]> git.sur5r.net Git - freertos/commitdiff
Add FreeRTOS-Plus directory with new directory structure so it matches the FreeRTOS...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 18 Apr 2013 09:17:05 +0000 (09:17 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 18 Apr 2013 09:17:05 +0000 (09:17 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1873 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

528 files changed:
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/CLI-commands.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/CLI-commands.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOS_Plus_CLI_with_Trace.sln [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/READ_ME.url [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Run-time-stats-utils.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcPort.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/UDPCommandServer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.filters [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.user [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOS_Plus_CyaSSL.sln [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/READ_ME.url [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPServerTask.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.filters [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.user [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/ca-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/main.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.cproject [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.project [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.cdt.codan.core.prefs [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.ltk.core.refactoring.prefs [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CLI-commands.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/USB_CDC/CDCCommandConsole.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/CDCCommandConsole.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/DemoIPTrace.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/TwoEchoClients.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Flash_map.xml [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSIPConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOS_UDP_Demo Debug.launch [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/LEDs.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/README_FIRST.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/RunTimeStatsTimer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/CMSIS END USER LICENCE AGREEMENT.pdf [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/cmsis_readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/LPC1800CMSIS_ReleaseNotes.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cm3.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmFunc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmInstr.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/debug_frmwrk.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_adc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_atimer.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_can.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_cgu.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_clkpwr.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_dac.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_emc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_evrt.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpdma.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpio.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2c.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2s.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_lcd.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_libcfg_default.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_mcpwm.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_nvic.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_pwr.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_qei.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rgu.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rit.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rtc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_sct.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_scu.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_ssp.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_timer.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_uart.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_utils.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_wwdt.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc_types.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/spifi_rom_api.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/system_LPC18xx.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/debug_frmwrk.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_adc.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_atimer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_can.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_cgu.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_dac.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_emc.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_evrt.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpdma.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpio.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2c.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2s.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_lcd.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_libcfg_default.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_mcpwm.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_nvic.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_pwr.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_qei.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rgu.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rit.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rtc.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_sct.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_scu.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_ssp.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_timer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_uart.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_utils.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_wwdt.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/system_LPC18xx.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/Readme Config.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcPort.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcBase.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcHooks.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcKernel.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcPort.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcTypes.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcUser.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/debugger trace upload.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcBase.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcKernel.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcPort.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcUser.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/cdcuser.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdcuser.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/lpc43xx_libcfg.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usb.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcfg.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcore.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbdesc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbhw.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbuser.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom-win7.inf [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom.inf [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbcore.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbdesc.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbuser.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/main.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/printf-stdarg.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/trcConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SelectServer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SimpleClientAndServer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/UDPCommandServer.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SelectServer.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SimpleClientAndServer.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/UDPCommandInterpreter.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSIPConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOS_Plus_UDP_with_CLI.sln [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/READ_ME.url [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/Run-time-stats-utils.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.filters [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.user [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Packet32.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/PacketData.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Win32-Extensions.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/arch.c [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/bittypes.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/ip6_misc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/netif.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-bpf.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-namedb.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-stdinc.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bluetooth.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bpf.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/namedb.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/sll.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/usb.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/vlan.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/remote-ext.h [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/wpcap.lib [new file with mode: 0644]
FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/main.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/AUTHORS [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/COPYING [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ChangeLog [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/LICENSE_INFORMATION.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/Makefile.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/Makefile.in [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/NEWS [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/README [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ReadMeFirst.url [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/aclocal.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ca-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-ecc-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-key.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/client-keyEnc.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/cliCrl.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.revoked [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccCliCRL.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccSrvCRL.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/crl/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/dsa2048.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ecc-client-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ecc-keyPkcs8.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ntru-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/ntru-key.raw [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/rsa2048.der [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-cert.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc-rsa.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-key.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-keyEnc.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc12.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc2.pem [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/certs/taoCert.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config.in [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/compile [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/config.guess [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/config.sub [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/depcomp [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/install-sh [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/ltmain.sh [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/config/missing [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/configure [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/configure.ac [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes_asm.s [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/arc4.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asm.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asn.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/coding.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/des3.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dh.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dsa.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc_fp.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mont_small.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_12.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_17.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_20.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_24.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_28.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_3.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_32.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_4.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_48.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_6.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_64.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_7.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_8.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_9.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_small_set.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_12.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_17.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_20.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_24.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_28.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_3.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_32.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_4.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_48.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_6.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_64.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_7.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_8.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_9.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_small_set.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hc128.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hmac.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/integer.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/logging.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md2.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md4.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md5.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/memory.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/misc.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/pwdbased.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rabbit.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/random.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ripemd.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rsa.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha256.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha512.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/tfm.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl-iphone.xcodeproj/project.pbxproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/callbacks.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/crl.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/aes.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/arc4.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn_public.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/coding.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/des3.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dh.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dsa.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ecc.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/error.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hc128.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hmac.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/integer.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/logging.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md2.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md4.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md5.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/memory.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/misc.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_class.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_superclass.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/pwdbased.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rabbit.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/random.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ripemd.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rsa.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/settings.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha256.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha512.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/tfm.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/types.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/visibility.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/error.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/internal.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ocsp.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/asn1.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bio.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bn.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/conf.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/crypto.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/des.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dh.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dsa.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ec.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ecdsa.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/engine.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/err.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/evp.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/hmac.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/lhash.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md4.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md5.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ocsp.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslconf.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslv.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ossl_typ.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pem.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pkcs12.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rand.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ripemd.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rsa.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/sha.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ssl.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/stack.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ui.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509v3.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.rc [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/ssl.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/test.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h.in [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/doc/README.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/doc/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/client/client-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/client/client.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/client/client.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/client/client.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/client/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/server/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/server/server-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/server/server.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/server/server.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/examples/server/server.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/input [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/lib/dummy [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/ax_pthread.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/hexversion.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/lib_socket_nsl.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/libtool.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/ltoptions.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/ltsugar.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/ltversion.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/lt~obsolete.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/m4/visibility.m4 [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/quit [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/crl.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/internal.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/io.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/keys.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/ocsp.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/sniffer.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/ssl.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/src/tls.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSniffer.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/snifftest.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/sslSniffTest.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/stamp-h.in [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/support/libcyassl.pc.in [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/PythonBuild.sh [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/README [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/cyassl.i [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/cyassl_adds.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/python_cyassl.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/rsasign.py [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/swig/runme.py [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/api.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/hash.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/suites.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-ecc.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-openssl.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-dtls.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-ecc.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-hc128.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-ntru.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-openssl.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test-psk.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/test.conf [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/unit.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/tests/unit.h [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/testsuite/include.am [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite-ntru.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.c [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.sln [new file with mode: 0644]
FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.vcproj [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/History.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/LICENSE_INFORMATION.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/ReadMe.url [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/LinkToDemo.url [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/Readme Config.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcConfig.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcPort.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcBase.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcHooks.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernel.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTypes.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcUser.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/ReadMe.url [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/debugger trace upload.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcBase.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernel.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcPort.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcUser.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DHCP.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DNS.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/History.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/ReadMe.url [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOSIPConfigDefaults.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DHCP.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DNS.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_IP_Private.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_Sockets.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_UDP_IP.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/IPTraceMacroDefaults.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkBufferManagement.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkInterface.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_1.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_2.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_end.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_start.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_end.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_start.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_end.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_start.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC17xx/NetworkInterface.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/NetworkInterface.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.h [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SH2A/NetworkInterface.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/WinPCap/NetworkInterface.c [new file with mode: 0644]
FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/readme.txt [new file with mode: 0644]
FreeRTOS-Plus/Source/WebDocs.url [new file with mode: 0644]
FreeRTOS-Plus/Source/readme.txt [new file with mode: 0644]

diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/CLI-commands.c b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/CLICommands/CLI-commands.c
new file mode 100644 (file)
index 0000000..a143eb6
--- /dev/null
@@ -0,0 +1,676 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+ /******************************************************************************\r
+ *\r
+ * See the following URL for information on the commands defined in this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+/* FreeRTOS+CLI includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+/* FreeRTOS+UDP includes, just to make the stats available to the CLI\r
+commands. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+#ifndef  configINCLUDE_TRACE_RELATED_CLI_COMMANDS\r
+       #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0\r
+#endif\r
+\r
+\r
+/*\r
+ * Implements the run-time-stats command.\r
+ */\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the task-stats command.\r
+ */\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the echo-three-parameters command.\r
+ */\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the echo-parameters command.\r
+ */\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that prints out IP address information.\r
+ */\r
+static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that prints out the gathered demo debug stats.\r
+ */\r
+static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that sends an ICMP ping request to an IP address.\r
+ */\r
+static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the "trace start" and "trace stop" commands;\r
+ */\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+#endif\r
+\r
+/* Structure that defines the "ip-config" command line command. */\r
+static const CLI_Command_Definition_t xIPConfig =\r
+{\r
+       ( const int8_t * const ) "ip-config",\r
+       ( const int8_t * const ) "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
+       prvDisplayIPConfig,\r
+       0\r
+};\r
+\r
+#if configINCLUDE_DEMO_DEBUG_STATS != 0\r
+       /* Structure that defines the "ip-debug-stats" command line command. */\r
+       static const CLI_Command_Definition_t xIPDebugStats =\r
+       {\r
+               ( const int8_t * const ) "ip-debug-stats", /* The command string to type. */\r
+               ( const int8_t * const ) "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
+               prvDisplayIPDebugStats, /* The function to run. */\r
+               0 /* No parameters are expected. */\r
+       };\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
+\r
+/* Structure that defines the "run-time-stats" command line command.   This\r
+generates a table that shows how much run time each task has */\r
+static const CLI_Command_Definition_t xRunTimeStats =\r
+{\r
+       ( const int8_t * const ) "run-time-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
+       prvRunTimeStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "task-stats" command line command.  This generates\r
+a table that gives information on each task in the system. */\r
+static const CLI_Command_Definition_t xTaskStats =\r
+{\r
+       ( const int8_t * const ) "task-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
+       prvTaskStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "echo_3_parameters" command line command.  This\r
+takes exactly three parameters that the command simply echos back one at a\r
+time. */\r
+static const CLI_Command_Definition_t xThreeParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo-3-parameters",\r
+       ( const int8_t * const ) "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
+       prvThreeParameterEchoCommand, /* The function to run. */\r
+       3 /* Three parameters are expected, which can take any value. */\r
+};\r
+\r
+/* Structure that defines the "echo_parameters" command line command.  This\r
+takes a variable number of parameters that the command simply echos back one at\r
+a time. */\r
+static const CLI_Command_Definition_t xParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo-parameters",\r
+       ( const int8_t * const ) "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
+       prvParameterEchoCommand, /* The function to run. */\r
+       -1 /* The user can enter any number of commands. */\r
+};\r
+\r
+#if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+\r
+       /* Structure that defines the "ping" command line command.  This takes an IP\r
+       address or host name and (optionally) the number of bytes to ping as\r
+       parameters. */\r
+       static const CLI_Command_Definition_t xPing =\r
+       {\r
+               ( const int8_t * const ) "ping",\r
+               ( const int8_t * const ) "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
+               prvPingCommand, /* The function to run. */\r
+               -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */\r
+       };\r
+\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       /* Structure that defines the "trace" command line command.  This takes a single\r
+       parameter, which can be either "start" or "stop". */\r
+       static const CLI_Command_Definition_t xStartStopTrace =\r
+       {\r
+               ( const int8_t * const ) "trace",\r
+               ( const int8_t * const ) "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
+               prvStartStopTraceCommand, /* The function to run. */\r
+               1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
+       };\r
+#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vRegisterCLICommands( void )\r
+{\r
+       /* Register all the command line commands defined immediately above. */\r
+       FreeRTOS_CLIRegisterCommand( &xTaskStats );\r
+       FreeRTOS_CLIRegisterCommand( &xRunTimeStats );\r
+       FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xIPDebugStats );\r
+       FreeRTOS_CLIRegisterCommand( &xIPConfig );\r
+\r
+       #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+       {\r
+               FreeRTOS_CLIRegisterCommand( &xPing );\r
+       }\r
+       #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+       #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+               FreeRTOS_CLIRegisterCommand( & xStartStopTrace );\r
+       #endif\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE xParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The three parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &xParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* Return the parameter string. */\r
+               memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+               sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+               strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+               strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+               /* If this is the last of the three parameters then there are no more\r
+               strings to return after this one. */\r
+               if( lParameterNumber == 3L )\r
+               {\r
+                       /* If this is the last of the three parameters then there are no more\r
+                       strings to return after this one. */\r
+                       xReturn = pdFALSE;\r
+                       lParameterNumber = 0L;\r
+               }\r
+               else\r
+               {\r
+                       /* There are more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE xParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &xParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               if( pcParameter != NULL )\r
+               {\r
+                       /* Return the parameter string. */\r
+                       memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+                       sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+                       strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+                       strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+                       /* There might be more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+               else\r
+               {\r
+                       /* No more parameters were found.  Make sure the write buffer does\r
+                       not contain a valid string. */\r
+                       pcWriteBuffer[ 0 ] = 0x00;\r
+\r
+                       /* No more data to return. */\r
+                       xReturn = pdFALSE;\r
+\r
+                       /* Start over the next time this command is executed. */\r
+                       lParameterNumber = 0;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+\r
+       static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       int8_t * pcParameter;\r
+       portBASE_TYPE lParameterStringLength, xReturn;\r
+       uint32_t ulIPAddress, ulBytesToPing;\r
+       const uint32_t ulDefaultBytesToPing = 8UL;\r
+       int8_t cBuffer[ 16 ];\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               /* Start with an empty string. */\r
+               pcWriteBuffer[ 0 ] = 0x00;\r
+\r
+               /* Obtain the number of bytes to ping. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               2,                                              /* Return the second parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               if( pcParameter == NULL )\r
+               {\r
+                       /* The number of bytes was not specified, so default it. */\r
+                       ulBytesToPing = ulDefaultBytesToPing;\r
+               }\r
+               else\r
+               {\r
+                       ulBytesToPing = atol( ( const char * ) pcParameter );\r
+               }\r
+\r
+               /* Obtain the IP address string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               1,                                              /* Return the first parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* Attempt to obtain the IP address.   If the first character is not a\r
+               digit, assume the host name has been passed in. */\r
+               if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )\r
+               {\r
+                       ulIPAddress = FreeRTOS_inet_addr( ( const uint8_t * ) pcParameter );\r
+               }\r
+               else\r
+               {\r
+                       /* Terminate the host name. */\r
+                       pcParameter[ lParameterStringLength ] = 0x00;\r
+\r
+                       /* Attempt to resolve host. */\r
+                       ulIPAddress = FreeRTOS_gethostbyname( ( uint8_t * ) pcParameter );\r
+               }\r
+\r
+               /* Convert IP address, which may have come from a DNS lookup, to string. */\r
+               FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer );\r
+\r
+               if( ulIPAddress != 0 )\r
+               {\r
+                       xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );\r
+               }\r
+               else\r
+               {\r
+                       xReturn = pdFALSE;\r
+               }\r
+\r
+               if( xReturn == pdFALSE )\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
+               }\r
+               else\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
+               }\r
+\r
+               return pdFALSE;\r
+       }\r
+       /*-----------------------------------------------------------*/\r
+\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+#if configINCLUDE_DEMO_DEBUG_STATS != 0\r
+\r
+       static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       static portBASE_TYPE xIndex = -1;\r
+       extern xExampleDebugStatEntry_t xIPTraceValues[];\r
+       portBASE_TYPE xReturn;\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               xIndex++;\r
+\r
+               if( xIndex < xExampleDebugStatEntries() )\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
+                       xReturn = pdPASS;\r
+               }\r
+               else\r
+               {\r
+                       /* Reset the index for the next time it is called. */\r
+                       xIndex = -1;\r
+\r
+                       /* Ensure nothing remains in the write buffer. */\r
+                       pcWriteBuffer[ 0 ] = 0x00;\r
+                       xReturn = pdFALSE;\r
+               }\r
+\r
+               return xReturn;\r
+       }\r
+       /*-----------------------------------------------------------*/\r
+\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
+\r
+static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+static portBASE_TYPE xIndex = 0;\r
+portBASE_TYPE xReturn;\r
+uint32_t ulAddress;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       switch( xIndex )\r
+       {\r
+               case 0 :\r
+                       FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nIP address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 1 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nNet mask " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 2 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nGateway address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 3 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nDNS server address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               default :\r
+                       ulAddress = 0;\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\n\r\n" );\r
+                       xReturn = pdFALSE;\r
+                       xIndex = 0;\r
+                       break;\r
+       }\r
+\r
+       if( ulAddress != 0 )\r
+       {\r
+               FreeRTOS_inet_ntoa( ulAddress, ( ( char * ) &( pcWriteBuffer[ strlen( ( char * ) pcWriteBuffer ) ] ) ) );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+\r
+       static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       int8_t *pcParameter;\r
+       portBASE_TYPE lParameterStringLength;\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               1,                                              /* Return the first parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* There are only two valid parameter values. */\r
+               if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+               {\r
+                       /* Start or restart the trace. */\r
+                       vTraceStop();\r
+                       vTraceClear();\r
+                       vTraceStart();\r
+\r
+                       sprintf( ( char * ) pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
+               }\r
+               else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+               {\r
+                       /* End the trace, if one is running. */\r
+                       vTraceStop();\r
+                       sprintf( ( char * ) pcWriteBuffer, "Stopping trace recording.\r\n" );\r
+               }\r
+               else\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
+               }\r
+\r
+               /* There is no more data to return after this single string, so return\r
+               pdFALSE. */\r
+               return pdFALSE;\r
+       }\r
+\r
+#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r
diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.c b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.c
new file mode 100644 (file)
index 0000000..728e7b8
--- /dev/null
@@ -0,0 +1,411 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+\r
+/******************************************************************************\r
+ *\r
+ * See the following web page for essential TwoEchoClient.c usage and \r
+ * configuration details:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Common_Echo_Clients.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+/* Small delay used between attempts to obtain a zero copy buffer. */\r
+#define echoTINY_DELAY ( ( portTickType ) 2 )\r
+\r
+/* The echo tasks create a socket, send out a number of echo requests\r
+(listening for each echo reply), then close the socket again before\r
+starting over.  This delay is used between each iteration to ensure the\r
+network does not get too congested.  The delay is shorter when the Windows\r
+simulator is used because simulated time is slower than real time. */\r
+#ifdef _WINDOWS_\r
+       #define echoLOOP_DELAY  ( ( portTickType ) 10 / portTICK_RATE_MS )\r
+#else\r
+       #define echoLOOP_DELAY  ( ( portTickType ) 150 / portTICK_RATE_MS )\r
+#endif /* _WINDOWS_ */\r
+\r
+#if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1\r
+       /* When the trace recorder code is included user events are generated to\r
+       mark the sending and receiving of the echoed data (only in the zero copy\r
+       task. */\r
+       #define echoMARK_SEND_IN_TRACE_BUFFER( x ) vTraceUserEvent( x )\r
+       traceLabel xZeroCopySendEvent, xZeroCopyReceiveEvent;\r
+\r
+#else\r
+       /* When the trace recorder code is not included just #define away the call\r
+       to post the user event. */\r
+       #define echoMARK_SEND_IN_TRACE_BUFFER( x )\r
+       #define xZeroCopySendEvent 0\r
+       #define xZeroCopyReceiveEvent 0\r
+#endif\r
+\r
+/* The echo server is assumed to be on port 7, which is the standard echo\r
+protocol port. */\r
+#define echoECHO_PORT  ( 7 )\r
+\r
+/*\r
+ * Uses a socket to send data to, then receive data from, the standard echo\r
+ * port number 7.  prvEchoClientTask() uses the standard interface.\r
+ * prvZeroCopyEchoClientTask() uses the zero copy interface.\r
+ */\r
+static void prvEchoClientTask( void *pvParameters );\r
+static void prvZeroCopyEchoClientTask( void *pvParameters );\r
+\r
+/* The receive timeout is set shorter when the windows simulator is used\r
+because simulated time is slower than real time. */\r
+#ifdef _WINDOWS_\r
+       const portTickType xReceiveTimeOut = 50 / portTICK_RATE_MS;\r
+#else\r
+       const portTickType xReceiveTimeOut = 500 / portTICK_RATE_MS;\r
+#endif\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority )\r
+{\r
+       /* Create the echo client task that does not use the zero copy interface. */\r
+       xTaskCreate(    prvEchoClientTask,                                              /* The function that implements the task. */\r
+                                       ( const signed char * const ) "Echo0",  /* Just a text name for the task to aid debugging. */\r
+                                       usTaskStackSize,                                                /* The stack size is defined in FreeRTOSIPConfig.h. */\r
+                                       NULL,                                                                   /* The task parameter, not used in this case. */\r
+                                       uxTaskPriority,                                                 /* The priority assigned to the task is defined in FreeRTOSConfig.h. */\r
+                                       NULL );                                                                 /* The task handle is not used. */\r
+\r
+       /* Create the echo client task that does use the zero copy interface. */\r
+       xTaskCreate(    prvZeroCopyEchoClientTask,                              /* The function that implements the task. */\r
+                                       ( const signed char * const ) "Echo1",  /* Just a text name for the task to aid debugging. */\r
+                                       usTaskStackSize,                                                /* The stack size is defined in FreeRTOSIPConfig.h. */\r
+                                       NULL,                                                                   /* The task parameter, not used in this case. */\r
+                                       uxTaskPriority,                                                 /* The priority assigned to the task is defined in FreeRTOSConfig.h. */\r
+                                       NULL );                                                                 /* The task handle is not used. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvEchoClientTask( void *pvParameters )\r
+{\r
+xSocket_t xSocket;\r
+struct freertos_sockaddr xEchoServerAddress;\r
+int8_t cTxString[ 25 ], cRxString[ 25 ]; /* Make sure the stack is large enough to hold these.  Turn on stack overflow checking during debug to be sure. */\r
+int32_t lLoopCount = 0UL;\r
+const int32_t lMaxLoopCount = 50;\r
+volatile uint32_t ulRxCount = 0UL, ulTxCount = 0UL;\r
+uint32_t xAddressLength = sizeof( xEchoServerAddress );\r
+\r
+       /* Remove compiler warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Echo requests are sent to the echo server.  The address of the echo\r
+       server is configured by the constants configECHO_SERVER_ADDR0 to\r
+       configECHO_SERVER_ADDR3 in FreeRTOSConfig.h. */\r
+       xEchoServerAddress.sin_port = FreeRTOS_htons( echoECHO_PORT );\r
+       xEchoServerAddress.sin_addr = FreeRTOS_inet_addr_quick( configECHO_SERVER_ADDR0,\r
+                                                                                                                       configECHO_SERVER_ADDR1,\r
+                                                                                                                       configECHO_SERVER_ADDR2,\r
+                                                                                                                       configECHO_SERVER_ADDR3 );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Create a socket. */\r
+               xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( xSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+               /* Set a time out so a missing reply does not cause the task to block\r
+               indefinitely. */\r
+               FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, &xReceiveTimeOut, sizeof( xReceiveTimeOut ) );\r
+\r
+               /* Send a number of echo requests. */\r
+               for( lLoopCount = 0; lLoopCount < lMaxLoopCount; lLoopCount++ )\r
+               {\r
+                       /* Create the string that is sent to the echo server. */\r
+                       sprintf( ( char * ) cTxString, "Message number %u\r\n", ulTxCount );\r
+\r
+                       /* Send the string to the socket.  ulFlags is set to 0, so the zero\r
+                       copy interface is not used.  That means the data from cTxString is\r
+                       copied into a network buffer inside FreeRTOS_sendto(), and cTxString\r
+                       can be reused as soon as FreeRTOS_sendto() has returned.  1 is added\r
+                       to ensure the NULL string terminator is sent as part of the message. */\r
+                       FreeRTOS_sendto( xSocket,                               /* The socket being sent to. */\r
+                                                       ( void * ) cTxString,   /* The data being sent. */\r
+                                                       strlen( ( const char * ) cTxString ) + 1, /* The length of the data being sent. */\r
+                                                       0,                                              /* ulFlags with the FREERTOS_ZERO_COPY bit clear. */\r
+                                                       &xEchoServerAddress,    /* The destination address. */\r
+                                                       sizeof( xEchoServerAddress ) );\r
+\r
+                       /* Keep a count of how many echo requests have been transmitted so\r
+                       it can be compared to the number of echo replies received.  It would\r
+                       be expected to loose at least one to an ARP message the first time\r
+                       the     connection is created. */\r
+                       ulTxCount++;\r
+\r
+                       /* Receive data echoed back to the socket.  ulFlags is zero, so the\r
+                       zero copy option is not being used and the received data will be\r
+                       copied into the buffer pointed to by cRxString.  xAddressLength is\r
+                       not actually used (at the time of writing this comment, anyway) by\r
+                       FreeRTOS_recvfrom(), but is set appropriately in case future\r
+                       versions do use it. */\r
+                       memset( ( void * ) cRxString, 0x00, sizeof( cRxString ) );\r
+                       FreeRTOS_recvfrom(      xSocket,                                /* The socket being received from. */\r
+                                                               cRxString,                              /* The buffer into which the received data will be written. */\r
+                                                               sizeof( cRxString ),    /* The size of the buffer provided to receive the data. */\r
+                                                               0,                                              /* ulFlags with the FREERTOS_ZERO_COPY bit clear. */\r
+                                                               &xEchoServerAddress,    /* The address from where the data was sent (the source address). */\r
+                                                               &xAddressLength );\r
+\r
+                       /* Compare the transmitted string to the received string. */\r
+                       if( strcmp( ( char * ) cRxString, ( char * ) cTxString ) == 0 )\r
+                       {\r
+                               /* The echo reply was received without error. */\r
+                               ulRxCount++;\r
+                       }\r
+               };\r
+\r
+               /* Pause for a short while to ensure the network is not too\r
+               congested. */\r
+               vTaskDelay( echoLOOP_DELAY );\r
+\r
+               /* Close this socket before looping back to create another. */\r
+               FreeRTOS_closesocket( xSocket );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvZeroCopyEchoClientTask( void *pvParameters )\r
+{\r
+xSocket_t xSocket;\r
+struct freertos_sockaddr xEchoServerAddress;\r
+static int8_t cTxString[ 40 ];\r
+int32_t lLoopCount = 0UL;\r
+volatile uint32_t ulRxCount = 0UL, ulTxCount = 0UL;\r
+uint32_t xAddressLength = sizeof( xEchoServerAddress );\r
+int32_t lReturned;\r
+uint8_t *pucUDPPayloadBuffer;\r
+\r
+const int32_t lMaxLoopCount = 50;\r
+const uint8_t * const pucStringToSend = ( const uint8_t * const ) "Zero copy message number";\r
+/* The buffer is large enough to hold the string, a number, and the string terminator. */\r
+const size_t xBufferLength = strlen( ( char * ) pucStringToSend ) + 15;\r
+\r
+       #if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1\r
+       {\r
+               /* When the trace recorder code is included user events are generated to\r
+               mark the sending and receiving of the echoed data (only in the zero copy\r
+               task). */\r
+               xZeroCopySendEvent = xTraceOpenLabel( "ZeroCopyTx" );\r
+               xZeroCopyReceiveEvent = xTraceOpenLabel( "ZeroCopyRx" );\r
+       }\r
+       #endif /* ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS */\r
+\r
+       /* Remove compiler warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Delay for a little while to ensure the task is out of synch with the\r
+       other echo task implemented above. */\r
+       vTaskDelay( echoLOOP_DELAY >> 1 );\r
+\r
+       /* Echo requests are sent to the echo server.  The address of the echo\r
+       server is configured by the constants configECHO_SERVER_ADDR0 to\r
+       configECHO_SERVER_ADDR3 in FreeRTOSConfig.h. */\r
+       xEchoServerAddress.sin_port = FreeRTOS_htons( echoECHO_PORT );\r
+       xEchoServerAddress.sin_addr = FreeRTOS_inet_addr_quick( configECHO_SERVER_ADDR0,\r
+                                                                                                                       configECHO_SERVER_ADDR1,\r
+                                                                                                                       configECHO_SERVER_ADDR2,\r
+                                                                                                                       configECHO_SERVER_ADDR3 );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Create a socket. */\r
+               xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( xSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+               /* Set a time out so a missing reply does not cause the task to block\r
+               indefinitely. */\r
+               FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, &xReceiveTimeOut, sizeof( xReceiveTimeOut ) );\r
+\r
+               /* Send a number of echo requests. */\r
+               for( lLoopCount = 0; lLoopCount < lMaxLoopCount; lLoopCount++ )\r
+               {\r
+                       /* This task is going to send using the zero copy interface.  The\r
+                       data being sent is therefore written directly into a buffer that is\r
+                       passed by reference into the FreeRTOS_sendto() function.  First\r
+                       obtain a buffer of adequate size from the IP stack.  Although a max\r
+                       delay is used, the actual delay will be capped to\r
+                       ipconfigMAX_SEND_BLOCK_TIME_TICKS, hence the test to ensure a buffer\r
+                       was actually obtained. */\r
+                       pucUDPPayloadBuffer = ( uint8_t * ) FreeRTOS_GetUDPPayloadBuffer( xBufferLength, portMAX_DELAY );\r
+\r
+                       if( pucUDPPayloadBuffer != NULL )\r
+                       {\r
+                               /* A buffer was successfully obtained.  Create the string that is\r
+                               sent to the echo server.  Note the string is written directly\r
+                               into the buffer obtained from the IP stack. */\r
+                               sprintf( ( char * ) pucUDPPayloadBuffer, "%s %u\r\n", ( const char * ) "Zero copy message number", ulTxCount );\r
+\r
+                               /* Also copy the string into a local buffer so it can be compared\r
+                               with the string that is later received back from the echo server. */\r
+                               strcpy( ( char * ) cTxString, ( char * ) pucUDPPayloadBuffer );\r
+\r
+                               /* Pass the buffer into the send function.  ulFlags has the\r
+                               FREERTOS_ZERO_COPY bit set so the IP stack will take control of\r
+                               the     buffer, rather than copy data out of the buffer. */\r
+                               echoMARK_SEND_IN_TRACE_BUFFER( xZeroCopySendEvent );\r
+                               lReturned = FreeRTOS_sendto(    xSocket,                                        /* The socket being sent to. */\r
+                                                                                               ( void * ) pucUDPPayloadBuffer, /* The buffer being passed into the IP stack. */\r
+                                                                                               strlen( ( const char * ) cTxString ) + 1, /* The length of the data being sent.  Plus 1 to ensure the null terminator is part of the data. */\r
+                                                                                               FREERTOS_ZERO_COPY,                     /* ulFlags with the zero copy bit is set. */\r
+                                                                                               &xEchoServerAddress,            /* Where the data is being sent. */\r
+                                                                                               sizeof( xEchoServerAddress ) );\r
+\r
+                               if( lReturned == 0 )\r
+                               {\r
+                                       /* The send operation failed, so this task is still\r
+                                       responsible     for the buffer obtained from the IP stack.  To\r
+                                       ensure the buffer is not lost it must either be used again,\r
+                                       or, as in this case, returned to the IP stack using\r
+                                       FreeRTOS_ReleaseUDPPayloadBuffer().  pucUDPPayloadBuffer can\r
+                                       be safely re-used to receive from the socket below once the\r
+                                       buffer has been returned to the stack. */\r
+                                       FreeRTOS_ReleaseUDPPayloadBuffer( ( void * ) pucUDPPayloadBuffer );\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* The send was successful so the IP stack is now managing\r
+                                       the     buffer pointed to by pucUDPPayloadBuffer, and the IP\r
+                                       stack will return the buffer once it has been sent.\r
+                                       pucUDPPayloadBuffer can be safely re-used to receive from\r
+                                       the socket below. */\r
+                               }\r
+\r
+                               /* Keep a count of how many echo requests have been transmitted\r
+                               so it can be compared to the number of echo replies received.\r
+                               It would be expected to loose at least one to an ARP message the\r
+                               first time the connection is created. */\r
+                               ulTxCount++;\r
+\r
+                               /* Receive data on the socket.  ulFlags has the zero copy bit set\r
+                               (FREERTOS_ZERO_COPY) indicating to the stack that a reference to\r
+                               the     received data should be passed out to this task using the\r
+                               second parameter to the FreeRTOS_recvfrom() call.  When this is\r
+                               done the IP stack is no longer responsible for releasing the\r
+                               buffer, and     the task *must* return the buffer to the stack when\r
+                               it is no longer needed.  By default the receive block time is\r
+                               portMAX_DELAY. */\r
+                               echoMARK_SEND_IN_TRACE_BUFFER( xZeroCopyReceiveEvent );\r
+                               lReturned = FreeRTOS_recvfrom(  xSocket,                                        /* The socket to receive from. */\r
+                                                                                               ( void * ) &pucUDPPayloadBuffer,  /* pucUDPPayloadBuffer will be set to point to the buffer that already contains the received data. */\r
+                                                                                               0,                                                      /* Ignored because the zero copy interface is being used. */\r
+                                                                                               FREERTOS_ZERO_COPY,                     /* ulFlags with the FREERTOS_ZERO_COPY bit set. */\r
+                                                                                               &xEchoServerAddress,            /* The address from which the data was sent. */\r
+                                                                                               &xAddressLength );\r
+\r
+                               if( lReturned > 0 )\r
+                               {\r
+                                       /* Compare the string sent to the echo server with the string\r
+                                       received back from the echo server. */\r
+                                       if( strcmp( ( char * ) pucUDPPayloadBuffer, ( char * ) cTxString ) == 0 )\r
+                                       {\r
+                                               /* The strings matched. */\r
+                                               ulRxCount++;\r
+                                       }\r
+\r
+                                       /* The buffer that contains the data passed out of the stack\r
+                                       *must* be returned to the stack. */\r
+                                       FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );\r
+                               }\r
+                       }\r
+               }\r
+\r
+               /* Pause for a short while to ensure the network is not too\r
+               congested. */\r
+               vTaskDelay( echoLOOP_DELAY );\r
+\r
+               /* Close this socket before looping back to create another. */\r
+               FreeRTOS_closesocket( xSocket );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.h b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/EchoClients/TwoEchoClients.h
new file mode 100644 (file)
index 0000000..cbff482
--- /dev/null
@@ -0,0 +1,85 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef TWO_ECHO_CLIENTS_H\r
+#define TWO_ECHO_CLIENTS_H\r
+\r
+/*\r
+ * Create the two UDP echo client tasks.  One task uses the standard interface\r
+ * to send to and receive from an echo server.  The other task uses the zero\r
+ * copy interface to send to and receive from an echo server.\r
+ */\r
+void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority );\r
+\r
+#endif /* TWO_ECHO_CLIENTS_H */\r
diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.c b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.c
new file mode 100644 (file)
index 0000000..4227e08
--- /dev/null
@@ -0,0 +1,196 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/* \r
+ * This file, along with DemoIPTrace.h, provides a basic example use of the\r
+ * FreeRTOS+UDP trace macros.  The statistics gathered here can be viewed in\r
+ * the command line interface.\r
+ * See http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */ \r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "DemoIPTrace.h"\r
+\r
+/* It is possible to remove the trace macros using the \r
+configINCLUDE_DEMO_DEBUG_STATS setting in FreeRTOSIPConfig.h. */\r
+#if configINCLUDE_DEMO_DEBUG_STATS == 1\r
+\r
+/*\r
+ * Each row in the xIPTraceValues[] table contains a pointer to a function that\r
+ * updates the value for that row.  Rows that latch the lowest value point to\r
+ * this function (for example, this function can be used to latch the lowest\r
+ * number of network buffers that were available during the execution of the\r
+ * stack).\r
+ */\r
+static void prvStoreLowest( uint32_t *pulCurrentValue, uint32_t ulCount );\r
+\r
+/*\r
+ * Each row in the xIPTraceValues[] table contains a pointer to a function that\r
+ * updates the value for that row.  Rows that simply increment an event count\r
+ * point to this function.\r
+ */\r
+static void prvIncrementEventCount( uint32_t *pulCurrentValue, uint32_t ulCount );\r
+\r
+\r
+xExampleDebugStatEntry_t xIPTraceValues[] =\r
+{\r
+       /* Comment out array entries to remove individual trace items. */\r
+\r
+       { iptraceID_NETWORK_BUFFER_OBTAINED,                    ( const uint8_t * const ) "Lowest ever available network buffers",                              prvStoreLowest, 0xffffUL },\r
+       { iptraceID_NETWORK_EVENT_RECEIVED,                             ( const uint8_t * const ) "Lowest ever free space in network event queue",              prvStoreLowest, 0xffffUL },\r
+       { iptraceID_FAILED_TO_OBTAIN_NETWORK_BUFFER,    ( const uint8_t * const ) "Count of failed attempts to obtain a network buffer",prvIncrementEventCount, 0 },\r
+       { iptraceID_ARP_TABLE_ENTRY_EXPIRED,                    ( const uint8_t * const ) "Count of expired ARP entries",                                               prvIncrementEventCount, 0 },\r
+       { iptraceID_PACKET_DROPPED_TO_GENERATE_ARP,             ( const uint8_t * const ) "Count of packets dropped to generate ARP",                   prvIncrementEventCount, 0 },\r
+       { iptraceID_FAILED_TO_CREATE_SOCKET,                    ( const uint8_t * const ) "Count of failures to create a socket",                               prvIncrementEventCount, 0 },\r
+       { iptraceID_RECVFROM_DISCARDING_BYTES,                  ( const uint8_t * const ) "Count of times recvfrom() has discarding bytes",             prvIncrementEventCount, 0 },\r
+       { iptraceID_ETHERNET_RX_EVENT_LOST,                             ( const uint8_t * const ) "Count of lost Ethenret Rx events (event queue full?)",prvIncrementEventCount, 0 },\r
+       { iptraceID_STACK_TX_EVENT_LOST,                                ( const uint8_t * const ) "Count of lost IP stack events (event queue full?)",  prvIncrementEventCount, 0 },\r
+       { ipconfigID_BIND_FAILED,                                               ( const uint8_t * const ) "Count of failed calls to bind()",                                    prvIncrementEventCount, 0 },\r
+       { iptraceID_NETWORK_INTERFACE_TRANSMIT,                 ( const uint8_t * const ) "Count of transmitted packets",                                               prvIncrementEventCount, 0 },\r
+       { iptraceID_RECVFROM_TIMEOUT,                                   ( const uint8_t * const ) "Count of receive timeouts",                                                  prvIncrementEventCount, 0 },\r
+       { iptraceID_SENDTO_DATA_TOO_LONG,                               ( const uint8_t * const ) "Count of failed sends due to oversized payload",             prvIncrementEventCount, 0 },\r
+       { iptraceID_SENDTO_SOCKET_NOT_BOUND,                    ( const uint8_t * const ) "Count of failed sends due to unbound socket",                prvIncrementEventCount, 0 },\r
+       { iptraceID_NO_BUFFER_FOR_SENDTO,                               ( const uint8_t * const ) "Count of failed transmits due to timeout",                   prvIncrementEventCount, 0 },\r
+       { iptraceID_WAIT_FOR_TX_DMA_DESCRIPTOR,                 ( const uint8_t * const ) "Number of times task had to wait to obtain a DMA Tx descriptor", prvIncrementEventCount, 0 },\r
+       { iptraceID_FAILED_TO_NOTIFY_SELECT_GROUP,              ( const uint8_t * const ) "Failed to notify select group",                                              prvIncrementEventCount, 0 }\r
+};\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xExampleDebugStatEntries( void )\r
+{\r
+       /* Return the number of entries in the xIPTraceValues[] table. */\r
+       return ( portBASE_TYPE ) ( sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t ) );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vExampleDebugStatUpdate( uint8_t ucIdentifier, uint32_t ulValue )\r
+{\r
+portBASE_TYPE xIndex;\r
+const portBASE_TYPE xEntries = sizeof( xIPTraceValues ) / sizeof( xExampleDebugStatEntry_t );\r
+\r
+       /* Update an entry in the xIPTraceValues[] table.  Each row in the table\r
+       includes a pointer to a function that performs the actual update.  This\r
+       function just executes the update function from that table row. */\r
+       for( xIndex = 0; xIndex < xEntries; xIndex++ )\r
+       {\r
+               if( xIPTraceValues[ xIndex ].ucIdentifier == ucIdentifier )\r
+               {\r
+                       xIPTraceValues[ xIndex ].vPerformAction( &( xIPTraceValues[ xIndex ].ulData ), ulValue );\r
+                       break;\r
+               }\r
+       }\r
+\r
+       configASSERT( xIndex != xEntries );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvIncrementEventCount( uint32_t *pulCurrentValue, uint32_t ulCount )\r
+{\r
+       /* Each row in the xIPTraceValues[] table contains a pointer to a function\r
+       that updates the value for that row.  Rows that simply increment an event\r
+       count point to this function. */\r
+       ( void ) ulCount;\r
+       ( *pulCurrentValue )++;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvStoreLowest( uint32_t *pulCurrentValue, uint32_t ulCount )\r
+{\r
+       /* Each row in the xIPTraceValues[] table contains a pointer to a function\r
+       that updates the value for that row.  Rows that latch the lowest value\r
+       point to this function (for example, this function can be used to latch\r
+       the lowest number of network buffers that were available during the\r
+       execution of the stack). */\r
+       if( ulCount < *pulCurrentValue )\r
+       {\r
+               *pulCurrentValue = ulCount;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS == 1 */\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.h b/FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_UDP_Demos/TraceMacros/Example1/DemoIPTrace.h
new file mode 100644 (file)
index 0000000..bd829f9
--- /dev/null
@@ -0,0 +1,164 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/*\r
+ * This file, along with DemoIPTrace.h, provides a basic example use of the\r
+ * FreeRTOS+UDP trace macros.  The statistics gathered here can be viewed in\r
+ * the command line interface.\r
+ * See http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml\r
+ */\r
+\r
+#ifndef DEMO_IP_TRACE_MACROS_H\r
+#define DEMO_IP_TRACE_MACROS_H\r
+\r
+typedef void ( *vTraceAction_t )( uint32_t *, uint32_t );\r
+\r
+/* Type that defines each statistic being gathered. */\r
+typedef struct ExampleDebugStatEntry\r
+{\r
+       uint8_t ucIdentifier;                                   /* Unique identifier for statistic. */\r
+       const uint8_t * const pucDescription;   /* Text description for the statistic. */\r
+       vTraceAction_t vPerformAction;                  /* Action to perform when the statistic is updated (increment counter, store minimum value, store maximum value, etc. */\r
+       uint32_t ulData;                                                /* The meaning of this data is dependent on the trace macro ID. */\r
+} xExampleDebugStatEntry_t;\r
+\r
+/* Unique identifiers used to locate the entry for each trace macro in the\r
+xIPTraceValues[] table defined in DemoIPTrace.c. */\r
+#define iptraceID_NETWORK_BUFFER_OBTAINED                                      1\r
+#define iptraceID_NETWORK_BUFFER_OBTAINED_FROM_ISR                     2\r
+#define iptraceID_NETWORK_EVENT_RECEIVED                                       3\r
+#define iptraceID_FAILED_TO_OBTAIN_NETWORK_BUFFER                      4\r
+#define iptraceID_ARP_TABLE_ENTRY_EXPIRED                                      5\r
+#define iptraceID_PACKET_DROPPED_TO_GENERATE_ARP                       6\r
+#define iptraceID_FAILED_TO_CREATE_SOCKET                                      7\r
+#define iptraceID_RECVFROM_DISCARDING_BYTES                                    8\r
+#define iptraceID_ETHERNET_RX_EVENT_LOST                                       9\r
+#define iptraceID_STACK_TX_EVENT_LOST                                          10\r
+#define ipconfigID_BIND_FAILED                                                         11\r
+#define iptraceID_NETWORK_INTERFACE_TRANSMIT                           12\r
+#define iptraceID_RECVFROM_TIMEOUT                                                     13\r
+#define iptraceID_SENDTO_DATA_TOO_LONG                                         14\r
+#define iptraceID_SENDTO_SOCKET_NOT_BOUND                                      15\r
+#define iptraceID_NO_BUFFER_FOR_SENDTO                                         16\r
+#define iptraceID_WAIT_FOR_TX_DMA_DESCRIPTOR                           17\r
+#define iptraceID_FAILED_TO_NOTIFY_SELECT_GROUP                                18\r
+\r
+/* It is possible to remove the trace macros using the\r
+configINCLUDE_DEMO_DEBUG_STATS setting in FreeRTOSIPConfig.h. */\r
+#if configINCLUDE_DEMO_DEBUG_STATS == 1\r
+\r
+       /* The trace macro definitions themselves.  Any trace macros left undefined\r
+       will default to be empty macros. */\r
+       #define iptraceNETWORK_BUFFER_OBTAINED( pxBufferAddress ) vExampleDebugStatUpdate( iptraceID_NETWORK_BUFFER_OBTAINED, uxQueueMessagesWaiting( ( xQueueHandle ) xNetworkBufferSemaphore ) )\r
+       #define iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR( pxBufferAddress ) vExampleDebugStatUpdate( iptraceID_NETWORK_BUFFER_OBTAINED, uxQueueMessagesWaiting( ( xQueueHandle ) xNetworkBufferSemaphore ) )\r
+\r
+       #define iptraceNETWORK_EVENT_RECEIVED( eEvent ) {                                                                                                                                                               \\r
+                                                                                                               uint16_t usSpace;                                                                                                                       \\r
+                                                                                                                       usSpace = ( uint16_t ) uxQueueMessagesWaiting( xNetworkEventQueue );    \\r
+                                                                                                                       /* Minus one as an event was removed before the space was queried. */   \\r
+                                                                                                                       usSpace = ( ipconfigEVENT_QUEUE_LENGTH - usSpace ) - 1;                                 \\r
+                                                                                                                       vExampleDebugStatUpdate( iptraceID_NETWORK_EVENT_RECEIVED, usSpace );   \\r
+                                                                                                               }\r
+\r
+       #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER()                                        vExampleDebugStatUpdate( iptraceID_FAILED_TO_OBTAIN_NETWORK_BUFFER, 0 )\r
+       #define iptraceARP_TABLE_ENTRY_EXPIRED( ulIPAddress )                           vExampleDebugStatUpdate( iptraceID_ARP_TABLE_ENTRY_EXPIRED, 0 )\r
+       #define iptracePACKET_DROPPED_TO_GENERATE_ARP( ulIPAddress )            vExampleDebugStatUpdate( iptraceID_PACKET_DROPPED_TO_GENERATE_ARP, 0 )\r
+       #define iptraceFAILED_TO_CREATE_SOCKET()                                                        vExampleDebugStatUpdate( iptraceID_FAILED_TO_CREATE_SOCKET, 0 )\r
+       #define iptraceRECVFROM_DISCARDING_BYTES( xNumberOfBytesDiscarded )     vExampleDebugStatUpdate( iptraceID_RECVFROM_DISCARDING_BYTES, 0 )\r
+       #define iptraceETHERNET_RX_EVENT_LOST()                                                         vExampleDebugStatUpdate( iptraceID_ETHERNET_RX_EVENT_LOST, 0 )\r
+       #define iptraceSTACK_TX_EVENT_LOST( xEvent )                                            vExampleDebugStatUpdate( iptraceID_STACK_TX_EVENT_LOST, 0 )\r
+       #define iptraceBIND_FAILED( xSocket, usPort )                                           vExampleDebugStatUpdate( ipconfigID_BIND_FAILED, 0 )\r
+       #define iptraceNETWORK_INTERFACE_TRANSMIT()                                                     vExampleDebugStatUpdate( iptraceID_NETWORK_INTERFACE_TRANSMIT, 0 )\r
+       #define iptraceRECVFROM_TIMEOUT()                                                                       vExampleDebugStatUpdate( iptraceID_RECVFROM_TIMEOUT, 0 )\r
+       #define iptraceSENDTO_DATA_TOO_LONG()                                                           vExampleDebugStatUpdate( iptraceID_SENDTO_DATA_TOO_LONG, 0 )\r
+       #define iptraceSENDTO_SOCKET_NOT_BOUND()                                                        vExampleDebugStatUpdate( iptraceID_SENDTO_SOCKET_NOT_BOUND, 0 )\r
+       #define iptraceNO_BUFFER_FOR_SENDTO()                                                           vExampleDebugStatUpdate( iptraceID_NO_BUFFER_FOR_SENDTO, 0 )\r
+       #define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR()                                          vExampleDebugStatUpdate( iptraceID_WAIT_FOR_TX_DMA_DESCRIPTOR, 0 )\r
+       #define iptraceFAILED_TO_NOTIFY_SELECT_GROUP( xSocket )                         vExampleDebugStatUpdate( iptraceID_FAILED_TO_NOTIFY_SELECT_GROUP, 0 )\r
+\r
+       /*\r
+        * The function that updates a line in the xIPTraceValues table.\r
+        */\r
+       void vExampleDebugStatUpdate( uint8_t ucIdentifier, uint32_t ulValue );\r
+\r
+       /*\r
+        * Returns the number of entries in the xIPTraceValues table.\r
+        */\r
+       portBASE_TYPE xExampleDebugStatEntries( void );\r
+\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS == 1 */\r
+\r
+\r
+#endif /* DEMO_IP_TRACE_MACROS_H */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/CLI-commands.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/CLI-commands.c
new file mode 100644 (file)
index 0000000..220580c
--- /dev/null
@@ -0,0 +1,396 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+CLI includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+/* FreeRTOS+Trace includes. */\r
+#include "trcUser.h"\r
+\r
+/*\r
+ * Defines a command that returns a table showing the state of each task at the\r
+ * time the command is called.\r
+ */\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that returns a table showing how much time each task has\r
+ * spent in the Running state.\r
+ */\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that expects exactly three parameters.  Each of the three\r
+ * parameter are echoed back one at a time.\r
+ */\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that can take a variable number of parameters.  Each \r
+ * parameter is echoes back one at a time.\r
+ */\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that starts/stops events being recorded for offline viewing \r
+ * in FreeRTOS+Trace.\r
+ */\r
+static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/* Structure that defines the "run-time-stats" command line command. */\r
+static const CLI_Command_Definition_t xRunTimeStats =\r
+{\r
+       ( const int8_t * const ) "run-time-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "\r\nrun-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
+       prvRunTimeStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "task-stats" command line command. */\r
+static const CLI_Command_Definition_t xTaskStats =\r
+{\r
+       ( const int8_t * const ) "task-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "\r\ntask-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
+       prvTaskStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "echo_3_parameters" command line command.  This \r
+takes exactly three parameters that the command simply echos back one at a \r
+time. */\r
+static const CLI_Command_Definition_t xThreeParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo_3_parameters",\r
+       ( const int8_t * const ) "\r\necho_3_parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
+       prvThreeParameterEchoCommand, /* The function to run. */\r
+       3 /* Three parameters are expected, which can take any value. */\r
+};\r
+\r
+/* Structure that defines the "echo_parameters" command line command.  This \r
+takes a variable number of parameters that the command simply echos back one at \r
+a time. */\r
+static const CLI_Command_Definition_t xParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo_parameters",\r
+       ( const int8_t * const ) "\r\necho_parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
+       prvParameterEchoCommand, /* The function to run. */\r
+       -1 /* The user can enter any number of commands. */\r
+};\r
+\r
+/* Structure that defines the "trace" command line command.  This takes a single\r
+parameter, which can be either "start" or "stop". */\r
+static const CLI_Command_Definition_t xStartTrace =\r
+{\r
+       ( const int8_t * const ) "trace",\r
+       ( const int8_t * const ) "\r\ntrace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
+       prvStartStopTraceCommand, /* The function to run. */\r
+       1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
+};\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vRegisterCLICommands( void )\r
+{\r
+       /* Register all the command line commands defined immediately above. */\r
+       FreeRTOS_CLIRegisterCommand( &xTaskStats );\r
+       FreeRTOS_CLIRegisterCommand( &xRunTimeStats );\r
+       FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xStartTrace );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the \r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the \r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE lParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the \r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The three parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       ( \r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* Return the parameter string. */\r
+               memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+               sprintf( ( char * ) pcWriteBuffer, "%d: ", lParameterNumber );\r
+               strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
+               strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+               /* If this is the last of the three parameters then there are no more\r
+               strings to return after this one. */\r
+               if( lParameterNumber == 3L )\r
+               {\r
+                       /* If this is the last of the three parameters then there are no more\r
+                       strings to return after this one. */\r
+                       xReturn = pdFALSE;\r
+                       lParameterNumber = 0L;\r
+               }\r
+               else\r
+               {\r
+                       /* There are more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE lParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the \r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       ( \r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               if( pcParameter != NULL )\r
+               {\r
+                       /* Return the parameter string. */\r
+                       memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+                       sprintf( ( char * ) pcWriteBuffer, "%d: ", lParameterNumber );\r
+                       strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, lParameterStringLength );\r
+                       strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+                       /* There might be more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+               else\r
+               {\r
+                       /* No more parameters were found.  Make sure the write buffer does\r
+                       not contain a valid string. */\r
+                       pcWriteBuffer[ 0 ] = 0x00;\r
+\r
+                       /* No more data to return. */\r
+                       xReturn = pdFALSE;\r
+\r
+                       /* Start over the next time this command is executed. */\r
+                       lParameterNumber = 0;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE lParameterStringLength;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the \r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Obtain the parameter string. */\r
+       pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                               ( \r
+                                                                       pcCommandString,                /* The command string itself. */\r
+                                                                       1,                                              /* Return the first parameter. */\r
+                                                                       &lParameterStringLength /* Store the parameter string length. */\r
+                                                               );\r
+\r
+       /* Sanity check something was returned. */\r
+       configASSERT( pcParameter );\r
+\r
+       /* There are only two valid parameter values. */\r
+       if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+       {\r
+               /* Start or restart the trace. */\r
+               vTraceStop();\r
+               vTraceClear();\r
+               vTraceStart();\r
+\r
+               sprintf( ( char * ) pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
+       }\r
+       else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+       {\r
+               /* End the trace, if one is running. */\r
+               vTraceStop();\r
+               sprintf( ( char * ) pcWriteBuffer, "Stopping trace recording.\r\n" );\r
+       }\r
+       else\r
+       {\r
+               sprintf( ( char * ) pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
+       }\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..92a64c4
--- /dev/null
@@ -0,0 +1,155 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
+ * http://www.freertos.org/a00110.html\r
+ *----------------------------------------------------------*/\r
+\r
+#define configUSE_PREEMPTION                   1\r
+#define configUSE_IDLE_HOOK                            1\r
+#define configUSE_TICK_HOOK                            0\r
+#define configTICK_RATE_HZ                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */\r
+#define configMAX_TASK_NAME_LEN                        ( 7 )\r
+#define configUSE_TRACE_FACILITY               1\r
+#define configUSE_16_BIT_TICKS                 0\r
+#define configIDLE_SHOULD_YIELD                        1\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configUSE_MUTEXES                              1\r
+#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */\r
+#define configUSE_RECURSIVE_MUTEXES            1\r
+#define configQUEUE_REGISTRY_SIZE              0\r
+#define configUSE_MALLOC_FAILED_HOOK   0\r
+#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_ALTERNATIVE_API              0\r
+\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              2\r
+#define configTIMER_QUEUE_LENGTH               20\r
+#define configTIMER_TASK_STACK_DEPTH   ( configMINIMAL_STACK_SIZE * 2 )\r
+\r
+#define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 7 )\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+\r
+/* Co-routine definitions. */\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero\r
+to exclude the API function. */\r
+\r
+#define INCLUDE_vTaskPrioritySet                       1\r
+#define INCLUDE_uxTaskPriorityGet                      1\r
+#define INCLUDE_vTaskDelete                                    1\r
+#define INCLUDE_vTaskCleanUpResources          0\r
+#define INCLUDE_vTaskSuspend                           1\r
+#define INCLUDE_vTaskDelayUntil                                1\r
+#define INCLUDE_vTaskDelay                                     1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark    1\r
+#define INCLUDE_xTaskGetSchedulerState         1\r
+\r
+/* Run time stats gathering definitions. */\r
+unsigned long ulGetRunTimeCounterValue( void );\r
+void vConfigureTimerForRunTimeStats( void );\r
+#define configGENERATE_RUN_TIME_STATS  1\r
+#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
+#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()\r
+\r
+extern void vAssertCalled( void );\r
+#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
+\r
+/* The UDP port to use for incoming command inputs.  The outgoing port is\r
+set to ( configUDP_CLI_PORT_NUMBER + 1 ). */\r
+#define configUDP_CLI_PORT_NUMBER      5001\r
+\r
+/* The size of the global output buffer that is available for use when there\r
+are multiple command interpreters running at once (for example, one on a UART\r
+and one on TCP/IP).  This is done to prevent an output buffer being defined by\r
+each implementation - which would waste RAM.  In this case, there is only one\r
+command interpreter running, and it has its own local output buffer, so the\r
+global buffer is just set to be one byte long as it is not used and should not\r
+take up unnecessary RAM. */\r
+#define configCOMMAND_INT_MAX_OUTPUT_SIZE 1\r
+\r
+\r
+/* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */\r
+#include "trcHooks.h"\r
+\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOS_Plus_CLI_with_Trace.sln b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/FreeRTOS_Plus_CLI_with_Trace.sln
new file mode 100644 (file)
index 0000000..3f819af
--- /dev/null
@@ -0,0 +1,20 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual C++ Express 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WIN32", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/READ_ME.url b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/READ_ME.url
new file mode 100644 (file)
index 0000000..8ee5a95
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/Free_RTOS_Plus_Trace_CLI_Example.shtml\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Run-time-stats-utils.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Run-time-stats-utils.c
new file mode 100644 (file)
index 0000000..ea243d3
--- /dev/null
@@ -0,0 +1,142 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*\r
+ * Utility functions required to gather run time statistics.  See:\r
+ * http://www.freertos.org/rtos-run-time-stats.html\r
+ *\r
+ * Note that this is a simulated port, where simulated time is a lot slower than\r
+ * real time, therefore the run time counter values have no real meaningful\r
+ * units.\r
+ *\r
+ * Also note that it is assumed this demo is going to be used for short periods\r
+ * of time only, and therefore timer overflows are not handled.\r
+*/\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+\r
+/* FreeRTOS+Trace includes. */\r
+#include "trcUser.h"\r
+\r
+/* Variables used in the creation of the run time stats time base.  Run time \r
+stats record how much time each task spends in the Running state. */\r
+static long long llInitialRunTimeCounterValue = 0LL, llTicksPerHundedthMillisecond = 0LL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vConfigureTimerForRunTimeStats( void )\r
+{\r
+LARGE_INTEGER liPerformanceCounterFrequency, liInitialRunTimeValue;\r
+\r
+       /* Initialise the variables used to create the run time stats time base.\r
+       Run time stats record how much time each task spends in the Running \r
+       state. */\r
+\r
+       if( QueryPerformanceFrequency( &liPerformanceCounterFrequency ) == 0 )\r
+       {\r
+               llTicksPerHundedthMillisecond = 1;\r
+       }\r
+       else\r
+       {\r
+               /* How many times does the performance counter increment in 1/100th\r
+               millisecond. */\r
+               llTicksPerHundedthMillisecond = liPerformanceCounterFrequency.QuadPart / 100000LL;\r
+\r
+               /* What is the performance counter value now, this will be subtracted\r
+               from readings taken at run time. */\r
+               QueryPerformanceCounter( &liInitialRunTimeValue );\r
+               llInitialRunTimeCounterValue = liInitialRunTimeValue.QuadPart;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned long ulGetRunTimeCounterValue( void )\r
+{\r
+LARGE_INTEGER liCurrentCount;\r
+unsigned long ulReturn;\r
+\r
+       /* What is the performance counter value now? */\r
+       QueryPerformanceCounter( &liCurrentCount );\r
+\r
+       /* Subtract the performance counter value reading taken when the \r
+       application started to get a count from that reference point, then\r
+       scale to (simulated) 1/100ths of a millisecond. */\r
+       if( llTicksPerHundedthMillisecond == 0 )\r
+       {\r
+               /* The trace macros can call this function before the kernel has been\r
+               started, in which case llTicksPerHundedthMillisecond will not have been\r
+               initialised. */\r
+               ulReturn = 0;\r
+       }\r
+       else\r
+       {\r
+               ulReturn = ( unsigned long ) ( ( liCurrentCount.QuadPart - llInitialRunTimeCounterValue ) / llTicksPerHundedthMillisecond );\r
+       }\r
+\r
+       return ulReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcConfig.h
new file mode 100644 (file)
index 0000000..edc7d33
--- /dev/null
@@ -0,0 +1,415 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.2.2 Recorder Library\r
+ * Percepio AB, www.percepio.se\r
+ *\r
+ * trcConfig.h\r
+ *\r
+ * Configuration parameters for the trace recorder library. Before using the \r
+ * trace recorder library, please check that the default settings are \r
+ * appropriate for your system, and if necessary adjust these. Most likely, you \r
+ * will need to adjust the NTask, NISR, NQueue, NMutex and NSemaphore values to \r
+ * reflect the number of such objects in your system. These may be \r
+ * overapproximated, although larger values values implies more RAM usage.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.se/index.php?page=downloads\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.se\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCCONFIG_H\r
+#define TRCCONFIG_H\r
+\r
+/*******************************************************************************\r
+ * CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the event buffer, i.e., the number of records\r
+ * it may store. Each registered event typically use one record (4 byte), but\r
+ * vTracePrintF may use multiple records depending on the number of data args.\r
+ ******************************************************************************/\r
+\r
+#if WIN32\r
+    #define EVENT_BUFFER_SIZE 3000\r
+#else\r
+    #define EVENT_BUFFER_SIZE 1000 /* Adjust wrt. to available RAM */\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * SYMBOL_TABLE_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the symbol table, in bytes. This symbol table \r
+ * stores User Events labels and names of deleted tasks, queues, or other kernel\r
+ * objects. Note that the names of active objects not stored here but in the \r
+ * Object Table. Thus, if you don't use User Events or delete any kernel \r
+ * objects you set this to zero (0) to minimize RAM usage.\r
+ ******************************************************************************/\r
+#define SYMBOL_TABLE_SIZE 1000\r
+\r
+/*******************************************************************************\r
+ * NTask, NISR, NQueue, NSemaphore, NMutex\r
+ *\r
+ * A group of Macros which should be defined as an integer value of zero (0) \r
+ * or larger.\r
+ *\r
+ * This defines the capacity of the Object Property Table - the maximum number\r
+ * of objects active at any given point within each object class.\r
+ * \r
+ * NOTE: In case objects are deleted and created during runtime, this setting\r
+ * does not limit the total amount of objects, only the number of concurrently\r
+ * active objects. \r
+ *\r
+ * Using too small values will give an error message through the vTraceError\r
+ * routine, which makes the error message appear when opening the trace data\r
+ * in FreeRTOS+Trace. If you are using the recorder status monitor task,\r
+ * any error messages are displayed in console prints, assuming that the\r
+ * print macro has been defined properly (vConsolePrintMessage).\r
+ * \r
+ * NOTE 2: If you include the monitor task (USE_TRACE_PROGRESS_MONITOR_TASK)\r
+ * make sure to dimension NTask with this task accounted for.\r
+ *\r
+ * Also remember to account for all tasks created by FreeRTOS, such as the \r
+ * IDLE task, the FreeRTOS timer task, and any tasks created by other 3rd party \r
+ * software components, such as communication stacks.\r
+ * Moreover, one task slot is used to indicate "(startup)", i.e., a "task" that \r
+ * represent the time before the first task starts. NTask should thus be at \r
+ * least 2-3 slots larger than your application task count.\r
+ *\r
+ * NOTE 3: The FreeRTOS timer task creates a Queue, that should be accounted \r
+ * for in NQueue.\r
+ ******************************************************************************/\r
+#define NTask             15\r
+#define NISR              4\r
+#define NQueue            3\r
+#define NSemaphore        4\r
+#define NMutex            2\r
+\r
+/* Maximum object name length for each class (includes zero termination) */\r
+#define NameLenTask       configMAX_TASK_NAME_LEN\r
+#define NameLenISR        10\r
+#define NameLenQueue      15\r
+#define NameLenSemaphore  15\r
+#define NameLenMutex      15\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION\r
+ *\r
+ * Macro which should be defined as a string.\r
+ *\r
+ * This string is stored in the trace and displayed in FreeRTOS+Trace. Can be\r
+ * used to store, e.g., system version or build date. This is also used to store\r
+ * internal error messages from the recorder, which if occurs overwrites the\r
+ * value defined here. This may be maximum 256 chars.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION "FreeRTOS+Trace Demo"\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION_MAX_LENGTH\r
+ *\r
+ * The maximum length (including zero termination) for the TRACE_DESCRIPTION\r
+ * string. Since this string also is used for internal error messages from the \r
+ * recorder do not make it too short, as this may truncate the error messages.\r
+ * Default is 80. \r
+ * Maximum allowed length is 256 - the trace will fail to load if longer.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION_MAX_LENGTH 80\r
+\r
+\r
+/******************************************************************************\r
+ * TRACE_DATA_ALLOCATION\r
+ *\r
+ * This defines how to allocate the recorder data structure, i.e., using a \r
+ * static declaration or using a dynamic allocation in runtime (malloc).\r
+ *\r
+ * Should be one of these two options:\r
+ * - TRACE_DATA_ALLOCATION_STATIC (default)\r
+ * - TRACE_DATA_ALLOCATION_DYNAMIC\r
+ *\r
+ * Using static allocation has the benefits of compile-time errors if the buffer \r
+ * is too large (too large constants in trcConfig.h) and no need to call the \r
+ * initialization routine (xTraceInitTraceData).\r
+ *\r
+ * Using dynamic allocation may give more flexibility in some cases.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_DATA_ALLOCATION TRACE_DATA_ALLOCATION_STATIC\r
+\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION REGARDING WHAT CODE/FEATURES TO INCLUDE\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * INCLUDE_USER_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0) the code for creating User Events is excluded to\r
+ * reduce code size. User Events are application-generated events, like \r
+ * "printf" but for the trace log instead of console output. User Events are \r
+ * much faster than a printf and can therefore be used in timing critical code.\r
+ * See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
+ * \r
+ * Note that FreeRTOS+Trace Standard Edition or Professional Edition is required\r
+ * for User Events, they are not displayed in FreeRTOS+Trace Free Edition.\r
+ *****************************************************************************/\r
+#define INCLUDE_USER_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_ISR_TRACING\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Interrupt Service Routines is \r
+ * excluded to reduce code size. Note, recording ISRs require that you insert\r
+ * calls to vTraceStoreISRBegin and vTraceStoreISREnd in your interrupt handlers.\r
+ * There is no automatic recording of ISRs like for task scheduling, since \r
+ * FreeRTOS does not have a central interrupt dispatcher.\r
+ *****************************************************************************/\r
+#define INCLUDE_ISR_TRACING 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_OBJECT_DELETE\r
+ * \r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * This must be enabled (1) if tasks, queues or other \r
+ * traced kernel objects are deleted at runtime, e.g., using vTaskDelete or \r
+ * vQueueDelete. If no deletes are made, this can be set to 0 in order to\r
+ * exclude the delete-handling code. \r
+ *****************************************************************************/\r
+#define INCLUDE_OBJECT_DELETE 1\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION RELATED TO BEHAVIOR\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * RECORDER_STORE_MODE\r
+ *\r
+ * Macro which should be defined as one of:\r
+ * - STORE_MODE_RING_BUFFER\r
+ * - STORE_MODE_STOP_WHEN_FULL\r
+ * Default is STORE_MODE_RING_BUFFER.\r
+ *\r
+ * With RECORDER_STORE_MODE set to STORE_MODE_RING_BUFFER, the events are stored\r
+ * in a ring buffer, i.e., where the oldest events are overwritten when the\r
+ * buffer becomes full. This allows you to get the last events leading up to an\r
+ * interesting state, e.g., an error, without having a large trace buffer for\r
+ * string the whole run since startup. In this mode, the recorder can run\r
+ * "forever" as the buffer never gets full, i.e., in the sense that it always\r
+ * has room for more events.\r
+ *\r
+ * To fetch the trace in mode STORE_MODE_RING_BUFFER, you need to first halt the\r
+ * system using your debugger and then do a RAM dump, or to explicitly stop the\r
+ * recorder using vTraceStop() and then store/upload the trace data using a\r
+ * FreeRTOS task that you need to provide yourself. The trace data is found in\r
+ * the struct RecorderData, initialized in trcBase.c.\r
+ *\r
+ * Note that, if you upload the trace using a RAM dump, i.e., when the system is \r
+ * halted on a breakpoint or by a debugger command, there is no need to stop the \r
+ * recorder first.\r
+ *\r
+ * When RECORDER_STORE_MODE is STORE_MODE_STOP_WHEN_FULL, the recording is\r
+ * stopped when the buffer becomes full. When the recorder stops itself this way\r
+ * vTracePortEnd() is called which allows for custom actions, such as triggering\r
+ * a task that stores the trace buffer, i.e., in case taking a RAM dump\r
+ * using an on-chip debugger is not possible. In the Windows port, vTracePortEnd\r
+ * saves the trace to file directly, but this is not recommended in a real-time\r
+ * system since the scheduler is blocked during the processing of vTracePortEnd.\r
+ *****************************************************************************/\r
+#ifndef WIN32\r
+#define RECORDER_STORE_MODE STORE_MODE_RING_BUFFER\r
+#else\r
+/* Default in the Win32 demo */\r
+#define RECORDER_STORE_MODE STORE_MODE_STOP_WHEN_FULL\r
+#endif\r
+\r
+/******************************************************************************\r
+ * STOP_AFTER_N_EVENTS\r
+ *\r
+ * Macro which should be defined as an integer value, or not defined.\r
+ * Default is -1\r
+ *\r
+ * STOP_AFTER_N_EVENTS is intended for tests of the ring buffer mode (when\r
+ * RECORDER_STORE_MODE is STORE_MODE_RING_BUFFER). It stops the recording when\r
+ * the specified number of events has been observed. This value can be larger\r
+ * than the buffer size, to allow for test of the "wrapping around" that occurs\r
+ * in ring buffer mode . A negative value (or no definition of this macro)\r
+ * disables this feature.\r
+ *****************************************************************************/\r
+#define STOP_AFTER_N_EVENTS -1\r
+\r
+/******************************************************************************\r
+ * USE_IMPLICIT_IFE_RULES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * ### Instance Finish Events (IFE) ###\r
+ *\r
+ * For tasks with "infinite" main loops (non-terminating tasks), the concept\r
+ * of a task instance has no clear definition, it is an application-specific\r
+ * thing. FreeRTOS+Trace allows you to define Instance Finish Events (IFEs),\r
+ * which marks the point in a cyclic task when the "task instance" ends.\r
+ * The IFE is a blocking kernel call, typically in the main loop of a task\r
+ * which typically reads a message queue, waits for a semaphore or performs\r
+ * an explicit delay.\r
+ *\r
+ * If USE_IMPLICIT_IFE_RULES is one (1), the following FreeRTOS kernel calls\r
+ * are considered by default to be IFEs (Implicit IFEs):\r
+ *  - vTaskDelay\r
+ *  - vTaskDelayUntil\r
+ *  - vTaskSuspend\r
+ *  - xQueueReceive (blocking cases only)\r
+ *  - xSemaphoreTake (blocking cases only)\r
+ *\r
+ * However, Implicit IFEs only applies to blocking kernel calls. If an\r
+ * xQueueReceive reads a message without blocking, it does not create a new\r
+ * instance since no blocking occurred.\r
+ *\r
+ * Moreover, the actual IFE might sometimes be another blocking call such as\r
+ * xQueueSend or xSemaphoreGive. We therefore allow for user-defined\r
+ * Explicit IFEs by calling\r
+ *\r
+ *     vTraceTaskInstanceIsFinished()\r
+ *\r
+ * right before the kernel call considered as IFE. This does not create an\r
+ * additional event but instead stores the service code and object handle\r
+ * of the IFE call as properties of the task.\r
+ *\r
+ * If using Explicit IFEs and the task also calls an Implicit IFE like\r
+ * vTaskDelay, this may result in additional incorrect task instances.\r
+ * This is solved by disabling the Implicit IFEs for the task, by adding\r
+ * a call to\r
+ * \r
+ *     vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+ * \r
+ * in the very beginning of that task. This allows you to combine Explicit IFEs\r
+ * for some tasks with Implicit IFEs for the rest of the tasks, if\r
+ * USE_IMPLICIT_IFE_RULES is 1.\r
+ *\r
+ * By setting USE_IMPLICIT_IFE_RULES to zero (0), the implicit IFEs are disabled\r
+ * for all tasks. Tasks will then be considered to have a single instance only, \r
+ * covering all execution fragments, unless you define an explicit IFE in each\r
+ * task by calling vTraceTaskInstanceIsFinished before the blocking call.\r
+ *****************************************************************************/\r
+#define USE_IMPLICIT_IFE_RULES 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_SAVE_TO_FILE\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If enabled (1), the recorder will include code for saving the trace\r
+ * to a local file system.\r
+ ******************************************************************************/\r
+#ifdef WIN32\r
+    #define INCLUDE_SAVE_TO_FILE 1\r
+#else\r
+    #define INCLUDE_SAVE_TO_FILE 0\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PRIORITY\r
+ *\r
+ * Macro which sets the priority of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is tskIDLE_PRIORITY + 1\r
+ * Note that if your system constantly has a high CPU load from high-priority \r
+ * tasks, this might not be get a chance to execute.\r
+ * \r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_PRIORITY (tskIDLE_PRIORITY + 1)\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_STACKSIZE\r
+ *\r
+ * Macro which sets the stack size of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is intentionally \r
+ * excluded from the demo trace.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_STACKSIZE 500\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PERIOD\r
+ *\r
+ * Macro which sets the period of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is 1000 FreeRTOS ticks (typically 1 second). On the Windows port, a \r
+ * lower value is suggested since the Windows port runs very slowly, often 20-40\r
+ * times slower than the simulated FreeRTOS time.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#if WIN32\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 100\r
+#else\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TEAM_LICENSE_CODE\r
+ *\r
+ * Macro which defines a string - the team license code.\r
+ * If no team license is available, this should be an empty string "".\r
+ * This should be maximum 32 chars, including zero-termination.\r
+ *****************************************************************************/\r
+#define TEAM_LICENSE_CODE ""\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcPort.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/Trace_Recorder_Configuration/trcPort.h
new file mode 100644 (file)
index 0000000..91f9a95
--- /dev/null
@@ -0,0 +1,492 @@
+/******************************************************************************* \r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.h\r
+ *\r
+ * Contains together with trcPort.c all portability issues of the trace recorder \r
+ * library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCPORT_H\r
+#define TRCPORT_H\r
+\r
+/* If FreeRTOS Win32 port */\r
+#ifdef WIN32\r
+\r
+   #undef _WIN32_WINNT\r
+   #define _WIN32_WINNT 0x0600\r
+\r
+   /* Standard includes. */\r
+   #include <stdio.h>\r
+   #include <windows.h>\r
+   #include <direct.h>\r
+\r
+/*******************************************************************************\r
+ * The Win32 port by default saves the trace to file and then kills the\r
+ * program when the recorder is stopped, to facilitate quick, simple tests\r
+ * of the recorder.\r
+ ******************************************************************************/\r
+   #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
+   #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
+#else\r
+       #define WIN32_PORT_SAVE_WHEN_STOPPED 0\r
+       #define WIN32_PORT_EXIT_WHEN_STOPPED 0\r
+#endif\r
+\r
+#define DIRECTION_INCREMENTING 1\r
+#define DIRECTION_DECREMENTING 2\r
+\r
+/******************************************************************************\r
+ * Supported ports\r
+ * \r
+ * PORT_HWIndependent\r
+ * A hardware independent fallback option for event timestamping. Provides low \r
+ * resolution timestamps based on the OS tick.\r
+ * This may be used on the Win32 port, but may also be used on embedded hardware \r
+ * platforms. Note that this gives suboptimal display in FreeRTOS+Trace. All \r
+ * time durations will be truncated to the OS tick frequency, typically 1 KHz. \r
+ * This means that a task or ISR that executes in less than 1 ms get an exection \r
+ * time of zero. They are however still visible in FreeRTOS+Trace. \r
+ *\r
+ * PORT_Win32\r
+ * "Accurate" timestamping based on the Windows permance counter. Note that\r
+ * this gives the host machine time, not the simulated FreeRTOS time (tick \r
+ * count). The timing of the Win32 FreeRTOS build is not real-time, since it \r
+ * depends on the scheduling and tick rate of Windows, which is very slow.\r
+ *\r
+ * Officially supported hardware timer ports:\r
+ * - PORT_Atmel_AT91SAM7\r
+ * - PORT_Atmel_UC3A0\r
+ * - PORT_ARM_CortexM \r
+ * - PORT_Renesas_RX600\r
+ * - PORT_Microchip_dsPIC_AND_PIC24\r
+ *\r
+ * We also provide several "unofficial" hardware-specific ports. There have \r
+ * been developed by external contributors, and have not yet been verified \r
+ * by Percepio AB. Let us know if you have problems getting these to work.\r
+ * \r
+ * Unoffical hardware specific ports provided are:\r
+ * - PORT_TEXAS_INSTRUMENTS_TMS570\r
+ * - PORT_TEXAS_INSTRUMENTS_MSP430\r
+ * - PORT_MICROCHIP_PIC32\r
+ * - PORT_XILINX_PPC405\r
+ * - PORT_XILINX_PPC440\r
+ * - PORT_XILINX_MICROBLAZE\r
+ * - PORT_NXP_LPC210X\r
+ *\r
+ *****************************************************************************/\r
+\r
+#define PORT_NOT_SET                          -1\r
+\r
+/*** Officially supported hardware timer ports *******************************/\r
+#define PORT_HWIndependent                     0\r
+#define PORT_Win32                             1\r
+#define PORT_Atmel_AT91SAM7                    2\r
+#define PORT_Atmel_UC3A0                       3\r
+#define PORT_ARM_CortexM                       4\r
+#define PORT_Renesas_RX600                     5\r
+#define PORT_Microchip_dsPIC_AND_PIC24         6\r
+\r
+/*** Unofficial ports, provided by external developers, not yet verified *****/\r
+#define PORT_TEXAS_INSTRUMENTS_TMS570          7\r
+#define PORT_TEXAS_INSTRUMENTS_MSP430          8\r
+#define PORT_MICROCHIP_PIC32                   9\r
+#define PORT_XILINX_PPC405                    10\r
+#define PORT_XILINX_PPC440                    11\r
+#define PORT_XILINX_MICROBLAZE                12\r
+#define PORT_NXP_LPC210X                      13\r
+\r
+/*** Select your port here! **************************************************/\r
+#define SELECTED_PORT PORT_Win32\r
+/*****************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET) \r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * IRQ_PRIORITY_ORDER\r
+ *\r
+ * Macro which should be defined as an integer of 0 or 1.\r
+ *\r
+ * This should be 0 if lower irq priority values implies higher priority \r
+ * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+ * if higher irq priority values means higher priority, this should be 1.\r
+ *\r
+ * This setting is not critical. It is used only to sort and colorize the \r
+ * interrupts in priority order, in case you record interrupts using\r
+ * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
+ *\r
+ * We provide this setting for some hardware architectures below:\r
+ * - ARM Cortex M:       0 (lower irq priority values are more significant)\r
+ * - Atmel AT91SAM7x:    1 (higher irq priority values are more significant)\r
+ * - Atmel AVR32:        1 (higher irq priority values are more significant)\r
+ * - Renesas RX600:      1 (higher irq priority values are more significant)\r
+ * - Microchip PIC24:    0 (lower irq priority values are more significant)\r
+ * - Microchip dsPIC:    0 (lower irq priority values are more significant)\r
+ * - TI TMS570:          0 (lower irq priority values are more significant)\r
+ * - Freescale HCS08:    0 (lower irq priority values are more significant)\r
+ * - Freescale HCS12:    0 (lower irq priority values are more significant)\r
+ * - PowerPC 405:        0 (lower irq priority values are more significant)\r
+ * - PowerPC 440:        0 (lower irq priority values are more significant)\r
+ * - Freescale ColdFire: 1 (higher irq priority values are more significant)\r
+ * - NXP LPC210x:        0 (lower irq priority values are more significant)\r
+ * - MicroBlaze:        0  (lower irq priority values are more significant)\r
+ *\r
+ * If your chip is not on the above list, and you perhaps know this detail by \r
+ * heart, please inform us by e-mail to support@percepio.com.\r
+ *\r
+ ******************************************************************************\r
+ *\r
+ * HWTC Macros \r
+ *\r
+ * These four HWTC macros provides a hardware isolation layer representing a \r
+ * generic hardware timer/counter used for driving the operating system tick, \r
+ * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
+ * AT91SAM7X.\r
+ *\r
+ * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
+ * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
+ * already wrapped.\r
+ *\r
+ * HWTC_COUNT_DIRECTION: Should be one of:\r
+ * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
+ *   such as the PIT on Atmel AT91SAM7X.\r
+ *   When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
+ *   interrupt is signaled.\r
+ * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
+ *   such as the SysTick on ARM Cortex M3/M4 chips.\r
+ *   When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
+ *   interrupt is signaled.\r
+ *\r
+ * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
+ * two tick interrupts. This should preferably be mapped to the reload\r
+ * register of the hardware timer, to make it more portable between chips in the \r
+ * same family. The macro should in most cases be (reload register + 1).\r
+ *\r
+ * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
+ * (where the SysTick runs at the core clock frequency), the "differential \r
+ * timestamping" used in the recorder will more frequently insert extra XTS \r
+ * events to store the timestamps, which increases the event buffer usage. \r
+ * In such cases, to reduce the number of XTS events and thereby get longer \r
+ * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
+ * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
+ * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
+ * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
+ * faster chip require a higher HWTC_DIVISOR value. \r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * FREE LICENSE OFFER FROM PERCEPIO\r
+ *\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students,\r
+ * hobbyists or early-phase startups) we have the following offer: \r
+ * Provide a hardware port for our FreeRTOS recorder and get a FREE single-user\r
+ * license for FreeRTOS+Trace Professional Edition. Read more about this offer\r
+ * at www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_Win32)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
+    #define HWTC_PERIOD 0\r
+    #define HWTC_DIVISOR 1\r
+    \r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_HWIndependent)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT 0\r
+    #define HWTC_PERIOD 1\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+\r
+    /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
+    A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
+    #define HWTC_PERIOD 2995 \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
+  \r
+    /* For Atmel AVR32 (AT32UC3A) */\r
+  \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+    /* For all chips using ARM Cortex M cores */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
+    #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
+    #define HWTC_DIVISOR 2\r
+    \r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Renesas_RX600)    \r
+\r
+    #include "iodefine.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (CMT0.CMCNT)\r
+    #define HWTC_PERIOD ((((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/8))\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Microchip_dsPIC_AND_PIC24) \r
+\r
+    /* For Microchip PIC24 and dsPIC (16 bit) */\r
+\r
+    /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
+       than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 Âµs. \r
+       In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
+       becomes a problem on PIC24, use the filters to exclude less interresting tasks \r
+       or system calls. */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TMR1)\r
+    #define HWTC_PERIOD (PR1+1)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+    \r
+    /* Tested with LPC2106, but should work with most LPC21XX chips.\r
+       Assumption: prescaler is 1:1 (this setting is hardcoded in \r
+       FreeRTOS port for LPC21XX) */\r
+      \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT  *((uint32_t *)0xE0004008 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) \r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
+    #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
+    #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
+    #define HWTC_PERIOD (RTIUDCP0)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TA0R)\r
+    #define HWTC_PERIOD configCPU_CLOCKS_PER_TICK      \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ReadTimer1())     /* Should be available in BSP */\r
+    #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x3db)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most PowerPC chips */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x016 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+    \r
+#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most Microblaze configurations\r
+     * This port is based on the official FreeRTOS Microlaze port and example application.\r
+     * It uses the AXI Timer 0 - the tick interrupt source.\r
+     * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
+     */\r
+    #include "xtmrctr_l.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 16\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT != PORT_NOT_SET)\r
+\r
+    #error "SELECTED_PORT had unsupported value!"\r
+    #define SELECTED_PORT PORT_NOT_SET\r
+\r
+#endif\r
+\r
+#if (SELECTED_PORT != PORT_NOT_SET)\r
+    \r
+    #ifndef HWTC_COUNT_DIRECTION\r
+    #error "HWTC_COUNT_DIRECTION is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_COUNT\r
+    #error "HWTC_COUNT is not set!"    \r
+    #endif \r
+    \r
+    #ifndef HWTC_PERIOD\r
+    #error "HWTC_PERIOD is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_DIVISOR\r
+    #error "HWTC_DIVISOR is not set!"    \r
+    #endif \r
+    \r
+    #ifndef IRQ_PRIORITY_ORDER\r
+    #error "IRQ_PRIORITY_ORDER is not set!"\r
+    #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
+    #error "IRQ_PRIORITY_ORDER has bad value!"\r
+    #endif \r
+    \r
+    #if (HWTC_DIVISOR < 1)\r
+    #error "HWTC_DIVISOR must be a non-zero positive value!"\r
+    #endif \r
+\r
+#endif\r
+/*******************************************************************************\r
+ * vTraceConsoleMessage\r
+ *\r
+ * A wrapper for your system-specific console "printf" console output function.\r
+ * This needs to be correctly defined to see status reports from the trace \r
+ * status monitor task (this is defined in trcUser.c).\r
+ ******************************************************************************/         \r
+#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+/* Port specific includes */\r
+#include "console.h"\r
+#endif\r
+\r
+#define vTraceConsoleMessage(x)\r
+\r
+/*******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, \r
+ * students, hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called when the recorder is stopped due to full buffer.\r
+ * Mainly intended to show a message in the console.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetFileName.\r
+ ******************************************************************************/\r
+void vTracePortEnd(void);\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path);\r
+\r
+/******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a target-side file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port may call\r
+ * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
+ ******************************************************************************/\r
+void vTracePortSave(void);\r
+\r
+#endif\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/UDPCommandServer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/UDPCommandServer.c
new file mode 100644 (file)
index 0000000..b4b8336
--- /dev/null
@@ -0,0 +1,259 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#pragma comment( lib, "ws2_32.lib" )\r
+\r
+/* Win32 includes. */\r
+#include <WinSock2.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+CLI includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+/* Dimensions the buffer into which input characters are placed. */\r
+#define cmdMAX_INPUT_SIZE      60\r
+\r
+/* Dimensions the buffer into which string outputs can be placed. */\r
+#define cmdMAX_OUTPUT_SIZE     1024\r
+\r
+/* Dimensions the buffer passed to the recvfrom() call. */\r
+#define cmdSOCKET_INPUT_BUFFER_SIZE 60\r
+\r
+/*\r
+ * Open and configure the UDP socket.\r
+ */\r
+static SOCKET prvOpenUDPSocket( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* \r
+ * Task that provides the input and output for the FreeRTOS+CLI command\r
+ * interpreter.  In this case a UDP port is used.  See the URL in the comments\r
+ * within main.c for the location of the online documentation.\r
+ */\r
+void vUDPCommandInterpreterTask( void *pvParameters )\r
+{\r
+long lBytes, lByte;\r
+signed char cInChar, cInputIndex = 0;\r
+static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
+portBASE_TYPE xMoreDataToFollow;\r
+volatile int iErrorCode = 0;\r
+struct sockaddr_in xClient;\r
+int xClientAddressLength = sizeof( struct sockaddr_in );\r
+SOCKET xSocket;\r
+\r
+       /* Just to prevent compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Attempt to open the socket. */\r
+       xSocket = prvOpenUDPSocket();\r
+\r
+       if( xSocket != INVALID_SOCKET )\r
+       {\r
+               for( ;; )\r
+               {\r
+                       /* Wait for incoming data on the opened socket. */\r
+                       lBytes = recvfrom( xSocket, cLocalBuffer, sizeof( cLocalBuffer ), 0, ( struct sockaddr * ) &xClient, &xClientAddressLength );\r
+\r
+                       if( lBytes == SOCKET_ERROR )\r
+                       {\r
+                               /* Something went wrong, but it is not handled by this simple\r
+                               example. */\r
+                               iErrorCode = WSAGetLastError();\r
+                       }\r
+                       else\r
+                       {                               \r
+                               /* Process each received byte in turn. */\r
+                               lByte = 0;\r
+                               while( lByte < lBytes )\r
+                               {\r
+                                       /* The next character in the input buffer. */\r
+                                       cInChar = cLocalBuffer[ lByte ];\r
+                                       lByte++;\r
+\r
+                                       /* Newline characters are taken as the end of the command\r
+                                       string. */\r
+                                       if( cInChar == '\n' )\r
+                                       {\r
+                                               /* Process the input string received prior to the \r
+                                               newline. */\r
+                                               do\r
+                                               {\r
+                                                       /* Pass the string to FreeRTOS+CLI. */\r
+                                                       xMoreDataToFollow = FreeRTOS_CLIProcessCommand( cInputString, cOutputString, cmdMAX_OUTPUT_SIZE );\r
+                                                       \r
+                                                       /* Send the output generated by the command's\r
+                                                       implementation. */\r
+                                                       sendto( xSocket, cOutputString,  strlen( cOutputString ), 0, ( SOCKADDR * ) &xClient, xClientAddressLength );\r
+\r
+                                               } while( xMoreDataToFollow != pdFALSE ); /* Until the command does not generate any more output. */\r
+\r
+                                               /* All the strings generated by the command processing \r
+                                               have been sent.  Clear the input string ready to receive \r
+                                               the next command. */\r
+                                               cInputIndex = 0;\r
+                                               memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
+                                               \r
+                                               /* Transmit a spacer, just to make the command console\r
+                                               easier to read. */\r
+                                               sendto( xSocket, "\r\n",  strlen( "\r\n" ), 0, ( SOCKADDR * ) &xClient, xClientAddressLength );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               if( cInChar == '\r' )\r
+                                               {\r
+                                                       /* Ignore the character.  Newlines are used to \r
+                                                       detect the end of the input string. */\r
+                                               }\r
+                                               else if( cInChar == '\b' )\r
+                                               {\r
+                                                       /* Backspace was pressed.  Erase the last character \r
+                                                       in the string - if any. */\r
+                                                       if( cInputIndex > 0 )\r
+                                                       {\r
+                                                               cInputIndex--;\r
+                                                               cInputString[ cInputIndex ] = '\0';\r
+                                                       }\r
+                                               }\r
+                                               else\r
+                                               {\r
+                                                       /* A character was entered.  Add it to the string\r
+                                                       entered so far.  When a \n is entered the complete\r
+                                                       string will be passed to the command interpreter. */\r
+                                                       if( cInputIndex < cmdMAX_INPUT_SIZE )\r
+                                                       {\r
+                                                               cInputString[ cInputIndex ] = cInChar;\r
+                                                               cInputIndex++;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               } \r
+       }\r
+       else\r
+       {\r
+               /* The socket could not be opened. */\r
+               vTaskDelete( NULL );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static SOCKET prvOpenUDPSocket( void )\r
+{\r
+WSADATA xWSAData;\r
+WORD wVersionRequested;\r
+struct sockaddr_in xServer;\r
+SOCKET xSocket = INVALID_SOCKET;\r
+\r
+       wVersionRequested = MAKEWORD( 2, 2 );\r
+\r
+       /* Prepare to use WinSock. */\r
+       if( WSAStartup( wVersionRequested, &xWSAData ) != 0 )\r
+       {\r
+               fprintf( stderr, "Could not open Windows connection.\n" );\r
+       }\r
+       else\r
+       {\r
+               xSocket = socket( AF_INET, SOCK_DGRAM, 0 );\r
+               if( xSocket == INVALID_SOCKET)\r
+               {\r
+                       fprintf( stderr, "Could not create socket.\n" );\r
+                       WSACleanup();\r
+               }\r
+               else\r
+               {\r
+                       /* Zero out the server structure. */\r
+                       memset( ( void * ) &xServer, 0x00, sizeof( struct sockaddr_in ) );\r
+\r
+                       /* Set family and port. */\r
+                       xServer.sin_family = AF_INET;\r
+                       xServer.sin_port = htons( configUDP_CLI_PORT_NUMBER );\r
+\r
+                       /* Assign the loopback address */\r
+                       xServer.sin_addr.S_un.S_un_b.s_b1 = 127;\r
+                       xServer.sin_addr.S_un.S_un_b.s_b2 = 0;\r
+                       xServer.sin_addr.S_un.S_un_b.s_b3 = 0;\r
+                       xServer.sin_addr.S_un.S_un_b.s_b4 = 1;\r
+\r
+                       /* Bind the address to the socket. */\r
+                       if( bind( xSocket, ( struct sockaddr * ) &xServer, sizeof( struct sockaddr_in ) ) == -1 )\r
+                       {\r
+                               fprintf( stderr, "Could not socket to port %d.\n", configUDP_CLI_PORT_NUMBER );\r
+                               closesocket( xSocket );\r
+                               xSocket = INVALID_SOCKET;\r
+                               WSACleanup();\r
+                       }\r
+               }\r
+       }\r
+\r
+       return xSocket;\r
+}\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj
new file mode 100644 (file)
index 0000000..33b3ead
--- /dev/null
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>\r
+    <ProjectName>RTOSDemo</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\..\FreeRTOS\Source\include;..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\Source\FreeRTOS-Plus-CLI;.\Trace_Recorder_Configuration;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Debug/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>\r
+      </AdditionalLibraryDirectories>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Debug/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Release/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Release/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_3.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcBase.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernel.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcPort.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcUser.c" />\r
+    <ClCompile Include="CLI-commands.c" />\r
+    <ClCompile Include="main.c">\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="Run-time-stats-utils.c" />\r
+    <ClCompile Include="UDPCommandServer.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcBase.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcHooks.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernel.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcTypes.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcUser.h" />\r
+    <ClInclude Include="FreeRTOSConfig.h" />\r
+    <ClInclude Include="Trace_Recorder_Configuration\trcConfig.h" />\r
+    <ClInclude Include="Trace_Recorder_Configuration\trcPort.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.filters b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.filters
new file mode 100644 (file)
index 0000000..edbf9fc
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{38712199-cebf-4124-bf15-398f7c3419ea}</UniqueIdentifier>\r
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+    <Filter Include="Demo App Source">\r
+      <UniqueIdentifier>{34567deb-d5ab-4a56-8640-0aaec609521a}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS">\r
+      <UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source">\r
+      <UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>\r
+      <Extensions>*.c</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source\Portable">\r
+      <UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+">\r
+      <UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+Trace">\r
+      <UniqueIdentifier>{629e761f-e8a8-430e-b44e-f38d83292b54}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+Trace\Include">\r
+      <UniqueIdentifier>{e17028e8-51ed-45af-8aa4-22ade709b3fb}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Configuration Files">\r
+      <UniqueIdentifier>{19ff1a34-36de-4c48-9d10-3fb1fa0d1fa4}</UniqueIdentifier>\r
+      <Extensions>\r
+      </Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+CLI">\r
+      <UniqueIdentifier>{fd43c0ed-fdbc-437f-a5a3-c50399690bd7}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Demo App Source\Trace Recorder Configuration">\r
+      <UniqueIdentifier>{91dffc7b-279b-44f6-a2b2-f5d2e132a85d}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="main.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_3.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="UDPCommandServer.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="CLI-commands.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Run-time-stats-utils.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+CLI</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcUser.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcBase.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcKernel.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-Trace\trcPort.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="FreeRTOSConfig.h">\r
+      <Filter>FreeRTOS\Configuration Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Trace_Recorder_Configuration\trcPort.h">\r
+      <Filter>Demo App Source\Trace Recorder Configuration</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Trace_Recorder_Configuration\trcConfig.h">\r
+      <Filter>Demo App Source\Trace Recorder Configuration</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcUser.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcBase.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcHooks.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcKernel.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-Trace\Include\trcTypes.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+Trace\Include</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.user b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/WIN32.vcxproj.user
new file mode 100644 (file)
index 0000000..695b5c7
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c
new file mode 100644 (file)
index 0000000..1d5af92
--- /dev/null
@@ -0,0 +1,288 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*\r
+ ******************************************************************************\r
+ * -NOTE- The Win32 port is a simulation (or is that emulation?) only!  Do not\r
+ * expect to get real time behaviour from the Win32 port or this demo\r
+ * application.  It is provided as a convenient development and demonstration\r
+ * test bed only.  This was tested using Windows XP on a dual core laptop.\r
+ *\r
+ * In this example, one simulated millisecond will take approximately 40ms to\r
+ * execute, and the timing information in the FreeRTOS+Trace logs have no\r
+ * meaningful units.  See the documentation page for the Windows simulator for\r
+ * an explanation of the slow timing:\r
+ * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
+ ******************************************************************************\r
+ *\r
+ * This is a simple FreeRTOS Windows simulator project that makes it easy to \r
+ * evaluate FreeRTOS+CLI and FreeRTOS+Trace on a standard desktop PC, without\r
+ * any external hardware or interfaces being required.\r
+ *\r
+ * To keep everything as simple as possible, the command line interface is \r
+ * accessed through a UDP socket on the default Windows loopback IP address of\r
+ * 127.0.0.1.  Full instructions are provided on the documentation page\r
+ * referenced above.\r
+ *\r
+ * Commands are provided to both start and stop a FreeRTOS+Trace recording.  \r
+ * Stopping a recording will result in the recorded data being saved to the\r
+ * hard disk, ready for viewing in the FreeRTOS+Trace graphical user interface.\r
+ * Again, full instructions are provided on the documentation page referenced\r
+ * above.\r
+ *\r
+ * A queue send task and a queue receive task are defined in this file.  The\r
+ * queue receive task spends most of its time blocked on the queue waiting for\r
+ * messages to arrive.  The queue send task periodically sends a message to the\r
+ * queue, causing the queue receive task to exit the Blocked state.  The\r
+ * priority of the queue receive task is above that of the queue send task, so\r
+ * it pre-empts the queue send task as soon as it leaves the Blocked state.  It\r
+ * then consumes the message from the queue and prints "message received" to\r
+ * the screen before returning to block on the queue once again.  This \r
+ * sequencing is clearly visible in the recorded FreeRTOS+Trace data.\r
+ *\r
+ * Finally, a trace monitoring task is also created that prints out a message\r
+ * when it determines that the status of the trace has changed since it last\r
+ * executed.  It prints out a message when the trace has started, when the\r
+ * trace has stopped, and periodically when the trace is executing.\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+#include "task.h"\r
+#include "queue.h"\r
+\r
+/* FreeRTOS+Trace includes. */\r
+#include "trcUser.h"\r
+\r
+/* Priorities at which the tasks are created. */\r
+#define mainQUEUE_RECEIVE_TASK_PRIORITY                ( tskIDLE_PRIORITY + 2 )\r
+#define        mainQUEUE_SEND_TASK_PRIORITY            ( tskIDLE_PRIORITY + 1 )\r
+#define mainUDP_CLI_TASK_PRIORITY                      ( tskIDLE_PRIORITY )\r
+\r
+/* The rate at which data is sent to the queue.  The (simulated) 50ms value is \r
+converted to ticks using the portTICK_RATE_MS constant. */\r
+#define mainQUEUE_SEND_FREQUENCY_MS                    ( 50 / portTICK_RATE_MS )\r
+\r
+/* The number of items the queue can hold.  This is 1 as the receive task\r
+will remove items as they are added, meaning the send task should always find\r
+the queue empty. */\r
+#define mainQUEUE_LENGTH                                       ( 1 )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * The queue send and receive tasks as described in the comments at the top of\r
+ * this file. \r
+ */\r
+static void prvQueueReceiveTask( void *pvParameters );\r
+static void prvQueueSendTask( void *pvParameters );\r
+\r
+/*\r
+ * The task that implements the UDP command interpreter using FreeRTOS+CLI.\r
+ */\r
+extern void vUDPCommandInterpreterTask( void *pvParameters );\r
+\r
+/*\r
+ * Register commands that can be used with FreeRTOS+CLI through the UDP socket.\r
+ * The commands are defined in CLI-commands.c.\r
+ */\r
+extern void vRegisterCLICommands( void );\r
+\r
+/* The queue used by both tasks. */\r
+static xQueueHandle xQueue = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+int main( void )\r
+{\r
+const uint32_t ulLongTime_ms = 250UL;\r
+\r
+       /* Create the queue used to pass messages from the queue send task to the\r
+       queue receive task. */\r
+       xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
+       \r
+       /* Give the queue a name for the FreeRTOS+Trace log. */\r
+       vTraceSetQueueName( xQueue, "DemoQ" );\r
+\r
+       /* Start the two tasks as described in the comments at the top of this\r
+       file. */\r
+       xTaskCreate( prvQueueReceiveTask,                               /* The function that implements the task. */\r
+                               ( signed char * ) "Rx",                         /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+                               configMINIMAL_STACK_SIZE,                       /* The size of the stack to allocate to the task.  Not actually used as a stack in the Win32 simulator port. */\r
+                               NULL,                                                           /* The parameter passed to the task - not used in this example. */\r
+                               mainQUEUE_RECEIVE_TASK_PRIORITY,        /* The priority assigned to the task. */\r
+                               NULL );                                                         /* The task handle is not required, so NULL is passed. */\r
+\r
+       xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+\r
+       /* Create the task that handles the CLI on a UDP port.  The port number\r
+       is set using the configUDP_CLI_PORT_NUMBER setting in FreeRTOSConfig.h. */\r
+       xTaskCreate( vUDPCommandInterpreterTask, ( signed char * ) "CLI", configMINIMAL_STACK_SIZE, NULL, mainUDP_CLI_TASK_PRIORITY, NULL );\r
+\r
+       /* Create the task that monitors the trace recording status, printing\r
+       periodic information to the display. */\r
+       vTraceStartStatusMonitor();\r
+\r
+       /* Register commands with the FreeRTOS+CLI command interpreter. */\r
+       vRegisterCLICommands();\r
+\r
+       /* Start the tasks and timer running. */\r
+       vTaskStartScheduler();\r
+\r
+       /* If all is well, the scheduler will now be running, and the following\r
+       line will never be reached.  If the following line does execute, then\r
+       there was insufficient FreeRTOS heap memory available for the idle and/or\r
+       timer tasks     to be created.  See the memory management section on the\r
+       FreeRTOS web site for more details (this is standard text that is not not \r
+       really applicable to the Win32 simulator port). */\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongTime_ms );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueSendTask( void *pvParameters )\r
+{\r
+portTickType xNextWakeTime;\r
+const unsigned long ulValueToSend = 100UL;\r
+\r
+       /* Remove warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Initialise xNextWakeTime - this only needs to be done once. */\r
+       xNextWakeTime = xTaskGetTickCount();\r
+\r
+       for( ;; )\r
+       {\r
+               /* Place this task in the blocked state until it is time to run again.\r
+               While in the Blocked state this task will not consume any CPU time. */\r
+               vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_FREQUENCY_MS );\r
+\r
+               /* Send to the queue - causing the queue receive task to unblock and\r
+               write a message to the display.  0 is used as the block time so the \r
+               sending operation will not block - it shouldn't need to block as the \r
+               queue should always     be empty at this point in the code, and it is an\r
+               error if it is not. */\r
+               xQueueSend( xQueue, &ulValueToSend, 0U );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueReceiveTask( void *pvParameters )\r
+{\r
+unsigned long ulReceivedValue;\r
+\r
+       /* Remove warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait until something arrives in the queue - this task will block\r
+               indefinitely provided INCLUDE_vTaskSuspend is set to 1 in\r
+               FreeRTOSConfig.h. */\r
+               xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );\r
+\r
+               /*  To get here something must have been received from the queue, but\r
+               is it the expected value?  If it is, write the message to the \r
+               display before looping back to block on the queue again. */\r
+               if( ulReceivedValue == 100UL )\r
+               {\r
+                       printf( "Message received!\r\n" );\r
+                       ulReceivedValue = 0U;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+const unsigned long ulMSToSleep = 5;\r
+\r
+       /* This function is called on each cycle of the idle task if\r
+       configUSE_IDLE_HOOK is set to 1 in FreeRTOSConfig.h.  Sleep to reduce CPU \r
+       load. */\r
+       Sleep( ulMSToSleep );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( void )\r
+{\r
+const unsigned long ulLongSleep = 1000UL;\r
+\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongSleep );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/readme.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/readme.txt
new file mode 100644 (file)
index 0000000..1a0cbcf
--- /dev/null
@@ -0,0 +1,7 @@
+Directories:\r
+\r
++ FreeRTOS-Plus/Demo_Projects_Using_FreeRTOS_Simulator/FreeRTOS_Plus_CLI_with_Trace\r
+  contains a FreeRTOS windows simulator demo project for both FreeRTOS+CLI and\r
+  FreeRTOS+Trace.  See http://www.FreeRTOS.org/trace for information on using\r
+  the project.\r
+  \r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..3655007
--- /dev/null
@@ -0,0 +1,136 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
+ * http://www.freertos.org/a00110.html\r
+ *----------------------------------------------------------*/\r
+\r
+#define configUSE_PREEMPTION                   1\r
+#define configUSE_IDLE_HOOK                            1\r
+#define configUSE_TICK_HOOK                            0\r
+#define configTICK_RATE_HZ                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */\r
+#define configMAX_TASK_NAME_LEN                        ( 7 )\r
+#define configUSE_TRACE_FACILITY               1\r
+#define configUSE_16_BIT_TICKS                 0\r
+#define configIDLE_SHOULD_YIELD                        1\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configUSE_MUTEXES                              1\r
+#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */\r
+#define configUSE_RECURSIVE_MUTEXES            1\r
+#define configQUEUE_REGISTRY_SIZE              0\r
+#define configUSE_MALLOC_FAILED_HOOK   0\r
+#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_ALTERNATIVE_API              0\r
+\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              2\r
+#define configTIMER_QUEUE_LENGTH               20\r
+#define configTIMER_TASK_STACK_DEPTH   ( configMINIMAL_STACK_SIZE * 2 )\r
+\r
+#define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 7 )\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+\r
+/* Co-routine definitions. */\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero\r
+to exclude the API function. */\r
+\r
+#define INCLUDE_vTaskPrioritySet                       1\r
+#define INCLUDE_uxTaskPriorityGet                      1\r
+#define INCLUDE_vTaskDelete                                    1\r
+#define INCLUDE_vTaskCleanUpResources          0\r
+#define INCLUDE_vTaskSuspend                           1\r
+#define INCLUDE_vTaskDelayUntil                                1\r
+#define INCLUDE_vTaskDelay                                     1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark    1\r
+#define INCLUDE_xTaskGetSchedulerState         1\r
+\r
+/* Run time stats gathering definitions. */\r
+#define configGENERATE_RUN_TIME_STATS  0\r
+\r
+extern void vAssertCalled( void );\r
+#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
+\r
+/* The TCP port used by both the secure client and the secure server. */\r
+#define configTCP_PORT_NUMBER  5001\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOS_Plus_CyaSSL.sln b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/FreeRTOS_Plus_CyaSSL.sln
new file mode 100644 (file)
index 0000000..3f819af
--- /dev/null
@@ -0,0 +1,20 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual C++ Express 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WIN32", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/READ_ME.url b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/READ_ME.url
new file mode 100644 (file)
index 0000000..c9b8dac
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/FreeRTOS-Plus/CyaSSL/FreeRTOS_CyaSSL_Example.shtml\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c
new file mode 100644 (file)
index 0000000..d2f085b
--- /dev/null
@@ -0,0 +1,175 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#pragma comment( lib, "ws2_32.lib" )\r
+\r
+/* Win32 includes. */\r
+#include <WinSock2.h>\r
+\r
+/* CyaSSL includes. */\r
+#include "cyassl/ssl.h"\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The CyaSSL context for the client. */\r
+static CYASSL_CTX* xCyaSSL_ClientContext = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* See the comments at the top of main.c. */\r
+void vSecureTCPClientTask( void *pvParameters )\r
+{\r
+SOCKET xClientSocket;\r
+struct sockaddr_in xConnection;\r
+CYASSL* xCyaSSL_Object;\r
+WORD wVersionRequested;\r
+WSADATA xWSAData;\r
+uint8_t cString[ 50 ];\r
+portBASE_TYPE lReturned;\r
+uint32_t ulCount = 0UL;\r
+\r
+       /* Remove compiler warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Prepare to use WinSock. */\r
+       wVersionRequested = MAKEWORD( 2, 2 );\r
+       configASSERT( WSAStartup( wVersionRequested, &xWSAData ) == 0 );\r
+\r
+       /* Set family and port for client socket. */\r
+       memset( ( void * ) &xConnection, 0x00, sizeof( struct sockaddr_in ) );\r
+       xConnection.sin_family = AF_INET;\r
+       xConnection.sin_addr.s_addr = inet_addr("127.0.0.1");\r
+       xConnection.sin_port = htons( configTCP_PORT_NUMBER );\r
+\r
+    /* Attempt to create a context that uses the TLS V1 server protocol. */\r
+    xCyaSSL_ClientContext = CyaSSL_CTX_new( CyaTLSv1_client_method() );\r
+       configASSERT( xCyaSSL_ClientContext );\r
+\r
+    /* Load the CA certificate. */\r
+    lReturned = CyaSSL_CTX_load_verify_locations( xCyaSSL_ClientContext, "ca-cert.pem", 0 );\r
+       configASSERT( lReturned == SSL_SUCCESS );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Create the socket. */\r
+               xClientSocket = socket( AF_INET, SOCK_STREAM, 0 );\r
+               configASSERT( xClientSocket != INVALID_SOCKET );\r
+\r
+               /* Connect to the secure server. */\r
+               if( connect( xClientSocket, ( SOCKADDR * ) &xConnection, sizeof( xConnection ) ) == 0 )\r
+               {\r
+                       /* The connect was successful.  Create a CyaSSL object to associate \r
+                       with this connection. */\r
+                       xCyaSSL_Object = CyaSSL_new( xCyaSSL_ClientContext );\r
+        \r
+                       if( xCyaSSL_Object != NULL )\r
+                       {\r
+                               /* Associate the created CyaSSL object with the connected \r
+                               socket. */\r
+                               lReturned = CyaSSL_set_fd( xCyaSSL_Object, xClientSocket );\r
+                               configASSERT( lReturned == SSL_SUCCESS );\r
+\r
+                               /* The count is used to differentiate between messages sent to\r
+                               the server, and to break out of the do while loop below. */\r
+                               ulCount = 0UL;\r
+\r
+                               do\r
+                               {\r
+                                       /* Create the string that is sent to the secure server. */\r
+                                       sprintf( ( char * ) cString, "Message number %lu\r\n", ulCount );\r
+\r
+                                       /* The next line is the secure equivalent of the standard \r
+                                       sockets call:\r
+                                       lReturned = send( xClientSocket, cString, strlen( cString ) + 1, 0 ); */\r
+                                       lReturned = CyaSSL_write( xCyaSSL_Object, ( const char * ) cString, strlen( ( const char * ) cString ) + 1 );\r
+                                       \r
+                                       \r
+                                       /* Short delay to prevent the messages streaming up the\r
+                                       console too quickly. */\r
+                                       vTaskDelay( 5 );\r
+                                       ulCount++;\r
+\r
+                               } while( ( lReturned != SOCKET_ERROR ) && ( ulCount < 10UL ) );\r
+                       }\r
+                                               \r
+                       CyaSSL_free( xCyaSSL_Object );\r
+                       closesocket( xClientSocket );\r
+\r
+                       /* Delay for a short time before starting over. */\r
+                       vTaskDelay( 50 );\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPServerTask.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPServerTask.c
new file mode 100644 (file)
index 0000000..2068a12
--- /dev/null
@@ -0,0 +1,285 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#pragma comment( lib, "ws2_32.lib" )\r
+\r
+/* Win32 includes. */\r
+#include <WinSock2.h>\r
+\r
+/* CyaSSL includes. */\r
+#include "cyassl/ssl.h"\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* This application is using the FreeRTOS Windows simulator, which uses the\r
+FreeRTOS scheduler to schedule FreeRTOS task within the Windows environment.\r
+The Windows envrionment must not be allowed to block any Windows threads that\r
+are running FreeRTOS tasks, unless the FreeRTOS task is running at the FreeRTOS\r
+idle priority.  For simplicity, this demo uses the Windows TCP/IP stack, the\r
+API for which can cause Windows threads to block.  Therefore, any FreeRTOS task\r
+that makes calls to the Windows TCP/IP stack must be assigned the idle prioity.\r
+Note this is only a restriction of the simulated Windows environment - real\r
+FreeRTOS ports do not have this restriction. */\r
+#define sstSECURE_CLIENT_TASK_PRIORITY         ( tskIDLE_PRIORITY )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Open, configures and binds the server's TCP socket.\r
+ */\r
+static SOCKET prvOpenServerSocket( void );\r
+\r
+/* \r
+ * Prepare the CyaSSL library for use.\r
+ */\r
+static void prvInitialiseCyaSSL( void );\r
+\r
+/*\r
+ * The task that implements the client side of the connection.\r
+ */\r
+extern void vSecureTCPClientTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The CyaSSL context for the server. */\r
+static CYASSL_CTX* xCyaSSL_ServerContext = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* See the comments at the top of main.c. */\r
+void vSecureTCPServerTask( void *pvParameters )\r
+{\r
+portBASE_TYPE xReturned;\r
+long lBytes;\r
+uint8_t cReceivedString[ 60 ];\r
+struct sockaddr_in xClient;\r
+int xClientAddressLength = sizeof( struct sockaddr_in );\r
+SOCKET xListeningSocket, xConnectedSocket;\r
+CYASSL* xCyaSSL_Object; /* Only one connection is accepted at a time, so only one object is needed at a time. */\r
+\r
+       /* Just to prevent compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Perform the initialisation necessary before CyaSSL can be used. */\r
+       prvInitialiseCyaSSL();\r
+       configASSERT( xCyaSSL_ServerContext );\r
+\r
+       /* Attempt to open the socket. */\r
+       xListeningSocket = prvOpenServerSocket();\r
+\r
+       /* Now the server socket has been created and the CyaSSL library has been\r
+       initialised, the task that implements the client side can be created. */\r
+       xTaskCreate( vSecureTCPClientTask, "Client", configMINIMAL_STACK_SIZE, NULL, sstSECURE_CLIENT_TASK_PRIORITY, NULL );\r
+\r
+       if( xListeningSocket != INVALID_SOCKET )\r
+       {\r
+               for( ;; )\r
+               {\r
+                       /* Wait until the client connects. */\r
+                       printf( "Waiting for new connection\r\n" );\r
+                       xConnectedSocket = accept( xListeningSocket, ( struct sockaddr * ) &xClient, &xClientAddressLength );\r
+\r
+                       if( xConnectedSocket != INVALID_SOCKET )\r
+                       {\r
+                               printf( "Connection established\r\n" );\r
+\r
+                               /* A connection has been accepted by the server.  Create a \r
+                               CyaSSL object for use with the newly connected socket. */\r
+                               xCyaSSL_Object = NULL;\r
+                               xCyaSSL_Object = CyaSSL_new( xCyaSSL_ServerContext );\r
+    \r
+                               if( xCyaSSL_Object != NULL )\r
+                               {\r
+                                       /* Associate the created CyaSSL object with the connected \r
+                                       socket. */\r
+                                       xReturned = CyaSSL_set_fd( xCyaSSL_Object, xConnectedSocket );\r
+                                       configASSERT( xReturned == SSL_SUCCESS );\r
+\r
+                                       do\r
+                                       {\r
+                                               /* The next line is the secure equivalent to the \r
+                                               standard sockets call:\r
+                                               lBytes = recv( xConnectedSocket, cReceivedString, 50, 0 ); */\r
+                                               lBytes = CyaSSL_read( xCyaSSL_Object, cReceivedString, sizeof( cReceivedString ) );\r
+                                               \r
+                                               /* Print the received characters. */\r
+                                               if( lBytes > 0 )\r
+                                               {\r
+                                                       printf( "Received by the secure server: %s\r\n", cReceivedString );\r
+                                               }\r
+\r
+                                       } while ( lBytes > 0 );\r
+\r
+                                       /* The connection was closed, close the socket and free the\r
+                                       CyaSSL object. */\r
+                                       closesocket( xConnectedSocket );                                        \r
+                                       CyaSSL_free( xCyaSSL_Object );\r
+                                       printf( "Connection closed, back to start\r\n\r\n" );\r
+                               }                                                               \r
+                       }\r
+               } \r
+       }\r
+       else\r
+       {\r
+               /* The socket could not be opened. */\r
+               vTaskDelete( NULL );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static SOCKET prvOpenServerSocket( void )\r
+{\r
+WSADATA xWSAData;\r
+WORD wVersionRequested;\r
+struct sockaddr_in xConnection;\r
+SOCKET xSocket = INVALID_SOCKET;\r
+\r
+       wVersionRequested = MAKEWORD( 2, 2 );\r
+\r
+       /* Prepare to use WinSock. */\r
+       if( WSAStartup( wVersionRequested, &xWSAData ) != 0 )\r
+       {\r
+               fprintf( stderr, "Could not open Windows connection.\n" );\r
+       }\r
+       else\r
+       {\r
+               xSocket = socket( AF_INET, SOCK_STREAM, 0 );\r
+               if( xSocket == INVALID_SOCKET)\r
+               {\r
+                       fprintf( stderr, "Could not create socket.\n" );\r
+                       WSACleanup();\r
+               }\r
+               else\r
+               {\r
+                       /* Zero out the server structure. */\r
+                       memset( ( void * ) &xConnection, 0x00, sizeof( struct sockaddr_in ) );\r
+\r
+                       xConnection.sin_family = AF_INET;\r
+                       xConnection.sin_addr.s_addr = inet_addr("127.0.0.1");\r
+                       xConnection.sin_port = htons( configTCP_PORT_NUMBER );\r
+\r
+                       /* Bind the address to the socket. */\r
+                       if( bind( xSocket, ( struct sockaddr * ) &xConnection, sizeof( struct sockaddr_in ) ) == -1 )\r
+                       {\r
+                               fprintf( stderr, "Could not socket to port %d.\n", configTCP_PORT_NUMBER );\r
+                               closesocket( xSocket );\r
+                               xSocket = INVALID_SOCKET;\r
+                               WSACleanup();\r
+                       }\r
+\r
+                       if( listen( xSocket, 20 ) != 0 )\r
+                       {\r
+                               closesocket( xSocket );\r
+                               xSocket = INVALID_SOCKET;\r
+                               WSACleanup();\r
+                       }\r
+               }\r
+       }\r
+\r
+       return xSocket;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvInitialiseCyaSSL( void )\r
+{\r
+int32_t iReturn;\r
+\r
+       #ifdef DEBUG_CYASSL\r
+       {\r
+               CyaSSL_Debugging_ON();\r
+       }\r
+       #endif\r
+\r
+    /* Initialise CyaSSL.  This must be done before any other CyaSSL functions\r
+    are called. */\r
+    CyaSSL_Init();\r
+\r
+    /* Attempt to create a context that uses the TLS V1 server protocol. */\r
+    xCyaSSL_ServerContext = CyaSSL_CTX_new( CyaTLSv1_server_method() );\r
+\r
+    if( xCyaSSL_ServerContext != NULL )\r
+    {\r
+        /* Load the CA certificate.  Real applications should ensure that\r
+        CyaSSL_CTX_load_verify_locations() returns SSL_SUCCESS before \r
+               proceeding. */\r
+        iReturn = CyaSSL_CTX_load_verify_locations( xCyaSSL_ServerContext, "ca-cert.pem", 0 );\r
+               configASSERT( iReturn == SSL_SUCCESS );\r
+\r
+               iReturn = CyaSSL_CTX_use_certificate_file( xCyaSSL_ServerContext, "server-cert.pem", SSL_FILETYPE_PEM );\r
+               configASSERT( iReturn == SSL_SUCCESS );\r
+\r
+               iReturn = CyaSSL_CTX_use_PrivateKey_file( xCyaSSL_ServerContext, "server-key.pem", SSL_FILETYPE_PEM );\r
+               configASSERT( iReturn == SSL_SUCCESS );\r
+    }\r
+}\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj
new file mode 100644 (file)
index 0000000..0290eb1
--- /dev/null
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>\r
+    <ProjectName>RTOSDemo</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\Source\CyaSSL;..\..\..\FreeRTOS\Source\include;..\..\..\FreeRTOS\Source\portable\MSVC-MingW;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;SIZEOF_LONG_LONG=8;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Debug/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>\r
+      </AdditionalLibraryDirectories>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Debug/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <AdditionalIncludeDirectories>..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Release/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Release/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\aes.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\arc4.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\asn.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\coding.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\des3.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\dh.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\dsa.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\hc128.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\hmac.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\integer.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\logging.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\md4.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\md5.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\memory.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\misc.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\pwdbased.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\rabbit.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\random.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\rsa.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\sha.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\sha256.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\internal.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\io.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\keys.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\ssl.c" />\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\tls.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_3.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c" />\r
+    <ClCompile Include="main.c">\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="SecureTCPClientTask.c" />\r
+    <ClCompile Include="SecureTCPServerTask.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="FreeRTOSConfig.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.filters b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.filters
new file mode 100644 (file)
index 0000000..82abb1f
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{38712199-cebf-4124-bf15-398f7c3419ea}</UniqueIdentifier>\r
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+    <Filter Include="Demo App Source">\r
+      <UniqueIdentifier>{34567deb-d5ab-4a56-8640-0aaec609521a}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS">\r
+      <UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source">\r
+      <UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>\r
+      <Extensions>*.c</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source\Portable">\r
+      <UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+">\r
+      <UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\CyaSSL">\r
+      <UniqueIdentifier>{8b481200-a9e5-48a4-98ad-49d2783cd652}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\CyaSSL\ctaocrypt">\r
+      <UniqueIdentifier>{738eaad9-4e49-4309-9074-c3d9e102fb4a}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="main.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_3.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\internal.c">\r
+      <Filter>FreeRTOS+\CyaSSL</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\io.c">\r
+      <Filter>FreeRTOS+\CyaSSL</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\keys.c">\r
+      <Filter>FreeRTOS+\CyaSSL</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\ssl.c">\r
+      <Filter>FreeRTOS+\CyaSSL</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\src\tls.c">\r
+      <Filter>FreeRTOS+\CyaSSL</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\aes.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\arc4.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\asn.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\coding.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\des3.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\dh.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\dsa.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\hc128.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\hmac.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\integer.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\logging.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\md4.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\md5.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\memory.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\misc.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\pwdbased.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\rabbit.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\random.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\rsa.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\sha256.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\CyaSSL\ctaocrypt\src\sha.c">\r
+      <Filter>FreeRTOS+\CyaSSL\ctaocrypt</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="SecureTCPServerTask.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="SecureTCPClientTask.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="FreeRTOSConfig.h">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.user b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/WIN32.vcxproj.user
new file mode 100644 (file)
index 0000000..695b5c7
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/ca-cert.pem b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/ca-cert.pem
new file mode 100644 (file)
index 0000000..4a9786a
--- /dev/null
@@ -0,0 +1,87 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e9:d0:a7:5f:79:25:f4:3c
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:18:15 2011 GMT
+            Not After : Jul 20 18:18:15 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
+                    f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
+                    de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
+                    21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
+                    32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
+                    8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
+                    a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
+                    a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
+                    82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
+                    3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
+                    76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
+                    73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
+                    de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
+                    cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
+                    b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
+                    13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
+                    ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
+                    36:79
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+            X509v3 Authority Key Identifier: 
+                keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+                DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:E9:D0:A7:5F:79:25:F4:3C
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
+        4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
+        e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
+        f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
+        af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
+        98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
+        8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
+        1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
+        61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
+        1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
+        60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
+        18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
+        f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
+        b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
+        5a:1f:7f:ca
+-----BEGIN CERTIFICATE-----
+MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
+VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
+A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
+dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
+MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
+8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
+EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
+dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
+mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
+CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
+BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
+P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
+dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
+BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
+9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
+PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
+Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
+G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
+ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
+rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/main.c
new file mode 100644 (file)
index 0000000..968bebb
--- /dev/null
@@ -0,0 +1,177 @@
+/*\r
+    FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*\r
+ ******************************************************************************\r
+ * -NOTE- The Win32 port is a simulation (or is that emulation?) only!  Do not\r
+ * expect to get real time behaviour from the Win32 port or this demo\r
+ * application.  It is provided as a convenient development and demonstration\r
+ * test bed only.  This was tested using Windows XP on a dual core laptop.\r
+ *\r
+ * In this example, one simulated millisecond will take approximately 40ms to\r
+ * execute.  See the documentation page for the Windows simulator for an \r
+ * explanation of the slow timing:\r
+ * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
+ ******************************************************************************\r
+ *\r
+ * This is a simple FreeRTOS Windows simulator project that makes it easy to \r
+ * evaluate CyaSSL in a FreeRTOS environment on a standard desktop PC, and \r
+ * without any external hardware or interfaces being required.\r
+ *\r
+ * main() creates a TCP server task, which initialises CyaSSL, before creating a\r
+ * TCP client task.  Both the server and client use TLS secured sockets.\r
+ *\r
+ * The client task repeatedly connects to the server, sends 10 messages, then \r
+ * disconnects.  The server task prints the contents of each message to the\r
+ * console as they are received.\r
+ *\r
+ * CyaSSL objects are created and deleted as each socket connects and\r
+ * disconnects respectively.\r
+ *\r
+ * The server task is implemented in SecureTCPServerTask.c, and the client task\r
+ * in SecureTCPClientTask.c.\r
+ *\r
+ * Visit http://www.FreeRTOS.org/ssl for FreeRTOS + CyaSSL for demo \r
+ * documentation.\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+#include "task.h"\r
+\r
+/* This application is using the FreeRTOS Windows simulator, which uses the\r
+FreeRTOS scheduler to schedule FreeRTOS task within the Windows environment.\r
+The Windows environment must not be allowed to block any Windows threads that\r
+are running FreeRTOS tasks, unless the FreeRTOS task is running at the FreeRTOS\r
+idle priority.  For simplicity, this demo uses the Windows TCP/IP stack, the\r
+API for which can cause Windows threads to block.  Therefore, any FreeRTOS task\r
+that makes calls to the Windows TCP/IP stack must be assigned the idle priority.\r
+Note this is only a restriction of the simulated Windows environment - real\r
+FreeRTOS ports do not have this restriction. */\r
+#define mainSECURE_SERVER_TASK_PRIORITY                ( tskIDLE_PRIORITY )\r
+\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * The task that implements the server side.\r
+ */\r
+extern void vSecureTCPServerTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+int main( void )\r
+{\r
+const uint32_t ulLongTime_ms = 250UL;\r
+\r
+       /* Create the TCP server task.  This will itself create the client task\r
+       once it has completed the CyaSSL initialisation. */\r
+       xTaskCreate( vSecureTCPServerTask, ( signed char * ) "Server", configMINIMAL_STACK_SIZE, NULL, mainSECURE_SERVER_TASK_PRIORITY, NULL );\r
+\r
+       /* Start the task running. */\r
+       vTaskStartScheduler();\r
+\r
+       /* If all is well, the scheduler will now be running, and the following\r
+       line will never be reached.  If the following line does execute, then\r
+       there was insufficient FreeRTOS heap memory available for the idle and/or\r
+       timer tasks     to be created.  See the memory management section on the\r
+       FreeRTOS web site for more details (this is standard text that is not not \r
+       really applicable to the Win32 simulator port). */\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongTime_ms );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+const unsigned long ulMSToSleep = 5;\r
+\r
+       /* This function is called on each cycle of the idle task if\r
+       configUSE_IDLE_HOOK is set to 1 in FreeRTOSConfig.h.  Sleep to reduce CPU \r
+       load. */\r
+       Sleep( ulMSToSleep );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( void )\r
+{\r
+const unsigned long ulLongSleep = 1000UL;\r
+\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongSleep );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-cert.pem b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-cert.pem
new file mode 100644 (file)
index 0000000..8381265
--- /dev/null
@@ -0,0 +1,158 @@
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 2 (0x2)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:27:13 2011 GMT
+            Not After : Jul 20 18:27:13 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=yaSSL, OU=Support, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:c0:95:08:e1:57:41:f2:71:6d:b7:d2:45:41:27:
+                    01:65:c6:45:ae:f2:bc:24:30:b8:95:ce:2f:4e:d6:
+                    f6:1c:88:bc:7c:9f:fb:a8:67:7f:fe:5c:9c:51:75:
+                    f7:8a:ca:07:e7:35:2f:8f:e1:bd:7b:c0:2f:7c:ab:
+                    64:a8:17:fc:ca:5d:7b:ba:e0:21:e5:72:2e:6f:2e:
+                    86:d8:95:73:da:ac:1b:53:b9:5f:3f:d7:19:0d:25:
+                    4f:e1:63:63:51:8b:0b:64:3f:ad:43:b8:a5:1c:5c:
+                    34:b3:ae:00:a0:63:c5:f6:7f:0b:59:68:78:73:a6:
+                    8c:18:a9:02:6d:af:c3:19:01:2e:b8:10:e3:c6:cc:
+                    40:b4:69:a3:46:33:69:87:6e:c4:bb:17:a6:f3:e8:
+                    dd:ad:73:bc:7b:2f:21:b5:fd:66:51:0c:bd:54:b3:
+                    e1:6d:5f:1c:bc:23:73:d1:09:03:89:14:d2:10:b9:
+                    64:c3:2a:d0:a1:96:4a:bc:e1:d4:1a:5b:c7:a0:c0:
+                    c1:63:78:0f:44:37:30:32:96:80:32:23:95:a1:77:
+                    ba:13:d2:97:73:e2:5d:25:c9:6a:0d:c3:39:60:a4:
+                    b4:b0:69:42:42:09:e9:d8:08:bc:33:20:b3:58:22:
+                    a7:aa:eb:c4:e1:e6:61:83:c5:d2:96:df:d9:d0:4f:
+                    ad:d7
+                Exponent: 65537 (0x10001)
+    Signature Algorithm: sha1WithRSAEncryption
+        71:4e:d3:62:df:cc:4c:f7:cd:b7:6e:52:0b:6c:6e:e0:bd:c2:
+        2d:07:d7:c0:b0:6e:43:1e:35:bc:30:01:50:f0:ff:99:23:6c:
+        18:1a:41:b6:11:d6:d4:19:61:fd:e4:77:97:1c:39:e1:57:ab:
+        c5:15:63:77:11:36:5e:74:e2:24:0b:1f:41:78:ad:b7:81:e7:
+        b4:40:66:80:f0:4b:91:a0:6d:a8:6e:3d:53:d9:8b:ce:2a:e1:
+        0b:45:65:87:a1:96:ae:ee:3e:88:d5:12:1f:78:17:ae:2c:c5:
+        73:44:d8:dc:f4:af:d8:cc:ae:4c:e1:0c:be:55:a4:99:f7:6e:
+        96:c0:c8:45:87:bf:dc:51:57:ff:9e:73:37:6a:18:9c:c3:f9:
+        22:7a:f4:b0:52:bd:fc:21:30:f8:c5:ff:1e:87:7d:ad:a2:5a:
+        35:f5:22:a8:b4:0a:76:38:e6:76:b0:98:af:1b:ec:8a:0a:43:
+        74:d2:85:34:37:84:07:e1:f6:23:b2:29:de:a6:b6:b7:4c:57:
+        7e:96:06:cb:a9:16:25:29:3a:03:2d:55:7d:a6:8c:a4:f7:9e:
+        81:c9:95:b6:7c:c1:4a:ce:94:66:0c:ca:88:eb:d2:09:f5:5b:
+        19:58:82:df:27:fd:67:95:78:b7:02:06:d5:a7:61:bd:ef:3a:
+        fc:b2:61:cd
+-----BEGIN CERTIFICATE-----
+MIIDkDCCAngCAQIwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTExMDI0MTgyNzEzWhcN
+MTQwNzIwMTgyNzEzWjCBijELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB01vbnRhbmEx
+EDAOBgNVBAcTB0JvemVtYW4xDjAMBgNVBAoTBXlhU1NMMRAwDgYDVQQLEwdTdXBw
+b3J0MRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZv
+QHlhc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMCVCOFX
+QfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hnf/5cnFF194rKB+c1L4/h
+vXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/XGQ0lT+FjY1GLC2Q/rUO4
+pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bMQLRpo0YzaYduxLsXpvPo
+3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq0KGWSrzh1Bpbx6DAwWN4
+D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ6dgIvDMgs1gip6rrxOHm
+YYPF0pbf2dBPrdcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAcU7TYt/MTPfNt25S
+C2xu4L3CLQfXwLBuQx41vDABUPD/mSNsGBpBthHW1Blh/eR3lxw54VerxRVjdxE2
+XnTiJAsfQXitt4HntEBmgPBLkaBtqG49U9mLzirhC0Vlh6GWru4+iNUSH3gXrizF
+c0TY3PSv2MyuTOEMvlWkmfdulsDIRYe/3FFX/55zN2oYnMP5Inr0sFK9/CEw+MX/
+Hod9raJaNfUiqLQKdjjmdrCYrxvsigpDdNKFNDeEB+H2I7Ip3qa2t0xXfpYGy6kW
+JSk6Ay1VfaaMpPeegcmVtnzBSs6UZgzKiOvSCfVbGViC3yf9Z5V4twIG1adhve86
+/LJhzQ==
+-----END CERTIFICATE-----
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e9:d0:a7:5f:79:25:f4:3c
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:18:15 2011 GMT
+            Not After : Jul 20 18:18:15 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
+                    f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
+                    de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
+                    21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
+                    32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
+                    8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
+                    a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
+                    a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
+                    82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
+                    3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
+                    76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
+                    73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
+                    de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
+                    cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
+                    b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
+                    13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
+                    ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
+                    36:79
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+            X509v3 Authority Key Identifier: 
+                keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+                DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:E9:D0:A7:5F:79:25:F4:3C
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
+        4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
+        e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
+        f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
+        af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
+        98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
+        8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
+        1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
+        61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
+        1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
+        60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
+        18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
+        f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
+        b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
+        5a:1f:7f:ca
+-----BEGIN CERTIFICATE-----
+MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
+VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
+A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
+dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
+MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
+8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
+EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
+dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
+mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
+CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
+BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
+P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
+dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
+BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
+9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
+PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
+Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
+G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
+ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
+rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-key.pem b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/server-key.pem
new file mode 100644 (file)
index 0000000..d1627f4
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAwJUI4VdB8nFtt9JFQScBZcZFrvK8JDC4lc4vTtb2HIi8fJ/7
+qGd//lycUXX3isoH5zUvj+G9e8AvfKtkqBf8yl17uuAh5XIuby6G2JVz2qwbU7lf
+P9cZDSVP4WNjUYsLZD+tQ7ilHFw0s64AoGPF9n8LWWh4c6aMGKkCba/DGQEuuBDj
+xsxAtGmjRjNph27Euxem8+jdrXO8ey8htf1mUQy9VLPhbV8cvCNz0QkDiRTSELlk
+wyrQoZZKvOHUGlvHoMDBY3gPRDcwMpaAMiOVoXe6E9KXc+JdJclqDcM5YKS0sGlC
+Qgnp2Ai8MyCzWCKnquvE4eZhg8XSlt/Z0E+t1wIDAQABAoIBAQCa0DQPUmIFUAHv
+n+1kbsLE2hryhNeSEEiSxOlq64t1bMZ5OPLJckqGZFSVd8vDmp231B2kAMieTuTd
+x7pnFsF0vKnWlI8rMBr77d8hBSPZSjm9mGtlmrjcxH3upkMVLj2+HSJgKnMw1T7Y
+oqyGQy7E9WReP4l1DxHYUSVOn9iqo85gs+KK2X4b8GTKmlsFC1uqy+XjP24yIgXz
+0PrvdFKB4l90073/MYNFdfpjepcu1rYZxpIm5CgGUFAOeC6peA0Ul7QS2DFAq6EB
+QcIw+AdfFuRhd9Jg8p+N6PS662PeKpeB70xs5lU0USsoNPRTHMRYCj+7r7X3SoVD
+LTzxWFiBAoGBAPIsVHY5I2PJEDK3k62vvhl1loFk5rW4iUJB0W3QHBv4G6xpyzY8
+ZH3c9Bm4w2CxV0hfUk9ZOlV/MsAZQ1A/rs5vF/MOn0DKTq0VO8l56cBZOHNwnAp8
+yTpIMqfYSXUKhcLC/RVz2pkJKmmanwpxv7AEpox6Wm9IWlQ7xrFTF9/nAoGBAMuT
+3ncVXbdcXHzYkKmYLdZpDmOzo9ymzItqpKISjI57SCyySzfcBhh96v52odSh6T8N
+zRtfr1+elltbD6F8r7ObkNtXczrtsCNErkFPHwdCEyNMy/r0FKTV9542fFufqDzB
+hV900jkt/9CE3/uzIHoumxeu5roLrl9TpFLtG8SRAoGBAOyY2rvV/vlSSn0CVUlv
+VW5SL4SjK7OGYrNU0mNS2uOIdqDvixWl0xgUcndex6MEH54ZYrUbG57D8rUy+UzB
+qusMJn3UX0pRXKRFBnBEp1bA1CIUdp7YY1CJkNPiv4GVkjFBhzkaQwsYpVMfORpf
+H0O8h2rfbtMiAP4imHBOGhkpAoGBAIpBVihRnl/Ungs7mKNU8mxW1KrpaTOFJAza
+1AwtxL9PAmk4fNTm3Ezt1xYRwz4A58MmwFEC3rt1nG9WnHrzju/PisUr0toGakTJ
+c/5umYf4W77xfOZltU9s8MnF/xbKixsX4lg9ojerAby/QM5TjI7t7+5ZneBj5nxe
+9Y5L8TvBAoGATUX5QIzFW/QqGoq08hysa+kMVja3TnKW1eWK0uL/8fEYEz2GCbjY
+dqfJHHFSlDBD4PF4dP1hG0wJzOZoKnGtHN9DvFbbpaS+NXCkXs9P/ABVmTo9I89n
+WvUi+LUp0EQR6zUuRr79jhiyX6i/GTKh9dwD5nyaHwx8qbAOITc78bA=
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.cproject b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.cproject
new file mode 100644 (file)
index 0000000..290712e
--- /dev/null
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<?fileVersion 4.0.0?>\r
+\r
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
+       <storageModule moduleId="org.eclipse.cdt.core.settings">\r
+               <cconfiguration id="com.crt.advproject.config.exe.debug.56486929">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.debug.56486929" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+                               <externalSettings/>\r
+                               <extensions>\r
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
+                               </extensions>\r
+                       </storageModule>\r
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+                               <configuration artifactExtension="axf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="Debug build" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser" id="com.crt.advproject.config.exe.debug.56486929" name="Debug" parent="com.crt.advproject.config.exe.debug" postannouncebuildStep="Performing post-build steps" postbuildStep="arm-none-eabi-size &quot;${BuildArtifactFileName}&quot;; # arm-none-eabi-objcopy -O binary &quot;${BuildArtifactFileName}&quot; &quot;${BuildArtifactFileBaseName}.bin&quot; ; checksum -p ${TargetChip} -d &quot;${BuildArtifactFileBaseName}.bin&quot;;  ">\r
+                                       <folderInfo id="com.crt.advproject.config.exe.debug.56486929." name="/" resourcePath="">\r
+                                               <toolChain id="com.crt.advproject.toolchain.exe.debug.1736903826" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug">\r
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug.358467611" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>\r
+                                                       <builder buildPath="${workspace_loc:/FreeRTOS_UDP_Demo/Debug}" id="com.crt.advproject.builder.exe.debug.710857417" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="com.crt.advproject.builder.exe.debug">\r
+                                                               <outputEntries>\r
+                                                                       <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Debug"/>\r
+                                                                       <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Release"/>\r
+                                                               </outputEntries>\r
+                                                       </builder>\r
+                                                       <tool id="com.crt.advproject.cpp.exe.debug.359174792" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug"/>\r
+                                                       <tool id="com.crt.advproject.gcc.exe.debug.517029683" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug">\r
+                                                               <option id="com.crt.advproject.gcc.arch.79720019" name="Architecture" superClass="com.crt.advproject.gcc.arch" value="com.crt.advproject.gcc.target.cm3" valueType="enumerated"/>\r
+                                                               <option id="com.crt.advproject.gcc.thumb.1093240773" name="Thumb mode" superClass="com.crt.advproject.gcc.thumb" value="true" valueType="boolean"/>\r
+                                                               <option id="gnu.c.compiler.option.preprocessor.def.symbols.156210417" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">\r
+                                                                       <listOptionValue builtIn="false" value="__REDLIB__"/>\r
+                                                                       <listOptionValue builtIn="false" value="__USE_CMSIS"/>\r
+                                                                       <listOptionValue builtIn="false" value="DEBUG"/>\r
+                                                                       <listOptionValue builtIn="false" value="__CODE_RED"/>\r
+                                                                       <listOptionValue builtIn="false" value="CORE_M3"/>\r
+                                                                       <listOptionValue builtIn="false" value="__LPC18XX__"/>\r
+                                                               </option>\r
+                                                               <option id="gnu.c.compiler.option.misc.other.732935978" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wextra" valueType="string"/>\r
+                                                               <option id="com.crt.advproject.gcc.hdrlib.1620518189" name="Use headers for C library" superClass="com.crt.advproject.gcc.hdrlib" value="com.crt.advproject.gcc.hdrlib.codered" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.include.paths.1643954527" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ThirdParty/TraceRecorderSrc/Include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Plus_CLI}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Examples/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ThirdParty/USB_CDC/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/ARM_CM3}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Plus_UDP/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Plus_UDP/portable/Compiler/GCC}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc}&quot;"/>\r
+                                                               </option>\r
+                                                               <inputType id="com.crt.advproject.compiler.input.927112517" superClass="com.crt.advproject.compiler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.gas.exe.debug.281614531" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">\r
+                                                               <option id="com.crt.advproject.gas.arch.247575353" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>\r
+                                                               <option id="com.crt.advproject.gas.thumb.852781844" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>\r
+                                                               <option id="gnu.both.asm.option.flags.crt.1159577990" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__REDLIB__ -DDEBUG -D__CODE_RED" valueType="string"/>\r
+                                                               <option id="com.crt.advproject.gas.hdrlib.1844219337" name="Use headers for C library" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.codered" valueType="enumerated"/>\r
+                                                               <option id="gnu.both.asm.option.include.paths.1881892397" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1850237032" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="com.crt.advproject.assembler.input.1243504913" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.link.cpp.exe.debug.1490011469" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>\r
+                                                       <tool id="com.crt.advproject.link.exe.debug.1212311005" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">\r
+                                                               <option id="com.crt.advproject.link.arch.1240101764" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>\r
+                                                               <option id="com.crt.advproject.link.thumb.570286733" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>\r
+                                                               <option id="com.crt.advproject.link.script.1691634442" name="Linker script" superClass="com.crt.advproject.link.script" value="&quot;FreeRTOS_UDP_Demo_Debug.ld&quot;" valueType="string"/>\r
+                                                               <option id="com.crt.advproject.link.manage.234522607" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>\r
+                                                               <option id="gnu.c.link.option.nostdlibs.2023812520" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>\r
+                                                               <option id="gnu.c.link.option.other.1608563250" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">\r
+                                                                       <listOptionValue builtIn="false" value="-Map=&quot;${BuildArtifactFileBaseName}.map&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="--gc-sections"/>\r
+                                                               </option>\r
+                                                               <option id="com.crt.advproject.link.gcc.hdrlib.2006557555" name="Use C library" superClass="com.crt.advproject.link.gcc.hdrlib" value="com.crt.advproject.gcc.link.hdrlib.codered.nohost" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.link.option.nodeflibs.2072403274" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.c.link.option.nodeflibs" value="false" valueType="boolean"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1085761099" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
+                                                               </inputType>\r
+                                                       </tool>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <folderInfo id="com.crt.advproject.config.exe.debug.56486929.980802473" name="/" resourcePath="ThirdParty/TraceRecorderSrc">\r
+                                               <toolChain id="com.crt.advproject.toolchain.exe.debug.709674187" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug" unusedChildren="">\r
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>\r
+                                                       <tool id="com.crt.advproject.cpp.exe.debug.1303446668" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug.359174792"/>\r
+                                                       <tool id="com.crt.advproject.gcc.exe.debug.1458430819" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug.517029683">\r
+                                                               <option id="com.crt.advproject.gcc.exe.debug.option.optimization.level.1862136849" name="Optimization Level" superClass="com.crt.advproject.gcc.exe.debug.option.optimization.level" value="gnu.c.optimization.level.size" valueType="enumerated"/>\r
+                                                               <inputType id="com.crt.advproject.compiler.input.1947025281" superClass="com.crt.advproject.compiler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.gas.exe.debug.1770773733" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug.281614531">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1311215667" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="com.crt.advproject.assembler.input.1953406684" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.link.cpp.exe.debug.997074386" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug.1490011469"/>\r
+                                                       <tool id="com.crt.advproject.link.exe.debug.953255510" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug.1212311005"/>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <folderInfo id="com.crt.advproject.config.exe.debug.56486929.1781697322" name="/" resourcePath="ThirdParty/CMSISv2p10_LPC18xx_DriverLib">\r
+                                               <toolChain id="com.crt.advproject.toolchain.exe.debug.222538953" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug" unusedChildren="">\r
+                                                       <tool id="com.crt.advproject.cpp.exe.debug.906161578" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug.359174792"/>\r
+                                                       <tool id="com.crt.advproject.gcc.exe.debug.1015468334" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug.517029683">\r
+                                                               <option id="com.crt.advproject.gcc.exe.debug.option.optimization.level.2021633161" superClass="com.crt.advproject.gcc.exe.debug.option.optimization.level" value="gnu.c.optimization.level.size" valueType="enumerated"/>\r
+                                                               <inputType id="com.crt.advproject.compiler.input.1878730423" superClass="com.crt.advproject.compiler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.gas.exe.debug.253843695" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug.281614531">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1935362347" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="com.crt.advproject.assembler.input.190369423" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.link.cpp.exe.debug.1715304950" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug.1490011469"/>\r
+                                                       <tool id="com.crt.advproject.link.exe.debug.536813209" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug.1212311005"/>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <folderInfo id="com.crt.advproject.config.exe.debug.56486929.2106668528" name="/" resourcePath="ThirdParty/USB_CDC">\r
+                                               <toolChain id="com.crt.advproject.toolchain.exe.debug.1865989435" name="Code Red MCU Tools" superClass="com.crt.advproject.toolchain.exe.debug" unusedChildren="">\r
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="com.crt.advproject.platform.exe.debug" name="ARM-based MCU (Debug)" superClass="com.crt.advproject.platform.exe.debug"/>\r
+                                                       <tool id="com.crt.advproject.cpp.exe.debug.1158267972" name="MCU C++ Compiler" superClass="com.crt.advproject.cpp.exe.debug.359174792"/>\r
+                                                       <tool id="com.crt.advproject.gcc.exe.debug.1784372430" name="MCU C Compiler" superClass="com.crt.advproject.gcc.exe.debug.517029683">\r
+                                                               <option id="com.crt.advproject.gcc.exe.debug.option.optimization.level.369260631" name="Optimization Level" superClass="com.crt.advproject.gcc.exe.debug.option.optimization.level" value="gnu.c.optimization.level.size" valueType="enumerated"/>\r
+                                                               <inputType id="com.crt.advproject.compiler.input.466388069" superClass="com.crt.advproject.compiler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.gas.exe.debug.401476199" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug.281614531">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1255426283" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                                                               <inputType id="com.crt.advproject.assembler.input.882456885" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                       </tool>\r
+                                                       <tool id="com.crt.advproject.link.cpp.exe.debug.2009352548" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug.1490011469"/>\r
+                                                       <tool id="com.crt.advproject.link.exe.debug.1734116997" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug.1212311005"/>\r
+                                               </toolChain>\r
+                                       </folderInfo>\r
+                                       <fileInfo id="com.crt.advproject.config.exe.debug.56486929.src/cr_startup_lpc18xx.cpp" name="cr_startup_lpc18xx.cpp" rcbsApplicability="disable" resourcePath="src/cr_startup_lpc18xx.cpp" toolsToInvoke=""/>\r
+                                       <sourceEntries>\r
+                                               <entry excluding="ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_wwdt.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_utils.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_uart.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_timer.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_ssp.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_sct.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rtc.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rit.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_qei.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_pwr.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_nvic.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_mcpwm.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_libcfg_default.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_lcd.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2s.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2c.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpdma.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_evrt.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_emc.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_dac.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_can.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_atimer.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_adc.c|ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/debug_frmwrk.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
+                               </configuration>\r
+                       </storageModule>\r
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+               </cconfiguration>\r
+       </storageModule>\r
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
+               <project id="FreeRTOS_UDP_Demo.com.crt.advproject.projecttype.exe.1394466011" name="Executable" projectType="com.crt.advproject.projecttype.exe"/>\r
+       </storageModule>\r
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
+       <storageModule moduleId="com.crt.config">\r
+               <projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#13;\r
+&lt;TargetConfig&gt;&#13;\r
+&lt;Properties property_0="" property_2="LPC1850A_4350A_SPIFI.cfx" property_3="NXP" property_4="LPC1830" property_count="5" version="1"/&gt;&#13;\r
+&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC1830" match_id="0x0" name="LPC1830" stub="crt_emu_lpc18_43_nxp"&gt;&lt;chip&gt;&lt;name&gt;LPC1830&lt;/name&gt;&#13;\r
+&lt;family&gt;LPC18xx&lt;/family&gt;&#13;\r
+&lt;vendor&gt;NXP (formerly Philips)&lt;/vendor&gt;&#13;\r
+&lt;reset board="None" core="Real" sys="Real"/&gt;&#13;\r
+&lt;clock changeable="TRUE" freq="20MHz" is_accurate="TRUE"/&gt;&#13;\r
+&lt;memory can_program="true" id="Flash" is_ro="true" type="Flash"/&gt;&#13;\r
+&lt;memory id="RAM" type="RAM"/&gt;&#13;\r
+&lt;memory id="Periph" is_volatile="true" type="Peripheral"/&gt;&#13;\r
+&lt;memoryInstance derived_from="Flash" edited="true" id="SPIFlash" location="0x14000000" size="0x400000"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" edited="true" id="RamLoc96" location="0x10000000" size="0x18000"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" edited="true" id="RamLoc40" location="0x10080000" size="0xa000"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" edited="true" id="RamAHB32" location="0x20000000" size="0x8000"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" edited="true" id="RamAHB16" location="0x20008000" size="0x4000"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" edited="true" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SCT" id="SCT" location="0x40000000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x40002000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x40004000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="EMC" id="EMC" location="0x40005000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="USB0" id="USB0" location="0x40006000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="USB1" id="USB1" location="0x40007000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x40010000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="ATIMER" id="ATIMER" location="0x40040000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="REGFILE" id="REGFILE" location="0x40041000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="PMC" id="PMC" location="0x40042000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="CREG" id="CREG" location="0x40043000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="EVENTROUTER" id="EVENTROUTER" location="0x40044000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="RTC" id="RTC" location="0x40046000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="CGU" id="CGU" location="0x40050000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="CCU1" id="CCU1" location="0x40051000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="CCU2" id="CCU2" location="0x40052000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="RGU" id="RGU" location="0x40053000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="WWDT" id="WWDT" location="0x40080000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="USART0" id="USART0" location="0x40081000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="USART2" id="USART2" location="0x400c1000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="USART3" id="USART3" location="0x400c2000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="UART1" id="UART1" location="0x40082000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SSP0" id="SSP0" location="0x40083000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SSP1" id="SSP1" location="0x400c5000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40084000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40085000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x400c3000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x400c4000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SCU" id="SCU" location="0x40086000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x40087000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x40088000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40089000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400a0000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="I2C0" id="I2C0" location="0x400a1000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="I2C1" id="I2C1" location="0x400e0000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="I2S0" id="I2S0" location="0x400a2000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="I2S1" id="I2S1" location="0x400a3000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="C-CAN1" id="C-CAN1" location="0x400a4000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x400c0000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="QEI" id="QEI" location="0x400c6000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GIMA" id="GIMA" location="0x400c7000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="DAC" id="DAC" location="0x400e1000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="C-CAN0" id="C-CAN0" location="0x400e2000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="ADC0" id="ADC0" location="0x400e3000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="ADC1" id="ADC1" location="0x400e4000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x400f4000"/&gt;&#13;\r
+&lt;/chip&gt;&#13;\r
+&lt;processor&gt;&lt;name gcc_name="cortex-m3"&gt;Cortex-M3&lt;/name&gt;&#13;\r
+&lt;family&gt;Cortex-M&lt;/family&gt;&#13;\r
+&lt;/processor&gt;&#13;\r
+&lt;link href="nxp_lpc18xx_peripheral.xme" show="embed" type="simple"/&gt;&#13;\r
+&lt;/info&gt;&#13;\r
+&lt;/infoList&gt;&#13;\r
+&lt;/TargetConfig&gt;</projectStorage>\r
+       </storageModule>\r
+       <storageModule moduleId="refreshScope" versionNumber="2">\r
+               <configuration configurationName="Release">\r
+                       <resource resourceType="PROJECT" workspacePath="/FreeRTOS_UDP_Demo"/>\r
+               </configuration>\r
+               <configuration configurationName="Debug">\r
+                       <resource resourceType="PROJECT" workspacePath="/FreeRTOS_UDP_Demo"/>\r
+               </configuration>\r
+       </storageModule>\r
+       <storageModule moduleId="scannerConfiguration">\r
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.56486929;com.crt.advproject.config.exe.debug.56486929.;com.crt.advproject.gcc.exe.debug.517029683;com.crt.advproject.compiler.input.927112517">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+               </scannerConfigBuildInfo>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.56486929;com.crt.advproject.config.exe.debug.56486929.;com.crt.advproject.gas.exe.debug.281614531;com.crt.advproject.assembler.input.1243504913">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+               </scannerConfigBuildInfo>\r
+       </storageModule>\r
+</cproject>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.project b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.project
new file mode 100644 (file)
index 0000000..aa42a5e
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>FreeRTOS_UDP_Demo</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\r
+                       <triggers>clean,full,incremental,</triggers>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>\r
+                       <triggers>full,incremental,</triggers>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.cdt.core.cnature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
+       </natures>\r
+</projectDescription>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.cdt.codan.core.prefs b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.cdt.codan.core.prefs
new file mode 100644 (file)
index 0000000..733f315
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1\r
+useParentScope=false\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.ltk.core.refactoring.prefs b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644 (file)
index 0000000..cfcd1d3
--- /dev/null
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1\r
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CLI-commands.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CLI-commands.c
new file mode 100644 (file)
index 0000000..043c25c
--- /dev/null
@@ -0,0 +1,670 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+ /******************************************************************************\r
+ *\r
+ * See the following URL for information on the commands defined in this file:\r
+ * http://localhost/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Ethernet_Related_CLI_Commands.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+/* FreeRTOS+CLI includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+/* FreeRTOS+UDP includes, just to make the stats available to the CLI\r
+commands. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+#ifndef  configINCLUDE_TRACE_RELATED_CLI_COMMANDS\r
+       #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0\r
+#endif\r
+\r
+\r
+/*\r
+ * Implements the run-time-stats command.\r
+ */\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the task-stats command.\r
+ */\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the echo-three-parameters command.\r
+ */\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the echo-parameters command.\r
+ */\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that prints out IP address information.\r
+ */\r
+static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that prints out the gathered demo debug stats.\r
+ */\r
+static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Defines a command that sends an ICMP ping request to an IP address.\r
+ */\r
+static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Implements the "trace start" and "trace stop" commands;\r
+ */\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+#endif\r
+\r
+/* Structure that defines the "ip-config" command line command. */\r
+static const CLI_Command_Definition_t xIPConfig =\r
+{\r
+       ( const int8_t * const ) "ip-config",\r
+       ( const int8_t * const ) "ip-config:\r\n Displays IP address configuration\r\n\r\n",\r
+       prvDisplayIPConfig,\r
+       0\r
+};\r
+\r
+#if configINCLUDE_DEMO_DEBUG_STATS != 0\r
+       /* Structure that defines the "ip-debug-stats" command line command. */\r
+       static const CLI_Command_Definition_t xIPDebugStats =\r
+       {\r
+               ( const int8_t * const ) "ip-debug-stats", /* The command string to type. */\r
+               ( const int8_t * const ) "ip-debug-stats:\r\n Shows some IP stack stats useful for debug - an example only.\r\n\r\n",\r
+               prvDisplayIPDebugStats, /* The function to run. */\r
+               0 /* No parameters are expected. */\r
+       };\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
+\r
+/* Structure that defines the "run-time-stats" command line command.   This\r
+generates a table that shows how much run time each task has */\r
+static const CLI_Command_Definition_t xRunTimeStats =\r
+{\r
+       ( const int8_t * const ) "run-time-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "run-time-stats:\r\n Displays a table showing how much processing time each FreeRTOS task has used\r\n\r\n",\r
+       prvRunTimeStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "task-stats" command line command.  This generates\r
+a table that gives information on each task in the system. */\r
+static const CLI_Command_Definition_t xTaskStats =\r
+{\r
+       ( const int8_t * const ) "task-stats", /* The command string to type. */\r
+       ( const int8_t * const ) "task-stats:\r\n Displays a table showing the state of each FreeRTOS task\r\n\r\n",\r
+       prvTaskStatsCommand, /* The function to run. */\r
+       0 /* No parameters are expected. */\r
+};\r
+\r
+/* Structure that defines the "echo_3_parameters" command line command.  This\r
+takes exactly three parameters that the command simply echos back one at a\r
+time. */\r
+static const CLI_Command_Definition_t xThreeParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo-3-parameters",\r
+       ( const int8_t * const ) "echo-3-parameters <param1> <param2> <param3>:\r\n Expects three parameters, echos each in turn\r\n\r\n",\r
+       prvThreeParameterEchoCommand, /* The function to run. */\r
+       3 /* Three parameters are expected, which can take any value. */\r
+};\r
+\r
+/* Structure that defines the "echo_parameters" command line command.  This\r
+takes a variable number of parameters that the command simply echos back one at\r
+a time. */\r
+static const CLI_Command_Definition_t xParameterEcho =\r
+{\r
+       ( const int8_t * const ) "echo-parameters",\r
+       ( const int8_t * const ) "echo-parameters <...>:\r\n Take variable number of parameters, echos each in turn\r\n\r\n",\r
+       prvParameterEchoCommand, /* The function to run. */\r
+       -1 /* The user can enter any number of commands. */\r
+};\r
+\r
+#if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+\r
+       /* Structure that defines the "ping" command line command.  This takes an IP\r
+       address or host name and (optionally) the number of bytes to ping as\r
+       parameters. */\r
+       static const CLI_Command_Definition_t xPing =\r
+       {\r
+               ( const int8_t * const ) "ping",\r
+               ( const int8_t * const ) "ping <ipaddress> <optional:bytes to send>:\r\n for example, ping 192.168.0.3 8, or ping www.example.com\r\n\r\n",\r
+               prvPingCommand, /* The function to run. */\r
+               -1 /* Ping can take either one or two parameter, so the number of parameters has to be determined by the ping command implementation. */\r
+       };\r
+\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       /* Structure that defines the "trace" command line command.  This takes a single\r
+       parameter, which can be either "start" or "stop". */\r
+       static const CLI_Command_Definition_t xStartStopTrace =\r
+       {\r
+               ( const int8_t * const ) "trace",\r
+               ( const int8_t * const ) "trace [start | stop]:\r\n Starts or stops a trace recording for viewing in FreeRTOS+Trace\r\n\r\n",\r
+               prvStartStopTraceCommand, /* The function to run. */\r
+               1 /* One parameter is expected.  Valid values are "start" and "stop". */\r
+       };\r
+#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vRegisterCLICommands( void )\r
+{\r
+       /* Register all the command line commands defined immediately above. */\r
+       FreeRTOS_CLIRegisterCommand( &xTaskStats );\r
+       FreeRTOS_CLIRegisterCommand( &xRunTimeStats );\r
+       FreeRTOS_CLIRegisterCommand( &xThreeParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xParameterEcho );\r
+       FreeRTOS_CLIRegisterCommand( &xIPDebugStats );\r
+       FreeRTOS_CLIRegisterCommand( &xIPConfig );\r
+\r
+       #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+       {\r
+               FreeRTOS_CLIRegisterCommand( &xPing );\r
+       }\r
+       #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+       #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+               FreeRTOS_CLIRegisterCommand( & xStartStopTrace );\r
+       #endif\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvTaskStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t *const pcHeader = ( int8_t * ) "Task          State  Priority  Stack      #\r\n************************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskList( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvRunTimeStatsCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+const int8_t * const pcHeader = ( int8_t * ) "Task            Abs Time      % Time\r\n****************************************\r\n";\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       /* Generate a table of task stats. */\r
+       strcpy( ( char * ) pcWriteBuffer, ( char * ) pcHeader );\r
+       vTaskGetRunTimeStats( pcWriteBuffer + strlen( ( char * ) pcHeader ) );\r
+\r
+       /* There is no more data to return after this single string, so return\r
+       pdFALSE. */\r
+       return pdFALSE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvThreeParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE xParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The three parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &xParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* Return the parameter string. */\r
+               memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+               sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+               strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+               strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+               /* If this is the last of the three parameters then there are no more\r
+               strings to return after this one. */\r
+               if( lParameterNumber == 3L )\r
+               {\r
+                       /* If this is the last of the three parameters then there are no more\r
+                       strings to return after this one. */\r
+                       xReturn = pdFALSE;\r
+                       lParameterNumber = 0L;\r
+               }\r
+               else\r
+               {\r
+                       /* There are more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvParameterEchoCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+int8_t *pcParameter;\r
+portBASE_TYPE xParameterStringLength, xReturn;\r
+static portBASE_TYPE lParameterNumber = 0;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       if( lParameterNumber == 0 )\r
+       {\r
+               /* The first time the function is called after the command has been\r
+               entered just a header string is returned. */\r
+               sprintf( ( char * ) pcWriteBuffer, "The parameters were:\r\n" );\r
+\r
+               /* Next time the function is called the first parameter will be echoed\r
+               back. */\r
+               lParameterNumber = 1L;\r
+\r
+               /* There is more data to be returned as no parameters have been echoed\r
+               back yet. */\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               lParameterNumber,               /* Return the next parameter. */\r
+                                                                               &xParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               if( pcParameter != NULL )\r
+               {\r
+                       /* Return the parameter string. */\r
+                       memset( pcWriteBuffer, 0x00, xWriteBufferLen );\r
+                       sprintf( ( char * ) pcWriteBuffer, "%d: ", ( int ) lParameterNumber );\r
+                       strncat( ( char * ) pcWriteBuffer, ( const char * ) pcParameter, xParameterStringLength );\r
+                       strncat( ( char * ) pcWriteBuffer, "\r\n", strlen( "\r\n" ) );\r
+\r
+                       /* There might be more parameters to return after this one. */\r
+                       xReturn = pdTRUE;\r
+                       lParameterNumber++;\r
+               }\r
+               else\r
+               {\r
+                       /* No more parameters were found.  Make sure the write buffer does\r
+                       not contain a valid string. */\r
+                       pcWriteBuffer[ 0 ] = 0x00;\r
+\r
+                       /* No more data to return. */\r
+                       xReturn = pdFALSE;\r
+\r
+                       /* Start over the next time this command is executed. */\r
+                       lParameterNumber = 0;\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+\r
+       static portBASE_TYPE prvPingCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       int8_t * pcParameter;\r
+       portBASE_TYPE lParameterStringLength, xReturn;\r
+       uint32_t ulIPAddress, ulBytesToPing;\r
+       const uint32_t ulDefaultBytesToPing = 8UL;\r
+       int8_t cBuffer[ 16 ];\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               /* Start with an empty string. */\r
+               pcWriteBuffer[ 0 ] = 0x00;\r
+\r
+               /* Obtain the number of bytes to ping. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               2,                                              /* Return the second parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               if( pcParameter == NULL )\r
+               {\r
+                       /* The number of bytes was not specified, so default it. */\r
+                       ulBytesToPing = ulDefaultBytesToPing;\r
+               }\r
+               else\r
+               {\r
+                       ulBytesToPing = atol( ( const char * ) pcParameter );\r
+               }\r
+\r
+               /* Obtain the IP address string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               1,                                              /* Return the first parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* Attempt to obtain the IP address.   If the first character is not a\r
+               digit, assume the host name has been passed in. */\r
+               if( ( *pcParameter >= '0' ) && ( *pcParameter <= '9' ) )\r
+               {\r
+                       ulIPAddress = FreeRTOS_inet_addr( ( const uint8_t * ) pcParameter );\r
+               }\r
+               else\r
+               {\r
+                       /* Terminate the host name. */\r
+                       pcParameter[ lParameterStringLength ] = 0x00;\r
+\r
+                       /* Attempt to resolve host. */\r
+                       ulIPAddress = FreeRTOS_gethostbyname( ( uint8_t * ) pcParameter );\r
+               }\r
+\r
+               /* Convert IP address, which may have come from a DNS lookup, to string. */\r
+               FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer );\r
+\r
+               if( ulIPAddress != 0 )\r
+               {\r
+                       xReturn = FreeRTOS_SendPingRequest( ulIPAddress, ( uint16_t ) ulBytesToPing, portMAX_DELAY );\r
+               }\r
+               else\r
+               {\r
+                       xReturn = pdFALSE;\r
+               }\r
+\r
+               if( xReturn == pdFALSE )\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "%s", "Could not send ping request\r\n" );\r
+               }\r
+               else\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "Ping sent to %s with identifier %d\r\n", cBuffer, xReturn );\r
+               }\r
+\r
+               return pdFALSE;\r
+       }\r
+       /*-----------------------------------------------------------*/\r
+\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+#if configINCLUDE_DEMO_DEBUG_STATS != 0\r
+\r
+       static portBASE_TYPE prvDisplayIPDebugStats( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       static portBASE_TYPE xIndex = -1;\r
+       extern xExampleDebugStatEntry_t xIPTraceValues[];\r
+       portBASE_TYPE xReturn;\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               xIndex++;\r
+\r
+               if( xIndex < xExampleDebugStatEntries() )\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "%s %d\r\n", ( char * ) xIPTraceValues[ xIndex ].pucDescription, ( int ) xIPTraceValues[ xIndex ].ulData );\r
+                       xReturn = pdPASS;\r
+               }\r
+               else\r
+               {\r
+                       /* Reset the index for the next time it is called. */\r
+                       xIndex = -1;\r
+\r
+                       /* Ensure nothing remains in the write buffer. */\r
+                       pcWriteBuffer[ 0 ] = 0x00;\r
+                       xReturn = pdFALSE;\r
+               }\r
+\r
+               return xReturn;\r
+       }\r
+       /*-----------------------------------------------------------*/\r
+\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS */\r
+\r
+static portBASE_TYPE prvDisplayIPConfig( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+static portBASE_TYPE xIndex = 0;\r
+portBASE_TYPE xReturn;\r
+uint32_t ulAddress;\r
+\r
+       /* Remove compile time warnings about unused parameters, and check the\r
+       write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+       write buffer length is adequate, so does not check for buffer overflows. */\r
+       ( void ) pcCommandString;\r
+       ( void ) xWriteBufferLen;\r
+       configASSERT( pcWriteBuffer );\r
+\r
+       switch( xIndex )\r
+       {\r
+               case 0 :\r
+                       FreeRTOS_GetAddressConfiguration( &ulAddress, NULL, NULL, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nIP address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 1 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, &ulAddress, NULL, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nNet mask " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 2 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, NULL, &ulAddress, NULL );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nGateway address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               case 3 :\r
+                       FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulAddress );\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\nDNS server address " );\r
+                       xReturn = pdTRUE;\r
+                       xIndex++;\r
+                       break;\r
+\r
+               default :\r
+                       ulAddress = 0;\r
+                       sprintf( ( char * ) pcWriteBuffer, "\r\n\r\n" );\r
+                       xReturn = pdFALSE;\r
+                       xIndex = 0;\r
+                       break;\r
+       }\r
+\r
+       if( ulAddress != 0 )\r
+       {\r
+               FreeRTOS_inet_ntoa( ulAddress, ( ( char * ) &( pcWriteBuffer[ strlen( ( char * ) pcWriteBuffer ) ] ) ) );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+\r
+       static portBASE_TYPE prvStartStopTraceCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+       {\r
+       int8_t *pcParameter;\r
+       portBASE_TYPE lParameterStringLength;\r
+\r
+               /* Remove compile time warnings about unused parameters, and check the\r
+               write buffer is not NULL.  NOTE - for simplicity, this example assumes the\r
+               write buffer length is adequate, so does not check for buffer overflows. */\r
+               ( void ) pcCommandString;\r
+               ( void ) xWriteBufferLen;\r
+               configASSERT( pcWriteBuffer );\r
+\r
+               /* Obtain the parameter string. */\r
+               pcParameter = ( int8_t * ) FreeRTOS_CLIGetParameter\r
+                                                                       (\r
+                                                                               pcCommandString,                /* The command string itself. */\r
+                                                                               1,                                              /* Return the first parameter. */\r
+                                                                               &lParameterStringLength /* Store the parameter string length. */\r
+                                                                       );\r
+\r
+               /* Sanity check something was returned. */\r
+               configASSERT( pcParameter );\r
+\r
+               /* There are only two valid parameter values. */\r
+               if( strncmp( ( const char * ) pcParameter, "start", strlen( "start" ) ) == 0 )\r
+               {\r
+                       /* Start or restart the trace. */\r
+                       vTraceStop();\r
+                       vTraceClear();\r
+                       vTraceStart();\r
+\r
+                       sprintf( ( char * ) pcWriteBuffer, "Trace recording (re)started.\r\n" );\r
+               }\r
+               else if( strncmp( ( const char * ) pcParameter, "stop", strlen( "stop" ) ) == 0 )\r
+               {\r
+                       /* End the trace, if one is running. */\r
+                       vTraceStop();\r
+                       sprintf( ( char * ) pcWriteBuffer, "Stopping trace recording.\r\n" );\r
+               }\r
+               else\r
+               {\r
+                       sprintf( ( char * ) pcWriteBuffer, "Valid parameters are 'start' and 'stop'.\r\n" );\r
+               }\r
+\r
+               /* There is no more data to return after this single string, so return\r
+               pdFALSE. */\r
+               return pdFALSE;\r
+       }\r
+\r
+#endif /* configINCLUDE_TRACE_RELATED_CLI_COMMANDS */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/CreateProjectDirectoryStructure.bat
new file mode 100644 (file)
index 0000000..ac6c270
--- /dev/null
@@ -0,0 +1,77 @@
+REM This file should be executed from the command line prior to the first\r
+REM build.  It will be necessary to refresh the Eclipse project once the\r
+REM .bat file has been executed (normally just press F5 to refresh).\r
+\r
+REM Copies all the required files from their location within the standard\r
+REM FreeRTOS directory structure to under the Eclipse project directory.\r
+REM This permits the Eclipse project to be used in 'managed' mode and without\r
+REM having to setup any linked resources.\r
+\r
+REM Standard paths\r
+SET FREERTOS_SOURCE=..\..\..\FreeRTOS\Source\r
+SET FREERTOS_UDP_SOURCE=..\..\Source\FreeRTOS-Plus-UDP\r
+SET FREERTOS_CLI_SOURCE=..\..\Source\FreeRTOS-Plus-CLI\r
+\r
+REM Have the files already been copied?\r
+IF EXIST FreeRTOS_Source Goto END\r
+\r
+    REM Create the required directory structure.\r
+    MD FreeRTOS_Source\r
+    MD FreeRTOS_Source\include\r
+    MD FreeRTOS_Source\portable\\r
+       MD FreeRTOS_Source\portable\GCC\r
+    MD FreeRTOS_Source\portable\GCC\ARM_CM3\r
+    MD FreeRTOS_Source\portable\MemMang\r
+       MD FreeRTOS_Plus_UDP\r
+       MD FreeRTOS_Plus_UDP\include\r
+       MD FreeRTOS_Plus_UDP\portable\r
+       MD FreeRTOS_Plus_UDP\portable\Compiler\r
+       MD FreeRTOS_Plus_UDP\portable\Compiler\GCC\r
+       MD FreeRTOS_Plus_UDP\portable\BufferManagement\r
+       MD FreeRTOS_Plus_UDP\portable\NetworkInterface\r
+       MD FreeRTOS_Plus_UDP\portable\NetworkInterface\LPC18xx\r
+       MD FreeRTOS_Plus_CLI\r
+       MD Examples\Ethernet\r
+\r
+    REM Copy the core kernel files into the SDK projects directory\r
+    copy %FREERTOS_SOURCE%\tasks.c FreeRTOS_Source\r
+    copy %FREERTOS_SOURCE%\queue.c FreeRTOS_Source\r
+    copy %FREERTOS_SOURCE%\list.c FreeRTOS_Source\r
+    copy %FREERTOS_SOURCE%\timers.c FreeRTOS_Source\r
+\r
+    REM Copy the common header files into the SDK projects directory\r
+    copy %FREERTOS_SOURCE%\include\*.* FreeRTOS_Source\include\r
+\r
+    REM Copy the portable layer files into the projects directory\r
+    copy %FREERTOS_SOURCE%\portable\GCC\ARM_CM3\*.* FreeRTOS_Source\portable\GCC\ARM_CM3\r
+\r
+    REM Copy the memory allocation file into the project's directory\r
+    copy %FREERTOS_SOURCE%\portable\MemMang\heap_4.c FreeRTOS_Source\portable\MemMang\r
+\r
+       REM Copy the FreeRTOS+UDP core files\r
+       copy %FREERTOS_UDP_SOURCE%\*.c FreeRTOS_Plus_UDP\r
+       copy %FREERTOS_UDP_SOURCE%\*.h FreeRTOS_Plus_UDP\r
+       copy %FREERTOS_UDP_SOURCE%\readme.txt FreeRTOS_Plus_UDP\r
+       copy %FREERTOS_UDP_SOURCE%\include\*.* FreeRTOS_Plus_UDP\include\r
+\r
+       REM Copy the FreeRTOS+UDP portable layer files\r
+       copy %FREERTOS_UDP_SOURCE%\portable\NetworkInterface\LPC18xx\*.* FreeRTOS_Plus_UDP\portable\NetworkInterface\LPC18xx\r
+       copy %FREERTOS_UDP_SOURCE%\portable\NetworkInterface\*.* FreeRTOS_Plus_UDP\portable\NetworkInterface\r
+       copy %FREERTOS_UDP_SOURCE%\portable\BufferManagement\BufferAllocation_2.c FreeRTOS_Plus_UDP\portable\BufferManagement\r
+       copy %FREERTOS_UDP_SOURCE%\portable\Compiler\GCC\*.* FreeRTOS_Plus_UDP\portable\Compiler\GCC\r
+\r
+       REM Copy the FreeRTOS+CLI files\r
+       copy %FREERTOS_CLI_SOURCE%\*.* FreeRTOS_Plus_CLI\r
+\r
+       REM Copy the echo client example implementation\r
+       copy ..\Common\FreeRTOS_Plus_UDP_Demos\EchoClients\TwoEchoClients.c Examples\Ethernet\r
+       copy ..\Common\FreeRTOS_Plus_UDP_Demos\EchoClients\TwoEchoClients.h Examples\include\r
+\r
+       REM Copy the example IP trace macro implementation\r
+       copy ..\Common\FreeRTOS_Plus_UDP_Demos\TraceMacros\Example1\DemoIPTrace.c Examples\Ethernet\r
+       copy ..\Common\FreeRTOS_Plus_UDP_Demos\TraceMacros\Example1\DemoIPTrace.h Examples\include\r
+\r
+       REM Copy the CLI commands implementation into the project directory.\r
+       copy ..\Common\FreeRTOS_Plus_UDP_Demos\CLICommands\CLI-commands.c .\r
+\r
+: END\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/USB_CDC/CDCCommandConsole.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/USB_CDC/CDCCommandConsole.c
new file mode 100644 (file)
index 0000000..5ed2f33
--- /dev/null
@@ -0,0 +1,325 @@
+/*\r
+    FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    http://www.FreeRTOS.org - Documentation, latest information, license and\r
+    contact details.\r
+\r
+    http://www.SafeRTOS.com - A version that is certified for use in safety\r
+    critical systems.\r
+\r
+    http://www.OpenRTOS.com - Commercial support, development, porting,\r
+    licensing and training services.\r
+*/\r
+\r
+/*\r
+ * NOTE:  This file uses a third party USB CDC driver.\r
+ */\r
+\r
+/* Standard includes. */\r
+#include "string.h"\r
+#include "stdio.h"\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+/* Driver includes. */\r
+#include "usbhw.h"\r
+#include "cdcuser.h"\r
+#include "usbcfg.h"\r
+#include "usbuser.h"\r
+\r
+/* Example includes. */\r
+#include "FreeRTOS_CLI.h"\r
+#include "CDCCommandConsole.h"\r
+\r
+/* Dimensions the buffer into which input characters are placed. */\r
+#define cmdMAX_INPUT_SIZE              50\r
+\r
+/* The maximum time in ticks to wait for the CDC access mutex. */\r
+#define cmdMAX_MUTEX_WAIT              ( 200 / portTICK_RATE_MS )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * The task that implements the command console processing.\r
+ */\r
+static void prvCDCCommandConsoleTask( void *pvParameters );\r
+\r
+/*\r
+ * Obtain a character from the CDC input.  The calling task will be held in the\r
+ * Blocked state (so other tasks can execute) until a character is avilable.\r
+ */\r
+int8_t cGetCDCChar( void );\r
+\r
+/*\r
+ * Initialise the third party virtual comport files driver\r
+ */\r
+static void prvSetupUSBDrivers( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* 'Given' by the CDC interrupt to unblock the receiving task when new data\r
+is available. */\r
+static xSemaphoreHandle xNewDataSemaphore = NULL;\r
+\r
+/* Used to guard access to the CDC output, which is used by more than one\r
+task. */\r
+static xSemaphoreHandle xCDCMutex = NULL;\r
+\r
+/* Const messages output by the command console. */\r
+static const uint8_t * const pcWelcomeMessage = ( uint8_t * ) "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";\r
+static const uint8_t * const pcEndOfOutputMessage = ( uint8_t * ) "\r\n[Press ENTER to execute the previous command again]\r\n>";\r
+static const uint8_t * const pcNewLine = ( uint8_t * ) "\r\n";\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vCDCCommandConsoleStart( uint16_t usStackSize, unsigned portBASE_TYPE uxPriority )\r
+{\r
+       /* Create the semaphores and mutexes used by the CDC to task interface. */\r
+       xCDCMutex = xSemaphoreCreateMutex();\r
+       vSemaphoreCreateBinary( xNewDataSemaphore );\r
+       configASSERT( xCDCMutex );\r
+       configASSERT( xNewDataSemaphore );\r
+\r
+       /* Add the semaphore and mutex to the queue registry for viewing in the\r
+       kernel aware state viewer. */\r
+       vQueueAddToRegistry( xCDCMutex, ( signed char * ) "CDCMu" );\r
+       vQueueAddToRegistry( xNewDataSemaphore, ( signed char * ) "CDCDat" );\r
+\r
+       /* Create that task that handles the console itself. */\r
+       xTaskCreate(    prvCDCCommandConsoleTask,                       /* The task that implements the command console. */\r
+                                       ( const int8_t * const ) "CDCCmd",      /* Text name assigned to the task.  This is just to assist debugging.  The kernel does not use this name itself. */\r
+                                       usStackSize,                                            /* The size of the stack allocated to the task. */\r
+                                       NULL,                                                           /* The parameter is not used, so NULL is passed. */\r
+                                       uxPriority,                                                     /* The priority allocated to the task. */\r
+                                       NULL );                                                         /* A handle is not required, so just pass NULL. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvCDCCommandConsoleTask( void *pvParameters )\r
+{\r
+int8_t cRxedChar, cInputIndex = 0, *pcOutputString;\r
+static int8_t cInputString[ cmdMAX_INPUT_SIZE ], cLastInputString[ cmdMAX_INPUT_SIZE ];\r
+portBASE_TYPE xReturned;\r
+\r
+       ( void ) pvParameters;\r
+\r
+       /* Obtain the address of the output buffer.  Note there is no mutual\r
+       exclusion on this buffer as it is assumed only one command console\r
+       interface will be used at any one time. */\r
+       pcOutputString = FreeRTOS_CLIGetOutputBuffer();\r
+\r
+       /* Initialise the virtual com port (CDC) interface. */\r
+       prvSetupUSBDrivers();\r
+\r
+       /* Send the welcome message.  This probably won't be seen as the console\r
+       will not have been connected yet. */\r
+       USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcWelcomeMessage, strlen( ( const char * ) pcWelcomeMessage ) );\r
+\r
+       for( ;; )\r
+       {\r
+               /* No characters received yet for the current input string. */\r
+               cRxedChar = 0;\r
+\r
+               /* Only interested in reading one character at a time. */\r
+               cRxedChar = cGetCDCChar();\r
+\r
+               if( xSemaphoreTake( xCDCMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )\r
+               {\r
+                       /* Echo the character back. */\r
+                       USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) &cRxedChar, sizeof( uint8_t ) );\r
+\r
+                       /* Was it the end of the line? */\r
+                       if( cRxedChar == '\n' || cRxedChar == '\r' )\r
+                       {\r
+                               /* Just to space the output from the input. */\r
+                               USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcNewLine, strlen( ( const char * ) pcNewLine ) );\r
+\r
+                               /* See if the command is empty, indicating that the last command is\r
+                               to be executed again. */\r
+                               if( cInputIndex == 0 )\r
+                               {\r
+                                       /* Copy the last command back into the input string. */\r
+                                       strcpy( ( char * ) cInputString, ( char * ) cLastInputString );\r
+                               }\r
+\r
+                               /* Pass the received command to the command interpreter.  The\r
+                               command interpreter is called repeatedly until it returns pdFALSE\r
+                               (indicating there is no more output) as it might generate more than\r
+                               one string. */\r
+                               do\r
+                               {\r
+                                       /* Get the next output string from the command interpreter. */\r
+                                       xReturned = FreeRTOS_CLIProcessCommand( cInputString, pcOutputString, configCOMMAND_INT_MAX_OUTPUT_SIZE );\r
+\r
+                                       /* Write the generated string to the CDC. */\r
+                                       USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcOutputString, strlen( ( const char * ) pcOutputString ) );\r
+                                       vTaskDelay( 1 );\r
+\r
+                               } while( xReturned != pdFALSE );\r
+\r
+                               /* All the strings generated by the input command have been sent.\r
+                               Clear the input string ready to receive the next command.  Remember\r
+                               the command that was just processed first in case it is to be\r
+                               processed again. */\r
+                               strcpy( ( char * ) cLastInputString, ( char * ) cInputString );\r
+                               cInputIndex = 0;\r
+                               memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
+\r
+                               USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pcEndOfOutputMessage, strlen( ( const char * ) pcEndOfOutputMessage ) );\r
+                       }\r
+                       else\r
+                       {\r
+                               if( cRxedChar == '\r' )\r
+                               {\r
+                                       /* Ignore the character. */\r
+                               }\r
+                               else if( cRxedChar == '\b' )\r
+                               {\r
+                                       /* Backspace was pressed.  Erase the last character in the\r
+                                       string - if any. */\r
+                                       if( cInputIndex > 0 )\r
+                                       {\r
+                                               cInputIndex--;\r
+                                               cInputString[ cInputIndex ] = '\0';\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* A character was entered.  Add it to the string\r
+                                       entered so far.  When a \n is entered the complete\r
+                                       string will be passed to the command interpreter. */\r
+                                       if( ( cRxedChar >= ' ' ) && ( cRxedChar <= '~' ) )\r
+                                       {\r
+                                               if( cInputIndex < cmdMAX_INPUT_SIZE )\r
+                                               {\r
+                                                       cInputString[ cInputIndex ] = cRxedChar;\r
+                                                       cInputIndex++;\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       /* Must ensure to give the mutex back. */\r
+                       xSemaphoreGive( xCDCMutex );\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vOutputString( const uint8_t * const pucMessage )\r
+{\r
+       if( xSemaphoreTake( xCDCMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )\r
+       {\r
+               USB_WriteEP( CDC_DEP_IN, ( uint8_t * ) pucMessage, strlen( ( const char * ) pucMessage ) );\r
+               xSemaphoreGive( xCDCMutex );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+int8_t cGetCDCChar( void )\r
+{\r
+int32_t lAvailableBytes, xBytes = 0;\r
+int8_t cInputChar;\r
+\r
+       do\r
+       {\r
+               /* Are there any characters already available? */\r
+               CDC_OutBufAvailChar( &lAvailableBytes );\r
+               if( lAvailableBytes > 0 )\r
+               {\r
+                       if( xSemaphoreTake( xCDCMutex, cmdMAX_MUTEX_WAIT ) == pdPASS )\r
+                       {\r
+                               /* Attempt to read one character. */\r
+                               xBytes = 1;\r
+                               xBytes = CDC_RdOutBuf( ( char * ) &cInputChar, &xBytes );\r
+\r
+                               xSemaphoreGive( xCDCMutex );\r
+                       }\r
+               }\r
+\r
+               if( xBytes == 0 )\r
+               {\r
+                       /* A character was not available.  Wait until signalled by the\r
+                       CDC Rx callback function that new data has arrived. */\r
+                       xSemaphoreTake( xNewDataSemaphore, portMAX_DELAY );\r
+               }\r
+\r
+       } while( xBytes == 0 );\r
+\r
+       return cInputChar;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Callback function executed by the USB interrupt when new data arrives. */\r
+void vCDCNewDataNotify( void )\r
+{\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+\r
+       configASSERT( xNewDataSemaphore );\r
+\r
+       /* 'Give' the semaphore that signals the arrival of new data to the command\r
+       console task. */\r
+       xSemaphoreGiveFromISR( xNewDataSemaphore, &xHigherPriorityTaskWoken );\r
+       portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSetupUSBDrivers( void )\r
+{\r
+LPC_USBDRV_INIT_T xUSBCallback;\r
+\r
+       /* Initialise the callback structure. */\r
+       memset( ( void * ) &xUSBCallback, 0, sizeof( LPC_USBDRV_INIT_T ) );\r
+       xUSBCallback.USB_Reset_Event = USB_Reset_Event;\r
+       xUSBCallback.USB_P_EP[ 0 ] = USB_EndPoint0;\r
+       xUSBCallback.USB_P_EP[ 1 ] = USB_EndPoint1;\r
+       xUSBCallback.USB_P_EP[ 2 ] = USB_EndPoint2;\r
+       xUSBCallback.ep0_maxp = USB_MAX_PACKET0;\r
+\r
+       /* Initialise then connect the USB. */\r
+       USB_Init( &xUSBCallback );\r
+       USB_Connect( pdTRUE );\r
+}\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/CDCCommandConsole.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/CDCCommandConsole.h
new file mode 100644 (file)
index 0000000..983f1b0
--- /dev/null
@@ -0,0 +1,81 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef CDC_COMMAND_CONSOLE_H\r
+#define CDC_COMMAND_CONSOLE_H\r
+\r
+/*\r
+ * Create the task that implements a command console using the USB virtual com\r
+ * port driver for intput and output.\r
+ */\r
+void vCDCCommandConsoleStart( uint16_t usStackSize, unsigned portBASE_TYPE uxPriority );\r
+\r
+#endif /* CDC_COMMAND_CONSOLE_H */\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/DemoIPTrace.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/DemoIPTrace.h
new file mode 100644 (file)
index 0000000..b2f866e
--- /dev/null
@@ -0,0 +1,156 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*\r
+ * This file, along with DemoIPTrace.h, provides a basic example use of the\r
+ * FreeRTOS+UDP trace macros.  The statistics gathered here can be viewed in\r
+ * the command line interface.\r
+ * See http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml\r
+ */\r
+\r
+#ifndef DEMO_IP_TRACE_MACROS_H\r
+#define DEMO_IP_TRACE_MACROS_H\r
+\r
+typedef void ( *vTraceAction_t )( uint32_t *, uint32_t );\r
+\r
+/* Type that defines each statistic being gathered. */\r
+typedef struct ExampleDebugStatEntry\r
+{\r
+       uint8_t ucIdentifier;                                   /* Unique identifier for statistic. */\r
+       const uint8_t * const pucDescription;   /* Text description for the statistic. */\r
+       vTraceAction_t vPerformAction;                  /* Action to perform when the statistic is updated (increment counter, store minimum value, store maximum value, etc. */\r
+       uint32_t ulData;                                                /* The meaning of this data is dependent on the trace macro ID. */\r
+} xExampleDebugStatEntry_t;\r
+\r
+/* Unique identifiers used to locate the entry for each trace macro in the\r
+xIPTraceValues[] table defined in DemoIPTrace.c. */\r
+#define iptraceID_NETWORK_BUFFER_OBTAINED                                      1\r
+#define iptraceID_NETWORK_BUFFER_OBTAINED_FROM_ISR                     2\r
+#define iptraceID_NETWORK_EVENT_RECEIVED                                       3\r
+#define iptraceID_FAILED_TO_OBTAIN_NETWORK_BUFFER                      4\r
+#define iptraceID_ARP_TABLE_ENTRY_EXPIRED                                      5\r
+#define iptraceID_PACKET_DROPPED_TO_GENERATE_ARP                       6\r
+#define iptraceID_FAILED_TO_CREATE_SOCKET                                      7\r
+#define iptraceID_RECVFROM_DISCARDING_BYTES                                    8\r
+#define iptraceID_ETHERNET_RX_EVENT_LOST                                       9\r
+#define iptraceID_STACK_TX_EVENT_LOST                                          10\r
+#define ipconfigID_BIND_FAILED                                                         11\r
+#define iptraceID_NETWORK_INTERFACE_TRANSMIT                           12\r
+#define iptraceID_RECVFROM_TIMEOUT                                                     13\r
+#define iptraceID_SENDTO_DATA_TOO_LONG                                         14\r
+#define iptraceID_SENDTO_SOCKET_NOT_BOUND                                      15\r
+#define iptraceID_NO_BUFFER_FOR_SENDTO                                         16\r
+#define iptraceID_WAIT_FOR_TX_DMA_DESCRIPTOR                           17\r
+\r
+/* It is possible to remove the trace macros using the\r
+configINCLUDE_DEMO_DEBUG_STATS setting in FreeRTOSIPConfig.h. */\r
+#if configINCLUDE_DEMO_DEBUG_STATS == 1\r
+\r
+       /* The trace macro definitions themselves.  Any trace macros left undefined\r
+       will default to be empty macros. */\r
+       #define iptraceNETWORK_BUFFER_OBTAINED( pxBufferAddress ) vExampleDebugStatUpdate( iptraceID_NETWORK_BUFFER_OBTAINED, uxQueueMessagesWaiting( ( xQueueHandle ) xNetworkBufferSemaphore ) )\r
+       #define iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR( pxBufferAddress ) vExampleDebugStatUpdate( iptraceID_NETWORK_BUFFER_OBTAINED, uxQueueMessagesWaiting( ( xQueueHandle ) xNetworkBufferSemaphore ) )\r
+\r
+       #define iptraceNETWORK_EVENT_RECEIVED( eEvent ) {                                                                                                                                                               \\r
+                                                                                                               uint16_t usSpace;                                                                                                                       \\r
+                                                                                                                       usSpace = ( uint16_t ) uxQueueMessagesWaiting( xNetworkEventQueue );    \\r
+                                                                                                                       /* Minus one as an event was removed before the space was queried. */   \\r
+                                                                                                                       usSpace = ( ipconfigEVENT_QUEUE_LENGTH - usSpace ) - 1;                                 \\r
+                                                                                                                       vExampleDebugStatUpdate( iptraceID_NETWORK_EVENT_RECEIVED, usSpace );   \\r
+                                                                                                               }\r
+\r
+       #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER()                                        vExampleDebugStatUpdate( iptraceID_FAILED_TO_OBTAIN_NETWORK_BUFFER, 0 )\r
+       #define iptraceARP_TABLE_ENTRY_EXPIRED( ulIPAddress )                           vExampleDebugStatUpdate( iptraceID_ARP_TABLE_ENTRY_EXPIRED, 0 )\r
+       #define iptracePACKET_DROPPED_TO_GENERATE_ARP( ulIPAddress )            vExampleDebugStatUpdate( iptraceID_PACKET_DROPPED_TO_GENERATE_ARP, 0 )\r
+       #define iptraceFAILED_TO_CREATE_SOCKET()                                                        vExampleDebugStatUpdate( iptraceID_FAILED_TO_CREATE_SOCKET, 0 )\r
+       #define iptraceRECVFROM_DISCARDING_BYTES( xNumberOfBytesDiscarded )     vExampleDebugStatUpdate( iptraceID_RECVFROM_DISCARDING_BYTES, 0 )\r
+       #define iptraceETHERNET_RX_EVENT_LOST()                                                         vExampleDebugStatUpdate( iptraceID_ETHERNET_RX_EVENT_LOST, 0 )\r
+       #define iptraceSTACK_TX_EVENT_LOST( xEvent )                                            vExampleDebugStatUpdate( iptraceID_STACK_TX_EVENT_LOST, 0 )\r
+       #define iptraceBIND_FAILED( xSocket, usPort )                                           vExampleDebugStatUpdate( ipconfigID_BIND_FAILED, 0 )\r
+       #define iptraceNETWORK_INTERFACE_TRANSMIT()                                                     vExampleDebugStatUpdate( iptraceID_NETWORK_INTERFACE_TRANSMIT, 0 )\r
+       #define iptraceRECVFROM_TIMEOUT()                                                                       vExampleDebugStatUpdate( iptraceID_RECVFROM_TIMEOUT, 0 )\r
+       #define iptraceSENDTO_DATA_TOO_LONG()                                                           vExampleDebugStatUpdate( iptraceID_SENDTO_DATA_TOO_LONG, 0 )\r
+       #define iptraceSENDTO_SOCKET_NOT_BOUND()                                                        vExampleDebugStatUpdate( iptraceID_SENDTO_SOCKET_NOT_BOUND, 0 )\r
+       #define iptraceNO_BUFFER_FOR_SENDTO()                                                           vExampleDebugStatUpdate( iptraceID_NO_BUFFER_FOR_SENDTO, 0 )\r
+       #define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR()                                          vExampleDebugStatUpdate( iptraceID_WAIT_FOR_TX_DMA_DESCRIPTOR, 0 )\r
+\r
+       /*\r
+        * The function that updates a line in the xIPTraceValues table.\r
+        */\r
+       void vExampleDebugStatUpdate( uint8_t ucIdentifier, uint32_t ulValue );\r
+\r
+       /*\r
+        * Returns the number of entries in the xIPTraceValues table.\r
+        */\r
+       portBASE_TYPE xExampleDebugStatEntries( void );\r
+\r
+#endif /* configINCLUDE_DEMO_DEBUG_STATS == 1 */\r
+\r
+\r
+#endif /* DEMO_IP_TRACE_MACROS_H */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/TwoEchoClients.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Examples/include/TwoEchoClients.h
new file mode 100644 (file)
index 0000000..c3d6752
--- /dev/null
@@ -0,0 +1,79 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT \r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
+    and contact details.  \r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef TWO_ECHO_CLIENTS_H\r
+#define TWO_ECHO_CLIENTS_H\r
+\r
+/*\r
+ * Create the two UDP echo client tasks.  One task uses the standard interface\r
+ * to send to and receive from an echo server.  The other task uses the zero\r
+ * copy interface to send to and receive from an echo server.\r
+ */\r
+void vStartEchoClientTasks( uint16_t usTaskStackSize, unsigned portBASE_TYPE uxTaskPriority );\r
+\r
+#endif /* TWO_ECHO_CLIENTS_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Flash_map.xml b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/Flash_map.xml
new file mode 100644 (file)
index 0000000..1fb1cd3
--- /dev/null
@@ -0,0 +1,12 @@
+<info flash_driver='LPC1850A_4350A_SPIFI.cfx'>\r
+ <chip>\r
+  <memory id='Flash' type='Flash' is_ro='true' can_program='true'></memory>\r
+  <memory id='RAM' type='RAM'></memory>\r
+   <memoryInstance id='SPIFlash' derived_from='Flash' location='0x14000000' size='0x400000'  edited='true'/>\r
+   <memoryInstance id='RamLoc96' derived_from='RAM' location='0x10000000' size='0x18000'  edited='true'/>\r
+   <memoryInstance id='RamLoc40' derived_from='RAM' location='0x10080000' size='0xa000'  edited='true'/>\r
+   <memoryInstance id='RamAHB32' derived_from='RAM' location='0x20000000' size='0x8000'  edited='true'/>\r
+   <memoryInstance id='RamAHB16' derived_from='RAM' location='0x20008000' size='0x4000'  edited='true'/>\r
+   <memoryInstance id='RamAHB_ETB16' derived_from='RAM' location='0x2000c000' size='0x4000'  edited='true'/>\r
+ </chip>\r
+</info>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..e266da0
--- /dev/null
@@ -0,0 +1,281 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+#include <stdint.h>\r
+extern uint32_t SystemCoreClock;\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
+ * http://www.freertos.org/a00110.html\r
+ *\r
+ * The bottom of this file contains some constants specific to running the UDP\r
+ * stack in this demo.  Constants specific to FreeRTOS+UDP itself (rather than\r
+ * the demo) are contained in FreeRTOSIPConfig.h.\r
+ *----------------------------------------------------------*/\r
+\r
+#define configUSE_PREEMPTION                   1\r
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
+#define configUSE_TICKLESS_IDLE                        0\r
+#define configMAX_PRIORITIES                   ( 7 )\r
+#define configCPU_CLOCK_HZ                             ( SystemCoreClock )\r
+#define configTICK_RATE_HZ                             100\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 300 )\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 40 * 1024 ) ) /* Has not effect in this demo as the heap is manually pointed to AHB RAM. */\r
+#define configMAX_TASK_NAME_LEN                        ( 12 )\r
+#define configIDLE_SHOULD_YIELD                        0\r
+#define configQUEUE_REGISTRY_SIZE              10\r
+#define configUSE_TRACE_FACILITY               1\r
+#define configUSE_16_BIT_TICKS                 0\r
+#define configUSE_MUTEXES                              1\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_ALTERNATIVE_API              0\r
+#define configUSE_RECURSIVE_MUTEXES            1\r
+\r
+/* Hook function related definitions. */\r
+#define configUSE_TICK_HOOK                            0\r
+#define configUSE_IDLE_HOOK                            0\r
+#define configUSE_MALLOC_FAILED_HOOK   1\r
+#define configCHECK_FOR_STACK_OVERFLOW 2\r
+\r
+/* Software timer related definitions. */\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
+#define configTIMER_QUEUE_LENGTH               5\r
+#define configTIMER_TASK_STACK_DEPTH   configMINIMAL_STACK_SIZE\r
+\r
+/* Run time stats gathering definitions. */\r
+void vMainConfigureTimerForRunTimeStats( void );\r
+uint32_t ulMainGetRunTimeCounterValue( void );\r
+#define configGENERATE_RUN_TIME_STATS  1\r
+#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats()\r
+#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero\r
+to exclude the API function. */\r
+#define INCLUDE_vTaskPrioritySet                       1\r
+#define INCLUDE_uxTaskPriorityGet                      1\r
+#define INCLUDE_vTaskDelete                                    1\r
+#define INCLUDE_vTaskCleanUpResources          0\r
+#define INCLUDE_vTaskSuspend                           1\r
+#define INCLUDE_vTaskDelayUntil                                1\r
+#define INCLUDE_vTaskDelay                                     1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark    1\r
+#define INCLUDE_xTimerGetTimerTaskHandle       0\r
+#define INCLUDE_xTaskGetIdleTaskHandle         0\r
+#define INCLUDE_xQueueGetMutexHolder           1\r
+\r
+/* Assert statement defined for debug builds. */\r
+#ifdef DEBUG\r
+       #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }\r
+#endif\r
+\r
+/* Interrupt priority configuration settings follow.\r
+http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+\r
+/* Use the system definition for the number of interrupt priorities, if there\r
+is one */\r
+#ifdef __NVIC_PRIO_BITS\r
+       #define configPRIO_BITS       __NVIC_PRIO_BITS\r
+#else\r
+       #define configPRIO_BITS       5        /* 32 priority levels */\r
+#endif\r
+\r
+/* The maximum priority an interrupt that uses an interrupt safe FreeRTOS API\r
+function can have.  Note that lower priority have numerically higher values.  */\r
+#define configMAX_LIBRARY_INTERRUPT_PRIORITY   ( 5 )\r
+\r
+/* The minimum possible interrupt priority. */\r
+#define configMIN_LIBRARY_INTERRUPT_PRIORITY   ( 31 )\r
+\r
+/* The lowest priority. */\r
+#define configKERNEL_INTERRUPT_PRIORITY                ( configMIN_LIBRARY_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
+\r
+/* Priority 5, or 248 as only the top five bits are implemented. */\r
+#define configMAX_SYSCALL_INTERRUPT_PRIORITY   ( configMAX_LIBRARY_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
+\r
+/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS\r
+standard names. */\r
+#define vPortSVCHandler SVCall_Handler\r
+#define xPortPendSVHandler PendSV_Handler\r
+#define xPortSysTickHandler SysTick_Handler\r
+\r
+\r
+\r
+\r
+/*\r
+ * DEMO APPLICATION SPECIFIC DEFINITIONS FOLLOW FROM HERE\r
+ */\r
+\r
+/* Set to 1 to include "trace start" and "trace stop" CLI commands.  These\r
+commands start and stop the FreeRTOS+Trace recording. */\r
+#define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0\r
+\r
+/* Dimensions a buffer that can be used by the FreeRTOS+CLI command\r
+interpreter.  See the FreeRTOS+CLI documentation for more information:\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */\r
+#define configCOMMAND_INT_MAX_OUTPUT_SIZE              1024\r
+\r
+/* The priority used by the Ethernet MAC driver interrupt. */\r
+#define configMAC_INTERRUPT_PRIORITY           ( configMAX_LIBRARY_INTERRUPT_PRIORITY )\r
+\r
+/* If configINCLUDE_DEMO_DEBUG_STATS is set to one, then a few basic IP trace\r
+macros are defined to gather some UDP stack statistics that can then be viewed\r
+through the CLI interface.  See\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml*/\r
+#define configINCLUDE_DEMO_DEBUG_STATS 1\r
+\r
+/* The LPC1830 Ethernet peripheral uses a DMA to transmit and receive packets.\r
+The DMA uses a chain of descriptors to reference Ethernet buffers, and provide\r
+information on the state of each buffer (full/empty/error/etc.).\r
+configNUM_RX_ETHERNET_DMA_DESCRIPTORS defines the total number of receive\r
+descriptors (descriptors that point to buffers into which the DMA will write\r
+packets received from the network).  An Ethernet buffer is assigned to each\r
+descriptor.  Having too few descriptors will impact reliability because the DMA\r
+will have to drop packets that are received when there are no receive\r
+descriptors free.  It is however only necessary to have a couple of free\r
+descriptors at a time, and having more wastes the RAM used by the Ethernet\r
+buffers that are surplus to requirements. */\r
+#define configNUM_RX_ETHERNET_DMA_DESCRIPTORS  4\r
+\r
+/* The LPC1830 Ethernet peripheral uses a DMA to transmit and receive packets.\r
+The DMA uses a chain of descriptors to reference Ethernet buffers that are\r
+waiting to be sent onto the network.  configNUM_TX_ETHERNET_DMA_DESCRIPTORS\r
+defines the total number of transmit descriptors.  An Ethernet buffer is\r
+not assigned to a transmit descriptor until data is actually sent, but will\r
+remain assigned to the descriptor until the descriptor is re-used.  It is not\r
+necessary to have many transmit descriptors as the IP stack task will be held\r
+in the Blocked state (so other tasks can run) until a descriptor becomes\r
+available if it attempts to transmit when all the descriptors are in use.  See\r
+the iptraceWAITING_FOR_TX_DMA_DESCRIPTOR() IP trace macro. */\r
+#define configNUM_TX_ETHERNET_DMA_DESCRIPTORS  1\r
+\r
+/* The address of an echo server that will be used by the two demo echo client\r
+tasks.\r
+http://localhost/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Common_Echo_Clients.shtml */\r
+#define configECHO_SERVER_ADDR0        172\r
+#define configECHO_SERVER_ADDR1 25\r
+#define configECHO_SERVER_ADDR2 218\r
+#define configECHO_SERVER_ADDR3 103\r
+\r
+/* MAC address configuration.  In a deployed production system this would\r
+probably be read from an EEPROM.  In the demo it is just hard coded.  Make sure\r
+each node on the network has a unique MAC address. */\r
+#define configMAC_ADDR0        0x00\r
+#define configMAC_ADDR1        0x01\r
+#define configMAC_ADDR2        0x02\r
+#define configMAC_ADDR3        0x03\r
+#define configMAC_ADDR4        0x04\r
+#define configMAC_ADDR5        0x08\r
+\r
+/* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
+ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configIP_ADDR0         192\r
+#define configIP_ADDR1         168\r
+#define configIP_ADDR2         1\r
+#define configIP_ADDR3         125\r
+\r
+/* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
+0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configGATEWAY_ADDR0    192\r
+#define configGATEWAY_ADDR1    168\r
+#define configGATEWAY_ADDR2    1\r
+#define configGATEWAY_ADDR3    1\r
+\r
+/* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
+208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
+to 1 but a DNS server cannot be contacted.*/\r
+#define configDNS_SERVER_ADDR0         208\r
+#define configDNS_SERVER_ADDR1         67\r
+#define configDNS_SERVER_ADDR2         222\r
+#define configDNS_SERVER_ADDR3         222\r
+\r
+/* Defalt netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
+ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configNET_MASK0                255\r
+#define configNET_MASK1                255\r
+#define configNET_MASK2                255\r
+#define configNET_MASK3                0\r
+\r
+#if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       /* Only include the trace macro definitions required by FreeRTOS+Trace is\r
+       the trace start and trace stop CLI commands are included. */\r
+       #include "trcHooks.h"\r
+#endif\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSIPConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSIPConfig.h
new file mode 100644 (file)
index 0000000..56525d5
--- /dev/null
@@ -0,0 +1,232 @@
+/*\r
+ * FreeRTOS+UDP Preview 002 (C) 2012 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for configuration information.\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Configuration.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+#ifndef FREERTOS_IP_CONFIG_H\r
+#define FREERTOS_IP_CONFIG_H\r
+\r
+/* The IP stack executes it its own task (although any application task can make\r
+use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY\r
+sets the priority of the task that executes the IP stack.  The priority is a\r
+standard FreeRTOS task priority so can take any value from 0 (the lowest\r
+priority) to (configMAX_PRIORITIES - 1) (the highest priority).\r
+configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in\r
+FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to\r
+the priority assigned to the task executing the IP stack relative to the\r
+priority assigned to tasks that use the IP stack. */\r
+#define ipconfigUDP_TASK_PRIORITY                      ( configMAX_PRIORITIES - 2 )\r
+\r
+/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+UDP\r
+task.  This setting is less important when the FreeRTOS Win32 simulator is used\r
+as the Win32 simulator only stores a fixed amount of information on the task\r
+stack.  FreeRTOS includes optional stack overflow detection, see:\r
+http://www.freertos.org/Stacks-and-stack-overflow-checking.html */\r
+#define ipconfigUDP_TASK_STACK_SIZE_WORDS      ( configMINIMAL_STACK_SIZE * 3 )\r
+\r
+/* ipconfigRAND32() is called by the IP stack to generate a random number that\r
+is then used as a DHCP transaction number.  Random number generation is performed\r
+via this macro to allow applications to use their own random number generation\r
+method.  For example, it might be possible to generate a random number by\r
+sampling noise on an analogue input. */\r
+#define ipconfigRAND32()       1\r
+\r
+/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+UDP will call the\r
+network event hook at the appropriate times.  If ipconfigUSE_NETWORK_EVENT_HOOK\r
+is not set to 1 then the network event hook will never be called.  See\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml\r
+*/\r
+#define ipconfigUSE_NETWORK_EVENT_HOOK 1\r
+\r
+/* Sockets have a send block time attribute.  If FreeRTOS_sendto() is called but\r
+a network buffer cannot be obtained then the calling task is held in the Blocked\r
+state (so other tasks can continue to executed) until either a network buffer\r
+becomes available or the send block time expires.  If the send block time expires\r
+then the send operation is aborted.  The maximum allowable send block time is\r
+capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS.  Capping the\r
+maximum allowable send block time prevents prevents a deadlock occurring when\r
+all the network buffers are in use and the tasks that process (and subsequently\r
+free) the network buffers are themselves blocked waiting for a network buffer.\r
+ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks.  A time in\r
+milliseconds can be converted to a time in ticks by dividing the time in\r
+milliseconds by portTICK_RATE_MS. */\r
+#define ipconfigMAX_SEND_BLOCK_TIME_TICKS ( 20 / portTICK_RATE_MS )\r
+\r
+/* If ipconfigUSE_DHCP is 1 then FreeRTOS+UDP will attempt to retrieve an IP\r
+address, netmask, DNS server address and gateway address from a DHCP server.  If\r
+ipconfigUSE_DHCP is 0 then FreeRTOS+UDP will use a static IP address.  The\r
+stack will revert to using the static IP address even when ipconfigUSE_DHCP is\r
+set to 1 if a valid configuration cannot be obtained from a DHCP server for any\r
+reason.  The static configuration used is that passed into the stack by the\r
+FreeRTOS_IPInit() function call. */\r
+#define ipconfigUSE_DHCP       1\r
+\r
+/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at\r
+increasing time intervals until either a reply is received from a DHCP server\r
+and accepted, or the interval between transmissions reaches\r
+ipconfigMAXIMUM_DISCOVER_TX_PERIOD.  The IP stack will revert to using the\r
+static IP address passed as a parameter to FreeRTOS_IPInit() if the\r
+re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without\r
+a DHCP reply being received. */\r
+#ifdef _WINDOWS_\r
+       /* The windows simulated time is not real time so the max delay is much\r
+       shorter. */\r
+       #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 999 / portTICK_RATE_MS )\r
+#else\r
+       #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 120000 / portTICK_RATE_MS )\r
+#endif /* _WINDOWS_ */\r
+\r
+/* The ARP cache is a table that maps IP addresses to MAC addresses.  The IP\r
+stack can only send a UDP message to a remove IP address if it knowns the MAC\r
+address associated with the IP address, or the MAC address of the router used to\r
+contact the remote IP address.  When a UDP message is received from a remote IP\r
+address the MAC address and IP address are added to the ARP cache.  When a UDP\r
+message is sent to a remote IP address that does not already appear in the ARP\r
+cache then the UDP message is replaced by a ARP message that solicits the\r
+required MAC address information.  ipconfigARP_CACHE_ENTRIES defines the maximum\r
+number of entries that can exist in the ARP table at any one time. */\r
+#define ipconfigARP_CACHE_ENTRIES              6\r
+\r
+/* ARP requests that do not result in an ARP response will be re-transmitted a\r
+maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is\r
+aborted. */\r
+#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )\r
+\r
+/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP\r
+table being created or refreshed and the entry being removed because it is stale.\r
+New ARP requests are sent for ARP cache entries that are nearing their maximum\r
+age.  ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is\r
+equal to 1500 seconds (or 25 minutes). */\r
+#define ipconfigMAX_ARP_AGE                    150\r
+\r
+/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling\r
+routines, which are relatively large.  To save code space the full\r
+FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster\r
+alternative called FreeRTOS_inet_addr_quick() is provided.  FreeRTOS_inet_addr()\r
+takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.\r
+FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets\r
+(for example, 192, 168, 0, 1) as its parameters.  If\r
+ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and\r
+FreeRTOS_indet_addr_quick() are available.  If ipconfigINCLUDE_FULL_INET_ADDR is\r
+not set to 1 then only FreeRTOS_indet_addr_quick() is available. */\r
+#define ipconfigINCLUDE_FULL_INET_ADDR 1\r
+\r
+/* ipconfigNUM_NETWORK_BUFFERS defines the total number of network buffer that\r
+are available to the IP stack.  The total number of network buffers is limited\r
+to ensure the total amount of RAM that can be consumed by the IP stack is capped\r
+to a pre-determinable value. */\r
+#define ipconfigNUM_NETWORK_BUFFERS            10\r
+\r
+/* A FreeRTOS queue is used to send events from application tasks to the IP\r
+stack.  ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can\r
+be queued for processing at any one time.  The event queue must be a minimum of\r
+5 greater than the total number of network buffers. */\r
+#define ipconfigEVENT_QUEUE_LENGTH             ( ipconfigNUM_NETWORK_BUFFERS + 5 )\r
+\r
+/* The address of a socket is the combination of its IP address and its port\r
+number.  FreeRTOS_bind() is used to manually allocate a port number to a socket\r
+(to 'bind' the socket to a port), but manual binding is not normally necessary\r
+for client sockets (those sockets that initiate outgoing connections rather than\r
+wait for incoming connections on a known port number).  If\r
+ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling\r
+FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP\r
+stack automatically binding the socket to a port number from the range\r
+socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff.  If\r
+ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()\r
+on a socket that has not yet been bound will result in the send operation being\r
+aborted. */\r
+#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1\r
+\r
+/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */\r
+#define updconfigIP_TIME_TO_LIVE               128\r
+\r
+/* If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 1 then UDP packets that\r
+contain more data than will fit in a single network frame will be fragmented\r
+across multiple IP packets.  Also see the ipconfigNETWORK_MTU setting.  If\r
+ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must\r
+be divisible by 8.  Setting ipconfigCAN_FRAGMENT_OUTGOING_PACKETS to 1 will\r
+increase both the code size and execution time. */\r
+#define ipconfigCAN_FRAGMENT_OUTGOING_PACKETS 0\r
+\r
+/* The MTU is the maximum number of bytes the payload of a network frame can\r
+contain.  For normal Ethernet V2 frames the maximum MTU is 1500.  Setting a\r
+lower value can save RAM, depending on the buffer management scheme used.  If\r
+ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must\r
+be divisible by 8. */\r
+#define ipconfigNETWORK_MTU 586\r
+\r
+/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver.  DNS is used\r
+through the FreeRTOS_gethostbyname() API function. */\r
+#define ipconfigUSE_DNS                1\r
+\r
+/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will\r
+generate replies to incoming ICMP echo (ping) requests. */\r
+#define ipconfigREPLY_TO_INCOMING_PINGS                                1\r
+\r
+/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the\r
+FreeRTOS_SendPingRequest() API function is available. */\r
+#define ipconfigSUPPORT_OUTGOING_PINGS                         1\r
+\r
+/* Used for stack testing only, and must be implemented in the network\r
+interface. */\r
+#define updconfigLOOPBACK_ETHERNET_PACKETS     0\r
+\r
+/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames\r
+that are not in Ethernet II format will be dropped.  This option is included for\r
+potential future IP stack developments. */\r
+#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1\r
+\r
+/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the\r
+responsibility of the Ethernet interface to filter out packets that are of no\r
+interest.  If the Ethernet interface does not implement this functionality, then\r
+set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack\r
+perform the filtering instead (it is much less efficient for the stack to do it\r
+because the packet will already have been passed into the stack).  If the\r
+Ethernet driver does all the necessary filtering in hardware then software\r
+filtering can be removed by using a value other than 1 or 0. */\r
+#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES    2\r
+\r
+/* The example IP trace macros are included here so the definitions are\r
+available in all the FreeRTOS+UDP source files. */\r
+#include "DemoIPTrace.h"\r
+\r
+#endif /* FREERTOS_IP_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOS_UDP_Demo Debug.launch b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOS_UDP_Demo Debug.launch
new file mode 100644 (file)
index 0000000..9df3028
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<launchConfiguration type="com.crt.dsfdebug.crtmcu.launchType">\r
+<stringAttribute key=".gdbinit" value=""/>\r
+<stringAttribute key="LAUNCH_ID.OFSemuDetails" value="Red Probe Family"/>\r
+<booleanAttribute key="com.crt.ctrlcenter.crtInit" value="true"/>\r
+<stringAttribute key="com.crt.ctrlcenter.targetbase" value="NXP LPC18xx (SWD) (*)"/>\r
+<stringAttribute key="com.crt.ctrlcenter.targetconfig" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;config chipvendor=&quot;NXP&quot; genname=&quot;NXP LPC18xx (SWD)&quot; id=&quot;config.gdb.stub&quot;&gt;&lt;parameters&gt;&lt;params&gt;&lt;param description=&quot;Enter as XTAL[,PLL]. PLL is optional. Values are in kHz&quot; name=&quot;Crystal (XTAL) frequency and PLL value&quot; required=&quot;false&quot; type=&quot;nullString&quot; value=&quot;&quot; var=&quot;xtal.hz&quot;/&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;initValue value=&quot;false&quot; var=&quot;vector.catch&quot;/&gt;&#13;&#10;&lt;params&gt;&lt;param default=&quot;true&quot; description=&quot;Vector catch&quot; name=&quot;Vector catch&quot; value=&quot;True&quot; var=&quot;vector.catch&quot;&gt;&lt;enum value=&quot;True&quot;/&gt;&#13;&#10;&lt;enum value=&quot;False&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;params&gt;&lt;param default=&quot;true&quot; description=&quot;Enable Red Trace&quot; name=&quot;Enable Red Trace &quot; value=&quot;true&quot; var=&quot;swv.enable&quot;&gt;&lt;enum value=&quot;true&quot;/&gt;&#13;&#10;&lt;enum value=&quot;false&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;params&gt;&lt;param default=&quot;Auto&quot; description=&quot;Enablement of semihosting support&quot; name=&quot;Semihosting support&quot; value=&quot;Auto&quot; var=&quot;internal.semihost&quot;&gt;&lt;enum value=&quot;On&quot;/&gt;&#13;&#10;&lt;enum value=&quot;Off&quot;/&gt;&#13;&#10;&lt;enum value=&quot;Auto&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;params&gt;&lt;param default=&quot;&quot; description=&quot;Switch debug interface between SWD and JTAG (leave blank for default [SWD])&quot; name=&quot;Debug interface&quot; option=&quot;&quot; value=&quot;&quot; var=&quot;internal.debug.interface&quot;&gt;&lt;enum value=&quot;&quot;/&gt;&#13;&#10;&lt;enum value=&quot;JTAG&quot;/&gt;&#13;&#10;&lt;enum value=&quot;SWD&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;params&gt;&lt;param default=&quot;&quot; description=&quot;Maximum wire speed in KHz (leave blank to Auto-detect). Not all values are supported by all targets&quot; name=&quot;Maximum wire speed&quot; type=&quot;nullString&quot; value=&quot;&quot; var=&quot;emu.speed&quot;&gt;&lt;enum value=&quot;&quot;/&gt;&#13;&#10;&lt;enum value=&quot;30000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;15000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;10000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;7500&quot;/&gt;&#13;&#10;&lt;enum value=&quot;6000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;5000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;3750&quot;/&gt;&#13;&#10;&lt;enum value=&quot;3000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;2500&quot;/&gt;&#13;&#10;&lt;enum value=&quot;2000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;1500&quot;/&gt;&#13;&#10;&lt;enum value=&quot;1250&quot;/&gt;&#13;&#10;&lt;enum value=&quot;1200&quot;/&gt;&#13;&#10;&lt;enum value=&quot;1000&quot;/&gt;&#13;&#10;&lt;enum value=&quot;750&quot;/&gt;&#13;&#10;&lt;enum value=&quot;600&quot;/&gt;&#13;&#10;&lt;enum value=&quot;500&quot;/&gt;&#13;&#10;&lt;enum value=&quot;400&quot;/&gt;&#13;&#10;&lt;enum value=&quot;300&quot;/&gt;&#13;&#10;&lt;enum value=&quot;250&quot;/&gt;&#13;&#10;&lt;enum value=&quot;200&quot;/&gt;&#13;&#10;&lt;enum value=&quot;150&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;params&gt;&lt;param content=&quot;startupScript&quot; description=&quot;Startup script (for use with Redlink)&quot; name=&quot;Startup script&quot; type=&quot;nullString&quot; value=&quot;&quot; var=&quot;startup.script&quot;/&gt;&#13;&#10;&lt;param default=&quot;&quot; description=&quot;Additional options&quot; name=&quot;Additional options&quot; value=&quot;&quot; var=&quot;misc.options&quot;/&gt;&#13;&#10;&lt;param default=&quot;2&quot; description=&quot;Set stub debug level (1-4)&quot; name=&quot;Debug Level &quot; value=&quot;2&quot; var=&quot;debug.level&quot;/&gt;&#13;&#10;&lt;param default=&quot;True&quot; description=&quot;when True, executable image will be loaded into the target&quot; name=&quot;Load image&quot; type=&quot;boolean&quot; value=&quot;True&quot; var=&quot;load&quot;&gt;&lt;enum value=&quot;True&quot;/&gt;&#13;&#10;&lt;enum value=&quot;False&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;param default=&quot;cont&quot; description=&quot;Run, continue or (do nothing)&quot; name=&quot;Run/Continue image&quot; value=&quot;cont&quot; var=&quot;run&quot;&gt;&lt;enum value=&quot;run&quot;/&gt;&#13;&#10;&lt;enum value=&quot;cont&quot;/&gt;&#13;&#10;&lt;enum value=&quot;&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;param default=&quot;off&quot; description=&quot;If on is specified, make the debugger treat unknown memory as non-existent and refuse \naccesses to such memory. If off is specified, treat the memory as RAM&quot; name=&quot;Memory Access Checking&quot; value=&quot;off&quot; var=&quot;mem.access&quot;&gt;&lt;enum value=&quot;on&quot;/&gt;&#13;&#10;&lt;enum value=&quot;off&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;param default=&quot;cont&quot; description=&quot;choose the disconnect behavior for the target&quot; name=&quot;Disconnect behavior&quot; value=&quot;cont&quot; var=&quot;ondisconnect&quot;&gt;&lt;enum value=&quot;nochange&quot;/&gt;&#13;&#10;&lt;enum value=&quot;stop&quot;/&gt;&#13;&#10;&lt;enum value=&quot;cont&quot;/&gt;&#13;&#10;&lt;enum value=&quot;run_cont&quot;/&gt;&#13;&#10;&lt;/param&gt;&#13;&#10;&lt;param default=&quot;&quot; description=&quot;Command to run before starting the debugger&quot; name=&quot;Pre launch command&quot; value=&quot;&quot; var=&quot;internal.prelaunch.command&quot;/&gt;&#13;&#10;&lt;/params&gt;&#13;&#10;&lt;/parameters&gt;&#13;&#10;&lt;script emulators=&quot;${gdb.stub} -mi -info-emu&quot; silent=&quot;false&quot; swv=&quot;true&quot; type=&quot;init&quot;&gt;set remotetimeout 60000&amp;#x0A;target extended-remote | ${gdb.stub} -g -mi -${debug.level:2} ${-c+speed:$null} ${-s+emu.speed:$null} ${-p+package:$null} ${-vendor=+vendor:$null} ${-flash-driver=+flash.driver:$null} ${-e+emulator:$null} ${vector.catch?-vc:} ${misc.options}&amp;#x0A;set mem inaccessible-by-default ${mem.access}&amp;#x0A;mon ondisconnect ${ondisconnect}&amp;#x0A;set arm force-mode thumb&amp;#x0A;${load}&lt;/script&gt;&#13;&#10;&lt;script silent=&quot;false&quot; type=&quot;run&quot;&gt;${run}&lt;/script&gt;&#13;&#10;&lt;/config&gt;&#10;"/>\r
+<intAttribute key="com.crt.ctrlcenter.version" value="1"/>\r
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>\r
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.GDB_INIT" value=""/>\r
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.breakpointsFullPath" value="false"/>\r
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="com.crt.ctrlcenter.cmdfactory"/>\r
+<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>\r
+<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="true"/>\r
+<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>\r
+<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>\r
+<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="com.crt.ctrlcenter.CRTEmbeddedCDebugger"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>\r
+<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>\r
+<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_REGISTER_BOOKKEEPING" value="false"/>\r
+<booleanAttribute key="org.eclipse.cdt.launch.ENABLE_VARIABLE_BOOKKEEPING" value="false"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug\FreeRTOS_UDP_Demo.axf"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="FreeRTOS_UDP_Demo"/>\r
+<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.crt.advproject.config.exe.debug.56486929"/>\r
+<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="false"/>\r
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">\r
+<listEntry value="/FreeRTOS_UDP_Demo"/>\r
+</listAttribute>\r
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">\r
+<listEntry value="4"/>\r
+</listAttribute>\r
+<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>\r
+<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>\r
+<stringAttribute key="saved_expressions&lt;seperator&gt;Unknown" value="RecorderData,&amp;RecorderData,&amp;eventBuffer,&amp;eventData,eventData,0x100014c0,0x10001530"/>\r
+</launchConfiguration>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/LEDs.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/LEDs.c
new file mode 100644 (file)
index 0000000..def8510
--- /dev/null
@@ -0,0 +1,140 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/* Simple LED IO functions.  LED 0 is toggled by a timer every half second. */\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "timers.h"\r
+\r
+/* Library includes. */\r
+#include "lpc18xx_gpio.h"\r
+#include "lpc18xx_scu.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+#define ledTOGGLE_RATE ( 500 / portTICK_RATE_MS )\r
+\r
+#define ledLED0_PORT   1\r
+#define ledLED0_BIT            ( 1UL << 11UL )\r
+\r
+#define ledLED1_PORT   2\r
+#define ledLED1_BIT            ( 1UL << 12UL )\r
+\r
+/*\r
+ * Toggles an LED just to show the application is running. \r
+ */\r
+static void prvLEDToggleTimerCallback( xTimerHandle xTimer );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vLEDsInitialise( void )\r
+{\r
+static xTimerHandle xLEDToggleTimer = NULL;\r
+\r
+       /* Set the LED pin-muxing and configure as output. */\r
+       scu_pinmux( 0x2 , 11, MD_PUP, FUNC0 );\r
+       scu_pinmux( 0x2 , 12, MD_PUP, FUNC0 );\r
+       GPIO_SetDir( ledLED0_PORT, ledLED0_BIT, 1 );\r
+       GPIO_SetDir( ledLED1_PORT, ledLED1_BIT, 1 );\r
+\r
+    /* Create the timer used to toggle LED0. */\r
+       xLEDToggleTimer = xTimerCreate( ( const int8_t * ) "LEDTmr",    /* Just a text name to associate with the timer, useful for debugging, but not used by the kernel. */\r
+                                                               ledTOGGLE_RATE,                                         /* The period of the timer. */\r
+                                                               pdTRUE,                                                         /* This timer will autoreload, so uxAutoReload is set to pdTRUE. */\r
+                                                               NULL,                                                           /* The timer ID is not used, so can be set to NULL. */\r
+                                                               prvLEDToggleTimerCallback );            /* The callback function executed each time the timer expires. */\r
+\r
+    /* Sanity check that the timer was actually created. */\r
+    configASSERT( xLEDToggleTimer );\r
+\r
+    /* Start the timer.  If this is called before the scheduler is started then\r
+    the block time will automatically get changed to 0 (from portMAX_DELAY). */\r
+    xTimerStart( xLEDToggleTimer, portMAX_DELAY );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvLEDToggleTimerCallback( xTimerHandle xTimer )\r
+{\r
+static uint8_t ucState = 0;\r
+\r
+       /* Remove compiler warnings. */\r
+       ( void ) xTimer;\r
+\r
+       /* Just toggle an LED to show the program is running. */\r
+       if( ucState == 0 )\r
+       {\r
+               GPIO_SetValue( ledLED0_PORT, ledLED0_BIT );\r
+       }\r
+       else\r
+       {\r
+               GPIO_ClearValue( ledLED0_PORT, ledLED0_BIT );\r
+       }\r
+       \r
+       ucState = !ucState;\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/README_FIRST.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/README_FIRST.txt
new file mode 100644 (file)
index 0000000..4311d8b
--- /dev/null
@@ -0,0 +1,11 @@
+This demo is documented on the following web page:\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/RTOS_UDP_and_CLI_LPC1830_NGX.shtml\r
+\r
+The FreeRTOS+UDP API is documented on the following web page:\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
+\r
+Other information, including a FreeRTOS+UDP primer, a description of the \r
+directory structure, and a glossary of networking terminology, can be found in \r
+the FreeRTOS+UDP portal:\r
+http://www.FreeRTOS.org/udp\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/RunTimeStatsTimer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/RunTimeStatsTimer.c
new file mode 100644 (file)
index 0000000..35ed0c5
--- /dev/null
@@ -0,0 +1,132 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Utility functions to implement run time stats on Cortex-M CPUs.  The collected\r
+run time data can be viewed through the CLI interface.  See the following URL for\r
+more information on run time stats: \r
+http://www.freertos.org/rtos-run-time-stats.html */\r
+\r
+/* Used in the run time stats calculations. */\r
+static uint32_t ulClocksPer10thOfAMilliSecond = 0UL;\r
+\r
+\r
+void vMainConfigureTimerForRunTimeStats( void )\r
+{\r
+       /* How many clocks are there per tenth of a millisecond? */\r
+       ulClocksPer10thOfAMilliSecond = configCPU_CLOCK_HZ / 10000UL;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+uint32_t ulMainGetRunTimeCounterValue( void )\r
+{\r
+uint32_t ulSysTickCounts, ulTickCount, ulReturn;\r
+const uint32_t ulSysTickReloadValue = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+volatile uint32_t * const pulCurrentSysTickCount = ( ( volatile uint32_t *) 0xe000e018 );\r
+volatile uint32_t * const pulInterruptCTRLState = ( ( volatile uint32_t *) 0xe000ed04 );\r
+const uint32_t ulSysTickPendingBit = 0x04000000UL;\r
+\r
+       /* NOTE: There are potentially race conditions here.  However, it is used\r
+       anyway to keep the examples simple, and to avoid reliance on a separate\r
+       timer peripheral. */\r
+\r
+\r
+       /* The SysTick is a down counter.  How many clocks have passed since it was\r
+       last reloaded? */\r
+       ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
+\r
+       /* How many times has it overflowed? */\r
+       ulTickCount = xTaskGetTickCountFromISR();\r
+\r
+       /* Is there a SysTick interrupt pending? */\r
+       if( ( *pulInterruptCTRLState & ulSysTickPendingBit ) != 0UL )\r
+       {\r
+               /* There is a SysTick interrupt pending, so the SysTick has overflowed\r
+               but the tick count not yet incremented. */\r
+               ulTickCount++;\r
+\r
+               /* Read the SysTick again, as the overflow might have occurred since\r
+               it was read last. */\r
+               ulSysTickCounts = ulSysTickReloadValue - *pulCurrentSysTickCount;\r
+       }\r
+\r
+       /* Convert the tick count into tenths of a millisecond.  THIS ASSUMES\r
+       configTICK_RATE_HZ is 1000! */\r
+       ulReturn = ( ulTickCount * 10UL ) ;\r
+\r
+       /* Add on the number of tenths of a millisecond that have passed since the\r
+       tick count last got updated. */\r
+       ulReturn += ( ulSysTickCounts / ulClocksPer10thOfAMilliSecond );\r
+\r
+       return ulReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/CMSIS END USER LICENCE AGREEMENT.pdf b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/CMSIS END USER LICENCE AGREEMENT.pdf
new file mode 100644 (file)
index 0000000..e04afae
Binary files /dev/null and b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/CMSIS END USER LICENCE AGREEMENT.pdf differ
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/cmsis_readme.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_cmsis/cmsis_readme.txt
new file mode 100644 (file)
index 0000000..316499c
--- /dev/null
@@ -0,0 +1,44 @@
+CMSIS : Cortex Microcontroller Software Interface Standard\r
+==========================================================\r
+\r
+Introduction\r
+~~~~~~~~~~~~\r
+CMSIS defines for a Cortex-M Microcontroller System:\r
+\r
+    * A common way to access peripheral registers and a \r
+      common way to define exception vectors.\r
+    * The register names of the Core Peripherals and the \r
+      names of the Core Exception Vectors.\r
+    * An device independent interface for RTOS Kernels \r
+      including a debug channel.\r
+\r
+By using CMSIS compliant software components, the user can \r
+easier re-use template code. CMSIS is intended to enable the\r
+combination of software components from multiple middleware \r
+vendors. \r
+\r
+This project contains appropriate files for this MCU family \r
+taken from CMSIS. A full copy of the CMSIS files, together\r
+with additional information on CMSIS can be found at:\r
+\r
+  http://www.onarm.com/\r
+  http://www.arm.com/\r
+\r
+Documentation\r
+~~~~~~~~~~~~~\r
+The standard CMSIS documentation can be found within the\r
+Code Red IDE help system, via:\r
+\r
+Help -> Help Contents -> Code Red Product Documentation -> CMSIS\r
+\r
+More information on the use of CMSIS within the Code Red IDE\r
+can be found in the Support area of the Code Red website at\r
+\r
+  http://www.code-red-tech.com/\r
+\r
+At the time of writing, the CMSIS FAQ can be found directly\r
+at:\r
+\r
+  http://support.code-red-tech.com/CodeRedWiki/Support4CMSIS\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/LPC1800CMSIS_ReleaseNotes.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/LPC1800CMSIS_ReleaseNotes.txt
new file mode 100644 (file)
index 0000000..b91c5ee
--- /dev/null
@@ -0,0 +1,325 @@
+RELEASE CMSIS for REV A 20111209\r
+1/ New LPC18xx.h header file. Changes GPIO structure.\r
+2/ Addition of lpc18xx_emc.c and lpc18xx_emc.h to configure memory on Hitex board.\r
+3/ Addition of spifi_rom_api.h, spifi_drv_M3.lib and SPIFI_ROM_support.doc SPIFI driver package\r
+4/ Updated SPIFI programming driver for Keil MDK which uses the SPIFI lib\r
+5/ New BOOTFAST example shows how to boot from external flash or QSPI and ramp to 180 MHz\r
+\r
+RELEASE CMSIS for REV A 20111130\r
+1./ lpc18xx_lcd.h LCD_CFG_type add member pcd, lpc18xx_lcd.c add init pcd in LCD_Init function\r
+2./ protect MAX and MIN macro in lpc_types.h\r
+3./ Add getPC function to ARM,GNU, IAR startup_lpc18xx.s\r
+4./ Add VTOR init in SystemInit function\r
+5./ Change All ADC examples to use ADC port 0\r
+6./ These example: CortexM3_Mpu, Pwr_DeepPowerDown, Timer_FreqMeasure, SCT_SimpleMatch and all USBDEV_ROM examples Keil project was adjusted\r
+7./ SDRAM example and LCD example was changed not to use uint64_t in NS2CLK function\r
+8./ Nvic_VectorTableRelocation.c\r
+removed: \r
+#if __RAM_MODE__//Run in RAM mode\r
+  memcpy((void *)VTOR_OFFSET, (const void *)0x10000000, 256*4);\r
+#else\r
+  memcpy((void *)VTOR_OFFSET, (const void *)0x1C000000, 256*4);\r
+#endif\r
+\r
+added:\r
+memcpy((void *)VTOR_OFFSET, (const void *)(getPC()& 0xFF000000), 256*4);\r
+9./ Pwr_PowerDown change method for testing this feature\r
+\r
+\r
+RELEASE CMSIS for REV A 20111028\r
+1./ Add GNU support\r
+2./ Addition of new Keil flash drivers for eFlash and SPIFI\r
+3./ Change of Keil projects to support eFlash and SPIFI operation\r
+\r
+PRE-RELEASE CMSIS for REV A 20111011\r
+1/ PowerDown Example IAR issue fixed\r
+2/ Upgraded CMSIS to version 2.10\r
+3/ Upgraded Core header to Rev A\r
+4/ lpc18xx_can.h remove all bitrates from 8Mhz, add bitrates from 12Mhz\r
+       /** Bitrate: 100K */\r
+       #define CAN_BITRATE100K12MHZ           0x00004509\r
+       /** Bitrate: 125K */\r
+       #define CAN_BITRATE125K12MHZ           0x00004507\r
+       /** Bitrate: 250K */\r
+       #define CAN_BITRATE250K12MHZ           0x00004503\r
+       /** Bitrate: 500K */\r
+       #define CAN_BITRATE500K12MHZ            0x00004501\r
+       /** Bitrate: 1000K */\r
+       #define CAN_BITRATE1000K12MHZ          0x00004500\r
+5./ lpc18xx_cgu.* add PLL audio clock, modify alloc connect table and CGU_Entity_ControlReg_Offset\r
+6./ lpc18xx_evrt.h\r
+       add EVRT_SRC_SDIO\r
+7./ lpc18xx_i2s.h separate LPC_I2S0 and LPC_I2S1\r
+8./ lpc18xx_scu.h\r
+       redefine, add pin modes and add pin functions 4->7\r
+9./ debug_frmwrk.c\r
+       changed pin mode for UART RXD0 and UART RXD1\r
+10./ lpc_can.c replace LPC_CAN by LPC_CAN0\r
+11./ lpc18xx_i2c.* replace i2c pin configurations\r
+12./ lpc18xx_ssp.c down default clock speed to 100kHz\r
+13./ Examples\CCAN\CCan_SimpleTxRx\CCan_SimpleTxRx.c change RD pin mode to enable input buffer\r
+14./ Examples\EMAC\Emac_EasyWeb\emac.c\r
+               replace MII and RMII pin setting by source from CodeBundle\r
+15./ Examples\EMC\Emc_Sdram\SDRAM_Init.c and Examples\EMC\Emc_NorFlash\SST39VF320.c\r
+               replace EMC pin setting to be compatible with Rev A\r
+16./ Examples\I2S\I2s_Audio\I2s_Audio.c\r
+               replace I2S pin setting to be compatible with Rev A\r
+               replace I2S to I2S0\r
+17./ Examples\LCD\Lcd_Demo\IS42S16400D.c\r
+               replace EMC pin setting to be compatible with Rev A\r
+18./ Examples\SSP\All SSP examples: replace SSP pin setting to be compatible with Rev A\r
+19./ Timer_Capture and Timer_FreqMeasure: replace Capture input pin setting to be compatible with Rev A\r
+20./ Examples\UART\All UART examples: replace UART pin setting to be compatible with Rev A\r
+21./ Examples\USBDEV\USB_*\usbhw.c\r
+               replace USB pin setting to be compatible with Rev A\r
+               correct clock in Init function\r
+\r
+RELEASE: LPC1800CMSIS_20110829\r
+1./ Add GNU Support\r
+modify pasting in can.c to be compatible with GCC\r
+\r
+RELEASE: LPC1800CMSIS_20110729\r
+1./ IAR flash support is moved to Tools folder\r
+2./ ADC.h fixed macro ADC_CR_BITACC\r
+3./ I2S.h fixed comment\r
+       from #endif /* LPC17XX_SSP_H_ */\r
+       to #endif /* LPC18XX_I2S_H_ */\r
+4./ ADC.c fix ADC_Init Clock by rounding clk div value\r
+5./ i2s.c fixed some comment\r
+6./ EMC Nor Flash renamed file  flash programing function\r
+7./ SDRAM can run at MAX EMC Speed\r
+8./ Removed flash programing support for LHF00L28\r
+\r
+RELEASE: LPC1800CMSIS_20110627\r
+1./ Fix abstract\r
+2./ Fix I2S FreqConfig mistake\r
+3./ Add DFU Driver and App\r
+\r
+\r
+RELEASE: LPC1800CMSIS_20110613\r
+1./ Add DSP Document\r
+2./ Speed Up External FLash Mode\r
+3./ Add IAR Flash Support\r
+4./ Fix GPDMA Flash transfer issue in IAR\r
+5./ Set default taget is EXFLASH(Keil only)\r
+\r
+************************************************************************************************************************************************\r
+RELEASE: LPC1800CMSIS_20110603\r
+1./ Add DSP_lib into Core folder\r
+2./ Update core_cmFunc.h and core_cmInstr.h for solving conflict with IAR EWARM version 6.20 or later\r
+3./ add IAR startup file and IAR support files in Core\DeviceSupport\NXP\LPC18xx\r
+4./ Modify SystemInit function to support RAM mode\r
+       #if (__RAM_MODE__)\r
+       SCB->VTOR = 0x10000000;\r
+       #endif\r
+5./ Modify CCU1 and CCU2 struct in LPC18xx.h\r
+6./ Fix bug in uart_set_divisors function\r
+7./ Change UART clock source from XTAL to PLL1 in uart driver\r
+8./ Fix RTC bugs\r
+9./ Modify lpc18xx_GPDMA.c to support IAR compiler\r
+10./ Modify lpc18xx_cgu.c to support IAR compiler\r
+11./ Update lpc_types.h to support IAR compiler\r
+12./ Fix bugs in I2S driver\r
+13./ Remove Warnings\r
+14./ Change new header, add more comments\r
+15./ Standalize example, project, output names\r
+16./ Support IAR EWARM (RAM mode)\r
+17./ SUpport Hitex Board as default\r
+18./ Modify hardware configuration in abstract files\r
+19./ Set default Target to RAM mode\r
+\r
+************************************************************************************************************************************************\r
+RELEASE: LPC1800CMSIS_20110514\r
+1./ Change all Keil example projects from device Cortex M3 to LPC1850\r
+2./ change all examples to support Hitex board only\r
+3./ Verify all project option\r
+4./ separated CGU and PWR into 2 independent drivers\r
+\r
+************************************************************************************************************************************************\r
+RELEASE: LPC1800CMSIS_20110421\r
+1./ Add CAN driver:\r
+       Drivers/include/lpc18xx_can.h\r
+       Drivers/source/lpc18xx_can.c\r
+\r
+2./ Add CAN example for simple Transceiver\r
+       Examples\C_CAN\simpleTxRx\r
+\r
+3./ Add 4 USB Rom examples:\r
+       USB_DFU\r
+       USB_HID\r
+       USB_MassStorage\r
+       USB_Composite\r
+\r
+4./ Enable _printf function\r
+       debug_frmwrk.h:\r
+               uncomment _printf function declaration\r
+       debug_frmwrk.c:\r
+               uncomment _printf function\r
+\r
+************************************************************************************************************************************************\r
+RELEASE: LPC1800CMSIS_20110401\r
+\r
+1./ Change all Keil example proiects from device NXP LPC1768 to ARM Cortex-M3\r
+\r
+2./ Fix bug in I2C driver (customer feedback)\r
+       Problem description: \r
+               I2C_MasterTransferData() is not able to \r
+               (1) Send, \r
+               (2) doing a repeated Start and \r
+               (3) starting to receive with one function call. \r
+               Problem is that the repeated start is not generated, but a retransmission of the \r
+               last word is startet. \r
+       Solve: change \r
+               I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; \r
+               I2Cx->I2CONSET = I2C_I2CONSET_STA; \r
+       to \r
+               I2Cx->I2CONSET = I2C_I2CONSET_STA; \r
+               I2Cx->I2CONCLR = I2C_I2CONCLR_SIC; \r
+               in function I2C_Start ()\r
+\r
+3./ lpc18xx_timer.c:\r
+       Function TIM_ClearIntPending():\r
+               Change TIMx->IR |= TIM_IR_CLR(IntFlag);\r
+               To     TIMx->IR = TIM_IR_CLR(IntFlag);\r
+       Function TIM_ClearIntCapturePending():\r
+               Change TIMx->IR |= (1<<(4+IntFlag));\r
+               To     TIMx->IR = (1<<(4+IntFlag));\r
+       Function TIM_GetCaptureValue(): \r
+               Add return 0;\r
+\r
+4./ EMC - Nor Flash: remove example build target for FLASH mode as it only can run in RAM mode.\r
+\r
+5./ SCT: update Fizzim tool to version 1.1\r
+\r
+6./ Tools:\r
+       Update Flash burning for LHF00L28 and SST39X320X\r
+\r
+************************************************************************************************************************************************\r
+\r
+RELEASE: LPC1800CMSIS_20110324\r
+\r
+1./ Current support hardwares:\r
+       - NXP LPC1800 Evaluation board through definition 'BOARD_NXP_EA'\r
+       - Hitex LPC1800 Board through definition 'BOARD_HITEX_LPC1800'\r
+    Some examples can run on LPC1800 Evaluation board, some can run on Hitex board...Please refer to abstract.txt\r
+\r
+2./ Addin new flash support under Tools/Flash/SST39X320X\r
+\r
+3./ lpc18xx_evrt.c:\r
+       Change EVRTx->SET_EN |= (1<<(uint8_t)EVRT_Src);\r
+       To     EVRTx->SET_EN = (1<<(uint8_t)EVRT_Src);\r
+       Purpose: prevent clearing other set bits as writing '0' has no effect\r
+\r
+4./ Fix ATIMER_WIC example:\r
+       - Configure 32KHZ osc in lpc18xx_atimer.c\r
+       - Call the configuration function in atimer_wic.c\r
+\r
+5./ Fix RTC_Alarm example:\r
+       - Configure 32KHZ osc in lpc18xx_rtc.c\r
+       - Update Rtc_Alarm.c\r
+\r
+6./ Add in PWR_PowerDown example\r
+\r
+7./ Add in PWR_DeepPowerDown example\r
+\r
+8./ All example in PWR are modified to wait for '1' sent from PC's COM port to start\r
+\r
+9./ Fix LCD Logic4.3 example to run on Hitex LPC1800 Board\r
+\r
+10./ Add in GPDMA Flash_2_Ram_Test example\r
+\r
+11./ EMC EXT_SDRAM example: join IS42S16400D.c and MT48LC4M32B2.c into SDRAM_Init.c\r
+\r
+12./ lpc18xx_i2s.c: update I2S_FreqConfig() function\r
+\r
+************************************************************************************************************************************************\r
+\r
+RELEASE: LPC1800CMSIS_20110311\r
+\r
+1./ This package is compliant to CMSIS 2.0\r
+\r
+2./ Add in 'Tools' folder which contains neccessary material for building project, examples like flash burning,..\r
+\r
+3./ Examples are given in Keil uVision 4 project\r
+\r
+4./ Current support hardwares:\r
+       - NXP LPC1800 Evaluation board through definition 'BOARD_NXP_EA'\r
+\r
+5./ Examples can run:\r
+       - RAM (debug) mode\r
+       - ROM (Flash, stand alone) mode\r
+               + External Nor Flash. Flash Part supporting:\r
+                       1) LHF00L28\r
+\r
+6./ Each example folder has an 'abstract.txt' file, this is where user can start\r
+\r
+7./ Below is list of drivers and examples:\r
+       - ADC (lpc18xx_adc):\r
+               + ADC_Interrupt\r
+               + ADC_Polling\r
+               + ADC_Burst\r
+               + ADC_Dma\r
+       - ATIMER (lpc18xx_atimer):\r
+               + ATIMER_interrupt\r
+       - PWR (lpc18xx_clkpwr):\r
+               + CLKPWR_Sleep\r
+               + CLKPWR_DeepSleep\r
+       - DAC (lpc18xx_dac):\r
+               + DAC_WaveGenerator\r
+               + DAC_Dma\r
+       - EMAC (lpc18xx_emac):\r
+               + EMAC_EasyWeb\r
+       - EMC (no driver):\r
+               + EXT_SDRAM\r
+               + NOR_FLASH\r
+       - GPDMA (lpc18xx_gpdma):\r
+               + GPDMA_Ram2Ram\r
+               + GPDMA_LinkList\r
+       - GPIO (lpc18xx_gpio):\r
+               + GPIO_LedBlinky\r
+       - I2C (lpc18xx_i2c):\r
+               + I2C_Master\r
+       - I2S (lpc18xx_i2s):\r
+               + I2S_Audio\r
+       - LCD (lpc18xx_lcd)\r
+       - MCPWM (lpc18xx_mcpwm):\r
+               + MCPWM_Simple\r
+       - SCU (lpc18xx_scu)\r
+       - QEI (lpc18xx_qei):\r
+               + QEI_Velo\r
+       - RIT (lpc18xx_rit):\r
+               + RIT_Interrupt\r
+       - RTC (lpc18xx_rtc):\r
+               + RTC_Calib\r
+               + RTC_Alarm\r
+       - SSP (lpc18xx_ssp):\r
+               + SSP_SPI\r
+               + SSP_Microwire\r
+               + SSP_TI\r
+       - TIMER (lpc18xx_timer):\r
+               + TIMER_Capture\r
+               + TIMER_MatchInterrupt\r
+               + TIMER_FreqMeasure\r
+       - UART (lpc18xx_uart):\r
+               + UART_Autobaud\r
+               + UART_Dma\r
+               + UART_Interrupt\r
+               + UART_Polling\r
+               + UART_RS485\r
+       - SCT(LPC18xx_SCT):\r
+               + SCT_Capture\r
+               + SCT_Match\r
+       - WWDT (lpc18xx_wwdt):\r
+               + WWDT_Interrupt\r
+       - CORTEXM3 (no driver):\r
+               + CORTEXM3_BitBanding\r
+               + CORTEXM3_MPU\r
+               + CORTEXM3_PriviledgeMode\r
+       - USBDEV (no driver):\r
+               + USBDEV_VirtualCOM\r
+               + USBDEV_MassStorage\r
+       - NVIC (no driver):\r
+               + NVIC_Priority\r
+               + NVIC_VecRelocation\r
+       - EVRT (lpc18xx_evrt)\r
+               
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/readme.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/docs_nxp_driverlib/readme.txt
new file mode 100644 (file)
index 0000000..cc002c2
--- /dev/null
@@ -0,0 +1,9 @@
+NXP's documentation for their peripheral driver library can be found\r
+as a Microsoft Compiled HTML Help file (.chm) within the LPC18xx \r
+CMSIS Standard Peripheral Driver Library download on NXP's website.\r
+\r
+At the time of writing, this can be found at the following link:\r
+\r
+http://lpcware.com/file_filter/nxp?term_node_tid_depth=All&term_node_tid_depth_1=103\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/LPC18xx.h
new file mode 100644 (file)
index 0000000..9241fba
--- /dev/null
@@ -0,0 +1,32280 @@
+\r
+/****************************************************************************************************//**\r
+ * @file     LPC18xx.h\r
+ *\r
+ * @status   EXPERIMENTAL\r
+ *\r
+ * @brief    CMSIS Cortex-M3 Core Peripheral Access Layer Header File for\r
+ *           default LPC18xx Device Series\r
+ *\r
+ * @version  V18\r
+ * @date     1. December 2011\r
+ *\r
+ * @note     Generated with SVDConv V2.6 Build 6c  on Thursday, 01.12.2011 08:48:39\r
+ *\r
+ *           from CMSIS SVD File 'LPC18xxv18.xml' Version 18,\r
+ *           created on Tuesday, 22.11.2011 18:06:23, last modified on Tuesday, 22.11.2011 18:38:38\r
+ *\r
+ *******************************************************************************************************/\r
+\r
+\r
+\r
+/** @addtogroup (null)\r
+  * @{\r
+  */\r
+\r
+/** @addtogroup LPC18xx\r
+  * @{\r
+  */\r
+\r
+#ifndef __LPC18XX_H__\r
+#define __LPC18XX_H__\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+\r
+/********************************************\r
+** Start of section using anonymous unions **\r
+*********************************************/\r
+\r
+#if defined(__ARMCC_VERSION)\r
+  #pragma push\r
+  #pragma anon_unions\r
+#elif defined(__CWCC__)\r
+  #pragma push\r
+  #pragma cpp_extensions on\r
+#elif defined(__GNUC__)\r
+  /* anonymous unions are enabled by default */\r
+#elif defined(__IAR_SYSTEMS_ICC__)\r
+  #pragma push\r
+  #pragma language=extended\r
+#else\r
+  #error Not supported compiler type\r
+#endif\r
+\r
+\r
+ /* Interrupt Number Definition */\r
+\r
+typedef enum {\r
+// -------------------------  Cortex-M3 Processor Exceptions Numbers  -----------------------------\r
+  Reset_IRQn                        = -15,  /*!<   1  Reset Vector, invoked on Power up and warm reset */\r
+  NonMaskableInt_IRQn               = -14,  /*!<   2  Non maskable Interrupt, cannot be stopped or preempted */\r
+  HardFault_IRQn                    = -13,  /*!<   3  Hard Fault, all classes of Fault */\r
+  MemoryManagement_IRQn             = -12,  /*!<   4  Memory Management, MPU mismatch, including Access Violation and No Match */\r
+  BusFault_IRQn                     = -11,  /*!<   5  Bus Fault, Pre-Fetch-, Memory Access Fault, other address/memory related Fault */\r
+  UsageFault_IRQn                   = -10,  /*!<   6  Usage Fault, i.e. Undef Instruction, Illegal State Transition */\r
+  SVCall_IRQn                       = -5,   /*!<  11  System Service Call via SVC instruction */\r
+  DebugMonitor_IRQn                 = -4,   /*!<  12  Debug Monitor                    */\r
+  PendSV_IRQn                       = -2,   /*!<  14  Pendable request for system service */\r
+  SysTick_IRQn                      = -1,   /*!<  15  System Tick Timer                */\r
+// ---------------------------  LPC18xx Specific Interrupt Numbers  -------------------------------\r
+  DAC_IRQn                          = 0,    /*!<   0  DAC                              */\r
+  RESERVED0_IRQn                    = 1,    /*!<   1  M0a                              */\r
+  DMA_IRQn                          = 2,    /*!<   2  DMA                              */\r
+  RESERVED1_IRQn                    = 3,    /*!<   3  EZH/EDM                          */\r
+  RESERVED2_IRQn                    = 4,\r
+  ETHERNET_IRQn                     = 5,    /*!<   5  ETHERNET                         */\r
+  SDIO_IRQn                         = 6,    /*!<   6  SDIO                             */\r
+  LCD_IRQn                          = 7,    /*!<   7  LCD                              */\r
+  USB0_IRQn                         = 8,    /*!<   8  USB0                             */\r
+  USB1_IRQn                         = 9,    /*!<   9  USB1                             */\r
+  SCT_IRQn                          = 10,   /*!<  10  SCT                              */\r
+  RITIMER_IRQn                      = 11,   /*!<  11  RITIMER                          */\r
+  TIMER0_IRQn                       = 12,   /*!<  12  TIMER0                           */\r
+  TIMER1_IRQn                       = 13,   /*!<  13  TIMER1                           */\r
+  TIMER2_IRQn                       = 14,   /*!<  14  TIMER2                           */\r
+  TIMER3_IRQn                       = 15,   /*!<  15  TIMER3                           */\r
+  MCPWM_IRQn                        = 16,   /*!<  16  MCPWM                            */\r
+  ADC0_IRQn                         = 17,   /*!<  17  ADC0                             */\r
+  I2C0_IRQn                         = 18,   /*!<  18  I2C0                             */\r
+  I2C1_IRQn                         = 19,   /*!<  19  I2C1                             */\r
+  RESERVED3_IRQn                    = 20,\r
+  ADC1_IRQn                         = 21,   /*!<  21  ADC1                             */\r
+  SSP0_IRQn                         = 22,   /*!<  22  SSP0                             */\r
+  SSP1_IRQn                         = 23,   /*!<  23  SSP1                             */\r
+  USART0_IRQn                       = 24,   /*!<  24  USART0                           */\r
+  UART1_IRQn                        = 25,   /*!<  25  UART1                            */\r
+  USART2_IRQn                       = 26,   /*!<  26  USART2                           */\r
+  USART3_IRQn                       = 27,   /*!<  27  USART3                           */\r
+  I2S0_IRQn                         = 28,   /*!<  28  I2S0                             */\r
+  I2S1_IRQn                         = 29,   /*!<  29  I2S1                             */\r
+  RESERVED4_IRQn                    = 30,\r
+  RESERVED5_IRQn                    = 31,\r
+  PIN_INT0_IRQn                     = 32,   /*!<  32  PIN_INT0                         */\r
+  PIN_INT1_IRQn                     = 33,   /*!<  33  PIN_INT1                         */\r
+  PIN_INT2_IRQn                     = 34,   /*!<  34  PIN_INT2                         */\r
+  PIN_INT3_IRQn                     = 35,   /*!<  35  PIN_INT3                         */\r
+  PIN_INT4_IRQn                     = 36,   /*!<  36  PIN_INT4                         */\r
+  PIN_INT5_IRQn                     = 37,   /*!<  37  PIN_INT5                         */\r
+  PIN_INT6_IRQn                     = 38,   /*!<  38  PIN_INT6                         */\r
+  PIN_INT7_IRQn                     = 39,   /*!<  39  PIN_INT7                         */\r
+  GINT0_IRQn                        = 40,   /*!<  40  GINT0                            */\r
+  GINT1_IRQn                        = 41,   /*!<  41  GINT1                            */\r
+  EVENTROUTER_IRQn                  = 42,   /*!<  42  EVENTROUTER                      */\r
+  C_CAN1_IRQn                       = 43,   /*!<  43  C_CAN1                           */\r
+  RESERVED6_IRQn                    = 44,\r
+  RESERVED7_IRQn                    = 45,   /*!<  45  VADC                             */\r
+  ATIMER_IRQn                       = 46,   /*!<  46  ATIMER                           */\r
+  RTC_IRQn                          = 47,   /*!<  47  RTC                              */\r
+  RESERVED8_IRQn                    = 48,\r
+  WWDT_IRQn                         = 49,   /*!<  49  WWDT                              */\r
+  RESERVED9_IRQn                    = 50,\r
+  C_CAN0_IRQn                       = 51,   /*!<  51  C_CAN0                           */\r
+  QEI_IRQn                          = 52,   /*!<  52  QEI                              */\r
+} IRQn_Type;\r
+\r
+ /* Event Router Input (ERI) Number Definitions */\r
+typedef enum {\r
+  WAKEUP0_ERIn                      = 0,\r
+  WAKEUP1_ERIn                      = 1,\r
+  WAKEUP2_ERIn                      = 2,\r
+  WAKEUP3_ERIn                      = 3,\r
+  ATIMER_ERIn                       = 4,\r
+  RTC_ERIn                          = 5,\r
+  BOD1_ERIn                         = 6,  /* Bod trip 1 */\r
+  WWDT_ERIn                         = 7,\r
+  ETH_ERIn                          = 8,\r
+  USB0_ERIn                         = 9,\r
+  USB1_ERIn                         = 10,\r
+  SDIO_ERIn                         = 11,\r
+  CAN_ERIn                          = 12, /* CAN0/1 or'ed */\r
+  TIM2_ERIn                         = 13,\r
+  TIM6_ERIn                         = 14,\r
+  QEI_ERIn                          = 15,\r
+  TIM14_ERIn                        = 16,\r
+  RESERVED0_ERIn                    = 17, /* M0s */\r
+  RESERVED1_ERIn                    = 18, /* M3/M4 */\r
+  RESET_ERIn                        = 19\r
+}ERIn_Type;\r
+\r
+/** @addtogroup Configuration_of_CMSIS\r
+  * @{\r
+  */\r
+\r
+/* Processor and Core Peripheral Section */ /* Configuration of the Template Processor and Core Peripherals */\r
+\r
+#define __CM3_REV                              0x0101          /*!< Cortex-M3 Core Revision               */\r
+#define __MPU_PRESENT                  1               /*!< MPU present or not                    */\r
+#define __NVIC_PRIO_BITS               4               /*!< Number of Bits used for Priority Levels */\r
+#define __Vendor_SysTickConfig         0               /*!< Set to 1 if different SysTick Config is used */\r
+/** @} */ /* End of group Configuration_of_CMSIS */\r
+\r
+#include "core_cm3.h"                       /*!< Cortex-M3 processor and core peripherals */\r
+//#include <core_cm3.h>                       /*!< Cortex-M3 processor and core peripherals */\r
+\r
+#include "system_LPC18xx.h"                 /*!< LPC18xx System                        */\r
+\r
+/** @addtogroup Device_Peripheral_Registers\r
+  * @{\r
+  */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          SCT                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx State Configurable Timer (SCT) Modification date=1/18/2011 Major revision=0 Minor revision=7  (SCT)\r
+  */\r
+\r
+#define CONFIG_SCT_nEV   (16)            /* Number of events */\r
+#define CONFIG_SCT_nRG   (16)            /* Number of match/compare registers */\r
+#define CONFIG_SCT_nOU   (16)            /* Number of outputs */\r
+\r
+typedef struct\r
+{\r
+    __IO  uint32_t CONFIG;              /* 0x000 Configuration Register */\r
+    union {\r
+        __IO uint32_t CTRL_U;           /* 0x004 Control Register */\r
+        struct {\r
+            __IO uint16_t CTRL_L;       /* 0x004 low control register */\r
+            __IO uint16_t CTRL_H;       /* 0x006 high control register */\r
+        };\r
+    };\r
+    __IO uint16_t LIMIT_L;              /* 0x008 limit register for counter L */\r
+    __IO uint16_t LIMIT_H;              /* 0x00A limit register for counter H */\r
+    __IO uint16_t HALT_L;               /* 0x00C halt register for counter L */\r
+    __IO uint16_t HALT_H;               /* 0x00E halt register for counter H */\r
+    __IO uint16_t STOP_L;               /* 0x010 stop register for counter L */\r
+    __IO uint16_t STOP_H;               /* 0x012 stop register for counter H */\r
+    __IO uint16_t START_L;              /* 0x014 start register for counter L */\r
+    __IO uint16_t START_H;              /* 0x016 start register for counter H */\r
+         uint32_t RESERVED1[10];        /* 0x018-0x03C reserved */\r
+    union {\r
+        __IO uint32_t COUNT_U;          /* 0x040 counter register */\r
+        struct {\r
+            __IO uint16_t COUNT_L;      /* 0x040 counter register for counter L */\r
+            __IO uint16_t COUNT_H;      /* 0x042 counter register for counter H */\r
+        };\r
+    };\r
+    __IO uint16_t STATE_L;              /* 0x044 state register for counter L */\r
+    __IO uint16_t STATE_H;              /* 0x046 state register for counter H */\r
+    __I  uint32_t INPUT;                /* 0x048 input register */\r
+    __IO uint16_t REGMODE_L;            /* 0x04C match - capture registers mode register L */\r
+    __IO uint16_t REGMODE_H;            /* 0x04E match - capture registers mode register H */\r
+    __IO uint32_t OUTPUT;               /* 0x050 output register */\r
+    __IO uint32_t OUTPUTDIRCTRL;        /* 0x054 Output counter direction Control Register */\r
+    __IO uint32_t RES;                  /* 0x058 conflict resolution register */\r
+    __IO uint32_t DMA0REQUEST;          /* 0x05C DMA0 Request Register */\r
+    __IO uint32_t DMA1REQUEST;          /* 0x060 DMA1 Request Register */\r
+         uint32_t RESERVED2[35];        /* 0x064-0x0EC reserved */\r
+    __IO uint32_t EVEN;                 /* 0x0F0 event enable register */\r
+    __IO uint32_t EVFLAG;               /* 0x0F4 event flag register */\r
+    __IO uint32_t CONEN;                /* 0x0F8 conflict enable register */\r
+    __IO uint32_t CONFLAG;              /* 0x0FC conflict flag register */\r
+\r
+    union {\r
+        __IO union {                    /* 0x100-... Match / Capture value */\r
+            uint32_t U;                 /*       SCTMATCH[i].U  Unified 32-bit register */\r
+            struct {\r
+                uint16_t L;             /*       SCTMATCH[i].L  Access to L value */\r
+                uint16_t H;             /*       SCTMATCH[i].H  Access to H value */\r
+            };\r
+        } MATCH[CONFIG_SCT_nRG];\r
+        __I union {\r
+            uint32_t U;                 /*       SCTCAP[i].U  Unified 32-bit register */\r
+            struct {\r
+                uint16_t L;             /*       SCTCAP[i].L  Access to H value */\r
+                uint16_t H;             /*       SCTCAP[i].H  Access to H value */\r
+            };\r
+        } CAP[CONFIG_SCT_nRG];\r
+    };\r
+\r
+         uint32_t RESERVED3[32-CONFIG_SCT_nRG];      /* ...-0x17C reserved */\r
+\r
+    union {\r
+        __IO uint16_t MATCH_L[CONFIG_SCT_nRG];       /* 0x180-... Match Value L counter */\r
+        __I  uint16_t CAP_L[CONFIG_SCT_nRG];         /* 0x180-... Capture Value L counter */\r
+    };\r
+         uint16_t RESERVED4[32-CONFIG_SCT_nRG];      /* ...-0x1BE reserved */\r
+    union {\r
+        __IO uint16_t MATCH_H[CONFIG_SCT_nRG];       /* 0x1C0-... Match Value H counter */\r
+        __I  uint16_t CAP_H[CONFIG_SCT_nRG];         /* 0x1C0-... Capture Value H counter */\r
+    };\r
+         uint16_t RESERVED5[32-CONFIG_SCT_nRG];      /* ...-0x1FE reserved */\r
+\r
+    union {\r
+        __IO union {                    /* 0x200-... Match Reload / Capture Control value */\r
+            uint32_t U;                 /*       SCTMATCHREL[i].U  Unified 32-bit register */\r
+            struct {\r
+                uint16_t L;             /*       SCTMATCHREL[i].L  Access to L value */\r
+                uint16_t H;             /*       SCTMATCHREL[i].H  Access to H value */\r
+            };\r
+        } MATCHREL[CONFIG_SCT_nRG];\r
+        __IO union {\r
+            uint32_t U;                 /*       SCTCAPCTRL[i].U  Unified 32-bit register */\r
+            struct {\r
+                uint16_t L;             /*       SCTCAPCTRL[i].L  Access to H value */\r
+                uint16_t H;             /*       SCTCAPCTRL[i].H  Access to H value */\r
+            };\r
+        } CAPCTRL[CONFIG_SCT_nRG];\r
+    };\r
+\r
+         uint32_t RESERVED6[32-CONFIG_SCT_nRG];      /* ...-0x27C reserved */\r
+\r
+    union {\r
+        __IO uint16_t MATCHREL_L[CONFIG_SCT_nRG];    /* 0x280-... Match Reload value L counter */\r
+        __IO uint16_t CAPCTRL_L[CONFIG_SCT_nRG];     /* 0x280-... Capture Control value L counter */\r
+    };\r
+         uint16_t RESERVED7[32-CONFIG_SCT_nRG];      /* ...-0x2BE reserved */\r
+    union {\r
+        __IO uint16_t MATCHREL_H[CONFIG_SCT_nRG];    /* 0x2C0-... Match Reload value H counter */\r
+        __IO uint16_t CAPCTRL_H[CONFIG_SCT_nRG];     /* 0x2C0-... Capture Control value H counter */\r
+    };\r
+         uint16_t RESERVED8[32-CONFIG_SCT_nRG];      /* ...-0x2FE reserved */\r
+\r
+    __IO struct {                       /* 0x300-0x3FC  SCTEVENT[i].STATE / SCTEVENT[i].CTRL*/\r
+        uint32_t STATE;                 /* Event State Register */\r
+        uint32_t CTRL;                  /* Event Control Register */\r
+    } EVENT[CONFIG_SCT_nEV];\r
+\r
+         uint32_t RESERVED9[128-2*CONFIG_SCT_nEV];   /* ...-0x4FC reserved */\r
+\r
+    __IO struct {                       /* 0x500-0x57C  SCTOUT[i].SET / SCTOUT[i].CLR */\r
+        uint32_t SET;                   /* Output n Set Register */\r
+        uint32_t CLR;                   /* Output n Clear Register */\r
+    } OUT[CONFIG_SCT_nOU];\r
+\r
+         uint32_t RESERVED10[191-2*CONFIG_SCT_nOU];  /* ...-0x7F8 reserved */\r
+\r
+    __I  uint32_t MODULECONTENT;        /* 0x7FC Module Content */\r
+\r
+} LPC_SCT_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         GPDMA                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx General Purpose DMA (GPDMA) controller Modification date=1/19/2011 Major revision=0 Minor revision=7  (GPDMA)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40002000) GPDMA Structure        */\r
+  __I  uint32_t INTSTAT;                    /*!< (@ 0x40002000) DMA Interrupt Status Register */\r
+  __I  uint32_t INTTCSTAT;                  /*!< (@ 0x40002004) DMA Interrupt Terminal Count Request Status Register */\r
+  __O  uint32_t INTTCCLEAR;                 /*!< (@ 0x40002008) DMA Interrupt Terminal Count Request Clear Register */\r
+  __I  uint32_t INTERRSTAT;                 /*!< (@ 0x4000200C) DMA Interrupt Error Status Register */\r
+  __O  uint32_t INTERRCLR;                  /*!< (@ 0x40002010) DMA Interrupt Error Clear Register */\r
+  __I  uint32_t RAWINTTCSTAT;               /*!< (@ 0x40002014) DMA Raw Interrupt Terminal Count Status Register */\r
+  __I  uint32_t RAWINTERRSTAT;              /*!< (@ 0x40002018) DMA Raw Error Interrupt Status Register */\r
+  __I  uint32_t ENBLDCHNS;                  /*!< (@ 0x4000201C) DMA Enabled Channel Register */\r
+  __IO uint32_t SOFTBREQ;                   /*!< (@ 0x40002020) DMA Software Burst Request Register */\r
+  __IO uint32_t SOFTSREQ;                   /*!< (@ 0x40002024) DMA Software Single Request Register */\r
+  __IO uint32_t SOFTLBREQ;                  /*!< (@ 0x40002028) DMA Software Last Burst Request Register */\r
+  __IO uint32_t SOFTLSREQ;                  /*!< (@ 0x4000202C) DMA Software Last Single Request Register */\r
+  __IO uint32_t CONFIG;                     /*!< (@ 0x40002030) DMA Configuration Register */\r
+  __IO uint32_t SYNC;                       /*!< (@ 0x40002034) DMA Synchronization Register */\r
+  __I  uint32_t RESERVED0[50];\r
+  __IO uint32_t C0SRCADDR;                  /*!< (@ 0x40002100) DMA Channel Source Address Register */\r
+  __IO uint32_t C0DESTADDR;                 /*!< (@ 0x40002104) DMA Channel Destination Address Register */\r
+  __IO uint32_t C0LLI;                      /*!< (@ 0x40002108) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C0CONTROL;                  /*!< (@ 0x4000210C) DMA Channel Control Register */\r
+  __IO uint32_t C0CONFIG;                   /*!< (@ 0x40002110) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED1[3];\r
+  __IO uint32_t C1SRCADDR;                  /*!< (@ 0x40002120) DMA Channel Source Address Register */\r
+  __IO uint32_t C1DESTADDR;                 /*!< (@ 0x40002124) DMA Channel Destination Address Register */\r
+  __IO uint32_t C1LLI;                      /*!< (@ 0x40002128) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C1CONTROL;                  /*!< (@ 0x4000212C) DMA Channel Control Register */\r
+  __IO uint32_t C1CONFIG;                   /*!< (@ 0x40002130) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED2[3];\r
+  __IO uint32_t C2SRCADDR;                  /*!< (@ 0x40002140) DMA Channel Source Address Register */\r
+  __IO uint32_t C2DESTADDR;                 /*!< (@ 0x40002144) DMA Channel Destination Address Register */\r
+  __IO uint32_t C2LLI;                      /*!< (@ 0x40002148) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C2CONTROL;                  /*!< (@ 0x4000214C) DMA Channel Control Register */\r
+  __IO uint32_t C2CONFIG;                   /*!< (@ 0x40002150) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED3[3];\r
+  __IO uint32_t C3SRCADDR;                  /*!< (@ 0x40002160) DMA Channel Source Address Register */\r
+  __IO uint32_t C3DESTADDR;                 /*!< (@ 0x40002164) DMA Channel Destination Address Register */\r
+  __IO uint32_t C3LLI;                      /*!< (@ 0x40002168) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C3CONTROL;                  /*!< (@ 0x4000216C) DMA Channel Control Register */\r
+  __IO uint32_t C3CONFIG;                   /*!< (@ 0x40002170) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED4[3];\r
+  __IO uint32_t C4SRCADDR;                  /*!< (@ 0x40002180) DMA Channel Source Address Register */\r
+  __IO uint32_t C4DESTADDR;                 /*!< (@ 0x40002184) DMA Channel Destination Address Register */\r
+  __IO uint32_t C4LLI;                      /*!< (@ 0x40002188) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C4CONTROL;                  /*!< (@ 0x4000218C) DMA Channel Control Register */\r
+  __IO uint32_t C4CONFIG;                   /*!< (@ 0x40002190) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED5[3];\r
+  __IO uint32_t C5SRCADDR;                  /*!< (@ 0x400021A0) DMA Channel Source Address Register */\r
+  __IO uint32_t C5DESTADDR;                 /*!< (@ 0x400021A4) DMA Channel Destination Address Register */\r
+  __IO uint32_t C5LLI;                      /*!< (@ 0x400021A8) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C5CONTROL;                  /*!< (@ 0x400021AC) DMA Channel Control Register */\r
+  __IO uint32_t C5CONFIG;                   /*!< (@ 0x400021B0) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED6[3];\r
+  __IO uint32_t C6SRCADDR;                  /*!< (@ 0x400021C0) DMA Channel Source Address Register */\r
+  __IO uint32_t C6DESTADDR;                 /*!< (@ 0x400021C4) DMA Channel Destination Address Register */\r
+  __IO uint32_t C6LLI;                      /*!< (@ 0x400021C8) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C6CONTROL;                  /*!< (@ 0x400021CC) DMA Channel Control Register */\r
+  __IO uint32_t C6CONFIG;                   /*!< (@ 0x400021D0) DMA Channel Configuration Register */\r
+  __I  uint32_t RESERVED7[3];\r
+  __IO uint32_t C7SRCADDR;                  /*!< (@ 0x400021E0) DMA Channel Source Address Register */\r
+  __IO uint32_t C7DESTADDR;                 /*!< (@ 0x400021E4) DMA Channel Destination Address Register */\r
+  __IO uint32_t C7LLI;                      /*!< (@ 0x400021E8) DMA Channel Linked List Item Register */\r
+  __IO uint32_t C7CONTROL;                  /*!< (@ 0x400021EC) DMA Channel Control Register */\r
+  __IO uint32_t C7CONFIG;                   /*!< (@ 0x400021F0) DMA Channel Configuration Register */\r
+} LPC_GPDMA_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         SDMMC                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx SD/MMC Modification date=n/a Major revision=n/a Minor revision=n/a  (SDMMC)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40004000) SDMMC Structure        */\r
+  __IO uint32_t CTRL;                       /*!< (@ 0x40004000) Control Register       */\r
+  __IO uint32_t PWREN;                      /*!< (@ 0x40004004) Power Enable Register  */\r
+  __IO uint32_t CLKDIV;                     /*!< (@ 0x40004008) Clock Divider Register */\r
+  __IO uint32_t CLKSRC;                     /*!< (@ 0x4000400C) SD Clock Source Register */\r
+  __IO uint32_t CLKENA;                     /*!< (@ 0x40004010) Clock Enable Register  */\r
+  __IO uint32_t TMOUT;                      /*!< (@ 0x40004014) Timeout Register       */\r
+  __IO uint32_t CTYPE;                      /*!< (@ 0x40004018) Card Type Register     */\r
+  __IO uint32_t BLKSIZ;                     /*!< (@ 0x4000401C) Block Size Register    */\r
+  __IO uint32_t BYTCNT;                     /*!< (@ 0x40004020) Byte Count Register    */\r
+  __IO uint32_t INTMASK;                    /*!< (@ 0x40004024) Interrupt Mask Register */\r
+  __IO uint32_t CMDARG;                     /*!< (@ 0x40004028) Command Argument Register */\r
+  __IO uint32_t CMD;                        /*!< (@ 0x4000402C) Command Register       */\r
+  __I  uint32_t RESP0;                      /*!< (@ 0x40004030) Response Register 0    */\r
+  __I  uint32_t RESP1;                      /*!< (@ 0x40004034) Response Register 1    */\r
+  __I  uint32_t RESP2;                      /*!< (@ 0x40004038) Response Register 2    */\r
+  __I  uint32_t RESP3;                      /*!< (@ 0x4000403C) Response Register 3    */\r
+  __I  uint32_t MINTSTS;                    /*!< (@ 0x40004040) Masked Interrupt Status Register */\r
+  __IO uint32_t RINTSTS;                    /*!< (@ 0x40004044) Raw Interrupt Status Register */\r
+  __I  uint32_t STATUS;                     /*!< (@ 0x40004048) Status Register        */\r
+  __IO uint32_t FIFOTH;                     /*!< (@ 0x4000404C) FIFO Threshold Watermark Register */\r
+  __I  uint32_t CDETECT;                    /*!< (@ 0x40004050) Card Detect Register   */\r
+  __I  uint32_t WRTPRT;                     /*!< (@ 0x40004054) Write Protect Register */\r
+  __IO uint32_t GPIO;                       /*!< (@ 0x40004058) General Purpose Input/Output Register */\r
+  __I  uint32_t TCBCNT;                     /*!< (@ 0x4000405C) Transferred CIU Card Byte Count Register */\r
+  __I  uint32_t TBBCNT;                     /*!< (@ 0x40004060) Transferred Host to BIU-FIFO Byte Count Register */\r
+  __IO uint32_t DEBNCE;                     /*!< (@ 0x40004064) Debounce Count Register */\r
+  __IO uint32_t USRID;                      /*!< (@ 0x40004068) User ID Register       */\r
+  __I  uint32_t VERID;                      /*!< (@ 0x4000406C) Version ID Register    */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t UHS_REG;                    /*!< (@ 0x40004074) UHS-1 Register         */\r
+  __IO uint32_t RST_N;                      /*!< (@ 0x40004078) Hardware Reset         */\r
+  __I  uint32_t RESERVED1;\r
+  __IO uint32_t BMOD;                       /*!< (@ 0x40004080) Bus Mode Register      */\r
+  __O  uint32_t PLDMND;                     /*!< (@ 0x40004084) Poll Demand Register   */\r
+  __IO uint32_t DBADDR;                     /*!< (@ 0x40004088) Descriptor List Base Address Register */\r
+  __IO uint32_t IDSTS;                      /*!< (@ 0x4000408C) Internal DMAC Status Register */\r
+  __IO uint32_t IDINTEN;                    /*!< (@ 0x40004090) Internal DMAC Interrupt Enable Register */\r
+  __I  uint32_t DSCADDR;                    /*!< (@ 0x40004094) Current Host Descriptor Address Register */\r
+  __I  uint32_t BUFADDR;                    /*!< (@ 0x40004098) Current Buffer Descriptor Address Register */\r
+} LPC_SDMMC_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          EMC                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx External Memory Controller (EMC) Modification date=1/19/2011 Major revision=0 Minor revision=7  (EMC)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40005000) EMC Structure          */\r
+  __IO uint32_t CONTROL;                    /*!< (@ 0x40005000) Controls operation of the memory controller. */\r
+  __I  uint32_t STATUS;                     /*!< (@ 0x40005004) Provides EMC status information. */\r
+  __IO uint32_t CONFIG;                     /*!< (@ 0x40005008) Configures operation of the memory controller. */\r
+  __I  uint32_t RESERVED0[5];\r
+  __IO uint32_t DYNAMICCONTROL;             /*!< (@ 0x40005020) Controls dynamic memory operation. */\r
+  __IO uint32_t DYNAMICREFRESH;             /*!< (@ 0x40005024) Configures dynamic memory refresh operation. */\r
+  __IO uint32_t DYNAMICREADCONFIG;          /*!< (@ 0x40005028) Configures the dynamic memory read strategy. */\r
+  __I  uint32_t RESERVED1;\r
+  __IO uint32_t DYNAMICRP;                  /*!< (@ 0x40005030) Selects the precharge command period. */\r
+  __IO uint32_t DYNAMICRAS;                 /*!< (@ 0x40005034) Selects the active to precharge command period. */\r
+  __IO uint32_t DYNAMICSREX;                /*!< (@ 0x40005038) Selects the self-refresh exit time. */\r
+  __IO uint32_t DYNAMICAPR;                 /*!< (@ 0x4000503C) Selects the last-data-out to active command time. */\r
+  __IO uint32_t DYNAMICDAL;                 /*!< (@ 0x40005040) Selects the data-in to active command time. */\r
+  __IO uint32_t DYNAMICWR;                  /*!< (@ 0x40005044) Selects the write recovery time. */\r
+  __IO uint32_t DYNAMICRC;                  /*!< (@ 0x40005048) Selects the active to active command period. */\r
+  __IO uint32_t DYNAMICRFC;                 /*!< (@ 0x4000504C) Selects the auto-refresh period. */\r
+  __IO uint32_t DYNAMICXSR;                 /*!< (@ 0x40005050) Selects the exit self-refresh to active command time. */\r
+  __IO uint32_t DYNAMICRRD;                 /*!< (@ 0x40005054) Selects the active bank A to active bank B latency. */\r
+  __IO uint32_t DYNAMICMRD;                 /*!< (@ 0x40005058) Selects the load mode register to active command time. */\r
+  __I  uint32_t RESERVED2[9];\r
+  __IO uint32_t STATICEXTENDEDWAIT;         /*!< (@ 0x40005080) Selects time for long static memory read and write transfers. */\r
+  __I  uint32_t RESERVED3[31];\r
+  __IO uint32_t DYNAMICCONFIG0;             /*!< (@ 0x40005100) Selects the configuration information for dynamic memory chip select n. */\r
+  __IO uint32_t DYNAMICRASCAS0;             /*!< (@ 0x40005104) Selects the RAS and CAS latencies for dynamic memory chip select n. */\r
+  __I  uint32_t RESERVED4[6];\r
+  __IO uint32_t DYNAMICCONFIG1;             /*!< (@ 0x40005120) Selects the configuration information for dynamic memory chip select n. */\r
+  __IO uint32_t DYNAMICRASCAS1;             /*!< (@ 0x40005124) Selects the RAS and CAS latencies for dynamic memory chip select n. */\r
+  __I  uint32_t RESERVED5[6];\r
+  __IO uint32_t DYNAMICCONFIG2;             /*!< (@ 0x40005140) Selects the configuration information for dynamic memory chip select n. */\r
+  __IO uint32_t DYNAMICRASCAS2;             /*!< (@ 0x40005144) Selects the RAS and CAS latencies for dynamic memory chip select n. */\r
+  __I  uint32_t RESERVED6[6];\r
+  __IO uint32_t DYNAMICCONFIG3;             /*!< (@ 0x40005160) Selects the configuration information for dynamic memory chip select n. */\r
+  __IO uint32_t DYNAMICRASCAS3;             /*!< (@ 0x40005164) Selects the RAS and CAS latencies for dynamic memory chip select n. */\r
+  __I  uint32_t RESERVED7[38];\r
+  __IO uint32_t STATICCONFIG0;              /*!< (@ 0x40005200) Selects the memory configuration for static chip select n. */\r
+  __IO uint32_t STATICWAITWEN0;             /*!< (@ 0x40005204) Selects the delay from chip select n to write enable. */\r
+  __IO uint32_t STATICWAITOEN0;             /*!< (@ 0x40005208) Selects the delay from chip select n or address change, whichever is later, to output enable. */\r
+  __IO uint32_t STATICWAITRD0;              /*!< (@ 0x4000520C) Selects the delay from chip select n to a read access. */\r
+  __IO uint32_t STATICWAITPAG0;             /*!< (@ 0x40005210) Selects the delay for asynchronous page mode sequential accesses for chip select n. */\r
+  __IO uint32_t STATICWAITWR0;              /*!< (@ 0x40005214) Selects the delay from chip select n to a write access. */\r
+  __IO uint32_t STATICWAITTURN0;            /*!< (@ 0x40005218) Selects bus turnaround cycles */\r
+  __I  uint32_t  RESERVED8;\r
+  __IO uint32_t STATICCONFIG1;              /*!< (@ 0x40005220) Selects the memory configuration for static chip select n. */\r
+  __IO uint32_t STATICWAITWEN1;             /*!< (@ 0x40005224) Selects the delay from chip select n to write enable. */\r
+  __IO uint32_t STATICWAITOEN1;             /*!< (@ 0x40005228) Selects the delay from chip select n or address change, whichever is later, to output enable. */\r
+  __IO uint32_t STATICWAITRD1;              /*!< (@ 0x4000522C) Selects the delay from chip select n to a read access. */\r
+  __IO uint32_t STATICWAITPAG1;             /*!< (@ 0x40005230) Selects the delay for asynchronous page mode sequential accesses for chip select n. */\r
+  __IO uint32_t STATICWAITWR1;              /*!< (@ 0x40005234) Selects the delay from chip select n to a write access. */\r
+  __IO uint32_t  STATICWAITTURN1;           /*!< (@ 0x40005238) Selects bus turnaround cycles */\r
+  __I  uint32_t  RESERVED9;\r
+  __IO uint32_t STATICCONFIG2;              /*!< (@ 0x40005240) Selects the memory configuration for static chip select n. */\r
+  __IO uint32_t STATICWAITWEN2;             /*!< (@ 0x40005244) Selects the delay from chip select n to write enable. */\r
+  __IO uint32_t STATICWAITOEN2;             /*!< (@ 0x40005248) Selects the delay from chip select n or address change, whichever is later, to output enable. */\r
+  __IO uint32_t STATICWAITRD2;              /*!< (@ 0x4000524C) Selects the delay from chip select n to a read access. */\r
+  __IO uint32_t STATICWAITPAG2;             /*!< (@ 0x40005250) Selects the delay for asynchronous page mode sequential accesses for chip select n. */\r
+  __IO uint32_t STATICWAITWR2;              /*!< (@ 0x40005254) Selects the delay from chip select n to a write access. */\r
+  __IO uint32_t  STATICWAITTURN2;           /*!< (@ 0x40005258) Selects bus turnaround cycles */\r
+  __I  uint32_t  RESERVED10;\r
+  __IO uint32_t STATICCONFIG3;              /*!< (@ 0x40005260) Selects the memory configuration for static chip select n. */\r
+  __IO uint32_t STATICWAITWEN3;             /*!< (@ 0x40005264) Selects the delay from chip select n to write enable. */\r
+  __IO uint32_t STATICWAITOEN3;             /*!< (@ 0x40005268) Selects the delay from chip select n or address change, whichever is later, to output enable. */\r
+  __IO uint32_t STATICWAITRD3;              /*!< (@ 0x4000526C) Selects the delay from chip select n to a read access. */\r
+  __IO uint32_t STATICWAITPAG3;             /*!< (@ 0x40005270) Selects the delay for asynchronous page mode sequential accesses for chip select n. */\r
+  __IO uint32_t STATICWAITWR3;              /*!< (@ 0x40005274) Selects the delay from chip select n to a write access. */\r
+  __IO uint32_t  STATICWAITTURN3;           /*!< (@ 0x40005278) Selects bus turnaround cycles */\r
+} LPC_EMC_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         USB0                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx USB0 Host/Device/OTG controller Modification date=1/19/2011 Major revision=0 Minor revision=7  (USB0)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40006000) USB0 Structure         */\r
+  __I  uint32_t RESERVED0[64];\r
+  __I  uint32_t CAPLENGTH;                  /*!< (@ 0x40006100) Capability register length */\r
+  __I  uint32_t HCSPARAMS;                  /*!< (@ 0x40006104) Host controller structural parameters */\r
+  __I  uint32_t HCCPARAMS;                  /*!< (@ 0x40006108) Host controller capability parameters */\r
+  __I  uint32_t RESERVED1[5];\r
+  __I  uint32_t DCIVERSION;                 /*!< (@ 0x40006120) Device interface version number */\r
+  __I  uint32_t RESERVED2[7];\r
+\r
+  union {\r
+    __IO uint32_t USBCMD_H;                 /*!< (@ 0x40006140) USB command (host mode) */\r
+    __IO uint32_t USBCMD_D;                 /*!< (@ 0x40006140) USB command (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t USBSTS_H;                 /*!< (@ 0x40006144) USB status (host mode) */\r
+    __IO uint32_t USBSTS_D;                 /*!< (@ 0x40006144) USB status (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t USBINTR_H;                /*!< (@ 0x40006148) USB interrupt enable (host mode) */\r
+    __IO uint32_t USBINTR_D;                /*!< (@ 0x40006148) USB interrupt enable (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t FRINDEX_H;                /*!< (@ 0x4000614C) USB frame index (host mode) */\r
+    __IO uint32_t FRINDEX_D;                /*!< (@ 0x4000614C) USB frame index (device mode) */\r
+  };\r
+  __I  uint32_t RESERVED3;\r
+\r
+  union {\r
+    __IO uint32_t PERIODICLISTBASE;         /*!< (@ 0x40006154) Frame list base address (host mode) */\r
+    __IO uint32_t DEVICEADDR;               /*!< (@ 0x40006154) USB device address (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t ASYNCLISTADDR;            /*!< (@ 0x40006158) Address of endpoint list in memory */\r
+    __IO uint32_t ENDPOINTLISTADDR;         /*!< (@ 0x40006158) Address of endpoint list in memory */\r
+  };\r
+  __IO uint32_t TTCTRL;                     /*!< (@ 0x4000615C) Asynchronous buffer status for embedded TT (host mode) */\r
+  __IO uint32_t BURSTSIZE;                  /*!< (@ 0x40006160) Programmable burst size */\r
+  __IO uint32_t TXFILLTUNING;               /*!< (@ 0x40006164) Host transmit pre-buffer packet tuning (host mode) */\r
+  __I  uint32_t RESERVED4[3];\r
+  __IO uint32_t BINTERVAL;                  /*!< (@ 0x40006174) Length of virtual frame */\r
+  __IO uint32_t ENDPTNAK;                   /*!< (@ 0x40006178) Endpoint NAK (device mode) */\r
+  __IO uint32_t ENDPTNAKEN;                 /*!< (@ 0x4000617C) Endpoint NAK Enable (device mode) */\r
+  __I  uint32_t RESERVED5;\r
+\r
+  union {\r
+    __IO uint32_t PORTSC1_H;                /*!< (@ 0x40006184) Port 1 status/control (host mode) */\r
+    __IO uint32_t PORTSC1_D;                /*!< (@ 0x40006184) Port 1 status/control (device mode) */\r
+  };\r
+  __I  uint32_t RESERVED6[7];\r
+  __IO uint32_t OTGSC;                      /*!< (@ 0x400061A4) OTG status and control */\r
+\r
+  union {\r
+    __IO uint32_t USBMODE_H;                /*!< (@ 0x400061A8) USB mode (host mode)   */\r
+    __IO uint32_t USBMODE_D;                /*!< (@ 0x400061A8) USB device mode (device mode) */\r
+  };\r
+  __IO uint32_t ENDPTSETUPSTAT;             /*!< (@ 0x400061AC) Endpoint setup status  */\r
+  __IO uint32_t ENDPTPRIME;                 /*!< (@ 0x400061B0) Endpoint initialization */\r
+  __IO uint32_t ENDPTFLUSH;                 /*!< (@ 0x400061B4) Endpoint de-initialization */\r
+  __I  uint32_t ENDPTSTAT;                  /*!< (@ 0x400061B8) Endpoint status        */\r
+  __IO uint32_t ENDPTCOMPLETE;              /*!< (@ 0x400061BC) Endpoint complete      */\r
+  __IO uint32_t ENDPTCTRL0;                 /*!< (@ 0x400061C0) Endpoint control 0     */\r
+  __IO uint32_t ENDPTCTRL1;                 /*!< (@ 0x400061C4) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL2;                 /*!< (@ 0x400061C8) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL3;                 /*!< (@ 0x400061CC) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL4;                 /*!< (@ 0x400061D0) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL5;                 /*!< (@ 0x400061D4) Endpoint control       */\r
+} LPC_USB0_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         USB1                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx USB1 Host/Device controller Modification date=1/19/2011 Major revision=0 Minor revision=7  (USB1)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40007000) USB1 Structure         */\r
+  __I  uint32_t RESERVED0[64];\r
+  __I  uint32_t CAPLENGTH;                  /*!< (@ 0x40007100) Capability register length */\r
+  __I  uint32_t HCSPARAMS;                  /*!< (@ 0x40007104) Host controller structural parameters */\r
+  __I  uint32_t HCCPARAMS;                  /*!< (@ 0x40007108) Host controller capability parameters */\r
+  __I  uint32_t RESERVED1[5];\r
+  __I  uint32_t DCIVERSION;                 /*!< (@ 0x40007120) Device interface version number */\r
+  __I  uint32_t RESERVED2[7];\r
+\r
+  union {\r
+    __IO uint32_t USBCMD_H;                 /*!< (@ 0x40007140) USB command (host mode) */\r
+    __IO uint32_t USBCMD_D;                 /*!< (@ 0x40007140) USB command (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t USBSTS_H;                 /*!< (@ 0x40007144) USB status (host mode) */\r
+    __IO uint32_t USBSTS_D;                 /*!< (@ 0x40007144) USB status (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t USBINTR_H;                /*!< (@ 0x40007148) USB interrupt enable (host mode) */\r
+    __IO uint32_t USBINTR_D;                /*!< (@ 0x40007148) USB interrupt enable (device mode) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t FRINDEX_H;                /*!< (@ 0x4000714C) USB frame index (host mode) */\r
+    __I  uint32_t FRINDEX_D;                /*!< (@ 0x4000714C) USB frame index (device mode) */\r
+  };\r
+  __I  uint32_t RESERVED3;\r
+\r
+  union {\r
+    __IO uint32_t PERIODICLISTBASE;         /*!< (@ 0x40007154) Frame list base address */\r
+    __IO uint32_t DEVICEADDR;               /*!< (@ 0x40007154) USB device address     */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t ASYNCLISTADDR;            /*!< (@ 0x40007158) Address of endpoint list in memory (host mode) */\r
+    __IO uint32_t ENDPOINTLISTADDR;         /*!< (@ 0x40007158) Address of endpoint list in memory (device mode) */\r
+  };\r
+  __IO uint32_t TTCTRL;                     /*!< (@ 0x4000715C) Asynchronous buffer status for embedded TT (host mode) */\r
+  __IO uint32_t BURSTSIZE;                  /*!< (@ 0x40007160) Programmable burst size */\r
+  __IO uint32_t TXFILLTUNING;               /*!< (@ 0x40007164) Host transmit pre-buffer packet tuning (host mode) */\r
+  __I  uint32_t RESERVED4[2];\r
+  __IO uint32_t ULPIVIEWPORT;               /*!< (@ 0x40007170) ULPI viewport          */\r
+  __IO uint32_t BINTERVAL;                  /*!< (@ 0x40007174) Length of virtual frame */\r
+  __IO uint32_t ENDPTNAK;                   /*!< (@ 0x40007178) Endpoint NAK (device mode) */\r
+  __IO uint32_t ENDPTNAKEN;                 /*!< (@ 0x4000717C) Endpoint NAK Enable (device mode) */\r
+  __I  uint32_t RESERVED5;\r
+\r
+  union {\r
+    __IO uint32_t PORTSC1_H;                /*!< (@ 0x40007184) Port 1 status/control (host mode) */\r
+    __IO uint32_t PORTSC1_D;                /*!< (@ 0x40007184) Port 1 status/control (device mode) */\r
+  };\r
+  __I  uint32_t RESERVED6[8];\r
+\r
+  union {\r
+    __IO uint32_t USBMODE_H;                /*!< (@ 0x400071A8) USB mode (host mode)   */\r
+    __IO uint32_t USBMODE_D;                /*!< (@ 0x400071A8) USB mode (device mode) */\r
+  };\r
+  __IO uint32_t ENDPTSETUPSTAT;             /*!< (@ 0x400071AC) Endpoint setup status  */\r
+  __IO uint32_t ENDPTPRIME;                 /*!< (@ 0x400071B0) Endpoint initialization */\r
+  __IO uint32_t ENDPTFLUSH;                 /*!< (@ 0x400071B4) Endpoint de-initialization */\r
+  __I  uint32_t ENDPTSTAT;                  /*!< (@ 0x400071B8) Endpoint status        */\r
+  __IO uint32_t ENDPTCOMPLETE;              /*!< (@ 0x400071BC) Endpoint complete      */\r
+  __IO uint32_t ENDPTCTRL0;                 /*!< (@ 0x400071C0) Endpoint control 0     */\r
+  __IO uint32_t ENDPTCTRL1;                 /*!< (@ 0x400071C4) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL2;                 /*!< (@ 0x400071C8) Endpoint control       */\r
+  __IO uint32_t ENDPTCTRL3;                 /*!< (@ 0x400071CC) Endpoint control       */\r
+} LPC_USB1_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          LCD                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx LCD Modification date=1/19/2011 Major revision=0 Minor revision=7  (LCD)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40008000) LCD Structure          */\r
+  __IO uint32_t TIMH;                       /*!< (@ 0x40008000) Horizontal Timing Control register */\r
+  __IO uint32_t TIMV;                       /*!< (@ 0x40008004) Vertical Timing Control register */\r
+  __IO uint32_t POL;                        /*!< (@ 0x40008008) Clock and Signal Polarity Control register */\r
+  __IO uint32_t LE;                         /*!< (@ 0x4000800C) Line End Control register */\r
+  __IO uint32_t UPBASE;                     /*!< (@ 0x40008010) Upper Panel Frame Base Address register */\r
+  __IO uint32_t LPBASE;                     /*!< (@ 0x40008014) Lower Panel Frame Base Address register */\r
+  __IO uint32_t CTRL;                       /*!< (@ 0x40008018) LCD Control register   */\r
+  __IO uint32_t INTMSK;                     /*!< (@ 0x4000801C) Interrupt Mask register */\r
+  __I  uint32_t INTRAW;                     /*!< (@ 0x40008020) Raw Interrupt Status register */\r
+  __I  uint32_t INTSTAT;                    /*!< (@ 0x40008024) Masked Interrupt Status register */\r
+  __O  uint32_t INTCLR;                     /*!< (@ 0x40008028) Interrupt Clear register */\r
+  __I  uint32_t UPCURR;                     /*!< (@ 0x4000802C) Upper Panel Current Address Value register */\r
+  __I  uint32_t LPCURR;                     /*!< (@ 0x40008030) Lower Panel Current Address Value register */\r
+  __I  uint32_t RESERVED0[115];\r
+  __IO uint32_t PAL[256];                                      /*!< (@ 0x40008200) 256x16-bit Color Palette registers */\r
+  __I  uint32_t RESERVED1[128];\r
+  __IO uint32_t CRSR_IMG[256];              /*!< (@ 0x40008800) Cursor Image registers */\r
+  __IO uint32_t CRSR_CTRL;                  /*!< (@ 0x40008C00) Cursor Control register */\r
+  __IO uint32_t CRSR_CFG;                   /*!< (@ 0x40008C04) Cursor Configuration register */\r
+  __IO uint32_t CRSR_PAL0;                  /*!< (@ 0x40008C08) Cursor Palette register 0 */\r
+  __IO uint32_t CRSR_PAL1;                  /*!< (@ 0x40008C0C) Cursor Palette register 1 */\r
+  __IO uint32_t CRSR_XY;                    /*!< (@ 0x40008C10) Cursor XY Position register */\r
+  __IO uint32_t CRSR_CLIP;                  /*!< (@ 0x40008C14) Cursor Clip Position register */\r
+  __I  uint32_t RESERVED2[2];\r
+  __IO uint32_t CRSR_INTMSK;                /*!< (@ 0x40008C20) Cursor Interrupt Mask register */\r
+  __O  uint32_t CRSR_INTCLR;                /*!< (@ 0x40008C24) Cursor Interrupt Clear register */\r
+  __I  uint32_t CRSR_INTRAW;                /*!< (@ 0x40008C28) Cursor Raw Interrupt Status register */\r
+  __I  uint32_t CRSR_INTSTAT;               /*!< (@ 0x40008C2C) Cursor Masked Interrupt Status register */\r
+} LPC_LCD_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                       ETHERNET                                       -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Ethernet Modification date=1/20/2011 Major revision=0 Minor revision=7  (ETHERNET)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40010000) ETHERNET Structure     */\r
+  __IO uint32_t MAC_CONFIG;                 /*!< (@ 0x40010000) MAC configuration register */\r
+  __IO uint32_t MAC_FRAME_FILTER;           /*!< (@ 0x40010004) MAC frame filter       */\r
+  __IO uint32_t MAC_HASHTABLE_HIGH;         /*!< (@ 0x40010008) Hash table high register */\r
+  __IO uint32_t MAC_HASHTABLE_LOW;          /*!< (@ 0x4001000C) Hash table low register */\r
+  __IO uint32_t MAC_MII_ADDR;               /*!< (@ 0x40010010) MII address register   */\r
+  __IO uint32_t MAC_MII_DATA;               /*!< (@ 0x40010014) MII data register      */\r
+  __IO uint32_t MAC_FLOW_CTRL;              /*!< (@ 0x40010018) Flow control register  */\r
+  __IO uint32_t MAC_VLAN_TAG;               /*!< (@ 0x4001001C) VLAN tag register      */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t MAC_DEBUG;                  /*!< (@ 0x40010024) Debug register         */\r
+  __IO uint32_t MAC_RWAKE_FRFLT;            /*!< (@ 0x40010028) Remote wake-up frame filter */\r
+  __IO uint32_t MAC_PMT_CTRL_STAT;          /*!< (@ 0x4001002C) PMT control and status */\r
+  __I  uint32_t RESERVED1[2];\r
+  __IO uint32_t MAC_INTR;                   /*!< (@ 0x40010038) Interrupt status register */\r
+  __IO uint32_t MAC_INTR_MASK;              /*!< (@ 0x4001003C) Interrupt mask register */\r
+  __IO uint32_t MAC_ADDR0_HIGH;             /*!< (@ 0x40010040) MAC address 0 high register */\r
+  __IO uint32_t MAC_ADDR0_LOW;              /*!< (@ 0x40010044) MAC address 0 low register */\r
+  __I  uint32_t RESERVED2[430];\r
+  __IO uint32_t MAC_TIMESTP_CTRL;           /*!< (@ 0x40010700) Time stamp control register */\r
+  __I  uint32_t RESERVED3[575];\r
+  __IO uint32_t DMA_BUS_MODE;               /*!< (@ 0x40011000) Bus Mode Register      */\r
+  __IO uint32_t DMA_TRANS_POLL_DEMAND;      /*!< (@ 0x40011004) Transmit poll demand register */\r
+  __IO uint32_t DMA_REC_POLL_DEMAND;        /*!< (@ 0x40011008) Receive poll demand register */\r
+  __IO uint32_t DMA_REC_DES_ADDR;           /*!< (@ 0x4001100C) Receive descriptor list address register */\r
+  __IO uint32_t DMA_TRANS_DES_ADDR;         /*!< (@ 0x40011010) Transmit descriptor list address register */\r
+  __IO uint32_t DMA_STAT;                   /*!< (@ 0x40011014) Status register        */\r
+  __IO uint32_t DMA_OP_MODE;                /*!< (@ 0x40011018) Operation mode register */\r
+  __IO uint32_t DMA_INT_EN;                 /*!< (@ 0x4001101C) Interrupt enable register */\r
+  __IO uint32_t DMA_MFRM_BUFOF;             /*!< (@ 0x40011020) Missed frame and buffer overflow register */\r
+  __IO uint32_t DMA_REC_INT_WDT;            /*!< (@ 0x40011024) Receive interrupt watchdog timer register */\r
+  __I  uint32_t RESERVED4[8];\r
+  __IO uint32_t DMA_CURHOST_TRANS_DES;      /*!< (@ 0x40011048) Current host transmit descriptor register */\r
+  __IO uint32_t DMA_CURHOST_REC_DES;        /*!< (@ 0x4001104C) Current host receive descriptor register */\r
+  __IO uint32_t DMA_CURHOST_TRANS_BUF;      /*!< (@ 0x40011050) Current host transmit buffer address register */\r
+  __IO uint32_t DMA_CURHOST_REC_BUF;        /*!< (@ 0x40011054) Current host receive buffer address register */\r
+} LPC_ETHERNET_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        ATIMER                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Alarm timer Modification date=1/7/2011 Major revision=0 Minor revision=6  (ATIMER)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40040000) ATIMER Structure       */\r
+  __IO uint32_t DOWNCOUNTER;                /*!< (@ 0x40040000) Downcounter register   */\r
+  __IO uint32_t PRESET;                     /*!< (@ 0x40040004) Preset value register  */\r
+  __I  uint32_t RESERVED0[1012];\r
+  __O  uint32_t CLR_EN;                     /*!< (@ 0x40040FD8) Interrupt clear enable register */\r
+  __O  uint32_t SET_EN;                     /*!< (@ 0x40040FDC) Interrupt set enable register */\r
+  __I  uint32_t STATUS;                     /*!< (@ 0x40040FE0) Status register        */\r
+  __I  uint32_t ENABLE;                     /*!< (@ 0x40040FE4) Enable register        */\r
+  __O  uint32_t CLR_STAT;                   /*!< (@ 0x40040FE8) Clear register         */\r
+  __O  uint32_t SET_STAT;                   /*!< (@ 0x40040FEC) Set register           */\r
+} LPC_ATIMER_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        REGFILE                                       -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx rtc/REGFILE date=1/20/2011 Major revision=0 Minor revision=7  (REGFILE)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40041000) REGFILE Structure      */\r
+  __IO uint32_t REGFILE[64];                /*!< (@ 0x40041000) General purpose storage register */\r
+} LPC_REGFILE_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          PMC                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Power Management Controller (PMC) Modification date=1/20/2011 Major revision=0 Minor revision=7  (PMC)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40042000) PMC Structure          */\r
+  __IO uint32_t PD0_SLEEP0_HW_ENA;          /*!< (@ 0x40042000) Hardware sleep event enable register */\r
+  __I  uint32_t  RESERVED0[6];\r
+  __IO uint32_t PD0_SLEEP0_MODE;            /*!< (@ 0x4004201C) Sleep power mode register */\r
+} LPC_PMC_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         CREG                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Configuration Registers (CREG) Modification date=8/19/2011 Major revision=0 Minor revision=14  (CREG)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40043000) CREG Structure         */\r
+  __I  uint32_t  IRCTRM;                    /*!< (@ 0x40043000) IRC trim register      */\r
+  __IO uint32_t CREG0;                      /*!< (@ 0x40043004) Chip configuration register 32 kHz oscillator output and BOD control register. */\r
+  __IO uint32_t PMUCON;                     /*!< (@ 0x40043008) Power mode control register. */\r
+  __I  uint32_t RESERVED0[61];\r
+  __IO uint32_t M3MEMMAP;                   /*!< (@ 0x40043100) ARM Cortex-M3 memory mapping */\r
+  __I  uint32_t RESERVED1[5];\r
+  __IO uint32_t CREG5;                      /*!< (@ 0x40043118) Chip configuration register 5. Controls JTAG access. */\r
+  __IO uint32_t DMAMUX;                     /*!< (@ 0x4004311C) DMA muxing control     */\r
+  __I  uint32_t RESERVED2[2];\r
+  __IO uint32_t ETBCFG;                     /*!< (@ 0x40043128) ETB RAM configuration  */\r
+  __IO uint32_t  CREG6;                     /*!< (@ 0x4004312C) Chip configuration register 6 */\r
+  __I  uint32_t RESERVED3[52];\r
+  __I  uint32_t CHIPID;                     /*!< (@ 0x40043200) Part ID                */\r
+} LPC_CREG_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                      EVENTROUTER                                     -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Event router Modification date=1/20/2011 Major revision=0 Minor revision=7  (EVENTROUTER)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40044000) EVENTROUTER Structure  */\r
+  __IO uint32_t HILO;                       /*!< (@ 0x40044000) Level configuration register */\r
+  __IO uint32_t EDGE;                       /*!< (@ 0x40044004) Edge configuration     */\r
+  __I  uint32_t RESERVED0[1012];\r
+  __O  uint32_t CLR_EN;                     /*!< (@ 0x40044FD8) Event clear enable register */\r
+  __O  uint32_t SET_EN;                     /*!< (@ 0x40044FDC) Event set enable register */\r
+  __I  uint32_t STATUS;                     /*!< (@ 0x40044FE0) Status register        */\r
+  __I  uint32_t ENABLE;                     /*!< (@ 0x40044FE4) Enable register        */\r
+  __O  uint32_t CLR_STAT;                   /*!< (@ 0x40044FE8) Clear register         */\r
+  __O  uint32_t SET_STAT;                   /*!< (@ 0x40044FEC) Set register           */\r
+} LPC_EVENTROUTER_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          RTC                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Real-Time Clock (RTC) Modification date=1/20/2011 Major revision=0 Minor revision=7  (RTC)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40046000) RTC Structure          */\r
+  __O  uint32_t ILR;                        /*!< (@ 0x40046000) Interrupt Location Register */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t CCR;                        /*!< (@ 0x40046008) Clock Control Register */\r
+  __IO uint32_t CIIR;                       /*!< (@ 0x4004600C) Counter Increment Interrupt Register */\r
+  __IO uint32_t AMR;                        /*!< (@ 0x40046010) Alarm Mask Register    */\r
+  __I  uint32_t CTIME0;                     /*!< (@ 0x40046014) Consolidated Time Register 0 */\r
+  __I  uint32_t CTIME1;                     /*!< (@ 0x40046018) Consolidated Time Register 1 */\r
+  __I  uint32_t CTIME2;                     /*!< (@ 0x4004601C) Consolidated Time Register 2 */\r
+  __IO uint32_t SEC;                        /*!< (@ 0x40046020) Seconds Register       */\r
+  __IO uint32_t MIN;                        /*!< (@ 0x40046024) Minutes Register       */\r
+  __IO uint32_t HRS;                        /*!< (@ 0x40046028) Hours Register         */\r
+  __IO uint32_t DOM;                        /*!< (@ 0x4004602C) Day of Month Register  */\r
+  __IO uint32_t DOW;                        /*!< (@ 0x40046030) Day of Week Register   */\r
+  __IO uint32_t DOY;                        /*!< (@ 0x40046034) Day of Year Register   */\r
+  __IO uint32_t MONTH;                      /*!< (@ 0x40046038) Months Register        */\r
+  __IO uint32_t YEAR;                       /*!< (@ 0x4004603C) Years Register         */\r
+  __IO uint32_t CALIBRATION;                /*!< (@ 0x40046040) Calibration Value Register */\r
+  __I  uint32_t RESERVED1[7];\r
+  __IO uint32_t ASEC;                       /*!< (@ 0x40046060) Alarm value for Seconds */\r
+  __IO uint32_t AMIN;                       /*!< (@ 0x40046064) Alarm value for Minutes */\r
+  __IO uint32_t AHRS;                       /*!< (@ 0x40046068) Alarm value for Hours  */\r
+  __IO uint32_t ADOM;                       /*!< (@ 0x4004606C) Alarm value for Day of Month */\r
+  __IO uint32_t ADOW;                       /*!< (@ 0x40046070) Alarm value for Day of Week */\r
+  __IO uint32_t ADOY;                       /*!< (@ 0x40046074) Alarm value for Day of Year */\r
+  __IO uint32_t AMON;                       /*!< (@ 0x40046078) Alarm value for Months */\r
+  __IO uint32_t AYRS;                       /*!< (@ 0x4004607C) Alarm value for Year   */\r
+} LPC_RTC_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          CGU                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10462 Chapter title=LPC18xx Clock Generation Unit (CGU) Modification date=6/1/2011 Major revision=0 Minor revision=1  (CGU)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40050000) CGU Structure          */\r
+  __I  uint32_t RESERVED0[5];\r
+  __IO uint32_t FREQ_MON;                   /*!< (@ 0x40050014) Frequency monitor register */\r
+  __IO uint32_t XTAL_OSC_CTRL;              /*!< (@ 0x40050018) Crystal oscillator control register */\r
+  __I  uint32_t PLL0USB_STAT;               /*!< (@ 0x4005001C) PLL0 (USB) status register */\r
+  __IO uint32_t PLL0USB_CTRL;               /*!< (@ 0x40050020) PLL0 (USB) control register */\r
+  __IO uint32_t PLL0USB_MDIV;               /*!< (@ 0x40050024) PLL0 (USB) M-divider register */\r
+  __IO uint32_t PLL0USB_NP_DIV;             /*!< (@ 0x40050028) PLL0 (USB) N/P-divider register */\r
+  __I  uint32_t PLL0AUDIO_STAT;             /*!< (@ 0x4005002C) PLL0 (audio) status register */\r
+  __IO uint32_t PLL0AUDIO_CTRL;             /*!< (@ 0x40050030) PLL0 (audio) control register */\r
+  __IO uint32_t PLL0AUDIO_MDIV;             /*!< (@ 0x40050034) PLL0 (audio) M-divider register */\r
+  __IO uint32_t PLL0AUDIO_NP_DIV;           /*!< (@ 0x40050038) PLL0 (audio) N/P-divider register */\r
+  __IO uint32_t PLL0AUDIO_FRAC;             /*!< (@ 0x4005003C) PLL0 (audio)           */\r
+  __I  uint32_t PLL1_STAT;                  /*!< (@ 0x40050040) PLL1 status register   */\r
+  __IO uint32_t PLL1_CTRL;                  /*!< (@ 0x40050044) PLL1 control register  */\r
+  __IO uint32_t IDIVA_CTRL;                 /*!< (@ 0x40050048) Integer divider A control register */\r
+  __IO uint32_t IDIVB_CTRL;                 /*!< (@ 0x4005004C) Integer divider B control register */\r
+  __IO uint32_t IDIVC_CTRL;                 /*!< (@ 0x40050050) Integer divider C control register */\r
+  __IO uint32_t IDIVD_CTRL;                 /*!< (@ 0x40050054) Integer divider D control register */\r
+  __IO uint32_t IDIVE_CTRL;                 /*!< (@ 0x40050058) Integer divider E control register */\r
+  __IO uint32_t BASE_SAFE_CLK;              /*!< (@ 0x4005005C) Output stage 0 control register for base clock BASE_SAFE_CLK */\r
+  __IO uint32_t BASE_USB0_CLK;              /*!< (@ 0x40050060) Output stage 1 control register for base clock BASE_USB0_CLK */\r
+  __IO uint32_t BASE_PERIPH_CLK;            /*!< (@ 0x40050064) Output stage 2 control register for base clock BASE_PERIPH_CLK */\r
+  __IO uint32_t BASE_USB1_CLK;              /*!< (@ 0x40050068) Output stage 3 control register for base clock BASE_USB1_CLK */\r
+  __IO uint32_t BASE_M3_CLK;                /*!< (@ 0x4005006C) Output stage control register  */\r
+  __IO uint32_t BASE_SPIFI_CLK;             /*!< (@ 0x40050070) Output stage control register  */\r
+  __IO uint32_t BASE_SPI_CLK;               /*!< (@ 0x40050074) Output stage control register  */\r
+  __IO uint32_t BASE_PHY_RX_CLK;            /*!< (@ 0x40050078) Output stage control register  */\r
+  __IO uint32_t BASE_PHY_TX_CLK;            /*!< (@ 0x4005007C) Output stage control register  */\r
+  __IO uint32_t BASE_APB1_CLK;              /*!< (@ 0x40050080) Output stage control register  */\r
+  __IO uint32_t BASE_APB3_CLK;              /*!< (@ 0x40050084) Output stage control register  */\r
+  __IO uint32_t BASE_LCD_CLK;               /*!< (@ 0x40050088) Output stage control register  */\r
+  __IO uint32_t RESERVED2;\r
+  __IO uint32_t BASE_SDIO_CLK;              /*!< (@ 0x40050090) Output stage control register  */\r
+  __IO uint32_t BASE_SSP0_CLK;              /*!< (@ 0x40050094) Output stage control register  */\r
+  __IO uint32_t BASE_SSP1_CLK;              /*!< (@ 0x40050098) Output stage control register  */\r
+  __IO uint32_t BASE_UART0_CLK;             /*!< (@ 0x4005009C) Output stage control register  */\r
+  __IO uint32_t BASE_UART1_CLK;             /*!< (@ 0x400500A0) Output stage control register  */\r
+  __IO uint32_t BASE_UART2_CLK;             /*!< (@ 0x400500A4) Output stage control register  */\r
+  __IO uint32_t BASE_UART3_CLK;             /*!< (@ 0x400500A8) Output stage control register  */\r
+  __IO uint32_t BASE_OUT_CLK;               /*!< (@ 0x400500AC) Output stage 20 control register for base clock BASE_OUT_CLK */\r
+  __I  uint32_t RESERVED3[4];\r
+  __IO uint32_t BASE_APLL_CLK;              /*!< (@ 0x400500C0) Output stage 25 control register for base clock BASE_APLL_CLK */\r
+  __IO uint32_t BASE_CGU_OUT0_CLK;          /*!< (@ 0x400500C4) Output stage 26 control register for base clock BASE_CGU_OUT0_CLK */\r
+  __IO uint32_t BASE_CGU_OUT1_CLK;          /*!< (@ 0x400500C8) Output stage 27 control register for base clock BASE_CGU_OUT1_CLK */\r
+} LPC_CGU_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         CCU1                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Clock Control Unit (CCU) Modification date=1/21/2011 Major revision=0 Minor revision=7  (CCU1)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40051000) CCU1 Structure         */\r
+  __IO uint32_t PM;                         /*!< (@ 0x40051000) CCU1 power mode register */\r
+  __I  uint32_t BASE_STAT;                  /*!< (@ 0x40051004) CCU1 base clocks status register */\r
+  __I  uint32_t RESERVED0[62];\r
+  __IO uint32_t CLK_APB3_BUS_CFG;           /*!< (@ 0x40051100) CLK_APB3_BUS clock configuration register */\r
+  __I  uint32_t CLK_APB3_BUS_STAT;          /*!< (@ 0x40051104) CLK_APB3_BUS clock status register */\r
+  __IO uint32_t CLK_APB3_I2C1_CFG;          /*!< (@ 0x40051108) CLK_APB3_I2C1 clock configuration register */\r
+  __I  uint32_t CLK_APB3_I2C1_STAT;         /*!< (@ 0x4005110C) CLK_APB3_I2C1 clock status register */\r
+  __IO uint32_t CLK_APB3_DAC_CFG;           /*!< (@ 0x40051110) CLK_APB3_DAC clock configuration register */\r
+  __I  uint32_t CLK_APB3_DAC_STAT;          /*!< (@ 0x40051114) CLK_APB3_DAC clock status register */\r
+  __IO uint32_t CLK_APB3_ADC0_CFG;          /*!< (@ 0x40051118) CLK_APB3_ADC0 clock configuration register */\r
+  __I  uint32_t CLK_APB3_ADC0_STAT;         /*!< (@ 0x4005111C) CLK_APB3_ADC0 clock status register */\r
+  __IO uint32_t CLK_APB3_ADC1_CFG;          /*!< (@ 0x40051120) CLK_APB3_ADC1 clock configuration register */\r
+  __I  uint32_t CLK_APB3_ADC1_STAT;         /*!< (@ 0x40051124) CLK_APB3_ADC1 clock status register */\r
+  __IO uint32_t CLK_APB3_CAN0_CFG;          /*!< (@ 0x40051128) CLK_APB3_CAN0 clock configuration register */\r
+  __I  uint32_t CLK_APB3_CAN0_STAT;         /*!< (@ 0x4005112C) CLK_APB3_CAN0 clock status register */\r
+  __I  uint32_t  RESERVED1[52];\r
+  __IO uint32_t CLK_APB1_BUS_CFG;           /*!< (@ 0x40051200) CLK_APB1_BUS clock configuration register */\r
+  __I  uint32_t CLK_APB1_BUS_STAT;          /*!< (@ 0x40051204) CLK_APB1_BUS clock status register */\r
+  __IO uint32_t CLK_APB1_MOTOCONPWM_CFG;    /*!< (@ 0x40051208) CLK_APB1_MOTOCONPWM clock configuration register */\r
+  __I  uint32_t CLK_APB1_MOTOCONPWM_STAT;   /*!< (@ 0x4005120C) CLK_APB1_MOTOCONPWM clock status register */\r
+  __IO uint32_t CLK_ABP1_I2C0_CFG;          /*!< (@ 0x40051210) CLK_ABP1_I2C0 clock configuration register */\r
+  __I  uint32_t CLK_APB1_I2C0_STAT;         /*!< (@ 0x40051214) CLK_APB1_I2C0 clock status register */\r
+  __IO uint32_t CLK_APB1_I2S_CFG;           /*!< (@ 0x40051218) CLK_APB1_I2S clock configuration register */\r
+  __I  uint32_t CLK_APB1_I2S_STAT;          /*!< (@ 0x4005121C) CLK_APB1_I2S clock status register */\r
+  __IO uint32_t CLK_APB1_CAN1_CFG;          /*!< (@ 0x40051220) CLK_APB1_CAN1 clock configuration register */\r
+  __I  uint32_t CLK_APB1_CAN1_STAT;         /*!< (@ 0x40051224) CLK_APB1_CAN1 clock status register */\r
+  __I  uint32_t  RESERVED2[54];\r
+  __IO uint32_t CLK_SPIFI_CFG;              /*!< (@ 0x40051300) CLK_SPIFI clock configuration register */\r
+  __I  uint32_t CLK_SPIFI_STAT;             /*!< (@ 0x40051304) CLK_APB1_SPIFI clock status register */\r
+  __I  uint32_t RESERVED3[62];\r
+  __IO uint32_t CLK_M3_BUS_CFG;             /*!< (@ 0x40051400) CLK_M3_BUS clock configuration register */\r
+  __I  uint32_t CLK_M3_BUS_STAT;            /*!< (@ 0x40051404) CLK_M3_BUSclock status register */\r
+  __IO uint32_t CLK_M3_SPIFI_CFG;           /*!< (@ 0x40051408) CLK_M3_SPIFI clock configuration register */\r
+  __I  uint32_t CLK_M3_SPIFI_STAT;          /*!< (@ 0x4005140C) CLK_M3_SPIFI clock status register */\r
+  __IO uint32_t CLK_M3_GPIO_CFG;            /*!< (@ 0x40051410) CLK_M3_GPIO clock configuration register */\r
+  __I  uint32_t CLK_M3_GPIO_STAT;           /*!< (@ 0x40051414) CLK_M3_GPIO clock status register */\r
+  __IO uint32_t CLK_M3_LCD_CFG;             /*!< (@ 0x40051418) CLK_M3_LCD clock configuration register */\r
+  __I  uint32_t CLK_M3_LCD_STAT;            /*!< (@ 0x4005141C) CLK_M3_LCD clock status register */\r
+  __IO uint32_t CLK_M3_ETHERNET_CFG;        /*!< (@ 0x40051420) CLK_M3_ETHERNET clock configuration register */\r
+  __I  uint32_t CLK_M3_ETHERNET_STAT;       /*!< (@ 0x40051424) CLK_M3_ETHERNET clock status register */\r
+  __IO uint32_t CLK_M3_USB0_CFG;            /*!< (@ 0x40051428) CLK_M3_USB0 clock configuration register */\r
+  __I  uint32_t CLK_M3_USB0_STAT;           /*!< (@ 0x4005142C) CLK_M3_USB0 clock status register */\r
+  __IO uint32_t CLK_M3_EMC_CFG;             /*!< (@ 0x40051430) CLK_M3_EMC clock configuration register */\r
+  __I  uint32_t CLK_M3_EMC_STAT;            /*!< (@ 0x40051434) CLK_M3_EMC clock status register */\r
+  __IO uint32_t CLK_M3_SDIO_CFG;            /*!< (@ 0x40051438) CLK_M3_SDIO clock configuration register */\r
+  __I  uint32_t CLK_M3_SDIO_STAT;           /*!< (@ 0x4005143C) CLK_M3_SDIO clock status register */\r
+  __IO uint32_t CLK_M3_DMA_CFG;             /*!< (@ 0x40051440) CLK_M3_DMA clock configuration register */\r
+  __I  uint32_t CLK_M3_DMA_STAT;            /*!< (@ 0x40051444) CLK_M3_DMA clock status register */\r
+  __IO uint32_t CLK_M3_M3CORE_CFG;          /*!< (@ 0x40051448) CLK_M3_M3CORE clock configuration register */\r
+  __I  uint32_t CLK_M3_M3CORE_STAT;         /*!< (@ 0x4005144C) CLK_M3_M3CORE clock status register */\r
+  __I  uint32_t  RESERVED4[6];\r
+  __IO uint32_t CLK_M3_SCT_CFG;             /*!< (@ 0x40051468) CLK_M3_SCT clock configuration register */\r
+  __I  uint32_t CLK_M3_SCT_STAT;            /*!< (@ 0x4005146C) CLK_M3_SCT clock status register */\r
+  __IO uint32_t CLK_M3_USB1_CFG;            /*!< (@ 0x40051470) CLK_M3_USB1 clock configuration register */\r
+  __I  uint32_t CLK_M3_USB1_STAT;           /*!< (@ 0x40051474) CLK_M3_USB1 clock status register */\r
+  __IO uint32_t CLK_M3_EMCDIV_CFG;          /*!< (@ 0x40051478) CLK_M3_EMCDIV clock configuration register */\r
+  __I  uint32_t CLK_M3_EMCDIV_STAT;         /*!< (@ 0x4005147C) CLK_M3_EMCDIV clock status register */\r
+  __I  uint32_t  RESERVED5[32];\r
+  __IO uint32_t CLK_M3_WWDT_CFG;            /*!< (@ 0x40051500) CLK_M3_WWDT clock configuration register */\r
+  __I  uint32_t CLK_M3_WWDT_STAT;           /*!< (@ 0x40051504) CLK_M3_WWDT clock status register */\r
+  __IO uint32_t CLK_M3_USART0_CFG;          /*!< (@ 0x40051508) CLK_M3_USART0 clock configuration register */\r
+  __I  uint32_t CLK_M3_USART0_STAT;         /*!< (@ 0x4005150C) CLK_M3_USART0 clock status register */\r
+  __IO uint32_t CLK_M3_UART1_CFG;           /*!< (@ 0x40051510) CLK_M3_UART1 clock configuration register */\r
+  __I  uint32_t CLK_M3_UART1_STAT;          /*!< (@ 0x40051514) CLK_M3_UART1 clock status register */\r
+  __IO uint32_t CLK_M3_SSP0_CFG;            /*!< (@ 0x40051518) CLK_M3_SSP0 clock configuration register */\r
+  __I  uint32_t CLK_M3_SSP0_STAT;           /*!< (@ 0x4005151C) CLK_M3_SSP0 clock status register */\r
+  __IO uint32_t CLK_M3_TIMER0_CFG;          /*!< (@ 0x40051520) CLK_M3_TIMER0 clock configuration register */\r
+  __I  uint32_t CLK_M3_TIMER0_STAT;         /*!< (@ 0x40051524) CLK_M3_TIMER0 clock status register */\r
+  __IO uint32_t CLK_M3_TIMER1_CFG;          /*!< (@ 0x40051528) CLK_M3_TIMER1clock configuration register */\r
+  __I  uint32_t CLK_M3_TIMER1_STAT;         /*!< (@ 0x4005152C) CLK_M3_TIMER1 clock status register */\r
+  __IO uint32_t CLK_M3_SCU_CFG;             /*!< (@ 0x40051530) CLK_M3_SCU clock configuration register */\r
+  __I  uint32_t CLK_M3_SCU_STAT;            /*!< (@ 0x40051534) CLK_SCU_XXX clock status register */\r
+  __IO uint32_t CLK_M3_CREG_CFG;            /*!< (@ 0x40051538) CLK_M3_CREGclock configuration register */\r
+  __I  uint32_t CLK_M3_CREG_STAT;           /*!< (@ 0x4005153C) CLK_M3_CREG clock status register */\r
+  __I  uint32_t  RESERVED6[48];\r
+  __IO uint32_t CLK_M3_RITIMER_CFG;         /*!< (@ 0x40051600) CLK_M3_RITIMER clock configuration register */\r
+  __I  uint32_t CLK_M3_RITIMER_STAT;        /*!< (@ 0x40051604) CLK_M3_RITIMER clock status register */\r
+  __IO uint32_t CLK_M3_USART2_CFG;          /*!< (@ 0x40051608) CLK_M3_USART2 clock configuration register */\r
+  __I  uint32_t CLK_M3_USART2_STAT;         /*!< (@ 0x4005160C) CLK_M3_USART2 clock status register */\r
+  __IO uint32_t CLK_M3_USART3_CFG;          /*!< (@ 0x40051610) CLK_M3_USART3 clock configuration register */\r
+  __I  uint32_t CLK_M3_USART3_STAT;         /*!< (@ 0x40051614) CLK_M3_USART3 clock status register */\r
+  __IO uint32_t CLK_M3_TIMER2_CFG;          /*!< (@ 0x40051618) CLK_M3_TIMER2 clock configuration register */\r
+  __I  uint32_t CLK_M3_TIMER2_STAT;         /*!< (@ 0x4005161C) CLK_M3_TIMER2 clock status register */\r
+  __IO uint32_t CLK_M3_TIMER3_CFG;          /*!< (@ 0x40051620) CLK_M3_TIMER3 clock configuration register */\r
+  __I  uint32_t CLK_M3_TIMER3_STAT;         /*!< (@ 0x40051624) CLK_M3_TIMER3 clock status register */\r
+  __IO uint32_t CLK_M3_SSP1_CFG;            /*!< (@ 0x40051628) CLK_M3_SSP1 clock configuration register */\r
+  __I  uint32_t CLK_M3_SSP1_STAT;           /*!< (@ 0x4005162C) CLK_M3_SSP1 clock status register */\r
+  __IO uint32_t CLK_M3_QEI_CFG;             /*!< (@ 0x40051630) CLK_M3_QEIclock configuration register */\r
+  __I  uint32_t CLK_M3_QEI_STAT;            /*!< (@ 0x40051634) CLK_M3_QEI clock status register */\r
+  __I  uint32_t  RESERVED7[114];\r
+  __IO uint32_t CLK_USB0_CFG;               /*!< (@ 0x40051800) CLK_M3_USB0 clock configuration register */\r
+  __I  uint32_t CLK_USB0_STAT;              /*!< (@ 0x40051804) CLK_USB0 clock status register */\r
+  __I  uint32_t RESERVED8[62];\r
+  __IO uint32_t CLK_USB1_CFG;               /*!< (@ 0x40051900) CLK_USB1 clock configuration register */\r
+  __I  uint32_t CLK_USB1_STAT;              /*!< (@ 0x40051904) CLK_USB1 clock status register */\r
+  __I  uint32_t RESERVED9[126];\r
+  __IO uint32_t CLK_VADC_CFG;               /*!< (@ 0x40051B00) CLK_VADC clock configuration register */\r
+  __I  uint32_t CLK_VADC_STAT;              /*!< (@ 0x40051B04) CLK_VADC clock status register */\r
+} LPC_CCU1_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         CCU2                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Clock Control Unit (CCU) Modification date=1/21/2011 Major revision=0 Minor revision=7  (CCU2)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40052000) CCU2 Structure         */\r
+  __IO uint32_t PM;                         /*!< (@ 0x40052000) Power mode register    */\r
+  __I  uint32_t BASE_STAT;                  /*!< (@ 0x40052004) CCU base clocks status register */\r
+  __I  uint32_t RESERVED0[62];\r
+  __IO uint32_t CLK_APLL_CFG;               /*!< (@ 0x40052100) CLK_APLL clock configuration register */\r
+  __I  uint32_t CLK_APLL_STAT;              /*!< (@ 0x40052104) CLK_APLL clock status register */\r
+  __I  uint32_t RESERVED1[62];\r
+  __IO uint32_t CLK_APB2_USART3_CFG;        /*!< (@ 0x40052200) CLK_APB2_USART3 clock configuration register */\r
+  __I  uint32_t CLK_APB2_USART3_STAT;       /*!< (@ 0x40052204) CLK_APB2_USART3 clock status register */\r
+  __I  uint32_t RESERVED2[62];\r
+  __IO uint32_t CLK_APB2_USART2_CFG;        /*!< (@ 0x40052300) CLK_APB2_USART2 clock configuration register */\r
+  __I  uint32_t CLK_APB2_USART2_STAT;       /*!< (@ 0x40052304) CLK_APB2_USART clock status register */\r
+  __I  uint32_t RESERVED3[62];\r
+  __IO uint32_t CLK_APB0_UART1_CFG;         /*!< (@ 0x40052400) CLK_APB2_UART1 clock configuration register */\r
+  __I  uint32_t CLK_APB0_UART1_STAT;        /*!< (@ 0x40052404) CLK_APB0_UART1 clock status register */\r
+  __I  uint32_t RESERVED4[62];\r
+  __IO uint32_t CLK_APB0_USART0_CFG;        /*!< (@ 0x40052500) CLK_APB2_USART0 clock configuration register */\r
+  __I  uint32_t CLK_APB0_USART0_STAT;       /*!< (@ 0x40052504) CLK_APB0_USART0 clock status register */\r
+  __I  uint32_t RESERVED5[62];\r
+  __IO uint32_t CLK_APB2_SSP1_CFG;          /*!< (@ 0x40052600) CLK_APB2_SSP1 clock configuration register */\r
+  __I  uint32_t CLK_APB2_SSP1_STAT;         /*!< (@ 0x40052604) CLK_APB2_SSP1 clock status register */\r
+  __I  uint32_t RESERVED6[62];\r
+  __IO uint32_t CLK_APB0_SSP0_CFG;          /*!< (@ 0x40052700) CLK_APB0_SSP0 clock configuration register */\r
+  __I  uint32_t CLK_APB0_SSP0_STAT;         /*!< (@ 0x40052704) CLK_APB0_SSP0 clock status register */\r
+  __I  uint32_t RESERVED7[62];\r
+  __IO uint32_t CLK_SDIO_CFG;               /*!< (@ 0x40052800) CLK_SDIO clock configuration register */\r
+  __I  uint32_t CLK_SDIO_STAT;              /*!< (@ 0x40052804) CLK_SDIO clock status register */\r
+} LPC_CCU2_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          RGU                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Reset GenerationUnit (RGU) Modification date=7/20/2011 Major revision=0 Minor revision=13  (RGU)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40053000) RGU Structure          */\r
+  __I  uint32_t RESERVED0[64];\r
+  __O  uint32_t RESET_CTRL0;                /*!< (@ 0x40053100) Reset control register 0 */\r
+  __O  uint32_t RESET_CTRL1;                /*!< (@ 0x40053104) Reset control register 1 */\r
+  __I  uint32_t RESERVED1[2];\r
+  __IO uint32_t RESET_STATUS0;              /*!< (@ 0x40053110) Reset status register 0 */\r
+  __IO uint32_t RESET_STATUS1;              /*!< (@ 0x40053114) Reset status register 1 */\r
+  __IO uint32_t RESET_STATUS2;              /*!< (@ 0x40053118) Reset status register 2 */\r
+  __IO uint32_t RESET_STATUS3;              /*!< (@ 0x4005311C) Reset status register 3 */\r
+  __I  uint32_t RESERVED2[12];\r
+  __I  uint32_t RESET_ACTIVE_STATUS0;       /*!< (@ 0x40053150) Reset active status register 0 */\r
+  __I  uint32_t RESET_ACTIVE_STATUS1;       /*!< (@ 0x40053154) Reset active status register 1 */\r
+  __I  uint32_t RESERVED3[170];\r
+  __IO uint32_t RESET_EXT_STAT0;            /*!< (@ 0x40053400) Reset external status register 0 for CORE_RST */\r
+  __IO uint32_t RESET_EXT_STAT1;            /*!< (@ 0x40053404) Reset external status register 1 for PERIPH_RST */\r
+  __IO uint32_t RESET_EXT_STAT2;            /*!< (@ 0x40053408) Reset external status register 2 for MASTER_RST */\r
+  __I  uint32_t RESERVED4;\r
+  __IO uint32_t RESET_EXT_STAT4;            /*!< (@ 0x40053410) Reset external status register 4 for WWDT_RST */\r
+  __IO uint32_t RESET_EXT_STAT5;            /*!< (@ 0x40053414) Reset external status register 5 for CREG_RST */\r
+  __I  uint32_t RESERVED5[2];\r
+  __IO uint32_t RESET_EXT_STAT8;            /*!< (@ 0x40053420) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT9;            /*!< (@ 0x40053424) Reset external status register */\r
+  __I  uint32_t RESERVED6[3];\r
+  __IO uint32_t RESET_EXT_STAT13;           /*!< (@ 0x40053434) Reset external status register */\r
+  __I  uint32_t RESERVED7[2];\r
+  __IO uint32_t RESET_EXT_STAT16;           /*!< (@ 0x40053440) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT17;           /*!< (@ 0x40053444) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT18;           /*!< (@ 0x40053448) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT19;           /*!< (@ 0x4005344C) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT20;           /*!< (@ 0x40053450) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT21;           /*!< (@ 0x40053454) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT22;           /*!< (@ 0x40053458) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT23;           /*!< (@ 0x4005345C) Reset external status register */\r
+  __I  uint32_t RESERVED8[4];\r
+  __IO uint32_t RESET_EXT_STAT28;           /*!< (@ 0x40053470) Reset external status register */\r
+  __I  uint32_t RESERVED9[3];\r
+  __IO uint32_t RESET_EXT_STAT32;           /*!< (@ 0x40053480) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT33;           /*!< (@ 0x40053484) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT34;           /*!< (@ 0x40053488) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT35;           /*!< (@ 0x4005348C) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT36;           /*!< (@ 0x40053490) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT37;           /*!< (@ 0x40053494) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT38;           /*!< (@ 0x40053498) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT39;           /*!< (@ 0x4005349C) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT40;           /*!< (@ 0x400534A0) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT41;           /*!< (@ 0x400534A4) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT42;           /*!< (@ 0x400534A8) Reset external status register */\r
+  __I  uint32_t RESERVED10;\r
+  __IO uint32_t RESET_EXT_STAT44;           /*!< (@ 0x400534B0) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT45;           /*!< (@ 0x400534B4) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT46;           /*!< (@ 0x400534B8) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT47;           /*!< (@ 0x400534BC) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT48;           /*!< (@ 0x400534C0) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT49;           /*!< (@ 0x400534C4) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT50;           /*!< (@ 0x400534C8) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT51;           /*!< (@ 0x400534CC) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT52;           /*!< (@ 0x400534D0) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT53;           /*!< (@ 0x400534D4) Reset external status register */\r
+  __IO uint32_t  RESET_EXT_STAT54;          /*!< (@ 0x400534D8) Reset external status register */\r
+  __IO uint32_t RESET_EXT_STAT55;           /*!< (@ 0x400534DC) Reset external status register */\r
+} LPC_RGU_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         WWDT                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Windowed Watchdog timer (WWDT) Modification date=1/14/2011 Major revision=0 Minor revision=7  (WWDT)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40080000) WWDT Structure         */\r
+  __IO uint32_t MOD;                        /*!< (@ 0x40080000) Watchdog mode register. This register contains the basic mode and status of the Watchdog Timer. */\r
+  __IO uint32_t TC;                         /*!< (@ 0x40080004) Watchdog timer constant register. This register determines the time-out value. */\r
+  __O  uint32_t FEED;                       /*!< (@ 0x40080008) Watchdog feed sequence register. Writing 0xAA followed by 0x55 to this register reloads the Watchdog timer with the value contained in WDTC. */\r
+  __I  uint32_t TV;                         /*!< (@ 0x4008000C) Watchdog timer value register. This register reads out the current value of the Watchdog timer. */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t WARNINT;                    /*!< (@ 0x40080014) Watchdog warning interrupt register. This register contains the Watchdog warning interrupt compare value. */\r
+  __IO uint32_t WINDOW;                     /*!< (@ 0x40080018) Watchdog timer window register. This register contains the Watchdog window value. */\r
+} LPC_WWDT_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        USARTn                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx USART0_2_3 Modification date=1/14/2011 Major revision=0 Minor revision=7  (USARTn)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400xx000) USARTn Structure       */\r
+\r
+  union {\r
+    __IO uint32_t DLL;                      /*!< (@ 0x400xx000) Divisor Latch LSB. Least significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider (DLAB = 1). */\r
+    __O  uint32_t THR;                      /*!< (@ 0x400xx000) Transmit Holding Register. The next character to be transmitted is written here (DLAB = 0). */\r
+    __I  uint32_t RBR;                      /*!< (@ 0x400xx000) Receiver Buffer Register. Contains the next received character to be read (DLAB = 0). */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t IER;                      /*!< (@ 0x400xx004) Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential UART interrupts (DLAB = 0). */\r
+    __IO uint32_t DLM;                      /*!< (@ 0x400xx004) Divisor Latch MSB. Most significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider (DLAB = 1). */\r
+  };\r
+\r
+  union {\r
+    __O  uint32_t FCR;                      /*!< (@ 0x400xx008) FIFO Control Register. Controls UART FIFO usage and modes. */\r
+    __I  uint32_t IIR;                      /*!< (@ 0x400xx008) Interrupt ID Register. Identifies which interrupt(s) are pending. */\r
+  };\r
+  __IO uint32_t LCR;                        /*!< (@ 0x400xx00C) Line Control Register. Contains controls for frame formatting and break generation. */\r
+  __I  uint32_t RESERVED0[1];\r
+  __I  uint32_t LSR;                        /*!< (@ 0x400xx014) Line Status Register. Contains flags for transmit and receive status, including line errors. */\r
+  __I  uint32_t RESERVED1[1];\r
+  __IO uint32_t SCR;                        /*!< (@ 0x400xx01C) Scratch Pad Register. Eight-bit temporary storage for software. */\r
+  __IO uint32_t ACR;                        /*!< (@ 0x400xx020) Auto-baud Control Register. Contains controls for the auto-baud feature. */\r
+  __IO uint32_t ICR;                        /*!< (@ 0x400xx024) IrDA control register (UART3 only) */\r
+  __IO uint32_t FDR;                        /*!< (@ 0x400xx028) Fractional Divider Register. Generates a clock input for the baud rate divider. */\r
+  __IO uint32_t OSR;                        /*!< (@ 0x400xx02C) Oversampling Register. Controls the degree of oversampling during each bit time. */\r
+  __I  uint32_t RESERVED2[4];\r
+  __IO uint32_t HDEN;                       /*!< (@ 0x400xx03C) Half-duplex enable Register */\r
+  __I  uint32_t RESERVED3[1];\r
+  __IO uint32_t SCICTRL;                    /*!< (@ 0x400xx048) Smart card interface control register */\r
+  __IO uint32_t RS485CTRL;                  /*!< (@ 0x400xx04C) RS-485/EIA-485 Control. Contains controls to configure various aspects of RS-485/EIA-485 modes. */\r
+  __IO uint32_t RS485ADRMATCH;              /*!< (@ 0x400xx050) RS-485/EIA-485 address match. Contains the address match value for RS-485/EIA-485 mode. */\r
+  __IO uint32_t RS485DLY;                   /*!< (@ 0x400xx054) RS-485/EIA-485 direction control delay. */\r
+  __IO uint32_t SYNCCTRL;                   /*!< (@ 0x400xx058) Synchronous mode control register. */\r
+  __IO uint32_t TER;                        /*!< (@ 0x400xx05C) Transmit Enable Register. Turns off UART transmitter for use with software flow control. */\r
+} LPC_USARTn_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         UART1                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx UART1 Modification date=1/14/2011 Major revision=0 Minor revision=7  (UART1)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40082000) UART1 Structure        */\r
+\r
+  union {\r
+    __IO uint32_t DLL;                      /*!< (@ 0x40082000) Divisor Latch LSB. Least significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider. (DLAB=1) */\r
+    __O  uint32_t THR;                      /*!< (@ 0x40082000) Transmit Holding Register. The next character to be transmitted is written here. (DLAB=0) */\r
+    __I  uint32_t RBR;                      /*!< (@ 0x40082000) Receiver Buffer Register. Contains the next received character to be read. (DLAB=0) */\r
+  };\r
+\r
+  union {\r
+    __IO uint32_t IER;                      /*!< (@ 0x40082004) Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential UART1 interrupts. (DLAB=0) */\r
+    __IO uint32_t DLM;                      /*!< (@ 0x40082004) Divisor Latch MSB. Most significant byte of the baud rate divisor value. The full divisor is used to generate a baud rate from the fractional rate divider.(DLAB=1) */\r
+  };\r
+\r
+  union {\r
+    __O  uint32_t FCR;                      /*!< (@ 0x40082008) FIFO Control Register. Controls UART1 FIFO usage and modes. */\r
+    __I  uint32_t IIR;                      /*!< (@ 0x40082008) Interrupt ID Register. Identifies which interrupt(s) are pending. */\r
+  };\r
+  __IO uint32_t LCR;                        /*!< (@ 0x4008200C) Line Control Register. Contains controls for frame formatting and break generation. */\r
+  __IO uint32_t MCR;                        /*!< (@ 0x40082010) Modem Control Register. Contains controls for flow control handshaking and loopback mode. */\r
+  __I  uint32_t LSR;                        /*!< (@ 0x40082014) Line Status Register. Contains flags for transmit and receive status, including line errors. */\r
+  __I  uint32_t MSR;                        /*!< (@ 0x40082018) Modem Status Register. Contains handshake signal status flags. */\r
+  __IO uint32_t SCR;                        /*!< (@ 0x4008201C) Scratch Pad Register. 8-bit temporary storage for software. */\r
+  __IO uint32_t ACR;                        /*!< (@ 0x40082020) Auto-baud Control Register. Contains controls for the auto-baud feature. */\r
+  __I  uint32_t  RESERVED0;\r
+  __IO uint32_t FDR;                        /*!< (@ 0x40082028) Fractional Divider Register. Generates a clock input for the baud rate divider. */\r
+  __I  uint32_t  RESERVED1;\r
+  __IO uint32_t TER;                        /*!< (@ 0x40082030) Transmit Enable Register. Turns off UART transmitter for use with software flow control. */\r
+  __I  uint32_t RESERVED2[6];\r
+  __IO uint32_t RS485CTRL;                  /*!< (@ 0x4008204C) RS-485/EIA-485 Control. Contains controls to configure various aspects of RS-485/EIA-485 modes. */\r
+  __IO uint32_t RS485ADRMATCH;              /*!< (@ 0x40082050) RS-485/EIA-485 address match. Contains the address match value for RS-485/EIA-485 mode. */\r
+  __IO uint32_t RS485DLY;                   /*!< (@ 0x40082054) RS-485/EIA-485 direction control delay. */\r
+  __I  uint32_t FIFOLVL;                    /*!< (@ 0x40082058) FIFO Level register. Provides the current fill levels of the transmit and receive FIFOs.  */\r
+} LPC_UART1_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         SSPn                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx SSP0/1 Modification date=1/14/2011 Major revision=0 Minor revision=7  (SSP0)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400xx000) SSPn Structure         */\r
+  __IO uint32_t CR0;                        /*!< (@ 0x400xx000) Control Register 0. Selects the serial clock rate, bus type, and data size. */\r
+  __IO uint32_t CR1;                        /*!< (@ 0x400xx004) Control Register 1. Selects master/slave and other modes. */\r
+  __IO uint32_t DR;                         /*!< (@ 0x400xx008) Data Register. Writes fill the transmit FIFO, and reads empty the receive FIFO. */\r
+  __I  uint32_t SR;                         /*!< (@ 0x400xx00C) Status Register        */\r
+  __IO uint32_t CPSR;                       /*!< (@ 0x400xx010) Clock Prescale Register */\r
+  __IO uint32_t IMSC;                       /*!< (@ 0x400xx014) Interrupt Mask Set and Clear Register */\r
+  __I  uint32_t RIS;                        /*!< (@ 0x400xx018) Raw Interrupt Status Register */\r
+  __I  uint32_t MIS;                        /*!< (@ 0x400xx01C) Masked Interrupt Status Register */\r
+  __O  uint32_t ICR;                        /*!< (@ 0x400xx020) SSPICR Interrupt Clear Register */\r
+  __IO uint32_t DMACR;                      /*!< (@ 0x400xx024) SSPn DMA control register */\r
+} LPC_SSPn_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        TIMERn                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Timer0/1/2/3 Modification date=1/14/2011 Major revision=0 Minor revision=7  (TIMERn)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400xx000) TIMERn Structure       */\r
+  __IO uint32_t IR;                         /*!< (@ 0x400xx000) Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending. */\r
+  __IO uint32_t TCR;                        /*!< (@ 0x400xx004) Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. */\r
+  __IO uint32_t TC;                         /*!< (@ 0x400xx008) Timer Counter. The 32 bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR. */\r
+  __IO uint32_t PR;                         /*!< (@ 0x400xx00C) Prescale Register. The Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC. */\r
+  __IO uint32_t PC;                         /*!< (@ 0x400xx010) Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface. */\r
+  __IO uint32_t MCR;                        /*!< (@ 0x400xx014) Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. */\r
+  __IO uint32_t MR[4];                      /*!< (@ 0x400xx018) Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */\r
+  __IO uint32_t CCR;                        /*!< (@ 0x400xx028) Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place. */\r
+  __IO uint32_t CR[4];                      /*!< (@ 0x400xx02C) Capture Register. CR is loaded with the value of TC when there is an event on the CAPn.0 input. */\r
+  __IO uint32_t EMR;                        /*!< (@ 0x400xx03C) External Match Register. The EMR controls the external match pins MATn.0-3 (MAT0.0-3 and MAT1.0-3 respectively). */\r
+  __I  uint32_t RESERVED0[12];\r
+  __IO uint32_t CTCR;                       /*!< (@ 0x400xx070) Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting. */\r
+} LPC_TIMERn_Type;\r
+\r
+\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          SCU                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx System Control Unit (SCU) Modification date=6/8/2011 Major revision=0 Minor revision=10  (SCU)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40086000) SCU Structure          */\r
+  __IO uint32_t SFSP0_0;                   /*!< (@ 0x40086000) Pin configuration register for pins P0 */\r
+  __IO uint32_t SFSP0_1;                   /*!< (@ 0x40086004) Pin configuration register for pins P0 */\r
+  __I  uint32_t RESERVED0[30];\r
+  __IO uint32_t SFSP1_0;                    /*!< (@ 0x40086080) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_1;                    /*!< (@ 0x40086084) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_2;                    /*!< (@ 0x40086088) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_3;                    /*!< (@ 0x4008608C) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_4;                    /*!< (@ 0x40086090) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_5;                    /*!< (@ 0x40086094) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_6;                    /*!< (@ 0x40086098) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_7;                    /*!< (@ 0x4008609C) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_8;                    /*!< (@ 0x400860A0) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_9;                    /*!< (@ 0x400860A4) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_10;                   /*!< (@ 0x400860A8) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_11;                   /*!< (@ 0x400860AC) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_12;                   /*!< (@ 0x400860B0) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_13;                   /*!< (@ 0x400860B4) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_14;                   /*!< (@ 0x400860B8) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_15;                   /*!< (@ 0x400860BC) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_16;                   /*!< (@ 0x400860C0) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_17;                   /*!< (@ 0x400860C4) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_18;                   /*!< (@ 0x400860C8) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_19;                   /*!< (@ 0x400860CC) Pin configuration register for pins P1 */\r
+  __IO uint32_t SFSP1_20;                   /*!< (@ 0x400860D0) Pin configuration register for pins P1 */\r
+  __I  uint32_t RESERVED1[11];\r
+  __IO uint32_t SFSP2_0;                    /*!< (@ 0x40086100) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_1;                    /*!< (@ 0x40086104) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_2;                    /*!< (@ 0x40086108) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_3;                    /*!< (@ 0x4008610C) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_4;                    /*!< (@ 0x40086110) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_5;                    /*!< (@ 0x40086114) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_6;                    /*!< (@ 0x40086118) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_7;                    /*!< (@ 0x4008611C) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_8;                    /*!< (@ 0x40086120) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_9;                    /*!< (@ 0x40086124) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_10;                   /*!< (@ 0x40086128) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_11;                   /*!< (@ 0x4008612C) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_12;                   /*!< (@ 0x40086130) Pin configuration register for pins P2 */\r
+  __IO uint32_t SFSP2_13;                   /*!< (@ 0x40086134) Pin configuration register for pins P2 */\r
+  __I  uint32_t RESERVED2[18];\r
+  __IO uint32_t SFSP3_0;                       /*!< (@ 0x40086180) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_1;                       /*!< (@ 0x40086184) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_2;                       /*!< (@ 0x40086188) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_3;                       /*!< (@ 0x4008618C) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_4;                       /*!< (@ 0x40086190) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_5;                       /*!< (@ 0x40086194) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_6;                       /*!< (@ 0x40086198) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_7;                       /*!< (@ 0x4008619C) Pin configuration register for pins P3 */\r
+  __IO uint32_t SFSP3_8;                       /*!< (@ 0x400861A0) Pin configuration register for pins P3 */\r
+  __I  uint32_t RESERVED3[23];\r
+  __IO uint32_t SFSP4_0;                    /*!< (@ 0x40086200) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_1;                    /*!< (@ 0x40086204) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_2;                    /*!< (@ 0x40086208) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_3;                    /*!< (@ 0x4008620C) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_4;                    /*!< (@ 0x40086210) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_5;                    /*!< (@ 0x40086214) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_6;                    /*!< (@ 0x40086218) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_7;                    /*!< (@ 0x4008621C) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_8;                    /*!< (@ 0x40086220) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_9;                    /*!< (@ 0x40086224) Pin configuration register for pins P4 */\r
+  __IO uint32_t SFSP4_10;                   /*!< (@ 0x40086228) Pin configuration register for pins P4 */\r
+  __I  uint32_t RESERVED4[21];\r
+  __IO uint32_t SFSP5_0;                       /*!< (@ 0x40086280) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_1;                       /*!< (@ 0x40086284) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_2;                       /*!< (@ 0x40086288) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_3;                       /*!< (@ 0x4008628C) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_4;                       /*!< (@ 0x40086290) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_5;                       /*!< (@ 0x40086294) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_6;                       /*!< (@ 0x40086298) Pin configuration register for pins P5 */\r
+  __IO uint32_t SFSP5_7;                       /*!< (@ 0x4008629C) Pin configuration register for pins P5 */\r
+  __I  uint32_t RESERVED5[24];\r
+  __IO uint32_t SFSP6_0;                    /*!< (@ 0x40086300) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_1;                    /*!< (@ 0x40086304) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_2;                    /*!< (@ 0x40086308) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_3;                    /*!< (@ 0x4008630C) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_4;                    /*!< (@ 0x40086310) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_5;                    /*!< (@ 0x40086314) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_6;                    /*!< (@ 0x40086318) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_7;                    /*!< (@ 0x4008631C) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_8;                    /*!< (@ 0x40086320) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_9;                    /*!< (@ 0x40086324) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_10;                   /*!< (@ 0x40086328) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_11;                   /*!< (@ 0x4008632C) Pin configuration register for pins P6 */\r
+  __IO uint32_t SFSP6_12;                   /*!< (@ 0x40086330) Pin configuration register for pins P6 */\r
+  __I  uint32_t RESERVED6[19];\r
+  __IO uint32_t SFSP7_0;                       /*!< (@ 0x40086380) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_1;                       /*!< (@ 0x40086384) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_2;                       /*!< (@ 0x40086388) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_3;                       /*!< (@ 0x4008638C) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_4;                       /*!< (@ 0x40086390) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_5;                       /*!< (@ 0x40086394) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_6;                       /*!< (@ 0x40086398) Pin configuration register for pins P7 */\r
+  __IO uint32_t SFSP7_7;                       /*!< (@ 0x4008639C) Pin configuration register for pins P7 */\r
+  __I  uint32_t RESERVED7[24];\r
+  __IO uint32_t SFSP8_0;                       /*!< (@ 0x40086400) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_1;                       /*!< (@ 0x40086404) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_2;                       /*!< (@ 0x40086408) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_3;                       /*!< (@ 0x4008640C) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_4;                       /*!< (@ 0x40086410) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_5;                       /*!< (@ 0x40086414) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_6;                       /*!< (@ 0x40086418) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_7;                       /*!< (@ 0x4008641C) Pin configuration register for pins P8 */\r
+  __IO uint32_t SFSP8_8;                       /*!< (@ 0x40086420) Pin configuration register for pins P8 */\r
+  __I  uint32_t RESERVED8[23];\r
+  __IO uint32_t SFSP9_0;                       /*!< (@ 0x40086480) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_1;                       /*!< (@ 0x40086484) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_2;                       /*!< (@ 0x40086488) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_3;                       /*!< (@ 0x4008648C) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_4;                       /*!< (@ 0x40086490) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_5;                       /*!< (@ 0x40086494) Pin configuration register for pins P9 */\r
+  __IO uint32_t SFSP9_6;                       /*!< (@ 0x40086498) Pin configuration register for pins P9 */\r
+  __I  uint32_t RESERVED9[25];\r
+  __IO uint32_t SFSPA_0;                       /*!< (@ 0x40086500) Pin configuration register for pins PA */\r
+  __IO uint32_t SFSPA_1;                       /*!< (@ 0x40086504) Pin configuration register for pins PA */\r
+  __IO uint32_t SFSPA_2;                       /*!< (@ 0x40086508) Pin configuration register for pins PA */\r
+  __IO uint32_t SFSPA_3;                       /*!< (@ 0x4008650C) Pin configuration register for pins PA */\r
+  __IO uint32_t SFSPA_4;                       /*!< (@ 0x40086510) Pin configuration register for pins PA */\r
+  __I  uint32_t RESERVED10[27];\r
+  __IO uint32_t SFSPB_0;                       /*!< (@ 0x40086580) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_1;                       /*!< (@ 0x40086584) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_2;                       /*!< (@ 0x40086588) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_3;                       /*!< (@ 0x4008658C) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_4;                       /*!< (@ 0x40086590) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_5;                       /*!< (@ 0x40086594) Pin configuration register for pins PB */\r
+  __IO uint32_t SFSPB_6;                       /*!< (@ 0x40086598) Pin configuration register for pins PB */\r
+  __I  uint32_t RESERVED11[25];\r
+  __IO uint32_t SFSPC_0;                    /*!< (@ 0x40086600) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_1;                    /*!< (@ 0x40086604) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_2;                    /*!< (@ 0x40086608) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_3;                    /*!< (@ 0x4008660C) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_4;                    /*!< (@ 0x40086610) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_5;                    /*!< (@ 0x40086614) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_6;                    /*!< (@ 0x40086618) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_7;                    /*!< (@ 0x4008661C) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_8;                    /*!< (@ 0x40086620) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_9;                    /*!< (@ 0x40086624) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_10;                   /*!< (@ 0x40086628) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_11;                   /*!< (@ 0x4008662C) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_12;                   /*!< (@ 0x40086630) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_13;                   /*!< (@ 0x40086634) Pin configuration register for pins PC */\r
+  __IO uint32_t SFSPC_14;                   /*!< (@ 0x40086638) Pin configuration register for pins PC */\r
+  __I  uint32_t RESERVED12[17];\r
+  __IO uint32_t SFSPD_0;                    /*!< (@ 0x40086680) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_1;                    /*!< (@ 0x40086684) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_2;                    /*!< (@ 0x40086688) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_3;                    /*!< (@ 0x4008668C) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_4;                    /*!< (@ 0x40086690) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_5;                    /*!< (@ 0x40086694) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_6;                    /*!< (@ 0x40086698) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_7;                    /*!< (@ 0x4008669C) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_8;                    /*!< (@ 0x400866A0) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_9;                    /*!< (@ 0x400866A4) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_10;                   /*!< (@ 0x400866A8) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_11;                   /*!< (@ 0x400866AC) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_12;                   /*!< (@ 0x400866B0) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_13;                   /*!< (@ 0x400866B4) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_14;                   /*!< (@ 0x400866B8) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_15;                   /*!< (@ 0x400866BC) Pin configuration register for pins PD */\r
+  __IO uint32_t SFSPD_16;                   /*!< (@ 0x400866C0) Pin configuration register for pins PD */\r
+  __I  uint32_t RESERVED13[15];\r
+  __IO uint32_t SFSPE_0;                    /*!< (@ 0x40086700) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_1;                    /*!< (@ 0x40086704) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_2;                    /*!< (@ 0x40086708) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_3;                    /*!< (@ 0x4008670C) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_4;                    /*!< (@ 0x40086710) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_5;                    /*!< (@ 0x40086714) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_6;                    /*!< (@ 0x40086718) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_7;                    /*!< (@ 0x4008671C) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_8;                    /*!< (@ 0x40086720) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_9;                    /*!< (@ 0x40086724) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_10;                   /*!< (@ 0x40086728) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_11;                   /*!< (@ 0x4008672C) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_12;                   /*!< (@ 0x40086730) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_13;                   /*!< (@ 0x40086734) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_14;                   /*!< (@ 0x40086738) Pin configuration register for pins PE */\r
+  __IO uint32_t SFSPE_15;                   /*!< (@ 0x4008673C) Pin configuration register for pins PE */\r
+  __I  uint32_t RESERVED14[16];\r
+  __IO uint32_t SFSPF_0;                    /*!< (@ 0x40086780) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_1;                    /*!< (@ 0x40086784) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_2;                    /*!< (@ 0x40086788) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_3;                    /*!< (@ 0x4008678C) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_4;                    /*!< (@ 0x40086790) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_5;                    /*!< (@ 0x40086794) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_6;                    /*!< (@ 0x40086798) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_7;                    /*!< (@ 0x4008679C) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_8;                    /*!< (@ 0x400867A0) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_9;                    /*!< (@ 0x400867A4) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_10;                   /*!< (@ 0x400867A8) Pin configuration register for pins PF */\r
+  __IO uint32_t SFSPF_11;                   /*!< (@ 0x400867AC) Pin configuration register for pins PF */\r
+  __I  uint32_t RESERVED15[276];\r
+  __IO uint32_t SFSCLK_0;                   /*!< (@ 0x40086C00) Pin configuration register for pin CLK0 */\r
+  __IO uint32_t SFSCLK_1;                   /*!< (@ 0x40086C04) Pin configuration register for pin CLK1 */\r
+  __IO uint32_t SFSCLK_2;                   /*!< (@ 0x40086C08) Pin configuration register for pin CLK2 */\r
+  __IO uint32_t SFSCLK_3;                   /*!< (@ 0x40086C0C) Pin configuration register for pin CLK3 */\r
+  __I  uint32_t RESERVED16[28];\r
+  __IO uint32_t SFSUSB;                     /*!< (@ 0x40086C80) Pin configuration register for */\r
+  __IO uint32_t SFSI2C0;                    /*!< (@ 0x40086C84) Pin configuration register for I 2C0-bus pins */\r
+  __IO uint32_t ENAIO0;                     /*!< (@ 0x40086C88) ADC0 function select register */\r
+  __IO uint32_t ENAIO1;                     /*!< (@ 0x40086C8C) ADC1 function select register */\r
+  __IO uint32_t ENAIO2;                     /*!< (@ 0x40086C90) Analog function select register */\r
+  __I  uint32_t RESERVED17[27];\r
+  __IO uint32_t  EMCDELAYCLK;               /*!< (@ 0x40086D00) EMC clock delay register */\r
+  __I  uint32_t  RESERVED18[63];\r
+  __IO uint32_t PINTSEL0;                   /*!< (@ 0x40086E00) Pin interrupt select register for pin interrupts 0 to 3. */\r
+  __IO uint32_t PINTSEL1;                   /*!< (@ 0x40086E04) Pin interrupt select register for pin interrupts 4 to 7. */\r
+} LPC_SCU_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                     GPIO_PIN_INT                                     -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief GPIO pin interrupt (GPIO_PIN_INT)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40087000) GPIO_PIN_INT Structure */\r
+  __IO uint32_t  ISEL;                      /*!< (@ 0x40087000) Pin Interrupt Mode register */\r
+  __IO uint32_t  IENR;                      /*!< (@ 0x40087004) Pin Interrupt Enable (Rising) register */\r
+  __O  uint32_t  SIENR;                     /*!< (@ 0x40087008) Set Pin Interrupt Enable (Rising) register */\r
+  __O  uint32_t  CIENR;                     /*!< (@ 0x4008700C) Clear Pin Interrupt Enable (Rising) register */\r
+  __IO uint32_t  IENF;                      /*!< (@ 0x40087010) Pin Interrupt Enable Falling Edge / Active Level register */\r
+  __O  uint32_t  SIENF;                     /*!< (@ 0x40087014) Set Pin Interrupt Enable Falling Edge / Active Level register */\r
+  __O  uint32_t  CIENF;                     /*!< (@ 0x40087018) Clear Pin Interrupt Enable Falling Edge / Active Level address */\r
+  __IO uint32_t  RISE;                      /*!< (@ 0x4008701C) Pin Interrupt Rising Edge register */\r
+  __IO uint32_t  FALL;                      /*!< (@ 0x40087020) Pin Interrupt Falling Edge register */\r
+  __IO uint32_t  IST;                       /*!< (@ 0x40087024) Pin Interrupt Status register */\r
+} LPC_GPIO_PIN_INT_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                    GPIO_GROUP_INTn                                   -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief GPIO group interrupt 0 (GPIO_GROUP_INTn)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x40088000) GPIO_GROUP_INTn Structure */\r
+  __IO uint32_t  CTRL;                      /*!< (@ 0x40088000) GPIO grouped interrupt control register */\r
+  __I  uint32_t  RESERVED0[7];\r
+  __IO uint32_t  PORT_POL0;                 /*!< (@ 0x40088020) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL1;                 /*!< (@ 0x40088024) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL2;                 /*!< (@ 0x40088028) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL3;                 /*!< (@ 0x4008802C) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL4;                 /*!< (@ 0x40088030) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL5;                 /*!< (@ 0x40088034) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL6;                 /*!< (@ 0x40088038) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_POL7;                 /*!< (@ 0x4008803C) GPIO grouped interrupt port polarity register */\r
+  __IO uint32_t  PORT_ENA0;                 /*!< (@ 0x40088040) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA1;                 /*!< (@ 0x40088044) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA2;                 /*!< (@ 0x40088048) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA3;                 /*!< (@ 0x4008804C) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA4;                 /*!< (@ 0x40088050) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA5;                 /*!< (@ 0x40088054) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA6;                 /*!< (@ 0x40088058) GPIO grouped interrupt port m enable register */\r
+  __IO uint32_t  PORT_ENA7;                 /*!< (@ 0x4008805C) GPIO grouped interrupt port m enable register */\r
+} LPC_GPIO_GROUP_INTn_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         MCPWM                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Motor Control PWM (MOTOCONPWM) Modification date=1/14/2011 Major revision=0 Minor revision=7  (MCPWM)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400A0000) MCPWM Structure        */\r
+  __I  uint32_t CON;                        /*!< (@ 0x400A0000) PWM Control read address */\r
+  __O  uint32_t CON_SET;                    /*!< (@ 0x400A0004) PWM Control set address */\r
+  __O  uint32_t CON_CLR;                    /*!< (@ 0x400A0008) PWM Control clear address */\r
+  __I  uint32_t CAPCON;                     /*!< (@ 0x400A000C) Capture Control read address */\r
+  __O  uint32_t CAPCON_SET;                 /*!< (@ 0x400A0010) Capture Control set address */\r
+  __O  uint32_t CAPCON_CLR;                 /*!< (@ 0x400A0014) Event Control clear address */\r
+  __IO uint32_t TC[3];                      /*!< (@ 0x400A0018) Timer Counter register */\r
+  __IO uint32_t LIM[3];                     /*!< (@ 0x400A0024) Limit register         */\r
+  __IO uint32_t MAT[3];                     /*!< (@ 0x400A0030) Match register         */\r
+  __IO uint32_t DT;                         /*!< (@ 0x400A003C) Dead time register     */\r
+  __IO uint32_t CCP;                        /*!< (@ 0x400A0040) Communication Pattern register */\r
+  __I  uint32_t CAP[3];                     /*!< (@ 0x400A0044) Capture register       */\r
+  __I  uint32_t INTEN;                      /*!< (@ 0x400A0050) Interrupt Enable read address */\r
+  __O  uint32_t INTEN_SET;                  /*!< (@ 0x400A0054) Interrupt Enable set address */\r
+  __O  uint32_t INTEN_CLR;                  /*!< (@ 0x400A0058) Interrupt Enable clear address */\r
+  __I  uint32_t CNTCON;                     /*!< (@ 0x400A005C) Count Control read address */\r
+  __O  uint32_t CNTCON_SET;                 /*!< (@ 0x400A0060) Count Control set address */\r
+  __O  uint32_t CNTCON_CLR;                 /*!< (@ 0x400A0064) Count Control clear address */\r
+  __I  uint32_t INTF;                       /*!< (@ 0x400A0068) Interrupt flags read address */\r
+  __O  uint32_t INTF_SET;                   /*!< (@ 0x400A006C) Interrupt flags set address */\r
+  __O  uint32_t INTF_CLR;                   /*!< (@ 0x400A0070) Interrupt flags clear address */\r
+  __O  uint32_t CAP_CLR;                    /*!< (@ 0x400A0074) Capture clear address  */\r
+} LPC_MCPWM_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         I2C0                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx I2C0/1-bus interface Modification date=1/14/2011 Major revision=0 Minor revision=7  (I2Cn)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400xx000) I2C0 Structure         */\r
+  __IO uint32_t CONSET;                     /*!< (@ 0x400xx000) I2C Control Set Register. When a one is written to a bit of this register, the corresponding bit in the I2C control register is set. Writing a zero has no effect on the corresponding bit in the I2C control register. */\r
+  __I  uint32_t STAT;                       /*!< (@ 0x400xx004) I2C Status Register. During I2C operation, this register provides detailed status codes that allow software to determine the next action needed. */\r
+  __IO uint32_t DAT;                        /*!< (@ 0x400xx008) I2C Data Register. During master or slave transmit mode, data to be transmitted is written to this register. During master or slave receive mode, data that has been received may be read from this register. */\r
+  __IO uint32_t ADR0;                       /*!< (@ 0x400xx00C) I2C Slave Address Register 0. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */\r
+  __IO uint32_t SCLH;                       /*!< (@ 0x400xx010) SCH Duty Cycle Register High Half Word. Determines the high time of the I2C clock. */\r
+  __IO uint32_t SCLL;                       /*!< (@ 0x400xx014) SCL Duty Cycle Register Low Half Word. Determines the low time of the I2C clock. SCLL and SCLH together determine the clock frequency generated by an I2C master and certain times used in slave mode. */\r
+  __O  uint32_t CONCLR;                     /*!< (@ 0x400xx018) I2C Control Clear Register. When a one is written to a bit of this register, the corresponding bit in the I2C control register is cleared. Writing a zero has no effect on the corresponding bit in the I2C control register. */\r
+  __IO uint32_t MMCTRL;                     /*!< (@ 0x400xx01C) Monitor mode control register. */\r
+  __IO uint32_t ADR1;                       /*!< (@ 0x400xx020) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */\r
+  __IO uint32_t ADR2;                       /*!< (@ 0x400xx024) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */\r
+  __IO uint32_t ADR3;                       /*!< (@ 0x400xx028) I2C Slave Address Register. Contains the 7-bit slave address for operation of the I2C interface in slave mode, and is not used in master mode. The least significant bit determines whether a slave responds to the General Call address. */\r
+  __I  uint32_t DATA_BUFFER;                /*!< (@ 0x400xx02C) Data buffer register. The contents of the 8 MSBs of the DAT shift register will be transferred to the DATA_BUFFER automatically after every nine bits (8 bits of data plus ACK or NACK) has been received on the bus. */\r
+  __IO uint32_t MASK[4];                    /*!< (@ 0x400xx030) I2C Slave address mask register */\r
+} LPC_I2Cn_Type;\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         I2Sn                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx I2S interface Modification date=1/14/2011 Major revision=0 Minor revision=7  (I2Sn)\r
+    0x400A2000 / 0x400A3000\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400Ax000) I2S Structure         */\r
+  __IO uint32_t DAO;                        /*!< (@ 0x400Ax000) I2S Digital Audio Output Register. Contains control bits for the I2S transmit channel. */\r
+  __IO uint32_t DAI;                        /*!< (@ 0x400Ax004) I2S Digital Audio Input Register. Contains control bits for the I2S receive channel. */\r
+  __O  uint32_t TXFIFO;                     /*!< (@ 0x400Ax008) I2S Transmit FIFO. Access register for the 8 x 32-bit transmitter FIFO. */\r
+  __I  uint32_t RXFIFO;                     /*!< (@ 0x400Ax00C) I2S Receive FIFO. Access register for the 8 x 32-bit receiver FIFO. */\r
+  __I  uint32_t STATE;                      /*!< (@ 0x400Ax010) I2S Status Feedback Register. Contains status information about the I2S interface. */\r
+  __IO uint32_t DMA1;                       /*!< (@ 0x400Ax014) I2S DMA Configuration Register 1. Contains control information for DMA request 1. */\r
+  __IO uint32_t DMA2;                       /*!< (@ 0x400Ax018) I2S DMA Configuration Register 2. Contains control information for DMA request 2. */\r
+  __IO uint32_t IRQ;                        /*!< (@ 0x400Ax01C) I2S Interrupt Request Control Register. Contains bits that control how the I2S interrupt request is generated. */\r
+  __IO uint32_t TXRATE;                     /*!< (@ 0x400Ax020) I2S Transmit MCLK divider. This register determines the I2S TX MCLK rate by specifying the value to divide PCLK by in order to produce MCLK. */\r
+  __IO uint32_t RXRATE;                     /*!< (@ 0x400Ax024) I2S Receive MCLK divider. This register determines the I2S RX MCLK rate by specifying the value to divide PCLK by in order to produce MCLK. */\r
+  __IO uint32_t TXBITRATE;                  /*!< (@ 0x400Ax028) I2S Transmit bit rate divider. This register determines the I2S transmit bit rate by specifying the value to divide TX_MCLK by in order to produce the transmit bit clock. */\r
+  __IO uint32_t RXBITRATE;                  /*!< (@ 0x400Ax02C) I2S Receive bit rate divider. This register determines the I2S receive bit rate by specifying the value to divide RX_MCLK by in order to produce the receive bit clock. */\r
+  __IO uint32_t TXMODE;                     /*!< (@ 0x400Ax030) I2S Transmit mode control. */\r
+  __IO uint32_t RXMODE;                     /*!< (@ 0x400Ax034) I2S Receive mode control. */\r
+} LPC_I2Sn_Type;\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        C_CANn                                        -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx C_CAN Modification date=1/18/2011 Major revision=0 Minor revision=7  (C_CANn)\r
+    0x400A4000 / 0x400E2000\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400E2000) C_CAN Structure       */\r
+  __IO uint32_t CNTL;                       /*!< (@ 0x400E2000) CAN control            */\r
+  __IO uint32_t STAT;                       /*!< (@ 0x400E2004) Status register        */\r
+  __I  uint32_t EC;                         /*!< (@ 0x400E2008) Error counter          */\r
+  __IO uint32_t BT;                         /*!< (@ 0x400E200C) Bit timing register    */\r
+  __I  uint32_t INT;                        /*!< (@ 0x400E2010) Interrupt register     */\r
+  __IO uint32_t TEST;                       /*!< (@ 0x400E2014) Test register          */\r
+  __IO uint32_t BRPE;                       /*!< (@ 0x400E2018) Baud rate prescaler extension register */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t IF1_CMDREQ;                 /*!< (@ 0x400E2020) Message interface command request  */\r
+\r
+  union {\r
+    __IO uint32_t IF1_CMDMSK_R;             /*!< (@ 0x400E2024) Message interface command mask (read direction) */\r
+    __IO uint32_t IF1_CMDMSK_W;             /*!< (@ 0x400E2024) Message interface command mask (write direction) */\r
+  };\r
+  __IO uint32_t IF1_MSK1;                   /*!< (@ 0x400E2028) Message interface mask 1 */\r
+  __IO uint32_t IF1_MSK2;                   /*!< (@ 0x400E202C) Message interface 1 mask 2 */\r
+  __IO uint32_t IF1_ARB1;                   /*!< (@ 0x400E2030) Message interface 1 arbitration 1 */\r
+  __IO uint32_t IF1_ARB2;                   /*!< (@ 0x400E2034) Message interface 1 arbitration 2 */\r
+  __IO uint32_t IF1_MCTRL;                  /*!< (@ 0x400E2038) Message interface 1 message control */\r
+  __IO uint32_t IF1_DA1;                    /*!< (@ 0x400E203C) Message interface data A1 */\r
+  __IO uint32_t IF1_DA2;                    /*!< (@ 0x400E2040) Message interface 1 data A2 */\r
+  __IO uint32_t IF1_DB1;                    /*!< (@ 0x400E2044) Message interface 1 data B1 */\r
+  __IO uint32_t IF1_DB2;                    /*!< (@ 0x400E2048) Message interface 1 data B2 */\r
+  __I  uint32_t RESERVED1[13];\r
+  __IO uint32_t IF2_CMDREQ;                 /*!< (@ 0x400E2080) Message interface command request  */\r
+\r
+  union {\r
+    __IO uint32_t IF2_CMDMSK_R;             /*!< (@ 0x400E2084) Message interface command mask (read direction) */\r
+    __IO uint32_t IF2_CMDMSK_W;             /*!< (@ 0x400E2084) Message interface command mask (write direction) */\r
+  };\r
+  __IO uint32_t IF2_MSK1;                   /*!< (@ 0x400E2088) Message interface mask 1 */\r
+  __IO uint32_t IF2_MSK2;                   /*!< (@ 0x400E208C) Message interface 1 mask 2 */\r
+  __IO uint32_t IF2_ARB1;                   /*!< (@ 0x400E2090) Message interface 1 arbitration 1 */\r
+  __IO uint32_t IF2_ARB2;                   /*!< (@ 0x400E2094) Message interface 1 arbitration 2 */\r
+  __IO uint32_t IF2_MCTRL;                  /*!< (@ 0x400E2098) Message interface 1 message control */\r
+  __IO uint32_t IF2_DA1;                    /*!< (@ 0x400E209C) Message interface data A1 */\r
+  __IO uint32_t IF2_DA2;                    /*!< (@ 0x400E20A0) Message interface 1 data A2 */\r
+  __IO uint32_t IF2_DB1;                    /*!< (@ 0x400E20A4) Message interface 1 data B1 */\r
+  __IO uint32_t IF2_DB2;                    /*!< (@ 0x400E20A8) Message interface 1 data B2 */\r
+  __I  uint32_t RESERVED2[21];\r
+  __I  uint32_t TXREQ1;                     /*!< (@ 0x400E2100) Transmission request 1 */\r
+  __I  uint32_t TXREQ2;                     /*!< (@ 0x400E2104) Transmission request 2 */\r
+  __I  uint32_t RESERVED3[6];\r
+  __I  uint32_t ND1;                        /*!< (@ 0x400E2120) New data 1             */\r
+  __I  uint32_t ND2;                        /*!< (@ 0x400E2124) New data 2             */\r
+  __I  uint32_t RESERVED4[6];\r
+  __I  uint32_t IR1;                        /*!< (@ 0x400E2140) Interrupt pending 1    */\r
+  __I  uint32_t IR2;                        /*!< (@ 0x400E2144) Interrupt pending 2    */\r
+  __I  uint32_t RESERVED5[6];\r
+  __I  uint32_t MSGV1;                      /*!< (@ 0x400E2160) Message valid 1        */\r
+  __I  uint32_t MSGV2;                      /*!< (@ 0x400E2164) Message valid 2        */\r
+  __I  uint32_t RESERVED6[6];\r
+  __IO uint32_t CLKDIV;                     /*!< (@ 0x400E2180) CAN clock divider register */\r
+} LPC_C_CANn_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                        RITIMER                                       -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Repetitive Interrupt Timer (RIT) Modification date=1/14/2011 Major revision=0 Minor revision=7  (RITIMER)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400C0000) RITIMER Structure      */\r
+  __IO uint32_t COMPVAL;                    /*!< (@ 0x400C0000) Compare register       */\r
+  __IO uint32_t MASK;                       /*!< (@ 0x400C0004) Mask register. This register holds the 32-bit mask value. A 1 written to any bit will force a compare on the corresponding bit of the counter and compare register. */\r
+  __IO uint32_t CTRL;                       /*!< (@ 0x400C0008) Control register.      */\r
+  __IO uint32_t COUNTER;                    /*!< (@ 0x400C000C) 32-bit counter         */\r
+} LPC_RITIMER_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          QEI                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx Quadrature Encoder Interface (QEI) Modification date=1/18/2011 Major revision=0 Minor revision=7  (QEI)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400C6000) QEI Structure          */\r
+  __O  uint32_t CON;                        /*!< (@ 0x400C6000) Control register       */\r
+  __I  uint32_t STAT;                       /*!< (@ 0x400C6004) Encoder status register */\r
+  __IO uint32_t CONF;                       /*!< (@ 0x400C6008) Configuration register */\r
+  __I  uint32_t POS;                        /*!< (@ 0x400C600C) Position register      */\r
+  __IO uint32_t MAXPOS;                     /*!< (@ 0x400C6010) Maximum position register */\r
+  __IO uint32_t CMPOS0;                     /*!< (@ 0x400C6014) position compare register 0 */\r
+  __IO uint32_t CMPOS1;                     /*!< (@ 0x400C6018) position compare register 1 */\r
+  __IO uint32_t CMPOS2;                     /*!< (@ 0x400C601C) position compare register 2 */\r
+  __I  uint32_t INXCNT;                     /*!< (@ 0x400C6020) Index count register   */\r
+  __IO uint32_t INXCMP0;                    /*!< (@ 0x400C6024) Index compare register 0 */\r
+  __IO uint32_t LOAD;                       /*!< (@ 0x400C6028) Velocity timer reload register */\r
+  __I  uint32_t TIME;                       /*!< (@ 0x400C602C) Velocity timer register */\r
+  __I  uint32_t VEL;                        /*!< (@ 0x400C6030) Velocity counter register */\r
+  __I  uint32_t CAP;                        /*!< (@ 0x400C6034) Velocity capture register */\r
+  __IO uint32_t VELCOMP;                    /*!< (@ 0x400C6038) Velocity compare register */\r
+  __IO uint32_t FILTERPHA;                  /*!< (@ 0x400C603C) Digital filter register on input phase A (QEI_A) */\r
+  __IO uint32_t FILTERPHB;                  /*!< (@ 0x400C6040) Digital filter register on input phase B (QEI_B) */\r
+  __IO uint32_t FILTERINX;                  /*!< (@ 0x400C6044) Digital filter register on input index (QEI_IDX) */\r
+  __IO uint32_t WINDOW;                     /*!< (@ 0x400C6048) Index acceptance window register */\r
+  __IO uint32_t INXCMP1;                    /*!< (@ 0x400C604C) Index compare register 1 */\r
+  __IO uint32_t INXCMP2;                    /*!< (@ 0x400C6050) Index compare register 2 */\r
+  __I  uint32_t RESERVED0[993];\r
+  __O  uint32_t IEC;                        /*!< (@ 0x400C6FD8) Interrupt enable clear register */\r
+  __O  uint32_t IES;                        /*!< (@ 0x400C6FDC) Interrupt enable set register */\r
+  __I  uint32_t INTSTAT;                    /*!< (@ 0x400C6FE0) Interrupt status register */\r
+  __I  uint32_t IE;                         /*!< (@ 0x400C6FE4) Interrupt enable register */\r
+  __O  uint32_t CLR;                        /*!< (@ 0x400C6FE8) Interrupt status clear register */\r
+  __O  uint32_t SET;                        /*!< (@ 0x400C6FEC) Interrupt status set register */\r
+} LPC_QEI_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         GIMA                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=Falcon Chapter title=Global Input Multiplexer Array (GIMA) Modification date=3/25/2011 Major revision=0 Minor revision=4  (GIMA)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400C7000) GIMA Structure         */\r
+  __IO uint32_t  CAP0_0_IN;                 /*!< (@ 0x400C7000) Timer 0 CAP0_0 capture input multiplexer (GIMA output 0) */\r
+  __IO uint32_t  CAP0_1_IN;                 /*!< (@ 0x400C7004) Timer 0 CAP0_1 capture input multiplexer (GIMA output 1) */\r
+  __IO uint32_t  CAP0_2_IN;                 /*!< (@ 0x400C7008) Timer 0 CAP0_2 capture input multiplexer (GIMA output 2) */\r
+  __IO uint32_t  CAP0_3_IN;                 /*!< (@ 0x400C700C) Timer 0 CAP0_3 capture input multiplexer (GIMA output 3) */\r
+  __IO uint32_t  CAP1_0_IN;                 /*!< (@ 0x400C7010) Timer 1 CAP1_0 capture input multiplexer (GIMA output 4) */\r
+  __IO uint32_t  CAP1_1_IN;                 /*!< (@ 0x400C7014) Timer 1 CAP1_1 capture input multiplexer (GIMA output 5) */\r
+  __IO uint32_t  CAP1_2_IN;                 /*!< (@ 0x400C7018) Timer 1 CAP1_2 capture input multiplexer (GIMA output 6) */\r
+  __IO uint32_t  CAP1_3_IN;                 /*!< (@ 0x400C701C) Timer 1 CAP1_3 capture input multiplexer (GIMA output 7) */\r
+  __IO uint32_t  CAP2_0_IN;                 /*!< (@ 0x400C7020) Timer 2 CAP2_0 capture input multiplexer (GIMA output 8) */\r
+  __IO uint32_t  CAP2_1_IN;                 /*!< (@ 0x400C7024) Timer 2 CAP2_1 capture input multiplexer (GIMA output 9) */\r
+  __IO uint32_t  CAP2_2_IN;                 /*!< (@ 0x400C7028) Timer 2 CAP2_2 capture input multiplexer (GIMA output 10) */\r
+  __IO uint32_t  CAP2_3_IN;                 /*!< (@ 0x400C702C) Timer 2 CAP2_3 capture input multiplexer (GIMA output 11) */\r
+  __IO uint32_t  CAP3_0_IN;                 /*!< (@ 0x400C7030) Timer 3 CAP3_0 capture input multiplexer (GIMA output 12) */\r
+  __IO uint32_t  CAP3_1_IN;                 /*!< (@ 0x400C7034) Timer 3 CAP3_1 capture input multiplexer (GIMA output 13) */\r
+  __IO uint32_t  CAP3_2_IN;                 /*!< (@ 0x400C7038) Timer 3 CAP3_2 capture input multiplexer (GIMA output 14) */\r
+  __IO uint32_t  CAP3_3_IN;                 /*!< (@ 0x400C703C) Timer 3 CAP3_3 capture input multiplexer (GIMA output 15) */\r
+  __IO uint32_t  CTIN_0_IN;                 /*!< (@ 0x400C7040) SCT CTIN_0 capture input multiplexer (GIMA output 16) */\r
+  __IO uint32_t  CTIN_1_IN;                 /*!< (@ 0x400C7044) SCT CTIN_1 capture input multiplexer (GIMA output 17) */\r
+  __IO uint32_t  CTIN_2_IN;                 /*!< (@ 0x400C7048) SCT CTIN_2 capture input multiplexer (GIMA output 18) */\r
+  __IO uint32_t  CTIN_3_IN;                 /*!< (@ 0x400C704C) SCT CTIN_3 capture input multiplexer (GIMA output 19) */\r
+  __IO uint32_t  CTIN_4_IN;                 /*!< (@ 0x400C7050) SCT CTIN_4 capture input multiplexer (GIMA output 20) */\r
+  __IO uint32_t  CTIN_5_IN;                 /*!< (@ 0x400C7054) SCT CTIN_5 capture input multiplexer (GIMA output 21) */\r
+  __IO uint32_t  CTIN_6_IN;                 /*!< (@ 0x400C7058) SCT CTIN_6 capture input multiplexer (GIMA output 22) */\r
+  __IO uint32_t  CTIN_7_IN;                 /*!< (@ 0x400C705C) SCT CTIN_7 capture input multiplexer (GIMA output 23) */\r
+  __IO uint32_t  VADC_TRIGGER_IN;           /*!< (@ 0x400C7060) VADC trigger input multiplexer (GIMA output 24) */\r
+  __IO uint32_t  EVENTROUTER_13_IN;         /*!< (@ 0x400C7064) Event router input 13 multiplexer (GIMA output 25) */\r
+  __IO uint32_t  EVENTROUTER_14_IN;         /*!< (@ 0x400C7068) Event router input 14 multiplexer (GIMA output 26) */\r
+  __IO uint32_t  EVENTROUTER_16_IN;         /*!< (@ 0x400C706C) Event router input 16 multiplexer (GIMA output 27) */\r
+  __IO uint32_t  ADCSTART0_IN;              /*!< (@ 0x400C7070) ADC start0 input multiplexer (GIMA output 28) */\r
+  __IO uint32_t  ADCSTART1_IN;              /*!< (@ 0x400C7074) ADC start1 input multiplexer (GIMA output 29) */\r
+} LPC_GIMA_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                          DAC                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx DAC Modification date=1/18/2011 Major revision=0 Minor revision=7  (DAC)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400E1000) DAC Structure          */\r
+  __IO uint32_t CR;                         /*!< (@ 0x400E1000) DAC register. Holds the conversion data. */\r
+  __IO uint32_t CTRL;                       /*!< (@ 0x400E1004) DAC control register.  */\r
+  __IO uint32_t CNTVAL;                     /*!< (@ 0x400E1008) DAC counter value register. */\r
+} LPC_DAC_Type;\r
+\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                         ADCn                                         -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief Product name title=UM10430 Chapter title=LPC18xx 10-bit ADC0/1 Modification date=1/18/2011 Major revision=0 Minor revision=7  (ADCn)\r
+    0x400E3000 / 0x400E4000\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400Ex000) ADCn Structure         */\r
+  __IO uint32_t CR;                         /*!< (@ 0x400Ex000) A/D Control Register. The AD0CR register must be written to select the operating mode before A/D conversion can occur. */\r
+  __I  uint32_t GDR;                        /*!< (@ 0x400Ex004) A/D Global Data Register. Contains the result of the most recent A/D conversion. */\r
+  __I  uint32_t RESERVED0;\r
+  __IO uint32_t INTEN;                      /*!< (@ 0x400Ex00C) A/D Interrupt Enable Register. This register contains enable bits that allow the DONE flag of each A/D channel to be included or excluded from contributing to the generation of an A/D interrupt. */\r
+  __I  uint32_t DR[8];                      /*!< (@ 0x400Ex010) A/D Channel Data Register. This register contains the result of the most recent conversion completed on channel n. */\r
+  __I  uint32_t STAT;                       /*!< (@ 0x400Ex030) A/D Status Register. This register contains DONE and OVERRUN flags for all of the A/D channels, as well as the A/D interrupt flag. */\r
+} LPC_ADCn_Type;\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                       GPIO_PORT                                      -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+/**\r
+  * @brief GPIO port  (GPIO_PORT)\r
+  */\r
+\r
+typedef struct {                            /*!< (@ 0x400F4000) GPIO_PORT Structure    */\r
+  __IO uint8_t B[256];                      /*!< (@ 0x400F4000) Byte pin registers port 0 to 5; pins PIOn_0 to PIOn_31 */\r
+  __I  uint32_t RESERVED0[960];\r
+  __IO uint32_t W[256];                     /*!< (@ 0x400F5000) Word pin registers port 0 to 5 */\r
+  __I  uint32_t RESERVED1[768];\r
+  __IO uint32_t DIR[8];                     /*!< (@ 0x400F6000) Direction registers port n */\r
+  __I  uint32_t RESERVED2[24];\r
+  __IO uint32_t MASK[8];                    /*!< (@ 0x400F6080) Mask register port n   */\r
+  __I  uint32_t RESERVED3[24];\r
+  __IO uint32_t PIN[8];                     /*!< (@ 0x400F6100) Portpin register port n */\r
+  __I  uint32_t RESERVED4[24];\r
+  __IO uint32_t MPIN[8];                    /*!< (@ 0x400F6180) Masked port register port n */\r
+  __I  uint32_t RESERVED5[24];\r
+  __IO uint32_t SET[8];                     /*!< (@ 0x400F6200) Write: Set register for port n Read: output bits for port n */\r
+  __I  uint32_t RESERVED6[24];\r
+  __O  uint32_t CLR[8];                     /*!< (@ 0x400F6280) Clear port n           */\r
+  __I  uint32_t RESERVED7[24];\r
+  __O  uint32_t NOT[8];                     /*!< (@ 0x400F6300) Toggle port n          */\r
+} LPC_GPIO_PORT_Type;\r
+\r
+\r
+\r
+/********************************************\r
+** End of section using anonymous unions   **\r
+*********************************************/\r
+\r
+#if defined(__ARMCC_VERSION)\r
+  #pragma pop\r
+#elif defined(__CWCC__)\r
+  #pragma pop\r
+#elif defined(__GNUC__)\r
+  /* leave anonymous unions enabled */\r
+#elif defined(__IAR_SYSTEMS_ICC__)\r
+  #pragma pop\r
+#else\r
+  #error Not supported compiler type\r
+#endif\r
+\r
+\r
+#ifdef CMSIS_BITPOSITIONS\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  SCT Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  SCT_CONFIG  -------------------------------------------\r
+#define SCT_CONFIG_UNIFY_Pos                                  0                                                         /*!< SCT CONFIG: UNIFY Position          */\r
+#define SCT_CONFIG_UNIFY_Msk                                  (0x01UL << SCT_CONFIG_UNIFY_Pos)                          /*!< SCT CONFIG: UNIFY Mask              */\r
+#define SCT_CONFIG_CLKMODE_Pos                                1                                                         /*!< SCT CONFIG: CLKMODE Position        */\r
+#define SCT_CONFIG_CLKMODE_Msk                                (0x03UL << SCT_CONFIG_CLKMODE_Pos)                        /*!< SCT CONFIG: CLKMODE Mask            */\r
+#define SCT_CONFIG_CLKSEL_Pos                                 3                                                         /*!< SCT CONFIG: CLKSEL Position         */\r
+#define SCT_CONFIG_CLKSEL_Msk                                 (0x0fUL << SCT_CONFIG_CLKSEL_Pos)                         /*!< SCT CONFIG: CLKSEL Mask             */\r
+#define SCT_CONFIG_NORELAODL_NORELOADU_Pos                    7                                                         /*!< SCT CONFIG: NORELAODL_NORELOADU Position */\r
+#define SCT_CONFIG_NORELAODL_NORELOADU_Msk                    (0x01UL << SCT_CONFIG_NORELAODL_NORELOADU_Pos)            /*!< SCT CONFIG: NORELAODL_NORELOADU Mask */\r
+#define SCT_CONFIG_NORELOADH_Pos                              8                                                         /*!< SCT CONFIG: NORELOADH Position      */\r
+#define SCT_CONFIG_NORELOADH_Msk                              (0x01UL << SCT_CONFIG_NORELOADH_Pos)                      /*!< SCT CONFIG: NORELOADH Mask          */\r
+#define SCT_CONFIG_INSYNCn_Pos                                9                                                         /*!< SCT CONFIG: INSYNCn Position        */\r
+#define SCT_CONFIG_INSYNCn_Msk                                (0x000000ffUL << SCT_CONFIG_INSYNCn_Pos)                  /*!< SCT CONFIG: INSYNCn Mask            */\r
+\r
+// ----------------------------------------  SCT_CTRL  --------------------------------------------\r
+#define SCT_CTRL_DOWN_L_Pos                                   0                                                         /*!< SCT CTRL: DOWN_L Position           */\r
+#define SCT_CTRL_DOWN_L_Msk                                   (0x01UL << SCT_CTRL_DOWN_L_Pos)                           /*!< SCT CTRL: DOWN_L Mask               */\r
+#define SCT_CTRL_STOP_L_Pos                                   1                                                         /*!< SCT CTRL: STOP_L Position           */\r
+#define SCT_CTRL_STOP_L_Msk                                   (0x01UL << SCT_CTRL_STOP_L_Pos)                           /*!< SCT CTRL: STOP_L Mask               */\r
+#define SCT_CTRL_HALT_L_Pos                                   2                                                         /*!< SCT CTRL: HALT_L Position           */\r
+#define SCT_CTRL_HALT_L_Msk                                   (0x01UL << SCT_CTRL_HALT_L_Pos)                           /*!< SCT CTRL: HALT_L Mask               */\r
+#define SCT_CTRL_CLRCTR_L_Pos                                 3                                                         /*!< SCT CTRL: CLRCTR_L Position         */\r
+#define SCT_CTRL_CLRCTR_L_Msk                                 (0x01UL << SCT_CTRL_CLRCTR_L_Pos)                         /*!< SCT CTRL: CLRCTR_L Mask             */\r
+#define SCT_CTRL_BIDIR_L_Pos                                  4                                                         /*!< SCT CTRL: BIDIR_L Position          */\r
+#define SCT_CTRL_BIDIR_L_Msk                                  (0x01UL << SCT_CTRL_BIDIR_L_Pos)                          /*!< SCT CTRL: BIDIR_L Mask              */\r
+#define SCT_CTRL_PRE_L_Pos                                    5                                                         /*!< SCT CTRL: PRE_L Position            */\r
+#define SCT_CTRL_PRE_L_Msk                                    (0x000000ffUL << SCT_CTRL_PRE_L_Pos)                      /*!< SCT CTRL: PRE_L Mask                */\r
+#define SCT_CTRL_DOWN_H_Pos                                   16                                                        /*!< SCT CTRL: DOWN_H Position           */\r
+#define SCT_CTRL_DOWN_H_Msk                                   (0x01UL << SCT_CTRL_DOWN_H_Pos)                           /*!< SCT CTRL: DOWN_H Mask               */\r
+#define SCT_CTRL_STOP_H_Pos                                   17                                                        /*!< SCT CTRL: STOP_H Position           */\r
+#define SCT_CTRL_STOP_H_Msk                                   (0x01UL << SCT_CTRL_STOP_H_Pos)                           /*!< SCT CTRL: STOP_H Mask               */\r
+#define SCT_CTRL_HALT_H_Pos                                   18                                                        /*!< SCT CTRL: HALT_H Position           */\r
+#define SCT_CTRL_HALT_H_Msk                                   (0x01UL << SCT_CTRL_HALT_H_Pos)                           /*!< SCT CTRL: HALT_H Mask               */\r
+#define SCT_CTRL_CLRCTR_H_Pos                                 19                                                        /*!< SCT CTRL: CLRCTR_H Position         */\r
+#define SCT_CTRL_CLRCTR_H_Msk                                 (0x01UL << SCT_CTRL_CLRCTR_H_Pos)                         /*!< SCT CTRL: CLRCTR_H Mask             */\r
+#define SCT_CTRL_BIDIR_H_Pos                                  20                                                        /*!< SCT CTRL: BIDIR_H Position          */\r
+#define SCT_CTRL_BIDIR_H_Msk                                  (0x01UL << SCT_CTRL_BIDIR_H_Pos)                          /*!< SCT CTRL: BIDIR_H Mask              */\r
+#define SCT_CTRL_PRE_H_Pos                                    21                                                        /*!< SCT CTRL: PRE_H Position            */\r
+#define SCT_CTRL_PRE_H_Msk                                    (0x000000ffUL << SCT_CTRL_PRE_H_Pos)                      /*!< SCT CTRL: PRE_H Mask                */\r
+\r
+// ----------------------------------------  SCT_LIMIT  -------------------------------------------\r
+#define SCT_LIMIT_LIMMSK_L_Pos                                0                                                         /*!< SCT LIMIT: LIMMSK_L Position        */\r
+#define SCT_LIMIT_LIMMSK_L_Msk                                (0x0000ffffUL << SCT_LIMIT_LIMMSK_L_Pos)                  /*!< SCT LIMIT: LIMMSK_L Mask            */\r
+#define SCT_LIMIT_LIMMSK_H_Pos                                16                                                        /*!< SCT LIMIT: LIMMSK_H Position        */\r
+#define SCT_LIMIT_LIMMSK_H_Msk                                (0x0000ffffUL << SCT_LIMIT_LIMMSK_H_Pos)                  /*!< SCT LIMIT: LIMMSK_H Mask            */\r
+\r
+// ----------------------------------------  SCT_HALT  --------------------------------------------\r
+#define SCT_HALT_HALTMSK_L_Pos                                0                                                         /*!< SCT HALT: HALTMSK_L Position        */\r
+#define SCT_HALT_HALTMSK_L_Msk                                (0x0000ffffUL << SCT_HALT_HALTMSK_L_Pos)                  /*!< SCT HALT: HALTMSK_L Mask            */\r
+#define SCT_HALT_HALTMSK_H_Pos                                16                                                        /*!< SCT HALT: HALTMSK_H Position        */\r
+#define SCT_HALT_HALTMSK_H_Msk                                (0x0000ffffUL << SCT_HALT_HALTMSK_H_Pos)                  /*!< SCT HALT: HALTMSK_H Mask            */\r
+\r
+// ----------------------------------------  SCT_STOP  --------------------------------------------\r
+#define SCT_STOP_STOPMSK_L_Pos                                0                                                         /*!< SCT STOP: STOPMSK_L Position        */\r
+#define SCT_STOP_STOPMSK_L_Msk                                (0x0000ffffUL << SCT_STOP_STOPMSK_L_Pos)                  /*!< SCT STOP: STOPMSK_L Mask            */\r
+#define SCT_STOP_STOPMSK_H_Pos                                16                                                        /*!< SCT STOP: STOPMSK_H Position        */\r
+#define SCT_STOP_STOPMSK_H_Msk                                (0x0000ffffUL << SCT_STOP_STOPMSK_H_Pos)                  /*!< SCT STOP: STOPMSK_H Mask            */\r
+\r
+// ----------------------------------------  SCT_START  -------------------------------------------\r
+#define SCT_START_STARTMSK_L_Pos                              0                                                         /*!< SCT START: STARTMSK_L Position      */\r
+#define SCT_START_STARTMSK_L_Msk                              (0x0000ffffUL << SCT_START_STARTMSK_L_Pos)                /*!< SCT START: STARTMSK_L Mask          */\r
+#define SCT_START_STARTMSK_H_Pos                              16                                                        /*!< SCT START: STARTMSK_H Position      */\r
+#define SCT_START_STARTMSK_H_Msk                              (0x0000ffffUL << SCT_START_STARTMSK_H_Pos)                /*!< SCT START: STARTMSK_H Mask          */\r
+\r
+// ----------------------------------------  SCT_COUNT  -------------------------------------------\r
+#define SCT_COUNT_CTR_L_Pos                                   0                                                         /*!< SCT COUNT: CTR_L Position           */\r
+#define SCT_COUNT_CTR_L_Msk                                   (0x0000ffffUL << SCT_COUNT_CTR_L_Pos)                     /*!< SCT COUNT: CTR_L Mask               */\r
+#define SCT_COUNT_CTR_H_Pos                                   16                                                        /*!< SCT COUNT: CTR_H Position           */\r
+#define SCT_COUNT_CTR_H_Msk                                   (0x0000ffffUL << SCT_COUNT_CTR_H_Pos)                     /*!< SCT COUNT: CTR_H Mask               */\r
+\r
+// ----------------------------------------  SCT_STATE  -------------------------------------------\r
+#define SCT_STATE_STATE_L_Pos                                 0                                                         /*!< SCT STATE: STATE_L Position         */\r
+#define SCT_STATE_STATE_L_Msk                                 (0x1fUL << SCT_STATE_STATE_L_Pos)                         /*!< SCT STATE: STATE_L Mask             */\r
+#define SCT_STATE_STATE_H_Pos                                 16                                                        /*!< SCT STATE: STATE_H Position         */\r
+#define SCT_STATE_STATE_H_Msk                                 (0x1fUL << SCT_STATE_STATE_H_Pos)                         /*!< SCT STATE: STATE_H Mask             */\r
+\r
+// ----------------------------------------  SCT_INPUT  -------------------------------------------\r
+#define SCT_INPUT_AIN0_Pos                                    0                                                         /*!< SCT INPUT: AIN0 Position            */\r
+#define SCT_INPUT_AIN0_Msk                                    (0x01UL << SCT_INPUT_AIN0_Pos)                            /*!< SCT INPUT: AIN0 Mask                */\r
+#define SCT_INPUT_AIN1_Pos                                    1                                                         /*!< SCT INPUT: AIN1 Position            */\r
+#define SCT_INPUT_AIN1_Msk                                    (0x01UL << SCT_INPUT_AIN1_Pos)                            /*!< SCT INPUT: AIN1 Mask                */\r
+#define SCT_INPUT_AIN2_Pos                                    2                                                         /*!< SCT INPUT: AIN2 Position            */\r
+#define SCT_INPUT_AIN2_Msk                                    (0x01UL << SCT_INPUT_AIN2_Pos)                            /*!< SCT INPUT: AIN2 Mask                */\r
+#define SCT_INPUT_AIN3_Pos                                    3                                                         /*!< SCT INPUT: AIN3 Position            */\r
+#define SCT_INPUT_AIN3_Msk                                    (0x01UL << SCT_INPUT_AIN3_Pos)                            /*!< SCT INPUT: AIN3 Mask                */\r
+#define SCT_INPUT_AIN4_Pos                                    4                                                         /*!< SCT INPUT: AIN4 Position            */\r
+#define SCT_INPUT_AIN4_Msk                                    (0x01UL << SCT_INPUT_AIN4_Pos)                            /*!< SCT INPUT: AIN4 Mask                */\r
+#define SCT_INPUT_AIN5_Pos                                    5                                                         /*!< SCT INPUT: AIN5 Position            */\r
+#define SCT_INPUT_AIN5_Msk                                    (0x01UL << SCT_INPUT_AIN5_Pos)                            /*!< SCT INPUT: AIN5 Mask                */\r
+#define SCT_INPUT_AIN6_Pos                                    6                                                         /*!< SCT INPUT: AIN6 Position            */\r
+#define SCT_INPUT_AIN6_Msk                                    (0x01UL << SCT_INPUT_AIN6_Pos)                            /*!< SCT INPUT: AIN6 Mask                */\r
+#define SCT_INPUT_AIN7_Pos                                    7                                                         /*!< SCT INPUT: AIN7 Position            */\r
+#define SCT_INPUT_AIN7_Msk                                    (0x01UL << SCT_INPUT_AIN7_Pos)                            /*!< SCT INPUT: AIN7 Mask                */\r
+#define SCT_INPUT_SIN0_Pos                                    16                                                        /*!< SCT INPUT: SIN0 Position            */\r
+#define SCT_INPUT_SIN0_Msk                                    (0x01UL << SCT_INPUT_SIN0_Pos)                            /*!< SCT INPUT: SIN0 Mask                */\r
+#define SCT_INPUT_SIN1_Pos                                    17                                                        /*!< SCT INPUT: SIN1 Position            */\r
+#define SCT_INPUT_SIN1_Msk                                    (0x01UL << SCT_INPUT_SIN1_Pos)                            /*!< SCT INPUT: SIN1 Mask                */\r
+#define SCT_INPUT_SIN2_Pos                                    18                                                        /*!< SCT INPUT: SIN2 Position            */\r
+#define SCT_INPUT_SIN2_Msk                                    (0x01UL << SCT_INPUT_SIN2_Pos)                            /*!< SCT INPUT: SIN2 Mask                */\r
+#define SCT_INPUT_SIN3_Pos                                    19                                                        /*!< SCT INPUT: SIN3 Position            */\r
+#define SCT_INPUT_SIN3_Msk                                    (0x01UL << SCT_INPUT_SIN3_Pos)                            /*!< SCT INPUT: SIN3 Mask                */\r
+#define SCT_INPUT_SIN4_Pos                                    20                                                        /*!< SCT INPUT: SIN4 Position            */\r
+#define SCT_INPUT_SIN4_Msk                                    (0x01UL << SCT_INPUT_SIN4_Pos)                            /*!< SCT INPUT: SIN4 Mask                */\r
+#define SCT_INPUT_SIN5_Pos                                    21                                                        /*!< SCT INPUT: SIN5 Position            */\r
+#define SCT_INPUT_SIN5_Msk                                    (0x01UL << SCT_INPUT_SIN5_Pos)                            /*!< SCT INPUT: SIN5 Mask                */\r
+#define SCT_INPUT_SIN6_Pos                                    22                                                        /*!< SCT INPUT: SIN6 Position            */\r
+#define SCT_INPUT_SIN6_Msk                                    (0x01UL << SCT_INPUT_SIN6_Pos)                            /*!< SCT INPUT: SIN6 Mask                */\r
+#define SCT_INPUT_SIN7_Pos                                    23                                                        /*!< SCT INPUT: SIN7 Position            */\r
+#define SCT_INPUT_SIN7_Msk                                    (0x01UL << SCT_INPUT_SIN7_Pos)                            /*!< SCT INPUT: SIN7 Mask                */\r
+\r
+// ---------------------------------------  SCT_REGMODE  ------------------------------------------\r
+#define SCT_REGMODE_REGMOD_L0_Pos                             0                                                         /*!< SCT REGMODE: REGMOD_L0 Position     */\r
+#define SCT_REGMODE_REGMOD_L0_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L0_Pos)                     /*!< SCT REGMODE: REGMOD_L0 Mask         */\r
+#define SCT_REGMODE_REGMOD_L1_Pos                             1                                                         /*!< SCT REGMODE: REGMOD_L1 Position     */\r
+#define SCT_REGMODE_REGMOD_L1_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L1_Pos)                     /*!< SCT REGMODE: REGMOD_L1 Mask         */\r
+#define SCT_REGMODE_REGMOD_L2_Pos                             2                                                         /*!< SCT REGMODE: REGMOD_L2 Position     */\r
+#define SCT_REGMODE_REGMOD_L2_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L2_Pos)                     /*!< SCT REGMODE: REGMOD_L2 Mask         */\r
+#define SCT_REGMODE_REGMOD_L3_Pos                             3                                                         /*!< SCT REGMODE: REGMOD_L3 Position     */\r
+#define SCT_REGMODE_REGMOD_L3_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L3_Pos)                     /*!< SCT REGMODE: REGMOD_L3 Mask         */\r
+#define SCT_REGMODE_REGMOD_L4_Pos                             4                                                         /*!< SCT REGMODE: REGMOD_L4 Position     */\r
+#define SCT_REGMODE_REGMOD_L4_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L4_Pos)                     /*!< SCT REGMODE: REGMOD_L4 Mask         */\r
+#define SCT_REGMODE_REGMOD_L5_Pos                             5                                                         /*!< SCT REGMODE: REGMOD_L5 Position     */\r
+#define SCT_REGMODE_REGMOD_L5_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L5_Pos)                     /*!< SCT REGMODE: REGMOD_L5 Mask         */\r
+#define SCT_REGMODE_REGMOD_L6_Pos                             6                                                         /*!< SCT REGMODE: REGMOD_L6 Position     */\r
+#define SCT_REGMODE_REGMOD_L6_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L6_Pos)                     /*!< SCT REGMODE: REGMOD_L6 Mask         */\r
+#define SCT_REGMODE_REGMOD_L7_Pos                             7                                                         /*!< SCT REGMODE: REGMOD_L7 Position     */\r
+#define SCT_REGMODE_REGMOD_L7_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L7_Pos)                     /*!< SCT REGMODE: REGMOD_L7 Mask         */\r
+#define SCT_REGMODE_REGMOD_L8_Pos                             8                                                         /*!< SCT REGMODE: REGMOD_L8 Position     */\r
+#define SCT_REGMODE_REGMOD_L8_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L8_Pos)                     /*!< SCT REGMODE: REGMOD_L8 Mask         */\r
+#define SCT_REGMODE_REGMOD_L9_Pos                             9                                                         /*!< SCT REGMODE: REGMOD_L9 Position     */\r
+#define SCT_REGMODE_REGMOD_L9_Msk                             (0x01UL << SCT_REGMODE_REGMOD_L9_Pos)                     /*!< SCT REGMODE: REGMOD_L9 Mask         */\r
+#define SCT_REGMODE_REGMOD_L10_Pos                            10                                                        /*!< SCT REGMODE: REGMOD_L10 Position    */\r
+#define SCT_REGMODE_REGMOD_L10_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L10_Pos)                    /*!< SCT REGMODE: REGMOD_L10 Mask        */\r
+#define SCT_REGMODE_REGMOD_L11_Pos                            11                                                        /*!< SCT REGMODE: REGMOD_L11 Position    */\r
+#define SCT_REGMODE_REGMOD_L11_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L11_Pos)                    /*!< SCT REGMODE: REGMOD_L11 Mask        */\r
+#define SCT_REGMODE_REGMOD_L12_Pos                            12                                                        /*!< SCT REGMODE: REGMOD_L12 Position    */\r
+#define SCT_REGMODE_REGMOD_L12_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L12_Pos)                    /*!< SCT REGMODE: REGMOD_L12 Mask        */\r
+#define SCT_REGMODE_REGMOD_L13_Pos                            13                                                        /*!< SCT REGMODE: REGMOD_L13 Position    */\r
+#define SCT_REGMODE_REGMOD_L13_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L13_Pos)                    /*!< SCT REGMODE: REGMOD_L13 Mask        */\r
+#define SCT_REGMODE_REGMOD_L14_Pos                            14                                                        /*!< SCT REGMODE: REGMOD_L14 Position    */\r
+#define SCT_REGMODE_REGMOD_L14_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L14_Pos)                    /*!< SCT REGMODE: REGMOD_L14 Mask        */\r
+#define SCT_REGMODE_REGMOD_L15_Pos                            15                                                        /*!< SCT REGMODE: REGMOD_L15 Position    */\r
+#define SCT_REGMODE_REGMOD_L15_Msk                            (0x01UL << SCT_REGMODE_REGMOD_L15_Pos)                    /*!< SCT REGMODE: REGMOD_L15 Mask        */\r
+#define SCT_REGMODE_REGMOD_H16_Pos                            16                                                        /*!< SCT REGMODE: REGMOD_H16 Position    */\r
+#define SCT_REGMODE_REGMOD_H16_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H16_Pos)                    /*!< SCT REGMODE: REGMOD_H16 Mask        */\r
+#define SCT_REGMODE_REGMOD_H17_Pos                            17                                                        /*!< SCT REGMODE: REGMOD_H17 Position    */\r
+#define SCT_REGMODE_REGMOD_H17_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H17_Pos)                    /*!< SCT REGMODE: REGMOD_H17 Mask        */\r
+#define SCT_REGMODE_REGMOD_H18_Pos                            18                                                        /*!< SCT REGMODE: REGMOD_H18 Position    */\r
+#define SCT_REGMODE_REGMOD_H18_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H18_Pos)                    /*!< SCT REGMODE: REGMOD_H18 Mask        */\r
+#define SCT_REGMODE_REGMOD_H19_Pos                            19                                                        /*!< SCT REGMODE: REGMOD_H19 Position    */\r
+#define SCT_REGMODE_REGMOD_H19_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H19_Pos)                    /*!< SCT REGMODE: REGMOD_H19 Mask        */\r
+#define SCT_REGMODE_REGMOD_H20_Pos                            20                                                        /*!< SCT REGMODE: REGMOD_H20 Position    */\r
+#define SCT_REGMODE_REGMOD_H20_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H20_Pos)                    /*!< SCT REGMODE: REGMOD_H20 Mask        */\r
+#define SCT_REGMODE_REGMOD_H21_Pos                            21                                                        /*!< SCT REGMODE: REGMOD_H21 Position    */\r
+#define SCT_REGMODE_REGMOD_H21_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H21_Pos)                    /*!< SCT REGMODE: REGMOD_H21 Mask        */\r
+#define SCT_REGMODE_REGMOD_H22_Pos                            22                                                        /*!< SCT REGMODE: REGMOD_H22 Position    */\r
+#define SCT_REGMODE_REGMOD_H22_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H22_Pos)                    /*!< SCT REGMODE: REGMOD_H22 Mask        */\r
+#define SCT_REGMODE_REGMOD_H23_Pos                            23                                                        /*!< SCT REGMODE: REGMOD_H23 Position    */\r
+#define SCT_REGMODE_REGMOD_H23_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H23_Pos)                    /*!< SCT REGMODE: REGMOD_H23 Mask        */\r
+#define SCT_REGMODE_REGMOD_H24_Pos                            24                                                        /*!< SCT REGMODE: REGMOD_H24 Position    */\r
+#define SCT_REGMODE_REGMOD_H24_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H24_Pos)                    /*!< SCT REGMODE: REGMOD_H24 Mask        */\r
+#define SCT_REGMODE_REGMOD_H25_Pos                            25                                                        /*!< SCT REGMODE: REGMOD_H25 Position    */\r
+#define SCT_REGMODE_REGMOD_H25_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H25_Pos)                    /*!< SCT REGMODE: REGMOD_H25 Mask        */\r
+#define SCT_REGMODE_REGMOD_H26_Pos                            26                                                        /*!< SCT REGMODE: REGMOD_H26 Position    */\r
+#define SCT_REGMODE_REGMOD_H26_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H26_Pos)                    /*!< SCT REGMODE: REGMOD_H26 Mask        */\r
+#define SCT_REGMODE_REGMOD_H27_Pos                            27                                                        /*!< SCT REGMODE: REGMOD_H27 Position    */\r
+#define SCT_REGMODE_REGMOD_H27_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H27_Pos)                    /*!< SCT REGMODE: REGMOD_H27 Mask        */\r
+#define SCT_REGMODE_REGMOD_H28_Pos                            28                                                        /*!< SCT REGMODE: REGMOD_H28 Position    */\r
+#define SCT_REGMODE_REGMOD_H28_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H28_Pos)                    /*!< SCT REGMODE: REGMOD_H28 Mask        */\r
+#define SCT_REGMODE_REGMOD_H29_Pos                            29                                                        /*!< SCT REGMODE: REGMOD_H29 Position    */\r
+#define SCT_REGMODE_REGMOD_H29_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H29_Pos)                    /*!< SCT REGMODE: REGMOD_H29 Mask        */\r
+#define SCT_REGMODE_REGMOD_H30_Pos                            30                                                        /*!< SCT REGMODE: REGMOD_H30 Position    */\r
+#define SCT_REGMODE_REGMOD_H30_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H30_Pos)                    /*!< SCT REGMODE: REGMOD_H30 Mask        */\r
+#define SCT_REGMODE_REGMOD_H31_Pos                            31                                                        /*!< SCT REGMODE: REGMOD_H31 Position    */\r
+#define SCT_REGMODE_REGMOD_H31_Msk                            (0x01UL << SCT_REGMODE_REGMOD_H31_Pos)                    /*!< SCT REGMODE: REGMOD_H31 Mask        */\r
+\r
+// ---------------------------------------  SCT_OUTPUT  -------------------------------------------\r
+#define SCT_OUTPUT_OUT0_Pos                                   0                                                         /*!< SCT OUTPUT: OUT0 Position           */\r
+#define SCT_OUTPUT_OUT0_Msk                                   (0x01UL << SCT_OUTPUT_OUT0_Pos)                           /*!< SCT OUTPUT: OUT0 Mask               */\r
+#define SCT_OUTPUT_OUT1_Pos                                   1                                                         /*!< SCT OUTPUT: OUT1 Position           */\r
+#define SCT_OUTPUT_OUT1_Msk                                   (0x01UL << SCT_OUTPUT_OUT1_Pos)                           /*!< SCT OUTPUT: OUT1 Mask               */\r
+#define SCT_OUTPUT_OUT2_Pos                                   2                                                         /*!< SCT OUTPUT: OUT2 Position           */\r
+#define SCT_OUTPUT_OUT2_Msk                                   (0x01UL << SCT_OUTPUT_OUT2_Pos)                           /*!< SCT OUTPUT: OUT2 Mask               */\r
+#define SCT_OUTPUT_OUT3_Pos                                   3                                                         /*!< SCT OUTPUT: OUT3 Position           */\r
+#define SCT_OUTPUT_OUT3_Msk                                   (0x01UL << SCT_OUTPUT_OUT3_Pos)                           /*!< SCT OUTPUT: OUT3 Mask               */\r
+#define SCT_OUTPUT_OUT4_Pos                                   4                                                         /*!< SCT OUTPUT: OUT4 Position           */\r
+#define SCT_OUTPUT_OUT4_Msk                                   (0x01UL << SCT_OUTPUT_OUT4_Pos)                           /*!< SCT OUTPUT: OUT4 Mask               */\r
+#define SCT_OUTPUT_OUT5_Pos                                   5                                                         /*!< SCT OUTPUT: OUT5 Position           */\r
+#define SCT_OUTPUT_OUT5_Msk                                   (0x01UL << SCT_OUTPUT_OUT5_Pos)                           /*!< SCT OUTPUT: OUT5 Mask               */\r
+#define SCT_OUTPUT_OUT6_Pos                                   6                                                         /*!< SCT OUTPUT: OUT6 Position           */\r
+#define SCT_OUTPUT_OUT6_Msk                                   (0x01UL << SCT_OUTPUT_OUT6_Pos)                           /*!< SCT OUTPUT: OUT6 Mask               */\r
+#define SCT_OUTPUT_OUT7_Pos                                   7                                                         /*!< SCT OUTPUT: OUT7 Position           */\r
+#define SCT_OUTPUT_OUT7_Msk                                   (0x01UL << SCT_OUTPUT_OUT7_Pos)                           /*!< SCT OUTPUT: OUT7 Mask               */\r
+#define SCT_OUTPUT_OUT8_Pos                                   8                                                         /*!< SCT OUTPUT: OUT8 Position           */\r
+#define SCT_OUTPUT_OUT8_Msk                                   (0x01UL << SCT_OUTPUT_OUT8_Pos)                           /*!< SCT OUTPUT: OUT8 Mask               */\r
+#define SCT_OUTPUT_OUT9_Pos                                   9                                                         /*!< SCT OUTPUT: OUT9 Position           */\r
+#define SCT_OUTPUT_OUT9_Msk                                   (0x01UL << SCT_OUTPUT_OUT9_Pos)                           /*!< SCT OUTPUT: OUT9 Mask               */\r
+#define SCT_OUTPUT_OUT10_Pos                                  10                                                        /*!< SCT OUTPUT: OUT10 Position          */\r
+#define SCT_OUTPUT_OUT10_Msk                                  (0x01UL << SCT_OUTPUT_OUT10_Pos)                          /*!< SCT OUTPUT: OUT10 Mask              */\r
+#define SCT_OUTPUT_OUT11_Pos                                  11                                                        /*!< SCT OUTPUT: OUT11 Position          */\r
+#define SCT_OUTPUT_OUT11_Msk                                  (0x01UL << SCT_OUTPUT_OUT11_Pos)                          /*!< SCT OUTPUT: OUT11 Mask              */\r
+#define SCT_OUTPUT_OUT12_Pos                                  12                                                        /*!< SCT OUTPUT: OUT12 Position          */\r
+#define SCT_OUTPUT_OUT12_Msk                                  (0x01UL << SCT_OUTPUT_OUT12_Pos)                          /*!< SCT OUTPUT: OUT12 Mask              */\r
+#define SCT_OUTPUT_OUT13_Pos                                  13                                                        /*!< SCT OUTPUT: OUT13 Position          */\r
+#define SCT_OUTPUT_OUT13_Msk                                  (0x01UL << SCT_OUTPUT_OUT13_Pos)                          /*!< SCT OUTPUT: OUT13 Mask              */\r
+#define SCT_OUTPUT_OUT14_Pos                                  14                                                        /*!< SCT OUTPUT: OUT14 Position          */\r
+#define SCT_OUTPUT_OUT14_Msk                                  (0x01UL << SCT_OUTPUT_OUT14_Pos)                          /*!< SCT OUTPUT: OUT14 Mask              */\r
+#define SCT_OUTPUT_OUT15_Pos                                  15                                                        /*!< SCT OUTPUT: OUT15 Position          */\r
+#define SCT_OUTPUT_OUT15_Msk                                  (0x01UL << SCT_OUTPUT_OUT15_Pos)                          /*!< SCT OUTPUT: OUT15 Mask              */\r
+\r
+// ------------------------------------  SCT_OUTPUTDIRCTRL  ---------------------------------------\r
+#define SCT_OUTPUTDIRCTRL_SETCLR0_Pos                         0                                                         /*!< SCT OUTPUTDIRCTRL: SETCLR0 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR0_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR0_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR0 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR1_Pos                         2                                                         /*!< SCT OUTPUTDIRCTRL: SETCLR1 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR1_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR1_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR1 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR2_Pos                         4                                                         /*!< SCT OUTPUTDIRCTRL: SETCLR2 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR2_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR2_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR2 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR3_Pos                         6                                                         /*!< SCT OUTPUTDIRCTRL: SETCLR3 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR3_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR3_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR3 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR4_Pos                         8                                                         /*!< SCT OUTPUTDIRCTRL: SETCLR4 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR4_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR4_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR4 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR5_Pos                         10                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR5 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR5_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR5_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR5 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR6_Pos                         12                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR6 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR6_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR6_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR6 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR7_Pos                         14                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR7 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR7_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR7_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR7 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR8_Pos                         16                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR8 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR8_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR8_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR8 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR9_Pos                         18                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR9 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR9_Msk                         (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR9_Pos)                 /*!< SCT OUTPUTDIRCTRL: SETCLR9 Mask     */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR10_Pos                        20                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR10 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR10_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR10_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR10 Mask    */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR11_Pos                        22                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR11 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR11_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR11_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR11 Mask    */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR12_Pos                        24                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR12 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR12_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR12_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR12 Mask    */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR13_Pos                        26                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR13 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR13_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR13_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR13 Mask    */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR14_Pos                        28                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR14 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR14_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR14_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR14 Mask    */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR15_Pos                        30                                                        /*!< SCT OUTPUTDIRCTRL: SETCLR15 Position */\r
+#define SCT_OUTPUTDIRCTRL_SETCLR15_Msk                        (0x03UL << SCT_OUTPUTDIRCTRL_SETCLR15_Pos)                /*!< SCT OUTPUTDIRCTRL: SETCLR15 Mask    */\r
+\r
+// -----------------------------------------  SCT_RES  --------------------------------------------\r
+#define SCT_RES_O0RES_Pos                                     0                                                         /*!< SCT RES: O0RES Position             */\r
+#define SCT_RES_O0RES_Msk                                     (0x03UL << SCT_RES_O0RES_Pos)                             /*!< SCT RES: O0RES Mask                 */\r
+#define SCT_RES_O1RES_Pos                                     2                                                         /*!< SCT RES: O1RES Position             */\r
+#define SCT_RES_O1RES_Msk                                     (0x03UL << SCT_RES_O1RES_Pos)                             /*!< SCT RES: O1RES Mask                 */\r
+#define SCT_RES_O2RES_Pos                                     4                                                         /*!< SCT RES: O2RES Position             */\r
+#define SCT_RES_O2RES_Msk                                     (0x03UL << SCT_RES_O2RES_Pos)                             /*!< SCT RES: O2RES Mask                 */\r
+#define SCT_RES_O3RES_Pos                                     6                                                         /*!< SCT RES: O3RES Position             */\r
+#define SCT_RES_O3RES_Msk                                     (0x03UL << SCT_RES_O3RES_Pos)                             /*!< SCT RES: O3RES Mask                 */\r
+#define SCT_RES_O4RES_Pos                                     8                                                         /*!< SCT RES: O4RES Position             */\r
+#define SCT_RES_O4RES_Msk                                     (0x03UL << SCT_RES_O4RES_Pos)                             /*!< SCT RES: O4RES Mask                 */\r
+#define SCT_RES_O5RES_Pos                                     10                                                        /*!< SCT RES: O5RES Position             */\r
+#define SCT_RES_O5RES_Msk                                     (0x03UL << SCT_RES_O5RES_Pos)                             /*!< SCT RES: O5RES Mask                 */\r
+#define SCT_RES_O6RES_Pos                                     12                                                        /*!< SCT RES: O6RES Position             */\r
+#define SCT_RES_O6RES_Msk                                     (0x03UL << SCT_RES_O6RES_Pos)                             /*!< SCT RES: O6RES Mask                 */\r
+#define SCT_RES_O7RES_Pos                                     14                                                        /*!< SCT RES: O7RES Position             */\r
+#define SCT_RES_O7RES_Msk                                     (0x03UL << SCT_RES_O7RES_Pos)                             /*!< SCT RES: O7RES Mask                 */\r
+#define SCT_RES_O8RES_Pos                                     16                                                        /*!< SCT RES: O8RES Position             */\r
+#define SCT_RES_O8RES_Msk                                     (0x03UL << SCT_RES_O8RES_Pos)                             /*!< SCT RES: O8RES Mask                 */\r
+#define SCT_RES_O9RES_Pos                                     18                                                        /*!< SCT RES: O9RES Position             */\r
+#define SCT_RES_O9RES_Msk                                     (0x03UL << SCT_RES_O9RES_Pos)                             /*!< SCT RES: O9RES Mask                 */\r
+#define SCT_RES_O10RES_Pos                                    20                                                        /*!< SCT RES: O10RES Position            */\r
+#define SCT_RES_O10RES_Msk                                    (0x03UL << SCT_RES_O10RES_Pos)                            /*!< SCT RES: O10RES Mask                */\r
+#define SCT_RES_O11RES_Pos                                    22                                                        /*!< SCT RES: O11RES Position            */\r
+#define SCT_RES_O11RES_Msk                                    (0x03UL << SCT_RES_O11RES_Pos)                            /*!< SCT RES: O11RES Mask                */\r
+#define SCT_RES_O12RES_Pos                                    24                                                        /*!< SCT RES: O12RES Position            */\r
+#define SCT_RES_O12RES_Msk                                    (0x03UL << SCT_RES_O12RES_Pos)                            /*!< SCT RES: O12RES Mask                */\r
+#define SCT_RES_O13RES_Pos                                    26                                                        /*!< SCT RES: O13RES Position            */\r
+#define SCT_RES_O13RES_Msk                                    (0x03UL << SCT_RES_O13RES_Pos)                            /*!< SCT RES: O13RES Mask                */\r
+#define SCT_RES_O14RES_Pos                                    28                                                        /*!< SCT RES: O14RES Position            */\r
+#define SCT_RES_O14RES_Msk                                    (0x03UL << SCT_RES_O14RES_Pos)                            /*!< SCT RES: O14RES Mask                */\r
+#define SCT_RES_O15RES_Pos                                    30                                                        /*!< SCT RES: O15RES Position            */\r
+#define SCT_RES_O15RES_Msk                                    (0x03UL << SCT_RES_O15RES_Pos)                            /*!< SCT RES: O15RES Mask                */\r
+\r
+// ---------------------------------------  SCT_DMAREQ0  ------------------------------------------\r
+#define SCT_DMAREQ0_DEV_0_0_Pos                               0                                                         /*!< SCT DMAREQ0: DEV_0_0 Position       */\r
+#define SCT_DMAREQ0_DEV_0_0_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_0_Pos)                       /*!< SCT DMAREQ0: DEV_0_0 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_1_Pos                               1                                                         /*!< SCT DMAREQ0: DEV_0_1 Position       */\r
+#define SCT_DMAREQ0_DEV_0_1_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_1_Pos)                       /*!< SCT DMAREQ0: DEV_0_1 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_2_Pos                               2                                                         /*!< SCT DMAREQ0: DEV_0_2 Position       */\r
+#define SCT_DMAREQ0_DEV_0_2_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_2_Pos)                       /*!< SCT DMAREQ0: DEV_0_2 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_3_Pos                               3                                                         /*!< SCT DMAREQ0: DEV_0_3 Position       */\r
+#define SCT_DMAREQ0_DEV_0_3_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_3_Pos)                       /*!< SCT DMAREQ0: DEV_0_3 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_4_Pos                               4                                                         /*!< SCT DMAREQ0: DEV_0_4 Position       */\r
+#define SCT_DMAREQ0_DEV_0_4_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_4_Pos)                       /*!< SCT DMAREQ0: DEV_0_4 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_5_Pos                               5                                                         /*!< SCT DMAREQ0: DEV_0_5 Position       */\r
+#define SCT_DMAREQ0_DEV_0_5_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_5_Pos)                       /*!< SCT DMAREQ0: DEV_0_5 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_6_Pos                               6                                                         /*!< SCT DMAREQ0: DEV_0_6 Position       */\r
+#define SCT_DMAREQ0_DEV_0_6_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_6_Pos)                       /*!< SCT DMAREQ0: DEV_0_6 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_7_Pos                               7                                                         /*!< SCT DMAREQ0: DEV_0_7 Position       */\r
+#define SCT_DMAREQ0_DEV_0_7_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_7_Pos)                       /*!< SCT DMAREQ0: DEV_0_7 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_8_Pos                               8                                                         /*!< SCT DMAREQ0: DEV_0_8 Position       */\r
+#define SCT_DMAREQ0_DEV_0_8_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_8_Pos)                       /*!< SCT DMAREQ0: DEV_0_8 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_9_Pos                               9                                                         /*!< SCT DMAREQ0: DEV_0_9 Position       */\r
+#define SCT_DMAREQ0_DEV_0_9_Msk                               (0x01UL << SCT_DMAREQ0_DEV_0_9_Pos)                       /*!< SCT DMAREQ0: DEV_0_9 Mask           */\r
+#define SCT_DMAREQ0_DEV_0_10_Pos                              10                                                        /*!< SCT DMAREQ0: DEV_0_10 Position      */\r
+#define SCT_DMAREQ0_DEV_0_10_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_10_Pos)                      /*!< SCT DMAREQ0: DEV_0_10 Mask          */\r
+#define SCT_DMAREQ0_DEV_0_11_Pos                              11                                                        /*!< SCT DMAREQ0: DEV_0_11 Position      */\r
+#define SCT_DMAREQ0_DEV_0_11_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_11_Pos)                      /*!< SCT DMAREQ0: DEV_0_11 Mask          */\r
+#define SCT_DMAREQ0_DEV_0_12_Pos                              12                                                        /*!< SCT DMAREQ0: DEV_0_12 Position      */\r
+#define SCT_DMAREQ0_DEV_0_12_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_12_Pos)                      /*!< SCT DMAREQ0: DEV_0_12 Mask          */\r
+#define SCT_DMAREQ0_DEV_0_13_Pos                              13                                                        /*!< SCT DMAREQ0: DEV_0_13 Position      */\r
+#define SCT_DMAREQ0_DEV_0_13_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_13_Pos)                      /*!< SCT DMAREQ0: DEV_0_13 Mask          */\r
+#define SCT_DMAREQ0_DEV_0_14_Pos                              14                                                        /*!< SCT DMAREQ0: DEV_0_14 Position      */\r
+#define SCT_DMAREQ0_DEV_0_14_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_14_Pos)                      /*!< SCT DMAREQ0: DEV_0_14 Mask          */\r
+#define SCT_DMAREQ0_DEV_0_15_Pos                              15                                                        /*!< SCT DMAREQ0: DEV_0_15 Position      */\r
+#define SCT_DMAREQ0_DEV_0_15_Msk                              (0x01UL << SCT_DMAREQ0_DEV_0_15_Pos)                      /*!< SCT DMAREQ0: DEV_0_15 Mask          */\r
+#define SCT_DMAREQ0_DRL0_Pos                                  30                                                        /*!< SCT DMAREQ0: DRL0 Position          */\r
+#define SCT_DMAREQ0_DRL0_Msk                                  (0x01UL << SCT_DMAREQ0_DRL0_Pos)                          /*!< SCT DMAREQ0: DRL0 Mask              */\r
+#define SCT_DMAREQ0_DRQ0_Pos                                  31                                                        /*!< SCT DMAREQ0: DRQ0 Position          */\r
+#define SCT_DMAREQ0_DRQ0_Msk                                  (0x01UL << SCT_DMAREQ0_DRQ0_Pos)                          /*!< SCT DMAREQ0: DRQ0 Mask              */\r
+\r
+// ---------------------------------------  SCT_DMAREQ1  ------------------------------------------\r
+#define SCT_DMAREQ1_DEV_1_0_Pos                               0                                                         /*!< SCT DMAREQ1: DEV_1_0 Position       */\r
+#define SCT_DMAREQ1_DEV_1_0_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_0_Pos)                       /*!< SCT DMAREQ1: DEV_1_0 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_1_Pos                               1                                                         /*!< SCT DMAREQ1: DEV_1_1 Position       */\r
+#define SCT_DMAREQ1_DEV_1_1_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_1_Pos)                       /*!< SCT DMAREQ1: DEV_1_1 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_2_Pos                               2                                                         /*!< SCT DMAREQ1: DEV_1_2 Position       */\r
+#define SCT_DMAREQ1_DEV_1_2_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_2_Pos)                       /*!< SCT DMAREQ1: DEV_1_2 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_3_Pos                               3                                                         /*!< SCT DMAREQ1: DEV_1_3 Position       */\r
+#define SCT_DMAREQ1_DEV_1_3_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_3_Pos)                       /*!< SCT DMAREQ1: DEV_1_3 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_4_Pos                               4                                                         /*!< SCT DMAREQ1: DEV_1_4 Position       */\r
+#define SCT_DMAREQ1_DEV_1_4_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_4_Pos)                       /*!< SCT DMAREQ1: DEV_1_4 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_5_Pos                               5                                                         /*!< SCT DMAREQ1: DEV_1_5 Position       */\r
+#define SCT_DMAREQ1_DEV_1_5_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_5_Pos)                       /*!< SCT DMAREQ1: DEV_1_5 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_6_Pos                               6                                                         /*!< SCT DMAREQ1: DEV_1_6 Position       */\r
+#define SCT_DMAREQ1_DEV_1_6_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_6_Pos)                       /*!< SCT DMAREQ1: DEV_1_6 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_7_Pos                               7                                                         /*!< SCT DMAREQ1: DEV_1_7 Position       */\r
+#define SCT_DMAREQ1_DEV_1_7_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_7_Pos)                       /*!< SCT DMAREQ1: DEV_1_7 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_8_Pos                               8                                                         /*!< SCT DMAREQ1: DEV_1_8 Position       */\r
+#define SCT_DMAREQ1_DEV_1_8_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_8_Pos)                       /*!< SCT DMAREQ1: DEV_1_8 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_9_Pos                               9                                                         /*!< SCT DMAREQ1: DEV_1_9 Position       */\r
+#define SCT_DMAREQ1_DEV_1_9_Msk                               (0x01UL << SCT_DMAREQ1_DEV_1_9_Pos)                       /*!< SCT DMAREQ1: DEV_1_9 Mask           */\r
+#define SCT_DMAREQ1_DEV_1_10_Pos                              10                                                        /*!< SCT DMAREQ1: DEV_1_10 Position      */\r
+#define SCT_DMAREQ1_DEV_1_10_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_10_Pos)                      /*!< SCT DMAREQ1: DEV_1_10 Mask          */\r
+#define SCT_DMAREQ1_DEV_1_11_Pos                              11                                                        /*!< SCT DMAREQ1: DEV_1_11 Position      */\r
+#define SCT_DMAREQ1_DEV_1_11_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_11_Pos)                      /*!< SCT DMAREQ1: DEV_1_11 Mask          */\r
+#define SCT_DMAREQ1_DEV_1_12_Pos                              12                                                        /*!< SCT DMAREQ1: DEV_1_12 Position      */\r
+#define SCT_DMAREQ1_DEV_1_12_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_12_Pos)                      /*!< SCT DMAREQ1: DEV_1_12 Mask          */\r
+#define SCT_DMAREQ1_DEV_1_13_Pos                              13                                                        /*!< SCT DMAREQ1: DEV_1_13 Position      */\r
+#define SCT_DMAREQ1_DEV_1_13_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_13_Pos)                      /*!< SCT DMAREQ1: DEV_1_13 Mask          */\r
+#define SCT_DMAREQ1_DEV_1_14_Pos                              14                                                        /*!< SCT DMAREQ1: DEV_1_14 Position      */\r
+#define SCT_DMAREQ1_DEV_1_14_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_14_Pos)                      /*!< SCT DMAREQ1: DEV_1_14 Mask          */\r
+#define SCT_DMAREQ1_DEV_1_15_Pos                              15                                                        /*!< SCT DMAREQ1: DEV_1_15 Position      */\r
+#define SCT_DMAREQ1_DEV_1_15_Msk                              (0x01UL << SCT_DMAREQ1_DEV_1_15_Pos)                      /*!< SCT DMAREQ1: DEV_1_15 Mask          */\r
+#define SCT_DMAREQ1_DRL1_Pos                                  30                                                        /*!< SCT DMAREQ1: DRL1 Position          */\r
+#define SCT_DMAREQ1_DRL1_Msk                                  (0x01UL << SCT_DMAREQ1_DRL1_Pos)                          /*!< SCT DMAREQ1: DRL1 Mask              */\r
+#define SCT_DMAREQ1_DRQ1_Pos                                  31                                                        /*!< SCT DMAREQ1: DRQ1 Position          */\r
+#define SCT_DMAREQ1_DRQ1_Msk                                  (0x01UL << SCT_DMAREQ1_DRQ1_Pos)                          /*!< SCT DMAREQ1: DRQ1 Mask              */\r
+\r
+// ----------------------------------------  SCT_EVEN  --------------------------------------------\r
+#define SCT_EVEN_IEN0_Pos                                     0                                                         /*!< SCT EVEN: IEN0 Position             */\r
+#define SCT_EVEN_IEN0_Msk                                     (0x01UL << SCT_EVEN_IEN0_Pos)                             /*!< SCT EVEN: IEN0 Mask                 */\r
+#define SCT_EVEN_IEN1_Pos                                     1                                                         /*!< SCT EVEN: IEN1 Position             */\r
+#define SCT_EVEN_IEN1_Msk                                     (0x01UL << SCT_EVEN_IEN1_Pos)                             /*!< SCT EVEN: IEN1 Mask                 */\r
+#define SCT_EVEN_IEN2_Pos                                     2                                                         /*!< SCT EVEN: IEN2 Position             */\r
+#define SCT_EVEN_IEN2_Msk                                     (0x01UL << SCT_EVEN_IEN2_Pos)                             /*!< SCT EVEN: IEN2 Mask                 */\r
+#define SCT_EVEN_IEN3_Pos                                     3                                                         /*!< SCT EVEN: IEN3 Position             */\r
+#define SCT_EVEN_IEN3_Msk                                     (0x01UL << SCT_EVEN_IEN3_Pos)                             /*!< SCT EVEN: IEN3 Mask                 */\r
+#define SCT_EVEN_IEN4_Pos                                     4                                                         /*!< SCT EVEN: IEN4 Position             */\r
+#define SCT_EVEN_IEN4_Msk                                     (0x01UL << SCT_EVEN_IEN4_Pos)                             /*!< SCT EVEN: IEN4 Mask                 */\r
+#define SCT_EVEN_IEN5_Pos                                     5                                                         /*!< SCT EVEN: IEN5 Position             */\r
+#define SCT_EVEN_IEN5_Msk                                     (0x01UL << SCT_EVEN_IEN5_Pos)                             /*!< SCT EVEN: IEN5 Mask                 */\r
+#define SCT_EVEN_IEN6_Pos                                     6                                                         /*!< SCT EVEN: IEN6 Position             */\r
+#define SCT_EVEN_IEN6_Msk                                     (0x01UL << SCT_EVEN_IEN6_Pos)                             /*!< SCT EVEN: IEN6 Mask                 */\r
+#define SCT_EVEN_IEN7_Pos                                     7                                                         /*!< SCT EVEN: IEN7 Position             */\r
+#define SCT_EVEN_IEN7_Msk                                     (0x01UL << SCT_EVEN_IEN7_Pos)                             /*!< SCT EVEN: IEN7 Mask                 */\r
+#define SCT_EVEN_IEN8_Pos                                     8                                                         /*!< SCT EVEN: IEN8 Position             */\r
+#define SCT_EVEN_IEN8_Msk                                     (0x01UL << SCT_EVEN_IEN8_Pos)                             /*!< SCT EVEN: IEN8 Mask                 */\r
+#define SCT_EVEN_IEN9_Pos                                     9                                                         /*!< SCT EVEN: IEN9 Position             */\r
+#define SCT_EVEN_IEN9_Msk                                     (0x01UL << SCT_EVEN_IEN9_Pos)                             /*!< SCT EVEN: IEN9 Mask                 */\r
+#define SCT_EVEN_IEN10_Pos                                    10                                                        /*!< SCT EVEN: IEN10 Position            */\r
+#define SCT_EVEN_IEN10_Msk                                    (0x01UL << SCT_EVEN_IEN10_Pos)                            /*!< SCT EVEN: IEN10 Mask                */\r
+#define SCT_EVEN_IEN11_Pos                                    11                                                        /*!< SCT EVEN: IEN11 Position            */\r
+#define SCT_EVEN_IEN11_Msk                                    (0x01UL << SCT_EVEN_IEN11_Pos)                            /*!< SCT EVEN: IEN11 Mask                */\r
+#define SCT_EVEN_IEN12_Pos                                    12                                                        /*!< SCT EVEN: IEN12 Position            */\r
+#define SCT_EVEN_IEN12_Msk                                    (0x01UL << SCT_EVEN_IEN12_Pos)                            /*!< SCT EVEN: IEN12 Mask                */\r
+#define SCT_EVEN_IEN13_Pos                                    13                                                        /*!< SCT EVEN: IEN13 Position            */\r
+#define SCT_EVEN_IEN13_Msk                                    (0x01UL << SCT_EVEN_IEN13_Pos)                            /*!< SCT EVEN: IEN13 Mask                */\r
+#define SCT_EVEN_IEN14_Pos                                    14                                                        /*!< SCT EVEN: IEN14 Position            */\r
+#define SCT_EVEN_IEN14_Msk                                    (0x01UL << SCT_EVEN_IEN14_Pos)                            /*!< SCT EVEN: IEN14 Mask                */\r
+#define SCT_EVEN_IEN15_Pos                                    15                                                        /*!< SCT EVEN: IEN15 Position            */\r
+#define SCT_EVEN_IEN15_Msk                                    (0x01UL << SCT_EVEN_IEN15_Pos)                            /*!< SCT EVEN: IEN15 Mask                */\r
+\r
+// ---------------------------------------  SCT_EVFLAG  -------------------------------------------\r
+#define SCT_EVFLAG_FLAG0_Pos                                  0                                                         /*!< SCT EVFLAG: FLAG0 Position          */\r
+#define SCT_EVFLAG_FLAG0_Msk                                  (0x01UL << SCT_EVFLAG_FLAG0_Pos)                          /*!< SCT EVFLAG: FLAG0 Mask              */\r
+#define SCT_EVFLAG_FLAG1_Pos                                  1                                                         /*!< SCT EVFLAG: FLAG1 Position          */\r
+#define SCT_EVFLAG_FLAG1_Msk                                  (0x01UL << SCT_EVFLAG_FLAG1_Pos)                          /*!< SCT EVFLAG: FLAG1 Mask              */\r
+#define SCT_EVFLAG_FLAG2_Pos                                  2                                                         /*!< SCT EVFLAG: FLAG2 Position          */\r
+#define SCT_EVFLAG_FLAG2_Msk                                  (0x01UL << SCT_EVFLAG_FLAG2_Pos)                          /*!< SCT EVFLAG: FLAG2 Mask              */\r
+#define SCT_EVFLAG_FLAG3_Pos                                  3                                                         /*!< SCT EVFLAG: FLAG3 Position          */\r
+#define SCT_EVFLAG_FLAG3_Msk                                  (0x01UL << SCT_EVFLAG_FLAG3_Pos)                          /*!< SCT EVFLAG: FLAG3 Mask              */\r
+#define SCT_EVFLAG_FLAG4_Pos                                  4                                                         /*!< SCT EVFLAG: FLAG4 Position          */\r
+#define SCT_EVFLAG_FLAG4_Msk                                  (0x01UL << SCT_EVFLAG_FLAG4_Pos)                          /*!< SCT EVFLAG: FLAG4 Mask              */\r
+#define SCT_EVFLAG_FLAG5_Pos                                  5                                                         /*!< SCT EVFLAG: FLAG5 Position          */\r
+#define SCT_EVFLAG_FLAG5_Msk                                  (0x01UL << SCT_EVFLAG_FLAG5_Pos)                          /*!< SCT EVFLAG: FLAG5 Mask              */\r
+#define SCT_EVFLAG_FLAG6_Pos                                  6                                                         /*!< SCT EVFLAG: FLAG6 Position          */\r
+#define SCT_EVFLAG_FLAG6_Msk                                  (0x01UL << SCT_EVFLAG_FLAG6_Pos)                          /*!< SCT EVFLAG: FLAG6 Mask              */\r
+#define SCT_EVFLAG_FLAG7_Pos                                  7                                                         /*!< SCT EVFLAG: FLAG7 Position          */\r
+#define SCT_EVFLAG_FLAG7_Msk                                  (0x01UL << SCT_EVFLAG_FLAG7_Pos)                          /*!< SCT EVFLAG: FLAG7 Mask              */\r
+#define SCT_EVFLAG_FLAG8_Pos                                  8                                                         /*!< SCT EVFLAG: FLAG8 Position          */\r
+#define SCT_EVFLAG_FLAG8_Msk                                  (0x01UL << SCT_EVFLAG_FLAG8_Pos)                          /*!< SCT EVFLAG: FLAG8 Mask              */\r
+#define SCT_EVFLAG_FLAG9_Pos                                  9                                                         /*!< SCT EVFLAG: FLAG9 Position          */\r
+#define SCT_EVFLAG_FLAG9_Msk                                  (0x01UL << SCT_EVFLAG_FLAG9_Pos)                          /*!< SCT EVFLAG: FLAG9 Mask              */\r
+#define SCT_EVFLAG_FLAG10_Pos                                 10                                                        /*!< SCT EVFLAG: FLAG10 Position         */\r
+#define SCT_EVFLAG_FLAG10_Msk                                 (0x01UL << SCT_EVFLAG_FLAG10_Pos)                         /*!< SCT EVFLAG: FLAG10 Mask             */\r
+#define SCT_EVFLAG_FLAG11_Pos                                 11                                                        /*!< SCT EVFLAG: FLAG11 Position         */\r
+#define SCT_EVFLAG_FLAG11_Msk                                 (0x01UL << SCT_EVFLAG_FLAG11_Pos)                         /*!< SCT EVFLAG: FLAG11 Mask             */\r
+#define SCT_EVFLAG_FLAG12_Pos                                 12                                                        /*!< SCT EVFLAG: FLAG12 Position         */\r
+#define SCT_EVFLAG_FLAG12_Msk                                 (0x01UL << SCT_EVFLAG_FLAG12_Pos)                         /*!< SCT EVFLAG: FLAG12 Mask             */\r
+#define SCT_EVFLAG_FLAG13_Pos                                 13                                                        /*!< SCT EVFLAG: FLAG13 Position         */\r
+#define SCT_EVFLAG_FLAG13_Msk                                 (0x01UL << SCT_EVFLAG_FLAG13_Pos)                         /*!< SCT EVFLAG: FLAG13 Mask             */\r
+#define SCT_EVFLAG_FLAG14_Pos                                 14                                                        /*!< SCT EVFLAG: FLAG14 Position         */\r
+#define SCT_EVFLAG_FLAG14_Msk                                 (0x01UL << SCT_EVFLAG_FLAG14_Pos)                         /*!< SCT EVFLAG: FLAG14 Mask             */\r
+#define SCT_EVFLAG_FLAG15_Pos                                 15                                                        /*!< SCT EVFLAG: FLAG15 Position         */\r
+#define SCT_EVFLAG_FLAG15_Msk                                 (0x01UL << SCT_EVFLAG_FLAG15_Pos)                         /*!< SCT EVFLAG: FLAG15 Mask             */\r
+\r
+// ----------------------------------------  SCT_CONEN  -------------------------------------------\r
+#define SCT_CONEN_NCEN0_Pos                                   0                                                         /*!< SCT CONEN: NCEN0 Position           */\r
+#define SCT_CONEN_NCEN0_Msk                                   (0x01UL << SCT_CONEN_NCEN0_Pos)                           /*!< SCT CONEN: NCEN0 Mask               */\r
+#define SCT_CONEN_NCEN1_Pos                                   1                                                         /*!< SCT CONEN: NCEN1 Position           */\r
+#define SCT_CONEN_NCEN1_Msk                                   (0x01UL << SCT_CONEN_NCEN1_Pos)                           /*!< SCT CONEN: NCEN1 Mask               */\r
+#define SCT_CONEN_NCEN2_Pos                                   2                                                         /*!< SCT CONEN: NCEN2 Position           */\r
+#define SCT_CONEN_NCEN2_Msk                                   (0x01UL << SCT_CONEN_NCEN2_Pos)                           /*!< SCT CONEN: NCEN2 Mask               */\r
+#define SCT_CONEN_NCEN3_Pos                                   3                                                         /*!< SCT CONEN: NCEN3 Position           */\r
+#define SCT_CONEN_NCEN3_Msk                                   (0x01UL << SCT_CONEN_NCEN3_Pos)                           /*!< SCT CONEN: NCEN3 Mask               */\r
+#define SCT_CONEN_NCEN4_Pos                                   4                                                         /*!< SCT CONEN: NCEN4 Position           */\r
+#define SCT_CONEN_NCEN4_Msk                                   (0x01UL << SCT_CONEN_NCEN4_Pos)                           /*!< SCT CONEN: NCEN4 Mask               */\r
+#define SCT_CONEN_NCEN5_Pos                                   5                                                         /*!< SCT CONEN: NCEN5 Position           */\r
+#define SCT_CONEN_NCEN5_Msk                                   (0x01UL << SCT_CONEN_NCEN5_Pos)                           /*!< SCT CONEN: NCEN5 Mask               */\r
+#define SCT_CONEN_NCEN6_Pos                                   6                                                         /*!< SCT CONEN: NCEN6 Position           */\r
+#define SCT_CONEN_NCEN6_Msk                                   (0x01UL << SCT_CONEN_NCEN6_Pos)                           /*!< SCT CONEN: NCEN6 Mask               */\r
+#define SCT_CONEN_NCEN7_Pos                                   7                                                         /*!< SCT CONEN: NCEN7 Position           */\r
+#define SCT_CONEN_NCEN7_Msk                                   (0x01UL << SCT_CONEN_NCEN7_Pos)                           /*!< SCT CONEN: NCEN7 Mask               */\r
+#define SCT_CONEN_NCEN8_Pos                                   8                                                         /*!< SCT CONEN: NCEN8 Position           */\r
+#define SCT_CONEN_NCEN8_Msk                                   (0x01UL << SCT_CONEN_NCEN8_Pos)                           /*!< SCT CONEN: NCEN8 Mask               */\r
+#define SCT_CONEN_NCEN9_Pos                                   9                                                         /*!< SCT CONEN: NCEN9 Position           */\r
+#define SCT_CONEN_NCEN9_Msk                                   (0x01UL << SCT_CONEN_NCEN9_Pos)                           /*!< SCT CONEN: NCEN9 Mask               */\r
+#define SCT_CONEN_NCEN10_Pos                                  10                                                        /*!< SCT CONEN: NCEN10 Position          */\r
+#define SCT_CONEN_NCEN10_Msk                                  (0x01UL << SCT_CONEN_NCEN10_Pos)                          /*!< SCT CONEN: NCEN10 Mask              */\r
+#define SCT_CONEN_NCEN11_Pos                                  11                                                        /*!< SCT CONEN: NCEN11 Position          */\r
+#define SCT_CONEN_NCEN11_Msk                                  (0x01UL << SCT_CONEN_NCEN11_Pos)                          /*!< SCT CONEN: NCEN11 Mask              */\r
+#define SCT_CONEN_NCEN12_Pos                                  12                                                        /*!< SCT CONEN: NCEN12 Position          */\r
+#define SCT_CONEN_NCEN12_Msk                                  (0x01UL << SCT_CONEN_NCEN12_Pos)                          /*!< SCT CONEN: NCEN12 Mask              */\r
+#define SCT_CONEN_NCEN13_Pos                                  13                                                        /*!< SCT CONEN: NCEN13 Position          */\r
+#define SCT_CONEN_NCEN13_Msk                                  (0x01UL << SCT_CONEN_NCEN13_Pos)                          /*!< SCT CONEN: NCEN13 Mask              */\r
+#define SCT_CONEN_NCEN14_Pos                                  14                                                        /*!< SCT CONEN: NCEN14 Position          */\r
+#define SCT_CONEN_NCEN14_Msk                                  (0x01UL << SCT_CONEN_NCEN14_Pos)                          /*!< SCT CONEN: NCEN14 Mask              */\r
+#define SCT_CONEN_NCEN15_Pos                                  15                                                        /*!< SCT CONEN: NCEN15 Position          */\r
+#define SCT_CONEN_NCEN15_Msk                                  (0x01UL << SCT_CONEN_NCEN15_Pos)                          /*!< SCT CONEN: NCEN15 Mask              */\r
+\r
+// ---------------------------------------  SCT_CONFLAG  ------------------------------------------\r
+#define SCT_CONFLAG_NCFLAG0_Pos                               0                                                         /*!< SCT CONFLAG: NCFLAG0 Position       */\r
+#define SCT_CONFLAG_NCFLAG0_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG0_Pos)                       /*!< SCT CONFLAG: NCFLAG0 Mask           */\r
+#define SCT_CONFLAG_NCFLAG1_Pos                               1                                                         /*!< SCT CONFLAG: NCFLAG1 Position       */\r
+#define SCT_CONFLAG_NCFLAG1_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG1_Pos)                       /*!< SCT CONFLAG: NCFLAG1 Mask           */\r
+#define SCT_CONFLAG_NCFLAG2_Pos                               2                                                         /*!< SCT CONFLAG: NCFLAG2 Position       */\r
+#define SCT_CONFLAG_NCFLAG2_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG2_Pos)                       /*!< SCT CONFLAG: NCFLAG2 Mask           */\r
+#define SCT_CONFLAG_NCFLAG3_Pos                               3                                                         /*!< SCT CONFLAG: NCFLAG3 Position       */\r
+#define SCT_CONFLAG_NCFLAG3_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG3_Pos)                       /*!< SCT CONFLAG: NCFLAG3 Mask           */\r
+#define SCT_CONFLAG_NCFLAG4_Pos                               4                                                         /*!< SCT CONFLAG: NCFLAG4 Position       */\r
+#define SCT_CONFLAG_NCFLAG4_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG4_Pos)                       /*!< SCT CONFLAG: NCFLAG4 Mask           */\r
+#define SCT_CONFLAG_NCFLAG5_Pos                               5                                                         /*!< SCT CONFLAG: NCFLAG5 Position       */\r
+#define SCT_CONFLAG_NCFLAG5_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG5_Pos)                       /*!< SCT CONFLAG: NCFLAG5 Mask           */\r
+#define SCT_CONFLAG_NCFLAG6_Pos                               6                                                         /*!< SCT CONFLAG: NCFLAG6 Position       */\r
+#define SCT_CONFLAG_NCFLAG6_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG6_Pos)                       /*!< SCT CONFLAG: NCFLAG6 Mask           */\r
+#define SCT_CONFLAG_NCFLAG7_Pos                               7                                                         /*!< SCT CONFLAG: NCFLAG7 Position       */\r
+#define SCT_CONFLAG_NCFLAG7_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG7_Pos)                       /*!< SCT CONFLAG: NCFLAG7 Mask           */\r
+#define SCT_CONFLAG_NCFLAG8_Pos                               8                                                         /*!< SCT CONFLAG: NCFLAG8 Position       */\r
+#define SCT_CONFLAG_NCFLAG8_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG8_Pos)                       /*!< SCT CONFLAG: NCFLAG8 Mask           */\r
+#define SCT_CONFLAG_NCFLAG9_Pos                               9                                                         /*!< SCT CONFLAG: NCFLAG9 Position       */\r
+#define SCT_CONFLAG_NCFLAG9_Msk                               (0x01UL << SCT_CONFLAG_NCFLAG9_Pos)                       /*!< SCT CONFLAG: NCFLAG9 Mask           */\r
+#define SCT_CONFLAG_NCFLAG10_Pos                              10                                                        /*!< SCT CONFLAG: NCFLAG10 Position      */\r
+#define SCT_CONFLAG_NCFLAG10_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG10_Pos)                      /*!< SCT CONFLAG: NCFLAG10 Mask          */\r
+#define SCT_CONFLAG_NCFLAG11_Pos                              11                                                        /*!< SCT CONFLAG: NCFLAG11 Position      */\r
+#define SCT_CONFLAG_NCFLAG11_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG11_Pos)                      /*!< SCT CONFLAG: NCFLAG11 Mask          */\r
+#define SCT_CONFLAG_NCFLAG12_Pos                              12                                                        /*!< SCT CONFLAG: NCFLAG12 Position      */\r
+#define SCT_CONFLAG_NCFLAG12_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG12_Pos)                      /*!< SCT CONFLAG: NCFLAG12 Mask          */\r
+#define SCT_CONFLAG_NCFLAG13_Pos                              13                                                        /*!< SCT CONFLAG: NCFLAG13 Position      */\r
+#define SCT_CONFLAG_NCFLAG13_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG13_Pos)                      /*!< SCT CONFLAG: NCFLAG13 Mask          */\r
+#define SCT_CONFLAG_NCFLAG14_Pos                              14                                                        /*!< SCT CONFLAG: NCFLAG14 Position      */\r
+#define SCT_CONFLAG_NCFLAG14_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG14_Pos)                      /*!< SCT CONFLAG: NCFLAG14 Mask          */\r
+#define SCT_CONFLAG_NCFLAG15_Pos                              15                                                        /*!< SCT CONFLAG: NCFLAG15 Position      */\r
+#define SCT_CONFLAG_NCFLAG15_Msk                              (0x01UL << SCT_CONFLAG_NCFLAG15_Pos)                      /*!< SCT CONFLAG: NCFLAG15 Mask          */\r
+#define SCT_CONFLAG_BUSERRL_Pos                               30                                                        /*!< SCT CONFLAG: BUSERRL Position       */\r
+#define SCT_CONFLAG_BUSERRL_Msk                               (0x01UL << SCT_CONFLAG_BUSERRL_Pos)                       /*!< SCT CONFLAG: BUSERRL Mask           */\r
+#define SCT_CONFLAG_BUSERRH_Pos                               31                                                        /*!< SCT CONFLAG: BUSERRH Position       */\r
+#define SCT_CONFLAG_BUSERRH_Msk                               (0x01UL << SCT_CONFLAG_BUSERRH_Pos)                       /*!< SCT CONFLAG: BUSERRH Mask           */\r
+\r
+// ---------------------------------------  SCT_MATCH0  -------------------------------------------\r
+#define SCT_MATCH0_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH0: MATCHn_L Position       */\r
+#define SCT_MATCH0_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH0_MATCHn_L_Pos)                 /*!< SCT MATCH0: MATCHn_L Mask           */\r
+#define SCT_MATCH0_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH0: MATCHn_H Position       */\r
+#define SCT_MATCH0_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH0_MATCHn_H_Pos)                 /*!< SCT MATCH0: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP0  --------------------------------------------\r
+#define SCT_CAP0_CAPn_L_Pos                                   0                                                         /*!< SCT CAP0: CAPn_L Position           */\r
+#define SCT_CAP0_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP0_CAPn_L_Pos)                     /*!< SCT CAP0: CAPn_L Mask               */\r
+#define SCT_CAP0_CAPn_H_Pos                                   16                                                        /*!< SCT CAP0: CAPn_H Position           */\r
+#define SCT_CAP0_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP0_CAPn_H_Pos)                     /*!< SCT CAP0: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH1  -------------------------------------------\r
+#define SCT_MATCH1_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH1: MATCHn_L Position       */\r
+#define SCT_MATCH1_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH1_MATCHn_L_Pos)                 /*!< SCT MATCH1: MATCHn_L Mask           */\r
+#define SCT_MATCH1_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH1: MATCHn_H Position       */\r
+#define SCT_MATCH1_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH1_MATCHn_H_Pos)                 /*!< SCT MATCH1: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP1  --------------------------------------------\r
+#define SCT_CAP1_CAPn_L_Pos                                   0                                                         /*!< SCT CAP1: CAPn_L Position           */\r
+#define SCT_CAP1_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP1_CAPn_L_Pos)                     /*!< SCT CAP1: CAPn_L Mask               */\r
+#define SCT_CAP1_CAPn_H_Pos                                   16                                                        /*!< SCT CAP1: CAPn_H Position           */\r
+#define SCT_CAP1_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP1_CAPn_H_Pos)                     /*!< SCT CAP1: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH2  -------------------------------------------\r
+#define SCT_MATCH2_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH2: MATCHn_L Position       */\r
+#define SCT_MATCH2_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH2_MATCHn_L_Pos)                 /*!< SCT MATCH2: MATCHn_L Mask           */\r
+#define SCT_MATCH2_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH2: MATCHn_H Position       */\r
+#define SCT_MATCH2_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH2_MATCHn_H_Pos)                 /*!< SCT MATCH2: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP2  --------------------------------------------\r
+#define SCT_CAP2_CAPn_L_Pos                                   0                                                         /*!< SCT CAP2: CAPn_L Position           */\r
+#define SCT_CAP2_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP2_CAPn_L_Pos)                     /*!< SCT CAP2: CAPn_L Mask               */\r
+#define SCT_CAP2_CAPn_H_Pos                                   16                                                        /*!< SCT CAP2: CAPn_H Position           */\r
+#define SCT_CAP2_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP2_CAPn_H_Pos)                     /*!< SCT CAP2: CAPn_H Mask               */\r
+\r
+// ----------------------------------------  SCT_CAP3  --------------------------------------------\r
+#define SCT_CAP3_CAPn_L_Pos                                   0                                                         /*!< SCT CAP3: CAPn_L Position           */\r
+#define SCT_CAP3_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP3_CAPn_L_Pos)                     /*!< SCT CAP3: CAPn_L Mask               */\r
+#define SCT_CAP3_CAPn_H_Pos                                   16                                                        /*!< SCT CAP3: CAPn_H Position           */\r
+#define SCT_CAP3_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP3_CAPn_H_Pos)                     /*!< SCT CAP3: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH3  -------------------------------------------\r
+#define SCT_MATCH3_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH3: MATCHn_L Position       */\r
+#define SCT_MATCH3_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH3_MATCHn_L_Pos)                 /*!< SCT MATCH3: MATCHn_L Mask           */\r
+#define SCT_MATCH3_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH3: MATCHn_H Position       */\r
+#define SCT_MATCH3_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH3_MATCHn_H_Pos)                 /*!< SCT MATCH3: MATCHn_H Mask           */\r
+\r
+// ---------------------------------------  SCT_MATCH4  -------------------------------------------\r
+#define SCT_MATCH4_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH4: MATCHn_L Position       */\r
+#define SCT_MATCH4_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH4_MATCHn_L_Pos)                 /*!< SCT MATCH4: MATCHn_L Mask           */\r
+#define SCT_MATCH4_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH4: MATCHn_H Position       */\r
+#define SCT_MATCH4_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH4_MATCHn_H_Pos)                 /*!< SCT MATCH4: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP4  --------------------------------------------\r
+#define SCT_CAP4_CAPn_L_Pos                                   0                                                         /*!< SCT CAP4: CAPn_L Position           */\r
+#define SCT_CAP4_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP4_CAPn_L_Pos)                     /*!< SCT CAP4: CAPn_L Mask               */\r
+#define SCT_CAP4_CAPn_H_Pos                                   16                                                        /*!< SCT CAP4: CAPn_H Position           */\r
+#define SCT_CAP4_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP4_CAPn_H_Pos)                     /*!< SCT CAP4: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH5  -------------------------------------------\r
+#define SCT_MATCH5_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH5: MATCHn_L Position       */\r
+#define SCT_MATCH5_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH5_MATCHn_L_Pos)                 /*!< SCT MATCH5: MATCHn_L Mask           */\r
+#define SCT_MATCH5_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH5: MATCHn_H Position       */\r
+#define SCT_MATCH5_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH5_MATCHn_H_Pos)                 /*!< SCT MATCH5: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP5  --------------------------------------------\r
+#define SCT_CAP5_CAPn_L_Pos                                   0                                                         /*!< SCT CAP5: CAPn_L Position           */\r
+#define SCT_CAP5_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP5_CAPn_L_Pos)                     /*!< SCT CAP5: CAPn_L Mask               */\r
+#define SCT_CAP5_CAPn_H_Pos                                   16                                                        /*!< SCT CAP5: CAPn_H Position           */\r
+#define SCT_CAP5_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP5_CAPn_H_Pos)                     /*!< SCT CAP5: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH6  -------------------------------------------\r
+#define SCT_MATCH6_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH6: MATCHn_L Position       */\r
+#define SCT_MATCH6_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH6_MATCHn_L_Pos)                 /*!< SCT MATCH6: MATCHn_L Mask           */\r
+#define SCT_MATCH6_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH6: MATCHn_H Position       */\r
+#define SCT_MATCH6_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH6_MATCHn_H_Pos)                 /*!< SCT MATCH6: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP6  --------------------------------------------\r
+#define SCT_CAP6_CAPn_L_Pos                                   0                                                         /*!< SCT CAP6: CAPn_L Position           */\r
+#define SCT_CAP6_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP6_CAPn_L_Pos)                     /*!< SCT CAP6: CAPn_L Mask               */\r
+#define SCT_CAP6_CAPn_H_Pos                                   16                                                        /*!< SCT CAP6: CAPn_H Position           */\r
+#define SCT_CAP6_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP6_CAPn_H_Pos)                     /*!< SCT CAP6: CAPn_H Mask               */\r
+\r
+// ----------------------------------------  SCT_CAP7  --------------------------------------------\r
+#define SCT_CAP7_CAPn_L_Pos                                   0                                                         /*!< SCT CAP7: CAPn_L Position           */\r
+#define SCT_CAP7_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP7_CAPn_L_Pos)                     /*!< SCT CAP7: CAPn_L Mask               */\r
+#define SCT_CAP7_CAPn_H_Pos                                   16                                                        /*!< SCT CAP7: CAPn_H Position           */\r
+#define SCT_CAP7_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP7_CAPn_H_Pos)                     /*!< SCT CAP7: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH7  -------------------------------------------\r
+#define SCT_MATCH7_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH7: MATCHn_L Position       */\r
+#define SCT_MATCH7_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH7_MATCHn_L_Pos)                 /*!< SCT MATCH7: MATCHn_L Mask           */\r
+#define SCT_MATCH7_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH7: MATCHn_H Position       */\r
+#define SCT_MATCH7_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH7_MATCHn_H_Pos)                 /*!< SCT MATCH7: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP8  --------------------------------------------\r
+#define SCT_CAP8_CAPn_L_Pos                                   0                                                         /*!< SCT CAP8: CAPn_L Position           */\r
+#define SCT_CAP8_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP8_CAPn_L_Pos)                     /*!< SCT CAP8: CAPn_L Mask               */\r
+#define SCT_CAP8_CAPn_H_Pos                                   16                                                        /*!< SCT CAP8: CAPn_H Position           */\r
+#define SCT_CAP8_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP8_CAPn_H_Pos)                     /*!< SCT CAP8: CAPn_H Mask               */\r
+\r
+// ---------------------------------------  SCT_MATCH8  -------------------------------------------\r
+#define SCT_MATCH8_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH8: MATCHn_L Position       */\r
+#define SCT_MATCH8_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH8_MATCHn_L_Pos)                 /*!< SCT MATCH8: MATCHn_L Mask           */\r
+#define SCT_MATCH8_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH8: MATCHn_H Position       */\r
+#define SCT_MATCH8_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH8_MATCHn_H_Pos)                 /*!< SCT MATCH8: MATCHn_H Mask           */\r
+\r
+// ---------------------------------------  SCT_MATCH9  -------------------------------------------\r
+#define SCT_MATCH9_MATCHn_L_Pos                               0                                                         /*!< SCT MATCH9: MATCHn_L Position       */\r
+#define SCT_MATCH9_MATCHn_L_Msk                               (0x0000ffffUL << SCT_MATCH9_MATCHn_L_Pos)                 /*!< SCT MATCH9: MATCHn_L Mask           */\r
+#define SCT_MATCH9_MATCHn_H_Pos                               16                                                        /*!< SCT MATCH9: MATCHn_H Position       */\r
+#define SCT_MATCH9_MATCHn_H_Msk                               (0x0000ffffUL << SCT_MATCH9_MATCHn_H_Pos)                 /*!< SCT MATCH9: MATCHn_H Mask           */\r
+\r
+// ----------------------------------------  SCT_CAP9  --------------------------------------------\r
+#define SCT_CAP9_CAPn_L_Pos                                   0                                                         /*!< SCT CAP9: CAPn_L Position           */\r
+#define SCT_CAP9_CAPn_L_Msk                                   (0x0000ffffUL << SCT_CAP9_CAPn_L_Pos)                     /*!< SCT CAP9: CAPn_L Mask               */\r
+#define SCT_CAP9_CAPn_H_Pos                                   16                                                        /*!< SCT CAP9: CAPn_H Position           */\r
+#define SCT_CAP9_CAPn_H_Msk                                   (0x0000ffffUL << SCT_CAP9_CAPn_H_Pos)                     /*!< SCT CAP9: CAPn_H Mask               */\r
+\r
+// ----------------------------------------  SCT_CAP10  -------------------------------------------\r
+#define SCT_CAP10_CAPn_L_Pos                                  0                                                         /*!< SCT CAP10: CAPn_L Position          */\r
+#define SCT_CAP10_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP10_CAPn_L_Pos)                    /*!< SCT CAP10: CAPn_L Mask              */\r
+#define SCT_CAP10_CAPn_H_Pos                                  16                                                        /*!< SCT CAP10: CAPn_H Position          */\r
+#define SCT_CAP10_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP10_CAPn_H_Pos)                    /*!< SCT CAP10: CAPn_H Mask              */\r
+\r
+// ---------------------------------------  SCT_MATCH10  ------------------------------------------\r
+#define SCT_MATCH10_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH10: MATCHn_L Position      */\r
+#define SCT_MATCH10_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH10_MATCHn_L_Pos)                /*!< SCT MATCH10: MATCHn_L Mask          */\r
+#define SCT_MATCH10_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH10: MATCHn_H Position      */\r
+#define SCT_MATCH10_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH10_MATCHn_H_Pos)                /*!< SCT MATCH10: MATCHn_H Mask          */\r
+\r
+// ----------------------------------------  SCT_CAP11  -------------------------------------------\r
+#define SCT_CAP11_CAPn_L_Pos                                  0                                                         /*!< SCT CAP11: CAPn_L Position          */\r
+#define SCT_CAP11_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP11_CAPn_L_Pos)                    /*!< SCT CAP11: CAPn_L Mask              */\r
+#define SCT_CAP11_CAPn_H_Pos                                  16                                                        /*!< SCT CAP11: CAPn_H Position          */\r
+#define SCT_CAP11_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP11_CAPn_H_Pos)                    /*!< SCT CAP11: CAPn_H Mask              */\r
+\r
+// ---------------------------------------  SCT_MATCH11  ------------------------------------------\r
+#define SCT_MATCH11_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH11: MATCHn_L Position      */\r
+#define SCT_MATCH11_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH11_MATCHn_L_Pos)                /*!< SCT MATCH11: MATCHn_L Mask          */\r
+#define SCT_MATCH11_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH11: MATCHn_H Position      */\r
+#define SCT_MATCH11_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH11_MATCHn_H_Pos)                /*!< SCT MATCH11: MATCHn_H Mask          */\r
+\r
+// ---------------------------------------  SCT_MATCH12  ------------------------------------------\r
+#define SCT_MATCH12_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH12: MATCHn_L Position      */\r
+#define SCT_MATCH12_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH12_MATCHn_L_Pos)                /*!< SCT MATCH12: MATCHn_L Mask          */\r
+#define SCT_MATCH12_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH12: MATCHn_H Position      */\r
+#define SCT_MATCH12_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH12_MATCHn_H_Pos)                /*!< SCT MATCH12: MATCHn_H Mask          */\r
+\r
+// ----------------------------------------  SCT_CAP12  -------------------------------------------\r
+#define SCT_CAP12_CAPn_L_Pos                                  0                                                         /*!< SCT CAP12: CAPn_L Position          */\r
+#define SCT_CAP12_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP12_CAPn_L_Pos)                    /*!< SCT CAP12: CAPn_L Mask              */\r
+#define SCT_CAP12_CAPn_H_Pos                                  16                                                        /*!< SCT CAP12: CAPn_H Position          */\r
+#define SCT_CAP12_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP12_CAPn_H_Pos)                    /*!< SCT CAP12: CAPn_H Mask              */\r
+\r
+// ----------------------------------------  SCT_CAP13  -------------------------------------------\r
+#define SCT_CAP13_CAPn_L_Pos                                  0                                                         /*!< SCT CAP13: CAPn_L Position          */\r
+#define SCT_CAP13_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP13_CAPn_L_Pos)                    /*!< SCT CAP13: CAPn_L Mask              */\r
+#define SCT_CAP13_CAPn_H_Pos                                  16                                                        /*!< SCT CAP13: CAPn_H Position          */\r
+#define SCT_CAP13_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP13_CAPn_H_Pos)                    /*!< SCT CAP13: CAPn_H Mask              */\r
+\r
+// ---------------------------------------  SCT_MATCH13  ------------------------------------------\r
+#define SCT_MATCH13_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH13: MATCHn_L Position      */\r
+#define SCT_MATCH13_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH13_MATCHn_L_Pos)                /*!< SCT MATCH13: MATCHn_L Mask          */\r
+#define SCT_MATCH13_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH13: MATCHn_H Position      */\r
+#define SCT_MATCH13_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH13_MATCHn_H_Pos)                /*!< SCT MATCH13: MATCHn_H Mask          */\r
+\r
+// ---------------------------------------  SCT_MATCH14  ------------------------------------------\r
+#define SCT_MATCH14_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH14: MATCHn_L Position      */\r
+#define SCT_MATCH14_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH14_MATCHn_L_Pos)                /*!< SCT MATCH14: MATCHn_L Mask          */\r
+#define SCT_MATCH14_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH14: MATCHn_H Position      */\r
+#define SCT_MATCH14_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH14_MATCHn_H_Pos)                /*!< SCT MATCH14: MATCHn_H Mask          */\r
+\r
+// ----------------------------------------  SCT_CAP14  -------------------------------------------\r
+#define SCT_CAP14_CAPn_L_Pos                                  0                                                         /*!< SCT CAP14: CAPn_L Position          */\r
+#define SCT_CAP14_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP14_CAPn_L_Pos)                    /*!< SCT CAP14: CAPn_L Mask              */\r
+#define SCT_CAP14_CAPn_H_Pos                                  16                                                        /*!< SCT CAP14: CAPn_H Position          */\r
+#define SCT_CAP14_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP14_CAPn_H_Pos)                    /*!< SCT CAP14: CAPn_H Mask              */\r
+\r
+// ---------------------------------------  SCT_MATCH15  ------------------------------------------\r
+#define SCT_MATCH15_MATCHn_L_Pos                              0                                                         /*!< SCT MATCH15: MATCHn_L Position      */\r
+#define SCT_MATCH15_MATCHn_L_Msk                              (0x0000ffffUL << SCT_MATCH15_MATCHn_L_Pos)                /*!< SCT MATCH15: MATCHn_L Mask          */\r
+#define SCT_MATCH15_MATCHn_H_Pos                              16                                                        /*!< SCT MATCH15: MATCHn_H Position      */\r
+#define SCT_MATCH15_MATCHn_H_Msk                              (0x0000ffffUL << SCT_MATCH15_MATCHn_H_Pos)                /*!< SCT MATCH15: MATCHn_H Mask          */\r
+\r
+// ----------------------------------------  SCT_CAP15  -------------------------------------------\r
+#define SCT_CAP15_CAPn_L_Pos                                  0                                                         /*!< SCT CAP15: CAPn_L Position          */\r
+#define SCT_CAP15_CAPn_L_Msk                                  (0x0000ffffUL << SCT_CAP15_CAPn_L_Pos)                    /*!< SCT CAP15: CAPn_L Mask              */\r
+#define SCT_CAP15_CAPn_H_Pos                                  16                                                        /*!< SCT CAP15: CAPn_H Position          */\r
+#define SCT_CAP15_CAPn_H_Msk                                  (0x0000ffffUL << SCT_CAP15_CAPn_H_Pos)                    /*!< SCT CAP15: CAPn_H Mask              */\r
+\r
+// --------------------------------------  SCT_MATCHREL0  -----------------------------------------\r
+#define SCT_MATCHREL0_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL0: RELOADn_L Position   */\r
+#define SCT_MATCHREL0_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL0_RELOADn_L_Pos)             /*!< SCT MATCHREL0: RELOADn_L Mask       */\r
+#define SCT_MATCHREL0_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL0: RELOADn_H Position   */\r
+#define SCT_MATCHREL0_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL0_RELOADn_H_Pos)             /*!< SCT MATCHREL0: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL0  ------------------------------------------\r
+#define SCT_CAPCTRL0_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL0: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL0: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL0: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL0: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL0: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL0: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL0: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL0: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL0: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL0: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL0_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL0_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL0: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL0_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL0: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL0: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL0: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL0: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL0: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL0: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL0_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL0_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL0: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL0_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL0: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL0_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL0_CAPCONn_H_Pos)              /*!< SCT CAPCTRL0: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL1  -----------------------------------------\r
+#define SCT_MATCHREL1_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL1: RELOADn_L Position   */\r
+#define SCT_MATCHREL1_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL1_RELOADn_L_Pos)             /*!< SCT MATCHREL1: RELOADn_L Mask       */\r
+#define SCT_MATCHREL1_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL1: RELOADn_H Position   */\r
+#define SCT_MATCHREL1_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL1_RELOADn_H_Pos)             /*!< SCT MATCHREL1: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL1  ------------------------------------------\r
+#define SCT_CAPCTRL1_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL1: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL1: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL1: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL1: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL1: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL1: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL1: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL1: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL1: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL1: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL1_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL1_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL1: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL1_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL1: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL1: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL1: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL1: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL1: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL1: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL1_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL1_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL1: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL1_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL1: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL1_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL1_CAPCONn_H_Pos)              /*!< SCT CAPCTRL1: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL2  -----------------------------------------\r
+#define SCT_MATCHREL2_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL2: RELOADn_L Position   */\r
+#define SCT_MATCHREL2_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL2_RELOADn_L_Pos)             /*!< SCT MATCHREL2: RELOADn_L Mask       */\r
+#define SCT_MATCHREL2_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL2: RELOADn_H Position   */\r
+#define SCT_MATCHREL2_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL2_RELOADn_H_Pos)             /*!< SCT MATCHREL2: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL2  ------------------------------------------\r
+#define SCT_CAPCTRL2_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL2: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL2: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL2: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL2: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL2: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL2: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL2: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL2: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL2: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL2: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL2_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL2_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL2: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL2_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL2: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL2: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL2: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL2: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL2: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL2: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL2_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL2_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL2: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL2_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL2: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL2_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL2_CAPCONn_H_Pos)              /*!< SCT CAPCTRL2: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL3  -----------------------------------------\r
+#define SCT_MATCHREL3_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL3: RELOADn_L Position   */\r
+#define SCT_MATCHREL3_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL3_RELOADn_L_Pos)             /*!< SCT MATCHREL3: RELOADn_L Mask       */\r
+#define SCT_MATCHREL3_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL3: RELOADn_H Position   */\r
+#define SCT_MATCHREL3_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL3_RELOADn_H_Pos)             /*!< SCT MATCHREL3: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL3  ------------------------------------------\r
+#define SCT_CAPCTRL3_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL3: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL3: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL3: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL3: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL3: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL3: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL3: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL3: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL3: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL3: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL3_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL3_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL3: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL3_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL3: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL3: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL3: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL3: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL3: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL3: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL3_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL3_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL3: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL3_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL3: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL3_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL3_CAPCONn_H_Pos)              /*!< SCT CAPCTRL3: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_CAPCTRL4  ------------------------------------------\r
+#define SCT_CAPCTRL4_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL4: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL4: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL4: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL4: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL4: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL4: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL4: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL4: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL4: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL4: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL4_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL4_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL4: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL4_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL4: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL4: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL4: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL4: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL4: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL4: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL4_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL4_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL4: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL4_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL4: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL4_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL4_CAPCONn_H_Pos)              /*!< SCT CAPCTRL4: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL4  -----------------------------------------\r
+#define SCT_MATCHREL4_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL4: RELOADn_L Position   */\r
+#define SCT_MATCHREL4_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL4_RELOADn_L_Pos)             /*!< SCT MATCHREL4: RELOADn_L Mask       */\r
+#define SCT_MATCHREL4_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL4: RELOADn_H Position   */\r
+#define SCT_MATCHREL4_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL4_RELOADn_H_Pos)             /*!< SCT MATCHREL4: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL5  ------------------------------------------\r
+#define SCT_CAPCTRL5_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL5: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL5: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL5: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL5: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL5: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL5: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL5: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL5: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL5: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL5: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL5_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL5_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL5: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL5_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL5: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL5: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL5: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL5: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL5: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL5: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL5_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL5_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL5: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL5_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL5: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL5_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL5_CAPCONn_H_Pos)              /*!< SCT CAPCTRL5: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL5  -----------------------------------------\r
+#define SCT_MATCHREL5_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL5: RELOADn_L Position   */\r
+#define SCT_MATCHREL5_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL5_RELOADn_L_Pos)             /*!< SCT MATCHREL5: RELOADn_L Mask       */\r
+#define SCT_MATCHREL5_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL5: RELOADn_H Position   */\r
+#define SCT_MATCHREL5_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL5_RELOADn_H_Pos)             /*!< SCT MATCHREL5: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_MATCHREL6  -----------------------------------------\r
+#define SCT_MATCHREL6_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL6: RELOADn_L Position   */\r
+#define SCT_MATCHREL6_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL6_RELOADn_L_Pos)             /*!< SCT MATCHREL6: RELOADn_L Mask       */\r
+#define SCT_MATCHREL6_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL6: RELOADn_H Position   */\r
+#define SCT_MATCHREL6_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL6_RELOADn_H_Pos)             /*!< SCT MATCHREL6: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL6  ------------------------------------------\r
+#define SCT_CAPCTRL6_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL6: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL6: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL6: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL6: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL6: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL6: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL6: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL6: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL6: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL6: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL6_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL6_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL6: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL6_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL6: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL6: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL6: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL6: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL6: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL6: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL6_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL6_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL6: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL6_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL6: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL6_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL6_CAPCONn_H_Pos)              /*!< SCT CAPCTRL6: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_CAPCTRL7  ------------------------------------------\r
+#define SCT_CAPCTRL7_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL7: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL7: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL7: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL7: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL7: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL7: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL7: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL7: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL7: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL7: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL7_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL7_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL7: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL7_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL7: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL7: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL7: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL7: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL7: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL7: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL7_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL7_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL7: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL7_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL7: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL7_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL7_CAPCONn_H_Pos)              /*!< SCT CAPCTRL7: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL7  -----------------------------------------\r
+#define SCT_MATCHREL7_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL7: RELOADn_L Position   */\r
+#define SCT_MATCHREL7_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL7_RELOADn_L_Pos)             /*!< SCT MATCHREL7: RELOADn_L Mask       */\r
+#define SCT_MATCHREL7_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL7: RELOADn_H Position   */\r
+#define SCT_MATCHREL7_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL7_RELOADn_H_Pos)             /*!< SCT MATCHREL7: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL8  ------------------------------------------\r
+#define SCT_CAPCTRL8_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL8: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL8: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL8: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL8: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL8: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL8: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL8: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL8: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL8: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL8: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL8_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL8_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL8: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL8_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL8: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL8: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL8: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL8: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL8: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL8: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL8_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL8_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL8: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL8_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL8: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL8_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL8_CAPCONn_H_Pos)              /*!< SCT CAPCTRL8: CAPCONn_H Mask        */\r
+\r
+// --------------------------------------  SCT_MATCHREL8  -----------------------------------------\r
+#define SCT_MATCHREL8_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL8: RELOADn_L Position   */\r
+#define SCT_MATCHREL8_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL8_RELOADn_L_Pos)             /*!< SCT MATCHREL8: RELOADn_L Mask       */\r
+#define SCT_MATCHREL8_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL8: RELOADn_H Position   */\r
+#define SCT_MATCHREL8_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL8_RELOADn_H_Pos)             /*!< SCT MATCHREL8: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_MATCHREL9  -----------------------------------------\r
+#define SCT_MATCHREL9_RELOADn_L_Pos                           0                                                         /*!< SCT MATCHREL9: RELOADn_L Position   */\r
+#define SCT_MATCHREL9_RELOADn_L_Msk                           (0x0000ffffUL << SCT_MATCHREL9_RELOADn_L_Pos)             /*!< SCT MATCHREL9: RELOADn_L Mask       */\r
+#define SCT_MATCHREL9_RELOADn_H_Pos                           16                                                        /*!< SCT MATCHREL9: RELOADn_H Position   */\r
+#define SCT_MATCHREL9_RELOADn_H_Msk                           (0x0000ffffUL << SCT_MATCHREL9_RELOADn_H_Pos)             /*!< SCT MATCHREL9: RELOADn_H Mask       */\r
+\r
+// --------------------------------------  SCT_CAPCTRL9  ------------------------------------------\r
+#define SCT_CAPCTRL9_CAPCONn_L0_Pos                           0                                                         /*!< SCT CAPCTRL9: CAPCONn_L0 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L0_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L0_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L0 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L1_Pos                           1                                                         /*!< SCT CAPCTRL9: CAPCONn_L1 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L1_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L1_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L1 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L2_Pos                           2                                                         /*!< SCT CAPCTRL9: CAPCONn_L2 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L2_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L2_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L2 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L3_Pos                           3                                                         /*!< SCT CAPCTRL9: CAPCONn_L3 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L3_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L3_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L3 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L4_Pos                           4                                                         /*!< SCT CAPCTRL9: CAPCONn_L4 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L4_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L4_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L4 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L5_Pos                           5                                                         /*!< SCT CAPCTRL9: CAPCONn_L5 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L5_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L5_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L5 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L6_Pos                           6                                                         /*!< SCT CAPCTRL9: CAPCONn_L6 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L6_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L6_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L6 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L7_Pos                           7                                                         /*!< SCT CAPCTRL9: CAPCONn_L7 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L7_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L7_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L7 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L8_Pos                           8                                                         /*!< SCT CAPCTRL9: CAPCONn_L8 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L8_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L8_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L8 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L9_Pos                           9                                                         /*!< SCT CAPCTRL9: CAPCONn_L9 Position   */\r
+#define SCT_CAPCTRL9_CAPCONn_L9_Msk                           (0x01UL << SCT_CAPCTRL9_CAPCONn_L9_Pos)                   /*!< SCT CAPCTRL9: CAPCONn_L9 Mask       */\r
+#define SCT_CAPCTRL9_CAPCONn_L10_Pos                          10                                                        /*!< SCT CAPCTRL9: CAPCONn_L10 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L10_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L10_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L10 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_L11_Pos                          11                                                        /*!< SCT CAPCTRL9: CAPCONn_L11 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L11_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L11_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L11 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_L12_Pos                          12                                                        /*!< SCT CAPCTRL9: CAPCONn_L12 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L12_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L12_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L12 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_L13_Pos                          13                                                        /*!< SCT CAPCTRL9: CAPCONn_L13 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L13_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L13_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L13 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_L14_Pos                          14                                                        /*!< SCT CAPCTRL9: CAPCONn_L14 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L14_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L14_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L14 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_L15_Pos                          15                                                        /*!< SCT CAPCTRL9: CAPCONn_L15 Position  */\r
+#define SCT_CAPCTRL9_CAPCONn_L15_Msk                          (0x01UL << SCT_CAPCTRL9_CAPCONn_L15_Pos)                  /*!< SCT CAPCTRL9: CAPCONn_L15 Mask      */\r
+#define SCT_CAPCTRL9_CAPCONn_H_Pos                            16                                                        /*!< SCT CAPCTRL9: CAPCONn_H Position    */\r
+#define SCT_CAPCTRL9_CAPCONn_H_Msk                            (0x0000ffffUL << SCT_CAPCTRL9_CAPCONn_H_Pos)              /*!< SCT CAPCTRL9: CAPCONn_H Mask        */\r
+\r
+// -------------------------------------  SCT_MATCHREL10  -----------------------------------------\r
+#define SCT_MATCHREL10_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL10: RELOADn_L Position  */\r
+#define SCT_MATCHREL10_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL10_RELOADn_L_Pos)            /*!< SCT MATCHREL10: RELOADn_L Mask      */\r
+#define SCT_MATCHREL10_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL10: RELOADn_H Position  */\r
+#define SCT_MATCHREL10_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL10_RELOADn_H_Pos)            /*!< SCT MATCHREL10: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL10  -----------------------------------------\r
+#define SCT_CAPCTRL10_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL10: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL10: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL10: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL10: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL10: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL10: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL10: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL10: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL10: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL10: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL10_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL10_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL10: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL10_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL10: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL10: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL10: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL10: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL10: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL10: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL10_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL10_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL10: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL10_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL10: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL10_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL10_CAPCONn_H_Pos)             /*!< SCT CAPCTRL10: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_MATCHREL11  -----------------------------------------\r
+#define SCT_MATCHREL11_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL11: RELOADn_L Position  */\r
+#define SCT_MATCHREL11_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL11_RELOADn_L_Pos)            /*!< SCT MATCHREL11: RELOADn_L Mask      */\r
+#define SCT_MATCHREL11_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL11: RELOADn_H Position  */\r
+#define SCT_MATCHREL11_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL11_RELOADn_H_Pos)            /*!< SCT MATCHREL11: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL11  -----------------------------------------\r
+#define SCT_CAPCTRL11_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL11: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL11: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL11: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL11: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL11: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL11: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL11: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL11: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL11: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL11: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL11_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL11_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL11: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL11_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL11: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL11: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL11: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL11: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL11: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL11: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL11_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL11_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL11: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL11_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL11: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL11_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL11_CAPCONn_H_Pos)             /*!< SCT CAPCTRL11: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_MATCHREL12  -----------------------------------------\r
+#define SCT_MATCHREL12_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL12: RELOADn_L Position  */\r
+#define SCT_MATCHREL12_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL12_RELOADn_L_Pos)            /*!< SCT MATCHREL12: RELOADn_L Mask      */\r
+#define SCT_MATCHREL12_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL12: RELOADn_H Position  */\r
+#define SCT_MATCHREL12_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL12_RELOADn_H_Pos)            /*!< SCT MATCHREL12: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL12  -----------------------------------------\r
+#define SCT_CAPCTRL12_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL12: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL12: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL12: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL12: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL12: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL12: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL12: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL12: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL12: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL12: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL12_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL12_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL12: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL12_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL12: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL12: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL12: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL12: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL12: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL12: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL12_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL12_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL12: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL12_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL12: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL12_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL12_CAPCONn_H_Pos)             /*!< SCT CAPCTRL12: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_MATCHREL13  -----------------------------------------\r
+#define SCT_MATCHREL13_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL13: RELOADn_L Position  */\r
+#define SCT_MATCHREL13_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL13_RELOADn_L_Pos)            /*!< SCT MATCHREL13: RELOADn_L Mask      */\r
+#define SCT_MATCHREL13_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL13: RELOADn_H Position  */\r
+#define SCT_MATCHREL13_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL13_RELOADn_H_Pos)            /*!< SCT MATCHREL13: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL13  -----------------------------------------\r
+#define SCT_CAPCTRL13_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL13: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL13: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL13: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL13: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL13: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL13: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL13: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL13: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL13: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL13: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL13_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL13_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL13: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL13_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL13: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL13: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL13: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL13: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL13: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL13: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL13_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL13_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL13: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL13_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL13: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL13_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL13_CAPCONn_H_Pos)             /*!< SCT CAPCTRL13: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_MATCHREL14  -----------------------------------------\r
+#define SCT_MATCHREL14_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL14: RELOADn_L Position  */\r
+#define SCT_MATCHREL14_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL14_RELOADn_L_Pos)            /*!< SCT MATCHREL14: RELOADn_L Mask      */\r
+#define SCT_MATCHREL14_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL14: RELOADn_H Position  */\r
+#define SCT_MATCHREL14_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL14_RELOADn_H_Pos)            /*!< SCT MATCHREL14: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL14  -----------------------------------------\r
+#define SCT_CAPCTRL14_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL14: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL14: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL14: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL14: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL14: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL14: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL14: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL14: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL14: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL14: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL14_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL14_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL14: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL14_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL14: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL14: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL14: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL14: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL14: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL14: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL14_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL14_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL14: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL14_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL14: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL14_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL14_CAPCONn_H_Pos)             /*!< SCT CAPCTRL14: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_MATCHREL15  -----------------------------------------\r
+#define SCT_MATCHREL15_RELOADn_L_Pos                          0                                                         /*!< SCT MATCHREL15: RELOADn_L Position  */\r
+#define SCT_MATCHREL15_RELOADn_L_Msk                          (0x0000ffffUL << SCT_MATCHREL15_RELOADn_L_Pos)            /*!< SCT MATCHREL15: RELOADn_L Mask      */\r
+#define SCT_MATCHREL15_RELOADn_H_Pos                          16                                                        /*!< SCT MATCHREL15: RELOADn_H Position  */\r
+#define SCT_MATCHREL15_RELOADn_H_Msk                          (0x0000ffffUL << SCT_MATCHREL15_RELOADn_H_Pos)            /*!< SCT MATCHREL15: RELOADn_H Mask      */\r
+\r
+// --------------------------------------  SCT_CAPCTRL15  -----------------------------------------\r
+#define SCT_CAPCTRL15_CAPCONn_L0_Pos                          0                                                         /*!< SCT CAPCTRL15: CAPCONn_L0 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L0_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L0_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L0 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L1_Pos                          1                                                         /*!< SCT CAPCTRL15: CAPCONn_L1 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L1_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L1_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L1 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L2_Pos                          2                                                         /*!< SCT CAPCTRL15: CAPCONn_L2 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L2_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L2_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L2 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L3_Pos                          3                                                         /*!< SCT CAPCTRL15: CAPCONn_L3 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L3_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L3_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L3 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L4_Pos                          4                                                         /*!< SCT CAPCTRL15: CAPCONn_L4 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L4_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L4_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L4 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L5_Pos                          5                                                         /*!< SCT CAPCTRL15: CAPCONn_L5 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L5_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L5_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L5 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L6_Pos                          6                                                         /*!< SCT CAPCTRL15: CAPCONn_L6 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L6_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L6_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L6 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L7_Pos                          7                                                         /*!< SCT CAPCTRL15: CAPCONn_L7 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L7_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L7_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L7 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L8_Pos                          8                                                         /*!< SCT CAPCTRL15: CAPCONn_L8 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L8_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L8_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L8 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L9_Pos                          9                                                         /*!< SCT CAPCTRL15: CAPCONn_L9 Position  */\r
+#define SCT_CAPCTRL15_CAPCONn_L9_Msk                          (0x01UL << SCT_CAPCTRL15_CAPCONn_L9_Pos)                  /*!< SCT CAPCTRL15: CAPCONn_L9 Mask      */\r
+#define SCT_CAPCTRL15_CAPCONn_L10_Pos                         10                                                        /*!< SCT CAPCTRL15: CAPCONn_L10 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L10_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L10_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L10 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_L11_Pos                         11                                                        /*!< SCT CAPCTRL15: CAPCONn_L11 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L11_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L11_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L11 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_L12_Pos                         12                                                        /*!< SCT CAPCTRL15: CAPCONn_L12 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L12_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L12_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L12 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_L13_Pos                         13                                                        /*!< SCT CAPCTRL15: CAPCONn_L13 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L13_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L13_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L13 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_L14_Pos                         14                                                        /*!< SCT CAPCTRL15: CAPCONn_L14 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L14_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L14_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L14 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_L15_Pos                         15                                                        /*!< SCT CAPCTRL15: CAPCONn_L15 Position */\r
+#define SCT_CAPCTRL15_CAPCONn_L15_Msk                         (0x01UL << SCT_CAPCTRL15_CAPCONn_L15_Pos)                 /*!< SCT CAPCTRL15: CAPCONn_L15 Mask     */\r
+#define SCT_CAPCTRL15_CAPCONn_H_Pos                           16                                                        /*!< SCT CAPCTRL15: CAPCONn_H Position   */\r
+#define SCT_CAPCTRL15_CAPCONn_H_Msk                           (0x0000ffffUL << SCT_CAPCTRL15_CAPCONn_H_Pos)             /*!< SCT CAPCTRL15: CAPCONn_H Mask       */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK0  ----------------------------------------\r
+#define SCT_EVSTATEMSK0_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK0: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK0: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK0: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK0: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK0: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK0: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK0: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK0: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK0: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK0: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK0_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK0: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK0_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK0: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK0: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK0: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK0: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK0: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK0: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK0: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK0: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK0: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK0: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK0: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK0: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK0: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK0: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK0: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK0: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK0: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK0: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK0: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK0: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK0: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK0_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK0: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK0_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK0_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK0: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL0  ------------------------------------------\r
+#define SCT_EVCTRL0_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL0: MATCHSEL Position      */\r
+#define SCT_EVCTRL0_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL0_MATCHSEL_Pos)                      /*!< SCT EVCTRL0: MATCHSEL Mask          */\r
+#define SCT_EVCTRL0_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL0: HEVENT Position        */\r
+#define SCT_EVCTRL0_HEVENT_Msk                                (0x01UL << SCT_EVCTRL0_HEVENT_Pos)                        /*!< SCT EVCTRL0: HEVENT Mask            */\r
+#define SCT_EVCTRL0_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL0: OUTSEL Position        */\r
+#define SCT_EVCTRL0_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL0_OUTSEL_Pos)                        /*!< SCT EVCTRL0: OUTSEL Mask            */\r
+#define SCT_EVCTRL0_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL0: IOSEL Position         */\r
+#define SCT_EVCTRL0_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL0_IOSEL_Pos)                         /*!< SCT EVCTRL0: IOSEL Mask             */\r
+#define SCT_EVCTRL0_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL0: IOCOND Position        */\r
+#define SCT_EVCTRL0_IOCOND_Msk                                (0x03UL << SCT_EVCTRL0_IOCOND_Pos)                        /*!< SCT EVCTRL0: IOCOND Mask            */\r
+#define SCT_EVCTRL0_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL0: COMBMODE Position      */\r
+#define SCT_EVCTRL0_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL0_COMBMODE_Pos)                      /*!< SCT EVCTRL0: COMBMODE Mask          */\r
+#define SCT_EVCTRL0_STATELD_Pos                               14                                                        /*!< SCT EVCTRL0: STATELD Position       */\r
+#define SCT_EVCTRL0_STATELD_Msk                               (0x01UL << SCT_EVCTRL0_STATELD_Pos)                       /*!< SCT EVCTRL0: STATELD Mask           */\r
+#define SCT_EVCTRL0_STATEV_Pos                                15                                                        /*!< SCT EVCTRL0: STATEV Position        */\r
+#define SCT_EVCTRL0_STATEV_Msk                                (0x1fUL << SCT_EVCTRL0_STATEV_Pos)                        /*!< SCT EVCTRL0: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK1  ----------------------------------------\r
+#define SCT_EVSTATEMSK1_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK1: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK1: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK1: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK1: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK1: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK1: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK1: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK1: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK1: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK1: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK1_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK1: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK1_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK1: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK1: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK1: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK1: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK1: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK1: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK1: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK1: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK1: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK1: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK1: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK1: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK1: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK1: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK1: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK1: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK1: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK1: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK1: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK1: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK1: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK1_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK1: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK1_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK1_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK1: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL1  ------------------------------------------\r
+#define SCT_EVCTRL1_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL1: MATCHSEL Position      */\r
+#define SCT_EVCTRL1_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL1_MATCHSEL_Pos)                      /*!< SCT EVCTRL1: MATCHSEL Mask          */\r
+#define SCT_EVCTRL1_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL1: HEVENT Position        */\r
+#define SCT_EVCTRL1_HEVENT_Msk                                (0x01UL << SCT_EVCTRL1_HEVENT_Pos)                        /*!< SCT EVCTRL1: HEVENT Mask            */\r
+#define SCT_EVCTRL1_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL1: OUTSEL Position        */\r
+#define SCT_EVCTRL1_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL1_OUTSEL_Pos)                        /*!< SCT EVCTRL1: OUTSEL Mask            */\r
+#define SCT_EVCTRL1_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL1: IOSEL Position         */\r
+#define SCT_EVCTRL1_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL1_IOSEL_Pos)                         /*!< SCT EVCTRL1: IOSEL Mask             */\r
+#define SCT_EVCTRL1_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL1: IOCOND Position        */\r
+#define SCT_EVCTRL1_IOCOND_Msk                                (0x03UL << SCT_EVCTRL1_IOCOND_Pos)                        /*!< SCT EVCTRL1: IOCOND Mask            */\r
+#define SCT_EVCTRL1_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL1: COMBMODE Position      */\r
+#define SCT_EVCTRL1_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL1_COMBMODE_Pos)                      /*!< SCT EVCTRL1: COMBMODE Mask          */\r
+#define SCT_EVCTRL1_STATELD_Pos                               14                                                        /*!< SCT EVCTRL1: STATELD Position       */\r
+#define SCT_EVCTRL1_STATELD_Msk                               (0x01UL << SCT_EVCTRL1_STATELD_Pos)                       /*!< SCT EVCTRL1: STATELD Mask           */\r
+#define SCT_EVCTRL1_STATEV_Pos                                15                                                        /*!< SCT EVCTRL1: STATEV Position        */\r
+#define SCT_EVCTRL1_STATEV_Msk                                (0x1fUL << SCT_EVCTRL1_STATEV_Pos)                        /*!< SCT EVCTRL1: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK2  ----------------------------------------\r
+#define SCT_EVSTATEMSK2_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK2: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK2: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK2: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK2: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK2: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK2: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK2: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK2: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK2: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK2: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK2_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK2: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK2_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK2: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK2: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK2: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK2: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK2: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK2: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK2: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK2: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK2: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK2: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK2: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK2: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK2: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK2: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK2: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK2: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK2: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK2: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK2: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK2: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK2: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK2_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK2: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK2_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK2_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK2: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL2  ------------------------------------------\r
+#define SCT_EVCTRL2_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL2: MATCHSEL Position      */\r
+#define SCT_EVCTRL2_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL2_MATCHSEL_Pos)                      /*!< SCT EVCTRL2: MATCHSEL Mask          */\r
+#define SCT_EVCTRL2_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL2: HEVENT Position        */\r
+#define SCT_EVCTRL2_HEVENT_Msk                                (0x01UL << SCT_EVCTRL2_HEVENT_Pos)                        /*!< SCT EVCTRL2: HEVENT Mask            */\r
+#define SCT_EVCTRL2_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL2: OUTSEL Position        */\r
+#define SCT_EVCTRL2_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL2_OUTSEL_Pos)                        /*!< SCT EVCTRL2: OUTSEL Mask            */\r
+#define SCT_EVCTRL2_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL2: IOSEL Position         */\r
+#define SCT_EVCTRL2_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL2_IOSEL_Pos)                         /*!< SCT EVCTRL2: IOSEL Mask             */\r
+#define SCT_EVCTRL2_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL2: IOCOND Position        */\r
+#define SCT_EVCTRL2_IOCOND_Msk                                (0x03UL << SCT_EVCTRL2_IOCOND_Pos)                        /*!< SCT EVCTRL2: IOCOND Mask            */\r
+#define SCT_EVCTRL2_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL2: COMBMODE Position      */\r
+#define SCT_EVCTRL2_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL2_COMBMODE_Pos)                      /*!< SCT EVCTRL2: COMBMODE Mask          */\r
+#define SCT_EVCTRL2_STATELD_Pos                               14                                                        /*!< SCT EVCTRL2: STATELD Position       */\r
+#define SCT_EVCTRL2_STATELD_Msk                               (0x01UL << SCT_EVCTRL2_STATELD_Pos)                       /*!< SCT EVCTRL2: STATELD Mask           */\r
+#define SCT_EVCTRL2_STATEV_Pos                                15                                                        /*!< SCT EVCTRL2: STATEV Position        */\r
+#define SCT_EVCTRL2_STATEV_Msk                                (0x1fUL << SCT_EVCTRL2_STATEV_Pos)                        /*!< SCT EVCTRL2: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK3  ----------------------------------------\r
+#define SCT_EVSTATEMSK3_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK3: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK3: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK3: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK3: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK3: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK3: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK3: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK3: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK3: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK3: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK3_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK3: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK3_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK3: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK3: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK3: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK3: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK3: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK3: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK3: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK3: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK3: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK3: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK3: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK3: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK3: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK3: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK3: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK3: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK3: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK3: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK3: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK3: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK3: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK3_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK3: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK3_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK3_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK3: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL3  ------------------------------------------\r
+#define SCT_EVCTRL3_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL3: MATCHSEL Position      */\r
+#define SCT_EVCTRL3_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL3_MATCHSEL_Pos)                      /*!< SCT EVCTRL3: MATCHSEL Mask          */\r
+#define SCT_EVCTRL3_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL3: HEVENT Position        */\r
+#define SCT_EVCTRL3_HEVENT_Msk                                (0x01UL << SCT_EVCTRL3_HEVENT_Pos)                        /*!< SCT EVCTRL3: HEVENT Mask            */\r
+#define SCT_EVCTRL3_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL3: OUTSEL Position        */\r
+#define SCT_EVCTRL3_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL3_OUTSEL_Pos)                        /*!< SCT EVCTRL3: OUTSEL Mask            */\r
+#define SCT_EVCTRL3_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL3: IOSEL Position         */\r
+#define SCT_EVCTRL3_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL3_IOSEL_Pos)                         /*!< SCT EVCTRL3: IOSEL Mask             */\r
+#define SCT_EVCTRL3_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL3: IOCOND Position        */\r
+#define SCT_EVCTRL3_IOCOND_Msk                                (0x03UL << SCT_EVCTRL3_IOCOND_Pos)                        /*!< SCT EVCTRL3: IOCOND Mask            */\r
+#define SCT_EVCTRL3_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL3: COMBMODE Position      */\r
+#define SCT_EVCTRL3_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL3_COMBMODE_Pos)                      /*!< SCT EVCTRL3: COMBMODE Mask          */\r
+#define SCT_EVCTRL3_STATELD_Pos                               14                                                        /*!< SCT EVCTRL3: STATELD Position       */\r
+#define SCT_EVCTRL3_STATELD_Msk                               (0x01UL << SCT_EVCTRL3_STATELD_Pos)                       /*!< SCT EVCTRL3: STATELD Mask           */\r
+#define SCT_EVCTRL3_STATEV_Pos                                15                                                        /*!< SCT EVCTRL3: STATEV Position        */\r
+#define SCT_EVCTRL3_STATEV_Msk                                (0x1fUL << SCT_EVCTRL3_STATEV_Pos)                        /*!< SCT EVCTRL3: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK4  ----------------------------------------\r
+#define SCT_EVSTATEMSK4_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK4: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK4: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK4: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK4: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK4: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK4: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK4: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK4: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK4: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK4: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK4_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK4: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK4_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK4: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK4: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK4: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK4: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK4: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK4: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK4: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK4: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK4: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK4: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK4: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK4: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK4: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK4: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK4: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK4: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK4: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK4: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK4: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK4: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK4: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK4_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK4: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK4_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK4_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK4: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL4  ------------------------------------------\r
+#define SCT_EVCTRL4_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL4: MATCHSEL Position      */\r
+#define SCT_EVCTRL4_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL4_MATCHSEL_Pos)                      /*!< SCT EVCTRL4: MATCHSEL Mask          */\r
+#define SCT_EVCTRL4_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL4: HEVENT Position        */\r
+#define SCT_EVCTRL4_HEVENT_Msk                                (0x01UL << SCT_EVCTRL4_HEVENT_Pos)                        /*!< SCT EVCTRL4: HEVENT Mask            */\r
+#define SCT_EVCTRL4_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL4: OUTSEL Position        */\r
+#define SCT_EVCTRL4_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL4_OUTSEL_Pos)                        /*!< SCT EVCTRL4: OUTSEL Mask            */\r
+#define SCT_EVCTRL4_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL4: IOSEL Position         */\r
+#define SCT_EVCTRL4_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL4_IOSEL_Pos)                         /*!< SCT EVCTRL4: IOSEL Mask             */\r
+#define SCT_EVCTRL4_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL4: IOCOND Position        */\r
+#define SCT_EVCTRL4_IOCOND_Msk                                (0x03UL << SCT_EVCTRL4_IOCOND_Pos)                        /*!< SCT EVCTRL4: IOCOND Mask            */\r
+#define SCT_EVCTRL4_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL4: COMBMODE Position      */\r
+#define SCT_EVCTRL4_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL4_COMBMODE_Pos)                      /*!< SCT EVCTRL4: COMBMODE Mask          */\r
+#define SCT_EVCTRL4_STATELD_Pos                               14                                                        /*!< SCT EVCTRL4: STATELD Position       */\r
+#define SCT_EVCTRL4_STATELD_Msk                               (0x01UL << SCT_EVCTRL4_STATELD_Pos)                       /*!< SCT EVCTRL4: STATELD Mask           */\r
+#define SCT_EVCTRL4_STATEV_Pos                                15                                                        /*!< SCT EVCTRL4: STATEV Position        */\r
+#define SCT_EVCTRL4_STATEV_Msk                                (0x1fUL << SCT_EVCTRL4_STATEV_Pos)                        /*!< SCT EVCTRL4: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK5  ----------------------------------------\r
+#define SCT_EVSTATEMSK5_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK5: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK5: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK5: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK5: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK5: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK5: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK5: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK5: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK5: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK5: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK5_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK5: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK5_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK5: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK5: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK5: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK5: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK5: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK5: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK5: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK5: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK5: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK5: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK5: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK5: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK5: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK5: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK5: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK5: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK5: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK5: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK5: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK5: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK5: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK5_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK5: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK5_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK5_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK5: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL5  ------------------------------------------\r
+#define SCT_EVCTRL5_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL5: MATCHSEL Position      */\r
+#define SCT_EVCTRL5_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL5_MATCHSEL_Pos)                      /*!< SCT EVCTRL5: MATCHSEL Mask          */\r
+#define SCT_EVCTRL5_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL5: HEVENT Position        */\r
+#define SCT_EVCTRL5_HEVENT_Msk                                (0x01UL << SCT_EVCTRL5_HEVENT_Pos)                        /*!< SCT EVCTRL5: HEVENT Mask            */\r
+#define SCT_EVCTRL5_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL5: OUTSEL Position        */\r
+#define SCT_EVCTRL5_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL5_OUTSEL_Pos)                        /*!< SCT EVCTRL5: OUTSEL Mask            */\r
+#define SCT_EVCTRL5_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL5: IOSEL Position         */\r
+#define SCT_EVCTRL5_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL5_IOSEL_Pos)                         /*!< SCT EVCTRL5: IOSEL Mask             */\r
+#define SCT_EVCTRL5_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL5: IOCOND Position        */\r
+#define SCT_EVCTRL5_IOCOND_Msk                                (0x03UL << SCT_EVCTRL5_IOCOND_Pos)                        /*!< SCT EVCTRL5: IOCOND Mask            */\r
+#define SCT_EVCTRL5_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL5: COMBMODE Position      */\r
+#define SCT_EVCTRL5_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL5_COMBMODE_Pos)                      /*!< SCT EVCTRL5: COMBMODE Mask          */\r
+#define SCT_EVCTRL5_STATELD_Pos                               14                                                        /*!< SCT EVCTRL5: STATELD Position       */\r
+#define SCT_EVCTRL5_STATELD_Msk                               (0x01UL << SCT_EVCTRL5_STATELD_Pos)                       /*!< SCT EVCTRL5: STATELD Mask           */\r
+#define SCT_EVCTRL5_STATEV_Pos                                15                                                        /*!< SCT EVCTRL5: STATEV Position        */\r
+#define SCT_EVCTRL5_STATEV_Msk                                (0x1fUL << SCT_EVCTRL5_STATEV_Pos)                        /*!< SCT EVCTRL5: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK6  ----------------------------------------\r
+#define SCT_EVSTATEMSK6_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK6: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK6: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK6: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK6: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK6: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK6: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK6: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK6: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK6: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK6: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK6_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK6: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK6_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK6: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK6: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK6: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK6: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK6: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK6: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK6: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK6: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK6: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK6: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK6: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK6: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK6: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK6: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK6: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK6: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK6: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK6: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK6: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK6: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK6: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK6_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK6: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK6_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK6_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK6: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL6  ------------------------------------------\r
+#define SCT_EVCTRL6_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL6: MATCHSEL Position      */\r
+#define SCT_EVCTRL6_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL6_MATCHSEL_Pos)                      /*!< SCT EVCTRL6: MATCHSEL Mask          */\r
+#define SCT_EVCTRL6_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL6: HEVENT Position        */\r
+#define SCT_EVCTRL6_HEVENT_Msk                                (0x01UL << SCT_EVCTRL6_HEVENT_Pos)                        /*!< SCT EVCTRL6: HEVENT Mask            */\r
+#define SCT_EVCTRL6_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL6: OUTSEL Position        */\r
+#define SCT_EVCTRL6_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL6_OUTSEL_Pos)                        /*!< SCT EVCTRL6: OUTSEL Mask            */\r
+#define SCT_EVCTRL6_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL6: IOSEL Position         */\r
+#define SCT_EVCTRL6_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL6_IOSEL_Pos)                         /*!< SCT EVCTRL6: IOSEL Mask             */\r
+#define SCT_EVCTRL6_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL6: IOCOND Position        */\r
+#define SCT_EVCTRL6_IOCOND_Msk                                (0x03UL << SCT_EVCTRL6_IOCOND_Pos)                        /*!< SCT EVCTRL6: IOCOND Mask            */\r
+#define SCT_EVCTRL6_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL6: COMBMODE Position      */\r
+#define SCT_EVCTRL6_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL6_COMBMODE_Pos)                      /*!< SCT EVCTRL6: COMBMODE Mask          */\r
+#define SCT_EVCTRL6_STATELD_Pos                               14                                                        /*!< SCT EVCTRL6: STATELD Position       */\r
+#define SCT_EVCTRL6_STATELD_Msk                               (0x01UL << SCT_EVCTRL6_STATELD_Pos)                       /*!< SCT EVCTRL6: STATELD Mask           */\r
+#define SCT_EVCTRL6_STATEV_Pos                                15                                                        /*!< SCT EVCTRL6: STATEV Position        */\r
+#define SCT_EVCTRL6_STATEV_Msk                                (0x1fUL << SCT_EVCTRL6_STATEV_Pos)                        /*!< SCT EVCTRL6: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK7  ----------------------------------------\r
+#define SCT_EVSTATEMSK7_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK7: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK7: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK7: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK7: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK7: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK7: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK7: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK7: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK7: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK7: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK7_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK7: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK7_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK7: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK7: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK7: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK7: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK7: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK7: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK7: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK7: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK7: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK7: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK7: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK7: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK7: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK7: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK7: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK7: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK7: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK7: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK7: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK7: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK7: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK7_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK7: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK7_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK7_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK7: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL7  ------------------------------------------\r
+#define SCT_EVCTRL7_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL7: MATCHSEL Position      */\r
+#define SCT_EVCTRL7_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL7_MATCHSEL_Pos)                      /*!< SCT EVCTRL7: MATCHSEL Mask          */\r
+#define SCT_EVCTRL7_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL7: HEVENT Position        */\r
+#define SCT_EVCTRL7_HEVENT_Msk                                (0x01UL << SCT_EVCTRL7_HEVENT_Pos)                        /*!< SCT EVCTRL7: HEVENT Mask            */\r
+#define SCT_EVCTRL7_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL7: OUTSEL Position        */\r
+#define SCT_EVCTRL7_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL7_OUTSEL_Pos)                        /*!< SCT EVCTRL7: OUTSEL Mask            */\r
+#define SCT_EVCTRL7_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL7: IOSEL Position         */\r
+#define SCT_EVCTRL7_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL7_IOSEL_Pos)                         /*!< SCT EVCTRL7: IOSEL Mask             */\r
+#define SCT_EVCTRL7_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL7: IOCOND Position        */\r
+#define SCT_EVCTRL7_IOCOND_Msk                                (0x03UL << SCT_EVCTRL7_IOCOND_Pos)                        /*!< SCT EVCTRL7: IOCOND Mask            */\r
+#define SCT_EVCTRL7_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL7: COMBMODE Position      */\r
+#define SCT_EVCTRL7_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL7_COMBMODE_Pos)                      /*!< SCT EVCTRL7: COMBMODE Mask          */\r
+#define SCT_EVCTRL7_STATELD_Pos                               14                                                        /*!< SCT EVCTRL7: STATELD Position       */\r
+#define SCT_EVCTRL7_STATELD_Msk                               (0x01UL << SCT_EVCTRL7_STATELD_Pos)                       /*!< SCT EVCTRL7: STATELD Mask           */\r
+#define SCT_EVCTRL7_STATEV_Pos                                15                                                        /*!< SCT EVCTRL7: STATEV Position        */\r
+#define SCT_EVCTRL7_STATEV_Msk                                (0x1fUL << SCT_EVCTRL7_STATEV_Pos)                        /*!< SCT EVCTRL7: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK8  ----------------------------------------\r
+#define SCT_EVSTATEMSK8_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK8: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK8: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK8: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK8: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK8: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK8: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK8: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK8: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK8: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK8: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK8_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK8: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK8_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK8: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK8: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK8: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK8: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK8: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK8: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK8: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK8: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK8: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK8: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK8: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK8: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK8: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK8: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK8: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK8: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK8: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK8: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK8: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK8: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK8: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK8_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK8: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK8_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK8_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK8: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL8  ------------------------------------------\r
+#define SCT_EVCTRL8_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL8: MATCHSEL Position      */\r
+#define SCT_EVCTRL8_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL8_MATCHSEL_Pos)                      /*!< SCT EVCTRL8: MATCHSEL Mask          */\r
+#define SCT_EVCTRL8_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL8: HEVENT Position        */\r
+#define SCT_EVCTRL8_HEVENT_Msk                                (0x01UL << SCT_EVCTRL8_HEVENT_Pos)                        /*!< SCT EVCTRL8: HEVENT Mask            */\r
+#define SCT_EVCTRL8_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL8: OUTSEL Position        */\r
+#define SCT_EVCTRL8_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL8_OUTSEL_Pos)                        /*!< SCT EVCTRL8: OUTSEL Mask            */\r
+#define SCT_EVCTRL8_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL8: IOSEL Position         */\r
+#define SCT_EVCTRL8_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL8_IOSEL_Pos)                         /*!< SCT EVCTRL8: IOSEL Mask             */\r
+#define SCT_EVCTRL8_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL8: IOCOND Position        */\r
+#define SCT_EVCTRL8_IOCOND_Msk                                (0x03UL << SCT_EVCTRL8_IOCOND_Pos)                        /*!< SCT EVCTRL8: IOCOND Mask            */\r
+#define SCT_EVCTRL8_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL8: COMBMODE Position      */\r
+#define SCT_EVCTRL8_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL8_COMBMODE_Pos)                      /*!< SCT EVCTRL8: COMBMODE Mask          */\r
+#define SCT_EVCTRL8_STATELD_Pos                               14                                                        /*!< SCT EVCTRL8: STATELD Position       */\r
+#define SCT_EVCTRL8_STATELD_Msk                               (0x01UL << SCT_EVCTRL8_STATELD_Pos)                       /*!< SCT EVCTRL8: STATELD Mask           */\r
+#define SCT_EVCTRL8_STATEV_Pos                                15                                                        /*!< SCT EVCTRL8: STATEV Position        */\r
+#define SCT_EVCTRL8_STATEV_Msk                                (0x1fUL << SCT_EVCTRL8_STATEV_Pos)                        /*!< SCT EVCTRL8: STATEV Mask            */\r
+\r
+// -------------------------------------  SCT_EVSTATEMSK9  ----------------------------------------\r
+#define SCT_EVSTATEMSK9_STATEMSKn0_Pos                        0                                                         /*!< SCT EVSTATEMSK9: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn0_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn0_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn0 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn1_Pos                        1                                                         /*!< SCT EVSTATEMSK9: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn1_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn1_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn1 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn2_Pos                        2                                                         /*!< SCT EVSTATEMSK9: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn2_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn2_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn2 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn3_Pos                        3                                                         /*!< SCT EVSTATEMSK9: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn3_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn3_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn3 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn4_Pos                        4                                                         /*!< SCT EVSTATEMSK9: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn4_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn4_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn4 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn5_Pos                        5                                                         /*!< SCT EVSTATEMSK9: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn5_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn5_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn5 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn6_Pos                        6                                                         /*!< SCT EVSTATEMSK9: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn6_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn6_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn6 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn7_Pos                        7                                                         /*!< SCT EVSTATEMSK9: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn7_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn7_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn7 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn8_Pos                        8                                                         /*!< SCT EVSTATEMSK9: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn8_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn8_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn8 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn9_Pos                        9                                                         /*!< SCT EVSTATEMSK9: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn9_Msk                        (0x01UL << SCT_EVSTATEMSK9_STATEMSKn9_Pos)                /*!< SCT EVSTATEMSK9: STATEMSKn9 Mask    */\r
+#define SCT_EVSTATEMSK9_STATEMSKn10_Pos                       10                                                        /*!< SCT EVSTATEMSK9: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn10_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn10_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn10 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn11_Pos                       11                                                        /*!< SCT EVSTATEMSK9: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn11_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn11_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn11 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn12_Pos                       12                                                        /*!< SCT EVSTATEMSK9: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn12_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn12_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn12 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn13_Pos                       13                                                        /*!< SCT EVSTATEMSK9: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn13_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn13_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn13 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn14_Pos                       14                                                        /*!< SCT EVSTATEMSK9: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn14_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn14_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn14 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn15_Pos                       15                                                        /*!< SCT EVSTATEMSK9: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn15_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn15_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn15 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn16_Pos                       16                                                        /*!< SCT EVSTATEMSK9: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn16_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn16_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn16 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn17_Pos                       17                                                        /*!< SCT EVSTATEMSK9: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn17_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn17_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn17 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn18_Pos                       18                                                        /*!< SCT EVSTATEMSK9: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn18_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn18_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn18 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn19_Pos                       19                                                        /*!< SCT EVSTATEMSK9: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn19_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn19_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn19 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn20_Pos                       20                                                        /*!< SCT EVSTATEMSK9: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn20_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn20_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn20 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn21_Pos                       21                                                        /*!< SCT EVSTATEMSK9: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn21_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn21_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn21 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn22_Pos                       22                                                        /*!< SCT EVSTATEMSK9: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn22_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn22_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn22 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn23_Pos                       23                                                        /*!< SCT EVSTATEMSK9: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn23_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn23_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn23 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn24_Pos                       24                                                        /*!< SCT EVSTATEMSK9: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn24_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn24_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn24 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn25_Pos                       25                                                        /*!< SCT EVSTATEMSK9: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn25_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn25_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn25 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn26_Pos                       26                                                        /*!< SCT EVSTATEMSK9: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn26_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn26_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn26 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn27_Pos                       27                                                        /*!< SCT EVSTATEMSK9: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn27_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn27_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn27 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn28_Pos                       28                                                        /*!< SCT EVSTATEMSK9: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn28_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn28_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn28 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn29_Pos                       29                                                        /*!< SCT EVSTATEMSK9: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn29_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn29_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn29 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn30_Pos                       30                                                        /*!< SCT EVSTATEMSK9: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn30_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn30_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn30 Mask   */\r
+#define SCT_EVSTATEMSK9_STATEMSKn31_Pos                       31                                                        /*!< SCT EVSTATEMSK9: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK9_STATEMSKn31_Msk                       (0x01UL << SCT_EVSTATEMSK9_STATEMSKn31_Pos)               /*!< SCT EVSTATEMSK9: STATEMSKn31 Mask   */\r
+\r
+// ---------------------------------------  SCT_EVCTRL9  ------------------------------------------\r
+#define SCT_EVCTRL9_MATCHSEL_Pos                              0                                                         /*!< SCT EVCTRL9: MATCHSEL Position      */\r
+#define SCT_EVCTRL9_MATCHSEL_Msk                              (0x0fUL << SCT_EVCTRL9_MATCHSEL_Pos)                      /*!< SCT EVCTRL9: MATCHSEL Mask          */\r
+#define SCT_EVCTRL9_HEVENT_Pos                                4                                                         /*!< SCT EVCTRL9: HEVENT Position        */\r
+#define SCT_EVCTRL9_HEVENT_Msk                                (0x01UL << SCT_EVCTRL9_HEVENT_Pos)                        /*!< SCT EVCTRL9: HEVENT Mask            */\r
+#define SCT_EVCTRL9_OUTSEL_Pos                                5                                                         /*!< SCT EVCTRL9: OUTSEL Position        */\r
+#define SCT_EVCTRL9_OUTSEL_Msk                                (0x01UL << SCT_EVCTRL9_OUTSEL_Pos)                        /*!< SCT EVCTRL9: OUTSEL Mask            */\r
+#define SCT_EVCTRL9_IOSEL_Pos                                 6                                                         /*!< SCT EVCTRL9: IOSEL Position         */\r
+#define SCT_EVCTRL9_IOSEL_Msk                                 (0x0fUL << SCT_EVCTRL9_IOSEL_Pos)                         /*!< SCT EVCTRL9: IOSEL Mask             */\r
+#define SCT_EVCTRL9_IOCOND_Pos                                10                                                        /*!< SCT EVCTRL9: IOCOND Position        */\r
+#define SCT_EVCTRL9_IOCOND_Msk                                (0x03UL << SCT_EVCTRL9_IOCOND_Pos)                        /*!< SCT EVCTRL9: IOCOND Mask            */\r
+#define SCT_EVCTRL9_COMBMODE_Pos                              12                                                        /*!< SCT EVCTRL9: COMBMODE Position      */\r
+#define SCT_EVCTRL9_COMBMODE_Msk                              (0x03UL << SCT_EVCTRL9_COMBMODE_Pos)                      /*!< SCT EVCTRL9: COMBMODE Mask          */\r
+#define SCT_EVCTRL9_STATELD_Pos                               14                                                        /*!< SCT EVCTRL9: STATELD Position       */\r
+#define SCT_EVCTRL9_STATELD_Msk                               (0x01UL << SCT_EVCTRL9_STATELD_Pos)                       /*!< SCT EVCTRL9: STATELD Mask           */\r
+#define SCT_EVCTRL9_STATEV_Pos                                15                                                        /*!< SCT EVCTRL9: STATEV Position        */\r
+#define SCT_EVCTRL9_STATEV_Msk                                (0x1fUL << SCT_EVCTRL9_STATEV_Pos)                        /*!< SCT EVCTRL9: STATEV Mask            */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK10  ----------------------------------------\r
+#define SCT_EVSTATEMSK10_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK10: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK10: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK10: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK10: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK10: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK10: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK10: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK10: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK10: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK10: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK10_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK10: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK10_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK10: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK10: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK10: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK10: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK10: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK10: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK10: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK10: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK10: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK10: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK10: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK10: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK10: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK10: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK10: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK10: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK10: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK10: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK10: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK10: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK10: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK10_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK10: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK10_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK10_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK10: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL10  ------------------------------------------\r
+#define SCT_EVCTRL10_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL10: MATCHSEL Position     */\r
+#define SCT_EVCTRL10_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL10_MATCHSEL_Pos)                     /*!< SCT EVCTRL10: MATCHSEL Mask         */\r
+#define SCT_EVCTRL10_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL10: HEVENT Position       */\r
+#define SCT_EVCTRL10_HEVENT_Msk                               (0x01UL << SCT_EVCTRL10_HEVENT_Pos)                       /*!< SCT EVCTRL10: HEVENT Mask           */\r
+#define SCT_EVCTRL10_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL10: OUTSEL Position       */\r
+#define SCT_EVCTRL10_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL10_OUTSEL_Pos)                       /*!< SCT EVCTRL10: OUTSEL Mask           */\r
+#define SCT_EVCTRL10_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL10: IOSEL Position        */\r
+#define SCT_EVCTRL10_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL10_IOSEL_Pos)                        /*!< SCT EVCTRL10: IOSEL Mask            */\r
+#define SCT_EVCTRL10_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL10: IOCOND Position       */\r
+#define SCT_EVCTRL10_IOCOND_Msk                               (0x03UL << SCT_EVCTRL10_IOCOND_Pos)                       /*!< SCT EVCTRL10: IOCOND Mask           */\r
+#define SCT_EVCTRL10_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL10: COMBMODE Position     */\r
+#define SCT_EVCTRL10_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL10_COMBMODE_Pos)                     /*!< SCT EVCTRL10: COMBMODE Mask         */\r
+#define SCT_EVCTRL10_STATELD_Pos                              14                                                        /*!< SCT EVCTRL10: STATELD Position      */\r
+#define SCT_EVCTRL10_STATELD_Msk                              (0x01UL << SCT_EVCTRL10_STATELD_Pos)                      /*!< SCT EVCTRL10: STATELD Mask          */\r
+#define SCT_EVCTRL10_STATEV_Pos                               15                                                        /*!< SCT EVCTRL10: STATEV Position       */\r
+#define SCT_EVCTRL10_STATEV_Msk                               (0x1fUL << SCT_EVCTRL10_STATEV_Pos)                       /*!< SCT EVCTRL10: STATEV Mask           */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK11  ----------------------------------------\r
+#define SCT_EVSTATEMSK11_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK11: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK11: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK11: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK11: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK11: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK11: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK11: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK11: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK11: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK11: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK11_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK11: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK11_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK11: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK11: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK11: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK11: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK11: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK11: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK11: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK11: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK11: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK11: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK11: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK11: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK11: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK11: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK11: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK11: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK11: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK11: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK11: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK11: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK11: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK11_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK11: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK11_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK11_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK11: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL11  ------------------------------------------\r
+#define SCT_EVCTRL11_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL11: MATCHSEL Position     */\r
+#define SCT_EVCTRL11_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL11_MATCHSEL_Pos)                     /*!< SCT EVCTRL11: MATCHSEL Mask         */\r
+#define SCT_EVCTRL11_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL11: HEVENT Position       */\r
+#define SCT_EVCTRL11_HEVENT_Msk                               (0x01UL << SCT_EVCTRL11_HEVENT_Pos)                       /*!< SCT EVCTRL11: HEVENT Mask           */\r
+#define SCT_EVCTRL11_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL11: OUTSEL Position       */\r
+#define SCT_EVCTRL11_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL11_OUTSEL_Pos)                       /*!< SCT EVCTRL11: OUTSEL Mask           */\r
+#define SCT_EVCTRL11_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL11: IOSEL Position        */\r
+#define SCT_EVCTRL11_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL11_IOSEL_Pos)                        /*!< SCT EVCTRL11: IOSEL Mask            */\r
+#define SCT_EVCTRL11_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL11: IOCOND Position       */\r
+#define SCT_EVCTRL11_IOCOND_Msk                               (0x03UL << SCT_EVCTRL11_IOCOND_Pos)                       /*!< SCT EVCTRL11: IOCOND Mask           */\r
+#define SCT_EVCTRL11_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL11: COMBMODE Position     */\r
+#define SCT_EVCTRL11_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL11_COMBMODE_Pos)                     /*!< SCT EVCTRL11: COMBMODE Mask         */\r
+#define SCT_EVCTRL11_STATELD_Pos                              14                                                        /*!< SCT EVCTRL11: STATELD Position      */\r
+#define SCT_EVCTRL11_STATELD_Msk                              (0x01UL << SCT_EVCTRL11_STATELD_Pos)                      /*!< SCT EVCTRL11: STATELD Mask          */\r
+#define SCT_EVCTRL11_STATEV_Pos                               15                                                        /*!< SCT EVCTRL11: STATEV Position       */\r
+#define SCT_EVCTRL11_STATEV_Msk                               (0x1fUL << SCT_EVCTRL11_STATEV_Pos)                       /*!< SCT EVCTRL11: STATEV Mask           */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK12  ----------------------------------------\r
+#define SCT_EVSTATEMSK12_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK12: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK12: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK12: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK12: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK12: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK12: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK12: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK12: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK12: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK12: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK12_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK12: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK12_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK12: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK12: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK12: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK12: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK12: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK12: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK12: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK12: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK12: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK12: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK12: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK12: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK12: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK12: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK12: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK12: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK12: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK12: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK12: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK12: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK12: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK12_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK12: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK12_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK12_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK12: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL12  ------------------------------------------\r
+#define SCT_EVCTRL12_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL12: MATCHSEL Position     */\r
+#define SCT_EVCTRL12_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL12_MATCHSEL_Pos)                     /*!< SCT EVCTRL12: MATCHSEL Mask         */\r
+#define SCT_EVCTRL12_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL12: HEVENT Position       */\r
+#define SCT_EVCTRL12_HEVENT_Msk                               (0x01UL << SCT_EVCTRL12_HEVENT_Pos)                       /*!< SCT EVCTRL12: HEVENT Mask           */\r
+#define SCT_EVCTRL12_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL12: OUTSEL Position       */\r
+#define SCT_EVCTRL12_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL12_OUTSEL_Pos)                       /*!< SCT EVCTRL12: OUTSEL Mask           */\r
+#define SCT_EVCTRL12_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL12: IOSEL Position        */\r
+#define SCT_EVCTRL12_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL12_IOSEL_Pos)                        /*!< SCT EVCTRL12: IOSEL Mask            */\r
+#define SCT_EVCTRL12_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL12: IOCOND Position       */\r
+#define SCT_EVCTRL12_IOCOND_Msk                               (0x03UL << SCT_EVCTRL12_IOCOND_Pos)                       /*!< SCT EVCTRL12: IOCOND Mask           */\r
+#define SCT_EVCTRL12_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL12: COMBMODE Position     */\r
+#define SCT_EVCTRL12_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL12_COMBMODE_Pos)                     /*!< SCT EVCTRL12: COMBMODE Mask         */\r
+#define SCT_EVCTRL12_STATELD_Pos                              14                                                        /*!< SCT EVCTRL12: STATELD Position      */\r
+#define SCT_EVCTRL12_STATELD_Msk                              (0x01UL << SCT_EVCTRL12_STATELD_Pos)                      /*!< SCT EVCTRL12: STATELD Mask          */\r
+#define SCT_EVCTRL12_STATEV_Pos                               15                                                        /*!< SCT EVCTRL12: STATEV Position       */\r
+#define SCT_EVCTRL12_STATEV_Msk                               (0x1fUL << SCT_EVCTRL12_STATEV_Pos)                       /*!< SCT EVCTRL12: STATEV Mask           */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK13  ----------------------------------------\r
+#define SCT_EVSTATEMSK13_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK13: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK13: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK13: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK13: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK13: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK13: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK13: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK13: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK13: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK13: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK13_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK13: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK13_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK13: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK13: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK13: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK13: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK13: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK13: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK13: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK13: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK13: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK13: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK13: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK13: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK13: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK13: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK13: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK13: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK13: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK13: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK13: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK13: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK13: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK13_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK13: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK13_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK13_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK13: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL13  ------------------------------------------\r
+#define SCT_EVCTRL13_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL13: MATCHSEL Position     */\r
+#define SCT_EVCTRL13_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL13_MATCHSEL_Pos)                     /*!< SCT EVCTRL13: MATCHSEL Mask         */\r
+#define SCT_EVCTRL13_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL13: HEVENT Position       */\r
+#define SCT_EVCTRL13_HEVENT_Msk                               (0x01UL << SCT_EVCTRL13_HEVENT_Pos)                       /*!< SCT EVCTRL13: HEVENT Mask           */\r
+#define SCT_EVCTRL13_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL13: OUTSEL Position       */\r
+#define SCT_EVCTRL13_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL13_OUTSEL_Pos)                       /*!< SCT EVCTRL13: OUTSEL Mask           */\r
+#define SCT_EVCTRL13_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL13: IOSEL Position        */\r
+#define SCT_EVCTRL13_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL13_IOSEL_Pos)                        /*!< SCT EVCTRL13: IOSEL Mask            */\r
+#define SCT_EVCTRL13_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL13: IOCOND Position       */\r
+#define SCT_EVCTRL13_IOCOND_Msk                               (0x03UL << SCT_EVCTRL13_IOCOND_Pos)                       /*!< SCT EVCTRL13: IOCOND Mask           */\r
+#define SCT_EVCTRL13_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL13: COMBMODE Position     */\r
+#define SCT_EVCTRL13_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL13_COMBMODE_Pos)                     /*!< SCT EVCTRL13: COMBMODE Mask         */\r
+#define SCT_EVCTRL13_STATELD_Pos                              14                                                        /*!< SCT EVCTRL13: STATELD Position      */\r
+#define SCT_EVCTRL13_STATELD_Msk                              (0x01UL << SCT_EVCTRL13_STATELD_Pos)                      /*!< SCT EVCTRL13: STATELD Mask          */\r
+#define SCT_EVCTRL13_STATEV_Pos                               15                                                        /*!< SCT EVCTRL13: STATEV Position       */\r
+#define SCT_EVCTRL13_STATEV_Msk                               (0x1fUL << SCT_EVCTRL13_STATEV_Pos)                       /*!< SCT EVCTRL13: STATEV Mask           */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK14  ----------------------------------------\r
+#define SCT_EVSTATEMSK14_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK14: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK14: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK14: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK14: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK14: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK14: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK14: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK14: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK14: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK14: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK14_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK14: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK14_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK14: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK14: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK14: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK14: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK14: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK14: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK14: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK14: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK14: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK14: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK14: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK14: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK14: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK14: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK14: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK14: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK14: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK14: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK14: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK14: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK14: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK14_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK14: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK14_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK14_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK14: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL14  ------------------------------------------\r
+#define SCT_EVCTRL14_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL14: MATCHSEL Position     */\r
+#define SCT_EVCTRL14_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL14_MATCHSEL_Pos)                     /*!< SCT EVCTRL14: MATCHSEL Mask         */\r
+#define SCT_EVCTRL14_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL14: HEVENT Position       */\r
+#define SCT_EVCTRL14_HEVENT_Msk                               (0x01UL << SCT_EVCTRL14_HEVENT_Pos)                       /*!< SCT EVCTRL14: HEVENT Mask           */\r
+#define SCT_EVCTRL14_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL14: OUTSEL Position       */\r
+#define SCT_EVCTRL14_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL14_OUTSEL_Pos)                       /*!< SCT EVCTRL14: OUTSEL Mask           */\r
+#define SCT_EVCTRL14_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL14: IOSEL Position        */\r
+#define SCT_EVCTRL14_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL14_IOSEL_Pos)                        /*!< SCT EVCTRL14: IOSEL Mask            */\r
+#define SCT_EVCTRL14_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL14: IOCOND Position       */\r
+#define SCT_EVCTRL14_IOCOND_Msk                               (0x03UL << SCT_EVCTRL14_IOCOND_Pos)                       /*!< SCT EVCTRL14: IOCOND Mask           */\r
+#define SCT_EVCTRL14_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL14: COMBMODE Position     */\r
+#define SCT_EVCTRL14_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL14_COMBMODE_Pos)                     /*!< SCT EVCTRL14: COMBMODE Mask         */\r
+#define SCT_EVCTRL14_STATELD_Pos                              14                                                        /*!< SCT EVCTRL14: STATELD Position      */\r
+#define SCT_EVCTRL14_STATELD_Msk                              (0x01UL << SCT_EVCTRL14_STATELD_Pos)                      /*!< SCT EVCTRL14: STATELD Mask          */\r
+#define SCT_EVCTRL14_STATEV_Pos                               15                                                        /*!< SCT EVCTRL14: STATEV Position       */\r
+#define SCT_EVCTRL14_STATEV_Msk                               (0x1fUL << SCT_EVCTRL14_STATEV_Pos)                       /*!< SCT EVCTRL14: STATEV Mask           */\r
+\r
+// ------------------------------------  SCT_EVSTATEMSK15  ----------------------------------------\r
+#define SCT_EVSTATEMSK15_STATEMSKn0_Pos                       0                                                         /*!< SCT EVSTATEMSK15: STATEMSKn0 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn0_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn0_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn0 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn1_Pos                       1                                                         /*!< SCT EVSTATEMSK15: STATEMSKn1 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn1_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn1_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn1 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn2_Pos                       2                                                         /*!< SCT EVSTATEMSK15: STATEMSKn2 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn2_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn2_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn2 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn3_Pos                       3                                                         /*!< SCT EVSTATEMSK15: STATEMSKn3 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn3_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn3_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn3 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn4_Pos                       4                                                         /*!< SCT EVSTATEMSK15: STATEMSKn4 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn4_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn4_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn4 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn5_Pos                       5                                                         /*!< SCT EVSTATEMSK15: STATEMSKn5 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn5_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn5_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn5 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn6_Pos                       6                                                         /*!< SCT EVSTATEMSK15: STATEMSKn6 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn6_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn6_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn6 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn7_Pos                       7                                                         /*!< SCT EVSTATEMSK15: STATEMSKn7 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn7_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn7_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn7 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn8_Pos                       8                                                         /*!< SCT EVSTATEMSK15: STATEMSKn8 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn8_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn8_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn8 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn9_Pos                       9                                                         /*!< SCT EVSTATEMSK15: STATEMSKn9 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn9_Msk                       (0x01UL << SCT_EVSTATEMSK15_STATEMSKn9_Pos)               /*!< SCT EVSTATEMSK15: STATEMSKn9 Mask   */\r
+#define SCT_EVSTATEMSK15_STATEMSKn10_Pos                      10                                                        /*!< SCT EVSTATEMSK15: STATEMSKn10 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn10_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn10_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn10 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn11_Pos                      11                                                        /*!< SCT EVSTATEMSK15: STATEMSKn11 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn11_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn11_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn11 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn12_Pos                      12                                                        /*!< SCT EVSTATEMSK15: STATEMSKn12 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn12_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn12_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn12 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn13_Pos                      13                                                        /*!< SCT EVSTATEMSK15: STATEMSKn13 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn13_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn13_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn13 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn14_Pos                      14                                                        /*!< SCT EVSTATEMSK15: STATEMSKn14 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn14_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn14_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn14 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn15_Pos                      15                                                        /*!< SCT EVSTATEMSK15: STATEMSKn15 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn15_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn15_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn15 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn16_Pos                      16                                                        /*!< SCT EVSTATEMSK15: STATEMSKn16 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn16_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn16_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn16 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn17_Pos                      17                                                        /*!< SCT EVSTATEMSK15: STATEMSKn17 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn17_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn17_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn17 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn18_Pos                      18                                                        /*!< SCT EVSTATEMSK15: STATEMSKn18 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn18_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn18_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn18 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn19_Pos                      19                                                        /*!< SCT EVSTATEMSK15: STATEMSKn19 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn19_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn19_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn19 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn20_Pos                      20                                                        /*!< SCT EVSTATEMSK15: STATEMSKn20 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn20_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn20_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn20 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn21_Pos                      21                                                        /*!< SCT EVSTATEMSK15: STATEMSKn21 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn21_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn21_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn21 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn22_Pos                      22                                                        /*!< SCT EVSTATEMSK15: STATEMSKn22 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn22_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn22_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn22 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn23_Pos                      23                                                        /*!< SCT EVSTATEMSK15: STATEMSKn23 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn23_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn23_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn23 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn24_Pos                      24                                                        /*!< SCT EVSTATEMSK15: STATEMSKn24 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn24_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn24_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn24 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn25_Pos                      25                                                        /*!< SCT EVSTATEMSK15: STATEMSKn25 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn25_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn25_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn25 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn26_Pos                      26                                                        /*!< SCT EVSTATEMSK15: STATEMSKn26 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn26_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn26_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn26 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn27_Pos                      27                                                        /*!< SCT EVSTATEMSK15: STATEMSKn27 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn27_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn27_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn27 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn28_Pos                      28                                                        /*!< SCT EVSTATEMSK15: STATEMSKn28 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn28_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn28_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn28 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn29_Pos                      29                                                        /*!< SCT EVSTATEMSK15: STATEMSKn29 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn29_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn29_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn29 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn30_Pos                      30                                                        /*!< SCT EVSTATEMSK15: STATEMSKn30 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn30_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn30_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn30 Mask  */\r
+#define SCT_EVSTATEMSK15_STATEMSKn31_Pos                      31                                                        /*!< SCT EVSTATEMSK15: STATEMSKn31 Position */\r
+#define SCT_EVSTATEMSK15_STATEMSKn31_Msk                      (0x01UL << SCT_EVSTATEMSK15_STATEMSKn31_Pos)              /*!< SCT EVSTATEMSK15: STATEMSKn31 Mask  */\r
+\r
+// --------------------------------------  SCT_EVCTRL15  ------------------------------------------\r
+#define SCT_EVCTRL15_MATCHSEL_Pos                             0                                                         /*!< SCT EVCTRL15: MATCHSEL Position     */\r
+#define SCT_EVCTRL15_MATCHSEL_Msk                             (0x0fUL << SCT_EVCTRL15_MATCHSEL_Pos)                     /*!< SCT EVCTRL15: MATCHSEL Mask         */\r
+#define SCT_EVCTRL15_HEVENT_Pos                               4                                                         /*!< SCT EVCTRL15: HEVENT Position       */\r
+#define SCT_EVCTRL15_HEVENT_Msk                               (0x01UL << SCT_EVCTRL15_HEVENT_Pos)                       /*!< SCT EVCTRL15: HEVENT Mask           */\r
+#define SCT_EVCTRL15_OUTSEL_Pos                               5                                                         /*!< SCT EVCTRL15: OUTSEL Position       */\r
+#define SCT_EVCTRL15_OUTSEL_Msk                               (0x01UL << SCT_EVCTRL15_OUTSEL_Pos)                       /*!< SCT EVCTRL15: OUTSEL Mask           */\r
+#define SCT_EVCTRL15_IOSEL_Pos                                6                                                         /*!< SCT EVCTRL15: IOSEL Position        */\r
+#define SCT_EVCTRL15_IOSEL_Msk                                (0x0fUL << SCT_EVCTRL15_IOSEL_Pos)                        /*!< SCT EVCTRL15: IOSEL Mask            */\r
+#define SCT_EVCTRL15_IOCOND_Pos                               10                                                        /*!< SCT EVCTRL15: IOCOND Position       */\r
+#define SCT_EVCTRL15_IOCOND_Msk                               (0x03UL << SCT_EVCTRL15_IOCOND_Pos)                       /*!< SCT EVCTRL15: IOCOND Mask           */\r
+#define SCT_EVCTRL15_COMBMODE_Pos                             12                                                        /*!< SCT EVCTRL15: COMBMODE Position     */\r
+#define SCT_EVCTRL15_COMBMODE_Msk                             (0x03UL << SCT_EVCTRL15_COMBMODE_Pos)                     /*!< SCT EVCTRL15: COMBMODE Mask         */\r
+#define SCT_EVCTRL15_STATELD_Pos                              14                                                        /*!< SCT EVCTRL15: STATELD Position      */\r
+#define SCT_EVCTRL15_STATELD_Msk                              (0x01UL << SCT_EVCTRL15_STATELD_Pos)                      /*!< SCT EVCTRL15: STATELD Mask          */\r
+#define SCT_EVCTRL15_STATEV_Pos                               15                                                        /*!< SCT EVCTRL15: STATEV Position       */\r
+#define SCT_EVCTRL15_STATEV_Msk                               (0x1fUL << SCT_EVCTRL15_STATEV_Pos)                       /*!< SCT EVCTRL15: STATEV Mask           */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET0  -----------------------------------------\r
+#define SCT_OUTPUTSET0_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET0: SETn0 Position      */\r
+#define SCT_OUTPUTSET0_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn0_Pos)                      /*!< SCT OUTPUTSET0: SETn0 Mask          */\r
+#define SCT_OUTPUTSET0_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET0: SETn1 Position      */\r
+#define SCT_OUTPUTSET0_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn1_Pos)                      /*!< SCT OUTPUTSET0: SETn1 Mask          */\r
+#define SCT_OUTPUTSET0_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET0: SETn2 Position      */\r
+#define SCT_OUTPUTSET0_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn2_Pos)                      /*!< SCT OUTPUTSET0: SETn2 Mask          */\r
+#define SCT_OUTPUTSET0_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET0: SETn3 Position      */\r
+#define SCT_OUTPUTSET0_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn3_Pos)                      /*!< SCT OUTPUTSET0: SETn3 Mask          */\r
+#define SCT_OUTPUTSET0_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET0: SETn4 Position      */\r
+#define SCT_OUTPUTSET0_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn4_Pos)                      /*!< SCT OUTPUTSET0: SETn4 Mask          */\r
+#define SCT_OUTPUTSET0_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET0: SETn5 Position      */\r
+#define SCT_OUTPUTSET0_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn5_Pos)                      /*!< SCT OUTPUTSET0: SETn5 Mask          */\r
+#define SCT_OUTPUTSET0_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET0: SETn6 Position      */\r
+#define SCT_OUTPUTSET0_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn6_Pos)                      /*!< SCT OUTPUTSET0: SETn6 Mask          */\r
+#define SCT_OUTPUTSET0_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET0: SETn7 Position      */\r
+#define SCT_OUTPUTSET0_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn7_Pos)                      /*!< SCT OUTPUTSET0: SETn7 Mask          */\r
+#define SCT_OUTPUTSET0_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET0: SETn8 Position      */\r
+#define SCT_OUTPUTSET0_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn8_Pos)                      /*!< SCT OUTPUTSET0: SETn8 Mask          */\r
+#define SCT_OUTPUTSET0_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET0: SETn9 Position      */\r
+#define SCT_OUTPUTSET0_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET0_SETn9_Pos)                      /*!< SCT OUTPUTSET0: SETn9 Mask          */\r
+#define SCT_OUTPUTSET0_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET0: SETn10 Position     */\r
+#define SCT_OUTPUTSET0_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn10_Pos)                     /*!< SCT OUTPUTSET0: SETn10 Mask         */\r
+#define SCT_OUTPUTSET0_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET0: SETn11 Position     */\r
+#define SCT_OUTPUTSET0_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn11_Pos)                     /*!< SCT OUTPUTSET0: SETn11 Mask         */\r
+#define SCT_OUTPUTSET0_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET0: SETn12 Position     */\r
+#define SCT_OUTPUTSET0_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn12_Pos)                     /*!< SCT OUTPUTSET0: SETn12 Mask         */\r
+#define SCT_OUTPUTSET0_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET0: SETn13 Position     */\r
+#define SCT_OUTPUTSET0_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn13_Pos)                     /*!< SCT OUTPUTSET0: SETn13 Mask         */\r
+#define SCT_OUTPUTSET0_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET0: SETn14 Position     */\r
+#define SCT_OUTPUTSET0_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn14_Pos)                     /*!< SCT OUTPUTSET0: SETn14 Mask         */\r
+#define SCT_OUTPUTSET0_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET0: SETn15 Position     */\r
+#define SCT_OUTPUTSET0_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET0_SETn15_Pos)                     /*!< SCT OUTPUTSET0: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR0  -----------------------------------------\r
+#define SCT_OUTPUTCLR0_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR0: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn0_Pos)                      /*!< SCT OUTPUTCLR0: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR0: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn1_Pos)                      /*!< SCT OUTPUTCLR0: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR0: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn2_Pos)                      /*!< SCT OUTPUTCLR0: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR0: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn3_Pos)                      /*!< SCT OUTPUTCLR0: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR0: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn4_Pos)                      /*!< SCT OUTPUTCLR0: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR0: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn5_Pos)                      /*!< SCT OUTPUTCLR0: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR0: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn6_Pos)                      /*!< SCT OUTPUTCLR0: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR0: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn7_Pos)                      /*!< SCT OUTPUTCLR0: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR0: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn8_Pos)                      /*!< SCT OUTPUTCLR0: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR0: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR0_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR0_CLRn9_Pos)                      /*!< SCT OUTPUTCLR0: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR0_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR0: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn10_Pos)                     /*!< SCT OUTPUTCLR0: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR0_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR0: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn11_Pos)                     /*!< SCT OUTPUTCLR0: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR0_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR0: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn12_Pos)                     /*!< SCT OUTPUTCLR0: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR0_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR0: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn13_Pos)                     /*!< SCT OUTPUTCLR0: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR0_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR0: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn14_Pos)                     /*!< SCT OUTPUTCLR0: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR0_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR0: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR0_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR0_CLRn15_Pos)                     /*!< SCT OUTPUTCLR0: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET1  -----------------------------------------\r
+#define SCT_OUTPUTSET1_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET1: SETn0 Position      */\r
+#define SCT_OUTPUTSET1_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn0_Pos)                      /*!< SCT OUTPUTSET1: SETn0 Mask          */\r
+#define SCT_OUTPUTSET1_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET1: SETn1 Position      */\r
+#define SCT_OUTPUTSET1_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn1_Pos)                      /*!< SCT OUTPUTSET1: SETn1 Mask          */\r
+#define SCT_OUTPUTSET1_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET1: SETn2 Position      */\r
+#define SCT_OUTPUTSET1_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn2_Pos)                      /*!< SCT OUTPUTSET1: SETn2 Mask          */\r
+#define SCT_OUTPUTSET1_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET1: SETn3 Position      */\r
+#define SCT_OUTPUTSET1_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn3_Pos)                      /*!< SCT OUTPUTSET1: SETn3 Mask          */\r
+#define SCT_OUTPUTSET1_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET1: SETn4 Position      */\r
+#define SCT_OUTPUTSET1_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn4_Pos)                      /*!< SCT OUTPUTSET1: SETn4 Mask          */\r
+#define SCT_OUTPUTSET1_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET1: SETn5 Position      */\r
+#define SCT_OUTPUTSET1_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn5_Pos)                      /*!< SCT OUTPUTSET1: SETn5 Mask          */\r
+#define SCT_OUTPUTSET1_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET1: SETn6 Position      */\r
+#define SCT_OUTPUTSET1_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn6_Pos)                      /*!< SCT OUTPUTSET1: SETn6 Mask          */\r
+#define SCT_OUTPUTSET1_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET1: SETn7 Position      */\r
+#define SCT_OUTPUTSET1_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn7_Pos)                      /*!< SCT OUTPUTSET1: SETn7 Mask          */\r
+#define SCT_OUTPUTSET1_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET1: SETn8 Position      */\r
+#define SCT_OUTPUTSET1_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn8_Pos)                      /*!< SCT OUTPUTSET1: SETn8 Mask          */\r
+#define SCT_OUTPUTSET1_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET1: SETn9 Position      */\r
+#define SCT_OUTPUTSET1_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET1_SETn9_Pos)                      /*!< SCT OUTPUTSET1: SETn9 Mask          */\r
+#define SCT_OUTPUTSET1_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET1: SETn10 Position     */\r
+#define SCT_OUTPUTSET1_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn10_Pos)                     /*!< SCT OUTPUTSET1: SETn10 Mask         */\r
+#define SCT_OUTPUTSET1_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET1: SETn11 Position     */\r
+#define SCT_OUTPUTSET1_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn11_Pos)                     /*!< SCT OUTPUTSET1: SETn11 Mask         */\r
+#define SCT_OUTPUTSET1_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET1: SETn12 Position     */\r
+#define SCT_OUTPUTSET1_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn12_Pos)                     /*!< SCT OUTPUTSET1: SETn12 Mask         */\r
+#define SCT_OUTPUTSET1_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET1: SETn13 Position     */\r
+#define SCT_OUTPUTSET1_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn13_Pos)                     /*!< SCT OUTPUTSET1: SETn13 Mask         */\r
+#define SCT_OUTPUTSET1_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET1: SETn14 Position     */\r
+#define SCT_OUTPUTSET1_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn14_Pos)                     /*!< SCT OUTPUTSET1: SETn14 Mask         */\r
+#define SCT_OUTPUTSET1_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET1: SETn15 Position     */\r
+#define SCT_OUTPUTSET1_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET1_SETn15_Pos)                     /*!< SCT OUTPUTSET1: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR1  -----------------------------------------\r
+#define SCT_OUTPUTCLR1_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR1: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn0_Pos)                      /*!< SCT OUTPUTCLR1: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR1: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn1_Pos)                      /*!< SCT OUTPUTCLR1: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR1: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn2_Pos)                      /*!< SCT OUTPUTCLR1: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR1: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn3_Pos)                      /*!< SCT OUTPUTCLR1: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR1: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn4_Pos)                      /*!< SCT OUTPUTCLR1: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR1: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn5_Pos)                      /*!< SCT OUTPUTCLR1: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR1: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn6_Pos)                      /*!< SCT OUTPUTCLR1: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR1: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn7_Pos)                      /*!< SCT OUTPUTCLR1: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR1: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn8_Pos)                      /*!< SCT OUTPUTCLR1: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR1: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR1_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR1_CLRn9_Pos)                      /*!< SCT OUTPUTCLR1: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR1_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR1: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn10_Pos)                     /*!< SCT OUTPUTCLR1: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR1_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR1: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn11_Pos)                     /*!< SCT OUTPUTCLR1: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR1_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR1: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn12_Pos)                     /*!< SCT OUTPUTCLR1: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR1_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR1: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn13_Pos)                     /*!< SCT OUTPUTCLR1: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR1_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR1: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn14_Pos)                     /*!< SCT OUTPUTCLR1: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR1_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR1: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR1_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR1_CLRn15_Pos)                     /*!< SCT OUTPUTCLR1: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET2  -----------------------------------------\r
+#define SCT_OUTPUTSET2_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET2: SETn0 Position      */\r
+#define SCT_OUTPUTSET2_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn0_Pos)                      /*!< SCT OUTPUTSET2: SETn0 Mask          */\r
+#define SCT_OUTPUTSET2_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET2: SETn1 Position      */\r
+#define SCT_OUTPUTSET2_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn1_Pos)                      /*!< SCT OUTPUTSET2: SETn1 Mask          */\r
+#define SCT_OUTPUTSET2_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET2: SETn2 Position      */\r
+#define SCT_OUTPUTSET2_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn2_Pos)                      /*!< SCT OUTPUTSET2: SETn2 Mask          */\r
+#define SCT_OUTPUTSET2_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET2: SETn3 Position      */\r
+#define SCT_OUTPUTSET2_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn3_Pos)                      /*!< SCT OUTPUTSET2: SETn3 Mask          */\r
+#define SCT_OUTPUTSET2_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET2: SETn4 Position      */\r
+#define SCT_OUTPUTSET2_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn4_Pos)                      /*!< SCT OUTPUTSET2: SETn4 Mask          */\r
+#define SCT_OUTPUTSET2_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET2: SETn5 Position      */\r
+#define SCT_OUTPUTSET2_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn5_Pos)                      /*!< SCT OUTPUTSET2: SETn5 Mask          */\r
+#define SCT_OUTPUTSET2_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET2: SETn6 Position      */\r
+#define SCT_OUTPUTSET2_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn6_Pos)                      /*!< SCT OUTPUTSET2: SETn6 Mask          */\r
+#define SCT_OUTPUTSET2_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET2: SETn7 Position      */\r
+#define SCT_OUTPUTSET2_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn7_Pos)                      /*!< SCT OUTPUTSET2: SETn7 Mask          */\r
+#define SCT_OUTPUTSET2_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET2: SETn8 Position      */\r
+#define SCT_OUTPUTSET2_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn8_Pos)                      /*!< SCT OUTPUTSET2: SETn8 Mask          */\r
+#define SCT_OUTPUTSET2_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET2: SETn9 Position      */\r
+#define SCT_OUTPUTSET2_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET2_SETn9_Pos)                      /*!< SCT OUTPUTSET2: SETn9 Mask          */\r
+#define SCT_OUTPUTSET2_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET2: SETn10 Position     */\r
+#define SCT_OUTPUTSET2_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn10_Pos)                     /*!< SCT OUTPUTSET2: SETn10 Mask         */\r
+#define SCT_OUTPUTSET2_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET2: SETn11 Position     */\r
+#define SCT_OUTPUTSET2_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn11_Pos)                     /*!< SCT OUTPUTSET2: SETn11 Mask         */\r
+#define SCT_OUTPUTSET2_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET2: SETn12 Position     */\r
+#define SCT_OUTPUTSET2_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn12_Pos)                     /*!< SCT OUTPUTSET2: SETn12 Mask         */\r
+#define SCT_OUTPUTSET2_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET2: SETn13 Position     */\r
+#define SCT_OUTPUTSET2_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn13_Pos)                     /*!< SCT OUTPUTSET2: SETn13 Mask         */\r
+#define SCT_OUTPUTSET2_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET2: SETn14 Position     */\r
+#define SCT_OUTPUTSET2_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn14_Pos)                     /*!< SCT OUTPUTSET2: SETn14 Mask         */\r
+#define SCT_OUTPUTSET2_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET2: SETn15 Position     */\r
+#define SCT_OUTPUTSET2_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET2_SETn15_Pos)                     /*!< SCT OUTPUTSET2: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR2  -----------------------------------------\r
+#define SCT_OUTPUTCLR2_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR2: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn0_Pos)                      /*!< SCT OUTPUTCLR2: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR2: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn1_Pos)                      /*!< SCT OUTPUTCLR2: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR2: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn2_Pos)                      /*!< SCT OUTPUTCLR2: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR2: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn3_Pos)                      /*!< SCT OUTPUTCLR2: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR2: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn4_Pos)                      /*!< SCT OUTPUTCLR2: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR2: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn5_Pos)                      /*!< SCT OUTPUTCLR2: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR2: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn6_Pos)                      /*!< SCT OUTPUTCLR2: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR2: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn7_Pos)                      /*!< SCT OUTPUTCLR2: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR2: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn8_Pos)                      /*!< SCT OUTPUTCLR2: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR2: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR2_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR2_CLRn9_Pos)                      /*!< SCT OUTPUTCLR2: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR2_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR2: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn10_Pos)                     /*!< SCT OUTPUTCLR2: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR2_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR2: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn11_Pos)                     /*!< SCT OUTPUTCLR2: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR2_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR2: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn12_Pos)                     /*!< SCT OUTPUTCLR2: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR2_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR2: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn13_Pos)                     /*!< SCT OUTPUTCLR2: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR2_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR2: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn14_Pos)                     /*!< SCT OUTPUTCLR2: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR2_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR2: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR2_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR2_CLRn15_Pos)                     /*!< SCT OUTPUTCLR2: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET3  -----------------------------------------\r
+#define SCT_OUTPUTSET3_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET3: SETn0 Position      */\r
+#define SCT_OUTPUTSET3_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn0_Pos)                      /*!< SCT OUTPUTSET3: SETn0 Mask          */\r
+#define SCT_OUTPUTSET3_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET3: SETn1 Position      */\r
+#define SCT_OUTPUTSET3_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn1_Pos)                      /*!< SCT OUTPUTSET3: SETn1 Mask          */\r
+#define SCT_OUTPUTSET3_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET3: SETn2 Position      */\r
+#define SCT_OUTPUTSET3_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn2_Pos)                      /*!< SCT OUTPUTSET3: SETn2 Mask          */\r
+#define SCT_OUTPUTSET3_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET3: SETn3 Position      */\r
+#define SCT_OUTPUTSET3_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn3_Pos)                      /*!< SCT OUTPUTSET3: SETn3 Mask          */\r
+#define SCT_OUTPUTSET3_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET3: SETn4 Position      */\r
+#define SCT_OUTPUTSET3_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn4_Pos)                      /*!< SCT OUTPUTSET3: SETn4 Mask          */\r
+#define SCT_OUTPUTSET3_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET3: SETn5 Position      */\r
+#define SCT_OUTPUTSET3_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn5_Pos)                      /*!< SCT OUTPUTSET3: SETn5 Mask          */\r
+#define SCT_OUTPUTSET3_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET3: SETn6 Position      */\r
+#define SCT_OUTPUTSET3_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn6_Pos)                      /*!< SCT OUTPUTSET3: SETn6 Mask          */\r
+#define SCT_OUTPUTSET3_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET3: SETn7 Position      */\r
+#define SCT_OUTPUTSET3_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn7_Pos)                      /*!< SCT OUTPUTSET3: SETn7 Mask          */\r
+#define SCT_OUTPUTSET3_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET3: SETn8 Position      */\r
+#define SCT_OUTPUTSET3_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn8_Pos)                      /*!< SCT OUTPUTSET3: SETn8 Mask          */\r
+#define SCT_OUTPUTSET3_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET3: SETn9 Position      */\r
+#define SCT_OUTPUTSET3_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET3_SETn9_Pos)                      /*!< SCT OUTPUTSET3: SETn9 Mask          */\r
+#define SCT_OUTPUTSET3_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET3: SETn10 Position     */\r
+#define SCT_OUTPUTSET3_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn10_Pos)                     /*!< SCT OUTPUTSET3: SETn10 Mask         */\r
+#define SCT_OUTPUTSET3_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET3: SETn11 Position     */\r
+#define SCT_OUTPUTSET3_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn11_Pos)                     /*!< SCT OUTPUTSET3: SETn11 Mask         */\r
+#define SCT_OUTPUTSET3_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET3: SETn12 Position     */\r
+#define SCT_OUTPUTSET3_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn12_Pos)                     /*!< SCT OUTPUTSET3: SETn12 Mask         */\r
+#define SCT_OUTPUTSET3_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET3: SETn13 Position     */\r
+#define SCT_OUTPUTSET3_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn13_Pos)                     /*!< SCT OUTPUTSET3: SETn13 Mask         */\r
+#define SCT_OUTPUTSET3_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET3: SETn14 Position     */\r
+#define SCT_OUTPUTSET3_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn14_Pos)                     /*!< SCT OUTPUTSET3: SETn14 Mask         */\r
+#define SCT_OUTPUTSET3_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET3: SETn15 Position     */\r
+#define SCT_OUTPUTSET3_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET3_SETn15_Pos)                     /*!< SCT OUTPUTSET3: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR3  -----------------------------------------\r
+#define SCT_OUTPUTCLR3_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR3: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn0_Pos)                      /*!< SCT OUTPUTCLR3: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR3: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn1_Pos)                      /*!< SCT OUTPUTCLR3: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR3: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn2_Pos)                      /*!< SCT OUTPUTCLR3: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR3: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn3_Pos)                      /*!< SCT OUTPUTCLR3: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR3: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn4_Pos)                      /*!< SCT OUTPUTCLR3: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR3: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn5_Pos)                      /*!< SCT OUTPUTCLR3: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR3: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn6_Pos)                      /*!< SCT OUTPUTCLR3: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR3: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn7_Pos)                      /*!< SCT OUTPUTCLR3: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR3: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn8_Pos)                      /*!< SCT OUTPUTCLR3: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR3: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR3_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR3_CLRn9_Pos)                      /*!< SCT OUTPUTCLR3: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR3_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR3: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn10_Pos)                     /*!< SCT OUTPUTCLR3: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR3_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR3: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn11_Pos)                     /*!< SCT OUTPUTCLR3: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR3_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR3: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn12_Pos)                     /*!< SCT OUTPUTCLR3: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR3_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR3: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn13_Pos)                     /*!< SCT OUTPUTCLR3: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR3_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR3: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn14_Pos)                     /*!< SCT OUTPUTCLR3: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR3_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR3: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR3_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR3_CLRn15_Pos)                     /*!< SCT OUTPUTCLR3: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET4  -----------------------------------------\r
+#define SCT_OUTPUTSET4_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET4: SETn0 Position      */\r
+#define SCT_OUTPUTSET4_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn0_Pos)                      /*!< SCT OUTPUTSET4: SETn0 Mask          */\r
+#define SCT_OUTPUTSET4_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET4: SETn1 Position      */\r
+#define SCT_OUTPUTSET4_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn1_Pos)                      /*!< SCT OUTPUTSET4: SETn1 Mask          */\r
+#define SCT_OUTPUTSET4_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET4: SETn2 Position      */\r
+#define SCT_OUTPUTSET4_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn2_Pos)                      /*!< SCT OUTPUTSET4: SETn2 Mask          */\r
+#define SCT_OUTPUTSET4_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET4: SETn3 Position      */\r
+#define SCT_OUTPUTSET4_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn3_Pos)                      /*!< SCT OUTPUTSET4: SETn3 Mask          */\r
+#define SCT_OUTPUTSET4_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET4: SETn4 Position      */\r
+#define SCT_OUTPUTSET4_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn4_Pos)                      /*!< SCT OUTPUTSET4: SETn4 Mask          */\r
+#define SCT_OUTPUTSET4_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET4: SETn5 Position      */\r
+#define SCT_OUTPUTSET4_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn5_Pos)                      /*!< SCT OUTPUTSET4: SETn5 Mask          */\r
+#define SCT_OUTPUTSET4_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET4: SETn6 Position      */\r
+#define SCT_OUTPUTSET4_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn6_Pos)                      /*!< SCT OUTPUTSET4: SETn6 Mask          */\r
+#define SCT_OUTPUTSET4_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET4: SETn7 Position      */\r
+#define SCT_OUTPUTSET4_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn7_Pos)                      /*!< SCT OUTPUTSET4: SETn7 Mask          */\r
+#define SCT_OUTPUTSET4_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET4: SETn8 Position      */\r
+#define SCT_OUTPUTSET4_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn8_Pos)                      /*!< SCT OUTPUTSET4: SETn8 Mask          */\r
+#define SCT_OUTPUTSET4_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET4: SETn9 Position      */\r
+#define SCT_OUTPUTSET4_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET4_SETn9_Pos)                      /*!< SCT OUTPUTSET4: SETn9 Mask          */\r
+#define SCT_OUTPUTSET4_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET4: SETn10 Position     */\r
+#define SCT_OUTPUTSET4_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn10_Pos)                     /*!< SCT OUTPUTSET4: SETn10 Mask         */\r
+#define SCT_OUTPUTSET4_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET4: SETn11 Position     */\r
+#define SCT_OUTPUTSET4_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn11_Pos)                     /*!< SCT OUTPUTSET4: SETn11 Mask         */\r
+#define SCT_OUTPUTSET4_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET4: SETn12 Position     */\r
+#define SCT_OUTPUTSET4_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn12_Pos)                     /*!< SCT OUTPUTSET4: SETn12 Mask         */\r
+#define SCT_OUTPUTSET4_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET4: SETn13 Position     */\r
+#define SCT_OUTPUTSET4_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn13_Pos)                     /*!< SCT OUTPUTSET4: SETn13 Mask         */\r
+#define SCT_OUTPUTSET4_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET4: SETn14 Position     */\r
+#define SCT_OUTPUTSET4_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn14_Pos)                     /*!< SCT OUTPUTSET4: SETn14 Mask         */\r
+#define SCT_OUTPUTSET4_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET4: SETn15 Position     */\r
+#define SCT_OUTPUTSET4_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET4_SETn15_Pos)                     /*!< SCT OUTPUTSET4: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR4  -----------------------------------------\r
+#define SCT_OUTPUTCLR4_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR4: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn0_Pos)                      /*!< SCT OUTPUTCLR4: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR4: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn1_Pos)                      /*!< SCT OUTPUTCLR4: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR4: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn2_Pos)                      /*!< SCT OUTPUTCLR4: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR4: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn3_Pos)                      /*!< SCT OUTPUTCLR4: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR4: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn4_Pos)                      /*!< SCT OUTPUTCLR4: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR4: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn5_Pos)                      /*!< SCT OUTPUTCLR4: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR4: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn6_Pos)                      /*!< SCT OUTPUTCLR4: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR4: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn7_Pos)                      /*!< SCT OUTPUTCLR4: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR4: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn8_Pos)                      /*!< SCT OUTPUTCLR4: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR4: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR4_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR4_CLRn9_Pos)                      /*!< SCT OUTPUTCLR4: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR4_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR4: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn10_Pos)                     /*!< SCT OUTPUTCLR4: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR4_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR4: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn11_Pos)                     /*!< SCT OUTPUTCLR4: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR4_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR4: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn12_Pos)                     /*!< SCT OUTPUTCLR4: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR4_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR4: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn13_Pos)                     /*!< SCT OUTPUTCLR4: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR4_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR4: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn14_Pos)                     /*!< SCT OUTPUTCLR4: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR4_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR4: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR4_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR4_CLRn15_Pos)                     /*!< SCT OUTPUTCLR4: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET5  -----------------------------------------\r
+#define SCT_OUTPUTSET5_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET5: SETn0 Position      */\r
+#define SCT_OUTPUTSET5_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn0_Pos)                      /*!< SCT OUTPUTSET5: SETn0 Mask          */\r
+#define SCT_OUTPUTSET5_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET5: SETn1 Position      */\r
+#define SCT_OUTPUTSET5_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn1_Pos)                      /*!< SCT OUTPUTSET5: SETn1 Mask          */\r
+#define SCT_OUTPUTSET5_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET5: SETn2 Position      */\r
+#define SCT_OUTPUTSET5_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn2_Pos)                      /*!< SCT OUTPUTSET5: SETn2 Mask          */\r
+#define SCT_OUTPUTSET5_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET5: SETn3 Position      */\r
+#define SCT_OUTPUTSET5_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn3_Pos)                      /*!< SCT OUTPUTSET5: SETn3 Mask          */\r
+#define SCT_OUTPUTSET5_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET5: SETn4 Position      */\r
+#define SCT_OUTPUTSET5_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn4_Pos)                      /*!< SCT OUTPUTSET5: SETn4 Mask          */\r
+#define SCT_OUTPUTSET5_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET5: SETn5 Position      */\r
+#define SCT_OUTPUTSET5_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn5_Pos)                      /*!< SCT OUTPUTSET5: SETn5 Mask          */\r
+#define SCT_OUTPUTSET5_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET5: SETn6 Position      */\r
+#define SCT_OUTPUTSET5_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn6_Pos)                      /*!< SCT OUTPUTSET5: SETn6 Mask          */\r
+#define SCT_OUTPUTSET5_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET5: SETn7 Position      */\r
+#define SCT_OUTPUTSET5_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn7_Pos)                      /*!< SCT OUTPUTSET5: SETn7 Mask          */\r
+#define SCT_OUTPUTSET5_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET5: SETn8 Position      */\r
+#define SCT_OUTPUTSET5_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn8_Pos)                      /*!< SCT OUTPUTSET5: SETn8 Mask          */\r
+#define SCT_OUTPUTSET5_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET5: SETn9 Position      */\r
+#define SCT_OUTPUTSET5_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET5_SETn9_Pos)                      /*!< SCT OUTPUTSET5: SETn9 Mask          */\r
+#define SCT_OUTPUTSET5_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET5: SETn10 Position     */\r
+#define SCT_OUTPUTSET5_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn10_Pos)                     /*!< SCT OUTPUTSET5: SETn10 Mask         */\r
+#define SCT_OUTPUTSET5_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET5: SETn11 Position     */\r
+#define SCT_OUTPUTSET5_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn11_Pos)                     /*!< SCT OUTPUTSET5: SETn11 Mask         */\r
+#define SCT_OUTPUTSET5_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET5: SETn12 Position     */\r
+#define SCT_OUTPUTSET5_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn12_Pos)                     /*!< SCT OUTPUTSET5: SETn12 Mask         */\r
+#define SCT_OUTPUTSET5_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET5: SETn13 Position     */\r
+#define SCT_OUTPUTSET5_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn13_Pos)                     /*!< SCT OUTPUTSET5: SETn13 Mask         */\r
+#define SCT_OUTPUTSET5_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET5: SETn14 Position     */\r
+#define SCT_OUTPUTSET5_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn14_Pos)                     /*!< SCT OUTPUTSET5: SETn14 Mask         */\r
+#define SCT_OUTPUTSET5_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET5: SETn15 Position     */\r
+#define SCT_OUTPUTSET5_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET5_SETn15_Pos)                     /*!< SCT OUTPUTSET5: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR5  -----------------------------------------\r
+#define SCT_OUTPUTCLR5_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR5: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn0_Pos)                      /*!< SCT OUTPUTCLR5: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR5: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn1_Pos)                      /*!< SCT OUTPUTCLR5: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR5: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn2_Pos)                      /*!< SCT OUTPUTCLR5: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR5: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn3_Pos)                      /*!< SCT OUTPUTCLR5: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR5: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn4_Pos)                      /*!< SCT OUTPUTCLR5: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR5: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn5_Pos)                      /*!< SCT OUTPUTCLR5: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR5: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn6_Pos)                      /*!< SCT OUTPUTCLR5: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR5: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn7_Pos)                      /*!< SCT OUTPUTCLR5: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR5: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn8_Pos)                      /*!< SCT OUTPUTCLR5: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR5: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR5_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR5_CLRn9_Pos)                      /*!< SCT OUTPUTCLR5: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR5_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR5: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn10_Pos)                     /*!< SCT OUTPUTCLR5: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR5_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR5: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn11_Pos)                     /*!< SCT OUTPUTCLR5: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR5_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR5: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn12_Pos)                     /*!< SCT OUTPUTCLR5: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR5_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR5: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn13_Pos)                     /*!< SCT OUTPUTCLR5: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR5_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR5: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn14_Pos)                     /*!< SCT OUTPUTCLR5: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR5_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR5: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR5_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR5_CLRn15_Pos)                     /*!< SCT OUTPUTCLR5: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET6  -----------------------------------------\r
+#define SCT_OUTPUTSET6_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET6: SETn0 Position      */\r
+#define SCT_OUTPUTSET6_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn0_Pos)                      /*!< SCT OUTPUTSET6: SETn0 Mask          */\r
+#define SCT_OUTPUTSET6_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET6: SETn1 Position      */\r
+#define SCT_OUTPUTSET6_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn1_Pos)                      /*!< SCT OUTPUTSET6: SETn1 Mask          */\r
+#define SCT_OUTPUTSET6_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET6: SETn2 Position      */\r
+#define SCT_OUTPUTSET6_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn2_Pos)                      /*!< SCT OUTPUTSET6: SETn2 Mask          */\r
+#define SCT_OUTPUTSET6_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET6: SETn3 Position      */\r
+#define SCT_OUTPUTSET6_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn3_Pos)                      /*!< SCT OUTPUTSET6: SETn3 Mask          */\r
+#define SCT_OUTPUTSET6_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET6: SETn4 Position      */\r
+#define SCT_OUTPUTSET6_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn4_Pos)                      /*!< SCT OUTPUTSET6: SETn4 Mask          */\r
+#define SCT_OUTPUTSET6_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET6: SETn5 Position      */\r
+#define SCT_OUTPUTSET6_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn5_Pos)                      /*!< SCT OUTPUTSET6: SETn5 Mask          */\r
+#define SCT_OUTPUTSET6_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET6: SETn6 Position      */\r
+#define SCT_OUTPUTSET6_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn6_Pos)                      /*!< SCT OUTPUTSET6: SETn6 Mask          */\r
+#define SCT_OUTPUTSET6_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET6: SETn7 Position      */\r
+#define SCT_OUTPUTSET6_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn7_Pos)                      /*!< SCT OUTPUTSET6: SETn7 Mask          */\r
+#define SCT_OUTPUTSET6_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET6: SETn8 Position      */\r
+#define SCT_OUTPUTSET6_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn8_Pos)                      /*!< SCT OUTPUTSET6: SETn8 Mask          */\r
+#define SCT_OUTPUTSET6_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET6: SETn9 Position      */\r
+#define SCT_OUTPUTSET6_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET6_SETn9_Pos)                      /*!< SCT OUTPUTSET6: SETn9 Mask          */\r
+#define SCT_OUTPUTSET6_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET6: SETn10 Position     */\r
+#define SCT_OUTPUTSET6_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn10_Pos)                     /*!< SCT OUTPUTSET6: SETn10 Mask         */\r
+#define SCT_OUTPUTSET6_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET6: SETn11 Position     */\r
+#define SCT_OUTPUTSET6_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn11_Pos)                     /*!< SCT OUTPUTSET6: SETn11 Mask         */\r
+#define SCT_OUTPUTSET6_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET6: SETn12 Position     */\r
+#define SCT_OUTPUTSET6_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn12_Pos)                     /*!< SCT OUTPUTSET6: SETn12 Mask         */\r
+#define SCT_OUTPUTSET6_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET6: SETn13 Position     */\r
+#define SCT_OUTPUTSET6_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn13_Pos)                     /*!< SCT OUTPUTSET6: SETn13 Mask         */\r
+#define SCT_OUTPUTSET6_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET6: SETn14 Position     */\r
+#define SCT_OUTPUTSET6_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn14_Pos)                     /*!< SCT OUTPUTSET6: SETn14 Mask         */\r
+#define SCT_OUTPUTSET6_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET6: SETn15 Position     */\r
+#define SCT_OUTPUTSET6_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET6_SETn15_Pos)                     /*!< SCT OUTPUTSET6: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR6  -----------------------------------------\r
+#define SCT_OUTPUTCLR6_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR6: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn0_Pos)                      /*!< SCT OUTPUTCLR6: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR6: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn1_Pos)                      /*!< SCT OUTPUTCLR6: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR6: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn2_Pos)                      /*!< SCT OUTPUTCLR6: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR6: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn3_Pos)                      /*!< SCT OUTPUTCLR6: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR6: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn4_Pos)                      /*!< SCT OUTPUTCLR6: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR6: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn5_Pos)                      /*!< SCT OUTPUTCLR6: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR6: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn6_Pos)                      /*!< SCT OUTPUTCLR6: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR6: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn7_Pos)                      /*!< SCT OUTPUTCLR6: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR6: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn8_Pos)                      /*!< SCT OUTPUTCLR6: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR6: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR6_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR6_CLRn9_Pos)                      /*!< SCT OUTPUTCLR6: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR6_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR6: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn10_Pos)                     /*!< SCT OUTPUTCLR6: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR6_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR6: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn11_Pos)                     /*!< SCT OUTPUTCLR6: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR6_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR6: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn12_Pos)                     /*!< SCT OUTPUTCLR6: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR6_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR6: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn13_Pos)                     /*!< SCT OUTPUTCLR6: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR6_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR6: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn14_Pos)                     /*!< SCT OUTPUTCLR6: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR6_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR6: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR6_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR6_CLRn15_Pos)                     /*!< SCT OUTPUTCLR6: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET7  -----------------------------------------\r
+#define SCT_OUTPUTSET7_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET7: SETn0 Position      */\r
+#define SCT_OUTPUTSET7_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn0_Pos)                      /*!< SCT OUTPUTSET7: SETn0 Mask          */\r
+#define SCT_OUTPUTSET7_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET7: SETn1 Position      */\r
+#define SCT_OUTPUTSET7_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn1_Pos)                      /*!< SCT OUTPUTSET7: SETn1 Mask          */\r
+#define SCT_OUTPUTSET7_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET7: SETn2 Position      */\r
+#define SCT_OUTPUTSET7_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn2_Pos)                      /*!< SCT OUTPUTSET7: SETn2 Mask          */\r
+#define SCT_OUTPUTSET7_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET7: SETn3 Position      */\r
+#define SCT_OUTPUTSET7_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn3_Pos)                      /*!< SCT OUTPUTSET7: SETn3 Mask          */\r
+#define SCT_OUTPUTSET7_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET7: SETn4 Position      */\r
+#define SCT_OUTPUTSET7_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn4_Pos)                      /*!< SCT OUTPUTSET7: SETn4 Mask          */\r
+#define SCT_OUTPUTSET7_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET7: SETn5 Position      */\r
+#define SCT_OUTPUTSET7_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn5_Pos)                      /*!< SCT OUTPUTSET7: SETn5 Mask          */\r
+#define SCT_OUTPUTSET7_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET7: SETn6 Position      */\r
+#define SCT_OUTPUTSET7_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn6_Pos)                      /*!< SCT OUTPUTSET7: SETn6 Mask          */\r
+#define SCT_OUTPUTSET7_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET7: SETn7 Position      */\r
+#define SCT_OUTPUTSET7_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn7_Pos)                      /*!< SCT OUTPUTSET7: SETn7 Mask          */\r
+#define SCT_OUTPUTSET7_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET7: SETn8 Position      */\r
+#define SCT_OUTPUTSET7_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn8_Pos)                      /*!< SCT OUTPUTSET7: SETn8 Mask          */\r
+#define SCT_OUTPUTSET7_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET7: SETn9 Position      */\r
+#define SCT_OUTPUTSET7_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET7_SETn9_Pos)                      /*!< SCT OUTPUTSET7: SETn9 Mask          */\r
+#define SCT_OUTPUTSET7_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET7: SETn10 Position     */\r
+#define SCT_OUTPUTSET7_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn10_Pos)                     /*!< SCT OUTPUTSET7: SETn10 Mask         */\r
+#define SCT_OUTPUTSET7_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET7: SETn11 Position     */\r
+#define SCT_OUTPUTSET7_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn11_Pos)                     /*!< SCT OUTPUTSET7: SETn11 Mask         */\r
+#define SCT_OUTPUTSET7_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET7: SETn12 Position     */\r
+#define SCT_OUTPUTSET7_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn12_Pos)                     /*!< SCT OUTPUTSET7: SETn12 Mask         */\r
+#define SCT_OUTPUTSET7_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET7: SETn13 Position     */\r
+#define SCT_OUTPUTSET7_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn13_Pos)                     /*!< SCT OUTPUTSET7: SETn13 Mask         */\r
+#define SCT_OUTPUTSET7_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET7: SETn14 Position     */\r
+#define SCT_OUTPUTSET7_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn14_Pos)                     /*!< SCT OUTPUTSET7: SETn14 Mask         */\r
+#define SCT_OUTPUTSET7_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET7: SETn15 Position     */\r
+#define SCT_OUTPUTSET7_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET7_SETn15_Pos)                     /*!< SCT OUTPUTSET7: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR7  -----------------------------------------\r
+#define SCT_OUTPUTCLR7_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR7: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn0_Pos)                      /*!< SCT OUTPUTCLR7: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR7: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn1_Pos)                      /*!< SCT OUTPUTCLR7: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR7: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn2_Pos)                      /*!< SCT OUTPUTCLR7: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR7: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn3_Pos)                      /*!< SCT OUTPUTCLR7: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR7: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn4_Pos)                      /*!< SCT OUTPUTCLR7: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR7: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn5_Pos)                      /*!< SCT OUTPUTCLR7: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR7: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn6_Pos)                      /*!< SCT OUTPUTCLR7: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR7: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn7_Pos)                      /*!< SCT OUTPUTCLR7: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR7: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn8_Pos)                      /*!< SCT OUTPUTCLR7: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR7: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR7_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR7_CLRn9_Pos)                      /*!< SCT OUTPUTCLR7: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR7_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR7: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn10_Pos)                     /*!< SCT OUTPUTCLR7: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR7_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR7: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn11_Pos)                     /*!< SCT OUTPUTCLR7: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR7_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR7: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn12_Pos)                     /*!< SCT OUTPUTCLR7: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR7_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR7: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn13_Pos)                     /*!< SCT OUTPUTCLR7: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR7_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR7: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn14_Pos)                     /*!< SCT OUTPUTCLR7: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR7_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR7: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR7_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR7_CLRn15_Pos)                     /*!< SCT OUTPUTCLR7: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET8  -----------------------------------------\r
+#define SCT_OUTPUTSET8_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET8: SETn0 Position      */\r
+#define SCT_OUTPUTSET8_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn0_Pos)                      /*!< SCT OUTPUTSET8: SETn0 Mask          */\r
+#define SCT_OUTPUTSET8_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET8: SETn1 Position      */\r
+#define SCT_OUTPUTSET8_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn1_Pos)                      /*!< SCT OUTPUTSET8: SETn1 Mask          */\r
+#define SCT_OUTPUTSET8_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET8: SETn2 Position      */\r
+#define SCT_OUTPUTSET8_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn2_Pos)                      /*!< SCT OUTPUTSET8: SETn2 Mask          */\r
+#define SCT_OUTPUTSET8_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET8: SETn3 Position      */\r
+#define SCT_OUTPUTSET8_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn3_Pos)                      /*!< SCT OUTPUTSET8: SETn3 Mask          */\r
+#define SCT_OUTPUTSET8_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET8: SETn4 Position      */\r
+#define SCT_OUTPUTSET8_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn4_Pos)                      /*!< SCT OUTPUTSET8: SETn4 Mask          */\r
+#define SCT_OUTPUTSET8_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET8: SETn5 Position      */\r
+#define SCT_OUTPUTSET8_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn5_Pos)                      /*!< SCT OUTPUTSET8: SETn5 Mask          */\r
+#define SCT_OUTPUTSET8_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET8: SETn6 Position      */\r
+#define SCT_OUTPUTSET8_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn6_Pos)                      /*!< SCT OUTPUTSET8: SETn6 Mask          */\r
+#define SCT_OUTPUTSET8_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET8: SETn7 Position      */\r
+#define SCT_OUTPUTSET8_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn7_Pos)                      /*!< SCT OUTPUTSET8: SETn7 Mask          */\r
+#define SCT_OUTPUTSET8_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET8: SETn8 Position      */\r
+#define SCT_OUTPUTSET8_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn8_Pos)                      /*!< SCT OUTPUTSET8: SETn8 Mask          */\r
+#define SCT_OUTPUTSET8_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET8: SETn9 Position      */\r
+#define SCT_OUTPUTSET8_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET8_SETn9_Pos)                      /*!< SCT OUTPUTSET8: SETn9 Mask          */\r
+#define SCT_OUTPUTSET8_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET8: SETn10 Position     */\r
+#define SCT_OUTPUTSET8_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn10_Pos)                     /*!< SCT OUTPUTSET8: SETn10 Mask         */\r
+#define SCT_OUTPUTSET8_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET8: SETn11 Position     */\r
+#define SCT_OUTPUTSET8_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn11_Pos)                     /*!< SCT OUTPUTSET8: SETn11 Mask         */\r
+#define SCT_OUTPUTSET8_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET8: SETn12 Position     */\r
+#define SCT_OUTPUTSET8_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn12_Pos)                     /*!< SCT OUTPUTSET8: SETn12 Mask         */\r
+#define SCT_OUTPUTSET8_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET8: SETn13 Position     */\r
+#define SCT_OUTPUTSET8_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn13_Pos)                     /*!< SCT OUTPUTSET8: SETn13 Mask         */\r
+#define SCT_OUTPUTSET8_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET8: SETn14 Position     */\r
+#define SCT_OUTPUTSET8_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn14_Pos)                     /*!< SCT OUTPUTSET8: SETn14 Mask         */\r
+#define SCT_OUTPUTSET8_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET8: SETn15 Position     */\r
+#define SCT_OUTPUTSET8_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET8_SETn15_Pos)                     /*!< SCT OUTPUTSET8: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR8  -----------------------------------------\r
+#define SCT_OUTPUTCLR8_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR8: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn0_Pos)                      /*!< SCT OUTPUTCLR8: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR8: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn1_Pos)                      /*!< SCT OUTPUTCLR8: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR8: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn2_Pos)                      /*!< SCT OUTPUTCLR8: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR8: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn3_Pos)                      /*!< SCT OUTPUTCLR8: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR8: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn4_Pos)                      /*!< SCT OUTPUTCLR8: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR8: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn5_Pos)                      /*!< SCT OUTPUTCLR8: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR8: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn6_Pos)                      /*!< SCT OUTPUTCLR8: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR8: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn7_Pos)                      /*!< SCT OUTPUTCLR8: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR8: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn8_Pos)                      /*!< SCT OUTPUTCLR8: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR8: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR8_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR8_CLRn9_Pos)                      /*!< SCT OUTPUTCLR8: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR8_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR8: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn10_Pos)                     /*!< SCT OUTPUTCLR8: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR8_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR8: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn11_Pos)                     /*!< SCT OUTPUTCLR8: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR8_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR8: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn12_Pos)                     /*!< SCT OUTPUTCLR8: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR8_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR8: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn13_Pos)                     /*!< SCT OUTPUTCLR8: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR8_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR8: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn14_Pos)                     /*!< SCT OUTPUTCLR8: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR8_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR8: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR8_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR8_CLRn15_Pos)                     /*!< SCT OUTPUTCLR8: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET9  -----------------------------------------\r
+#define SCT_OUTPUTSET9_SETn0_Pos                              0                                                         /*!< SCT OUTPUTSET9: SETn0 Position      */\r
+#define SCT_OUTPUTSET9_SETn0_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn0_Pos)                      /*!< SCT OUTPUTSET9: SETn0 Mask          */\r
+#define SCT_OUTPUTSET9_SETn1_Pos                              1                                                         /*!< SCT OUTPUTSET9: SETn1 Position      */\r
+#define SCT_OUTPUTSET9_SETn1_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn1_Pos)                      /*!< SCT OUTPUTSET9: SETn1 Mask          */\r
+#define SCT_OUTPUTSET9_SETn2_Pos                              2                                                         /*!< SCT OUTPUTSET9: SETn2 Position      */\r
+#define SCT_OUTPUTSET9_SETn2_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn2_Pos)                      /*!< SCT OUTPUTSET9: SETn2 Mask          */\r
+#define SCT_OUTPUTSET9_SETn3_Pos                              3                                                         /*!< SCT OUTPUTSET9: SETn3 Position      */\r
+#define SCT_OUTPUTSET9_SETn3_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn3_Pos)                      /*!< SCT OUTPUTSET9: SETn3 Mask          */\r
+#define SCT_OUTPUTSET9_SETn4_Pos                              4                                                         /*!< SCT OUTPUTSET9: SETn4 Position      */\r
+#define SCT_OUTPUTSET9_SETn4_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn4_Pos)                      /*!< SCT OUTPUTSET9: SETn4 Mask          */\r
+#define SCT_OUTPUTSET9_SETn5_Pos                              5                                                         /*!< SCT OUTPUTSET9: SETn5 Position      */\r
+#define SCT_OUTPUTSET9_SETn5_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn5_Pos)                      /*!< SCT OUTPUTSET9: SETn5 Mask          */\r
+#define SCT_OUTPUTSET9_SETn6_Pos                              6                                                         /*!< SCT OUTPUTSET9: SETn6 Position      */\r
+#define SCT_OUTPUTSET9_SETn6_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn6_Pos)                      /*!< SCT OUTPUTSET9: SETn6 Mask          */\r
+#define SCT_OUTPUTSET9_SETn7_Pos                              7                                                         /*!< SCT OUTPUTSET9: SETn7 Position      */\r
+#define SCT_OUTPUTSET9_SETn7_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn7_Pos)                      /*!< SCT OUTPUTSET9: SETn7 Mask          */\r
+#define SCT_OUTPUTSET9_SETn8_Pos                              8                                                         /*!< SCT OUTPUTSET9: SETn8 Position      */\r
+#define SCT_OUTPUTSET9_SETn8_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn8_Pos)                      /*!< SCT OUTPUTSET9: SETn8 Mask          */\r
+#define SCT_OUTPUTSET9_SETn9_Pos                              9                                                         /*!< SCT OUTPUTSET9: SETn9 Position      */\r
+#define SCT_OUTPUTSET9_SETn9_Msk                              (0x01UL << SCT_OUTPUTSET9_SETn9_Pos)                      /*!< SCT OUTPUTSET9: SETn9 Mask          */\r
+#define SCT_OUTPUTSET9_SETn10_Pos                             10                                                        /*!< SCT OUTPUTSET9: SETn10 Position     */\r
+#define SCT_OUTPUTSET9_SETn10_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn10_Pos)                     /*!< SCT OUTPUTSET9: SETn10 Mask         */\r
+#define SCT_OUTPUTSET9_SETn11_Pos                             11                                                        /*!< SCT OUTPUTSET9: SETn11 Position     */\r
+#define SCT_OUTPUTSET9_SETn11_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn11_Pos)                     /*!< SCT OUTPUTSET9: SETn11 Mask         */\r
+#define SCT_OUTPUTSET9_SETn12_Pos                             12                                                        /*!< SCT OUTPUTSET9: SETn12 Position     */\r
+#define SCT_OUTPUTSET9_SETn12_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn12_Pos)                     /*!< SCT OUTPUTSET9: SETn12 Mask         */\r
+#define SCT_OUTPUTSET9_SETn13_Pos                             13                                                        /*!< SCT OUTPUTSET9: SETn13 Position     */\r
+#define SCT_OUTPUTSET9_SETn13_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn13_Pos)                     /*!< SCT OUTPUTSET9: SETn13 Mask         */\r
+#define SCT_OUTPUTSET9_SETn14_Pos                             14                                                        /*!< SCT OUTPUTSET9: SETn14 Position     */\r
+#define SCT_OUTPUTSET9_SETn14_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn14_Pos)                     /*!< SCT OUTPUTSET9: SETn14 Mask         */\r
+#define SCT_OUTPUTSET9_SETn15_Pos                             15                                                        /*!< SCT OUTPUTSET9: SETn15 Position     */\r
+#define SCT_OUTPUTSET9_SETn15_Msk                             (0x01UL << SCT_OUTPUTSET9_SETn15_Pos)                     /*!< SCT OUTPUTSET9: SETn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR9  -----------------------------------------\r
+#define SCT_OUTPUTCLR9_CLRn0_Pos                              0                                                         /*!< SCT OUTPUTCLR9: CLRn0 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn0_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn0_Pos)                      /*!< SCT OUTPUTCLR9: CLRn0 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn1_Pos                              1                                                         /*!< SCT OUTPUTCLR9: CLRn1 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn1_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn1_Pos)                      /*!< SCT OUTPUTCLR9: CLRn1 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn2_Pos                              2                                                         /*!< SCT OUTPUTCLR9: CLRn2 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn2_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn2_Pos)                      /*!< SCT OUTPUTCLR9: CLRn2 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn3_Pos                              3                                                         /*!< SCT OUTPUTCLR9: CLRn3 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn3_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn3_Pos)                      /*!< SCT OUTPUTCLR9: CLRn3 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn4_Pos                              4                                                         /*!< SCT OUTPUTCLR9: CLRn4 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn4_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn4_Pos)                      /*!< SCT OUTPUTCLR9: CLRn4 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn5_Pos                              5                                                         /*!< SCT OUTPUTCLR9: CLRn5 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn5_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn5_Pos)                      /*!< SCT OUTPUTCLR9: CLRn5 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn6_Pos                              6                                                         /*!< SCT OUTPUTCLR9: CLRn6 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn6_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn6_Pos)                      /*!< SCT OUTPUTCLR9: CLRn6 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn7_Pos                              7                                                         /*!< SCT OUTPUTCLR9: CLRn7 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn7_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn7_Pos)                      /*!< SCT OUTPUTCLR9: CLRn7 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn8_Pos                              8                                                         /*!< SCT OUTPUTCLR9: CLRn8 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn8_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn8_Pos)                      /*!< SCT OUTPUTCLR9: CLRn8 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn9_Pos                              9                                                         /*!< SCT OUTPUTCLR9: CLRn9 Position      */\r
+#define SCT_OUTPUTCLR9_CLRn9_Msk                              (0x01UL << SCT_OUTPUTCLR9_CLRn9_Pos)                      /*!< SCT OUTPUTCLR9: CLRn9 Mask          */\r
+#define SCT_OUTPUTCLR9_CLRn10_Pos                             10                                                        /*!< SCT OUTPUTCLR9: CLRn10 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn10_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn10_Pos)                     /*!< SCT OUTPUTCLR9: CLRn10 Mask         */\r
+#define SCT_OUTPUTCLR9_CLRn11_Pos                             11                                                        /*!< SCT OUTPUTCLR9: CLRn11 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn11_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn11_Pos)                     /*!< SCT OUTPUTCLR9: CLRn11 Mask         */\r
+#define SCT_OUTPUTCLR9_CLRn12_Pos                             12                                                        /*!< SCT OUTPUTCLR9: CLRn12 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn12_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn12_Pos)                     /*!< SCT OUTPUTCLR9: CLRn12 Mask         */\r
+#define SCT_OUTPUTCLR9_CLRn13_Pos                             13                                                        /*!< SCT OUTPUTCLR9: CLRn13 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn13_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn13_Pos)                     /*!< SCT OUTPUTCLR9: CLRn13 Mask         */\r
+#define SCT_OUTPUTCLR9_CLRn14_Pos                             14                                                        /*!< SCT OUTPUTCLR9: CLRn14 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn14_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn14_Pos)                     /*!< SCT OUTPUTCLR9: CLRn14 Mask         */\r
+#define SCT_OUTPUTCLR9_CLRn15_Pos                             15                                                        /*!< SCT OUTPUTCLR9: CLRn15 Position     */\r
+#define SCT_OUTPUTCLR9_CLRn15_Msk                             (0x01UL << SCT_OUTPUTCLR9_CLRn15_Pos)                     /*!< SCT OUTPUTCLR9: CLRn15 Mask         */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET10  ----------------------------------------\r
+#define SCT_OUTPUTSET10_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET10: SETn0 Position     */\r
+#define SCT_OUTPUTSET10_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn0_Pos)                     /*!< SCT OUTPUTSET10: SETn0 Mask         */\r
+#define SCT_OUTPUTSET10_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET10: SETn1 Position     */\r
+#define SCT_OUTPUTSET10_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn1_Pos)                     /*!< SCT OUTPUTSET10: SETn1 Mask         */\r
+#define SCT_OUTPUTSET10_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET10: SETn2 Position     */\r
+#define SCT_OUTPUTSET10_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn2_Pos)                     /*!< SCT OUTPUTSET10: SETn2 Mask         */\r
+#define SCT_OUTPUTSET10_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET10: SETn3 Position     */\r
+#define SCT_OUTPUTSET10_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn3_Pos)                     /*!< SCT OUTPUTSET10: SETn3 Mask         */\r
+#define SCT_OUTPUTSET10_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET10: SETn4 Position     */\r
+#define SCT_OUTPUTSET10_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn4_Pos)                     /*!< SCT OUTPUTSET10: SETn4 Mask         */\r
+#define SCT_OUTPUTSET10_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET10: SETn5 Position     */\r
+#define SCT_OUTPUTSET10_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn5_Pos)                     /*!< SCT OUTPUTSET10: SETn5 Mask         */\r
+#define SCT_OUTPUTSET10_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET10: SETn6 Position     */\r
+#define SCT_OUTPUTSET10_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn6_Pos)                     /*!< SCT OUTPUTSET10: SETn6 Mask         */\r
+#define SCT_OUTPUTSET10_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET10: SETn7 Position     */\r
+#define SCT_OUTPUTSET10_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn7_Pos)                     /*!< SCT OUTPUTSET10: SETn7 Mask         */\r
+#define SCT_OUTPUTSET10_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET10: SETn8 Position     */\r
+#define SCT_OUTPUTSET10_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn8_Pos)                     /*!< SCT OUTPUTSET10: SETn8 Mask         */\r
+#define SCT_OUTPUTSET10_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET10: SETn9 Position     */\r
+#define SCT_OUTPUTSET10_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET10_SETn9_Pos)                     /*!< SCT OUTPUTSET10: SETn9 Mask         */\r
+#define SCT_OUTPUTSET10_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET10: SETn10 Position    */\r
+#define SCT_OUTPUTSET10_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn10_Pos)                    /*!< SCT OUTPUTSET10: SETn10 Mask        */\r
+#define SCT_OUTPUTSET10_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET10: SETn11 Position    */\r
+#define SCT_OUTPUTSET10_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn11_Pos)                    /*!< SCT OUTPUTSET10: SETn11 Mask        */\r
+#define SCT_OUTPUTSET10_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET10: SETn12 Position    */\r
+#define SCT_OUTPUTSET10_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn12_Pos)                    /*!< SCT OUTPUTSET10: SETn12 Mask        */\r
+#define SCT_OUTPUTSET10_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET10: SETn13 Position    */\r
+#define SCT_OUTPUTSET10_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn13_Pos)                    /*!< SCT OUTPUTSET10: SETn13 Mask        */\r
+#define SCT_OUTPUTSET10_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET10: SETn14 Position    */\r
+#define SCT_OUTPUTSET10_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn14_Pos)                    /*!< SCT OUTPUTSET10: SETn14 Mask        */\r
+#define SCT_OUTPUTSET10_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET10: SETn15 Position    */\r
+#define SCT_OUTPUTSET10_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET10_SETn15_Pos)                    /*!< SCT OUTPUTSET10: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR10  ----------------------------------------\r
+#define SCT_OUTPUTCLR10_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR10: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn0_Pos)                     /*!< SCT OUTPUTCLR10: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR10: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn1_Pos)                     /*!< SCT OUTPUTCLR10: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR10: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn2_Pos)                     /*!< SCT OUTPUTCLR10: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR10: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn3_Pos)                     /*!< SCT OUTPUTCLR10: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR10: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn4_Pos)                     /*!< SCT OUTPUTCLR10: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR10: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn5_Pos)                     /*!< SCT OUTPUTCLR10: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR10: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn6_Pos)                     /*!< SCT OUTPUTCLR10: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR10: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn7_Pos)                     /*!< SCT OUTPUTCLR10: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR10: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn8_Pos)                     /*!< SCT OUTPUTCLR10: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR10: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR10_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR10_CLRn9_Pos)                     /*!< SCT OUTPUTCLR10: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR10_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR10: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn10_Pos)                    /*!< SCT OUTPUTCLR10: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR10_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR10: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn11_Pos)                    /*!< SCT OUTPUTCLR10: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR10_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR10: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn12_Pos)                    /*!< SCT OUTPUTCLR10: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR10_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR10: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn13_Pos)                    /*!< SCT OUTPUTCLR10: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR10_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR10: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn14_Pos)                    /*!< SCT OUTPUTCLR10: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR10_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR10: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR10_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR10_CLRn15_Pos)                    /*!< SCT OUTPUTCLR10: CLRn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET11  ----------------------------------------\r
+#define SCT_OUTPUTSET11_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET11: SETn0 Position     */\r
+#define SCT_OUTPUTSET11_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn0_Pos)                     /*!< SCT OUTPUTSET11: SETn0 Mask         */\r
+#define SCT_OUTPUTSET11_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET11: SETn1 Position     */\r
+#define SCT_OUTPUTSET11_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn1_Pos)                     /*!< SCT OUTPUTSET11: SETn1 Mask         */\r
+#define SCT_OUTPUTSET11_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET11: SETn2 Position     */\r
+#define SCT_OUTPUTSET11_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn2_Pos)                     /*!< SCT OUTPUTSET11: SETn2 Mask         */\r
+#define SCT_OUTPUTSET11_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET11: SETn3 Position     */\r
+#define SCT_OUTPUTSET11_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn3_Pos)                     /*!< SCT OUTPUTSET11: SETn3 Mask         */\r
+#define SCT_OUTPUTSET11_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET11: SETn4 Position     */\r
+#define SCT_OUTPUTSET11_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn4_Pos)                     /*!< SCT OUTPUTSET11: SETn4 Mask         */\r
+#define SCT_OUTPUTSET11_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET11: SETn5 Position     */\r
+#define SCT_OUTPUTSET11_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn5_Pos)                     /*!< SCT OUTPUTSET11: SETn5 Mask         */\r
+#define SCT_OUTPUTSET11_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET11: SETn6 Position     */\r
+#define SCT_OUTPUTSET11_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn6_Pos)                     /*!< SCT OUTPUTSET11: SETn6 Mask         */\r
+#define SCT_OUTPUTSET11_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET11: SETn7 Position     */\r
+#define SCT_OUTPUTSET11_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn7_Pos)                     /*!< SCT OUTPUTSET11: SETn7 Mask         */\r
+#define SCT_OUTPUTSET11_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET11: SETn8 Position     */\r
+#define SCT_OUTPUTSET11_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn8_Pos)                     /*!< SCT OUTPUTSET11: SETn8 Mask         */\r
+#define SCT_OUTPUTSET11_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET11: SETn9 Position     */\r
+#define SCT_OUTPUTSET11_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET11_SETn9_Pos)                     /*!< SCT OUTPUTSET11: SETn9 Mask         */\r
+#define SCT_OUTPUTSET11_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET11: SETn10 Position    */\r
+#define SCT_OUTPUTSET11_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn10_Pos)                    /*!< SCT OUTPUTSET11: SETn10 Mask        */\r
+#define SCT_OUTPUTSET11_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET11: SETn11 Position    */\r
+#define SCT_OUTPUTSET11_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn11_Pos)                    /*!< SCT OUTPUTSET11: SETn11 Mask        */\r
+#define SCT_OUTPUTSET11_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET11: SETn12 Position    */\r
+#define SCT_OUTPUTSET11_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn12_Pos)                    /*!< SCT OUTPUTSET11: SETn12 Mask        */\r
+#define SCT_OUTPUTSET11_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET11: SETn13 Position    */\r
+#define SCT_OUTPUTSET11_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn13_Pos)                    /*!< SCT OUTPUTSET11: SETn13 Mask        */\r
+#define SCT_OUTPUTSET11_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET11: SETn14 Position    */\r
+#define SCT_OUTPUTSET11_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn14_Pos)                    /*!< SCT OUTPUTSET11: SETn14 Mask        */\r
+#define SCT_OUTPUTSET11_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET11: SETn15 Position    */\r
+#define SCT_OUTPUTSET11_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET11_SETn15_Pos)                    /*!< SCT OUTPUTSET11: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR11  ----------------------------------------\r
+#define SCT_OUTPUTCLR11_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR11: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn0_Pos)                     /*!< SCT OUTPUTCLR11: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR11: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn1_Pos)                     /*!< SCT OUTPUTCLR11: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR11: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn2_Pos)                     /*!< SCT OUTPUTCLR11: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR11: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn3_Pos)                     /*!< SCT OUTPUTCLR11: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR11: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn4_Pos)                     /*!< SCT OUTPUTCLR11: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR11: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn5_Pos)                     /*!< SCT OUTPUTCLR11: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR11: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn6_Pos)                     /*!< SCT OUTPUTCLR11: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR11: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn7_Pos)                     /*!< SCT OUTPUTCLR11: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR11: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn8_Pos)                     /*!< SCT OUTPUTCLR11: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR11: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR11_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR11_CLRn9_Pos)                     /*!< SCT OUTPUTCLR11: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR11_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR11: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn10_Pos)                    /*!< SCT OUTPUTCLR11: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR11_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR11: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn11_Pos)                    /*!< SCT OUTPUTCLR11: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR11_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR11: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn12_Pos)                    /*!< SCT OUTPUTCLR11: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR11_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR11: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn13_Pos)                    /*!< SCT OUTPUTCLR11: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR11_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR11: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn14_Pos)                    /*!< SCT OUTPUTCLR11: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR11_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR11: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR11_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR11_CLRn15_Pos)                    /*!< SCT OUTPUTCLR11: CLRn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET12  ----------------------------------------\r
+#define SCT_OUTPUTSET12_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET12: SETn0 Position     */\r
+#define SCT_OUTPUTSET12_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn0_Pos)                     /*!< SCT OUTPUTSET12: SETn0 Mask         */\r
+#define SCT_OUTPUTSET12_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET12: SETn1 Position     */\r
+#define SCT_OUTPUTSET12_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn1_Pos)                     /*!< SCT OUTPUTSET12: SETn1 Mask         */\r
+#define SCT_OUTPUTSET12_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET12: SETn2 Position     */\r
+#define SCT_OUTPUTSET12_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn2_Pos)                     /*!< SCT OUTPUTSET12: SETn2 Mask         */\r
+#define SCT_OUTPUTSET12_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET12: SETn3 Position     */\r
+#define SCT_OUTPUTSET12_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn3_Pos)                     /*!< SCT OUTPUTSET12: SETn3 Mask         */\r
+#define SCT_OUTPUTSET12_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET12: SETn4 Position     */\r
+#define SCT_OUTPUTSET12_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn4_Pos)                     /*!< SCT OUTPUTSET12: SETn4 Mask         */\r
+#define SCT_OUTPUTSET12_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET12: SETn5 Position     */\r
+#define SCT_OUTPUTSET12_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn5_Pos)                     /*!< SCT OUTPUTSET12: SETn5 Mask         */\r
+#define SCT_OUTPUTSET12_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET12: SETn6 Position     */\r
+#define SCT_OUTPUTSET12_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn6_Pos)                     /*!< SCT OUTPUTSET12: SETn6 Mask         */\r
+#define SCT_OUTPUTSET12_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET12: SETn7 Position     */\r
+#define SCT_OUTPUTSET12_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn7_Pos)                     /*!< SCT OUTPUTSET12: SETn7 Mask         */\r
+#define SCT_OUTPUTSET12_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET12: SETn8 Position     */\r
+#define SCT_OUTPUTSET12_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn8_Pos)                     /*!< SCT OUTPUTSET12: SETn8 Mask         */\r
+#define SCT_OUTPUTSET12_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET12: SETn9 Position     */\r
+#define SCT_OUTPUTSET12_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET12_SETn9_Pos)                     /*!< SCT OUTPUTSET12: SETn9 Mask         */\r
+#define SCT_OUTPUTSET12_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET12: SETn10 Position    */\r
+#define SCT_OUTPUTSET12_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn10_Pos)                    /*!< SCT OUTPUTSET12: SETn10 Mask        */\r
+#define SCT_OUTPUTSET12_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET12: SETn11 Position    */\r
+#define SCT_OUTPUTSET12_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn11_Pos)                    /*!< SCT OUTPUTSET12: SETn11 Mask        */\r
+#define SCT_OUTPUTSET12_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET12: SETn12 Position    */\r
+#define SCT_OUTPUTSET12_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn12_Pos)                    /*!< SCT OUTPUTSET12: SETn12 Mask        */\r
+#define SCT_OUTPUTSET12_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET12: SETn13 Position    */\r
+#define SCT_OUTPUTSET12_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn13_Pos)                    /*!< SCT OUTPUTSET12: SETn13 Mask        */\r
+#define SCT_OUTPUTSET12_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET12: SETn14 Position    */\r
+#define SCT_OUTPUTSET12_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn14_Pos)                    /*!< SCT OUTPUTSET12: SETn14 Mask        */\r
+#define SCT_OUTPUTSET12_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET12: SETn15 Position    */\r
+#define SCT_OUTPUTSET12_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET12_SETn15_Pos)                    /*!< SCT OUTPUTSET12: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR12  ----------------------------------------\r
+#define SCT_OUTPUTCLR12_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR12: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn0_Pos)                     /*!< SCT OUTPUTCLR12: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR12: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn1_Pos)                     /*!< SCT OUTPUTCLR12: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR12: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn2_Pos)                     /*!< SCT OUTPUTCLR12: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR12: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn3_Pos)                     /*!< SCT OUTPUTCLR12: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR12: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn4_Pos)                     /*!< SCT OUTPUTCLR12: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR12: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn5_Pos)                     /*!< SCT OUTPUTCLR12: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR12: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn6_Pos)                     /*!< SCT OUTPUTCLR12: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR12: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn7_Pos)                     /*!< SCT OUTPUTCLR12: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR12: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn8_Pos)                     /*!< SCT OUTPUTCLR12: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR12: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR12_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR12_CLRn9_Pos)                     /*!< SCT OUTPUTCLR12: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR12_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR12: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn10_Pos)                    /*!< SCT OUTPUTCLR12: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR12_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR12: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn11_Pos)                    /*!< SCT OUTPUTCLR12: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR12_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR12: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn12_Pos)                    /*!< SCT OUTPUTCLR12: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR12_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR12: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn13_Pos)                    /*!< SCT OUTPUTCLR12: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR12_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR12: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn14_Pos)                    /*!< SCT OUTPUTCLR12: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR12_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR12: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR12_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR12_CLRn15_Pos)                    /*!< SCT OUTPUTCLR12: CLRn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET13  ----------------------------------------\r
+#define SCT_OUTPUTSET13_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET13: SETn0 Position     */\r
+#define SCT_OUTPUTSET13_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn0_Pos)                     /*!< SCT OUTPUTSET13: SETn0 Mask         */\r
+#define SCT_OUTPUTSET13_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET13: SETn1 Position     */\r
+#define SCT_OUTPUTSET13_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn1_Pos)                     /*!< SCT OUTPUTSET13: SETn1 Mask         */\r
+#define SCT_OUTPUTSET13_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET13: SETn2 Position     */\r
+#define SCT_OUTPUTSET13_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn2_Pos)                     /*!< SCT OUTPUTSET13: SETn2 Mask         */\r
+#define SCT_OUTPUTSET13_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET13: SETn3 Position     */\r
+#define SCT_OUTPUTSET13_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn3_Pos)                     /*!< SCT OUTPUTSET13: SETn3 Mask         */\r
+#define SCT_OUTPUTSET13_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET13: SETn4 Position     */\r
+#define SCT_OUTPUTSET13_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn4_Pos)                     /*!< SCT OUTPUTSET13: SETn4 Mask         */\r
+#define SCT_OUTPUTSET13_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET13: SETn5 Position     */\r
+#define SCT_OUTPUTSET13_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn5_Pos)                     /*!< SCT OUTPUTSET13: SETn5 Mask         */\r
+#define SCT_OUTPUTSET13_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET13: SETn6 Position     */\r
+#define SCT_OUTPUTSET13_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn6_Pos)                     /*!< SCT OUTPUTSET13: SETn6 Mask         */\r
+#define SCT_OUTPUTSET13_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET13: SETn7 Position     */\r
+#define SCT_OUTPUTSET13_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn7_Pos)                     /*!< SCT OUTPUTSET13: SETn7 Mask         */\r
+#define SCT_OUTPUTSET13_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET13: SETn8 Position     */\r
+#define SCT_OUTPUTSET13_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn8_Pos)                     /*!< SCT OUTPUTSET13: SETn8 Mask         */\r
+#define SCT_OUTPUTSET13_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET13: SETn9 Position     */\r
+#define SCT_OUTPUTSET13_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET13_SETn9_Pos)                     /*!< SCT OUTPUTSET13: SETn9 Mask         */\r
+#define SCT_OUTPUTSET13_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET13: SETn10 Position    */\r
+#define SCT_OUTPUTSET13_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn10_Pos)                    /*!< SCT OUTPUTSET13: SETn10 Mask        */\r
+#define SCT_OUTPUTSET13_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET13: SETn11 Position    */\r
+#define SCT_OUTPUTSET13_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn11_Pos)                    /*!< SCT OUTPUTSET13: SETn11 Mask        */\r
+#define SCT_OUTPUTSET13_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET13: SETn12 Position    */\r
+#define SCT_OUTPUTSET13_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn12_Pos)                    /*!< SCT OUTPUTSET13: SETn12 Mask        */\r
+#define SCT_OUTPUTSET13_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET13: SETn13 Position    */\r
+#define SCT_OUTPUTSET13_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn13_Pos)                    /*!< SCT OUTPUTSET13: SETn13 Mask        */\r
+#define SCT_OUTPUTSET13_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET13: SETn14 Position    */\r
+#define SCT_OUTPUTSET13_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn14_Pos)                    /*!< SCT OUTPUTSET13: SETn14 Mask        */\r
+#define SCT_OUTPUTSET13_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET13: SETn15 Position    */\r
+#define SCT_OUTPUTSET13_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET13_SETn15_Pos)                    /*!< SCT OUTPUTSET13: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR13  ----------------------------------------\r
+#define SCT_OUTPUTCLR13_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR13: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn0_Pos)                     /*!< SCT OUTPUTCLR13: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR13: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn1_Pos)                     /*!< SCT OUTPUTCLR13: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR13: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn2_Pos)                     /*!< SCT OUTPUTCLR13: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR13: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn3_Pos)                     /*!< SCT OUTPUTCLR13: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR13: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn4_Pos)                     /*!< SCT OUTPUTCLR13: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR13: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn5_Pos)                     /*!< SCT OUTPUTCLR13: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR13: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn6_Pos)                     /*!< SCT OUTPUTCLR13: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR13: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn7_Pos)                     /*!< SCT OUTPUTCLR13: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR13: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn8_Pos)                     /*!< SCT OUTPUTCLR13: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR13: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR13_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR13_CLRn9_Pos)                     /*!< SCT OUTPUTCLR13: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR13_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR13: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn10_Pos)                    /*!< SCT OUTPUTCLR13: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR13_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR13: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn11_Pos)                    /*!< SCT OUTPUTCLR13: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR13_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR13: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn12_Pos)                    /*!< SCT OUTPUTCLR13: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR13_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR13: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn13_Pos)                    /*!< SCT OUTPUTCLR13: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR13_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR13: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn14_Pos)                    /*!< SCT OUTPUTCLR13: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR13_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR13: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR13_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR13_CLRn15_Pos)                    /*!< SCT OUTPUTCLR13: CLRn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET14  ----------------------------------------\r
+#define SCT_OUTPUTSET14_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET14: SETn0 Position     */\r
+#define SCT_OUTPUTSET14_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn0_Pos)                     /*!< SCT OUTPUTSET14: SETn0 Mask         */\r
+#define SCT_OUTPUTSET14_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET14: SETn1 Position     */\r
+#define SCT_OUTPUTSET14_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn1_Pos)                     /*!< SCT OUTPUTSET14: SETn1 Mask         */\r
+#define SCT_OUTPUTSET14_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET14: SETn2 Position     */\r
+#define SCT_OUTPUTSET14_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn2_Pos)                     /*!< SCT OUTPUTSET14: SETn2 Mask         */\r
+#define SCT_OUTPUTSET14_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET14: SETn3 Position     */\r
+#define SCT_OUTPUTSET14_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn3_Pos)                     /*!< SCT OUTPUTSET14: SETn3 Mask         */\r
+#define SCT_OUTPUTSET14_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET14: SETn4 Position     */\r
+#define SCT_OUTPUTSET14_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn4_Pos)                     /*!< SCT OUTPUTSET14: SETn4 Mask         */\r
+#define SCT_OUTPUTSET14_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET14: SETn5 Position     */\r
+#define SCT_OUTPUTSET14_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn5_Pos)                     /*!< SCT OUTPUTSET14: SETn5 Mask         */\r
+#define SCT_OUTPUTSET14_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET14: SETn6 Position     */\r
+#define SCT_OUTPUTSET14_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn6_Pos)                     /*!< SCT OUTPUTSET14: SETn6 Mask         */\r
+#define SCT_OUTPUTSET14_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET14: SETn7 Position     */\r
+#define SCT_OUTPUTSET14_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn7_Pos)                     /*!< SCT OUTPUTSET14: SETn7 Mask         */\r
+#define SCT_OUTPUTSET14_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET14: SETn8 Position     */\r
+#define SCT_OUTPUTSET14_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn8_Pos)                     /*!< SCT OUTPUTSET14: SETn8 Mask         */\r
+#define SCT_OUTPUTSET14_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET14: SETn9 Position     */\r
+#define SCT_OUTPUTSET14_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET14_SETn9_Pos)                     /*!< SCT OUTPUTSET14: SETn9 Mask         */\r
+#define SCT_OUTPUTSET14_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET14: SETn10 Position    */\r
+#define SCT_OUTPUTSET14_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn10_Pos)                    /*!< SCT OUTPUTSET14: SETn10 Mask        */\r
+#define SCT_OUTPUTSET14_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET14: SETn11 Position    */\r
+#define SCT_OUTPUTSET14_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn11_Pos)                    /*!< SCT OUTPUTSET14: SETn11 Mask        */\r
+#define SCT_OUTPUTSET14_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET14: SETn12 Position    */\r
+#define SCT_OUTPUTSET14_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn12_Pos)                    /*!< SCT OUTPUTSET14: SETn12 Mask        */\r
+#define SCT_OUTPUTSET14_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET14: SETn13 Position    */\r
+#define SCT_OUTPUTSET14_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn13_Pos)                    /*!< SCT OUTPUTSET14: SETn13 Mask        */\r
+#define SCT_OUTPUTSET14_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET14: SETn14 Position    */\r
+#define SCT_OUTPUTSET14_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn14_Pos)                    /*!< SCT OUTPUTSET14: SETn14 Mask        */\r
+#define SCT_OUTPUTSET14_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET14: SETn15 Position    */\r
+#define SCT_OUTPUTSET14_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET14_SETn15_Pos)                    /*!< SCT OUTPUTSET14: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR14  ----------------------------------------\r
+#define SCT_OUTPUTCLR14_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR14: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn0_Pos)                     /*!< SCT OUTPUTCLR14: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR14: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn1_Pos)                     /*!< SCT OUTPUTCLR14: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR14: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn2_Pos)                     /*!< SCT OUTPUTCLR14: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR14: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn3_Pos)                     /*!< SCT OUTPUTCLR14: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR14: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn4_Pos)                     /*!< SCT OUTPUTCLR14: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR14: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn5_Pos)                     /*!< SCT OUTPUTCLR14: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR14: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn6_Pos)                     /*!< SCT OUTPUTCLR14: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR14: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn7_Pos)                     /*!< SCT OUTPUTCLR14: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR14: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn8_Pos)                     /*!< SCT OUTPUTCLR14: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR14: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR14_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR14_CLRn9_Pos)                     /*!< SCT OUTPUTCLR14: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR14_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR14: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn10_Pos)                    /*!< SCT OUTPUTCLR14: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR14_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR14: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn11_Pos)                    /*!< SCT OUTPUTCLR14: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR14_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR14: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn12_Pos)                    /*!< SCT OUTPUTCLR14: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR14_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR14: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn13_Pos)                    /*!< SCT OUTPUTCLR14: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR14_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR14: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn14_Pos)                    /*!< SCT OUTPUTCLR14: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR14_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR14: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR14_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR14_CLRn15_Pos)                    /*!< SCT OUTPUTCLR14: CLRn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTSET15  ----------------------------------------\r
+#define SCT_OUTPUTSET15_SETn0_Pos                             0                                                         /*!< SCT OUTPUTSET15: SETn0 Position     */\r
+#define SCT_OUTPUTSET15_SETn0_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn0_Pos)                     /*!< SCT OUTPUTSET15: SETn0 Mask         */\r
+#define SCT_OUTPUTSET15_SETn1_Pos                             1                                                         /*!< SCT OUTPUTSET15: SETn1 Position     */\r
+#define SCT_OUTPUTSET15_SETn1_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn1_Pos)                     /*!< SCT OUTPUTSET15: SETn1 Mask         */\r
+#define SCT_OUTPUTSET15_SETn2_Pos                             2                                                         /*!< SCT OUTPUTSET15: SETn2 Position     */\r
+#define SCT_OUTPUTSET15_SETn2_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn2_Pos)                     /*!< SCT OUTPUTSET15: SETn2 Mask         */\r
+#define SCT_OUTPUTSET15_SETn3_Pos                             3                                                         /*!< SCT OUTPUTSET15: SETn3 Position     */\r
+#define SCT_OUTPUTSET15_SETn3_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn3_Pos)                     /*!< SCT OUTPUTSET15: SETn3 Mask         */\r
+#define SCT_OUTPUTSET15_SETn4_Pos                             4                                                         /*!< SCT OUTPUTSET15: SETn4 Position     */\r
+#define SCT_OUTPUTSET15_SETn4_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn4_Pos)                     /*!< SCT OUTPUTSET15: SETn4 Mask         */\r
+#define SCT_OUTPUTSET15_SETn5_Pos                             5                                                         /*!< SCT OUTPUTSET15: SETn5 Position     */\r
+#define SCT_OUTPUTSET15_SETn5_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn5_Pos)                     /*!< SCT OUTPUTSET15: SETn5 Mask         */\r
+#define SCT_OUTPUTSET15_SETn6_Pos                             6                                                         /*!< SCT OUTPUTSET15: SETn6 Position     */\r
+#define SCT_OUTPUTSET15_SETn6_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn6_Pos)                     /*!< SCT OUTPUTSET15: SETn6 Mask         */\r
+#define SCT_OUTPUTSET15_SETn7_Pos                             7                                                         /*!< SCT OUTPUTSET15: SETn7 Position     */\r
+#define SCT_OUTPUTSET15_SETn7_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn7_Pos)                     /*!< SCT OUTPUTSET15: SETn7 Mask         */\r
+#define SCT_OUTPUTSET15_SETn8_Pos                             8                                                         /*!< SCT OUTPUTSET15: SETn8 Position     */\r
+#define SCT_OUTPUTSET15_SETn8_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn8_Pos)                     /*!< SCT OUTPUTSET15: SETn8 Mask         */\r
+#define SCT_OUTPUTSET15_SETn9_Pos                             9                                                         /*!< SCT OUTPUTSET15: SETn9 Position     */\r
+#define SCT_OUTPUTSET15_SETn9_Msk                             (0x01UL << SCT_OUTPUTSET15_SETn9_Pos)                     /*!< SCT OUTPUTSET15: SETn9 Mask         */\r
+#define SCT_OUTPUTSET15_SETn10_Pos                            10                                                        /*!< SCT OUTPUTSET15: SETn10 Position    */\r
+#define SCT_OUTPUTSET15_SETn10_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn10_Pos)                    /*!< SCT OUTPUTSET15: SETn10 Mask        */\r
+#define SCT_OUTPUTSET15_SETn11_Pos                            11                                                        /*!< SCT OUTPUTSET15: SETn11 Position    */\r
+#define SCT_OUTPUTSET15_SETn11_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn11_Pos)                    /*!< SCT OUTPUTSET15: SETn11 Mask        */\r
+#define SCT_OUTPUTSET15_SETn12_Pos                            12                                                        /*!< SCT OUTPUTSET15: SETn12 Position    */\r
+#define SCT_OUTPUTSET15_SETn12_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn12_Pos)                    /*!< SCT OUTPUTSET15: SETn12 Mask        */\r
+#define SCT_OUTPUTSET15_SETn13_Pos                            13                                                        /*!< SCT OUTPUTSET15: SETn13 Position    */\r
+#define SCT_OUTPUTSET15_SETn13_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn13_Pos)                    /*!< SCT OUTPUTSET15: SETn13 Mask        */\r
+#define SCT_OUTPUTSET15_SETn14_Pos                            14                                                        /*!< SCT OUTPUTSET15: SETn14 Position    */\r
+#define SCT_OUTPUTSET15_SETn14_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn14_Pos)                    /*!< SCT OUTPUTSET15: SETn14 Mask        */\r
+#define SCT_OUTPUTSET15_SETn15_Pos                            15                                                        /*!< SCT OUTPUTSET15: SETn15 Position    */\r
+#define SCT_OUTPUTSET15_SETn15_Msk                            (0x01UL << SCT_OUTPUTSET15_SETn15_Pos)                    /*!< SCT OUTPUTSET15: SETn15 Mask        */\r
+\r
+// -------------------------------------  SCT_OUTPUTCLR15  ----------------------------------------\r
+#define SCT_OUTPUTCLR15_CLRn0_Pos                             0                                                         /*!< SCT OUTPUTCLR15: CLRn0 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn0_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn0_Pos)                     /*!< SCT OUTPUTCLR15: CLRn0 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn1_Pos                             1                                                         /*!< SCT OUTPUTCLR15: CLRn1 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn1_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn1_Pos)                     /*!< SCT OUTPUTCLR15: CLRn1 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn2_Pos                             2                                                         /*!< SCT OUTPUTCLR15: CLRn2 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn2_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn2_Pos)                     /*!< SCT OUTPUTCLR15: CLRn2 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn3_Pos                             3                                                         /*!< SCT OUTPUTCLR15: CLRn3 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn3_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn3_Pos)                     /*!< SCT OUTPUTCLR15: CLRn3 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn4_Pos                             4                                                         /*!< SCT OUTPUTCLR15: CLRn4 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn4_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn4_Pos)                     /*!< SCT OUTPUTCLR15: CLRn4 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn5_Pos                             5                                                         /*!< SCT OUTPUTCLR15: CLRn5 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn5_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn5_Pos)                     /*!< SCT OUTPUTCLR15: CLRn5 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn6_Pos                             6                                                         /*!< SCT OUTPUTCLR15: CLRn6 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn6_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn6_Pos)                     /*!< SCT OUTPUTCLR15: CLRn6 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn7_Pos                             7                                                         /*!< SCT OUTPUTCLR15: CLRn7 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn7_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn7_Pos)                     /*!< SCT OUTPUTCLR15: CLRn7 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn8_Pos                             8                                                         /*!< SCT OUTPUTCLR15: CLRn8 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn8_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn8_Pos)                     /*!< SCT OUTPUTCLR15: CLRn8 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn9_Pos                             9                                                         /*!< SCT OUTPUTCLR15: CLRn9 Position     */\r
+#define SCT_OUTPUTCLR15_CLRn9_Msk                             (0x01UL << SCT_OUTPUTCLR15_CLRn9_Pos)                     /*!< SCT OUTPUTCLR15: CLRn9 Mask         */\r
+#define SCT_OUTPUTCLR15_CLRn10_Pos                            10                                                        /*!< SCT OUTPUTCLR15: CLRn10 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn10_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn10_Pos)                    /*!< SCT OUTPUTCLR15: CLRn10 Mask        */\r
+#define SCT_OUTPUTCLR15_CLRn11_Pos                            11                                                        /*!< SCT OUTPUTCLR15: CLRn11 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn11_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn11_Pos)                    /*!< SCT OUTPUTCLR15: CLRn11 Mask        */\r
+#define SCT_OUTPUTCLR15_CLRn12_Pos                            12                                                        /*!< SCT OUTPUTCLR15: CLRn12 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn12_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn12_Pos)                    /*!< SCT OUTPUTCLR15: CLRn12 Mask        */\r
+#define SCT_OUTPUTCLR15_CLRn13_Pos                            13                                                        /*!< SCT OUTPUTCLR15: CLRn13 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn13_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn13_Pos)                    /*!< SCT OUTPUTCLR15: CLRn13 Mask        */\r
+#define SCT_OUTPUTCLR15_CLRn14_Pos                            14                                                        /*!< SCT OUTPUTCLR15: CLRn14 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn14_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn14_Pos)                    /*!< SCT OUTPUTCLR15: CLRn14 Mask        */\r
+#define SCT_OUTPUTCLR15_CLRn15_Pos                            15                                                        /*!< SCT OUTPUTCLR15: CLRn15 Position    */\r
+#define SCT_OUTPUTCLR15_CLRn15_Msk                            (0x01UL << SCT_OUTPUTCLR15_CLRn15_Pos)                    /*!< SCT OUTPUTCLR15: CLRn15 Mask        */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 GPDMA Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// --------------------------------------  GPDMA_INTSTAT  -----------------------------------------\r
+#define GPDMA_INTSTAT_INTSTAT0_Pos                            0                                                         /*!< GPDMA INTSTAT: INTSTAT0 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT0_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT0_Pos)                    /*!< GPDMA INTSTAT: INTSTAT0 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT1_Pos                            1                                                         /*!< GPDMA INTSTAT: INTSTAT1 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT1_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT1_Pos)                    /*!< GPDMA INTSTAT: INTSTAT1 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT2_Pos                            2                                                         /*!< GPDMA INTSTAT: INTSTAT2 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT2_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT2_Pos)                    /*!< GPDMA INTSTAT: INTSTAT2 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT3_Pos                            3                                                         /*!< GPDMA INTSTAT: INTSTAT3 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT3_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT3_Pos)                    /*!< GPDMA INTSTAT: INTSTAT3 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT4_Pos                            4                                                         /*!< GPDMA INTSTAT: INTSTAT4 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT4_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT4_Pos)                    /*!< GPDMA INTSTAT: INTSTAT4 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT5_Pos                            5                                                         /*!< GPDMA INTSTAT: INTSTAT5 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT5_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT5_Pos)                    /*!< GPDMA INTSTAT: INTSTAT5 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT6_Pos                            6                                                         /*!< GPDMA INTSTAT: INTSTAT6 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT6_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT6_Pos)                    /*!< GPDMA INTSTAT: INTSTAT6 Mask        */\r
+#define GPDMA_INTSTAT_INTSTAT7_Pos                            7                                                         /*!< GPDMA INTSTAT: INTSTAT7 Position    */\r
+#define GPDMA_INTSTAT_INTSTAT7_Msk                            (0x01UL << GPDMA_INTSTAT_INTSTAT7_Pos)                    /*!< GPDMA INTSTAT: INTSTAT7 Mask        */\r
+\r
+// -------------------------------------  GPDMA_INTTCSTAT  ----------------------------------------\r
+#define GPDMA_INTTCSTAT_INTTCSTAT0_Pos                        0                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT0 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT0_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT0_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT0 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT1_Pos                        1                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT1 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT1_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT1_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT1 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT2_Pos                        2                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT2 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT2_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT2_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT2 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT3_Pos                        3                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT3 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT3_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT3_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT3 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT4_Pos                        4                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT4 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT4_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT4_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT4 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT5_Pos                        5                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT5 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT5_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT5_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT5 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT6_Pos                        6                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT6 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT6_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT6_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT6 Mask    */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT7_Pos                        7                                                         /*!< GPDMA INTTCSTAT: INTTCSTAT7 Position */\r
+#define GPDMA_INTTCSTAT_INTTCSTAT7_Msk                        (0x01UL << GPDMA_INTTCSTAT_INTTCSTAT7_Pos)                /*!< GPDMA INTTCSTAT: INTTCSTAT7 Mask    */\r
+\r
+// ------------------------------------  GPDMA_INTTCCLEAR  ----------------------------------------\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR0_Pos                      0                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR0 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR0_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR0_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR0 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR1_Pos                      1                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR1 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR1_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR1_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR1 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR2_Pos                      2                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR2 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR2_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR2_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR2 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR3_Pos                      3                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR3 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR3_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR3_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR3 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR4_Pos                      4                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR4 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR4_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR4_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR4 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR5_Pos                      5                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR5 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR5_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR5_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR5 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR6_Pos                      6                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR6 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR6_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR6_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR6 Mask  */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR7_Pos                      7                                                         /*!< GPDMA INTTCCLEAR: INTTCCLEAR7 Position */\r
+#define GPDMA_INTTCCLEAR_INTTCCLEAR7_Msk                      (0x01UL << GPDMA_INTTCCLEAR_INTTCCLEAR7_Pos)              /*!< GPDMA INTTCCLEAR: INTTCCLEAR7 Mask  */\r
+\r
+// ------------------------------------  GPDMA_INTERRSTAT  ----------------------------------------\r
+#define GPDMA_INTERRSTAT_INTERRSTAT0_Pos                      0                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT0 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT0_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT0_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT0 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT1_Pos                      1                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT1 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT1_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT1_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT1 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT2_Pos                      2                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT2 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT2_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT2_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT2 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT3_Pos                      3                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT3 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT3_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT3_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT3 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT4_Pos                      4                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT4 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT4_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT4_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT4 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT5_Pos                      5                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT5 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT5_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT5_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT5 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT6_Pos                      6                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT6 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT6_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT6_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT6 Mask  */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT7_Pos                      7                                                         /*!< GPDMA INTERRSTAT: INTERRSTAT7 Position */\r
+#define GPDMA_INTERRSTAT_INTERRSTAT7_Msk                      (0x01UL << GPDMA_INTERRSTAT_INTERRSTAT7_Pos)              /*!< GPDMA INTERRSTAT: INTERRSTAT7 Mask  */\r
+\r
+// -------------------------------------  GPDMA_INTERRCLR  ----------------------------------------\r
+#define GPDMA_INTERRCLR_INTERRCLR0_Pos                        0                                                         /*!< GPDMA INTERRCLR: INTERRCLR0 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR0_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR0_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR0 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR1_Pos                        1                                                         /*!< GPDMA INTERRCLR: INTERRCLR1 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR1_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR1_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR1 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR2_Pos                        2                                                         /*!< GPDMA INTERRCLR: INTERRCLR2 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR2_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR2_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR2 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR3_Pos                        3                                                         /*!< GPDMA INTERRCLR: INTERRCLR3 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR3_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR3_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR3 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR4_Pos                        4                                                         /*!< GPDMA INTERRCLR: INTERRCLR4 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR4_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR4_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR4 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR5_Pos                        5                                                         /*!< GPDMA INTERRCLR: INTERRCLR5 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR5_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR5_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR5 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR6_Pos                        6                                                         /*!< GPDMA INTERRCLR: INTERRCLR6 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR6_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR6_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR6 Mask    */\r
+#define GPDMA_INTERRCLR_INTERRCLR7_Pos                        7                                                         /*!< GPDMA INTERRCLR: INTERRCLR7 Position */\r
+#define GPDMA_INTERRCLR_INTERRCLR7_Msk                        (0x01UL << GPDMA_INTERRCLR_INTERRCLR7_Pos)                /*!< GPDMA INTERRCLR: INTERRCLR7 Mask    */\r
+\r
+// -----------------------------------  GPDMA_RAWINTTCSTAT  ---------------------------------------\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT0_Pos                  0                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT0 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT0_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT0_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT0 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT1_Pos                  1                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT1 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT1_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT1_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT1 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT2_Pos                  2                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT2 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT2_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT2_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT2 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT3_Pos                  3                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT3 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT3_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT3_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT3 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT4_Pos                  4                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT4 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT4_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT4_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT4 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT5_Pos                  5                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT5 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT5_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT5_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT5 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT6_Pos                  6                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT6 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT6_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT6_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT6 Mask */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT7_Pos                  7                                                         /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT7 Position */\r
+#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT7_Msk                  (0x01UL << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT7_Pos)          /*!< GPDMA RAWINTTCSTAT: RAWINTTCSTAT7 Mask */\r
+\r
+// -----------------------------------  GPDMA_RAWINTERRSTAT  --------------------------------------\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT0_Pos                0                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT0 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT0_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT0_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT0 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT1_Pos                1                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT1 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT1_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT1_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT1 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT2_Pos                2                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT2 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT2_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT2_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT2 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT3_Pos                3                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT3 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT3_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT3_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT3 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT4_Pos                4                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT4 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT4_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT4_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT4 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT5_Pos                5                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT5 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT5_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT5_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT5 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT6_Pos                6                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT6 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT6_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT6_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT6 Mask */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT7_Pos                7                                                         /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT7 Position */\r
+#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT7_Msk                (0x01UL << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT7_Pos)        /*!< GPDMA RAWINTERRSTAT: RAWINTERRSTAT7 Mask */\r
+\r
+// -------------------------------------  GPDMA_ENBLDCHNS  ----------------------------------------\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS0_Pos                  0                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS0 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS0_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS0_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS0 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS1_Pos                  1                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS1 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS1_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS1_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS1 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS2_Pos                  2                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS2 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS2_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS2_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS2 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS3_Pos                  3                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS3 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS3_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS3_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS3 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS4_Pos                  4                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS4 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS4_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS4_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS4 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS5_Pos                  5                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS5 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS5_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS5_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS5 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS6_Pos                  6                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS6 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS6_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS6_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS6 Mask */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS7_Pos                  7                                                         /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS7 Position */\r
+#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS7_Msk                  (0x01UL << GPDMA_ENBLDCHNS_ENABLEDCHANNELS7_Pos)          /*!< GPDMA ENBLDCHNS: ENABLEDCHANNELS7 Mask */\r
+\r
+// -------------------------------------  GPDMA_SOFTBREQ  -----------------------------------------\r
+#define GPDMA_SOFTBREQ_SOFTBREQ0_Pos                          0                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ0 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ0_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ0_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ0 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ1_Pos                          1                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ1 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ1_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ1_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ1 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ2_Pos                          2                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ2 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ2_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ2_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ2 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ3_Pos                          3                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ3 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ3_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ3_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ3 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ4_Pos                          4                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ4 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ4_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ4_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ4 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ5_Pos                          5                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ5 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ5_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ5_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ5 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ6_Pos                          6                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ6 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ6_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ6_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ6 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ7_Pos                          7                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ7 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ7_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ7_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ7 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ8_Pos                          8                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ8 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ8_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ8_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ8 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ9_Pos                          9                                                         /*!< GPDMA SOFTBREQ: SOFTBREQ9 Position  */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ9_Msk                          (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ9_Pos)                  /*!< GPDMA SOFTBREQ: SOFTBREQ9 Mask      */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ10_Pos                         10                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ10 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ10_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ10_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ10 Mask     */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ11_Pos                         11                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ11 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ11_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ11_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ11 Mask     */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ12_Pos                         12                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ12 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ12_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ12_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ12 Mask     */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ13_Pos                         13                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ13 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ13_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ13_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ13 Mask     */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ14_Pos                         14                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ14 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ14_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ14_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ14 Mask     */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ15_Pos                         15                                                        /*!< GPDMA SOFTBREQ: SOFTBREQ15 Position */\r
+#define GPDMA_SOFTBREQ_SOFTBREQ15_Msk                         (0x01UL << GPDMA_SOFTBREQ_SOFTBREQ15_Pos)                 /*!< GPDMA SOFTBREQ: SOFTBREQ15 Mask     */\r
+\r
+// -------------------------------------  GPDMA_SOFTSREQ  -----------------------------------------\r
+#define GPDMA_SOFTSREQ_SOFTSREQ0_Pos                          0                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ0 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ0_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ0_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ0 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ1_Pos                          1                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ1 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ1_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ1_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ1 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ2_Pos                          2                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ2 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ2_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ2_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ2 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ3_Pos                          3                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ3 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ3_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ3_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ3 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ4_Pos                          4                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ4 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ4_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ4_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ4 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ5_Pos                          5                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ5 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ5_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ5_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ5 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ6_Pos                          6                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ6 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ6_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ6_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ6 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ7_Pos                          7                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ7 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ7_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ7_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ7 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ8_Pos                          8                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ8 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ8_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ8_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ8 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ9_Pos                          9                                                         /*!< GPDMA SOFTSREQ: SOFTSREQ9 Position  */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ9_Msk                          (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ9_Pos)                  /*!< GPDMA SOFTSREQ: SOFTSREQ9 Mask      */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ10_Pos                         10                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ10 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ10_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ10_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ10 Mask     */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ11_Pos                         11                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ11 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ11_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ11_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ11 Mask     */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ12_Pos                         12                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ12 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ12_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ12_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ12 Mask     */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ13_Pos                         13                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ13 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ13_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ13_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ13 Mask     */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ14_Pos                         14                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ14 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ14_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ14_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ14 Mask     */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ15_Pos                         15                                                        /*!< GPDMA SOFTSREQ: SOFTSREQ15 Position */\r
+#define GPDMA_SOFTSREQ_SOFTSREQ15_Msk                         (0x01UL << GPDMA_SOFTSREQ_SOFTSREQ15_Pos)                 /*!< GPDMA SOFTSREQ: SOFTSREQ15 Mask     */\r
+\r
+// -------------------------------------  GPDMA_SOFTLBREQ  ----------------------------------------\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ0_Pos                        0                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ0 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ0_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ0_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ0 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ1_Pos                        1                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ1 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ1_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ1_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ1 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ2_Pos                        2                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ2 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ2_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ2_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ2 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ3_Pos                        3                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ3 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ3_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ3_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ3 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ4_Pos                        4                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ4 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ4_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ4_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ4 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ5_Pos                        5                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ5 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ5_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ5_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ5 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ6_Pos                        6                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ6 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ6_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ6_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ6 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ7_Pos                        7                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ7 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ7_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ7_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ7 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ8_Pos                        8                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ8 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ8_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ8_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ8 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ9_Pos                        9                                                         /*!< GPDMA SOFTLBREQ: SOFTLBREQ9 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ9_Msk                        (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ9_Pos)                /*!< GPDMA SOFTLBREQ: SOFTLBREQ9 Mask    */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ10_Pos                       10                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ10 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ10_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ10_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ10 Mask   */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ11_Pos                       11                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ11 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ11_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ11_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ11 Mask   */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ12_Pos                       12                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ12 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ12_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ12_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ12 Mask   */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ13_Pos                       13                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ13 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ13_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ13_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ13 Mask   */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ14_Pos                       14                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ14 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ14_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ14_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ14 Mask   */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ15_Pos                       15                                                        /*!< GPDMA SOFTLBREQ: SOFTLBREQ15 Position */\r
+#define GPDMA_SOFTLBREQ_SOFTLBREQ15_Msk                       (0x01UL << GPDMA_SOFTLBREQ_SOFTLBREQ15_Pos)               /*!< GPDMA SOFTLBREQ: SOFTLBREQ15 Mask   */\r
+\r
+// -------------------------------------  GPDMA_SOFTLSREQ  ----------------------------------------\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ0_Pos                        0                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ0 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ0_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ0_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ0 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ1_Pos                        1                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ1 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ1_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ1_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ1 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ2_Pos                        2                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ2 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ2_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ2_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ2 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ3_Pos                        3                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ3 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ3_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ3_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ3 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ4_Pos                        4                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ4 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ4_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ4_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ4 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ5_Pos                        5                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ5 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ5_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ5_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ5 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ6_Pos                        6                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ6 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ6_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ6_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ6 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ7_Pos                        7                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ7 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ7_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ7_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ7 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ8_Pos                        8                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ8 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ8_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ8_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ8 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ9_Pos                        9                                                         /*!< GPDMA SOFTLSREQ: SOFTLSREQ9 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ9_Msk                        (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ9_Pos)                /*!< GPDMA SOFTLSREQ: SOFTLSREQ9 Mask    */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ10_Pos                       10                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ10 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ10_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ10_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ10 Mask   */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ11_Pos                       11                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ11 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ11_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ11_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ11 Mask   */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ12_Pos                       12                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ12 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ12_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ12_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ12 Mask   */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ13_Pos                       13                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ13 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ13_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ13_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ13 Mask   */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ14_Pos                       14                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ14 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ14_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ14_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ14 Mask   */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ15_Pos                       15                                                        /*!< GPDMA SOFTLSREQ: SOFTLSREQ15 Position */\r
+#define GPDMA_SOFTLSREQ_SOFTLSREQ15_Msk                       (0x01UL << GPDMA_SOFTLSREQ_SOFTLSREQ15_Pos)               /*!< GPDMA SOFTLSREQ: SOFTLSREQ15 Mask   */\r
+\r
+// --------------------------------------  GPDMA_CONFIG  ------------------------------------------\r
+#define GPDMA_CONFIG_E_Pos                                    0                                                         /*!< GPDMA CONFIG: E Position            */\r
+#define GPDMA_CONFIG_E_Msk                                    (0x01UL << GPDMA_CONFIG_E_Pos)                            /*!< GPDMA CONFIG: E Mask                */\r
+#define GPDMA_CONFIG_M0_Pos                                   1                                                         /*!< GPDMA CONFIG: M0 Position           */\r
+#define GPDMA_CONFIG_M0_Msk                                   (0x01UL << GPDMA_CONFIG_M0_Pos)                           /*!< GPDMA CONFIG: M0 Mask               */\r
+#define GPDMA_CONFIG_M1_Pos                                   2                                                         /*!< GPDMA CONFIG: M1 Position           */\r
+#define GPDMA_CONFIG_M1_Msk                                   (0x01UL << GPDMA_CONFIG_M1_Pos)                           /*!< GPDMA CONFIG: M1 Mask               */\r
+\r
+// ---------------------------------------  GPDMA_SYNC  -------------------------------------------\r
+#define GPDMA_SYNC_DMACSYNC0_Pos                              0                                                         /*!< GPDMA SYNC: DMACSYNC0 Position      */\r
+#define GPDMA_SYNC_DMACSYNC0_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC0_Pos)                      /*!< GPDMA SYNC: DMACSYNC0 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC1_Pos                              1                                                         /*!< GPDMA SYNC: DMACSYNC1 Position      */\r
+#define GPDMA_SYNC_DMACSYNC1_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC1_Pos)                      /*!< GPDMA SYNC: DMACSYNC1 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC2_Pos                              2                                                         /*!< GPDMA SYNC: DMACSYNC2 Position      */\r
+#define GPDMA_SYNC_DMACSYNC2_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC2_Pos)                      /*!< GPDMA SYNC: DMACSYNC2 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC3_Pos                              3                                                         /*!< GPDMA SYNC: DMACSYNC3 Position      */\r
+#define GPDMA_SYNC_DMACSYNC3_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC3_Pos)                      /*!< GPDMA SYNC: DMACSYNC3 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC4_Pos                              4                                                         /*!< GPDMA SYNC: DMACSYNC4 Position      */\r
+#define GPDMA_SYNC_DMACSYNC4_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC4_Pos)                      /*!< GPDMA SYNC: DMACSYNC4 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC5_Pos                              5                                                         /*!< GPDMA SYNC: DMACSYNC5 Position      */\r
+#define GPDMA_SYNC_DMACSYNC5_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC5_Pos)                      /*!< GPDMA SYNC: DMACSYNC5 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC6_Pos                              6                                                         /*!< GPDMA SYNC: DMACSYNC6 Position      */\r
+#define GPDMA_SYNC_DMACSYNC6_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC6_Pos)                      /*!< GPDMA SYNC: DMACSYNC6 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC7_Pos                              7                                                         /*!< GPDMA SYNC: DMACSYNC7 Position      */\r
+#define GPDMA_SYNC_DMACSYNC7_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC7_Pos)                      /*!< GPDMA SYNC: DMACSYNC7 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC8_Pos                              8                                                         /*!< GPDMA SYNC: DMACSYNC8 Position      */\r
+#define GPDMA_SYNC_DMACSYNC8_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC8_Pos)                      /*!< GPDMA SYNC: DMACSYNC8 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC9_Pos                              9                                                         /*!< GPDMA SYNC: DMACSYNC9 Position      */\r
+#define GPDMA_SYNC_DMACSYNC9_Msk                              (0x01UL << GPDMA_SYNC_DMACSYNC9_Pos)                      /*!< GPDMA SYNC: DMACSYNC9 Mask          */\r
+#define GPDMA_SYNC_DMACSYNC10_Pos                             10                                                        /*!< GPDMA SYNC: DMACSYNC10 Position     */\r
+#define GPDMA_SYNC_DMACSYNC10_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC10_Pos)                     /*!< GPDMA SYNC: DMACSYNC10 Mask         */\r
+#define GPDMA_SYNC_DMACSYNC11_Pos                             11                                                        /*!< GPDMA SYNC: DMACSYNC11 Position     */\r
+#define GPDMA_SYNC_DMACSYNC11_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC11_Pos)                     /*!< GPDMA SYNC: DMACSYNC11 Mask         */\r
+#define GPDMA_SYNC_DMACSYNC12_Pos                             12                                                        /*!< GPDMA SYNC: DMACSYNC12 Position     */\r
+#define GPDMA_SYNC_DMACSYNC12_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC12_Pos)                     /*!< GPDMA SYNC: DMACSYNC12 Mask         */\r
+#define GPDMA_SYNC_DMACSYNC13_Pos                             13                                                        /*!< GPDMA SYNC: DMACSYNC13 Position     */\r
+#define GPDMA_SYNC_DMACSYNC13_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC13_Pos)                     /*!< GPDMA SYNC: DMACSYNC13 Mask         */\r
+#define GPDMA_SYNC_DMACSYNC14_Pos                             14                                                        /*!< GPDMA SYNC: DMACSYNC14 Position     */\r
+#define GPDMA_SYNC_DMACSYNC14_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC14_Pos)                     /*!< GPDMA SYNC: DMACSYNC14 Mask         */\r
+#define GPDMA_SYNC_DMACSYNC15_Pos                             15                                                        /*!< GPDMA SYNC: DMACSYNC15 Position     */\r
+#define GPDMA_SYNC_DMACSYNC15_Msk                             (0x01UL << GPDMA_SYNC_DMACSYNC15_Pos)                     /*!< GPDMA SYNC: DMACSYNC15 Mask         */\r
+\r
+// -------------------------------------  GPDMA_C0SRCADDR  ----------------------------------------\r
+#define GPDMA_C0SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C0SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C0SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C0SRCADDR_SRCADDR_Pos)             /*!< GPDMA C0SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C0DESTADDR  ----------------------------------------\r
+#define GPDMA_C0DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C0DESTADDR: DESTADDR Position */\r
+#define GPDMA_C0DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C0DESTADDR_DESTADDR_Pos)           /*!< GPDMA C0DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C0LLI  ------------------------------------------\r
+#define GPDMA_C0LLI_LM_Pos                                    0                                                         /*!< GPDMA C0LLI: LM Position            */\r
+#define GPDMA_C0LLI_LM_Msk                                    (0x01UL << GPDMA_C0LLI_LM_Pos)                            /*!< GPDMA C0LLI: LM Mask                */\r
+#define GPDMA_C0LLI_R_Pos                                     1                                                         /*!< GPDMA C0LLI: R Position             */\r
+#define GPDMA_C0LLI_R_Msk                                     (0x01UL << GPDMA_C0LLI_R_Pos)                             /*!< GPDMA C0LLI: R Mask                 */\r
+#define GPDMA_C0LLI_LLI_Pos                                   2                                                         /*!< GPDMA C0LLI: LLI Position           */\r
+#define GPDMA_C0LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C0LLI_LLI_Pos)                     /*!< GPDMA C0LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C0CONTROL  ----------------------------------------\r
+#define GPDMA_C0CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C0CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C0CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C0CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C0CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C0CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C0CONTROL: SBSIZE Position    */\r
+#define GPDMA_C0CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C0CONTROL_SBSIZE_Pos)                    /*!< GPDMA C0CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C0CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C0CONTROL: DBSIZE Position    */\r
+#define GPDMA_C0CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C0CONTROL_DBSIZE_Pos)                    /*!< GPDMA C0CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C0CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C0CONTROL: SWIDTH Position    */\r
+#define GPDMA_C0CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C0CONTROL_SWIDTH_Pos)                    /*!< GPDMA C0CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C0CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C0CONTROL: DWIDTH Position    */\r
+#define GPDMA_C0CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C0CONTROL_DWIDTH_Pos)                    /*!< GPDMA C0CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C0CONTROL_S_Pos                                 24                                                        /*!< GPDMA C0CONTROL: S Position         */\r
+#define GPDMA_C0CONTROL_S_Msk                                 (0x01UL << GPDMA_C0CONTROL_S_Pos)                         /*!< GPDMA C0CONTROL: S Mask             */\r
+#define GPDMA_C0CONTROL_D_Pos                                 25                                                        /*!< GPDMA C0CONTROL: D Position         */\r
+#define GPDMA_C0CONTROL_D_Msk                                 (0x01UL << GPDMA_C0CONTROL_D_Pos)                         /*!< GPDMA C0CONTROL: D Mask             */\r
+#define GPDMA_C0CONTROL_SI_Pos                                26                                                        /*!< GPDMA C0CONTROL: SI Position        */\r
+#define GPDMA_C0CONTROL_SI_Msk                                (0x01UL << GPDMA_C0CONTROL_SI_Pos)                        /*!< GPDMA C0CONTROL: SI Mask            */\r
+#define GPDMA_C0CONTROL_DI_Pos                                27                                                        /*!< GPDMA C0CONTROL: DI Position        */\r
+#define GPDMA_C0CONTROL_DI_Msk                                (0x01UL << GPDMA_C0CONTROL_DI_Pos)                        /*!< GPDMA C0CONTROL: DI Mask            */\r
+#define GPDMA_C0CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C0CONTROL: PROT1 Position     */\r
+#define GPDMA_C0CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C0CONTROL_PROT1_Pos)                     /*!< GPDMA C0CONTROL: PROT1 Mask         */\r
+#define GPDMA_C0CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C0CONTROL: PROT2 Position     */\r
+#define GPDMA_C0CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C0CONTROL_PROT2_Pos)                     /*!< GPDMA C0CONTROL: PROT2 Mask         */\r
+#define GPDMA_C0CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C0CONTROL: PROT3 Position     */\r
+#define GPDMA_C0CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C0CONTROL_PROT3_Pos)                     /*!< GPDMA C0CONTROL: PROT3 Mask         */\r
+#define GPDMA_C0CONTROL_I_Pos                                 31                                                        /*!< GPDMA C0CONTROL: I Position         */\r
+#define GPDMA_C0CONTROL_I_Msk                                 (0x01UL << GPDMA_C0CONTROL_I_Pos)                         /*!< GPDMA C0CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C0CONFIG  -----------------------------------------\r
+#define GPDMA_C0CONFIG_E_Pos                                  0                                                         /*!< GPDMA C0CONFIG: E Position          */\r
+#define GPDMA_C0CONFIG_E_Msk                                  (0x01UL << GPDMA_C0CONFIG_E_Pos)                          /*!< GPDMA C0CONFIG: E Mask              */\r
+#define GPDMA_C0CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C0CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C0CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C0CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C0CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C0CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C0CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C0CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C0CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C0CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C0CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C0CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C0CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C0CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C0CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C0CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C0CONFIG: IE Position         */\r
+#define GPDMA_C0CONFIG_IE_Msk                                 (0x01UL << GPDMA_C0CONFIG_IE_Pos)                         /*!< GPDMA C0CONFIG: IE Mask             */\r
+#define GPDMA_C0CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C0CONFIG: ITC Position        */\r
+#define GPDMA_C0CONFIG_ITC_Msk                                (0x01UL << GPDMA_C0CONFIG_ITC_Pos)                        /*!< GPDMA C0CONFIG: ITC Mask            */\r
+#define GPDMA_C0CONFIG_L_Pos                                  16                                                        /*!< GPDMA C0CONFIG: L Position          */\r
+#define GPDMA_C0CONFIG_L_Msk                                  (0x01UL << GPDMA_C0CONFIG_L_Pos)                          /*!< GPDMA C0CONFIG: L Mask              */\r
+#define GPDMA_C0CONFIG_A_Pos                                  17                                                        /*!< GPDMA C0CONFIG: A Position          */\r
+#define GPDMA_C0CONFIG_A_Msk                                  (0x01UL << GPDMA_C0CONFIG_A_Pos)                          /*!< GPDMA C0CONFIG: A Mask              */\r
+#define GPDMA_C0CONFIG_H_Pos                                  18                                                        /*!< GPDMA C0CONFIG: H Position          */\r
+#define GPDMA_C0CONFIG_H_Msk                                  (0x01UL << GPDMA_C0CONFIG_H_Pos)                          /*!< GPDMA C0CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C1SRCADDR  ----------------------------------------\r
+#define GPDMA_C1SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C1SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C1SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C1SRCADDR_SRCADDR_Pos)             /*!< GPDMA C1SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C1DESTADDR  ----------------------------------------\r
+#define GPDMA_C1DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C1DESTADDR: DESTADDR Position */\r
+#define GPDMA_C1DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C1DESTADDR_DESTADDR_Pos)           /*!< GPDMA C1DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C1LLI  ------------------------------------------\r
+#define GPDMA_C1LLI_LM_Pos                                    0                                                         /*!< GPDMA C1LLI: LM Position            */\r
+#define GPDMA_C1LLI_LM_Msk                                    (0x01UL << GPDMA_C1LLI_LM_Pos)                            /*!< GPDMA C1LLI: LM Mask                */\r
+#define GPDMA_C1LLI_R_Pos                                     1                                                         /*!< GPDMA C1LLI: R Position             */\r
+#define GPDMA_C1LLI_R_Msk                                     (0x01UL << GPDMA_C1LLI_R_Pos)                             /*!< GPDMA C1LLI: R Mask                 */\r
+#define GPDMA_C1LLI_LLI_Pos                                   2                                                         /*!< GPDMA C1LLI: LLI Position           */\r
+#define GPDMA_C1LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C1LLI_LLI_Pos)                     /*!< GPDMA C1LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C1CONTROL  ----------------------------------------\r
+#define GPDMA_C1CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C1CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C1CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C1CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C1CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C1CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C1CONTROL: SBSIZE Position    */\r
+#define GPDMA_C1CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C1CONTROL_SBSIZE_Pos)                    /*!< GPDMA C1CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C1CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C1CONTROL: DBSIZE Position    */\r
+#define GPDMA_C1CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C1CONTROL_DBSIZE_Pos)                    /*!< GPDMA C1CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C1CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C1CONTROL: SWIDTH Position    */\r
+#define GPDMA_C1CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C1CONTROL_SWIDTH_Pos)                    /*!< GPDMA C1CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C1CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C1CONTROL: DWIDTH Position    */\r
+#define GPDMA_C1CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C1CONTROL_DWIDTH_Pos)                    /*!< GPDMA C1CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C1CONTROL_S_Pos                                 24                                                        /*!< GPDMA C1CONTROL: S Position         */\r
+#define GPDMA_C1CONTROL_S_Msk                                 (0x01UL << GPDMA_C1CONTROL_S_Pos)                         /*!< GPDMA C1CONTROL: S Mask             */\r
+#define GPDMA_C1CONTROL_D_Pos                                 25                                                        /*!< GPDMA C1CONTROL: D Position         */\r
+#define GPDMA_C1CONTROL_D_Msk                                 (0x01UL << GPDMA_C1CONTROL_D_Pos)                         /*!< GPDMA C1CONTROL: D Mask             */\r
+#define GPDMA_C1CONTROL_SI_Pos                                26                                                        /*!< GPDMA C1CONTROL: SI Position        */\r
+#define GPDMA_C1CONTROL_SI_Msk                                (0x01UL << GPDMA_C1CONTROL_SI_Pos)                        /*!< GPDMA C1CONTROL: SI Mask            */\r
+#define GPDMA_C1CONTROL_DI_Pos                                27                                                        /*!< GPDMA C1CONTROL: DI Position        */\r
+#define GPDMA_C1CONTROL_DI_Msk                                (0x01UL << GPDMA_C1CONTROL_DI_Pos)                        /*!< GPDMA C1CONTROL: DI Mask            */\r
+#define GPDMA_C1CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C1CONTROL: PROT1 Position     */\r
+#define GPDMA_C1CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C1CONTROL_PROT1_Pos)                     /*!< GPDMA C1CONTROL: PROT1 Mask         */\r
+#define GPDMA_C1CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C1CONTROL: PROT2 Position     */\r
+#define GPDMA_C1CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C1CONTROL_PROT2_Pos)                     /*!< GPDMA C1CONTROL: PROT2 Mask         */\r
+#define GPDMA_C1CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C1CONTROL: PROT3 Position     */\r
+#define GPDMA_C1CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C1CONTROL_PROT3_Pos)                     /*!< GPDMA C1CONTROL: PROT3 Mask         */\r
+#define GPDMA_C1CONTROL_I_Pos                                 31                                                        /*!< GPDMA C1CONTROL: I Position         */\r
+#define GPDMA_C1CONTROL_I_Msk                                 (0x01UL << GPDMA_C1CONTROL_I_Pos)                         /*!< GPDMA C1CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C1CONFIG  -----------------------------------------\r
+#define GPDMA_C1CONFIG_E_Pos                                  0                                                         /*!< GPDMA C1CONFIG: E Position          */\r
+#define GPDMA_C1CONFIG_E_Msk                                  (0x01UL << GPDMA_C1CONFIG_E_Pos)                          /*!< GPDMA C1CONFIG: E Mask              */\r
+#define GPDMA_C1CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C1CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C1CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C1CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C1CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C1CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C1CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C1CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C1CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C1CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C1CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C1CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C1CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C1CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C1CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C1CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C1CONFIG: IE Position         */\r
+#define GPDMA_C1CONFIG_IE_Msk                                 (0x01UL << GPDMA_C1CONFIG_IE_Pos)                         /*!< GPDMA C1CONFIG: IE Mask             */\r
+#define GPDMA_C1CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C1CONFIG: ITC Position        */\r
+#define GPDMA_C1CONFIG_ITC_Msk                                (0x01UL << GPDMA_C1CONFIG_ITC_Pos)                        /*!< GPDMA C1CONFIG: ITC Mask            */\r
+#define GPDMA_C1CONFIG_L_Pos                                  16                                                        /*!< GPDMA C1CONFIG: L Position          */\r
+#define GPDMA_C1CONFIG_L_Msk                                  (0x01UL << GPDMA_C1CONFIG_L_Pos)                          /*!< GPDMA C1CONFIG: L Mask              */\r
+#define GPDMA_C1CONFIG_A_Pos                                  17                                                        /*!< GPDMA C1CONFIG: A Position          */\r
+#define GPDMA_C1CONFIG_A_Msk                                  (0x01UL << GPDMA_C1CONFIG_A_Pos)                          /*!< GPDMA C1CONFIG: A Mask              */\r
+#define GPDMA_C1CONFIG_H_Pos                                  18                                                        /*!< GPDMA C1CONFIG: H Position          */\r
+#define GPDMA_C1CONFIG_H_Msk                                  (0x01UL << GPDMA_C1CONFIG_H_Pos)                          /*!< GPDMA C1CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C2SRCADDR  ----------------------------------------\r
+#define GPDMA_C2SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C2SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C2SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C2SRCADDR_SRCADDR_Pos)             /*!< GPDMA C2SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C2DESTADDR  ----------------------------------------\r
+#define GPDMA_C2DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C2DESTADDR: DESTADDR Position */\r
+#define GPDMA_C2DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C2DESTADDR_DESTADDR_Pos)           /*!< GPDMA C2DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C2LLI  ------------------------------------------\r
+#define GPDMA_C2LLI_LM_Pos                                    0                                                         /*!< GPDMA C2LLI: LM Position            */\r
+#define GPDMA_C2LLI_LM_Msk                                    (0x01UL << GPDMA_C2LLI_LM_Pos)                            /*!< GPDMA C2LLI: LM Mask                */\r
+#define GPDMA_C2LLI_R_Pos                                     1                                                         /*!< GPDMA C2LLI: R Position             */\r
+#define GPDMA_C2LLI_R_Msk                                     (0x01UL << GPDMA_C2LLI_R_Pos)                             /*!< GPDMA C2LLI: R Mask                 */\r
+#define GPDMA_C2LLI_LLI_Pos                                   2                                                         /*!< GPDMA C2LLI: LLI Position           */\r
+#define GPDMA_C2LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C2LLI_LLI_Pos)                     /*!< GPDMA C2LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C2CONTROL  ----------------------------------------\r
+#define GPDMA_C2CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C2CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C2CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C2CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C2CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C2CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C2CONTROL: SBSIZE Position    */\r
+#define GPDMA_C2CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C2CONTROL_SBSIZE_Pos)                    /*!< GPDMA C2CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C2CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C2CONTROL: DBSIZE Position    */\r
+#define GPDMA_C2CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C2CONTROL_DBSIZE_Pos)                    /*!< GPDMA C2CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C2CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C2CONTROL: SWIDTH Position    */\r
+#define GPDMA_C2CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C2CONTROL_SWIDTH_Pos)                    /*!< GPDMA C2CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C2CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C2CONTROL: DWIDTH Position    */\r
+#define GPDMA_C2CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C2CONTROL_DWIDTH_Pos)                    /*!< GPDMA C2CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C2CONTROL_S_Pos                                 24                                                        /*!< GPDMA C2CONTROL: S Position         */\r
+#define GPDMA_C2CONTROL_S_Msk                                 (0x01UL << GPDMA_C2CONTROL_S_Pos)                         /*!< GPDMA C2CONTROL: S Mask             */\r
+#define GPDMA_C2CONTROL_D_Pos                                 25                                                        /*!< GPDMA C2CONTROL: D Position         */\r
+#define GPDMA_C2CONTROL_D_Msk                                 (0x01UL << GPDMA_C2CONTROL_D_Pos)                         /*!< GPDMA C2CONTROL: D Mask             */\r
+#define GPDMA_C2CONTROL_SI_Pos                                26                                                        /*!< GPDMA C2CONTROL: SI Position        */\r
+#define GPDMA_C2CONTROL_SI_Msk                                (0x01UL << GPDMA_C2CONTROL_SI_Pos)                        /*!< GPDMA C2CONTROL: SI Mask            */\r
+#define GPDMA_C2CONTROL_DI_Pos                                27                                                        /*!< GPDMA C2CONTROL: DI Position        */\r
+#define GPDMA_C2CONTROL_DI_Msk                                (0x01UL << GPDMA_C2CONTROL_DI_Pos)                        /*!< GPDMA C2CONTROL: DI Mask            */\r
+#define GPDMA_C2CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C2CONTROL: PROT1 Position     */\r
+#define GPDMA_C2CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C2CONTROL_PROT1_Pos)                     /*!< GPDMA C2CONTROL: PROT1 Mask         */\r
+#define GPDMA_C2CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C2CONTROL: PROT2 Position     */\r
+#define GPDMA_C2CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C2CONTROL_PROT2_Pos)                     /*!< GPDMA C2CONTROL: PROT2 Mask         */\r
+#define GPDMA_C2CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C2CONTROL: PROT3 Position     */\r
+#define GPDMA_C2CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C2CONTROL_PROT3_Pos)                     /*!< GPDMA C2CONTROL: PROT3 Mask         */\r
+#define GPDMA_C2CONTROL_I_Pos                                 31                                                        /*!< GPDMA C2CONTROL: I Position         */\r
+#define GPDMA_C2CONTROL_I_Msk                                 (0x01UL << GPDMA_C2CONTROL_I_Pos)                         /*!< GPDMA C2CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C2CONFIG  -----------------------------------------\r
+#define GPDMA_C2CONFIG_E_Pos                                  0                                                         /*!< GPDMA C2CONFIG: E Position          */\r
+#define GPDMA_C2CONFIG_E_Msk                                  (0x01UL << GPDMA_C2CONFIG_E_Pos)                          /*!< GPDMA C2CONFIG: E Mask              */\r
+#define GPDMA_C2CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C2CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C2CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C2CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C2CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C2CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C2CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C2CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C2CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C2CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C2CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C2CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C2CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C2CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C2CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C2CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C2CONFIG: IE Position         */\r
+#define GPDMA_C2CONFIG_IE_Msk                                 (0x01UL << GPDMA_C2CONFIG_IE_Pos)                         /*!< GPDMA C2CONFIG: IE Mask             */\r
+#define GPDMA_C2CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C2CONFIG: ITC Position        */\r
+#define GPDMA_C2CONFIG_ITC_Msk                                (0x01UL << GPDMA_C2CONFIG_ITC_Pos)                        /*!< GPDMA C2CONFIG: ITC Mask            */\r
+#define GPDMA_C2CONFIG_L_Pos                                  16                                                        /*!< GPDMA C2CONFIG: L Position          */\r
+#define GPDMA_C2CONFIG_L_Msk                                  (0x01UL << GPDMA_C2CONFIG_L_Pos)                          /*!< GPDMA C2CONFIG: L Mask              */\r
+#define GPDMA_C2CONFIG_A_Pos                                  17                                                        /*!< GPDMA C2CONFIG: A Position          */\r
+#define GPDMA_C2CONFIG_A_Msk                                  (0x01UL << GPDMA_C2CONFIG_A_Pos)                          /*!< GPDMA C2CONFIG: A Mask              */\r
+#define GPDMA_C2CONFIG_H_Pos                                  18                                                        /*!< GPDMA C2CONFIG: H Position          */\r
+#define GPDMA_C2CONFIG_H_Msk                                  (0x01UL << GPDMA_C2CONFIG_H_Pos)                          /*!< GPDMA C2CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C3SRCADDR  ----------------------------------------\r
+#define GPDMA_C3SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C3SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C3SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C3SRCADDR_SRCADDR_Pos)             /*!< GPDMA C3SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C3DESTADDR  ----------------------------------------\r
+#define GPDMA_C3DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C3DESTADDR: DESTADDR Position */\r
+#define GPDMA_C3DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C3DESTADDR_DESTADDR_Pos)           /*!< GPDMA C3DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C3LLI  ------------------------------------------\r
+#define GPDMA_C3LLI_LM_Pos                                    0                                                         /*!< GPDMA C3LLI: LM Position            */\r
+#define GPDMA_C3LLI_LM_Msk                                    (0x01UL << GPDMA_C3LLI_LM_Pos)                            /*!< GPDMA C3LLI: LM Mask                */\r
+#define GPDMA_C3LLI_R_Pos                                     1                                                         /*!< GPDMA C3LLI: R Position             */\r
+#define GPDMA_C3LLI_R_Msk                                     (0x01UL << GPDMA_C3LLI_R_Pos)                             /*!< GPDMA C3LLI: R Mask                 */\r
+#define GPDMA_C3LLI_LLI_Pos                                   2                                                         /*!< GPDMA C3LLI: LLI Position           */\r
+#define GPDMA_C3LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C3LLI_LLI_Pos)                     /*!< GPDMA C3LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C3CONTROL  ----------------------------------------\r
+#define GPDMA_C3CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C3CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C3CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C3CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C3CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C3CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C3CONTROL: SBSIZE Position    */\r
+#define GPDMA_C3CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C3CONTROL_SBSIZE_Pos)                    /*!< GPDMA C3CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C3CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C3CONTROL: DBSIZE Position    */\r
+#define GPDMA_C3CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C3CONTROL_DBSIZE_Pos)                    /*!< GPDMA C3CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C3CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C3CONTROL: SWIDTH Position    */\r
+#define GPDMA_C3CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C3CONTROL_SWIDTH_Pos)                    /*!< GPDMA C3CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C3CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C3CONTROL: DWIDTH Position    */\r
+#define GPDMA_C3CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C3CONTROL_DWIDTH_Pos)                    /*!< GPDMA C3CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C3CONTROL_S_Pos                                 24                                                        /*!< GPDMA C3CONTROL: S Position         */\r
+#define GPDMA_C3CONTROL_S_Msk                                 (0x01UL << GPDMA_C3CONTROL_S_Pos)                         /*!< GPDMA C3CONTROL: S Mask             */\r
+#define GPDMA_C3CONTROL_D_Pos                                 25                                                        /*!< GPDMA C3CONTROL: D Position         */\r
+#define GPDMA_C3CONTROL_D_Msk                                 (0x01UL << GPDMA_C3CONTROL_D_Pos)                         /*!< GPDMA C3CONTROL: D Mask             */\r
+#define GPDMA_C3CONTROL_SI_Pos                                26                                                        /*!< GPDMA C3CONTROL: SI Position        */\r
+#define GPDMA_C3CONTROL_SI_Msk                                (0x01UL << GPDMA_C3CONTROL_SI_Pos)                        /*!< GPDMA C3CONTROL: SI Mask            */\r
+#define GPDMA_C3CONTROL_DI_Pos                                27                                                        /*!< GPDMA C3CONTROL: DI Position        */\r
+#define GPDMA_C3CONTROL_DI_Msk                                (0x01UL << GPDMA_C3CONTROL_DI_Pos)                        /*!< GPDMA C3CONTROL: DI Mask            */\r
+#define GPDMA_C3CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C3CONTROL: PROT1 Position     */\r
+#define GPDMA_C3CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C3CONTROL_PROT1_Pos)                     /*!< GPDMA C3CONTROL: PROT1 Mask         */\r
+#define GPDMA_C3CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C3CONTROL: PROT2 Position     */\r
+#define GPDMA_C3CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C3CONTROL_PROT2_Pos)                     /*!< GPDMA C3CONTROL: PROT2 Mask         */\r
+#define GPDMA_C3CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C3CONTROL: PROT3 Position     */\r
+#define GPDMA_C3CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C3CONTROL_PROT3_Pos)                     /*!< GPDMA C3CONTROL: PROT3 Mask         */\r
+#define GPDMA_C3CONTROL_I_Pos                                 31                                                        /*!< GPDMA C3CONTROL: I Position         */\r
+#define GPDMA_C3CONTROL_I_Msk                                 (0x01UL << GPDMA_C3CONTROL_I_Pos)                         /*!< GPDMA C3CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C3CONFIG  -----------------------------------------\r
+#define GPDMA_C3CONFIG_E_Pos                                  0                                                         /*!< GPDMA C3CONFIG: E Position          */\r
+#define GPDMA_C3CONFIG_E_Msk                                  (0x01UL << GPDMA_C3CONFIG_E_Pos)                          /*!< GPDMA C3CONFIG: E Mask              */\r
+#define GPDMA_C3CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C3CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C3CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C3CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C3CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C3CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C3CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C3CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C3CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C3CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C3CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C3CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C3CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C3CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C3CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C3CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C3CONFIG: IE Position         */\r
+#define GPDMA_C3CONFIG_IE_Msk                                 (0x01UL << GPDMA_C3CONFIG_IE_Pos)                         /*!< GPDMA C3CONFIG: IE Mask             */\r
+#define GPDMA_C3CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C3CONFIG: ITC Position        */\r
+#define GPDMA_C3CONFIG_ITC_Msk                                (0x01UL << GPDMA_C3CONFIG_ITC_Pos)                        /*!< GPDMA C3CONFIG: ITC Mask            */\r
+#define GPDMA_C3CONFIG_L_Pos                                  16                                                        /*!< GPDMA C3CONFIG: L Position          */\r
+#define GPDMA_C3CONFIG_L_Msk                                  (0x01UL << GPDMA_C3CONFIG_L_Pos)                          /*!< GPDMA C3CONFIG: L Mask              */\r
+#define GPDMA_C3CONFIG_A_Pos                                  17                                                        /*!< GPDMA C3CONFIG: A Position          */\r
+#define GPDMA_C3CONFIG_A_Msk                                  (0x01UL << GPDMA_C3CONFIG_A_Pos)                          /*!< GPDMA C3CONFIG: A Mask              */\r
+#define GPDMA_C3CONFIG_H_Pos                                  18                                                        /*!< GPDMA C3CONFIG: H Position          */\r
+#define GPDMA_C3CONFIG_H_Msk                                  (0x01UL << GPDMA_C3CONFIG_H_Pos)                          /*!< GPDMA C3CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C4SRCADDR  ----------------------------------------\r
+#define GPDMA_C4SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C4SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C4SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C4SRCADDR_SRCADDR_Pos)             /*!< GPDMA C4SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C4DESTADDR  ----------------------------------------\r
+#define GPDMA_C4DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C4DESTADDR: DESTADDR Position */\r
+#define GPDMA_C4DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C4DESTADDR_DESTADDR_Pos)           /*!< GPDMA C4DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C4LLI  ------------------------------------------\r
+#define GPDMA_C4LLI_LM_Pos                                    0                                                         /*!< GPDMA C4LLI: LM Position            */\r
+#define GPDMA_C4LLI_LM_Msk                                    (0x01UL << GPDMA_C4LLI_LM_Pos)                            /*!< GPDMA C4LLI: LM Mask                */\r
+#define GPDMA_C4LLI_R_Pos                                     1                                                         /*!< GPDMA C4LLI: R Position             */\r
+#define GPDMA_C4LLI_R_Msk                                     (0x01UL << GPDMA_C4LLI_R_Pos)                             /*!< GPDMA C4LLI: R Mask                 */\r
+#define GPDMA_C4LLI_LLI_Pos                                   2                                                         /*!< GPDMA C4LLI: LLI Position           */\r
+#define GPDMA_C4LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C4LLI_LLI_Pos)                     /*!< GPDMA C4LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C4CONTROL  ----------------------------------------\r
+#define GPDMA_C4CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C4CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C4CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C4CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C4CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C4CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C4CONTROL: SBSIZE Position    */\r
+#define GPDMA_C4CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C4CONTROL_SBSIZE_Pos)                    /*!< GPDMA C4CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C4CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C4CONTROL: DBSIZE Position    */\r
+#define GPDMA_C4CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C4CONTROL_DBSIZE_Pos)                    /*!< GPDMA C4CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C4CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C4CONTROL: SWIDTH Position    */\r
+#define GPDMA_C4CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C4CONTROL_SWIDTH_Pos)                    /*!< GPDMA C4CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C4CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C4CONTROL: DWIDTH Position    */\r
+#define GPDMA_C4CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C4CONTROL_DWIDTH_Pos)                    /*!< GPDMA C4CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C4CONTROL_S_Pos                                 24                                                        /*!< GPDMA C4CONTROL: S Position         */\r
+#define GPDMA_C4CONTROL_S_Msk                                 (0x01UL << GPDMA_C4CONTROL_S_Pos)                         /*!< GPDMA C4CONTROL: S Mask             */\r
+#define GPDMA_C4CONTROL_D_Pos                                 25                                                        /*!< GPDMA C4CONTROL: D Position         */\r
+#define GPDMA_C4CONTROL_D_Msk                                 (0x01UL << GPDMA_C4CONTROL_D_Pos)                         /*!< GPDMA C4CONTROL: D Mask             */\r
+#define GPDMA_C4CONTROL_SI_Pos                                26                                                        /*!< GPDMA C4CONTROL: SI Position        */\r
+#define GPDMA_C4CONTROL_SI_Msk                                (0x01UL << GPDMA_C4CONTROL_SI_Pos)                        /*!< GPDMA C4CONTROL: SI Mask            */\r
+#define GPDMA_C4CONTROL_DI_Pos                                27                                                        /*!< GPDMA C4CONTROL: DI Position        */\r
+#define GPDMA_C4CONTROL_DI_Msk                                (0x01UL << GPDMA_C4CONTROL_DI_Pos)                        /*!< GPDMA C4CONTROL: DI Mask            */\r
+#define GPDMA_C4CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C4CONTROL: PROT1 Position     */\r
+#define GPDMA_C4CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C4CONTROL_PROT1_Pos)                     /*!< GPDMA C4CONTROL: PROT1 Mask         */\r
+#define GPDMA_C4CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C4CONTROL: PROT2 Position     */\r
+#define GPDMA_C4CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C4CONTROL_PROT2_Pos)                     /*!< GPDMA C4CONTROL: PROT2 Mask         */\r
+#define GPDMA_C4CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C4CONTROL: PROT3 Position     */\r
+#define GPDMA_C4CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C4CONTROL_PROT3_Pos)                     /*!< GPDMA C4CONTROL: PROT3 Mask         */\r
+#define GPDMA_C4CONTROL_I_Pos                                 31                                                        /*!< GPDMA C4CONTROL: I Position         */\r
+#define GPDMA_C4CONTROL_I_Msk                                 (0x01UL << GPDMA_C4CONTROL_I_Pos)                         /*!< GPDMA C4CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C4CONFIG  -----------------------------------------\r
+#define GPDMA_C4CONFIG_E_Pos                                  0                                                         /*!< GPDMA C4CONFIG: E Position          */\r
+#define GPDMA_C4CONFIG_E_Msk                                  (0x01UL << GPDMA_C4CONFIG_E_Pos)                          /*!< GPDMA C4CONFIG: E Mask              */\r
+#define GPDMA_C4CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C4CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C4CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C4CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C4CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C4CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C4CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C4CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C4CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C4CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C4CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C4CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C4CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C4CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C4CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C4CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C4CONFIG: IE Position         */\r
+#define GPDMA_C4CONFIG_IE_Msk                                 (0x01UL << GPDMA_C4CONFIG_IE_Pos)                         /*!< GPDMA C4CONFIG: IE Mask             */\r
+#define GPDMA_C4CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C4CONFIG: ITC Position        */\r
+#define GPDMA_C4CONFIG_ITC_Msk                                (0x01UL << GPDMA_C4CONFIG_ITC_Pos)                        /*!< GPDMA C4CONFIG: ITC Mask            */\r
+#define GPDMA_C4CONFIG_L_Pos                                  16                                                        /*!< GPDMA C4CONFIG: L Position          */\r
+#define GPDMA_C4CONFIG_L_Msk                                  (0x01UL << GPDMA_C4CONFIG_L_Pos)                          /*!< GPDMA C4CONFIG: L Mask              */\r
+#define GPDMA_C4CONFIG_A_Pos                                  17                                                        /*!< GPDMA C4CONFIG: A Position          */\r
+#define GPDMA_C4CONFIG_A_Msk                                  (0x01UL << GPDMA_C4CONFIG_A_Pos)                          /*!< GPDMA C4CONFIG: A Mask              */\r
+#define GPDMA_C4CONFIG_H_Pos                                  18                                                        /*!< GPDMA C4CONFIG: H Position          */\r
+#define GPDMA_C4CONFIG_H_Msk                                  (0x01UL << GPDMA_C4CONFIG_H_Pos)                          /*!< GPDMA C4CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C5SRCADDR  ----------------------------------------\r
+#define GPDMA_C5SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C5SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C5SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C5SRCADDR_SRCADDR_Pos)             /*!< GPDMA C5SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C5DESTADDR  ----------------------------------------\r
+#define GPDMA_C5DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C5DESTADDR: DESTADDR Position */\r
+#define GPDMA_C5DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C5DESTADDR_DESTADDR_Pos)           /*!< GPDMA C5DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C5LLI  ------------------------------------------\r
+#define GPDMA_C5LLI_LM_Pos                                    0                                                         /*!< GPDMA C5LLI: LM Position            */\r
+#define GPDMA_C5LLI_LM_Msk                                    (0x01UL << GPDMA_C5LLI_LM_Pos)                            /*!< GPDMA C5LLI: LM Mask                */\r
+#define GPDMA_C5LLI_R_Pos                                     1                                                         /*!< GPDMA C5LLI: R Position             */\r
+#define GPDMA_C5LLI_R_Msk                                     (0x01UL << GPDMA_C5LLI_R_Pos)                             /*!< GPDMA C5LLI: R Mask                 */\r
+#define GPDMA_C5LLI_LLI_Pos                                   2                                                         /*!< GPDMA C5LLI: LLI Position           */\r
+#define GPDMA_C5LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C5LLI_LLI_Pos)                     /*!< GPDMA C5LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C5CONTROL  ----------------------------------------\r
+#define GPDMA_C5CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C5CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C5CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C5CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C5CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C5CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C5CONTROL: SBSIZE Position    */\r
+#define GPDMA_C5CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C5CONTROL_SBSIZE_Pos)                    /*!< GPDMA C5CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C5CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C5CONTROL: DBSIZE Position    */\r
+#define GPDMA_C5CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C5CONTROL_DBSIZE_Pos)                    /*!< GPDMA C5CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C5CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C5CONTROL: SWIDTH Position    */\r
+#define GPDMA_C5CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C5CONTROL_SWIDTH_Pos)                    /*!< GPDMA C5CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C5CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C5CONTROL: DWIDTH Position    */\r
+#define GPDMA_C5CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C5CONTROL_DWIDTH_Pos)                    /*!< GPDMA C5CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C5CONTROL_S_Pos                                 24                                                        /*!< GPDMA C5CONTROL: S Position         */\r
+#define GPDMA_C5CONTROL_S_Msk                                 (0x01UL << GPDMA_C5CONTROL_S_Pos)                         /*!< GPDMA C5CONTROL: S Mask             */\r
+#define GPDMA_C5CONTROL_D_Pos                                 25                                                        /*!< GPDMA C5CONTROL: D Position         */\r
+#define GPDMA_C5CONTROL_D_Msk                                 (0x01UL << GPDMA_C5CONTROL_D_Pos)                         /*!< GPDMA C5CONTROL: D Mask             */\r
+#define GPDMA_C5CONTROL_SI_Pos                                26                                                        /*!< GPDMA C5CONTROL: SI Position        */\r
+#define GPDMA_C5CONTROL_SI_Msk                                (0x01UL << GPDMA_C5CONTROL_SI_Pos)                        /*!< GPDMA C5CONTROL: SI Mask            */\r
+#define GPDMA_C5CONTROL_DI_Pos                                27                                                        /*!< GPDMA C5CONTROL: DI Position        */\r
+#define GPDMA_C5CONTROL_DI_Msk                                (0x01UL << GPDMA_C5CONTROL_DI_Pos)                        /*!< GPDMA C5CONTROL: DI Mask            */\r
+#define GPDMA_C5CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C5CONTROL: PROT1 Position     */\r
+#define GPDMA_C5CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C5CONTROL_PROT1_Pos)                     /*!< GPDMA C5CONTROL: PROT1 Mask         */\r
+#define GPDMA_C5CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C5CONTROL: PROT2 Position     */\r
+#define GPDMA_C5CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C5CONTROL_PROT2_Pos)                     /*!< GPDMA C5CONTROL: PROT2 Mask         */\r
+#define GPDMA_C5CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C5CONTROL: PROT3 Position     */\r
+#define GPDMA_C5CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C5CONTROL_PROT3_Pos)                     /*!< GPDMA C5CONTROL: PROT3 Mask         */\r
+#define GPDMA_C5CONTROL_I_Pos                                 31                                                        /*!< GPDMA C5CONTROL: I Position         */\r
+#define GPDMA_C5CONTROL_I_Msk                                 (0x01UL << GPDMA_C5CONTROL_I_Pos)                         /*!< GPDMA C5CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C5CONFIG  -----------------------------------------\r
+#define GPDMA_C5CONFIG_E_Pos                                  0                                                         /*!< GPDMA C5CONFIG: E Position          */\r
+#define GPDMA_C5CONFIG_E_Msk                                  (0x01UL << GPDMA_C5CONFIG_E_Pos)                          /*!< GPDMA C5CONFIG: E Mask              */\r
+#define GPDMA_C5CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C5CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C5CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C5CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C5CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C5CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C5CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C5CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C5CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C5CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C5CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C5CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C5CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C5CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C5CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C5CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C5CONFIG: IE Position         */\r
+#define GPDMA_C5CONFIG_IE_Msk                                 (0x01UL << GPDMA_C5CONFIG_IE_Pos)                         /*!< GPDMA C5CONFIG: IE Mask             */\r
+#define GPDMA_C5CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C5CONFIG: ITC Position        */\r
+#define GPDMA_C5CONFIG_ITC_Msk                                (0x01UL << GPDMA_C5CONFIG_ITC_Pos)                        /*!< GPDMA C5CONFIG: ITC Mask            */\r
+#define GPDMA_C5CONFIG_L_Pos                                  16                                                        /*!< GPDMA C5CONFIG: L Position          */\r
+#define GPDMA_C5CONFIG_L_Msk                                  (0x01UL << GPDMA_C5CONFIG_L_Pos)                          /*!< GPDMA C5CONFIG: L Mask              */\r
+#define GPDMA_C5CONFIG_A_Pos                                  17                                                        /*!< GPDMA C5CONFIG: A Position          */\r
+#define GPDMA_C5CONFIG_A_Msk                                  (0x01UL << GPDMA_C5CONFIG_A_Pos)                          /*!< GPDMA C5CONFIG: A Mask              */\r
+#define GPDMA_C5CONFIG_H_Pos                                  18                                                        /*!< GPDMA C5CONFIG: H Position          */\r
+#define GPDMA_C5CONFIG_H_Msk                                  (0x01UL << GPDMA_C5CONFIG_H_Pos)                          /*!< GPDMA C5CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C6SRCADDR  ----------------------------------------\r
+#define GPDMA_C6SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C6SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C6SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C6SRCADDR_SRCADDR_Pos)             /*!< GPDMA C6SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C6DESTADDR  ----------------------------------------\r
+#define GPDMA_C6DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C6DESTADDR: DESTADDR Position */\r
+#define GPDMA_C6DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C6DESTADDR_DESTADDR_Pos)           /*!< GPDMA C6DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C6LLI  ------------------------------------------\r
+#define GPDMA_C6LLI_LM_Pos                                    0                                                         /*!< GPDMA C6LLI: LM Position            */\r
+#define GPDMA_C6LLI_LM_Msk                                    (0x01UL << GPDMA_C6LLI_LM_Pos)                            /*!< GPDMA C6LLI: LM Mask                */\r
+#define GPDMA_C6LLI_R_Pos                                     1                                                         /*!< GPDMA C6LLI: R Position             */\r
+#define GPDMA_C6LLI_R_Msk                                     (0x01UL << GPDMA_C6LLI_R_Pos)                             /*!< GPDMA C6LLI: R Mask                 */\r
+#define GPDMA_C6LLI_LLI_Pos                                   2                                                         /*!< GPDMA C6LLI: LLI Position           */\r
+#define GPDMA_C6LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C6LLI_LLI_Pos)                     /*!< GPDMA C6LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C6CONTROL  ----------------------------------------\r
+#define GPDMA_C6CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C6CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C6CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C6CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C6CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C6CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C6CONTROL: SBSIZE Position    */\r
+#define GPDMA_C6CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C6CONTROL_SBSIZE_Pos)                    /*!< GPDMA C6CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C6CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C6CONTROL: DBSIZE Position    */\r
+#define GPDMA_C6CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C6CONTROL_DBSIZE_Pos)                    /*!< GPDMA C6CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C6CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C6CONTROL: SWIDTH Position    */\r
+#define GPDMA_C6CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C6CONTROL_SWIDTH_Pos)                    /*!< GPDMA C6CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C6CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C6CONTROL: DWIDTH Position    */\r
+#define GPDMA_C6CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C6CONTROL_DWIDTH_Pos)                    /*!< GPDMA C6CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C6CONTROL_S_Pos                                 24                                                        /*!< GPDMA C6CONTROL: S Position         */\r
+#define GPDMA_C6CONTROL_S_Msk                                 (0x01UL << GPDMA_C6CONTROL_S_Pos)                         /*!< GPDMA C6CONTROL: S Mask             */\r
+#define GPDMA_C6CONTROL_D_Pos                                 25                                                        /*!< GPDMA C6CONTROL: D Position         */\r
+#define GPDMA_C6CONTROL_D_Msk                                 (0x01UL << GPDMA_C6CONTROL_D_Pos)                         /*!< GPDMA C6CONTROL: D Mask             */\r
+#define GPDMA_C6CONTROL_SI_Pos                                26                                                        /*!< GPDMA C6CONTROL: SI Position        */\r
+#define GPDMA_C6CONTROL_SI_Msk                                (0x01UL << GPDMA_C6CONTROL_SI_Pos)                        /*!< GPDMA C6CONTROL: SI Mask            */\r
+#define GPDMA_C6CONTROL_DI_Pos                                27                                                        /*!< GPDMA C6CONTROL: DI Position        */\r
+#define GPDMA_C6CONTROL_DI_Msk                                (0x01UL << GPDMA_C6CONTROL_DI_Pos)                        /*!< GPDMA C6CONTROL: DI Mask            */\r
+#define GPDMA_C6CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C6CONTROL: PROT1 Position     */\r
+#define GPDMA_C6CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C6CONTROL_PROT1_Pos)                     /*!< GPDMA C6CONTROL: PROT1 Mask         */\r
+#define GPDMA_C6CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C6CONTROL: PROT2 Position     */\r
+#define GPDMA_C6CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C6CONTROL_PROT2_Pos)                     /*!< GPDMA C6CONTROL: PROT2 Mask         */\r
+#define GPDMA_C6CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C6CONTROL: PROT3 Position     */\r
+#define GPDMA_C6CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C6CONTROL_PROT3_Pos)                     /*!< GPDMA C6CONTROL: PROT3 Mask         */\r
+#define GPDMA_C6CONTROL_I_Pos                                 31                                                        /*!< GPDMA C6CONTROL: I Position         */\r
+#define GPDMA_C6CONTROL_I_Msk                                 (0x01UL << GPDMA_C6CONTROL_I_Pos)                         /*!< GPDMA C6CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C6CONFIG  -----------------------------------------\r
+#define GPDMA_C6CONFIG_E_Pos                                  0                                                         /*!< GPDMA C6CONFIG: E Position          */\r
+#define GPDMA_C6CONFIG_E_Msk                                  (0x01UL << GPDMA_C6CONFIG_E_Pos)                          /*!< GPDMA C6CONFIG: E Mask              */\r
+#define GPDMA_C6CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C6CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C6CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C6CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C6CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C6CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C6CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C6CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C6CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C6CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C6CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C6CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C6CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C6CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C6CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C6CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C6CONFIG: IE Position         */\r
+#define GPDMA_C6CONFIG_IE_Msk                                 (0x01UL << GPDMA_C6CONFIG_IE_Pos)                         /*!< GPDMA C6CONFIG: IE Mask             */\r
+#define GPDMA_C6CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C6CONFIG: ITC Position        */\r
+#define GPDMA_C6CONFIG_ITC_Msk                                (0x01UL << GPDMA_C6CONFIG_ITC_Pos)                        /*!< GPDMA C6CONFIG: ITC Mask            */\r
+#define GPDMA_C6CONFIG_L_Pos                                  16                                                        /*!< GPDMA C6CONFIG: L Position          */\r
+#define GPDMA_C6CONFIG_L_Msk                                  (0x01UL << GPDMA_C6CONFIG_L_Pos)                          /*!< GPDMA C6CONFIG: L Mask              */\r
+#define GPDMA_C6CONFIG_A_Pos                                  17                                                        /*!< GPDMA C6CONFIG: A Position          */\r
+#define GPDMA_C6CONFIG_A_Msk                                  (0x01UL << GPDMA_C6CONFIG_A_Pos)                          /*!< GPDMA C6CONFIG: A Mask              */\r
+#define GPDMA_C6CONFIG_H_Pos                                  18                                                        /*!< GPDMA C6CONFIG: H Position          */\r
+#define GPDMA_C6CONFIG_H_Msk                                  (0x01UL << GPDMA_C6CONFIG_H_Pos)                          /*!< GPDMA C6CONFIG: H Mask              */\r
+\r
+// -------------------------------------  GPDMA_C7SRCADDR  ----------------------------------------\r
+#define GPDMA_C7SRCADDR_SRCADDR_Pos                           0                                                         /*!< GPDMA C7SRCADDR: SRCADDR Position   */\r
+#define GPDMA_C7SRCADDR_SRCADDR_Msk                           (0xffffffffUL << GPDMA_C7SRCADDR_SRCADDR_Pos)             /*!< GPDMA C7SRCADDR: SRCADDR Mask       */\r
+\r
+// ------------------------------------  GPDMA_C7DESTADDR  ----------------------------------------\r
+#define GPDMA_C7DESTADDR_DESTADDR_Pos                         0                                                         /*!< GPDMA C7DESTADDR: DESTADDR Position */\r
+#define GPDMA_C7DESTADDR_DESTADDR_Msk                         (0xffffffffUL << GPDMA_C7DESTADDR_DESTADDR_Pos)           /*!< GPDMA C7DESTADDR: DESTADDR Mask     */\r
+\r
+// ---------------------------------------  GPDMA_C7LLI  ------------------------------------------\r
+#define GPDMA_C7LLI_LM_Pos                                    0                                                         /*!< GPDMA C7LLI: LM Position            */\r
+#define GPDMA_C7LLI_LM_Msk                                    (0x01UL << GPDMA_C7LLI_LM_Pos)                            /*!< GPDMA C7LLI: LM Mask                */\r
+#define GPDMA_C7LLI_R_Pos                                     1                                                         /*!< GPDMA C7LLI: R Position             */\r
+#define GPDMA_C7LLI_R_Msk                                     (0x01UL << GPDMA_C7LLI_R_Pos)                             /*!< GPDMA C7LLI: R Mask                 */\r
+#define GPDMA_C7LLI_LLI_Pos                                   2                                                         /*!< GPDMA C7LLI: LLI Position           */\r
+#define GPDMA_C7LLI_LLI_Msk                                   (0x3fffffffUL << GPDMA_C7LLI_LLI_Pos)                     /*!< GPDMA C7LLI: LLI Mask               */\r
+\r
+// -------------------------------------  GPDMA_C7CONTROL  ----------------------------------------\r
+#define GPDMA_C7CONTROL_TRANSFERSIZE_Pos                      0                                                         /*!< GPDMA C7CONTROL: TRANSFERSIZE Position */\r
+#define GPDMA_C7CONTROL_TRANSFERSIZE_Msk                      (0x00000fffUL << GPDMA_C7CONTROL_TRANSFERSIZE_Pos)        /*!< GPDMA C7CONTROL: TRANSFERSIZE Mask  */\r
+#define GPDMA_C7CONTROL_SBSIZE_Pos                            12                                                        /*!< GPDMA C7CONTROL: SBSIZE Position    */\r
+#define GPDMA_C7CONTROL_SBSIZE_Msk                            (0x07UL << GPDMA_C7CONTROL_SBSIZE_Pos)                    /*!< GPDMA C7CONTROL: SBSIZE Mask        */\r
+#define GPDMA_C7CONTROL_DBSIZE_Pos                            15                                                        /*!< GPDMA C7CONTROL: DBSIZE Position    */\r
+#define GPDMA_C7CONTROL_DBSIZE_Msk                            (0x07UL << GPDMA_C7CONTROL_DBSIZE_Pos)                    /*!< GPDMA C7CONTROL: DBSIZE Mask        */\r
+#define GPDMA_C7CONTROL_SWIDTH_Pos                            18                                                        /*!< GPDMA C7CONTROL: SWIDTH Position    */\r
+#define GPDMA_C7CONTROL_SWIDTH_Msk                            (0x07UL << GPDMA_C7CONTROL_SWIDTH_Pos)                    /*!< GPDMA C7CONTROL: SWIDTH Mask        */\r
+#define GPDMA_C7CONTROL_DWIDTH_Pos                            21                                                        /*!< GPDMA C7CONTROL: DWIDTH Position    */\r
+#define GPDMA_C7CONTROL_DWIDTH_Msk                            (0x07UL << GPDMA_C7CONTROL_DWIDTH_Pos)                    /*!< GPDMA C7CONTROL: DWIDTH Mask        */\r
+#define GPDMA_C7CONTROL_S_Pos                                 24                                                        /*!< GPDMA C7CONTROL: S Position         */\r
+#define GPDMA_C7CONTROL_S_Msk                                 (0x01UL << GPDMA_C7CONTROL_S_Pos)                         /*!< GPDMA C7CONTROL: S Mask             */\r
+#define GPDMA_C7CONTROL_D_Pos                                 25                                                        /*!< GPDMA C7CONTROL: D Position         */\r
+#define GPDMA_C7CONTROL_D_Msk                                 (0x01UL << GPDMA_C7CONTROL_D_Pos)                         /*!< GPDMA C7CONTROL: D Mask             */\r
+#define GPDMA_C7CONTROL_SI_Pos                                26                                                        /*!< GPDMA C7CONTROL: SI Position        */\r
+#define GPDMA_C7CONTROL_SI_Msk                                (0x01UL << GPDMA_C7CONTROL_SI_Pos)                        /*!< GPDMA C7CONTROL: SI Mask            */\r
+#define GPDMA_C7CONTROL_DI_Pos                                27                                                        /*!< GPDMA C7CONTROL: DI Position        */\r
+#define GPDMA_C7CONTROL_DI_Msk                                (0x01UL << GPDMA_C7CONTROL_DI_Pos)                        /*!< GPDMA C7CONTROL: DI Mask            */\r
+#define GPDMA_C7CONTROL_PROT1_Pos                             28                                                        /*!< GPDMA C7CONTROL: PROT1 Position     */\r
+#define GPDMA_C7CONTROL_PROT1_Msk                             (0x01UL << GPDMA_C7CONTROL_PROT1_Pos)                     /*!< GPDMA C7CONTROL: PROT1 Mask         */\r
+#define GPDMA_C7CONTROL_PROT2_Pos                             29                                                        /*!< GPDMA C7CONTROL: PROT2 Position     */\r
+#define GPDMA_C7CONTROL_PROT2_Msk                             (0x01UL << GPDMA_C7CONTROL_PROT2_Pos)                     /*!< GPDMA C7CONTROL: PROT2 Mask         */\r
+#define GPDMA_C7CONTROL_PROT3_Pos                             30                                                        /*!< GPDMA C7CONTROL: PROT3 Position     */\r
+#define GPDMA_C7CONTROL_PROT3_Msk                             (0x01UL << GPDMA_C7CONTROL_PROT3_Pos)                     /*!< GPDMA C7CONTROL: PROT3 Mask         */\r
+#define GPDMA_C7CONTROL_I_Pos                                 31                                                        /*!< GPDMA C7CONTROL: I Position         */\r
+#define GPDMA_C7CONTROL_I_Msk                                 (0x01UL << GPDMA_C7CONTROL_I_Pos)                         /*!< GPDMA C7CONTROL: I Mask             */\r
+\r
+// -------------------------------------  GPDMA_C7CONFIG  -----------------------------------------\r
+#define GPDMA_C7CONFIG_E_Pos                                  0                                                         /*!< GPDMA C7CONFIG: E Position          */\r
+#define GPDMA_C7CONFIG_E_Msk                                  (0x01UL << GPDMA_C7CONFIG_E_Pos)                          /*!< GPDMA C7CONFIG: E Mask              */\r
+#define GPDMA_C7CONFIG_SRCPERIPHERAL_Pos                      1                                                         /*!< GPDMA C7CONFIG: SRCPERIPHERAL Position */\r
+#define GPDMA_C7CONFIG_SRCPERIPHERAL_Msk                      (0x1fUL << GPDMA_C7CONFIG_SRCPERIPHERAL_Pos)              /*!< GPDMA C7CONFIG: SRCPERIPHERAL Mask  */\r
+#define GPDMA_C7CONFIG_DESTPERIPHERAL_Pos                     6                                                         /*!< GPDMA C7CONFIG: DESTPERIPHERAL Position */\r
+#define GPDMA_C7CONFIG_DESTPERIPHERAL_Msk                     (0x1fUL << GPDMA_C7CONFIG_DESTPERIPHERAL_Pos)             /*!< GPDMA C7CONFIG: DESTPERIPHERAL Mask */\r
+#define GPDMA_C7CONFIG_FLOWCNTRL_Pos                          11                                                        /*!< GPDMA C7CONFIG: FLOWCNTRL Position  */\r
+#define GPDMA_C7CONFIG_FLOWCNTRL_Msk                          (0x07UL << GPDMA_C7CONFIG_FLOWCNTRL_Pos)                  /*!< GPDMA C7CONFIG: FLOWCNTRL Mask      */\r
+#define GPDMA_C7CONFIG_IE_Pos                                 14                                                        /*!< GPDMA C7CONFIG: IE Position         */\r
+#define GPDMA_C7CONFIG_IE_Msk                                 (0x01UL << GPDMA_C7CONFIG_IE_Pos)                         /*!< GPDMA C7CONFIG: IE Mask             */\r
+#define GPDMA_C7CONFIG_ITC_Pos                                15                                                        /*!< GPDMA C7CONFIG: ITC Position        */\r
+#define GPDMA_C7CONFIG_ITC_Msk                                (0x01UL << GPDMA_C7CONFIG_ITC_Pos)                        /*!< GPDMA C7CONFIG: ITC Mask            */\r
+#define GPDMA_C7CONFIG_L_Pos                                  16                                                        /*!< GPDMA C7CONFIG: L Position          */\r
+#define GPDMA_C7CONFIG_L_Msk                                  (0x01UL << GPDMA_C7CONFIG_L_Pos)                          /*!< GPDMA C7CONFIG: L Mask              */\r
+#define GPDMA_C7CONFIG_A_Pos                                  17                                                        /*!< GPDMA C7CONFIG: A Position          */\r
+#define GPDMA_C7CONFIG_A_Msk                                  (0x01UL << GPDMA_C7CONFIG_A_Pos)                          /*!< GPDMA C7CONFIG: A Mask              */\r
+#define GPDMA_C7CONFIG_H_Pos                                  18                                                        /*!< GPDMA C7CONFIG: H Position          */\r
+#define GPDMA_C7CONFIG_H_Msk                                  (0x01UL << GPDMA_C7CONFIG_H_Pos)                          /*!< GPDMA C7CONFIG: H Mask              */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 SDMMC Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  SDMMC_CTRL  -------------------------------------------\r
+#define SDMMC_CTRL_CONTROLLER_RESET_Pos                       0                                                         /*!< SDMMC CTRL: CONTROLLER_RESET Position */\r
+#define SDMMC_CTRL_CONTROLLER_RESET_Msk                       (0x01UL << SDMMC_CTRL_CONTROLLER_RESET_Pos)               /*!< SDMMC CTRL: CONTROLLER_RESET Mask   */\r
+#define SDMMC_CTRL_FIFO_RESET_Pos                             1                                                         /*!< SDMMC CTRL: FIFO_RESET Position     */\r
+#define SDMMC_CTRL_FIFO_RESET_Msk                             (0x01UL << SDMMC_CTRL_FIFO_RESET_Pos)                     /*!< SDMMC CTRL: FIFO_RESET Mask         */\r
+#define SDMMC_CTRL_DMA_RESET_Pos                              2                                                         /*!< SDMMC CTRL: DMA_RESET Position      */\r
+#define SDMMC_CTRL_DMA_RESET_Msk                              (0x01UL << SDMMC_CTRL_DMA_RESET_Pos)                      /*!< SDMMC CTRL: DMA_RESET Mask          */\r
+#define SDMMC_CTRL_INT_ENABLE_Pos                             4                                                         /*!< SDMMC CTRL: INT_ENABLE Position     */\r
+#define SDMMC_CTRL_INT_ENABLE_Msk                             (0x01UL << SDMMC_CTRL_INT_ENABLE_Pos)                     /*!< SDMMC CTRL: INT_ENABLE Mask         */\r
+#define SDMMC_CTRL_DMA_ENABLE_Pos                             5                                                         /*!< SDMMC CTRL: DMA_ENABLE Position     */\r
+#define SDMMC_CTRL_DMA_ENABLE_Msk                             (0x01UL << SDMMC_CTRL_DMA_ENABLE_Pos)                     /*!< SDMMC CTRL: DMA_ENABLE Mask         */\r
+#define SDMMC_CTRL_READ_WAIT_Pos                              6                                                         /*!< SDMMC CTRL: READ_WAIT Position      */\r
+#define SDMMC_CTRL_READ_WAIT_Msk                              (0x01UL << SDMMC_CTRL_READ_WAIT_Pos)                      /*!< SDMMC CTRL: READ_WAIT Mask          */\r
+#define SDMMC_CTRL_SEND_IRQ_RESPONSE_Pos                      7                                                         /*!< SDMMC CTRL: SEND_IRQ_RESPONSE Position */\r
+#define SDMMC_CTRL_SEND_IRQ_RESPONSE_Msk                      (0x01UL << SDMMC_CTRL_SEND_IRQ_RESPONSE_Pos)              /*!< SDMMC CTRL: SEND_IRQ_RESPONSE Mask  */\r
+#define SDMMC_CTRL_ABORT_READ_DATA_Pos                        8                                                         /*!< SDMMC CTRL: ABORT_READ_DATA Position */\r
+#define SDMMC_CTRL_ABORT_READ_DATA_Msk                        (0x01UL << SDMMC_CTRL_ABORT_READ_DATA_Pos)                /*!< SDMMC CTRL: ABORT_READ_DATA Mask    */\r
+#define SDMMC_CTRL_SEND_CCSD_Pos                              9                                                         /*!< SDMMC CTRL: SEND_CCSD Position      */\r
+#define SDMMC_CTRL_SEND_CCSD_Msk                              (0x01UL << SDMMC_CTRL_SEND_CCSD_Pos)                      /*!< SDMMC CTRL: SEND_CCSD Mask          */\r
+#define SDMMC_CTRL_SEND_AUTO_STOP_CCSD_Pos                    10                                                        /*!< SDMMC CTRL: SEND_AUTO_STOP_CCSD Position */\r
+#define SDMMC_CTRL_SEND_AUTO_STOP_CCSD_Msk                    (0x01UL << SDMMC_CTRL_SEND_AUTO_STOP_CCSD_Pos)            /*!< SDMMC CTRL: SEND_AUTO_STOP_CCSD Mask */\r
+#define SDMMC_CTRL_CEATA_DEVICE_INTERRUPT_STATUS_Pos          11                                                        /*!< SDMMC CTRL: CEATA_DEVICE_INTERRUPT_STATUS Position */\r
+#define SDMMC_CTRL_CEATA_DEVICE_INTERRUPT_STATUS_Msk          (0x01UL << SDMMC_CTRL_CEATA_DEVICE_INTERRUPT_STATUS_Pos)  /*!< SDMMC CTRL: CEATA_DEVICE_INTERRUPT_STATUS Mask */\r
+#define SDMMC_CTRL_CARD_VOLTAGE_A_Pos                         16                                                        /*!< SDMMC CTRL: CARD_VOLTAGE_A Position */\r
+#define SDMMC_CTRL_CARD_VOLTAGE_A_Msk                         (0x0fUL << SDMMC_CTRL_CARD_VOLTAGE_A_Pos)                 /*!< SDMMC CTRL: CARD_VOLTAGE_A Mask     */\r
+#define SDMMC_CTRL_CARD_VOLTAGE_B_Pos                         20                                                        /*!< SDMMC CTRL: CARD_VOLTAGE_B Position */\r
+#define SDMMC_CTRL_CARD_VOLTAGE_B_Msk                         (0x0fUL << SDMMC_CTRL_CARD_VOLTAGE_B_Pos)                 /*!< SDMMC CTRL: CARD_VOLTAGE_B Mask     */\r
+#define SDMMC_CTRL_ENABLE_OD_PULLUP_Pos                       24                                                        /*!< SDMMC CTRL: ENABLE_OD_PULLUP Position */\r
+#define SDMMC_CTRL_ENABLE_OD_PULLUP_Msk                       (0x01UL << SDMMC_CTRL_ENABLE_OD_PULLUP_Pos)               /*!< SDMMC CTRL: ENABLE_OD_PULLUP Mask   */\r
+#define SDMMC_CTRL_USE_INTERNAL_DMAC_Pos                      25                                                        /*!< SDMMC CTRL: USE_INTERNAL_DMAC Position */\r
+#define SDMMC_CTRL_USE_INTERNAL_DMAC_Msk                      (0x01UL << SDMMC_CTRL_USE_INTERNAL_DMAC_Pos)              /*!< SDMMC CTRL: USE_INTERNAL_DMAC Mask  */\r
+\r
+// ---------------------------------------  SDMMC_PWREN  ------------------------------------------\r
+#define SDMMC_PWREN_POWER_ENABLE_Pos                          0                                                         /*!< SDMMC PWREN: POWER_ENABLE Position  */\r
+#define SDMMC_PWREN_POWER_ENABLE_Msk                          (0x3fffffffUL << SDMMC_PWREN_POWER_ENABLE_Pos)            /*!< SDMMC PWREN: POWER_ENABLE Mask      */\r
+\r
+// --------------------------------------  SDMMC_CLKDIV  ------------------------------------------\r
+#define SDMMC_CLKDIV_CLK_DIVIDER0_Pos                         0                                                         /*!< SDMMC CLKDIV: CLK_DIVIDER0 Position */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER0_Msk                         (0x000000ffUL << SDMMC_CLKDIV_CLK_DIVIDER0_Pos)           /*!< SDMMC CLKDIV: CLK_DIVIDER0 Mask     */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER1_Pos                         8                                                         /*!< SDMMC CLKDIV: CLK_DIVIDER1 Position */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER1_Msk                         (0x000000ffUL << SDMMC_CLKDIV_CLK_DIVIDER1_Pos)           /*!< SDMMC CLKDIV: CLK_DIVIDER1 Mask     */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER2_Pos                         16                                                        /*!< SDMMC CLKDIV: CLK_DIVIDER2 Position */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER2_Msk                         (0x000000ffUL << SDMMC_CLKDIV_CLK_DIVIDER2_Pos)           /*!< SDMMC CLKDIV: CLK_DIVIDER2 Mask     */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER3_Pos                         24                                                        /*!< SDMMC CLKDIV: CLK_DIVIDER3 Position */\r
+#define SDMMC_CLKDIV_CLK_DIVIDER3_Msk                         (0x000000ffUL << SDMMC_CLKDIV_CLK_DIVIDER3_Pos)           /*!< SDMMC CLKDIV: CLK_DIVIDER3 Mask     */\r
+\r
+// --------------------------------------  SDMMC_CLKSRC  ------------------------------------------\r
+#define SDMMC_CLKSRC_CLK_SOURCE_Pos                           0                                                         /*!< SDMMC CLKSRC: CLK_SOURCE Position   */\r
+#define SDMMC_CLKSRC_CLK_SOURCE_Msk                           (0xffffffffUL << SDMMC_CLKSRC_CLK_SOURCE_Pos)             /*!< SDMMC CLKSRC: CLK_SOURCE Mask       */\r
+\r
+// --------------------------------------  SDMMC_CLKENA  ------------------------------------------\r
+#define SDMMC_CLKENA_CCLK_ENABLE_Pos                          0                                                         /*!< SDMMC CLKENA: CCLK_ENABLE Position  */\r
+#define SDMMC_CLKENA_CCLK_ENABLE_Msk                          (0x0000ffffUL << SDMMC_CLKENA_CCLK_ENABLE_Pos)            /*!< SDMMC CLKENA: CCLK_ENABLE Mask      */\r
+#define SDMMC_CLKENA_CCLK_LOW_POWER_Pos                       16                                                        /*!< SDMMC CLKENA: CCLK_LOW_POWER Position */\r
+#define SDMMC_CLKENA_CCLK_LOW_POWER_Msk                       (0x0000ffffUL << SDMMC_CLKENA_CCLK_LOW_POWER_Pos)         /*!< SDMMC CLKENA: CCLK_LOW_POWER Mask   */\r
+\r
+// ---------------------------------------  SDMMC_TMOUT  ------------------------------------------\r
+#define SDMMC_TMOUT_RESPONSE_TIMEOUT_Pos                      0                                                         /*!< SDMMC TMOUT: RESPONSE_TIMEOUT Position */\r
+#define SDMMC_TMOUT_RESPONSE_TIMEOUT_Msk                      (0x000000ffUL << SDMMC_TMOUT_RESPONSE_TIMEOUT_Pos)        /*!< SDMMC TMOUT: RESPONSE_TIMEOUT Mask  */\r
+#define SDMMC_TMOUT_DATA_TIMEOUT_Pos                          8                                                         /*!< SDMMC TMOUT: DATA_TIMEOUT Position  */\r
+#define SDMMC_TMOUT_DATA_TIMEOUT_Msk                          (0x00ffffffUL << SDMMC_TMOUT_DATA_TIMEOUT_Pos)            /*!< SDMMC TMOUT: DATA_TIMEOUT Mask      */\r
+\r
+// ---------------------------------------  SDMMC_CTYPE  ------------------------------------------\r
+#define SDMMC_CTYPE_CARD_WIDTH0_Pos                           0                                                         /*!< SDMMC CTYPE: CARD_WIDTH0 Position   */\r
+#define SDMMC_CTYPE_CARD_WIDTH0_Msk                           (0x0000ffffUL << SDMMC_CTYPE_CARD_WIDTH0_Pos)             /*!< SDMMC CTYPE: CARD_WIDTH0 Mask       */\r
+#define SDMMC_CTYPE_CARD_WIDTH1_Pos                           16                                                        /*!< SDMMC CTYPE: CARD_WIDTH1 Position   */\r
+#define SDMMC_CTYPE_CARD_WIDTH1_Msk                           (0x0000ffffUL << SDMMC_CTYPE_CARD_WIDTH1_Pos)             /*!< SDMMC CTYPE: CARD_WIDTH1 Mask       */\r
+\r
+// --------------------------------------  SDMMC_BLKSIZ  ------------------------------------------\r
+#define SDMMC_BLKSIZ_BLOCK_SIZE_Pos                           0                                                         /*!< SDMMC BLKSIZ: BLOCK_SIZE Position   */\r
+#define SDMMC_BLKSIZ_BLOCK_SIZE_Msk                           (0x0000ffffUL << SDMMC_BLKSIZ_BLOCK_SIZE_Pos)             /*!< SDMMC BLKSIZ: BLOCK_SIZE Mask       */\r
+\r
+// --------------------------------------  SDMMC_BYTCNT  ------------------------------------------\r
+#define SDMMC_BYTCNT_BYTE_COUNT_Pos                           0                                                         /*!< SDMMC BYTCNT: BYTE_COUNT Position   */\r
+#define SDMMC_BYTCNT_BYTE_COUNT_Msk                           (0xffffffffUL << SDMMC_BYTCNT_BYTE_COUNT_Pos)             /*!< SDMMC BYTCNT: BYTE_COUNT Mask       */\r
+\r
+// --------------------------------------  SDMMC_INTMASK  -----------------------------------------\r
+#define SDMMC_INTMASK_CDET_Pos                                0                                                         /*!< SDMMC INTMASK: CDET Position        */\r
+#define SDMMC_INTMASK_CDET_Msk                                (0x01UL << SDMMC_INTMASK_CDET_Pos)                        /*!< SDMMC INTMASK: CDET Mask            */\r
+#define SDMMC_INTMASK_RE_Pos                                  1                                                         /*!< SDMMC INTMASK: RE Position          */\r
+#define SDMMC_INTMASK_RE_Msk                                  (0x01UL << SDMMC_INTMASK_RE_Pos)                          /*!< SDMMC INTMASK: RE Mask              */\r
+#define SDMMC_INTMASK_CDONE_Pos                               2                                                         /*!< SDMMC INTMASK: CDONE Position       */\r
+#define SDMMC_INTMASK_CDONE_Msk                               (0x01UL << SDMMC_INTMASK_CDONE_Pos)                       /*!< SDMMC INTMASK: CDONE Mask           */\r
+#define SDMMC_INTMASK_DTO_Pos                                 3                                                         /*!< SDMMC INTMASK: DTO Position         */\r
+#define SDMMC_INTMASK_DTO_Msk                                 (0x01UL << SDMMC_INTMASK_DTO_Pos)                         /*!< SDMMC INTMASK: DTO Mask             */\r
+#define SDMMC_INTMASK_TXDR_Pos                                4                                                         /*!< SDMMC INTMASK: TXDR Position        */\r
+#define SDMMC_INTMASK_TXDR_Msk                                (0x01UL << SDMMC_INTMASK_TXDR_Pos)                        /*!< SDMMC INTMASK: TXDR Mask            */\r
+#define SDMMC_INTMASK_RXDR_Pos                                5                                                         /*!< SDMMC INTMASK: RXDR Position        */\r
+#define SDMMC_INTMASK_RXDR_Msk                                (0x01UL << SDMMC_INTMASK_RXDR_Pos)                        /*!< SDMMC INTMASK: RXDR Mask            */\r
+#define SDMMC_INTMASK_RCRC_Pos                                6                                                         /*!< SDMMC INTMASK: RCRC Position        */\r
+#define SDMMC_INTMASK_RCRC_Msk                                (0x01UL << SDMMC_INTMASK_RCRC_Pos)                        /*!< SDMMC INTMASK: RCRC Mask            */\r
+#define SDMMC_INTMASK_DCRC_Pos                                7                                                         /*!< SDMMC INTMASK: DCRC Position        */\r
+#define SDMMC_INTMASK_DCRC_Msk                                (0x01UL << SDMMC_INTMASK_DCRC_Pos)                        /*!< SDMMC INTMASK: DCRC Mask            */\r
+#define SDMMC_INTMASK_RTO_Pos                                 8                                                         /*!< SDMMC INTMASK: RTO Position         */\r
+#define SDMMC_INTMASK_RTO_Msk                                 (0x01UL << SDMMC_INTMASK_RTO_Pos)                         /*!< SDMMC INTMASK: RTO Mask             */\r
+#define SDMMC_INTMASK_DRTO_Pos                                9                                                         /*!< SDMMC INTMASK: DRTO Position        */\r
+#define SDMMC_INTMASK_DRTO_Msk                                (0x01UL << SDMMC_INTMASK_DRTO_Pos)                        /*!< SDMMC INTMASK: DRTO Mask            */\r
+#define SDMMC_INTMASK_HTO_Pos                                 10                                                        /*!< SDMMC INTMASK: HTO Position         */\r
+#define SDMMC_INTMASK_HTO_Msk                                 (0x01UL << SDMMC_INTMASK_HTO_Pos)                         /*!< SDMMC INTMASK: HTO Mask             */\r
+#define SDMMC_INTMASK_FRUN_Pos                                11                                                        /*!< SDMMC INTMASK: FRUN Position        */\r
+#define SDMMC_INTMASK_FRUN_Msk                                (0x01UL << SDMMC_INTMASK_FRUN_Pos)                        /*!< SDMMC INTMASK: FRUN Mask            */\r
+#define SDMMC_INTMASK_HLE_Pos                                 12                                                        /*!< SDMMC INTMASK: HLE Position         */\r
+#define SDMMC_INTMASK_HLE_Msk                                 (0x01UL << SDMMC_INTMASK_HLE_Pos)                         /*!< SDMMC INTMASK: HLE Mask             */\r
+#define SDMMC_INTMASK_SBE_Pos                                 13                                                        /*!< SDMMC INTMASK: SBE Position         */\r
+#define SDMMC_INTMASK_SBE_Msk                                 (0x01UL << SDMMC_INTMASK_SBE_Pos)                         /*!< SDMMC INTMASK: SBE Mask             */\r
+#define SDMMC_INTMASK_ACD_Pos                                 14                                                        /*!< SDMMC INTMASK: ACD Position         */\r
+#define SDMMC_INTMASK_ACD_Msk                                 (0x01UL << SDMMC_INTMASK_ACD_Pos)                         /*!< SDMMC INTMASK: ACD Mask             */\r
+#define SDMMC_INTMASK_EBE_Pos                                 15                                                        /*!< SDMMC INTMASK: EBE Position         */\r
+#define SDMMC_INTMASK_EBE_Msk                                 (0x01UL << SDMMC_INTMASK_EBE_Pos)                         /*!< SDMMC INTMASK: EBE Mask             */\r
+#define SDMMC_INTMASK_SDIO_INT_MASK_Pos                       16                                                        /*!< SDMMC INTMASK: SDIO_INT_MASK Position */\r
+#define SDMMC_INTMASK_SDIO_INT_MASK_Msk                       (0x0000ffffUL << SDMMC_INTMASK_SDIO_INT_MASK_Pos)         /*!< SDMMC INTMASK: SDIO_INT_MASK Mask   */\r
+\r
+// --------------------------------------  SDMMC_CMDARG  ------------------------------------------\r
+#define SDMMC_CMDARG_CMD_ARG_Pos                              0                                                         /*!< SDMMC CMDARG: CMD_ARG Position      */\r
+#define SDMMC_CMDARG_CMD_ARG_Msk                              (0xffffffffUL << SDMMC_CMDARG_CMD_ARG_Pos)                /*!< SDMMC CMDARG: CMD_ARG Mask          */\r
+\r
+// ----------------------------------------  SDMMC_CMD  -------------------------------------------\r
+#define SDMMC_CMD_CMD_INDEX_Pos                               0                                                         /*!< SDMMC CMD: CMD_INDEX Position       */\r
+#define SDMMC_CMD_CMD_INDEX_Msk                               (0x3fUL << SDMMC_CMD_CMD_INDEX_Pos)                       /*!< SDMMC CMD: CMD_INDEX Mask           */\r
+#define SDMMC_CMD_RESPONSE_EXPECT_Pos                         6                                                         /*!< SDMMC CMD: RESPONSE_EXPECT Position */\r
+#define SDMMC_CMD_RESPONSE_EXPECT_Msk                         (0x01UL << SDMMC_CMD_RESPONSE_EXPECT_Pos)                 /*!< SDMMC CMD: RESPONSE_EXPECT Mask     */\r
+#define SDMMC_CMD_RESPONSE_LENGTH_Pos                         7                                                         /*!< SDMMC CMD: RESPONSE_LENGTH Position */\r
+#define SDMMC_CMD_RESPONSE_LENGTH_Msk                         (0x01UL << SDMMC_CMD_RESPONSE_LENGTH_Pos)                 /*!< SDMMC CMD: RESPONSE_LENGTH Mask     */\r
+#define SDMMC_CMD_CHECK_RESPONSE_CRC_Pos                      8                                                         /*!< SDMMC CMD: CHECK_RESPONSE_CRC Position */\r
+#define SDMMC_CMD_CHECK_RESPONSE_CRC_Msk                      (0x01UL << SDMMC_CMD_CHECK_RESPONSE_CRC_Pos)              /*!< SDMMC CMD: CHECK_RESPONSE_CRC Mask  */\r
+#define SDMMC_CMD_DATA_EXPECTED_Pos                           9                                                         /*!< SDMMC CMD: DATA_EXPECTED Position   */\r
+#define SDMMC_CMD_DATA_EXPECTED_Msk                           (0x01UL << SDMMC_CMD_DATA_EXPECTED_Pos)                   /*!< SDMMC CMD: DATA_EXPECTED Mask       */\r
+#define SDMMC_CMD_READ_WRITE_Pos                              10                                                        /*!< SDMMC CMD: READ_WRITE Position      */\r
+#define SDMMC_CMD_READ_WRITE_Msk                              (0x01UL << SDMMC_CMD_READ_WRITE_Pos)                      /*!< SDMMC CMD: READ_WRITE Mask          */\r
+#define SDMMC_CMD_TRANSFER_MODE_Pos                           11                                                        /*!< SDMMC CMD: TRANSFER_MODE Position   */\r
+#define SDMMC_CMD_TRANSFER_MODE_Msk                           (0x01UL << SDMMC_CMD_TRANSFER_MODE_Pos)                   /*!< SDMMC CMD: TRANSFER_MODE Mask       */\r
+#define SDMMC_CMD_SEND_AUTO_STOP_Pos                          12                                                        /*!< SDMMC CMD: SEND_AUTO_STOP Position  */\r
+#define SDMMC_CMD_SEND_AUTO_STOP_Msk                          (0x01UL << SDMMC_CMD_SEND_AUTO_STOP_Pos)                  /*!< SDMMC CMD: SEND_AUTO_STOP Mask      */\r
+#define SDMMC_CMD_WAIT_PRVDATA_COMPLETE_Pos                   13                                                        /*!< SDMMC CMD: WAIT_PRVDATA_COMPLETE Position */\r
+#define SDMMC_CMD_WAIT_PRVDATA_COMPLETE_Msk                   (0x01UL << SDMMC_CMD_WAIT_PRVDATA_COMPLETE_Pos)           /*!< SDMMC CMD: WAIT_PRVDATA_COMPLETE Mask */\r
+#define SDMMC_CMD_STOP_ABORT_CMd_Pos                          14                                                        /*!< SDMMC CMD: STOP_ABORT_CMd Position  */\r
+#define SDMMC_CMD_STOP_ABORT_CMd_Msk                          (0x01UL << SDMMC_CMD_STOP_ABORT_CMd_Pos)                  /*!< SDMMC CMD: STOP_ABORT_CMd Mask      */\r
+#define SDMMC_CMD_SEND_INITIALIZATION_Pos                     15                                                        /*!< SDMMC CMD: SEND_INITIALIZATION Position */\r
+#define SDMMC_CMD_SEND_INITIALIZATION_Msk                     (0x01UL << SDMMC_CMD_SEND_INITIALIZATION_Pos)             /*!< SDMMC CMD: SEND_INITIALIZATION Mask */\r
+#define SDMMC_CMD_CARD_NUMBER_Pos                             16                                                        /*!< SDMMC CMD: CARD_NUMBER Position     */\r
+#define SDMMC_CMD_CARD_NUMBER_Msk                             (0x1fUL << SDMMC_CMD_CARD_NUMBER_Pos)                     /*!< SDMMC CMD: CARD_NUMBER Mask         */\r
+#define SDMMC_CMD_UPDATE_CLOCK_REGISTERS_ONLY_Pos             21                                                        /*!< SDMMC CMD: UPDATE_CLOCK_REGISTERS_ONLY Position */\r
+#define SDMMC_CMD_UPDATE_CLOCK_REGISTERS_ONLY_Msk             (0x01UL << SDMMC_CMD_UPDATE_CLOCK_REGISTERS_ONLY_Pos)     /*!< SDMMC CMD: UPDATE_CLOCK_REGISTERS_ONLY Mask */\r
+#define SDMMC_CMD_READ_CEATA_DEVICE_Pos                       22                                                        /*!< SDMMC CMD: READ_CEATA_DEVICE Position */\r
+#define SDMMC_CMD_READ_CEATA_DEVICE_Msk                       (0x01UL << SDMMC_CMD_READ_CEATA_DEVICE_Pos)               /*!< SDMMC CMD: READ_CEATA_DEVICE Mask   */\r
+#define SDMMC_CMD_CCS_EXPECTED_Pos                            23                                                        /*!< SDMMC CMD: CCS_EXPECTED Position    */\r
+#define SDMMC_CMD_CCS_EXPECTED_Msk                            (0x01UL << SDMMC_CMD_CCS_EXPECTED_Pos)                    /*!< SDMMC CMD: CCS_EXPECTED Mask        */\r
+#define SDMMC_CMD_ENABLE_BOOT_Pos                             24                                                        /*!< SDMMC CMD: ENABLE_BOOT Position     */\r
+#define SDMMC_CMD_ENABLE_BOOT_Msk                             (0x01UL << SDMMC_CMD_ENABLE_BOOT_Pos)                     /*!< SDMMC CMD: ENABLE_BOOT Mask         */\r
+#define SDMMC_CMD_EXPECT_BOOT_ACK_Pos                         25                                                        /*!< SDMMC CMD: EXPECT_BOOT_ACK Position */\r
+#define SDMMC_CMD_EXPECT_BOOT_ACK_Msk                         (0x01UL << SDMMC_CMD_EXPECT_BOOT_ACK_Pos)                 /*!< SDMMC CMD: EXPECT_BOOT_ACK Mask     */\r
+#define SDMMC_CMD_DISABLE_BOOT_Pos                            26                                                        /*!< SDMMC CMD: DISABLE_BOOT Position    */\r
+#define SDMMC_CMD_DISABLE_BOOT_Msk                            (0x01UL << SDMMC_CMD_DISABLE_BOOT_Pos)                    /*!< SDMMC CMD: DISABLE_BOOT Mask        */\r
+#define SDMMC_CMD_BOOT_MODE_Pos                               27                                                        /*!< SDMMC CMD: BOOT_MODE Position       */\r
+#define SDMMC_CMD_BOOT_MODE_Msk                               (0x01UL << SDMMC_CMD_BOOT_MODE_Pos)                       /*!< SDMMC CMD: BOOT_MODE Mask           */\r
+#define SDMMC_CMD_VOLT_SWITCH_Pos                             28                                                        /*!< SDMMC CMD: VOLT_SWITCH Position     */\r
+#define SDMMC_CMD_VOLT_SWITCH_Msk                             (0x01UL << SDMMC_CMD_VOLT_SWITCH_Pos)                     /*!< SDMMC CMD: VOLT_SWITCH Mask         */\r
+#define SDMMC_CMD_START_CMD_Pos                               31                                                        /*!< SDMMC CMD: START_CMD Position       */\r
+#define SDMMC_CMD_START_CMD_Msk                               (0x01UL << SDMMC_CMD_START_CMD_Pos)                       /*!< SDMMC CMD: START_CMD Mask           */\r
+\r
+// ---------------------------------------  SDMMC_RESP0  ------------------------------------------\r
+#define SDMMC_RESP0_RESPONSE0_Pos                             0                                                         /*!< SDMMC RESP0: RESPONSE0 Position     */\r
+#define SDMMC_RESP0_RESPONSE0_Msk                             (0xffffffffUL << SDMMC_RESP0_RESPONSE0_Pos)               /*!< SDMMC RESP0: RESPONSE0 Mask         */\r
+\r
+// ---------------------------------------  SDMMC_RESP1  ------------------------------------------\r
+#define SDMMC_RESP1_RESPONSE1_Pos                             0                                                         /*!< SDMMC RESP1: RESPONSE1 Position     */\r
+#define SDMMC_RESP1_RESPONSE1_Msk                             (0xffffffffUL << SDMMC_RESP1_RESPONSE1_Pos)               /*!< SDMMC RESP1: RESPONSE1 Mask         */\r
+\r
+// ---------------------------------------  SDMMC_RESP2  ------------------------------------------\r
+#define SDMMC_RESP2_RESPONSE2_Pos                             0                                                         /*!< SDMMC RESP2: RESPONSE2 Position     */\r
+#define SDMMC_RESP2_RESPONSE2_Msk                             (0xffffffffUL << SDMMC_RESP2_RESPONSE2_Pos)               /*!< SDMMC RESP2: RESPONSE2 Mask         */\r
+\r
+// ---------------------------------------  SDMMC_RESP3  ------------------------------------------\r
+#define SDMMC_RESP3_RESPONSE3_Pos                             0                                                         /*!< SDMMC RESP3: RESPONSE3 Position     */\r
+#define SDMMC_RESP3_RESPONSE3_Msk                             (0xffffffffUL << SDMMC_RESP3_RESPONSE3_Pos)               /*!< SDMMC RESP3: RESPONSE3 Mask         */\r
+\r
+// --------------------------------------  SDMMC_MINTSTS  -----------------------------------------\r
+#define SDMMC_MINTSTS_CDET_Pos                                0                                                         /*!< SDMMC MINTSTS: CDET Position        */\r
+#define SDMMC_MINTSTS_CDET_Msk                                (0x01UL << SDMMC_MINTSTS_CDET_Pos)                        /*!< SDMMC MINTSTS: CDET Mask            */\r
+#define SDMMC_MINTSTS_RE_Pos                                  1                                                         /*!< SDMMC MINTSTS: RE Position          */\r
+#define SDMMC_MINTSTS_RE_Msk                                  (0x01UL << SDMMC_MINTSTS_RE_Pos)                          /*!< SDMMC MINTSTS: RE Mask              */\r
+#define SDMMC_MINTSTS_CDONE_Pos                               2                                                         /*!< SDMMC MINTSTS: CDONE Position       */\r
+#define SDMMC_MINTSTS_CDONE_Msk                               (0x01UL << SDMMC_MINTSTS_CDONE_Pos)                       /*!< SDMMC MINTSTS: CDONE Mask           */\r
+#define SDMMC_MINTSTS_DTO_Pos                                 3                                                         /*!< SDMMC MINTSTS: DTO Position         */\r
+#define SDMMC_MINTSTS_DTO_Msk                                 (0x01UL << SDMMC_MINTSTS_DTO_Pos)                         /*!< SDMMC MINTSTS: DTO Mask             */\r
+#define SDMMC_MINTSTS_TXDR_Pos                                4                                                         /*!< SDMMC MINTSTS: TXDR Position        */\r
+#define SDMMC_MINTSTS_TXDR_Msk                                (0x01UL << SDMMC_MINTSTS_TXDR_Pos)                        /*!< SDMMC MINTSTS: TXDR Mask            */\r
+#define SDMMC_MINTSTS_RXDR_Pos                                5                                                         /*!< SDMMC MINTSTS: RXDR Position        */\r
+#define SDMMC_MINTSTS_RXDR_Msk                                (0x01UL << SDMMC_MINTSTS_RXDR_Pos)                        /*!< SDMMC MINTSTS: RXDR Mask            */\r
+#define SDMMC_MINTSTS_RCRC_Pos                                6                                                         /*!< SDMMC MINTSTS: RCRC Position        */\r
+#define SDMMC_MINTSTS_RCRC_Msk                                (0x01UL << SDMMC_MINTSTS_RCRC_Pos)                        /*!< SDMMC MINTSTS: RCRC Mask            */\r
+#define SDMMC_MINTSTS_DCRC_Pos                                7                                                         /*!< SDMMC MINTSTS: DCRC Position        */\r
+#define SDMMC_MINTSTS_DCRC_Msk                                (0x01UL << SDMMC_MINTSTS_DCRC_Pos)                        /*!< SDMMC MINTSTS: DCRC Mask            */\r
+#define SDMMC_MINTSTS_RTO_Pos                                 8                                                         /*!< SDMMC MINTSTS: RTO Position         */\r
+#define SDMMC_MINTSTS_RTO_Msk                                 (0x01UL << SDMMC_MINTSTS_RTO_Pos)                         /*!< SDMMC MINTSTS: RTO Mask             */\r
+#define SDMMC_MINTSTS_DRTO_Pos                                9                                                         /*!< SDMMC MINTSTS: DRTO Position        */\r
+#define SDMMC_MINTSTS_DRTO_Msk                                (0x01UL << SDMMC_MINTSTS_DRTO_Pos)                        /*!< SDMMC MINTSTS: DRTO Mask            */\r
+#define SDMMC_MINTSTS_HTO_Pos                                 10                                                        /*!< SDMMC MINTSTS: HTO Position         */\r
+#define SDMMC_MINTSTS_HTO_Msk                                 (0x01UL << SDMMC_MINTSTS_HTO_Pos)                         /*!< SDMMC MINTSTS: HTO Mask             */\r
+#define SDMMC_MINTSTS_FRUN_Pos                                11                                                        /*!< SDMMC MINTSTS: FRUN Position        */\r
+#define SDMMC_MINTSTS_FRUN_Msk                                (0x01UL << SDMMC_MINTSTS_FRUN_Pos)                        /*!< SDMMC MINTSTS: FRUN Mask            */\r
+#define SDMMC_MINTSTS_HLE_Pos                                 12                                                        /*!< SDMMC MINTSTS: HLE Position         */\r
+#define SDMMC_MINTSTS_HLE_Msk                                 (0x01UL << SDMMC_MINTSTS_HLE_Pos)                         /*!< SDMMC MINTSTS: HLE Mask             */\r
+#define SDMMC_MINTSTS_SBE_Pos                                 13                                                        /*!< SDMMC MINTSTS: SBE Position         */\r
+#define SDMMC_MINTSTS_SBE_Msk                                 (0x01UL << SDMMC_MINTSTS_SBE_Pos)                         /*!< SDMMC MINTSTS: SBE Mask             */\r
+#define SDMMC_MINTSTS_ACD_Pos                                 14                                                        /*!< SDMMC MINTSTS: ACD Position         */\r
+#define SDMMC_MINTSTS_ACD_Msk                                 (0x01UL << SDMMC_MINTSTS_ACD_Pos)                         /*!< SDMMC MINTSTS: ACD Mask             */\r
+#define SDMMC_MINTSTS_EBE_Pos                                 15                                                        /*!< SDMMC MINTSTS: EBE Position         */\r
+#define SDMMC_MINTSTS_EBE_Msk                                 (0x01UL << SDMMC_MINTSTS_EBE_Pos)                         /*!< SDMMC MINTSTS: EBE Mask             */\r
+#define SDMMC_MINTSTS_SDIO_INTERRUPT_Pos                      16                                                        /*!< SDMMC MINTSTS: SDIO_INTERRUPT Position */\r
+#define SDMMC_MINTSTS_SDIO_INTERRUPT_Msk                      (0x0000ffffUL << SDMMC_MINTSTS_SDIO_INTERRUPT_Pos)        /*!< SDMMC MINTSTS: SDIO_INTERRUPT Mask  */\r
+\r
+// --------------------------------------  SDMMC_RINTSTS  -----------------------------------------\r
+#define SDMMC_RINTSTS_CDET_Pos                                0                                                         /*!< SDMMC RINTSTS: CDET Position        */\r
+#define SDMMC_RINTSTS_CDET_Msk                                (0x01UL << SDMMC_RINTSTS_CDET_Pos)                        /*!< SDMMC RINTSTS: CDET Mask            */\r
+#define SDMMC_RINTSTS_RE_Pos                                  1                                                         /*!< SDMMC RINTSTS: RE Position          */\r
+#define SDMMC_RINTSTS_RE_Msk                                  (0x01UL << SDMMC_RINTSTS_RE_Pos)                          /*!< SDMMC RINTSTS: RE Mask              */\r
+#define SDMMC_RINTSTS_CDONE_Pos                               2                                                         /*!< SDMMC RINTSTS: CDONE Position       */\r
+#define SDMMC_RINTSTS_CDONE_Msk                               (0x01UL << SDMMC_RINTSTS_CDONE_Pos)                       /*!< SDMMC RINTSTS: CDONE Mask           */\r
+#define SDMMC_RINTSTS_DTO_Pos                                 3                                                         /*!< SDMMC RINTSTS: DTO Position         */\r
+#define SDMMC_RINTSTS_DTO_Msk                                 (0x01UL << SDMMC_RINTSTS_DTO_Pos)                         /*!< SDMMC RINTSTS: DTO Mask             */\r
+#define SDMMC_RINTSTS_TXDR_Pos                                4                                                         /*!< SDMMC RINTSTS: TXDR Position        */\r
+#define SDMMC_RINTSTS_TXDR_Msk                                (0x01UL << SDMMC_RINTSTS_TXDR_Pos)                        /*!< SDMMC RINTSTS: TXDR Mask            */\r
+#define SDMMC_RINTSTS_RXDR_Pos                                5                                                         /*!< SDMMC RINTSTS: RXDR Position        */\r
+#define SDMMC_RINTSTS_RXDR_Msk                                (0x01UL << SDMMC_RINTSTS_RXDR_Pos)                        /*!< SDMMC RINTSTS: RXDR Mask            */\r
+#define SDMMC_RINTSTS_RCRC_Pos                                6                                                         /*!< SDMMC RINTSTS: RCRC Position        */\r
+#define SDMMC_RINTSTS_RCRC_Msk                                (0x01UL << SDMMC_RINTSTS_RCRC_Pos)                        /*!< SDMMC RINTSTS: RCRC Mask            */\r
+#define SDMMC_RINTSTS_DCRC_Pos                                7                                                         /*!< SDMMC RINTSTS: DCRC Position        */\r
+#define SDMMC_RINTSTS_DCRC_Msk                                (0x01UL << SDMMC_RINTSTS_DCRC_Pos)                        /*!< SDMMC RINTSTS: DCRC Mask            */\r
+#define SDMMC_RINTSTS_RTO_BAR_Pos                             8                                                         /*!< SDMMC RINTSTS: RTO_BAR Position     */\r
+#define SDMMC_RINTSTS_RTO_BAR_Msk                             (0x01UL << SDMMC_RINTSTS_RTO_BAR_Pos)                     /*!< SDMMC RINTSTS: RTO_BAR Mask         */\r
+#define SDMMC_RINTSTS_DRTO_BDS_Pos                            9                                                         /*!< SDMMC RINTSTS: DRTO_BDS Position    */\r
+#define SDMMC_RINTSTS_DRTO_BDS_Msk                            (0x01UL << SDMMC_RINTSTS_DRTO_BDS_Pos)                    /*!< SDMMC RINTSTS: DRTO_BDS Mask        */\r
+#define SDMMC_RINTSTS_HTO_Pos                                 10                                                        /*!< SDMMC RINTSTS: HTO Position         */\r
+#define SDMMC_RINTSTS_HTO_Msk                                 (0x01UL << SDMMC_RINTSTS_HTO_Pos)                         /*!< SDMMC RINTSTS: HTO Mask             */\r
+#define SDMMC_RINTSTS_FRUN_Pos                                11                                                        /*!< SDMMC RINTSTS: FRUN Position        */\r
+#define SDMMC_RINTSTS_FRUN_Msk                                (0x01UL << SDMMC_RINTSTS_FRUN_Pos)                        /*!< SDMMC RINTSTS: FRUN Mask            */\r
+#define SDMMC_RINTSTS_HLE_Pos                                 12                                                        /*!< SDMMC RINTSTS: HLE Position         */\r
+#define SDMMC_RINTSTS_HLE_Msk                                 (0x01UL << SDMMC_RINTSTS_HLE_Pos)                         /*!< SDMMC RINTSTS: HLE Mask             */\r
+#define SDMMC_RINTSTS_SBE_Pos                                 13                                                        /*!< SDMMC RINTSTS: SBE Position         */\r
+#define SDMMC_RINTSTS_SBE_Msk                                 (0x01UL << SDMMC_RINTSTS_SBE_Pos)                         /*!< SDMMC RINTSTS: SBE Mask             */\r
+#define SDMMC_RINTSTS_ACD_Pos                                 14                                                        /*!< SDMMC RINTSTS: ACD Position         */\r
+#define SDMMC_RINTSTS_ACD_Msk                                 (0x01UL << SDMMC_RINTSTS_ACD_Pos)                         /*!< SDMMC RINTSTS: ACD Mask             */\r
+#define SDMMC_RINTSTS_EBE_Pos                                 15                                                        /*!< SDMMC RINTSTS: EBE Position         */\r
+#define SDMMC_RINTSTS_EBE_Msk                                 (0x01UL << SDMMC_RINTSTS_EBE_Pos)                         /*!< SDMMC RINTSTS: EBE Mask             */\r
+#define SDMMC_RINTSTS_SDIO_INTERRUPT_Pos                      16                                                        /*!< SDMMC RINTSTS: SDIO_INTERRUPT Position */\r
+#define SDMMC_RINTSTS_SDIO_INTERRUPT_Msk                      (0x0000ffffUL << SDMMC_RINTSTS_SDIO_INTERRUPT_Pos)        /*!< SDMMC RINTSTS: SDIO_INTERRUPT Mask  */\r
+\r
+// --------------------------------------  SDMMC_STATUS  ------------------------------------------\r
+#define SDMMC_STATUS_FIFO_RX_WATERMARK_Pos                    0                                                         /*!< SDMMC STATUS: FIFO_RX_WATERMARK Position */\r
+#define SDMMC_STATUS_FIFO_RX_WATERMARK_Msk                    (0x01UL << SDMMC_STATUS_FIFO_RX_WATERMARK_Pos)            /*!< SDMMC STATUS: FIFO_RX_WATERMARK Mask */\r
+#define SDMMC_STATUS_FIFO_TX_WATERMARK_Pos                    1                                                         /*!< SDMMC STATUS: FIFO_TX_WATERMARK Position */\r
+#define SDMMC_STATUS_FIFO_TX_WATERMARK_Msk                    (0x01UL << SDMMC_STATUS_FIFO_TX_WATERMARK_Pos)            /*!< SDMMC STATUS: FIFO_TX_WATERMARK Mask */\r
+#define SDMMC_STATUS_FIFO_EMPTY_Pos                           2                                                         /*!< SDMMC STATUS: FIFO_EMPTY Position   */\r
+#define SDMMC_STATUS_FIFO_EMPTY_Msk                           (0x01UL << SDMMC_STATUS_FIFO_EMPTY_Pos)                   /*!< SDMMC STATUS: FIFO_EMPTY Mask       */\r
+#define SDMMC_STATUS_FIFO_FULL_Pos                            3                                                         /*!< SDMMC STATUS: FIFO_FULL Position    */\r
+#define SDMMC_STATUS_FIFO_FULL_Msk                            (0x01UL << SDMMC_STATUS_FIFO_FULL_Pos)                    /*!< SDMMC STATUS: FIFO_FULL Mask        */\r
+#define SDMMC_STATUS_CMDFSMSTATES_Pos                         4                                                         /*!< SDMMC STATUS: CMDFSMSTATES Position */\r
+#define SDMMC_STATUS_CMDFSMSTATES_Msk                         (0x0fUL << SDMMC_STATUS_CMDFSMSTATES_Pos)                 /*!< SDMMC STATUS: CMDFSMSTATES Mask     */\r
+#define SDMMC_STATUS_DATA_3_STATUS_Pos                        8                                                         /*!< SDMMC STATUS: DATA_3_STATUS Position */\r
+#define SDMMC_STATUS_DATA_3_STATUS_Msk                        (0x01UL << SDMMC_STATUS_DATA_3_STATUS_Pos)                /*!< SDMMC STATUS: DATA_3_STATUS Mask    */\r
+#define SDMMC_STATUS_DATA_BUSY_Pos                            9                                                         /*!< SDMMC STATUS: DATA_BUSY Position    */\r
+#define SDMMC_STATUS_DATA_BUSY_Msk                            (0x01UL << SDMMC_STATUS_DATA_BUSY_Pos)                    /*!< SDMMC STATUS: DATA_BUSY Mask        */\r
+#define SDMMC_STATUS_DATA_STATE_MC_BUSY_Pos                   10                                                        /*!< SDMMC STATUS: DATA_STATE_MC_BUSY Position */\r
+#define SDMMC_STATUS_DATA_STATE_MC_BUSY_Msk                   (0x01UL << SDMMC_STATUS_DATA_STATE_MC_BUSY_Pos)           /*!< SDMMC STATUS: DATA_STATE_MC_BUSY Mask */\r
+#define SDMMC_STATUS_RESPONSE_INDEX_Pos                       11                                                        /*!< SDMMC STATUS: RESPONSE_INDEX Position */\r
+#define SDMMC_STATUS_RESPONSE_INDEX_Msk                       (0x3fUL << SDMMC_STATUS_RESPONSE_INDEX_Pos)               /*!< SDMMC STATUS: RESPONSE_INDEX Mask   */\r
+#define SDMMC_STATUS_FIFO_COUNT_Pos                           17                                                        /*!< SDMMC STATUS: FIFO_COUNT Position   */\r
+#define SDMMC_STATUS_FIFO_COUNT_Msk                           (0x00001fffUL << SDMMC_STATUS_FIFO_COUNT_Pos)             /*!< SDMMC STATUS: FIFO_COUNT Mask       */\r
+#define SDMMC_STATUS_DMA_ACK_Pos                              30                                                        /*!< SDMMC STATUS: DMA_ACK Position      */\r
+#define SDMMC_STATUS_DMA_ACK_Msk                              (0x01UL << SDMMC_STATUS_DMA_ACK_Pos)                      /*!< SDMMC STATUS: DMA_ACK Mask          */\r
+#define SDMMC_STATUS_DMA_REQ_Pos                              31                                                        /*!< SDMMC STATUS: DMA_REQ Position      */\r
+#define SDMMC_STATUS_DMA_REQ_Msk                              (0x01UL << SDMMC_STATUS_DMA_REQ_Pos)                      /*!< SDMMC STATUS: DMA_REQ Mask          */\r
+\r
+// --------------------------------------  SDMMC_FIFOTH  ------------------------------------------\r
+#define SDMMC_FIFOTH_TX_WMARK_Pos                             0                                                         /*!< SDMMC FIFOTH: TX_WMARK Position     */\r
+#define SDMMC_FIFOTH_TX_WMARK_Msk                             (0x00000fffUL << SDMMC_FIFOTH_TX_WMARK_Pos)               /*!< SDMMC FIFOTH: TX_WMARK Mask         */\r
+#define SDMMC_FIFOTH_RX_WMARK_Pos                             16                                                        /*!< SDMMC FIFOTH: RX_WMARK Position     */\r
+#define SDMMC_FIFOTH_RX_WMARK_Msk                             (0x00000fffUL << SDMMC_FIFOTH_RX_WMARK_Pos)               /*!< SDMMC FIFOTH: RX_WMARK Mask         */\r
+#define SDMMC_FIFOTH_DW_DMA_MUTIPLE_TRANSACTION_SIZE_Pos      28                                                        /*!< SDMMC FIFOTH: DW_DMA_MUTIPLE_TRANSACTION_SIZE Position */\r
+#define SDMMC_FIFOTH_DW_DMA_MUTIPLE_TRANSACTION_SIZE_Msk      (0x07UL << SDMMC_FIFOTH_DW_DMA_MUTIPLE_TRANSACTION_SIZE_Pos)/*!< SDMMC FIFOTH: DW_DMA_MUTIPLE_TRANSACTION_SIZE Mask */\r
+\r
+// --------------------------------------  SDMMC_CDETECT  -----------------------------------------\r
+#define SDMMC_CDETECT_CARD_DETECT_N_Pos                       0                                                         /*!< SDMMC CDETECT: CARD_DETECT_N Position */\r
+#define SDMMC_CDETECT_CARD_DETECT_N_Msk                       (0x3fffffffUL << SDMMC_CDETECT_CARD_DETECT_N_Pos)         /*!< SDMMC CDETECT: CARD_DETECT_N Mask   */\r
+\r
+// --------------------------------------  SDMMC_WRTPRT  ------------------------------------------\r
+#define SDMMC_WRTPRT_WRITE_PROTECT_Pos                        0                                                         /*!< SDMMC WRTPRT: WRITE_PROTECT Position */\r
+#define SDMMC_WRTPRT_WRITE_PROTECT_Msk                        (0x3fffffffUL << SDMMC_WRTPRT_WRITE_PROTECT_Pos)          /*!< SDMMC WRTPRT: WRITE_PROTECT Mask    */\r
+\r
+// ---------------------------------------  SDMMC_GPIO  -------------------------------------------\r
+#define SDMMC_GPIO_GPI_Pos                                    0                                                         /*!< SDMMC GPIO: GPI Position            */\r
+#define SDMMC_GPIO_GPI_Msk                                    (0x000000ffUL << SDMMC_GPIO_GPI_Pos)                      /*!< SDMMC GPIO: GPI Mask                */\r
+#define SDMMC_GPIO_GPO_Pos                                    8                                                         /*!< SDMMC GPIO: GPO Position            */\r
+#define SDMMC_GPIO_GPO_Msk                                    (0x0000ffffUL << SDMMC_GPIO_GPO_Pos)                      /*!< SDMMC GPIO: GPO Mask                */\r
+\r
+// --------------------------------------  SDMMC_TCBCNT  ------------------------------------------\r
+#define SDMMC_TCBCNT_TRANS_CARD_BYTE_COUNT_Pos                0                                                         /*!< SDMMC TCBCNT: TRANS_CARD_BYTE_COUNT Position */\r
+#define SDMMC_TCBCNT_TRANS_CARD_BYTE_COUNT_Msk                (0xffffffffUL << SDMMC_TCBCNT_TRANS_CARD_BYTE_COUNT_Pos)  /*!< SDMMC TCBCNT: TRANS_CARD_BYTE_COUNT Mask */\r
+\r
+// --------------------------------------  SDMMC_TBBCNT  ------------------------------------------\r
+#define SDMMC_TBBCNT_TRANS_FIFO_BYTE_COUNT_Pos                0                                                         /*!< SDMMC TBBCNT: TRANS_FIFO_BYTE_COUNT Position */\r
+#define SDMMC_TBBCNT_TRANS_FIFO_BYTE_COUNT_Msk                (0xffffffffUL << SDMMC_TBBCNT_TRANS_FIFO_BYTE_COUNT_Pos)  /*!< SDMMC TBBCNT: TRANS_FIFO_BYTE_COUNT Mask */\r
+\r
+// --------------------------------------  SDMMC_DEBNCE  ------------------------------------------\r
+#define SDMMC_DEBNCE_DEBOUNCE_COUNT_Pos                       0                                                         /*!< SDMMC DEBNCE: DEBOUNCE_COUNT Position */\r
+#define SDMMC_DEBNCE_DEBOUNCE_COUNT_Msk                       (0x00ffffffUL << SDMMC_DEBNCE_DEBOUNCE_COUNT_Pos)         /*!< SDMMC DEBNCE: DEBOUNCE_COUNT Mask   */\r
+\r
+// ---------------------------------------  SDMMC_USRID  ------------------------------------------\r
+#define SDMMC_USRID_USRID_Pos                                 0                                                         /*!< SDMMC USRID: USRID Position         */\r
+#define SDMMC_USRID_USRID_Msk                                 (0xffffffffUL << SDMMC_USRID_USRID_Pos)                   /*!< SDMMC USRID: USRID Mask             */\r
+\r
+// ---------------------------------------  SDMMC_VERID  ------------------------------------------\r
+#define SDMMC_VERID_VERID_Pos                                 0                                                         /*!< SDMMC VERID: VERID Position         */\r
+#define SDMMC_VERID_VERID_Msk                                 (0xffffffffUL << SDMMC_VERID_VERID_Pos)                   /*!< SDMMC VERID: VERID Mask             */\r
+\r
+// --------------------------------------  SDMMC_UHS_REG  -----------------------------------------\r
+#define SDMMC_UHS_REG_VOLT_REG_Pos                            0                                                         /*!< SDMMC UHS_REG: VOLT_REG Position    */\r
+#define SDMMC_UHS_REG_VOLT_REG_Msk                            (0x0000ffffUL << SDMMC_UHS_REG_VOLT_REG_Pos)              /*!< SDMMC UHS_REG: VOLT_REG Mask        */\r
+#define SDMMC_UHS_REG_DDR_REG_Pos                             16                                                        /*!< SDMMC UHS_REG: DDR_REG Position     */\r
+#define SDMMC_UHS_REG_DDR_REG_Msk                             (0x0000ffffUL << SDMMC_UHS_REG_DDR_REG_Pos)               /*!< SDMMC UHS_REG: DDR_REG Mask         */\r
+\r
+// ---------------------------------------  SDMMC_RST_N  ------------------------------------------\r
+#define SDMMC_RST_N_CARD_RESET_Pos                            0                                                         /*!< SDMMC RST_N: CARD_RESET Position    */\r
+#define SDMMC_RST_N_CARD_RESET_Msk                            (0x0000ffffUL << SDMMC_RST_N_CARD_RESET_Pos)              /*!< SDMMC RST_N: CARD_RESET Mask        */\r
+\r
+// ---------------------------------------  SDMMC_BMOD  -------------------------------------------\r
+#define SDMMC_BMOD_SWR_Pos                                    0                                                         /*!< SDMMC BMOD: SWR Position            */\r
+#define SDMMC_BMOD_SWR_Msk                                    (0x01UL << SDMMC_BMOD_SWR_Pos)                            /*!< SDMMC BMOD: SWR Mask                */\r
+#define SDMMC_BMOD_FB_Pos                                     1                                                         /*!< SDMMC BMOD: FB Position             */\r
+#define SDMMC_BMOD_FB_Msk                                     (0x01UL << SDMMC_BMOD_FB_Pos)                             /*!< SDMMC BMOD: FB Mask                 */\r
+#define SDMMC_BMOD_DSL_Pos                                    2                                                         /*!< SDMMC BMOD: DSL Position            */\r
+#define SDMMC_BMOD_DSL_Msk                                    (0x1fUL << SDMMC_BMOD_DSL_Pos)                            /*!< SDMMC BMOD: DSL Mask                */\r
+#define SDMMC_BMOD_DE_Pos                                     7                                                         /*!< SDMMC BMOD: DE Position             */\r
+#define SDMMC_BMOD_DE_Msk                                     (0x01UL << SDMMC_BMOD_DE_Pos)                             /*!< SDMMC BMOD: DE Mask                 */\r
+#define SDMMC_BMOD_PBL_Pos                                    8                                                         /*!< SDMMC BMOD: PBL Position            */\r
+#define SDMMC_BMOD_PBL_Msk                                    (0x07UL << SDMMC_BMOD_PBL_Pos)                            /*!< SDMMC BMOD: PBL Mask                */\r
+\r
+// --------------------------------------  SDMMC_PLDMND  ------------------------------------------\r
+#define SDMMC_PLDMND_PD_Pos                                   0                                                         /*!< SDMMC PLDMND: PD Position           */\r
+#define SDMMC_PLDMND_PD_Msk                                   (0xffffffffUL << SDMMC_PLDMND_PD_Pos)                     /*!< SDMMC PLDMND: PD Mask               */\r
+\r
+// --------------------------------------  SDMMC_DBADDR  ------------------------------------------\r
+#define SDMMC_DBADDR_SDL_Pos                                  0                                                         /*!< SDMMC DBADDR: SDL Position          */\r
+#define SDMMC_DBADDR_SDL_Msk                                  (0xffffffffUL << SDMMC_DBADDR_SDL_Pos)                    /*!< SDMMC DBADDR: SDL Mask              */\r
+\r
+// ---------------------------------------  SDMMC_IDSTS  ------------------------------------------\r
+#define SDMMC_IDSTS_TI_Pos                                    0                                                         /*!< SDMMC IDSTS: TI Position            */\r
+#define SDMMC_IDSTS_TI_Msk                                    (0x01UL << SDMMC_IDSTS_TI_Pos)                            /*!< SDMMC IDSTS: TI Mask                */\r
+#define SDMMC_IDSTS_RI_Pos                                    1                                                         /*!< SDMMC IDSTS: RI Position            */\r
+#define SDMMC_IDSTS_RI_Msk                                    (0x01UL << SDMMC_IDSTS_RI_Pos)                            /*!< SDMMC IDSTS: RI Mask                */\r
+#define SDMMC_IDSTS_FBE_Pos                                   2                                                         /*!< SDMMC IDSTS: FBE Position           */\r
+#define SDMMC_IDSTS_FBE_Msk                                   (0x01UL << SDMMC_IDSTS_FBE_Pos)                           /*!< SDMMC IDSTS: FBE Mask               */\r
+#define SDMMC_IDSTS_DU_Pos                                    4                                                         /*!< SDMMC IDSTS: DU Position            */\r
+#define SDMMC_IDSTS_DU_Msk                                    (0x01UL << SDMMC_IDSTS_DU_Pos)                            /*!< SDMMC IDSTS: DU Mask                */\r
+#define SDMMC_IDSTS_CES_Pos                                   5                                                         /*!< SDMMC IDSTS: CES Position           */\r
+#define SDMMC_IDSTS_CES_Msk                                   (0x01UL << SDMMC_IDSTS_CES_Pos)                           /*!< SDMMC IDSTS: CES Mask               */\r
+#define SDMMC_IDSTS_NIS_Pos                                   8                                                         /*!< SDMMC IDSTS: NIS Position           */\r
+#define SDMMC_IDSTS_NIS_Msk                                   (0x01UL << SDMMC_IDSTS_NIS_Pos)                           /*!< SDMMC IDSTS: NIS Mask               */\r
+#define SDMMC_IDSTS_AIS_Pos                                   9                                                         /*!< SDMMC IDSTS: AIS Position           */\r
+#define SDMMC_IDSTS_AIS_Msk                                   (0x01UL << SDMMC_IDSTS_AIS_Pos)                           /*!< SDMMC IDSTS: AIS Mask               */\r
+#define SDMMC_IDSTS_EB_Pos                                    10                                                        /*!< SDMMC IDSTS: EB Position            */\r
+#define SDMMC_IDSTS_EB_Msk                                    (0x07UL << SDMMC_IDSTS_EB_Pos)                            /*!< SDMMC IDSTS: EB Mask                */\r
+#define SDMMC_IDSTS_FSM_Pos                                   13                                                        /*!< SDMMC IDSTS: FSM Position           */\r
+#define SDMMC_IDSTS_FSM_Msk                                   (0x0fUL << SDMMC_IDSTS_FSM_Pos)                           /*!< SDMMC IDSTS: FSM Mask               */\r
+\r
+// --------------------------------------  SDMMC_IDINTEN  -----------------------------------------\r
+#define SDMMC_IDINTEN_TI_Pos                                  0                                                         /*!< SDMMC IDINTEN: TI Position          */\r
+#define SDMMC_IDINTEN_TI_Msk                                  (0x01UL << SDMMC_IDINTEN_TI_Pos)                          /*!< SDMMC IDINTEN: TI Mask              */\r
+#define SDMMC_IDINTEN_RI_Pos                                  1                                                         /*!< SDMMC IDINTEN: RI Position          */\r
+#define SDMMC_IDINTEN_RI_Msk                                  (0x01UL << SDMMC_IDINTEN_RI_Pos)                          /*!< SDMMC IDINTEN: RI Mask              */\r
+#define SDMMC_IDINTEN_FBE_Pos                                 2                                                         /*!< SDMMC IDINTEN: FBE Position         */\r
+#define SDMMC_IDINTEN_FBE_Msk                                 (0x01UL << SDMMC_IDINTEN_FBE_Pos)                         /*!< SDMMC IDINTEN: FBE Mask             */\r
+#define SDMMC_IDINTEN_DU_Pos                                  4                                                         /*!< SDMMC IDINTEN: DU Position          */\r
+#define SDMMC_IDINTEN_DU_Msk                                  (0x01UL << SDMMC_IDINTEN_DU_Pos)                          /*!< SDMMC IDINTEN: DU Mask              */\r
+#define SDMMC_IDINTEN_CES_Pos                                 5                                                         /*!< SDMMC IDINTEN: CES Position         */\r
+#define SDMMC_IDINTEN_CES_Msk                                 (0x01UL << SDMMC_IDINTEN_CES_Pos)                         /*!< SDMMC IDINTEN: CES Mask             */\r
+#define SDMMC_IDINTEN_NIS_Pos                                 8                                                         /*!< SDMMC IDINTEN: NIS Position         */\r
+#define SDMMC_IDINTEN_NIS_Msk                                 (0x01UL << SDMMC_IDINTEN_NIS_Pos)                         /*!< SDMMC IDINTEN: NIS Mask             */\r
+#define SDMMC_IDINTEN_AIS_Pos                                 9                                                         /*!< SDMMC IDINTEN: AIS Position         */\r
+#define SDMMC_IDINTEN_AIS_Msk                                 (0x01UL << SDMMC_IDINTEN_AIS_Pos)                         /*!< SDMMC IDINTEN: AIS Mask             */\r
+\r
+// --------------------------------------  SDMMC_DSCADDR  -----------------------------------------\r
+#define SDMMC_DSCADDR_HDA_Pos                                 0                                                         /*!< SDMMC DSCADDR: HDA Position         */\r
+#define SDMMC_DSCADDR_HDA_Msk                                 (0xffffffffUL << SDMMC_DSCADDR_HDA_Pos)                   /*!< SDMMC DSCADDR: HDA Mask             */\r
+\r
+// --------------------------------------  SDMMC_BUFADDR  -----------------------------------------\r
+#define SDMMC_BUFADDR_HBA_Pos                                 0                                                         /*!< SDMMC BUFADDR: HBA Position         */\r
+#define SDMMC_BUFADDR_HBA_Msk                                 (0xffffffffUL << SDMMC_BUFADDR_HBA_Pos)                   /*!< SDMMC BUFADDR: HBA Mask             */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  EMC Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  EMC_CONTROL  ------------------------------------------\r
+#define EMC_CONTROL_E_Pos                                     0                                                         /*!< EMC CONTROL: E Position             */\r
+#define EMC_CONTROL_E_Msk                                     (0x01UL << EMC_CONTROL_E_Pos)                             /*!< EMC CONTROL: E Mask                 */\r
+#define EMC_CONTROL_M_Pos                                     1                                                         /*!< EMC CONTROL: M Position             */\r
+#define EMC_CONTROL_M_Msk                                     (0x01UL << EMC_CONTROL_M_Pos)                             /*!< EMC CONTROL: M Mask                 */\r
+#define EMC_CONTROL_L_Pos                                     2                                                         /*!< EMC CONTROL: L Position             */\r
+#define EMC_CONTROL_L_Msk                                     (0x01UL << EMC_CONTROL_L_Pos)                             /*!< EMC CONTROL: L Mask                 */\r
+\r
+// ---------------------------------------  EMC_STATUS  -------------------------------------------\r
+#define EMC_STATUS_B_Pos                                      0                                                         /*!< EMC STATUS: B Position              */\r
+#define EMC_STATUS_B_Msk                                      (0x01UL << EMC_STATUS_B_Pos)                              /*!< EMC STATUS: B Mask                  */\r
+#define EMC_STATUS_S_Pos                                      1                                                         /*!< EMC STATUS: S Position              */\r
+#define EMC_STATUS_S_Msk                                      (0x01UL << EMC_STATUS_S_Pos)                              /*!< EMC STATUS: S Mask                  */\r
+#define EMC_STATUS_SA_Pos                                     2                                                         /*!< EMC STATUS: SA Position             */\r
+#define EMC_STATUS_SA_Msk                                     (0x01UL << EMC_STATUS_SA_Pos)                             /*!< EMC STATUS: SA Mask                 */\r
+\r
+// ---------------------------------------  EMC_CONFIG  -------------------------------------------\r
+#define EMC_CONFIG_EM_Pos                                     0                                                         /*!< EMC CONFIG: EM Position             */\r
+#define EMC_CONFIG_EM_Msk                                     (0x01UL << EMC_CONFIG_EM_Pos)                             /*!< EMC CONFIG: EM Mask                 */\r
+#define EMC_CONFIG_CR_Pos                                     8                                                         /*!< EMC CONFIG: CR Position             */\r
+#define EMC_CONFIG_CR_Msk                                     (0x01UL << EMC_CONFIG_CR_Pos)                             /*!< EMC CONFIG: CR Mask                 */\r
+\r
+// -----------------------------------  EMC_DYNAMICCONTROL  ---------------------------------------\r
+#define EMC_DYNAMICCONTROL_CE_Pos                             0                                                         /*!< EMC DYNAMICCONTROL: CE Position     */\r
+#define EMC_DYNAMICCONTROL_CE_Msk                             (0x01UL << EMC_DYNAMICCONTROL_CE_Pos)                     /*!< EMC DYNAMICCONTROL: CE Mask         */\r
+#define EMC_DYNAMICCONTROL_CS_Pos                             1                                                         /*!< EMC DYNAMICCONTROL: CS Position     */\r
+#define EMC_DYNAMICCONTROL_CS_Msk                             (0x01UL << EMC_DYNAMICCONTROL_CS_Pos)                     /*!< EMC DYNAMICCONTROL: CS Mask         */\r
+#define EMC_DYNAMICCONTROL_SR_Pos                             2                                                         /*!< EMC DYNAMICCONTROL: SR Position     */\r
+#define EMC_DYNAMICCONTROL_SR_Msk                             (0x01UL << EMC_DYNAMICCONTROL_SR_Pos)                     /*!< EMC DYNAMICCONTROL: SR Mask         */\r
+#define EMC_DYNAMICCONTROL_MMC_Pos                            5                                                         /*!< EMC DYNAMICCONTROL: MMC Position    */\r
+#define EMC_DYNAMICCONTROL_MMC_Msk                            (0x01UL << EMC_DYNAMICCONTROL_MMC_Pos)                    /*!< EMC DYNAMICCONTROL: MMC Mask        */\r
+#define EMC_DYNAMICCONTROL_I_Pos                              7                                                         /*!< EMC DYNAMICCONTROL: I Position      */\r
+#define EMC_DYNAMICCONTROL_I_Msk                              (0x03UL << EMC_DYNAMICCONTROL_I_Pos)                      /*!< EMC DYNAMICCONTROL: I Mask          */\r
+#define EMC_DYNAMICCONTROL_DP_Pos                             13                                                        /*!< EMC DYNAMICCONTROL: DP Position     */\r
+#define EMC_DYNAMICCONTROL_DP_Msk                             (0x01UL << EMC_DYNAMICCONTROL_DP_Pos)                     /*!< EMC DYNAMICCONTROL: DP Mask         */\r
+\r
+// -----------------------------------  EMC_DYNAMICREFRESH  ---------------------------------------\r
+#define EMC_DYNAMICREFRESH_REFRESH_Pos                        0                                                         /*!< EMC DYNAMICREFRESH: REFRESH Position */\r
+#define EMC_DYNAMICREFRESH_REFRESH_Msk                        (0x000007ffUL << EMC_DYNAMICREFRESH_REFRESH_Pos)          /*!< EMC DYNAMICREFRESH: REFRESH Mask    */\r
+\r
+// ----------------------------------  EMC_DYNAMICREADCONFIG  -------------------------------------\r
+#define EMC_DYNAMICREADCONFIG_RD_Pos                          0                                                         /*!< EMC DYNAMICREADCONFIG: RD Position  */\r
+#define EMC_DYNAMICREADCONFIG_RD_Msk                          (0x03UL << EMC_DYNAMICREADCONFIG_RD_Pos)                  /*!< EMC DYNAMICREADCONFIG: RD Mask      */\r
+\r
+// --------------------------------------  EMC_DYNAMICRP  -----------------------------------------\r
+#define EMC_DYNAMICRP_tRP_Pos                                 0                                                         /*!< EMC DYNAMICRP: tRP Position         */\r
+#define EMC_DYNAMICRP_tRP_Msk                                 (0x0fUL << EMC_DYNAMICRP_tRP_Pos)                         /*!< EMC DYNAMICRP: tRP Mask             */\r
+\r
+// -------------------------------------  EMC_DYNAMICRAS  -----------------------------------------\r
+#define EMC_DYNAMICRAS_tRAS_Pos                               0                                                         /*!< EMC DYNAMICRAS: tRAS Position       */\r
+#define EMC_DYNAMICRAS_tRAS_Msk                               (0x0fUL << EMC_DYNAMICRAS_tRAS_Pos)                       /*!< EMC DYNAMICRAS: tRAS Mask           */\r
+\r
+// -------------------------------------  EMC_DYNAMICSREX  ----------------------------------------\r
+#define EMC_DYNAMICSREX_tSREX_Pos                             0                                                         /*!< EMC DYNAMICSREX: tSREX Position     */\r
+#define EMC_DYNAMICSREX_tSREX_Msk                             (0x0fUL << EMC_DYNAMICSREX_tSREX_Pos)                     /*!< EMC DYNAMICSREX: tSREX Mask         */\r
+\r
+// -------------------------------------  EMC_DYNAMICAPR  -----------------------------------------\r
+#define EMC_DYNAMICAPR_tAPR_Pos                               0                                                         /*!< EMC DYNAMICAPR: tAPR Position       */\r
+#define EMC_DYNAMICAPR_tAPR_Msk                               (0x0fUL << EMC_DYNAMICAPR_tAPR_Pos)                       /*!< EMC DYNAMICAPR: tAPR Mask           */\r
+\r
+// -------------------------------------  EMC_DYNAMICDAL  -----------------------------------------\r
+#define EMC_DYNAMICDAL_tDAL_Pos                               0                                                         /*!< EMC DYNAMICDAL: tDAL Position       */\r
+#define EMC_DYNAMICDAL_tDAL_Msk                               (0x0fUL << EMC_DYNAMICDAL_tDAL_Pos)                       /*!< EMC DYNAMICDAL: tDAL Mask           */\r
+\r
+// --------------------------------------  EMC_DYNAMICWR  -----------------------------------------\r
+#define EMC_DYNAMICWR_tWR_Pos                                 0                                                         /*!< EMC DYNAMICWR: tWR Position         */\r
+#define EMC_DYNAMICWR_tWR_Msk                                 (0x0fUL << EMC_DYNAMICWR_tWR_Pos)                         /*!< EMC DYNAMICWR: tWR Mask             */\r
+\r
+// --------------------------------------  EMC_DYNAMICRC  -----------------------------------------\r
+#define EMC_DYNAMICRC_tRC_Pos                                 0                                                         /*!< EMC DYNAMICRC: tRC Position         */\r
+#define EMC_DYNAMICRC_tRC_Msk                                 (0x1fUL << EMC_DYNAMICRC_tRC_Pos)                         /*!< EMC DYNAMICRC: tRC Mask             */\r
+\r
+// -------------------------------------  EMC_DYNAMICRFC  -----------------------------------------\r
+#define EMC_DYNAMICRFC_tRFC_Pos                               0                                                         /*!< EMC DYNAMICRFC: tRFC Position       */\r
+#define EMC_DYNAMICRFC_tRFC_Msk                               (0x1fUL << EMC_DYNAMICRFC_tRFC_Pos)                       /*!< EMC DYNAMICRFC: tRFC Mask           */\r
+\r
+// -------------------------------------  EMC_DYNAMICXSR  -----------------------------------------\r
+#define EMC_DYNAMICXSR_tXSR_Pos                               0                                                         /*!< EMC DYNAMICXSR: tXSR Position       */\r
+#define EMC_DYNAMICXSR_tXSR_Msk                               (0x1fUL << EMC_DYNAMICXSR_tXSR_Pos)                       /*!< EMC DYNAMICXSR: tXSR Mask           */\r
+\r
+// -------------------------------------  EMC_DYNAMICRRD  -----------------------------------------\r
+#define EMC_DYNAMICRRD_tRRD_Pos                               0                                                         /*!< EMC DYNAMICRRD: tRRD Position       */\r
+#define EMC_DYNAMICRRD_tRRD_Msk                               (0x0fUL << EMC_DYNAMICRRD_tRRD_Pos)                       /*!< EMC DYNAMICRRD: tRRD Mask           */\r
+\r
+// -------------------------------------  EMC_DYNAMICMRD  -----------------------------------------\r
+#define EMC_DYNAMICMRD_tMRD_Pos                               0                                                         /*!< EMC DYNAMICMRD: tMRD Position       */\r
+#define EMC_DYNAMICMRD_tMRD_Msk                               (0x0fUL << EMC_DYNAMICMRD_tMRD_Pos)                       /*!< EMC DYNAMICMRD: tMRD Mask           */\r
+\r
+// ---------------------------------  EMC_STATICEXTENDEDWAIT  -------------------------------------\r
+#define EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_Pos               0                                                         /*!< EMC STATICEXTENDEDWAIT: EXTENDEDWAIT Position */\r
+#define EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_Msk               (0x000003ffUL << EMC_STATICEXTENDEDWAIT_EXTENDEDWAIT_Pos) /*!< EMC STATICEXTENDEDWAIT: EXTENDEDWAIT Mask */\r
+\r
+// -----------------------------------  EMC_DYNAMICCONFIG0  ---------------------------------------\r
+#define EMC_DYNAMICCONFIG0_MD_Pos                             3                                                         /*!< EMC DYNAMICCONFIG0: MD Position     */\r
+#define EMC_DYNAMICCONFIG0_MD_Msk                             (0x03UL << EMC_DYNAMICCONFIG0_MD_Pos)                     /*!< EMC DYNAMICCONFIG0: MD Mask         */\r
+#define EMC_DYNAMICCONFIG0_AM0_Pos                            7                                                         /*!< EMC DYNAMICCONFIG0: AM0 Position    */\r
+#define EMC_DYNAMICCONFIG0_AM0_Msk                            (0x3fUL << EMC_DYNAMICCONFIG0_AM0_Pos)                    /*!< EMC DYNAMICCONFIG0: AM0 Mask        */\r
+#define EMC_DYNAMICCONFIG0_AM1_Pos                            14                                                        /*!< EMC DYNAMICCONFIG0: AM1 Position    */\r
+#define EMC_DYNAMICCONFIG0_AM1_Msk                            (0x01UL << EMC_DYNAMICCONFIG0_AM1_Pos)                    /*!< EMC DYNAMICCONFIG0: AM1 Mask        */\r
+#define EMC_DYNAMICCONFIG0_B_Pos                              19                                                        /*!< EMC DYNAMICCONFIG0: B Position      */\r
+#define EMC_DYNAMICCONFIG0_B_Msk                              (0x01UL << EMC_DYNAMICCONFIG0_B_Pos)                      /*!< EMC DYNAMICCONFIG0: B Mask          */\r
+#define EMC_DYNAMICCONFIG0_P_Pos                              20                                                        /*!< EMC DYNAMICCONFIG0: P Position      */\r
+#define EMC_DYNAMICCONFIG0_P_Msk                              (0x01UL << EMC_DYNAMICCONFIG0_P_Pos)                      /*!< EMC DYNAMICCONFIG0: P Mask          */\r
+\r
+// -----------------------------------  EMC_DYNAMICRASCAS0  ---------------------------------------\r
+#define EMC_DYNAMICRASCAS0_RAS_Pos                            0                                                         /*!< EMC DYNAMICRASCAS0: RAS Position    */\r
+#define EMC_DYNAMICRASCAS0_RAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS0_RAS_Pos)                    /*!< EMC DYNAMICRASCAS0: RAS Mask        */\r
+#define EMC_DYNAMICRASCAS0_CAS_Pos                            8                                                         /*!< EMC DYNAMICRASCAS0: CAS Position    */\r
+#define EMC_DYNAMICRASCAS0_CAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS0_CAS_Pos)                    /*!< EMC DYNAMICRASCAS0: CAS Mask        */\r
+\r
+// -----------------------------------  EMC_DYNAMICCONFIG1  ---------------------------------------\r
+#define EMC_DYNAMICCONFIG1_MD_Pos                             3                                                         /*!< EMC DYNAMICCONFIG1: MD Position     */\r
+#define EMC_DYNAMICCONFIG1_MD_Msk                             (0x03UL << EMC_DYNAMICCONFIG1_MD_Pos)                     /*!< EMC DYNAMICCONFIG1: MD Mask         */\r
+#define EMC_DYNAMICCONFIG1_AM0_Pos                            7                                                         /*!< EMC DYNAMICCONFIG1: AM0 Position    */\r
+#define EMC_DYNAMICCONFIG1_AM0_Msk                            (0x3fUL << EMC_DYNAMICCONFIG1_AM0_Pos)                    /*!< EMC DYNAMICCONFIG1: AM0 Mask        */\r
+#define EMC_DYNAMICCONFIG1_AM1_Pos                            14                                                        /*!< EMC DYNAMICCONFIG1: AM1 Position    */\r
+#define EMC_DYNAMICCONFIG1_AM1_Msk                            (0x01UL << EMC_DYNAMICCONFIG1_AM1_Pos)                    /*!< EMC DYNAMICCONFIG1: AM1 Mask        */\r
+#define EMC_DYNAMICCONFIG1_B_Pos                              19                                                        /*!< EMC DYNAMICCONFIG1: B Position      */\r
+#define EMC_DYNAMICCONFIG1_B_Msk                              (0x01UL << EMC_DYNAMICCONFIG1_B_Pos)                      /*!< EMC DYNAMICCONFIG1: B Mask          */\r
+#define EMC_DYNAMICCONFIG1_P_Pos                              20                                                        /*!< EMC DYNAMICCONFIG1: P Position      */\r
+#define EMC_DYNAMICCONFIG1_P_Msk                              (0x01UL << EMC_DYNAMICCONFIG1_P_Pos)                      /*!< EMC DYNAMICCONFIG1: P Mask          */\r
+\r
+// -----------------------------------  EMC_DYNAMICRASCAS1  ---------------------------------------\r
+#define EMC_DYNAMICRASCAS1_RAS_Pos                            0                                                         /*!< EMC DYNAMICRASCAS1: RAS Position    */\r
+#define EMC_DYNAMICRASCAS1_RAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS1_RAS_Pos)                    /*!< EMC DYNAMICRASCAS1: RAS Mask        */\r
+#define EMC_DYNAMICRASCAS1_CAS_Pos                            8                                                         /*!< EMC DYNAMICRASCAS1: CAS Position    */\r
+#define EMC_DYNAMICRASCAS1_CAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS1_CAS_Pos)                    /*!< EMC DYNAMICRASCAS1: CAS Mask        */\r
+\r
+// -----------------------------------  EMC_DYNAMICCONFIG2  ---------------------------------------\r
+#define EMC_DYNAMICCONFIG2_MD_Pos                             3                                                         /*!< EMC DYNAMICCONFIG2: MD Position     */\r
+#define EMC_DYNAMICCONFIG2_MD_Msk                             (0x03UL << EMC_DYNAMICCONFIG2_MD_Pos)                     /*!< EMC DYNAMICCONFIG2: MD Mask         */\r
+#define EMC_DYNAMICCONFIG2_AM0_Pos                            7                                                         /*!< EMC DYNAMICCONFIG2: AM0 Position    */\r
+#define EMC_DYNAMICCONFIG2_AM0_Msk                            (0x3fUL << EMC_DYNAMICCONFIG2_AM0_Pos)                    /*!< EMC DYNAMICCONFIG2: AM0 Mask        */\r
+#define EMC_DYNAMICCONFIG2_AM1_Pos                            14                                                        /*!< EMC DYNAMICCONFIG2: AM1 Position    */\r
+#define EMC_DYNAMICCONFIG2_AM1_Msk                            (0x01UL << EMC_DYNAMICCONFIG2_AM1_Pos)                    /*!< EMC DYNAMICCONFIG2: AM1 Mask        */\r
+#define EMC_DYNAMICCONFIG2_B_Pos                              19                                                        /*!< EMC DYNAMICCONFIG2: B Position      */\r
+#define EMC_DYNAMICCONFIG2_B_Msk                              (0x01UL << EMC_DYNAMICCONFIG2_B_Pos)                      /*!< EMC DYNAMICCONFIG2: B Mask          */\r
+#define EMC_DYNAMICCONFIG2_P_Pos                              20                                                        /*!< EMC DYNAMICCONFIG2: P Position      */\r
+#define EMC_DYNAMICCONFIG2_P_Msk                              (0x01UL << EMC_DYNAMICCONFIG2_P_Pos)                      /*!< EMC DYNAMICCONFIG2: P Mask          */\r
+\r
+// -----------------------------------  EMC_DYNAMICRASCAS2  ---------------------------------------\r
+#define EMC_DYNAMICRASCAS2_RAS_Pos                            0                                                         /*!< EMC DYNAMICRASCAS2: RAS Position    */\r
+#define EMC_DYNAMICRASCAS2_RAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS2_RAS_Pos)                    /*!< EMC DYNAMICRASCAS2: RAS Mask        */\r
+#define EMC_DYNAMICRASCAS2_CAS_Pos                            8                                                         /*!< EMC DYNAMICRASCAS2: CAS Position    */\r
+#define EMC_DYNAMICRASCAS2_CAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS2_CAS_Pos)                    /*!< EMC DYNAMICRASCAS2: CAS Mask        */\r
+\r
+// -----------------------------------  EMC_DYNAMICCONFIG3  ---------------------------------------\r
+#define EMC_DYNAMICCONFIG3_MD_Pos                             3                                                         /*!< EMC DYNAMICCONFIG3: MD Position     */\r
+#define EMC_DYNAMICCONFIG3_MD_Msk                             (0x03UL << EMC_DYNAMICCONFIG3_MD_Pos)                     /*!< EMC DYNAMICCONFIG3: MD Mask         */\r
+#define EMC_DYNAMICCONFIG3_AM0_Pos                            7                                                         /*!< EMC DYNAMICCONFIG3: AM0 Position    */\r
+#define EMC_DYNAMICCONFIG3_AM0_Msk                            (0x3fUL << EMC_DYNAMICCONFIG3_AM0_Pos)                    /*!< EMC DYNAMICCONFIG3: AM0 Mask        */\r
+#define EMC_DYNAMICCONFIG3_AM1_Pos                            14                                                        /*!< EMC DYNAMICCONFIG3: AM1 Position    */\r
+#define EMC_DYNAMICCONFIG3_AM1_Msk                            (0x01UL << EMC_DYNAMICCONFIG3_AM1_Pos)                    /*!< EMC DYNAMICCONFIG3: AM1 Mask        */\r
+#define EMC_DYNAMICCONFIG3_B_Pos                              19                                                        /*!< EMC DYNAMICCONFIG3: B Position      */\r
+#define EMC_DYNAMICCONFIG3_B_Msk                              (0x01UL << EMC_DYNAMICCONFIG3_B_Pos)                      /*!< EMC DYNAMICCONFIG3: B Mask          */\r
+#define EMC_DYNAMICCONFIG3_P_Pos                              20                                                        /*!< EMC DYNAMICCONFIG3: P Position      */\r
+#define EMC_DYNAMICCONFIG3_P_Msk                              (0x01UL << EMC_DYNAMICCONFIG3_P_Pos)                      /*!< EMC DYNAMICCONFIG3: P Mask          */\r
+\r
+// -----------------------------------  EMC_DYNAMICRASCAS3  ---------------------------------------\r
+#define EMC_DYNAMICRASCAS3_RAS_Pos                            0                                                         /*!< EMC DYNAMICRASCAS3: RAS Position    */\r
+#define EMC_DYNAMICRASCAS3_RAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS3_RAS_Pos)                    /*!< EMC DYNAMICRASCAS3: RAS Mask        */\r
+#define EMC_DYNAMICRASCAS3_CAS_Pos                            8                                                         /*!< EMC DYNAMICRASCAS3: CAS Position    */\r
+#define EMC_DYNAMICRASCAS3_CAS_Msk                            (0x03UL << EMC_DYNAMICRASCAS3_CAS_Pos)                    /*!< EMC DYNAMICRASCAS3: CAS Mask        */\r
+\r
+// ------------------------------------  EMC_STATICCONFIG0  ---------------------------------------\r
+#define EMC_STATICCONFIG0_MW_Pos                              0                                                         /*!< EMC STATICCONFIG0: MW Position      */\r
+#define EMC_STATICCONFIG0_MW_Msk                              (0x03UL << EMC_STATICCONFIG0_MW_Pos)                      /*!< EMC STATICCONFIG0: MW Mask          */\r
+#define EMC_STATICCONFIG0_PM_Pos                              3                                                         /*!< EMC STATICCONFIG0: PM Position      */\r
+#define EMC_STATICCONFIG0_PM_Msk                              (0x01UL << EMC_STATICCONFIG0_PM_Pos)                      /*!< EMC STATICCONFIG0: PM Mask          */\r
+#define EMC_STATICCONFIG0_PC_Pos                              6                                                         /*!< EMC STATICCONFIG0: PC Position      */\r
+#define EMC_STATICCONFIG0_PC_Msk                              (0x01UL << EMC_STATICCONFIG0_PC_Pos)                      /*!< EMC STATICCONFIG0: PC Mask          */\r
+#define EMC_STATICCONFIG0_PB_Pos                              7                                                         /*!< EMC STATICCONFIG0: PB Position      */\r
+#define EMC_STATICCONFIG0_PB_Msk                              (0x01UL << EMC_STATICCONFIG0_PB_Pos)                      /*!< EMC STATICCONFIG0: PB Mask          */\r
+#define EMC_STATICCONFIG0_EW_Pos                              8                                                         /*!< EMC STATICCONFIG0: EW Position      */\r
+#define EMC_STATICCONFIG0_EW_Msk                              (0x01UL << EMC_STATICCONFIG0_EW_Pos)                      /*!< EMC STATICCONFIG0: EW Mask          */\r
+#define EMC_STATICCONFIG0_B_Pos                               19                                                        /*!< EMC STATICCONFIG0: B Position       */\r
+#define EMC_STATICCONFIG0_B_Msk                               (0x01UL << EMC_STATICCONFIG0_B_Pos)                       /*!< EMC STATICCONFIG0: B Mask           */\r
+#define EMC_STATICCONFIG0_P_Pos                               20                                                        /*!< EMC STATICCONFIG0: P Position       */\r
+#define EMC_STATICCONFIG0_P_Msk                               (0x01UL << EMC_STATICCONFIG0_P_Pos)                       /*!< EMC STATICCONFIG0: P Mask           */\r
+\r
+// -----------------------------------  EMC_STATICWAITWEN0  ---------------------------------------\r
+#define EMC_STATICWAITWEN0_WAITWEN_Pos                        0                                                         /*!< EMC STATICWAITWEN0: WAITWEN Position */\r
+#define EMC_STATICWAITWEN0_WAITWEN_Msk                        (0x0fUL << EMC_STATICWAITWEN0_WAITWEN_Pos)                /*!< EMC STATICWAITWEN0: WAITWEN Mask    */\r
+\r
+// -----------------------------------  EMC_STATICWAITOEN0  ---------------------------------------\r
+#define EMC_STATICWAITOEN0_WAITOEN_Pos                        0                                                         /*!< EMC STATICWAITOEN0: WAITOEN Position */\r
+#define EMC_STATICWAITOEN0_WAITOEN_Msk                        (0x0fUL << EMC_STATICWAITOEN0_WAITOEN_Pos)                /*!< EMC STATICWAITOEN0: WAITOEN Mask    */\r
+\r
+// ------------------------------------  EMC_STATICWAITRD0  ---------------------------------------\r
+#define EMC_STATICWAITRD0_WAITRD_Pos                          0                                                         /*!< EMC STATICWAITRD0: WAITRD Position  */\r
+#define EMC_STATICWAITRD0_WAITRD_Msk                          (0x1fUL << EMC_STATICWAITRD0_WAITRD_Pos)                  /*!< EMC STATICWAITRD0: WAITRD Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITPAG0  ---------------------------------------\r
+#define EMC_STATICWAITPAG0_WAITPAGE_Pos                       0                                                         /*!< EMC STATICWAITPAG0: WAITPAGE Position */\r
+#define EMC_STATICWAITPAG0_WAITPAGE_Msk                       (0x1fUL << EMC_STATICWAITPAG0_WAITPAGE_Pos)               /*!< EMC STATICWAITPAG0: WAITPAGE Mask   */\r
+\r
+// ------------------------------------  EMC_STATICWAITWR0  ---------------------------------------\r
+#define EMC_STATICWAITWR0_WAITWR_Pos                          0                                                         /*!< EMC STATICWAITWR0: WAITWR Position  */\r
+#define EMC_STATICWAITWR0_WAITWR_Msk                          (0x1fUL << EMC_STATICWAITWR0_WAITWR_Pos)                  /*!< EMC STATICWAITWR0: WAITWR Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITTURN0  --------------------------------------\r
+#define EMC_STATICWAITTURN0_WAITTURN_Pos                      0                                                         /*!< EMC STATICWAITTURN0: WAITTURN Position */\r
+#define EMC_STATICWAITTURN0_WAITTURN_Msk                      (0x0fUL << EMC_STATICWAITTURN0_WAITTURN_Pos)              /*!< EMC STATICWAITTURN0: WAITTURN Mask  */\r
+\r
+// ------------------------------------  EMC_STATICCONFIG1  ---------------------------------------\r
+#define EMC_STATICCONFIG1_MW_Pos                              0                                                         /*!< EMC STATICCONFIG1: MW Position      */\r
+#define EMC_STATICCONFIG1_MW_Msk                              (0x03UL << EMC_STATICCONFIG1_MW_Pos)                      /*!< EMC STATICCONFIG1: MW Mask          */\r
+#define EMC_STATICCONFIG1_PM_Pos                              3                                                         /*!< EMC STATICCONFIG1: PM Position      */\r
+#define EMC_STATICCONFIG1_PM_Msk                              (0x01UL << EMC_STATICCONFIG1_PM_Pos)                      /*!< EMC STATICCONFIG1: PM Mask          */\r
+#define EMC_STATICCONFIG1_PC_Pos                              6                                                         /*!< EMC STATICCONFIG1: PC Position      */\r
+#define EMC_STATICCONFIG1_PC_Msk                              (0x01UL << EMC_STATICCONFIG1_PC_Pos)                      /*!< EMC STATICCONFIG1: PC Mask          */\r
+#define EMC_STATICCONFIG1_PB_Pos                              7                                                         /*!< EMC STATICCONFIG1: PB Position      */\r
+#define EMC_STATICCONFIG1_PB_Msk                              (0x01UL << EMC_STATICCONFIG1_PB_Pos)                      /*!< EMC STATICCONFIG1: PB Mask          */\r
+#define EMC_STATICCONFIG1_EW_Pos                              8                                                         /*!< EMC STATICCONFIG1: EW Position      */\r
+#define EMC_STATICCONFIG1_EW_Msk                              (0x01UL << EMC_STATICCONFIG1_EW_Pos)                      /*!< EMC STATICCONFIG1: EW Mask          */\r
+#define EMC_STATICCONFIG1_B_Pos                               19                                                        /*!< EMC STATICCONFIG1: B Position       */\r
+#define EMC_STATICCONFIG1_B_Msk                               (0x01UL << EMC_STATICCONFIG1_B_Pos)                       /*!< EMC STATICCONFIG1: B Mask           */\r
+#define EMC_STATICCONFIG1_P_Pos                               20                                                        /*!< EMC STATICCONFIG1: P Position       */\r
+#define EMC_STATICCONFIG1_P_Msk                               (0x01UL << EMC_STATICCONFIG1_P_Pos)                       /*!< EMC STATICCONFIG1: P Mask           */\r
+\r
+// -----------------------------------  EMC_STATICWAITWEN1  ---------------------------------------\r
+#define EMC_STATICWAITWEN1_WAITWEN_Pos                        0                                                         /*!< EMC STATICWAITWEN1: WAITWEN Position */\r
+#define EMC_STATICWAITWEN1_WAITWEN_Msk                        (0x0fUL << EMC_STATICWAITWEN1_WAITWEN_Pos)                /*!< EMC STATICWAITWEN1: WAITWEN Mask    */\r
+\r
+// -----------------------------------  EMC_STATICWAITOEN1  ---------------------------------------\r
+#define EMC_STATICWAITOEN1_WAITOEN_Pos                        0                                                         /*!< EMC STATICWAITOEN1: WAITOEN Position */\r
+#define EMC_STATICWAITOEN1_WAITOEN_Msk                        (0x0fUL << EMC_STATICWAITOEN1_WAITOEN_Pos)                /*!< EMC STATICWAITOEN1: WAITOEN Mask    */\r
+\r
+// ------------------------------------  EMC_STATICWAITRD1  ---------------------------------------\r
+#define EMC_STATICWAITRD1_WAITRD_Pos                          0                                                         /*!< EMC STATICWAITRD1: WAITRD Position  */\r
+#define EMC_STATICWAITRD1_WAITRD_Msk                          (0x1fUL << EMC_STATICWAITRD1_WAITRD_Pos)                  /*!< EMC STATICWAITRD1: WAITRD Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITPAG1  ---------------------------------------\r
+#define EMC_STATICWAITPAG1_WAITPAGE_Pos                       0                                                         /*!< EMC STATICWAITPAG1: WAITPAGE Position */\r
+#define EMC_STATICWAITPAG1_WAITPAGE_Msk                       (0x1fUL << EMC_STATICWAITPAG1_WAITPAGE_Pos)               /*!< EMC STATICWAITPAG1: WAITPAGE Mask   */\r
+\r
+// ------------------------------------  EMC_STATICWAITWR1  ---------------------------------------\r
+#define EMC_STATICWAITWR1_WAITWR_Pos                          0                                                         /*!< EMC STATICWAITWR1: WAITWR Position  */\r
+#define EMC_STATICWAITWR1_WAITWR_Msk                          (0x1fUL << EMC_STATICWAITWR1_WAITWR_Pos)                  /*!< EMC STATICWAITWR1: WAITWR Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITTURN1  --------------------------------------\r
+#define EMC_STATICWAITTURN1_WAITTURN_Pos                      0                                                         /*!< EMC STATICWAITTURN1: WAITTURN Position */\r
+#define EMC_STATICWAITTURN1_WAITTURN_Msk                      (0x0fUL << EMC_STATICWAITTURN1_WAITTURN_Pos)              /*!< EMC STATICWAITTURN1: WAITTURN Mask  */\r
+\r
+// ------------------------------------  EMC_STATICCONFIG2  ---------------------------------------\r
+#define EMC_STATICCONFIG2_MW_Pos                              0                                                         /*!< EMC STATICCONFIG2: MW Position      */\r
+#define EMC_STATICCONFIG2_MW_Msk                              (0x03UL << EMC_STATICCONFIG2_MW_Pos)                      /*!< EMC STATICCONFIG2: MW Mask          */\r
+#define EMC_STATICCONFIG2_PM_Pos                              3                                                         /*!< EMC STATICCONFIG2: PM Position      */\r
+#define EMC_STATICCONFIG2_PM_Msk                              (0x01UL << EMC_STATICCONFIG2_PM_Pos)                      /*!< EMC STATICCONFIG2: PM Mask          */\r
+#define EMC_STATICCONFIG2_PC_Pos                              6                                                         /*!< EMC STATICCONFIG2: PC Position      */\r
+#define EMC_STATICCONFIG2_PC_Msk                              (0x01UL << EMC_STATICCONFIG2_PC_Pos)                      /*!< EMC STATICCONFIG2: PC Mask          */\r
+#define EMC_STATICCONFIG2_PB_Pos                              7                                                         /*!< EMC STATICCONFIG2: PB Position      */\r
+#define EMC_STATICCONFIG2_PB_Msk                              (0x01UL << EMC_STATICCONFIG2_PB_Pos)                      /*!< EMC STATICCONFIG2: PB Mask          */\r
+#define EMC_STATICCONFIG2_EW_Pos                              8                                                         /*!< EMC STATICCONFIG2: EW Position      */\r
+#define EMC_STATICCONFIG2_EW_Msk                              (0x01UL << EMC_STATICCONFIG2_EW_Pos)                      /*!< EMC STATICCONFIG2: EW Mask          */\r
+#define EMC_STATICCONFIG2_B_Pos                               19                                                        /*!< EMC STATICCONFIG2: B Position       */\r
+#define EMC_STATICCONFIG2_B_Msk                               (0x01UL << EMC_STATICCONFIG2_B_Pos)                       /*!< EMC STATICCONFIG2: B Mask           */\r
+#define EMC_STATICCONFIG2_P_Pos                               20                                                        /*!< EMC STATICCONFIG2: P Position       */\r
+#define EMC_STATICCONFIG2_P_Msk                               (0x01UL << EMC_STATICCONFIG2_P_Pos)                       /*!< EMC STATICCONFIG2: P Mask           */\r
+\r
+// -----------------------------------  EMC_STATICWAITWEN2  ---------------------------------------\r
+#define EMC_STATICWAITWEN2_WAITWEN_Pos                        0                                                         /*!< EMC STATICWAITWEN2: WAITWEN Position */\r
+#define EMC_STATICWAITWEN2_WAITWEN_Msk                        (0x0fUL << EMC_STATICWAITWEN2_WAITWEN_Pos)                /*!< EMC STATICWAITWEN2: WAITWEN Mask    */\r
+\r
+// -----------------------------------  EMC_STATICWAITOEN2  ---------------------------------------\r
+#define EMC_STATICWAITOEN2_WAITOEN_Pos                        0                                                         /*!< EMC STATICWAITOEN2: WAITOEN Position */\r
+#define EMC_STATICWAITOEN2_WAITOEN_Msk                        (0x0fUL << EMC_STATICWAITOEN2_WAITOEN_Pos)                /*!< EMC STATICWAITOEN2: WAITOEN Mask    */\r
+\r
+// ------------------------------------  EMC_STATICWAITRD2  ---------------------------------------\r
+#define EMC_STATICWAITRD2_WAITRD_Pos                          0                                                         /*!< EMC STATICWAITRD2: WAITRD Position  */\r
+#define EMC_STATICWAITRD2_WAITRD_Msk                          (0x1fUL << EMC_STATICWAITRD2_WAITRD_Pos)                  /*!< EMC STATICWAITRD2: WAITRD Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITPAG2  ---------------------------------------\r
+#define EMC_STATICWAITPAG2_WAITPAGE_Pos                       0                                                         /*!< EMC STATICWAITPAG2: WAITPAGE Position */\r
+#define EMC_STATICWAITPAG2_WAITPAGE_Msk                       (0x1fUL << EMC_STATICWAITPAG2_WAITPAGE_Pos)               /*!< EMC STATICWAITPAG2: WAITPAGE Mask   */\r
+\r
+// ------------------------------------  EMC_STATICWAITWR2  ---------------------------------------\r
+#define EMC_STATICWAITWR2_WAITWR_Pos                          0                                                         /*!< EMC STATICWAITWR2: WAITWR Position  */\r
+#define EMC_STATICWAITWR2_WAITWR_Msk                          (0x1fUL << EMC_STATICWAITWR2_WAITWR_Pos)                  /*!< EMC STATICWAITWR2: WAITWR Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITTURN2  --------------------------------------\r
+#define EMC_STATICWAITTURN2_WAITTURN_Pos                      0                                                         /*!< EMC STATICWAITTURN2: WAITTURN Position */\r
+#define EMC_STATICWAITTURN2_WAITTURN_Msk                      (0x0fUL << EMC_STATICWAITTURN2_WAITTURN_Pos)              /*!< EMC STATICWAITTURN2: WAITTURN Mask  */\r
+\r
+// ------------------------------------  EMC_STATICCONFIG3  ---------------------------------------\r
+#define EMC_STATICCONFIG3_MW_Pos                              0                                                         /*!< EMC STATICCONFIG3: MW Position      */\r
+#define EMC_STATICCONFIG3_MW_Msk                              (0x03UL << EMC_STATICCONFIG3_MW_Pos)                      /*!< EMC STATICCONFIG3: MW Mask          */\r
+#define EMC_STATICCONFIG3_PM_Pos                              3                                                         /*!< EMC STATICCONFIG3: PM Position      */\r
+#define EMC_STATICCONFIG3_PM_Msk                              (0x01UL << EMC_STATICCONFIG3_PM_Pos)                      /*!< EMC STATICCONFIG3: PM Mask          */\r
+#define EMC_STATICCONFIG3_PC_Pos                              6                                                         /*!< EMC STATICCONFIG3: PC Position      */\r
+#define EMC_STATICCONFIG3_PC_Msk                              (0x01UL << EMC_STATICCONFIG3_PC_Pos)                      /*!< EMC STATICCONFIG3: PC Mask          */\r
+#define EMC_STATICCONFIG3_PB_Pos                              7                                                         /*!< EMC STATICCONFIG3: PB Position      */\r
+#define EMC_STATICCONFIG3_PB_Msk                              (0x01UL << EMC_STATICCONFIG3_PB_Pos)                      /*!< EMC STATICCONFIG3: PB Mask          */\r
+#define EMC_STATICCONFIG3_EW_Pos                              8                                                         /*!< EMC STATICCONFIG3: EW Position      */\r
+#define EMC_STATICCONFIG3_EW_Msk                              (0x01UL << EMC_STATICCONFIG3_EW_Pos)                      /*!< EMC STATICCONFIG3: EW Mask          */\r
+#define EMC_STATICCONFIG3_B_Pos                               19                                                        /*!< EMC STATICCONFIG3: B Position       */\r
+#define EMC_STATICCONFIG3_B_Msk                               (0x01UL << EMC_STATICCONFIG3_B_Pos)                       /*!< EMC STATICCONFIG3: B Mask           */\r
+#define EMC_STATICCONFIG3_P_Pos                               20                                                        /*!< EMC STATICCONFIG3: P Position       */\r
+#define EMC_STATICCONFIG3_P_Msk                               (0x01UL << EMC_STATICCONFIG3_P_Pos)                       /*!< EMC STATICCONFIG3: P Mask           */\r
+\r
+// -----------------------------------  EMC_STATICWAITWEN3  ---------------------------------------\r
+#define EMC_STATICWAITWEN3_WAITWEN_Pos                        0                                                         /*!< EMC STATICWAITWEN3: WAITWEN Position */\r
+#define EMC_STATICWAITWEN3_WAITWEN_Msk                        (0x0fUL << EMC_STATICWAITWEN3_WAITWEN_Pos)                /*!< EMC STATICWAITWEN3: WAITWEN Mask    */\r
+\r
+// -----------------------------------  EMC_STATICWAITOEN3  ---------------------------------------\r
+#define EMC_STATICWAITOEN3_WAITOEN_Pos                        0                                                         /*!< EMC STATICWAITOEN3: WAITOEN Position */\r
+#define EMC_STATICWAITOEN3_WAITOEN_Msk                        (0x0fUL << EMC_STATICWAITOEN3_WAITOEN_Pos)                /*!< EMC STATICWAITOEN3: WAITOEN Mask    */\r
+\r
+// ------------------------------------  EMC_STATICWAITRD3  ---------------------------------------\r
+#define EMC_STATICWAITRD3_WAITRD_Pos                          0                                                         /*!< EMC STATICWAITRD3: WAITRD Position  */\r
+#define EMC_STATICWAITRD3_WAITRD_Msk                          (0x1fUL << EMC_STATICWAITRD3_WAITRD_Pos)                  /*!< EMC STATICWAITRD3: WAITRD Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITPAG3  ---------------------------------------\r
+#define EMC_STATICWAITPAG3_WAITPAGE_Pos                       0                                                         /*!< EMC STATICWAITPAG3: WAITPAGE Position */\r
+#define EMC_STATICWAITPAG3_WAITPAGE_Msk                       (0x1fUL << EMC_STATICWAITPAG3_WAITPAGE_Pos)               /*!< EMC STATICWAITPAG3: WAITPAGE Mask   */\r
+\r
+// ------------------------------------  EMC_STATICWAITWR3  ---------------------------------------\r
+#define EMC_STATICWAITWR3_WAITWR_Pos                          0                                                         /*!< EMC STATICWAITWR3: WAITWR Position  */\r
+#define EMC_STATICWAITWR3_WAITWR_Msk                          (0x1fUL << EMC_STATICWAITWR3_WAITWR_Pos)                  /*!< EMC STATICWAITWR3: WAITWR Mask      */\r
+\r
+// -----------------------------------  EMC_STATICWAITTURN3  --------------------------------------\r
+#define EMC_STATICWAITTURN3_WAITTURN_Pos                      0                                                         /*!< EMC STATICWAITTURN3: WAITTURN Position */\r
+#define EMC_STATICWAITTURN3_WAITTURN_Msk                      (0x0fUL << EMC_STATICWAITTURN3_WAITTURN_Pos)              /*!< EMC STATICWAITTURN3: WAITTURN Mask  */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 USB0 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -------------------------------------  USB0_CAPLENGTH  -----------------------------------------\r
+#define USB0_CAPLENGTH_CAPLENGTH_Pos                          0                                                         /*!< USB0 CAPLENGTH: CAPLENGTH Position  */\r
+#define USB0_CAPLENGTH_CAPLENGTH_Msk                          (0x000000ffUL << USB0_CAPLENGTH_CAPLENGTH_Pos)            /*!< USB0 CAPLENGTH: CAPLENGTH Mask      */\r
+#define USB0_CAPLENGTH_HCIVERSION_Pos                         8                                                         /*!< USB0 CAPLENGTH: HCIVERSION Position */\r
+#define USB0_CAPLENGTH_HCIVERSION_Msk                         (0x0000ffffUL << USB0_CAPLENGTH_HCIVERSION_Pos)           /*!< USB0 CAPLENGTH: HCIVERSION Mask     */\r
+\r
+// -------------------------------------  USB0_HCSPARAMS  -----------------------------------------\r
+#define USB0_HCSPARAMS_N_PORTS_Pos                            0                                                         /*!< USB0 HCSPARAMS: N_PORTS Position    */\r
+#define USB0_HCSPARAMS_N_PORTS_Msk                            (0x0fUL << USB0_HCSPARAMS_N_PORTS_Pos)                    /*!< USB0 HCSPARAMS: N_PORTS Mask        */\r
+#define USB0_HCSPARAMS_PPC_Pos                                4                                                         /*!< USB0 HCSPARAMS: PPC Position        */\r
+#define USB0_HCSPARAMS_PPC_Msk                                (0x01UL << USB0_HCSPARAMS_PPC_Pos)                        /*!< USB0 HCSPARAMS: PPC Mask            */\r
+#define USB0_HCSPARAMS_N_PCC_Pos                              8                                                         /*!< USB0 HCSPARAMS: N_PCC Position      */\r
+#define USB0_HCSPARAMS_N_PCC_Msk                              (0x0fUL << USB0_HCSPARAMS_N_PCC_Pos)                      /*!< USB0 HCSPARAMS: N_PCC Mask          */\r
+#define USB0_HCSPARAMS_N_CC_Pos                               12                                                        /*!< USB0 HCSPARAMS: N_CC Position       */\r
+#define USB0_HCSPARAMS_N_CC_Msk                               (0x0fUL << USB0_HCSPARAMS_N_CC_Pos)                       /*!< USB0 HCSPARAMS: N_CC Mask           */\r
+#define USB0_HCSPARAMS_PI_Pos                                 16                                                        /*!< USB0 HCSPARAMS: PI Position         */\r
+#define USB0_HCSPARAMS_PI_Msk                                 (0x01UL << USB0_HCSPARAMS_PI_Pos)                         /*!< USB0 HCSPARAMS: PI Mask             */\r
+#define USB0_HCSPARAMS_N_PTT_Pos                              20                                                        /*!< USB0 HCSPARAMS: N_PTT Position      */\r
+#define USB0_HCSPARAMS_N_PTT_Msk                              (0x0fUL << USB0_HCSPARAMS_N_PTT_Pos)                      /*!< USB0 HCSPARAMS: N_PTT Mask          */\r
+#define USB0_HCSPARAMS_N_TT_Pos                               24                                                        /*!< USB0 HCSPARAMS: N_TT Position       */\r
+#define USB0_HCSPARAMS_N_TT_Msk                               (0x0fUL << USB0_HCSPARAMS_N_TT_Pos)                       /*!< USB0 HCSPARAMS: N_TT Mask           */\r
+\r
+// -------------------------------------  USB0_HCCPARAMS  -----------------------------------------\r
+#define USB0_HCCPARAMS_ADC_Pos                                0                                                         /*!< USB0 HCCPARAMS: ADC Position        */\r
+#define USB0_HCCPARAMS_ADC_Msk                                (0x01UL << USB0_HCCPARAMS_ADC_Pos)                        /*!< USB0 HCCPARAMS: ADC Mask            */\r
+#define USB0_HCCPARAMS_PFL_Pos                                1                                                         /*!< USB0 HCCPARAMS: PFL Position        */\r
+#define USB0_HCCPARAMS_PFL_Msk                                (0x01UL << USB0_HCCPARAMS_PFL_Pos)                        /*!< USB0 HCCPARAMS: PFL Mask            */\r
+#define USB0_HCCPARAMS_ASP_Pos                                2                                                         /*!< USB0 HCCPARAMS: ASP Position        */\r
+#define USB0_HCCPARAMS_ASP_Msk                                (0x01UL << USB0_HCCPARAMS_ASP_Pos)                        /*!< USB0 HCCPARAMS: ASP Mask            */\r
+#define USB0_HCCPARAMS_IST_Pos                                4                                                         /*!< USB0 HCCPARAMS: IST Position        */\r
+#define USB0_HCCPARAMS_IST_Msk                                (0x0fUL << USB0_HCCPARAMS_IST_Pos)                        /*!< USB0 HCCPARAMS: IST Mask            */\r
+#define USB0_HCCPARAMS_EECP_Pos                               8                                                         /*!< USB0 HCCPARAMS: EECP Position       */\r
+#define USB0_HCCPARAMS_EECP_Msk                               (0x000000ffUL << USB0_HCCPARAMS_EECP_Pos)                 /*!< USB0 HCCPARAMS: EECP Mask           */\r
+\r
+// -------------------------------------  USB0_DCIVERSION  ----------------------------------------\r
+#define USB0_DCIVERSION_DCIVERSION_Pos                        0                                                         /*!< USB0 DCIVERSION: DCIVERSION Position */\r
+#define USB0_DCIVERSION_DCIVERSION_Msk                        (0x0000ffffUL << USB0_DCIVERSION_DCIVERSION_Pos)          /*!< USB0 DCIVERSION: DCIVERSION Mask    */\r
+\r
+// --------------------------------------  USB0_USBCMD_D  -----------------------------------------\r
+#define USB0_USBCMD_D_RS_Pos                                  0                                                         /*!< USB0 USBCMD_D: RS Position          */\r
+#define USB0_USBCMD_D_RS_Msk                                  (0x01UL << USB0_USBCMD_D_RS_Pos)                          /*!< USB0 USBCMD_D: RS Mask              */\r
+#define USB0_USBCMD_D_RST_Pos                                 1                                                         /*!< USB0 USBCMD_D: RST Position         */\r
+#define USB0_USBCMD_D_RST_Msk                                 (0x01UL << USB0_USBCMD_D_RST_Pos)                         /*!< USB0 USBCMD_D: RST Mask             */\r
+#define USB0_USBCMD_D_SUTW_Pos                                13                                                        /*!< USB0 USBCMD_D: SUTW Position        */\r
+#define USB0_USBCMD_D_SUTW_Msk                                (0x01UL << USB0_USBCMD_D_SUTW_Pos)                        /*!< USB0 USBCMD_D: SUTW Mask            */\r
+#define USB0_USBCMD_D_ATDTW_Pos                               14                                                        /*!< USB0 USBCMD_D: ATDTW Position       */\r
+#define USB0_USBCMD_D_ATDTW_Msk                               (0x01UL << USB0_USBCMD_D_ATDTW_Pos)                       /*!< USB0 USBCMD_D: ATDTW Mask           */\r
+#define USB0_USBCMD_D_ITC_Pos                                 16                                                        /*!< USB0 USBCMD_D: ITC Position         */\r
+#define USB0_USBCMD_D_ITC_Msk                                 (0x000000ffUL << USB0_USBCMD_D_ITC_Pos)                   /*!< USB0 USBCMD_D: ITC Mask             */\r
+\r
+// --------------------------------------  USB0_USBCMD_H  -----------------------------------------\r
+#define USB0_USBCMD_H_RS_Pos                                  0                                                         /*!< USB0 USBCMD_H: RS Position          */\r
+#define USB0_USBCMD_H_RS_Msk                                  (0x01UL << USB0_USBCMD_H_RS_Pos)                          /*!< USB0 USBCMD_H: RS Mask              */\r
+#define USB0_USBCMD_H_RST_Pos                                 1                                                         /*!< USB0 USBCMD_H: RST Position         */\r
+#define USB0_USBCMD_H_RST_Msk                                 (0x01UL << USB0_USBCMD_H_RST_Pos)                         /*!< USB0 USBCMD_H: RST Mask             */\r
+#define USB0_USBCMD_H_FS0_Pos                                 2                                                         /*!< USB0 USBCMD_H: FS0 Position         */\r
+#define USB0_USBCMD_H_FS0_Msk                                 (0x01UL << USB0_USBCMD_H_FS0_Pos)                         /*!< USB0 USBCMD_H: FS0 Mask             */\r
+#define USB0_USBCMD_H_FS1_Pos                                 3                                                         /*!< USB0 USBCMD_H: FS1 Position         */\r
+#define USB0_USBCMD_H_FS1_Msk                                 (0x01UL << USB0_USBCMD_H_FS1_Pos)                         /*!< USB0 USBCMD_H: FS1 Mask             */\r
+#define USB0_USBCMD_H_PSE_Pos                                 4                                                         /*!< USB0 USBCMD_H: PSE Position         */\r
+#define USB0_USBCMD_H_PSE_Msk                                 (0x01UL << USB0_USBCMD_H_PSE_Pos)                         /*!< USB0 USBCMD_H: PSE Mask             */\r
+#define USB0_USBCMD_H_ASE_Pos                                 5                                                         /*!< USB0 USBCMD_H: ASE Position         */\r
+#define USB0_USBCMD_H_ASE_Msk                                 (0x01UL << USB0_USBCMD_H_ASE_Pos)                         /*!< USB0 USBCMD_H: ASE Mask             */\r
+#define USB0_USBCMD_H_IAA_Pos                                 6                                                         /*!< USB0 USBCMD_H: IAA Position         */\r
+#define USB0_USBCMD_H_IAA_Msk                                 (0x01UL << USB0_USBCMD_H_IAA_Pos)                         /*!< USB0 USBCMD_H: IAA Mask             */\r
+#define USB0_USBCMD_H_ASP1_0_Pos                              8                                                         /*!< USB0 USBCMD_H: ASP1_0 Position      */\r
+#define USB0_USBCMD_H_ASP1_0_Msk                              (0x03UL << USB0_USBCMD_H_ASP1_0_Pos)                      /*!< USB0 USBCMD_H: ASP1_0 Mask          */\r
+#define USB0_USBCMD_H_ASPE_Pos                                11                                                        /*!< USB0 USBCMD_H: ASPE Position        */\r
+#define USB0_USBCMD_H_ASPE_Msk                                (0x01UL << USB0_USBCMD_H_ASPE_Pos)                        /*!< USB0 USBCMD_H: ASPE Mask            */\r
+#define USB0_USBCMD_H_FS2_Pos                                 15                                                        /*!< USB0 USBCMD_H: FS2 Position         */\r
+#define USB0_USBCMD_H_FS2_Msk                                 (0x01UL << USB0_USBCMD_H_FS2_Pos)                         /*!< USB0 USBCMD_H: FS2 Mask             */\r
+#define USB0_USBCMD_H_ITC_Pos                                 16                                                        /*!< USB0 USBCMD_H: ITC Position         */\r
+#define USB0_USBCMD_H_ITC_Msk                                 (0x000000ffUL << USB0_USBCMD_H_ITC_Pos)                   /*!< USB0 USBCMD_H: ITC Mask             */\r
+\r
+// --------------------------------------  USB0_USBSTS_D  -----------------------------------------\r
+#define USB0_USBSTS_D_UI_Pos                                  0                                                         /*!< USB0 USBSTS_D: UI Position          */\r
+#define USB0_USBSTS_D_UI_Msk                                  (0x01UL << USB0_USBSTS_D_UI_Pos)                          /*!< USB0 USBSTS_D: UI Mask              */\r
+#define USB0_USBSTS_D_UEI_Pos                                 1                                                         /*!< USB0 USBSTS_D: UEI Position         */\r
+#define USB0_USBSTS_D_UEI_Msk                                 (0x01UL << USB0_USBSTS_D_UEI_Pos)                         /*!< USB0 USBSTS_D: UEI Mask             */\r
+#define USB0_USBSTS_D_PCI_Pos                                 2                                                         /*!< USB0 USBSTS_D: PCI Position         */\r
+#define USB0_USBSTS_D_PCI_Msk                                 (0x01UL << USB0_USBSTS_D_PCI_Pos)                         /*!< USB0 USBSTS_D: PCI Mask             */\r
+#define USB0_USBSTS_D_AAI_Pos                                 5                                                         /*!< USB0 USBSTS_D: AAI Position         */\r
+#define USB0_USBSTS_D_AAI_Msk                                 (0x01UL << USB0_USBSTS_D_AAI_Pos)                         /*!< USB0 USBSTS_D: AAI Mask             */\r
+#define USB0_USBSTS_D_URI_Pos                                 6                                                         /*!< USB0 USBSTS_D: URI Position         */\r
+#define USB0_USBSTS_D_URI_Msk                                 (0x01UL << USB0_USBSTS_D_URI_Pos)                         /*!< USB0 USBSTS_D: URI Mask             */\r
+#define USB0_USBSTS_D_SRI_Pos                                 7                                                         /*!< USB0 USBSTS_D: SRI Position         */\r
+#define USB0_USBSTS_D_SRI_Msk                                 (0x01UL << USB0_USBSTS_D_SRI_Pos)                         /*!< USB0 USBSTS_D: SRI Mask             */\r
+#define USB0_USBSTS_D_SLI_Pos                                 8                                                         /*!< USB0 USBSTS_D: SLI Position         */\r
+#define USB0_USBSTS_D_SLI_Msk                                 (0x01UL << USB0_USBSTS_D_SLI_Pos)                         /*!< USB0 USBSTS_D: SLI Mask             */\r
+#define USB0_USBSTS_D_NAKI_Pos                                16                                                        /*!< USB0 USBSTS_D: NAKI Position        */\r
+#define USB0_USBSTS_D_NAKI_Msk                                (0x01UL << USB0_USBSTS_D_NAKI_Pos)                        /*!< USB0 USBSTS_D: NAKI Mask            */\r
+\r
+// --------------------------------------  USB0_USBSTS_H  -----------------------------------------\r
+#define USB0_USBSTS_H_UI_Pos                                  0                                                         /*!< USB0 USBSTS_H: UI Position          */\r
+#define USB0_USBSTS_H_UI_Msk                                  (0x01UL << USB0_USBSTS_H_UI_Pos)                          /*!< USB0 USBSTS_H: UI Mask              */\r
+#define USB0_USBSTS_H_UEI_Pos                                 1                                                         /*!< USB0 USBSTS_H: UEI Position         */\r
+#define USB0_USBSTS_H_UEI_Msk                                 (0x01UL << USB0_USBSTS_H_UEI_Pos)                         /*!< USB0 USBSTS_H: UEI Mask             */\r
+#define USB0_USBSTS_H_PCI_Pos                                 2                                                         /*!< USB0 USBSTS_H: PCI Position         */\r
+#define USB0_USBSTS_H_PCI_Msk                                 (0x01UL << USB0_USBSTS_H_PCI_Pos)                         /*!< USB0 USBSTS_H: PCI Mask             */\r
+#define USB0_USBSTS_H_FRI_Pos                                 3                                                         /*!< USB0 USBSTS_H: FRI Position         */\r
+#define USB0_USBSTS_H_FRI_Msk                                 (0x01UL << USB0_USBSTS_H_FRI_Pos)                         /*!< USB0 USBSTS_H: FRI Mask             */\r
+#define USB0_USBSTS_H_AAI_Pos                                 5                                                         /*!< USB0 USBSTS_H: AAI Position         */\r
+#define USB0_USBSTS_H_AAI_Msk                                 (0x01UL << USB0_USBSTS_H_AAI_Pos)                         /*!< USB0 USBSTS_H: AAI Mask             */\r
+#define USB0_USBSTS_H_SRI_Pos                                 7                                                         /*!< USB0 USBSTS_H: SRI Position         */\r
+#define USB0_USBSTS_H_SRI_Msk                                 (0x01UL << USB0_USBSTS_H_SRI_Pos)                         /*!< USB0 USBSTS_H: SRI Mask             */\r
+#define USB0_USBSTS_H_HCH_Pos                                 12                                                        /*!< USB0 USBSTS_H: HCH Position         */\r
+#define USB0_USBSTS_H_HCH_Msk                                 (0x01UL << USB0_USBSTS_H_HCH_Pos)                         /*!< USB0 USBSTS_H: HCH Mask             */\r
+#define USB0_USBSTS_H_RCL_Pos                                 13                                                        /*!< USB0 USBSTS_H: RCL Position         */\r
+#define USB0_USBSTS_H_RCL_Msk                                 (0x01UL << USB0_USBSTS_H_RCL_Pos)                         /*!< USB0 USBSTS_H: RCL Mask             */\r
+#define USB0_USBSTS_H_PS_Pos                                  14                                                        /*!< USB0 USBSTS_H: PS Position          */\r
+#define USB0_USBSTS_H_PS_Msk                                  (0x01UL << USB0_USBSTS_H_PS_Pos)                          /*!< USB0 USBSTS_H: PS Mask              */\r
+#define USB0_USBSTS_H_AS_Pos                                  15                                                        /*!< USB0 USBSTS_H: AS Position          */\r
+#define USB0_USBSTS_H_AS_Msk                                  (0x01UL << USB0_USBSTS_H_AS_Pos)                          /*!< USB0 USBSTS_H: AS Mask              */\r
+#define USB0_USBSTS_H_UAI_Pos                                 18                                                        /*!< USB0 USBSTS_H: UAI Position         */\r
+#define USB0_USBSTS_H_UAI_Msk                                 (0x01UL << USB0_USBSTS_H_UAI_Pos)                         /*!< USB0 USBSTS_H: UAI Mask             */\r
+#define USB0_USBSTS_H_UPI_Pos                                 19                                                        /*!< USB0 USBSTS_H: UPI Position         */\r
+#define USB0_USBSTS_H_UPI_Msk                                 (0x01UL << USB0_USBSTS_H_UPI_Pos)                         /*!< USB0 USBSTS_H: UPI Mask             */\r
+\r
+// -------------------------------------  USB0_USBINTR_D  -----------------------------------------\r
+#define USB0_USBINTR_D_UE_Pos                                 0                                                         /*!< USB0 USBINTR_D: UE Position         */\r
+#define USB0_USBINTR_D_UE_Msk                                 (0x01UL << USB0_USBINTR_D_UE_Pos)                         /*!< USB0 USBINTR_D: UE Mask             */\r
+#define USB0_USBINTR_D_UEE_Pos                                1                                                         /*!< USB0 USBINTR_D: UEE Position        */\r
+#define USB0_USBINTR_D_UEE_Msk                                (0x01UL << USB0_USBINTR_D_UEE_Pos)                        /*!< USB0 USBINTR_D: UEE Mask            */\r
+#define USB0_USBINTR_D_PCE_Pos                                2                                                         /*!< USB0 USBINTR_D: PCE Position        */\r
+#define USB0_USBINTR_D_PCE_Msk                                (0x01UL << USB0_USBINTR_D_PCE_Pos)                        /*!< USB0 USBINTR_D: PCE Mask            */\r
+#define USB0_USBINTR_D_URE_Pos                                6                                                         /*!< USB0 USBINTR_D: URE Position        */\r
+#define USB0_USBINTR_D_URE_Msk                                (0x01UL << USB0_USBINTR_D_URE_Pos)                        /*!< USB0 USBINTR_D: URE Mask            */\r
+#define USB0_USBINTR_D_SRE_Pos                                7                                                         /*!< USB0 USBINTR_D: SRE Position        */\r
+#define USB0_USBINTR_D_SRE_Msk                                (0x01UL << USB0_USBINTR_D_SRE_Pos)                        /*!< USB0 USBINTR_D: SRE Mask            */\r
+#define USB0_USBINTR_D_SLE_Pos                                8                                                         /*!< USB0 USBINTR_D: SLE Position        */\r
+#define USB0_USBINTR_D_SLE_Msk                                (0x01UL << USB0_USBINTR_D_SLE_Pos)                        /*!< USB0 USBINTR_D: SLE Mask            */\r
+#define USB0_USBINTR_D_NAKE_Pos                               16                                                        /*!< USB0 USBINTR_D: NAKE Position       */\r
+#define USB0_USBINTR_D_NAKE_Msk                               (0x01UL << USB0_USBINTR_D_NAKE_Pos)                       /*!< USB0 USBINTR_D: NAKE Mask           */\r
+\r
+// -------------------------------------  USB0_USBINTR_H  -----------------------------------------\r
+#define USB0_USBINTR_H_UE_Pos                                 0                                                         /*!< USB0 USBINTR_H: UE Position         */\r
+#define USB0_USBINTR_H_UE_Msk                                 (0x01UL << USB0_USBINTR_H_UE_Pos)                         /*!< USB0 USBINTR_H: UE Mask             */\r
+#define USB0_USBINTR_H_UEE_Pos                                1                                                         /*!< USB0 USBINTR_H: UEE Position        */\r
+#define USB0_USBINTR_H_UEE_Msk                                (0x01UL << USB0_USBINTR_H_UEE_Pos)                        /*!< USB0 USBINTR_H: UEE Mask            */\r
+#define USB0_USBINTR_H_PCE_Pos                                2                                                         /*!< USB0 USBINTR_H: PCE Position        */\r
+#define USB0_USBINTR_H_PCE_Msk                                (0x01UL << USB0_USBINTR_H_PCE_Pos)                        /*!< USB0 USBINTR_H: PCE Mask            */\r
+#define USB0_USBINTR_H_FRE_Pos                                3                                                         /*!< USB0 USBINTR_H: FRE Position        */\r
+#define USB0_USBINTR_H_FRE_Msk                                (0x01UL << USB0_USBINTR_H_FRE_Pos)                        /*!< USB0 USBINTR_H: FRE Mask            */\r
+#define USB0_USBINTR_H_AAE_Pos                                5                                                         /*!< USB0 USBINTR_H: AAE Position        */\r
+#define USB0_USBINTR_H_AAE_Msk                                (0x01UL << USB0_USBINTR_H_AAE_Pos)                        /*!< USB0 USBINTR_H: AAE Mask            */\r
+#define USB0_USBINTR_H_SRE_Pos                                7                                                         /*!< USB0 USBINTR_H: SRE Position        */\r
+#define USB0_USBINTR_H_SRE_Msk                                (0x01UL << USB0_USBINTR_H_SRE_Pos)                        /*!< USB0 USBINTR_H: SRE Mask            */\r
+#define USB0_USBINTR_H_UAIE_Pos                               18                                                        /*!< USB0 USBINTR_H: UAIE Position       */\r
+#define USB0_USBINTR_H_UAIE_Msk                               (0x01UL << USB0_USBINTR_H_UAIE_Pos)                       /*!< USB0 USBINTR_H: UAIE Mask           */\r
+#define USB0_USBINTR_H_UPIA_Pos                               19                                                        /*!< USB0 USBINTR_H: UPIA Position       */\r
+#define USB0_USBINTR_H_UPIA_Msk                               (0x01UL << USB0_USBINTR_H_UPIA_Pos)                       /*!< USB0 USBINTR_H: UPIA Mask           */\r
+\r
+// -------------------------------------  USB0_FRINDEX_D  -----------------------------------------\r
+#define USB0_FRINDEX_D_FRINDEX2_0_Pos                         0                                                         /*!< USB0 FRINDEX_D: FRINDEX2_0 Position */\r
+#define USB0_FRINDEX_D_FRINDEX2_0_Msk                         (0x07UL << USB0_FRINDEX_D_FRINDEX2_0_Pos)                 /*!< USB0 FRINDEX_D: FRINDEX2_0 Mask     */\r
+#define USB0_FRINDEX_D_FRINDEX13_3_Pos                        3                                                         /*!< USB0 FRINDEX_D: FRINDEX13_3 Position */\r
+#define USB0_FRINDEX_D_FRINDEX13_3_Msk                        (0x000007ffUL << USB0_FRINDEX_D_FRINDEX13_3_Pos)          /*!< USB0 FRINDEX_D: FRINDEX13_3 Mask    */\r
+\r
+// -------------------------------------  USB0_FRINDEX_H  -----------------------------------------\r
+#define USB0_FRINDEX_H_FRINDEX2_0_Pos                         0                                                         /*!< USB0 FRINDEX_H: FRINDEX2_0 Position */\r
+#define USB0_FRINDEX_H_FRINDEX2_0_Msk                         (0x07UL << USB0_FRINDEX_H_FRINDEX2_0_Pos)                 /*!< USB0 FRINDEX_H: FRINDEX2_0 Mask     */\r
+#define USB0_FRINDEX_H_FRINDEX12_3_Pos                        3                                                         /*!< USB0 FRINDEX_H: FRINDEX12_3 Position */\r
+#define USB0_FRINDEX_H_FRINDEX12_3_Msk                        (0x000003ffUL << USB0_FRINDEX_H_FRINDEX12_3_Pos)          /*!< USB0 FRINDEX_H: FRINDEX12_3 Mask    */\r
+\r
+// -------------------------------------  USB0_DEVICEADDR  ----------------------------------------\r
+#define USB0_DEVICEADDR_USBADRA_Pos                           24                                                        /*!< USB0 DEVICEADDR: USBADRA Position   */\r
+#define USB0_DEVICEADDR_USBADRA_Msk                           (0x01UL << USB0_DEVICEADDR_USBADRA_Pos)                   /*!< USB0 DEVICEADDR: USBADRA Mask       */\r
+#define USB0_DEVICEADDR_USBADR_Pos                            25                                                        /*!< USB0 DEVICEADDR: USBADR Position    */\r
+#define USB0_DEVICEADDR_USBADR_Msk                            (0x7fUL << USB0_DEVICEADDR_USBADR_Pos)                    /*!< USB0 DEVICEADDR: USBADR Mask        */\r
+\r
+// ----------------------------------  USB0_PERIODICLISTBASE  -------------------------------------\r
+#define USB0_PERIODICLISTBASE_PERBASE31_12_Pos                12                                                        /*!< USB0 PERIODICLISTBASE: PERBASE31_12 Position */\r
+#define USB0_PERIODICLISTBASE_PERBASE31_12_Msk                (0x000fffffUL << USB0_PERIODICLISTBASE_PERBASE31_12_Pos)  /*!< USB0 PERIODICLISTBASE: PERBASE31_12 Mask */\r
+\r
+// ----------------------------------  USB0_ENDPOINTLISTADDR  -------------------------------------\r
+#define USB0_ENDPOINTLISTADDR_EPBASE31_11_Pos                 11                                                        /*!< USB0 ENDPOINTLISTADDR: EPBASE31_11 Position */\r
+#define USB0_ENDPOINTLISTADDR_EPBASE31_11_Msk                 (0x001fffffUL << USB0_ENDPOINTLISTADDR_EPBASE31_11_Pos)   /*!< USB0 ENDPOINTLISTADDR: EPBASE31_11 Mask */\r
+\r
+// -----------------------------------  USB0_ASYNCLISTADDR  ---------------------------------------\r
+#define USB0_ASYNCLISTADDR_ASYBASE31_5_Pos                    5                                                         /*!< USB0 ASYNCLISTADDR: ASYBASE31_5 Position */\r
+#define USB0_ASYNCLISTADDR_ASYBASE31_5_Msk                    (0x07ffffffUL << USB0_ASYNCLISTADDR_ASYBASE31_5_Pos)      /*!< USB0 ASYNCLISTADDR: ASYBASE31_5 Mask */\r
+\r
+// ---------------------------------------  USB0_TTCTRL  ------------------------------------------\r
+#define USB0_TTCTRL_TTHA_Pos                                  24                                                        /*!< USB0 TTCTRL: TTHA Position          */\r
+#define USB0_TTCTRL_TTHA_Msk                                  (0x7fUL << USB0_TTCTRL_TTHA_Pos)                          /*!< USB0 TTCTRL: TTHA Mask              */\r
+\r
+// -------------------------------------  USB0_BURSTSIZE  -----------------------------------------\r
+#define USB0_BURSTSIZE_RXPBURST_Pos                           0                                                         /*!< USB0 BURSTSIZE: RXPBURST Position   */\r
+#define USB0_BURSTSIZE_RXPBURST_Msk                           (0x000000ffUL << USB0_BURSTSIZE_RXPBURST_Pos)             /*!< USB0 BURSTSIZE: RXPBURST Mask       */\r
+#define USB0_BURSTSIZE_TXPBURST_Pos                           8                                                         /*!< USB0 BURSTSIZE: TXPBURST Position   */\r
+#define USB0_BURSTSIZE_TXPBURST_Msk                           (0x000000ffUL << USB0_BURSTSIZE_TXPBURST_Pos)             /*!< USB0 BURSTSIZE: TXPBURST Mask       */\r
+\r
+// ------------------------------------  USB0_TXFILLTUNING  ---------------------------------------\r
+#define USB0_TXFILLTUNING_TXSCHOH_Pos                         0                                                         /*!< USB0 TXFILLTUNING: TXSCHOH Position */\r
+#define USB0_TXFILLTUNING_TXSCHOH_Msk                         (0x000000ffUL << USB0_TXFILLTUNING_TXSCHOH_Pos)           /*!< USB0 TXFILLTUNING: TXSCHOH Mask     */\r
+#define USB0_TXFILLTUNING_TXSCHEATLTH_Pos                     8                                                         /*!< USB0 TXFILLTUNING: TXSCHEATLTH Position */\r
+#define USB0_TXFILLTUNING_TXSCHEATLTH_Msk                     (0x1fUL << USB0_TXFILLTUNING_TXSCHEATLTH_Pos)             /*!< USB0 TXFILLTUNING: TXSCHEATLTH Mask */\r
+#define USB0_TXFILLTUNING_TXFIFOTHRES_Pos                     16                                                        /*!< USB0 TXFILLTUNING: TXFIFOTHRES Position */\r
+#define USB0_TXFILLTUNING_TXFIFOTHRES_Msk                     (0x3fUL << USB0_TXFILLTUNING_TXFIFOTHRES_Pos)             /*!< USB0 TXFILLTUNING: TXFIFOTHRES Mask */\r
+\r
+// -------------------------------------  USB0_BINTERVAL  -----------------------------------------\r
+#define USB0_BINTERVAL_BINT_Pos                               0                                                         /*!< USB0 BINTERVAL: BINT Position       */\r
+#define USB0_BINTERVAL_BINT_Msk                               (0x0fUL << USB0_BINTERVAL_BINT_Pos)                       /*!< USB0 BINTERVAL: BINT Mask           */\r
+\r
+// --------------------------------------  USB0_ENDPTNAK  -----------------------------------------\r
+#define USB0_ENDPTNAK_EPRN0_Pos                               0                                                         /*!< USB0 ENDPTNAK: EPRN0 Position       */\r
+#define USB0_ENDPTNAK_EPRN0_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN0_Pos)                       /*!< USB0 ENDPTNAK: EPRN0 Mask           */\r
+#define USB0_ENDPTNAK_EPRN1_Pos                               1                                                         /*!< USB0 ENDPTNAK: EPRN1 Position       */\r
+#define USB0_ENDPTNAK_EPRN1_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN1_Pos)                       /*!< USB0 ENDPTNAK: EPRN1 Mask           */\r
+#define USB0_ENDPTNAK_EPRN2_Pos                               2                                                         /*!< USB0 ENDPTNAK: EPRN2 Position       */\r
+#define USB0_ENDPTNAK_EPRN2_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN2_Pos)                       /*!< USB0 ENDPTNAK: EPRN2 Mask           */\r
+#define USB0_ENDPTNAK_EPRN3_Pos                               3                                                         /*!< USB0 ENDPTNAK: EPRN3 Position       */\r
+#define USB0_ENDPTNAK_EPRN3_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN3_Pos)                       /*!< USB0 ENDPTNAK: EPRN3 Mask           */\r
+#define USB0_ENDPTNAK_EPRN4_Pos                               4                                                         /*!< USB0 ENDPTNAK: EPRN4 Position       */\r
+#define USB0_ENDPTNAK_EPRN4_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN4_Pos)                       /*!< USB0 ENDPTNAK: EPRN4 Mask           */\r
+#define USB0_ENDPTNAK_EPRN5_Pos                               5                                                         /*!< USB0 ENDPTNAK: EPRN5 Position       */\r
+#define USB0_ENDPTNAK_EPRN5_Msk                               (0x01UL << USB0_ENDPTNAK_EPRN5_Pos)                       /*!< USB0 ENDPTNAK: EPRN5 Mask           */\r
+#define USB0_ENDPTNAK_EPTN0_Pos                               16                                                        /*!< USB0 ENDPTNAK: EPTN0 Position       */\r
+#define USB0_ENDPTNAK_EPTN0_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN0_Pos)                       /*!< USB0 ENDPTNAK: EPTN0 Mask           */\r
+#define USB0_ENDPTNAK_EPTN1_Pos                               17                                                        /*!< USB0 ENDPTNAK: EPTN1 Position       */\r
+#define USB0_ENDPTNAK_EPTN1_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN1_Pos)                       /*!< USB0 ENDPTNAK: EPTN1 Mask           */\r
+#define USB0_ENDPTNAK_EPTN2_Pos                               18                                                        /*!< USB0 ENDPTNAK: EPTN2 Position       */\r
+#define USB0_ENDPTNAK_EPTN2_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN2_Pos)                       /*!< USB0 ENDPTNAK: EPTN2 Mask           */\r
+#define USB0_ENDPTNAK_EPTN3_Pos                               19                                                        /*!< USB0 ENDPTNAK: EPTN3 Position       */\r
+#define USB0_ENDPTNAK_EPTN3_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN3_Pos)                       /*!< USB0 ENDPTNAK: EPTN3 Mask           */\r
+#define USB0_ENDPTNAK_EPTN4_Pos                               20                                                        /*!< USB0 ENDPTNAK: EPTN4 Position       */\r
+#define USB0_ENDPTNAK_EPTN4_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN4_Pos)                       /*!< USB0 ENDPTNAK: EPTN4 Mask           */\r
+#define USB0_ENDPTNAK_EPTN5_Pos                               21                                                        /*!< USB0 ENDPTNAK: EPTN5 Position       */\r
+#define USB0_ENDPTNAK_EPTN5_Msk                               (0x01UL << USB0_ENDPTNAK_EPTN5_Pos)                       /*!< USB0 ENDPTNAK: EPTN5 Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTNAKEN  ----------------------------------------\r
+#define USB0_ENDPTNAKEN_EPRNE0_Pos                            0                                                         /*!< USB0 ENDPTNAKEN: EPRNE0 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE0_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE0_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE0 Mask        */\r
+#define USB0_ENDPTNAKEN_EPRNE1_Pos                            1                                                         /*!< USB0 ENDPTNAKEN: EPRNE1 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE1_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE1_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE1 Mask        */\r
+#define USB0_ENDPTNAKEN_EPRNE2_Pos                            2                                                         /*!< USB0 ENDPTNAKEN: EPRNE2 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE2_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE2_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE2 Mask        */\r
+#define USB0_ENDPTNAKEN_EPRNE3_Pos                            3                                                         /*!< USB0 ENDPTNAKEN: EPRNE3 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE3_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE3_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE3 Mask        */\r
+#define USB0_ENDPTNAKEN_EPRNE4_Pos                            4                                                         /*!< USB0 ENDPTNAKEN: EPRNE4 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE4_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE4_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE4 Mask        */\r
+#define USB0_ENDPTNAKEN_EPRNE5_Pos                            5                                                         /*!< USB0 ENDPTNAKEN: EPRNE5 Position    */\r
+#define USB0_ENDPTNAKEN_EPRNE5_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPRNE5_Pos)                    /*!< USB0 ENDPTNAKEN: EPRNE5 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE0_Pos                            16                                                        /*!< USB0 ENDPTNAKEN: EPTNE0 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE0_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE0_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE0 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE1_Pos                            17                                                        /*!< USB0 ENDPTNAKEN: EPTNE1 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE1_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE1_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE1 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE2_Pos                            18                                                        /*!< USB0 ENDPTNAKEN: EPTNE2 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE2_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE2_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE2 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE3_Pos                            19                                                        /*!< USB0 ENDPTNAKEN: EPTNE3 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE3_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE3_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE3 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE4_Pos                            20                                                        /*!< USB0 ENDPTNAKEN: EPTNE4 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE4_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE4_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE4 Mask        */\r
+#define USB0_ENDPTNAKEN_EPTNE5_Pos                            21                                                        /*!< USB0 ENDPTNAKEN: EPTNE5 Position    */\r
+#define USB0_ENDPTNAKEN_EPTNE5_Msk                            (0x01UL << USB0_ENDPTNAKEN_EPTNE5_Pos)                    /*!< USB0 ENDPTNAKEN: EPTNE5 Mask        */\r
+\r
+// -------------------------------------  USB0_PORTSC1_D  -----------------------------------------\r
+#define USB0_PORTSC1_D_CCS_Pos                                0                                                         /*!< USB0 PORTSC1_D: CCS Position        */\r
+#define USB0_PORTSC1_D_CCS_Msk                                (0x01UL << USB0_PORTSC1_D_CCS_Pos)                        /*!< USB0 PORTSC1_D: CCS Mask            */\r
+#define USB0_PORTSC1_D_PE_Pos                                 2                                                         /*!< USB0 PORTSC1_D: PE Position         */\r
+#define USB0_PORTSC1_D_PE_Msk                                 (0x01UL << USB0_PORTSC1_D_PE_Pos)                         /*!< USB0 PORTSC1_D: PE Mask             */\r
+#define USB0_PORTSC1_D_PEC_Pos                                3                                                         /*!< USB0 PORTSC1_D: PEC Position        */\r
+#define USB0_PORTSC1_D_PEC_Msk                                (0x01UL << USB0_PORTSC1_D_PEC_Pos)                        /*!< USB0 PORTSC1_D: PEC Mask            */\r
+#define USB0_PORTSC1_D_FPR_Pos                                6                                                         /*!< USB0 PORTSC1_D: FPR Position        */\r
+#define USB0_PORTSC1_D_FPR_Msk                                (0x01UL << USB0_PORTSC1_D_FPR_Pos)                        /*!< USB0 PORTSC1_D: FPR Mask            */\r
+#define USB0_PORTSC1_D_SUSP_Pos                               7                                                         /*!< USB0 PORTSC1_D: SUSP Position       */\r
+#define USB0_PORTSC1_D_SUSP_Msk                               (0x01UL << USB0_PORTSC1_D_SUSP_Pos)                       /*!< USB0 PORTSC1_D: SUSP Mask           */\r
+#define USB0_PORTSC1_D_PR_Pos                                 8                                                         /*!< USB0 PORTSC1_D: PR Position         */\r
+#define USB0_PORTSC1_D_PR_Msk                                 (0x01UL << USB0_PORTSC1_D_PR_Pos)                         /*!< USB0 PORTSC1_D: PR Mask             */\r
+#define USB0_PORTSC1_D_HSP_Pos                                9                                                         /*!< USB0 PORTSC1_D: HSP Position        */\r
+#define USB0_PORTSC1_D_HSP_Msk                                (0x01UL << USB0_PORTSC1_D_HSP_Pos)                        /*!< USB0 PORTSC1_D: HSP Mask            */\r
+#define USB0_PORTSC1_D_PIC1_0_Pos                             14                                                        /*!< USB0 PORTSC1_D: PIC1_0 Position     */\r
+#define USB0_PORTSC1_D_PIC1_0_Msk                             (0x03UL << USB0_PORTSC1_D_PIC1_0_Pos)                     /*!< USB0 PORTSC1_D: PIC1_0 Mask         */\r
+#define USB0_PORTSC1_D_PTC3_0_Pos                             16                                                        /*!< USB0 PORTSC1_D: PTC3_0 Position     */\r
+#define USB0_PORTSC1_D_PTC3_0_Msk                             (0x0fUL << USB0_PORTSC1_D_PTC3_0_Pos)                     /*!< USB0 PORTSC1_D: PTC3_0 Mask         */\r
+#define USB0_PORTSC1_D_PHCD_Pos                               23                                                        /*!< USB0 PORTSC1_D: PHCD Position       */\r
+#define USB0_PORTSC1_D_PHCD_Msk                               (0x01UL << USB0_PORTSC1_D_PHCD_Pos)                       /*!< USB0 PORTSC1_D: PHCD Mask           */\r
+#define USB0_PORTSC1_D_PFSC_Pos                               24                                                        /*!< USB0 PORTSC1_D: PFSC Position       */\r
+#define USB0_PORTSC1_D_PFSC_Msk                               (0x01UL << USB0_PORTSC1_D_PFSC_Pos)                       /*!< USB0 PORTSC1_D: PFSC Mask           */\r
+#define USB0_PORTSC1_D_PSPD_Pos                               26                                                        /*!< USB0 PORTSC1_D: PSPD Position       */\r
+#define USB0_PORTSC1_D_PSPD_Msk                               (0x03UL << USB0_PORTSC1_D_PSPD_Pos)                       /*!< USB0 PORTSC1_D: PSPD Mask           */\r
+\r
+// -------------------------------------  USB0_PORTSC1_H  -----------------------------------------\r
+#define USB0_PORTSC1_H_CCS_Pos                                0                                                         /*!< USB0 PORTSC1_H: CCS Position        */\r
+#define USB0_PORTSC1_H_CCS_Msk                                (0x01UL << USB0_PORTSC1_H_CCS_Pos)                        /*!< USB0 PORTSC1_H: CCS Mask            */\r
+#define USB0_PORTSC1_H_CSC_Pos                                1                                                         /*!< USB0 PORTSC1_H: CSC Position        */\r
+#define USB0_PORTSC1_H_CSC_Msk                                (0x01UL << USB0_PORTSC1_H_CSC_Pos)                        /*!< USB0 PORTSC1_H: CSC Mask            */\r
+#define USB0_PORTSC1_H_PE_Pos                                 2                                                         /*!< USB0 PORTSC1_H: PE Position         */\r
+#define USB0_PORTSC1_H_PE_Msk                                 (0x01UL << USB0_PORTSC1_H_PE_Pos)                         /*!< USB0 PORTSC1_H: PE Mask             */\r
+#define USB0_PORTSC1_H_PEC_Pos                                3                                                         /*!< USB0 PORTSC1_H: PEC Position        */\r
+#define USB0_PORTSC1_H_PEC_Msk                                (0x01UL << USB0_PORTSC1_H_PEC_Pos)                        /*!< USB0 PORTSC1_H: PEC Mask            */\r
+#define USB0_PORTSC1_H_OCA_Pos                                4                                                         /*!< USB0 PORTSC1_H: OCA Position        */\r
+#define USB0_PORTSC1_H_OCA_Msk                                (0x01UL << USB0_PORTSC1_H_OCA_Pos)                        /*!< USB0 PORTSC1_H: OCA Mask            */\r
+#define USB0_PORTSC1_H_OCC_Pos                                5                                                         /*!< USB0 PORTSC1_H: OCC Position        */\r
+#define USB0_PORTSC1_H_OCC_Msk                                (0x01UL << USB0_PORTSC1_H_OCC_Pos)                        /*!< USB0 PORTSC1_H: OCC Mask            */\r
+#define USB0_PORTSC1_H_FPR_Pos                                6                                                         /*!< USB0 PORTSC1_H: FPR Position        */\r
+#define USB0_PORTSC1_H_FPR_Msk                                (0x01UL << USB0_PORTSC1_H_FPR_Pos)                        /*!< USB0 PORTSC1_H: FPR Mask            */\r
+#define USB0_PORTSC1_H_SUSP_Pos                               7                                                         /*!< USB0 PORTSC1_H: SUSP Position       */\r
+#define USB0_PORTSC1_H_SUSP_Msk                               (0x01UL << USB0_PORTSC1_H_SUSP_Pos)                       /*!< USB0 PORTSC1_H: SUSP Mask           */\r
+#define USB0_PORTSC1_H_PR_Pos                                 8                                                         /*!< USB0 PORTSC1_H: PR Position         */\r
+#define USB0_PORTSC1_H_PR_Msk                                 (0x01UL << USB0_PORTSC1_H_PR_Pos)                         /*!< USB0 PORTSC1_H: PR Mask             */\r
+#define USB0_PORTSC1_H_HSP_Pos                                9                                                         /*!< USB0 PORTSC1_H: HSP Position        */\r
+#define USB0_PORTSC1_H_HSP_Msk                                (0x01UL << USB0_PORTSC1_H_HSP_Pos)                        /*!< USB0 PORTSC1_H: HSP Mask            */\r
+#define USB0_PORTSC1_H_LS_Pos                                 10                                                        /*!< USB0 PORTSC1_H: LS Position         */\r
+#define USB0_PORTSC1_H_LS_Msk                                 (0x03UL << USB0_PORTSC1_H_LS_Pos)                         /*!< USB0 PORTSC1_H: LS Mask             */\r
+#define USB0_PORTSC1_H_PP_Pos                                 12                                                        /*!< USB0 PORTSC1_H: PP Position         */\r
+#define USB0_PORTSC1_H_PP_Msk                                 (0x01UL << USB0_PORTSC1_H_PP_Pos)                         /*!< USB0 PORTSC1_H: PP Mask             */\r
+#define USB0_PORTSC1_H_PIC1_0_Pos                             14                                                        /*!< USB0 PORTSC1_H: PIC1_0 Position     */\r
+#define USB0_PORTSC1_H_PIC1_0_Msk                             (0x03UL << USB0_PORTSC1_H_PIC1_0_Pos)                     /*!< USB0 PORTSC1_H: PIC1_0 Mask         */\r
+#define USB0_PORTSC1_H_PTC3_0_Pos                             16                                                        /*!< USB0 PORTSC1_H: PTC3_0 Position     */\r
+#define USB0_PORTSC1_H_PTC3_0_Msk                             (0x0fUL << USB0_PORTSC1_H_PTC3_0_Pos)                     /*!< USB0 PORTSC1_H: PTC3_0 Mask         */\r
+#define USB0_PORTSC1_H_WKCN_Pos                               20                                                        /*!< USB0 PORTSC1_H: WKCN Position       */\r
+#define USB0_PORTSC1_H_WKCN_Msk                               (0x01UL << USB0_PORTSC1_H_WKCN_Pos)                       /*!< USB0 PORTSC1_H: WKCN Mask           */\r
+#define USB0_PORTSC1_H_WKDC_Pos                               21                                                        /*!< USB0 PORTSC1_H: WKDC Position       */\r
+#define USB0_PORTSC1_H_WKDC_Msk                               (0x01UL << USB0_PORTSC1_H_WKDC_Pos)                       /*!< USB0 PORTSC1_H: WKDC Mask           */\r
+#define USB0_PORTSC1_H_WKOC_Pos                               22                                                        /*!< USB0 PORTSC1_H: WKOC Position       */\r
+#define USB0_PORTSC1_H_WKOC_Msk                               (0x01UL << USB0_PORTSC1_H_WKOC_Pos)                       /*!< USB0 PORTSC1_H: WKOC Mask           */\r
+#define USB0_PORTSC1_H_PHCD_Pos                               23                                                        /*!< USB0 PORTSC1_H: PHCD Position       */\r
+#define USB0_PORTSC1_H_PHCD_Msk                               (0x01UL << USB0_PORTSC1_H_PHCD_Pos)                       /*!< USB0 PORTSC1_H: PHCD Mask           */\r
+#define USB0_PORTSC1_H_PFSC_Pos                               24                                                        /*!< USB0 PORTSC1_H: PFSC Position       */\r
+#define USB0_PORTSC1_H_PFSC_Msk                               (0x01UL << USB0_PORTSC1_H_PFSC_Pos)                       /*!< USB0 PORTSC1_H: PFSC Mask           */\r
+#define USB0_PORTSC1_H_PSPD_Pos                               26                                                        /*!< USB0 PORTSC1_H: PSPD Position       */\r
+#define USB0_PORTSC1_H_PSPD_Msk                               (0x03UL << USB0_PORTSC1_H_PSPD_Pos)                       /*!< USB0 PORTSC1_H: PSPD Mask           */\r
+\r
+// ---------------------------------------  USB0_OTGSC  -------------------------------------------\r
+#define USB0_OTGSC_VD_Pos                                     0                                                         /*!< USB0 OTGSC: VD Position             */\r
+#define USB0_OTGSC_VD_Msk                                     (0x01UL << USB0_OTGSC_VD_Pos)                             /*!< USB0 OTGSC: VD Mask                 */\r
+#define USB0_OTGSC_VC_Pos                                     1                                                         /*!< USB0 OTGSC: VC Position             */\r
+#define USB0_OTGSC_VC_Msk                                     (0x01UL << USB0_OTGSC_VC_Pos)                             /*!< USB0 OTGSC: VC Mask                 */\r
+#define USB0_OTGSC_HAAR_Pos                                   2                                                         /*!< USB0 OTGSC: HAAR Position           */\r
+#define USB0_OTGSC_HAAR_Msk                                   (0x01UL << USB0_OTGSC_HAAR_Pos)                           /*!< USB0 OTGSC: HAAR Mask               */\r
+#define USB0_OTGSC_OT_Pos                                     3                                                         /*!< USB0 OTGSC: OT Position             */\r
+#define USB0_OTGSC_OT_Msk                                     (0x01UL << USB0_OTGSC_OT_Pos)                             /*!< USB0 OTGSC: OT Mask                 */\r
+#define USB0_OTGSC_DP_Pos                                     4                                                         /*!< USB0 OTGSC: DP Position             */\r
+#define USB0_OTGSC_DP_Msk                                     (0x01UL << USB0_OTGSC_DP_Pos)                             /*!< USB0 OTGSC: DP Mask                 */\r
+#define USB0_OTGSC_IDPU_Pos                                   5                                                         /*!< USB0 OTGSC: IDPU Position           */\r
+#define USB0_OTGSC_IDPU_Msk                                   (0x01UL << USB0_OTGSC_IDPU_Pos)                           /*!< USB0 OTGSC: IDPU Mask               */\r
+#define USB0_OTGSC_HADP_Pos                                   6                                                         /*!< USB0 OTGSC: HADP Position           */\r
+#define USB0_OTGSC_HADP_Msk                                   (0x01UL << USB0_OTGSC_HADP_Pos)                           /*!< USB0 OTGSC: HADP Mask               */\r
+#define USB0_OTGSC_HABA_Pos                                   7                                                         /*!< USB0 OTGSC: HABA Position           */\r
+#define USB0_OTGSC_HABA_Msk                                   (0x01UL << USB0_OTGSC_HABA_Pos)                           /*!< USB0 OTGSC: HABA Mask               */\r
+#define USB0_OTGSC_ID_Pos                                     8                                                         /*!< USB0 OTGSC: ID Position             */\r
+#define USB0_OTGSC_ID_Msk                                     (0x01UL << USB0_OTGSC_ID_Pos)                             /*!< USB0 OTGSC: ID Mask                 */\r
+#define USB0_OTGSC_AVV_Pos                                    9                                                         /*!< USB0 OTGSC: AVV Position            */\r
+#define USB0_OTGSC_AVV_Msk                                    (0x01UL << USB0_OTGSC_AVV_Pos)                            /*!< USB0 OTGSC: AVV Mask                */\r
+#define USB0_OTGSC_ASV_Pos                                    10                                                        /*!< USB0 OTGSC: ASV Position            */\r
+#define USB0_OTGSC_ASV_Msk                                    (0x01UL << USB0_OTGSC_ASV_Pos)                            /*!< USB0 OTGSC: ASV Mask                */\r
+#define USB0_OTGSC_BSV_Pos                                    11                                                        /*!< USB0 OTGSC: BSV Position            */\r
+#define USB0_OTGSC_BSV_Msk                                    (0x01UL << USB0_OTGSC_BSV_Pos)                            /*!< USB0 OTGSC: BSV Mask                */\r
+#define USB0_OTGSC_BSE_Pos                                    12                                                        /*!< USB0 OTGSC: BSE Position            */\r
+#define USB0_OTGSC_BSE_Msk                                    (0x01UL << USB0_OTGSC_BSE_Pos)                            /*!< USB0 OTGSC: BSE Mask                */\r
+#define USB0_OTGSC_MS1T_Pos                                   13                                                        /*!< USB0 OTGSC: MS1T Position           */\r
+#define USB0_OTGSC_MS1T_Msk                                   (0x01UL << USB0_OTGSC_MS1T_Pos)                           /*!< USB0 OTGSC: MS1T Mask               */\r
+#define USB0_OTGSC_DPS_Pos                                    14                                                        /*!< USB0 OTGSC: DPS Position            */\r
+#define USB0_OTGSC_DPS_Msk                                    (0x01UL << USB0_OTGSC_DPS_Pos)                            /*!< USB0 OTGSC: DPS Mask                */\r
+#define USB0_OTGSC_IDIS_Pos                                   16                                                        /*!< USB0 OTGSC: IDIS Position           */\r
+#define USB0_OTGSC_IDIS_Msk                                   (0x01UL << USB0_OTGSC_IDIS_Pos)                           /*!< USB0 OTGSC: IDIS Mask               */\r
+#define USB0_OTGSC_AVVIS_Pos                                  17                                                        /*!< USB0 OTGSC: AVVIS Position          */\r
+#define USB0_OTGSC_AVVIS_Msk                                  (0x01UL << USB0_OTGSC_AVVIS_Pos)                          /*!< USB0 OTGSC: AVVIS Mask              */\r
+#define USB0_OTGSC_ASVIS_Pos                                  18                                                        /*!< USB0 OTGSC: ASVIS Position          */\r
+#define USB0_OTGSC_ASVIS_Msk                                  (0x01UL << USB0_OTGSC_ASVIS_Pos)                          /*!< USB0 OTGSC: ASVIS Mask              */\r
+#define USB0_OTGSC_BSVIS_Pos                                  19                                                        /*!< USB0 OTGSC: BSVIS Position          */\r
+#define USB0_OTGSC_BSVIS_Msk                                  (0x01UL << USB0_OTGSC_BSVIS_Pos)                          /*!< USB0 OTGSC: BSVIS Mask              */\r
+#define USB0_OTGSC_BSEIS_Pos                                  20                                                        /*!< USB0 OTGSC: BSEIS Position          */\r
+#define USB0_OTGSC_BSEIS_Msk                                  (0x01UL << USB0_OTGSC_BSEIS_Pos)                          /*!< USB0 OTGSC: BSEIS Mask              */\r
+#define USB0_OTGSC_ms1S_Pos                                   21                                                        /*!< USB0 OTGSC: ms1S Position           */\r
+#define USB0_OTGSC_ms1S_Msk                                   (0x01UL << USB0_OTGSC_ms1S_Pos)                           /*!< USB0 OTGSC: ms1S Mask               */\r
+#define USB0_OTGSC_DPIS_Pos                                   22                                                        /*!< USB0 OTGSC: DPIS Position           */\r
+#define USB0_OTGSC_DPIS_Msk                                   (0x01UL << USB0_OTGSC_DPIS_Pos)                           /*!< USB0 OTGSC: DPIS Mask               */\r
+#define USB0_OTGSC_IDIE_Pos                                   24                                                        /*!< USB0 OTGSC: IDIE Position           */\r
+#define USB0_OTGSC_IDIE_Msk                                   (0x01UL << USB0_OTGSC_IDIE_Pos)                           /*!< USB0 OTGSC: IDIE Mask               */\r
+#define USB0_OTGSC_AVVIE_Pos                                  25                                                        /*!< USB0 OTGSC: AVVIE Position          */\r
+#define USB0_OTGSC_AVVIE_Msk                                  (0x01UL << USB0_OTGSC_AVVIE_Pos)                          /*!< USB0 OTGSC: AVVIE Mask              */\r
+#define USB0_OTGSC_ASVIE_Pos                                  26                                                        /*!< USB0 OTGSC: ASVIE Position          */\r
+#define USB0_OTGSC_ASVIE_Msk                                  (0x01UL << USB0_OTGSC_ASVIE_Pos)                          /*!< USB0 OTGSC: ASVIE Mask              */\r
+#define USB0_OTGSC_BSVIE_Pos                                  27                                                        /*!< USB0 OTGSC: BSVIE Position          */\r
+#define USB0_OTGSC_BSVIE_Msk                                  (0x01UL << USB0_OTGSC_BSVIE_Pos)                          /*!< USB0 OTGSC: BSVIE Mask              */\r
+#define USB0_OTGSC_BSEIE_Pos                                  28                                                        /*!< USB0 OTGSC: BSEIE Position          */\r
+#define USB0_OTGSC_BSEIE_Msk                                  (0x01UL << USB0_OTGSC_BSEIE_Pos)                          /*!< USB0 OTGSC: BSEIE Mask              */\r
+#define USB0_OTGSC_MS1E_Pos                                   29                                                        /*!< USB0 OTGSC: MS1E Position           */\r
+#define USB0_OTGSC_MS1E_Msk                                   (0x01UL << USB0_OTGSC_MS1E_Pos)                           /*!< USB0 OTGSC: MS1E Mask               */\r
+#define USB0_OTGSC_DPIE_Pos                                   30                                                        /*!< USB0 OTGSC: DPIE Position           */\r
+#define USB0_OTGSC_DPIE_Msk                                   (0x01UL << USB0_OTGSC_DPIE_Pos)                           /*!< USB0 OTGSC: DPIE Mask               */\r
+\r
+// -------------------------------------  USB0_USBMODE_D  -----------------------------------------\r
+#define USB0_USBMODE_D_CM1_0_Pos                              0                                                         /*!< USB0 USBMODE_D: CM1_0 Position      */\r
+#define USB0_USBMODE_D_CM1_0_Msk                              (0x03UL << USB0_USBMODE_D_CM1_0_Pos)                      /*!< USB0 USBMODE_D: CM1_0 Mask          */\r
+#define USB0_USBMODE_D_ES_Pos                                 2                                                         /*!< USB0 USBMODE_D: ES Position         */\r
+#define USB0_USBMODE_D_ES_Msk                                 (0x01UL << USB0_USBMODE_D_ES_Pos)                         /*!< USB0 USBMODE_D: ES Mask             */\r
+#define USB0_USBMODE_D_SLOM_Pos                               3                                                         /*!< USB0 USBMODE_D: SLOM Position       */\r
+#define USB0_USBMODE_D_SLOM_Msk                               (0x01UL << USB0_USBMODE_D_SLOM_Pos)                       /*!< USB0 USBMODE_D: SLOM Mask           */\r
+#define USB0_USBMODE_D_SDIS_Pos                               4                                                         /*!< USB0 USBMODE_D: SDIS Position       */\r
+#define USB0_USBMODE_D_SDIS_Msk                               (0x01UL << USB0_USBMODE_D_SDIS_Pos)                       /*!< USB0 USBMODE_D: SDIS Mask           */\r
+\r
+// -------------------------------------  USB0_USBMODE_H  -----------------------------------------\r
+#define USB0_USBMODE_H_CM_Pos                                 0                                                         /*!< USB0 USBMODE_H: CM Position         */\r
+#define USB0_USBMODE_H_CM_Msk                                 (0x03UL << USB0_USBMODE_H_CM_Pos)                         /*!< USB0 USBMODE_H: CM Mask             */\r
+#define USB0_USBMODE_H_ES_Pos                                 2                                                         /*!< USB0 USBMODE_H: ES Position         */\r
+#define USB0_USBMODE_H_ES_Msk                                 (0x01UL << USB0_USBMODE_H_ES_Pos)                         /*!< USB0 USBMODE_H: ES Mask             */\r
+#define USB0_USBMODE_H_SDIS_Pos                               4                                                         /*!< USB0 USBMODE_H: SDIS Position       */\r
+#define USB0_USBMODE_H_SDIS_Msk                               (0x01UL << USB0_USBMODE_H_SDIS_Pos)                       /*!< USB0 USBMODE_H: SDIS Mask           */\r
+#define USB0_USBMODE_H_VBPS_Pos                               5                                                         /*!< USB0 USBMODE_H: VBPS Position       */\r
+#define USB0_USBMODE_H_VBPS_Msk                               (0x01UL << USB0_USBMODE_H_VBPS_Pos)                       /*!< USB0 USBMODE_H: VBPS Mask           */\r
+\r
+// -----------------------------------  USB0_ENDPTSETUPSTAT  --------------------------------------\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Pos               0                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT0 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT0 Mask */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Pos               1                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT1 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT1 Mask */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Pos               2                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT2 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT2 Mask */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Pos               3                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT3 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT3 Mask */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT4_Pos               4                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT4 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT4_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT4_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT4 Mask */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT5_Pos               5                                                         /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT5 Position */\r
+#define USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT5_Msk               (0x01UL << USB0_ENDPTSETUPSTAT_ENDPTSETUPSTAT5_Pos)       /*!< USB0 ENDPTSETUPSTAT: ENDPTSETUPSTAT5 Mask */\r
+\r
+// -------------------------------------  USB0_ENDPTPRIME  ----------------------------------------\r
+#define USB0_ENDPTPRIME_PERB0_Pos                             0                                                         /*!< USB0 ENDPTPRIME: PERB0 Position     */\r
+#define USB0_ENDPTPRIME_PERB0_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB0_Pos)                     /*!< USB0 ENDPTPRIME: PERB0 Mask         */\r
+#define USB0_ENDPTPRIME_PERB1_Pos                             1                                                         /*!< USB0 ENDPTPRIME: PERB1 Position     */\r
+#define USB0_ENDPTPRIME_PERB1_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB1_Pos)                     /*!< USB0 ENDPTPRIME: PERB1 Mask         */\r
+#define USB0_ENDPTPRIME_PERB2_Pos                             2                                                         /*!< USB0 ENDPTPRIME: PERB2 Position     */\r
+#define USB0_ENDPTPRIME_PERB2_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB2_Pos)                     /*!< USB0 ENDPTPRIME: PERB2 Mask         */\r
+#define USB0_ENDPTPRIME_PERB3_Pos                             3                                                         /*!< USB0 ENDPTPRIME: PERB3 Position     */\r
+#define USB0_ENDPTPRIME_PERB3_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB3_Pos)                     /*!< USB0 ENDPTPRIME: PERB3 Mask         */\r
+#define USB0_ENDPTPRIME_PERB4_Pos                             4                                                         /*!< USB0 ENDPTPRIME: PERB4 Position     */\r
+#define USB0_ENDPTPRIME_PERB4_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB4_Pos)                     /*!< USB0 ENDPTPRIME: PERB4 Mask         */\r
+#define USB0_ENDPTPRIME_PERB5_Pos                             5                                                         /*!< USB0 ENDPTPRIME: PERB5 Position     */\r
+#define USB0_ENDPTPRIME_PERB5_Msk                             (0x01UL << USB0_ENDPTPRIME_PERB5_Pos)                     /*!< USB0 ENDPTPRIME: PERB5 Mask         */\r
+#define USB0_ENDPTPRIME_PETB0_Pos                             16                                                        /*!< USB0 ENDPTPRIME: PETB0 Position     */\r
+#define USB0_ENDPTPRIME_PETB0_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB0_Pos)                     /*!< USB0 ENDPTPRIME: PETB0 Mask         */\r
+#define USB0_ENDPTPRIME_PETB1_Pos                             17                                                        /*!< USB0 ENDPTPRIME: PETB1 Position     */\r
+#define USB0_ENDPTPRIME_PETB1_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB1_Pos)                     /*!< USB0 ENDPTPRIME: PETB1 Mask         */\r
+#define USB0_ENDPTPRIME_PETB2_Pos                             18                                                        /*!< USB0 ENDPTPRIME: PETB2 Position     */\r
+#define USB0_ENDPTPRIME_PETB2_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB2_Pos)                     /*!< USB0 ENDPTPRIME: PETB2 Mask         */\r
+#define USB0_ENDPTPRIME_PETB3_Pos                             19                                                        /*!< USB0 ENDPTPRIME: PETB3 Position     */\r
+#define USB0_ENDPTPRIME_PETB3_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB3_Pos)                     /*!< USB0 ENDPTPRIME: PETB3 Mask         */\r
+#define USB0_ENDPTPRIME_PETB4_Pos                             20                                                        /*!< USB0 ENDPTPRIME: PETB4 Position     */\r
+#define USB0_ENDPTPRIME_PETB4_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB4_Pos)                     /*!< USB0 ENDPTPRIME: PETB4 Mask         */\r
+#define USB0_ENDPTPRIME_PETB5_Pos                             21                                                        /*!< USB0 ENDPTPRIME: PETB5 Position     */\r
+#define USB0_ENDPTPRIME_PETB5_Msk                             (0x01UL << USB0_ENDPTPRIME_PETB5_Pos)                     /*!< USB0 ENDPTPRIME: PETB5 Mask         */\r
+\r
+// -------------------------------------  USB0_ENDPTFLUSH  ----------------------------------------\r
+#define USB0_ENDPTFLUSH_FERB0_Pos                             0                                                         /*!< USB0 ENDPTFLUSH: FERB0 Position     */\r
+#define USB0_ENDPTFLUSH_FERB0_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB0_Pos)                     /*!< USB0 ENDPTFLUSH: FERB0 Mask         */\r
+#define USB0_ENDPTFLUSH_FERB1_Pos                             1                                                         /*!< USB0 ENDPTFLUSH: FERB1 Position     */\r
+#define USB0_ENDPTFLUSH_FERB1_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB1_Pos)                     /*!< USB0 ENDPTFLUSH: FERB1 Mask         */\r
+#define USB0_ENDPTFLUSH_FERB2_Pos                             2                                                         /*!< USB0 ENDPTFLUSH: FERB2 Position     */\r
+#define USB0_ENDPTFLUSH_FERB2_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB2_Pos)                     /*!< USB0 ENDPTFLUSH: FERB2 Mask         */\r
+#define USB0_ENDPTFLUSH_FERB3_Pos                             3                                                         /*!< USB0 ENDPTFLUSH: FERB3 Position     */\r
+#define USB0_ENDPTFLUSH_FERB3_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB3_Pos)                     /*!< USB0 ENDPTFLUSH: FERB3 Mask         */\r
+#define USB0_ENDPTFLUSH_FERB4_Pos                             4                                                         /*!< USB0 ENDPTFLUSH: FERB4 Position     */\r
+#define USB0_ENDPTFLUSH_FERB4_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB4_Pos)                     /*!< USB0 ENDPTFLUSH: FERB4 Mask         */\r
+#define USB0_ENDPTFLUSH_FERB5_Pos                             5                                                         /*!< USB0 ENDPTFLUSH: FERB5 Position     */\r
+#define USB0_ENDPTFLUSH_FERB5_Msk                             (0x01UL << USB0_ENDPTFLUSH_FERB5_Pos)                     /*!< USB0 ENDPTFLUSH: FERB5 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB0_Pos                             16                                                        /*!< USB0 ENDPTFLUSH: FETB0 Position     */\r
+#define USB0_ENDPTFLUSH_FETB0_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB0_Pos)                     /*!< USB0 ENDPTFLUSH: FETB0 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB1_Pos                             17                                                        /*!< USB0 ENDPTFLUSH: FETB1 Position     */\r
+#define USB0_ENDPTFLUSH_FETB1_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB1_Pos)                     /*!< USB0 ENDPTFLUSH: FETB1 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB2_Pos                             18                                                        /*!< USB0 ENDPTFLUSH: FETB2 Position     */\r
+#define USB0_ENDPTFLUSH_FETB2_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB2_Pos)                     /*!< USB0 ENDPTFLUSH: FETB2 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB3_Pos                             19                                                        /*!< USB0 ENDPTFLUSH: FETB3 Position     */\r
+#define USB0_ENDPTFLUSH_FETB3_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB3_Pos)                     /*!< USB0 ENDPTFLUSH: FETB3 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB4_Pos                             20                                                        /*!< USB0 ENDPTFLUSH: FETB4 Position     */\r
+#define USB0_ENDPTFLUSH_FETB4_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB4_Pos)                     /*!< USB0 ENDPTFLUSH: FETB4 Mask         */\r
+#define USB0_ENDPTFLUSH_FETB5_Pos                             21                                                        /*!< USB0 ENDPTFLUSH: FETB5 Position     */\r
+#define USB0_ENDPTFLUSH_FETB5_Msk                             (0x01UL << USB0_ENDPTFLUSH_FETB5_Pos)                     /*!< USB0 ENDPTFLUSH: FETB5 Mask         */\r
+\r
+// -------------------------------------  USB0_ENDPTSTAT  -----------------------------------------\r
+#define USB0_ENDPTSTAT_ERBR0_Pos                              0                                                         /*!< USB0 ENDPTSTAT: ERBR0 Position      */\r
+#define USB0_ENDPTSTAT_ERBR0_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR0_Pos)                      /*!< USB0 ENDPTSTAT: ERBR0 Mask          */\r
+#define USB0_ENDPTSTAT_ERBR1_Pos                              1                                                         /*!< USB0 ENDPTSTAT: ERBR1 Position      */\r
+#define USB0_ENDPTSTAT_ERBR1_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR1_Pos)                      /*!< USB0 ENDPTSTAT: ERBR1 Mask          */\r
+#define USB0_ENDPTSTAT_ERBR2_Pos                              2                                                         /*!< USB0 ENDPTSTAT: ERBR2 Position      */\r
+#define USB0_ENDPTSTAT_ERBR2_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR2_Pos)                      /*!< USB0 ENDPTSTAT: ERBR2 Mask          */\r
+#define USB0_ENDPTSTAT_ERBR3_Pos                              3                                                         /*!< USB0 ENDPTSTAT: ERBR3 Position      */\r
+#define USB0_ENDPTSTAT_ERBR3_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR3_Pos)                      /*!< USB0 ENDPTSTAT: ERBR3 Mask          */\r
+#define USB0_ENDPTSTAT_ERBR4_Pos                              4                                                         /*!< USB0 ENDPTSTAT: ERBR4 Position      */\r
+#define USB0_ENDPTSTAT_ERBR4_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR4_Pos)                      /*!< USB0 ENDPTSTAT: ERBR4 Mask          */\r
+#define USB0_ENDPTSTAT_ERBR5_Pos                              5                                                         /*!< USB0 ENDPTSTAT: ERBR5 Position      */\r
+#define USB0_ENDPTSTAT_ERBR5_Msk                              (0x01UL << USB0_ENDPTSTAT_ERBR5_Pos)                      /*!< USB0 ENDPTSTAT: ERBR5 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR0_Pos                              16                                                        /*!< USB0 ENDPTSTAT: ETBR0 Position      */\r
+#define USB0_ENDPTSTAT_ETBR0_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR0_Pos)                      /*!< USB0 ENDPTSTAT: ETBR0 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR1_Pos                              17                                                        /*!< USB0 ENDPTSTAT: ETBR1 Position      */\r
+#define USB0_ENDPTSTAT_ETBR1_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR1_Pos)                      /*!< USB0 ENDPTSTAT: ETBR1 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR2_Pos                              18                                                        /*!< USB0 ENDPTSTAT: ETBR2 Position      */\r
+#define USB0_ENDPTSTAT_ETBR2_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR2_Pos)                      /*!< USB0 ENDPTSTAT: ETBR2 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR3_Pos                              19                                                        /*!< USB0 ENDPTSTAT: ETBR3 Position      */\r
+#define USB0_ENDPTSTAT_ETBR3_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR3_Pos)                      /*!< USB0 ENDPTSTAT: ETBR3 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR4_Pos                              20                                                        /*!< USB0 ENDPTSTAT: ETBR4 Position      */\r
+#define USB0_ENDPTSTAT_ETBR4_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR4_Pos)                      /*!< USB0 ENDPTSTAT: ETBR4 Mask          */\r
+#define USB0_ENDPTSTAT_ETBR5_Pos                              21                                                        /*!< USB0 ENDPTSTAT: ETBR5 Position      */\r
+#define USB0_ENDPTSTAT_ETBR5_Msk                              (0x01UL << USB0_ENDPTSTAT_ETBR5_Pos)                      /*!< USB0 ENDPTSTAT: ETBR5 Mask          */\r
+\r
+// -----------------------------------  USB0_ENDPTCOMPLETE  ---------------------------------------\r
+#define USB0_ENDPTCOMPLETE_ERCE0_Pos                          0                                                         /*!< USB0 ENDPTCOMPLETE: ERCE0 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE0_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE0_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE0 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ERCE1_Pos                          1                                                         /*!< USB0 ENDPTCOMPLETE: ERCE1 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE1_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE1_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE1 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ERCE2_Pos                          2                                                         /*!< USB0 ENDPTCOMPLETE: ERCE2 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE2_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE2_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE2 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ERCE3_Pos                          3                                                         /*!< USB0 ENDPTCOMPLETE: ERCE3 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE3_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE3_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE3 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ERCE4_Pos                          4                                                         /*!< USB0 ENDPTCOMPLETE: ERCE4 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE4_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE4_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE4 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ERCE5_Pos                          5                                                         /*!< USB0 ENDPTCOMPLETE: ERCE5 Position  */\r
+#define USB0_ENDPTCOMPLETE_ERCE5_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ERCE5_Pos)                  /*!< USB0 ENDPTCOMPLETE: ERCE5 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE0_Pos                          16                                                        /*!< USB0 ENDPTCOMPLETE: ETCE0 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE0_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE0_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE0 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE1_Pos                          17                                                        /*!< USB0 ENDPTCOMPLETE: ETCE1 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE1_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE1_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE1 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE2_Pos                          18                                                        /*!< USB0 ENDPTCOMPLETE: ETCE2 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE2_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE2_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE2 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE3_Pos                          19                                                        /*!< USB0 ENDPTCOMPLETE: ETCE3 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE3_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE3_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE3 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE4_Pos                          20                                                        /*!< USB0 ENDPTCOMPLETE: ETCE4 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE4_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE4_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE4 Mask      */\r
+#define USB0_ENDPTCOMPLETE_ETCE5_Pos                          21                                                        /*!< USB0 ENDPTCOMPLETE: ETCE5 Position  */\r
+#define USB0_ENDPTCOMPLETE_ETCE5_Msk                          (0x01UL << USB0_ENDPTCOMPLETE_ETCE5_Pos)                  /*!< USB0 ENDPTCOMPLETE: ETCE5 Mask      */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL0  ----------------------------------------\r
+#define USB0_ENDPTCTRL0_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL0: RXS Position       */\r
+#define USB0_ENDPTCTRL0_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL0_RXS_Pos)                       /*!< USB0 ENDPTCTRL0: RXS Mask           */\r
+#define USB0_ENDPTCTRL0_RXT1_0_Pos                            2                                                         /*!< USB0 ENDPTCTRL0: RXT1_0 Position    */\r
+#define USB0_ENDPTCTRL0_RXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL0_RXT1_0_Pos)                    /*!< USB0 ENDPTCTRL0: RXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL0_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL0: RXE Position       */\r
+#define USB0_ENDPTCTRL0_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL0_RXE_Pos)                       /*!< USB0 ENDPTCTRL0: RXE Mask           */\r
+#define USB0_ENDPTCTRL0_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL0: TXS Position       */\r
+#define USB0_ENDPTCTRL0_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL0_TXS_Pos)                       /*!< USB0 ENDPTCTRL0: TXS Mask           */\r
+#define USB0_ENDPTCTRL0_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL0: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL0_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL0_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL0: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL0_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL0: TXE Position       */\r
+#define USB0_ENDPTCTRL0_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL0_TXE_Pos)                       /*!< USB0 ENDPTCTRL0: TXE Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL1  ----------------------------------------\r
+#define USB0_ENDPTCTRL1_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL1: RXS Position       */\r
+#define USB0_ENDPTCTRL1_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL1_RXS_Pos)                       /*!< USB0 ENDPTCTRL1: RXS Mask           */\r
+#define USB0_ENDPTCTRL1_RXT_Pos                               2                                                         /*!< USB0 ENDPTCTRL1: RXT Position       */\r
+#define USB0_ENDPTCTRL1_RXT_Msk                               (0x03UL << USB0_ENDPTCTRL1_RXT_Pos)                       /*!< USB0 ENDPTCTRL1: RXT Mask           */\r
+#define USB0_ENDPTCTRL1_RXI_Pos                               5                                                         /*!< USB0 ENDPTCTRL1: RXI Position       */\r
+#define USB0_ENDPTCTRL1_RXI_Msk                               (0x01UL << USB0_ENDPTCTRL1_RXI_Pos)                       /*!< USB0 ENDPTCTRL1: RXI Mask           */\r
+#define USB0_ENDPTCTRL1_RXR_Pos                               6                                                         /*!< USB0 ENDPTCTRL1: RXR Position       */\r
+#define USB0_ENDPTCTRL1_RXR_Msk                               (0x01UL << USB0_ENDPTCTRL1_RXR_Pos)                       /*!< USB0 ENDPTCTRL1: RXR Mask           */\r
+#define USB0_ENDPTCTRL1_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL1: RXE Position       */\r
+#define USB0_ENDPTCTRL1_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL1_RXE_Pos)                       /*!< USB0 ENDPTCTRL1: RXE Mask           */\r
+#define USB0_ENDPTCTRL1_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL1: TXS Position       */\r
+#define USB0_ENDPTCTRL1_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL1_TXS_Pos)                       /*!< USB0 ENDPTCTRL1: TXS Mask           */\r
+#define USB0_ENDPTCTRL1_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL1: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL1_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL1_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL1: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL1_TXI_Pos                               21                                                        /*!< USB0 ENDPTCTRL1: TXI Position       */\r
+#define USB0_ENDPTCTRL1_TXI_Msk                               (0x01UL << USB0_ENDPTCTRL1_TXI_Pos)                       /*!< USB0 ENDPTCTRL1: TXI Mask           */\r
+#define USB0_ENDPTCTRL1_TXR_Pos                               22                                                        /*!< USB0 ENDPTCTRL1: TXR Position       */\r
+#define USB0_ENDPTCTRL1_TXR_Msk                               (0x01UL << USB0_ENDPTCTRL1_TXR_Pos)                       /*!< USB0 ENDPTCTRL1: TXR Mask           */\r
+#define USB0_ENDPTCTRL1_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL1: TXE Position       */\r
+#define USB0_ENDPTCTRL1_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL1_TXE_Pos)                       /*!< USB0 ENDPTCTRL1: TXE Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL2  ----------------------------------------\r
+#define USB0_ENDPTCTRL2_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL2: RXS Position       */\r
+#define USB0_ENDPTCTRL2_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL2_RXS_Pos)                       /*!< USB0 ENDPTCTRL2: RXS Mask           */\r
+#define USB0_ENDPTCTRL2_RXT_Pos                               2                                                         /*!< USB0 ENDPTCTRL2: RXT Position       */\r
+#define USB0_ENDPTCTRL2_RXT_Msk                               (0x03UL << USB0_ENDPTCTRL2_RXT_Pos)                       /*!< USB0 ENDPTCTRL2: RXT Mask           */\r
+#define USB0_ENDPTCTRL2_RXI_Pos                               5                                                         /*!< USB0 ENDPTCTRL2: RXI Position       */\r
+#define USB0_ENDPTCTRL2_RXI_Msk                               (0x01UL << USB0_ENDPTCTRL2_RXI_Pos)                       /*!< USB0 ENDPTCTRL2: RXI Mask           */\r
+#define USB0_ENDPTCTRL2_RXR_Pos                               6                                                         /*!< USB0 ENDPTCTRL2: RXR Position       */\r
+#define USB0_ENDPTCTRL2_RXR_Msk                               (0x01UL << USB0_ENDPTCTRL2_RXR_Pos)                       /*!< USB0 ENDPTCTRL2: RXR Mask           */\r
+#define USB0_ENDPTCTRL2_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL2: RXE Position       */\r
+#define USB0_ENDPTCTRL2_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL2_RXE_Pos)                       /*!< USB0 ENDPTCTRL2: RXE Mask           */\r
+#define USB0_ENDPTCTRL2_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL2: TXS Position       */\r
+#define USB0_ENDPTCTRL2_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL2_TXS_Pos)                       /*!< USB0 ENDPTCTRL2: TXS Mask           */\r
+#define USB0_ENDPTCTRL2_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL2: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL2_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL2_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL2: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL2_TXI_Pos                               21                                                        /*!< USB0 ENDPTCTRL2: TXI Position       */\r
+#define USB0_ENDPTCTRL2_TXI_Msk                               (0x01UL << USB0_ENDPTCTRL2_TXI_Pos)                       /*!< USB0 ENDPTCTRL2: TXI Mask           */\r
+#define USB0_ENDPTCTRL2_TXR_Pos                               22                                                        /*!< USB0 ENDPTCTRL2: TXR Position       */\r
+#define USB0_ENDPTCTRL2_TXR_Msk                               (0x01UL << USB0_ENDPTCTRL2_TXR_Pos)                       /*!< USB0 ENDPTCTRL2: TXR Mask           */\r
+#define USB0_ENDPTCTRL2_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL2: TXE Position       */\r
+#define USB0_ENDPTCTRL2_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL2_TXE_Pos)                       /*!< USB0 ENDPTCTRL2: TXE Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL3  ----------------------------------------\r
+#define USB0_ENDPTCTRL3_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL3: RXS Position       */\r
+#define USB0_ENDPTCTRL3_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL3_RXS_Pos)                       /*!< USB0 ENDPTCTRL3: RXS Mask           */\r
+#define USB0_ENDPTCTRL3_RXT_Pos                               2                                                         /*!< USB0 ENDPTCTRL3: RXT Position       */\r
+#define USB0_ENDPTCTRL3_RXT_Msk                               (0x03UL << USB0_ENDPTCTRL3_RXT_Pos)                       /*!< USB0 ENDPTCTRL3: RXT Mask           */\r
+#define USB0_ENDPTCTRL3_RXI_Pos                               5                                                         /*!< USB0 ENDPTCTRL3: RXI Position       */\r
+#define USB0_ENDPTCTRL3_RXI_Msk                               (0x01UL << USB0_ENDPTCTRL3_RXI_Pos)                       /*!< USB0 ENDPTCTRL3: RXI Mask           */\r
+#define USB0_ENDPTCTRL3_RXR_Pos                               6                                                         /*!< USB0 ENDPTCTRL3: RXR Position       */\r
+#define USB0_ENDPTCTRL3_RXR_Msk                               (0x01UL << USB0_ENDPTCTRL3_RXR_Pos)                       /*!< USB0 ENDPTCTRL3: RXR Mask           */\r
+#define USB0_ENDPTCTRL3_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL3: RXE Position       */\r
+#define USB0_ENDPTCTRL3_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL3_RXE_Pos)                       /*!< USB0 ENDPTCTRL3: RXE Mask           */\r
+#define USB0_ENDPTCTRL3_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL3: TXS Position       */\r
+#define USB0_ENDPTCTRL3_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL3_TXS_Pos)                       /*!< USB0 ENDPTCTRL3: TXS Mask           */\r
+#define USB0_ENDPTCTRL3_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL3: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL3_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL3_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL3: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL3_TXI_Pos                               21                                                        /*!< USB0 ENDPTCTRL3: TXI Position       */\r
+#define USB0_ENDPTCTRL3_TXI_Msk                               (0x01UL << USB0_ENDPTCTRL3_TXI_Pos)                       /*!< USB0 ENDPTCTRL3: TXI Mask           */\r
+#define USB0_ENDPTCTRL3_TXR_Pos                               22                                                        /*!< USB0 ENDPTCTRL3: TXR Position       */\r
+#define USB0_ENDPTCTRL3_TXR_Msk                               (0x01UL << USB0_ENDPTCTRL3_TXR_Pos)                       /*!< USB0 ENDPTCTRL3: TXR Mask           */\r
+#define USB0_ENDPTCTRL3_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL3: TXE Position       */\r
+#define USB0_ENDPTCTRL3_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL3_TXE_Pos)                       /*!< USB0 ENDPTCTRL3: TXE Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL4  ----------------------------------------\r
+#define USB0_ENDPTCTRL4_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL4: RXS Position       */\r
+#define USB0_ENDPTCTRL4_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL4_RXS_Pos)                       /*!< USB0 ENDPTCTRL4: RXS Mask           */\r
+#define USB0_ENDPTCTRL4_RXT_Pos                               2                                                         /*!< USB0 ENDPTCTRL4: RXT Position       */\r
+#define USB0_ENDPTCTRL4_RXT_Msk                               (0x03UL << USB0_ENDPTCTRL4_RXT_Pos)                       /*!< USB0 ENDPTCTRL4: RXT Mask           */\r
+#define USB0_ENDPTCTRL4_RXI_Pos                               5                                                         /*!< USB0 ENDPTCTRL4: RXI Position       */\r
+#define USB0_ENDPTCTRL4_RXI_Msk                               (0x01UL << USB0_ENDPTCTRL4_RXI_Pos)                       /*!< USB0 ENDPTCTRL4: RXI Mask           */\r
+#define USB0_ENDPTCTRL4_RXR_Pos                               6                                                         /*!< USB0 ENDPTCTRL4: RXR Position       */\r
+#define USB0_ENDPTCTRL4_RXR_Msk                               (0x01UL << USB0_ENDPTCTRL4_RXR_Pos)                       /*!< USB0 ENDPTCTRL4: RXR Mask           */\r
+#define USB0_ENDPTCTRL4_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL4: RXE Position       */\r
+#define USB0_ENDPTCTRL4_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL4_RXE_Pos)                       /*!< USB0 ENDPTCTRL4: RXE Mask           */\r
+#define USB0_ENDPTCTRL4_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL4: TXS Position       */\r
+#define USB0_ENDPTCTRL4_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL4_TXS_Pos)                       /*!< USB0 ENDPTCTRL4: TXS Mask           */\r
+#define USB0_ENDPTCTRL4_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL4: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL4_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL4_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL4: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL4_TXI_Pos                               21                                                        /*!< USB0 ENDPTCTRL4: TXI Position       */\r
+#define USB0_ENDPTCTRL4_TXI_Msk                               (0x01UL << USB0_ENDPTCTRL4_TXI_Pos)                       /*!< USB0 ENDPTCTRL4: TXI Mask           */\r
+#define USB0_ENDPTCTRL4_TXR_Pos                               22                                                        /*!< USB0 ENDPTCTRL4: TXR Position       */\r
+#define USB0_ENDPTCTRL4_TXR_Msk                               (0x01UL << USB0_ENDPTCTRL4_TXR_Pos)                       /*!< USB0 ENDPTCTRL4: TXR Mask           */\r
+#define USB0_ENDPTCTRL4_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL4: TXE Position       */\r
+#define USB0_ENDPTCTRL4_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL4_TXE_Pos)                       /*!< USB0 ENDPTCTRL4: TXE Mask           */\r
+\r
+// -------------------------------------  USB0_ENDPTCTRL5  ----------------------------------------\r
+#define USB0_ENDPTCTRL5_RXS_Pos                               0                                                         /*!< USB0 ENDPTCTRL5: RXS Position       */\r
+#define USB0_ENDPTCTRL5_RXS_Msk                               (0x01UL << USB0_ENDPTCTRL5_RXS_Pos)                       /*!< USB0 ENDPTCTRL5: RXS Mask           */\r
+#define USB0_ENDPTCTRL5_RXT_Pos                               2                                                         /*!< USB0 ENDPTCTRL5: RXT Position       */\r
+#define USB0_ENDPTCTRL5_RXT_Msk                               (0x03UL << USB0_ENDPTCTRL5_RXT_Pos)                       /*!< USB0 ENDPTCTRL5: RXT Mask           */\r
+#define USB0_ENDPTCTRL5_RXI_Pos                               5                                                         /*!< USB0 ENDPTCTRL5: RXI Position       */\r
+#define USB0_ENDPTCTRL5_RXI_Msk                               (0x01UL << USB0_ENDPTCTRL5_RXI_Pos)                       /*!< USB0 ENDPTCTRL5: RXI Mask           */\r
+#define USB0_ENDPTCTRL5_RXR_Pos                               6                                                         /*!< USB0 ENDPTCTRL5: RXR Position       */\r
+#define USB0_ENDPTCTRL5_RXR_Msk                               (0x01UL << USB0_ENDPTCTRL5_RXR_Pos)                       /*!< USB0 ENDPTCTRL5: RXR Mask           */\r
+#define USB0_ENDPTCTRL5_RXE_Pos                               7                                                         /*!< USB0 ENDPTCTRL5: RXE Position       */\r
+#define USB0_ENDPTCTRL5_RXE_Msk                               (0x01UL << USB0_ENDPTCTRL5_RXE_Pos)                       /*!< USB0 ENDPTCTRL5: RXE Mask           */\r
+#define USB0_ENDPTCTRL5_TXS_Pos                               16                                                        /*!< USB0 ENDPTCTRL5: TXS Position       */\r
+#define USB0_ENDPTCTRL5_TXS_Msk                               (0x01UL << USB0_ENDPTCTRL5_TXS_Pos)                       /*!< USB0 ENDPTCTRL5: TXS Mask           */\r
+#define USB0_ENDPTCTRL5_TXT1_0_Pos                            18                                                        /*!< USB0 ENDPTCTRL5: TXT1_0 Position    */\r
+#define USB0_ENDPTCTRL5_TXT1_0_Msk                            (0x03UL << USB0_ENDPTCTRL5_TXT1_0_Pos)                    /*!< USB0 ENDPTCTRL5: TXT1_0 Mask        */\r
+#define USB0_ENDPTCTRL5_TXI_Pos                               21                                                        /*!< USB0 ENDPTCTRL5: TXI Position       */\r
+#define USB0_ENDPTCTRL5_TXI_Msk                               (0x01UL << USB0_ENDPTCTRL5_TXI_Pos)                       /*!< USB0 ENDPTCTRL5: TXI Mask           */\r
+#define USB0_ENDPTCTRL5_TXR_Pos                               22                                                        /*!< USB0 ENDPTCTRL5: TXR Position       */\r
+#define USB0_ENDPTCTRL5_TXR_Msk                               (0x01UL << USB0_ENDPTCTRL5_TXR_Pos)                       /*!< USB0 ENDPTCTRL5: TXR Mask           */\r
+#define USB0_ENDPTCTRL5_TXE_Pos                               23                                                        /*!< USB0 ENDPTCTRL5: TXE Position       */\r
+#define USB0_ENDPTCTRL5_TXE_Msk                               (0x01UL << USB0_ENDPTCTRL5_TXE_Pos)                       /*!< USB0 ENDPTCTRL5: TXE Mask           */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 USB1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -------------------------------------  USB1_CAPLENGTH  -----------------------------------------\r
+#define USB1_CAPLENGTH_CAPLENGTH_Pos                          0                                                         /*!< USB1 CAPLENGTH: CAPLENGTH Position  */\r
+#define USB1_CAPLENGTH_CAPLENGTH_Msk                          (0x000000ffUL << USB1_CAPLENGTH_CAPLENGTH_Pos)            /*!< USB1 CAPLENGTH: CAPLENGTH Mask      */\r
+#define USB1_CAPLENGTH_HCIVERSION_Pos                         8                                                         /*!< USB1 CAPLENGTH: HCIVERSION Position */\r
+#define USB1_CAPLENGTH_HCIVERSION_Msk                         (0x0000ffffUL << USB1_CAPLENGTH_HCIVERSION_Pos)           /*!< USB1 CAPLENGTH: HCIVERSION Mask     */\r
+\r
+// -------------------------------------  USB1_HCSPARAMS  -----------------------------------------\r
+#define USB1_HCSPARAMS_N_PORTS_Pos                            0                                                         /*!< USB1 HCSPARAMS: N_PORTS Position    */\r
+#define USB1_HCSPARAMS_N_PORTS_Msk                            (0x0fUL << USB1_HCSPARAMS_N_PORTS_Pos)                    /*!< USB1 HCSPARAMS: N_PORTS Mask        */\r
+#define USB1_HCSPARAMS_PPC_Pos                                4                                                         /*!< USB1 HCSPARAMS: PPC Position        */\r
+#define USB1_HCSPARAMS_PPC_Msk                                (0x01UL << USB1_HCSPARAMS_PPC_Pos)                        /*!< USB1 HCSPARAMS: PPC Mask            */\r
+#define USB1_HCSPARAMS_N_PCC_Pos                              8                                                         /*!< USB1 HCSPARAMS: N_PCC Position      */\r
+#define USB1_HCSPARAMS_N_PCC_Msk                              (0x0fUL << USB1_HCSPARAMS_N_PCC_Pos)                      /*!< USB1 HCSPARAMS: N_PCC Mask          */\r
+#define USB1_HCSPARAMS_N_CC_Pos                               12                                                        /*!< USB1 HCSPARAMS: N_CC Position       */\r
+#define USB1_HCSPARAMS_N_CC_Msk                               (0x0fUL << USB1_HCSPARAMS_N_CC_Pos)                       /*!< USB1 HCSPARAMS: N_CC Mask           */\r
+#define USB1_HCSPARAMS_PI_Pos                                 16                                                        /*!< USB1 HCSPARAMS: PI Position         */\r
+#define USB1_HCSPARAMS_PI_Msk                                 (0x01UL << USB1_HCSPARAMS_PI_Pos)                         /*!< USB1 HCSPARAMS: PI Mask             */\r
+#define USB1_HCSPARAMS_N_PTT_Pos                              20                                                        /*!< USB1 HCSPARAMS: N_PTT Position      */\r
+#define USB1_HCSPARAMS_N_PTT_Msk                              (0x0fUL << USB1_HCSPARAMS_N_PTT_Pos)                      /*!< USB1 HCSPARAMS: N_PTT Mask          */\r
+#define USB1_HCSPARAMS_N_TT_Pos                               24                                                        /*!< USB1 HCSPARAMS: N_TT Position       */\r
+#define USB1_HCSPARAMS_N_TT_Msk                               (0x0fUL << USB1_HCSPARAMS_N_TT_Pos)                       /*!< USB1 HCSPARAMS: N_TT Mask           */\r
+\r
+// -------------------------------------  USB1_HCCPARAMS  -----------------------------------------\r
+#define USB1_HCCPARAMS_ADC_Pos                                0                                                         /*!< USB1 HCCPARAMS: ADC Position        */\r
+#define USB1_HCCPARAMS_ADC_Msk                                (0x01UL << USB1_HCCPARAMS_ADC_Pos)                        /*!< USB1 HCCPARAMS: ADC Mask            */\r
+#define USB1_HCCPARAMS_PFL_Pos                                1                                                         /*!< USB1 HCCPARAMS: PFL Position        */\r
+#define USB1_HCCPARAMS_PFL_Msk                                (0x01UL << USB1_HCCPARAMS_PFL_Pos)                        /*!< USB1 HCCPARAMS: PFL Mask            */\r
+#define USB1_HCCPARAMS_ASP_Pos                                2                                                         /*!< USB1 HCCPARAMS: ASP Position        */\r
+#define USB1_HCCPARAMS_ASP_Msk                                (0x01UL << USB1_HCCPARAMS_ASP_Pos)                        /*!< USB1 HCCPARAMS: ASP Mask            */\r
+#define USB1_HCCPARAMS_IST_Pos                                4                                                         /*!< USB1 HCCPARAMS: IST Position        */\r
+#define USB1_HCCPARAMS_IST_Msk                                (0x0fUL << USB1_HCCPARAMS_IST_Pos)                        /*!< USB1 HCCPARAMS: IST Mask            */\r
+#define USB1_HCCPARAMS_EECP_Pos                               8                                                         /*!< USB1 HCCPARAMS: EECP Position       */\r
+#define USB1_HCCPARAMS_EECP_Msk                               (0x000000ffUL << USB1_HCCPARAMS_EECP_Pos)                 /*!< USB1 HCCPARAMS: EECP Mask           */\r
+\r
+// -------------------------------------  USB1_DCIVERSION  ----------------------------------------\r
+#define USB1_DCIVERSION_DCIVERSION_Pos                        0                                                         /*!< USB1 DCIVERSION: DCIVERSION Position */\r
+#define USB1_DCIVERSION_DCIVERSION_Msk                        (0x0000ffffUL << USB1_DCIVERSION_DCIVERSION_Pos)          /*!< USB1 DCIVERSION: DCIVERSION Mask    */\r
+\r
+// --------------------------------------  USB1_USBCMD_D  -----------------------------------------\r
+#define USB1_USBCMD_D_RS_Pos                                  0                                                         /*!< USB1 USBCMD_D: RS Position          */\r
+#define USB1_USBCMD_D_RS_Msk                                  (0x01UL << USB1_USBCMD_D_RS_Pos)                          /*!< USB1 USBCMD_D: RS Mask              */\r
+#define USB1_USBCMD_D_RST_Pos                                 1                                                         /*!< USB1 USBCMD_D: RST Position         */\r
+#define USB1_USBCMD_D_RST_Msk                                 (0x01UL << USB1_USBCMD_D_RST_Pos)                         /*!< USB1 USBCMD_D: RST Mask             */\r
+#define USB1_USBCMD_D_SUTW_Pos                                13                                                        /*!< USB1 USBCMD_D: SUTW Position        */\r
+#define USB1_USBCMD_D_SUTW_Msk                                (0x01UL << USB1_USBCMD_D_SUTW_Pos)                        /*!< USB1 USBCMD_D: SUTW Mask            */\r
+#define USB1_USBCMD_D_ATDTW_Pos                               14                                                        /*!< USB1 USBCMD_D: ATDTW Position       */\r
+#define USB1_USBCMD_D_ATDTW_Msk                               (0x01UL << USB1_USBCMD_D_ATDTW_Pos)                       /*!< USB1 USBCMD_D: ATDTW Mask           */\r
+#define USB1_USBCMD_D_FS2_Pos                                 15                                                        /*!< USB1 USBCMD_D: FS2 Position         */\r
+#define USB1_USBCMD_D_FS2_Msk                                 (0x01UL << USB1_USBCMD_D_FS2_Pos)                         /*!< USB1 USBCMD_D: FS2 Mask             */\r
+#define USB1_USBCMD_D_ITC_Pos                                 16                                                        /*!< USB1 USBCMD_D: ITC Position         */\r
+#define USB1_USBCMD_D_ITC_Msk                                 (0x000000ffUL << USB1_USBCMD_D_ITC_Pos)                   /*!< USB1 USBCMD_D: ITC Mask             */\r
+\r
+// --------------------------------------  USB1_USBCMD_H  -----------------------------------------\r
+#define USB1_USBCMD_H_RS_Pos                                  0                                                         /*!< USB1 USBCMD_H: RS Position          */\r
+#define USB1_USBCMD_H_RS_Msk                                  (0x01UL << USB1_USBCMD_H_RS_Pos)                          /*!< USB1 USBCMD_H: RS Mask              */\r
+#define USB1_USBCMD_H_RST_Pos                                 1                                                         /*!< USB1 USBCMD_H: RST Position         */\r
+#define USB1_USBCMD_H_RST_Msk                                 (0x01UL << USB1_USBCMD_H_RST_Pos)                         /*!< USB1 USBCMD_H: RST Mask             */\r
+#define USB1_USBCMD_H_FS0_Pos                                 2                                                         /*!< USB1 USBCMD_H: FS0 Position         */\r
+#define USB1_USBCMD_H_FS0_Msk                                 (0x01UL << USB1_USBCMD_H_FS0_Pos)                         /*!< USB1 USBCMD_H: FS0 Mask             */\r
+#define USB1_USBCMD_H_FS1_Pos                                 3                                                         /*!< USB1 USBCMD_H: FS1 Position         */\r
+#define USB1_USBCMD_H_FS1_Msk                                 (0x01UL << USB1_USBCMD_H_FS1_Pos)                         /*!< USB1 USBCMD_H: FS1 Mask             */\r
+#define USB1_USBCMD_H_PSE_Pos                                 4                                                         /*!< USB1 USBCMD_H: PSE Position         */\r
+#define USB1_USBCMD_H_PSE_Msk                                 (0x01UL << USB1_USBCMD_H_PSE_Pos)                         /*!< USB1 USBCMD_H: PSE Mask             */\r
+#define USB1_USBCMD_H_ASE_Pos                                 5                                                         /*!< USB1 USBCMD_H: ASE Position         */\r
+#define USB1_USBCMD_H_ASE_Msk                                 (0x01UL << USB1_USBCMD_H_ASE_Pos)                         /*!< USB1 USBCMD_H: ASE Mask             */\r
+#define USB1_USBCMD_H_IAA_Pos                                 6                                                         /*!< USB1 USBCMD_H: IAA Position         */\r
+#define USB1_USBCMD_H_IAA_Msk                                 (0x01UL << USB1_USBCMD_H_IAA_Pos)                         /*!< USB1 USBCMD_H: IAA Mask             */\r
+#define USB1_USBCMD_H_ASP1_0_Pos                              8                                                         /*!< USB1 USBCMD_H: ASP1_0 Position      */\r
+#define USB1_USBCMD_H_ASP1_0_Msk                              (0x03UL << USB1_USBCMD_H_ASP1_0_Pos)                      /*!< USB1 USBCMD_H: ASP1_0 Mask          */\r
+#define USB1_USBCMD_H_ASPE_Pos                                11                                                        /*!< USB1 USBCMD_H: ASPE Position        */\r
+#define USB1_USBCMD_H_ASPE_Msk                                (0x01UL << USB1_USBCMD_H_ASPE_Pos)                        /*!< USB1 USBCMD_H: ASPE Mask            */\r
+#define USB1_USBCMD_H_FS2_Pos                                 15                                                        /*!< USB1 USBCMD_H: FS2 Position         */\r
+#define USB1_USBCMD_H_FS2_Msk                                 (0x01UL << USB1_USBCMD_H_FS2_Pos)                         /*!< USB1 USBCMD_H: FS2 Mask             */\r
+#define USB1_USBCMD_H_ITC_Pos                                 16                                                        /*!< USB1 USBCMD_H: ITC Position         */\r
+#define USB1_USBCMD_H_ITC_Msk                                 (0x000000ffUL << USB1_USBCMD_H_ITC_Pos)                   /*!< USB1 USBCMD_H: ITC Mask             */\r
+\r
+// --------------------------------------  USB1_USBSTS_D  -----------------------------------------\r
+#define USB1_USBSTS_D_UI_Pos                                  0                                                         /*!< USB1 USBSTS_D: UI Position          */\r
+#define USB1_USBSTS_D_UI_Msk                                  (0x01UL << USB1_USBSTS_D_UI_Pos)                          /*!< USB1 USBSTS_D: UI Mask              */\r
+#define USB1_USBSTS_D_UEI_Pos                                 1                                                         /*!< USB1 USBSTS_D: UEI Position         */\r
+#define USB1_USBSTS_D_UEI_Msk                                 (0x01UL << USB1_USBSTS_D_UEI_Pos)                         /*!< USB1 USBSTS_D: UEI Mask             */\r
+#define USB1_USBSTS_D_PCI_Pos                                 2                                                         /*!< USB1 USBSTS_D: PCI Position         */\r
+#define USB1_USBSTS_D_PCI_Msk                                 (0x01UL << USB1_USBSTS_D_PCI_Pos)                         /*!< USB1 USBSTS_D: PCI Mask             */\r
+#define USB1_USBSTS_D_URI_Pos                                 6                                                         /*!< USB1 USBSTS_D: URI Position         */\r
+#define USB1_USBSTS_D_URI_Msk                                 (0x01UL << USB1_USBSTS_D_URI_Pos)                         /*!< USB1 USBSTS_D: URI Mask             */\r
+#define USB1_USBSTS_D_SRI_Pos                                 7                                                         /*!< USB1 USBSTS_D: SRI Position         */\r
+#define USB1_USBSTS_D_SRI_Msk                                 (0x01UL << USB1_USBSTS_D_SRI_Pos)                         /*!< USB1 USBSTS_D: SRI Mask             */\r
+#define USB1_USBSTS_D_SLI_Pos                                 8                                                         /*!< USB1 USBSTS_D: SLI Position         */\r
+#define USB1_USBSTS_D_SLI_Msk                                 (0x01UL << USB1_USBSTS_D_SLI_Pos)                         /*!< USB1 USBSTS_D: SLI Mask             */\r
+#define USB1_USBSTS_D_NAKI_Pos                                16                                                        /*!< USB1 USBSTS_D: NAKI Position        */\r
+#define USB1_USBSTS_D_NAKI_Msk                                (0x01UL << USB1_USBSTS_D_NAKI_Pos)                        /*!< USB1 USBSTS_D: NAKI Mask            */\r
+\r
+// --------------------------------------  USB1_USBSTS_H  -----------------------------------------\r
+#define USB1_USBSTS_H_UI_Pos                                  0                                                         /*!< USB1 USBSTS_H: UI Position          */\r
+#define USB1_USBSTS_H_UI_Msk                                  (0x01UL << USB1_USBSTS_H_UI_Pos)                          /*!< USB1 USBSTS_H: UI Mask              */\r
+#define USB1_USBSTS_H_UEI_Pos                                 1                                                         /*!< USB1 USBSTS_H: UEI Position         */\r
+#define USB1_USBSTS_H_UEI_Msk                                 (0x01UL << USB1_USBSTS_H_UEI_Pos)                         /*!< USB1 USBSTS_H: UEI Mask             */\r
+#define USB1_USBSTS_H_PCI_Pos                                 2                                                         /*!< USB1 USBSTS_H: PCI Position         */\r
+#define USB1_USBSTS_H_PCI_Msk                                 (0x01UL << USB1_USBSTS_H_PCI_Pos)                         /*!< USB1 USBSTS_H: PCI Mask             */\r
+#define USB1_USBSTS_H_FRI_Pos                                 3                                                         /*!< USB1 USBSTS_H: FRI Position         */\r
+#define USB1_USBSTS_H_FRI_Msk                                 (0x01UL << USB1_USBSTS_H_FRI_Pos)                         /*!< USB1 USBSTS_H: FRI Mask             */\r
+#define USB1_USBSTS_H_AAI_Pos                                 5                                                         /*!< USB1 USBSTS_H: AAI Position         */\r
+#define USB1_USBSTS_H_AAI_Msk                                 (0x01UL << USB1_USBSTS_H_AAI_Pos)                         /*!< USB1 USBSTS_H: AAI Mask             */\r
+#define USB1_USBSTS_H_SRI_Pos                                 7                                                         /*!< USB1 USBSTS_H: SRI Position         */\r
+#define USB1_USBSTS_H_SRI_Msk                                 (0x01UL << USB1_USBSTS_H_SRI_Pos)                         /*!< USB1 USBSTS_H: SRI Mask             */\r
+#define USB1_USBSTS_H_SLI_Pos                                 8                                                         /*!< USB1 USBSTS_H: SLI Position         */\r
+#define USB1_USBSTS_H_SLI_Msk                                 (0x01UL << USB1_USBSTS_H_SLI_Pos)                         /*!< USB1 USBSTS_H: SLI Mask             */\r
+#define USB1_USBSTS_H_HCH_Pos                                 12                                                        /*!< USB1 USBSTS_H: HCH Position         */\r
+#define USB1_USBSTS_H_HCH_Msk                                 (0x01UL << USB1_USBSTS_H_HCH_Pos)                         /*!< USB1 USBSTS_H: HCH Mask             */\r
+#define USB1_USBSTS_H_RCL_Pos                                 13                                                        /*!< USB1 USBSTS_H: RCL Position         */\r
+#define USB1_USBSTS_H_RCL_Msk                                 (0x01UL << USB1_USBSTS_H_RCL_Pos)                         /*!< USB1 USBSTS_H: RCL Mask             */\r
+#define USB1_USBSTS_H_PS_Pos                                  14                                                        /*!< USB1 USBSTS_H: PS Position          */\r
+#define USB1_USBSTS_H_PS_Msk                                  (0x01UL << USB1_USBSTS_H_PS_Pos)                          /*!< USB1 USBSTS_H: PS Mask              */\r
+#define USB1_USBSTS_H_AS_Pos                                  15                                                        /*!< USB1 USBSTS_H: AS Position          */\r
+#define USB1_USBSTS_H_AS_Msk                                  (0x01UL << USB1_USBSTS_H_AS_Pos)                          /*!< USB1 USBSTS_H: AS Mask              */\r
+#define USB1_USBSTS_H_UAI_Pos                                 18                                                        /*!< USB1 USBSTS_H: UAI Position         */\r
+#define USB1_USBSTS_H_UAI_Msk                                 (0x01UL << USB1_USBSTS_H_UAI_Pos)                         /*!< USB1 USBSTS_H: UAI Mask             */\r
+#define USB1_USBSTS_H_UPI_Pos                                 19                                                        /*!< USB1 USBSTS_H: UPI Position         */\r
+#define USB1_USBSTS_H_UPI_Msk                                 (0x01UL << USB1_USBSTS_H_UPI_Pos)                         /*!< USB1 USBSTS_H: UPI Mask             */\r
+\r
+// -------------------------------------  USB1_USBINTR_D  -----------------------------------------\r
+#define USB1_USBINTR_D_UE_Pos                                 0                                                         /*!< USB1 USBINTR_D: UE Position         */\r
+#define USB1_USBINTR_D_UE_Msk                                 (0x01UL << USB1_USBINTR_D_UE_Pos)                         /*!< USB1 USBINTR_D: UE Mask             */\r
+#define USB1_USBINTR_D_UEE_Pos                                1                                                         /*!< USB1 USBINTR_D: UEE Position        */\r
+#define USB1_USBINTR_D_UEE_Msk                                (0x01UL << USB1_USBINTR_D_UEE_Pos)                        /*!< USB1 USBINTR_D: UEE Mask            */\r
+#define USB1_USBINTR_D_PCE_Pos                                2                                                         /*!< USB1 USBINTR_D: PCE Position        */\r
+#define USB1_USBINTR_D_PCE_Msk                                (0x01UL << USB1_USBINTR_D_PCE_Pos)                        /*!< USB1 USBINTR_D: PCE Mask            */\r
+#define USB1_USBINTR_D_URE_Pos                                6                                                         /*!< USB1 USBINTR_D: URE Position        */\r
+#define USB1_USBINTR_D_URE_Msk                                (0x01UL << USB1_USBINTR_D_URE_Pos)                        /*!< USB1 USBINTR_D: URE Mask            */\r
+#define USB1_USBINTR_D_SRE_Pos                                7                                                         /*!< USB1 USBINTR_D: SRE Position        */\r
+#define USB1_USBINTR_D_SRE_Msk                                (0x01UL << USB1_USBINTR_D_SRE_Pos)                        /*!< USB1 USBINTR_D: SRE Mask            */\r
+#define USB1_USBINTR_D_SLE_Pos                                8                                                         /*!< USB1 USBINTR_D: SLE Position        */\r
+#define USB1_USBINTR_D_SLE_Msk                                (0x01UL << USB1_USBINTR_D_SLE_Pos)                        /*!< USB1 USBINTR_D: SLE Mask            */\r
+#define USB1_USBINTR_D_NAKE_Pos                               16                                                        /*!< USB1 USBINTR_D: NAKE Position       */\r
+#define USB1_USBINTR_D_NAKE_Msk                               (0x01UL << USB1_USBINTR_D_NAKE_Pos)                       /*!< USB1 USBINTR_D: NAKE Mask           */\r
+#define USB1_USBINTR_D_UAIE_Pos                               18                                                        /*!< USB1 USBINTR_D: UAIE Position       */\r
+#define USB1_USBINTR_D_UAIE_Msk                               (0x01UL << USB1_USBINTR_D_UAIE_Pos)                       /*!< USB1 USBINTR_D: UAIE Mask           */\r
+#define USB1_USBINTR_D_UPIA_Pos                               19                                                        /*!< USB1 USBINTR_D: UPIA Position       */\r
+#define USB1_USBINTR_D_UPIA_Msk                               (0x01UL << USB1_USBINTR_D_UPIA_Pos)                       /*!< USB1 USBINTR_D: UPIA Mask           */\r
+\r
+// -------------------------------------  USB1_USBINTR_H  -----------------------------------------\r
+#define USB1_USBINTR_H_UE_Pos                                 0                                                         /*!< USB1 USBINTR_H: UE Position         */\r
+#define USB1_USBINTR_H_UE_Msk                                 (0x01UL << USB1_USBINTR_H_UE_Pos)                         /*!< USB1 USBINTR_H: UE Mask             */\r
+#define USB1_USBINTR_H_UEE_Pos                                1                                                         /*!< USB1 USBINTR_H: UEE Position        */\r
+#define USB1_USBINTR_H_UEE_Msk                                (0x01UL << USB1_USBINTR_H_UEE_Pos)                        /*!< USB1 USBINTR_H: UEE Mask            */\r
+#define USB1_USBINTR_H_PCE_Pos                                2                                                         /*!< USB1 USBINTR_H: PCE Position        */\r
+#define USB1_USBINTR_H_PCE_Msk                                (0x01UL << USB1_USBINTR_H_PCE_Pos)                        /*!< USB1 USBINTR_H: PCE Mask            */\r
+#define USB1_USBINTR_H_FRE_Pos                                3                                                         /*!< USB1 USBINTR_H: FRE Position        */\r
+#define USB1_USBINTR_H_FRE_Msk                                (0x01UL << USB1_USBINTR_H_FRE_Pos)                        /*!< USB1 USBINTR_H: FRE Mask            */\r
+#define USB1_USBINTR_H_AAE_Pos                                5                                                         /*!< USB1 USBINTR_H: AAE Position        */\r
+#define USB1_USBINTR_H_AAE_Msk                                (0x01UL << USB1_USBINTR_H_AAE_Pos)                        /*!< USB1 USBINTR_H: AAE Mask            */\r
+#define USB1_USBINTR_H_SRE_Pos                                7                                                         /*!< USB1 USBINTR_H: SRE Position        */\r
+#define USB1_USBINTR_H_SRE_Msk                                (0x01UL << USB1_USBINTR_H_SRE_Pos)                        /*!< USB1 USBINTR_H: SRE Mask            */\r
+#define USB1_USBINTR_H_UAIE_Pos                               18                                                        /*!< USB1 USBINTR_H: UAIE Position       */\r
+#define USB1_USBINTR_H_UAIE_Msk                               (0x01UL << USB1_USBINTR_H_UAIE_Pos)                       /*!< USB1 USBINTR_H: UAIE Mask           */\r
+#define USB1_USBINTR_H_UPIA_Pos                               19                                                        /*!< USB1 USBINTR_H: UPIA Position       */\r
+#define USB1_USBINTR_H_UPIA_Msk                               (0x01UL << USB1_USBINTR_H_UPIA_Pos)                       /*!< USB1 USBINTR_H: UPIA Mask           */\r
+\r
+// -------------------------------------  USB1_FRINDEX_D  -----------------------------------------\r
+#define USB1_FRINDEX_D_FRINDEX2_0_Pos                         0                                                         /*!< USB1 FRINDEX_D: FRINDEX2_0 Position */\r
+#define USB1_FRINDEX_D_FRINDEX2_0_Msk                         (0x07UL << USB1_FRINDEX_D_FRINDEX2_0_Pos)                 /*!< USB1 FRINDEX_D: FRINDEX2_0 Mask     */\r
+#define USB1_FRINDEX_D_FRINDEX13_3_Pos                        3                                                         /*!< USB1 FRINDEX_D: FRINDEX13_3 Position */\r
+#define USB1_FRINDEX_D_FRINDEX13_3_Msk                        (0x000007ffUL << USB1_FRINDEX_D_FRINDEX13_3_Pos)          /*!< USB1 FRINDEX_D: FRINDEX13_3 Mask    */\r
+\r
+// -------------------------------------  USB1_FRINDEX_H  -----------------------------------------\r
+#define USB1_FRINDEX_H_FRINDEX2_0_Pos                         0                                                         /*!< USB1 FRINDEX_H: FRINDEX2_0 Position */\r
+#define USB1_FRINDEX_H_FRINDEX2_0_Msk                         (0x07UL << USB1_FRINDEX_H_FRINDEX2_0_Pos)                 /*!< USB1 FRINDEX_H: FRINDEX2_0 Mask     */\r
+#define USB1_FRINDEX_H_FRINDEX12_3_Pos                        3                                                         /*!< USB1 FRINDEX_H: FRINDEX12_3 Position */\r
+#define USB1_FRINDEX_H_FRINDEX12_3_Msk                        (0x000003ffUL << USB1_FRINDEX_H_FRINDEX12_3_Pos)          /*!< USB1 FRINDEX_H: FRINDEX12_3 Mask    */\r
+\r
+// -------------------------------------  USB1_DEVICEADDR  ----------------------------------------\r
+#define USB1_DEVICEADDR_USBADRA_Pos                           24                                                        /*!< USB1 DEVICEADDR: USBADRA Position   */\r
+#define USB1_DEVICEADDR_USBADRA_Msk                           (0x01UL << USB1_DEVICEADDR_USBADRA_Pos)                   /*!< USB1 DEVICEADDR: USBADRA Mask       */\r
+#define USB1_DEVICEADDR_USBADR_Pos                            25                                                        /*!< USB1 DEVICEADDR: USBADR Position    */\r
+#define USB1_DEVICEADDR_USBADR_Msk                            (0x7fUL << USB1_DEVICEADDR_USBADR_Pos)                    /*!< USB1 DEVICEADDR: USBADR Mask        */\r
+\r
+// ----------------------------------  USB1_PERIODICLISTBASE  -------------------------------------\r
+#define USB1_PERIODICLISTBASE_PERBASE31_12_Pos                12                                                        /*!< USB1 PERIODICLISTBASE: PERBASE31_12 Position */\r
+#define USB1_PERIODICLISTBASE_PERBASE31_12_Msk                (0x000fffffUL << USB1_PERIODICLISTBASE_PERBASE31_12_Pos)  /*!< USB1 PERIODICLISTBASE: PERBASE31_12 Mask */\r
+\r
+// ----------------------------------  USB1_ENDPOINTLISTADDR  -------------------------------------\r
+#define USB1_ENDPOINTLISTADDR_EPBASE31_11_Pos                 11                                                        /*!< USB1 ENDPOINTLISTADDR: EPBASE31_11 Position */\r
+#define USB1_ENDPOINTLISTADDR_EPBASE31_11_Msk                 (0x001fffffUL << USB1_ENDPOINTLISTADDR_EPBASE31_11_Pos)   /*!< USB1 ENDPOINTLISTADDR: EPBASE31_11 Mask */\r
+\r
+// -----------------------------------  USB1_ASYNCLISTADDR  ---------------------------------------\r
+#define USB1_ASYNCLISTADDR_ASYBASE31_5_Pos                    5                                                         /*!< USB1 ASYNCLISTADDR: ASYBASE31_5 Position */\r
+#define USB1_ASYNCLISTADDR_ASYBASE31_5_Msk                    (0x07ffffffUL << USB1_ASYNCLISTADDR_ASYBASE31_5_Pos)      /*!< USB1 ASYNCLISTADDR: ASYBASE31_5 Mask */\r
+\r
+// ---------------------------------------  USB1_TTCTRL  ------------------------------------------\r
+#define USB1_TTCTRL_TTHA_Pos                                  24                                                        /*!< USB1 TTCTRL: TTHA Position          */\r
+#define USB1_TTCTRL_TTHA_Msk                                  (0x7fUL << USB1_TTCTRL_TTHA_Pos)                          /*!< USB1 TTCTRL: TTHA Mask              */\r
+\r
+// -------------------------------------  USB1_BURSTSIZE  -----------------------------------------\r
+#define USB1_BURSTSIZE_RXPBURST_Pos                           0                                                         /*!< USB1 BURSTSIZE: RXPBURST Position   */\r
+#define USB1_BURSTSIZE_RXPBURST_Msk                           (0x000000ffUL << USB1_BURSTSIZE_RXPBURST_Pos)             /*!< USB1 BURSTSIZE: RXPBURST Mask       */\r
+#define USB1_BURSTSIZE_TXPBURST_Pos                           8                                                         /*!< USB1 BURSTSIZE: TXPBURST Position   */\r
+#define USB1_BURSTSIZE_TXPBURST_Msk                           (0x000000ffUL << USB1_BURSTSIZE_TXPBURST_Pos)             /*!< USB1 BURSTSIZE: TXPBURST Mask       */\r
+\r
+// ------------------------------------  USB1_TXFILLTUNING  ---------------------------------------\r
+#define USB1_TXFILLTUNING_TXSCHOH_Pos                         0                                                         /*!< USB1 TXFILLTUNING: TXSCHOH Position */\r
+#define USB1_TXFILLTUNING_TXSCHOH_Msk                         (0x000000ffUL << USB1_TXFILLTUNING_TXSCHOH_Pos)           /*!< USB1 TXFILLTUNING: TXSCHOH Mask     */\r
+#define USB1_TXFILLTUNING_TXSCHEATLTH_Pos                     8                                                         /*!< USB1 TXFILLTUNING: TXSCHEATLTH Position */\r
+#define USB1_TXFILLTUNING_TXSCHEATLTH_Msk                     (0x1fUL << USB1_TXFILLTUNING_TXSCHEATLTH_Pos)             /*!< USB1 TXFILLTUNING: TXSCHEATLTH Mask */\r
+#define USB1_TXFILLTUNING_TXFIFOTHRES_Pos                     16                                                        /*!< USB1 TXFILLTUNING: TXFIFOTHRES Position */\r
+#define USB1_TXFILLTUNING_TXFIFOTHRES_Msk                     (0x3fUL << USB1_TXFILLTUNING_TXFIFOTHRES_Pos)             /*!< USB1 TXFILLTUNING: TXFIFOTHRES Mask */\r
+\r
+// ------------------------------------  USB1_ULPIVIEWPORT  ---------------------------------------\r
+#define USB1_ULPIVIEWPORT_ULPIDATWR_Pos                       0                                                         /*!< USB1 ULPIVIEWPORT: ULPIDATWR Position */\r
+#define USB1_ULPIVIEWPORT_ULPIDATWR_Msk                       (0x000000ffUL << USB1_ULPIVIEWPORT_ULPIDATWR_Pos)         /*!< USB1 ULPIVIEWPORT: ULPIDATWR Mask   */\r
+#define USB1_ULPIVIEWPORT_ULPIDATRD_Pos                       8                                                         /*!< USB1 ULPIVIEWPORT: ULPIDATRD Position */\r
+#define USB1_ULPIVIEWPORT_ULPIDATRD_Msk                       (0x000000ffUL << USB1_ULPIVIEWPORT_ULPIDATRD_Pos)         /*!< USB1 ULPIVIEWPORT: ULPIDATRD Mask   */\r
+#define USB1_ULPIVIEWPORT_ULPIADDR_Pos                        16                                                        /*!< USB1 ULPIVIEWPORT: ULPIADDR Position */\r
+#define USB1_ULPIVIEWPORT_ULPIADDR_Msk                        (0x000000ffUL << USB1_ULPIVIEWPORT_ULPIADDR_Pos)          /*!< USB1 ULPIVIEWPORT: ULPIADDR Mask    */\r
+#define USB1_ULPIVIEWPORT_ULPIPORT_Pos                        24                                                        /*!< USB1 ULPIVIEWPORT: ULPIPORT Position */\r
+#define USB1_ULPIVIEWPORT_ULPIPORT_Msk                        (0x07UL << USB1_ULPIVIEWPORT_ULPIPORT_Pos)                /*!< USB1 ULPIVIEWPORT: ULPIPORT Mask    */\r
+#define USB1_ULPIVIEWPORT_ULPISS_Pos                          27                                                        /*!< USB1 ULPIVIEWPORT: ULPISS Position  */\r
+#define USB1_ULPIVIEWPORT_ULPISS_Msk                          (0x01UL << USB1_ULPIVIEWPORT_ULPISS_Pos)                  /*!< USB1 ULPIVIEWPORT: ULPISS Mask      */\r
+#define USB1_ULPIVIEWPORT_ULPIRW_Pos                          29                                                        /*!< USB1 ULPIVIEWPORT: ULPIRW Position  */\r
+#define USB1_ULPIVIEWPORT_ULPIRW_Msk                          (0x01UL << USB1_ULPIVIEWPORT_ULPIRW_Pos)                  /*!< USB1 ULPIVIEWPORT: ULPIRW Mask      */\r
+#define USB1_ULPIVIEWPORT_ULPIRUN_Pos                         30                                                        /*!< USB1 ULPIVIEWPORT: ULPIRUN Position */\r
+#define USB1_ULPIVIEWPORT_ULPIRUN_Msk                         (0x01UL << USB1_ULPIVIEWPORT_ULPIRUN_Pos)                 /*!< USB1 ULPIVIEWPORT: ULPIRUN Mask     */\r
+#define USB1_ULPIVIEWPORT_ULPIWU_Pos                          31                                                        /*!< USB1 ULPIVIEWPORT: ULPIWU Position  */\r
+#define USB1_ULPIVIEWPORT_ULPIWU_Msk                          (0x01UL << USB1_ULPIVIEWPORT_ULPIWU_Pos)                  /*!< USB1 ULPIVIEWPORT: ULPIWU Mask      */\r
+\r
+// -------------------------------------  USB1_BINTERVAL  -----------------------------------------\r
+#define USB1_BINTERVAL_BINT_Pos                               0                                                         /*!< USB1 BINTERVAL: BINT Position       */\r
+#define USB1_BINTERVAL_BINT_Msk                               (0x0fUL << USB1_BINTERVAL_BINT_Pos)                       /*!< USB1 BINTERVAL: BINT Mask           */\r
+\r
+// --------------------------------------  USB1_ENDPTNAK  -----------------------------------------\r
+#define USB1_ENDPTNAK_EPRN0_Pos                               0                                                         /*!< USB1 ENDPTNAK: EPRN0 Position       */\r
+#define USB1_ENDPTNAK_EPRN0_Msk                               (0x01UL << USB1_ENDPTNAK_EPRN0_Pos)                       /*!< USB1 ENDPTNAK: EPRN0 Mask           */\r
+#define USB1_ENDPTNAK_EPRN1_Pos                               1                                                         /*!< USB1 ENDPTNAK: EPRN1 Position       */\r
+#define USB1_ENDPTNAK_EPRN1_Msk                               (0x01UL << USB1_ENDPTNAK_EPRN1_Pos)                       /*!< USB1 ENDPTNAK: EPRN1 Mask           */\r
+#define USB1_ENDPTNAK_EPRN2_Pos                               2                                                         /*!< USB1 ENDPTNAK: EPRN2 Position       */\r
+#define USB1_ENDPTNAK_EPRN2_Msk                               (0x01UL << USB1_ENDPTNAK_EPRN2_Pos)                       /*!< USB1 ENDPTNAK: EPRN2 Mask           */\r
+#define USB1_ENDPTNAK_EPRN3_Pos                               3                                                         /*!< USB1 ENDPTNAK: EPRN3 Position       */\r
+#define USB1_ENDPTNAK_EPRN3_Msk                               (0x01UL << USB1_ENDPTNAK_EPRN3_Pos)                       /*!< USB1 ENDPTNAK: EPRN3 Mask           */\r
+#define USB1_ENDPTNAK_EPTN16_Pos                              16                                                        /*!< USB1 ENDPTNAK: EPTN16 Position      */\r
+#define USB1_ENDPTNAK_EPTN16_Msk                              (0x01UL << USB1_ENDPTNAK_EPTN16_Pos)                      /*!< USB1 ENDPTNAK: EPTN16 Mask          */\r
+#define USB1_ENDPTNAK_EPTN17_Pos                              17                                                        /*!< USB1 ENDPTNAK: EPTN17 Position      */\r
+#define USB1_ENDPTNAK_EPTN17_Msk                              (0x01UL << USB1_ENDPTNAK_EPTN17_Pos)                      /*!< USB1 ENDPTNAK: EPTN17 Mask          */\r
+#define USB1_ENDPTNAK_EPTN18_Pos                              18                                                        /*!< USB1 ENDPTNAK: EPTN18 Position      */\r
+#define USB1_ENDPTNAK_EPTN18_Msk                              (0x01UL << USB1_ENDPTNAK_EPTN18_Pos)                      /*!< USB1 ENDPTNAK: EPTN18 Mask          */\r
+#define USB1_ENDPTNAK_EPTN19_Pos                              19                                                        /*!< USB1 ENDPTNAK: EPTN19 Position      */\r
+#define USB1_ENDPTNAK_EPTN19_Msk                              (0x01UL << USB1_ENDPTNAK_EPTN19_Pos)                      /*!< USB1 ENDPTNAK: EPTN19 Mask          */\r
+\r
+// -------------------------------------  USB1_ENDPTNAKEN  ----------------------------------------\r
+#define USB1_ENDPTNAKEN_EPRNE0_Pos                            0                                                         /*!< USB1 ENDPTNAKEN: EPRNE0 Position    */\r
+#define USB1_ENDPTNAKEN_EPRNE0_Msk                            (0x01UL << USB1_ENDPTNAKEN_EPRNE0_Pos)                    /*!< USB1 ENDPTNAKEN: EPRNE0 Mask        */\r
+#define USB1_ENDPTNAKEN_EPRNE1_Pos                            1                                                         /*!< USB1 ENDPTNAKEN: EPRNE1 Position    */\r
+#define USB1_ENDPTNAKEN_EPRNE1_Msk                            (0x01UL << USB1_ENDPTNAKEN_EPRNE1_Pos)                    /*!< USB1 ENDPTNAKEN: EPRNE1 Mask        */\r
+#define USB1_ENDPTNAKEN_EPRNE2_Pos                            2                                                         /*!< USB1 ENDPTNAKEN: EPRNE2 Position    */\r
+#define USB1_ENDPTNAKEN_EPRNE2_Msk                            (0x01UL << USB1_ENDPTNAKEN_EPRNE2_Pos)                    /*!< USB1 ENDPTNAKEN: EPRNE2 Mask        */\r
+#define USB1_ENDPTNAKEN_EPRNE3_Pos                            3                                                         /*!< USB1 ENDPTNAKEN: EPRNE3 Position    */\r
+#define USB1_ENDPTNAKEN_EPRNE3_Msk                            (0x01UL << USB1_ENDPTNAKEN_EPRNE3_Pos)                    /*!< USB1 ENDPTNAKEN: EPRNE3 Mask        */\r
+#define USB1_ENDPTNAKEN_EPTNE16_Pos                           16                                                        /*!< USB1 ENDPTNAKEN: EPTNE16 Position   */\r
+#define USB1_ENDPTNAKEN_EPTNE16_Msk                           (0x01UL << USB1_ENDPTNAKEN_EPTNE16_Pos)                   /*!< USB1 ENDPTNAKEN: EPTNE16 Mask       */\r
+#define USB1_ENDPTNAKEN_EPTNE17_Pos                           17                                                        /*!< USB1 ENDPTNAKEN: EPTNE17 Position   */\r
+#define USB1_ENDPTNAKEN_EPTNE17_Msk                           (0x01UL << USB1_ENDPTNAKEN_EPTNE17_Pos)                   /*!< USB1 ENDPTNAKEN: EPTNE17 Mask       */\r
+#define USB1_ENDPTNAKEN_EPTNE18_Pos                           18                                                        /*!< USB1 ENDPTNAKEN: EPTNE18 Position   */\r
+#define USB1_ENDPTNAKEN_EPTNE18_Msk                           (0x01UL << USB1_ENDPTNAKEN_EPTNE18_Pos)                   /*!< USB1 ENDPTNAKEN: EPTNE18 Mask       */\r
+#define USB1_ENDPTNAKEN_EPTNE19_Pos                           19                                                        /*!< USB1 ENDPTNAKEN: EPTNE19 Position   */\r
+#define USB1_ENDPTNAKEN_EPTNE19_Msk                           (0x01UL << USB1_ENDPTNAKEN_EPTNE19_Pos)                   /*!< USB1 ENDPTNAKEN: EPTNE19 Mask       */\r
+\r
+// -------------------------------------  USB1_PORTSC1_D  -----------------------------------------\r
+#define USB1_PORTSC1_D_CCS_Pos                                0                                                         /*!< USB1 PORTSC1_D: CCS Position        */\r
+#define USB1_PORTSC1_D_CCS_Msk                                (0x01UL << USB1_PORTSC1_D_CCS_Pos)                        /*!< USB1 PORTSC1_D: CCS Mask            */\r
+#define USB1_PORTSC1_D_CSC_Pos                                1                                                         /*!< USB1 PORTSC1_D: CSC Position        */\r
+#define USB1_PORTSC1_D_CSC_Msk                                (0x01UL << USB1_PORTSC1_D_CSC_Pos)                        /*!< USB1 PORTSC1_D: CSC Mask            */\r
+#define USB1_PORTSC1_D_PE_Pos                                 2                                                         /*!< USB1 PORTSC1_D: PE Position         */\r
+#define USB1_PORTSC1_D_PE_Msk                                 (0x01UL << USB1_PORTSC1_D_PE_Pos)                         /*!< USB1 PORTSC1_D: PE Mask             */\r
+#define USB1_PORTSC1_D_PEC_Pos                                3                                                         /*!< USB1 PORTSC1_D: PEC Position        */\r
+#define USB1_PORTSC1_D_PEC_Msk                                (0x01UL << USB1_PORTSC1_D_PEC_Pos)                        /*!< USB1 PORTSC1_D: PEC Mask            */\r
+#define USB1_PORTSC1_D_FPR_Pos                                6                                                         /*!< USB1 PORTSC1_D: FPR Position        */\r
+#define USB1_PORTSC1_D_FPR_Msk                                (0x01UL << USB1_PORTSC1_D_FPR_Pos)                        /*!< USB1 PORTSC1_D: FPR Mask            */\r
+#define USB1_PORTSC1_D_SUSP_Pos                               7                                                         /*!< USB1 PORTSC1_D: SUSP Position       */\r
+#define USB1_PORTSC1_D_SUSP_Msk                               (0x01UL << USB1_PORTSC1_D_SUSP_Pos)                       /*!< USB1 PORTSC1_D: SUSP Mask           */\r
+#define USB1_PORTSC1_D_PR_Pos                                 8                                                         /*!< USB1 PORTSC1_D: PR Position         */\r
+#define USB1_PORTSC1_D_PR_Msk                                 (0x01UL << USB1_PORTSC1_D_PR_Pos)                         /*!< USB1 PORTSC1_D: PR Mask             */\r
+#define USB1_PORTSC1_D_HSP_Pos                                9                                                         /*!< USB1 PORTSC1_D: HSP Position        */\r
+#define USB1_PORTSC1_D_HSP_Msk                                (0x01UL << USB1_PORTSC1_D_HSP_Pos)                        /*!< USB1 PORTSC1_D: HSP Mask            */\r
+#define USB1_PORTSC1_D_LS_Pos                                 10                                                        /*!< USB1 PORTSC1_D: LS Position         */\r
+#define USB1_PORTSC1_D_LS_Msk                                 (0x03UL << USB1_PORTSC1_D_LS_Pos)                         /*!< USB1 PORTSC1_D: LS Mask             */\r
+#define USB1_PORTSC1_D_PP_Pos                                 12                                                        /*!< USB1 PORTSC1_D: PP Position         */\r
+#define USB1_PORTSC1_D_PP_Msk                                 (0x01UL << USB1_PORTSC1_D_PP_Pos)                         /*!< USB1 PORTSC1_D: PP Mask             */\r
+#define USB1_PORTSC1_D_PIC1_0_Pos                             14                                                        /*!< USB1 PORTSC1_D: PIC1_0 Position     */\r
+#define USB1_PORTSC1_D_PIC1_0_Msk                             (0x03UL << USB1_PORTSC1_D_PIC1_0_Pos)                     /*!< USB1 PORTSC1_D: PIC1_0 Mask         */\r
+#define USB1_PORTSC1_D_PTC3_0_Pos                             16                                                        /*!< USB1 PORTSC1_D: PTC3_0 Position     */\r
+#define USB1_PORTSC1_D_PTC3_0_Msk                             (0x0fUL << USB1_PORTSC1_D_PTC3_0_Pos)                     /*!< USB1 PORTSC1_D: PTC3_0 Mask         */\r
+#define USB1_PORTSC1_D_PHCD_Pos                               23                                                        /*!< USB1 PORTSC1_D: PHCD Position       */\r
+#define USB1_PORTSC1_D_PHCD_Msk                               (0x01UL << USB1_PORTSC1_D_PHCD_Pos)                       /*!< USB1 PORTSC1_D: PHCD Mask           */\r
+#define USB1_PORTSC1_D_PFSC_Pos                               24                                                        /*!< USB1 PORTSC1_D: PFSC Position       */\r
+#define USB1_PORTSC1_D_PFSC_Msk                               (0x01UL << USB1_PORTSC1_D_PFSC_Pos)                       /*!< USB1 PORTSC1_D: PFSC Mask           */\r
+#define USB1_PORTSC1_D_PSPD_Pos                               26                                                        /*!< USB1 PORTSC1_D: PSPD Position       */\r
+#define USB1_PORTSC1_D_PSPD_Msk                               (0x03UL << USB1_PORTSC1_D_PSPD_Pos)                       /*!< USB1 PORTSC1_D: PSPD Mask           */\r
+#define USB1_PORTSC1_D_PTS_Pos                                30                                                        /*!< USB1 PORTSC1_D: PTS Position        */\r
+#define USB1_PORTSC1_D_PTS_Msk                                (0x03UL << USB1_PORTSC1_D_PTS_Pos)                        /*!< USB1 PORTSC1_D: PTS Mask            */\r
+\r
+// -------------------------------------  USB1_PORTSC1_H  -----------------------------------------\r
+#define USB1_PORTSC1_H_CCS_Pos                                0                                                         /*!< USB1 PORTSC1_H: CCS Position        */\r
+#define USB1_PORTSC1_H_CCS_Msk                                (0x01UL << USB1_PORTSC1_H_CCS_Pos)                        /*!< USB1 PORTSC1_H: CCS Mask            */\r
+#define USB1_PORTSC1_H_CSC_Pos                                1                                                         /*!< USB1 PORTSC1_H: CSC Position        */\r
+#define USB1_PORTSC1_H_CSC_Msk                                (0x01UL << USB1_PORTSC1_H_CSC_Pos)                        /*!< USB1 PORTSC1_H: CSC Mask            */\r
+#define USB1_PORTSC1_H_PE_Pos                                 2                                                         /*!< USB1 PORTSC1_H: PE Position         */\r
+#define USB1_PORTSC1_H_PE_Msk                                 (0x01UL << USB1_PORTSC1_H_PE_Pos)                         /*!< USB1 PORTSC1_H: PE Mask             */\r
+#define USB1_PORTSC1_H_PEC_Pos                                3                                                         /*!< USB1 PORTSC1_H: PEC Position        */\r
+#define USB1_PORTSC1_H_PEC_Msk                                (0x01UL << USB1_PORTSC1_H_PEC_Pos)                        /*!< USB1 PORTSC1_H: PEC Mask            */\r
+#define USB1_PORTSC1_H_OCA_Pos                                4                                                         /*!< USB1 PORTSC1_H: OCA Position        */\r
+#define USB1_PORTSC1_H_OCA_Msk                                (0x01UL << USB1_PORTSC1_H_OCA_Pos)                        /*!< USB1 PORTSC1_H: OCA Mask            */\r
+#define USB1_PORTSC1_H_OCC_Pos                                5                                                         /*!< USB1 PORTSC1_H: OCC Position        */\r
+#define USB1_PORTSC1_H_OCC_Msk                                (0x01UL << USB1_PORTSC1_H_OCC_Pos)                        /*!< USB1 PORTSC1_H: OCC Mask            */\r
+#define USB1_PORTSC1_H_FPR_Pos                                6                                                         /*!< USB1 PORTSC1_H: FPR Position        */\r
+#define USB1_PORTSC1_H_FPR_Msk                                (0x01UL << USB1_PORTSC1_H_FPR_Pos)                        /*!< USB1 PORTSC1_H: FPR Mask            */\r
+#define USB1_PORTSC1_H_SUSP_Pos                               7                                                         /*!< USB1 PORTSC1_H: SUSP Position       */\r
+#define USB1_PORTSC1_H_SUSP_Msk                               (0x01UL << USB1_PORTSC1_H_SUSP_Pos)                       /*!< USB1 PORTSC1_H: SUSP Mask           */\r
+#define USB1_PORTSC1_H_PR_Pos                                 8                                                         /*!< USB1 PORTSC1_H: PR Position         */\r
+#define USB1_PORTSC1_H_PR_Msk                                 (0x01UL << USB1_PORTSC1_H_PR_Pos)                         /*!< USB1 PORTSC1_H: PR Mask             */\r
+#define USB1_PORTSC1_H_HSP_Pos                                9                                                         /*!< USB1 PORTSC1_H: HSP Position        */\r
+#define USB1_PORTSC1_H_HSP_Msk                                (0x01UL << USB1_PORTSC1_H_HSP_Pos)                        /*!< USB1 PORTSC1_H: HSP Mask            */\r
+#define USB1_PORTSC1_H_LS_Pos                                 10                                                        /*!< USB1 PORTSC1_H: LS Position         */\r
+#define USB1_PORTSC1_H_LS_Msk                                 (0x03UL << USB1_PORTSC1_H_LS_Pos)                         /*!< USB1 PORTSC1_H: LS Mask             */\r
+#define USB1_PORTSC1_H_PP_Pos                                 12                                                        /*!< USB1 PORTSC1_H: PP Position         */\r
+#define USB1_PORTSC1_H_PP_Msk                                 (0x01UL << USB1_PORTSC1_H_PP_Pos)                         /*!< USB1 PORTSC1_H: PP Mask             */\r
+#define USB1_PORTSC1_H_PIC1_0_Pos                             14                                                        /*!< USB1 PORTSC1_H: PIC1_0 Position     */\r
+#define USB1_PORTSC1_H_PIC1_0_Msk                             (0x03UL << USB1_PORTSC1_H_PIC1_0_Pos)                     /*!< USB1 PORTSC1_H: PIC1_0 Mask         */\r
+#define USB1_PORTSC1_H_PTC3_0_Pos                             16                                                        /*!< USB1 PORTSC1_H: PTC3_0 Position     */\r
+#define USB1_PORTSC1_H_PTC3_0_Msk                             (0x0fUL << USB1_PORTSC1_H_PTC3_0_Pos)                     /*!< USB1 PORTSC1_H: PTC3_0 Mask         */\r
+#define USB1_PORTSC1_H_WKCN_Pos                               20                                                        /*!< USB1 PORTSC1_H: WKCN Position       */\r
+#define USB1_PORTSC1_H_WKCN_Msk                               (0x01UL << USB1_PORTSC1_H_WKCN_Pos)                       /*!< USB1 PORTSC1_H: WKCN Mask           */\r
+#define USB1_PORTSC1_H_WKDC_Pos                               21                                                        /*!< USB1 PORTSC1_H: WKDC Position       */\r
+#define USB1_PORTSC1_H_WKDC_Msk                               (0x01UL << USB1_PORTSC1_H_WKDC_Pos)                       /*!< USB1 PORTSC1_H: WKDC Mask           */\r
+#define USB1_PORTSC1_H_WKOC_Pos                               22                                                        /*!< USB1 PORTSC1_H: WKOC Position       */\r
+#define USB1_PORTSC1_H_WKOC_Msk                               (0x01UL << USB1_PORTSC1_H_WKOC_Pos)                       /*!< USB1 PORTSC1_H: WKOC Mask           */\r
+#define USB1_PORTSC1_H_PHCD_Pos                               23                                                        /*!< USB1 PORTSC1_H: PHCD Position       */\r
+#define USB1_PORTSC1_H_PHCD_Msk                               (0x01UL << USB1_PORTSC1_H_PHCD_Pos)                       /*!< USB1 PORTSC1_H: PHCD Mask           */\r
+#define USB1_PORTSC1_H_PFSC_Pos                               24                                                        /*!< USB1 PORTSC1_H: PFSC Position       */\r
+#define USB1_PORTSC1_H_PFSC_Msk                               (0x01UL << USB1_PORTSC1_H_PFSC_Pos)                       /*!< USB1 PORTSC1_H: PFSC Mask           */\r
+#define USB1_PORTSC1_H_PSPD_Pos                               26                                                        /*!< USB1 PORTSC1_H: PSPD Position       */\r
+#define USB1_PORTSC1_H_PSPD_Msk                               (0x03UL << USB1_PORTSC1_H_PSPD_Pos)                       /*!< USB1 PORTSC1_H: PSPD Mask           */\r
+#define USB1_PORTSC1_H_PTS_Pos                                30                                                        /*!< USB1 PORTSC1_H: PTS Position        */\r
+#define USB1_PORTSC1_H_PTS_Msk                                (0x03UL << USB1_PORTSC1_H_PTS_Pos)                        /*!< USB1 PORTSC1_H: PTS Mask            */\r
+\r
+// -------------------------------------  USB1_USBMODE_D  -----------------------------------------\r
+#define USB1_USBMODE_D_CM1_0_Pos                              0                                                         /*!< USB1 USBMODE_D: CM1_0 Position      */\r
+#define USB1_USBMODE_D_CM1_0_Msk                              (0x03UL << USB1_USBMODE_D_CM1_0_Pos)                      /*!< USB1 USBMODE_D: CM1_0 Mask          */\r
+#define USB1_USBMODE_D_ES_Pos                                 2                                                         /*!< USB1 USBMODE_D: ES Position         */\r
+#define USB1_USBMODE_D_ES_Msk                                 (0x01UL << USB1_USBMODE_D_ES_Pos)                         /*!< USB1 USBMODE_D: ES Mask             */\r
+#define USB1_USBMODE_D_SLOM_Pos                               3                                                         /*!< USB1 USBMODE_D: SLOM Position       */\r
+#define USB1_USBMODE_D_SLOM_Msk                               (0x01UL << USB1_USBMODE_D_SLOM_Pos)                       /*!< USB1 USBMODE_D: SLOM Mask           */\r
+#define USB1_USBMODE_D_SDIS_Pos                               4                                                         /*!< USB1 USBMODE_D: SDIS Position       */\r
+#define USB1_USBMODE_D_SDIS_Msk                               (0x01UL << USB1_USBMODE_D_SDIS_Pos)                       /*!< USB1 USBMODE_D: SDIS Mask           */\r
+\r
+// -------------------------------------  USB1_USBMODE_H  -----------------------------------------\r
+#define USB1_USBMODE_H_CM1_0_Pos                              0                                                         /*!< USB1 USBMODE_H: CM1_0 Position      */\r
+#define USB1_USBMODE_H_CM1_0_Msk                              (0x03UL << USB1_USBMODE_H_CM1_0_Pos)                      /*!< USB1 USBMODE_H: CM1_0 Mask          */\r
+#define USB1_USBMODE_H_ES_Pos                                 2                                                         /*!< USB1 USBMODE_H: ES Position         */\r
+#define USB1_USBMODE_H_ES_Msk                                 (0x01UL << USB1_USBMODE_H_ES_Pos)                         /*!< USB1 USBMODE_H: ES Mask             */\r
+#define USB1_USBMODE_H_SDIS_Pos                               4                                                         /*!< USB1 USBMODE_H: SDIS Position       */\r
+#define USB1_USBMODE_H_SDIS_Msk                               (0x01UL << USB1_USBMODE_H_SDIS_Pos)                       /*!< USB1 USBMODE_H: SDIS Mask           */\r
+#define USB1_USBMODE_H_VBPS_Pos                               5                                                         /*!< USB1 USBMODE_H: VBPS Position       */\r
+#define USB1_USBMODE_H_VBPS_Msk                               (0x01UL << USB1_USBMODE_H_VBPS_Pos)                       /*!< USB1 USBMODE_H: VBPS Mask           */\r
+\r
+// -----------------------------------  USB1_ENDPTSETUPSTAT  --------------------------------------\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Pos               0                                                         /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT0 Position */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Msk               (0x01UL << USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT0_Pos)       /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT0 Mask */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Pos               1                                                         /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT1 Position */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Msk               (0x01UL << USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT1_Pos)       /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT1 Mask */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Pos               2                                                         /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT2 Position */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Msk               (0x01UL << USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT2_Pos)       /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT2 Mask */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Pos               3                                                         /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT3 Position */\r
+#define USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Msk               (0x01UL << USB1_ENDPTSETUPSTAT_ENDPTSETUPSTAT3_Pos)       /*!< USB1 ENDPTSETUPSTAT: ENDPTSETUPSTAT3 Mask */\r
+\r
+// -------------------------------------  USB1_ENDPTPRIME  ----------------------------------------\r
+#define USB1_ENDPTPRIME_PERB0_Pos                             0                                                         /*!< USB1 ENDPTPRIME: PERB0 Position     */\r
+#define USB1_ENDPTPRIME_PERB0_Msk                             (0x01UL << USB1_ENDPTPRIME_PERB0_Pos)                     /*!< USB1 ENDPTPRIME: PERB0 Mask         */\r
+#define USB1_ENDPTPRIME_PERB1_Pos                             1                                                         /*!< USB1 ENDPTPRIME: PERB1 Position     */\r
+#define USB1_ENDPTPRIME_PERB1_Msk                             (0x01UL << USB1_ENDPTPRIME_PERB1_Pos)                     /*!< USB1 ENDPTPRIME: PERB1 Mask         */\r
+#define USB1_ENDPTPRIME_PERB2_Pos                             2                                                         /*!< USB1 ENDPTPRIME: PERB2 Position     */\r
+#define USB1_ENDPTPRIME_PERB2_Msk                             (0x01UL << USB1_ENDPTPRIME_PERB2_Pos)                     /*!< USB1 ENDPTPRIME: PERB2 Mask         */\r
+#define USB1_ENDPTPRIME_PERB3_Pos                             3                                                         /*!< USB1 ENDPTPRIME: PERB3 Position     */\r
+#define USB1_ENDPTPRIME_PERB3_Msk                             (0x01UL << USB1_ENDPTPRIME_PERB3_Pos)                     /*!< USB1 ENDPTPRIME: PERB3 Mask         */\r
+#define USB1_ENDPTPRIME_PETB0_Pos                             16                                                        /*!< USB1 ENDPTPRIME: PETB0 Position     */\r
+#define USB1_ENDPTPRIME_PETB0_Msk                             (0x01UL << USB1_ENDPTPRIME_PETB0_Pos)                     /*!< USB1 ENDPTPRIME: PETB0 Mask         */\r
+#define USB1_ENDPTPRIME_PETB1_Pos                             17                                                        /*!< USB1 ENDPTPRIME: PETB1 Position     */\r
+#define USB1_ENDPTPRIME_PETB1_Msk                             (0x01UL << USB1_ENDPTPRIME_PETB1_Pos)                     /*!< USB1 ENDPTPRIME: PETB1 Mask         */\r
+#define USB1_ENDPTPRIME_PETB2_Pos                             18                                                        /*!< USB1 ENDPTPRIME: PETB2 Position     */\r
+#define USB1_ENDPTPRIME_PETB2_Msk                             (0x01UL << USB1_ENDPTPRIME_PETB2_Pos)                     /*!< USB1 ENDPTPRIME: PETB2 Mask         */\r
+#define USB1_ENDPTPRIME_PETB3_Pos                             19                                                        /*!< USB1 ENDPTPRIME: PETB3 Position     */\r
+#define USB1_ENDPTPRIME_PETB3_Msk                             (0x01UL << USB1_ENDPTPRIME_PETB3_Pos)                     /*!< USB1 ENDPTPRIME: PETB3 Mask         */\r
+\r
+// -------------------------------------  USB1_ENDPTFLUSH  ----------------------------------------\r
+#define USB1_ENDPTFLUSH_FERB0_Pos                             0                                                         /*!< USB1 ENDPTFLUSH: FERB0 Position     */\r
+#define USB1_ENDPTFLUSH_FERB0_Msk                             (0x01UL << USB1_ENDPTFLUSH_FERB0_Pos)                     /*!< USB1 ENDPTFLUSH: FERB0 Mask         */\r
+#define USB1_ENDPTFLUSH_FERB1_Pos                             1                                                         /*!< USB1 ENDPTFLUSH: FERB1 Position     */\r
+#define USB1_ENDPTFLUSH_FERB1_Msk                             (0x01UL << USB1_ENDPTFLUSH_FERB1_Pos)                     /*!< USB1 ENDPTFLUSH: FERB1 Mask         */\r
+#define USB1_ENDPTFLUSH_FERB2_Pos                             2                                                         /*!< USB1 ENDPTFLUSH: FERB2 Position     */\r
+#define USB1_ENDPTFLUSH_FERB2_Msk                             (0x01UL << USB1_ENDPTFLUSH_FERB2_Pos)                     /*!< USB1 ENDPTFLUSH: FERB2 Mask         */\r
+#define USB1_ENDPTFLUSH_FERB3_Pos                             3                                                         /*!< USB1 ENDPTFLUSH: FERB3 Position     */\r
+#define USB1_ENDPTFLUSH_FERB3_Msk                             (0x01UL << USB1_ENDPTFLUSH_FERB3_Pos)                     /*!< USB1 ENDPTFLUSH: FERB3 Mask         */\r
+#define USB1_ENDPTFLUSH_FETB0_Pos                             16                                                        /*!< USB1 ENDPTFLUSH: FETB0 Position     */\r
+#define USB1_ENDPTFLUSH_FETB0_Msk                             (0x01UL << USB1_ENDPTFLUSH_FETB0_Pos)                     /*!< USB1 ENDPTFLUSH: FETB0 Mask         */\r
+#define USB1_ENDPTFLUSH_FETB1_Pos                             17                                                        /*!< USB1 ENDPTFLUSH: FETB1 Position     */\r
+#define USB1_ENDPTFLUSH_FETB1_Msk                             (0x01UL << USB1_ENDPTFLUSH_FETB1_Pos)                     /*!< USB1 ENDPTFLUSH: FETB1 Mask         */\r
+#define USB1_ENDPTFLUSH_FETB2_Pos                             18                                                        /*!< USB1 ENDPTFLUSH: FETB2 Position     */\r
+#define USB1_ENDPTFLUSH_FETB2_Msk                             (0x01UL << USB1_ENDPTFLUSH_FETB2_Pos)                     /*!< USB1 ENDPTFLUSH: FETB2 Mask         */\r
+#define USB1_ENDPTFLUSH_FETB3_Pos                             19                                                        /*!< USB1 ENDPTFLUSH: FETB3 Position     */\r
+#define USB1_ENDPTFLUSH_FETB3_Msk                             (0x01UL << USB1_ENDPTFLUSH_FETB3_Pos)                     /*!< USB1 ENDPTFLUSH: FETB3 Mask         */\r
+\r
+// -------------------------------------  USB1_ENDPTSTAT  -----------------------------------------\r
+#define USB1_ENDPTSTAT_ERBR0_Pos                              0                                                         /*!< USB1 ENDPTSTAT: ERBR0 Position      */\r
+#define USB1_ENDPTSTAT_ERBR0_Msk                              (0x01UL << USB1_ENDPTSTAT_ERBR0_Pos)                      /*!< USB1 ENDPTSTAT: ERBR0 Mask          */\r
+#define USB1_ENDPTSTAT_ERBR1_Pos                              1                                                         /*!< USB1 ENDPTSTAT: ERBR1 Position      */\r
+#define USB1_ENDPTSTAT_ERBR1_Msk                              (0x01UL << USB1_ENDPTSTAT_ERBR1_Pos)                      /*!< USB1 ENDPTSTAT: ERBR1 Mask          */\r
+#define USB1_ENDPTSTAT_ERBR2_Pos                              2                                                         /*!< USB1 ENDPTSTAT: ERBR2 Position      */\r
+#define USB1_ENDPTSTAT_ERBR2_Msk                              (0x01UL << USB1_ENDPTSTAT_ERBR2_Pos)                      /*!< USB1 ENDPTSTAT: ERBR2 Mask          */\r
+#define USB1_ENDPTSTAT_ERBR3_Pos                              3                                                         /*!< USB1 ENDPTSTAT: ERBR3 Position      */\r
+#define USB1_ENDPTSTAT_ERBR3_Msk                              (0x01UL << USB1_ENDPTSTAT_ERBR3_Pos)                      /*!< USB1 ENDPTSTAT: ERBR3 Mask          */\r
+#define USB1_ENDPTSTAT_ETBR0_Pos                              16                                                        /*!< USB1 ENDPTSTAT: ETBR0 Position      */\r
+#define USB1_ENDPTSTAT_ETBR0_Msk                              (0x01UL << USB1_ENDPTSTAT_ETBR0_Pos)                      /*!< USB1 ENDPTSTAT: ETBR0 Mask          */\r
+#define USB1_ENDPTSTAT_ETBR1_Pos                              17                                                        /*!< USB1 ENDPTSTAT: ETBR1 Position      */\r
+#define USB1_ENDPTSTAT_ETBR1_Msk                              (0x01UL << USB1_ENDPTSTAT_ETBR1_Pos)                      /*!< USB1 ENDPTSTAT: ETBR1 Mask          */\r
+#define USB1_ENDPTSTAT_ETBR2_Pos                              18                                                        /*!< USB1 ENDPTSTAT: ETBR2 Position      */\r
+#define USB1_ENDPTSTAT_ETBR2_Msk                              (0x01UL << USB1_ENDPTSTAT_ETBR2_Pos)                      /*!< USB1 ENDPTSTAT: ETBR2 Mask          */\r
+#define USB1_ENDPTSTAT_ETBR3_Pos                              19                                                        /*!< USB1 ENDPTSTAT: ETBR3 Position      */\r
+#define USB1_ENDPTSTAT_ETBR3_Msk                              (0x01UL << USB1_ENDPTSTAT_ETBR3_Pos)                      /*!< USB1 ENDPTSTAT: ETBR3 Mask          */\r
+\r
+// -----------------------------------  USB1_ENDPTCOMPLETE  ---------------------------------------\r
+#define USB1_ENDPTCOMPLETE_ERCE0_Pos                          0                                                         /*!< USB1 ENDPTCOMPLETE: ERCE0 Position  */\r
+#define USB1_ENDPTCOMPLETE_ERCE0_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ERCE0_Pos)                  /*!< USB1 ENDPTCOMPLETE: ERCE0 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ERCE1_Pos                          1                                                         /*!< USB1 ENDPTCOMPLETE: ERCE1 Position  */\r
+#define USB1_ENDPTCOMPLETE_ERCE1_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ERCE1_Pos)                  /*!< USB1 ENDPTCOMPLETE: ERCE1 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ERCE2_Pos                          2                                                         /*!< USB1 ENDPTCOMPLETE: ERCE2 Position  */\r
+#define USB1_ENDPTCOMPLETE_ERCE2_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ERCE2_Pos)                  /*!< USB1 ENDPTCOMPLETE: ERCE2 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ERCE3_Pos                          3                                                         /*!< USB1 ENDPTCOMPLETE: ERCE3 Position  */\r
+#define USB1_ENDPTCOMPLETE_ERCE3_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ERCE3_Pos)                  /*!< USB1 ENDPTCOMPLETE: ERCE3 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ETCE0_Pos                          16                                                        /*!< USB1 ENDPTCOMPLETE: ETCE0 Position  */\r
+#define USB1_ENDPTCOMPLETE_ETCE0_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ETCE0_Pos)                  /*!< USB1 ENDPTCOMPLETE: ETCE0 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ETCE1_Pos                          17                                                        /*!< USB1 ENDPTCOMPLETE: ETCE1 Position  */\r
+#define USB1_ENDPTCOMPLETE_ETCE1_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ETCE1_Pos)                  /*!< USB1 ENDPTCOMPLETE: ETCE1 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ETCE2_Pos                          18                                                        /*!< USB1 ENDPTCOMPLETE: ETCE2 Position  */\r
+#define USB1_ENDPTCOMPLETE_ETCE2_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ETCE2_Pos)                  /*!< USB1 ENDPTCOMPLETE: ETCE2 Mask      */\r
+#define USB1_ENDPTCOMPLETE_ETCE3_Pos                          19                                                        /*!< USB1 ENDPTCOMPLETE: ETCE3 Position  */\r
+#define USB1_ENDPTCOMPLETE_ETCE3_Msk                          (0x01UL << USB1_ENDPTCOMPLETE_ETCE3_Pos)                  /*!< USB1 ENDPTCOMPLETE: ETCE3 Mask      */\r
+\r
+// -------------------------------------  USB1_ENDPTCTRL0  ----------------------------------------\r
+#define USB1_ENDPTCTRL0_RXS_Pos                               0                                                         /*!< USB1 ENDPTCTRL0: RXS Position       */\r
+#define USB1_ENDPTCTRL0_RXS_Msk                               (0x01UL << USB1_ENDPTCTRL0_RXS_Pos)                       /*!< USB1 ENDPTCTRL0: RXS Mask           */\r
+#define USB1_ENDPTCTRL0_RXT_Pos                               2                                                         /*!< USB1 ENDPTCTRL0: RXT Position       */\r
+#define USB1_ENDPTCTRL0_RXT_Msk                               (0x03UL << USB1_ENDPTCTRL0_RXT_Pos)                       /*!< USB1 ENDPTCTRL0: RXT Mask           */\r
+#define USB1_ENDPTCTRL0_RXE_Pos                               7                                                         /*!< USB1 ENDPTCTRL0: RXE Position       */\r
+#define USB1_ENDPTCTRL0_RXE_Msk                               (0x01UL << USB1_ENDPTCTRL0_RXE_Pos)                       /*!< USB1 ENDPTCTRL0: RXE Mask           */\r
+#define USB1_ENDPTCTRL0_TXS_Pos                               16                                                        /*!< USB1 ENDPTCTRL0: TXS Position       */\r
+#define USB1_ENDPTCTRL0_TXS_Msk                               (0x01UL << USB1_ENDPTCTRL0_TXS_Pos)                       /*!< USB1 ENDPTCTRL0: TXS Mask           */\r
+#define USB1_ENDPTCTRL0_TXT_Pos                               18                                                        /*!< USB1 ENDPTCTRL0: TXT Position       */\r
+#define USB1_ENDPTCTRL0_TXT_Msk                               (0x03UL << USB1_ENDPTCTRL0_TXT_Pos)                       /*!< USB1 ENDPTCTRL0: TXT Mask           */\r
+#define USB1_ENDPTCTRL0_TXE_Pos                               23                                                        /*!< USB1 ENDPTCTRL0: TXE Position       */\r
+#define USB1_ENDPTCTRL0_TXE_Msk                               (0x01UL << USB1_ENDPTCTRL0_TXE_Pos)                       /*!< USB1 ENDPTCTRL0: TXE Mask           */\r
+\r
+// -------------------------------------  USB1_ENDPTCTRL1  ----------------------------------------\r
+#define USB1_ENDPTCTRL1_RXS_Pos                               0                                                         /*!< USB1 ENDPTCTRL1: RXS Position       */\r
+#define USB1_ENDPTCTRL1_RXS_Msk                               (0x01UL << USB1_ENDPTCTRL1_RXS_Pos)                       /*!< USB1 ENDPTCTRL1: RXS Mask           */\r
+#define USB1_ENDPTCTRL1_RXT_Pos                               2                                                         /*!< USB1 ENDPTCTRL1: RXT Position       */\r
+#define USB1_ENDPTCTRL1_RXT_Msk                               (0x03UL << USB1_ENDPTCTRL1_RXT_Pos)                       /*!< USB1 ENDPTCTRL1: RXT Mask           */\r
+#define USB1_ENDPTCTRL1_RXI_Pos                               5                                                         /*!< USB1 ENDPTCTRL1: RXI Position       */\r
+#define USB1_ENDPTCTRL1_RXI_Msk                               (0x01UL << USB1_ENDPTCTRL1_RXI_Pos)                       /*!< USB1 ENDPTCTRL1: RXI Mask           */\r
+#define USB1_ENDPTCTRL1_RXR_Pos                               6                                                         /*!< USB1 ENDPTCTRL1: RXR Position       */\r
+#define USB1_ENDPTCTRL1_RXR_Msk                               (0x01UL << USB1_ENDPTCTRL1_RXR_Pos)                       /*!< USB1 ENDPTCTRL1: RXR Mask           */\r
+#define USB1_ENDPTCTRL1_RXE_Pos                               7                                                         /*!< USB1 ENDPTCTRL1: RXE Position       */\r
+#define USB1_ENDPTCTRL1_RXE_Msk                               (0x01UL << USB1_ENDPTCTRL1_RXE_Pos)                       /*!< USB1 ENDPTCTRL1: RXE Mask           */\r
+#define USB1_ENDPTCTRL1_TXS_Pos                               16                                                        /*!< USB1 ENDPTCTRL1: TXS Position       */\r
+#define USB1_ENDPTCTRL1_TXS_Msk                               (0x01UL << USB1_ENDPTCTRL1_TXS_Pos)                       /*!< USB1 ENDPTCTRL1: TXS Mask           */\r
+#define USB1_ENDPTCTRL1_TXT_Pos                               18                                                        /*!< USB1 ENDPTCTRL1: TXT Position       */\r
+#define USB1_ENDPTCTRL1_TXT_Msk                               (0x03UL << USB1_ENDPTCTRL1_TXT_Pos)                       /*!< USB1 ENDPTCTRL1: TXT Mask           */\r
+#define USB1_ENDPTCTRL1_TXI_Pos                               21                                                        /*!< USB1 ENDPTCTRL1: TXI Position       */\r
+#define USB1_ENDPTCTRL1_TXI_Msk                               (0x01UL << USB1_ENDPTCTRL1_TXI_Pos)                       /*!< USB1 ENDPTCTRL1: TXI Mask           */\r
+#define USB1_ENDPTCTRL1_TXR_Pos                               22                                                        /*!< USB1 ENDPTCTRL1: TXR Position       */\r
+#define USB1_ENDPTCTRL1_TXR_Msk                               (0x01UL << USB1_ENDPTCTRL1_TXR_Pos)                       /*!< USB1 ENDPTCTRL1: TXR Mask           */\r
+#define USB1_ENDPTCTRL1_TXE_Pos                               23                                                        /*!< USB1 ENDPTCTRL1: TXE Position       */\r
+#define USB1_ENDPTCTRL1_TXE_Msk                               (0x01UL << USB1_ENDPTCTRL1_TXE_Pos)                       /*!< USB1 ENDPTCTRL1: TXE Mask           */\r
+\r
+// -------------------------------------  USB1_ENDPTCTRL2  ----------------------------------------\r
+#define USB1_ENDPTCTRL2_RXS_Pos                               0                                                         /*!< USB1 ENDPTCTRL2: RXS Position       */\r
+#define USB1_ENDPTCTRL2_RXS_Msk                               (0x01UL << USB1_ENDPTCTRL2_RXS_Pos)                       /*!< USB1 ENDPTCTRL2: RXS Mask           */\r
+#define USB1_ENDPTCTRL2_RXT_Pos                               2                                                         /*!< USB1 ENDPTCTRL2: RXT Position       */\r
+#define USB1_ENDPTCTRL2_RXT_Msk                               (0x03UL << USB1_ENDPTCTRL2_RXT_Pos)                       /*!< USB1 ENDPTCTRL2: RXT Mask           */\r
+#define USB1_ENDPTCTRL2_RXI_Pos                               5                                                         /*!< USB1 ENDPTCTRL2: RXI Position       */\r
+#define USB1_ENDPTCTRL2_RXI_Msk                               (0x01UL << USB1_ENDPTCTRL2_RXI_Pos)                       /*!< USB1 ENDPTCTRL2: RXI Mask           */\r
+#define USB1_ENDPTCTRL2_RXR_Pos                               6                                                         /*!< USB1 ENDPTCTRL2: RXR Position       */\r
+#define USB1_ENDPTCTRL2_RXR_Msk                               (0x01UL << USB1_ENDPTCTRL2_RXR_Pos)                       /*!< USB1 ENDPTCTRL2: RXR Mask           */\r
+#define USB1_ENDPTCTRL2_RXE_Pos                               7                                                         /*!< USB1 ENDPTCTRL2: RXE Position       */\r
+#define USB1_ENDPTCTRL2_RXE_Msk                               (0x01UL << USB1_ENDPTCTRL2_RXE_Pos)                       /*!< USB1 ENDPTCTRL2: RXE Mask           */\r
+#define USB1_ENDPTCTRL2_TXS_Pos                               16                                                        /*!< USB1 ENDPTCTRL2: TXS Position       */\r
+#define USB1_ENDPTCTRL2_TXS_Msk                               (0x01UL << USB1_ENDPTCTRL2_TXS_Pos)                       /*!< USB1 ENDPTCTRL2: TXS Mask           */\r
+#define USB1_ENDPTCTRL2_TXT_Pos                               18                                                        /*!< USB1 ENDPTCTRL2: TXT Position       */\r
+#define USB1_ENDPTCTRL2_TXT_Msk                               (0x03UL << USB1_ENDPTCTRL2_TXT_Pos)                       /*!< USB1 ENDPTCTRL2: TXT Mask           */\r
+#define USB1_ENDPTCTRL2_TXI_Pos                               21                                                        /*!< USB1 ENDPTCTRL2: TXI Position       */\r
+#define USB1_ENDPTCTRL2_TXI_Msk                               (0x01UL << USB1_ENDPTCTRL2_TXI_Pos)                       /*!< USB1 ENDPTCTRL2: TXI Mask           */\r
+#define USB1_ENDPTCTRL2_TXR_Pos                               22                                                        /*!< USB1 ENDPTCTRL2: TXR Position       */\r
+#define USB1_ENDPTCTRL2_TXR_Msk                               (0x01UL << USB1_ENDPTCTRL2_TXR_Pos)                       /*!< USB1 ENDPTCTRL2: TXR Mask           */\r
+#define USB1_ENDPTCTRL2_TXE_Pos                               23                                                        /*!< USB1 ENDPTCTRL2: TXE Position       */\r
+#define USB1_ENDPTCTRL2_TXE_Msk                               (0x01UL << USB1_ENDPTCTRL2_TXE_Pos)                       /*!< USB1 ENDPTCTRL2: TXE Mask           */\r
+\r
+// -------------------------------------  USB1_ENDPTCTRL3  ----------------------------------------\r
+#define USB1_ENDPTCTRL3_RXS_Pos                               0                                                         /*!< USB1 ENDPTCTRL3: RXS Position       */\r
+#define USB1_ENDPTCTRL3_RXS_Msk                               (0x01UL << USB1_ENDPTCTRL3_RXS_Pos)                       /*!< USB1 ENDPTCTRL3: RXS Mask           */\r
+#define USB1_ENDPTCTRL3_RXT_Pos                               2                                                         /*!< USB1 ENDPTCTRL3: RXT Position       */\r
+#define USB1_ENDPTCTRL3_RXT_Msk                               (0x03UL << USB1_ENDPTCTRL3_RXT_Pos)                       /*!< USB1 ENDPTCTRL3: RXT Mask           */\r
+#define USB1_ENDPTCTRL3_RXI_Pos                               5                                                         /*!< USB1 ENDPTCTRL3: RXI Position       */\r
+#define USB1_ENDPTCTRL3_RXI_Msk                               (0x01UL << USB1_ENDPTCTRL3_RXI_Pos)                       /*!< USB1 ENDPTCTRL3: RXI Mask           */\r
+#define USB1_ENDPTCTRL3_RXR_Pos                               6                                                         /*!< USB1 ENDPTCTRL3: RXR Position       */\r
+#define USB1_ENDPTCTRL3_RXR_Msk                               (0x01UL << USB1_ENDPTCTRL3_RXR_Pos)                       /*!< USB1 ENDPTCTRL3: RXR Mask           */\r
+#define USB1_ENDPTCTRL3_RXE_Pos                               7                                                         /*!< USB1 ENDPTCTRL3: RXE Position       */\r
+#define USB1_ENDPTCTRL3_RXE_Msk                               (0x01UL << USB1_ENDPTCTRL3_RXE_Pos)                       /*!< USB1 ENDPTCTRL3: RXE Mask           */\r
+#define USB1_ENDPTCTRL3_TXS_Pos                               16                                                        /*!< USB1 ENDPTCTRL3: TXS Position       */\r
+#define USB1_ENDPTCTRL3_TXS_Msk                               (0x01UL << USB1_ENDPTCTRL3_TXS_Pos)                       /*!< USB1 ENDPTCTRL3: TXS Mask           */\r
+#define USB1_ENDPTCTRL3_TXT_Pos                               18                                                        /*!< USB1 ENDPTCTRL3: TXT Position       */\r
+#define USB1_ENDPTCTRL3_TXT_Msk                               (0x03UL << USB1_ENDPTCTRL3_TXT_Pos)                       /*!< USB1 ENDPTCTRL3: TXT Mask           */\r
+#define USB1_ENDPTCTRL3_TXI_Pos                               21                                                        /*!< USB1 ENDPTCTRL3: TXI Position       */\r
+#define USB1_ENDPTCTRL3_TXI_Msk                               (0x01UL << USB1_ENDPTCTRL3_TXI_Pos)                       /*!< USB1 ENDPTCTRL3: TXI Mask           */\r
+#define USB1_ENDPTCTRL3_TXR_Pos                               22                                                        /*!< USB1 ENDPTCTRL3: TXR Position       */\r
+#define USB1_ENDPTCTRL3_TXR_Msk                               (0x01UL << USB1_ENDPTCTRL3_TXR_Pos)                       /*!< USB1 ENDPTCTRL3: TXR Mask           */\r
+#define USB1_ENDPTCTRL3_TXE_Pos                               23                                                        /*!< USB1 ENDPTCTRL3: TXE Position       */\r
+#define USB1_ENDPTCTRL3_TXE_Msk                               (0x01UL << USB1_ENDPTCTRL3_TXE_Pos)                       /*!< USB1 ENDPTCTRL3: TXE Mask           */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  LCD Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  LCD_TIMH  --------------------------------------------\r
+#define LCD_TIMH_PPL_Pos                                      2                                                         /*!< LCD TIMH: PPL Position              */\r
+#define LCD_TIMH_PPL_Msk                                      (0x3fUL << LCD_TIMH_PPL_Pos)                              /*!< LCD TIMH: PPL Mask                  */\r
+#define LCD_TIMH_HSW_Pos                                      8                                                         /*!< LCD TIMH: HSW Position              */\r
+#define LCD_TIMH_HSW_Msk                                      (0x000000ffUL << LCD_TIMH_HSW_Pos)                        /*!< LCD TIMH: HSW Mask                  */\r
+#define LCD_TIMH_HFP_Pos                                      16                                                        /*!< LCD TIMH: HFP Position              */\r
+#define LCD_TIMH_HFP_Msk                                      (0x000000ffUL << LCD_TIMH_HFP_Pos)                        /*!< LCD TIMH: HFP Mask                  */\r
+#define LCD_TIMH_HBP_Pos                                      24                                                        /*!< LCD TIMH: HBP Position              */\r
+#define LCD_TIMH_HBP_Msk                                      (0x000000ffUL << LCD_TIMH_HBP_Pos)                        /*!< LCD TIMH: HBP Mask                  */\r
+\r
+// ----------------------------------------  LCD_TIMV  --------------------------------------------\r
+#define LCD_TIMV_LPP_Pos                                      0                                                         /*!< LCD TIMV: LPP Position              */\r
+#define LCD_TIMV_LPP_Msk                                      (0x000003ffUL << LCD_TIMV_LPP_Pos)                        /*!< LCD TIMV: LPP Mask                  */\r
+#define LCD_TIMV_VSW_Pos                                      10                                                        /*!< LCD TIMV: VSW Position              */\r
+#define LCD_TIMV_VSW_Msk                                      (0x3fUL << LCD_TIMV_VSW_Pos)                              /*!< LCD TIMV: VSW Mask                  */\r
+#define LCD_TIMV_VFP_Pos                                      16                                                        /*!< LCD TIMV: VFP Position              */\r
+#define LCD_TIMV_VFP_Msk                                      (0x000000ffUL << LCD_TIMV_VFP_Pos)                        /*!< LCD TIMV: VFP Mask                  */\r
+#define LCD_TIMV_VBP_Pos                                      24                                                        /*!< LCD TIMV: VBP Position              */\r
+#define LCD_TIMV_VBP_Msk                                      (0x000000ffUL << LCD_TIMV_VBP_Pos)                        /*!< LCD TIMV: VBP Mask                  */\r
+\r
+// -----------------------------------------  LCD_POL  --------------------------------------------\r
+#define LCD_POL_PCD_LO_Pos                                    0                                                         /*!< LCD POL: PCD_LO Position            */\r
+#define LCD_POL_PCD_LO_Msk                                    (0x1fUL << LCD_POL_PCD_LO_Pos)                            /*!< LCD POL: PCD_LO Mask                */\r
+#define LCD_POL_CLKSEL_Pos                                    5                                                         /*!< LCD POL: CLKSEL Position            */\r
+#define LCD_POL_CLKSEL_Msk                                    (0x01UL << LCD_POL_CLKSEL_Pos)                            /*!< LCD POL: CLKSEL Mask                */\r
+#define LCD_POL_ACB_Pos                                       6                                                         /*!< LCD POL: ACB Position               */\r
+#define LCD_POL_ACB_Msk                                       (0x1fUL << LCD_POL_ACB_Pos)                               /*!< LCD POL: ACB Mask                   */\r
+#define LCD_POL_IVS_Pos                                       11                                                        /*!< LCD POL: IVS Position               */\r
+#define LCD_POL_IVS_Msk                                       (0x01UL << LCD_POL_IVS_Pos)                               /*!< LCD POL: IVS Mask                   */\r
+#define LCD_POL_IHS_Pos                                       12                                                        /*!< LCD POL: IHS Position               */\r
+#define LCD_POL_IHS_Msk                                       (0x01UL << LCD_POL_IHS_Pos)                               /*!< LCD POL: IHS Mask                   */\r
+#define LCD_POL_IPC_Pos                                       13                                                        /*!< LCD POL: IPC Position               */\r
+#define LCD_POL_IPC_Msk                                       (0x01UL << LCD_POL_IPC_Pos)                               /*!< LCD POL: IPC Mask                   */\r
+#define LCD_POL_IOE_Pos                                       14                                                        /*!< LCD POL: IOE Position               */\r
+#define LCD_POL_IOE_Msk                                       (0x01UL << LCD_POL_IOE_Pos)                               /*!< LCD POL: IOE Mask                   */\r
+#define LCD_POL_CPL_Pos                                       16                                                        /*!< LCD POL: CPL Position               */\r
+#define LCD_POL_CPL_Msk                                       (0x000003ffUL << LCD_POL_CPL_Pos)                         /*!< LCD POL: CPL Mask                   */\r
+#define LCD_POL_BCD_Pos                                       26                                                        /*!< LCD POL: BCD Position               */\r
+#define LCD_POL_BCD_Msk                                       (0x01UL << LCD_POL_BCD_Pos)                               /*!< LCD POL: BCD Mask                   */\r
+#define LCD_POL_PCD_HI_Pos                                    27                                                        /*!< LCD POL: PCD_HI Position            */\r
+#define LCD_POL_PCD_HI_Msk                                    (0x1fUL << LCD_POL_PCD_HI_Pos)                            /*!< LCD POL: PCD_HI Mask                */\r
+\r
+// -----------------------------------------  LCD_LE  ---------------------------------------------\r
+#define LCD_LE_LED_Pos                                        0                                                         /*!< LCD LE: LED Position                */\r
+#define LCD_LE_LED_Msk                                        (0x7fUL << LCD_LE_LED_Pos)                                /*!< LCD LE: LED Mask                    */\r
+#define LCD_LE_LEE_Pos                                        16                                                        /*!< LCD LE: LEE Position                */\r
+#define LCD_LE_LEE_Msk                                        (0x01UL << LCD_LE_LEE_Pos)                                /*!< LCD LE: LEE Mask                    */\r
+\r
+// ---------------------------------------  LCD_UPBASE  -------------------------------------------\r
+#define LCD_UPBASE_LCDUPBASE_Pos                              3                                                         /*!< LCD UPBASE: LCDUPBASE Position      */\r
+#define LCD_UPBASE_LCDUPBASE_Msk                              (0x1fffffffUL << LCD_UPBASE_LCDUPBASE_Pos)                /*!< LCD UPBASE: LCDUPBASE Mask          */\r
+\r
+// ---------------------------------------  LCD_LPBASE  -------------------------------------------\r
+#define LCD_LPBASE_LCDLPBASE_Pos                              3                                                         /*!< LCD LPBASE: LCDLPBASE Position      */\r
+#define LCD_LPBASE_LCDLPBASE_Msk                              (0x1fffffffUL << LCD_LPBASE_LCDLPBASE_Pos)                /*!< LCD LPBASE: LCDLPBASE Mask          */\r
+\r
+// ----------------------------------------  LCD_CTRL  --------------------------------------------\r
+#define LCD_CTRL_LCDEN_Pos                                    0                                                         /*!< LCD CTRL: LCDEN Position            */\r
+#define LCD_CTRL_LCDEN_Msk                                    (0x01UL << LCD_CTRL_LCDEN_Pos)                            /*!< LCD CTRL: LCDEN Mask                */\r
+#define LCD_CTRL_LCDBPP_Pos                                   1                                                         /*!< LCD CTRL: LCDBPP Position           */\r
+#define LCD_CTRL_LCDBPP_Msk                                   (0x07UL << LCD_CTRL_LCDBPP_Pos)                           /*!< LCD CTRL: LCDBPP Mask               */\r
+#define LCD_CTRL_LCDBW_Pos                                    4                                                         /*!< LCD CTRL: LCDBW Position            */\r
+#define LCD_CTRL_LCDBW_Msk                                    (0x01UL << LCD_CTRL_LCDBW_Pos)                            /*!< LCD CTRL: LCDBW Mask                */\r
+#define LCD_CTRL_LCDTFT_Pos                                   5                                                         /*!< LCD CTRL: LCDTFT Position           */\r
+#define LCD_CTRL_LCDTFT_Msk                                   (0x01UL << LCD_CTRL_LCDTFT_Pos)                           /*!< LCD CTRL: LCDTFT Mask               */\r
+#define LCD_CTRL_LCDMONO8_Pos                                 6                                                         /*!< LCD CTRL: LCDMONO8 Position         */\r
+#define LCD_CTRL_LCDMONO8_Msk                                 (0x01UL << LCD_CTRL_LCDMONO8_Pos)                         /*!< LCD CTRL: LCDMONO8 Mask             */\r
+#define LCD_CTRL_LCDDUAL_Pos                                  7                                                         /*!< LCD CTRL: LCDDUAL Position          */\r
+#define LCD_CTRL_LCDDUAL_Msk                                  (0x01UL << LCD_CTRL_LCDDUAL_Pos)                          /*!< LCD CTRL: LCDDUAL Mask              */\r
+#define LCD_CTRL_BGR_Pos                                      8                                                         /*!< LCD CTRL: BGR Position              */\r
+#define LCD_CTRL_BGR_Msk                                      (0x01UL << LCD_CTRL_BGR_Pos)                              /*!< LCD CTRL: BGR Mask                  */\r
+#define LCD_CTRL_BEBO_Pos                                     9                                                         /*!< LCD CTRL: BEBO Position             */\r
+#define LCD_CTRL_BEBO_Msk                                     (0x01UL << LCD_CTRL_BEBO_Pos)                             /*!< LCD CTRL: BEBO Mask                 */\r
+#define LCD_CTRL_BEPO_Pos                                     10                                                        /*!< LCD CTRL: BEPO Position             */\r
+#define LCD_CTRL_BEPO_Msk                                     (0x01UL << LCD_CTRL_BEPO_Pos)                             /*!< LCD CTRL: BEPO Mask                 */\r
+#define LCD_CTRL_LCDPWR_Pos                                   11                                                        /*!< LCD CTRL: LCDPWR Position           */\r
+#define LCD_CTRL_LCDPWR_Msk                                   (0x01UL << LCD_CTRL_LCDPWR_Pos)                           /*!< LCD CTRL: LCDPWR Mask               */\r
+#define LCD_CTRL_LCDVCOMP_Pos                                 12                                                        /*!< LCD CTRL: LCDVCOMP Position         */\r
+#define LCD_CTRL_LCDVCOMP_Msk                                 (0x03UL << LCD_CTRL_LCDVCOMP_Pos)                         /*!< LCD CTRL: LCDVCOMP Mask             */\r
+#define LCD_CTRL_WATERMARK_Pos                                16                                                        /*!< LCD CTRL: WATERMARK Position        */\r
+#define LCD_CTRL_WATERMARK_Msk                                (0x01UL << LCD_CTRL_WATERMARK_Pos)                        /*!< LCD CTRL: WATERMARK Mask            */\r
+\r
+// ---------------------------------------  LCD_INTMSK  -------------------------------------------\r
+#define LCD_INTMSK_FUFIM_Pos                                  1                                                         /*!< LCD INTMSK: FUFIM Position          */\r
+#define LCD_INTMSK_FUFIM_Msk                                  (0x01UL << LCD_INTMSK_FUFIM_Pos)                          /*!< LCD INTMSK: FUFIM Mask              */\r
+#define LCD_INTMSK_LNBUIM_Pos                                 2                                                         /*!< LCD INTMSK: LNBUIM Position         */\r
+#define LCD_INTMSK_LNBUIM_Msk                                 (0x01UL << LCD_INTMSK_LNBUIM_Pos)                         /*!< LCD INTMSK: LNBUIM Mask             */\r
+#define LCD_INTMSK_VCOMPIM_Pos                                3                                                         /*!< LCD INTMSK: VCOMPIM Position        */\r
+#define LCD_INTMSK_VCOMPIM_Msk                                (0x01UL << LCD_INTMSK_VCOMPIM_Pos)                        /*!< LCD INTMSK: VCOMPIM Mask            */\r
+#define LCD_INTMSK_BERIM_Pos                                  4                                                         /*!< LCD INTMSK: BERIM Position          */\r
+#define LCD_INTMSK_BERIM_Msk                                  (0x01UL << LCD_INTMSK_BERIM_Pos)                          /*!< LCD INTMSK: BERIM Mask              */\r
+\r
+// ---------------------------------------  LCD_INTRAW  -------------------------------------------\r
+#define LCD_INTRAW_FUFRIS_Pos                                 1                                                         /*!< LCD INTRAW: FUFRIS Position         */\r
+#define LCD_INTRAW_FUFRIS_Msk                                 (0x01UL << LCD_INTRAW_FUFRIS_Pos)                         /*!< LCD INTRAW: FUFRIS Mask             */\r
+#define LCD_INTRAW_LNBURIS_Pos                                2                                                         /*!< LCD INTRAW: LNBURIS Position        */\r
+#define LCD_INTRAW_LNBURIS_Msk                                (0x01UL << LCD_INTRAW_LNBURIS_Pos)                        /*!< LCD INTRAW: LNBURIS Mask            */\r
+#define LCD_INTRAW_VCOMPRIS_Pos                               3                                                         /*!< LCD INTRAW: VCOMPRIS Position       */\r
+#define LCD_INTRAW_VCOMPRIS_Msk                               (0x01UL << LCD_INTRAW_VCOMPRIS_Pos)                       /*!< LCD INTRAW: VCOMPRIS Mask           */\r
+#define LCD_INTRAW_BERRAW_Pos                                 4                                                         /*!< LCD INTRAW: BERRAW Position         */\r
+#define LCD_INTRAW_BERRAW_Msk                                 (0x01UL << LCD_INTRAW_BERRAW_Pos)                         /*!< LCD INTRAW: BERRAW Mask             */\r
+\r
+// ---------------------------------------  LCD_INTSTAT  ------------------------------------------\r
+#define LCD_INTSTAT_FUFMIS_Pos                                1                                                         /*!< LCD INTSTAT: FUFMIS Position        */\r
+#define LCD_INTSTAT_FUFMIS_Msk                                (0x01UL << LCD_INTSTAT_FUFMIS_Pos)                        /*!< LCD INTSTAT: FUFMIS Mask            */\r
+#define LCD_INTSTAT_LNBUMIS_Pos                               2                                                         /*!< LCD INTSTAT: LNBUMIS Position       */\r
+#define LCD_INTSTAT_LNBUMIS_Msk                               (0x01UL << LCD_INTSTAT_LNBUMIS_Pos)                       /*!< LCD INTSTAT: LNBUMIS Mask           */\r
+#define LCD_INTSTAT_VCOMPMIS_Pos                              3                                                         /*!< LCD INTSTAT: VCOMPMIS Position      */\r
+#define LCD_INTSTAT_VCOMPMIS_Msk                              (0x01UL << LCD_INTSTAT_VCOMPMIS_Pos)                      /*!< LCD INTSTAT: VCOMPMIS Mask          */\r
+#define LCD_INTSTAT_BERMIS_Pos                                4                                                         /*!< LCD INTSTAT: BERMIS Position        */\r
+#define LCD_INTSTAT_BERMIS_Msk                                (0x01UL << LCD_INTSTAT_BERMIS_Pos)                        /*!< LCD INTSTAT: BERMIS Mask            */\r
+\r
+// ---------------------------------------  LCD_INTCLR  -------------------------------------------\r
+#define LCD_INTCLR_FUFIC_Pos                                  1                                                         /*!< LCD INTCLR: FUFIC Position          */\r
+#define LCD_INTCLR_FUFIC_Msk                                  (0x01UL << LCD_INTCLR_FUFIC_Pos)                          /*!< LCD INTCLR: FUFIC Mask              */\r
+#define LCD_INTCLR_LNBUIC_Pos                                 2                                                         /*!< LCD INTCLR: LNBUIC Position         */\r
+#define LCD_INTCLR_LNBUIC_Msk                                 (0x01UL << LCD_INTCLR_LNBUIC_Pos)                         /*!< LCD INTCLR: LNBUIC Mask             */\r
+#define LCD_INTCLR_VCOMPIC_Pos                                3                                                         /*!< LCD INTCLR: VCOMPIC Position        */\r
+#define LCD_INTCLR_VCOMPIC_Msk                                (0x01UL << LCD_INTCLR_VCOMPIC_Pos)                        /*!< LCD INTCLR: VCOMPIC Mask            */\r
+#define LCD_INTCLR_BERIC_Pos                                  4                                                         /*!< LCD INTCLR: BERIC Position          */\r
+#define LCD_INTCLR_BERIC_Msk                                  (0x01UL << LCD_INTCLR_BERIC_Pos)                          /*!< LCD INTCLR: BERIC Mask              */\r
+\r
+// ---------------------------------------  LCD_UPCURR  -------------------------------------------\r
+#define LCD_UPCURR_LCDUPCURR_Pos                              0                                                         /*!< LCD UPCURR: LCDUPCURR Position      */\r
+#define LCD_UPCURR_LCDUPCURR_Msk                              (0xffffffffUL << LCD_UPCURR_LCDUPCURR_Pos)                /*!< LCD UPCURR: LCDUPCURR Mask          */\r
+\r
+// ---------------------------------------  LCD_LPCURR  -------------------------------------------\r
+#define LCD_LPCURR_LCDLPCURR_Pos                              0                                                         /*!< LCD LPCURR: LCDLPCURR Position      */\r
+#define LCD_LPCURR_LCDLPCURR_Msk                              (0xffffffffUL << LCD_LPCURR_LCDLPCURR_Pos)                /*!< LCD LPCURR: LCDLPCURR Mask          */\r
+\r
+// ----------------------------------------  LCD_PAL0  --------------------------------------------\r
+#define LCD_PAL0_R04_0_Pos                                    0                                                         /*!< LCD PAL0: R04_0 Position            */\r
+#define LCD_PAL0_R04_0_Msk                                    (0x1fUL << LCD_PAL0_R04_0_Pos)                            /*!< LCD PAL0: R04_0 Mask                */\r
+#define LCD_PAL0_G04_0_Pos                                    5                                                         /*!< LCD PAL0: G04_0 Position            */\r
+#define LCD_PAL0_G04_0_Msk                                    (0x1fUL << LCD_PAL0_G04_0_Pos)                            /*!< LCD PAL0: G04_0 Mask                */\r
+#define LCD_PAL0_B04_0_Pos                                    10                                                        /*!< LCD PAL0: B04_0 Position            */\r
+#define LCD_PAL0_B04_0_Msk                                    (0x1fUL << LCD_PAL0_B04_0_Pos)                            /*!< LCD PAL0: B04_0 Mask                */\r
+#define LCD_PAL0_I0_Pos                                       15                                                        /*!< LCD PAL0: I0 Position               */\r
+#define LCD_PAL0_I0_Msk                                       (0x01UL << LCD_PAL0_I0_Pos)                               /*!< LCD PAL0: I0 Mask                   */\r
+#define LCD_PAL0_R14_0_Pos                                    16                                                        /*!< LCD PAL0: R14_0 Position            */\r
+#define LCD_PAL0_R14_0_Msk                                    (0x1fUL << LCD_PAL0_R14_0_Pos)                            /*!< LCD PAL0: R14_0 Mask                */\r
+#define LCD_PAL0_G14_0_Pos                                    21                                                        /*!< LCD PAL0: G14_0 Position            */\r
+#define LCD_PAL0_G14_0_Msk                                    (0x1fUL << LCD_PAL0_G14_0_Pos)                            /*!< LCD PAL0: G14_0 Mask                */\r
+#define LCD_PAL0_B14_0_Pos                                    26                                                        /*!< LCD PAL0: B14_0 Position            */\r
+#define LCD_PAL0_B14_0_Msk                                    (0x1fUL << LCD_PAL0_B14_0_Pos)                            /*!< LCD PAL0: B14_0 Mask                */\r
+#define LCD_PAL0_I1_Pos                                       31                                                        /*!< LCD PAL0: I1 Position               */\r
+#define LCD_PAL0_I1_Msk                                       (0x01UL << LCD_PAL0_I1_Pos)                               /*!< LCD PAL0: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL1  --------------------------------------------\r
+#define LCD_PAL1_R04_0_Pos                                    0                                                         /*!< LCD PAL1: R04_0 Position            */\r
+#define LCD_PAL1_R04_0_Msk                                    (0x1fUL << LCD_PAL1_R04_0_Pos)                            /*!< LCD PAL1: R04_0 Mask                */\r
+#define LCD_PAL1_G04_0_Pos                                    5                                                         /*!< LCD PAL1: G04_0 Position            */\r
+#define LCD_PAL1_G04_0_Msk                                    (0x1fUL << LCD_PAL1_G04_0_Pos)                            /*!< LCD PAL1: G04_0 Mask                */\r
+#define LCD_PAL1_B04_0_Pos                                    10                                                        /*!< LCD PAL1: B04_0 Position            */\r
+#define LCD_PAL1_B04_0_Msk                                    (0x1fUL << LCD_PAL1_B04_0_Pos)                            /*!< LCD PAL1: B04_0 Mask                */\r
+#define LCD_PAL1_I0_Pos                                       15                                                        /*!< LCD PAL1: I0 Position               */\r
+#define LCD_PAL1_I0_Msk                                       (0x01UL << LCD_PAL1_I0_Pos)                               /*!< LCD PAL1: I0 Mask                   */\r
+#define LCD_PAL1_R14_0_Pos                                    16                                                        /*!< LCD PAL1: R14_0 Position            */\r
+#define LCD_PAL1_R14_0_Msk                                    (0x1fUL << LCD_PAL1_R14_0_Pos)                            /*!< LCD PAL1: R14_0 Mask                */\r
+#define LCD_PAL1_G14_0_Pos                                    21                                                        /*!< LCD PAL1: G14_0 Position            */\r
+#define LCD_PAL1_G14_0_Msk                                    (0x1fUL << LCD_PAL1_G14_0_Pos)                            /*!< LCD PAL1: G14_0 Mask                */\r
+#define LCD_PAL1_B14_0_Pos                                    26                                                        /*!< LCD PAL1: B14_0 Position            */\r
+#define LCD_PAL1_B14_0_Msk                                    (0x1fUL << LCD_PAL1_B14_0_Pos)                            /*!< LCD PAL1: B14_0 Mask                */\r
+#define LCD_PAL1_I1_Pos                                       31                                                        /*!< LCD PAL1: I1 Position               */\r
+#define LCD_PAL1_I1_Msk                                       (0x01UL << LCD_PAL1_I1_Pos)                               /*!< LCD PAL1: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL2  --------------------------------------------\r
+#define LCD_PAL2_R04_0_Pos                                    0                                                         /*!< LCD PAL2: R04_0 Position            */\r
+#define LCD_PAL2_R04_0_Msk                                    (0x1fUL << LCD_PAL2_R04_0_Pos)                            /*!< LCD PAL2: R04_0 Mask                */\r
+#define LCD_PAL2_G04_0_Pos                                    5                                                         /*!< LCD PAL2: G04_0 Position            */\r
+#define LCD_PAL2_G04_0_Msk                                    (0x1fUL << LCD_PAL2_G04_0_Pos)                            /*!< LCD PAL2: G04_0 Mask                */\r
+#define LCD_PAL2_B04_0_Pos                                    10                                                        /*!< LCD PAL2: B04_0 Position            */\r
+#define LCD_PAL2_B04_0_Msk                                    (0x1fUL << LCD_PAL2_B04_0_Pos)                            /*!< LCD PAL2: B04_0 Mask                */\r
+#define LCD_PAL2_I0_Pos                                       15                                                        /*!< LCD PAL2: I0 Position               */\r
+#define LCD_PAL2_I0_Msk                                       (0x01UL << LCD_PAL2_I0_Pos)                               /*!< LCD PAL2: I0 Mask                   */\r
+#define LCD_PAL2_R14_0_Pos                                    16                                                        /*!< LCD PAL2: R14_0 Position            */\r
+#define LCD_PAL2_R14_0_Msk                                    (0x1fUL << LCD_PAL2_R14_0_Pos)                            /*!< LCD PAL2: R14_0 Mask                */\r
+#define LCD_PAL2_G14_0_Pos                                    21                                                        /*!< LCD PAL2: G14_0 Position            */\r
+#define LCD_PAL2_G14_0_Msk                                    (0x1fUL << LCD_PAL2_G14_0_Pos)                            /*!< LCD PAL2: G14_0 Mask                */\r
+#define LCD_PAL2_B14_0_Pos                                    26                                                        /*!< LCD PAL2: B14_0 Position            */\r
+#define LCD_PAL2_B14_0_Msk                                    (0x1fUL << LCD_PAL2_B14_0_Pos)                            /*!< LCD PAL2: B14_0 Mask                */\r
+#define LCD_PAL2_I1_Pos                                       31                                                        /*!< LCD PAL2: I1 Position               */\r
+#define LCD_PAL2_I1_Msk                                       (0x01UL << LCD_PAL2_I1_Pos)                               /*!< LCD PAL2: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL3  --------------------------------------------\r
+#define LCD_PAL3_R04_0_Pos                                    0                                                         /*!< LCD PAL3: R04_0 Position            */\r
+#define LCD_PAL3_R04_0_Msk                                    (0x1fUL << LCD_PAL3_R04_0_Pos)                            /*!< LCD PAL3: R04_0 Mask                */\r
+#define LCD_PAL3_G04_0_Pos                                    5                                                         /*!< LCD PAL3: G04_0 Position            */\r
+#define LCD_PAL3_G04_0_Msk                                    (0x1fUL << LCD_PAL3_G04_0_Pos)                            /*!< LCD PAL3: G04_0 Mask                */\r
+#define LCD_PAL3_B04_0_Pos                                    10                                                        /*!< LCD PAL3: B04_0 Position            */\r
+#define LCD_PAL3_B04_0_Msk                                    (0x1fUL << LCD_PAL3_B04_0_Pos)                            /*!< LCD PAL3: B04_0 Mask                */\r
+#define LCD_PAL3_I0_Pos                                       15                                                        /*!< LCD PAL3: I0 Position               */\r
+#define LCD_PAL3_I0_Msk                                       (0x01UL << LCD_PAL3_I0_Pos)                               /*!< LCD PAL3: I0 Mask                   */\r
+#define LCD_PAL3_R14_0_Pos                                    16                                                        /*!< LCD PAL3: R14_0 Position            */\r
+#define LCD_PAL3_R14_0_Msk                                    (0x1fUL << LCD_PAL3_R14_0_Pos)                            /*!< LCD PAL3: R14_0 Mask                */\r
+#define LCD_PAL3_G14_0_Pos                                    21                                                        /*!< LCD PAL3: G14_0 Position            */\r
+#define LCD_PAL3_G14_0_Msk                                    (0x1fUL << LCD_PAL3_G14_0_Pos)                            /*!< LCD PAL3: G14_0 Mask                */\r
+#define LCD_PAL3_B14_0_Pos                                    26                                                        /*!< LCD PAL3: B14_0 Position            */\r
+#define LCD_PAL3_B14_0_Msk                                    (0x1fUL << LCD_PAL3_B14_0_Pos)                            /*!< LCD PAL3: B14_0 Mask                */\r
+#define LCD_PAL3_I1_Pos                                       31                                                        /*!< LCD PAL3: I1 Position               */\r
+#define LCD_PAL3_I1_Msk                                       (0x01UL << LCD_PAL3_I1_Pos)                               /*!< LCD PAL3: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL4  --------------------------------------------\r
+#define LCD_PAL4_R04_0_Pos                                    0                                                         /*!< LCD PAL4: R04_0 Position            */\r
+#define LCD_PAL4_R04_0_Msk                                    (0x1fUL << LCD_PAL4_R04_0_Pos)                            /*!< LCD PAL4: R04_0 Mask                */\r
+#define LCD_PAL4_G04_0_Pos                                    5                                                         /*!< LCD PAL4: G04_0 Position            */\r
+#define LCD_PAL4_G04_0_Msk                                    (0x1fUL << LCD_PAL4_G04_0_Pos)                            /*!< LCD PAL4: G04_0 Mask                */\r
+#define LCD_PAL4_B04_0_Pos                                    10                                                        /*!< LCD PAL4: B04_0 Position            */\r
+#define LCD_PAL4_B04_0_Msk                                    (0x1fUL << LCD_PAL4_B04_0_Pos)                            /*!< LCD PAL4: B04_0 Mask                */\r
+#define LCD_PAL4_I0_Pos                                       15                                                        /*!< LCD PAL4: I0 Position               */\r
+#define LCD_PAL4_I0_Msk                                       (0x01UL << LCD_PAL4_I0_Pos)                               /*!< LCD PAL4: I0 Mask                   */\r
+#define LCD_PAL4_R14_0_Pos                                    16                                                        /*!< LCD PAL4: R14_0 Position            */\r
+#define LCD_PAL4_R14_0_Msk                                    (0x1fUL << LCD_PAL4_R14_0_Pos)                            /*!< LCD PAL4: R14_0 Mask                */\r
+#define LCD_PAL4_G14_0_Pos                                    21                                                        /*!< LCD PAL4: G14_0 Position            */\r
+#define LCD_PAL4_G14_0_Msk                                    (0x1fUL << LCD_PAL4_G14_0_Pos)                            /*!< LCD PAL4: G14_0 Mask                */\r
+#define LCD_PAL4_B14_0_Pos                                    26                                                        /*!< LCD PAL4: B14_0 Position            */\r
+#define LCD_PAL4_B14_0_Msk                                    (0x1fUL << LCD_PAL4_B14_0_Pos)                            /*!< LCD PAL4: B14_0 Mask                */\r
+#define LCD_PAL4_I1_Pos                                       31                                                        /*!< LCD PAL4: I1 Position               */\r
+#define LCD_PAL4_I1_Msk                                       (0x01UL << LCD_PAL4_I1_Pos)                               /*!< LCD PAL4: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL5  --------------------------------------------\r
+#define LCD_PAL5_R04_0_Pos                                    0                                                         /*!< LCD PAL5: R04_0 Position            */\r
+#define LCD_PAL5_R04_0_Msk                                    (0x1fUL << LCD_PAL5_R04_0_Pos)                            /*!< LCD PAL5: R04_0 Mask                */\r
+#define LCD_PAL5_G04_0_Pos                                    5                                                         /*!< LCD PAL5: G04_0 Position            */\r
+#define LCD_PAL5_G04_0_Msk                                    (0x1fUL << LCD_PAL5_G04_0_Pos)                            /*!< LCD PAL5: G04_0 Mask                */\r
+#define LCD_PAL5_B04_0_Pos                                    10                                                        /*!< LCD PAL5: B04_0 Position            */\r
+#define LCD_PAL5_B04_0_Msk                                    (0x1fUL << LCD_PAL5_B04_0_Pos)                            /*!< LCD PAL5: B04_0 Mask                */\r
+#define LCD_PAL5_I0_Pos                                       15                                                        /*!< LCD PAL5: I0 Position               */\r
+#define LCD_PAL5_I0_Msk                                       (0x01UL << LCD_PAL5_I0_Pos)                               /*!< LCD PAL5: I0 Mask                   */\r
+#define LCD_PAL5_R14_0_Pos                                    16                                                        /*!< LCD PAL5: R14_0 Position            */\r
+#define LCD_PAL5_R14_0_Msk                                    (0x1fUL << LCD_PAL5_R14_0_Pos)                            /*!< LCD PAL5: R14_0 Mask                */\r
+#define LCD_PAL5_G14_0_Pos                                    21                                                        /*!< LCD PAL5: G14_0 Position            */\r
+#define LCD_PAL5_G14_0_Msk                                    (0x1fUL << LCD_PAL5_G14_0_Pos)                            /*!< LCD PAL5: G14_0 Mask                */\r
+#define LCD_PAL5_B14_0_Pos                                    26                                                        /*!< LCD PAL5: B14_0 Position            */\r
+#define LCD_PAL5_B14_0_Msk                                    (0x1fUL << LCD_PAL5_B14_0_Pos)                            /*!< LCD PAL5: B14_0 Mask                */\r
+#define LCD_PAL5_I1_Pos                                       31                                                        /*!< LCD PAL5: I1 Position               */\r
+#define LCD_PAL5_I1_Msk                                       (0x01UL << LCD_PAL5_I1_Pos)                               /*!< LCD PAL5: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL6  --------------------------------------------\r
+#define LCD_PAL6_R04_0_Pos                                    0                                                         /*!< LCD PAL6: R04_0 Position            */\r
+#define LCD_PAL6_R04_0_Msk                                    (0x1fUL << LCD_PAL6_R04_0_Pos)                            /*!< LCD PAL6: R04_0 Mask                */\r
+#define LCD_PAL6_G04_0_Pos                                    5                                                         /*!< LCD PAL6: G04_0 Position            */\r
+#define LCD_PAL6_G04_0_Msk                                    (0x1fUL << LCD_PAL6_G04_0_Pos)                            /*!< LCD PAL6: G04_0 Mask                */\r
+#define LCD_PAL6_B04_0_Pos                                    10                                                        /*!< LCD PAL6: B04_0 Position            */\r
+#define LCD_PAL6_B04_0_Msk                                    (0x1fUL << LCD_PAL6_B04_0_Pos)                            /*!< LCD PAL6: B04_0 Mask                */\r
+#define LCD_PAL6_I0_Pos                                       15                                                        /*!< LCD PAL6: I0 Position               */\r
+#define LCD_PAL6_I0_Msk                                       (0x01UL << LCD_PAL6_I0_Pos)                               /*!< LCD PAL6: I0 Mask                   */\r
+#define LCD_PAL6_R14_0_Pos                                    16                                                        /*!< LCD PAL6: R14_0 Position            */\r
+#define LCD_PAL6_R14_0_Msk                                    (0x1fUL << LCD_PAL6_R14_0_Pos)                            /*!< LCD PAL6: R14_0 Mask                */\r
+#define LCD_PAL6_G14_0_Pos                                    21                                                        /*!< LCD PAL6: G14_0 Position            */\r
+#define LCD_PAL6_G14_0_Msk                                    (0x1fUL << LCD_PAL6_G14_0_Pos)                            /*!< LCD PAL6: G14_0 Mask                */\r
+#define LCD_PAL6_B14_0_Pos                                    26                                                        /*!< LCD PAL6: B14_0 Position            */\r
+#define LCD_PAL6_B14_0_Msk                                    (0x1fUL << LCD_PAL6_B14_0_Pos)                            /*!< LCD PAL6: B14_0 Mask                */\r
+#define LCD_PAL6_I1_Pos                                       31                                                        /*!< LCD PAL6: I1 Position               */\r
+#define LCD_PAL6_I1_Msk                                       (0x01UL << LCD_PAL6_I1_Pos)                               /*!< LCD PAL6: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL7  --------------------------------------------\r
+#define LCD_PAL7_R04_0_Pos                                    0                                                         /*!< LCD PAL7: R04_0 Position            */\r
+#define LCD_PAL7_R04_0_Msk                                    (0x1fUL << LCD_PAL7_R04_0_Pos)                            /*!< LCD PAL7: R04_0 Mask                */\r
+#define LCD_PAL7_G04_0_Pos                                    5                                                         /*!< LCD PAL7: G04_0 Position            */\r
+#define LCD_PAL7_G04_0_Msk                                    (0x1fUL << LCD_PAL7_G04_0_Pos)                            /*!< LCD PAL7: G04_0 Mask                */\r
+#define LCD_PAL7_B04_0_Pos                                    10                                                        /*!< LCD PAL7: B04_0 Position            */\r
+#define LCD_PAL7_B04_0_Msk                                    (0x1fUL << LCD_PAL7_B04_0_Pos)                            /*!< LCD PAL7: B04_0 Mask                */\r
+#define LCD_PAL7_I0_Pos                                       15                                                        /*!< LCD PAL7: I0 Position               */\r
+#define LCD_PAL7_I0_Msk                                       (0x01UL << LCD_PAL7_I0_Pos)                               /*!< LCD PAL7: I0 Mask                   */\r
+#define LCD_PAL7_R14_0_Pos                                    16                                                        /*!< LCD PAL7: R14_0 Position            */\r
+#define LCD_PAL7_R14_0_Msk                                    (0x1fUL << LCD_PAL7_R14_0_Pos)                            /*!< LCD PAL7: R14_0 Mask                */\r
+#define LCD_PAL7_G14_0_Pos                                    21                                                        /*!< LCD PAL7: G14_0 Position            */\r
+#define LCD_PAL7_G14_0_Msk                                    (0x1fUL << LCD_PAL7_G14_0_Pos)                            /*!< LCD PAL7: G14_0 Mask                */\r
+#define LCD_PAL7_B14_0_Pos                                    26                                                        /*!< LCD PAL7: B14_0 Position            */\r
+#define LCD_PAL7_B14_0_Msk                                    (0x1fUL << LCD_PAL7_B14_0_Pos)                            /*!< LCD PAL7: B14_0 Mask                */\r
+#define LCD_PAL7_I1_Pos                                       31                                                        /*!< LCD PAL7: I1 Position               */\r
+#define LCD_PAL7_I1_Msk                                       (0x01UL << LCD_PAL7_I1_Pos)                               /*!< LCD PAL7: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL8  --------------------------------------------\r
+#define LCD_PAL8_R04_0_Pos                                    0                                                         /*!< LCD PAL8: R04_0 Position            */\r
+#define LCD_PAL8_R04_0_Msk                                    (0x1fUL << LCD_PAL8_R04_0_Pos)                            /*!< LCD PAL8: R04_0 Mask                */\r
+#define LCD_PAL8_G04_0_Pos                                    5                                                         /*!< LCD PAL8: G04_0 Position            */\r
+#define LCD_PAL8_G04_0_Msk                                    (0x1fUL << LCD_PAL8_G04_0_Pos)                            /*!< LCD PAL8: G04_0 Mask                */\r
+#define LCD_PAL8_B04_0_Pos                                    10                                                        /*!< LCD PAL8: B04_0 Position            */\r
+#define LCD_PAL8_B04_0_Msk                                    (0x1fUL << LCD_PAL8_B04_0_Pos)                            /*!< LCD PAL8: B04_0 Mask                */\r
+#define LCD_PAL8_I0_Pos                                       15                                                        /*!< LCD PAL8: I0 Position               */\r
+#define LCD_PAL8_I0_Msk                                       (0x01UL << LCD_PAL8_I0_Pos)                               /*!< LCD PAL8: I0 Mask                   */\r
+#define LCD_PAL8_R14_0_Pos                                    16                                                        /*!< LCD PAL8: R14_0 Position            */\r
+#define LCD_PAL8_R14_0_Msk                                    (0x1fUL << LCD_PAL8_R14_0_Pos)                            /*!< LCD PAL8: R14_0 Mask                */\r
+#define LCD_PAL8_G14_0_Pos                                    21                                                        /*!< LCD PAL8: G14_0 Position            */\r
+#define LCD_PAL8_G14_0_Msk                                    (0x1fUL << LCD_PAL8_G14_0_Pos)                            /*!< LCD PAL8: G14_0 Mask                */\r
+#define LCD_PAL8_B14_0_Pos                                    26                                                        /*!< LCD PAL8: B14_0 Position            */\r
+#define LCD_PAL8_B14_0_Msk                                    (0x1fUL << LCD_PAL8_B14_0_Pos)                            /*!< LCD PAL8: B14_0 Mask                */\r
+#define LCD_PAL8_I1_Pos                                       31                                                        /*!< LCD PAL8: I1 Position               */\r
+#define LCD_PAL8_I1_Msk                                       (0x01UL << LCD_PAL8_I1_Pos)                               /*!< LCD PAL8: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL9  --------------------------------------------\r
+#define LCD_PAL9_R04_0_Pos                                    0                                                         /*!< LCD PAL9: R04_0 Position            */\r
+#define LCD_PAL9_R04_0_Msk                                    (0x1fUL << LCD_PAL9_R04_0_Pos)                            /*!< LCD PAL9: R04_0 Mask                */\r
+#define LCD_PAL9_G04_0_Pos                                    5                                                         /*!< LCD PAL9: G04_0 Position            */\r
+#define LCD_PAL9_G04_0_Msk                                    (0x1fUL << LCD_PAL9_G04_0_Pos)                            /*!< LCD PAL9: G04_0 Mask                */\r
+#define LCD_PAL9_B04_0_Pos                                    10                                                        /*!< LCD PAL9: B04_0 Position            */\r
+#define LCD_PAL9_B04_0_Msk                                    (0x1fUL << LCD_PAL9_B04_0_Pos)                            /*!< LCD PAL9: B04_0 Mask                */\r
+#define LCD_PAL9_I0_Pos                                       15                                                        /*!< LCD PAL9: I0 Position               */\r
+#define LCD_PAL9_I0_Msk                                       (0x01UL << LCD_PAL9_I0_Pos)                               /*!< LCD PAL9: I0 Mask                   */\r
+#define LCD_PAL9_R14_0_Pos                                    16                                                        /*!< LCD PAL9: R14_0 Position            */\r
+#define LCD_PAL9_R14_0_Msk                                    (0x1fUL << LCD_PAL9_R14_0_Pos)                            /*!< LCD PAL9: R14_0 Mask                */\r
+#define LCD_PAL9_G14_0_Pos                                    21                                                        /*!< LCD PAL9: G14_0 Position            */\r
+#define LCD_PAL9_G14_0_Msk                                    (0x1fUL << LCD_PAL9_G14_0_Pos)                            /*!< LCD PAL9: G14_0 Mask                */\r
+#define LCD_PAL9_B14_0_Pos                                    26                                                        /*!< LCD PAL9: B14_0 Position            */\r
+#define LCD_PAL9_B14_0_Msk                                    (0x1fUL << LCD_PAL9_B14_0_Pos)                            /*!< LCD PAL9: B14_0 Mask                */\r
+#define LCD_PAL9_I1_Pos                                       31                                                        /*!< LCD PAL9: I1 Position               */\r
+#define LCD_PAL9_I1_Msk                                       (0x01UL << LCD_PAL9_I1_Pos)                               /*!< LCD PAL9: I1 Mask                   */\r
+\r
+// ----------------------------------------  LCD_PAL10  -------------------------------------------\r
+#define LCD_PAL10_R04_0_Pos                                   0                                                         /*!< LCD PAL10: R04_0 Position           */\r
+#define LCD_PAL10_R04_0_Msk                                   (0x1fUL << LCD_PAL10_R04_0_Pos)                           /*!< LCD PAL10: R04_0 Mask               */\r
+#define LCD_PAL10_G04_0_Pos                                   5                                                         /*!< LCD PAL10: G04_0 Position           */\r
+#define LCD_PAL10_G04_0_Msk                                   (0x1fUL << LCD_PAL10_G04_0_Pos)                           /*!< LCD PAL10: G04_0 Mask               */\r
+#define LCD_PAL10_B04_0_Pos                                   10                                                        /*!< LCD PAL10: B04_0 Position           */\r
+#define LCD_PAL10_B04_0_Msk                                   (0x1fUL << LCD_PAL10_B04_0_Pos)                           /*!< LCD PAL10: B04_0 Mask               */\r
+#define LCD_PAL10_I0_Pos                                      15                                                        /*!< LCD PAL10: I0 Position              */\r
+#define LCD_PAL10_I0_Msk                                      (0x01UL << LCD_PAL10_I0_Pos)                              /*!< LCD PAL10: I0 Mask                  */\r
+#define LCD_PAL10_R14_0_Pos                                   16                                                        /*!< LCD PAL10: R14_0 Position           */\r
+#define LCD_PAL10_R14_0_Msk                                   (0x1fUL << LCD_PAL10_R14_0_Pos)                           /*!< LCD PAL10: R14_0 Mask               */\r
+#define LCD_PAL10_G14_0_Pos                                   21                                                        /*!< LCD PAL10: G14_0 Position           */\r
+#define LCD_PAL10_G14_0_Msk                                   (0x1fUL << LCD_PAL10_G14_0_Pos)                           /*!< LCD PAL10: G14_0 Mask               */\r
+#define LCD_PAL10_B14_0_Pos                                   26                                                        /*!< LCD PAL10: B14_0 Position           */\r
+#define LCD_PAL10_B14_0_Msk                                   (0x1fUL << LCD_PAL10_B14_0_Pos)                           /*!< LCD PAL10: B14_0 Mask               */\r
+#define LCD_PAL10_I1_Pos                                      31                                                        /*!< LCD PAL10: I1 Position              */\r
+#define LCD_PAL10_I1_Msk                                      (0x01UL << LCD_PAL10_I1_Pos)                              /*!< LCD PAL10: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL11  -------------------------------------------\r
+#define LCD_PAL11_R04_0_Pos                                   0                                                         /*!< LCD PAL11: R04_0 Position           */\r
+#define LCD_PAL11_R04_0_Msk                                   (0x1fUL << LCD_PAL11_R04_0_Pos)                           /*!< LCD PAL11: R04_0 Mask               */\r
+#define LCD_PAL11_G04_0_Pos                                   5                                                         /*!< LCD PAL11: G04_0 Position           */\r
+#define LCD_PAL11_G04_0_Msk                                   (0x1fUL << LCD_PAL11_G04_0_Pos)                           /*!< LCD PAL11: G04_0 Mask               */\r
+#define LCD_PAL11_B04_0_Pos                                   10                                                        /*!< LCD PAL11: B04_0 Position           */\r
+#define LCD_PAL11_B04_0_Msk                                   (0x1fUL << LCD_PAL11_B04_0_Pos)                           /*!< LCD PAL11: B04_0 Mask               */\r
+#define LCD_PAL11_I0_Pos                                      15                                                        /*!< LCD PAL11: I0 Position              */\r
+#define LCD_PAL11_I0_Msk                                      (0x01UL << LCD_PAL11_I0_Pos)                              /*!< LCD PAL11: I0 Mask                  */\r
+#define LCD_PAL11_R14_0_Pos                                   16                                                        /*!< LCD PAL11: R14_0 Position           */\r
+#define LCD_PAL11_R14_0_Msk                                   (0x1fUL << LCD_PAL11_R14_0_Pos)                           /*!< LCD PAL11: R14_0 Mask               */\r
+#define LCD_PAL11_G14_0_Pos                                   21                                                        /*!< LCD PAL11: G14_0 Position           */\r
+#define LCD_PAL11_G14_0_Msk                                   (0x1fUL << LCD_PAL11_G14_0_Pos)                           /*!< LCD PAL11: G14_0 Mask               */\r
+#define LCD_PAL11_B14_0_Pos                                   26                                                        /*!< LCD PAL11: B14_0 Position           */\r
+#define LCD_PAL11_B14_0_Msk                                   (0x1fUL << LCD_PAL11_B14_0_Pos)                           /*!< LCD PAL11: B14_0 Mask               */\r
+#define LCD_PAL11_I1_Pos                                      31                                                        /*!< LCD PAL11: I1 Position              */\r
+#define LCD_PAL11_I1_Msk                                      (0x01UL << LCD_PAL11_I1_Pos)                              /*!< LCD PAL11: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL12  -------------------------------------------\r
+#define LCD_PAL12_R04_0_Pos                                   0                                                         /*!< LCD PAL12: R04_0 Position           */\r
+#define LCD_PAL12_R04_0_Msk                                   (0x1fUL << LCD_PAL12_R04_0_Pos)                           /*!< LCD PAL12: R04_0 Mask               */\r
+#define LCD_PAL12_G04_0_Pos                                   5                                                         /*!< LCD PAL12: G04_0 Position           */\r
+#define LCD_PAL12_G04_0_Msk                                   (0x1fUL << LCD_PAL12_G04_0_Pos)                           /*!< LCD PAL12: G04_0 Mask               */\r
+#define LCD_PAL12_B04_0_Pos                                   10                                                        /*!< LCD PAL12: B04_0 Position           */\r
+#define LCD_PAL12_B04_0_Msk                                   (0x1fUL << LCD_PAL12_B04_0_Pos)                           /*!< LCD PAL12: B04_0 Mask               */\r
+#define LCD_PAL12_I0_Pos                                      15                                                        /*!< LCD PAL12: I0 Position              */\r
+#define LCD_PAL12_I0_Msk                                      (0x01UL << LCD_PAL12_I0_Pos)                              /*!< LCD PAL12: I0 Mask                  */\r
+#define LCD_PAL12_R14_0_Pos                                   16                                                        /*!< LCD PAL12: R14_0 Position           */\r
+#define LCD_PAL12_R14_0_Msk                                   (0x1fUL << LCD_PAL12_R14_0_Pos)                           /*!< LCD PAL12: R14_0 Mask               */\r
+#define LCD_PAL12_G14_0_Pos                                   21                                                        /*!< LCD PAL12: G14_0 Position           */\r
+#define LCD_PAL12_G14_0_Msk                                   (0x1fUL << LCD_PAL12_G14_0_Pos)                           /*!< LCD PAL12: G14_0 Mask               */\r
+#define LCD_PAL12_B14_0_Pos                                   26                                                        /*!< LCD PAL12: B14_0 Position           */\r
+#define LCD_PAL12_B14_0_Msk                                   (0x1fUL << LCD_PAL12_B14_0_Pos)                           /*!< LCD PAL12: B14_0 Mask               */\r
+#define LCD_PAL12_I1_Pos                                      31                                                        /*!< LCD PAL12: I1 Position              */\r
+#define LCD_PAL12_I1_Msk                                      (0x01UL << LCD_PAL12_I1_Pos)                              /*!< LCD PAL12: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL13  -------------------------------------------\r
+#define LCD_PAL13_R04_0_Pos                                   0                                                         /*!< LCD PAL13: R04_0 Position           */\r
+#define LCD_PAL13_R04_0_Msk                                   (0x1fUL << LCD_PAL13_R04_0_Pos)                           /*!< LCD PAL13: R04_0 Mask               */\r
+#define LCD_PAL13_G04_0_Pos                                   5                                                         /*!< LCD PAL13: G04_0 Position           */\r
+#define LCD_PAL13_G04_0_Msk                                   (0x1fUL << LCD_PAL13_G04_0_Pos)                           /*!< LCD PAL13: G04_0 Mask               */\r
+#define LCD_PAL13_B04_0_Pos                                   10                                                        /*!< LCD PAL13: B04_0 Position           */\r
+#define LCD_PAL13_B04_0_Msk                                   (0x1fUL << LCD_PAL13_B04_0_Pos)                           /*!< LCD PAL13: B04_0 Mask               */\r
+#define LCD_PAL13_I0_Pos                                      15                                                        /*!< LCD PAL13: I0 Position              */\r
+#define LCD_PAL13_I0_Msk                                      (0x01UL << LCD_PAL13_I0_Pos)                              /*!< LCD PAL13: I0 Mask                  */\r
+#define LCD_PAL13_R14_0_Pos                                   16                                                        /*!< LCD PAL13: R14_0 Position           */\r
+#define LCD_PAL13_R14_0_Msk                                   (0x1fUL << LCD_PAL13_R14_0_Pos)                           /*!< LCD PAL13: R14_0 Mask               */\r
+#define LCD_PAL13_G14_0_Pos                                   21                                                        /*!< LCD PAL13: G14_0 Position           */\r
+#define LCD_PAL13_G14_0_Msk                                   (0x1fUL << LCD_PAL13_G14_0_Pos)                           /*!< LCD PAL13: G14_0 Mask               */\r
+#define LCD_PAL13_B14_0_Pos                                   26                                                        /*!< LCD PAL13: B14_0 Position           */\r
+#define LCD_PAL13_B14_0_Msk                                   (0x1fUL << LCD_PAL13_B14_0_Pos)                           /*!< LCD PAL13: B14_0 Mask               */\r
+#define LCD_PAL13_I1_Pos                                      31                                                        /*!< LCD PAL13: I1 Position              */\r
+#define LCD_PAL13_I1_Msk                                      (0x01UL << LCD_PAL13_I1_Pos)                              /*!< LCD PAL13: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL14  -------------------------------------------\r
+#define LCD_PAL14_R04_0_Pos                                   0                                                         /*!< LCD PAL14: R04_0 Position           */\r
+#define LCD_PAL14_R04_0_Msk                                   (0x1fUL << LCD_PAL14_R04_0_Pos)                           /*!< LCD PAL14: R04_0 Mask               */\r
+#define LCD_PAL14_G04_0_Pos                                   5                                                         /*!< LCD PAL14: G04_0 Position           */\r
+#define LCD_PAL14_G04_0_Msk                                   (0x1fUL << LCD_PAL14_G04_0_Pos)                           /*!< LCD PAL14: G04_0 Mask               */\r
+#define LCD_PAL14_B04_0_Pos                                   10                                                        /*!< LCD PAL14: B04_0 Position           */\r
+#define LCD_PAL14_B04_0_Msk                                   (0x1fUL << LCD_PAL14_B04_0_Pos)                           /*!< LCD PAL14: B04_0 Mask               */\r
+#define LCD_PAL14_I0_Pos                                      15                                                        /*!< LCD PAL14: I0 Position              */\r
+#define LCD_PAL14_I0_Msk                                      (0x01UL << LCD_PAL14_I0_Pos)                              /*!< LCD PAL14: I0 Mask                  */\r
+#define LCD_PAL14_R14_0_Pos                                   16                                                        /*!< LCD PAL14: R14_0 Position           */\r
+#define LCD_PAL14_R14_0_Msk                                   (0x1fUL << LCD_PAL14_R14_0_Pos)                           /*!< LCD PAL14: R14_0 Mask               */\r
+#define LCD_PAL14_G14_0_Pos                                   21                                                        /*!< LCD PAL14: G14_0 Position           */\r
+#define LCD_PAL14_G14_0_Msk                                   (0x1fUL << LCD_PAL14_G14_0_Pos)                           /*!< LCD PAL14: G14_0 Mask               */\r
+#define LCD_PAL14_B14_0_Pos                                   26                                                        /*!< LCD PAL14: B14_0 Position           */\r
+#define LCD_PAL14_B14_0_Msk                                   (0x1fUL << LCD_PAL14_B14_0_Pos)                           /*!< LCD PAL14: B14_0 Mask               */\r
+#define LCD_PAL14_I1_Pos                                      31                                                        /*!< LCD PAL14: I1 Position              */\r
+#define LCD_PAL14_I1_Msk                                      (0x01UL << LCD_PAL14_I1_Pos)                              /*!< LCD PAL14: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL15  -------------------------------------------\r
+#define LCD_PAL15_R04_0_Pos                                   0                                                         /*!< LCD PAL15: R04_0 Position           */\r
+#define LCD_PAL15_R04_0_Msk                                   (0x1fUL << LCD_PAL15_R04_0_Pos)                           /*!< LCD PAL15: R04_0 Mask               */\r
+#define LCD_PAL15_G04_0_Pos                                   5                                                         /*!< LCD PAL15: G04_0 Position           */\r
+#define LCD_PAL15_G04_0_Msk                                   (0x1fUL << LCD_PAL15_G04_0_Pos)                           /*!< LCD PAL15: G04_0 Mask               */\r
+#define LCD_PAL15_B04_0_Pos                                   10                                                        /*!< LCD PAL15: B04_0 Position           */\r
+#define LCD_PAL15_B04_0_Msk                                   (0x1fUL << LCD_PAL15_B04_0_Pos)                           /*!< LCD PAL15: B04_0 Mask               */\r
+#define LCD_PAL15_I0_Pos                                      15                                                        /*!< LCD PAL15: I0 Position              */\r
+#define LCD_PAL15_I0_Msk                                      (0x01UL << LCD_PAL15_I0_Pos)                              /*!< LCD PAL15: I0 Mask                  */\r
+#define LCD_PAL15_R14_0_Pos                                   16                                                        /*!< LCD PAL15: R14_0 Position           */\r
+#define LCD_PAL15_R14_0_Msk                                   (0x1fUL << LCD_PAL15_R14_0_Pos)                           /*!< LCD PAL15: R14_0 Mask               */\r
+#define LCD_PAL15_G14_0_Pos                                   21                                                        /*!< LCD PAL15: G14_0 Position           */\r
+#define LCD_PAL15_G14_0_Msk                                   (0x1fUL << LCD_PAL15_G14_0_Pos)                           /*!< LCD PAL15: G14_0 Mask               */\r
+#define LCD_PAL15_B14_0_Pos                                   26                                                        /*!< LCD PAL15: B14_0 Position           */\r
+#define LCD_PAL15_B14_0_Msk                                   (0x1fUL << LCD_PAL15_B14_0_Pos)                           /*!< LCD PAL15: B14_0 Mask               */\r
+#define LCD_PAL15_I1_Pos                                      31                                                        /*!< LCD PAL15: I1 Position              */\r
+#define LCD_PAL15_I1_Msk                                      (0x01UL << LCD_PAL15_I1_Pos)                              /*!< LCD PAL15: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL16  -------------------------------------------\r
+#define LCD_PAL16_R04_0_Pos                                   0                                                         /*!< LCD PAL16: R04_0 Position           */\r
+#define LCD_PAL16_R04_0_Msk                                   (0x1fUL << LCD_PAL16_R04_0_Pos)                           /*!< LCD PAL16: R04_0 Mask               */\r
+#define LCD_PAL16_G04_0_Pos                                   5                                                         /*!< LCD PAL16: G04_0 Position           */\r
+#define LCD_PAL16_G04_0_Msk                                   (0x1fUL << LCD_PAL16_G04_0_Pos)                           /*!< LCD PAL16: G04_0 Mask               */\r
+#define LCD_PAL16_B04_0_Pos                                   10                                                        /*!< LCD PAL16: B04_0 Position           */\r
+#define LCD_PAL16_B04_0_Msk                                   (0x1fUL << LCD_PAL16_B04_0_Pos)                           /*!< LCD PAL16: B04_0 Mask               */\r
+#define LCD_PAL16_I0_Pos                                      15                                                        /*!< LCD PAL16: I0 Position              */\r
+#define LCD_PAL16_I0_Msk                                      (0x01UL << LCD_PAL16_I0_Pos)                              /*!< LCD PAL16: I0 Mask                  */\r
+#define LCD_PAL16_R14_0_Pos                                   16                                                        /*!< LCD PAL16: R14_0 Position           */\r
+#define LCD_PAL16_R14_0_Msk                                   (0x1fUL << LCD_PAL16_R14_0_Pos)                           /*!< LCD PAL16: R14_0 Mask               */\r
+#define LCD_PAL16_G14_0_Pos                                   21                                                        /*!< LCD PAL16: G14_0 Position           */\r
+#define LCD_PAL16_G14_0_Msk                                   (0x1fUL << LCD_PAL16_G14_0_Pos)                           /*!< LCD PAL16: G14_0 Mask               */\r
+#define LCD_PAL16_B14_0_Pos                                   26                                                        /*!< LCD PAL16: B14_0 Position           */\r
+#define LCD_PAL16_B14_0_Msk                                   (0x1fUL << LCD_PAL16_B14_0_Pos)                           /*!< LCD PAL16: B14_0 Mask               */\r
+#define LCD_PAL16_I1_Pos                                      31                                                        /*!< LCD PAL16: I1 Position              */\r
+#define LCD_PAL16_I1_Msk                                      (0x01UL << LCD_PAL16_I1_Pos)                              /*!< LCD PAL16: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL17  -------------------------------------------\r
+#define LCD_PAL17_R04_0_Pos                                   0                                                         /*!< LCD PAL17: R04_0 Position           */\r
+#define LCD_PAL17_R04_0_Msk                                   (0x1fUL << LCD_PAL17_R04_0_Pos)                           /*!< LCD PAL17: R04_0 Mask               */\r
+#define LCD_PAL17_G04_0_Pos                                   5                                                         /*!< LCD PAL17: G04_0 Position           */\r
+#define LCD_PAL17_G04_0_Msk                                   (0x1fUL << LCD_PAL17_G04_0_Pos)                           /*!< LCD PAL17: G04_0 Mask               */\r
+#define LCD_PAL17_B04_0_Pos                                   10                                                        /*!< LCD PAL17: B04_0 Position           */\r
+#define LCD_PAL17_B04_0_Msk                                   (0x1fUL << LCD_PAL17_B04_0_Pos)                           /*!< LCD PAL17: B04_0 Mask               */\r
+#define LCD_PAL17_I0_Pos                                      15                                                        /*!< LCD PAL17: I0 Position              */\r
+#define LCD_PAL17_I0_Msk                                      (0x01UL << LCD_PAL17_I0_Pos)                              /*!< LCD PAL17: I0 Mask                  */\r
+#define LCD_PAL17_R14_0_Pos                                   16                                                        /*!< LCD PAL17: R14_0 Position           */\r
+#define LCD_PAL17_R14_0_Msk                                   (0x1fUL << LCD_PAL17_R14_0_Pos)                           /*!< LCD PAL17: R14_0 Mask               */\r
+#define LCD_PAL17_G14_0_Pos                                   21                                                        /*!< LCD PAL17: G14_0 Position           */\r
+#define LCD_PAL17_G14_0_Msk                                   (0x1fUL << LCD_PAL17_G14_0_Pos)                           /*!< LCD PAL17: G14_0 Mask               */\r
+#define LCD_PAL17_B14_0_Pos                                   26                                                        /*!< LCD PAL17: B14_0 Position           */\r
+#define LCD_PAL17_B14_0_Msk                                   (0x1fUL << LCD_PAL17_B14_0_Pos)                           /*!< LCD PAL17: B14_0 Mask               */\r
+#define LCD_PAL17_I1_Pos                                      31                                                        /*!< LCD PAL17: I1 Position              */\r
+#define LCD_PAL17_I1_Msk                                      (0x01UL << LCD_PAL17_I1_Pos)                              /*!< LCD PAL17: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL18  -------------------------------------------\r
+#define LCD_PAL18_R04_0_Pos                                   0                                                         /*!< LCD PAL18: R04_0 Position           */\r
+#define LCD_PAL18_R04_0_Msk                                   (0x1fUL << LCD_PAL18_R04_0_Pos)                           /*!< LCD PAL18: R04_0 Mask               */\r
+#define LCD_PAL18_G04_0_Pos                                   5                                                         /*!< LCD PAL18: G04_0 Position           */\r
+#define LCD_PAL18_G04_0_Msk                                   (0x1fUL << LCD_PAL18_G04_0_Pos)                           /*!< LCD PAL18: G04_0 Mask               */\r
+#define LCD_PAL18_B04_0_Pos                                   10                                                        /*!< LCD PAL18: B04_0 Position           */\r
+#define LCD_PAL18_B04_0_Msk                                   (0x1fUL << LCD_PAL18_B04_0_Pos)                           /*!< LCD PAL18: B04_0 Mask               */\r
+#define LCD_PAL18_I0_Pos                                      15                                                        /*!< LCD PAL18: I0 Position              */\r
+#define LCD_PAL18_I0_Msk                                      (0x01UL << LCD_PAL18_I0_Pos)                              /*!< LCD PAL18: I0 Mask                  */\r
+#define LCD_PAL18_R14_0_Pos                                   16                                                        /*!< LCD PAL18: R14_0 Position           */\r
+#define LCD_PAL18_R14_0_Msk                                   (0x1fUL << LCD_PAL18_R14_0_Pos)                           /*!< LCD PAL18: R14_0 Mask               */\r
+#define LCD_PAL18_G14_0_Pos                                   21                                                        /*!< LCD PAL18: G14_0 Position           */\r
+#define LCD_PAL18_G14_0_Msk                                   (0x1fUL << LCD_PAL18_G14_0_Pos)                           /*!< LCD PAL18: G14_0 Mask               */\r
+#define LCD_PAL18_B14_0_Pos                                   26                                                        /*!< LCD PAL18: B14_0 Position           */\r
+#define LCD_PAL18_B14_0_Msk                                   (0x1fUL << LCD_PAL18_B14_0_Pos)                           /*!< LCD PAL18: B14_0 Mask               */\r
+#define LCD_PAL18_I1_Pos                                      31                                                        /*!< LCD PAL18: I1 Position              */\r
+#define LCD_PAL18_I1_Msk                                      (0x01UL << LCD_PAL18_I1_Pos)                              /*!< LCD PAL18: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL19  -------------------------------------------\r
+#define LCD_PAL19_R04_0_Pos                                   0                                                         /*!< LCD PAL19: R04_0 Position           */\r
+#define LCD_PAL19_R04_0_Msk                                   (0x1fUL << LCD_PAL19_R04_0_Pos)                           /*!< LCD PAL19: R04_0 Mask               */\r
+#define LCD_PAL19_G04_0_Pos                                   5                                                         /*!< LCD PAL19: G04_0 Position           */\r
+#define LCD_PAL19_G04_0_Msk                                   (0x1fUL << LCD_PAL19_G04_0_Pos)                           /*!< LCD PAL19: G04_0 Mask               */\r
+#define LCD_PAL19_B04_0_Pos                                   10                                                        /*!< LCD PAL19: B04_0 Position           */\r
+#define LCD_PAL19_B04_0_Msk                                   (0x1fUL << LCD_PAL19_B04_0_Pos)                           /*!< LCD PAL19: B04_0 Mask               */\r
+#define LCD_PAL19_I0_Pos                                      15                                                        /*!< LCD PAL19: I0 Position              */\r
+#define LCD_PAL19_I0_Msk                                      (0x01UL << LCD_PAL19_I0_Pos)                              /*!< LCD PAL19: I0 Mask                  */\r
+#define LCD_PAL19_R14_0_Pos                                   16                                                        /*!< LCD PAL19: R14_0 Position           */\r
+#define LCD_PAL19_R14_0_Msk                                   (0x1fUL << LCD_PAL19_R14_0_Pos)                           /*!< LCD PAL19: R14_0 Mask               */\r
+#define LCD_PAL19_G14_0_Pos                                   21                                                        /*!< LCD PAL19: G14_0 Position           */\r
+#define LCD_PAL19_G14_0_Msk                                   (0x1fUL << LCD_PAL19_G14_0_Pos)                           /*!< LCD PAL19: G14_0 Mask               */\r
+#define LCD_PAL19_B14_0_Pos                                   26                                                        /*!< LCD PAL19: B14_0 Position           */\r
+#define LCD_PAL19_B14_0_Msk                                   (0x1fUL << LCD_PAL19_B14_0_Pos)                           /*!< LCD PAL19: B14_0 Mask               */\r
+#define LCD_PAL19_I1_Pos                                      31                                                        /*!< LCD PAL19: I1 Position              */\r
+#define LCD_PAL19_I1_Msk                                      (0x01UL << LCD_PAL19_I1_Pos)                              /*!< LCD PAL19: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL20  -------------------------------------------\r
+#define LCD_PAL20_R04_0_Pos                                   0                                                         /*!< LCD PAL20: R04_0 Position           */\r
+#define LCD_PAL20_R04_0_Msk                                   (0x1fUL << LCD_PAL20_R04_0_Pos)                           /*!< LCD PAL20: R04_0 Mask               */\r
+#define LCD_PAL20_G04_0_Pos                                   5                                                         /*!< LCD PAL20: G04_0 Position           */\r
+#define LCD_PAL20_G04_0_Msk                                   (0x1fUL << LCD_PAL20_G04_0_Pos)                           /*!< LCD PAL20: G04_0 Mask               */\r
+#define LCD_PAL20_B04_0_Pos                                   10                                                        /*!< LCD PAL20: B04_0 Position           */\r
+#define LCD_PAL20_B04_0_Msk                                   (0x1fUL << LCD_PAL20_B04_0_Pos)                           /*!< LCD PAL20: B04_0 Mask               */\r
+#define LCD_PAL20_I0_Pos                                      15                                                        /*!< LCD PAL20: I0 Position              */\r
+#define LCD_PAL20_I0_Msk                                      (0x01UL << LCD_PAL20_I0_Pos)                              /*!< LCD PAL20: I0 Mask                  */\r
+#define LCD_PAL20_R14_0_Pos                                   16                                                        /*!< LCD PAL20: R14_0 Position           */\r
+#define LCD_PAL20_R14_0_Msk                                   (0x1fUL << LCD_PAL20_R14_0_Pos)                           /*!< LCD PAL20: R14_0 Mask               */\r
+#define LCD_PAL20_G14_0_Pos                                   21                                                        /*!< LCD PAL20: G14_0 Position           */\r
+#define LCD_PAL20_G14_0_Msk                                   (0x1fUL << LCD_PAL20_G14_0_Pos)                           /*!< LCD PAL20: G14_0 Mask               */\r
+#define LCD_PAL20_B14_0_Pos                                   26                                                        /*!< LCD PAL20: B14_0 Position           */\r
+#define LCD_PAL20_B14_0_Msk                                   (0x1fUL << LCD_PAL20_B14_0_Pos)                           /*!< LCD PAL20: B14_0 Mask               */\r
+#define LCD_PAL20_I1_Pos                                      31                                                        /*!< LCD PAL20: I1 Position              */\r
+#define LCD_PAL20_I1_Msk                                      (0x01UL << LCD_PAL20_I1_Pos)                              /*!< LCD PAL20: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL21  -------------------------------------------\r
+#define LCD_PAL21_R04_0_Pos                                   0                                                         /*!< LCD PAL21: R04_0 Position           */\r
+#define LCD_PAL21_R04_0_Msk                                   (0x1fUL << LCD_PAL21_R04_0_Pos)                           /*!< LCD PAL21: R04_0 Mask               */\r
+#define LCD_PAL21_G04_0_Pos                                   5                                                         /*!< LCD PAL21: G04_0 Position           */\r
+#define LCD_PAL21_G04_0_Msk                                   (0x1fUL << LCD_PAL21_G04_0_Pos)                           /*!< LCD PAL21: G04_0 Mask               */\r
+#define LCD_PAL21_B04_0_Pos                                   10                                                        /*!< LCD PAL21: B04_0 Position           */\r
+#define LCD_PAL21_B04_0_Msk                                   (0x1fUL << LCD_PAL21_B04_0_Pos)                           /*!< LCD PAL21: B04_0 Mask               */\r
+#define LCD_PAL21_I0_Pos                                      15                                                        /*!< LCD PAL21: I0 Position              */\r
+#define LCD_PAL21_I0_Msk                                      (0x01UL << LCD_PAL21_I0_Pos)                              /*!< LCD PAL21: I0 Mask                  */\r
+#define LCD_PAL21_R14_0_Pos                                   16                                                        /*!< LCD PAL21: R14_0 Position           */\r
+#define LCD_PAL21_R14_0_Msk                                   (0x1fUL << LCD_PAL21_R14_0_Pos)                           /*!< LCD PAL21: R14_0 Mask               */\r
+#define LCD_PAL21_G14_0_Pos                                   21                                                        /*!< LCD PAL21: G14_0 Position           */\r
+#define LCD_PAL21_G14_0_Msk                                   (0x1fUL << LCD_PAL21_G14_0_Pos)                           /*!< LCD PAL21: G14_0 Mask               */\r
+#define LCD_PAL21_B14_0_Pos                                   26                                                        /*!< LCD PAL21: B14_0 Position           */\r
+#define LCD_PAL21_B14_0_Msk                                   (0x1fUL << LCD_PAL21_B14_0_Pos)                           /*!< LCD PAL21: B14_0 Mask               */\r
+#define LCD_PAL21_I1_Pos                                      31                                                        /*!< LCD PAL21: I1 Position              */\r
+#define LCD_PAL21_I1_Msk                                      (0x01UL << LCD_PAL21_I1_Pos)                              /*!< LCD PAL21: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL22  -------------------------------------------\r
+#define LCD_PAL22_R04_0_Pos                                   0                                                         /*!< LCD PAL22: R04_0 Position           */\r
+#define LCD_PAL22_R04_0_Msk                                   (0x1fUL << LCD_PAL22_R04_0_Pos)                           /*!< LCD PAL22: R04_0 Mask               */\r
+#define LCD_PAL22_G04_0_Pos                                   5                                                         /*!< LCD PAL22: G04_0 Position           */\r
+#define LCD_PAL22_G04_0_Msk                                   (0x1fUL << LCD_PAL22_G04_0_Pos)                           /*!< LCD PAL22: G04_0 Mask               */\r
+#define LCD_PAL22_B04_0_Pos                                   10                                                        /*!< LCD PAL22: B04_0 Position           */\r
+#define LCD_PAL22_B04_0_Msk                                   (0x1fUL << LCD_PAL22_B04_0_Pos)                           /*!< LCD PAL22: B04_0 Mask               */\r
+#define LCD_PAL22_I0_Pos                                      15                                                        /*!< LCD PAL22: I0 Position              */\r
+#define LCD_PAL22_I0_Msk                                      (0x01UL << LCD_PAL22_I0_Pos)                              /*!< LCD PAL22: I0 Mask                  */\r
+#define LCD_PAL22_R14_0_Pos                                   16                                                        /*!< LCD PAL22: R14_0 Position           */\r
+#define LCD_PAL22_R14_0_Msk                                   (0x1fUL << LCD_PAL22_R14_0_Pos)                           /*!< LCD PAL22: R14_0 Mask               */\r
+#define LCD_PAL22_G14_0_Pos                                   21                                                        /*!< LCD PAL22: G14_0 Position           */\r
+#define LCD_PAL22_G14_0_Msk                                   (0x1fUL << LCD_PAL22_G14_0_Pos)                           /*!< LCD PAL22: G14_0 Mask               */\r
+#define LCD_PAL22_B14_0_Pos                                   26                                                        /*!< LCD PAL22: B14_0 Position           */\r
+#define LCD_PAL22_B14_0_Msk                                   (0x1fUL << LCD_PAL22_B14_0_Pos)                           /*!< LCD PAL22: B14_0 Mask               */\r
+#define LCD_PAL22_I1_Pos                                      31                                                        /*!< LCD PAL22: I1 Position              */\r
+#define LCD_PAL22_I1_Msk                                      (0x01UL << LCD_PAL22_I1_Pos)                              /*!< LCD PAL22: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL23  -------------------------------------------\r
+#define LCD_PAL23_R04_0_Pos                                   0                                                         /*!< LCD PAL23: R04_0 Position           */\r
+#define LCD_PAL23_R04_0_Msk                                   (0x1fUL << LCD_PAL23_R04_0_Pos)                           /*!< LCD PAL23: R04_0 Mask               */\r
+#define LCD_PAL23_G04_0_Pos                                   5                                                         /*!< LCD PAL23: G04_0 Position           */\r
+#define LCD_PAL23_G04_0_Msk                                   (0x1fUL << LCD_PAL23_G04_0_Pos)                           /*!< LCD PAL23: G04_0 Mask               */\r
+#define LCD_PAL23_B04_0_Pos                                   10                                                        /*!< LCD PAL23: B04_0 Position           */\r
+#define LCD_PAL23_B04_0_Msk                                   (0x1fUL << LCD_PAL23_B04_0_Pos)                           /*!< LCD PAL23: B04_0 Mask               */\r
+#define LCD_PAL23_I0_Pos                                      15                                                        /*!< LCD PAL23: I0 Position              */\r
+#define LCD_PAL23_I0_Msk                                      (0x01UL << LCD_PAL23_I0_Pos)                              /*!< LCD PAL23: I0 Mask                  */\r
+#define LCD_PAL23_R14_0_Pos                                   16                                                        /*!< LCD PAL23: R14_0 Position           */\r
+#define LCD_PAL23_R14_0_Msk                                   (0x1fUL << LCD_PAL23_R14_0_Pos)                           /*!< LCD PAL23: R14_0 Mask               */\r
+#define LCD_PAL23_G14_0_Pos                                   21                                                        /*!< LCD PAL23: G14_0 Position           */\r
+#define LCD_PAL23_G14_0_Msk                                   (0x1fUL << LCD_PAL23_G14_0_Pos)                           /*!< LCD PAL23: G14_0 Mask               */\r
+#define LCD_PAL23_B14_0_Pos                                   26                                                        /*!< LCD PAL23: B14_0 Position           */\r
+#define LCD_PAL23_B14_0_Msk                                   (0x1fUL << LCD_PAL23_B14_0_Pos)                           /*!< LCD PAL23: B14_0 Mask               */\r
+#define LCD_PAL23_I1_Pos                                      31                                                        /*!< LCD PAL23: I1 Position              */\r
+#define LCD_PAL23_I1_Msk                                      (0x01UL << LCD_PAL23_I1_Pos)                              /*!< LCD PAL23: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL24  -------------------------------------------\r
+#define LCD_PAL24_R04_0_Pos                                   0                                                         /*!< LCD PAL24: R04_0 Position           */\r
+#define LCD_PAL24_R04_0_Msk                                   (0x1fUL << LCD_PAL24_R04_0_Pos)                           /*!< LCD PAL24: R04_0 Mask               */\r
+#define LCD_PAL24_G04_0_Pos                                   5                                                         /*!< LCD PAL24: G04_0 Position           */\r
+#define LCD_PAL24_G04_0_Msk                                   (0x1fUL << LCD_PAL24_G04_0_Pos)                           /*!< LCD PAL24: G04_0 Mask               */\r
+#define LCD_PAL24_B04_0_Pos                                   10                                                        /*!< LCD PAL24: B04_0 Position           */\r
+#define LCD_PAL24_B04_0_Msk                                   (0x1fUL << LCD_PAL24_B04_0_Pos)                           /*!< LCD PAL24: B04_0 Mask               */\r
+#define LCD_PAL24_I0_Pos                                      15                                                        /*!< LCD PAL24: I0 Position              */\r
+#define LCD_PAL24_I0_Msk                                      (0x01UL << LCD_PAL24_I0_Pos)                              /*!< LCD PAL24: I0 Mask                  */\r
+#define LCD_PAL24_R14_0_Pos                                   16                                                        /*!< LCD PAL24: R14_0 Position           */\r
+#define LCD_PAL24_R14_0_Msk                                   (0x1fUL << LCD_PAL24_R14_0_Pos)                           /*!< LCD PAL24: R14_0 Mask               */\r
+#define LCD_PAL24_G14_0_Pos                                   21                                                        /*!< LCD PAL24: G14_0 Position           */\r
+#define LCD_PAL24_G14_0_Msk                                   (0x1fUL << LCD_PAL24_G14_0_Pos)                           /*!< LCD PAL24: G14_0 Mask               */\r
+#define LCD_PAL24_B14_0_Pos                                   26                                                        /*!< LCD PAL24: B14_0 Position           */\r
+#define LCD_PAL24_B14_0_Msk                                   (0x1fUL << LCD_PAL24_B14_0_Pos)                           /*!< LCD PAL24: B14_0 Mask               */\r
+#define LCD_PAL24_I1_Pos                                      31                                                        /*!< LCD PAL24: I1 Position              */\r
+#define LCD_PAL24_I1_Msk                                      (0x01UL << LCD_PAL24_I1_Pos)                              /*!< LCD PAL24: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL25  -------------------------------------------\r
+#define LCD_PAL25_R04_0_Pos                                   0                                                         /*!< LCD PAL25: R04_0 Position           */\r
+#define LCD_PAL25_R04_0_Msk                                   (0x1fUL << LCD_PAL25_R04_0_Pos)                           /*!< LCD PAL25: R04_0 Mask               */\r
+#define LCD_PAL25_G04_0_Pos                                   5                                                         /*!< LCD PAL25: G04_0 Position           */\r
+#define LCD_PAL25_G04_0_Msk                                   (0x1fUL << LCD_PAL25_G04_0_Pos)                           /*!< LCD PAL25: G04_0 Mask               */\r
+#define LCD_PAL25_B04_0_Pos                                   10                                                        /*!< LCD PAL25: B04_0 Position           */\r
+#define LCD_PAL25_B04_0_Msk                                   (0x1fUL << LCD_PAL25_B04_0_Pos)                           /*!< LCD PAL25: B04_0 Mask               */\r
+#define LCD_PAL25_I0_Pos                                      15                                                        /*!< LCD PAL25: I0 Position              */\r
+#define LCD_PAL25_I0_Msk                                      (0x01UL << LCD_PAL25_I0_Pos)                              /*!< LCD PAL25: I0 Mask                  */\r
+#define LCD_PAL25_R14_0_Pos                                   16                                                        /*!< LCD PAL25: R14_0 Position           */\r
+#define LCD_PAL25_R14_0_Msk                                   (0x1fUL << LCD_PAL25_R14_0_Pos)                           /*!< LCD PAL25: R14_0 Mask               */\r
+#define LCD_PAL25_G14_0_Pos                                   21                                                        /*!< LCD PAL25: G14_0 Position           */\r
+#define LCD_PAL25_G14_0_Msk                                   (0x1fUL << LCD_PAL25_G14_0_Pos)                           /*!< LCD PAL25: G14_0 Mask               */\r
+#define LCD_PAL25_B14_0_Pos                                   26                                                        /*!< LCD PAL25: B14_0 Position           */\r
+#define LCD_PAL25_B14_0_Msk                                   (0x1fUL << LCD_PAL25_B14_0_Pos)                           /*!< LCD PAL25: B14_0 Mask               */\r
+#define LCD_PAL25_I1_Pos                                      31                                                        /*!< LCD PAL25: I1 Position              */\r
+#define LCD_PAL25_I1_Msk                                      (0x01UL << LCD_PAL25_I1_Pos)                              /*!< LCD PAL25: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL26  -------------------------------------------\r
+#define LCD_PAL26_R04_0_Pos                                   0                                                         /*!< LCD PAL26: R04_0 Position           */\r
+#define LCD_PAL26_R04_0_Msk                                   (0x1fUL << LCD_PAL26_R04_0_Pos)                           /*!< LCD PAL26: R04_0 Mask               */\r
+#define LCD_PAL26_G04_0_Pos                                   5                                                         /*!< LCD PAL26: G04_0 Position           */\r
+#define LCD_PAL26_G04_0_Msk                                   (0x1fUL << LCD_PAL26_G04_0_Pos)                           /*!< LCD PAL26: G04_0 Mask               */\r
+#define LCD_PAL26_B04_0_Pos                                   10                                                        /*!< LCD PAL26: B04_0 Position           */\r
+#define LCD_PAL26_B04_0_Msk                                   (0x1fUL << LCD_PAL26_B04_0_Pos)                           /*!< LCD PAL26: B04_0 Mask               */\r
+#define LCD_PAL26_I0_Pos                                      15                                                        /*!< LCD PAL26: I0 Position              */\r
+#define LCD_PAL26_I0_Msk                                      (0x01UL << LCD_PAL26_I0_Pos)                              /*!< LCD PAL26: I0 Mask                  */\r
+#define LCD_PAL26_R14_0_Pos                                   16                                                        /*!< LCD PAL26: R14_0 Position           */\r
+#define LCD_PAL26_R14_0_Msk                                   (0x1fUL << LCD_PAL26_R14_0_Pos)                           /*!< LCD PAL26: R14_0 Mask               */\r
+#define LCD_PAL26_G14_0_Pos                                   21                                                        /*!< LCD PAL26: G14_0 Position           */\r
+#define LCD_PAL26_G14_0_Msk                                   (0x1fUL << LCD_PAL26_G14_0_Pos)                           /*!< LCD PAL26: G14_0 Mask               */\r
+#define LCD_PAL26_B14_0_Pos                                   26                                                        /*!< LCD PAL26: B14_0 Position           */\r
+#define LCD_PAL26_B14_0_Msk                                   (0x1fUL << LCD_PAL26_B14_0_Pos)                           /*!< LCD PAL26: B14_0 Mask               */\r
+#define LCD_PAL26_I1_Pos                                      31                                                        /*!< LCD PAL26: I1 Position              */\r
+#define LCD_PAL26_I1_Msk                                      (0x01UL << LCD_PAL26_I1_Pos)                              /*!< LCD PAL26: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL27  -------------------------------------------\r
+#define LCD_PAL27_R04_0_Pos                                   0                                                         /*!< LCD PAL27: R04_0 Position           */\r
+#define LCD_PAL27_R04_0_Msk                                   (0x1fUL << LCD_PAL27_R04_0_Pos)                           /*!< LCD PAL27: R04_0 Mask               */\r
+#define LCD_PAL27_G04_0_Pos                                   5                                                         /*!< LCD PAL27: G04_0 Position           */\r
+#define LCD_PAL27_G04_0_Msk                                   (0x1fUL << LCD_PAL27_G04_0_Pos)                           /*!< LCD PAL27: G04_0 Mask               */\r
+#define LCD_PAL27_B04_0_Pos                                   10                                                        /*!< LCD PAL27: B04_0 Position           */\r
+#define LCD_PAL27_B04_0_Msk                                   (0x1fUL << LCD_PAL27_B04_0_Pos)                           /*!< LCD PAL27: B04_0 Mask               */\r
+#define LCD_PAL27_I0_Pos                                      15                                                        /*!< LCD PAL27: I0 Position              */\r
+#define LCD_PAL27_I0_Msk                                      (0x01UL << LCD_PAL27_I0_Pos)                              /*!< LCD PAL27: I0 Mask                  */\r
+#define LCD_PAL27_R14_0_Pos                                   16                                                        /*!< LCD PAL27: R14_0 Position           */\r
+#define LCD_PAL27_R14_0_Msk                                   (0x1fUL << LCD_PAL27_R14_0_Pos)                           /*!< LCD PAL27: R14_0 Mask               */\r
+#define LCD_PAL27_G14_0_Pos                                   21                                                        /*!< LCD PAL27: G14_0 Position           */\r
+#define LCD_PAL27_G14_0_Msk                                   (0x1fUL << LCD_PAL27_G14_0_Pos)                           /*!< LCD PAL27: G14_0 Mask               */\r
+#define LCD_PAL27_B14_0_Pos                                   26                                                        /*!< LCD PAL27: B14_0 Position           */\r
+#define LCD_PAL27_B14_0_Msk                                   (0x1fUL << LCD_PAL27_B14_0_Pos)                           /*!< LCD PAL27: B14_0 Mask               */\r
+#define LCD_PAL27_I1_Pos                                      31                                                        /*!< LCD PAL27: I1 Position              */\r
+#define LCD_PAL27_I1_Msk                                      (0x01UL << LCD_PAL27_I1_Pos)                              /*!< LCD PAL27: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL28  -------------------------------------------\r
+#define LCD_PAL28_R04_0_Pos                                   0                                                         /*!< LCD PAL28: R04_0 Position           */\r
+#define LCD_PAL28_R04_0_Msk                                   (0x1fUL << LCD_PAL28_R04_0_Pos)                           /*!< LCD PAL28: R04_0 Mask               */\r
+#define LCD_PAL28_G04_0_Pos                                   5                                                         /*!< LCD PAL28: G04_0 Position           */\r
+#define LCD_PAL28_G04_0_Msk                                   (0x1fUL << LCD_PAL28_G04_0_Pos)                           /*!< LCD PAL28: G04_0 Mask               */\r
+#define LCD_PAL28_B04_0_Pos                                   10                                                        /*!< LCD PAL28: B04_0 Position           */\r
+#define LCD_PAL28_B04_0_Msk                                   (0x1fUL << LCD_PAL28_B04_0_Pos)                           /*!< LCD PAL28: B04_0 Mask               */\r
+#define LCD_PAL28_I0_Pos                                      15                                                        /*!< LCD PAL28: I0 Position              */\r
+#define LCD_PAL28_I0_Msk                                      (0x01UL << LCD_PAL28_I0_Pos)                              /*!< LCD PAL28: I0 Mask                  */\r
+#define LCD_PAL28_R14_0_Pos                                   16                                                        /*!< LCD PAL28: R14_0 Position           */\r
+#define LCD_PAL28_R14_0_Msk                                   (0x1fUL << LCD_PAL28_R14_0_Pos)                           /*!< LCD PAL28: R14_0 Mask               */\r
+#define LCD_PAL28_G14_0_Pos                                   21                                                        /*!< LCD PAL28: G14_0 Position           */\r
+#define LCD_PAL28_G14_0_Msk                                   (0x1fUL << LCD_PAL28_G14_0_Pos)                           /*!< LCD PAL28: G14_0 Mask               */\r
+#define LCD_PAL28_B14_0_Pos                                   26                                                        /*!< LCD PAL28: B14_0 Position           */\r
+#define LCD_PAL28_B14_0_Msk                                   (0x1fUL << LCD_PAL28_B14_0_Pos)                           /*!< LCD PAL28: B14_0 Mask               */\r
+#define LCD_PAL28_I1_Pos                                      31                                                        /*!< LCD PAL28: I1 Position              */\r
+#define LCD_PAL28_I1_Msk                                      (0x01UL << LCD_PAL28_I1_Pos)                              /*!< LCD PAL28: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL29  -------------------------------------------\r
+#define LCD_PAL29_R04_0_Pos                                   0                                                         /*!< LCD PAL29: R04_0 Position           */\r
+#define LCD_PAL29_R04_0_Msk                                   (0x1fUL << LCD_PAL29_R04_0_Pos)                           /*!< LCD PAL29: R04_0 Mask               */\r
+#define LCD_PAL29_G04_0_Pos                                   5                                                         /*!< LCD PAL29: G04_0 Position           */\r
+#define LCD_PAL29_G04_0_Msk                                   (0x1fUL << LCD_PAL29_G04_0_Pos)                           /*!< LCD PAL29: G04_0 Mask               */\r
+#define LCD_PAL29_B04_0_Pos                                   10                                                        /*!< LCD PAL29: B04_0 Position           */\r
+#define LCD_PAL29_B04_0_Msk                                   (0x1fUL << LCD_PAL29_B04_0_Pos)                           /*!< LCD PAL29: B04_0 Mask               */\r
+#define LCD_PAL29_I0_Pos                                      15                                                        /*!< LCD PAL29: I0 Position              */\r
+#define LCD_PAL29_I0_Msk                                      (0x01UL << LCD_PAL29_I0_Pos)                              /*!< LCD PAL29: I0 Mask                  */\r
+#define LCD_PAL29_R14_0_Pos                                   16                                                        /*!< LCD PAL29: R14_0 Position           */\r
+#define LCD_PAL29_R14_0_Msk                                   (0x1fUL << LCD_PAL29_R14_0_Pos)                           /*!< LCD PAL29: R14_0 Mask               */\r
+#define LCD_PAL29_G14_0_Pos                                   21                                                        /*!< LCD PAL29: G14_0 Position           */\r
+#define LCD_PAL29_G14_0_Msk                                   (0x1fUL << LCD_PAL29_G14_0_Pos)                           /*!< LCD PAL29: G14_0 Mask               */\r
+#define LCD_PAL29_B14_0_Pos                                   26                                                        /*!< LCD PAL29: B14_0 Position           */\r
+#define LCD_PAL29_B14_0_Msk                                   (0x1fUL << LCD_PAL29_B14_0_Pos)                           /*!< LCD PAL29: B14_0 Mask               */\r
+#define LCD_PAL29_I1_Pos                                      31                                                        /*!< LCD PAL29: I1 Position              */\r
+#define LCD_PAL29_I1_Msk                                      (0x01UL << LCD_PAL29_I1_Pos)                              /*!< LCD PAL29: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL30  -------------------------------------------\r
+#define LCD_PAL30_R04_0_Pos                                   0                                                         /*!< LCD PAL30: R04_0 Position           */\r
+#define LCD_PAL30_R04_0_Msk                                   (0x1fUL << LCD_PAL30_R04_0_Pos)                           /*!< LCD PAL30: R04_0 Mask               */\r
+#define LCD_PAL30_G04_0_Pos                                   5                                                         /*!< LCD PAL30: G04_0 Position           */\r
+#define LCD_PAL30_G04_0_Msk                                   (0x1fUL << LCD_PAL30_G04_0_Pos)                           /*!< LCD PAL30: G04_0 Mask               */\r
+#define LCD_PAL30_B04_0_Pos                                   10                                                        /*!< LCD PAL30: B04_0 Position           */\r
+#define LCD_PAL30_B04_0_Msk                                   (0x1fUL << LCD_PAL30_B04_0_Pos)                           /*!< LCD PAL30: B04_0 Mask               */\r
+#define LCD_PAL30_I0_Pos                                      15                                                        /*!< LCD PAL30: I0 Position              */\r
+#define LCD_PAL30_I0_Msk                                      (0x01UL << LCD_PAL30_I0_Pos)                              /*!< LCD PAL30: I0 Mask                  */\r
+#define LCD_PAL30_R14_0_Pos                                   16                                                        /*!< LCD PAL30: R14_0 Position           */\r
+#define LCD_PAL30_R14_0_Msk                                   (0x1fUL << LCD_PAL30_R14_0_Pos)                           /*!< LCD PAL30: R14_0 Mask               */\r
+#define LCD_PAL30_G14_0_Pos                                   21                                                        /*!< LCD PAL30: G14_0 Position           */\r
+#define LCD_PAL30_G14_0_Msk                                   (0x1fUL << LCD_PAL30_G14_0_Pos)                           /*!< LCD PAL30: G14_0 Mask               */\r
+#define LCD_PAL30_B14_0_Pos                                   26                                                        /*!< LCD PAL30: B14_0 Position           */\r
+#define LCD_PAL30_B14_0_Msk                                   (0x1fUL << LCD_PAL30_B14_0_Pos)                           /*!< LCD PAL30: B14_0 Mask               */\r
+#define LCD_PAL30_I1_Pos                                      31                                                        /*!< LCD PAL30: I1 Position              */\r
+#define LCD_PAL30_I1_Msk                                      (0x01UL << LCD_PAL30_I1_Pos)                              /*!< LCD PAL30: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL31  -------------------------------------------\r
+#define LCD_PAL31_R04_0_Pos                                   0                                                         /*!< LCD PAL31: R04_0 Position           */\r
+#define LCD_PAL31_R04_0_Msk                                   (0x1fUL << LCD_PAL31_R04_0_Pos)                           /*!< LCD PAL31: R04_0 Mask               */\r
+#define LCD_PAL31_G04_0_Pos                                   5                                                         /*!< LCD PAL31: G04_0 Position           */\r
+#define LCD_PAL31_G04_0_Msk                                   (0x1fUL << LCD_PAL31_G04_0_Pos)                           /*!< LCD PAL31: G04_0 Mask               */\r
+#define LCD_PAL31_B04_0_Pos                                   10                                                        /*!< LCD PAL31: B04_0 Position           */\r
+#define LCD_PAL31_B04_0_Msk                                   (0x1fUL << LCD_PAL31_B04_0_Pos)                           /*!< LCD PAL31: B04_0 Mask               */\r
+#define LCD_PAL31_I0_Pos                                      15                                                        /*!< LCD PAL31: I0 Position              */\r
+#define LCD_PAL31_I0_Msk                                      (0x01UL << LCD_PAL31_I0_Pos)                              /*!< LCD PAL31: I0 Mask                  */\r
+#define LCD_PAL31_R14_0_Pos                                   16                                                        /*!< LCD PAL31: R14_0 Position           */\r
+#define LCD_PAL31_R14_0_Msk                                   (0x1fUL << LCD_PAL31_R14_0_Pos)                           /*!< LCD PAL31: R14_0 Mask               */\r
+#define LCD_PAL31_G14_0_Pos                                   21                                                        /*!< LCD PAL31: G14_0 Position           */\r
+#define LCD_PAL31_G14_0_Msk                                   (0x1fUL << LCD_PAL31_G14_0_Pos)                           /*!< LCD PAL31: G14_0 Mask               */\r
+#define LCD_PAL31_B14_0_Pos                                   26                                                        /*!< LCD PAL31: B14_0 Position           */\r
+#define LCD_PAL31_B14_0_Msk                                   (0x1fUL << LCD_PAL31_B14_0_Pos)                           /*!< LCD PAL31: B14_0 Mask               */\r
+#define LCD_PAL31_I1_Pos                                      31                                                        /*!< LCD PAL31: I1 Position              */\r
+#define LCD_PAL31_I1_Msk                                      (0x01UL << LCD_PAL31_I1_Pos)                              /*!< LCD PAL31: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL32  -------------------------------------------\r
+#define LCD_PAL32_R04_0_Pos                                   0                                                         /*!< LCD PAL32: R04_0 Position           */\r
+#define LCD_PAL32_R04_0_Msk                                   (0x1fUL << LCD_PAL32_R04_0_Pos)                           /*!< LCD PAL32: R04_0 Mask               */\r
+#define LCD_PAL32_G04_0_Pos                                   5                                                         /*!< LCD PAL32: G04_0 Position           */\r
+#define LCD_PAL32_G04_0_Msk                                   (0x1fUL << LCD_PAL32_G04_0_Pos)                           /*!< LCD PAL32: G04_0 Mask               */\r
+#define LCD_PAL32_B04_0_Pos                                   10                                                        /*!< LCD PAL32: B04_0 Position           */\r
+#define LCD_PAL32_B04_0_Msk                                   (0x1fUL << LCD_PAL32_B04_0_Pos)                           /*!< LCD PAL32: B04_0 Mask               */\r
+#define LCD_PAL32_I0_Pos                                      15                                                        /*!< LCD PAL32: I0 Position              */\r
+#define LCD_PAL32_I0_Msk                                      (0x01UL << LCD_PAL32_I0_Pos)                              /*!< LCD PAL32: I0 Mask                  */\r
+#define LCD_PAL32_R14_0_Pos                                   16                                                        /*!< LCD PAL32: R14_0 Position           */\r
+#define LCD_PAL32_R14_0_Msk                                   (0x1fUL << LCD_PAL32_R14_0_Pos)                           /*!< LCD PAL32: R14_0 Mask               */\r
+#define LCD_PAL32_G14_0_Pos                                   21                                                        /*!< LCD PAL32: G14_0 Position           */\r
+#define LCD_PAL32_G14_0_Msk                                   (0x1fUL << LCD_PAL32_G14_0_Pos)                           /*!< LCD PAL32: G14_0 Mask               */\r
+#define LCD_PAL32_B14_0_Pos                                   26                                                        /*!< LCD PAL32: B14_0 Position           */\r
+#define LCD_PAL32_B14_0_Msk                                   (0x1fUL << LCD_PAL32_B14_0_Pos)                           /*!< LCD PAL32: B14_0 Mask               */\r
+#define LCD_PAL32_I1_Pos                                      31                                                        /*!< LCD PAL32: I1 Position              */\r
+#define LCD_PAL32_I1_Msk                                      (0x01UL << LCD_PAL32_I1_Pos)                              /*!< LCD PAL32: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL33  -------------------------------------------\r
+#define LCD_PAL33_R04_0_Pos                                   0                                                         /*!< LCD PAL33: R04_0 Position           */\r
+#define LCD_PAL33_R04_0_Msk                                   (0x1fUL << LCD_PAL33_R04_0_Pos)                           /*!< LCD PAL33: R04_0 Mask               */\r
+#define LCD_PAL33_G04_0_Pos                                   5                                                         /*!< LCD PAL33: G04_0 Position           */\r
+#define LCD_PAL33_G04_0_Msk                                   (0x1fUL << LCD_PAL33_G04_0_Pos)                           /*!< LCD PAL33: G04_0 Mask               */\r
+#define LCD_PAL33_B04_0_Pos                                   10                                                        /*!< LCD PAL33: B04_0 Position           */\r
+#define LCD_PAL33_B04_0_Msk                                   (0x1fUL << LCD_PAL33_B04_0_Pos)                           /*!< LCD PAL33: B04_0 Mask               */\r
+#define LCD_PAL33_I0_Pos                                      15                                                        /*!< LCD PAL33: I0 Position              */\r
+#define LCD_PAL33_I0_Msk                                      (0x01UL << LCD_PAL33_I0_Pos)                              /*!< LCD PAL33: I0 Mask                  */\r
+#define LCD_PAL33_R14_0_Pos                                   16                                                        /*!< LCD PAL33: R14_0 Position           */\r
+#define LCD_PAL33_R14_0_Msk                                   (0x1fUL << LCD_PAL33_R14_0_Pos)                           /*!< LCD PAL33: R14_0 Mask               */\r
+#define LCD_PAL33_G14_0_Pos                                   21                                                        /*!< LCD PAL33: G14_0 Position           */\r
+#define LCD_PAL33_G14_0_Msk                                   (0x1fUL << LCD_PAL33_G14_0_Pos)                           /*!< LCD PAL33: G14_0 Mask               */\r
+#define LCD_PAL33_B14_0_Pos                                   26                                                        /*!< LCD PAL33: B14_0 Position           */\r
+#define LCD_PAL33_B14_0_Msk                                   (0x1fUL << LCD_PAL33_B14_0_Pos)                           /*!< LCD PAL33: B14_0 Mask               */\r
+#define LCD_PAL33_I1_Pos                                      31                                                        /*!< LCD PAL33: I1 Position              */\r
+#define LCD_PAL33_I1_Msk                                      (0x01UL << LCD_PAL33_I1_Pos)                              /*!< LCD PAL33: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL34  -------------------------------------------\r
+#define LCD_PAL34_R04_0_Pos                                   0                                                         /*!< LCD PAL34: R04_0 Position           */\r
+#define LCD_PAL34_R04_0_Msk                                   (0x1fUL << LCD_PAL34_R04_0_Pos)                           /*!< LCD PAL34: R04_0 Mask               */\r
+#define LCD_PAL34_G04_0_Pos                                   5                                                         /*!< LCD PAL34: G04_0 Position           */\r
+#define LCD_PAL34_G04_0_Msk                                   (0x1fUL << LCD_PAL34_G04_0_Pos)                           /*!< LCD PAL34: G04_0 Mask               */\r
+#define LCD_PAL34_B04_0_Pos                                   10                                                        /*!< LCD PAL34: B04_0 Position           */\r
+#define LCD_PAL34_B04_0_Msk                                   (0x1fUL << LCD_PAL34_B04_0_Pos)                           /*!< LCD PAL34: B04_0 Mask               */\r
+#define LCD_PAL34_I0_Pos                                      15                                                        /*!< LCD PAL34: I0 Position              */\r
+#define LCD_PAL34_I0_Msk                                      (0x01UL << LCD_PAL34_I0_Pos)                              /*!< LCD PAL34: I0 Mask                  */\r
+#define LCD_PAL34_R14_0_Pos                                   16                                                        /*!< LCD PAL34: R14_0 Position           */\r
+#define LCD_PAL34_R14_0_Msk                                   (0x1fUL << LCD_PAL34_R14_0_Pos)                           /*!< LCD PAL34: R14_0 Mask               */\r
+#define LCD_PAL34_G14_0_Pos                                   21                                                        /*!< LCD PAL34: G14_0 Position           */\r
+#define LCD_PAL34_G14_0_Msk                                   (0x1fUL << LCD_PAL34_G14_0_Pos)                           /*!< LCD PAL34: G14_0 Mask               */\r
+#define LCD_PAL34_B14_0_Pos                                   26                                                        /*!< LCD PAL34: B14_0 Position           */\r
+#define LCD_PAL34_B14_0_Msk                                   (0x1fUL << LCD_PAL34_B14_0_Pos)                           /*!< LCD PAL34: B14_0 Mask               */\r
+#define LCD_PAL34_I1_Pos                                      31                                                        /*!< LCD PAL34: I1 Position              */\r
+#define LCD_PAL34_I1_Msk                                      (0x01UL << LCD_PAL34_I1_Pos)                              /*!< LCD PAL34: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL35  -------------------------------------------\r
+#define LCD_PAL35_R04_0_Pos                                   0                                                         /*!< LCD PAL35: R04_0 Position           */\r
+#define LCD_PAL35_R04_0_Msk                                   (0x1fUL << LCD_PAL35_R04_0_Pos)                           /*!< LCD PAL35: R04_0 Mask               */\r
+#define LCD_PAL35_G04_0_Pos                                   5                                                         /*!< LCD PAL35: G04_0 Position           */\r
+#define LCD_PAL35_G04_0_Msk                                   (0x1fUL << LCD_PAL35_G04_0_Pos)                           /*!< LCD PAL35: G04_0 Mask               */\r
+#define LCD_PAL35_B04_0_Pos                                   10                                                        /*!< LCD PAL35: B04_0 Position           */\r
+#define LCD_PAL35_B04_0_Msk                                   (0x1fUL << LCD_PAL35_B04_0_Pos)                           /*!< LCD PAL35: B04_0 Mask               */\r
+#define LCD_PAL35_I0_Pos                                      15                                                        /*!< LCD PAL35: I0 Position              */\r
+#define LCD_PAL35_I0_Msk                                      (0x01UL << LCD_PAL35_I0_Pos)                              /*!< LCD PAL35: I0 Mask                  */\r
+#define LCD_PAL35_R14_0_Pos                                   16                                                        /*!< LCD PAL35: R14_0 Position           */\r
+#define LCD_PAL35_R14_0_Msk                                   (0x1fUL << LCD_PAL35_R14_0_Pos)                           /*!< LCD PAL35: R14_0 Mask               */\r
+#define LCD_PAL35_G14_0_Pos                                   21                                                        /*!< LCD PAL35: G14_0 Position           */\r
+#define LCD_PAL35_G14_0_Msk                                   (0x1fUL << LCD_PAL35_G14_0_Pos)                           /*!< LCD PAL35: G14_0 Mask               */\r
+#define LCD_PAL35_B14_0_Pos                                   26                                                        /*!< LCD PAL35: B14_0 Position           */\r
+#define LCD_PAL35_B14_0_Msk                                   (0x1fUL << LCD_PAL35_B14_0_Pos)                           /*!< LCD PAL35: B14_0 Mask               */\r
+#define LCD_PAL35_I1_Pos                                      31                                                        /*!< LCD PAL35: I1 Position              */\r
+#define LCD_PAL35_I1_Msk                                      (0x01UL << LCD_PAL35_I1_Pos)                              /*!< LCD PAL35: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL36  -------------------------------------------\r
+#define LCD_PAL36_R04_0_Pos                                   0                                                         /*!< LCD PAL36: R04_0 Position           */\r
+#define LCD_PAL36_R04_0_Msk                                   (0x1fUL << LCD_PAL36_R04_0_Pos)                           /*!< LCD PAL36: R04_0 Mask               */\r
+#define LCD_PAL36_G04_0_Pos                                   5                                                         /*!< LCD PAL36: G04_0 Position           */\r
+#define LCD_PAL36_G04_0_Msk                                   (0x1fUL << LCD_PAL36_G04_0_Pos)                           /*!< LCD PAL36: G04_0 Mask               */\r
+#define LCD_PAL36_B04_0_Pos                                   10                                                        /*!< LCD PAL36: B04_0 Position           */\r
+#define LCD_PAL36_B04_0_Msk                                   (0x1fUL << LCD_PAL36_B04_0_Pos)                           /*!< LCD PAL36: B04_0 Mask               */\r
+#define LCD_PAL36_I0_Pos                                      15                                                        /*!< LCD PAL36: I0 Position              */\r
+#define LCD_PAL36_I0_Msk                                      (0x01UL << LCD_PAL36_I0_Pos)                              /*!< LCD PAL36: I0 Mask                  */\r
+#define LCD_PAL36_R14_0_Pos                                   16                                                        /*!< LCD PAL36: R14_0 Position           */\r
+#define LCD_PAL36_R14_0_Msk                                   (0x1fUL << LCD_PAL36_R14_0_Pos)                           /*!< LCD PAL36: R14_0 Mask               */\r
+#define LCD_PAL36_G14_0_Pos                                   21                                                        /*!< LCD PAL36: G14_0 Position           */\r
+#define LCD_PAL36_G14_0_Msk                                   (0x1fUL << LCD_PAL36_G14_0_Pos)                           /*!< LCD PAL36: G14_0 Mask               */\r
+#define LCD_PAL36_B14_0_Pos                                   26                                                        /*!< LCD PAL36: B14_0 Position           */\r
+#define LCD_PAL36_B14_0_Msk                                   (0x1fUL << LCD_PAL36_B14_0_Pos)                           /*!< LCD PAL36: B14_0 Mask               */\r
+#define LCD_PAL36_I1_Pos                                      31                                                        /*!< LCD PAL36: I1 Position              */\r
+#define LCD_PAL36_I1_Msk                                      (0x01UL << LCD_PAL36_I1_Pos)                              /*!< LCD PAL36: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL37  -------------------------------------------\r
+#define LCD_PAL37_R04_0_Pos                                   0                                                         /*!< LCD PAL37: R04_0 Position           */\r
+#define LCD_PAL37_R04_0_Msk                                   (0x1fUL << LCD_PAL37_R04_0_Pos)                           /*!< LCD PAL37: R04_0 Mask               */\r
+#define LCD_PAL37_G04_0_Pos                                   5                                                         /*!< LCD PAL37: G04_0 Position           */\r
+#define LCD_PAL37_G04_0_Msk                                   (0x1fUL << LCD_PAL37_G04_0_Pos)                           /*!< LCD PAL37: G04_0 Mask               */\r
+#define LCD_PAL37_B04_0_Pos                                   10                                                        /*!< LCD PAL37: B04_0 Position           */\r
+#define LCD_PAL37_B04_0_Msk                                   (0x1fUL << LCD_PAL37_B04_0_Pos)                           /*!< LCD PAL37: B04_0 Mask               */\r
+#define LCD_PAL37_I0_Pos                                      15                                                        /*!< LCD PAL37: I0 Position              */\r
+#define LCD_PAL37_I0_Msk                                      (0x01UL << LCD_PAL37_I0_Pos)                              /*!< LCD PAL37: I0 Mask                  */\r
+#define LCD_PAL37_R14_0_Pos                                   16                                                        /*!< LCD PAL37: R14_0 Position           */\r
+#define LCD_PAL37_R14_0_Msk                                   (0x1fUL << LCD_PAL37_R14_0_Pos)                           /*!< LCD PAL37: R14_0 Mask               */\r
+#define LCD_PAL37_G14_0_Pos                                   21                                                        /*!< LCD PAL37: G14_0 Position           */\r
+#define LCD_PAL37_G14_0_Msk                                   (0x1fUL << LCD_PAL37_G14_0_Pos)                           /*!< LCD PAL37: G14_0 Mask               */\r
+#define LCD_PAL37_B14_0_Pos                                   26                                                        /*!< LCD PAL37: B14_0 Position           */\r
+#define LCD_PAL37_B14_0_Msk                                   (0x1fUL << LCD_PAL37_B14_0_Pos)                           /*!< LCD PAL37: B14_0 Mask               */\r
+#define LCD_PAL37_I1_Pos                                      31                                                        /*!< LCD PAL37: I1 Position              */\r
+#define LCD_PAL37_I1_Msk                                      (0x01UL << LCD_PAL37_I1_Pos)                              /*!< LCD PAL37: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL38  -------------------------------------------\r
+#define LCD_PAL38_R04_0_Pos                                   0                                                         /*!< LCD PAL38: R04_0 Position           */\r
+#define LCD_PAL38_R04_0_Msk                                   (0x1fUL << LCD_PAL38_R04_0_Pos)                           /*!< LCD PAL38: R04_0 Mask               */\r
+#define LCD_PAL38_G04_0_Pos                                   5                                                         /*!< LCD PAL38: G04_0 Position           */\r
+#define LCD_PAL38_G04_0_Msk                                   (0x1fUL << LCD_PAL38_G04_0_Pos)                           /*!< LCD PAL38: G04_0 Mask               */\r
+#define LCD_PAL38_B04_0_Pos                                   10                                                        /*!< LCD PAL38: B04_0 Position           */\r
+#define LCD_PAL38_B04_0_Msk                                   (0x1fUL << LCD_PAL38_B04_0_Pos)                           /*!< LCD PAL38: B04_0 Mask               */\r
+#define LCD_PAL38_I0_Pos                                      15                                                        /*!< LCD PAL38: I0 Position              */\r
+#define LCD_PAL38_I0_Msk                                      (0x01UL << LCD_PAL38_I0_Pos)                              /*!< LCD PAL38: I0 Mask                  */\r
+#define LCD_PAL38_R14_0_Pos                                   16                                                        /*!< LCD PAL38: R14_0 Position           */\r
+#define LCD_PAL38_R14_0_Msk                                   (0x1fUL << LCD_PAL38_R14_0_Pos)                           /*!< LCD PAL38: R14_0 Mask               */\r
+#define LCD_PAL38_G14_0_Pos                                   21                                                        /*!< LCD PAL38: G14_0 Position           */\r
+#define LCD_PAL38_G14_0_Msk                                   (0x1fUL << LCD_PAL38_G14_0_Pos)                           /*!< LCD PAL38: G14_0 Mask               */\r
+#define LCD_PAL38_B14_0_Pos                                   26                                                        /*!< LCD PAL38: B14_0 Position           */\r
+#define LCD_PAL38_B14_0_Msk                                   (0x1fUL << LCD_PAL38_B14_0_Pos)                           /*!< LCD PAL38: B14_0 Mask               */\r
+#define LCD_PAL38_I1_Pos                                      31                                                        /*!< LCD PAL38: I1 Position              */\r
+#define LCD_PAL38_I1_Msk                                      (0x01UL << LCD_PAL38_I1_Pos)                              /*!< LCD PAL38: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL39  -------------------------------------------\r
+#define LCD_PAL39_R04_0_Pos                                   0                                                         /*!< LCD PAL39: R04_0 Position           */\r
+#define LCD_PAL39_R04_0_Msk                                   (0x1fUL << LCD_PAL39_R04_0_Pos)                           /*!< LCD PAL39: R04_0 Mask               */\r
+#define LCD_PAL39_G04_0_Pos                                   5                                                         /*!< LCD PAL39: G04_0 Position           */\r
+#define LCD_PAL39_G04_0_Msk                                   (0x1fUL << LCD_PAL39_G04_0_Pos)                           /*!< LCD PAL39: G04_0 Mask               */\r
+#define LCD_PAL39_B04_0_Pos                                   10                                                        /*!< LCD PAL39: B04_0 Position           */\r
+#define LCD_PAL39_B04_0_Msk                                   (0x1fUL << LCD_PAL39_B04_0_Pos)                           /*!< LCD PAL39: B04_0 Mask               */\r
+#define LCD_PAL39_I0_Pos                                      15                                                        /*!< LCD PAL39: I0 Position              */\r
+#define LCD_PAL39_I0_Msk                                      (0x01UL << LCD_PAL39_I0_Pos)                              /*!< LCD PAL39: I0 Mask                  */\r
+#define LCD_PAL39_R14_0_Pos                                   16                                                        /*!< LCD PAL39: R14_0 Position           */\r
+#define LCD_PAL39_R14_0_Msk                                   (0x1fUL << LCD_PAL39_R14_0_Pos)                           /*!< LCD PAL39: R14_0 Mask               */\r
+#define LCD_PAL39_G14_0_Pos                                   21                                                        /*!< LCD PAL39: G14_0 Position           */\r
+#define LCD_PAL39_G14_0_Msk                                   (0x1fUL << LCD_PAL39_G14_0_Pos)                           /*!< LCD PAL39: G14_0 Mask               */\r
+#define LCD_PAL39_B14_0_Pos                                   26                                                        /*!< LCD PAL39: B14_0 Position           */\r
+#define LCD_PAL39_B14_0_Msk                                   (0x1fUL << LCD_PAL39_B14_0_Pos)                           /*!< LCD PAL39: B14_0 Mask               */\r
+#define LCD_PAL39_I1_Pos                                      31                                                        /*!< LCD PAL39: I1 Position              */\r
+#define LCD_PAL39_I1_Msk                                      (0x01UL << LCD_PAL39_I1_Pos)                              /*!< LCD PAL39: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL40  -------------------------------------------\r
+#define LCD_PAL40_R04_0_Pos                                   0                                                         /*!< LCD PAL40: R04_0 Position           */\r
+#define LCD_PAL40_R04_0_Msk                                   (0x1fUL << LCD_PAL40_R04_0_Pos)                           /*!< LCD PAL40: R04_0 Mask               */\r
+#define LCD_PAL40_G04_0_Pos                                   5                                                         /*!< LCD PAL40: G04_0 Position           */\r
+#define LCD_PAL40_G04_0_Msk                                   (0x1fUL << LCD_PAL40_G04_0_Pos)                           /*!< LCD PAL40: G04_0 Mask               */\r
+#define LCD_PAL40_B04_0_Pos                                   10                                                        /*!< LCD PAL40: B04_0 Position           */\r
+#define LCD_PAL40_B04_0_Msk                                   (0x1fUL << LCD_PAL40_B04_0_Pos)                           /*!< LCD PAL40: B04_0 Mask               */\r
+#define LCD_PAL40_I0_Pos                                      15                                                        /*!< LCD PAL40: I0 Position              */\r
+#define LCD_PAL40_I0_Msk                                      (0x01UL << LCD_PAL40_I0_Pos)                              /*!< LCD PAL40: I0 Mask                  */\r
+#define LCD_PAL40_R14_0_Pos                                   16                                                        /*!< LCD PAL40: R14_0 Position           */\r
+#define LCD_PAL40_R14_0_Msk                                   (0x1fUL << LCD_PAL40_R14_0_Pos)                           /*!< LCD PAL40: R14_0 Mask               */\r
+#define LCD_PAL40_G14_0_Pos                                   21                                                        /*!< LCD PAL40: G14_0 Position           */\r
+#define LCD_PAL40_G14_0_Msk                                   (0x1fUL << LCD_PAL40_G14_0_Pos)                           /*!< LCD PAL40: G14_0 Mask               */\r
+#define LCD_PAL40_B14_0_Pos                                   26                                                        /*!< LCD PAL40: B14_0 Position           */\r
+#define LCD_PAL40_B14_0_Msk                                   (0x1fUL << LCD_PAL40_B14_0_Pos)                           /*!< LCD PAL40: B14_0 Mask               */\r
+#define LCD_PAL40_I1_Pos                                      31                                                        /*!< LCD PAL40: I1 Position              */\r
+#define LCD_PAL40_I1_Msk                                      (0x01UL << LCD_PAL40_I1_Pos)                              /*!< LCD PAL40: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL41  -------------------------------------------\r
+#define LCD_PAL41_R04_0_Pos                                   0                                                         /*!< LCD PAL41: R04_0 Position           */\r
+#define LCD_PAL41_R04_0_Msk                                   (0x1fUL << LCD_PAL41_R04_0_Pos)                           /*!< LCD PAL41: R04_0 Mask               */\r
+#define LCD_PAL41_G04_0_Pos                                   5                                                         /*!< LCD PAL41: G04_0 Position           */\r
+#define LCD_PAL41_G04_0_Msk                                   (0x1fUL << LCD_PAL41_G04_0_Pos)                           /*!< LCD PAL41: G04_0 Mask               */\r
+#define LCD_PAL41_B04_0_Pos                                   10                                                        /*!< LCD PAL41: B04_0 Position           */\r
+#define LCD_PAL41_B04_0_Msk                                   (0x1fUL << LCD_PAL41_B04_0_Pos)                           /*!< LCD PAL41: B04_0 Mask               */\r
+#define LCD_PAL41_I0_Pos                                      15                                                        /*!< LCD PAL41: I0 Position              */\r
+#define LCD_PAL41_I0_Msk                                      (0x01UL << LCD_PAL41_I0_Pos)                              /*!< LCD PAL41: I0 Mask                  */\r
+#define LCD_PAL41_R14_0_Pos                                   16                                                        /*!< LCD PAL41: R14_0 Position           */\r
+#define LCD_PAL41_R14_0_Msk                                   (0x1fUL << LCD_PAL41_R14_0_Pos)                           /*!< LCD PAL41: R14_0 Mask               */\r
+#define LCD_PAL41_G14_0_Pos                                   21                                                        /*!< LCD PAL41: G14_0 Position           */\r
+#define LCD_PAL41_G14_0_Msk                                   (0x1fUL << LCD_PAL41_G14_0_Pos)                           /*!< LCD PAL41: G14_0 Mask               */\r
+#define LCD_PAL41_B14_0_Pos                                   26                                                        /*!< LCD PAL41: B14_0 Position           */\r
+#define LCD_PAL41_B14_0_Msk                                   (0x1fUL << LCD_PAL41_B14_0_Pos)                           /*!< LCD PAL41: B14_0 Mask               */\r
+#define LCD_PAL41_I1_Pos                                      31                                                        /*!< LCD PAL41: I1 Position              */\r
+#define LCD_PAL41_I1_Msk                                      (0x01UL << LCD_PAL41_I1_Pos)                              /*!< LCD PAL41: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL42  -------------------------------------------\r
+#define LCD_PAL42_R04_0_Pos                                   0                                                         /*!< LCD PAL42: R04_0 Position           */\r
+#define LCD_PAL42_R04_0_Msk                                   (0x1fUL << LCD_PAL42_R04_0_Pos)                           /*!< LCD PAL42: R04_0 Mask               */\r
+#define LCD_PAL42_G04_0_Pos                                   5                                                         /*!< LCD PAL42: G04_0 Position           */\r
+#define LCD_PAL42_G04_0_Msk                                   (0x1fUL << LCD_PAL42_G04_0_Pos)                           /*!< LCD PAL42: G04_0 Mask               */\r
+#define LCD_PAL42_B04_0_Pos                                   10                                                        /*!< LCD PAL42: B04_0 Position           */\r
+#define LCD_PAL42_B04_0_Msk                                   (0x1fUL << LCD_PAL42_B04_0_Pos)                           /*!< LCD PAL42: B04_0 Mask               */\r
+#define LCD_PAL42_I0_Pos                                      15                                                        /*!< LCD PAL42: I0 Position              */\r
+#define LCD_PAL42_I0_Msk                                      (0x01UL << LCD_PAL42_I0_Pos)                              /*!< LCD PAL42: I0 Mask                  */\r
+#define LCD_PAL42_R14_0_Pos                                   16                                                        /*!< LCD PAL42: R14_0 Position           */\r
+#define LCD_PAL42_R14_0_Msk                                   (0x1fUL << LCD_PAL42_R14_0_Pos)                           /*!< LCD PAL42: R14_0 Mask               */\r
+#define LCD_PAL42_G14_0_Pos                                   21                                                        /*!< LCD PAL42: G14_0 Position           */\r
+#define LCD_PAL42_G14_0_Msk                                   (0x1fUL << LCD_PAL42_G14_0_Pos)                           /*!< LCD PAL42: G14_0 Mask               */\r
+#define LCD_PAL42_B14_0_Pos                                   26                                                        /*!< LCD PAL42: B14_0 Position           */\r
+#define LCD_PAL42_B14_0_Msk                                   (0x1fUL << LCD_PAL42_B14_0_Pos)                           /*!< LCD PAL42: B14_0 Mask               */\r
+#define LCD_PAL42_I1_Pos                                      31                                                        /*!< LCD PAL42: I1 Position              */\r
+#define LCD_PAL42_I1_Msk                                      (0x01UL << LCD_PAL42_I1_Pos)                              /*!< LCD PAL42: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL43  -------------------------------------------\r
+#define LCD_PAL43_R04_0_Pos                                   0                                                         /*!< LCD PAL43: R04_0 Position           */\r
+#define LCD_PAL43_R04_0_Msk                                   (0x1fUL << LCD_PAL43_R04_0_Pos)                           /*!< LCD PAL43: R04_0 Mask               */\r
+#define LCD_PAL43_G04_0_Pos                                   5                                                         /*!< LCD PAL43: G04_0 Position           */\r
+#define LCD_PAL43_G04_0_Msk                                   (0x1fUL << LCD_PAL43_G04_0_Pos)                           /*!< LCD PAL43: G04_0 Mask               */\r
+#define LCD_PAL43_B04_0_Pos                                   10                                                        /*!< LCD PAL43: B04_0 Position           */\r
+#define LCD_PAL43_B04_0_Msk                                   (0x1fUL << LCD_PAL43_B04_0_Pos)                           /*!< LCD PAL43: B04_0 Mask               */\r
+#define LCD_PAL43_I0_Pos                                      15                                                        /*!< LCD PAL43: I0 Position              */\r
+#define LCD_PAL43_I0_Msk                                      (0x01UL << LCD_PAL43_I0_Pos)                              /*!< LCD PAL43: I0 Mask                  */\r
+#define LCD_PAL43_R14_0_Pos                                   16                                                        /*!< LCD PAL43: R14_0 Position           */\r
+#define LCD_PAL43_R14_0_Msk                                   (0x1fUL << LCD_PAL43_R14_0_Pos)                           /*!< LCD PAL43: R14_0 Mask               */\r
+#define LCD_PAL43_G14_0_Pos                                   21                                                        /*!< LCD PAL43: G14_0 Position           */\r
+#define LCD_PAL43_G14_0_Msk                                   (0x1fUL << LCD_PAL43_G14_0_Pos)                           /*!< LCD PAL43: G14_0 Mask               */\r
+#define LCD_PAL43_B14_0_Pos                                   26                                                        /*!< LCD PAL43: B14_0 Position           */\r
+#define LCD_PAL43_B14_0_Msk                                   (0x1fUL << LCD_PAL43_B14_0_Pos)                           /*!< LCD PAL43: B14_0 Mask               */\r
+#define LCD_PAL43_I1_Pos                                      31                                                        /*!< LCD PAL43: I1 Position              */\r
+#define LCD_PAL43_I1_Msk                                      (0x01UL << LCD_PAL43_I1_Pos)                              /*!< LCD PAL43: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL44  -------------------------------------------\r
+#define LCD_PAL44_R04_0_Pos                                   0                                                         /*!< LCD PAL44: R04_0 Position           */\r
+#define LCD_PAL44_R04_0_Msk                                   (0x1fUL << LCD_PAL44_R04_0_Pos)                           /*!< LCD PAL44: R04_0 Mask               */\r
+#define LCD_PAL44_G04_0_Pos                                   5                                                         /*!< LCD PAL44: G04_0 Position           */\r
+#define LCD_PAL44_G04_0_Msk                                   (0x1fUL << LCD_PAL44_G04_0_Pos)                           /*!< LCD PAL44: G04_0 Mask               */\r
+#define LCD_PAL44_B04_0_Pos                                   10                                                        /*!< LCD PAL44: B04_0 Position           */\r
+#define LCD_PAL44_B04_0_Msk                                   (0x1fUL << LCD_PAL44_B04_0_Pos)                           /*!< LCD PAL44: B04_0 Mask               */\r
+#define LCD_PAL44_I0_Pos                                      15                                                        /*!< LCD PAL44: I0 Position              */\r
+#define LCD_PAL44_I0_Msk                                      (0x01UL << LCD_PAL44_I0_Pos)                              /*!< LCD PAL44: I0 Mask                  */\r
+#define LCD_PAL44_R14_0_Pos                                   16                                                        /*!< LCD PAL44: R14_0 Position           */\r
+#define LCD_PAL44_R14_0_Msk                                   (0x1fUL << LCD_PAL44_R14_0_Pos)                           /*!< LCD PAL44: R14_0 Mask               */\r
+#define LCD_PAL44_G14_0_Pos                                   21                                                        /*!< LCD PAL44: G14_0 Position           */\r
+#define LCD_PAL44_G14_0_Msk                                   (0x1fUL << LCD_PAL44_G14_0_Pos)                           /*!< LCD PAL44: G14_0 Mask               */\r
+#define LCD_PAL44_B14_0_Pos                                   26                                                        /*!< LCD PAL44: B14_0 Position           */\r
+#define LCD_PAL44_B14_0_Msk                                   (0x1fUL << LCD_PAL44_B14_0_Pos)                           /*!< LCD PAL44: B14_0 Mask               */\r
+#define LCD_PAL44_I1_Pos                                      31                                                        /*!< LCD PAL44: I1 Position              */\r
+#define LCD_PAL44_I1_Msk                                      (0x01UL << LCD_PAL44_I1_Pos)                              /*!< LCD PAL44: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL45  -------------------------------------------\r
+#define LCD_PAL45_R04_0_Pos                                   0                                                         /*!< LCD PAL45: R04_0 Position           */\r
+#define LCD_PAL45_R04_0_Msk                                   (0x1fUL << LCD_PAL45_R04_0_Pos)                           /*!< LCD PAL45: R04_0 Mask               */\r
+#define LCD_PAL45_G04_0_Pos                                   5                                                         /*!< LCD PAL45: G04_0 Position           */\r
+#define LCD_PAL45_G04_0_Msk                                   (0x1fUL << LCD_PAL45_G04_0_Pos)                           /*!< LCD PAL45: G04_0 Mask               */\r
+#define LCD_PAL45_B04_0_Pos                                   10                                                        /*!< LCD PAL45: B04_0 Position           */\r
+#define LCD_PAL45_B04_0_Msk                                   (0x1fUL << LCD_PAL45_B04_0_Pos)                           /*!< LCD PAL45: B04_0 Mask               */\r
+#define LCD_PAL45_I0_Pos                                      15                                                        /*!< LCD PAL45: I0 Position              */\r
+#define LCD_PAL45_I0_Msk                                      (0x01UL << LCD_PAL45_I0_Pos)                              /*!< LCD PAL45: I0 Mask                  */\r
+#define LCD_PAL45_R14_0_Pos                                   16                                                        /*!< LCD PAL45: R14_0 Position           */\r
+#define LCD_PAL45_R14_0_Msk                                   (0x1fUL << LCD_PAL45_R14_0_Pos)                           /*!< LCD PAL45: R14_0 Mask               */\r
+#define LCD_PAL45_G14_0_Pos                                   21                                                        /*!< LCD PAL45: G14_0 Position           */\r
+#define LCD_PAL45_G14_0_Msk                                   (0x1fUL << LCD_PAL45_G14_0_Pos)                           /*!< LCD PAL45: G14_0 Mask               */\r
+#define LCD_PAL45_B14_0_Pos                                   26                                                        /*!< LCD PAL45: B14_0 Position           */\r
+#define LCD_PAL45_B14_0_Msk                                   (0x1fUL << LCD_PAL45_B14_0_Pos)                           /*!< LCD PAL45: B14_0 Mask               */\r
+#define LCD_PAL45_I1_Pos                                      31                                                        /*!< LCD PAL45: I1 Position              */\r
+#define LCD_PAL45_I1_Msk                                      (0x01UL << LCD_PAL45_I1_Pos)                              /*!< LCD PAL45: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL46  -------------------------------------------\r
+#define LCD_PAL46_R04_0_Pos                                   0                                                         /*!< LCD PAL46: R04_0 Position           */\r
+#define LCD_PAL46_R04_0_Msk                                   (0x1fUL << LCD_PAL46_R04_0_Pos)                           /*!< LCD PAL46: R04_0 Mask               */\r
+#define LCD_PAL46_G04_0_Pos                                   5                                                         /*!< LCD PAL46: G04_0 Position           */\r
+#define LCD_PAL46_G04_0_Msk                                   (0x1fUL << LCD_PAL46_G04_0_Pos)                           /*!< LCD PAL46: G04_0 Mask               */\r
+#define LCD_PAL46_B04_0_Pos                                   10                                                        /*!< LCD PAL46: B04_0 Position           */\r
+#define LCD_PAL46_B04_0_Msk                                   (0x1fUL << LCD_PAL46_B04_0_Pos)                           /*!< LCD PAL46: B04_0 Mask               */\r
+#define LCD_PAL46_I0_Pos                                      15                                                        /*!< LCD PAL46: I0 Position              */\r
+#define LCD_PAL46_I0_Msk                                      (0x01UL << LCD_PAL46_I0_Pos)                              /*!< LCD PAL46: I0 Mask                  */\r
+#define LCD_PAL46_R14_0_Pos                                   16                                                        /*!< LCD PAL46: R14_0 Position           */\r
+#define LCD_PAL46_R14_0_Msk                                   (0x1fUL << LCD_PAL46_R14_0_Pos)                           /*!< LCD PAL46: R14_0 Mask               */\r
+#define LCD_PAL46_G14_0_Pos                                   21                                                        /*!< LCD PAL46: G14_0 Position           */\r
+#define LCD_PAL46_G14_0_Msk                                   (0x1fUL << LCD_PAL46_G14_0_Pos)                           /*!< LCD PAL46: G14_0 Mask               */\r
+#define LCD_PAL46_B14_0_Pos                                   26                                                        /*!< LCD PAL46: B14_0 Position           */\r
+#define LCD_PAL46_B14_0_Msk                                   (0x1fUL << LCD_PAL46_B14_0_Pos)                           /*!< LCD PAL46: B14_0 Mask               */\r
+#define LCD_PAL46_I1_Pos                                      31                                                        /*!< LCD PAL46: I1 Position              */\r
+#define LCD_PAL46_I1_Msk                                      (0x01UL << LCD_PAL46_I1_Pos)                              /*!< LCD PAL46: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL47  -------------------------------------------\r
+#define LCD_PAL47_R04_0_Pos                                   0                                                         /*!< LCD PAL47: R04_0 Position           */\r
+#define LCD_PAL47_R04_0_Msk                                   (0x1fUL << LCD_PAL47_R04_0_Pos)                           /*!< LCD PAL47: R04_0 Mask               */\r
+#define LCD_PAL47_G04_0_Pos                                   5                                                         /*!< LCD PAL47: G04_0 Position           */\r
+#define LCD_PAL47_G04_0_Msk                                   (0x1fUL << LCD_PAL47_G04_0_Pos)                           /*!< LCD PAL47: G04_0 Mask               */\r
+#define LCD_PAL47_B04_0_Pos                                   10                                                        /*!< LCD PAL47: B04_0 Position           */\r
+#define LCD_PAL47_B04_0_Msk                                   (0x1fUL << LCD_PAL47_B04_0_Pos)                           /*!< LCD PAL47: B04_0 Mask               */\r
+#define LCD_PAL47_I0_Pos                                      15                                                        /*!< LCD PAL47: I0 Position              */\r
+#define LCD_PAL47_I0_Msk                                      (0x01UL << LCD_PAL47_I0_Pos)                              /*!< LCD PAL47: I0 Mask                  */\r
+#define LCD_PAL47_R14_0_Pos                                   16                                                        /*!< LCD PAL47: R14_0 Position           */\r
+#define LCD_PAL47_R14_0_Msk                                   (0x1fUL << LCD_PAL47_R14_0_Pos)                           /*!< LCD PAL47: R14_0 Mask               */\r
+#define LCD_PAL47_G14_0_Pos                                   21                                                        /*!< LCD PAL47: G14_0 Position           */\r
+#define LCD_PAL47_G14_0_Msk                                   (0x1fUL << LCD_PAL47_G14_0_Pos)                           /*!< LCD PAL47: G14_0 Mask               */\r
+#define LCD_PAL47_B14_0_Pos                                   26                                                        /*!< LCD PAL47: B14_0 Position           */\r
+#define LCD_PAL47_B14_0_Msk                                   (0x1fUL << LCD_PAL47_B14_0_Pos)                           /*!< LCD PAL47: B14_0 Mask               */\r
+#define LCD_PAL47_I1_Pos                                      31                                                        /*!< LCD PAL47: I1 Position              */\r
+#define LCD_PAL47_I1_Msk                                      (0x01UL << LCD_PAL47_I1_Pos)                              /*!< LCD PAL47: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL48  -------------------------------------------\r
+#define LCD_PAL48_R04_0_Pos                                   0                                                         /*!< LCD PAL48: R04_0 Position           */\r
+#define LCD_PAL48_R04_0_Msk                                   (0x1fUL << LCD_PAL48_R04_0_Pos)                           /*!< LCD PAL48: R04_0 Mask               */\r
+#define LCD_PAL48_G04_0_Pos                                   5                                                         /*!< LCD PAL48: G04_0 Position           */\r
+#define LCD_PAL48_G04_0_Msk                                   (0x1fUL << LCD_PAL48_G04_0_Pos)                           /*!< LCD PAL48: G04_0 Mask               */\r
+#define LCD_PAL48_B04_0_Pos                                   10                                                        /*!< LCD PAL48: B04_0 Position           */\r
+#define LCD_PAL48_B04_0_Msk                                   (0x1fUL << LCD_PAL48_B04_0_Pos)                           /*!< LCD PAL48: B04_0 Mask               */\r
+#define LCD_PAL48_I0_Pos                                      15                                                        /*!< LCD PAL48: I0 Position              */\r
+#define LCD_PAL48_I0_Msk                                      (0x01UL << LCD_PAL48_I0_Pos)                              /*!< LCD PAL48: I0 Mask                  */\r
+#define LCD_PAL48_R14_0_Pos                                   16                                                        /*!< LCD PAL48: R14_0 Position           */\r
+#define LCD_PAL48_R14_0_Msk                                   (0x1fUL << LCD_PAL48_R14_0_Pos)                           /*!< LCD PAL48: R14_0 Mask               */\r
+#define LCD_PAL48_G14_0_Pos                                   21                                                        /*!< LCD PAL48: G14_0 Position           */\r
+#define LCD_PAL48_G14_0_Msk                                   (0x1fUL << LCD_PAL48_G14_0_Pos)                           /*!< LCD PAL48: G14_0 Mask               */\r
+#define LCD_PAL48_B14_0_Pos                                   26                                                        /*!< LCD PAL48: B14_0 Position           */\r
+#define LCD_PAL48_B14_0_Msk                                   (0x1fUL << LCD_PAL48_B14_0_Pos)                           /*!< LCD PAL48: B14_0 Mask               */\r
+#define LCD_PAL48_I1_Pos                                      31                                                        /*!< LCD PAL48: I1 Position              */\r
+#define LCD_PAL48_I1_Msk                                      (0x01UL << LCD_PAL48_I1_Pos)                              /*!< LCD PAL48: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL49  -------------------------------------------\r
+#define LCD_PAL49_R04_0_Pos                                   0                                                         /*!< LCD PAL49: R04_0 Position           */\r
+#define LCD_PAL49_R04_0_Msk                                   (0x1fUL << LCD_PAL49_R04_0_Pos)                           /*!< LCD PAL49: R04_0 Mask               */\r
+#define LCD_PAL49_G04_0_Pos                                   5                                                         /*!< LCD PAL49: G04_0 Position           */\r
+#define LCD_PAL49_G04_0_Msk                                   (0x1fUL << LCD_PAL49_G04_0_Pos)                           /*!< LCD PAL49: G04_0 Mask               */\r
+#define LCD_PAL49_B04_0_Pos                                   10                                                        /*!< LCD PAL49: B04_0 Position           */\r
+#define LCD_PAL49_B04_0_Msk                                   (0x1fUL << LCD_PAL49_B04_0_Pos)                           /*!< LCD PAL49: B04_0 Mask               */\r
+#define LCD_PAL49_I0_Pos                                      15                                                        /*!< LCD PAL49: I0 Position              */\r
+#define LCD_PAL49_I0_Msk                                      (0x01UL << LCD_PAL49_I0_Pos)                              /*!< LCD PAL49: I0 Mask                  */\r
+#define LCD_PAL49_R14_0_Pos                                   16                                                        /*!< LCD PAL49: R14_0 Position           */\r
+#define LCD_PAL49_R14_0_Msk                                   (0x1fUL << LCD_PAL49_R14_0_Pos)                           /*!< LCD PAL49: R14_0 Mask               */\r
+#define LCD_PAL49_G14_0_Pos                                   21                                                        /*!< LCD PAL49: G14_0 Position           */\r
+#define LCD_PAL49_G14_0_Msk                                   (0x1fUL << LCD_PAL49_G14_0_Pos)                           /*!< LCD PAL49: G14_0 Mask               */\r
+#define LCD_PAL49_B14_0_Pos                                   26                                                        /*!< LCD PAL49: B14_0 Position           */\r
+#define LCD_PAL49_B14_0_Msk                                   (0x1fUL << LCD_PAL49_B14_0_Pos)                           /*!< LCD PAL49: B14_0 Mask               */\r
+#define LCD_PAL49_I1_Pos                                      31                                                        /*!< LCD PAL49: I1 Position              */\r
+#define LCD_PAL49_I1_Msk                                      (0x01UL << LCD_PAL49_I1_Pos)                              /*!< LCD PAL49: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL50  -------------------------------------------\r
+#define LCD_PAL50_R04_0_Pos                                   0                                                         /*!< LCD PAL50: R04_0 Position           */\r
+#define LCD_PAL50_R04_0_Msk                                   (0x1fUL << LCD_PAL50_R04_0_Pos)                           /*!< LCD PAL50: R04_0 Mask               */\r
+#define LCD_PAL50_G04_0_Pos                                   5                                                         /*!< LCD PAL50: G04_0 Position           */\r
+#define LCD_PAL50_G04_0_Msk                                   (0x1fUL << LCD_PAL50_G04_0_Pos)                           /*!< LCD PAL50: G04_0 Mask               */\r
+#define LCD_PAL50_B04_0_Pos                                   10                                                        /*!< LCD PAL50: B04_0 Position           */\r
+#define LCD_PAL50_B04_0_Msk                                   (0x1fUL << LCD_PAL50_B04_0_Pos)                           /*!< LCD PAL50: B04_0 Mask               */\r
+#define LCD_PAL50_I0_Pos                                      15                                                        /*!< LCD PAL50: I0 Position              */\r
+#define LCD_PAL50_I0_Msk                                      (0x01UL << LCD_PAL50_I0_Pos)                              /*!< LCD PAL50: I0 Mask                  */\r
+#define LCD_PAL50_R14_0_Pos                                   16                                                        /*!< LCD PAL50: R14_0 Position           */\r
+#define LCD_PAL50_R14_0_Msk                                   (0x1fUL << LCD_PAL50_R14_0_Pos)                           /*!< LCD PAL50: R14_0 Mask               */\r
+#define LCD_PAL50_G14_0_Pos                                   21                                                        /*!< LCD PAL50: G14_0 Position           */\r
+#define LCD_PAL50_G14_0_Msk                                   (0x1fUL << LCD_PAL50_G14_0_Pos)                           /*!< LCD PAL50: G14_0 Mask               */\r
+#define LCD_PAL50_B14_0_Pos                                   26                                                        /*!< LCD PAL50: B14_0 Position           */\r
+#define LCD_PAL50_B14_0_Msk                                   (0x1fUL << LCD_PAL50_B14_0_Pos)                           /*!< LCD PAL50: B14_0 Mask               */\r
+#define LCD_PAL50_I1_Pos                                      31                                                        /*!< LCD PAL50: I1 Position              */\r
+#define LCD_PAL50_I1_Msk                                      (0x01UL << LCD_PAL50_I1_Pos)                              /*!< LCD PAL50: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL51  -------------------------------------------\r
+#define LCD_PAL51_R04_0_Pos                                   0                                                         /*!< LCD PAL51: R04_0 Position           */\r
+#define LCD_PAL51_R04_0_Msk                                   (0x1fUL << LCD_PAL51_R04_0_Pos)                           /*!< LCD PAL51: R04_0 Mask               */\r
+#define LCD_PAL51_G04_0_Pos                                   5                                                         /*!< LCD PAL51: G04_0 Position           */\r
+#define LCD_PAL51_G04_0_Msk                                   (0x1fUL << LCD_PAL51_G04_0_Pos)                           /*!< LCD PAL51: G04_0 Mask               */\r
+#define LCD_PAL51_B04_0_Pos                                   10                                                        /*!< LCD PAL51: B04_0 Position           */\r
+#define LCD_PAL51_B04_0_Msk                                   (0x1fUL << LCD_PAL51_B04_0_Pos)                           /*!< LCD PAL51: B04_0 Mask               */\r
+#define LCD_PAL51_I0_Pos                                      15                                                        /*!< LCD PAL51: I0 Position              */\r
+#define LCD_PAL51_I0_Msk                                      (0x01UL << LCD_PAL51_I0_Pos)                              /*!< LCD PAL51: I0 Mask                  */\r
+#define LCD_PAL51_R14_0_Pos                                   16                                                        /*!< LCD PAL51: R14_0 Position           */\r
+#define LCD_PAL51_R14_0_Msk                                   (0x1fUL << LCD_PAL51_R14_0_Pos)                           /*!< LCD PAL51: R14_0 Mask               */\r
+#define LCD_PAL51_G14_0_Pos                                   21                                                        /*!< LCD PAL51: G14_0 Position           */\r
+#define LCD_PAL51_G14_0_Msk                                   (0x1fUL << LCD_PAL51_G14_0_Pos)                           /*!< LCD PAL51: G14_0 Mask               */\r
+#define LCD_PAL51_B14_0_Pos                                   26                                                        /*!< LCD PAL51: B14_0 Position           */\r
+#define LCD_PAL51_B14_0_Msk                                   (0x1fUL << LCD_PAL51_B14_0_Pos)                           /*!< LCD PAL51: B14_0 Mask               */\r
+#define LCD_PAL51_I1_Pos                                      31                                                        /*!< LCD PAL51: I1 Position              */\r
+#define LCD_PAL51_I1_Msk                                      (0x01UL << LCD_PAL51_I1_Pos)                              /*!< LCD PAL51: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL52  -------------------------------------------\r
+#define LCD_PAL52_R04_0_Pos                                   0                                                         /*!< LCD PAL52: R04_0 Position           */\r
+#define LCD_PAL52_R04_0_Msk                                   (0x1fUL << LCD_PAL52_R04_0_Pos)                           /*!< LCD PAL52: R04_0 Mask               */\r
+#define LCD_PAL52_G04_0_Pos                                   5                                                         /*!< LCD PAL52: G04_0 Position           */\r
+#define LCD_PAL52_G04_0_Msk                                   (0x1fUL << LCD_PAL52_G04_0_Pos)                           /*!< LCD PAL52: G04_0 Mask               */\r
+#define LCD_PAL52_B04_0_Pos                                   10                                                        /*!< LCD PAL52: B04_0 Position           */\r
+#define LCD_PAL52_B04_0_Msk                                   (0x1fUL << LCD_PAL52_B04_0_Pos)                           /*!< LCD PAL52: B04_0 Mask               */\r
+#define LCD_PAL52_I0_Pos                                      15                                                        /*!< LCD PAL52: I0 Position              */\r
+#define LCD_PAL52_I0_Msk                                      (0x01UL << LCD_PAL52_I0_Pos)                              /*!< LCD PAL52: I0 Mask                  */\r
+#define LCD_PAL52_R14_0_Pos                                   16                                                        /*!< LCD PAL52: R14_0 Position           */\r
+#define LCD_PAL52_R14_0_Msk                                   (0x1fUL << LCD_PAL52_R14_0_Pos)                           /*!< LCD PAL52: R14_0 Mask               */\r
+#define LCD_PAL52_G14_0_Pos                                   21                                                        /*!< LCD PAL52: G14_0 Position           */\r
+#define LCD_PAL52_G14_0_Msk                                   (0x1fUL << LCD_PAL52_G14_0_Pos)                           /*!< LCD PAL52: G14_0 Mask               */\r
+#define LCD_PAL52_B14_0_Pos                                   26                                                        /*!< LCD PAL52: B14_0 Position           */\r
+#define LCD_PAL52_B14_0_Msk                                   (0x1fUL << LCD_PAL52_B14_0_Pos)                           /*!< LCD PAL52: B14_0 Mask               */\r
+#define LCD_PAL52_I1_Pos                                      31                                                        /*!< LCD PAL52: I1 Position              */\r
+#define LCD_PAL52_I1_Msk                                      (0x01UL << LCD_PAL52_I1_Pos)                              /*!< LCD PAL52: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL53  -------------------------------------------\r
+#define LCD_PAL53_R04_0_Pos                                   0                                                         /*!< LCD PAL53: R04_0 Position           */\r
+#define LCD_PAL53_R04_0_Msk                                   (0x1fUL << LCD_PAL53_R04_0_Pos)                           /*!< LCD PAL53: R04_0 Mask               */\r
+#define LCD_PAL53_G04_0_Pos                                   5                                                         /*!< LCD PAL53: G04_0 Position           */\r
+#define LCD_PAL53_G04_0_Msk                                   (0x1fUL << LCD_PAL53_G04_0_Pos)                           /*!< LCD PAL53: G04_0 Mask               */\r
+#define LCD_PAL53_B04_0_Pos                                   10                                                        /*!< LCD PAL53: B04_0 Position           */\r
+#define LCD_PAL53_B04_0_Msk                                   (0x1fUL << LCD_PAL53_B04_0_Pos)                           /*!< LCD PAL53: B04_0 Mask               */\r
+#define LCD_PAL53_I0_Pos                                      15                                                        /*!< LCD PAL53: I0 Position              */\r
+#define LCD_PAL53_I0_Msk                                      (0x01UL << LCD_PAL53_I0_Pos)                              /*!< LCD PAL53: I0 Mask                  */\r
+#define LCD_PAL53_R14_0_Pos                                   16                                                        /*!< LCD PAL53: R14_0 Position           */\r
+#define LCD_PAL53_R14_0_Msk                                   (0x1fUL << LCD_PAL53_R14_0_Pos)                           /*!< LCD PAL53: R14_0 Mask               */\r
+#define LCD_PAL53_G14_0_Pos                                   21                                                        /*!< LCD PAL53: G14_0 Position           */\r
+#define LCD_PAL53_G14_0_Msk                                   (0x1fUL << LCD_PAL53_G14_0_Pos)                           /*!< LCD PAL53: G14_0 Mask               */\r
+#define LCD_PAL53_B14_0_Pos                                   26                                                        /*!< LCD PAL53: B14_0 Position           */\r
+#define LCD_PAL53_B14_0_Msk                                   (0x1fUL << LCD_PAL53_B14_0_Pos)                           /*!< LCD PAL53: B14_0 Mask               */\r
+#define LCD_PAL53_I1_Pos                                      31                                                        /*!< LCD PAL53: I1 Position              */\r
+#define LCD_PAL53_I1_Msk                                      (0x01UL << LCD_PAL53_I1_Pos)                              /*!< LCD PAL53: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL54  -------------------------------------------\r
+#define LCD_PAL54_R04_0_Pos                                   0                                                         /*!< LCD PAL54: R04_0 Position           */\r
+#define LCD_PAL54_R04_0_Msk                                   (0x1fUL << LCD_PAL54_R04_0_Pos)                           /*!< LCD PAL54: R04_0 Mask               */\r
+#define LCD_PAL54_G04_0_Pos                                   5                                                         /*!< LCD PAL54: G04_0 Position           */\r
+#define LCD_PAL54_G04_0_Msk                                   (0x1fUL << LCD_PAL54_G04_0_Pos)                           /*!< LCD PAL54: G04_0 Mask               */\r
+#define LCD_PAL54_B04_0_Pos                                   10                                                        /*!< LCD PAL54: B04_0 Position           */\r
+#define LCD_PAL54_B04_0_Msk                                   (0x1fUL << LCD_PAL54_B04_0_Pos)                           /*!< LCD PAL54: B04_0 Mask               */\r
+#define LCD_PAL54_I0_Pos                                      15                                                        /*!< LCD PAL54: I0 Position              */\r
+#define LCD_PAL54_I0_Msk                                      (0x01UL << LCD_PAL54_I0_Pos)                              /*!< LCD PAL54: I0 Mask                  */\r
+#define LCD_PAL54_R14_0_Pos                                   16                                                        /*!< LCD PAL54: R14_0 Position           */\r
+#define LCD_PAL54_R14_0_Msk                                   (0x1fUL << LCD_PAL54_R14_0_Pos)                           /*!< LCD PAL54: R14_0 Mask               */\r
+#define LCD_PAL54_G14_0_Pos                                   21                                                        /*!< LCD PAL54: G14_0 Position           */\r
+#define LCD_PAL54_G14_0_Msk                                   (0x1fUL << LCD_PAL54_G14_0_Pos)                           /*!< LCD PAL54: G14_0 Mask               */\r
+#define LCD_PAL54_B14_0_Pos                                   26                                                        /*!< LCD PAL54: B14_0 Position           */\r
+#define LCD_PAL54_B14_0_Msk                                   (0x1fUL << LCD_PAL54_B14_0_Pos)                           /*!< LCD PAL54: B14_0 Mask               */\r
+#define LCD_PAL54_I1_Pos                                      31                                                        /*!< LCD PAL54: I1 Position              */\r
+#define LCD_PAL54_I1_Msk                                      (0x01UL << LCD_PAL54_I1_Pos)                              /*!< LCD PAL54: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL55  -------------------------------------------\r
+#define LCD_PAL55_R04_0_Pos                                   0                                                         /*!< LCD PAL55: R04_0 Position           */\r
+#define LCD_PAL55_R04_0_Msk                                   (0x1fUL << LCD_PAL55_R04_0_Pos)                           /*!< LCD PAL55: R04_0 Mask               */\r
+#define LCD_PAL55_G04_0_Pos                                   5                                                         /*!< LCD PAL55: G04_0 Position           */\r
+#define LCD_PAL55_G04_0_Msk                                   (0x1fUL << LCD_PAL55_G04_0_Pos)                           /*!< LCD PAL55: G04_0 Mask               */\r
+#define LCD_PAL55_B04_0_Pos                                   10                                                        /*!< LCD PAL55: B04_0 Position           */\r
+#define LCD_PAL55_B04_0_Msk                                   (0x1fUL << LCD_PAL55_B04_0_Pos)                           /*!< LCD PAL55: B04_0 Mask               */\r
+#define LCD_PAL55_I0_Pos                                      15                                                        /*!< LCD PAL55: I0 Position              */\r
+#define LCD_PAL55_I0_Msk                                      (0x01UL << LCD_PAL55_I0_Pos)                              /*!< LCD PAL55: I0 Mask                  */\r
+#define LCD_PAL55_R14_0_Pos                                   16                                                        /*!< LCD PAL55: R14_0 Position           */\r
+#define LCD_PAL55_R14_0_Msk                                   (0x1fUL << LCD_PAL55_R14_0_Pos)                           /*!< LCD PAL55: R14_0 Mask               */\r
+#define LCD_PAL55_G14_0_Pos                                   21                                                        /*!< LCD PAL55: G14_0 Position           */\r
+#define LCD_PAL55_G14_0_Msk                                   (0x1fUL << LCD_PAL55_G14_0_Pos)                           /*!< LCD PAL55: G14_0 Mask               */\r
+#define LCD_PAL55_B14_0_Pos                                   26                                                        /*!< LCD PAL55: B14_0 Position           */\r
+#define LCD_PAL55_B14_0_Msk                                   (0x1fUL << LCD_PAL55_B14_0_Pos)                           /*!< LCD PAL55: B14_0 Mask               */\r
+#define LCD_PAL55_I1_Pos                                      31                                                        /*!< LCD PAL55: I1 Position              */\r
+#define LCD_PAL55_I1_Msk                                      (0x01UL << LCD_PAL55_I1_Pos)                              /*!< LCD PAL55: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL56  -------------------------------------------\r
+#define LCD_PAL56_R04_0_Pos                                   0                                                         /*!< LCD PAL56: R04_0 Position           */\r
+#define LCD_PAL56_R04_0_Msk                                   (0x1fUL << LCD_PAL56_R04_0_Pos)                           /*!< LCD PAL56: R04_0 Mask               */\r
+#define LCD_PAL56_G04_0_Pos                                   5                                                         /*!< LCD PAL56: G04_0 Position           */\r
+#define LCD_PAL56_G04_0_Msk                                   (0x1fUL << LCD_PAL56_G04_0_Pos)                           /*!< LCD PAL56: G04_0 Mask               */\r
+#define LCD_PAL56_B04_0_Pos                                   10                                                        /*!< LCD PAL56: B04_0 Position           */\r
+#define LCD_PAL56_B04_0_Msk                                   (0x1fUL << LCD_PAL56_B04_0_Pos)                           /*!< LCD PAL56: B04_0 Mask               */\r
+#define LCD_PAL56_I0_Pos                                      15                                                        /*!< LCD PAL56: I0 Position              */\r
+#define LCD_PAL56_I0_Msk                                      (0x01UL << LCD_PAL56_I0_Pos)                              /*!< LCD PAL56: I0 Mask                  */\r
+#define LCD_PAL56_R14_0_Pos                                   16                                                        /*!< LCD PAL56: R14_0 Position           */\r
+#define LCD_PAL56_R14_0_Msk                                   (0x1fUL << LCD_PAL56_R14_0_Pos)                           /*!< LCD PAL56: R14_0 Mask               */\r
+#define LCD_PAL56_G14_0_Pos                                   21                                                        /*!< LCD PAL56: G14_0 Position           */\r
+#define LCD_PAL56_G14_0_Msk                                   (0x1fUL << LCD_PAL56_G14_0_Pos)                           /*!< LCD PAL56: G14_0 Mask               */\r
+#define LCD_PAL56_B14_0_Pos                                   26                                                        /*!< LCD PAL56: B14_0 Position           */\r
+#define LCD_PAL56_B14_0_Msk                                   (0x1fUL << LCD_PAL56_B14_0_Pos)                           /*!< LCD PAL56: B14_0 Mask               */\r
+#define LCD_PAL56_I1_Pos                                      31                                                        /*!< LCD PAL56: I1 Position              */\r
+#define LCD_PAL56_I1_Msk                                      (0x01UL << LCD_PAL56_I1_Pos)                              /*!< LCD PAL56: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL57  -------------------------------------------\r
+#define LCD_PAL57_R04_0_Pos                                   0                                                         /*!< LCD PAL57: R04_0 Position           */\r
+#define LCD_PAL57_R04_0_Msk                                   (0x1fUL << LCD_PAL57_R04_0_Pos)                           /*!< LCD PAL57: R04_0 Mask               */\r
+#define LCD_PAL57_G04_0_Pos                                   5                                                         /*!< LCD PAL57: G04_0 Position           */\r
+#define LCD_PAL57_G04_0_Msk                                   (0x1fUL << LCD_PAL57_G04_0_Pos)                           /*!< LCD PAL57: G04_0 Mask               */\r
+#define LCD_PAL57_B04_0_Pos                                   10                                                        /*!< LCD PAL57: B04_0 Position           */\r
+#define LCD_PAL57_B04_0_Msk                                   (0x1fUL << LCD_PAL57_B04_0_Pos)                           /*!< LCD PAL57: B04_0 Mask               */\r
+#define LCD_PAL57_I0_Pos                                      15                                                        /*!< LCD PAL57: I0 Position              */\r
+#define LCD_PAL57_I0_Msk                                      (0x01UL << LCD_PAL57_I0_Pos)                              /*!< LCD PAL57: I0 Mask                  */\r
+#define LCD_PAL57_R14_0_Pos                                   16                                                        /*!< LCD PAL57: R14_0 Position           */\r
+#define LCD_PAL57_R14_0_Msk                                   (0x1fUL << LCD_PAL57_R14_0_Pos)                           /*!< LCD PAL57: R14_0 Mask               */\r
+#define LCD_PAL57_G14_0_Pos                                   21                                                        /*!< LCD PAL57: G14_0 Position           */\r
+#define LCD_PAL57_G14_0_Msk                                   (0x1fUL << LCD_PAL57_G14_0_Pos)                           /*!< LCD PAL57: G14_0 Mask               */\r
+#define LCD_PAL57_B14_0_Pos                                   26                                                        /*!< LCD PAL57: B14_0 Position           */\r
+#define LCD_PAL57_B14_0_Msk                                   (0x1fUL << LCD_PAL57_B14_0_Pos)                           /*!< LCD PAL57: B14_0 Mask               */\r
+#define LCD_PAL57_I1_Pos                                      31                                                        /*!< LCD PAL57: I1 Position              */\r
+#define LCD_PAL57_I1_Msk                                      (0x01UL << LCD_PAL57_I1_Pos)                              /*!< LCD PAL57: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL58  -------------------------------------------\r
+#define LCD_PAL58_R04_0_Pos                                   0                                                         /*!< LCD PAL58: R04_0 Position           */\r
+#define LCD_PAL58_R04_0_Msk                                   (0x1fUL << LCD_PAL58_R04_0_Pos)                           /*!< LCD PAL58: R04_0 Mask               */\r
+#define LCD_PAL58_G04_0_Pos                                   5                                                         /*!< LCD PAL58: G04_0 Position           */\r
+#define LCD_PAL58_G04_0_Msk                                   (0x1fUL << LCD_PAL58_G04_0_Pos)                           /*!< LCD PAL58: G04_0 Mask               */\r
+#define LCD_PAL58_B04_0_Pos                                   10                                                        /*!< LCD PAL58: B04_0 Position           */\r
+#define LCD_PAL58_B04_0_Msk                                   (0x1fUL << LCD_PAL58_B04_0_Pos)                           /*!< LCD PAL58: B04_0 Mask               */\r
+#define LCD_PAL58_I0_Pos                                      15                                                        /*!< LCD PAL58: I0 Position              */\r
+#define LCD_PAL58_I0_Msk                                      (0x01UL << LCD_PAL58_I0_Pos)                              /*!< LCD PAL58: I0 Mask                  */\r
+#define LCD_PAL58_R14_0_Pos                                   16                                                        /*!< LCD PAL58: R14_0 Position           */\r
+#define LCD_PAL58_R14_0_Msk                                   (0x1fUL << LCD_PAL58_R14_0_Pos)                           /*!< LCD PAL58: R14_0 Mask               */\r
+#define LCD_PAL58_G14_0_Pos                                   21                                                        /*!< LCD PAL58: G14_0 Position           */\r
+#define LCD_PAL58_G14_0_Msk                                   (0x1fUL << LCD_PAL58_G14_0_Pos)                           /*!< LCD PAL58: G14_0 Mask               */\r
+#define LCD_PAL58_B14_0_Pos                                   26                                                        /*!< LCD PAL58: B14_0 Position           */\r
+#define LCD_PAL58_B14_0_Msk                                   (0x1fUL << LCD_PAL58_B14_0_Pos)                           /*!< LCD PAL58: B14_0 Mask               */\r
+#define LCD_PAL58_I1_Pos                                      31                                                        /*!< LCD PAL58: I1 Position              */\r
+#define LCD_PAL58_I1_Msk                                      (0x01UL << LCD_PAL58_I1_Pos)                              /*!< LCD PAL58: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL59  -------------------------------------------\r
+#define LCD_PAL59_R04_0_Pos                                   0                                                         /*!< LCD PAL59: R04_0 Position           */\r
+#define LCD_PAL59_R04_0_Msk                                   (0x1fUL << LCD_PAL59_R04_0_Pos)                           /*!< LCD PAL59: R04_0 Mask               */\r
+#define LCD_PAL59_G04_0_Pos                                   5                                                         /*!< LCD PAL59: G04_0 Position           */\r
+#define LCD_PAL59_G04_0_Msk                                   (0x1fUL << LCD_PAL59_G04_0_Pos)                           /*!< LCD PAL59: G04_0 Mask               */\r
+#define LCD_PAL59_B04_0_Pos                                   10                                                        /*!< LCD PAL59: B04_0 Position           */\r
+#define LCD_PAL59_B04_0_Msk                                   (0x1fUL << LCD_PAL59_B04_0_Pos)                           /*!< LCD PAL59: B04_0 Mask               */\r
+#define LCD_PAL59_I0_Pos                                      15                                                        /*!< LCD PAL59: I0 Position              */\r
+#define LCD_PAL59_I0_Msk                                      (0x01UL << LCD_PAL59_I0_Pos)                              /*!< LCD PAL59: I0 Mask                  */\r
+#define LCD_PAL59_R14_0_Pos                                   16                                                        /*!< LCD PAL59: R14_0 Position           */\r
+#define LCD_PAL59_R14_0_Msk                                   (0x1fUL << LCD_PAL59_R14_0_Pos)                           /*!< LCD PAL59: R14_0 Mask               */\r
+#define LCD_PAL59_G14_0_Pos                                   21                                                        /*!< LCD PAL59: G14_0 Position           */\r
+#define LCD_PAL59_G14_0_Msk                                   (0x1fUL << LCD_PAL59_G14_0_Pos)                           /*!< LCD PAL59: G14_0 Mask               */\r
+#define LCD_PAL59_B14_0_Pos                                   26                                                        /*!< LCD PAL59: B14_0 Position           */\r
+#define LCD_PAL59_B14_0_Msk                                   (0x1fUL << LCD_PAL59_B14_0_Pos)                           /*!< LCD PAL59: B14_0 Mask               */\r
+#define LCD_PAL59_I1_Pos                                      31                                                        /*!< LCD PAL59: I1 Position              */\r
+#define LCD_PAL59_I1_Msk                                      (0x01UL << LCD_PAL59_I1_Pos)                              /*!< LCD PAL59: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL60  -------------------------------------------\r
+#define LCD_PAL60_R04_0_Pos                                   0                                                         /*!< LCD PAL60: R04_0 Position           */\r
+#define LCD_PAL60_R04_0_Msk                                   (0x1fUL << LCD_PAL60_R04_0_Pos)                           /*!< LCD PAL60: R04_0 Mask               */\r
+#define LCD_PAL60_G04_0_Pos                                   5                                                         /*!< LCD PAL60: G04_0 Position           */\r
+#define LCD_PAL60_G04_0_Msk                                   (0x1fUL << LCD_PAL60_G04_0_Pos)                           /*!< LCD PAL60: G04_0 Mask               */\r
+#define LCD_PAL60_B04_0_Pos                                   10                                                        /*!< LCD PAL60: B04_0 Position           */\r
+#define LCD_PAL60_B04_0_Msk                                   (0x1fUL << LCD_PAL60_B04_0_Pos)                           /*!< LCD PAL60: B04_0 Mask               */\r
+#define LCD_PAL60_I0_Pos                                      15                                                        /*!< LCD PAL60: I0 Position              */\r
+#define LCD_PAL60_I0_Msk                                      (0x01UL << LCD_PAL60_I0_Pos)                              /*!< LCD PAL60: I0 Mask                  */\r
+#define LCD_PAL60_R14_0_Pos                                   16                                                        /*!< LCD PAL60: R14_0 Position           */\r
+#define LCD_PAL60_R14_0_Msk                                   (0x1fUL << LCD_PAL60_R14_0_Pos)                           /*!< LCD PAL60: R14_0 Mask               */\r
+#define LCD_PAL60_G14_0_Pos                                   21                                                        /*!< LCD PAL60: G14_0 Position           */\r
+#define LCD_PAL60_G14_0_Msk                                   (0x1fUL << LCD_PAL60_G14_0_Pos)                           /*!< LCD PAL60: G14_0 Mask               */\r
+#define LCD_PAL60_B14_0_Pos                                   26                                                        /*!< LCD PAL60: B14_0 Position           */\r
+#define LCD_PAL60_B14_0_Msk                                   (0x1fUL << LCD_PAL60_B14_0_Pos)                           /*!< LCD PAL60: B14_0 Mask               */\r
+#define LCD_PAL60_I1_Pos                                      31                                                        /*!< LCD PAL60: I1 Position              */\r
+#define LCD_PAL60_I1_Msk                                      (0x01UL << LCD_PAL60_I1_Pos)                              /*!< LCD PAL60: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL61  -------------------------------------------\r
+#define LCD_PAL61_R04_0_Pos                                   0                                                         /*!< LCD PAL61: R04_0 Position           */\r
+#define LCD_PAL61_R04_0_Msk                                   (0x1fUL << LCD_PAL61_R04_0_Pos)                           /*!< LCD PAL61: R04_0 Mask               */\r
+#define LCD_PAL61_G04_0_Pos                                   5                                                         /*!< LCD PAL61: G04_0 Position           */\r
+#define LCD_PAL61_G04_0_Msk                                   (0x1fUL << LCD_PAL61_G04_0_Pos)                           /*!< LCD PAL61: G04_0 Mask               */\r
+#define LCD_PAL61_B04_0_Pos                                   10                                                        /*!< LCD PAL61: B04_0 Position           */\r
+#define LCD_PAL61_B04_0_Msk                                   (0x1fUL << LCD_PAL61_B04_0_Pos)                           /*!< LCD PAL61: B04_0 Mask               */\r
+#define LCD_PAL61_I0_Pos                                      15                                                        /*!< LCD PAL61: I0 Position              */\r
+#define LCD_PAL61_I0_Msk                                      (0x01UL << LCD_PAL61_I0_Pos)                              /*!< LCD PAL61: I0 Mask                  */\r
+#define LCD_PAL61_R14_0_Pos                                   16                                                        /*!< LCD PAL61: R14_0 Position           */\r
+#define LCD_PAL61_R14_0_Msk                                   (0x1fUL << LCD_PAL61_R14_0_Pos)                           /*!< LCD PAL61: R14_0 Mask               */\r
+#define LCD_PAL61_G14_0_Pos                                   21                                                        /*!< LCD PAL61: G14_0 Position           */\r
+#define LCD_PAL61_G14_0_Msk                                   (0x1fUL << LCD_PAL61_G14_0_Pos)                           /*!< LCD PAL61: G14_0 Mask               */\r
+#define LCD_PAL61_B14_0_Pos                                   26                                                        /*!< LCD PAL61: B14_0 Position           */\r
+#define LCD_PAL61_B14_0_Msk                                   (0x1fUL << LCD_PAL61_B14_0_Pos)                           /*!< LCD PAL61: B14_0 Mask               */\r
+#define LCD_PAL61_I1_Pos                                      31                                                        /*!< LCD PAL61: I1 Position              */\r
+#define LCD_PAL61_I1_Msk                                      (0x01UL << LCD_PAL61_I1_Pos)                              /*!< LCD PAL61: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL62  -------------------------------------------\r
+#define LCD_PAL62_R04_0_Pos                                   0                                                         /*!< LCD PAL62: R04_0 Position           */\r
+#define LCD_PAL62_R04_0_Msk                                   (0x1fUL << LCD_PAL62_R04_0_Pos)                           /*!< LCD PAL62: R04_0 Mask               */\r
+#define LCD_PAL62_G04_0_Pos                                   5                                                         /*!< LCD PAL62: G04_0 Position           */\r
+#define LCD_PAL62_G04_0_Msk                                   (0x1fUL << LCD_PAL62_G04_0_Pos)                           /*!< LCD PAL62: G04_0 Mask               */\r
+#define LCD_PAL62_B04_0_Pos                                   10                                                        /*!< LCD PAL62: B04_0 Position           */\r
+#define LCD_PAL62_B04_0_Msk                                   (0x1fUL << LCD_PAL62_B04_0_Pos)                           /*!< LCD PAL62: B04_0 Mask               */\r
+#define LCD_PAL62_I0_Pos                                      15                                                        /*!< LCD PAL62: I0 Position              */\r
+#define LCD_PAL62_I0_Msk                                      (0x01UL << LCD_PAL62_I0_Pos)                              /*!< LCD PAL62: I0 Mask                  */\r
+#define LCD_PAL62_R14_0_Pos                                   16                                                        /*!< LCD PAL62: R14_0 Position           */\r
+#define LCD_PAL62_R14_0_Msk                                   (0x1fUL << LCD_PAL62_R14_0_Pos)                           /*!< LCD PAL62: R14_0 Mask               */\r
+#define LCD_PAL62_G14_0_Pos                                   21                                                        /*!< LCD PAL62: G14_0 Position           */\r
+#define LCD_PAL62_G14_0_Msk                                   (0x1fUL << LCD_PAL62_G14_0_Pos)                           /*!< LCD PAL62: G14_0 Mask               */\r
+#define LCD_PAL62_B14_0_Pos                                   26                                                        /*!< LCD PAL62: B14_0 Position           */\r
+#define LCD_PAL62_B14_0_Msk                                   (0x1fUL << LCD_PAL62_B14_0_Pos)                           /*!< LCD PAL62: B14_0 Mask               */\r
+#define LCD_PAL62_I1_Pos                                      31                                                        /*!< LCD PAL62: I1 Position              */\r
+#define LCD_PAL62_I1_Msk                                      (0x01UL << LCD_PAL62_I1_Pos)                              /*!< LCD PAL62: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL63  -------------------------------------------\r
+#define LCD_PAL63_R04_0_Pos                                   0                                                         /*!< LCD PAL63: R04_0 Position           */\r
+#define LCD_PAL63_R04_0_Msk                                   (0x1fUL << LCD_PAL63_R04_0_Pos)                           /*!< LCD PAL63: R04_0 Mask               */\r
+#define LCD_PAL63_G04_0_Pos                                   5                                                         /*!< LCD PAL63: G04_0 Position           */\r
+#define LCD_PAL63_G04_0_Msk                                   (0x1fUL << LCD_PAL63_G04_0_Pos)                           /*!< LCD PAL63: G04_0 Mask               */\r
+#define LCD_PAL63_B04_0_Pos                                   10                                                        /*!< LCD PAL63: B04_0 Position           */\r
+#define LCD_PAL63_B04_0_Msk                                   (0x1fUL << LCD_PAL63_B04_0_Pos)                           /*!< LCD PAL63: B04_0 Mask               */\r
+#define LCD_PAL63_I0_Pos                                      15                                                        /*!< LCD PAL63: I0 Position              */\r
+#define LCD_PAL63_I0_Msk                                      (0x01UL << LCD_PAL63_I0_Pos)                              /*!< LCD PAL63: I0 Mask                  */\r
+#define LCD_PAL63_R14_0_Pos                                   16                                                        /*!< LCD PAL63: R14_0 Position           */\r
+#define LCD_PAL63_R14_0_Msk                                   (0x1fUL << LCD_PAL63_R14_0_Pos)                           /*!< LCD PAL63: R14_0 Mask               */\r
+#define LCD_PAL63_G14_0_Pos                                   21                                                        /*!< LCD PAL63: G14_0 Position           */\r
+#define LCD_PAL63_G14_0_Msk                                   (0x1fUL << LCD_PAL63_G14_0_Pos)                           /*!< LCD PAL63: G14_0 Mask               */\r
+#define LCD_PAL63_B14_0_Pos                                   26                                                        /*!< LCD PAL63: B14_0 Position           */\r
+#define LCD_PAL63_B14_0_Msk                                   (0x1fUL << LCD_PAL63_B14_0_Pos)                           /*!< LCD PAL63: B14_0 Mask               */\r
+#define LCD_PAL63_I1_Pos                                      31                                                        /*!< LCD PAL63: I1 Position              */\r
+#define LCD_PAL63_I1_Msk                                      (0x01UL << LCD_PAL63_I1_Pos)                              /*!< LCD PAL63: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL64  -------------------------------------------\r
+#define LCD_PAL64_R04_0_Pos                                   0                                                         /*!< LCD PAL64: R04_0 Position           */\r
+#define LCD_PAL64_R04_0_Msk                                   (0x1fUL << LCD_PAL64_R04_0_Pos)                           /*!< LCD PAL64: R04_0 Mask               */\r
+#define LCD_PAL64_G04_0_Pos                                   5                                                         /*!< LCD PAL64: G04_0 Position           */\r
+#define LCD_PAL64_G04_0_Msk                                   (0x1fUL << LCD_PAL64_G04_0_Pos)                           /*!< LCD PAL64: G04_0 Mask               */\r
+#define LCD_PAL64_B04_0_Pos                                   10                                                        /*!< LCD PAL64: B04_0 Position           */\r
+#define LCD_PAL64_B04_0_Msk                                   (0x1fUL << LCD_PAL64_B04_0_Pos)                           /*!< LCD PAL64: B04_0 Mask               */\r
+#define LCD_PAL64_I0_Pos                                      15                                                        /*!< LCD PAL64: I0 Position              */\r
+#define LCD_PAL64_I0_Msk                                      (0x01UL << LCD_PAL64_I0_Pos)                              /*!< LCD PAL64: I0 Mask                  */\r
+#define LCD_PAL64_R14_0_Pos                                   16                                                        /*!< LCD PAL64: R14_0 Position           */\r
+#define LCD_PAL64_R14_0_Msk                                   (0x1fUL << LCD_PAL64_R14_0_Pos)                           /*!< LCD PAL64: R14_0 Mask               */\r
+#define LCD_PAL64_G14_0_Pos                                   21                                                        /*!< LCD PAL64: G14_0 Position           */\r
+#define LCD_PAL64_G14_0_Msk                                   (0x1fUL << LCD_PAL64_G14_0_Pos)                           /*!< LCD PAL64: G14_0 Mask               */\r
+#define LCD_PAL64_B14_0_Pos                                   26                                                        /*!< LCD PAL64: B14_0 Position           */\r
+#define LCD_PAL64_B14_0_Msk                                   (0x1fUL << LCD_PAL64_B14_0_Pos)                           /*!< LCD PAL64: B14_0 Mask               */\r
+#define LCD_PAL64_I1_Pos                                      31                                                        /*!< LCD PAL64: I1 Position              */\r
+#define LCD_PAL64_I1_Msk                                      (0x01UL << LCD_PAL64_I1_Pos)                              /*!< LCD PAL64: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL65  -------------------------------------------\r
+#define LCD_PAL65_R04_0_Pos                                   0                                                         /*!< LCD PAL65: R04_0 Position           */\r
+#define LCD_PAL65_R04_0_Msk                                   (0x1fUL << LCD_PAL65_R04_0_Pos)                           /*!< LCD PAL65: R04_0 Mask               */\r
+#define LCD_PAL65_G04_0_Pos                                   5                                                         /*!< LCD PAL65: G04_0 Position           */\r
+#define LCD_PAL65_G04_0_Msk                                   (0x1fUL << LCD_PAL65_G04_0_Pos)                           /*!< LCD PAL65: G04_0 Mask               */\r
+#define LCD_PAL65_B04_0_Pos                                   10                                                        /*!< LCD PAL65: B04_0 Position           */\r
+#define LCD_PAL65_B04_0_Msk                                   (0x1fUL << LCD_PAL65_B04_0_Pos)                           /*!< LCD PAL65: B04_0 Mask               */\r
+#define LCD_PAL65_I0_Pos                                      15                                                        /*!< LCD PAL65: I0 Position              */\r
+#define LCD_PAL65_I0_Msk                                      (0x01UL << LCD_PAL65_I0_Pos)                              /*!< LCD PAL65: I0 Mask                  */\r
+#define LCD_PAL65_R14_0_Pos                                   16                                                        /*!< LCD PAL65: R14_0 Position           */\r
+#define LCD_PAL65_R14_0_Msk                                   (0x1fUL << LCD_PAL65_R14_0_Pos)                           /*!< LCD PAL65: R14_0 Mask               */\r
+#define LCD_PAL65_G14_0_Pos                                   21                                                        /*!< LCD PAL65: G14_0 Position           */\r
+#define LCD_PAL65_G14_0_Msk                                   (0x1fUL << LCD_PAL65_G14_0_Pos)                           /*!< LCD PAL65: G14_0 Mask               */\r
+#define LCD_PAL65_B14_0_Pos                                   26                                                        /*!< LCD PAL65: B14_0 Position           */\r
+#define LCD_PAL65_B14_0_Msk                                   (0x1fUL << LCD_PAL65_B14_0_Pos)                           /*!< LCD PAL65: B14_0 Mask               */\r
+#define LCD_PAL65_I1_Pos                                      31                                                        /*!< LCD PAL65: I1 Position              */\r
+#define LCD_PAL65_I1_Msk                                      (0x01UL << LCD_PAL65_I1_Pos)                              /*!< LCD PAL65: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL66  -------------------------------------------\r
+#define LCD_PAL66_R04_0_Pos                                   0                                                         /*!< LCD PAL66: R04_0 Position           */\r
+#define LCD_PAL66_R04_0_Msk                                   (0x1fUL << LCD_PAL66_R04_0_Pos)                           /*!< LCD PAL66: R04_0 Mask               */\r
+#define LCD_PAL66_G04_0_Pos                                   5                                                         /*!< LCD PAL66: G04_0 Position           */\r
+#define LCD_PAL66_G04_0_Msk                                   (0x1fUL << LCD_PAL66_G04_0_Pos)                           /*!< LCD PAL66: G04_0 Mask               */\r
+#define LCD_PAL66_B04_0_Pos                                   10                                                        /*!< LCD PAL66: B04_0 Position           */\r
+#define LCD_PAL66_B04_0_Msk                                   (0x1fUL << LCD_PAL66_B04_0_Pos)                           /*!< LCD PAL66: B04_0 Mask               */\r
+#define LCD_PAL66_I0_Pos                                      15                                                        /*!< LCD PAL66: I0 Position              */\r
+#define LCD_PAL66_I0_Msk                                      (0x01UL << LCD_PAL66_I0_Pos)                              /*!< LCD PAL66: I0 Mask                  */\r
+#define LCD_PAL66_R14_0_Pos                                   16                                                        /*!< LCD PAL66: R14_0 Position           */\r
+#define LCD_PAL66_R14_0_Msk                                   (0x1fUL << LCD_PAL66_R14_0_Pos)                           /*!< LCD PAL66: R14_0 Mask               */\r
+#define LCD_PAL66_G14_0_Pos                                   21                                                        /*!< LCD PAL66: G14_0 Position           */\r
+#define LCD_PAL66_G14_0_Msk                                   (0x1fUL << LCD_PAL66_G14_0_Pos)                           /*!< LCD PAL66: G14_0 Mask               */\r
+#define LCD_PAL66_B14_0_Pos                                   26                                                        /*!< LCD PAL66: B14_0 Position           */\r
+#define LCD_PAL66_B14_0_Msk                                   (0x1fUL << LCD_PAL66_B14_0_Pos)                           /*!< LCD PAL66: B14_0 Mask               */\r
+#define LCD_PAL66_I1_Pos                                      31                                                        /*!< LCD PAL66: I1 Position              */\r
+#define LCD_PAL66_I1_Msk                                      (0x01UL << LCD_PAL66_I1_Pos)                              /*!< LCD PAL66: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL67  -------------------------------------------\r
+#define LCD_PAL67_R04_0_Pos                                   0                                                         /*!< LCD PAL67: R04_0 Position           */\r
+#define LCD_PAL67_R04_0_Msk                                   (0x1fUL << LCD_PAL67_R04_0_Pos)                           /*!< LCD PAL67: R04_0 Mask               */\r
+#define LCD_PAL67_G04_0_Pos                                   5                                                         /*!< LCD PAL67: G04_0 Position           */\r
+#define LCD_PAL67_G04_0_Msk                                   (0x1fUL << LCD_PAL67_G04_0_Pos)                           /*!< LCD PAL67: G04_0 Mask               */\r
+#define LCD_PAL67_B04_0_Pos                                   10                                                        /*!< LCD PAL67: B04_0 Position           */\r
+#define LCD_PAL67_B04_0_Msk                                   (0x1fUL << LCD_PAL67_B04_0_Pos)                           /*!< LCD PAL67: B04_0 Mask               */\r
+#define LCD_PAL67_I0_Pos                                      15                                                        /*!< LCD PAL67: I0 Position              */\r
+#define LCD_PAL67_I0_Msk                                      (0x01UL << LCD_PAL67_I0_Pos)                              /*!< LCD PAL67: I0 Mask                  */\r
+#define LCD_PAL67_R14_0_Pos                                   16                                                        /*!< LCD PAL67: R14_0 Position           */\r
+#define LCD_PAL67_R14_0_Msk                                   (0x1fUL << LCD_PAL67_R14_0_Pos)                           /*!< LCD PAL67: R14_0 Mask               */\r
+#define LCD_PAL67_G14_0_Pos                                   21                                                        /*!< LCD PAL67: G14_0 Position           */\r
+#define LCD_PAL67_G14_0_Msk                                   (0x1fUL << LCD_PAL67_G14_0_Pos)                           /*!< LCD PAL67: G14_0 Mask               */\r
+#define LCD_PAL67_B14_0_Pos                                   26                                                        /*!< LCD PAL67: B14_0 Position           */\r
+#define LCD_PAL67_B14_0_Msk                                   (0x1fUL << LCD_PAL67_B14_0_Pos)                           /*!< LCD PAL67: B14_0 Mask               */\r
+#define LCD_PAL67_I1_Pos                                      31                                                        /*!< LCD PAL67: I1 Position              */\r
+#define LCD_PAL67_I1_Msk                                      (0x01UL << LCD_PAL67_I1_Pos)                              /*!< LCD PAL67: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL68  -------------------------------------------\r
+#define LCD_PAL68_R04_0_Pos                                   0                                                         /*!< LCD PAL68: R04_0 Position           */\r
+#define LCD_PAL68_R04_0_Msk                                   (0x1fUL << LCD_PAL68_R04_0_Pos)                           /*!< LCD PAL68: R04_0 Mask               */\r
+#define LCD_PAL68_G04_0_Pos                                   5                                                         /*!< LCD PAL68: G04_0 Position           */\r
+#define LCD_PAL68_G04_0_Msk                                   (0x1fUL << LCD_PAL68_G04_0_Pos)                           /*!< LCD PAL68: G04_0 Mask               */\r
+#define LCD_PAL68_B04_0_Pos                                   10                                                        /*!< LCD PAL68: B04_0 Position           */\r
+#define LCD_PAL68_B04_0_Msk                                   (0x1fUL << LCD_PAL68_B04_0_Pos)                           /*!< LCD PAL68: B04_0 Mask               */\r
+#define LCD_PAL68_I0_Pos                                      15                                                        /*!< LCD PAL68: I0 Position              */\r
+#define LCD_PAL68_I0_Msk                                      (0x01UL << LCD_PAL68_I0_Pos)                              /*!< LCD PAL68: I0 Mask                  */\r
+#define LCD_PAL68_R14_0_Pos                                   16                                                        /*!< LCD PAL68: R14_0 Position           */\r
+#define LCD_PAL68_R14_0_Msk                                   (0x1fUL << LCD_PAL68_R14_0_Pos)                           /*!< LCD PAL68: R14_0 Mask               */\r
+#define LCD_PAL68_G14_0_Pos                                   21                                                        /*!< LCD PAL68: G14_0 Position           */\r
+#define LCD_PAL68_G14_0_Msk                                   (0x1fUL << LCD_PAL68_G14_0_Pos)                           /*!< LCD PAL68: G14_0 Mask               */\r
+#define LCD_PAL68_B14_0_Pos                                   26                                                        /*!< LCD PAL68: B14_0 Position           */\r
+#define LCD_PAL68_B14_0_Msk                                   (0x1fUL << LCD_PAL68_B14_0_Pos)                           /*!< LCD PAL68: B14_0 Mask               */\r
+#define LCD_PAL68_I1_Pos                                      31                                                        /*!< LCD PAL68: I1 Position              */\r
+#define LCD_PAL68_I1_Msk                                      (0x01UL << LCD_PAL68_I1_Pos)                              /*!< LCD PAL68: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL69  -------------------------------------------\r
+#define LCD_PAL69_R04_0_Pos                                   0                                                         /*!< LCD PAL69: R04_0 Position           */\r
+#define LCD_PAL69_R04_0_Msk                                   (0x1fUL << LCD_PAL69_R04_0_Pos)                           /*!< LCD PAL69: R04_0 Mask               */\r
+#define LCD_PAL69_G04_0_Pos                                   5                                                         /*!< LCD PAL69: G04_0 Position           */\r
+#define LCD_PAL69_G04_0_Msk                                   (0x1fUL << LCD_PAL69_G04_0_Pos)                           /*!< LCD PAL69: G04_0 Mask               */\r
+#define LCD_PAL69_B04_0_Pos                                   10                                                        /*!< LCD PAL69: B04_0 Position           */\r
+#define LCD_PAL69_B04_0_Msk                                   (0x1fUL << LCD_PAL69_B04_0_Pos)                           /*!< LCD PAL69: B04_0 Mask               */\r
+#define LCD_PAL69_I0_Pos                                      15                                                        /*!< LCD PAL69: I0 Position              */\r
+#define LCD_PAL69_I0_Msk                                      (0x01UL << LCD_PAL69_I0_Pos)                              /*!< LCD PAL69: I0 Mask                  */\r
+#define LCD_PAL69_R14_0_Pos                                   16                                                        /*!< LCD PAL69: R14_0 Position           */\r
+#define LCD_PAL69_R14_0_Msk                                   (0x1fUL << LCD_PAL69_R14_0_Pos)                           /*!< LCD PAL69: R14_0 Mask               */\r
+#define LCD_PAL69_G14_0_Pos                                   21                                                        /*!< LCD PAL69: G14_0 Position           */\r
+#define LCD_PAL69_G14_0_Msk                                   (0x1fUL << LCD_PAL69_G14_0_Pos)                           /*!< LCD PAL69: G14_0 Mask               */\r
+#define LCD_PAL69_B14_0_Pos                                   26                                                        /*!< LCD PAL69: B14_0 Position           */\r
+#define LCD_PAL69_B14_0_Msk                                   (0x1fUL << LCD_PAL69_B14_0_Pos)                           /*!< LCD PAL69: B14_0 Mask               */\r
+#define LCD_PAL69_I1_Pos                                      31                                                        /*!< LCD PAL69: I1 Position              */\r
+#define LCD_PAL69_I1_Msk                                      (0x01UL << LCD_PAL69_I1_Pos)                              /*!< LCD PAL69: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL70  -------------------------------------------\r
+#define LCD_PAL70_R04_0_Pos                                   0                                                         /*!< LCD PAL70: R04_0 Position           */\r
+#define LCD_PAL70_R04_0_Msk                                   (0x1fUL << LCD_PAL70_R04_0_Pos)                           /*!< LCD PAL70: R04_0 Mask               */\r
+#define LCD_PAL70_G04_0_Pos                                   5                                                         /*!< LCD PAL70: G04_0 Position           */\r
+#define LCD_PAL70_G04_0_Msk                                   (0x1fUL << LCD_PAL70_G04_0_Pos)                           /*!< LCD PAL70: G04_0 Mask               */\r
+#define LCD_PAL70_B04_0_Pos                                   10                                                        /*!< LCD PAL70: B04_0 Position           */\r
+#define LCD_PAL70_B04_0_Msk                                   (0x1fUL << LCD_PAL70_B04_0_Pos)                           /*!< LCD PAL70: B04_0 Mask               */\r
+#define LCD_PAL70_I0_Pos                                      15                                                        /*!< LCD PAL70: I0 Position              */\r
+#define LCD_PAL70_I0_Msk                                      (0x01UL << LCD_PAL70_I0_Pos)                              /*!< LCD PAL70: I0 Mask                  */\r
+#define LCD_PAL70_R14_0_Pos                                   16                                                        /*!< LCD PAL70: R14_0 Position           */\r
+#define LCD_PAL70_R14_0_Msk                                   (0x1fUL << LCD_PAL70_R14_0_Pos)                           /*!< LCD PAL70: R14_0 Mask               */\r
+#define LCD_PAL70_G14_0_Pos                                   21                                                        /*!< LCD PAL70: G14_0 Position           */\r
+#define LCD_PAL70_G14_0_Msk                                   (0x1fUL << LCD_PAL70_G14_0_Pos)                           /*!< LCD PAL70: G14_0 Mask               */\r
+#define LCD_PAL70_B14_0_Pos                                   26                                                        /*!< LCD PAL70: B14_0 Position           */\r
+#define LCD_PAL70_B14_0_Msk                                   (0x1fUL << LCD_PAL70_B14_0_Pos)                           /*!< LCD PAL70: B14_0 Mask               */\r
+#define LCD_PAL70_I1_Pos                                      31                                                        /*!< LCD PAL70: I1 Position              */\r
+#define LCD_PAL70_I1_Msk                                      (0x01UL << LCD_PAL70_I1_Pos)                              /*!< LCD PAL70: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL71  -------------------------------------------\r
+#define LCD_PAL71_R04_0_Pos                                   0                                                         /*!< LCD PAL71: R04_0 Position           */\r
+#define LCD_PAL71_R04_0_Msk                                   (0x1fUL << LCD_PAL71_R04_0_Pos)                           /*!< LCD PAL71: R04_0 Mask               */\r
+#define LCD_PAL71_G04_0_Pos                                   5                                                         /*!< LCD PAL71: G04_0 Position           */\r
+#define LCD_PAL71_G04_0_Msk                                   (0x1fUL << LCD_PAL71_G04_0_Pos)                           /*!< LCD PAL71: G04_0 Mask               */\r
+#define LCD_PAL71_B04_0_Pos                                   10                                                        /*!< LCD PAL71: B04_0 Position           */\r
+#define LCD_PAL71_B04_0_Msk                                   (0x1fUL << LCD_PAL71_B04_0_Pos)                           /*!< LCD PAL71: B04_0 Mask               */\r
+#define LCD_PAL71_I0_Pos                                      15                                                        /*!< LCD PAL71: I0 Position              */\r
+#define LCD_PAL71_I0_Msk                                      (0x01UL << LCD_PAL71_I0_Pos)                              /*!< LCD PAL71: I0 Mask                  */\r
+#define LCD_PAL71_R14_0_Pos                                   16                                                        /*!< LCD PAL71: R14_0 Position           */\r
+#define LCD_PAL71_R14_0_Msk                                   (0x1fUL << LCD_PAL71_R14_0_Pos)                           /*!< LCD PAL71: R14_0 Mask               */\r
+#define LCD_PAL71_G14_0_Pos                                   21                                                        /*!< LCD PAL71: G14_0 Position           */\r
+#define LCD_PAL71_G14_0_Msk                                   (0x1fUL << LCD_PAL71_G14_0_Pos)                           /*!< LCD PAL71: G14_0 Mask               */\r
+#define LCD_PAL71_B14_0_Pos                                   26                                                        /*!< LCD PAL71: B14_0 Position           */\r
+#define LCD_PAL71_B14_0_Msk                                   (0x1fUL << LCD_PAL71_B14_0_Pos)                           /*!< LCD PAL71: B14_0 Mask               */\r
+#define LCD_PAL71_I1_Pos                                      31                                                        /*!< LCD PAL71: I1 Position              */\r
+#define LCD_PAL71_I1_Msk                                      (0x01UL << LCD_PAL71_I1_Pos)                              /*!< LCD PAL71: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL72  -------------------------------------------\r
+#define LCD_PAL72_R04_0_Pos                                   0                                                         /*!< LCD PAL72: R04_0 Position           */\r
+#define LCD_PAL72_R04_0_Msk                                   (0x1fUL << LCD_PAL72_R04_0_Pos)                           /*!< LCD PAL72: R04_0 Mask               */\r
+#define LCD_PAL72_G04_0_Pos                                   5                                                         /*!< LCD PAL72: G04_0 Position           */\r
+#define LCD_PAL72_G04_0_Msk                                   (0x1fUL << LCD_PAL72_G04_0_Pos)                           /*!< LCD PAL72: G04_0 Mask               */\r
+#define LCD_PAL72_B04_0_Pos                                   10                                                        /*!< LCD PAL72: B04_0 Position           */\r
+#define LCD_PAL72_B04_0_Msk                                   (0x1fUL << LCD_PAL72_B04_0_Pos)                           /*!< LCD PAL72: B04_0 Mask               */\r
+#define LCD_PAL72_I0_Pos                                      15                                                        /*!< LCD PAL72: I0 Position              */\r
+#define LCD_PAL72_I0_Msk                                      (0x01UL << LCD_PAL72_I0_Pos)                              /*!< LCD PAL72: I0 Mask                  */\r
+#define LCD_PAL72_R14_0_Pos                                   16                                                        /*!< LCD PAL72: R14_0 Position           */\r
+#define LCD_PAL72_R14_0_Msk                                   (0x1fUL << LCD_PAL72_R14_0_Pos)                           /*!< LCD PAL72: R14_0 Mask               */\r
+#define LCD_PAL72_G14_0_Pos                                   21                                                        /*!< LCD PAL72: G14_0 Position           */\r
+#define LCD_PAL72_G14_0_Msk                                   (0x1fUL << LCD_PAL72_G14_0_Pos)                           /*!< LCD PAL72: G14_0 Mask               */\r
+#define LCD_PAL72_B14_0_Pos                                   26                                                        /*!< LCD PAL72: B14_0 Position           */\r
+#define LCD_PAL72_B14_0_Msk                                   (0x1fUL << LCD_PAL72_B14_0_Pos)                           /*!< LCD PAL72: B14_0 Mask               */\r
+#define LCD_PAL72_I1_Pos                                      31                                                        /*!< LCD PAL72: I1 Position              */\r
+#define LCD_PAL72_I1_Msk                                      (0x01UL << LCD_PAL72_I1_Pos)                              /*!< LCD PAL72: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL73  -------------------------------------------\r
+#define LCD_PAL73_R04_0_Pos                                   0                                                         /*!< LCD PAL73: R04_0 Position           */\r
+#define LCD_PAL73_R04_0_Msk                                   (0x1fUL << LCD_PAL73_R04_0_Pos)                           /*!< LCD PAL73: R04_0 Mask               */\r
+#define LCD_PAL73_G04_0_Pos                                   5                                                         /*!< LCD PAL73: G04_0 Position           */\r
+#define LCD_PAL73_G04_0_Msk                                   (0x1fUL << LCD_PAL73_G04_0_Pos)                           /*!< LCD PAL73: G04_0 Mask               */\r
+#define LCD_PAL73_B04_0_Pos                                   10                                                        /*!< LCD PAL73: B04_0 Position           */\r
+#define LCD_PAL73_B04_0_Msk                                   (0x1fUL << LCD_PAL73_B04_0_Pos)                           /*!< LCD PAL73: B04_0 Mask               */\r
+#define LCD_PAL73_I0_Pos                                      15                                                        /*!< LCD PAL73: I0 Position              */\r
+#define LCD_PAL73_I0_Msk                                      (0x01UL << LCD_PAL73_I0_Pos)                              /*!< LCD PAL73: I0 Mask                  */\r
+#define LCD_PAL73_R14_0_Pos                                   16                                                        /*!< LCD PAL73: R14_0 Position           */\r
+#define LCD_PAL73_R14_0_Msk                                   (0x1fUL << LCD_PAL73_R14_0_Pos)                           /*!< LCD PAL73: R14_0 Mask               */\r
+#define LCD_PAL73_G14_0_Pos                                   21                                                        /*!< LCD PAL73: G14_0 Position           */\r
+#define LCD_PAL73_G14_0_Msk                                   (0x1fUL << LCD_PAL73_G14_0_Pos)                           /*!< LCD PAL73: G14_0 Mask               */\r
+#define LCD_PAL73_B14_0_Pos                                   26                                                        /*!< LCD PAL73: B14_0 Position           */\r
+#define LCD_PAL73_B14_0_Msk                                   (0x1fUL << LCD_PAL73_B14_0_Pos)                           /*!< LCD PAL73: B14_0 Mask               */\r
+#define LCD_PAL73_I1_Pos                                      31                                                        /*!< LCD PAL73: I1 Position              */\r
+#define LCD_PAL73_I1_Msk                                      (0x01UL << LCD_PAL73_I1_Pos)                              /*!< LCD PAL73: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL74  -------------------------------------------\r
+#define LCD_PAL74_R04_0_Pos                                   0                                                         /*!< LCD PAL74: R04_0 Position           */\r
+#define LCD_PAL74_R04_0_Msk                                   (0x1fUL << LCD_PAL74_R04_0_Pos)                           /*!< LCD PAL74: R04_0 Mask               */\r
+#define LCD_PAL74_G04_0_Pos                                   5                                                         /*!< LCD PAL74: G04_0 Position           */\r
+#define LCD_PAL74_G04_0_Msk                                   (0x1fUL << LCD_PAL74_G04_0_Pos)                           /*!< LCD PAL74: G04_0 Mask               */\r
+#define LCD_PAL74_B04_0_Pos                                   10                                                        /*!< LCD PAL74: B04_0 Position           */\r
+#define LCD_PAL74_B04_0_Msk                                   (0x1fUL << LCD_PAL74_B04_0_Pos)                           /*!< LCD PAL74: B04_0 Mask               */\r
+#define LCD_PAL74_I0_Pos                                      15                                                        /*!< LCD PAL74: I0 Position              */\r
+#define LCD_PAL74_I0_Msk                                      (0x01UL << LCD_PAL74_I0_Pos)                              /*!< LCD PAL74: I0 Mask                  */\r
+#define LCD_PAL74_R14_0_Pos                                   16                                                        /*!< LCD PAL74: R14_0 Position           */\r
+#define LCD_PAL74_R14_0_Msk                                   (0x1fUL << LCD_PAL74_R14_0_Pos)                           /*!< LCD PAL74: R14_0 Mask               */\r
+#define LCD_PAL74_G14_0_Pos                                   21                                                        /*!< LCD PAL74: G14_0 Position           */\r
+#define LCD_PAL74_G14_0_Msk                                   (0x1fUL << LCD_PAL74_G14_0_Pos)                           /*!< LCD PAL74: G14_0 Mask               */\r
+#define LCD_PAL74_B14_0_Pos                                   26                                                        /*!< LCD PAL74: B14_0 Position           */\r
+#define LCD_PAL74_B14_0_Msk                                   (0x1fUL << LCD_PAL74_B14_0_Pos)                           /*!< LCD PAL74: B14_0 Mask               */\r
+#define LCD_PAL74_I1_Pos                                      31                                                        /*!< LCD PAL74: I1 Position              */\r
+#define LCD_PAL74_I1_Msk                                      (0x01UL << LCD_PAL74_I1_Pos)                              /*!< LCD PAL74: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL75  -------------------------------------------\r
+#define LCD_PAL75_R04_0_Pos                                   0                                                         /*!< LCD PAL75: R04_0 Position           */\r
+#define LCD_PAL75_R04_0_Msk                                   (0x1fUL << LCD_PAL75_R04_0_Pos)                           /*!< LCD PAL75: R04_0 Mask               */\r
+#define LCD_PAL75_G04_0_Pos                                   5                                                         /*!< LCD PAL75: G04_0 Position           */\r
+#define LCD_PAL75_G04_0_Msk                                   (0x1fUL << LCD_PAL75_G04_0_Pos)                           /*!< LCD PAL75: G04_0 Mask               */\r
+#define LCD_PAL75_B04_0_Pos                                   10                                                        /*!< LCD PAL75: B04_0 Position           */\r
+#define LCD_PAL75_B04_0_Msk                                   (0x1fUL << LCD_PAL75_B04_0_Pos)                           /*!< LCD PAL75: B04_0 Mask               */\r
+#define LCD_PAL75_I0_Pos                                      15                                                        /*!< LCD PAL75: I0 Position              */\r
+#define LCD_PAL75_I0_Msk                                      (0x01UL << LCD_PAL75_I0_Pos)                              /*!< LCD PAL75: I0 Mask                  */\r
+#define LCD_PAL75_R14_0_Pos                                   16                                                        /*!< LCD PAL75: R14_0 Position           */\r
+#define LCD_PAL75_R14_0_Msk                                   (0x1fUL << LCD_PAL75_R14_0_Pos)                           /*!< LCD PAL75: R14_0 Mask               */\r
+#define LCD_PAL75_G14_0_Pos                                   21                                                        /*!< LCD PAL75: G14_0 Position           */\r
+#define LCD_PAL75_G14_0_Msk                                   (0x1fUL << LCD_PAL75_G14_0_Pos)                           /*!< LCD PAL75: G14_0 Mask               */\r
+#define LCD_PAL75_B14_0_Pos                                   26                                                        /*!< LCD PAL75: B14_0 Position           */\r
+#define LCD_PAL75_B14_0_Msk                                   (0x1fUL << LCD_PAL75_B14_0_Pos)                           /*!< LCD PAL75: B14_0 Mask               */\r
+#define LCD_PAL75_I1_Pos                                      31                                                        /*!< LCD PAL75: I1 Position              */\r
+#define LCD_PAL75_I1_Msk                                      (0x01UL << LCD_PAL75_I1_Pos)                              /*!< LCD PAL75: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL76  -------------------------------------------\r
+#define LCD_PAL76_R04_0_Pos                                   0                                                         /*!< LCD PAL76: R04_0 Position           */\r
+#define LCD_PAL76_R04_0_Msk                                   (0x1fUL << LCD_PAL76_R04_0_Pos)                           /*!< LCD PAL76: R04_0 Mask               */\r
+#define LCD_PAL76_G04_0_Pos                                   5                                                         /*!< LCD PAL76: G04_0 Position           */\r
+#define LCD_PAL76_G04_0_Msk                                   (0x1fUL << LCD_PAL76_G04_0_Pos)                           /*!< LCD PAL76: G04_0 Mask               */\r
+#define LCD_PAL76_B04_0_Pos                                   10                                                        /*!< LCD PAL76: B04_0 Position           */\r
+#define LCD_PAL76_B04_0_Msk                                   (0x1fUL << LCD_PAL76_B04_0_Pos)                           /*!< LCD PAL76: B04_0 Mask               */\r
+#define LCD_PAL76_I0_Pos                                      15                                                        /*!< LCD PAL76: I0 Position              */\r
+#define LCD_PAL76_I0_Msk                                      (0x01UL << LCD_PAL76_I0_Pos)                              /*!< LCD PAL76: I0 Mask                  */\r
+#define LCD_PAL76_R14_0_Pos                                   16                                                        /*!< LCD PAL76: R14_0 Position           */\r
+#define LCD_PAL76_R14_0_Msk                                   (0x1fUL << LCD_PAL76_R14_0_Pos)                           /*!< LCD PAL76: R14_0 Mask               */\r
+#define LCD_PAL76_G14_0_Pos                                   21                                                        /*!< LCD PAL76: G14_0 Position           */\r
+#define LCD_PAL76_G14_0_Msk                                   (0x1fUL << LCD_PAL76_G14_0_Pos)                           /*!< LCD PAL76: G14_0 Mask               */\r
+#define LCD_PAL76_B14_0_Pos                                   26                                                        /*!< LCD PAL76: B14_0 Position           */\r
+#define LCD_PAL76_B14_0_Msk                                   (0x1fUL << LCD_PAL76_B14_0_Pos)                           /*!< LCD PAL76: B14_0 Mask               */\r
+#define LCD_PAL76_I1_Pos                                      31                                                        /*!< LCD PAL76: I1 Position              */\r
+#define LCD_PAL76_I1_Msk                                      (0x01UL << LCD_PAL76_I1_Pos)                              /*!< LCD PAL76: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL77  -------------------------------------------\r
+#define LCD_PAL77_R04_0_Pos                                   0                                                         /*!< LCD PAL77: R04_0 Position           */\r
+#define LCD_PAL77_R04_0_Msk                                   (0x1fUL << LCD_PAL77_R04_0_Pos)                           /*!< LCD PAL77: R04_0 Mask               */\r
+#define LCD_PAL77_G04_0_Pos                                   5                                                         /*!< LCD PAL77: G04_0 Position           */\r
+#define LCD_PAL77_G04_0_Msk                                   (0x1fUL << LCD_PAL77_G04_0_Pos)                           /*!< LCD PAL77: G04_0 Mask               */\r
+#define LCD_PAL77_B04_0_Pos                                   10                                                        /*!< LCD PAL77: B04_0 Position           */\r
+#define LCD_PAL77_B04_0_Msk                                   (0x1fUL << LCD_PAL77_B04_0_Pos)                           /*!< LCD PAL77: B04_0 Mask               */\r
+#define LCD_PAL77_I0_Pos                                      15                                                        /*!< LCD PAL77: I0 Position              */\r
+#define LCD_PAL77_I0_Msk                                      (0x01UL << LCD_PAL77_I0_Pos)                              /*!< LCD PAL77: I0 Mask                  */\r
+#define LCD_PAL77_R14_0_Pos                                   16                                                        /*!< LCD PAL77: R14_0 Position           */\r
+#define LCD_PAL77_R14_0_Msk                                   (0x1fUL << LCD_PAL77_R14_0_Pos)                           /*!< LCD PAL77: R14_0 Mask               */\r
+#define LCD_PAL77_G14_0_Pos                                   21                                                        /*!< LCD PAL77: G14_0 Position           */\r
+#define LCD_PAL77_G14_0_Msk                                   (0x1fUL << LCD_PAL77_G14_0_Pos)                           /*!< LCD PAL77: G14_0 Mask               */\r
+#define LCD_PAL77_B14_0_Pos                                   26                                                        /*!< LCD PAL77: B14_0 Position           */\r
+#define LCD_PAL77_B14_0_Msk                                   (0x1fUL << LCD_PAL77_B14_0_Pos)                           /*!< LCD PAL77: B14_0 Mask               */\r
+#define LCD_PAL77_I1_Pos                                      31                                                        /*!< LCD PAL77: I1 Position              */\r
+#define LCD_PAL77_I1_Msk                                      (0x01UL << LCD_PAL77_I1_Pos)                              /*!< LCD PAL77: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL78  -------------------------------------------\r
+#define LCD_PAL78_R04_0_Pos                                   0                                                         /*!< LCD PAL78: R04_0 Position           */\r
+#define LCD_PAL78_R04_0_Msk                                   (0x1fUL << LCD_PAL78_R04_0_Pos)                           /*!< LCD PAL78: R04_0 Mask               */\r
+#define LCD_PAL78_G04_0_Pos                                   5                                                         /*!< LCD PAL78: G04_0 Position           */\r
+#define LCD_PAL78_G04_0_Msk                                   (0x1fUL << LCD_PAL78_G04_0_Pos)                           /*!< LCD PAL78: G04_0 Mask               */\r
+#define LCD_PAL78_B04_0_Pos                                   10                                                        /*!< LCD PAL78: B04_0 Position           */\r
+#define LCD_PAL78_B04_0_Msk                                   (0x1fUL << LCD_PAL78_B04_0_Pos)                           /*!< LCD PAL78: B04_0 Mask               */\r
+#define LCD_PAL78_I0_Pos                                      15                                                        /*!< LCD PAL78: I0 Position              */\r
+#define LCD_PAL78_I0_Msk                                      (0x01UL << LCD_PAL78_I0_Pos)                              /*!< LCD PAL78: I0 Mask                  */\r
+#define LCD_PAL78_R14_0_Pos                                   16                                                        /*!< LCD PAL78: R14_0 Position           */\r
+#define LCD_PAL78_R14_0_Msk                                   (0x1fUL << LCD_PAL78_R14_0_Pos)                           /*!< LCD PAL78: R14_0 Mask               */\r
+#define LCD_PAL78_G14_0_Pos                                   21                                                        /*!< LCD PAL78: G14_0 Position           */\r
+#define LCD_PAL78_G14_0_Msk                                   (0x1fUL << LCD_PAL78_G14_0_Pos)                           /*!< LCD PAL78: G14_0 Mask               */\r
+#define LCD_PAL78_B14_0_Pos                                   26                                                        /*!< LCD PAL78: B14_0 Position           */\r
+#define LCD_PAL78_B14_0_Msk                                   (0x1fUL << LCD_PAL78_B14_0_Pos)                           /*!< LCD PAL78: B14_0 Mask               */\r
+#define LCD_PAL78_I1_Pos                                      31                                                        /*!< LCD PAL78: I1 Position              */\r
+#define LCD_PAL78_I1_Msk                                      (0x01UL << LCD_PAL78_I1_Pos)                              /*!< LCD PAL78: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL79  -------------------------------------------\r
+#define LCD_PAL79_R04_0_Pos                                   0                                                         /*!< LCD PAL79: R04_0 Position           */\r
+#define LCD_PAL79_R04_0_Msk                                   (0x1fUL << LCD_PAL79_R04_0_Pos)                           /*!< LCD PAL79: R04_0 Mask               */\r
+#define LCD_PAL79_G04_0_Pos                                   5                                                         /*!< LCD PAL79: G04_0 Position           */\r
+#define LCD_PAL79_G04_0_Msk                                   (0x1fUL << LCD_PAL79_G04_0_Pos)                           /*!< LCD PAL79: G04_0 Mask               */\r
+#define LCD_PAL79_B04_0_Pos                                   10                                                        /*!< LCD PAL79: B04_0 Position           */\r
+#define LCD_PAL79_B04_0_Msk                                   (0x1fUL << LCD_PAL79_B04_0_Pos)                           /*!< LCD PAL79: B04_0 Mask               */\r
+#define LCD_PAL79_I0_Pos                                      15                                                        /*!< LCD PAL79: I0 Position              */\r
+#define LCD_PAL79_I0_Msk                                      (0x01UL << LCD_PAL79_I0_Pos)                              /*!< LCD PAL79: I0 Mask                  */\r
+#define LCD_PAL79_R14_0_Pos                                   16                                                        /*!< LCD PAL79: R14_0 Position           */\r
+#define LCD_PAL79_R14_0_Msk                                   (0x1fUL << LCD_PAL79_R14_0_Pos)                           /*!< LCD PAL79: R14_0 Mask               */\r
+#define LCD_PAL79_G14_0_Pos                                   21                                                        /*!< LCD PAL79: G14_0 Position           */\r
+#define LCD_PAL79_G14_0_Msk                                   (0x1fUL << LCD_PAL79_G14_0_Pos)                           /*!< LCD PAL79: G14_0 Mask               */\r
+#define LCD_PAL79_B14_0_Pos                                   26                                                        /*!< LCD PAL79: B14_0 Position           */\r
+#define LCD_PAL79_B14_0_Msk                                   (0x1fUL << LCD_PAL79_B14_0_Pos)                           /*!< LCD PAL79: B14_0 Mask               */\r
+#define LCD_PAL79_I1_Pos                                      31                                                        /*!< LCD PAL79: I1 Position              */\r
+#define LCD_PAL79_I1_Msk                                      (0x01UL << LCD_PAL79_I1_Pos)                              /*!< LCD PAL79: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL80  -------------------------------------------\r
+#define LCD_PAL80_R04_0_Pos                                   0                                                         /*!< LCD PAL80: R04_0 Position           */\r
+#define LCD_PAL80_R04_0_Msk                                   (0x1fUL << LCD_PAL80_R04_0_Pos)                           /*!< LCD PAL80: R04_0 Mask               */\r
+#define LCD_PAL80_G04_0_Pos                                   5                                                         /*!< LCD PAL80: G04_0 Position           */\r
+#define LCD_PAL80_G04_0_Msk                                   (0x1fUL << LCD_PAL80_G04_0_Pos)                           /*!< LCD PAL80: G04_0 Mask               */\r
+#define LCD_PAL80_B04_0_Pos                                   10                                                        /*!< LCD PAL80: B04_0 Position           */\r
+#define LCD_PAL80_B04_0_Msk                                   (0x1fUL << LCD_PAL80_B04_0_Pos)                           /*!< LCD PAL80: B04_0 Mask               */\r
+#define LCD_PAL80_I0_Pos                                      15                                                        /*!< LCD PAL80: I0 Position              */\r
+#define LCD_PAL80_I0_Msk                                      (0x01UL << LCD_PAL80_I0_Pos)                              /*!< LCD PAL80: I0 Mask                  */\r
+#define LCD_PAL80_R14_0_Pos                                   16                                                        /*!< LCD PAL80: R14_0 Position           */\r
+#define LCD_PAL80_R14_0_Msk                                   (0x1fUL << LCD_PAL80_R14_0_Pos)                           /*!< LCD PAL80: R14_0 Mask               */\r
+#define LCD_PAL80_G14_0_Pos                                   21                                                        /*!< LCD PAL80: G14_0 Position           */\r
+#define LCD_PAL80_G14_0_Msk                                   (0x1fUL << LCD_PAL80_G14_0_Pos)                           /*!< LCD PAL80: G14_0 Mask               */\r
+#define LCD_PAL80_B14_0_Pos                                   26                                                        /*!< LCD PAL80: B14_0 Position           */\r
+#define LCD_PAL80_B14_0_Msk                                   (0x1fUL << LCD_PAL80_B14_0_Pos)                           /*!< LCD PAL80: B14_0 Mask               */\r
+#define LCD_PAL80_I1_Pos                                      31                                                        /*!< LCD PAL80: I1 Position              */\r
+#define LCD_PAL80_I1_Msk                                      (0x01UL << LCD_PAL80_I1_Pos)                              /*!< LCD PAL80: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL81  -------------------------------------------\r
+#define LCD_PAL81_R04_0_Pos                                   0                                                         /*!< LCD PAL81: R04_0 Position           */\r
+#define LCD_PAL81_R04_0_Msk                                   (0x1fUL << LCD_PAL81_R04_0_Pos)                           /*!< LCD PAL81: R04_0 Mask               */\r
+#define LCD_PAL81_G04_0_Pos                                   5                                                         /*!< LCD PAL81: G04_0 Position           */\r
+#define LCD_PAL81_G04_0_Msk                                   (0x1fUL << LCD_PAL81_G04_0_Pos)                           /*!< LCD PAL81: G04_0 Mask               */\r
+#define LCD_PAL81_B04_0_Pos                                   10                                                        /*!< LCD PAL81: B04_0 Position           */\r
+#define LCD_PAL81_B04_0_Msk                                   (0x1fUL << LCD_PAL81_B04_0_Pos)                           /*!< LCD PAL81: B04_0 Mask               */\r
+#define LCD_PAL81_I0_Pos                                      15                                                        /*!< LCD PAL81: I0 Position              */\r
+#define LCD_PAL81_I0_Msk                                      (0x01UL << LCD_PAL81_I0_Pos)                              /*!< LCD PAL81: I0 Mask                  */\r
+#define LCD_PAL81_R14_0_Pos                                   16                                                        /*!< LCD PAL81: R14_0 Position           */\r
+#define LCD_PAL81_R14_0_Msk                                   (0x1fUL << LCD_PAL81_R14_0_Pos)                           /*!< LCD PAL81: R14_0 Mask               */\r
+#define LCD_PAL81_G14_0_Pos                                   21                                                        /*!< LCD PAL81: G14_0 Position           */\r
+#define LCD_PAL81_G14_0_Msk                                   (0x1fUL << LCD_PAL81_G14_0_Pos)                           /*!< LCD PAL81: G14_0 Mask               */\r
+#define LCD_PAL81_B14_0_Pos                                   26                                                        /*!< LCD PAL81: B14_0 Position           */\r
+#define LCD_PAL81_B14_0_Msk                                   (0x1fUL << LCD_PAL81_B14_0_Pos)                           /*!< LCD PAL81: B14_0 Mask               */\r
+#define LCD_PAL81_I1_Pos                                      31                                                        /*!< LCD PAL81: I1 Position              */\r
+#define LCD_PAL81_I1_Msk                                      (0x01UL << LCD_PAL81_I1_Pos)                              /*!< LCD PAL81: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL82  -------------------------------------------\r
+#define LCD_PAL82_R04_0_Pos                                   0                                                         /*!< LCD PAL82: R04_0 Position           */\r
+#define LCD_PAL82_R04_0_Msk                                   (0x1fUL << LCD_PAL82_R04_0_Pos)                           /*!< LCD PAL82: R04_0 Mask               */\r
+#define LCD_PAL82_G04_0_Pos                                   5                                                         /*!< LCD PAL82: G04_0 Position           */\r
+#define LCD_PAL82_G04_0_Msk                                   (0x1fUL << LCD_PAL82_G04_0_Pos)                           /*!< LCD PAL82: G04_0 Mask               */\r
+#define LCD_PAL82_B04_0_Pos                                   10                                                        /*!< LCD PAL82: B04_0 Position           */\r
+#define LCD_PAL82_B04_0_Msk                                   (0x1fUL << LCD_PAL82_B04_0_Pos)                           /*!< LCD PAL82: B04_0 Mask               */\r
+#define LCD_PAL82_I0_Pos                                      15                                                        /*!< LCD PAL82: I0 Position              */\r
+#define LCD_PAL82_I0_Msk                                      (0x01UL << LCD_PAL82_I0_Pos)                              /*!< LCD PAL82: I0 Mask                  */\r
+#define LCD_PAL82_R14_0_Pos                                   16                                                        /*!< LCD PAL82: R14_0 Position           */\r
+#define LCD_PAL82_R14_0_Msk                                   (0x1fUL << LCD_PAL82_R14_0_Pos)                           /*!< LCD PAL82: R14_0 Mask               */\r
+#define LCD_PAL82_G14_0_Pos                                   21                                                        /*!< LCD PAL82: G14_0 Position           */\r
+#define LCD_PAL82_G14_0_Msk                                   (0x1fUL << LCD_PAL82_G14_0_Pos)                           /*!< LCD PAL82: G14_0 Mask               */\r
+#define LCD_PAL82_B14_0_Pos                                   26                                                        /*!< LCD PAL82: B14_0 Position           */\r
+#define LCD_PAL82_B14_0_Msk                                   (0x1fUL << LCD_PAL82_B14_0_Pos)                           /*!< LCD PAL82: B14_0 Mask               */\r
+#define LCD_PAL82_I1_Pos                                      31                                                        /*!< LCD PAL82: I1 Position              */\r
+#define LCD_PAL82_I1_Msk                                      (0x01UL << LCD_PAL82_I1_Pos)                              /*!< LCD PAL82: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL83  -------------------------------------------\r
+#define LCD_PAL83_R04_0_Pos                                   0                                                         /*!< LCD PAL83: R04_0 Position           */\r
+#define LCD_PAL83_R04_0_Msk                                   (0x1fUL << LCD_PAL83_R04_0_Pos)                           /*!< LCD PAL83: R04_0 Mask               */\r
+#define LCD_PAL83_G04_0_Pos                                   5                                                         /*!< LCD PAL83: G04_0 Position           */\r
+#define LCD_PAL83_G04_0_Msk                                   (0x1fUL << LCD_PAL83_G04_0_Pos)                           /*!< LCD PAL83: G04_0 Mask               */\r
+#define LCD_PAL83_B04_0_Pos                                   10                                                        /*!< LCD PAL83: B04_0 Position           */\r
+#define LCD_PAL83_B04_0_Msk                                   (0x1fUL << LCD_PAL83_B04_0_Pos)                           /*!< LCD PAL83: B04_0 Mask               */\r
+#define LCD_PAL83_I0_Pos                                      15                                                        /*!< LCD PAL83: I0 Position              */\r
+#define LCD_PAL83_I0_Msk                                      (0x01UL << LCD_PAL83_I0_Pos)                              /*!< LCD PAL83: I0 Mask                  */\r
+#define LCD_PAL83_R14_0_Pos                                   16                                                        /*!< LCD PAL83: R14_0 Position           */\r
+#define LCD_PAL83_R14_0_Msk                                   (0x1fUL << LCD_PAL83_R14_0_Pos)                           /*!< LCD PAL83: R14_0 Mask               */\r
+#define LCD_PAL83_G14_0_Pos                                   21                                                        /*!< LCD PAL83: G14_0 Position           */\r
+#define LCD_PAL83_G14_0_Msk                                   (0x1fUL << LCD_PAL83_G14_0_Pos)                           /*!< LCD PAL83: G14_0 Mask               */\r
+#define LCD_PAL83_B14_0_Pos                                   26                                                        /*!< LCD PAL83: B14_0 Position           */\r
+#define LCD_PAL83_B14_0_Msk                                   (0x1fUL << LCD_PAL83_B14_0_Pos)                           /*!< LCD PAL83: B14_0 Mask               */\r
+#define LCD_PAL83_I1_Pos                                      31                                                        /*!< LCD PAL83: I1 Position              */\r
+#define LCD_PAL83_I1_Msk                                      (0x01UL << LCD_PAL83_I1_Pos)                              /*!< LCD PAL83: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL84  -------------------------------------------\r
+#define LCD_PAL84_R04_0_Pos                                   0                                                         /*!< LCD PAL84: R04_0 Position           */\r
+#define LCD_PAL84_R04_0_Msk                                   (0x1fUL << LCD_PAL84_R04_0_Pos)                           /*!< LCD PAL84: R04_0 Mask               */\r
+#define LCD_PAL84_G04_0_Pos                                   5                                                         /*!< LCD PAL84: G04_0 Position           */\r
+#define LCD_PAL84_G04_0_Msk                                   (0x1fUL << LCD_PAL84_G04_0_Pos)                           /*!< LCD PAL84: G04_0 Mask               */\r
+#define LCD_PAL84_B04_0_Pos                                   10                                                        /*!< LCD PAL84: B04_0 Position           */\r
+#define LCD_PAL84_B04_0_Msk                                   (0x1fUL << LCD_PAL84_B04_0_Pos)                           /*!< LCD PAL84: B04_0 Mask               */\r
+#define LCD_PAL84_I0_Pos                                      15                                                        /*!< LCD PAL84: I0 Position              */\r
+#define LCD_PAL84_I0_Msk                                      (0x01UL << LCD_PAL84_I0_Pos)                              /*!< LCD PAL84: I0 Mask                  */\r
+#define LCD_PAL84_R14_0_Pos                                   16                                                        /*!< LCD PAL84: R14_0 Position           */\r
+#define LCD_PAL84_R14_0_Msk                                   (0x1fUL << LCD_PAL84_R14_0_Pos)                           /*!< LCD PAL84: R14_0 Mask               */\r
+#define LCD_PAL84_G14_0_Pos                                   21                                                        /*!< LCD PAL84: G14_0 Position           */\r
+#define LCD_PAL84_G14_0_Msk                                   (0x1fUL << LCD_PAL84_G14_0_Pos)                           /*!< LCD PAL84: G14_0 Mask               */\r
+#define LCD_PAL84_B14_0_Pos                                   26                                                        /*!< LCD PAL84: B14_0 Position           */\r
+#define LCD_PAL84_B14_0_Msk                                   (0x1fUL << LCD_PAL84_B14_0_Pos)                           /*!< LCD PAL84: B14_0 Mask               */\r
+#define LCD_PAL84_I1_Pos                                      31                                                        /*!< LCD PAL84: I1 Position              */\r
+#define LCD_PAL84_I1_Msk                                      (0x01UL << LCD_PAL84_I1_Pos)                              /*!< LCD PAL84: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL85  -------------------------------------------\r
+#define LCD_PAL85_R04_0_Pos                                   0                                                         /*!< LCD PAL85: R04_0 Position           */\r
+#define LCD_PAL85_R04_0_Msk                                   (0x1fUL << LCD_PAL85_R04_0_Pos)                           /*!< LCD PAL85: R04_0 Mask               */\r
+#define LCD_PAL85_G04_0_Pos                                   5                                                         /*!< LCD PAL85: G04_0 Position           */\r
+#define LCD_PAL85_G04_0_Msk                                   (0x1fUL << LCD_PAL85_G04_0_Pos)                           /*!< LCD PAL85: G04_0 Mask               */\r
+#define LCD_PAL85_B04_0_Pos                                   10                                                        /*!< LCD PAL85: B04_0 Position           */\r
+#define LCD_PAL85_B04_0_Msk                                   (0x1fUL << LCD_PAL85_B04_0_Pos)                           /*!< LCD PAL85: B04_0 Mask               */\r
+#define LCD_PAL85_I0_Pos                                      15                                                        /*!< LCD PAL85: I0 Position              */\r
+#define LCD_PAL85_I0_Msk                                      (0x01UL << LCD_PAL85_I0_Pos)                              /*!< LCD PAL85: I0 Mask                  */\r
+#define LCD_PAL85_R14_0_Pos                                   16                                                        /*!< LCD PAL85: R14_0 Position           */\r
+#define LCD_PAL85_R14_0_Msk                                   (0x1fUL << LCD_PAL85_R14_0_Pos)                           /*!< LCD PAL85: R14_0 Mask               */\r
+#define LCD_PAL85_G14_0_Pos                                   21                                                        /*!< LCD PAL85: G14_0 Position           */\r
+#define LCD_PAL85_G14_0_Msk                                   (0x1fUL << LCD_PAL85_G14_0_Pos)                           /*!< LCD PAL85: G14_0 Mask               */\r
+#define LCD_PAL85_B14_0_Pos                                   26                                                        /*!< LCD PAL85: B14_0 Position           */\r
+#define LCD_PAL85_B14_0_Msk                                   (0x1fUL << LCD_PAL85_B14_0_Pos)                           /*!< LCD PAL85: B14_0 Mask               */\r
+#define LCD_PAL85_I1_Pos                                      31                                                        /*!< LCD PAL85: I1 Position              */\r
+#define LCD_PAL85_I1_Msk                                      (0x01UL << LCD_PAL85_I1_Pos)                              /*!< LCD PAL85: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL86  -------------------------------------------\r
+#define LCD_PAL86_R04_0_Pos                                   0                                                         /*!< LCD PAL86: R04_0 Position           */\r
+#define LCD_PAL86_R04_0_Msk                                   (0x1fUL << LCD_PAL86_R04_0_Pos)                           /*!< LCD PAL86: R04_0 Mask               */\r
+#define LCD_PAL86_G04_0_Pos                                   5                                                         /*!< LCD PAL86: G04_0 Position           */\r
+#define LCD_PAL86_G04_0_Msk                                   (0x1fUL << LCD_PAL86_G04_0_Pos)                           /*!< LCD PAL86: G04_0 Mask               */\r
+#define LCD_PAL86_B04_0_Pos                                   10                                                        /*!< LCD PAL86: B04_0 Position           */\r
+#define LCD_PAL86_B04_0_Msk                                   (0x1fUL << LCD_PAL86_B04_0_Pos)                           /*!< LCD PAL86: B04_0 Mask               */\r
+#define LCD_PAL86_I0_Pos                                      15                                                        /*!< LCD PAL86: I0 Position              */\r
+#define LCD_PAL86_I0_Msk                                      (0x01UL << LCD_PAL86_I0_Pos)                              /*!< LCD PAL86: I0 Mask                  */\r
+#define LCD_PAL86_R14_0_Pos                                   16                                                        /*!< LCD PAL86: R14_0 Position           */\r
+#define LCD_PAL86_R14_0_Msk                                   (0x1fUL << LCD_PAL86_R14_0_Pos)                           /*!< LCD PAL86: R14_0 Mask               */\r
+#define LCD_PAL86_G14_0_Pos                                   21                                                        /*!< LCD PAL86: G14_0 Position           */\r
+#define LCD_PAL86_G14_0_Msk                                   (0x1fUL << LCD_PAL86_G14_0_Pos)                           /*!< LCD PAL86: G14_0 Mask               */\r
+#define LCD_PAL86_B14_0_Pos                                   26                                                        /*!< LCD PAL86: B14_0 Position           */\r
+#define LCD_PAL86_B14_0_Msk                                   (0x1fUL << LCD_PAL86_B14_0_Pos)                           /*!< LCD PAL86: B14_0 Mask               */\r
+#define LCD_PAL86_I1_Pos                                      31                                                        /*!< LCD PAL86: I1 Position              */\r
+#define LCD_PAL86_I1_Msk                                      (0x01UL << LCD_PAL86_I1_Pos)                              /*!< LCD PAL86: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL87  -------------------------------------------\r
+#define LCD_PAL87_R04_0_Pos                                   0                                                         /*!< LCD PAL87: R04_0 Position           */\r
+#define LCD_PAL87_R04_0_Msk                                   (0x1fUL << LCD_PAL87_R04_0_Pos)                           /*!< LCD PAL87: R04_0 Mask               */\r
+#define LCD_PAL87_G04_0_Pos                                   5                                                         /*!< LCD PAL87: G04_0 Position           */\r
+#define LCD_PAL87_G04_0_Msk                                   (0x1fUL << LCD_PAL87_G04_0_Pos)                           /*!< LCD PAL87: G04_0 Mask               */\r
+#define LCD_PAL87_B04_0_Pos                                   10                                                        /*!< LCD PAL87: B04_0 Position           */\r
+#define LCD_PAL87_B04_0_Msk                                   (0x1fUL << LCD_PAL87_B04_0_Pos)                           /*!< LCD PAL87: B04_0 Mask               */\r
+#define LCD_PAL87_I0_Pos                                      15                                                        /*!< LCD PAL87: I0 Position              */\r
+#define LCD_PAL87_I0_Msk                                      (0x01UL << LCD_PAL87_I0_Pos)                              /*!< LCD PAL87: I0 Mask                  */\r
+#define LCD_PAL87_R14_0_Pos                                   16                                                        /*!< LCD PAL87: R14_0 Position           */\r
+#define LCD_PAL87_R14_0_Msk                                   (0x1fUL << LCD_PAL87_R14_0_Pos)                           /*!< LCD PAL87: R14_0 Mask               */\r
+#define LCD_PAL87_G14_0_Pos                                   21                                                        /*!< LCD PAL87: G14_0 Position           */\r
+#define LCD_PAL87_G14_0_Msk                                   (0x1fUL << LCD_PAL87_G14_0_Pos)                           /*!< LCD PAL87: G14_0 Mask               */\r
+#define LCD_PAL87_B14_0_Pos                                   26                                                        /*!< LCD PAL87: B14_0 Position           */\r
+#define LCD_PAL87_B14_0_Msk                                   (0x1fUL << LCD_PAL87_B14_0_Pos)                           /*!< LCD PAL87: B14_0 Mask               */\r
+#define LCD_PAL87_I1_Pos                                      31                                                        /*!< LCD PAL87: I1 Position              */\r
+#define LCD_PAL87_I1_Msk                                      (0x01UL << LCD_PAL87_I1_Pos)                              /*!< LCD PAL87: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL88  -------------------------------------------\r
+#define LCD_PAL88_R04_0_Pos                                   0                                                         /*!< LCD PAL88: R04_0 Position           */\r
+#define LCD_PAL88_R04_0_Msk                                   (0x1fUL << LCD_PAL88_R04_0_Pos)                           /*!< LCD PAL88: R04_0 Mask               */\r
+#define LCD_PAL88_G04_0_Pos                                   5                                                         /*!< LCD PAL88: G04_0 Position           */\r
+#define LCD_PAL88_G04_0_Msk                                   (0x1fUL << LCD_PAL88_G04_0_Pos)                           /*!< LCD PAL88: G04_0 Mask               */\r
+#define LCD_PAL88_B04_0_Pos                                   10                                                        /*!< LCD PAL88: B04_0 Position           */\r
+#define LCD_PAL88_B04_0_Msk                                   (0x1fUL << LCD_PAL88_B04_0_Pos)                           /*!< LCD PAL88: B04_0 Mask               */\r
+#define LCD_PAL88_I0_Pos                                      15                                                        /*!< LCD PAL88: I0 Position              */\r
+#define LCD_PAL88_I0_Msk                                      (0x01UL << LCD_PAL88_I0_Pos)                              /*!< LCD PAL88: I0 Mask                  */\r
+#define LCD_PAL88_R14_0_Pos                                   16                                                        /*!< LCD PAL88: R14_0 Position           */\r
+#define LCD_PAL88_R14_0_Msk                                   (0x1fUL << LCD_PAL88_R14_0_Pos)                           /*!< LCD PAL88: R14_0 Mask               */\r
+#define LCD_PAL88_G14_0_Pos                                   21                                                        /*!< LCD PAL88: G14_0 Position           */\r
+#define LCD_PAL88_G14_0_Msk                                   (0x1fUL << LCD_PAL88_G14_0_Pos)                           /*!< LCD PAL88: G14_0 Mask               */\r
+#define LCD_PAL88_B14_0_Pos                                   26                                                        /*!< LCD PAL88: B14_0 Position           */\r
+#define LCD_PAL88_B14_0_Msk                                   (0x1fUL << LCD_PAL88_B14_0_Pos)                           /*!< LCD PAL88: B14_0 Mask               */\r
+#define LCD_PAL88_I1_Pos                                      31                                                        /*!< LCD PAL88: I1 Position              */\r
+#define LCD_PAL88_I1_Msk                                      (0x01UL << LCD_PAL88_I1_Pos)                              /*!< LCD PAL88: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL89  -------------------------------------------\r
+#define LCD_PAL89_R04_0_Pos                                   0                                                         /*!< LCD PAL89: R04_0 Position           */\r
+#define LCD_PAL89_R04_0_Msk                                   (0x1fUL << LCD_PAL89_R04_0_Pos)                           /*!< LCD PAL89: R04_0 Mask               */\r
+#define LCD_PAL89_G04_0_Pos                                   5                                                         /*!< LCD PAL89: G04_0 Position           */\r
+#define LCD_PAL89_G04_0_Msk                                   (0x1fUL << LCD_PAL89_G04_0_Pos)                           /*!< LCD PAL89: G04_0 Mask               */\r
+#define LCD_PAL89_B04_0_Pos                                   10                                                        /*!< LCD PAL89: B04_0 Position           */\r
+#define LCD_PAL89_B04_0_Msk                                   (0x1fUL << LCD_PAL89_B04_0_Pos)                           /*!< LCD PAL89: B04_0 Mask               */\r
+#define LCD_PAL89_I0_Pos                                      15                                                        /*!< LCD PAL89: I0 Position              */\r
+#define LCD_PAL89_I0_Msk                                      (0x01UL << LCD_PAL89_I0_Pos)                              /*!< LCD PAL89: I0 Mask                  */\r
+#define LCD_PAL89_R14_0_Pos                                   16                                                        /*!< LCD PAL89: R14_0 Position           */\r
+#define LCD_PAL89_R14_0_Msk                                   (0x1fUL << LCD_PAL89_R14_0_Pos)                           /*!< LCD PAL89: R14_0 Mask               */\r
+#define LCD_PAL89_G14_0_Pos                                   21                                                        /*!< LCD PAL89: G14_0 Position           */\r
+#define LCD_PAL89_G14_0_Msk                                   (0x1fUL << LCD_PAL89_G14_0_Pos)                           /*!< LCD PAL89: G14_0 Mask               */\r
+#define LCD_PAL89_B14_0_Pos                                   26                                                        /*!< LCD PAL89: B14_0 Position           */\r
+#define LCD_PAL89_B14_0_Msk                                   (0x1fUL << LCD_PAL89_B14_0_Pos)                           /*!< LCD PAL89: B14_0 Mask               */\r
+#define LCD_PAL89_I1_Pos                                      31                                                        /*!< LCD PAL89: I1 Position              */\r
+#define LCD_PAL89_I1_Msk                                      (0x01UL << LCD_PAL89_I1_Pos)                              /*!< LCD PAL89: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL90  -------------------------------------------\r
+#define LCD_PAL90_R04_0_Pos                                   0                                                         /*!< LCD PAL90: R04_0 Position           */\r
+#define LCD_PAL90_R04_0_Msk                                   (0x1fUL << LCD_PAL90_R04_0_Pos)                           /*!< LCD PAL90: R04_0 Mask               */\r
+#define LCD_PAL90_G04_0_Pos                                   5                                                         /*!< LCD PAL90: G04_0 Position           */\r
+#define LCD_PAL90_G04_0_Msk                                   (0x1fUL << LCD_PAL90_G04_0_Pos)                           /*!< LCD PAL90: G04_0 Mask               */\r
+#define LCD_PAL90_B04_0_Pos                                   10                                                        /*!< LCD PAL90: B04_0 Position           */\r
+#define LCD_PAL90_B04_0_Msk                                   (0x1fUL << LCD_PAL90_B04_0_Pos)                           /*!< LCD PAL90: B04_0 Mask               */\r
+#define LCD_PAL90_I0_Pos                                      15                                                        /*!< LCD PAL90: I0 Position              */\r
+#define LCD_PAL90_I0_Msk                                      (0x01UL << LCD_PAL90_I0_Pos)                              /*!< LCD PAL90: I0 Mask                  */\r
+#define LCD_PAL90_R14_0_Pos                                   16                                                        /*!< LCD PAL90: R14_0 Position           */\r
+#define LCD_PAL90_R14_0_Msk                                   (0x1fUL << LCD_PAL90_R14_0_Pos)                           /*!< LCD PAL90: R14_0 Mask               */\r
+#define LCD_PAL90_G14_0_Pos                                   21                                                        /*!< LCD PAL90: G14_0 Position           */\r
+#define LCD_PAL90_G14_0_Msk                                   (0x1fUL << LCD_PAL90_G14_0_Pos)                           /*!< LCD PAL90: G14_0 Mask               */\r
+#define LCD_PAL90_B14_0_Pos                                   26                                                        /*!< LCD PAL90: B14_0 Position           */\r
+#define LCD_PAL90_B14_0_Msk                                   (0x1fUL << LCD_PAL90_B14_0_Pos)                           /*!< LCD PAL90: B14_0 Mask               */\r
+#define LCD_PAL90_I1_Pos                                      31                                                        /*!< LCD PAL90: I1 Position              */\r
+#define LCD_PAL90_I1_Msk                                      (0x01UL << LCD_PAL90_I1_Pos)                              /*!< LCD PAL90: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL91  -------------------------------------------\r
+#define LCD_PAL91_R04_0_Pos                                   0                                                         /*!< LCD PAL91: R04_0 Position           */\r
+#define LCD_PAL91_R04_0_Msk                                   (0x1fUL << LCD_PAL91_R04_0_Pos)                           /*!< LCD PAL91: R04_0 Mask               */\r
+#define LCD_PAL91_G04_0_Pos                                   5                                                         /*!< LCD PAL91: G04_0 Position           */\r
+#define LCD_PAL91_G04_0_Msk                                   (0x1fUL << LCD_PAL91_G04_0_Pos)                           /*!< LCD PAL91: G04_0 Mask               */\r
+#define LCD_PAL91_B04_0_Pos                                   10                                                        /*!< LCD PAL91: B04_0 Position           */\r
+#define LCD_PAL91_B04_0_Msk                                   (0x1fUL << LCD_PAL91_B04_0_Pos)                           /*!< LCD PAL91: B04_0 Mask               */\r
+#define LCD_PAL91_I0_Pos                                      15                                                        /*!< LCD PAL91: I0 Position              */\r
+#define LCD_PAL91_I0_Msk                                      (0x01UL << LCD_PAL91_I0_Pos)                              /*!< LCD PAL91: I0 Mask                  */\r
+#define LCD_PAL91_R14_0_Pos                                   16                                                        /*!< LCD PAL91: R14_0 Position           */\r
+#define LCD_PAL91_R14_0_Msk                                   (0x1fUL << LCD_PAL91_R14_0_Pos)                           /*!< LCD PAL91: R14_0 Mask               */\r
+#define LCD_PAL91_G14_0_Pos                                   21                                                        /*!< LCD PAL91: G14_0 Position           */\r
+#define LCD_PAL91_G14_0_Msk                                   (0x1fUL << LCD_PAL91_G14_0_Pos)                           /*!< LCD PAL91: G14_0 Mask               */\r
+#define LCD_PAL91_B14_0_Pos                                   26                                                        /*!< LCD PAL91: B14_0 Position           */\r
+#define LCD_PAL91_B14_0_Msk                                   (0x1fUL << LCD_PAL91_B14_0_Pos)                           /*!< LCD PAL91: B14_0 Mask               */\r
+#define LCD_PAL91_I1_Pos                                      31                                                        /*!< LCD PAL91: I1 Position              */\r
+#define LCD_PAL91_I1_Msk                                      (0x01UL << LCD_PAL91_I1_Pos)                              /*!< LCD PAL91: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL92  -------------------------------------------\r
+#define LCD_PAL92_R04_0_Pos                                   0                                                         /*!< LCD PAL92: R04_0 Position           */\r
+#define LCD_PAL92_R04_0_Msk                                   (0x1fUL << LCD_PAL92_R04_0_Pos)                           /*!< LCD PAL92: R04_0 Mask               */\r
+#define LCD_PAL92_G04_0_Pos                                   5                                                         /*!< LCD PAL92: G04_0 Position           */\r
+#define LCD_PAL92_G04_0_Msk                                   (0x1fUL << LCD_PAL92_G04_0_Pos)                           /*!< LCD PAL92: G04_0 Mask               */\r
+#define LCD_PAL92_B04_0_Pos                                   10                                                        /*!< LCD PAL92: B04_0 Position           */\r
+#define LCD_PAL92_B04_0_Msk                                   (0x1fUL << LCD_PAL92_B04_0_Pos)                           /*!< LCD PAL92: B04_0 Mask               */\r
+#define LCD_PAL92_I0_Pos                                      15                                                        /*!< LCD PAL92: I0 Position              */\r
+#define LCD_PAL92_I0_Msk                                      (0x01UL << LCD_PAL92_I0_Pos)                              /*!< LCD PAL92: I0 Mask                  */\r
+#define LCD_PAL92_R14_0_Pos                                   16                                                        /*!< LCD PAL92: R14_0 Position           */\r
+#define LCD_PAL92_R14_0_Msk                                   (0x1fUL << LCD_PAL92_R14_0_Pos)                           /*!< LCD PAL92: R14_0 Mask               */\r
+#define LCD_PAL92_G14_0_Pos                                   21                                                        /*!< LCD PAL92: G14_0 Position           */\r
+#define LCD_PAL92_G14_0_Msk                                   (0x1fUL << LCD_PAL92_G14_0_Pos)                           /*!< LCD PAL92: G14_0 Mask               */\r
+#define LCD_PAL92_B14_0_Pos                                   26                                                        /*!< LCD PAL92: B14_0 Position           */\r
+#define LCD_PAL92_B14_0_Msk                                   (0x1fUL << LCD_PAL92_B14_0_Pos)                           /*!< LCD PAL92: B14_0 Mask               */\r
+#define LCD_PAL92_I1_Pos                                      31                                                        /*!< LCD PAL92: I1 Position              */\r
+#define LCD_PAL92_I1_Msk                                      (0x01UL << LCD_PAL92_I1_Pos)                              /*!< LCD PAL92: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL93  -------------------------------------------\r
+#define LCD_PAL93_R04_0_Pos                                   0                                                         /*!< LCD PAL93: R04_0 Position           */\r
+#define LCD_PAL93_R04_0_Msk                                   (0x1fUL << LCD_PAL93_R04_0_Pos)                           /*!< LCD PAL93: R04_0 Mask               */\r
+#define LCD_PAL93_G04_0_Pos                                   5                                                         /*!< LCD PAL93: G04_0 Position           */\r
+#define LCD_PAL93_G04_0_Msk                                   (0x1fUL << LCD_PAL93_G04_0_Pos)                           /*!< LCD PAL93: G04_0 Mask               */\r
+#define LCD_PAL93_B04_0_Pos                                   10                                                        /*!< LCD PAL93: B04_0 Position           */\r
+#define LCD_PAL93_B04_0_Msk                                   (0x1fUL << LCD_PAL93_B04_0_Pos)                           /*!< LCD PAL93: B04_0 Mask               */\r
+#define LCD_PAL93_I0_Pos                                      15                                                        /*!< LCD PAL93: I0 Position              */\r
+#define LCD_PAL93_I0_Msk                                      (0x01UL << LCD_PAL93_I0_Pos)                              /*!< LCD PAL93: I0 Mask                  */\r
+#define LCD_PAL93_R14_0_Pos                                   16                                                        /*!< LCD PAL93: R14_0 Position           */\r
+#define LCD_PAL93_R14_0_Msk                                   (0x1fUL << LCD_PAL93_R14_0_Pos)                           /*!< LCD PAL93: R14_0 Mask               */\r
+#define LCD_PAL93_G14_0_Pos                                   21                                                        /*!< LCD PAL93: G14_0 Position           */\r
+#define LCD_PAL93_G14_0_Msk                                   (0x1fUL << LCD_PAL93_G14_0_Pos)                           /*!< LCD PAL93: G14_0 Mask               */\r
+#define LCD_PAL93_B14_0_Pos                                   26                                                        /*!< LCD PAL93: B14_0 Position           */\r
+#define LCD_PAL93_B14_0_Msk                                   (0x1fUL << LCD_PAL93_B14_0_Pos)                           /*!< LCD PAL93: B14_0 Mask               */\r
+#define LCD_PAL93_I1_Pos                                      31                                                        /*!< LCD PAL93: I1 Position              */\r
+#define LCD_PAL93_I1_Msk                                      (0x01UL << LCD_PAL93_I1_Pos)                              /*!< LCD PAL93: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL94  -------------------------------------------\r
+#define LCD_PAL94_R04_0_Pos                                   0                                                         /*!< LCD PAL94: R04_0 Position           */\r
+#define LCD_PAL94_R04_0_Msk                                   (0x1fUL << LCD_PAL94_R04_0_Pos)                           /*!< LCD PAL94: R04_0 Mask               */\r
+#define LCD_PAL94_G04_0_Pos                                   5                                                         /*!< LCD PAL94: G04_0 Position           */\r
+#define LCD_PAL94_G04_0_Msk                                   (0x1fUL << LCD_PAL94_G04_0_Pos)                           /*!< LCD PAL94: G04_0 Mask               */\r
+#define LCD_PAL94_B04_0_Pos                                   10                                                        /*!< LCD PAL94: B04_0 Position           */\r
+#define LCD_PAL94_B04_0_Msk                                   (0x1fUL << LCD_PAL94_B04_0_Pos)                           /*!< LCD PAL94: B04_0 Mask               */\r
+#define LCD_PAL94_I0_Pos                                      15                                                        /*!< LCD PAL94: I0 Position              */\r
+#define LCD_PAL94_I0_Msk                                      (0x01UL << LCD_PAL94_I0_Pos)                              /*!< LCD PAL94: I0 Mask                  */\r
+#define LCD_PAL94_R14_0_Pos                                   16                                                        /*!< LCD PAL94: R14_0 Position           */\r
+#define LCD_PAL94_R14_0_Msk                                   (0x1fUL << LCD_PAL94_R14_0_Pos)                           /*!< LCD PAL94: R14_0 Mask               */\r
+#define LCD_PAL94_G14_0_Pos                                   21                                                        /*!< LCD PAL94: G14_0 Position           */\r
+#define LCD_PAL94_G14_0_Msk                                   (0x1fUL << LCD_PAL94_G14_0_Pos)                           /*!< LCD PAL94: G14_0 Mask               */\r
+#define LCD_PAL94_B14_0_Pos                                   26                                                        /*!< LCD PAL94: B14_0 Position           */\r
+#define LCD_PAL94_B14_0_Msk                                   (0x1fUL << LCD_PAL94_B14_0_Pos)                           /*!< LCD PAL94: B14_0 Mask               */\r
+#define LCD_PAL94_I1_Pos                                      31                                                        /*!< LCD PAL94: I1 Position              */\r
+#define LCD_PAL94_I1_Msk                                      (0x01UL << LCD_PAL94_I1_Pos)                              /*!< LCD PAL94: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL95  -------------------------------------------\r
+#define LCD_PAL95_R04_0_Pos                                   0                                                         /*!< LCD PAL95: R04_0 Position           */\r
+#define LCD_PAL95_R04_0_Msk                                   (0x1fUL << LCD_PAL95_R04_0_Pos)                           /*!< LCD PAL95: R04_0 Mask               */\r
+#define LCD_PAL95_G04_0_Pos                                   5                                                         /*!< LCD PAL95: G04_0 Position           */\r
+#define LCD_PAL95_G04_0_Msk                                   (0x1fUL << LCD_PAL95_G04_0_Pos)                           /*!< LCD PAL95: G04_0 Mask               */\r
+#define LCD_PAL95_B04_0_Pos                                   10                                                        /*!< LCD PAL95: B04_0 Position           */\r
+#define LCD_PAL95_B04_0_Msk                                   (0x1fUL << LCD_PAL95_B04_0_Pos)                           /*!< LCD PAL95: B04_0 Mask               */\r
+#define LCD_PAL95_I0_Pos                                      15                                                        /*!< LCD PAL95: I0 Position              */\r
+#define LCD_PAL95_I0_Msk                                      (0x01UL << LCD_PAL95_I0_Pos)                              /*!< LCD PAL95: I0 Mask                  */\r
+#define LCD_PAL95_R14_0_Pos                                   16                                                        /*!< LCD PAL95: R14_0 Position           */\r
+#define LCD_PAL95_R14_0_Msk                                   (0x1fUL << LCD_PAL95_R14_0_Pos)                           /*!< LCD PAL95: R14_0 Mask               */\r
+#define LCD_PAL95_G14_0_Pos                                   21                                                        /*!< LCD PAL95: G14_0 Position           */\r
+#define LCD_PAL95_G14_0_Msk                                   (0x1fUL << LCD_PAL95_G14_0_Pos)                           /*!< LCD PAL95: G14_0 Mask               */\r
+#define LCD_PAL95_B14_0_Pos                                   26                                                        /*!< LCD PAL95: B14_0 Position           */\r
+#define LCD_PAL95_B14_0_Msk                                   (0x1fUL << LCD_PAL95_B14_0_Pos)                           /*!< LCD PAL95: B14_0 Mask               */\r
+#define LCD_PAL95_I1_Pos                                      31                                                        /*!< LCD PAL95: I1 Position              */\r
+#define LCD_PAL95_I1_Msk                                      (0x01UL << LCD_PAL95_I1_Pos)                              /*!< LCD PAL95: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL96  -------------------------------------------\r
+#define LCD_PAL96_R04_0_Pos                                   0                                                         /*!< LCD PAL96: R04_0 Position           */\r
+#define LCD_PAL96_R04_0_Msk                                   (0x1fUL << LCD_PAL96_R04_0_Pos)                           /*!< LCD PAL96: R04_0 Mask               */\r
+#define LCD_PAL96_G04_0_Pos                                   5                                                         /*!< LCD PAL96: G04_0 Position           */\r
+#define LCD_PAL96_G04_0_Msk                                   (0x1fUL << LCD_PAL96_G04_0_Pos)                           /*!< LCD PAL96: G04_0 Mask               */\r
+#define LCD_PAL96_B04_0_Pos                                   10                                                        /*!< LCD PAL96: B04_0 Position           */\r
+#define LCD_PAL96_B04_0_Msk                                   (0x1fUL << LCD_PAL96_B04_0_Pos)                           /*!< LCD PAL96: B04_0 Mask               */\r
+#define LCD_PAL96_I0_Pos                                      15                                                        /*!< LCD PAL96: I0 Position              */\r
+#define LCD_PAL96_I0_Msk                                      (0x01UL << LCD_PAL96_I0_Pos)                              /*!< LCD PAL96: I0 Mask                  */\r
+#define LCD_PAL96_R14_0_Pos                                   16                                                        /*!< LCD PAL96: R14_0 Position           */\r
+#define LCD_PAL96_R14_0_Msk                                   (0x1fUL << LCD_PAL96_R14_0_Pos)                           /*!< LCD PAL96: R14_0 Mask               */\r
+#define LCD_PAL96_G14_0_Pos                                   21                                                        /*!< LCD PAL96: G14_0 Position           */\r
+#define LCD_PAL96_G14_0_Msk                                   (0x1fUL << LCD_PAL96_G14_0_Pos)                           /*!< LCD PAL96: G14_0 Mask               */\r
+#define LCD_PAL96_B14_0_Pos                                   26                                                        /*!< LCD PAL96: B14_0 Position           */\r
+#define LCD_PAL96_B14_0_Msk                                   (0x1fUL << LCD_PAL96_B14_0_Pos)                           /*!< LCD PAL96: B14_0 Mask               */\r
+#define LCD_PAL96_I1_Pos                                      31                                                        /*!< LCD PAL96: I1 Position              */\r
+#define LCD_PAL96_I1_Msk                                      (0x01UL << LCD_PAL96_I1_Pos)                              /*!< LCD PAL96: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL97  -------------------------------------------\r
+#define LCD_PAL97_R04_0_Pos                                   0                                                         /*!< LCD PAL97: R04_0 Position           */\r
+#define LCD_PAL97_R04_0_Msk                                   (0x1fUL << LCD_PAL97_R04_0_Pos)                           /*!< LCD PAL97: R04_0 Mask               */\r
+#define LCD_PAL97_G04_0_Pos                                   5                                                         /*!< LCD PAL97: G04_0 Position           */\r
+#define LCD_PAL97_G04_0_Msk                                   (0x1fUL << LCD_PAL97_G04_0_Pos)                           /*!< LCD PAL97: G04_0 Mask               */\r
+#define LCD_PAL97_B04_0_Pos                                   10                                                        /*!< LCD PAL97: B04_0 Position           */\r
+#define LCD_PAL97_B04_0_Msk                                   (0x1fUL << LCD_PAL97_B04_0_Pos)                           /*!< LCD PAL97: B04_0 Mask               */\r
+#define LCD_PAL97_I0_Pos                                      15                                                        /*!< LCD PAL97: I0 Position              */\r
+#define LCD_PAL97_I0_Msk                                      (0x01UL << LCD_PAL97_I0_Pos)                              /*!< LCD PAL97: I0 Mask                  */\r
+#define LCD_PAL97_R14_0_Pos                                   16                                                        /*!< LCD PAL97: R14_0 Position           */\r
+#define LCD_PAL97_R14_0_Msk                                   (0x1fUL << LCD_PAL97_R14_0_Pos)                           /*!< LCD PAL97: R14_0 Mask               */\r
+#define LCD_PAL97_G14_0_Pos                                   21                                                        /*!< LCD PAL97: G14_0 Position           */\r
+#define LCD_PAL97_G14_0_Msk                                   (0x1fUL << LCD_PAL97_G14_0_Pos)                           /*!< LCD PAL97: G14_0 Mask               */\r
+#define LCD_PAL97_B14_0_Pos                                   26                                                        /*!< LCD PAL97: B14_0 Position           */\r
+#define LCD_PAL97_B14_0_Msk                                   (0x1fUL << LCD_PAL97_B14_0_Pos)                           /*!< LCD PAL97: B14_0 Mask               */\r
+#define LCD_PAL97_I1_Pos                                      31                                                        /*!< LCD PAL97: I1 Position              */\r
+#define LCD_PAL97_I1_Msk                                      (0x01UL << LCD_PAL97_I1_Pos)                              /*!< LCD PAL97: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL98  -------------------------------------------\r
+#define LCD_PAL98_R04_0_Pos                                   0                                                         /*!< LCD PAL98: R04_0 Position           */\r
+#define LCD_PAL98_R04_0_Msk                                   (0x1fUL << LCD_PAL98_R04_0_Pos)                           /*!< LCD PAL98: R04_0 Mask               */\r
+#define LCD_PAL98_G04_0_Pos                                   5                                                         /*!< LCD PAL98: G04_0 Position           */\r
+#define LCD_PAL98_G04_0_Msk                                   (0x1fUL << LCD_PAL98_G04_0_Pos)                           /*!< LCD PAL98: G04_0 Mask               */\r
+#define LCD_PAL98_B04_0_Pos                                   10                                                        /*!< LCD PAL98: B04_0 Position           */\r
+#define LCD_PAL98_B04_0_Msk                                   (0x1fUL << LCD_PAL98_B04_0_Pos)                           /*!< LCD PAL98: B04_0 Mask               */\r
+#define LCD_PAL98_I0_Pos                                      15                                                        /*!< LCD PAL98: I0 Position              */\r
+#define LCD_PAL98_I0_Msk                                      (0x01UL << LCD_PAL98_I0_Pos)                              /*!< LCD PAL98: I0 Mask                  */\r
+#define LCD_PAL98_R14_0_Pos                                   16                                                        /*!< LCD PAL98: R14_0 Position           */\r
+#define LCD_PAL98_R14_0_Msk                                   (0x1fUL << LCD_PAL98_R14_0_Pos)                           /*!< LCD PAL98: R14_0 Mask               */\r
+#define LCD_PAL98_G14_0_Pos                                   21                                                        /*!< LCD PAL98: G14_0 Position           */\r
+#define LCD_PAL98_G14_0_Msk                                   (0x1fUL << LCD_PAL98_G14_0_Pos)                           /*!< LCD PAL98: G14_0 Mask               */\r
+#define LCD_PAL98_B14_0_Pos                                   26                                                        /*!< LCD PAL98: B14_0 Position           */\r
+#define LCD_PAL98_B14_0_Msk                                   (0x1fUL << LCD_PAL98_B14_0_Pos)                           /*!< LCD PAL98: B14_0 Mask               */\r
+#define LCD_PAL98_I1_Pos                                      31                                                        /*!< LCD PAL98: I1 Position              */\r
+#define LCD_PAL98_I1_Msk                                      (0x01UL << LCD_PAL98_I1_Pos)                              /*!< LCD PAL98: I1 Mask                  */\r
+\r
+// ----------------------------------------  LCD_PAL99  -------------------------------------------\r
+#define LCD_PAL99_R04_0_Pos                                   0                                                         /*!< LCD PAL99: R04_0 Position           */\r
+#define LCD_PAL99_R04_0_Msk                                   (0x1fUL << LCD_PAL99_R04_0_Pos)                           /*!< LCD PAL99: R04_0 Mask               */\r
+#define LCD_PAL99_G04_0_Pos                                   5                                                         /*!< LCD PAL99: G04_0 Position           */\r
+#define LCD_PAL99_G04_0_Msk                                   (0x1fUL << LCD_PAL99_G04_0_Pos)                           /*!< LCD PAL99: G04_0 Mask               */\r
+#define LCD_PAL99_B04_0_Pos                                   10                                                        /*!< LCD PAL99: B04_0 Position           */\r
+#define LCD_PAL99_B04_0_Msk                                   (0x1fUL << LCD_PAL99_B04_0_Pos)                           /*!< LCD PAL99: B04_0 Mask               */\r
+#define LCD_PAL99_I0_Pos                                      15                                                        /*!< LCD PAL99: I0 Position              */\r
+#define LCD_PAL99_I0_Msk                                      (0x01UL << LCD_PAL99_I0_Pos)                              /*!< LCD PAL99: I0 Mask                  */\r
+#define LCD_PAL99_R14_0_Pos                                   16                                                        /*!< LCD PAL99: R14_0 Position           */\r
+#define LCD_PAL99_R14_0_Msk                                   (0x1fUL << LCD_PAL99_R14_0_Pos)                           /*!< LCD PAL99: R14_0 Mask               */\r
+#define LCD_PAL99_G14_0_Pos                                   21                                                        /*!< LCD PAL99: G14_0 Position           */\r
+#define LCD_PAL99_G14_0_Msk                                   (0x1fUL << LCD_PAL99_G14_0_Pos)                           /*!< LCD PAL99: G14_0 Mask               */\r
+#define LCD_PAL99_B14_0_Pos                                   26                                                        /*!< LCD PAL99: B14_0 Position           */\r
+#define LCD_PAL99_B14_0_Msk                                   (0x1fUL << LCD_PAL99_B14_0_Pos)                           /*!< LCD PAL99: B14_0 Mask               */\r
+#define LCD_PAL99_I1_Pos                                      31                                                        /*!< LCD PAL99: I1 Position              */\r
+#define LCD_PAL99_I1_Msk                                      (0x01UL << LCD_PAL99_I1_Pos)                              /*!< LCD PAL99: I1 Mask                  */\r
+\r
+// ---------------------------------------  LCD_PAL100  -------------------------------------------\r
+#define LCD_PAL100_R04_0_Pos                                  0                                                         /*!< LCD PAL100: R04_0 Position          */\r
+#define LCD_PAL100_R04_0_Msk                                  (0x1fUL << LCD_PAL100_R04_0_Pos)                          /*!< LCD PAL100: R04_0 Mask              */\r
+#define LCD_PAL100_G04_0_Pos                                  5                                                         /*!< LCD PAL100: G04_0 Position          */\r
+#define LCD_PAL100_G04_0_Msk                                  (0x1fUL << LCD_PAL100_G04_0_Pos)                          /*!< LCD PAL100: G04_0 Mask              */\r
+#define LCD_PAL100_B04_0_Pos                                  10                                                        /*!< LCD PAL100: B04_0 Position          */\r
+#define LCD_PAL100_B04_0_Msk                                  (0x1fUL << LCD_PAL100_B04_0_Pos)                          /*!< LCD PAL100: B04_0 Mask              */\r
+#define LCD_PAL100_I0_Pos                                     15                                                        /*!< LCD PAL100: I0 Position             */\r
+#define LCD_PAL100_I0_Msk                                     (0x01UL << LCD_PAL100_I0_Pos)                             /*!< LCD PAL100: I0 Mask                 */\r
+#define LCD_PAL100_R14_0_Pos                                  16                                                        /*!< LCD PAL100: R14_0 Position          */\r
+#define LCD_PAL100_R14_0_Msk                                  (0x1fUL << LCD_PAL100_R14_0_Pos)                          /*!< LCD PAL100: R14_0 Mask              */\r
+#define LCD_PAL100_G14_0_Pos                                  21                                                        /*!< LCD PAL100: G14_0 Position          */\r
+#define LCD_PAL100_G14_0_Msk                                  (0x1fUL << LCD_PAL100_G14_0_Pos)                          /*!< LCD PAL100: G14_0 Mask              */\r
+#define LCD_PAL100_B14_0_Pos                                  26                                                        /*!< LCD PAL100: B14_0 Position          */\r
+#define LCD_PAL100_B14_0_Msk                                  (0x1fUL << LCD_PAL100_B14_0_Pos)                          /*!< LCD PAL100: B14_0 Mask              */\r
+#define LCD_PAL100_I1_Pos                                     31                                                        /*!< LCD PAL100: I1 Position             */\r
+#define LCD_PAL100_I1_Msk                                     (0x01UL << LCD_PAL100_I1_Pos)                             /*!< LCD PAL100: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL101  -------------------------------------------\r
+#define LCD_PAL101_R04_0_Pos                                  0                                                         /*!< LCD PAL101: R04_0 Position          */\r
+#define LCD_PAL101_R04_0_Msk                                  (0x1fUL << LCD_PAL101_R04_0_Pos)                          /*!< LCD PAL101: R04_0 Mask              */\r
+#define LCD_PAL101_G04_0_Pos                                  5                                                         /*!< LCD PAL101: G04_0 Position          */\r
+#define LCD_PAL101_G04_0_Msk                                  (0x1fUL << LCD_PAL101_G04_0_Pos)                          /*!< LCD PAL101: G04_0 Mask              */\r
+#define LCD_PAL101_B04_0_Pos                                  10                                                        /*!< LCD PAL101: B04_0 Position          */\r
+#define LCD_PAL101_B04_0_Msk                                  (0x1fUL << LCD_PAL101_B04_0_Pos)                          /*!< LCD PAL101: B04_0 Mask              */\r
+#define LCD_PAL101_I0_Pos                                     15                                                        /*!< LCD PAL101: I0 Position             */\r
+#define LCD_PAL101_I0_Msk                                     (0x01UL << LCD_PAL101_I0_Pos)                             /*!< LCD PAL101: I0 Mask                 */\r
+#define LCD_PAL101_R14_0_Pos                                  16                                                        /*!< LCD PAL101: R14_0 Position          */\r
+#define LCD_PAL101_R14_0_Msk                                  (0x1fUL << LCD_PAL101_R14_0_Pos)                          /*!< LCD PAL101: R14_0 Mask              */\r
+#define LCD_PAL101_G14_0_Pos                                  21                                                        /*!< LCD PAL101: G14_0 Position          */\r
+#define LCD_PAL101_G14_0_Msk                                  (0x1fUL << LCD_PAL101_G14_0_Pos)                          /*!< LCD PAL101: G14_0 Mask              */\r
+#define LCD_PAL101_B14_0_Pos                                  26                                                        /*!< LCD PAL101: B14_0 Position          */\r
+#define LCD_PAL101_B14_0_Msk                                  (0x1fUL << LCD_PAL101_B14_0_Pos)                          /*!< LCD PAL101: B14_0 Mask              */\r
+#define LCD_PAL101_I1_Pos                                     31                                                        /*!< LCD PAL101: I1 Position             */\r
+#define LCD_PAL101_I1_Msk                                     (0x01UL << LCD_PAL101_I1_Pos)                             /*!< LCD PAL101: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL102  -------------------------------------------\r
+#define LCD_PAL102_R04_0_Pos                                  0                                                         /*!< LCD PAL102: R04_0 Position          */\r
+#define LCD_PAL102_R04_0_Msk                                  (0x1fUL << LCD_PAL102_R04_0_Pos)                          /*!< LCD PAL102: R04_0 Mask              */\r
+#define LCD_PAL102_G04_0_Pos                                  5                                                         /*!< LCD PAL102: G04_0 Position          */\r
+#define LCD_PAL102_G04_0_Msk                                  (0x1fUL << LCD_PAL102_G04_0_Pos)                          /*!< LCD PAL102: G04_0 Mask              */\r
+#define LCD_PAL102_B04_0_Pos                                  10                                                        /*!< LCD PAL102: B04_0 Position          */\r
+#define LCD_PAL102_B04_0_Msk                                  (0x1fUL << LCD_PAL102_B04_0_Pos)                          /*!< LCD PAL102: B04_0 Mask              */\r
+#define LCD_PAL102_I0_Pos                                     15                                                        /*!< LCD PAL102: I0 Position             */\r
+#define LCD_PAL102_I0_Msk                                     (0x01UL << LCD_PAL102_I0_Pos)                             /*!< LCD PAL102: I0 Mask                 */\r
+#define LCD_PAL102_R14_0_Pos                                  16                                                        /*!< LCD PAL102: R14_0 Position          */\r
+#define LCD_PAL102_R14_0_Msk                                  (0x1fUL << LCD_PAL102_R14_0_Pos)                          /*!< LCD PAL102: R14_0 Mask              */\r
+#define LCD_PAL102_G14_0_Pos                                  21                                                        /*!< LCD PAL102: G14_0 Position          */\r
+#define LCD_PAL102_G14_0_Msk                                  (0x1fUL << LCD_PAL102_G14_0_Pos)                          /*!< LCD PAL102: G14_0 Mask              */\r
+#define LCD_PAL102_B14_0_Pos                                  26                                                        /*!< LCD PAL102: B14_0 Position          */\r
+#define LCD_PAL102_B14_0_Msk                                  (0x1fUL << LCD_PAL102_B14_0_Pos)                          /*!< LCD PAL102: B14_0 Mask              */\r
+#define LCD_PAL102_I1_Pos                                     31                                                        /*!< LCD PAL102: I1 Position             */\r
+#define LCD_PAL102_I1_Msk                                     (0x01UL << LCD_PAL102_I1_Pos)                             /*!< LCD PAL102: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL103  -------------------------------------------\r
+#define LCD_PAL103_R04_0_Pos                                  0                                                         /*!< LCD PAL103: R04_0 Position          */\r
+#define LCD_PAL103_R04_0_Msk                                  (0x1fUL << LCD_PAL103_R04_0_Pos)                          /*!< LCD PAL103: R04_0 Mask              */\r
+#define LCD_PAL103_G04_0_Pos                                  5                                                         /*!< LCD PAL103: G04_0 Position          */\r
+#define LCD_PAL103_G04_0_Msk                                  (0x1fUL << LCD_PAL103_G04_0_Pos)                          /*!< LCD PAL103: G04_0 Mask              */\r
+#define LCD_PAL103_B04_0_Pos                                  10                                                        /*!< LCD PAL103: B04_0 Position          */\r
+#define LCD_PAL103_B04_0_Msk                                  (0x1fUL << LCD_PAL103_B04_0_Pos)                          /*!< LCD PAL103: B04_0 Mask              */\r
+#define LCD_PAL103_I0_Pos                                     15                                                        /*!< LCD PAL103: I0 Position             */\r
+#define LCD_PAL103_I0_Msk                                     (0x01UL << LCD_PAL103_I0_Pos)                             /*!< LCD PAL103: I0 Mask                 */\r
+#define LCD_PAL103_R14_0_Pos                                  16                                                        /*!< LCD PAL103: R14_0 Position          */\r
+#define LCD_PAL103_R14_0_Msk                                  (0x1fUL << LCD_PAL103_R14_0_Pos)                          /*!< LCD PAL103: R14_0 Mask              */\r
+#define LCD_PAL103_G14_0_Pos                                  21                                                        /*!< LCD PAL103: G14_0 Position          */\r
+#define LCD_PAL103_G14_0_Msk                                  (0x1fUL << LCD_PAL103_G14_0_Pos)                          /*!< LCD PAL103: G14_0 Mask              */\r
+#define LCD_PAL103_B14_0_Pos                                  26                                                        /*!< LCD PAL103: B14_0 Position          */\r
+#define LCD_PAL103_B14_0_Msk                                  (0x1fUL << LCD_PAL103_B14_0_Pos)                          /*!< LCD PAL103: B14_0 Mask              */\r
+#define LCD_PAL103_I1_Pos                                     31                                                        /*!< LCD PAL103: I1 Position             */\r
+#define LCD_PAL103_I1_Msk                                     (0x01UL << LCD_PAL103_I1_Pos)                             /*!< LCD PAL103: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL104  -------------------------------------------\r
+#define LCD_PAL104_R04_0_Pos                                  0                                                         /*!< LCD PAL104: R04_0 Position          */\r
+#define LCD_PAL104_R04_0_Msk                                  (0x1fUL << LCD_PAL104_R04_0_Pos)                          /*!< LCD PAL104: R04_0 Mask              */\r
+#define LCD_PAL104_G04_0_Pos                                  5                                                         /*!< LCD PAL104: G04_0 Position          */\r
+#define LCD_PAL104_G04_0_Msk                                  (0x1fUL << LCD_PAL104_G04_0_Pos)                          /*!< LCD PAL104: G04_0 Mask              */\r
+#define LCD_PAL104_B04_0_Pos                                  10                                                        /*!< LCD PAL104: B04_0 Position          */\r
+#define LCD_PAL104_B04_0_Msk                                  (0x1fUL << LCD_PAL104_B04_0_Pos)                          /*!< LCD PAL104: B04_0 Mask              */\r
+#define LCD_PAL104_I0_Pos                                     15                                                        /*!< LCD PAL104: I0 Position             */\r
+#define LCD_PAL104_I0_Msk                                     (0x01UL << LCD_PAL104_I0_Pos)                             /*!< LCD PAL104: I0 Mask                 */\r
+#define LCD_PAL104_R14_0_Pos                                  16                                                        /*!< LCD PAL104: R14_0 Position          */\r
+#define LCD_PAL104_R14_0_Msk                                  (0x1fUL << LCD_PAL104_R14_0_Pos)                          /*!< LCD PAL104: R14_0 Mask              */\r
+#define LCD_PAL104_G14_0_Pos                                  21                                                        /*!< LCD PAL104: G14_0 Position          */\r
+#define LCD_PAL104_G14_0_Msk                                  (0x1fUL << LCD_PAL104_G14_0_Pos)                          /*!< LCD PAL104: G14_0 Mask              */\r
+#define LCD_PAL104_B14_0_Pos                                  26                                                        /*!< LCD PAL104: B14_0 Position          */\r
+#define LCD_PAL104_B14_0_Msk                                  (0x1fUL << LCD_PAL104_B14_0_Pos)                          /*!< LCD PAL104: B14_0 Mask              */\r
+#define LCD_PAL104_I1_Pos                                     31                                                        /*!< LCD PAL104: I1 Position             */\r
+#define LCD_PAL104_I1_Msk                                     (0x01UL << LCD_PAL104_I1_Pos)                             /*!< LCD PAL104: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL105  -------------------------------------------\r
+#define LCD_PAL105_R04_0_Pos                                  0                                                         /*!< LCD PAL105: R04_0 Position          */\r
+#define LCD_PAL105_R04_0_Msk                                  (0x1fUL << LCD_PAL105_R04_0_Pos)                          /*!< LCD PAL105: R04_0 Mask              */\r
+#define LCD_PAL105_G04_0_Pos                                  5                                                         /*!< LCD PAL105: G04_0 Position          */\r
+#define LCD_PAL105_G04_0_Msk                                  (0x1fUL << LCD_PAL105_G04_0_Pos)                          /*!< LCD PAL105: G04_0 Mask              */\r
+#define LCD_PAL105_B04_0_Pos                                  10                                                        /*!< LCD PAL105: B04_0 Position          */\r
+#define LCD_PAL105_B04_0_Msk                                  (0x1fUL << LCD_PAL105_B04_0_Pos)                          /*!< LCD PAL105: B04_0 Mask              */\r
+#define LCD_PAL105_I0_Pos                                     15                                                        /*!< LCD PAL105: I0 Position             */\r
+#define LCD_PAL105_I0_Msk                                     (0x01UL << LCD_PAL105_I0_Pos)                             /*!< LCD PAL105: I0 Mask                 */\r
+#define LCD_PAL105_R14_0_Pos                                  16                                                        /*!< LCD PAL105: R14_0 Position          */\r
+#define LCD_PAL105_R14_0_Msk                                  (0x1fUL << LCD_PAL105_R14_0_Pos)                          /*!< LCD PAL105: R14_0 Mask              */\r
+#define LCD_PAL105_G14_0_Pos                                  21                                                        /*!< LCD PAL105: G14_0 Position          */\r
+#define LCD_PAL105_G14_0_Msk                                  (0x1fUL << LCD_PAL105_G14_0_Pos)                          /*!< LCD PAL105: G14_0 Mask              */\r
+#define LCD_PAL105_B14_0_Pos                                  26                                                        /*!< LCD PAL105: B14_0 Position          */\r
+#define LCD_PAL105_B14_0_Msk                                  (0x1fUL << LCD_PAL105_B14_0_Pos)                          /*!< LCD PAL105: B14_0 Mask              */\r
+#define LCD_PAL105_I1_Pos                                     31                                                        /*!< LCD PAL105: I1 Position             */\r
+#define LCD_PAL105_I1_Msk                                     (0x01UL << LCD_PAL105_I1_Pos)                             /*!< LCD PAL105: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL106  -------------------------------------------\r
+#define LCD_PAL106_R04_0_Pos                                  0                                                         /*!< LCD PAL106: R04_0 Position          */\r
+#define LCD_PAL106_R04_0_Msk                                  (0x1fUL << LCD_PAL106_R04_0_Pos)                          /*!< LCD PAL106: R04_0 Mask              */\r
+#define LCD_PAL106_G04_0_Pos                                  5                                                         /*!< LCD PAL106: G04_0 Position          */\r
+#define LCD_PAL106_G04_0_Msk                                  (0x1fUL << LCD_PAL106_G04_0_Pos)                          /*!< LCD PAL106: G04_0 Mask              */\r
+#define LCD_PAL106_B04_0_Pos                                  10                                                        /*!< LCD PAL106: B04_0 Position          */\r
+#define LCD_PAL106_B04_0_Msk                                  (0x1fUL << LCD_PAL106_B04_0_Pos)                          /*!< LCD PAL106: B04_0 Mask              */\r
+#define LCD_PAL106_I0_Pos                                     15                                                        /*!< LCD PAL106: I0 Position             */\r
+#define LCD_PAL106_I0_Msk                                     (0x01UL << LCD_PAL106_I0_Pos)                             /*!< LCD PAL106: I0 Mask                 */\r
+#define LCD_PAL106_R14_0_Pos                                  16                                                        /*!< LCD PAL106: R14_0 Position          */\r
+#define LCD_PAL106_R14_0_Msk                                  (0x1fUL << LCD_PAL106_R14_0_Pos)                          /*!< LCD PAL106: R14_0 Mask              */\r
+#define LCD_PAL106_G14_0_Pos                                  21                                                        /*!< LCD PAL106: G14_0 Position          */\r
+#define LCD_PAL106_G14_0_Msk                                  (0x1fUL << LCD_PAL106_G14_0_Pos)                          /*!< LCD PAL106: G14_0 Mask              */\r
+#define LCD_PAL106_B14_0_Pos                                  26                                                        /*!< LCD PAL106: B14_0 Position          */\r
+#define LCD_PAL106_B14_0_Msk                                  (0x1fUL << LCD_PAL106_B14_0_Pos)                          /*!< LCD PAL106: B14_0 Mask              */\r
+#define LCD_PAL106_I1_Pos                                     31                                                        /*!< LCD PAL106: I1 Position             */\r
+#define LCD_PAL106_I1_Msk                                     (0x01UL << LCD_PAL106_I1_Pos)                             /*!< LCD PAL106: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL107  -------------------------------------------\r
+#define LCD_PAL107_R04_0_Pos                                  0                                                         /*!< LCD PAL107: R04_0 Position          */\r
+#define LCD_PAL107_R04_0_Msk                                  (0x1fUL << LCD_PAL107_R04_0_Pos)                          /*!< LCD PAL107: R04_0 Mask              */\r
+#define LCD_PAL107_G04_0_Pos                                  5                                                         /*!< LCD PAL107: G04_0 Position          */\r
+#define LCD_PAL107_G04_0_Msk                                  (0x1fUL << LCD_PAL107_G04_0_Pos)                          /*!< LCD PAL107: G04_0 Mask              */\r
+#define LCD_PAL107_B04_0_Pos                                  10                                                        /*!< LCD PAL107: B04_0 Position          */\r
+#define LCD_PAL107_B04_0_Msk                                  (0x1fUL << LCD_PAL107_B04_0_Pos)                          /*!< LCD PAL107: B04_0 Mask              */\r
+#define LCD_PAL107_I0_Pos                                     15                                                        /*!< LCD PAL107: I0 Position             */\r
+#define LCD_PAL107_I0_Msk                                     (0x01UL << LCD_PAL107_I0_Pos)                             /*!< LCD PAL107: I0 Mask                 */\r
+#define LCD_PAL107_R14_0_Pos                                  16                                                        /*!< LCD PAL107: R14_0 Position          */\r
+#define LCD_PAL107_R14_0_Msk                                  (0x1fUL << LCD_PAL107_R14_0_Pos)                          /*!< LCD PAL107: R14_0 Mask              */\r
+#define LCD_PAL107_G14_0_Pos                                  21                                                        /*!< LCD PAL107: G14_0 Position          */\r
+#define LCD_PAL107_G14_0_Msk                                  (0x1fUL << LCD_PAL107_G14_0_Pos)                          /*!< LCD PAL107: G14_0 Mask              */\r
+#define LCD_PAL107_B14_0_Pos                                  26                                                        /*!< LCD PAL107: B14_0 Position          */\r
+#define LCD_PAL107_B14_0_Msk                                  (0x1fUL << LCD_PAL107_B14_0_Pos)                          /*!< LCD PAL107: B14_0 Mask              */\r
+#define LCD_PAL107_I1_Pos                                     31                                                        /*!< LCD PAL107: I1 Position             */\r
+#define LCD_PAL107_I1_Msk                                     (0x01UL << LCD_PAL107_I1_Pos)                             /*!< LCD PAL107: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL108  -------------------------------------------\r
+#define LCD_PAL108_R04_0_Pos                                  0                                                         /*!< LCD PAL108: R04_0 Position          */\r
+#define LCD_PAL108_R04_0_Msk                                  (0x1fUL << LCD_PAL108_R04_0_Pos)                          /*!< LCD PAL108: R04_0 Mask              */\r
+#define LCD_PAL108_G04_0_Pos                                  5                                                         /*!< LCD PAL108: G04_0 Position          */\r
+#define LCD_PAL108_G04_0_Msk                                  (0x1fUL << LCD_PAL108_G04_0_Pos)                          /*!< LCD PAL108: G04_0 Mask              */\r
+#define LCD_PAL108_B04_0_Pos                                  10                                                        /*!< LCD PAL108: B04_0 Position          */\r
+#define LCD_PAL108_B04_0_Msk                                  (0x1fUL << LCD_PAL108_B04_0_Pos)                          /*!< LCD PAL108: B04_0 Mask              */\r
+#define LCD_PAL108_I0_Pos                                     15                                                        /*!< LCD PAL108: I0 Position             */\r
+#define LCD_PAL108_I0_Msk                                     (0x01UL << LCD_PAL108_I0_Pos)                             /*!< LCD PAL108: I0 Mask                 */\r
+#define LCD_PAL108_R14_0_Pos                                  16                                                        /*!< LCD PAL108: R14_0 Position          */\r
+#define LCD_PAL108_R14_0_Msk                                  (0x1fUL << LCD_PAL108_R14_0_Pos)                          /*!< LCD PAL108: R14_0 Mask              */\r
+#define LCD_PAL108_G14_0_Pos                                  21                                                        /*!< LCD PAL108: G14_0 Position          */\r
+#define LCD_PAL108_G14_0_Msk                                  (0x1fUL << LCD_PAL108_G14_0_Pos)                          /*!< LCD PAL108: G14_0 Mask              */\r
+#define LCD_PAL108_B14_0_Pos                                  26                                                        /*!< LCD PAL108: B14_0 Position          */\r
+#define LCD_PAL108_B14_0_Msk                                  (0x1fUL << LCD_PAL108_B14_0_Pos)                          /*!< LCD PAL108: B14_0 Mask              */\r
+#define LCD_PAL108_I1_Pos                                     31                                                        /*!< LCD PAL108: I1 Position             */\r
+#define LCD_PAL108_I1_Msk                                     (0x01UL << LCD_PAL108_I1_Pos)                             /*!< LCD PAL108: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL109  -------------------------------------------\r
+#define LCD_PAL109_R04_0_Pos                                  0                                                         /*!< LCD PAL109: R04_0 Position          */\r
+#define LCD_PAL109_R04_0_Msk                                  (0x1fUL << LCD_PAL109_R04_0_Pos)                          /*!< LCD PAL109: R04_0 Mask              */\r
+#define LCD_PAL109_G04_0_Pos                                  5                                                         /*!< LCD PAL109: G04_0 Position          */\r
+#define LCD_PAL109_G04_0_Msk                                  (0x1fUL << LCD_PAL109_G04_0_Pos)                          /*!< LCD PAL109: G04_0 Mask              */\r
+#define LCD_PAL109_B04_0_Pos                                  10                                                        /*!< LCD PAL109: B04_0 Position          */\r
+#define LCD_PAL109_B04_0_Msk                                  (0x1fUL << LCD_PAL109_B04_0_Pos)                          /*!< LCD PAL109: B04_0 Mask              */\r
+#define LCD_PAL109_I0_Pos                                     15                                                        /*!< LCD PAL109: I0 Position             */\r
+#define LCD_PAL109_I0_Msk                                     (0x01UL << LCD_PAL109_I0_Pos)                             /*!< LCD PAL109: I0 Mask                 */\r
+#define LCD_PAL109_R14_0_Pos                                  16                                                        /*!< LCD PAL109: R14_0 Position          */\r
+#define LCD_PAL109_R14_0_Msk                                  (0x1fUL << LCD_PAL109_R14_0_Pos)                          /*!< LCD PAL109: R14_0 Mask              */\r
+#define LCD_PAL109_G14_0_Pos                                  21                                                        /*!< LCD PAL109: G14_0 Position          */\r
+#define LCD_PAL109_G14_0_Msk                                  (0x1fUL << LCD_PAL109_G14_0_Pos)                          /*!< LCD PAL109: G14_0 Mask              */\r
+#define LCD_PAL109_B14_0_Pos                                  26                                                        /*!< LCD PAL109: B14_0 Position          */\r
+#define LCD_PAL109_B14_0_Msk                                  (0x1fUL << LCD_PAL109_B14_0_Pos)                          /*!< LCD PAL109: B14_0 Mask              */\r
+#define LCD_PAL109_I1_Pos                                     31                                                        /*!< LCD PAL109: I1 Position             */\r
+#define LCD_PAL109_I1_Msk                                     (0x01UL << LCD_PAL109_I1_Pos)                             /*!< LCD PAL109: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL110  -------------------------------------------\r
+#define LCD_PAL110_R04_0_Pos                                  0                                                         /*!< LCD PAL110: R04_0 Position          */\r
+#define LCD_PAL110_R04_0_Msk                                  (0x1fUL << LCD_PAL110_R04_0_Pos)                          /*!< LCD PAL110: R04_0 Mask              */\r
+#define LCD_PAL110_G04_0_Pos                                  5                                                         /*!< LCD PAL110: G04_0 Position          */\r
+#define LCD_PAL110_G04_0_Msk                                  (0x1fUL << LCD_PAL110_G04_0_Pos)                          /*!< LCD PAL110: G04_0 Mask              */\r
+#define LCD_PAL110_B04_0_Pos                                  10                                                        /*!< LCD PAL110: B04_0 Position          */\r
+#define LCD_PAL110_B04_0_Msk                                  (0x1fUL << LCD_PAL110_B04_0_Pos)                          /*!< LCD PAL110: B04_0 Mask              */\r
+#define LCD_PAL110_I0_Pos                                     15                                                        /*!< LCD PAL110: I0 Position             */\r
+#define LCD_PAL110_I0_Msk                                     (0x01UL << LCD_PAL110_I0_Pos)                             /*!< LCD PAL110: I0 Mask                 */\r
+#define LCD_PAL110_R14_0_Pos                                  16                                                        /*!< LCD PAL110: R14_0 Position          */\r
+#define LCD_PAL110_R14_0_Msk                                  (0x1fUL << LCD_PAL110_R14_0_Pos)                          /*!< LCD PAL110: R14_0 Mask              */\r
+#define LCD_PAL110_G14_0_Pos                                  21                                                        /*!< LCD PAL110: G14_0 Position          */\r
+#define LCD_PAL110_G14_0_Msk                                  (0x1fUL << LCD_PAL110_G14_0_Pos)                          /*!< LCD PAL110: G14_0 Mask              */\r
+#define LCD_PAL110_B14_0_Pos                                  26                                                        /*!< LCD PAL110: B14_0 Position          */\r
+#define LCD_PAL110_B14_0_Msk                                  (0x1fUL << LCD_PAL110_B14_0_Pos)                          /*!< LCD PAL110: B14_0 Mask              */\r
+#define LCD_PAL110_I1_Pos                                     31                                                        /*!< LCD PAL110: I1 Position             */\r
+#define LCD_PAL110_I1_Msk                                     (0x01UL << LCD_PAL110_I1_Pos)                             /*!< LCD PAL110: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL111  -------------------------------------------\r
+#define LCD_PAL111_R04_0_Pos                                  0                                                         /*!< LCD PAL111: R04_0 Position          */\r
+#define LCD_PAL111_R04_0_Msk                                  (0x1fUL << LCD_PAL111_R04_0_Pos)                          /*!< LCD PAL111: R04_0 Mask              */\r
+#define LCD_PAL111_G04_0_Pos                                  5                                                         /*!< LCD PAL111: G04_0 Position          */\r
+#define LCD_PAL111_G04_0_Msk                                  (0x1fUL << LCD_PAL111_G04_0_Pos)                          /*!< LCD PAL111: G04_0 Mask              */\r
+#define LCD_PAL111_B04_0_Pos                                  10                                                        /*!< LCD PAL111: B04_0 Position          */\r
+#define LCD_PAL111_B04_0_Msk                                  (0x1fUL << LCD_PAL111_B04_0_Pos)                          /*!< LCD PAL111: B04_0 Mask              */\r
+#define LCD_PAL111_I0_Pos                                     15                                                        /*!< LCD PAL111: I0 Position             */\r
+#define LCD_PAL111_I0_Msk                                     (0x01UL << LCD_PAL111_I0_Pos)                             /*!< LCD PAL111: I0 Mask                 */\r
+#define LCD_PAL111_R14_0_Pos                                  16                                                        /*!< LCD PAL111: R14_0 Position          */\r
+#define LCD_PAL111_R14_0_Msk                                  (0x1fUL << LCD_PAL111_R14_0_Pos)                          /*!< LCD PAL111: R14_0 Mask              */\r
+#define LCD_PAL111_G14_0_Pos                                  21                                                        /*!< LCD PAL111: G14_0 Position          */\r
+#define LCD_PAL111_G14_0_Msk                                  (0x1fUL << LCD_PAL111_G14_0_Pos)                          /*!< LCD PAL111: G14_0 Mask              */\r
+#define LCD_PAL111_B14_0_Pos                                  26                                                        /*!< LCD PAL111: B14_0 Position          */\r
+#define LCD_PAL111_B14_0_Msk                                  (0x1fUL << LCD_PAL111_B14_0_Pos)                          /*!< LCD PAL111: B14_0 Mask              */\r
+#define LCD_PAL111_I1_Pos                                     31                                                        /*!< LCD PAL111: I1 Position             */\r
+#define LCD_PAL111_I1_Msk                                     (0x01UL << LCD_PAL111_I1_Pos)                             /*!< LCD PAL111: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL112  -------------------------------------------\r
+#define LCD_PAL112_R04_0_Pos                                  0                                                         /*!< LCD PAL112: R04_0 Position          */\r
+#define LCD_PAL112_R04_0_Msk                                  (0x1fUL << LCD_PAL112_R04_0_Pos)                          /*!< LCD PAL112: R04_0 Mask              */\r
+#define LCD_PAL112_G04_0_Pos                                  5                                                         /*!< LCD PAL112: G04_0 Position          */\r
+#define LCD_PAL112_G04_0_Msk                                  (0x1fUL << LCD_PAL112_G04_0_Pos)                          /*!< LCD PAL112: G04_0 Mask              */\r
+#define LCD_PAL112_B04_0_Pos                                  10                                                        /*!< LCD PAL112: B04_0 Position          */\r
+#define LCD_PAL112_B04_0_Msk                                  (0x1fUL << LCD_PAL112_B04_0_Pos)                          /*!< LCD PAL112: B04_0 Mask              */\r
+#define LCD_PAL112_I0_Pos                                     15                                                        /*!< LCD PAL112: I0 Position             */\r
+#define LCD_PAL112_I0_Msk                                     (0x01UL << LCD_PAL112_I0_Pos)                             /*!< LCD PAL112: I0 Mask                 */\r
+#define LCD_PAL112_R14_0_Pos                                  16                                                        /*!< LCD PAL112: R14_0 Position          */\r
+#define LCD_PAL112_R14_0_Msk                                  (0x1fUL << LCD_PAL112_R14_0_Pos)                          /*!< LCD PAL112: R14_0 Mask              */\r
+#define LCD_PAL112_G14_0_Pos                                  21                                                        /*!< LCD PAL112: G14_0 Position          */\r
+#define LCD_PAL112_G14_0_Msk                                  (0x1fUL << LCD_PAL112_G14_0_Pos)                          /*!< LCD PAL112: G14_0 Mask              */\r
+#define LCD_PAL112_B14_0_Pos                                  26                                                        /*!< LCD PAL112: B14_0 Position          */\r
+#define LCD_PAL112_B14_0_Msk                                  (0x1fUL << LCD_PAL112_B14_0_Pos)                          /*!< LCD PAL112: B14_0 Mask              */\r
+#define LCD_PAL112_I1_Pos                                     31                                                        /*!< LCD PAL112: I1 Position             */\r
+#define LCD_PAL112_I1_Msk                                     (0x01UL << LCD_PAL112_I1_Pos)                             /*!< LCD PAL112: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL113  -------------------------------------------\r
+#define LCD_PAL113_R04_0_Pos                                  0                                                         /*!< LCD PAL113: R04_0 Position          */\r
+#define LCD_PAL113_R04_0_Msk                                  (0x1fUL << LCD_PAL113_R04_0_Pos)                          /*!< LCD PAL113: R04_0 Mask              */\r
+#define LCD_PAL113_G04_0_Pos                                  5                                                         /*!< LCD PAL113: G04_0 Position          */\r
+#define LCD_PAL113_G04_0_Msk                                  (0x1fUL << LCD_PAL113_G04_0_Pos)                          /*!< LCD PAL113: G04_0 Mask              */\r
+#define LCD_PAL113_B04_0_Pos                                  10                                                        /*!< LCD PAL113: B04_0 Position          */\r
+#define LCD_PAL113_B04_0_Msk                                  (0x1fUL << LCD_PAL113_B04_0_Pos)                          /*!< LCD PAL113: B04_0 Mask              */\r
+#define LCD_PAL113_I0_Pos                                     15                                                        /*!< LCD PAL113: I0 Position             */\r
+#define LCD_PAL113_I0_Msk                                     (0x01UL << LCD_PAL113_I0_Pos)                             /*!< LCD PAL113: I0 Mask                 */\r
+#define LCD_PAL113_R14_0_Pos                                  16                                                        /*!< LCD PAL113: R14_0 Position          */\r
+#define LCD_PAL113_R14_0_Msk                                  (0x1fUL << LCD_PAL113_R14_0_Pos)                          /*!< LCD PAL113: R14_0 Mask              */\r
+#define LCD_PAL113_G14_0_Pos                                  21                                                        /*!< LCD PAL113: G14_0 Position          */\r
+#define LCD_PAL113_G14_0_Msk                                  (0x1fUL << LCD_PAL113_G14_0_Pos)                          /*!< LCD PAL113: G14_0 Mask              */\r
+#define LCD_PAL113_B14_0_Pos                                  26                                                        /*!< LCD PAL113: B14_0 Position          */\r
+#define LCD_PAL113_B14_0_Msk                                  (0x1fUL << LCD_PAL113_B14_0_Pos)                          /*!< LCD PAL113: B14_0 Mask              */\r
+#define LCD_PAL113_I1_Pos                                     31                                                        /*!< LCD PAL113: I1 Position             */\r
+#define LCD_PAL113_I1_Msk                                     (0x01UL << LCD_PAL113_I1_Pos)                             /*!< LCD PAL113: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL114  -------------------------------------------\r
+#define LCD_PAL114_R04_0_Pos                                  0                                                         /*!< LCD PAL114: R04_0 Position          */\r
+#define LCD_PAL114_R04_0_Msk                                  (0x1fUL << LCD_PAL114_R04_0_Pos)                          /*!< LCD PAL114: R04_0 Mask              */\r
+#define LCD_PAL114_G04_0_Pos                                  5                                                         /*!< LCD PAL114: G04_0 Position          */\r
+#define LCD_PAL114_G04_0_Msk                                  (0x1fUL << LCD_PAL114_G04_0_Pos)                          /*!< LCD PAL114: G04_0 Mask              */\r
+#define LCD_PAL114_B04_0_Pos                                  10                                                        /*!< LCD PAL114: B04_0 Position          */\r
+#define LCD_PAL114_B04_0_Msk                                  (0x1fUL << LCD_PAL114_B04_0_Pos)                          /*!< LCD PAL114: B04_0 Mask              */\r
+#define LCD_PAL114_I0_Pos                                     15                                                        /*!< LCD PAL114: I0 Position             */\r
+#define LCD_PAL114_I0_Msk                                     (0x01UL << LCD_PAL114_I0_Pos)                             /*!< LCD PAL114: I0 Mask                 */\r
+#define LCD_PAL114_R14_0_Pos                                  16                                                        /*!< LCD PAL114: R14_0 Position          */\r
+#define LCD_PAL114_R14_0_Msk                                  (0x1fUL << LCD_PAL114_R14_0_Pos)                          /*!< LCD PAL114: R14_0 Mask              */\r
+#define LCD_PAL114_G14_0_Pos                                  21                                                        /*!< LCD PAL114: G14_0 Position          */\r
+#define LCD_PAL114_G14_0_Msk                                  (0x1fUL << LCD_PAL114_G14_0_Pos)                          /*!< LCD PAL114: G14_0 Mask              */\r
+#define LCD_PAL114_B14_0_Pos                                  26                                                        /*!< LCD PAL114: B14_0 Position          */\r
+#define LCD_PAL114_B14_0_Msk                                  (0x1fUL << LCD_PAL114_B14_0_Pos)                          /*!< LCD PAL114: B14_0 Mask              */\r
+#define LCD_PAL114_I1_Pos                                     31                                                        /*!< LCD PAL114: I1 Position             */\r
+#define LCD_PAL114_I1_Msk                                     (0x01UL << LCD_PAL114_I1_Pos)                             /*!< LCD PAL114: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL115  -------------------------------------------\r
+#define LCD_PAL115_R04_0_Pos                                  0                                                         /*!< LCD PAL115: R04_0 Position          */\r
+#define LCD_PAL115_R04_0_Msk                                  (0x1fUL << LCD_PAL115_R04_0_Pos)                          /*!< LCD PAL115: R04_0 Mask              */\r
+#define LCD_PAL115_G04_0_Pos                                  5                                                         /*!< LCD PAL115: G04_0 Position          */\r
+#define LCD_PAL115_G04_0_Msk                                  (0x1fUL << LCD_PAL115_G04_0_Pos)                          /*!< LCD PAL115: G04_0 Mask              */\r
+#define LCD_PAL115_B04_0_Pos                                  10                                                        /*!< LCD PAL115: B04_0 Position          */\r
+#define LCD_PAL115_B04_0_Msk                                  (0x1fUL << LCD_PAL115_B04_0_Pos)                          /*!< LCD PAL115: B04_0 Mask              */\r
+#define LCD_PAL115_I0_Pos                                     15                                                        /*!< LCD PAL115: I0 Position             */\r
+#define LCD_PAL115_I0_Msk                                     (0x01UL << LCD_PAL115_I0_Pos)                             /*!< LCD PAL115: I0 Mask                 */\r
+#define LCD_PAL115_R14_0_Pos                                  16                                                        /*!< LCD PAL115: R14_0 Position          */\r
+#define LCD_PAL115_R14_0_Msk                                  (0x1fUL << LCD_PAL115_R14_0_Pos)                          /*!< LCD PAL115: R14_0 Mask              */\r
+#define LCD_PAL115_G14_0_Pos                                  21                                                        /*!< LCD PAL115: G14_0 Position          */\r
+#define LCD_PAL115_G14_0_Msk                                  (0x1fUL << LCD_PAL115_G14_0_Pos)                          /*!< LCD PAL115: G14_0 Mask              */\r
+#define LCD_PAL115_B14_0_Pos                                  26                                                        /*!< LCD PAL115: B14_0 Position          */\r
+#define LCD_PAL115_B14_0_Msk                                  (0x1fUL << LCD_PAL115_B14_0_Pos)                          /*!< LCD PAL115: B14_0 Mask              */\r
+#define LCD_PAL115_I1_Pos                                     31                                                        /*!< LCD PAL115: I1 Position             */\r
+#define LCD_PAL115_I1_Msk                                     (0x01UL << LCD_PAL115_I1_Pos)                             /*!< LCD PAL115: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL116  -------------------------------------------\r
+#define LCD_PAL116_R04_0_Pos                                  0                                                         /*!< LCD PAL116: R04_0 Position          */\r
+#define LCD_PAL116_R04_0_Msk                                  (0x1fUL << LCD_PAL116_R04_0_Pos)                          /*!< LCD PAL116: R04_0 Mask              */\r
+#define LCD_PAL116_G04_0_Pos                                  5                                                         /*!< LCD PAL116: G04_0 Position          */\r
+#define LCD_PAL116_G04_0_Msk                                  (0x1fUL << LCD_PAL116_G04_0_Pos)                          /*!< LCD PAL116: G04_0 Mask              */\r
+#define LCD_PAL116_B04_0_Pos                                  10                                                        /*!< LCD PAL116: B04_0 Position          */\r
+#define LCD_PAL116_B04_0_Msk                                  (0x1fUL << LCD_PAL116_B04_0_Pos)                          /*!< LCD PAL116: B04_0 Mask              */\r
+#define LCD_PAL116_I0_Pos                                     15                                                        /*!< LCD PAL116: I0 Position             */\r
+#define LCD_PAL116_I0_Msk                                     (0x01UL << LCD_PAL116_I0_Pos)                             /*!< LCD PAL116: I0 Mask                 */\r
+#define LCD_PAL116_R14_0_Pos                                  16                                                        /*!< LCD PAL116: R14_0 Position          */\r
+#define LCD_PAL116_R14_0_Msk                                  (0x1fUL << LCD_PAL116_R14_0_Pos)                          /*!< LCD PAL116: R14_0 Mask              */\r
+#define LCD_PAL116_G14_0_Pos                                  21                                                        /*!< LCD PAL116: G14_0 Position          */\r
+#define LCD_PAL116_G14_0_Msk                                  (0x1fUL << LCD_PAL116_G14_0_Pos)                          /*!< LCD PAL116: G14_0 Mask              */\r
+#define LCD_PAL116_B14_0_Pos                                  26                                                        /*!< LCD PAL116: B14_0 Position          */\r
+#define LCD_PAL116_B14_0_Msk                                  (0x1fUL << LCD_PAL116_B14_0_Pos)                          /*!< LCD PAL116: B14_0 Mask              */\r
+#define LCD_PAL116_I1_Pos                                     31                                                        /*!< LCD PAL116: I1 Position             */\r
+#define LCD_PAL116_I1_Msk                                     (0x01UL << LCD_PAL116_I1_Pos)                             /*!< LCD PAL116: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL117  -------------------------------------------\r
+#define LCD_PAL117_R04_0_Pos                                  0                                                         /*!< LCD PAL117: R04_0 Position          */\r
+#define LCD_PAL117_R04_0_Msk                                  (0x1fUL << LCD_PAL117_R04_0_Pos)                          /*!< LCD PAL117: R04_0 Mask              */\r
+#define LCD_PAL117_G04_0_Pos                                  5                                                         /*!< LCD PAL117: G04_0 Position          */\r
+#define LCD_PAL117_G04_0_Msk                                  (0x1fUL << LCD_PAL117_G04_0_Pos)                          /*!< LCD PAL117: G04_0 Mask              */\r
+#define LCD_PAL117_B04_0_Pos                                  10                                                        /*!< LCD PAL117: B04_0 Position          */\r
+#define LCD_PAL117_B04_0_Msk                                  (0x1fUL << LCD_PAL117_B04_0_Pos)                          /*!< LCD PAL117: B04_0 Mask              */\r
+#define LCD_PAL117_I0_Pos                                     15                                                        /*!< LCD PAL117: I0 Position             */\r
+#define LCD_PAL117_I0_Msk                                     (0x01UL << LCD_PAL117_I0_Pos)                             /*!< LCD PAL117: I0 Mask                 */\r
+#define LCD_PAL117_R14_0_Pos                                  16                                                        /*!< LCD PAL117: R14_0 Position          */\r
+#define LCD_PAL117_R14_0_Msk                                  (0x1fUL << LCD_PAL117_R14_0_Pos)                          /*!< LCD PAL117: R14_0 Mask              */\r
+#define LCD_PAL117_G14_0_Pos                                  21                                                        /*!< LCD PAL117: G14_0 Position          */\r
+#define LCD_PAL117_G14_0_Msk                                  (0x1fUL << LCD_PAL117_G14_0_Pos)                          /*!< LCD PAL117: G14_0 Mask              */\r
+#define LCD_PAL117_B14_0_Pos                                  26                                                        /*!< LCD PAL117: B14_0 Position          */\r
+#define LCD_PAL117_B14_0_Msk                                  (0x1fUL << LCD_PAL117_B14_0_Pos)                          /*!< LCD PAL117: B14_0 Mask              */\r
+#define LCD_PAL117_I1_Pos                                     31                                                        /*!< LCD PAL117: I1 Position             */\r
+#define LCD_PAL117_I1_Msk                                     (0x01UL << LCD_PAL117_I1_Pos)                             /*!< LCD PAL117: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL118  -------------------------------------------\r
+#define LCD_PAL118_R04_0_Pos                                  0                                                         /*!< LCD PAL118: R04_0 Position          */\r
+#define LCD_PAL118_R04_0_Msk                                  (0x1fUL << LCD_PAL118_R04_0_Pos)                          /*!< LCD PAL118: R04_0 Mask              */\r
+#define LCD_PAL118_G04_0_Pos                                  5                                                         /*!< LCD PAL118: G04_0 Position          */\r
+#define LCD_PAL118_G04_0_Msk                                  (0x1fUL << LCD_PAL118_G04_0_Pos)                          /*!< LCD PAL118: G04_0 Mask              */\r
+#define LCD_PAL118_B04_0_Pos                                  10                                                        /*!< LCD PAL118: B04_0 Position          */\r
+#define LCD_PAL118_B04_0_Msk                                  (0x1fUL << LCD_PAL118_B04_0_Pos)                          /*!< LCD PAL118: B04_0 Mask              */\r
+#define LCD_PAL118_I0_Pos                                     15                                                        /*!< LCD PAL118: I0 Position             */\r
+#define LCD_PAL118_I0_Msk                                     (0x01UL << LCD_PAL118_I0_Pos)                             /*!< LCD PAL118: I0 Mask                 */\r
+#define LCD_PAL118_R14_0_Pos                                  16                                                        /*!< LCD PAL118: R14_0 Position          */\r
+#define LCD_PAL118_R14_0_Msk                                  (0x1fUL << LCD_PAL118_R14_0_Pos)                          /*!< LCD PAL118: R14_0 Mask              */\r
+#define LCD_PAL118_G14_0_Pos                                  21                                                        /*!< LCD PAL118: G14_0 Position          */\r
+#define LCD_PAL118_G14_0_Msk                                  (0x1fUL << LCD_PAL118_G14_0_Pos)                          /*!< LCD PAL118: G14_0 Mask              */\r
+#define LCD_PAL118_B14_0_Pos                                  26                                                        /*!< LCD PAL118: B14_0 Position          */\r
+#define LCD_PAL118_B14_0_Msk                                  (0x1fUL << LCD_PAL118_B14_0_Pos)                          /*!< LCD PAL118: B14_0 Mask              */\r
+#define LCD_PAL118_I1_Pos                                     31                                                        /*!< LCD PAL118: I1 Position             */\r
+#define LCD_PAL118_I1_Msk                                     (0x01UL << LCD_PAL118_I1_Pos)                             /*!< LCD PAL118: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL119  -------------------------------------------\r
+#define LCD_PAL119_R04_0_Pos                                  0                                                         /*!< LCD PAL119: R04_0 Position          */\r
+#define LCD_PAL119_R04_0_Msk                                  (0x1fUL << LCD_PAL119_R04_0_Pos)                          /*!< LCD PAL119: R04_0 Mask              */\r
+#define LCD_PAL119_G04_0_Pos                                  5                                                         /*!< LCD PAL119: G04_0 Position          */\r
+#define LCD_PAL119_G04_0_Msk                                  (0x1fUL << LCD_PAL119_G04_0_Pos)                          /*!< LCD PAL119: G04_0 Mask              */\r
+#define LCD_PAL119_B04_0_Pos                                  10                                                        /*!< LCD PAL119: B04_0 Position          */\r
+#define LCD_PAL119_B04_0_Msk                                  (0x1fUL << LCD_PAL119_B04_0_Pos)                          /*!< LCD PAL119: B04_0 Mask              */\r
+#define LCD_PAL119_I0_Pos                                     15                                                        /*!< LCD PAL119: I0 Position             */\r
+#define LCD_PAL119_I0_Msk                                     (0x01UL << LCD_PAL119_I0_Pos)                             /*!< LCD PAL119: I0 Mask                 */\r
+#define LCD_PAL119_R14_0_Pos                                  16                                                        /*!< LCD PAL119: R14_0 Position          */\r
+#define LCD_PAL119_R14_0_Msk                                  (0x1fUL << LCD_PAL119_R14_0_Pos)                          /*!< LCD PAL119: R14_0 Mask              */\r
+#define LCD_PAL119_G14_0_Pos                                  21                                                        /*!< LCD PAL119: G14_0 Position          */\r
+#define LCD_PAL119_G14_0_Msk                                  (0x1fUL << LCD_PAL119_G14_0_Pos)                          /*!< LCD PAL119: G14_0 Mask              */\r
+#define LCD_PAL119_B14_0_Pos                                  26                                                        /*!< LCD PAL119: B14_0 Position          */\r
+#define LCD_PAL119_B14_0_Msk                                  (0x1fUL << LCD_PAL119_B14_0_Pos)                          /*!< LCD PAL119: B14_0 Mask              */\r
+#define LCD_PAL119_I1_Pos                                     31                                                        /*!< LCD PAL119: I1 Position             */\r
+#define LCD_PAL119_I1_Msk                                     (0x01UL << LCD_PAL119_I1_Pos)                             /*!< LCD PAL119: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL120  -------------------------------------------\r
+#define LCD_PAL120_R04_0_Pos                                  0                                                         /*!< LCD PAL120: R04_0 Position          */\r
+#define LCD_PAL120_R04_0_Msk                                  (0x1fUL << LCD_PAL120_R04_0_Pos)                          /*!< LCD PAL120: R04_0 Mask              */\r
+#define LCD_PAL120_G04_0_Pos                                  5                                                         /*!< LCD PAL120: G04_0 Position          */\r
+#define LCD_PAL120_G04_0_Msk                                  (0x1fUL << LCD_PAL120_G04_0_Pos)                          /*!< LCD PAL120: G04_0 Mask              */\r
+#define LCD_PAL120_B04_0_Pos                                  10                                                        /*!< LCD PAL120: B04_0 Position          */\r
+#define LCD_PAL120_B04_0_Msk                                  (0x1fUL << LCD_PAL120_B04_0_Pos)                          /*!< LCD PAL120: B04_0 Mask              */\r
+#define LCD_PAL120_I0_Pos                                     15                                                        /*!< LCD PAL120: I0 Position             */\r
+#define LCD_PAL120_I0_Msk                                     (0x01UL << LCD_PAL120_I0_Pos)                             /*!< LCD PAL120: I0 Mask                 */\r
+#define LCD_PAL120_R14_0_Pos                                  16                                                        /*!< LCD PAL120: R14_0 Position          */\r
+#define LCD_PAL120_R14_0_Msk                                  (0x1fUL << LCD_PAL120_R14_0_Pos)                          /*!< LCD PAL120: R14_0 Mask              */\r
+#define LCD_PAL120_G14_0_Pos                                  21                                                        /*!< LCD PAL120: G14_0 Position          */\r
+#define LCD_PAL120_G14_0_Msk                                  (0x1fUL << LCD_PAL120_G14_0_Pos)                          /*!< LCD PAL120: G14_0 Mask              */\r
+#define LCD_PAL120_B14_0_Pos                                  26                                                        /*!< LCD PAL120: B14_0 Position          */\r
+#define LCD_PAL120_B14_0_Msk                                  (0x1fUL << LCD_PAL120_B14_0_Pos)                          /*!< LCD PAL120: B14_0 Mask              */\r
+#define LCD_PAL120_I1_Pos                                     31                                                        /*!< LCD PAL120: I1 Position             */\r
+#define LCD_PAL120_I1_Msk                                     (0x01UL << LCD_PAL120_I1_Pos)                             /*!< LCD PAL120: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL121  -------------------------------------------\r
+#define LCD_PAL121_R04_0_Pos                                  0                                                         /*!< LCD PAL121: R04_0 Position          */\r
+#define LCD_PAL121_R04_0_Msk                                  (0x1fUL << LCD_PAL121_R04_0_Pos)                          /*!< LCD PAL121: R04_0 Mask              */\r
+#define LCD_PAL121_G04_0_Pos                                  5                                                         /*!< LCD PAL121: G04_0 Position          */\r
+#define LCD_PAL121_G04_0_Msk                                  (0x1fUL << LCD_PAL121_G04_0_Pos)                          /*!< LCD PAL121: G04_0 Mask              */\r
+#define LCD_PAL121_B04_0_Pos                                  10                                                        /*!< LCD PAL121: B04_0 Position          */\r
+#define LCD_PAL121_B04_0_Msk                                  (0x1fUL << LCD_PAL121_B04_0_Pos)                          /*!< LCD PAL121: B04_0 Mask              */\r
+#define LCD_PAL121_I0_Pos                                     15                                                        /*!< LCD PAL121: I0 Position             */\r
+#define LCD_PAL121_I0_Msk                                     (0x01UL << LCD_PAL121_I0_Pos)                             /*!< LCD PAL121: I0 Mask                 */\r
+#define LCD_PAL121_R14_0_Pos                                  16                                                        /*!< LCD PAL121: R14_0 Position          */\r
+#define LCD_PAL121_R14_0_Msk                                  (0x1fUL << LCD_PAL121_R14_0_Pos)                          /*!< LCD PAL121: R14_0 Mask              */\r
+#define LCD_PAL121_G14_0_Pos                                  21                                                        /*!< LCD PAL121: G14_0 Position          */\r
+#define LCD_PAL121_G14_0_Msk                                  (0x1fUL << LCD_PAL121_G14_0_Pos)                          /*!< LCD PAL121: G14_0 Mask              */\r
+#define LCD_PAL121_B14_0_Pos                                  26                                                        /*!< LCD PAL121: B14_0 Position          */\r
+#define LCD_PAL121_B14_0_Msk                                  (0x1fUL << LCD_PAL121_B14_0_Pos)                          /*!< LCD PAL121: B14_0 Mask              */\r
+#define LCD_PAL121_I1_Pos                                     31                                                        /*!< LCD PAL121: I1 Position             */\r
+#define LCD_PAL121_I1_Msk                                     (0x01UL << LCD_PAL121_I1_Pos)                             /*!< LCD PAL121: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL122  -------------------------------------------\r
+#define LCD_PAL122_R04_0_Pos                                  0                                                         /*!< LCD PAL122: R04_0 Position          */\r
+#define LCD_PAL122_R04_0_Msk                                  (0x1fUL << LCD_PAL122_R04_0_Pos)                          /*!< LCD PAL122: R04_0 Mask              */\r
+#define LCD_PAL122_G04_0_Pos                                  5                                                         /*!< LCD PAL122: G04_0 Position          */\r
+#define LCD_PAL122_G04_0_Msk                                  (0x1fUL << LCD_PAL122_G04_0_Pos)                          /*!< LCD PAL122: G04_0 Mask              */\r
+#define LCD_PAL122_B04_0_Pos                                  10                                                        /*!< LCD PAL122: B04_0 Position          */\r
+#define LCD_PAL122_B04_0_Msk                                  (0x1fUL << LCD_PAL122_B04_0_Pos)                          /*!< LCD PAL122: B04_0 Mask              */\r
+#define LCD_PAL122_I0_Pos                                     15                                                        /*!< LCD PAL122: I0 Position             */\r
+#define LCD_PAL122_I0_Msk                                     (0x01UL << LCD_PAL122_I0_Pos)                             /*!< LCD PAL122: I0 Mask                 */\r
+#define LCD_PAL122_R14_0_Pos                                  16                                                        /*!< LCD PAL122: R14_0 Position          */\r
+#define LCD_PAL122_R14_0_Msk                                  (0x1fUL << LCD_PAL122_R14_0_Pos)                          /*!< LCD PAL122: R14_0 Mask              */\r
+#define LCD_PAL122_G14_0_Pos                                  21                                                        /*!< LCD PAL122: G14_0 Position          */\r
+#define LCD_PAL122_G14_0_Msk                                  (0x1fUL << LCD_PAL122_G14_0_Pos)                          /*!< LCD PAL122: G14_0 Mask              */\r
+#define LCD_PAL122_B14_0_Pos                                  26                                                        /*!< LCD PAL122: B14_0 Position          */\r
+#define LCD_PAL122_B14_0_Msk                                  (0x1fUL << LCD_PAL122_B14_0_Pos)                          /*!< LCD PAL122: B14_0 Mask              */\r
+#define LCD_PAL122_I1_Pos                                     31                                                        /*!< LCD PAL122: I1 Position             */\r
+#define LCD_PAL122_I1_Msk                                     (0x01UL << LCD_PAL122_I1_Pos)                             /*!< LCD PAL122: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL123  -------------------------------------------\r
+#define LCD_PAL123_R04_0_Pos                                  0                                                         /*!< LCD PAL123: R04_0 Position          */\r
+#define LCD_PAL123_R04_0_Msk                                  (0x1fUL << LCD_PAL123_R04_0_Pos)                          /*!< LCD PAL123: R04_0 Mask              */\r
+#define LCD_PAL123_G04_0_Pos                                  5                                                         /*!< LCD PAL123: G04_0 Position          */\r
+#define LCD_PAL123_G04_0_Msk                                  (0x1fUL << LCD_PAL123_G04_0_Pos)                          /*!< LCD PAL123: G04_0 Mask              */\r
+#define LCD_PAL123_B04_0_Pos                                  10                                                        /*!< LCD PAL123: B04_0 Position          */\r
+#define LCD_PAL123_B04_0_Msk                                  (0x1fUL << LCD_PAL123_B04_0_Pos)                          /*!< LCD PAL123: B04_0 Mask              */\r
+#define LCD_PAL123_I0_Pos                                     15                                                        /*!< LCD PAL123: I0 Position             */\r
+#define LCD_PAL123_I0_Msk                                     (0x01UL << LCD_PAL123_I0_Pos)                             /*!< LCD PAL123: I0 Mask                 */\r
+#define LCD_PAL123_R14_0_Pos                                  16                                                        /*!< LCD PAL123: R14_0 Position          */\r
+#define LCD_PAL123_R14_0_Msk                                  (0x1fUL << LCD_PAL123_R14_0_Pos)                          /*!< LCD PAL123: R14_0 Mask              */\r
+#define LCD_PAL123_G14_0_Pos                                  21                                                        /*!< LCD PAL123: G14_0 Position          */\r
+#define LCD_PAL123_G14_0_Msk                                  (0x1fUL << LCD_PAL123_G14_0_Pos)                          /*!< LCD PAL123: G14_0 Mask              */\r
+#define LCD_PAL123_B14_0_Pos                                  26                                                        /*!< LCD PAL123: B14_0 Position          */\r
+#define LCD_PAL123_B14_0_Msk                                  (0x1fUL << LCD_PAL123_B14_0_Pos)                          /*!< LCD PAL123: B14_0 Mask              */\r
+#define LCD_PAL123_I1_Pos                                     31                                                        /*!< LCD PAL123: I1 Position             */\r
+#define LCD_PAL123_I1_Msk                                     (0x01UL << LCD_PAL123_I1_Pos)                             /*!< LCD PAL123: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL124  -------------------------------------------\r
+#define LCD_PAL124_R04_0_Pos                                  0                                                         /*!< LCD PAL124: R04_0 Position          */\r
+#define LCD_PAL124_R04_0_Msk                                  (0x1fUL << LCD_PAL124_R04_0_Pos)                          /*!< LCD PAL124: R04_0 Mask              */\r
+#define LCD_PAL124_G04_0_Pos                                  5                                                         /*!< LCD PAL124: G04_0 Position          */\r
+#define LCD_PAL124_G04_0_Msk                                  (0x1fUL << LCD_PAL124_G04_0_Pos)                          /*!< LCD PAL124: G04_0 Mask              */\r
+#define LCD_PAL124_B04_0_Pos                                  10                                                        /*!< LCD PAL124: B04_0 Position          */\r
+#define LCD_PAL124_B04_0_Msk                                  (0x1fUL << LCD_PAL124_B04_0_Pos)                          /*!< LCD PAL124: B04_0 Mask              */\r
+#define LCD_PAL124_I0_Pos                                     15                                                        /*!< LCD PAL124: I0 Position             */\r
+#define LCD_PAL124_I0_Msk                                     (0x01UL << LCD_PAL124_I0_Pos)                             /*!< LCD PAL124: I0 Mask                 */\r
+#define LCD_PAL124_R14_0_Pos                                  16                                                        /*!< LCD PAL124: R14_0 Position          */\r
+#define LCD_PAL124_R14_0_Msk                                  (0x1fUL << LCD_PAL124_R14_0_Pos)                          /*!< LCD PAL124: R14_0 Mask              */\r
+#define LCD_PAL124_G14_0_Pos                                  21                                                        /*!< LCD PAL124: G14_0 Position          */\r
+#define LCD_PAL124_G14_0_Msk                                  (0x1fUL << LCD_PAL124_G14_0_Pos)                          /*!< LCD PAL124: G14_0 Mask              */\r
+#define LCD_PAL124_B14_0_Pos                                  26                                                        /*!< LCD PAL124: B14_0 Position          */\r
+#define LCD_PAL124_B14_0_Msk                                  (0x1fUL << LCD_PAL124_B14_0_Pos)                          /*!< LCD PAL124: B14_0 Mask              */\r
+#define LCD_PAL124_I1_Pos                                     31                                                        /*!< LCD PAL124: I1 Position             */\r
+#define LCD_PAL124_I1_Msk                                     (0x01UL << LCD_PAL124_I1_Pos)                             /*!< LCD PAL124: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL125  -------------------------------------------\r
+#define LCD_PAL125_R04_0_Pos                                  0                                                         /*!< LCD PAL125: R04_0 Position          */\r
+#define LCD_PAL125_R04_0_Msk                                  (0x1fUL << LCD_PAL125_R04_0_Pos)                          /*!< LCD PAL125: R04_0 Mask              */\r
+#define LCD_PAL125_G04_0_Pos                                  5                                                         /*!< LCD PAL125: G04_0 Position          */\r
+#define LCD_PAL125_G04_0_Msk                                  (0x1fUL << LCD_PAL125_G04_0_Pos)                          /*!< LCD PAL125: G04_0 Mask              */\r
+#define LCD_PAL125_B04_0_Pos                                  10                                                        /*!< LCD PAL125: B04_0 Position          */\r
+#define LCD_PAL125_B04_0_Msk                                  (0x1fUL << LCD_PAL125_B04_0_Pos)                          /*!< LCD PAL125: B04_0 Mask              */\r
+#define LCD_PAL125_I0_Pos                                     15                                                        /*!< LCD PAL125: I0 Position             */\r
+#define LCD_PAL125_I0_Msk                                     (0x01UL << LCD_PAL125_I0_Pos)                             /*!< LCD PAL125: I0 Mask                 */\r
+#define LCD_PAL125_R14_0_Pos                                  16                                                        /*!< LCD PAL125: R14_0 Position          */\r
+#define LCD_PAL125_R14_0_Msk                                  (0x1fUL << LCD_PAL125_R14_0_Pos)                          /*!< LCD PAL125: R14_0 Mask              */\r
+#define LCD_PAL125_G14_0_Pos                                  21                                                        /*!< LCD PAL125: G14_0 Position          */\r
+#define LCD_PAL125_G14_0_Msk                                  (0x1fUL << LCD_PAL125_G14_0_Pos)                          /*!< LCD PAL125: G14_0 Mask              */\r
+#define LCD_PAL125_B14_0_Pos                                  26                                                        /*!< LCD PAL125: B14_0 Position          */\r
+#define LCD_PAL125_B14_0_Msk                                  (0x1fUL << LCD_PAL125_B14_0_Pos)                          /*!< LCD PAL125: B14_0 Mask              */\r
+#define LCD_PAL125_I1_Pos                                     31                                                        /*!< LCD PAL125: I1 Position             */\r
+#define LCD_PAL125_I1_Msk                                     (0x01UL << LCD_PAL125_I1_Pos)                             /*!< LCD PAL125: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL126  -------------------------------------------\r
+#define LCD_PAL126_R04_0_Pos                                  0                                                         /*!< LCD PAL126: R04_0 Position          */\r
+#define LCD_PAL126_R04_0_Msk                                  (0x1fUL << LCD_PAL126_R04_0_Pos)                          /*!< LCD PAL126: R04_0 Mask              */\r
+#define LCD_PAL126_G04_0_Pos                                  5                                                         /*!< LCD PAL126: G04_0 Position          */\r
+#define LCD_PAL126_G04_0_Msk                                  (0x1fUL << LCD_PAL126_G04_0_Pos)                          /*!< LCD PAL126: G04_0 Mask              */\r
+#define LCD_PAL126_B04_0_Pos                                  10                                                        /*!< LCD PAL126: B04_0 Position          */\r
+#define LCD_PAL126_B04_0_Msk                                  (0x1fUL << LCD_PAL126_B04_0_Pos)                          /*!< LCD PAL126: B04_0 Mask              */\r
+#define LCD_PAL126_I0_Pos                                     15                                                        /*!< LCD PAL126: I0 Position             */\r
+#define LCD_PAL126_I0_Msk                                     (0x01UL << LCD_PAL126_I0_Pos)                             /*!< LCD PAL126: I0 Mask                 */\r
+#define LCD_PAL126_R14_0_Pos                                  16                                                        /*!< LCD PAL126: R14_0 Position          */\r
+#define LCD_PAL126_R14_0_Msk                                  (0x1fUL << LCD_PAL126_R14_0_Pos)                          /*!< LCD PAL126: R14_0 Mask              */\r
+#define LCD_PAL126_G14_0_Pos                                  21                                                        /*!< LCD PAL126: G14_0 Position          */\r
+#define LCD_PAL126_G14_0_Msk                                  (0x1fUL << LCD_PAL126_G14_0_Pos)                          /*!< LCD PAL126: G14_0 Mask              */\r
+#define LCD_PAL126_B14_0_Pos                                  26                                                        /*!< LCD PAL126: B14_0 Position          */\r
+#define LCD_PAL126_B14_0_Msk                                  (0x1fUL << LCD_PAL126_B14_0_Pos)                          /*!< LCD PAL126: B14_0 Mask              */\r
+#define LCD_PAL126_I1_Pos                                     31                                                        /*!< LCD PAL126: I1 Position             */\r
+#define LCD_PAL126_I1_Msk                                     (0x01UL << LCD_PAL126_I1_Pos)                             /*!< LCD PAL126: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL127  -------------------------------------------\r
+#define LCD_PAL127_R04_0_Pos                                  0                                                         /*!< LCD PAL127: R04_0 Position          */\r
+#define LCD_PAL127_R04_0_Msk                                  (0x1fUL << LCD_PAL127_R04_0_Pos)                          /*!< LCD PAL127: R04_0 Mask              */\r
+#define LCD_PAL127_G04_0_Pos                                  5                                                         /*!< LCD PAL127: G04_0 Position          */\r
+#define LCD_PAL127_G04_0_Msk                                  (0x1fUL << LCD_PAL127_G04_0_Pos)                          /*!< LCD PAL127: G04_0 Mask              */\r
+#define LCD_PAL127_B04_0_Pos                                  10                                                        /*!< LCD PAL127: B04_0 Position          */\r
+#define LCD_PAL127_B04_0_Msk                                  (0x1fUL << LCD_PAL127_B04_0_Pos)                          /*!< LCD PAL127: B04_0 Mask              */\r
+#define LCD_PAL127_I0_Pos                                     15                                                        /*!< LCD PAL127: I0 Position             */\r
+#define LCD_PAL127_I0_Msk                                     (0x01UL << LCD_PAL127_I0_Pos)                             /*!< LCD PAL127: I0 Mask                 */\r
+#define LCD_PAL127_R14_0_Pos                                  16                                                        /*!< LCD PAL127: R14_0 Position          */\r
+#define LCD_PAL127_R14_0_Msk                                  (0x1fUL << LCD_PAL127_R14_0_Pos)                          /*!< LCD PAL127: R14_0 Mask              */\r
+#define LCD_PAL127_G14_0_Pos                                  21                                                        /*!< LCD PAL127: G14_0 Position          */\r
+#define LCD_PAL127_G14_0_Msk                                  (0x1fUL << LCD_PAL127_G14_0_Pos)                          /*!< LCD PAL127: G14_0 Mask              */\r
+#define LCD_PAL127_B14_0_Pos                                  26                                                        /*!< LCD PAL127: B14_0 Position          */\r
+#define LCD_PAL127_B14_0_Msk                                  (0x1fUL << LCD_PAL127_B14_0_Pos)                          /*!< LCD PAL127: B14_0 Mask              */\r
+#define LCD_PAL127_I1_Pos                                     31                                                        /*!< LCD PAL127: I1 Position             */\r
+#define LCD_PAL127_I1_Msk                                     (0x01UL << LCD_PAL127_I1_Pos)                             /*!< LCD PAL127: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL128  -------------------------------------------\r
+#define LCD_PAL128_R04_0_Pos                                  0                                                         /*!< LCD PAL128: R04_0 Position          */\r
+#define LCD_PAL128_R04_0_Msk                                  (0x1fUL << LCD_PAL128_R04_0_Pos)                          /*!< LCD PAL128: R04_0 Mask              */\r
+#define LCD_PAL128_G04_0_Pos                                  5                                                         /*!< LCD PAL128: G04_0 Position          */\r
+#define LCD_PAL128_G04_0_Msk                                  (0x1fUL << LCD_PAL128_G04_0_Pos)                          /*!< LCD PAL128: G04_0 Mask              */\r
+#define LCD_PAL128_B04_0_Pos                                  10                                                        /*!< LCD PAL128: B04_0 Position          */\r
+#define LCD_PAL128_B04_0_Msk                                  (0x1fUL << LCD_PAL128_B04_0_Pos)                          /*!< LCD PAL128: B04_0 Mask              */\r
+#define LCD_PAL128_I0_Pos                                     15                                                        /*!< LCD PAL128: I0 Position             */\r
+#define LCD_PAL128_I0_Msk                                     (0x01UL << LCD_PAL128_I0_Pos)                             /*!< LCD PAL128: I0 Mask                 */\r
+#define LCD_PAL128_R14_0_Pos                                  16                                                        /*!< LCD PAL128: R14_0 Position          */\r
+#define LCD_PAL128_R14_0_Msk                                  (0x1fUL << LCD_PAL128_R14_0_Pos)                          /*!< LCD PAL128: R14_0 Mask              */\r
+#define LCD_PAL128_G14_0_Pos                                  21                                                        /*!< LCD PAL128: G14_0 Position          */\r
+#define LCD_PAL128_G14_0_Msk                                  (0x1fUL << LCD_PAL128_G14_0_Pos)                          /*!< LCD PAL128: G14_0 Mask              */\r
+#define LCD_PAL128_B14_0_Pos                                  26                                                        /*!< LCD PAL128: B14_0 Position          */\r
+#define LCD_PAL128_B14_0_Msk                                  (0x1fUL << LCD_PAL128_B14_0_Pos)                          /*!< LCD PAL128: B14_0 Mask              */\r
+#define LCD_PAL128_I1_Pos                                     31                                                        /*!< LCD PAL128: I1 Position             */\r
+#define LCD_PAL128_I1_Msk                                     (0x01UL << LCD_PAL128_I1_Pos)                             /*!< LCD PAL128: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL129  -------------------------------------------\r
+#define LCD_PAL129_R04_0_Pos                                  0                                                         /*!< LCD PAL129: R04_0 Position          */\r
+#define LCD_PAL129_R04_0_Msk                                  (0x1fUL << LCD_PAL129_R04_0_Pos)                          /*!< LCD PAL129: R04_0 Mask              */\r
+#define LCD_PAL129_G04_0_Pos                                  5                                                         /*!< LCD PAL129: G04_0 Position          */\r
+#define LCD_PAL129_G04_0_Msk                                  (0x1fUL << LCD_PAL129_G04_0_Pos)                          /*!< LCD PAL129: G04_0 Mask              */\r
+#define LCD_PAL129_B04_0_Pos                                  10                                                        /*!< LCD PAL129: B04_0 Position          */\r
+#define LCD_PAL129_B04_0_Msk                                  (0x1fUL << LCD_PAL129_B04_0_Pos)                          /*!< LCD PAL129: B04_0 Mask              */\r
+#define LCD_PAL129_I0_Pos                                     15                                                        /*!< LCD PAL129: I0 Position             */\r
+#define LCD_PAL129_I0_Msk                                     (0x01UL << LCD_PAL129_I0_Pos)                             /*!< LCD PAL129: I0 Mask                 */\r
+#define LCD_PAL129_R14_0_Pos                                  16                                                        /*!< LCD PAL129: R14_0 Position          */\r
+#define LCD_PAL129_R14_0_Msk                                  (0x1fUL << LCD_PAL129_R14_0_Pos)                          /*!< LCD PAL129: R14_0 Mask              */\r
+#define LCD_PAL129_G14_0_Pos                                  21                                                        /*!< LCD PAL129: G14_0 Position          */\r
+#define LCD_PAL129_G14_0_Msk                                  (0x1fUL << LCD_PAL129_G14_0_Pos)                          /*!< LCD PAL129: G14_0 Mask              */\r
+#define LCD_PAL129_B14_0_Pos                                  26                                                        /*!< LCD PAL129: B14_0 Position          */\r
+#define LCD_PAL129_B14_0_Msk                                  (0x1fUL << LCD_PAL129_B14_0_Pos)                          /*!< LCD PAL129: B14_0 Mask              */\r
+#define LCD_PAL129_I1_Pos                                     31                                                        /*!< LCD PAL129: I1 Position             */\r
+#define LCD_PAL129_I1_Msk                                     (0x01UL << LCD_PAL129_I1_Pos)                             /*!< LCD PAL129: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL130  -------------------------------------------\r
+#define LCD_PAL130_R04_0_Pos                                  0                                                         /*!< LCD PAL130: R04_0 Position          */\r
+#define LCD_PAL130_R04_0_Msk                                  (0x1fUL << LCD_PAL130_R04_0_Pos)                          /*!< LCD PAL130: R04_0 Mask              */\r
+#define LCD_PAL130_G04_0_Pos                                  5                                                         /*!< LCD PAL130: G04_0 Position          */\r
+#define LCD_PAL130_G04_0_Msk                                  (0x1fUL << LCD_PAL130_G04_0_Pos)                          /*!< LCD PAL130: G04_0 Mask              */\r
+#define LCD_PAL130_B04_0_Pos                                  10                                                        /*!< LCD PAL130: B04_0 Position          */\r
+#define LCD_PAL130_B04_0_Msk                                  (0x1fUL << LCD_PAL130_B04_0_Pos)                          /*!< LCD PAL130: B04_0 Mask              */\r
+#define LCD_PAL130_I0_Pos                                     15                                                        /*!< LCD PAL130: I0 Position             */\r
+#define LCD_PAL130_I0_Msk                                     (0x01UL << LCD_PAL130_I0_Pos)                             /*!< LCD PAL130: I0 Mask                 */\r
+#define LCD_PAL130_R14_0_Pos                                  16                                                        /*!< LCD PAL130: R14_0 Position          */\r
+#define LCD_PAL130_R14_0_Msk                                  (0x1fUL << LCD_PAL130_R14_0_Pos)                          /*!< LCD PAL130: R14_0 Mask              */\r
+#define LCD_PAL130_G14_0_Pos                                  21                                                        /*!< LCD PAL130: G14_0 Position          */\r
+#define LCD_PAL130_G14_0_Msk                                  (0x1fUL << LCD_PAL130_G14_0_Pos)                          /*!< LCD PAL130: G14_0 Mask              */\r
+#define LCD_PAL130_B14_0_Pos                                  26                                                        /*!< LCD PAL130: B14_0 Position          */\r
+#define LCD_PAL130_B14_0_Msk                                  (0x1fUL << LCD_PAL130_B14_0_Pos)                          /*!< LCD PAL130: B14_0 Mask              */\r
+#define LCD_PAL130_I1_Pos                                     31                                                        /*!< LCD PAL130: I1 Position             */\r
+#define LCD_PAL130_I1_Msk                                     (0x01UL << LCD_PAL130_I1_Pos)                             /*!< LCD PAL130: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL131  -------------------------------------------\r
+#define LCD_PAL131_R04_0_Pos                                  0                                                         /*!< LCD PAL131: R04_0 Position          */\r
+#define LCD_PAL131_R04_0_Msk                                  (0x1fUL << LCD_PAL131_R04_0_Pos)                          /*!< LCD PAL131: R04_0 Mask              */\r
+#define LCD_PAL131_G04_0_Pos                                  5                                                         /*!< LCD PAL131: G04_0 Position          */\r
+#define LCD_PAL131_G04_0_Msk                                  (0x1fUL << LCD_PAL131_G04_0_Pos)                          /*!< LCD PAL131: G04_0 Mask              */\r
+#define LCD_PAL131_B04_0_Pos                                  10                                                        /*!< LCD PAL131: B04_0 Position          */\r
+#define LCD_PAL131_B04_0_Msk                                  (0x1fUL << LCD_PAL131_B04_0_Pos)                          /*!< LCD PAL131: B04_0 Mask              */\r
+#define LCD_PAL131_I0_Pos                                     15                                                        /*!< LCD PAL131: I0 Position             */\r
+#define LCD_PAL131_I0_Msk                                     (0x01UL << LCD_PAL131_I0_Pos)                             /*!< LCD PAL131: I0 Mask                 */\r
+#define LCD_PAL131_R14_0_Pos                                  16                                                        /*!< LCD PAL131: R14_0 Position          */\r
+#define LCD_PAL131_R14_0_Msk                                  (0x1fUL << LCD_PAL131_R14_0_Pos)                          /*!< LCD PAL131: R14_0 Mask              */\r
+#define LCD_PAL131_G14_0_Pos                                  21                                                        /*!< LCD PAL131: G14_0 Position          */\r
+#define LCD_PAL131_G14_0_Msk                                  (0x1fUL << LCD_PAL131_G14_0_Pos)                          /*!< LCD PAL131: G14_0 Mask              */\r
+#define LCD_PAL131_B14_0_Pos                                  26                                                        /*!< LCD PAL131: B14_0 Position          */\r
+#define LCD_PAL131_B14_0_Msk                                  (0x1fUL << LCD_PAL131_B14_0_Pos)                          /*!< LCD PAL131: B14_0 Mask              */\r
+#define LCD_PAL131_I1_Pos                                     31                                                        /*!< LCD PAL131: I1 Position             */\r
+#define LCD_PAL131_I1_Msk                                     (0x01UL << LCD_PAL131_I1_Pos)                             /*!< LCD PAL131: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL132  -------------------------------------------\r
+#define LCD_PAL132_R04_0_Pos                                  0                                                         /*!< LCD PAL132: R04_0 Position          */\r
+#define LCD_PAL132_R04_0_Msk                                  (0x1fUL << LCD_PAL132_R04_0_Pos)                          /*!< LCD PAL132: R04_0 Mask              */\r
+#define LCD_PAL132_G04_0_Pos                                  5                                                         /*!< LCD PAL132: G04_0 Position          */\r
+#define LCD_PAL132_G04_0_Msk                                  (0x1fUL << LCD_PAL132_G04_0_Pos)                          /*!< LCD PAL132: G04_0 Mask              */\r
+#define LCD_PAL132_B04_0_Pos                                  10                                                        /*!< LCD PAL132: B04_0 Position          */\r
+#define LCD_PAL132_B04_0_Msk                                  (0x1fUL << LCD_PAL132_B04_0_Pos)                          /*!< LCD PAL132: B04_0 Mask              */\r
+#define LCD_PAL132_I0_Pos                                     15                                                        /*!< LCD PAL132: I0 Position             */\r
+#define LCD_PAL132_I0_Msk                                     (0x01UL << LCD_PAL132_I0_Pos)                             /*!< LCD PAL132: I0 Mask                 */\r
+#define LCD_PAL132_R14_0_Pos                                  16                                                        /*!< LCD PAL132: R14_0 Position          */\r
+#define LCD_PAL132_R14_0_Msk                                  (0x1fUL << LCD_PAL132_R14_0_Pos)                          /*!< LCD PAL132: R14_0 Mask              */\r
+#define LCD_PAL132_G14_0_Pos                                  21                                                        /*!< LCD PAL132: G14_0 Position          */\r
+#define LCD_PAL132_G14_0_Msk                                  (0x1fUL << LCD_PAL132_G14_0_Pos)                          /*!< LCD PAL132: G14_0 Mask              */\r
+#define LCD_PAL132_B14_0_Pos                                  26                                                        /*!< LCD PAL132: B14_0 Position          */\r
+#define LCD_PAL132_B14_0_Msk                                  (0x1fUL << LCD_PAL132_B14_0_Pos)                          /*!< LCD PAL132: B14_0 Mask              */\r
+#define LCD_PAL132_I1_Pos                                     31                                                        /*!< LCD PAL132: I1 Position             */\r
+#define LCD_PAL132_I1_Msk                                     (0x01UL << LCD_PAL132_I1_Pos)                             /*!< LCD PAL132: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL133  -------------------------------------------\r
+#define LCD_PAL133_R04_0_Pos                                  0                                                         /*!< LCD PAL133: R04_0 Position          */\r
+#define LCD_PAL133_R04_0_Msk                                  (0x1fUL << LCD_PAL133_R04_0_Pos)                          /*!< LCD PAL133: R04_0 Mask              */\r
+#define LCD_PAL133_G04_0_Pos                                  5                                                         /*!< LCD PAL133: G04_0 Position          */\r
+#define LCD_PAL133_G04_0_Msk                                  (0x1fUL << LCD_PAL133_G04_0_Pos)                          /*!< LCD PAL133: G04_0 Mask              */\r
+#define LCD_PAL133_B04_0_Pos                                  10                                                        /*!< LCD PAL133: B04_0 Position          */\r
+#define LCD_PAL133_B04_0_Msk                                  (0x1fUL << LCD_PAL133_B04_0_Pos)                          /*!< LCD PAL133: B04_0 Mask              */\r
+#define LCD_PAL133_I0_Pos                                     15                                                        /*!< LCD PAL133: I0 Position             */\r
+#define LCD_PAL133_I0_Msk                                     (0x01UL << LCD_PAL133_I0_Pos)                             /*!< LCD PAL133: I0 Mask                 */\r
+#define LCD_PAL133_R14_0_Pos                                  16                                                        /*!< LCD PAL133: R14_0 Position          */\r
+#define LCD_PAL133_R14_0_Msk                                  (0x1fUL << LCD_PAL133_R14_0_Pos)                          /*!< LCD PAL133: R14_0 Mask              */\r
+#define LCD_PAL133_G14_0_Pos                                  21                                                        /*!< LCD PAL133: G14_0 Position          */\r
+#define LCD_PAL133_G14_0_Msk                                  (0x1fUL << LCD_PAL133_G14_0_Pos)                          /*!< LCD PAL133: G14_0 Mask              */\r
+#define LCD_PAL133_B14_0_Pos                                  26                                                        /*!< LCD PAL133: B14_0 Position          */\r
+#define LCD_PAL133_B14_0_Msk                                  (0x1fUL << LCD_PAL133_B14_0_Pos)                          /*!< LCD PAL133: B14_0 Mask              */\r
+#define LCD_PAL133_I1_Pos                                     31                                                        /*!< LCD PAL133: I1 Position             */\r
+#define LCD_PAL133_I1_Msk                                     (0x01UL << LCD_PAL133_I1_Pos)                             /*!< LCD PAL133: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL134  -------------------------------------------\r
+#define LCD_PAL134_R04_0_Pos                                  0                                                         /*!< LCD PAL134: R04_0 Position          */\r
+#define LCD_PAL134_R04_0_Msk                                  (0x1fUL << LCD_PAL134_R04_0_Pos)                          /*!< LCD PAL134: R04_0 Mask              */\r
+#define LCD_PAL134_G04_0_Pos                                  5                                                         /*!< LCD PAL134: G04_0 Position          */\r
+#define LCD_PAL134_G04_0_Msk                                  (0x1fUL << LCD_PAL134_G04_0_Pos)                          /*!< LCD PAL134: G04_0 Mask              */\r
+#define LCD_PAL134_B04_0_Pos                                  10                                                        /*!< LCD PAL134: B04_0 Position          */\r
+#define LCD_PAL134_B04_0_Msk                                  (0x1fUL << LCD_PAL134_B04_0_Pos)                          /*!< LCD PAL134: B04_0 Mask              */\r
+#define LCD_PAL134_I0_Pos                                     15                                                        /*!< LCD PAL134: I0 Position             */\r
+#define LCD_PAL134_I0_Msk                                     (0x01UL << LCD_PAL134_I0_Pos)                             /*!< LCD PAL134: I0 Mask                 */\r
+#define LCD_PAL134_R14_0_Pos                                  16                                                        /*!< LCD PAL134: R14_0 Position          */\r
+#define LCD_PAL134_R14_0_Msk                                  (0x1fUL << LCD_PAL134_R14_0_Pos)                          /*!< LCD PAL134: R14_0 Mask              */\r
+#define LCD_PAL134_G14_0_Pos                                  21                                                        /*!< LCD PAL134: G14_0 Position          */\r
+#define LCD_PAL134_G14_0_Msk                                  (0x1fUL << LCD_PAL134_G14_0_Pos)                          /*!< LCD PAL134: G14_0 Mask              */\r
+#define LCD_PAL134_B14_0_Pos                                  26                                                        /*!< LCD PAL134: B14_0 Position          */\r
+#define LCD_PAL134_B14_0_Msk                                  (0x1fUL << LCD_PAL134_B14_0_Pos)                          /*!< LCD PAL134: B14_0 Mask              */\r
+#define LCD_PAL134_I1_Pos                                     31                                                        /*!< LCD PAL134: I1 Position             */\r
+#define LCD_PAL134_I1_Msk                                     (0x01UL << LCD_PAL134_I1_Pos)                             /*!< LCD PAL134: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL135  -------------------------------------------\r
+#define LCD_PAL135_R04_0_Pos                                  0                                                         /*!< LCD PAL135: R04_0 Position          */\r
+#define LCD_PAL135_R04_0_Msk                                  (0x1fUL << LCD_PAL135_R04_0_Pos)                          /*!< LCD PAL135: R04_0 Mask              */\r
+#define LCD_PAL135_G04_0_Pos                                  5                                                         /*!< LCD PAL135: G04_0 Position          */\r
+#define LCD_PAL135_G04_0_Msk                                  (0x1fUL << LCD_PAL135_G04_0_Pos)                          /*!< LCD PAL135: G04_0 Mask              */\r
+#define LCD_PAL135_B04_0_Pos                                  10                                                        /*!< LCD PAL135: B04_0 Position          */\r
+#define LCD_PAL135_B04_0_Msk                                  (0x1fUL << LCD_PAL135_B04_0_Pos)                          /*!< LCD PAL135: B04_0 Mask              */\r
+#define LCD_PAL135_I0_Pos                                     15                                                        /*!< LCD PAL135: I0 Position             */\r
+#define LCD_PAL135_I0_Msk                                     (0x01UL << LCD_PAL135_I0_Pos)                             /*!< LCD PAL135: I0 Mask                 */\r
+#define LCD_PAL135_R14_0_Pos                                  16                                                        /*!< LCD PAL135: R14_0 Position          */\r
+#define LCD_PAL135_R14_0_Msk                                  (0x1fUL << LCD_PAL135_R14_0_Pos)                          /*!< LCD PAL135: R14_0 Mask              */\r
+#define LCD_PAL135_G14_0_Pos                                  21                                                        /*!< LCD PAL135: G14_0 Position          */\r
+#define LCD_PAL135_G14_0_Msk                                  (0x1fUL << LCD_PAL135_G14_0_Pos)                          /*!< LCD PAL135: G14_0 Mask              */\r
+#define LCD_PAL135_B14_0_Pos                                  26                                                        /*!< LCD PAL135: B14_0 Position          */\r
+#define LCD_PAL135_B14_0_Msk                                  (0x1fUL << LCD_PAL135_B14_0_Pos)                          /*!< LCD PAL135: B14_0 Mask              */\r
+#define LCD_PAL135_I1_Pos                                     31                                                        /*!< LCD PAL135: I1 Position             */\r
+#define LCD_PAL135_I1_Msk                                     (0x01UL << LCD_PAL135_I1_Pos)                             /*!< LCD PAL135: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL136  -------------------------------------------\r
+#define LCD_PAL136_R04_0_Pos                                  0                                                         /*!< LCD PAL136: R04_0 Position          */\r
+#define LCD_PAL136_R04_0_Msk                                  (0x1fUL << LCD_PAL136_R04_0_Pos)                          /*!< LCD PAL136: R04_0 Mask              */\r
+#define LCD_PAL136_G04_0_Pos                                  5                                                         /*!< LCD PAL136: G04_0 Position          */\r
+#define LCD_PAL136_G04_0_Msk                                  (0x1fUL << LCD_PAL136_G04_0_Pos)                          /*!< LCD PAL136: G04_0 Mask              */\r
+#define LCD_PAL136_B04_0_Pos                                  10                                                        /*!< LCD PAL136: B04_0 Position          */\r
+#define LCD_PAL136_B04_0_Msk                                  (0x1fUL << LCD_PAL136_B04_0_Pos)                          /*!< LCD PAL136: B04_0 Mask              */\r
+#define LCD_PAL136_I0_Pos                                     15                                                        /*!< LCD PAL136: I0 Position             */\r
+#define LCD_PAL136_I0_Msk                                     (0x01UL << LCD_PAL136_I0_Pos)                             /*!< LCD PAL136: I0 Mask                 */\r
+#define LCD_PAL136_R14_0_Pos                                  16                                                        /*!< LCD PAL136: R14_0 Position          */\r
+#define LCD_PAL136_R14_0_Msk                                  (0x1fUL << LCD_PAL136_R14_0_Pos)                          /*!< LCD PAL136: R14_0 Mask              */\r
+#define LCD_PAL136_G14_0_Pos                                  21                                                        /*!< LCD PAL136: G14_0 Position          */\r
+#define LCD_PAL136_G14_0_Msk                                  (0x1fUL << LCD_PAL136_G14_0_Pos)                          /*!< LCD PAL136: G14_0 Mask              */\r
+#define LCD_PAL136_B14_0_Pos                                  26                                                        /*!< LCD PAL136: B14_0 Position          */\r
+#define LCD_PAL136_B14_0_Msk                                  (0x1fUL << LCD_PAL136_B14_0_Pos)                          /*!< LCD PAL136: B14_0 Mask              */\r
+#define LCD_PAL136_I1_Pos                                     31                                                        /*!< LCD PAL136: I1 Position             */\r
+#define LCD_PAL136_I1_Msk                                     (0x01UL << LCD_PAL136_I1_Pos)                             /*!< LCD PAL136: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL137  -------------------------------------------\r
+#define LCD_PAL137_R04_0_Pos                                  0                                                         /*!< LCD PAL137: R04_0 Position          */\r
+#define LCD_PAL137_R04_0_Msk                                  (0x1fUL << LCD_PAL137_R04_0_Pos)                          /*!< LCD PAL137: R04_0 Mask              */\r
+#define LCD_PAL137_G04_0_Pos                                  5                                                         /*!< LCD PAL137: G04_0 Position          */\r
+#define LCD_PAL137_G04_0_Msk                                  (0x1fUL << LCD_PAL137_G04_0_Pos)                          /*!< LCD PAL137: G04_0 Mask              */\r
+#define LCD_PAL137_B04_0_Pos                                  10                                                        /*!< LCD PAL137: B04_0 Position          */\r
+#define LCD_PAL137_B04_0_Msk                                  (0x1fUL << LCD_PAL137_B04_0_Pos)                          /*!< LCD PAL137: B04_0 Mask              */\r
+#define LCD_PAL137_I0_Pos                                     15                                                        /*!< LCD PAL137: I0 Position             */\r
+#define LCD_PAL137_I0_Msk                                     (0x01UL << LCD_PAL137_I0_Pos)                             /*!< LCD PAL137: I0 Mask                 */\r
+#define LCD_PAL137_R14_0_Pos                                  16                                                        /*!< LCD PAL137: R14_0 Position          */\r
+#define LCD_PAL137_R14_0_Msk                                  (0x1fUL << LCD_PAL137_R14_0_Pos)                          /*!< LCD PAL137: R14_0 Mask              */\r
+#define LCD_PAL137_G14_0_Pos                                  21                                                        /*!< LCD PAL137: G14_0 Position          */\r
+#define LCD_PAL137_G14_0_Msk                                  (0x1fUL << LCD_PAL137_G14_0_Pos)                          /*!< LCD PAL137: G14_0 Mask              */\r
+#define LCD_PAL137_B14_0_Pos                                  26                                                        /*!< LCD PAL137: B14_0 Position          */\r
+#define LCD_PAL137_B14_0_Msk                                  (0x1fUL << LCD_PAL137_B14_0_Pos)                          /*!< LCD PAL137: B14_0 Mask              */\r
+#define LCD_PAL137_I1_Pos                                     31                                                        /*!< LCD PAL137: I1 Position             */\r
+#define LCD_PAL137_I1_Msk                                     (0x01UL << LCD_PAL137_I1_Pos)                             /*!< LCD PAL137: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL138  -------------------------------------------\r
+#define LCD_PAL138_R04_0_Pos                                  0                                                         /*!< LCD PAL138: R04_0 Position          */\r
+#define LCD_PAL138_R04_0_Msk                                  (0x1fUL << LCD_PAL138_R04_0_Pos)                          /*!< LCD PAL138: R04_0 Mask              */\r
+#define LCD_PAL138_G04_0_Pos                                  5                                                         /*!< LCD PAL138: G04_0 Position          */\r
+#define LCD_PAL138_G04_0_Msk                                  (0x1fUL << LCD_PAL138_G04_0_Pos)                          /*!< LCD PAL138: G04_0 Mask              */\r
+#define LCD_PAL138_B04_0_Pos                                  10                                                        /*!< LCD PAL138: B04_0 Position          */\r
+#define LCD_PAL138_B04_0_Msk                                  (0x1fUL << LCD_PAL138_B04_0_Pos)                          /*!< LCD PAL138: B04_0 Mask              */\r
+#define LCD_PAL138_I0_Pos                                     15                                                        /*!< LCD PAL138: I0 Position             */\r
+#define LCD_PAL138_I0_Msk                                     (0x01UL << LCD_PAL138_I0_Pos)                             /*!< LCD PAL138: I0 Mask                 */\r
+#define LCD_PAL138_R14_0_Pos                                  16                                                        /*!< LCD PAL138: R14_0 Position          */\r
+#define LCD_PAL138_R14_0_Msk                                  (0x1fUL << LCD_PAL138_R14_0_Pos)                          /*!< LCD PAL138: R14_0 Mask              */\r
+#define LCD_PAL138_G14_0_Pos                                  21                                                        /*!< LCD PAL138: G14_0 Position          */\r
+#define LCD_PAL138_G14_0_Msk                                  (0x1fUL << LCD_PAL138_G14_0_Pos)                          /*!< LCD PAL138: G14_0 Mask              */\r
+#define LCD_PAL138_B14_0_Pos                                  26                                                        /*!< LCD PAL138: B14_0 Position          */\r
+#define LCD_PAL138_B14_0_Msk                                  (0x1fUL << LCD_PAL138_B14_0_Pos)                          /*!< LCD PAL138: B14_0 Mask              */\r
+#define LCD_PAL138_I1_Pos                                     31                                                        /*!< LCD PAL138: I1 Position             */\r
+#define LCD_PAL138_I1_Msk                                     (0x01UL << LCD_PAL138_I1_Pos)                             /*!< LCD PAL138: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL139  -------------------------------------------\r
+#define LCD_PAL139_R04_0_Pos                                  0                                                         /*!< LCD PAL139: R04_0 Position          */\r
+#define LCD_PAL139_R04_0_Msk                                  (0x1fUL << LCD_PAL139_R04_0_Pos)                          /*!< LCD PAL139: R04_0 Mask              */\r
+#define LCD_PAL139_G04_0_Pos                                  5                                                         /*!< LCD PAL139: G04_0 Position          */\r
+#define LCD_PAL139_G04_0_Msk                                  (0x1fUL << LCD_PAL139_G04_0_Pos)                          /*!< LCD PAL139: G04_0 Mask              */\r
+#define LCD_PAL139_B04_0_Pos                                  10                                                        /*!< LCD PAL139: B04_0 Position          */\r
+#define LCD_PAL139_B04_0_Msk                                  (0x1fUL << LCD_PAL139_B04_0_Pos)                          /*!< LCD PAL139: B04_0 Mask              */\r
+#define LCD_PAL139_I0_Pos                                     15                                                        /*!< LCD PAL139: I0 Position             */\r
+#define LCD_PAL139_I0_Msk                                     (0x01UL << LCD_PAL139_I0_Pos)                             /*!< LCD PAL139: I0 Mask                 */\r
+#define LCD_PAL139_R14_0_Pos                                  16                                                        /*!< LCD PAL139: R14_0 Position          */\r
+#define LCD_PAL139_R14_0_Msk                                  (0x1fUL << LCD_PAL139_R14_0_Pos)                          /*!< LCD PAL139: R14_0 Mask              */\r
+#define LCD_PAL139_G14_0_Pos                                  21                                                        /*!< LCD PAL139: G14_0 Position          */\r
+#define LCD_PAL139_G14_0_Msk                                  (0x1fUL << LCD_PAL139_G14_0_Pos)                          /*!< LCD PAL139: G14_0 Mask              */\r
+#define LCD_PAL139_B14_0_Pos                                  26                                                        /*!< LCD PAL139: B14_0 Position          */\r
+#define LCD_PAL139_B14_0_Msk                                  (0x1fUL << LCD_PAL139_B14_0_Pos)                          /*!< LCD PAL139: B14_0 Mask              */\r
+#define LCD_PAL139_I1_Pos                                     31                                                        /*!< LCD PAL139: I1 Position             */\r
+#define LCD_PAL139_I1_Msk                                     (0x01UL << LCD_PAL139_I1_Pos)                             /*!< LCD PAL139: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL140  -------------------------------------------\r
+#define LCD_PAL140_R04_0_Pos                                  0                                                         /*!< LCD PAL140: R04_0 Position          */\r
+#define LCD_PAL140_R04_0_Msk                                  (0x1fUL << LCD_PAL140_R04_0_Pos)                          /*!< LCD PAL140: R04_0 Mask              */\r
+#define LCD_PAL140_G04_0_Pos                                  5                                                         /*!< LCD PAL140: G04_0 Position          */\r
+#define LCD_PAL140_G04_0_Msk                                  (0x1fUL << LCD_PAL140_G04_0_Pos)                          /*!< LCD PAL140: G04_0 Mask              */\r
+#define LCD_PAL140_B04_0_Pos                                  10                                                        /*!< LCD PAL140: B04_0 Position          */\r
+#define LCD_PAL140_B04_0_Msk                                  (0x1fUL << LCD_PAL140_B04_0_Pos)                          /*!< LCD PAL140: B04_0 Mask              */\r
+#define LCD_PAL140_I0_Pos                                     15                                                        /*!< LCD PAL140: I0 Position             */\r
+#define LCD_PAL140_I0_Msk                                     (0x01UL << LCD_PAL140_I0_Pos)                             /*!< LCD PAL140: I0 Mask                 */\r
+#define LCD_PAL140_R14_0_Pos                                  16                                                        /*!< LCD PAL140: R14_0 Position          */\r
+#define LCD_PAL140_R14_0_Msk                                  (0x1fUL << LCD_PAL140_R14_0_Pos)                          /*!< LCD PAL140: R14_0 Mask              */\r
+#define LCD_PAL140_G14_0_Pos                                  21                                                        /*!< LCD PAL140: G14_0 Position          */\r
+#define LCD_PAL140_G14_0_Msk                                  (0x1fUL << LCD_PAL140_G14_0_Pos)                          /*!< LCD PAL140: G14_0 Mask              */\r
+#define LCD_PAL140_B14_0_Pos                                  26                                                        /*!< LCD PAL140: B14_0 Position          */\r
+#define LCD_PAL140_B14_0_Msk                                  (0x1fUL << LCD_PAL140_B14_0_Pos)                          /*!< LCD PAL140: B14_0 Mask              */\r
+#define LCD_PAL140_I1_Pos                                     31                                                        /*!< LCD PAL140: I1 Position             */\r
+#define LCD_PAL140_I1_Msk                                     (0x01UL << LCD_PAL140_I1_Pos)                             /*!< LCD PAL140: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL141  -------------------------------------------\r
+#define LCD_PAL141_R04_0_Pos                                  0                                                         /*!< LCD PAL141: R04_0 Position          */\r
+#define LCD_PAL141_R04_0_Msk                                  (0x1fUL << LCD_PAL141_R04_0_Pos)                          /*!< LCD PAL141: R04_0 Mask              */\r
+#define LCD_PAL141_G04_0_Pos                                  5                                                         /*!< LCD PAL141: G04_0 Position          */\r
+#define LCD_PAL141_G04_0_Msk                                  (0x1fUL << LCD_PAL141_G04_0_Pos)                          /*!< LCD PAL141: G04_0 Mask              */\r
+#define LCD_PAL141_B04_0_Pos                                  10                                                        /*!< LCD PAL141: B04_0 Position          */\r
+#define LCD_PAL141_B04_0_Msk                                  (0x1fUL << LCD_PAL141_B04_0_Pos)                          /*!< LCD PAL141: B04_0 Mask              */\r
+#define LCD_PAL141_I0_Pos                                     15                                                        /*!< LCD PAL141: I0 Position             */\r
+#define LCD_PAL141_I0_Msk                                     (0x01UL << LCD_PAL141_I0_Pos)                             /*!< LCD PAL141: I0 Mask                 */\r
+#define LCD_PAL141_R14_0_Pos                                  16                                                        /*!< LCD PAL141: R14_0 Position          */\r
+#define LCD_PAL141_R14_0_Msk                                  (0x1fUL << LCD_PAL141_R14_0_Pos)                          /*!< LCD PAL141: R14_0 Mask              */\r
+#define LCD_PAL141_G14_0_Pos                                  21                                                        /*!< LCD PAL141: G14_0 Position          */\r
+#define LCD_PAL141_G14_0_Msk                                  (0x1fUL << LCD_PAL141_G14_0_Pos)                          /*!< LCD PAL141: G14_0 Mask              */\r
+#define LCD_PAL141_B14_0_Pos                                  26                                                        /*!< LCD PAL141: B14_0 Position          */\r
+#define LCD_PAL141_B14_0_Msk                                  (0x1fUL << LCD_PAL141_B14_0_Pos)                          /*!< LCD PAL141: B14_0 Mask              */\r
+#define LCD_PAL141_I1_Pos                                     31                                                        /*!< LCD PAL141: I1 Position             */\r
+#define LCD_PAL141_I1_Msk                                     (0x01UL << LCD_PAL141_I1_Pos)                             /*!< LCD PAL141: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL142  -------------------------------------------\r
+#define LCD_PAL142_R04_0_Pos                                  0                                                         /*!< LCD PAL142: R04_0 Position          */\r
+#define LCD_PAL142_R04_0_Msk                                  (0x1fUL << LCD_PAL142_R04_0_Pos)                          /*!< LCD PAL142: R04_0 Mask              */\r
+#define LCD_PAL142_G04_0_Pos                                  5                                                         /*!< LCD PAL142: G04_0 Position          */\r
+#define LCD_PAL142_G04_0_Msk                                  (0x1fUL << LCD_PAL142_G04_0_Pos)                          /*!< LCD PAL142: G04_0 Mask              */\r
+#define LCD_PAL142_B04_0_Pos                                  10                                                        /*!< LCD PAL142: B04_0 Position          */\r
+#define LCD_PAL142_B04_0_Msk                                  (0x1fUL << LCD_PAL142_B04_0_Pos)                          /*!< LCD PAL142: B04_0 Mask              */\r
+#define LCD_PAL142_I0_Pos                                     15                                                        /*!< LCD PAL142: I0 Position             */\r
+#define LCD_PAL142_I0_Msk                                     (0x01UL << LCD_PAL142_I0_Pos)                             /*!< LCD PAL142: I0 Mask                 */\r
+#define LCD_PAL142_R14_0_Pos                                  16                                                        /*!< LCD PAL142: R14_0 Position          */\r
+#define LCD_PAL142_R14_0_Msk                                  (0x1fUL << LCD_PAL142_R14_0_Pos)                          /*!< LCD PAL142: R14_0 Mask              */\r
+#define LCD_PAL142_G14_0_Pos                                  21                                                        /*!< LCD PAL142: G14_0 Position          */\r
+#define LCD_PAL142_G14_0_Msk                                  (0x1fUL << LCD_PAL142_G14_0_Pos)                          /*!< LCD PAL142: G14_0 Mask              */\r
+#define LCD_PAL142_B14_0_Pos                                  26                                                        /*!< LCD PAL142: B14_0 Position          */\r
+#define LCD_PAL142_B14_0_Msk                                  (0x1fUL << LCD_PAL142_B14_0_Pos)                          /*!< LCD PAL142: B14_0 Mask              */\r
+#define LCD_PAL142_I1_Pos                                     31                                                        /*!< LCD PAL142: I1 Position             */\r
+#define LCD_PAL142_I1_Msk                                     (0x01UL << LCD_PAL142_I1_Pos)                             /*!< LCD PAL142: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL143  -------------------------------------------\r
+#define LCD_PAL143_R04_0_Pos                                  0                                                         /*!< LCD PAL143: R04_0 Position          */\r
+#define LCD_PAL143_R04_0_Msk                                  (0x1fUL << LCD_PAL143_R04_0_Pos)                          /*!< LCD PAL143: R04_0 Mask              */\r
+#define LCD_PAL143_G04_0_Pos                                  5                                                         /*!< LCD PAL143: G04_0 Position          */\r
+#define LCD_PAL143_G04_0_Msk                                  (0x1fUL << LCD_PAL143_G04_0_Pos)                          /*!< LCD PAL143: G04_0 Mask              */\r
+#define LCD_PAL143_B04_0_Pos                                  10                                                        /*!< LCD PAL143: B04_0 Position          */\r
+#define LCD_PAL143_B04_0_Msk                                  (0x1fUL << LCD_PAL143_B04_0_Pos)                          /*!< LCD PAL143: B04_0 Mask              */\r
+#define LCD_PAL143_I0_Pos                                     15                                                        /*!< LCD PAL143: I0 Position             */\r
+#define LCD_PAL143_I0_Msk                                     (0x01UL << LCD_PAL143_I0_Pos)                             /*!< LCD PAL143: I0 Mask                 */\r
+#define LCD_PAL143_R14_0_Pos                                  16                                                        /*!< LCD PAL143: R14_0 Position          */\r
+#define LCD_PAL143_R14_0_Msk                                  (0x1fUL << LCD_PAL143_R14_0_Pos)                          /*!< LCD PAL143: R14_0 Mask              */\r
+#define LCD_PAL143_G14_0_Pos                                  21                                                        /*!< LCD PAL143: G14_0 Position          */\r
+#define LCD_PAL143_G14_0_Msk                                  (0x1fUL << LCD_PAL143_G14_0_Pos)                          /*!< LCD PAL143: G14_0 Mask              */\r
+#define LCD_PAL143_B14_0_Pos                                  26                                                        /*!< LCD PAL143: B14_0 Position          */\r
+#define LCD_PAL143_B14_0_Msk                                  (0x1fUL << LCD_PAL143_B14_0_Pos)                          /*!< LCD PAL143: B14_0 Mask              */\r
+#define LCD_PAL143_I1_Pos                                     31                                                        /*!< LCD PAL143: I1 Position             */\r
+#define LCD_PAL143_I1_Msk                                     (0x01UL << LCD_PAL143_I1_Pos)                             /*!< LCD PAL143: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL144  -------------------------------------------\r
+#define LCD_PAL144_R04_0_Pos                                  0                                                         /*!< LCD PAL144: R04_0 Position          */\r
+#define LCD_PAL144_R04_0_Msk                                  (0x1fUL << LCD_PAL144_R04_0_Pos)                          /*!< LCD PAL144: R04_0 Mask              */\r
+#define LCD_PAL144_G04_0_Pos                                  5                                                         /*!< LCD PAL144: G04_0 Position          */\r
+#define LCD_PAL144_G04_0_Msk                                  (0x1fUL << LCD_PAL144_G04_0_Pos)                          /*!< LCD PAL144: G04_0 Mask              */\r
+#define LCD_PAL144_B04_0_Pos                                  10                                                        /*!< LCD PAL144: B04_0 Position          */\r
+#define LCD_PAL144_B04_0_Msk                                  (0x1fUL << LCD_PAL144_B04_0_Pos)                          /*!< LCD PAL144: B04_0 Mask              */\r
+#define LCD_PAL144_I0_Pos                                     15                                                        /*!< LCD PAL144: I0 Position             */\r
+#define LCD_PAL144_I0_Msk                                     (0x01UL << LCD_PAL144_I0_Pos)                             /*!< LCD PAL144: I0 Mask                 */\r
+#define LCD_PAL144_R14_0_Pos                                  16                                                        /*!< LCD PAL144: R14_0 Position          */\r
+#define LCD_PAL144_R14_0_Msk                                  (0x1fUL << LCD_PAL144_R14_0_Pos)                          /*!< LCD PAL144: R14_0 Mask              */\r
+#define LCD_PAL144_G14_0_Pos                                  21                                                        /*!< LCD PAL144: G14_0 Position          */\r
+#define LCD_PAL144_G14_0_Msk                                  (0x1fUL << LCD_PAL144_G14_0_Pos)                          /*!< LCD PAL144: G14_0 Mask              */\r
+#define LCD_PAL144_B14_0_Pos                                  26                                                        /*!< LCD PAL144: B14_0 Position          */\r
+#define LCD_PAL144_B14_0_Msk                                  (0x1fUL << LCD_PAL144_B14_0_Pos)                          /*!< LCD PAL144: B14_0 Mask              */\r
+#define LCD_PAL144_I1_Pos                                     31                                                        /*!< LCD PAL144: I1 Position             */\r
+#define LCD_PAL144_I1_Msk                                     (0x01UL << LCD_PAL144_I1_Pos)                             /*!< LCD PAL144: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL145  -------------------------------------------\r
+#define LCD_PAL145_R04_0_Pos                                  0                                                         /*!< LCD PAL145: R04_0 Position          */\r
+#define LCD_PAL145_R04_0_Msk                                  (0x1fUL << LCD_PAL145_R04_0_Pos)                          /*!< LCD PAL145: R04_0 Mask              */\r
+#define LCD_PAL145_G04_0_Pos                                  5                                                         /*!< LCD PAL145: G04_0 Position          */\r
+#define LCD_PAL145_G04_0_Msk                                  (0x1fUL << LCD_PAL145_G04_0_Pos)                          /*!< LCD PAL145: G04_0 Mask              */\r
+#define LCD_PAL145_B04_0_Pos                                  10                                                        /*!< LCD PAL145: B04_0 Position          */\r
+#define LCD_PAL145_B04_0_Msk                                  (0x1fUL << LCD_PAL145_B04_0_Pos)                          /*!< LCD PAL145: B04_0 Mask              */\r
+#define LCD_PAL145_I0_Pos                                     15                                                        /*!< LCD PAL145: I0 Position             */\r
+#define LCD_PAL145_I0_Msk                                     (0x01UL << LCD_PAL145_I0_Pos)                             /*!< LCD PAL145: I0 Mask                 */\r
+#define LCD_PAL145_R14_0_Pos                                  16                                                        /*!< LCD PAL145: R14_0 Position          */\r
+#define LCD_PAL145_R14_0_Msk                                  (0x1fUL << LCD_PAL145_R14_0_Pos)                          /*!< LCD PAL145: R14_0 Mask              */\r
+#define LCD_PAL145_G14_0_Pos                                  21                                                        /*!< LCD PAL145: G14_0 Position          */\r
+#define LCD_PAL145_G14_0_Msk                                  (0x1fUL << LCD_PAL145_G14_0_Pos)                          /*!< LCD PAL145: G14_0 Mask              */\r
+#define LCD_PAL145_B14_0_Pos                                  26                                                        /*!< LCD PAL145: B14_0 Position          */\r
+#define LCD_PAL145_B14_0_Msk                                  (0x1fUL << LCD_PAL145_B14_0_Pos)                          /*!< LCD PAL145: B14_0 Mask              */\r
+#define LCD_PAL145_I1_Pos                                     31                                                        /*!< LCD PAL145: I1 Position             */\r
+#define LCD_PAL145_I1_Msk                                     (0x01UL << LCD_PAL145_I1_Pos)                             /*!< LCD PAL145: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL146  -------------------------------------------\r
+#define LCD_PAL146_R04_0_Pos                                  0                                                         /*!< LCD PAL146: R04_0 Position          */\r
+#define LCD_PAL146_R04_0_Msk                                  (0x1fUL << LCD_PAL146_R04_0_Pos)                          /*!< LCD PAL146: R04_0 Mask              */\r
+#define LCD_PAL146_G04_0_Pos                                  5                                                         /*!< LCD PAL146: G04_0 Position          */\r
+#define LCD_PAL146_G04_0_Msk                                  (0x1fUL << LCD_PAL146_G04_0_Pos)                          /*!< LCD PAL146: G04_0 Mask              */\r
+#define LCD_PAL146_B04_0_Pos                                  10                                                        /*!< LCD PAL146: B04_0 Position          */\r
+#define LCD_PAL146_B04_0_Msk                                  (0x1fUL << LCD_PAL146_B04_0_Pos)                          /*!< LCD PAL146: B04_0 Mask              */\r
+#define LCD_PAL146_I0_Pos                                     15                                                        /*!< LCD PAL146: I0 Position             */\r
+#define LCD_PAL146_I0_Msk                                     (0x01UL << LCD_PAL146_I0_Pos)                             /*!< LCD PAL146: I0 Mask                 */\r
+#define LCD_PAL146_R14_0_Pos                                  16                                                        /*!< LCD PAL146: R14_0 Position          */\r
+#define LCD_PAL146_R14_0_Msk                                  (0x1fUL << LCD_PAL146_R14_0_Pos)                          /*!< LCD PAL146: R14_0 Mask              */\r
+#define LCD_PAL146_G14_0_Pos                                  21                                                        /*!< LCD PAL146: G14_0 Position          */\r
+#define LCD_PAL146_G14_0_Msk                                  (0x1fUL << LCD_PAL146_G14_0_Pos)                          /*!< LCD PAL146: G14_0 Mask              */\r
+#define LCD_PAL146_B14_0_Pos                                  26                                                        /*!< LCD PAL146: B14_0 Position          */\r
+#define LCD_PAL146_B14_0_Msk                                  (0x1fUL << LCD_PAL146_B14_0_Pos)                          /*!< LCD PAL146: B14_0 Mask              */\r
+#define LCD_PAL146_I1_Pos                                     31                                                        /*!< LCD PAL146: I1 Position             */\r
+#define LCD_PAL146_I1_Msk                                     (0x01UL << LCD_PAL146_I1_Pos)                             /*!< LCD PAL146: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL147  -------------------------------------------\r
+#define LCD_PAL147_R04_0_Pos                                  0                                                         /*!< LCD PAL147: R04_0 Position          */\r
+#define LCD_PAL147_R04_0_Msk                                  (0x1fUL << LCD_PAL147_R04_0_Pos)                          /*!< LCD PAL147: R04_0 Mask              */\r
+#define LCD_PAL147_G04_0_Pos                                  5                                                         /*!< LCD PAL147: G04_0 Position          */\r
+#define LCD_PAL147_G04_0_Msk                                  (0x1fUL << LCD_PAL147_G04_0_Pos)                          /*!< LCD PAL147: G04_0 Mask              */\r
+#define LCD_PAL147_B04_0_Pos                                  10                                                        /*!< LCD PAL147: B04_0 Position          */\r
+#define LCD_PAL147_B04_0_Msk                                  (0x1fUL << LCD_PAL147_B04_0_Pos)                          /*!< LCD PAL147: B04_0 Mask              */\r
+#define LCD_PAL147_I0_Pos                                     15                                                        /*!< LCD PAL147: I0 Position             */\r
+#define LCD_PAL147_I0_Msk                                     (0x01UL << LCD_PAL147_I0_Pos)                             /*!< LCD PAL147: I0 Mask                 */\r
+#define LCD_PAL147_R14_0_Pos                                  16                                                        /*!< LCD PAL147: R14_0 Position          */\r
+#define LCD_PAL147_R14_0_Msk                                  (0x1fUL << LCD_PAL147_R14_0_Pos)                          /*!< LCD PAL147: R14_0 Mask              */\r
+#define LCD_PAL147_G14_0_Pos                                  21                                                        /*!< LCD PAL147: G14_0 Position          */\r
+#define LCD_PAL147_G14_0_Msk                                  (0x1fUL << LCD_PAL147_G14_0_Pos)                          /*!< LCD PAL147: G14_0 Mask              */\r
+#define LCD_PAL147_B14_0_Pos                                  26                                                        /*!< LCD PAL147: B14_0 Position          */\r
+#define LCD_PAL147_B14_0_Msk                                  (0x1fUL << LCD_PAL147_B14_0_Pos)                          /*!< LCD PAL147: B14_0 Mask              */\r
+#define LCD_PAL147_I1_Pos                                     31                                                        /*!< LCD PAL147: I1 Position             */\r
+#define LCD_PAL147_I1_Msk                                     (0x01UL << LCD_PAL147_I1_Pos)                             /*!< LCD PAL147: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL148  -------------------------------------------\r
+#define LCD_PAL148_R04_0_Pos                                  0                                                         /*!< LCD PAL148: R04_0 Position          */\r
+#define LCD_PAL148_R04_0_Msk                                  (0x1fUL << LCD_PAL148_R04_0_Pos)                          /*!< LCD PAL148: R04_0 Mask              */\r
+#define LCD_PAL148_G04_0_Pos                                  5                                                         /*!< LCD PAL148: G04_0 Position          */\r
+#define LCD_PAL148_G04_0_Msk                                  (0x1fUL << LCD_PAL148_G04_0_Pos)                          /*!< LCD PAL148: G04_0 Mask              */\r
+#define LCD_PAL148_B04_0_Pos                                  10                                                        /*!< LCD PAL148: B04_0 Position          */\r
+#define LCD_PAL148_B04_0_Msk                                  (0x1fUL << LCD_PAL148_B04_0_Pos)                          /*!< LCD PAL148: B04_0 Mask              */\r
+#define LCD_PAL148_I0_Pos                                     15                                                        /*!< LCD PAL148: I0 Position             */\r
+#define LCD_PAL148_I0_Msk                                     (0x01UL << LCD_PAL148_I0_Pos)                             /*!< LCD PAL148: I0 Mask                 */\r
+#define LCD_PAL148_R14_0_Pos                                  16                                                        /*!< LCD PAL148: R14_0 Position          */\r
+#define LCD_PAL148_R14_0_Msk                                  (0x1fUL << LCD_PAL148_R14_0_Pos)                          /*!< LCD PAL148: R14_0 Mask              */\r
+#define LCD_PAL148_G14_0_Pos                                  21                                                        /*!< LCD PAL148: G14_0 Position          */\r
+#define LCD_PAL148_G14_0_Msk                                  (0x1fUL << LCD_PAL148_G14_0_Pos)                          /*!< LCD PAL148: G14_0 Mask              */\r
+#define LCD_PAL148_B14_0_Pos                                  26                                                        /*!< LCD PAL148: B14_0 Position          */\r
+#define LCD_PAL148_B14_0_Msk                                  (0x1fUL << LCD_PAL148_B14_0_Pos)                          /*!< LCD PAL148: B14_0 Mask              */\r
+#define LCD_PAL148_I1_Pos                                     31                                                        /*!< LCD PAL148: I1 Position             */\r
+#define LCD_PAL148_I1_Msk                                     (0x01UL << LCD_PAL148_I1_Pos)                             /*!< LCD PAL148: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL149  -------------------------------------------\r
+#define LCD_PAL149_R04_0_Pos                                  0                                                         /*!< LCD PAL149: R04_0 Position          */\r
+#define LCD_PAL149_R04_0_Msk                                  (0x1fUL << LCD_PAL149_R04_0_Pos)                          /*!< LCD PAL149: R04_0 Mask              */\r
+#define LCD_PAL149_G04_0_Pos                                  5                                                         /*!< LCD PAL149: G04_0 Position          */\r
+#define LCD_PAL149_G04_0_Msk                                  (0x1fUL << LCD_PAL149_G04_0_Pos)                          /*!< LCD PAL149: G04_0 Mask              */\r
+#define LCD_PAL149_B04_0_Pos                                  10                                                        /*!< LCD PAL149: B04_0 Position          */\r
+#define LCD_PAL149_B04_0_Msk                                  (0x1fUL << LCD_PAL149_B04_0_Pos)                          /*!< LCD PAL149: B04_0 Mask              */\r
+#define LCD_PAL149_I0_Pos                                     15                                                        /*!< LCD PAL149: I0 Position             */\r
+#define LCD_PAL149_I0_Msk                                     (0x01UL << LCD_PAL149_I0_Pos)                             /*!< LCD PAL149: I0 Mask                 */\r
+#define LCD_PAL149_R14_0_Pos                                  16                                                        /*!< LCD PAL149: R14_0 Position          */\r
+#define LCD_PAL149_R14_0_Msk                                  (0x1fUL << LCD_PAL149_R14_0_Pos)                          /*!< LCD PAL149: R14_0 Mask              */\r
+#define LCD_PAL149_G14_0_Pos                                  21                                                        /*!< LCD PAL149: G14_0 Position          */\r
+#define LCD_PAL149_G14_0_Msk                                  (0x1fUL << LCD_PAL149_G14_0_Pos)                          /*!< LCD PAL149: G14_0 Mask              */\r
+#define LCD_PAL149_B14_0_Pos                                  26                                                        /*!< LCD PAL149: B14_0 Position          */\r
+#define LCD_PAL149_B14_0_Msk                                  (0x1fUL << LCD_PAL149_B14_0_Pos)                          /*!< LCD PAL149: B14_0 Mask              */\r
+#define LCD_PAL149_I1_Pos                                     31                                                        /*!< LCD PAL149: I1 Position             */\r
+#define LCD_PAL149_I1_Msk                                     (0x01UL << LCD_PAL149_I1_Pos)                             /*!< LCD PAL149: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL150  -------------------------------------------\r
+#define LCD_PAL150_R04_0_Pos                                  0                                                         /*!< LCD PAL150: R04_0 Position          */\r
+#define LCD_PAL150_R04_0_Msk                                  (0x1fUL << LCD_PAL150_R04_0_Pos)                          /*!< LCD PAL150: R04_0 Mask              */\r
+#define LCD_PAL150_G04_0_Pos                                  5                                                         /*!< LCD PAL150: G04_0 Position          */\r
+#define LCD_PAL150_G04_0_Msk                                  (0x1fUL << LCD_PAL150_G04_0_Pos)                          /*!< LCD PAL150: G04_0 Mask              */\r
+#define LCD_PAL150_B04_0_Pos                                  10                                                        /*!< LCD PAL150: B04_0 Position          */\r
+#define LCD_PAL150_B04_0_Msk                                  (0x1fUL << LCD_PAL150_B04_0_Pos)                          /*!< LCD PAL150: B04_0 Mask              */\r
+#define LCD_PAL150_I0_Pos                                     15                                                        /*!< LCD PAL150: I0 Position             */\r
+#define LCD_PAL150_I0_Msk                                     (0x01UL << LCD_PAL150_I0_Pos)                             /*!< LCD PAL150: I0 Mask                 */\r
+#define LCD_PAL150_R14_0_Pos                                  16                                                        /*!< LCD PAL150: R14_0 Position          */\r
+#define LCD_PAL150_R14_0_Msk                                  (0x1fUL << LCD_PAL150_R14_0_Pos)                          /*!< LCD PAL150: R14_0 Mask              */\r
+#define LCD_PAL150_G14_0_Pos                                  21                                                        /*!< LCD PAL150: G14_0 Position          */\r
+#define LCD_PAL150_G14_0_Msk                                  (0x1fUL << LCD_PAL150_G14_0_Pos)                          /*!< LCD PAL150: G14_0 Mask              */\r
+#define LCD_PAL150_B14_0_Pos                                  26                                                        /*!< LCD PAL150: B14_0 Position          */\r
+#define LCD_PAL150_B14_0_Msk                                  (0x1fUL << LCD_PAL150_B14_0_Pos)                          /*!< LCD PAL150: B14_0 Mask              */\r
+#define LCD_PAL150_I1_Pos                                     31                                                        /*!< LCD PAL150: I1 Position             */\r
+#define LCD_PAL150_I1_Msk                                     (0x01UL << LCD_PAL150_I1_Pos)                             /*!< LCD PAL150: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL151  -------------------------------------------\r
+#define LCD_PAL151_R04_0_Pos                                  0                                                         /*!< LCD PAL151: R04_0 Position          */\r
+#define LCD_PAL151_R04_0_Msk                                  (0x1fUL << LCD_PAL151_R04_0_Pos)                          /*!< LCD PAL151: R04_0 Mask              */\r
+#define LCD_PAL151_G04_0_Pos                                  5                                                         /*!< LCD PAL151: G04_0 Position          */\r
+#define LCD_PAL151_G04_0_Msk                                  (0x1fUL << LCD_PAL151_G04_0_Pos)                          /*!< LCD PAL151: G04_0 Mask              */\r
+#define LCD_PAL151_B04_0_Pos                                  10                                                        /*!< LCD PAL151: B04_0 Position          */\r
+#define LCD_PAL151_B04_0_Msk                                  (0x1fUL << LCD_PAL151_B04_0_Pos)                          /*!< LCD PAL151: B04_0 Mask              */\r
+#define LCD_PAL151_I0_Pos                                     15                                                        /*!< LCD PAL151: I0 Position             */\r
+#define LCD_PAL151_I0_Msk                                     (0x01UL << LCD_PAL151_I0_Pos)                             /*!< LCD PAL151: I0 Mask                 */\r
+#define LCD_PAL151_R14_0_Pos                                  16                                                        /*!< LCD PAL151: R14_0 Position          */\r
+#define LCD_PAL151_R14_0_Msk                                  (0x1fUL << LCD_PAL151_R14_0_Pos)                          /*!< LCD PAL151: R14_0 Mask              */\r
+#define LCD_PAL151_G14_0_Pos                                  21                                                        /*!< LCD PAL151: G14_0 Position          */\r
+#define LCD_PAL151_G14_0_Msk                                  (0x1fUL << LCD_PAL151_G14_0_Pos)                          /*!< LCD PAL151: G14_0 Mask              */\r
+#define LCD_PAL151_B14_0_Pos                                  26                                                        /*!< LCD PAL151: B14_0 Position          */\r
+#define LCD_PAL151_B14_0_Msk                                  (0x1fUL << LCD_PAL151_B14_0_Pos)                          /*!< LCD PAL151: B14_0 Mask              */\r
+#define LCD_PAL151_I1_Pos                                     31                                                        /*!< LCD PAL151: I1 Position             */\r
+#define LCD_PAL151_I1_Msk                                     (0x01UL << LCD_PAL151_I1_Pos)                             /*!< LCD PAL151: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL152  -------------------------------------------\r
+#define LCD_PAL152_R04_0_Pos                                  0                                                         /*!< LCD PAL152: R04_0 Position          */\r
+#define LCD_PAL152_R04_0_Msk                                  (0x1fUL << LCD_PAL152_R04_0_Pos)                          /*!< LCD PAL152: R04_0 Mask              */\r
+#define LCD_PAL152_G04_0_Pos                                  5                                                         /*!< LCD PAL152: G04_0 Position          */\r
+#define LCD_PAL152_G04_0_Msk                                  (0x1fUL << LCD_PAL152_G04_0_Pos)                          /*!< LCD PAL152: G04_0 Mask              */\r
+#define LCD_PAL152_B04_0_Pos                                  10                                                        /*!< LCD PAL152: B04_0 Position          */\r
+#define LCD_PAL152_B04_0_Msk                                  (0x1fUL << LCD_PAL152_B04_0_Pos)                          /*!< LCD PAL152: B04_0 Mask              */\r
+#define LCD_PAL152_I0_Pos                                     15                                                        /*!< LCD PAL152: I0 Position             */\r
+#define LCD_PAL152_I0_Msk                                     (0x01UL << LCD_PAL152_I0_Pos)                             /*!< LCD PAL152: I0 Mask                 */\r
+#define LCD_PAL152_R14_0_Pos                                  16                                                        /*!< LCD PAL152: R14_0 Position          */\r
+#define LCD_PAL152_R14_0_Msk                                  (0x1fUL << LCD_PAL152_R14_0_Pos)                          /*!< LCD PAL152: R14_0 Mask              */\r
+#define LCD_PAL152_G14_0_Pos                                  21                                                        /*!< LCD PAL152: G14_0 Position          */\r
+#define LCD_PAL152_G14_0_Msk                                  (0x1fUL << LCD_PAL152_G14_0_Pos)                          /*!< LCD PAL152: G14_0 Mask              */\r
+#define LCD_PAL152_B14_0_Pos                                  26                                                        /*!< LCD PAL152: B14_0 Position          */\r
+#define LCD_PAL152_B14_0_Msk                                  (0x1fUL << LCD_PAL152_B14_0_Pos)                          /*!< LCD PAL152: B14_0 Mask              */\r
+#define LCD_PAL152_I1_Pos                                     31                                                        /*!< LCD PAL152: I1 Position             */\r
+#define LCD_PAL152_I1_Msk                                     (0x01UL << LCD_PAL152_I1_Pos)                             /*!< LCD PAL152: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL153  -------------------------------------------\r
+#define LCD_PAL153_R04_0_Pos                                  0                                                         /*!< LCD PAL153: R04_0 Position          */\r
+#define LCD_PAL153_R04_0_Msk                                  (0x1fUL << LCD_PAL153_R04_0_Pos)                          /*!< LCD PAL153: R04_0 Mask              */\r
+#define LCD_PAL153_G04_0_Pos                                  5                                                         /*!< LCD PAL153: G04_0 Position          */\r
+#define LCD_PAL153_G04_0_Msk                                  (0x1fUL << LCD_PAL153_G04_0_Pos)                          /*!< LCD PAL153: G04_0 Mask              */\r
+#define LCD_PAL153_B04_0_Pos                                  10                                                        /*!< LCD PAL153: B04_0 Position          */\r
+#define LCD_PAL153_B04_0_Msk                                  (0x1fUL << LCD_PAL153_B04_0_Pos)                          /*!< LCD PAL153: B04_0 Mask              */\r
+#define LCD_PAL153_I0_Pos                                     15                                                        /*!< LCD PAL153: I0 Position             */\r
+#define LCD_PAL153_I0_Msk                                     (0x01UL << LCD_PAL153_I0_Pos)                             /*!< LCD PAL153: I0 Mask                 */\r
+#define LCD_PAL153_R14_0_Pos                                  16                                                        /*!< LCD PAL153: R14_0 Position          */\r
+#define LCD_PAL153_R14_0_Msk                                  (0x1fUL << LCD_PAL153_R14_0_Pos)                          /*!< LCD PAL153: R14_0 Mask              */\r
+#define LCD_PAL153_G14_0_Pos                                  21                                                        /*!< LCD PAL153: G14_0 Position          */\r
+#define LCD_PAL153_G14_0_Msk                                  (0x1fUL << LCD_PAL153_G14_0_Pos)                          /*!< LCD PAL153: G14_0 Mask              */\r
+#define LCD_PAL153_B14_0_Pos                                  26                                                        /*!< LCD PAL153: B14_0 Position          */\r
+#define LCD_PAL153_B14_0_Msk                                  (0x1fUL << LCD_PAL153_B14_0_Pos)                          /*!< LCD PAL153: B14_0 Mask              */\r
+#define LCD_PAL153_I1_Pos                                     31                                                        /*!< LCD PAL153: I1 Position             */\r
+#define LCD_PAL153_I1_Msk                                     (0x01UL << LCD_PAL153_I1_Pos)                             /*!< LCD PAL153: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL154  -------------------------------------------\r
+#define LCD_PAL154_R04_0_Pos                                  0                                                         /*!< LCD PAL154: R04_0 Position          */\r
+#define LCD_PAL154_R04_0_Msk                                  (0x1fUL << LCD_PAL154_R04_0_Pos)                          /*!< LCD PAL154: R04_0 Mask              */\r
+#define LCD_PAL154_G04_0_Pos                                  5                                                         /*!< LCD PAL154: G04_0 Position          */\r
+#define LCD_PAL154_G04_0_Msk                                  (0x1fUL << LCD_PAL154_G04_0_Pos)                          /*!< LCD PAL154: G04_0 Mask              */\r
+#define LCD_PAL154_B04_0_Pos                                  10                                                        /*!< LCD PAL154: B04_0 Position          */\r
+#define LCD_PAL154_B04_0_Msk                                  (0x1fUL << LCD_PAL154_B04_0_Pos)                          /*!< LCD PAL154: B04_0 Mask              */\r
+#define LCD_PAL154_I0_Pos                                     15                                                        /*!< LCD PAL154: I0 Position             */\r
+#define LCD_PAL154_I0_Msk                                     (0x01UL << LCD_PAL154_I0_Pos)                             /*!< LCD PAL154: I0 Mask                 */\r
+#define LCD_PAL154_R14_0_Pos                                  16                                                        /*!< LCD PAL154: R14_0 Position          */\r
+#define LCD_PAL154_R14_0_Msk                                  (0x1fUL << LCD_PAL154_R14_0_Pos)                          /*!< LCD PAL154: R14_0 Mask              */\r
+#define LCD_PAL154_G14_0_Pos                                  21                                                        /*!< LCD PAL154: G14_0 Position          */\r
+#define LCD_PAL154_G14_0_Msk                                  (0x1fUL << LCD_PAL154_G14_0_Pos)                          /*!< LCD PAL154: G14_0 Mask              */\r
+#define LCD_PAL154_B14_0_Pos                                  26                                                        /*!< LCD PAL154: B14_0 Position          */\r
+#define LCD_PAL154_B14_0_Msk                                  (0x1fUL << LCD_PAL154_B14_0_Pos)                          /*!< LCD PAL154: B14_0 Mask              */\r
+#define LCD_PAL154_I1_Pos                                     31                                                        /*!< LCD PAL154: I1 Position             */\r
+#define LCD_PAL154_I1_Msk                                     (0x01UL << LCD_PAL154_I1_Pos)                             /*!< LCD PAL154: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL155  -------------------------------------------\r
+#define LCD_PAL155_R04_0_Pos                                  0                                                         /*!< LCD PAL155: R04_0 Position          */\r
+#define LCD_PAL155_R04_0_Msk                                  (0x1fUL << LCD_PAL155_R04_0_Pos)                          /*!< LCD PAL155: R04_0 Mask              */\r
+#define LCD_PAL155_G04_0_Pos                                  5                                                         /*!< LCD PAL155: G04_0 Position          */\r
+#define LCD_PAL155_G04_0_Msk                                  (0x1fUL << LCD_PAL155_G04_0_Pos)                          /*!< LCD PAL155: G04_0 Mask              */\r
+#define LCD_PAL155_B04_0_Pos                                  10                                                        /*!< LCD PAL155: B04_0 Position          */\r
+#define LCD_PAL155_B04_0_Msk                                  (0x1fUL << LCD_PAL155_B04_0_Pos)                          /*!< LCD PAL155: B04_0 Mask              */\r
+#define LCD_PAL155_I0_Pos                                     15                                                        /*!< LCD PAL155: I0 Position             */\r
+#define LCD_PAL155_I0_Msk                                     (0x01UL << LCD_PAL155_I0_Pos)                             /*!< LCD PAL155: I0 Mask                 */\r
+#define LCD_PAL155_R14_0_Pos                                  16                                                        /*!< LCD PAL155: R14_0 Position          */\r
+#define LCD_PAL155_R14_0_Msk                                  (0x1fUL << LCD_PAL155_R14_0_Pos)                          /*!< LCD PAL155: R14_0 Mask              */\r
+#define LCD_PAL155_G14_0_Pos                                  21                                                        /*!< LCD PAL155: G14_0 Position          */\r
+#define LCD_PAL155_G14_0_Msk                                  (0x1fUL << LCD_PAL155_G14_0_Pos)                          /*!< LCD PAL155: G14_0 Mask              */\r
+#define LCD_PAL155_B14_0_Pos                                  26                                                        /*!< LCD PAL155: B14_0 Position          */\r
+#define LCD_PAL155_B14_0_Msk                                  (0x1fUL << LCD_PAL155_B14_0_Pos)                          /*!< LCD PAL155: B14_0 Mask              */\r
+#define LCD_PAL155_I1_Pos                                     31                                                        /*!< LCD PAL155: I1 Position             */\r
+#define LCD_PAL155_I1_Msk                                     (0x01UL << LCD_PAL155_I1_Pos)                             /*!< LCD PAL155: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL156  -------------------------------------------\r
+#define LCD_PAL156_R04_0_Pos                                  0                                                         /*!< LCD PAL156: R04_0 Position          */\r
+#define LCD_PAL156_R04_0_Msk                                  (0x1fUL << LCD_PAL156_R04_0_Pos)                          /*!< LCD PAL156: R04_0 Mask              */\r
+#define LCD_PAL156_G04_0_Pos                                  5                                                         /*!< LCD PAL156: G04_0 Position          */\r
+#define LCD_PAL156_G04_0_Msk                                  (0x1fUL << LCD_PAL156_G04_0_Pos)                          /*!< LCD PAL156: G04_0 Mask              */\r
+#define LCD_PAL156_B04_0_Pos                                  10                                                        /*!< LCD PAL156: B04_0 Position          */\r
+#define LCD_PAL156_B04_0_Msk                                  (0x1fUL << LCD_PAL156_B04_0_Pos)                          /*!< LCD PAL156: B04_0 Mask              */\r
+#define LCD_PAL156_I0_Pos                                     15                                                        /*!< LCD PAL156: I0 Position             */\r
+#define LCD_PAL156_I0_Msk                                     (0x01UL << LCD_PAL156_I0_Pos)                             /*!< LCD PAL156: I0 Mask                 */\r
+#define LCD_PAL156_R14_0_Pos                                  16                                                        /*!< LCD PAL156: R14_0 Position          */\r
+#define LCD_PAL156_R14_0_Msk                                  (0x1fUL << LCD_PAL156_R14_0_Pos)                          /*!< LCD PAL156: R14_0 Mask              */\r
+#define LCD_PAL156_G14_0_Pos                                  21                                                        /*!< LCD PAL156: G14_0 Position          */\r
+#define LCD_PAL156_G14_0_Msk                                  (0x1fUL << LCD_PAL156_G14_0_Pos)                          /*!< LCD PAL156: G14_0 Mask              */\r
+#define LCD_PAL156_B14_0_Pos                                  26                                                        /*!< LCD PAL156: B14_0 Position          */\r
+#define LCD_PAL156_B14_0_Msk                                  (0x1fUL << LCD_PAL156_B14_0_Pos)                          /*!< LCD PAL156: B14_0 Mask              */\r
+#define LCD_PAL156_I1_Pos                                     31                                                        /*!< LCD PAL156: I1 Position             */\r
+#define LCD_PAL156_I1_Msk                                     (0x01UL << LCD_PAL156_I1_Pos)                             /*!< LCD PAL156: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL157  -------------------------------------------\r
+#define LCD_PAL157_R04_0_Pos                                  0                                                         /*!< LCD PAL157: R04_0 Position          */\r
+#define LCD_PAL157_R04_0_Msk                                  (0x1fUL << LCD_PAL157_R04_0_Pos)                          /*!< LCD PAL157: R04_0 Mask              */\r
+#define LCD_PAL157_G04_0_Pos                                  5                                                         /*!< LCD PAL157: G04_0 Position          */\r
+#define LCD_PAL157_G04_0_Msk                                  (0x1fUL << LCD_PAL157_G04_0_Pos)                          /*!< LCD PAL157: G04_0 Mask              */\r
+#define LCD_PAL157_B04_0_Pos                                  10                                                        /*!< LCD PAL157: B04_0 Position          */\r
+#define LCD_PAL157_B04_0_Msk                                  (0x1fUL << LCD_PAL157_B04_0_Pos)                          /*!< LCD PAL157: B04_0 Mask              */\r
+#define LCD_PAL157_I0_Pos                                     15                                                        /*!< LCD PAL157: I0 Position             */\r
+#define LCD_PAL157_I0_Msk                                     (0x01UL << LCD_PAL157_I0_Pos)                             /*!< LCD PAL157: I0 Mask                 */\r
+#define LCD_PAL157_R14_0_Pos                                  16                                                        /*!< LCD PAL157: R14_0 Position          */\r
+#define LCD_PAL157_R14_0_Msk                                  (0x1fUL << LCD_PAL157_R14_0_Pos)                          /*!< LCD PAL157: R14_0 Mask              */\r
+#define LCD_PAL157_G14_0_Pos                                  21                                                        /*!< LCD PAL157: G14_0 Position          */\r
+#define LCD_PAL157_G14_0_Msk                                  (0x1fUL << LCD_PAL157_G14_0_Pos)                          /*!< LCD PAL157: G14_0 Mask              */\r
+#define LCD_PAL157_B14_0_Pos                                  26                                                        /*!< LCD PAL157: B14_0 Position          */\r
+#define LCD_PAL157_B14_0_Msk                                  (0x1fUL << LCD_PAL157_B14_0_Pos)                          /*!< LCD PAL157: B14_0 Mask              */\r
+#define LCD_PAL157_I1_Pos                                     31                                                        /*!< LCD PAL157: I1 Position             */\r
+#define LCD_PAL157_I1_Msk                                     (0x01UL << LCD_PAL157_I1_Pos)                             /*!< LCD PAL157: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL158  -------------------------------------------\r
+#define LCD_PAL158_R04_0_Pos                                  0                                                         /*!< LCD PAL158: R04_0 Position          */\r
+#define LCD_PAL158_R04_0_Msk                                  (0x1fUL << LCD_PAL158_R04_0_Pos)                          /*!< LCD PAL158: R04_0 Mask              */\r
+#define LCD_PAL158_G04_0_Pos                                  5                                                         /*!< LCD PAL158: G04_0 Position          */\r
+#define LCD_PAL158_G04_0_Msk                                  (0x1fUL << LCD_PAL158_G04_0_Pos)                          /*!< LCD PAL158: G04_0 Mask              */\r
+#define LCD_PAL158_B04_0_Pos                                  10                                                        /*!< LCD PAL158: B04_0 Position          */\r
+#define LCD_PAL158_B04_0_Msk                                  (0x1fUL << LCD_PAL158_B04_0_Pos)                          /*!< LCD PAL158: B04_0 Mask              */\r
+#define LCD_PAL158_I0_Pos                                     15                                                        /*!< LCD PAL158: I0 Position             */\r
+#define LCD_PAL158_I0_Msk                                     (0x01UL << LCD_PAL158_I0_Pos)                             /*!< LCD PAL158: I0 Mask                 */\r
+#define LCD_PAL158_R14_0_Pos                                  16                                                        /*!< LCD PAL158: R14_0 Position          */\r
+#define LCD_PAL158_R14_0_Msk                                  (0x1fUL << LCD_PAL158_R14_0_Pos)                          /*!< LCD PAL158: R14_0 Mask              */\r
+#define LCD_PAL158_G14_0_Pos                                  21                                                        /*!< LCD PAL158: G14_0 Position          */\r
+#define LCD_PAL158_G14_0_Msk                                  (0x1fUL << LCD_PAL158_G14_0_Pos)                          /*!< LCD PAL158: G14_0 Mask              */\r
+#define LCD_PAL158_B14_0_Pos                                  26                                                        /*!< LCD PAL158: B14_0 Position          */\r
+#define LCD_PAL158_B14_0_Msk                                  (0x1fUL << LCD_PAL158_B14_0_Pos)                          /*!< LCD PAL158: B14_0 Mask              */\r
+#define LCD_PAL158_I1_Pos                                     31                                                        /*!< LCD PAL158: I1 Position             */\r
+#define LCD_PAL158_I1_Msk                                     (0x01UL << LCD_PAL158_I1_Pos)                             /*!< LCD PAL158: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL159  -------------------------------------------\r
+#define LCD_PAL159_R04_0_Pos                                  0                                                         /*!< LCD PAL159: R04_0 Position          */\r
+#define LCD_PAL159_R04_0_Msk                                  (0x1fUL << LCD_PAL159_R04_0_Pos)                          /*!< LCD PAL159: R04_0 Mask              */\r
+#define LCD_PAL159_G04_0_Pos                                  5                                                         /*!< LCD PAL159: G04_0 Position          */\r
+#define LCD_PAL159_G04_0_Msk                                  (0x1fUL << LCD_PAL159_G04_0_Pos)                          /*!< LCD PAL159: G04_0 Mask              */\r
+#define LCD_PAL159_B04_0_Pos                                  10                                                        /*!< LCD PAL159: B04_0 Position          */\r
+#define LCD_PAL159_B04_0_Msk                                  (0x1fUL << LCD_PAL159_B04_0_Pos)                          /*!< LCD PAL159: B04_0 Mask              */\r
+#define LCD_PAL159_I0_Pos                                     15                                                        /*!< LCD PAL159: I0 Position             */\r
+#define LCD_PAL159_I0_Msk                                     (0x01UL << LCD_PAL159_I0_Pos)                             /*!< LCD PAL159: I0 Mask                 */\r
+#define LCD_PAL159_R14_0_Pos                                  16                                                        /*!< LCD PAL159: R14_0 Position          */\r
+#define LCD_PAL159_R14_0_Msk                                  (0x1fUL << LCD_PAL159_R14_0_Pos)                          /*!< LCD PAL159: R14_0 Mask              */\r
+#define LCD_PAL159_G14_0_Pos                                  21                                                        /*!< LCD PAL159: G14_0 Position          */\r
+#define LCD_PAL159_G14_0_Msk                                  (0x1fUL << LCD_PAL159_G14_0_Pos)                          /*!< LCD PAL159: G14_0 Mask              */\r
+#define LCD_PAL159_B14_0_Pos                                  26                                                        /*!< LCD PAL159: B14_0 Position          */\r
+#define LCD_PAL159_B14_0_Msk                                  (0x1fUL << LCD_PAL159_B14_0_Pos)                          /*!< LCD PAL159: B14_0 Mask              */\r
+#define LCD_PAL159_I1_Pos                                     31                                                        /*!< LCD PAL159: I1 Position             */\r
+#define LCD_PAL159_I1_Msk                                     (0x01UL << LCD_PAL159_I1_Pos)                             /*!< LCD PAL159: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL160  -------------------------------------------\r
+#define LCD_PAL160_R04_0_Pos                                  0                                                         /*!< LCD PAL160: R04_0 Position          */\r
+#define LCD_PAL160_R04_0_Msk                                  (0x1fUL << LCD_PAL160_R04_0_Pos)                          /*!< LCD PAL160: R04_0 Mask              */\r
+#define LCD_PAL160_G04_0_Pos                                  5                                                         /*!< LCD PAL160: G04_0 Position          */\r
+#define LCD_PAL160_G04_0_Msk                                  (0x1fUL << LCD_PAL160_G04_0_Pos)                          /*!< LCD PAL160: G04_0 Mask              */\r
+#define LCD_PAL160_B04_0_Pos                                  10                                                        /*!< LCD PAL160: B04_0 Position          */\r
+#define LCD_PAL160_B04_0_Msk                                  (0x1fUL << LCD_PAL160_B04_0_Pos)                          /*!< LCD PAL160: B04_0 Mask              */\r
+#define LCD_PAL160_I0_Pos                                     15                                                        /*!< LCD PAL160: I0 Position             */\r
+#define LCD_PAL160_I0_Msk                                     (0x01UL << LCD_PAL160_I0_Pos)                             /*!< LCD PAL160: I0 Mask                 */\r
+#define LCD_PAL160_R14_0_Pos                                  16                                                        /*!< LCD PAL160: R14_0 Position          */\r
+#define LCD_PAL160_R14_0_Msk                                  (0x1fUL << LCD_PAL160_R14_0_Pos)                          /*!< LCD PAL160: R14_0 Mask              */\r
+#define LCD_PAL160_G14_0_Pos                                  21                                                        /*!< LCD PAL160: G14_0 Position          */\r
+#define LCD_PAL160_G14_0_Msk                                  (0x1fUL << LCD_PAL160_G14_0_Pos)                          /*!< LCD PAL160: G14_0 Mask              */\r
+#define LCD_PAL160_B14_0_Pos                                  26                                                        /*!< LCD PAL160: B14_0 Position          */\r
+#define LCD_PAL160_B14_0_Msk                                  (0x1fUL << LCD_PAL160_B14_0_Pos)                          /*!< LCD PAL160: B14_0 Mask              */\r
+#define LCD_PAL160_I1_Pos                                     31                                                        /*!< LCD PAL160: I1 Position             */\r
+#define LCD_PAL160_I1_Msk                                     (0x01UL << LCD_PAL160_I1_Pos)                             /*!< LCD PAL160: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL161  -------------------------------------------\r
+#define LCD_PAL161_R04_0_Pos                                  0                                                         /*!< LCD PAL161: R04_0 Position          */\r
+#define LCD_PAL161_R04_0_Msk                                  (0x1fUL << LCD_PAL161_R04_0_Pos)                          /*!< LCD PAL161: R04_0 Mask              */\r
+#define LCD_PAL161_G04_0_Pos                                  5                                                         /*!< LCD PAL161: G04_0 Position          */\r
+#define LCD_PAL161_G04_0_Msk                                  (0x1fUL << LCD_PAL161_G04_0_Pos)                          /*!< LCD PAL161: G04_0 Mask              */\r
+#define LCD_PAL161_B04_0_Pos                                  10                                                        /*!< LCD PAL161: B04_0 Position          */\r
+#define LCD_PAL161_B04_0_Msk                                  (0x1fUL << LCD_PAL161_B04_0_Pos)                          /*!< LCD PAL161: B04_0 Mask              */\r
+#define LCD_PAL161_I0_Pos                                     15                                                        /*!< LCD PAL161: I0 Position             */\r
+#define LCD_PAL161_I0_Msk                                     (0x01UL << LCD_PAL161_I0_Pos)                             /*!< LCD PAL161: I0 Mask                 */\r
+#define LCD_PAL161_R14_0_Pos                                  16                                                        /*!< LCD PAL161: R14_0 Position          */\r
+#define LCD_PAL161_R14_0_Msk                                  (0x1fUL << LCD_PAL161_R14_0_Pos)                          /*!< LCD PAL161: R14_0 Mask              */\r
+#define LCD_PAL161_G14_0_Pos                                  21                                                        /*!< LCD PAL161: G14_0 Position          */\r
+#define LCD_PAL161_G14_0_Msk                                  (0x1fUL << LCD_PAL161_G14_0_Pos)                          /*!< LCD PAL161: G14_0 Mask              */\r
+#define LCD_PAL161_B14_0_Pos                                  26                                                        /*!< LCD PAL161: B14_0 Position          */\r
+#define LCD_PAL161_B14_0_Msk                                  (0x1fUL << LCD_PAL161_B14_0_Pos)                          /*!< LCD PAL161: B14_0 Mask              */\r
+#define LCD_PAL161_I1_Pos                                     31                                                        /*!< LCD PAL161: I1 Position             */\r
+#define LCD_PAL161_I1_Msk                                     (0x01UL << LCD_PAL161_I1_Pos)                             /*!< LCD PAL161: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL162  -------------------------------------------\r
+#define LCD_PAL162_R04_0_Pos                                  0                                                         /*!< LCD PAL162: R04_0 Position          */\r
+#define LCD_PAL162_R04_0_Msk                                  (0x1fUL << LCD_PAL162_R04_0_Pos)                          /*!< LCD PAL162: R04_0 Mask              */\r
+#define LCD_PAL162_G04_0_Pos                                  5                                                         /*!< LCD PAL162: G04_0 Position          */\r
+#define LCD_PAL162_G04_0_Msk                                  (0x1fUL << LCD_PAL162_G04_0_Pos)                          /*!< LCD PAL162: G04_0 Mask              */\r
+#define LCD_PAL162_B04_0_Pos                                  10                                                        /*!< LCD PAL162: B04_0 Position          */\r
+#define LCD_PAL162_B04_0_Msk                                  (0x1fUL << LCD_PAL162_B04_0_Pos)                          /*!< LCD PAL162: B04_0 Mask              */\r
+#define LCD_PAL162_I0_Pos                                     15                                                        /*!< LCD PAL162: I0 Position             */\r
+#define LCD_PAL162_I0_Msk                                     (0x01UL << LCD_PAL162_I0_Pos)                             /*!< LCD PAL162: I0 Mask                 */\r
+#define LCD_PAL162_R14_0_Pos                                  16                                                        /*!< LCD PAL162: R14_0 Position          */\r
+#define LCD_PAL162_R14_0_Msk                                  (0x1fUL << LCD_PAL162_R14_0_Pos)                          /*!< LCD PAL162: R14_0 Mask              */\r
+#define LCD_PAL162_G14_0_Pos                                  21                                                        /*!< LCD PAL162: G14_0 Position          */\r
+#define LCD_PAL162_G14_0_Msk                                  (0x1fUL << LCD_PAL162_G14_0_Pos)                          /*!< LCD PAL162: G14_0 Mask              */\r
+#define LCD_PAL162_B14_0_Pos                                  26                                                        /*!< LCD PAL162: B14_0 Position          */\r
+#define LCD_PAL162_B14_0_Msk                                  (0x1fUL << LCD_PAL162_B14_0_Pos)                          /*!< LCD PAL162: B14_0 Mask              */\r
+#define LCD_PAL162_I1_Pos                                     31                                                        /*!< LCD PAL162: I1 Position             */\r
+#define LCD_PAL162_I1_Msk                                     (0x01UL << LCD_PAL162_I1_Pos)                             /*!< LCD PAL162: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL163  -------------------------------------------\r
+#define LCD_PAL163_R04_0_Pos                                  0                                                         /*!< LCD PAL163: R04_0 Position          */\r
+#define LCD_PAL163_R04_0_Msk                                  (0x1fUL << LCD_PAL163_R04_0_Pos)                          /*!< LCD PAL163: R04_0 Mask              */\r
+#define LCD_PAL163_G04_0_Pos                                  5                                                         /*!< LCD PAL163: G04_0 Position          */\r
+#define LCD_PAL163_G04_0_Msk                                  (0x1fUL << LCD_PAL163_G04_0_Pos)                          /*!< LCD PAL163: G04_0 Mask              */\r
+#define LCD_PAL163_B04_0_Pos                                  10                                                        /*!< LCD PAL163: B04_0 Position          */\r
+#define LCD_PAL163_B04_0_Msk                                  (0x1fUL << LCD_PAL163_B04_0_Pos)                          /*!< LCD PAL163: B04_0 Mask              */\r
+#define LCD_PAL163_I0_Pos                                     15                                                        /*!< LCD PAL163: I0 Position             */\r
+#define LCD_PAL163_I0_Msk                                     (0x01UL << LCD_PAL163_I0_Pos)                             /*!< LCD PAL163: I0 Mask                 */\r
+#define LCD_PAL163_R14_0_Pos                                  16                                                        /*!< LCD PAL163: R14_0 Position          */\r
+#define LCD_PAL163_R14_0_Msk                                  (0x1fUL << LCD_PAL163_R14_0_Pos)                          /*!< LCD PAL163: R14_0 Mask              */\r
+#define LCD_PAL163_G14_0_Pos                                  21                                                        /*!< LCD PAL163: G14_0 Position          */\r
+#define LCD_PAL163_G14_0_Msk                                  (0x1fUL << LCD_PAL163_G14_0_Pos)                          /*!< LCD PAL163: G14_0 Mask              */\r
+#define LCD_PAL163_B14_0_Pos                                  26                                                        /*!< LCD PAL163: B14_0 Position          */\r
+#define LCD_PAL163_B14_0_Msk                                  (0x1fUL << LCD_PAL163_B14_0_Pos)                          /*!< LCD PAL163: B14_0 Mask              */\r
+#define LCD_PAL163_I1_Pos                                     31                                                        /*!< LCD PAL163: I1 Position             */\r
+#define LCD_PAL163_I1_Msk                                     (0x01UL << LCD_PAL163_I1_Pos)                             /*!< LCD PAL163: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL164  -------------------------------------------\r
+#define LCD_PAL164_R04_0_Pos                                  0                                                         /*!< LCD PAL164: R04_0 Position          */\r
+#define LCD_PAL164_R04_0_Msk                                  (0x1fUL << LCD_PAL164_R04_0_Pos)                          /*!< LCD PAL164: R04_0 Mask              */\r
+#define LCD_PAL164_G04_0_Pos                                  5                                                         /*!< LCD PAL164: G04_0 Position          */\r
+#define LCD_PAL164_G04_0_Msk                                  (0x1fUL << LCD_PAL164_G04_0_Pos)                          /*!< LCD PAL164: G04_0 Mask              */\r
+#define LCD_PAL164_B04_0_Pos                                  10                                                        /*!< LCD PAL164: B04_0 Position          */\r
+#define LCD_PAL164_B04_0_Msk                                  (0x1fUL << LCD_PAL164_B04_0_Pos)                          /*!< LCD PAL164: B04_0 Mask              */\r
+#define LCD_PAL164_I0_Pos                                     15                                                        /*!< LCD PAL164: I0 Position             */\r
+#define LCD_PAL164_I0_Msk                                     (0x01UL << LCD_PAL164_I0_Pos)                             /*!< LCD PAL164: I0 Mask                 */\r
+#define LCD_PAL164_R14_0_Pos                                  16                                                        /*!< LCD PAL164: R14_0 Position          */\r
+#define LCD_PAL164_R14_0_Msk                                  (0x1fUL << LCD_PAL164_R14_0_Pos)                          /*!< LCD PAL164: R14_0 Mask              */\r
+#define LCD_PAL164_G14_0_Pos                                  21                                                        /*!< LCD PAL164: G14_0 Position          */\r
+#define LCD_PAL164_G14_0_Msk                                  (0x1fUL << LCD_PAL164_G14_0_Pos)                          /*!< LCD PAL164: G14_0 Mask              */\r
+#define LCD_PAL164_B14_0_Pos                                  26                                                        /*!< LCD PAL164: B14_0 Position          */\r
+#define LCD_PAL164_B14_0_Msk                                  (0x1fUL << LCD_PAL164_B14_0_Pos)                          /*!< LCD PAL164: B14_0 Mask              */\r
+#define LCD_PAL164_I1_Pos                                     31                                                        /*!< LCD PAL164: I1 Position             */\r
+#define LCD_PAL164_I1_Msk                                     (0x01UL << LCD_PAL164_I1_Pos)                             /*!< LCD PAL164: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL165  -------------------------------------------\r
+#define LCD_PAL165_R04_0_Pos                                  0                                                         /*!< LCD PAL165: R04_0 Position          */\r
+#define LCD_PAL165_R04_0_Msk                                  (0x1fUL << LCD_PAL165_R04_0_Pos)                          /*!< LCD PAL165: R04_0 Mask              */\r
+#define LCD_PAL165_G04_0_Pos                                  5                                                         /*!< LCD PAL165: G04_0 Position          */\r
+#define LCD_PAL165_G04_0_Msk                                  (0x1fUL << LCD_PAL165_G04_0_Pos)                          /*!< LCD PAL165: G04_0 Mask              */\r
+#define LCD_PAL165_B04_0_Pos                                  10                                                        /*!< LCD PAL165: B04_0 Position          */\r
+#define LCD_PAL165_B04_0_Msk                                  (0x1fUL << LCD_PAL165_B04_0_Pos)                          /*!< LCD PAL165: B04_0 Mask              */\r
+#define LCD_PAL165_I0_Pos                                     15                                                        /*!< LCD PAL165: I0 Position             */\r
+#define LCD_PAL165_I0_Msk                                     (0x01UL << LCD_PAL165_I0_Pos)                             /*!< LCD PAL165: I0 Mask                 */\r
+#define LCD_PAL165_R14_0_Pos                                  16                                                        /*!< LCD PAL165: R14_0 Position          */\r
+#define LCD_PAL165_R14_0_Msk                                  (0x1fUL << LCD_PAL165_R14_0_Pos)                          /*!< LCD PAL165: R14_0 Mask              */\r
+#define LCD_PAL165_G14_0_Pos                                  21                                                        /*!< LCD PAL165: G14_0 Position          */\r
+#define LCD_PAL165_G14_0_Msk                                  (0x1fUL << LCD_PAL165_G14_0_Pos)                          /*!< LCD PAL165: G14_0 Mask              */\r
+#define LCD_PAL165_B14_0_Pos                                  26                                                        /*!< LCD PAL165: B14_0 Position          */\r
+#define LCD_PAL165_B14_0_Msk                                  (0x1fUL << LCD_PAL165_B14_0_Pos)                          /*!< LCD PAL165: B14_0 Mask              */\r
+#define LCD_PAL165_I1_Pos                                     31                                                        /*!< LCD PAL165: I1 Position             */\r
+#define LCD_PAL165_I1_Msk                                     (0x01UL << LCD_PAL165_I1_Pos)                             /*!< LCD PAL165: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL166  -------------------------------------------\r
+#define LCD_PAL166_R04_0_Pos                                  0                                                         /*!< LCD PAL166: R04_0 Position          */\r
+#define LCD_PAL166_R04_0_Msk                                  (0x1fUL << LCD_PAL166_R04_0_Pos)                          /*!< LCD PAL166: R04_0 Mask              */\r
+#define LCD_PAL166_G04_0_Pos                                  5                                                         /*!< LCD PAL166: G04_0 Position          */\r
+#define LCD_PAL166_G04_0_Msk                                  (0x1fUL << LCD_PAL166_G04_0_Pos)                          /*!< LCD PAL166: G04_0 Mask              */\r
+#define LCD_PAL166_B04_0_Pos                                  10                                                        /*!< LCD PAL166: B04_0 Position          */\r
+#define LCD_PAL166_B04_0_Msk                                  (0x1fUL << LCD_PAL166_B04_0_Pos)                          /*!< LCD PAL166: B04_0 Mask              */\r
+#define LCD_PAL166_I0_Pos                                     15                                                        /*!< LCD PAL166: I0 Position             */\r
+#define LCD_PAL166_I0_Msk                                     (0x01UL << LCD_PAL166_I0_Pos)                             /*!< LCD PAL166: I0 Mask                 */\r
+#define LCD_PAL166_R14_0_Pos                                  16                                                        /*!< LCD PAL166: R14_0 Position          */\r
+#define LCD_PAL166_R14_0_Msk                                  (0x1fUL << LCD_PAL166_R14_0_Pos)                          /*!< LCD PAL166: R14_0 Mask              */\r
+#define LCD_PAL166_G14_0_Pos                                  21                                                        /*!< LCD PAL166: G14_0 Position          */\r
+#define LCD_PAL166_G14_0_Msk                                  (0x1fUL << LCD_PAL166_G14_0_Pos)                          /*!< LCD PAL166: G14_0 Mask              */\r
+#define LCD_PAL166_B14_0_Pos                                  26                                                        /*!< LCD PAL166: B14_0 Position          */\r
+#define LCD_PAL166_B14_0_Msk                                  (0x1fUL << LCD_PAL166_B14_0_Pos)                          /*!< LCD PAL166: B14_0 Mask              */\r
+#define LCD_PAL166_I1_Pos                                     31                                                        /*!< LCD PAL166: I1 Position             */\r
+#define LCD_PAL166_I1_Msk                                     (0x01UL << LCD_PAL166_I1_Pos)                             /*!< LCD PAL166: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL167  -------------------------------------------\r
+#define LCD_PAL167_R04_0_Pos                                  0                                                         /*!< LCD PAL167: R04_0 Position          */\r
+#define LCD_PAL167_R04_0_Msk                                  (0x1fUL << LCD_PAL167_R04_0_Pos)                          /*!< LCD PAL167: R04_0 Mask              */\r
+#define LCD_PAL167_G04_0_Pos                                  5                                                         /*!< LCD PAL167: G04_0 Position          */\r
+#define LCD_PAL167_G04_0_Msk                                  (0x1fUL << LCD_PAL167_G04_0_Pos)                          /*!< LCD PAL167: G04_0 Mask              */\r
+#define LCD_PAL167_B04_0_Pos                                  10                                                        /*!< LCD PAL167: B04_0 Position          */\r
+#define LCD_PAL167_B04_0_Msk                                  (0x1fUL << LCD_PAL167_B04_0_Pos)                          /*!< LCD PAL167: B04_0 Mask              */\r
+#define LCD_PAL167_I0_Pos                                     15                                                        /*!< LCD PAL167: I0 Position             */\r
+#define LCD_PAL167_I0_Msk                                     (0x01UL << LCD_PAL167_I0_Pos)                             /*!< LCD PAL167: I0 Mask                 */\r
+#define LCD_PAL167_R14_0_Pos                                  16                                                        /*!< LCD PAL167: R14_0 Position          */\r
+#define LCD_PAL167_R14_0_Msk                                  (0x1fUL << LCD_PAL167_R14_0_Pos)                          /*!< LCD PAL167: R14_0 Mask              */\r
+#define LCD_PAL167_G14_0_Pos                                  21                                                        /*!< LCD PAL167: G14_0 Position          */\r
+#define LCD_PAL167_G14_0_Msk                                  (0x1fUL << LCD_PAL167_G14_0_Pos)                          /*!< LCD PAL167: G14_0 Mask              */\r
+#define LCD_PAL167_B14_0_Pos                                  26                                                        /*!< LCD PAL167: B14_0 Position          */\r
+#define LCD_PAL167_B14_0_Msk                                  (0x1fUL << LCD_PAL167_B14_0_Pos)                          /*!< LCD PAL167: B14_0 Mask              */\r
+#define LCD_PAL167_I1_Pos                                     31                                                        /*!< LCD PAL167: I1 Position             */\r
+#define LCD_PAL167_I1_Msk                                     (0x01UL << LCD_PAL167_I1_Pos)                             /*!< LCD PAL167: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL168  -------------------------------------------\r
+#define LCD_PAL168_R04_0_Pos                                  0                                                         /*!< LCD PAL168: R04_0 Position          */\r
+#define LCD_PAL168_R04_0_Msk                                  (0x1fUL << LCD_PAL168_R04_0_Pos)                          /*!< LCD PAL168: R04_0 Mask              */\r
+#define LCD_PAL168_G04_0_Pos                                  5                                                         /*!< LCD PAL168: G04_0 Position          */\r
+#define LCD_PAL168_G04_0_Msk                                  (0x1fUL << LCD_PAL168_G04_0_Pos)                          /*!< LCD PAL168: G04_0 Mask              */\r
+#define LCD_PAL168_B04_0_Pos                                  10                                                        /*!< LCD PAL168: B04_0 Position          */\r
+#define LCD_PAL168_B04_0_Msk                                  (0x1fUL << LCD_PAL168_B04_0_Pos)                          /*!< LCD PAL168: B04_0 Mask              */\r
+#define LCD_PAL168_I0_Pos                                     15                                                        /*!< LCD PAL168: I0 Position             */\r
+#define LCD_PAL168_I0_Msk                                     (0x01UL << LCD_PAL168_I0_Pos)                             /*!< LCD PAL168: I0 Mask                 */\r
+#define LCD_PAL168_R14_0_Pos                                  16                                                        /*!< LCD PAL168: R14_0 Position          */\r
+#define LCD_PAL168_R14_0_Msk                                  (0x1fUL << LCD_PAL168_R14_0_Pos)                          /*!< LCD PAL168: R14_0 Mask              */\r
+#define LCD_PAL168_G14_0_Pos                                  21                                                        /*!< LCD PAL168: G14_0 Position          */\r
+#define LCD_PAL168_G14_0_Msk                                  (0x1fUL << LCD_PAL168_G14_0_Pos)                          /*!< LCD PAL168: G14_0 Mask              */\r
+#define LCD_PAL168_B14_0_Pos                                  26                                                        /*!< LCD PAL168: B14_0 Position          */\r
+#define LCD_PAL168_B14_0_Msk                                  (0x1fUL << LCD_PAL168_B14_0_Pos)                          /*!< LCD PAL168: B14_0 Mask              */\r
+#define LCD_PAL168_I1_Pos                                     31                                                        /*!< LCD PAL168: I1 Position             */\r
+#define LCD_PAL168_I1_Msk                                     (0x01UL << LCD_PAL168_I1_Pos)                             /*!< LCD PAL168: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL169  -------------------------------------------\r
+#define LCD_PAL169_R04_0_Pos                                  0                                                         /*!< LCD PAL169: R04_0 Position          */\r
+#define LCD_PAL169_R04_0_Msk                                  (0x1fUL << LCD_PAL169_R04_0_Pos)                          /*!< LCD PAL169: R04_0 Mask              */\r
+#define LCD_PAL169_G04_0_Pos                                  5                                                         /*!< LCD PAL169: G04_0 Position          */\r
+#define LCD_PAL169_G04_0_Msk                                  (0x1fUL << LCD_PAL169_G04_0_Pos)                          /*!< LCD PAL169: G04_0 Mask              */\r
+#define LCD_PAL169_B04_0_Pos                                  10                                                        /*!< LCD PAL169: B04_0 Position          */\r
+#define LCD_PAL169_B04_0_Msk                                  (0x1fUL << LCD_PAL169_B04_0_Pos)                          /*!< LCD PAL169: B04_0 Mask              */\r
+#define LCD_PAL169_I0_Pos                                     15                                                        /*!< LCD PAL169: I0 Position             */\r
+#define LCD_PAL169_I0_Msk                                     (0x01UL << LCD_PAL169_I0_Pos)                             /*!< LCD PAL169: I0 Mask                 */\r
+#define LCD_PAL169_R14_0_Pos                                  16                                                        /*!< LCD PAL169: R14_0 Position          */\r
+#define LCD_PAL169_R14_0_Msk                                  (0x1fUL << LCD_PAL169_R14_0_Pos)                          /*!< LCD PAL169: R14_0 Mask              */\r
+#define LCD_PAL169_G14_0_Pos                                  21                                                        /*!< LCD PAL169: G14_0 Position          */\r
+#define LCD_PAL169_G14_0_Msk                                  (0x1fUL << LCD_PAL169_G14_0_Pos)                          /*!< LCD PAL169: G14_0 Mask              */\r
+#define LCD_PAL169_B14_0_Pos                                  26                                                        /*!< LCD PAL169: B14_0 Position          */\r
+#define LCD_PAL169_B14_0_Msk                                  (0x1fUL << LCD_PAL169_B14_0_Pos)                          /*!< LCD PAL169: B14_0 Mask              */\r
+#define LCD_PAL169_I1_Pos                                     31                                                        /*!< LCD PAL169: I1 Position             */\r
+#define LCD_PAL169_I1_Msk                                     (0x01UL << LCD_PAL169_I1_Pos)                             /*!< LCD PAL169: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL170  -------------------------------------------\r
+#define LCD_PAL170_R04_0_Pos                                  0                                                         /*!< LCD PAL170: R04_0 Position          */\r
+#define LCD_PAL170_R04_0_Msk                                  (0x1fUL << LCD_PAL170_R04_0_Pos)                          /*!< LCD PAL170: R04_0 Mask              */\r
+#define LCD_PAL170_G04_0_Pos                                  5                                                         /*!< LCD PAL170: G04_0 Position          */\r
+#define LCD_PAL170_G04_0_Msk                                  (0x1fUL << LCD_PAL170_G04_0_Pos)                          /*!< LCD PAL170: G04_0 Mask              */\r
+#define LCD_PAL170_B04_0_Pos                                  10                                                        /*!< LCD PAL170: B04_0 Position          */\r
+#define LCD_PAL170_B04_0_Msk                                  (0x1fUL << LCD_PAL170_B04_0_Pos)                          /*!< LCD PAL170: B04_0 Mask              */\r
+#define LCD_PAL170_I0_Pos                                     15                                                        /*!< LCD PAL170: I0 Position             */\r
+#define LCD_PAL170_I0_Msk                                     (0x01UL << LCD_PAL170_I0_Pos)                             /*!< LCD PAL170: I0 Mask                 */\r
+#define LCD_PAL170_R14_0_Pos                                  16                                                        /*!< LCD PAL170: R14_0 Position          */\r
+#define LCD_PAL170_R14_0_Msk                                  (0x1fUL << LCD_PAL170_R14_0_Pos)                          /*!< LCD PAL170: R14_0 Mask              */\r
+#define LCD_PAL170_G14_0_Pos                                  21                                                        /*!< LCD PAL170: G14_0 Position          */\r
+#define LCD_PAL170_G14_0_Msk                                  (0x1fUL << LCD_PAL170_G14_0_Pos)                          /*!< LCD PAL170: G14_0 Mask              */\r
+#define LCD_PAL170_B14_0_Pos                                  26                                                        /*!< LCD PAL170: B14_0 Position          */\r
+#define LCD_PAL170_B14_0_Msk                                  (0x1fUL << LCD_PAL170_B14_0_Pos)                          /*!< LCD PAL170: B14_0 Mask              */\r
+#define LCD_PAL170_I1_Pos                                     31                                                        /*!< LCD PAL170: I1 Position             */\r
+#define LCD_PAL170_I1_Msk                                     (0x01UL << LCD_PAL170_I1_Pos)                             /*!< LCD PAL170: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL171  -------------------------------------------\r
+#define LCD_PAL171_R04_0_Pos                                  0                                                         /*!< LCD PAL171: R04_0 Position          */\r
+#define LCD_PAL171_R04_0_Msk                                  (0x1fUL << LCD_PAL171_R04_0_Pos)                          /*!< LCD PAL171: R04_0 Mask              */\r
+#define LCD_PAL171_G04_0_Pos                                  5                                                         /*!< LCD PAL171: G04_0 Position          */\r
+#define LCD_PAL171_G04_0_Msk                                  (0x1fUL << LCD_PAL171_G04_0_Pos)                          /*!< LCD PAL171: G04_0 Mask              */\r
+#define LCD_PAL171_B04_0_Pos                                  10                                                        /*!< LCD PAL171: B04_0 Position          */\r
+#define LCD_PAL171_B04_0_Msk                                  (0x1fUL << LCD_PAL171_B04_0_Pos)                          /*!< LCD PAL171: B04_0 Mask              */\r
+#define LCD_PAL171_I0_Pos                                     15                                                        /*!< LCD PAL171: I0 Position             */\r
+#define LCD_PAL171_I0_Msk                                     (0x01UL << LCD_PAL171_I0_Pos)                             /*!< LCD PAL171: I0 Mask                 */\r
+#define LCD_PAL171_R14_0_Pos                                  16                                                        /*!< LCD PAL171: R14_0 Position          */\r
+#define LCD_PAL171_R14_0_Msk                                  (0x1fUL << LCD_PAL171_R14_0_Pos)                          /*!< LCD PAL171: R14_0 Mask              */\r
+#define LCD_PAL171_G14_0_Pos                                  21                                                        /*!< LCD PAL171: G14_0 Position          */\r
+#define LCD_PAL171_G14_0_Msk                                  (0x1fUL << LCD_PAL171_G14_0_Pos)                          /*!< LCD PAL171: G14_0 Mask              */\r
+#define LCD_PAL171_B14_0_Pos                                  26                                                        /*!< LCD PAL171: B14_0 Position          */\r
+#define LCD_PAL171_B14_0_Msk                                  (0x1fUL << LCD_PAL171_B14_0_Pos)                          /*!< LCD PAL171: B14_0 Mask              */\r
+#define LCD_PAL171_I1_Pos                                     31                                                        /*!< LCD PAL171: I1 Position             */\r
+#define LCD_PAL171_I1_Msk                                     (0x01UL << LCD_PAL171_I1_Pos)                             /*!< LCD PAL171: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL172  -------------------------------------------\r
+#define LCD_PAL172_R04_0_Pos                                  0                                                         /*!< LCD PAL172: R04_0 Position          */\r
+#define LCD_PAL172_R04_0_Msk                                  (0x1fUL << LCD_PAL172_R04_0_Pos)                          /*!< LCD PAL172: R04_0 Mask              */\r
+#define LCD_PAL172_G04_0_Pos                                  5                                                         /*!< LCD PAL172: G04_0 Position          */\r
+#define LCD_PAL172_G04_0_Msk                                  (0x1fUL << LCD_PAL172_G04_0_Pos)                          /*!< LCD PAL172: G04_0 Mask              */\r
+#define LCD_PAL172_B04_0_Pos                                  10                                                        /*!< LCD PAL172: B04_0 Position          */\r
+#define LCD_PAL172_B04_0_Msk                                  (0x1fUL << LCD_PAL172_B04_0_Pos)                          /*!< LCD PAL172: B04_0 Mask              */\r
+#define LCD_PAL172_I0_Pos                                     15                                                        /*!< LCD PAL172: I0 Position             */\r
+#define LCD_PAL172_I0_Msk                                     (0x01UL << LCD_PAL172_I0_Pos)                             /*!< LCD PAL172: I0 Mask                 */\r
+#define LCD_PAL172_R14_0_Pos                                  16                                                        /*!< LCD PAL172: R14_0 Position          */\r
+#define LCD_PAL172_R14_0_Msk                                  (0x1fUL << LCD_PAL172_R14_0_Pos)                          /*!< LCD PAL172: R14_0 Mask              */\r
+#define LCD_PAL172_G14_0_Pos                                  21                                                        /*!< LCD PAL172: G14_0 Position          */\r
+#define LCD_PAL172_G14_0_Msk                                  (0x1fUL << LCD_PAL172_G14_0_Pos)                          /*!< LCD PAL172: G14_0 Mask              */\r
+#define LCD_PAL172_B14_0_Pos                                  26                                                        /*!< LCD PAL172: B14_0 Position          */\r
+#define LCD_PAL172_B14_0_Msk                                  (0x1fUL << LCD_PAL172_B14_0_Pos)                          /*!< LCD PAL172: B14_0 Mask              */\r
+#define LCD_PAL172_I1_Pos                                     31                                                        /*!< LCD PAL172: I1 Position             */\r
+#define LCD_PAL172_I1_Msk                                     (0x01UL << LCD_PAL172_I1_Pos)                             /*!< LCD PAL172: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL173  -------------------------------------------\r
+#define LCD_PAL173_R04_0_Pos                                  0                                                         /*!< LCD PAL173: R04_0 Position          */\r
+#define LCD_PAL173_R04_0_Msk                                  (0x1fUL << LCD_PAL173_R04_0_Pos)                          /*!< LCD PAL173: R04_0 Mask              */\r
+#define LCD_PAL173_G04_0_Pos                                  5                                                         /*!< LCD PAL173: G04_0 Position          */\r
+#define LCD_PAL173_G04_0_Msk                                  (0x1fUL << LCD_PAL173_G04_0_Pos)                          /*!< LCD PAL173: G04_0 Mask              */\r
+#define LCD_PAL173_B04_0_Pos                                  10                                                        /*!< LCD PAL173: B04_0 Position          */\r
+#define LCD_PAL173_B04_0_Msk                                  (0x1fUL << LCD_PAL173_B04_0_Pos)                          /*!< LCD PAL173: B04_0 Mask              */\r
+#define LCD_PAL173_I0_Pos                                     15                                                        /*!< LCD PAL173: I0 Position             */\r
+#define LCD_PAL173_I0_Msk                                     (0x01UL << LCD_PAL173_I0_Pos)                             /*!< LCD PAL173: I0 Mask                 */\r
+#define LCD_PAL173_R14_0_Pos                                  16                                                        /*!< LCD PAL173: R14_0 Position          */\r
+#define LCD_PAL173_R14_0_Msk                                  (0x1fUL << LCD_PAL173_R14_0_Pos)                          /*!< LCD PAL173: R14_0 Mask              */\r
+#define LCD_PAL173_G14_0_Pos                                  21                                                        /*!< LCD PAL173: G14_0 Position          */\r
+#define LCD_PAL173_G14_0_Msk                                  (0x1fUL << LCD_PAL173_G14_0_Pos)                          /*!< LCD PAL173: G14_0 Mask              */\r
+#define LCD_PAL173_B14_0_Pos                                  26                                                        /*!< LCD PAL173: B14_0 Position          */\r
+#define LCD_PAL173_B14_0_Msk                                  (0x1fUL << LCD_PAL173_B14_0_Pos)                          /*!< LCD PAL173: B14_0 Mask              */\r
+#define LCD_PAL173_I1_Pos                                     31                                                        /*!< LCD PAL173: I1 Position             */\r
+#define LCD_PAL173_I1_Msk                                     (0x01UL << LCD_PAL173_I1_Pos)                             /*!< LCD PAL173: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL174  -------------------------------------------\r
+#define LCD_PAL174_R04_0_Pos                                  0                                                         /*!< LCD PAL174: R04_0 Position          */\r
+#define LCD_PAL174_R04_0_Msk                                  (0x1fUL << LCD_PAL174_R04_0_Pos)                          /*!< LCD PAL174: R04_0 Mask              */\r
+#define LCD_PAL174_G04_0_Pos                                  5                                                         /*!< LCD PAL174: G04_0 Position          */\r
+#define LCD_PAL174_G04_0_Msk                                  (0x1fUL << LCD_PAL174_G04_0_Pos)                          /*!< LCD PAL174: G04_0 Mask              */\r
+#define LCD_PAL174_B04_0_Pos                                  10                                                        /*!< LCD PAL174: B04_0 Position          */\r
+#define LCD_PAL174_B04_0_Msk                                  (0x1fUL << LCD_PAL174_B04_0_Pos)                          /*!< LCD PAL174: B04_0 Mask              */\r
+#define LCD_PAL174_I0_Pos                                     15                                                        /*!< LCD PAL174: I0 Position             */\r
+#define LCD_PAL174_I0_Msk                                     (0x01UL << LCD_PAL174_I0_Pos)                             /*!< LCD PAL174: I0 Mask                 */\r
+#define LCD_PAL174_R14_0_Pos                                  16                                                        /*!< LCD PAL174: R14_0 Position          */\r
+#define LCD_PAL174_R14_0_Msk                                  (0x1fUL << LCD_PAL174_R14_0_Pos)                          /*!< LCD PAL174: R14_0 Mask              */\r
+#define LCD_PAL174_G14_0_Pos                                  21                                                        /*!< LCD PAL174: G14_0 Position          */\r
+#define LCD_PAL174_G14_0_Msk                                  (0x1fUL << LCD_PAL174_G14_0_Pos)                          /*!< LCD PAL174: G14_0 Mask              */\r
+#define LCD_PAL174_B14_0_Pos                                  26                                                        /*!< LCD PAL174: B14_0 Position          */\r
+#define LCD_PAL174_B14_0_Msk                                  (0x1fUL << LCD_PAL174_B14_0_Pos)                          /*!< LCD PAL174: B14_0 Mask              */\r
+#define LCD_PAL174_I1_Pos                                     31                                                        /*!< LCD PAL174: I1 Position             */\r
+#define LCD_PAL174_I1_Msk                                     (0x01UL << LCD_PAL174_I1_Pos)                             /*!< LCD PAL174: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL175  -------------------------------------------\r
+#define LCD_PAL175_R04_0_Pos                                  0                                                         /*!< LCD PAL175: R04_0 Position          */\r
+#define LCD_PAL175_R04_0_Msk                                  (0x1fUL << LCD_PAL175_R04_0_Pos)                          /*!< LCD PAL175: R04_0 Mask              */\r
+#define LCD_PAL175_G04_0_Pos                                  5                                                         /*!< LCD PAL175: G04_0 Position          */\r
+#define LCD_PAL175_G04_0_Msk                                  (0x1fUL << LCD_PAL175_G04_0_Pos)                          /*!< LCD PAL175: G04_0 Mask              */\r
+#define LCD_PAL175_B04_0_Pos                                  10                                                        /*!< LCD PAL175: B04_0 Position          */\r
+#define LCD_PAL175_B04_0_Msk                                  (0x1fUL << LCD_PAL175_B04_0_Pos)                          /*!< LCD PAL175: B04_0 Mask              */\r
+#define LCD_PAL175_I0_Pos                                     15                                                        /*!< LCD PAL175: I0 Position             */\r
+#define LCD_PAL175_I0_Msk                                     (0x01UL << LCD_PAL175_I0_Pos)                             /*!< LCD PAL175: I0 Mask                 */\r
+#define LCD_PAL175_R14_0_Pos                                  16                                                        /*!< LCD PAL175: R14_0 Position          */\r
+#define LCD_PAL175_R14_0_Msk                                  (0x1fUL << LCD_PAL175_R14_0_Pos)                          /*!< LCD PAL175: R14_0 Mask              */\r
+#define LCD_PAL175_G14_0_Pos                                  21                                                        /*!< LCD PAL175: G14_0 Position          */\r
+#define LCD_PAL175_G14_0_Msk                                  (0x1fUL << LCD_PAL175_G14_0_Pos)                          /*!< LCD PAL175: G14_0 Mask              */\r
+#define LCD_PAL175_B14_0_Pos                                  26                                                        /*!< LCD PAL175: B14_0 Position          */\r
+#define LCD_PAL175_B14_0_Msk                                  (0x1fUL << LCD_PAL175_B14_0_Pos)                          /*!< LCD PAL175: B14_0 Mask              */\r
+#define LCD_PAL175_I1_Pos                                     31                                                        /*!< LCD PAL175: I1 Position             */\r
+#define LCD_PAL175_I1_Msk                                     (0x01UL << LCD_PAL175_I1_Pos)                             /*!< LCD PAL175: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL176  -------------------------------------------\r
+#define LCD_PAL176_R04_0_Pos                                  0                                                         /*!< LCD PAL176: R04_0 Position          */\r
+#define LCD_PAL176_R04_0_Msk                                  (0x1fUL << LCD_PAL176_R04_0_Pos)                          /*!< LCD PAL176: R04_0 Mask              */\r
+#define LCD_PAL176_G04_0_Pos                                  5                                                         /*!< LCD PAL176: G04_0 Position          */\r
+#define LCD_PAL176_G04_0_Msk                                  (0x1fUL << LCD_PAL176_G04_0_Pos)                          /*!< LCD PAL176: G04_0 Mask              */\r
+#define LCD_PAL176_B04_0_Pos                                  10                                                        /*!< LCD PAL176: B04_0 Position          */\r
+#define LCD_PAL176_B04_0_Msk                                  (0x1fUL << LCD_PAL176_B04_0_Pos)                          /*!< LCD PAL176: B04_0 Mask              */\r
+#define LCD_PAL176_I0_Pos                                     15                                                        /*!< LCD PAL176: I0 Position             */\r
+#define LCD_PAL176_I0_Msk                                     (0x01UL << LCD_PAL176_I0_Pos)                             /*!< LCD PAL176: I0 Mask                 */\r
+#define LCD_PAL176_R14_0_Pos                                  16                                                        /*!< LCD PAL176: R14_0 Position          */\r
+#define LCD_PAL176_R14_0_Msk                                  (0x1fUL << LCD_PAL176_R14_0_Pos)                          /*!< LCD PAL176: R14_0 Mask              */\r
+#define LCD_PAL176_G14_0_Pos                                  21                                                        /*!< LCD PAL176: G14_0 Position          */\r
+#define LCD_PAL176_G14_0_Msk                                  (0x1fUL << LCD_PAL176_G14_0_Pos)                          /*!< LCD PAL176: G14_0 Mask              */\r
+#define LCD_PAL176_B14_0_Pos                                  26                                                        /*!< LCD PAL176: B14_0 Position          */\r
+#define LCD_PAL176_B14_0_Msk                                  (0x1fUL << LCD_PAL176_B14_0_Pos)                          /*!< LCD PAL176: B14_0 Mask              */\r
+#define LCD_PAL176_I1_Pos                                     31                                                        /*!< LCD PAL176: I1 Position             */\r
+#define LCD_PAL176_I1_Msk                                     (0x01UL << LCD_PAL176_I1_Pos)                             /*!< LCD PAL176: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL177  -------------------------------------------\r
+#define LCD_PAL177_R04_0_Pos                                  0                                                         /*!< LCD PAL177: R04_0 Position          */\r
+#define LCD_PAL177_R04_0_Msk                                  (0x1fUL << LCD_PAL177_R04_0_Pos)                          /*!< LCD PAL177: R04_0 Mask              */\r
+#define LCD_PAL177_G04_0_Pos                                  5                                                         /*!< LCD PAL177: G04_0 Position          */\r
+#define LCD_PAL177_G04_0_Msk                                  (0x1fUL << LCD_PAL177_G04_0_Pos)                          /*!< LCD PAL177: G04_0 Mask              */\r
+#define LCD_PAL177_B04_0_Pos                                  10                                                        /*!< LCD PAL177: B04_0 Position          */\r
+#define LCD_PAL177_B04_0_Msk                                  (0x1fUL << LCD_PAL177_B04_0_Pos)                          /*!< LCD PAL177: B04_0 Mask              */\r
+#define LCD_PAL177_I0_Pos                                     15                                                        /*!< LCD PAL177: I0 Position             */\r
+#define LCD_PAL177_I0_Msk                                     (0x01UL << LCD_PAL177_I0_Pos)                             /*!< LCD PAL177: I0 Mask                 */\r
+#define LCD_PAL177_R14_0_Pos                                  16                                                        /*!< LCD PAL177: R14_0 Position          */\r
+#define LCD_PAL177_R14_0_Msk                                  (0x1fUL << LCD_PAL177_R14_0_Pos)                          /*!< LCD PAL177: R14_0 Mask              */\r
+#define LCD_PAL177_G14_0_Pos                                  21                                                        /*!< LCD PAL177: G14_0 Position          */\r
+#define LCD_PAL177_G14_0_Msk                                  (0x1fUL << LCD_PAL177_G14_0_Pos)                          /*!< LCD PAL177: G14_0 Mask              */\r
+#define LCD_PAL177_B14_0_Pos                                  26                                                        /*!< LCD PAL177: B14_0 Position          */\r
+#define LCD_PAL177_B14_0_Msk                                  (0x1fUL << LCD_PAL177_B14_0_Pos)                          /*!< LCD PAL177: B14_0 Mask              */\r
+#define LCD_PAL177_I1_Pos                                     31                                                        /*!< LCD PAL177: I1 Position             */\r
+#define LCD_PAL177_I1_Msk                                     (0x01UL << LCD_PAL177_I1_Pos)                             /*!< LCD PAL177: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL178  -------------------------------------------\r
+#define LCD_PAL178_R04_0_Pos                                  0                                                         /*!< LCD PAL178: R04_0 Position          */\r
+#define LCD_PAL178_R04_0_Msk                                  (0x1fUL << LCD_PAL178_R04_0_Pos)                          /*!< LCD PAL178: R04_0 Mask              */\r
+#define LCD_PAL178_G04_0_Pos                                  5                                                         /*!< LCD PAL178: G04_0 Position          */\r
+#define LCD_PAL178_G04_0_Msk                                  (0x1fUL << LCD_PAL178_G04_0_Pos)                          /*!< LCD PAL178: G04_0 Mask              */\r
+#define LCD_PAL178_B04_0_Pos                                  10                                                        /*!< LCD PAL178: B04_0 Position          */\r
+#define LCD_PAL178_B04_0_Msk                                  (0x1fUL << LCD_PAL178_B04_0_Pos)                          /*!< LCD PAL178: B04_0 Mask              */\r
+#define LCD_PAL178_I0_Pos                                     15                                                        /*!< LCD PAL178: I0 Position             */\r
+#define LCD_PAL178_I0_Msk                                     (0x01UL << LCD_PAL178_I0_Pos)                             /*!< LCD PAL178: I0 Mask                 */\r
+#define LCD_PAL178_R14_0_Pos                                  16                                                        /*!< LCD PAL178: R14_0 Position          */\r
+#define LCD_PAL178_R14_0_Msk                                  (0x1fUL << LCD_PAL178_R14_0_Pos)                          /*!< LCD PAL178: R14_0 Mask              */\r
+#define LCD_PAL178_G14_0_Pos                                  21                                                        /*!< LCD PAL178: G14_0 Position          */\r
+#define LCD_PAL178_G14_0_Msk                                  (0x1fUL << LCD_PAL178_G14_0_Pos)                          /*!< LCD PAL178: G14_0 Mask              */\r
+#define LCD_PAL178_B14_0_Pos                                  26                                                        /*!< LCD PAL178: B14_0 Position          */\r
+#define LCD_PAL178_B14_0_Msk                                  (0x1fUL << LCD_PAL178_B14_0_Pos)                          /*!< LCD PAL178: B14_0 Mask              */\r
+#define LCD_PAL178_I1_Pos                                     31                                                        /*!< LCD PAL178: I1 Position             */\r
+#define LCD_PAL178_I1_Msk                                     (0x01UL << LCD_PAL178_I1_Pos)                             /*!< LCD PAL178: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL179  -------------------------------------------\r
+#define LCD_PAL179_R04_0_Pos                                  0                                                         /*!< LCD PAL179: R04_0 Position          */\r
+#define LCD_PAL179_R04_0_Msk                                  (0x1fUL << LCD_PAL179_R04_0_Pos)                          /*!< LCD PAL179: R04_0 Mask              */\r
+#define LCD_PAL179_G04_0_Pos                                  5                                                         /*!< LCD PAL179: G04_0 Position          */\r
+#define LCD_PAL179_G04_0_Msk                                  (0x1fUL << LCD_PAL179_G04_0_Pos)                          /*!< LCD PAL179: G04_0 Mask              */\r
+#define LCD_PAL179_B04_0_Pos                                  10                                                        /*!< LCD PAL179: B04_0 Position          */\r
+#define LCD_PAL179_B04_0_Msk                                  (0x1fUL << LCD_PAL179_B04_0_Pos)                          /*!< LCD PAL179: B04_0 Mask              */\r
+#define LCD_PAL179_I0_Pos                                     15                                                        /*!< LCD PAL179: I0 Position             */\r
+#define LCD_PAL179_I0_Msk                                     (0x01UL << LCD_PAL179_I0_Pos)                             /*!< LCD PAL179: I0 Mask                 */\r
+#define LCD_PAL179_R14_0_Pos                                  16                                                        /*!< LCD PAL179: R14_0 Position          */\r
+#define LCD_PAL179_R14_0_Msk                                  (0x1fUL << LCD_PAL179_R14_0_Pos)                          /*!< LCD PAL179: R14_0 Mask              */\r
+#define LCD_PAL179_G14_0_Pos                                  21                                                        /*!< LCD PAL179: G14_0 Position          */\r
+#define LCD_PAL179_G14_0_Msk                                  (0x1fUL << LCD_PAL179_G14_0_Pos)                          /*!< LCD PAL179: G14_0 Mask              */\r
+#define LCD_PAL179_B14_0_Pos                                  26                                                        /*!< LCD PAL179: B14_0 Position          */\r
+#define LCD_PAL179_B14_0_Msk                                  (0x1fUL << LCD_PAL179_B14_0_Pos)                          /*!< LCD PAL179: B14_0 Mask              */\r
+#define LCD_PAL179_I1_Pos                                     31                                                        /*!< LCD PAL179: I1 Position             */\r
+#define LCD_PAL179_I1_Msk                                     (0x01UL << LCD_PAL179_I1_Pos)                             /*!< LCD PAL179: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL180  -------------------------------------------\r
+#define LCD_PAL180_R04_0_Pos                                  0                                                         /*!< LCD PAL180: R04_0 Position          */\r
+#define LCD_PAL180_R04_0_Msk                                  (0x1fUL << LCD_PAL180_R04_0_Pos)                          /*!< LCD PAL180: R04_0 Mask              */\r
+#define LCD_PAL180_G04_0_Pos                                  5                                                         /*!< LCD PAL180: G04_0 Position          */\r
+#define LCD_PAL180_G04_0_Msk                                  (0x1fUL << LCD_PAL180_G04_0_Pos)                          /*!< LCD PAL180: G04_0 Mask              */\r
+#define LCD_PAL180_B04_0_Pos                                  10                                                        /*!< LCD PAL180: B04_0 Position          */\r
+#define LCD_PAL180_B04_0_Msk                                  (0x1fUL << LCD_PAL180_B04_0_Pos)                          /*!< LCD PAL180: B04_0 Mask              */\r
+#define LCD_PAL180_I0_Pos                                     15                                                        /*!< LCD PAL180: I0 Position             */\r
+#define LCD_PAL180_I0_Msk                                     (0x01UL << LCD_PAL180_I0_Pos)                             /*!< LCD PAL180: I0 Mask                 */\r
+#define LCD_PAL180_R14_0_Pos                                  16                                                        /*!< LCD PAL180: R14_0 Position          */\r
+#define LCD_PAL180_R14_0_Msk                                  (0x1fUL << LCD_PAL180_R14_0_Pos)                          /*!< LCD PAL180: R14_0 Mask              */\r
+#define LCD_PAL180_G14_0_Pos                                  21                                                        /*!< LCD PAL180: G14_0 Position          */\r
+#define LCD_PAL180_G14_0_Msk                                  (0x1fUL << LCD_PAL180_G14_0_Pos)                          /*!< LCD PAL180: G14_0 Mask              */\r
+#define LCD_PAL180_B14_0_Pos                                  26                                                        /*!< LCD PAL180: B14_0 Position          */\r
+#define LCD_PAL180_B14_0_Msk                                  (0x1fUL << LCD_PAL180_B14_0_Pos)                          /*!< LCD PAL180: B14_0 Mask              */\r
+#define LCD_PAL180_I1_Pos                                     31                                                        /*!< LCD PAL180: I1 Position             */\r
+#define LCD_PAL180_I1_Msk                                     (0x01UL << LCD_PAL180_I1_Pos)                             /*!< LCD PAL180: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL181  -------------------------------------------\r
+#define LCD_PAL181_R04_0_Pos                                  0                                                         /*!< LCD PAL181: R04_0 Position          */\r
+#define LCD_PAL181_R04_0_Msk                                  (0x1fUL << LCD_PAL181_R04_0_Pos)                          /*!< LCD PAL181: R04_0 Mask              */\r
+#define LCD_PAL181_G04_0_Pos                                  5                                                         /*!< LCD PAL181: G04_0 Position          */\r
+#define LCD_PAL181_G04_0_Msk                                  (0x1fUL << LCD_PAL181_G04_0_Pos)                          /*!< LCD PAL181: G04_0 Mask              */\r
+#define LCD_PAL181_B04_0_Pos                                  10                                                        /*!< LCD PAL181: B04_0 Position          */\r
+#define LCD_PAL181_B04_0_Msk                                  (0x1fUL << LCD_PAL181_B04_0_Pos)                          /*!< LCD PAL181: B04_0 Mask              */\r
+#define LCD_PAL181_I0_Pos                                     15                                                        /*!< LCD PAL181: I0 Position             */\r
+#define LCD_PAL181_I0_Msk                                     (0x01UL << LCD_PAL181_I0_Pos)                             /*!< LCD PAL181: I0 Mask                 */\r
+#define LCD_PAL181_R14_0_Pos                                  16                                                        /*!< LCD PAL181: R14_0 Position          */\r
+#define LCD_PAL181_R14_0_Msk                                  (0x1fUL << LCD_PAL181_R14_0_Pos)                          /*!< LCD PAL181: R14_0 Mask              */\r
+#define LCD_PAL181_G14_0_Pos                                  21                                                        /*!< LCD PAL181: G14_0 Position          */\r
+#define LCD_PAL181_G14_0_Msk                                  (0x1fUL << LCD_PAL181_G14_0_Pos)                          /*!< LCD PAL181: G14_0 Mask              */\r
+#define LCD_PAL181_B14_0_Pos                                  26                                                        /*!< LCD PAL181: B14_0 Position          */\r
+#define LCD_PAL181_B14_0_Msk                                  (0x1fUL << LCD_PAL181_B14_0_Pos)                          /*!< LCD PAL181: B14_0 Mask              */\r
+#define LCD_PAL181_I1_Pos                                     31                                                        /*!< LCD PAL181: I1 Position             */\r
+#define LCD_PAL181_I1_Msk                                     (0x01UL << LCD_PAL181_I1_Pos)                             /*!< LCD PAL181: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL182  -------------------------------------------\r
+#define LCD_PAL182_R04_0_Pos                                  0                                                         /*!< LCD PAL182: R04_0 Position          */\r
+#define LCD_PAL182_R04_0_Msk                                  (0x1fUL << LCD_PAL182_R04_0_Pos)                          /*!< LCD PAL182: R04_0 Mask              */\r
+#define LCD_PAL182_G04_0_Pos                                  5                                                         /*!< LCD PAL182: G04_0 Position          */\r
+#define LCD_PAL182_G04_0_Msk                                  (0x1fUL << LCD_PAL182_G04_0_Pos)                          /*!< LCD PAL182: G04_0 Mask              */\r
+#define LCD_PAL182_B04_0_Pos                                  10                                                        /*!< LCD PAL182: B04_0 Position          */\r
+#define LCD_PAL182_B04_0_Msk                                  (0x1fUL << LCD_PAL182_B04_0_Pos)                          /*!< LCD PAL182: B04_0 Mask              */\r
+#define LCD_PAL182_I0_Pos                                     15                                                        /*!< LCD PAL182: I0 Position             */\r
+#define LCD_PAL182_I0_Msk                                     (0x01UL << LCD_PAL182_I0_Pos)                             /*!< LCD PAL182: I0 Mask                 */\r
+#define LCD_PAL182_R14_0_Pos                                  16                                                        /*!< LCD PAL182: R14_0 Position          */\r
+#define LCD_PAL182_R14_0_Msk                                  (0x1fUL << LCD_PAL182_R14_0_Pos)                          /*!< LCD PAL182: R14_0 Mask              */\r
+#define LCD_PAL182_G14_0_Pos                                  21                                                        /*!< LCD PAL182: G14_0 Position          */\r
+#define LCD_PAL182_G14_0_Msk                                  (0x1fUL << LCD_PAL182_G14_0_Pos)                          /*!< LCD PAL182: G14_0 Mask              */\r
+#define LCD_PAL182_B14_0_Pos                                  26                                                        /*!< LCD PAL182: B14_0 Position          */\r
+#define LCD_PAL182_B14_0_Msk                                  (0x1fUL << LCD_PAL182_B14_0_Pos)                          /*!< LCD PAL182: B14_0 Mask              */\r
+#define LCD_PAL182_I1_Pos                                     31                                                        /*!< LCD PAL182: I1 Position             */\r
+#define LCD_PAL182_I1_Msk                                     (0x01UL << LCD_PAL182_I1_Pos)                             /*!< LCD PAL182: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL183  -------------------------------------------\r
+#define LCD_PAL183_R04_0_Pos                                  0                                                         /*!< LCD PAL183: R04_0 Position          */\r
+#define LCD_PAL183_R04_0_Msk                                  (0x1fUL << LCD_PAL183_R04_0_Pos)                          /*!< LCD PAL183: R04_0 Mask              */\r
+#define LCD_PAL183_G04_0_Pos                                  5                                                         /*!< LCD PAL183: G04_0 Position          */\r
+#define LCD_PAL183_G04_0_Msk                                  (0x1fUL << LCD_PAL183_G04_0_Pos)                          /*!< LCD PAL183: G04_0 Mask              */\r
+#define LCD_PAL183_B04_0_Pos                                  10                                                        /*!< LCD PAL183: B04_0 Position          */\r
+#define LCD_PAL183_B04_0_Msk                                  (0x1fUL << LCD_PAL183_B04_0_Pos)                          /*!< LCD PAL183: B04_0 Mask              */\r
+#define LCD_PAL183_I0_Pos                                     15                                                        /*!< LCD PAL183: I0 Position             */\r
+#define LCD_PAL183_I0_Msk                                     (0x01UL << LCD_PAL183_I0_Pos)                             /*!< LCD PAL183: I0 Mask                 */\r
+#define LCD_PAL183_R14_0_Pos                                  16                                                        /*!< LCD PAL183: R14_0 Position          */\r
+#define LCD_PAL183_R14_0_Msk                                  (0x1fUL << LCD_PAL183_R14_0_Pos)                          /*!< LCD PAL183: R14_0 Mask              */\r
+#define LCD_PAL183_G14_0_Pos                                  21                                                        /*!< LCD PAL183: G14_0 Position          */\r
+#define LCD_PAL183_G14_0_Msk                                  (0x1fUL << LCD_PAL183_G14_0_Pos)                          /*!< LCD PAL183: G14_0 Mask              */\r
+#define LCD_PAL183_B14_0_Pos                                  26                                                        /*!< LCD PAL183: B14_0 Position          */\r
+#define LCD_PAL183_B14_0_Msk                                  (0x1fUL << LCD_PAL183_B14_0_Pos)                          /*!< LCD PAL183: B14_0 Mask              */\r
+#define LCD_PAL183_I1_Pos                                     31                                                        /*!< LCD PAL183: I1 Position             */\r
+#define LCD_PAL183_I1_Msk                                     (0x01UL << LCD_PAL183_I1_Pos)                             /*!< LCD PAL183: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL184  -------------------------------------------\r
+#define LCD_PAL184_R04_0_Pos                                  0                                                         /*!< LCD PAL184: R04_0 Position          */\r
+#define LCD_PAL184_R04_0_Msk                                  (0x1fUL << LCD_PAL184_R04_0_Pos)                          /*!< LCD PAL184: R04_0 Mask              */\r
+#define LCD_PAL184_G04_0_Pos                                  5                                                         /*!< LCD PAL184: G04_0 Position          */\r
+#define LCD_PAL184_G04_0_Msk                                  (0x1fUL << LCD_PAL184_G04_0_Pos)                          /*!< LCD PAL184: G04_0 Mask              */\r
+#define LCD_PAL184_B04_0_Pos                                  10                                                        /*!< LCD PAL184: B04_0 Position          */\r
+#define LCD_PAL184_B04_0_Msk                                  (0x1fUL << LCD_PAL184_B04_0_Pos)                          /*!< LCD PAL184: B04_0 Mask              */\r
+#define LCD_PAL184_I0_Pos                                     15                                                        /*!< LCD PAL184: I0 Position             */\r
+#define LCD_PAL184_I0_Msk                                     (0x01UL << LCD_PAL184_I0_Pos)                             /*!< LCD PAL184: I0 Mask                 */\r
+#define LCD_PAL184_R14_0_Pos                                  16                                                        /*!< LCD PAL184: R14_0 Position          */\r
+#define LCD_PAL184_R14_0_Msk                                  (0x1fUL << LCD_PAL184_R14_0_Pos)                          /*!< LCD PAL184: R14_0 Mask              */\r
+#define LCD_PAL184_G14_0_Pos                                  21                                                        /*!< LCD PAL184: G14_0 Position          */\r
+#define LCD_PAL184_G14_0_Msk                                  (0x1fUL << LCD_PAL184_G14_0_Pos)                          /*!< LCD PAL184: G14_0 Mask              */\r
+#define LCD_PAL184_B14_0_Pos                                  26                                                        /*!< LCD PAL184: B14_0 Position          */\r
+#define LCD_PAL184_B14_0_Msk                                  (0x1fUL << LCD_PAL184_B14_0_Pos)                          /*!< LCD PAL184: B14_0 Mask              */\r
+#define LCD_PAL184_I1_Pos                                     31                                                        /*!< LCD PAL184: I1 Position             */\r
+#define LCD_PAL184_I1_Msk                                     (0x01UL << LCD_PAL184_I1_Pos)                             /*!< LCD PAL184: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL185  -------------------------------------------\r
+#define LCD_PAL185_R04_0_Pos                                  0                                                         /*!< LCD PAL185: R04_0 Position          */\r
+#define LCD_PAL185_R04_0_Msk                                  (0x1fUL << LCD_PAL185_R04_0_Pos)                          /*!< LCD PAL185: R04_0 Mask              */\r
+#define LCD_PAL185_G04_0_Pos                                  5                                                         /*!< LCD PAL185: G04_0 Position          */\r
+#define LCD_PAL185_G04_0_Msk                                  (0x1fUL << LCD_PAL185_G04_0_Pos)                          /*!< LCD PAL185: G04_0 Mask              */\r
+#define LCD_PAL185_B04_0_Pos                                  10                                                        /*!< LCD PAL185: B04_0 Position          */\r
+#define LCD_PAL185_B04_0_Msk                                  (0x1fUL << LCD_PAL185_B04_0_Pos)                          /*!< LCD PAL185: B04_0 Mask              */\r
+#define LCD_PAL185_I0_Pos                                     15                                                        /*!< LCD PAL185: I0 Position             */\r
+#define LCD_PAL185_I0_Msk                                     (0x01UL << LCD_PAL185_I0_Pos)                             /*!< LCD PAL185: I0 Mask                 */\r
+#define LCD_PAL185_R14_0_Pos                                  16                                                        /*!< LCD PAL185: R14_0 Position          */\r
+#define LCD_PAL185_R14_0_Msk                                  (0x1fUL << LCD_PAL185_R14_0_Pos)                          /*!< LCD PAL185: R14_0 Mask              */\r
+#define LCD_PAL185_G14_0_Pos                                  21                                                        /*!< LCD PAL185: G14_0 Position          */\r
+#define LCD_PAL185_G14_0_Msk                                  (0x1fUL << LCD_PAL185_G14_0_Pos)                          /*!< LCD PAL185: G14_0 Mask              */\r
+#define LCD_PAL185_B14_0_Pos                                  26                                                        /*!< LCD PAL185: B14_0 Position          */\r
+#define LCD_PAL185_B14_0_Msk                                  (0x1fUL << LCD_PAL185_B14_0_Pos)                          /*!< LCD PAL185: B14_0 Mask              */\r
+#define LCD_PAL185_I1_Pos                                     31                                                        /*!< LCD PAL185: I1 Position             */\r
+#define LCD_PAL185_I1_Msk                                     (0x01UL << LCD_PAL185_I1_Pos)                             /*!< LCD PAL185: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL186  -------------------------------------------\r
+#define LCD_PAL186_R04_0_Pos                                  0                                                         /*!< LCD PAL186: R04_0 Position          */\r
+#define LCD_PAL186_R04_0_Msk                                  (0x1fUL << LCD_PAL186_R04_0_Pos)                          /*!< LCD PAL186: R04_0 Mask              */\r
+#define LCD_PAL186_G04_0_Pos                                  5                                                         /*!< LCD PAL186: G04_0 Position          */\r
+#define LCD_PAL186_G04_0_Msk                                  (0x1fUL << LCD_PAL186_G04_0_Pos)                          /*!< LCD PAL186: G04_0 Mask              */\r
+#define LCD_PAL186_B04_0_Pos                                  10                                                        /*!< LCD PAL186: B04_0 Position          */\r
+#define LCD_PAL186_B04_0_Msk                                  (0x1fUL << LCD_PAL186_B04_0_Pos)                          /*!< LCD PAL186: B04_0 Mask              */\r
+#define LCD_PAL186_I0_Pos                                     15                                                        /*!< LCD PAL186: I0 Position             */\r
+#define LCD_PAL186_I0_Msk                                     (0x01UL << LCD_PAL186_I0_Pos)                             /*!< LCD PAL186: I0 Mask                 */\r
+#define LCD_PAL186_R14_0_Pos                                  16                                                        /*!< LCD PAL186: R14_0 Position          */\r
+#define LCD_PAL186_R14_0_Msk                                  (0x1fUL << LCD_PAL186_R14_0_Pos)                          /*!< LCD PAL186: R14_0 Mask              */\r
+#define LCD_PAL186_G14_0_Pos                                  21                                                        /*!< LCD PAL186: G14_0 Position          */\r
+#define LCD_PAL186_G14_0_Msk                                  (0x1fUL << LCD_PAL186_G14_0_Pos)                          /*!< LCD PAL186: G14_0 Mask              */\r
+#define LCD_PAL186_B14_0_Pos                                  26                                                        /*!< LCD PAL186: B14_0 Position          */\r
+#define LCD_PAL186_B14_0_Msk                                  (0x1fUL << LCD_PAL186_B14_0_Pos)                          /*!< LCD PAL186: B14_0 Mask              */\r
+#define LCD_PAL186_I1_Pos                                     31                                                        /*!< LCD PAL186: I1 Position             */\r
+#define LCD_PAL186_I1_Msk                                     (0x01UL << LCD_PAL186_I1_Pos)                             /*!< LCD PAL186: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL187  -------------------------------------------\r
+#define LCD_PAL187_R04_0_Pos                                  0                                                         /*!< LCD PAL187: R04_0 Position          */\r
+#define LCD_PAL187_R04_0_Msk                                  (0x1fUL << LCD_PAL187_R04_0_Pos)                          /*!< LCD PAL187: R04_0 Mask              */\r
+#define LCD_PAL187_G04_0_Pos                                  5                                                         /*!< LCD PAL187: G04_0 Position          */\r
+#define LCD_PAL187_G04_0_Msk                                  (0x1fUL << LCD_PAL187_G04_0_Pos)                          /*!< LCD PAL187: G04_0 Mask              */\r
+#define LCD_PAL187_B04_0_Pos                                  10                                                        /*!< LCD PAL187: B04_0 Position          */\r
+#define LCD_PAL187_B04_0_Msk                                  (0x1fUL << LCD_PAL187_B04_0_Pos)                          /*!< LCD PAL187: B04_0 Mask              */\r
+#define LCD_PAL187_I0_Pos                                     15                                                        /*!< LCD PAL187: I0 Position             */\r
+#define LCD_PAL187_I0_Msk                                     (0x01UL << LCD_PAL187_I0_Pos)                             /*!< LCD PAL187: I0 Mask                 */\r
+#define LCD_PAL187_R14_0_Pos                                  16                                                        /*!< LCD PAL187: R14_0 Position          */\r
+#define LCD_PAL187_R14_0_Msk                                  (0x1fUL << LCD_PAL187_R14_0_Pos)                          /*!< LCD PAL187: R14_0 Mask              */\r
+#define LCD_PAL187_G14_0_Pos                                  21                                                        /*!< LCD PAL187: G14_0 Position          */\r
+#define LCD_PAL187_G14_0_Msk                                  (0x1fUL << LCD_PAL187_G14_0_Pos)                          /*!< LCD PAL187: G14_0 Mask              */\r
+#define LCD_PAL187_B14_0_Pos                                  26                                                        /*!< LCD PAL187: B14_0 Position          */\r
+#define LCD_PAL187_B14_0_Msk                                  (0x1fUL << LCD_PAL187_B14_0_Pos)                          /*!< LCD PAL187: B14_0 Mask              */\r
+#define LCD_PAL187_I1_Pos                                     31                                                        /*!< LCD PAL187: I1 Position             */\r
+#define LCD_PAL187_I1_Msk                                     (0x01UL << LCD_PAL187_I1_Pos)                             /*!< LCD PAL187: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL188  -------------------------------------------\r
+#define LCD_PAL188_R04_0_Pos                                  0                                                         /*!< LCD PAL188: R04_0 Position          */\r
+#define LCD_PAL188_R04_0_Msk                                  (0x1fUL << LCD_PAL188_R04_0_Pos)                          /*!< LCD PAL188: R04_0 Mask              */\r
+#define LCD_PAL188_G04_0_Pos                                  5                                                         /*!< LCD PAL188: G04_0 Position          */\r
+#define LCD_PAL188_G04_0_Msk                                  (0x1fUL << LCD_PAL188_G04_0_Pos)                          /*!< LCD PAL188: G04_0 Mask              */\r
+#define LCD_PAL188_B04_0_Pos                                  10                                                        /*!< LCD PAL188: B04_0 Position          */\r
+#define LCD_PAL188_B04_0_Msk                                  (0x1fUL << LCD_PAL188_B04_0_Pos)                          /*!< LCD PAL188: B04_0 Mask              */\r
+#define LCD_PAL188_I0_Pos                                     15                                                        /*!< LCD PAL188: I0 Position             */\r
+#define LCD_PAL188_I0_Msk                                     (0x01UL << LCD_PAL188_I0_Pos)                             /*!< LCD PAL188: I0 Mask                 */\r
+#define LCD_PAL188_R14_0_Pos                                  16                                                        /*!< LCD PAL188: R14_0 Position          */\r
+#define LCD_PAL188_R14_0_Msk                                  (0x1fUL << LCD_PAL188_R14_0_Pos)                          /*!< LCD PAL188: R14_0 Mask              */\r
+#define LCD_PAL188_G14_0_Pos                                  21                                                        /*!< LCD PAL188: G14_0 Position          */\r
+#define LCD_PAL188_G14_0_Msk                                  (0x1fUL << LCD_PAL188_G14_0_Pos)                          /*!< LCD PAL188: G14_0 Mask              */\r
+#define LCD_PAL188_B14_0_Pos                                  26                                                        /*!< LCD PAL188: B14_0 Position          */\r
+#define LCD_PAL188_B14_0_Msk                                  (0x1fUL << LCD_PAL188_B14_0_Pos)                          /*!< LCD PAL188: B14_0 Mask              */\r
+#define LCD_PAL188_I1_Pos                                     31                                                        /*!< LCD PAL188: I1 Position             */\r
+#define LCD_PAL188_I1_Msk                                     (0x01UL << LCD_PAL188_I1_Pos)                             /*!< LCD PAL188: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL189  -------------------------------------------\r
+#define LCD_PAL189_R04_0_Pos                                  0                                                         /*!< LCD PAL189: R04_0 Position          */\r
+#define LCD_PAL189_R04_0_Msk                                  (0x1fUL << LCD_PAL189_R04_0_Pos)                          /*!< LCD PAL189: R04_0 Mask              */\r
+#define LCD_PAL189_G04_0_Pos                                  5                                                         /*!< LCD PAL189: G04_0 Position          */\r
+#define LCD_PAL189_G04_0_Msk                                  (0x1fUL << LCD_PAL189_G04_0_Pos)                          /*!< LCD PAL189: G04_0 Mask              */\r
+#define LCD_PAL189_B04_0_Pos                                  10                                                        /*!< LCD PAL189: B04_0 Position          */\r
+#define LCD_PAL189_B04_0_Msk                                  (0x1fUL << LCD_PAL189_B04_0_Pos)                          /*!< LCD PAL189: B04_0 Mask              */\r
+#define LCD_PAL189_I0_Pos                                     15                                                        /*!< LCD PAL189: I0 Position             */\r
+#define LCD_PAL189_I0_Msk                                     (0x01UL << LCD_PAL189_I0_Pos)                             /*!< LCD PAL189: I0 Mask                 */\r
+#define LCD_PAL189_R14_0_Pos                                  16                                                        /*!< LCD PAL189: R14_0 Position          */\r
+#define LCD_PAL189_R14_0_Msk                                  (0x1fUL << LCD_PAL189_R14_0_Pos)                          /*!< LCD PAL189: R14_0 Mask              */\r
+#define LCD_PAL189_G14_0_Pos                                  21                                                        /*!< LCD PAL189: G14_0 Position          */\r
+#define LCD_PAL189_G14_0_Msk                                  (0x1fUL << LCD_PAL189_G14_0_Pos)                          /*!< LCD PAL189: G14_0 Mask              */\r
+#define LCD_PAL189_B14_0_Pos                                  26                                                        /*!< LCD PAL189: B14_0 Position          */\r
+#define LCD_PAL189_B14_0_Msk                                  (0x1fUL << LCD_PAL189_B14_0_Pos)                          /*!< LCD PAL189: B14_0 Mask              */\r
+#define LCD_PAL189_I1_Pos                                     31                                                        /*!< LCD PAL189: I1 Position             */\r
+#define LCD_PAL189_I1_Msk                                     (0x01UL << LCD_PAL189_I1_Pos)                             /*!< LCD PAL189: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL190  -------------------------------------------\r
+#define LCD_PAL190_R04_0_Pos                                  0                                                         /*!< LCD PAL190: R04_0 Position          */\r
+#define LCD_PAL190_R04_0_Msk                                  (0x1fUL << LCD_PAL190_R04_0_Pos)                          /*!< LCD PAL190: R04_0 Mask              */\r
+#define LCD_PAL190_G04_0_Pos                                  5                                                         /*!< LCD PAL190: G04_0 Position          */\r
+#define LCD_PAL190_G04_0_Msk                                  (0x1fUL << LCD_PAL190_G04_0_Pos)                          /*!< LCD PAL190: G04_0 Mask              */\r
+#define LCD_PAL190_B04_0_Pos                                  10                                                        /*!< LCD PAL190: B04_0 Position          */\r
+#define LCD_PAL190_B04_0_Msk                                  (0x1fUL << LCD_PAL190_B04_0_Pos)                          /*!< LCD PAL190: B04_0 Mask              */\r
+#define LCD_PAL190_I0_Pos                                     15                                                        /*!< LCD PAL190: I0 Position             */\r
+#define LCD_PAL190_I0_Msk                                     (0x01UL << LCD_PAL190_I0_Pos)                             /*!< LCD PAL190: I0 Mask                 */\r
+#define LCD_PAL190_R14_0_Pos                                  16                                                        /*!< LCD PAL190: R14_0 Position          */\r
+#define LCD_PAL190_R14_0_Msk                                  (0x1fUL << LCD_PAL190_R14_0_Pos)                          /*!< LCD PAL190: R14_0 Mask              */\r
+#define LCD_PAL190_G14_0_Pos                                  21                                                        /*!< LCD PAL190: G14_0 Position          */\r
+#define LCD_PAL190_G14_0_Msk                                  (0x1fUL << LCD_PAL190_G14_0_Pos)                          /*!< LCD PAL190: G14_0 Mask              */\r
+#define LCD_PAL190_B14_0_Pos                                  26                                                        /*!< LCD PAL190: B14_0 Position          */\r
+#define LCD_PAL190_B14_0_Msk                                  (0x1fUL << LCD_PAL190_B14_0_Pos)                          /*!< LCD PAL190: B14_0 Mask              */\r
+#define LCD_PAL190_I1_Pos                                     31                                                        /*!< LCD PAL190: I1 Position             */\r
+#define LCD_PAL190_I1_Msk                                     (0x01UL << LCD_PAL190_I1_Pos)                             /*!< LCD PAL190: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL191  -------------------------------------------\r
+#define LCD_PAL191_R04_0_Pos                                  0                                                         /*!< LCD PAL191: R04_0 Position          */\r
+#define LCD_PAL191_R04_0_Msk                                  (0x1fUL << LCD_PAL191_R04_0_Pos)                          /*!< LCD PAL191: R04_0 Mask              */\r
+#define LCD_PAL191_G04_0_Pos                                  5                                                         /*!< LCD PAL191: G04_0 Position          */\r
+#define LCD_PAL191_G04_0_Msk                                  (0x1fUL << LCD_PAL191_G04_0_Pos)                          /*!< LCD PAL191: G04_0 Mask              */\r
+#define LCD_PAL191_B04_0_Pos                                  10                                                        /*!< LCD PAL191: B04_0 Position          */\r
+#define LCD_PAL191_B04_0_Msk                                  (0x1fUL << LCD_PAL191_B04_0_Pos)                          /*!< LCD PAL191: B04_0 Mask              */\r
+#define LCD_PAL191_I0_Pos                                     15                                                        /*!< LCD PAL191: I0 Position             */\r
+#define LCD_PAL191_I0_Msk                                     (0x01UL << LCD_PAL191_I0_Pos)                             /*!< LCD PAL191: I0 Mask                 */\r
+#define LCD_PAL191_R14_0_Pos                                  16                                                        /*!< LCD PAL191: R14_0 Position          */\r
+#define LCD_PAL191_R14_0_Msk                                  (0x1fUL << LCD_PAL191_R14_0_Pos)                          /*!< LCD PAL191: R14_0 Mask              */\r
+#define LCD_PAL191_G14_0_Pos                                  21                                                        /*!< LCD PAL191: G14_0 Position          */\r
+#define LCD_PAL191_G14_0_Msk                                  (0x1fUL << LCD_PAL191_G14_0_Pos)                          /*!< LCD PAL191: G14_0 Mask              */\r
+#define LCD_PAL191_B14_0_Pos                                  26                                                        /*!< LCD PAL191: B14_0 Position          */\r
+#define LCD_PAL191_B14_0_Msk                                  (0x1fUL << LCD_PAL191_B14_0_Pos)                          /*!< LCD PAL191: B14_0 Mask              */\r
+#define LCD_PAL191_I1_Pos                                     31                                                        /*!< LCD PAL191: I1 Position             */\r
+#define LCD_PAL191_I1_Msk                                     (0x01UL << LCD_PAL191_I1_Pos)                             /*!< LCD PAL191: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL192  -------------------------------------------\r
+#define LCD_PAL192_R04_0_Pos                                  0                                                         /*!< LCD PAL192: R04_0 Position          */\r
+#define LCD_PAL192_R04_0_Msk                                  (0x1fUL << LCD_PAL192_R04_0_Pos)                          /*!< LCD PAL192: R04_0 Mask              */\r
+#define LCD_PAL192_G04_0_Pos                                  5                                                         /*!< LCD PAL192: G04_0 Position          */\r
+#define LCD_PAL192_G04_0_Msk                                  (0x1fUL << LCD_PAL192_G04_0_Pos)                          /*!< LCD PAL192: G04_0 Mask              */\r
+#define LCD_PAL192_B04_0_Pos                                  10                                                        /*!< LCD PAL192: B04_0 Position          */\r
+#define LCD_PAL192_B04_0_Msk                                  (0x1fUL << LCD_PAL192_B04_0_Pos)                          /*!< LCD PAL192: B04_0 Mask              */\r
+#define LCD_PAL192_I0_Pos                                     15                                                        /*!< LCD PAL192: I0 Position             */\r
+#define LCD_PAL192_I0_Msk                                     (0x01UL << LCD_PAL192_I0_Pos)                             /*!< LCD PAL192: I0 Mask                 */\r
+#define LCD_PAL192_R14_0_Pos                                  16                                                        /*!< LCD PAL192: R14_0 Position          */\r
+#define LCD_PAL192_R14_0_Msk                                  (0x1fUL << LCD_PAL192_R14_0_Pos)                          /*!< LCD PAL192: R14_0 Mask              */\r
+#define LCD_PAL192_G14_0_Pos                                  21                                                        /*!< LCD PAL192: G14_0 Position          */\r
+#define LCD_PAL192_G14_0_Msk                                  (0x1fUL << LCD_PAL192_G14_0_Pos)                          /*!< LCD PAL192: G14_0 Mask              */\r
+#define LCD_PAL192_B14_0_Pos                                  26                                                        /*!< LCD PAL192: B14_0 Position          */\r
+#define LCD_PAL192_B14_0_Msk                                  (0x1fUL << LCD_PAL192_B14_0_Pos)                          /*!< LCD PAL192: B14_0 Mask              */\r
+#define LCD_PAL192_I1_Pos                                     31                                                        /*!< LCD PAL192: I1 Position             */\r
+#define LCD_PAL192_I1_Msk                                     (0x01UL << LCD_PAL192_I1_Pos)                             /*!< LCD PAL192: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL193  -------------------------------------------\r
+#define LCD_PAL193_R04_0_Pos                                  0                                                         /*!< LCD PAL193: R04_0 Position          */\r
+#define LCD_PAL193_R04_0_Msk                                  (0x1fUL << LCD_PAL193_R04_0_Pos)                          /*!< LCD PAL193: R04_0 Mask              */\r
+#define LCD_PAL193_G04_0_Pos                                  5                                                         /*!< LCD PAL193: G04_0 Position          */\r
+#define LCD_PAL193_G04_0_Msk                                  (0x1fUL << LCD_PAL193_G04_0_Pos)                          /*!< LCD PAL193: G04_0 Mask              */\r
+#define LCD_PAL193_B04_0_Pos                                  10                                                        /*!< LCD PAL193: B04_0 Position          */\r
+#define LCD_PAL193_B04_0_Msk                                  (0x1fUL << LCD_PAL193_B04_0_Pos)                          /*!< LCD PAL193: B04_0 Mask              */\r
+#define LCD_PAL193_I0_Pos                                     15                                                        /*!< LCD PAL193: I0 Position             */\r
+#define LCD_PAL193_I0_Msk                                     (0x01UL << LCD_PAL193_I0_Pos)                             /*!< LCD PAL193: I0 Mask                 */\r
+#define LCD_PAL193_R14_0_Pos                                  16                                                        /*!< LCD PAL193: R14_0 Position          */\r
+#define LCD_PAL193_R14_0_Msk                                  (0x1fUL << LCD_PAL193_R14_0_Pos)                          /*!< LCD PAL193: R14_0 Mask              */\r
+#define LCD_PAL193_G14_0_Pos                                  21                                                        /*!< LCD PAL193: G14_0 Position          */\r
+#define LCD_PAL193_G14_0_Msk                                  (0x1fUL << LCD_PAL193_G14_0_Pos)                          /*!< LCD PAL193: G14_0 Mask              */\r
+#define LCD_PAL193_B14_0_Pos                                  26                                                        /*!< LCD PAL193: B14_0 Position          */\r
+#define LCD_PAL193_B14_0_Msk                                  (0x1fUL << LCD_PAL193_B14_0_Pos)                          /*!< LCD PAL193: B14_0 Mask              */\r
+#define LCD_PAL193_I1_Pos                                     31                                                        /*!< LCD PAL193: I1 Position             */\r
+#define LCD_PAL193_I1_Msk                                     (0x01UL << LCD_PAL193_I1_Pos)                             /*!< LCD PAL193: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL194  -------------------------------------------\r
+#define LCD_PAL194_R04_0_Pos                                  0                                                         /*!< LCD PAL194: R04_0 Position          */\r
+#define LCD_PAL194_R04_0_Msk                                  (0x1fUL << LCD_PAL194_R04_0_Pos)                          /*!< LCD PAL194: R04_0 Mask              */\r
+#define LCD_PAL194_G04_0_Pos                                  5                                                         /*!< LCD PAL194: G04_0 Position          */\r
+#define LCD_PAL194_G04_0_Msk                                  (0x1fUL << LCD_PAL194_G04_0_Pos)                          /*!< LCD PAL194: G04_0 Mask              */\r
+#define LCD_PAL194_B04_0_Pos                                  10                                                        /*!< LCD PAL194: B04_0 Position          */\r
+#define LCD_PAL194_B04_0_Msk                                  (0x1fUL << LCD_PAL194_B04_0_Pos)                          /*!< LCD PAL194: B04_0 Mask              */\r
+#define LCD_PAL194_I0_Pos                                     15                                                        /*!< LCD PAL194: I0 Position             */\r
+#define LCD_PAL194_I0_Msk                                     (0x01UL << LCD_PAL194_I0_Pos)                             /*!< LCD PAL194: I0 Mask                 */\r
+#define LCD_PAL194_R14_0_Pos                                  16                                                        /*!< LCD PAL194: R14_0 Position          */\r
+#define LCD_PAL194_R14_0_Msk                                  (0x1fUL << LCD_PAL194_R14_0_Pos)                          /*!< LCD PAL194: R14_0 Mask              */\r
+#define LCD_PAL194_G14_0_Pos                                  21                                                        /*!< LCD PAL194: G14_0 Position          */\r
+#define LCD_PAL194_G14_0_Msk                                  (0x1fUL << LCD_PAL194_G14_0_Pos)                          /*!< LCD PAL194: G14_0 Mask              */\r
+#define LCD_PAL194_B14_0_Pos                                  26                                                        /*!< LCD PAL194: B14_0 Position          */\r
+#define LCD_PAL194_B14_0_Msk                                  (0x1fUL << LCD_PAL194_B14_0_Pos)                          /*!< LCD PAL194: B14_0 Mask              */\r
+#define LCD_PAL194_I1_Pos                                     31                                                        /*!< LCD PAL194: I1 Position             */\r
+#define LCD_PAL194_I1_Msk                                     (0x01UL << LCD_PAL194_I1_Pos)                             /*!< LCD PAL194: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL195  -------------------------------------------\r
+#define LCD_PAL195_R04_0_Pos                                  0                                                         /*!< LCD PAL195: R04_0 Position          */\r
+#define LCD_PAL195_R04_0_Msk                                  (0x1fUL << LCD_PAL195_R04_0_Pos)                          /*!< LCD PAL195: R04_0 Mask              */\r
+#define LCD_PAL195_G04_0_Pos                                  5                                                         /*!< LCD PAL195: G04_0 Position          */\r
+#define LCD_PAL195_G04_0_Msk                                  (0x1fUL << LCD_PAL195_G04_0_Pos)                          /*!< LCD PAL195: G04_0 Mask              */\r
+#define LCD_PAL195_B04_0_Pos                                  10                                                        /*!< LCD PAL195: B04_0 Position          */\r
+#define LCD_PAL195_B04_0_Msk                                  (0x1fUL << LCD_PAL195_B04_0_Pos)                          /*!< LCD PAL195: B04_0 Mask              */\r
+#define LCD_PAL195_I0_Pos                                     15                                                        /*!< LCD PAL195: I0 Position             */\r
+#define LCD_PAL195_I0_Msk                                     (0x01UL << LCD_PAL195_I0_Pos)                             /*!< LCD PAL195: I0 Mask                 */\r
+#define LCD_PAL195_R14_0_Pos                                  16                                                        /*!< LCD PAL195: R14_0 Position          */\r
+#define LCD_PAL195_R14_0_Msk                                  (0x1fUL << LCD_PAL195_R14_0_Pos)                          /*!< LCD PAL195: R14_0 Mask              */\r
+#define LCD_PAL195_G14_0_Pos                                  21                                                        /*!< LCD PAL195: G14_0 Position          */\r
+#define LCD_PAL195_G14_0_Msk                                  (0x1fUL << LCD_PAL195_G14_0_Pos)                          /*!< LCD PAL195: G14_0 Mask              */\r
+#define LCD_PAL195_B14_0_Pos                                  26                                                        /*!< LCD PAL195: B14_0 Position          */\r
+#define LCD_PAL195_B14_0_Msk                                  (0x1fUL << LCD_PAL195_B14_0_Pos)                          /*!< LCD PAL195: B14_0 Mask              */\r
+#define LCD_PAL195_I1_Pos                                     31                                                        /*!< LCD PAL195: I1 Position             */\r
+#define LCD_PAL195_I1_Msk                                     (0x01UL << LCD_PAL195_I1_Pos)                             /*!< LCD PAL195: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL196  -------------------------------------------\r
+#define LCD_PAL196_R04_0_Pos                                  0                                                         /*!< LCD PAL196: R04_0 Position          */\r
+#define LCD_PAL196_R04_0_Msk                                  (0x1fUL << LCD_PAL196_R04_0_Pos)                          /*!< LCD PAL196: R04_0 Mask              */\r
+#define LCD_PAL196_G04_0_Pos                                  5                                                         /*!< LCD PAL196: G04_0 Position          */\r
+#define LCD_PAL196_G04_0_Msk                                  (0x1fUL << LCD_PAL196_G04_0_Pos)                          /*!< LCD PAL196: G04_0 Mask              */\r
+#define LCD_PAL196_B04_0_Pos                                  10                                                        /*!< LCD PAL196: B04_0 Position          */\r
+#define LCD_PAL196_B04_0_Msk                                  (0x1fUL << LCD_PAL196_B04_0_Pos)                          /*!< LCD PAL196: B04_0 Mask              */\r
+#define LCD_PAL196_I0_Pos                                     15                                                        /*!< LCD PAL196: I0 Position             */\r
+#define LCD_PAL196_I0_Msk                                     (0x01UL << LCD_PAL196_I0_Pos)                             /*!< LCD PAL196: I0 Mask                 */\r
+#define LCD_PAL196_R14_0_Pos                                  16                                                        /*!< LCD PAL196: R14_0 Position          */\r
+#define LCD_PAL196_R14_0_Msk                                  (0x1fUL << LCD_PAL196_R14_0_Pos)                          /*!< LCD PAL196: R14_0 Mask              */\r
+#define LCD_PAL196_G14_0_Pos                                  21                                                        /*!< LCD PAL196: G14_0 Position          */\r
+#define LCD_PAL196_G14_0_Msk                                  (0x1fUL << LCD_PAL196_G14_0_Pos)                          /*!< LCD PAL196: G14_0 Mask              */\r
+#define LCD_PAL196_B14_0_Pos                                  26                                                        /*!< LCD PAL196: B14_0 Position          */\r
+#define LCD_PAL196_B14_0_Msk                                  (0x1fUL << LCD_PAL196_B14_0_Pos)                          /*!< LCD PAL196: B14_0 Mask              */\r
+#define LCD_PAL196_I1_Pos                                     31                                                        /*!< LCD PAL196: I1 Position             */\r
+#define LCD_PAL196_I1_Msk                                     (0x01UL << LCD_PAL196_I1_Pos)                             /*!< LCD PAL196: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL197  -------------------------------------------\r
+#define LCD_PAL197_R04_0_Pos                                  0                                                         /*!< LCD PAL197: R04_0 Position          */\r
+#define LCD_PAL197_R04_0_Msk                                  (0x1fUL << LCD_PAL197_R04_0_Pos)                          /*!< LCD PAL197: R04_0 Mask              */\r
+#define LCD_PAL197_G04_0_Pos                                  5                                                         /*!< LCD PAL197: G04_0 Position          */\r
+#define LCD_PAL197_G04_0_Msk                                  (0x1fUL << LCD_PAL197_G04_0_Pos)                          /*!< LCD PAL197: G04_0 Mask              */\r
+#define LCD_PAL197_B04_0_Pos                                  10                                                        /*!< LCD PAL197: B04_0 Position          */\r
+#define LCD_PAL197_B04_0_Msk                                  (0x1fUL << LCD_PAL197_B04_0_Pos)                          /*!< LCD PAL197: B04_0 Mask              */\r
+#define LCD_PAL197_I0_Pos                                     15                                                        /*!< LCD PAL197: I0 Position             */\r
+#define LCD_PAL197_I0_Msk                                     (0x01UL << LCD_PAL197_I0_Pos)                             /*!< LCD PAL197: I0 Mask                 */\r
+#define LCD_PAL197_R14_0_Pos                                  16                                                        /*!< LCD PAL197: R14_0 Position          */\r
+#define LCD_PAL197_R14_0_Msk                                  (0x1fUL << LCD_PAL197_R14_0_Pos)                          /*!< LCD PAL197: R14_0 Mask              */\r
+#define LCD_PAL197_G14_0_Pos                                  21                                                        /*!< LCD PAL197: G14_0 Position          */\r
+#define LCD_PAL197_G14_0_Msk                                  (0x1fUL << LCD_PAL197_G14_0_Pos)                          /*!< LCD PAL197: G14_0 Mask              */\r
+#define LCD_PAL197_B14_0_Pos                                  26                                                        /*!< LCD PAL197: B14_0 Position          */\r
+#define LCD_PAL197_B14_0_Msk                                  (0x1fUL << LCD_PAL197_B14_0_Pos)                          /*!< LCD PAL197: B14_0 Mask              */\r
+#define LCD_PAL197_I1_Pos                                     31                                                        /*!< LCD PAL197: I1 Position             */\r
+#define LCD_PAL197_I1_Msk                                     (0x01UL << LCD_PAL197_I1_Pos)                             /*!< LCD PAL197: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL198  -------------------------------------------\r
+#define LCD_PAL198_R04_0_Pos                                  0                                                         /*!< LCD PAL198: R04_0 Position          */\r
+#define LCD_PAL198_R04_0_Msk                                  (0x1fUL << LCD_PAL198_R04_0_Pos)                          /*!< LCD PAL198: R04_0 Mask              */\r
+#define LCD_PAL198_G04_0_Pos                                  5                                                         /*!< LCD PAL198: G04_0 Position          */\r
+#define LCD_PAL198_G04_0_Msk                                  (0x1fUL << LCD_PAL198_G04_0_Pos)                          /*!< LCD PAL198: G04_0 Mask              */\r
+#define LCD_PAL198_B04_0_Pos                                  10                                                        /*!< LCD PAL198: B04_0 Position          */\r
+#define LCD_PAL198_B04_0_Msk                                  (0x1fUL << LCD_PAL198_B04_0_Pos)                          /*!< LCD PAL198: B04_0 Mask              */\r
+#define LCD_PAL198_I0_Pos                                     15                                                        /*!< LCD PAL198: I0 Position             */\r
+#define LCD_PAL198_I0_Msk                                     (0x01UL << LCD_PAL198_I0_Pos)                             /*!< LCD PAL198: I0 Mask                 */\r
+#define LCD_PAL198_R14_0_Pos                                  16                                                        /*!< LCD PAL198: R14_0 Position          */\r
+#define LCD_PAL198_R14_0_Msk                                  (0x1fUL << LCD_PAL198_R14_0_Pos)                          /*!< LCD PAL198: R14_0 Mask              */\r
+#define LCD_PAL198_G14_0_Pos                                  21                                                        /*!< LCD PAL198: G14_0 Position          */\r
+#define LCD_PAL198_G14_0_Msk                                  (0x1fUL << LCD_PAL198_G14_0_Pos)                          /*!< LCD PAL198: G14_0 Mask              */\r
+#define LCD_PAL198_B14_0_Pos                                  26                                                        /*!< LCD PAL198: B14_0 Position          */\r
+#define LCD_PAL198_B14_0_Msk                                  (0x1fUL << LCD_PAL198_B14_0_Pos)                          /*!< LCD PAL198: B14_0 Mask              */\r
+#define LCD_PAL198_I1_Pos                                     31                                                        /*!< LCD PAL198: I1 Position             */\r
+#define LCD_PAL198_I1_Msk                                     (0x01UL << LCD_PAL198_I1_Pos)                             /*!< LCD PAL198: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL199  -------------------------------------------\r
+#define LCD_PAL199_R04_0_Pos                                  0                                                         /*!< LCD PAL199: R04_0 Position          */\r
+#define LCD_PAL199_R04_0_Msk                                  (0x1fUL << LCD_PAL199_R04_0_Pos)                          /*!< LCD PAL199: R04_0 Mask              */\r
+#define LCD_PAL199_G04_0_Pos                                  5                                                         /*!< LCD PAL199: G04_0 Position          */\r
+#define LCD_PAL199_G04_0_Msk                                  (0x1fUL << LCD_PAL199_G04_0_Pos)                          /*!< LCD PAL199: G04_0 Mask              */\r
+#define LCD_PAL199_B04_0_Pos                                  10                                                        /*!< LCD PAL199: B04_0 Position          */\r
+#define LCD_PAL199_B04_0_Msk                                  (0x1fUL << LCD_PAL199_B04_0_Pos)                          /*!< LCD PAL199: B04_0 Mask              */\r
+#define LCD_PAL199_I0_Pos                                     15                                                        /*!< LCD PAL199: I0 Position             */\r
+#define LCD_PAL199_I0_Msk                                     (0x01UL << LCD_PAL199_I0_Pos)                             /*!< LCD PAL199: I0 Mask                 */\r
+#define LCD_PAL199_R14_0_Pos                                  16                                                        /*!< LCD PAL199: R14_0 Position          */\r
+#define LCD_PAL199_R14_0_Msk                                  (0x1fUL << LCD_PAL199_R14_0_Pos)                          /*!< LCD PAL199: R14_0 Mask              */\r
+#define LCD_PAL199_G14_0_Pos                                  21                                                        /*!< LCD PAL199: G14_0 Position          */\r
+#define LCD_PAL199_G14_0_Msk                                  (0x1fUL << LCD_PAL199_G14_0_Pos)                          /*!< LCD PAL199: G14_0 Mask              */\r
+#define LCD_PAL199_B14_0_Pos                                  26                                                        /*!< LCD PAL199: B14_0 Position          */\r
+#define LCD_PAL199_B14_0_Msk                                  (0x1fUL << LCD_PAL199_B14_0_Pos)                          /*!< LCD PAL199: B14_0 Mask              */\r
+#define LCD_PAL199_I1_Pos                                     31                                                        /*!< LCD PAL199: I1 Position             */\r
+#define LCD_PAL199_I1_Msk                                     (0x01UL << LCD_PAL199_I1_Pos)                             /*!< LCD PAL199: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL200  -------------------------------------------\r
+#define LCD_PAL200_R04_0_Pos                                  0                                                         /*!< LCD PAL200: R04_0 Position          */\r
+#define LCD_PAL200_R04_0_Msk                                  (0x1fUL << LCD_PAL200_R04_0_Pos)                          /*!< LCD PAL200: R04_0 Mask              */\r
+#define LCD_PAL200_G04_0_Pos                                  5                                                         /*!< LCD PAL200: G04_0 Position          */\r
+#define LCD_PAL200_G04_0_Msk                                  (0x1fUL << LCD_PAL200_G04_0_Pos)                          /*!< LCD PAL200: G04_0 Mask              */\r
+#define LCD_PAL200_B04_0_Pos                                  10                                                        /*!< LCD PAL200: B04_0 Position          */\r
+#define LCD_PAL200_B04_0_Msk                                  (0x1fUL << LCD_PAL200_B04_0_Pos)                          /*!< LCD PAL200: B04_0 Mask              */\r
+#define LCD_PAL200_I0_Pos                                     15                                                        /*!< LCD PAL200: I0 Position             */\r
+#define LCD_PAL200_I0_Msk                                     (0x01UL << LCD_PAL200_I0_Pos)                             /*!< LCD PAL200: I0 Mask                 */\r
+#define LCD_PAL200_R14_0_Pos                                  16                                                        /*!< LCD PAL200: R14_0 Position          */\r
+#define LCD_PAL200_R14_0_Msk                                  (0x1fUL << LCD_PAL200_R14_0_Pos)                          /*!< LCD PAL200: R14_0 Mask              */\r
+#define LCD_PAL200_G14_0_Pos                                  21                                                        /*!< LCD PAL200: G14_0 Position          */\r
+#define LCD_PAL200_G14_0_Msk                                  (0x1fUL << LCD_PAL200_G14_0_Pos)                          /*!< LCD PAL200: G14_0 Mask              */\r
+#define LCD_PAL200_B14_0_Pos                                  26                                                        /*!< LCD PAL200: B14_0 Position          */\r
+#define LCD_PAL200_B14_0_Msk                                  (0x1fUL << LCD_PAL200_B14_0_Pos)                          /*!< LCD PAL200: B14_0 Mask              */\r
+#define LCD_PAL200_I1_Pos                                     31                                                        /*!< LCD PAL200: I1 Position             */\r
+#define LCD_PAL200_I1_Msk                                     (0x01UL << LCD_PAL200_I1_Pos)                             /*!< LCD PAL200: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL201  -------------------------------------------\r
+#define LCD_PAL201_R04_0_Pos                                  0                                                         /*!< LCD PAL201: R04_0 Position          */\r
+#define LCD_PAL201_R04_0_Msk                                  (0x1fUL << LCD_PAL201_R04_0_Pos)                          /*!< LCD PAL201: R04_0 Mask              */\r
+#define LCD_PAL201_G04_0_Pos                                  5                                                         /*!< LCD PAL201: G04_0 Position          */\r
+#define LCD_PAL201_G04_0_Msk                                  (0x1fUL << LCD_PAL201_G04_0_Pos)                          /*!< LCD PAL201: G04_0 Mask              */\r
+#define LCD_PAL201_B04_0_Pos                                  10                                                        /*!< LCD PAL201: B04_0 Position          */\r
+#define LCD_PAL201_B04_0_Msk                                  (0x1fUL << LCD_PAL201_B04_0_Pos)                          /*!< LCD PAL201: B04_0 Mask              */\r
+#define LCD_PAL201_I0_Pos                                     15                                                        /*!< LCD PAL201: I0 Position             */\r
+#define LCD_PAL201_I0_Msk                                     (0x01UL << LCD_PAL201_I0_Pos)                             /*!< LCD PAL201: I0 Mask                 */\r
+#define LCD_PAL201_R14_0_Pos                                  16                                                        /*!< LCD PAL201: R14_0 Position          */\r
+#define LCD_PAL201_R14_0_Msk                                  (0x1fUL << LCD_PAL201_R14_0_Pos)                          /*!< LCD PAL201: R14_0 Mask              */\r
+#define LCD_PAL201_G14_0_Pos                                  21                                                        /*!< LCD PAL201: G14_0 Position          */\r
+#define LCD_PAL201_G14_0_Msk                                  (0x1fUL << LCD_PAL201_G14_0_Pos)                          /*!< LCD PAL201: G14_0 Mask              */\r
+#define LCD_PAL201_B14_0_Pos                                  26                                                        /*!< LCD PAL201: B14_0 Position          */\r
+#define LCD_PAL201_B14_0_Msk                                  (0x1fUL << LCD_PAL201_B14_0_Pos)                          /*!< LCD PAL201: B14_0 Mask              */\r
+#define LCD_PAL201_I1_Pos                                     31                                                        /*!< LCD PAL201: I1 Position             */\r
+#define LCD_PAL201_I1_Msk                                     (0x01UL << LCD_PAL201_I1_Pos)                             /*!< LCD PAL201: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL202  -------------------------------------------\r
+#define LCD_PAL202_R04_0_Pos                                  0                                                         /*!< LCD PAL202: R04_0 Position          */\r
+#define LCD_PAL202_R04_0_Msk                                  (0x1fUL << LCD_PAL202_R04_0_Pos)                          /*!< LCD PAL202: R04_0 Mask              */\r
+#define LCD_PAL202_G04_0_Pos                                  5                                                         /*!< LCD PAL202: G04_0 Position          */\r
+#define LCD_PAL202_G04_0_Msk                                  (0x1fUL << LCD_PAL202_G04_0_Pos)                          /*!< LCD PAL202: G04_0 Mask              */\r
+#define LCD_PAL202_B04_0_Pos                                  10                                                        /*!< LCD PAL202: B04_0 Position          */\r
+#define LCD_PAL202_B04_0_Msk                                  (0x1fUL << LCD_PAL202_B04_0_Pos)                          /*!< LCD PAL202: B04_0 Mask              */\r
+#define LCD_PAL202_I0_Pos                                     15                                                        /*!< LCD PAL202: I0 Position             */\r
+#define LCD_PAL202_I0_Msk                                     (0x01UL << LCD_PAL202_I0_Pos)                             /*!< LCD PAL202: I0 Mask                 */\r
+#define LCD_PAL202_R14_0_Pos                                  16                                                        /*!< LCD PAL202: R14_0 Position          */\r
+#define LCD_PAL202_R14_0_Msk                                  (0x1fUL << LCD_PAL202_R14_0_Pos)                          /*!< LCD PAL202: R14_0 Mask              */\r
+#define LCD_PAL202_G14_0_Pos                                  21                                                        /*!< LCD PAL202: G14_0 Position          */\r
+#define LCD_PAL202_G14_0_Msk                                  (0x1fUL << LCD_PAL202_G14_0_Pos)                          /*!< LCD PAL202: G14_0 Mask              */\r
+#define LCD_PAL202_B14_0_Pos                                  26                                                        /*!< LCD PAL202: B14_0 Position          */\r
+#define LCD_PAL202_B14_0_Msk                                  (0x1fUL << LCD_PAL202_B14_0_Pos)                          /*!< LCD PAL202: B14_0 Mask              */\r
+#define LCD_PAL202_I1_Pos                                     31                                                        /*!< LCD PAL202: I1 Position             */\r
+#define LCD_PAL202_I1_Msk                                     (0x01UL << LCD_PAL202_I1_Pos)                             /*!< LCD PAL202: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL203  -------------------------------------------\r
+#define LCD_PAL203_R04_0_Pos                                  0                                                         /*!< LCD PAL203: R04_0 Position          */\r
+#define LCD_PAL203_R04_0_Msk                                  (0x1fUL << LCD_PAL203_R04_0_Pos)                          /*!< LCD PAL203: R04_0 Mask              */\r
+#define LCD_PAL203_G04_0_Pos                                  5                                                         /*!< LCD PAL203: G04_0 Position          */\r
+#define LCD_PAL203_G04_0_Msk                                  (0x1fUL << LCD_PAL203_G04_0_Pos)                          /*!< LCD PAL203: G04_0 Mask              */\r
+#define LCD_PAL203_B04_0_Pos                                  10                                                        /*!< LCD PAL203: B04_0 Position          */\r
+#define LCD_PAL203_B04_0_Msk                                  (0x1fUL << LCD_PAL203_B04_0_Pos)                          /*!< LCD PAL203: B04_0 Mask              */\r
+#define LCD_PAL203_I0_Pos                                     15                                                        /*!< LCD PAL203: I0 Position             */\r
+#define LCD_PAL203_I0_Msk                                     (0x01UL << LCD_PAL203_I0_Pos)                             /*!< LCD PAL203: I0 Mask                 */\r
+#define LCD_PAL203_R14_0_Pos                                  16                                                        /*!< LCD PAL203: R14_0 Position          */\r
+#define LCD_PAL203_R14_0_Msk                                  (0x1fUL << LCD_PAL203_R14_0_Pos)                          /*!< LCD PAL203: R14_0 Mask              */\r
+#define LCD_PAL203_G14_0_Pos                                  21                                                        /*!< LCD PAL203: G14_0 Position          */\r
+#define LCD_PAL203_G14_0_Msk                                  (0x1fUL << LCD_PAL203_G14_0_Pos)                          /*!< LCD PAL203: G14_0 Mask              */\r
+#define LCD_PAL203_B14_0_Pos                                  26                                                        /*!< LCD PAL203: B14_0 Position          */\r
+#define LCD_PAL203_B14_0_Msk                                  (0x1fUL << LCD_PAL203_B14_0_Pos)                          /*!< LCD PAL203: B14_0 Mask              */\r
+#define LCD_PAL203_I1_Pos                                     31                                                        /*!< LCD PAL203: I1 Position             */\r
+#define LCD_PAL203_I1_Msk                                     (0x01UL << LCD_PAL203_I1_Pos)                             /*!< LCD PAL203: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL204  -------------------------------------------\r
+#define LCD_PAL204_R04_0_Pos                                  0                                                         /*!< LCD PAL204: R04_0 Position          */\r
+#define LCD_PAL204_R04_0_Msk                                  (0x1fUL << LCD_PAL204_R04_0_Pos)                          /*!< LCD PAL204: R04_0 Mask              */\r
+#define LCD_PAL204_G04_0_Pos                                  5                                                         /*!< LCD PAL204: G04_0 Position          */\r
+#define LCD_PAL204_G04_0_Msk                                  (0x1fUL << LCD_PAL204_G04_0_Pos)                          /*!< LCD PAL204: G04_0 Mask              */\r
+#define LCD_PAL204_B04_0_Pos                                  10                                                        /*!< LCD PAL204: B04_0 Position          */\r
+#define LCD_PAL204_B04_0_Msk                                  (0x1fUL << LCD_PAL204_B04_0_Pos)                          /*!< LCD PAL204: B04_0 Mask              */\r
+#define LCD_PAL204_I0_Pos                                     15                                                        /*!< LCD PAL204: I0 Position             */\r
+#define LCD_PAL204_I0_Msk                                     (0x01UL << LCD_PAL204_I0_Pos)                             /*!< LCD PAL204: I0 Mask                 */\r
+#define LCD_PAL204_R14_0_Pos                                  16                                                        /*!< LCD PAL204: R14_0 Position          */\r
+#define LCD_PAL204_R14_0_Msk                                  (0x1fUL << LCD_PAL204_R14_0_Pos)                          /*!< LCD PAL204: R14_0 Mask              */\r
+#define LCD_PAL204_G14_0_Pos                                  21                                                        /*!< LCD PAL204: G14_0 Position          */\r
+#define LCD_PAL204_G14_0_Msk                                  (0x1fUL << LCD_PAL204_G14_0_Pos)                          /*!< LCD PAL204: G14_0 Mask              */\r
+#define LCD_PAL204_B14_0_Pos                                  26                                                        /*!< LCD PAL204: B14_0 Position          */\r
+#define LCD_PAL204_B14_0_Msk                                  (0x1fUL << LCD_PAL204_B14_0_Pos)                          /*!< LCD PAL204: B14_0 Mask              */\r
+#define LCD_PAL204_I1_Pos                                     31                                                        /*!< LCD PAL204: I1 Position             */\r
+#define LCD_PAL204_I1_Msk                                     (0x01UL << LCD_PAL204_I1_Pos)                             /*!< LCD PAL204: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL205  -------------------------------------------\r
+#define LCD_PAL205_R04_0_Pos                                  0                                                         /*!< LCD PAL205: R04_0 Position          */\r
+#define LCD_PAL205_R04_0_Msk                                  (0x1fUL << LCD_PAL205_R04_0_Pos)                          /*!< LCD PAL205: R04_0 Mask              */\r
+#define LCD_PAL205_G04_0_Pos                                  5                                                         /*!< LCD PAL205: G04_0 Position          */\r
+#define LCD_PAL205_G04_0_Msk                                  (0x1fUL << LCD_PAL205_G04_0_Pos)                          /*!< LCD PAL205: G04_0 Mask              */\r
+#define LCD_PAL205_B04_0_Pos                                  10                                                        /*!< LCD PAL205: B04_0 Position          */\r
+#define LCD_PAL205_B04_0_Msk                                  (0x1fUL << LCD_PAL205_B04_0_Pos)                          /*!< LCD PAL205: B04_0 Mask              */\r
+#define LCD_PAL205_I0_Pos                                     15                                                        /*!< LCD PAL205: I0 Position             */\r
+#define LCD_PAL205_I0_Msk                                     (0x01UL << LCD_PAL205_I0_Pos)                             /*!< LCD PAL205: I0 Mask                 */\r
+#define LCD_PAL205_R14_0_Pos                                  16                                                        /*!< LCD PAL205: R14_0 Position          */\r
+#define LCD_PAL205_R14_0_Msk                                  (0x1fUL << LCD_PAL205_R14_0_Pos)                          /*!< LCD PAL205: R14_0 Mask              */\r
+#define LCD_PAL205_G14_0_Pos                                  21                                                        /*!< LCD PAL205: G14_0 Position          */\r
+#define LCD_PAL205_G14_0_Msk                                  (0x1fUL << LCD_PAL205_G14_0_Pos)                          /*!< LCD PAL205: G14_0 Mask              */\r
+#define LCD_PAL205_B14_0_Pos                                  26                                                        /*!< LCD PAL205: B14_0 Position          */\r
+#define LCD_PAL205_B14_0_Msk                                  (0x1fUL << LCD_PAL205_B14_0_Pos)                          /*!< LCD PAL205: B14_0 Mask              */\r
+#define LCD_PAL205_I1_Pos                                     31                                                        /*!< LCD PAL205: I1 Position             */\r
+#define LCD_PAL205_I1_Msk                                     (0x01UL << LCD_PAL205_I1_Pos)                             /*!< LCD PAL205: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL206  -------------------------------------------\r
+#define LCD_PAL206_R04_0_Pos                                  0                                                         /*!< LCD PAL206: R04_0 Position          */\r
+#define LCD_PAL206_R04_0_Msk                                  (0x1fUL << LCD_PAL206_R04_0_Pos)                          /*!< LCD PAL206: R04_0 Mask              */\r
+#define LCD_PAL206_G04_0_Pos                                  5                                                         /*!< LCD PAL206: G04_0 Position          */\r
+#define LCD_PAL206_G04_0_Msk                                  (0x1fUL << LCD_PAL206_G04_0_Pos)                          /*!< LCD PAL206: G04_0 Mask              */\r
+#define LCD_PAL206_B04_0_Pos                                  10                                                        /*!< LCD PAL206: B04_0 Position          */\r
+#define LCD_PAL206_B04_0_Msk                                  (0x1fUL << LCD_PAL206_B04_0_Pos)                          /*!< LCD PAL206: B04_0 Mask              */\r
+#define LCD_PAL206_I0_Pos                                     15                                                        /*!< LCD PAL206: I0 Position             */\r
+#define LCD_PAL206_I0_Msk                                     (0x01UL << LCD_PAL206_I0_Pos)                             /*!< LCD PAL206: I0 Mask                 */\r
+#define LCD_PAL206_R14_0_Pos                                  16                                                        /*!< LCD PAL206: R14_0 Position          */\r
+#define LCD_PAL206_R14_0_Msk                                  (0x1fUL << LCD_PAL206_R14_0_Pos)                          /*!< LCD PAL206: R14_0 Mask              */\r
+#define LCD_PAL206_G14_0_Pos                                  21                                                        /*!< LCD PAL206: G14_0 Position          */\r
+#define LCD_PAL206_G14_0_Msk                                  (0x1fUL << LCD_PAL206_G14_0_Pos)                          /*!< LCD PAL206: G14_0 Mask              */\r
+#define LCD_PAL206_B14_0_Pos                                  26                                                        /*!< LCD PAL206: B14_0 Position          */\r
+#define LCD_PAL206_B14_0_Msk                                  (0x1fUL << LCD_PAL206_B14_0_Pos)                          /*!< LCD PAL206: B14_0 Mask              */\r
+#define LCD_PAL206_I1_Pos                                     31                                                        /*!< LCD PAL206: I1 Position             */\r
+#define LCD_PAL206_I1_Msk                                     (0x01UL << LCD_PAL206_I1_Pos)                             /*!< LCD PAL206: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL207  -------------------------------------------\r
+#define LCD_PAL207_R04_0_Pos                                  0                                                         /*!< LCD PAL207: R04_0 Position          */\r
+#define LCD_PAL207_R04_0_Msk                                  (0x1fUL << LCD_PAL207_R04_0_Pos)                          /*!< LCD PAL207: R04_0 Mask              */\r
+#define LCD_PAL207_G04_0_Pos                                  5                                                         /*!< LCD PAL207: G04_0 Position          */\r
+#define LCD_PAL207_G04_0_Msk                                  (0x1fUL << LCD_PAL207_G04_0_Pos)                          /*!< LCD PAL207: G04_0 Mask              */\r
+#define LCD_PAL207_B04_0_Pos                                  10                                                        /*!< LCD PAL207: B04_0 Position          */\r
+#define LCD_PAL207_B04_0_Msk                                  (0x1fUL << LCD_PAL207_B04_0_Pos)                          /*!< LCD PAL207: B04_0 Mask              */\r
+#define LCD_PAL207_I0_Pos                                     15                                                        /*!< LCD PAL207: I0 Position             */\r
+#define LCD_PAL207_I0_Msk                                     (0x01UL << LCD_PAL207_I0_Pos)                             /*!< LCD PAL207: I0 Mask                 */\r
+#define LCD_PAL207_R14_0_Pos                                  16                                                        /*!< LCD PAL207: R14_0 Position          */\r
+#define LCD_PAL207_R14_0_Msk                                  (0x1fUL << LCD_PAL207_R14_0_Pos)                          /*!< LCD PAL207: R14_0 Mask              */\r
+#define LCD_PAL207_G14_0_Pos                                  21                                                        /*!< LCD PAL207: G14_0 Position          */\r
+#define LCD_PAL207_G14_0_Msk                                  (0x1fUL << LCD_PAL207_G14_0_Pos)                          /*!< LCD PAL207: G14_0 Mask              */\r
+#define LCD_PAL207_B14_0_Pos                                  26                                                        /*!< LCD PAL207: B14_0 Position          */\r
+#define LCD_PAL207_B14_0_Msk                                  (0x1fUL << LCD_PAL207_B14_0_Pos)                          /*!< LCD PAL207: B14_0 Mask              */\r
+#define LCD_PAL207_I1_Pos                                     31                                                        /*!< LCD PAL207: I1 Position             */\r
+#define LCD_PAL207_I1_Msk                                     (0x01UL << LCD_PAL207_I1_Pos)                             /*!< LCD PAL207: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL208  -------------------------------------------\r
+#define LCD_PAL208_R04_0_Pos                                  0                                                         /*!< LCD PAL208: R04_0 Position          */\r
+#define LCD_PAL208_R04_0_Msk                                  (0x1fUL << LCD_PAL208_R04_0_Pos)                          /*!< LCD PAL208: R04_0 Mask              */\r
+#define LCD_PAL208_G04_0_Pos                                  5                                                         /*!< LCD PAL208: G04_0 Position          */\r
+#define LCD_PAL208_G04_0_Msk                                  (0x1fUL << LCD_PAL208_G04_0_Pos)                          /*!< LCD PAL208: G04_0 Mask              */\r
+#define LCD_PAL208_B04_0_Pos                                  10                                                        /*!< LCD PAL208: B04_0 Position          */\r
+#define LCD_PAL208_B04_0_Msk                                  (0x1fUL << LCD_PAL208_B04_0_Pos)                          /*!< LCD PAL208: B04_0 Mask              */\r
+#define LCD_PAL208_I0_Pos                                     15                                                        /*!< LCD PAL208: I0 Position             */\r
+#define LCD_PAL208_I0_Msk                                     (0x01UL << LCD_PAL208_I0_Pos)                             /*!< LCD PAL208: I0 Mask                 */\r
+#define LCD_PAL208_R14_0_Pos                                  16                                                        /*!< LCD PAL208: R14_0 Position          */\r
+#define LCD_PAL208_R14_0_Msk                                  (0x1fUL << LCD_PAL208_R14_0_Pos)                          /*!< LCD PAL208: R14_0 Mask              */\r
+#define LCD_PAL208_G14_0_Pos                                  21                                                        /*!< LCD PAL208: G14_0 Position          */\r
+#define LCD_PAL208_G14_0_Msk                                  (0x1fUL << LCD_PAL208_G14_0_Pos)                          /*!< LCD PAL208: G14_0 Mask              */\r
+#define LCD_PAL208_B14_0_Pos                                  26                                                        /*!< LCD PAL208: B14_0 Position          */\r
+#define LCD_PAL208_B14_0_Msk                                  (0x1fUL << LCD_PAL208_B14_0_Pos)                          /*!< LCD PAL208: B14_0 Mask              */\r
+#define LCD_PAL208_I1_Pos                                     31                                                        /*!< LCD PAL208: I1 Position             */\r
+#define LCD_PAL208_I1_Msk                                     (0x01UL << LCD_PAL208_I1_Pos)                             /*!< LCD PAL208: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL209  -------------------------------------------\r
+#define LCD_PAL209_R04_0_Pos                                  0                                                         /*!< LCD PAL209: R04_0 Position          */\r
+#define LCD_PAL209_R04_0_Msk                                  (0x1fUL << LCD_PAL209_R04_0_Pos)                          /*!< LCD PAL209: R04_0 Mask              */\r
+#define LCD_PAL209_G04_0_Pos                                  5                                                         /*!< LCD PAL209: G04_0 Position          */\r
+#define LCD_PAL209_G04_0_Msk                                  (0x1fUL << LCD_PAL209_G04_0_Pos)                          /*!< LCD PAL209: G04_0 Mask              */\r
+#define LCD_PAL209_B04_0_Pos                                  10                                                        /*!< LCD PAL209: B04_0 Position          */\r
+#define LCD_PAL209_B04_0_Msk                                  (0x1fUL << LCD_PAL209_B04_0_Pos)                          /*!< LCD PAL209: B04_0 Mask              */\r
+#define LCD_PAL209_I0_Pos                                     15                                                        /*!< LCD PAL209: I0 Position             */\r
+#define LCD_PAL209_I0_Msk                                     (0x01UL << LCD_PAL209_I0_Pos)                             /*!< LCD PAL209: I0 Mask                 */\r
+#define LCD_PAL209_R14_0_Pos                                  16                                                        /*!< LCD PAL209: R14_0 Position          */\r
+#define LCD_PAL209_R14_0_Msk                                  (0x1fUL << LCD_PAL209_R14_0_Pos)                          /*!< LCD PAL209: R14_0 Mask              */\r
+#define LCD_PAL209_G14_0_Pos                                  21                                                        /*!< LCD PAL209: G14_0 Position          */\r
+#define LCD_PAL209_G14_0_Msk                                  (0x1fUL << LCD_PAL209_G14_0_Pos)                          /*!< LCD PAL209: G14_0 Mask              */\r
+#define LCD_PAL209_B14_0_Pos                                  26                                                        /*!< LCD PAL209: B14_0 Position          */\r
+#define LCD_PAL209_B14_0_Msk                                  (0x1fUL << LCD_PAL209_B14_0_Pos)                          /*!< LCD PAL209: B14_0 Mask              */\r
+#define LCD_PAL209_I1_Pos                                     31                                                        /*!< LCD PAL209: I1 Position             */\r
+#define LCD_PAL209_I1_Msk                                     (0x01UL << LCD_PAL209_I1_Pos)                             /*!< LCD PAL209: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL210  -------------------------------------------\r
+#define LCD_PAL210_R04_0_Pos                                  0                                                         /*!< LCD PAL210: R04_0 Position          */\r
+#define LCD_PAL210_R04_0_Msk                                  (0x1fUL << LCD_PAL210_R04_0_Pos)                          /*!< LCD PAL210: R04_0 Mask              */\r
+#define LCD_PAL210_G04_0_Pos                                  5                                                         /*!< LCD PAL210: G04_0 Position          */\r
+#define LCD_PAL210_G04_0_Msk                                  (0x1fUL << LCD_PAL210_G04_0_Pos)                          /*!< LCD PAL210: G04_0 Mask              */\r
+#define LCD_PAL210_B04_0_Pos                                  10                                                        /*!< LCD PAL210: B04_0 Position          */\r
+#define LCD_PAL210_B04_0_Msk                                  (0x1fUL << LCD_PAL210_B04_0_Pos)                          /*!< LCD PAL210: B04_0 Mask              */\r
+#define LCD_PAL210_I0_Pos                                     15                                                        /*!< LCD PAL210: I0 Position             */\r
+#define LCD_PAL210_I0_Msk                                     (0x01UL << LCD_PAL210_I0_Pos)                             /*!< LCD PAL210: I0 Mask                 */\r
+#define LCD_PAL210_R14_0_Pos                                  16                                                        /*!< LCD PAL210: R14_0 Position          */\r
+#define LCD_PAL210_R14_0_Msk                                  (0x1fUL << LCD_PAL210_R14_0_Pos)                          /*!< LCD PAL210: R14_0 Mask              */\r
+#define LCD_PAL210_G14_0_Pos                                  21                                                        /*!< LCD PAL210: G14_0 Position          */\r
+#define LCD_PAL210_G14_0_Msk                                  (0x1fUL << LCD_PAL210_G14_0_Pos)                          /*!< LCD PAL210: G14_0 Mask              */\r
+#define LCD_PAL210_B14_0_Pos                                  26                                                        /*!< LCD PAL210: B14_0 Position          */\r
+#define LCD_PAL210_B14_0_Msk                                  (0x1fUL << LCD_PAL210_B14_0_Pos)                          /*!< LCD PAL210: B14_0 Mask              */\r
+#define LCD_PAL210_I1_Pos                                     31                                                        /*!< LCD PAL210: I1 Position             */\r
+#define LCD_PAL210_I1_Msk                                     (0x01UL << LCD_PAL210_I1_Pos)                             /*!< LCD PAL210: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL211  -------------------------------------------\r
+#define LCD_PAL211_R04_0_Pos                                  0                                                         /*!< LCD PAL211: R04_0 Position          */\r
+#define LCD_PAL211_R04_0_Msk                                  (0x1fUL << LCD_PAL211_R04_0_Pos)                          /*!< LCD PAL211: R04_0 Mask              */\r
+#define LCD_PAL211_G04_0_Pos                                  5                                                         /*!< LCD PAL211: G04_0 Position          */\r
+#define LCD_PAL211_G04_0_Msk                                  (0x1fUL << LCD_PAL211_G04_0_Pos)                          /*!< LCD PAL211: G04_0 Mask              */\r
+#define LCD_PAL211_B04_0_Pos                                  10                                                        /*!< LCD PAL211: B04_0 Position          */\r
+#define LCD_PAL211_B04_0_Msk                                  (0x1fUL << LCD_PAL211_B04_0_Pos)                          /*!< LCD PAL211: B04_0 Mask              */\r
+#define LCD_PAL211_I0_Pos                                     15                                                        /*!< LCD PAL211: I0 Position             */\r
+#define LCD_PAL211_I0_Msk                                     (0x01UL << LCD_PAL211_I0_Pos)                             /*!< LCD PAL211: I0 Mask                 */\r
+#define LCD_PAL211_R14_0_Pos                                  16                                                        /*!< LCD PAL211: R14_0 Position          */\r
+#define LCD_PAL211_R14_0_Msk                                  (0x1fUL << LCD_PAL211_R14_0_Pos)                          /*!< LCD PAL211: R14_0 Mask              */\r
+#define LCD_PAL211_G14_0_Pos                                  21                                                        /*!< LCD PAL211: G14_0 Position          */\r
+#define LCD_PAL211_G14_0_Msk                                  (0x1fUL << LCD_PAL211_G14_0_Pos)                          /*!< LCD PAL211: G14_0 Mask              */\r
+#define LCD_PAL211_B14_0_Pos                                  26                                                        /*!< LCD PAL211: B14_0 Position          */\r
+#define LCD_PAL211_B14_0_Msk                                  (0x1fUL << LCD_PAL211_B14_0_Pos)                          /*!< LCD PAL211: B14_0 Mask              */\r
+#define LCD_PAL211_I1_Pos                                     31                                                        /*!< LCD PAL211: I1 Position             */\r
+#define LCD_PAL211_I1_Msk                                     (0x01UL << LCD_PAL211_I1_Pos)                             /*!< LCD PAL211: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL212  -------------------------------------------\r
+#define LCD_PAL212_R04_0_Pos                                  0                                                         /*!< LCD PAL212: R04_0 Position          */\r
+#define LCD_PAL212_R04_0_Msk                                  (0x1fUL << LCD_PAL212_R04_0_Pos)                          /*!< LCD PAL212: R04_0 Mask              */\r
+#define LCD_PAL212_G04_0_Pos                                  5                                                         /*!< LCD PAL212: G04_0 Position          */\r
+#define LCD_PAL212_G04_0_Msk                                  (0x1fUL << LCD_PAL212_G04_0_Pos)                          /*!< LCD PAL212: G04_0 Mask              */\r
+#define LCD_PAL212_B04_0_Pos                                  10                                                        /*!< LCD PAL212: B04_0 Position          */\r
+#define LCD_PAL212_B04_0_Msk                                  (0x1fUL << LCD_PAL212_B04_0_Pos)                          /*!< LCD PAL212: B04_0 Mask              */\r
+#define LCD_PAL212_I0_Pos                                     15                                                        /*!< LCD PAL212: I0 Position             */\r
+#define LCD_PAL212_I0_Msk                                     (0x01UL << LCD_PAL212_I0_Pos)                             /*!< LCD PAL212: I0 Mask                 */\r
+#define LCD_PAL212_R14_0_Pos                                  16                                                        /*!< LCD PAL212: R14_0 Position          */\r
+#define LCD_PAL212_R14_0_Msk                                  (0x1fUL << LCD_PAL212_R14_0_Pos)                          /*!< LCD PAL212: R14_0 Mask              */\r
+#define LCD_PAL212_G14_0_Pos                                  21                                                        /*!< LCD PAL212: G14_0 Position          */\r
+#define LCD_PAL212_G14_0_Msk                                  (0x1fUL << LCD_PAL212_G14_0_Pos)                          /*!< LCD PAL212: G14_0 Mask              */\r
+#define LCD_PAL212_B14_0_Pos                                  26                                                        /*!< LCD PAL212: B14_0 Position          */\r
+#define LCD_PAL212_B14_0_Msk                                  (0x1fUL << LCD_PAL212_B14_0_Pos)                          /*!< LCD PAL212: B14_0 Mask              */\r
+#define LCD_PAL212_I1_Pos                                     31                                                        /*!< LCD PAL212: I1 Position             */\r
+#define LCD_PAL212_I1_Msk                                     (0x01UL << LCD_PAL212_I1_Pos)                             /*!< LCD PAL212: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL213  -------------------------------------------\r
+#define LCD_PAL213_R04_0_Pos                                  0                                                         /*!< LCD PAL213: R04_0 Position          */\r
+#define LCD_PAL213_R04_0_Msk                                  (0x1fUL << LCD_PAL213_R04_0_Pos)                          /*!< LCD PAL213: R04_0 Mask              */\r
+#define LCD_PAL213_G04_0_Pos                                  5                                                         /*!< LCD PAL213: G04_0 Position          */\r
+#define LCD_PAL213_G04_0_Msk                                  (0x1fUL << LCD_PAL213_G04_0_Pos)                          /*!< LCD PAL213: G04_0 Mask              */\r
+#define LCD_PAL213_B04_0_Pos                                  10                                                        /*!< LCD PAL213: B04_0 Position          */\r
+#define LCD_PAL213_B04_0_Msk                                  (0x1fUL << LCD_PAL213_B04_0_Pos)                          /*!< LCD PAL213: B04_0 Mask              */\r
+#define LCD_PAL213_I0_Pos                                     15                                                        /*!< LCD PAL213: I0 Position             */\r
+#define LCD_PAL213_I0_Msk                                     (0x01UL << LCD_PAL213_I0_Pos)                             /*!< LCD PAL213: I0 Mask                 */\r
+#define LCD_PAL213_R14_0_Pos                                  16                                                        /*!< LCD PAL213: R14_0 Position          */\r
+#define LCD_PAL213_R14_0_Msk                                  (0x1fUL << LCD_PAL213_R14_0_Pos)                          /*!< LCD PAL213: R14_0 Mask              */\r
+#define LCD_PAL213_G14_0_Pos                                  21                                                        /*!< LCD PAL213: G14_0 Position          */\r
+#define LCD_PAL213_G14_0_Msk                                  (0x1fUL << LCD_PAL213_G14_0_Pos)                          /*!< LCD PAL213: G14_0 Mask              */\r
+#define LCD_PAL213_B14_0_Pos                                  26                                                        /*!< LCD PAL213: B14_0 Position          */\r
+#define LCD_PAL213_B14_0_Msk                                  (0x1fUL << LCD_PAL213_B14_0_Pos)                          /*!< LCD PAL213: B14_0 Mask              */\r
+#define LCD_PAL213_I1_Pos                                     31                                                        /*!< LCD PAL213: I1 Position             */\r
+#define LCD_PAL213_I1_Msk                                     (0x01UL << LCD_PAL213_I1_Pos)                             /*!< LCD PAL213: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL214  -------------------------------------------\r
+#define LCD_PAL214_R04_0_Pos                                  0                                                         /*!< LCD PAL214: R04_0 Position          */\r
+#define LCD_PAL214_R04_0_Msk                                  (0x1fUL << LCD_PAL214_R04_0_Pos)                          /*!< LCD PAL214: R04_0 Mask              */\r
+#define LCD_PAL214_G04_0_Pos                                  5                                                         /*!< LCD PAL214: G04_0 Position          */\r
+#define LCD_PAL214_G04_0_Msk                                  (0x1fUL << LCD_PAL214_G04_0_Pos)                          /*!< LCD PAL214: G04_0 Mask              */\r
+#define LCD_PAL214_B04_0_Pos                                  10                                                        /*!< LCD PAL214: B04_0 Position          */\r
+#define LCD_PAL214_B04_0_Msk                                  (0x1fUL << LCD_PAL214_B04_0_Pos)                          /*!< LCD PAL214: B04_0 Mask              */\r
+#define LCD_PAL214_I0_Pos                                     15                                                        /*!< LCD PAL214: I0 Position             */\r
+#define LCD_PAL214_I0_Msk                                     (0x01UL << LCD_PAL214_I0_Pos)                             /*!< LCD PAL214: I0 Mask                 */\r
+#define LCD_PAL214_R14_0_Pos                                  16                                                        /*!< LCD PAL214: R14_0 Position          */\r
+#define LCD_PAL214_R14_0_Msk                                  (0x1fUL << LCD_PAL214_R14_0_Pos)                          /*!< LCD PAL214: R14_0 Mask              */\r
+#define LCD_PAL214_G14_0_Pos                                  21                                                        /*!< LCD PAL214: G14_0 Position          */\r
+#define LCD_PAL214_G14_0_Msk                                  (0x1fUL << LCD_PAL214_G14_0_Pos)                          /*!< LCD PAL214: G14_0 Mask              */\r
+#define LCD_PAL214_B14_0_Pos                                  26                                                        /*!< LCD PAL214: B14_0 Position          */\r
+#define LCD_PAL214_B14_0_Msk                                  (0x1fUL << LCD_PAL214_B14_0_Pos)                          /*!< LCD PAL214: B14_0 Mask              */\r
+#define LCD_PAL214_I1_Pos                                     31                                                        /*!< LCD PAL214: I1 Position             */\r
+#define LCD_PAL214_I1_Msk                                     (0x01UL << LCD_PAL214_I1_Pos)                             /*!< LCD PAL214: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL215  -------------------------------------------\r
+#define LCD_PAL215_R04_0_Pos                                  0                                                         /*!< LCD PAL215: R04_0 Position          */\r
+#define LCD_PAL215_R04_0_Msk                                  (0x1fUL << LCD_PAL215_R04_0_Pos)                          /*!< LCD PAL215: R04_0 Mask              */\r
+#define LCD_PAL215_G04_0_Pos                                  5                                                         /*!< LCD PAL215: G04_0 Position          */\r
+#define LCD_PAL215_G04_0_Msk                                  (0x1fUL << LCD_PAL215_G04_0_Pos)                          /*!< LCD PAL215: G04_0 Mask              */\r
+#define LCD_PAL215_B04_0_Pos                                  10                                                        /*!< LCD PAL215: B04_0 Position          */\r
+#define LCD_PAL215_B04_0_Msk                                  (0x1fUL << LCD_PAL215_B04_0_Pos)                          /*!< LCD PAL215: B04_0 Mask              */\r
+#define LCD_PAL215_I0_Pos                                     15                                                        /*!< LCD PAL215: I0 Position             */\r
+#define LCD_PAL215_I0_Msk                                     (0x01UL << LCD_PAL215_I0_Pos)                             /*!< LCD PAL215: I0 Mask                 */\r
+#define LCD_PAL215_R14_0_Pos                                  16                                                        /*!< LCD PAL215: R14_0 Position          */\r
+#define LCD_PAL215_R14_0_Msk                                  (0x1fUL << LCD_PAL215_R14_0_Pos)                          /*!< LCD PAL215: R14_0 Mask              */\r
+#define LCD_PAL215_G14_0_Pos                                  21                                                        /*!< LCD PAL215: G14_0 Position          */\r
+#define LCD_PAL215_G14_0_Msk                                  (0x1fUL << LCD_PAL215_G14_0_Pos)                          /*!< LCD PAL215: G14_0 Mask              */\r
+#define LCD_PAL215_B14_0_Pos                                  26                                                        /*!< LCD PAL215: B14_0 Position          */\r
+#define LCD_PAL215_B14_0_Msk                                  (0x1fUL << LCD_PAL215_B14_0_Pos)                          /*!< LCD PAL215: B14_0 Mask              */\r
+#define LCD_PAL215_I1_Pos                                     31                                                        /*!< LCD PAL215: I1 Position             */\r
+#define LCD_PAL215_I1_Msk                                     (0x01UL << LCD_PAL215_I1_Pos)                             /*!< LCD PAL215: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL216  -------------------------------------------\r
+#define LCD_PAL216_R04_0_Pos                                  0                                                         /*!< LCD PAL216: R04_0 Position          */\r
+#define LCD_PAL216_R04_0_Msk                                  (0x1fUL << LCD_PAL216_R04_0_Pos)                          /*!< LCD PAL216: R04_0 Mask              */\r
+#define LCD_PAL216_G04_0_Pos                                  5                                                         /*!< LCD PAL216: G04_0 Position          */\r
+#define LCD_PAL216_G04_0_Msk                                  (0x1fUL << LCD_PAL216_G04_0_Pos)                          /*!< LCD PAL216: G04_0 Mask              */\r
+#define LCD_PAL216_B04_0_Pos                                  10                                                        /*!< LCD PAL216: B04_0 Position          */\r
+#define LCD_PAL216_B04_0_Msk                                  (0x1fUL << LCD_PAL216_B04_0_Pos)                          /*!< LCD PAL216: B04_0 Mask              */\r
+#define LCD_PAL216_I0_Pos                                     15                                                        /*!< LCD PAL216: I0 Position             */\r
+#define LCD_PAL216_I0_Msk                                     (0x01UL << LCD_PAL216_I0_Pos)                             /*!< LCD PAL216: I0 Mask                 */\r
+#define LCD_PAL216_R14_0_Pos                                  16                                                        /*!< LCD PAL216: R14_0 Position          */\r
+#define LCD_PAL216_R14_0_Msk                                  (0x1fUL << LCD_PAL216_R14_0_Pos)                          /*!< LCD PAL216: R14_0 Mask              */\r
+#define LCD_PAL216_G14_0_Pos                                  21                                                        /*!< LCD PAL216: G14_0 Position          */\r
+#define LCD_PAL216_G14_0_Msk                                  (0x1fUL << LCD_PAL216_G14_0_Pos)                          /*!< LCD PAL216: G14_0 Mask              */\r
+#define LCD_PAL216_B14_0_Pos                                  26                                                        /*!< LCD PAL216: B14_0 Position          */\r
+#define LCD_PAL216_B14_0_Msk                                  (0x1fUL << LCD_PAL216_B14_0_Pos)                          /*!< LCD PAL216: B14_0 Mask              */\r
+#define LCD_PAL216_I1_Pos                                     31                                                        /*!< LCD PAL216: I1 Position             */\r
+#define LCD_PAL216_I1_Msk                                     (0x01UL << LCD_PAL216_I1_Pos)                             /*!< LCD PAL216: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL217  -------------------------------------------\r
+#define LCD_PAL217_R04_0_Pos                                  0                                                         /*!< LCD PAL217: R04_0 Position          */\r
+#define LCD_PAL217_R04_0_Msk                                  (0x1fUL << LCD_PAL217_R04_0_Pos)                          /*!< LCD PAL217: R04_0 Mask              */\r
+#define LCD_PAL217_G04_0_Pos                                  5                                                         /*!< LCD PAL217: G04_0 Position          */\r
+#define LCD_PAL217_G04_0_Msk                                  (0x1fUL << LCD_PAL217_G04_0_Pos)                          /*!< LCD PAL217: G04_0 Mask              */\r
+#define LCD_PAL217_B04_0_Pos                                  10                                                        /*!< LCD PAL217: B04_0 Position          */\r
+#define LCD_PAL217_B04_0_Msk                                  (0x1fUL << LCD_PAL217_B04_0_Pos)                          /*!< LCD PAL217: B04_0 Mask              */\r
+#define LCD_PAL217_I0_Pos                                     15                                                        /*!< LCD PAL217: I0 Position             */\r
+#define LCD_PAL217_I0_Msk                                     (0x01UL << LCD_PAL217_I0_Pos)                             /*!< LCD PAL217: I0 Mask                 */\r
+#define LCD_PAL217_R14_0_Pos                                  16                                                        /*!< LCD PAL217: R14_0 Position          */\r
+#define LCD_PAL217_R14_0_Msk                                  (0x1fUL << LCD_PAL217_R14_0_Pos)                          /*!< LCD PAL217: R14_0 Mask              */\r
+#define LCD_PAL217_G14_0_Pos                                  21                                                        /*!< LCD PAL217: G14_0 Position          */\r
+#define LCD_PAL217_G14_0_Msk                                  (0x1fUL << LCD_PAL217_G14_0_Pos)                          /*!< LCD PAL217: G14_0 Mask              */\r
+#define LCD_PAL217_B14_0_Pos                                  26                                                        /*!< LCD PAL217: B14_0 Position          */\r
+#define LCD_PAL217_B14_0_Msk                                  (0x1fUL << LCD_PAL217_B14_0_Pos)                          /*!< LCD PAL217: B14_0 Mask              */\r
+#define LCD_PAL217_I1_Pos                                     31                                                        /*!< LCD PAL217: I1 Position             */\r
+#define LCD_PAL217_I1_Msk                                     (0x01UL << LCD_PAL217_I1_Pos)                             /*!< LCD PAL217: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL218  -------------------------------------------\r
+#define LCD_PAL218_R04_0_Pos                                  0                                                         /*!< LCD PAL218: R04_0 Position          */\r
+#define LCD_PAL218_R04_0_Msk                                  (0x1fUL << LCD_PAL218_R04_0_Pos)                          /*!< LCD PAL218: R04_0 Mask              */\r
+#define LCD_PAL218_G04_0_Pos                                  5                                                         /*!< LCD PAL218: G04_0 Position          */\r
+#define LCD_PAL218_G04_0_Msk                                  (0x1fUL << LCD_PAL218_G04_0_Pos)                          /*!< LCD PAL218: G04_0 Mask              */\r
+#define LCD_PAL218_B04_0_Pos                                  10                                                        /*!< LCD PAL218: B04_0 Position          */\r
+#define LCD_PAL218_B04_0_Msk                                  (0x1fUL << LCD_PAL218_B04_0_Pos)                          /*!< LCD PAL218: B04_0 Mask              */\r
+#define LCD_PAL218_I0_Pos                                     15                                                        /*!< LCD PAL218: I0 Position             */\r
+#define LCD_PAL218_I0_Msk                                     (0x01UL << LCD_PAL218_I0_Pos)                             /*!< LCD PAL218: I0 Mask                 */\r
+#define LCD_PAL218_R14_0_Pos                                  16                                                        /*!< LCD PAL218: R14_0 Position          */\r
+#define LCD_PAL218_R14_0_Msk                                  (0x1fUL << LCD_PAL218_R14_0_Pos)                          /*!< LCD PAL218: R14_0 Mask              */\r
+#define LCD_PAL218_G14_0_Pos                                  21                                                        /*!< LCD PAL218: G14_0 Position          */\r
+#define LCD_PAL218_G14_0_Msk                                  (0x1fUL << LCD_PAL218_G14_0_Pos)                          /*!< LCD PAL218: G14_0 Mask              */\r
+#define LCD_PAL218_B14_0_Pos                                  26                                                        /*!< LCD PAL218: B14_0 Position          */\r
+#define LCD_PAL218_B14_0_Msk                                  (0x1fUL << LCD_PAL218_B14_0_Pos)                          /*!< LCD PAL218: B14_0 Mask              */\r
+#define LCD_PAL218_I1_Pos                                     31                                                        /*!< LCD PAL218: I1 Position             */\r
+#define LCD_PAL218_I1_Msk                                     (0x01UL << LCD_PAL218_I1_Pos)                             /*!< LCD PAL218: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL219  -------------------------------------------\r
+#define LCD_PAL219_R04_0_Pos                                  0                                                         /*!< LCD PAL219: R04_0 Position          */\r
+#define LCD_PAL219_R04_0_Msk                                  (0x1fUL << LCD_PAL219_R04_0_Pos)                          /*!< LCD PAL219: R04_0 Mask              */\r
+#define LCD_PAL219_G04_0_Pos                                  5                                                         /*!< LCD PAL219: G04_0 Position          */\r
+#define LCD_PAL219_G04_0_Msk                                  (0x1fUL << LCD_PAL219_G04_0_Pos)                          /*!< LCD PAL219: G04_0 Mask              */\r
+#define LCD_PAL219_B04_0_Pos                                  10                                                        /*!< LCD PAL219: B04_0 Position          */\r
+#define LCD_PAL219_B04_0_Msk                                  (0x1fUL << LCD_PAL219_B04_0_Pos)                          /*!< LCD PAL219: B04_0 Mask              */\r
+#define LCD_PAL219_I0_Pos                                     15                                                        /*!< LCD PAL219: I0 Position             */\r
+#define LCD_PAL219_I0_Msk                                     (0x01UL << LCD_PAL219_I0_Pos)                             /*!< LCD PAL219: I0 Mask                 */\r
+#define LCD_PAL219_R14_0_Pos                                  16                                                        /*!< LCD PAL219: R14_0 Position          */\r
+#define LCD_PAL219_R14_0_Msk                                  (0x1fUL << LCD_PAL219_R14_0_Pos)                          /*!< LCD PAL219: R14_0 Mask              */\r
+#define LCD_PAL219_G14_0_Pos                                  21                                                        /*!< LCD PAL219: G14_0 Position          */\r
+#define LCD_PAL219_G14_0_Msk                                  (0x1fUL << LCD_PAL219_G14_0_Pos)                          /*!< LCD PAL219: G14_0 Mask              */\r
+#define LCD_PAL219_B14_0_Pos                                  26                                                        /*!< LCD PAL219: B14_0 Position          */\r
+#define LCD_PAL219_B14_0_Msk                                  (0x1fUL << LCD_PAL219_B14_0_Pos)                          /*!< LCD PAL219: B14_0 Mask              */\r
+#define LCD_PAL219_I1_Pos                                     31                                                        /*!< LCD PAL219: I1 Position             */\r
+#define LCD_PAL219_I1_Msk                                     (0x01UL << LCD_PAL219_I1_Pos)                             /*!< LCD PAL219: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL220  -------------------------------------------\r
+#define LCD_PAL220_R04_0_Pos                                  0                                                         /*!< LCD PAL220: R04_0 Position          */\r
+#define LCD_PAL220_R04_0_Msk                                  (0x1fUL << LCD_PAL220_R04_0_Pos)                          /*!< LCD PAL220: R04_0 Mask              */\r
+#define LCD_PAL220_G04_0_Pos                                  5                                                         /*!< LCD PAL220: G04_0 Position          */\r
+#define LCD_PAL220_G04_0_Msk                                  (0x1fUL << LCD_PAL220_G04_0_Pos)                          /*!< LCD PAL220: G04_0 Mask              */\r
+#define LCD_PAL220_B04_0_Pos                                  10                                                        /*!< LCD PAL220: B04_0 Position          */\r
+#define LCD_PAL220_B04_0_Msk                                  (0x1fUL << LCD_PAL220_B04_0_Pos)                          /*!< LCD PAL220: B04_0 Mask              */\r
+#define LCD_PAL220_I0_Pos                                     15                                                        /*!< LCD PAL220: I0 Position             */\r
+#define LCD_PAL220_I0_Msk                                     (0x01UL << LCD_PAL220_I0_Pos)                             /*!< LCD PAL220: I0 Mask                 */\r
+#define LCD_PAL220_R14_0_Pos                                  16                                                        /*!< LCD PAL220: R14_0 Position          */\r
+#define LCD_PAL220_R14_0_Msk                                  (0x1fUL << LCD_PAL220_R14_0_Pos)                          /*!< LCD PAL220: R14_0 Mask              */\r
+#define LCD_PAL220_G14_0_Pos                                  21                                                        /*!< LCD PAL220: G14_0 Position          */\r
+#define LCD_PAL220_G14_0_Msk                                  (0x1fUL << LCD_PAL220_G14_0_Pos)                          /*!< LCD PAL220: G14_0 Mask              */\r
+#define LCD_PAL220_B14_0_Pos                                  26                                                        /*!< LCD PAL220: B14_0 Position          */\r
+#define LCD_PAL220_B14_0_Msk                                  (0x1fUL << LCD_PAL220_B14_0_Pos)                          /*!< LCD PAL220: B14_0 Mask              */\r
+#define LCD_PAL220_I1_Pos                                     31                                                        /*!< LCD PAL220: I1 Position             */\r
+#define LCD_PAL220_I1_Msk                                     (0x01UL << LCD_PAL220_I1_Pos)                             /*!< LCD PAL220: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL221  -------------------------------------------\r
+#define LCD_PAL221_R04_0_Pos                                  0                                                         /*!< LCD PAL221: R04_0 Position          */\r
+#define LCD_PAL221_R04_0_Msk                                  (0x1fUL << LCD_PAL221_R04_0_Pos)                          /*!< LCD PAL221: R04_0 Mask              */\r
+#define LCD_PAL221_G04_0_Pos                                  5                                                         /*!< LCD PAL221: G04_0 Position          */\r
+#define LCD_PAL221_G04_0_Msk                                  (0x1fUL << LCD_PAL221_G04_0_Pos)                          /*!< LCD PAL221: G04_0 Mask              */\r
+#define LCD_PAL221_B04_0_Pos                                  10                                                        /*!< LCD PAL221: B04_0 Position          */\r
+#define LCD_PAL221_B04_0_Msk                                  (0x1fUL << LCD_PAL221_B04_0_Pos)                          /*!< LCD PAL221: B04_0 Mask              */\r
+#define LCD_PAL221_I0_Pos                                     15                                                        /*!< LCD PAL221: I0 Position             */\r
+#define LCD_PAL221_I0_Msk                                     (0x01UL << LCD_PAL221_I0_Pos)                             /*!< LCD PAL221: I0 Mask                 */\r
+#define LCD_PAL221_R14_0_Pos                                  16                                                        /*!< LCD PAL221: R14_0 Position          */\r
+#define LCD_PAL221_R14_0_Msk                                  (0x1fUL << LCD_PAL221_R14_0_Pos)                          /*!< LCD PAL221: R14_0 Mask              */\r
+#define LCD_PAL221_G14_0_Pos                                  21                                                        /*!< LCD PAL221: G14_0 Position          */\r
+#define LCD_PAL221_G14_0_Msk                                  (0x1fUL << LCD_PAL221_G14_0_Pos)                          /*!< LCD PAL221: G14_0 Mask              */\r
+#define LCD_PAL221_B14_0_Pos                                  26                                                        /*!< LCD PAL221: B14_0 Position          */\r
+#define LCD_PAL221_B14_0_Msk                                  (0x1fUL << LCD_PAL221_B14_0_Pos)                          /*!< LCD PAL221: B14_0 Mask              */\r
+#define LCD_PAL221_I1_Pos                                     31                                                        /*!< LCD PAL221: I1 Position             */\r
+#define LCD_PAL221_I1_Msk                                     (0x01UL << LCD_PAL221_I1_Pos)                             /*!< LCD PAL221: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL222  -------------------------------------------\r
+#define LCD_PAL222_R04_0_Pos                                  0                                                         /*!< LCD PAL222: R04_0 Position          */\r
+#define LCD_PAL222_R04_0_Msk                                  (0x1fUL << LCD_PAL222_R04_0_Pos)                          /*!< LCD PAL222: R04_0 Mask              */\r
+#define LCD_PAL222_G04_0_Pos                                  5                                                         /*!< LCD PAL222: G04_0 Position          */\r
+#define LCD_PAL222_G04_0_Msk                                  (0x1fUL << LCD_PAL222_G04_0_Pos)                          /*!< LCD PAL222: G04_0 Mask              */\r
+#define LCD_PAL222_B04_0_Pos                                  10                                                        /*!< LCD PAL222: B04_0 Position          */\r
+#define LCD_PAL222_B04_0_Msk                                  (0x1fUL << LCD_PAL222_B04_0_Pos)                          /*!< LCD PAL222: B04_0 Mask              */\r
+#define LCD_PAL222_I0_Pos                                     15                                                        /*!< LCD PAL222: I0 Position             */\r
+#define LCD_PAL222_I0_Msk                                     (0x01UL << LCD_PAL222_I0_Pos)                             /*!< LCD PAL222: I0 Mask                 */\r
+#define LCD_PAL222_R14_0_Pos                                  16                                                        /*!< LCD PAL222: R14_0 Position          */\r
+#define LCD_PAL222_R14_0_Msk                                  (0x1fUL << LCD_PAL222_R14_0_Pos)                          /*!< LCD PAL222: R14_0 Mask              */\r
+#define LCD_PAL222_G14_0_Pos                                  21                                                        /*!< LCD PAL222: G14_0 Position          */\r
+#define LCD_PAL222_G14_0_Msk                                  (0x1fUL << LCD_PAL222_G14_0_Pos)                          /*!< LCD PAL222: G14_0 Mask              */\r
+#define LCD_PAL222_B14_0_Pos                                  26                                                        /*!< LCD PAL222: B14_0 Position          */\r
+#define LCD_PAL222_B14_0_Msk                                  (0x1fUL << LCD_PAL222_B14_0_Pos)                          /*!< LCD PAL222: B14_0 Mask              */\r
+#define LCD_PAL222_I1_Pos                                     31                                                        /*!< LCD PAL222: I1 Position             */\r
+#define LCD_PAL222_I1_Msk                                     (0x01UL << LCD_PAL222_I1_Pos)                             /*!< LCD PAL222: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL223  -------------------------------------------\r
+#define LCD_PAL223_R04_0_Pos                                  0                                                         /*!< LCD PAL223: R04_0 Position          */\r
+#define LCD_PAL223_R04_0_Msk                                  (0x1fUL << LCD_PAL223_R04_0_Pos)                          /*!< LCD PAL223: R04_0 Mask              */\r
+#define LCD_PAL223_G04_0_Pos                                  5                                                         /*!< LCD PAL223: G04_0 Position          */\r
+#define LCD_PAL223_G04_0_Msk                                  (0x1fUL << LCD_PAL223_G04_0_Pos)                          /*!< LCD PAL223: G04_0 Mask              */\r
+#define LCD_PAL223_B04_0_Pos                                  10                                                        /*!< LCD PAL223: B04_0 Position          */\r
+#define LCD_PAL223_B04_0_Msk                                  (0x1fUL << LCD_PAL223_B04_0_Pos)                          /*!< LCD PAL223: B04_0 Mask              */\r
+#define LCD_PAL223_I0_Pos                                     15                                                        /*!< LCD PAL223: I0 Position             */\r
+#define LCD_PAL223_I0_Msk                                     (0x01UL << LCD_PAL223_I0_Pos)                             /*!< LCD PAL223: I0 Mask                 */\r
+#define LCD_PAL223_R14_0_Pos                                  16                                                        /*!< LCD PAL223: R14_0 Position          */\r
+#define LCD_PAL223_R14_0_Msk                                  (0x1fUL << LCD_PAL223_R14_0_Pos)                          /*!< LCD PAL223: R14_0 Mask              */\r
+#define LCD_PAL223_G14_0_Pos                                  21                                                        /*!< LCD PAL223: G14_0 Position          */\r
+#define LCD_PAL223_G14_0_Msk                                  (0x1fUL << LCD_PAL223_G14_0_Pos)                          /*!< LCD PAL223: G14_0 Mask              */\r
+#define LCD_PAL223_B14_0_Pos                                  26                                                        /*!< LCD PAL223: B14_0 Position          */\r
+#define LCD_PAL223_B14_0_Msk                                  (0x1fUL << LCD_PAL223_B14_0_Pos)                          /*!< LCD PAL223: B14_0 Mask              */\r
+#define LCD_PAL223_I1_Pos                                     31                                                        /*!< LCD PAL223: I1 Position             */\r
+#define LCD_PAL223_I1_Msk                                     (0x01UL << LCD_PAL223_I1_Pos)                             /*!< LCD PAL223: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL224  -------------------------------------------\r
+#define LCD_PAL224_R04_0_Pos                                  0                                                         /*!< LCD PAL224: R04_0 Position          */\r
+#define LCD_PAL224_R04_0_Msk                                  (0x1fUL << LCD_PAL224_R04_0_Pos)                          /*!< LCD PAL224: R04_0 Mask              */\r
+#define LCD_PAL224_G04_0_Pos                                  5                                                         /*!< LCD PAL224: G04_0 Position          */\r
+#define LCD_PAL224_G04_0_Msk                                  (0x1fUL << LCD_PAL224_G04_0_Pos)                          /*!< LCD PAL224: G04_0 Mask              */\r
+#define LCD_PAL224_B04_0_Pos                                  10                                                        /*!< LCD PAL224: B04_0 Position          */\r
+#define LCD_PAL224_B04_0_Msk                                  (0x1fUL << LCD_PAL224_B04_0_Pos)                          /*!< LCD PAL224: B04_0 Mask              */\r
+#define LCD_PAL224_I0_Pos                                     15                                                        /*!< LCD PAL224: I0 Position             */\r
+#define LCD_PAL224_I0_Msk                                     (0x01UL << LCD_PAL224_I0_Pos)                             /*!< LCD PAL224: I0 Mask                 */\r
+#define LCD_PAL224_R14_0_Pos                                  16                                                        /*!< LCD PAL224: R14_0 Position          */\r
+#define LCD_PAL224_R14_0_Msk                                  (0x1fUL << LCD_PAL224_R14_0_Pos)                          /*!< LCD PAL224: R14_0 Mask              */\r
+#define LCD_PAL224_G14_0_Pos                                  21                                                        /*!< LCD PAL224: G14_0 Position          */\r
+#define LCD_PAL224_G14_0_Msk                                  (0x1fUL << LCD_PAL224_G14_0_Pos)                          /*!< LCD PAL224: G14_0 Mask              */\r
+#define LCD_PAL224_B14_0_Pos                                  26                                                        /*!< LCD PAL224: B14_0 Position          */\r
+#define LCD_PAL224_B14_0_Msk                                  (0x1fUL << LCD_PAL224_B14_0_Pos)                          /*!< LCD PAL224: B14_0 Mask              */\r
+#define LCD_PAL224_I1_Pos                                     31                                                        /*!< LCD PAL224: I1 Position             */\r
+#define LCD_PAL224_I1_Msk                                     (0x01UL << LCD_PAL224_I1_Pos)                             /*!< LCD PAL224: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL225  -------------------------------------------\r
+#define LCD_PAL225_R04_0_Pos                                  0                                                         /*!< LCD PAL225: R04_0 Position          */\r
+#define LCD_PAL225_R04_0_Msk                                  (0x1fUL << LCD_PAL225_R04_0_Pos)                          /*!< LCD PAL225: R04_0 Mask              */\r
+#define LCD_PAL225_G04_0_Pos                                  5                                                         /*!< LCD PAL225: G04_0 Position          */\r
+#define LCD_PAL225_G04_0_Msk                                  (0x1fUL << LCD_PAL225_G04_0_Pos)                          /*!< LCD PAL225: G04_0 Mask              */\r
+#define LCD_PAL225_B04_0_Pos                                  10                                                        /*!< LCD PAL225: B04_0 Position          */\r
+#define LCD_PAL225_B04_0_Msk                                  (0x1fUL << LCD_PAL225_B04_0_Pos)                          /*!< LCD PAL225: B04_0 Mask              */\r
+#define LCD_PAL225_I0_Pos                                     15                                                        /*!< LCD PAL225: I0 Position             */\r
+#define LCD_PAL225_I0_Msk                                     (0x01UL << LCD_PAL225_I0_Pos)                             /*!< LCD PAL225: I0 Mask                 */\r
+#define LCD_PAL225_R14_0_Pos                                  16                                                        /*!< LCD PAL225: R14_0 Position          */\r
+#define LCD_PAL225_R14_0_Msk                                  (0x1fUL << LCD_PAL225_R14_0_Pos)                          /*!< LCD PAL225: R14_0 Mask              */\r
+#define LCD_PAL225_G14_0_Pos                                  21                                                        /*!< LCD PAL225: G14_0 Position          */\r
+#define LCD_PAL225_G14_0_Msk                                  (0x1fUL << LCD_PAL225_G14_0_Pos)                          /*!< LCD PAL225: G14_0 Mask              */\r
+#define LCD_PAL225_B14_0_Pos                                  26                                                        /*!< LCD PAL225: B14_0 Position          */\r
+#define LCD_PAL225_B14_0_Msk                                  (0x1fUL << LCD_PAL225_B14_0_Pos)                          /*!< LCD PAL225: B14_0 Mask              */\r
+#define LCD_PAL225_I1_Pos                                     31                                                        /*!< LCD PAL225: I1 Position             */\r
+#define LCD_PAL225_I1_Msk                                     (0x01UL << LCD_PAL225_I1_Pos)                             /*!< LCD PAL225: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL226  -------------------------------------------\r
+#define LCD_PAL226_R04_0_Pos                                  0                                                         /*!< LCD PAL226: R04_0 Position          */\r
+#define LCD_PAL226_R04_0_Msk                                  (0x1fUL << LCD_PAL226_R04_0_Pos)                          /*!< LCD PAL226: R04_0 Mask              */\r
+#define LCD_PAL226_G04_0_Pos                                  5                                                         /*!< LCD PAL226: G04_0 Position          */\r
+#define LCD_PAL226_G04_0_Msk                                  (0x1fUL << LCD_PAL226_G04_0_Pos)                          /*!< LCD PAL226: G04_0 Mask              */\r
+#define LCD_PAL226_B04_0_Pos                                  10                                                        /*!< LCD PAL226: B04_0 Position          */\r
+#define LCD_PAL226_B04_0_Msk                                  (0x1fUL << LCD_PAL226_B04_0_Pos)                          /*!< LCD PAL226: B04_0 Mask              */\r
+#define LCD_PAL226_I0_Pos                                     15                                                        /*!< LCD PAL226: I0 Position             */\r
+#define LCD_PAL226_I0_Msk                                     (0x01UL << LCD_PAL226_I0_Pos)                             /*!< LCD PAL226: I0 Mask                 */\r
+#define LCD_PAL226_R14_0_Pos                                  16                                                        /*!< LCD PAL226: R14_0 Position          */\r
+#define LCD_PAL226_R14_0_Msk                                  (0x1fUL << LCD_PAL226_R14_0_Pos)                          /*!< LCD PAL226: R14_0 Mask              */\r
+#define LCD_PAL226_G14_0_Pos                                  21                                                        /*!< LCD PAL226: G14_0 Position          */\r
+#define LCD_PAL226_G14_0_Msk                                  (0x1fUL << LCD_PAL226_G14_0_Pos)                          /*!< LCD PAL226: G14_0 Mask              */\r
+#define LCD_PAL226_B14_0_Pos                                  26                                                        /*!< LCD PAL226: B14_0 Position          */\r
+#define LCD_PAL226_B14_0_Msk                                  (0x1fUL << LCD_PAL226_B14_0_Pos)                          /*!< LCD PAL226: B14_0 Mask              */\r
+#define LCD_PAL226_I1_Pos                                     31                                                        /*!< LCD PAL226: I1 Position             */\r
+#define LCD_PAL226_I1_Msk                                     (0x01UL << LCD_PAL226_I1_Pos)                             /*!< LCD PAL226: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL227  -------------------------------------------\r
+#define LCD_PAL227_R04_0_Pos                                  0                                                         /*!< LCD PAL227: R04_0 Position          */\r
+#define LCD_PAL227_R04_0_Msk                                  (0x1fUL << LCD_PAL227_R04_0_Pos)                          /*!< LCD PAL227: R04_0 Mask              */\r
+#define LCD_PAL227_G04_0_Pos                                  5                                                         /*!< LCD PAL227: G04_0 Position          */\r
+#define LCD_PAL227_G04_0_Msk                                  (0x1fUL << LCD_PAL227_G04_0_Pos)                          /*!< LCD PAL227: G04_0 Mask              */\r
+#define LCD_PAL227_B04_0_Pos                                  10                                                        /*!< LCD PAL227: B04_0 Position          */\r
+#define LCD_PAL227_B04_0_Msk                                  (0x1fUL << LCD_PAL227_B04_0_Pos)                          /*!< LCD PAL227: B04_0 Mask              */\r
+#define LCD_PAL227_I0_Pos                                     15                                                        /*!< LCD PAL227: I0 Position             */\r
+#define LCD_PAL227_I0_Msk                                     (0x01UL << LCD_PAL227_I0_Pos)                             /*!< LCD PAL227: I0 Mask                 */\r
+#define LCD_PAL227_R14_0_Pos                                  16                                                        /*!< LCD PAL227: R14_0 Position          */\r
+#define LCD_PAL227_R14_0_Msk                                  (0x1fUL << LCD_PAL227_R14_0_Pos)                          /*!< LCD PAL227: R14_0 Mask              */\r
+#define LCD_PAL227_G14_0_Pos                                  21                                                        /*!< LCD PAL227: G14_0 Position          */\r
+#define LCD_PAL227_G14_0_Msk                                  (0x1fUL << LCD_PAL227_G14_0_Pos)                          /*!< LCD PAL227: G14_0 Mask              */\r
+#define LCD_PAL227_B14_0_Pos                                  26                                                        /*!< LCD PAL227: B14_0 Position          */\r
+#define LCD_PAL227_B14_0_Msk                                  (0x1fUL << LCD_PAL227_B14_0_Pos)                          /*!< LCD PAL227: B14_0 Mask              */\r
+#define LCD_PAL227_I1_Pos                                     31                                                        /*!< LCD PAL227: I1 Position             */\r
+#define LCD_PAL227_I1_Msk                                     (0x01UL << LCD_PAL227_I1_Pos)                             /*!< LCD PAL227: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL228  -------------------------------------------\r
+#define LCD_PAL228_R04_0_Pos                                  0                                                         /*!< LCD PAL228: R04_0 Position          */\r
+#define LCD_PAL228_R04_0_Msk                                  (0x1fUL << LCD_PAL228_R04_0_Pos)                          /*!< LCD PAL228: R04_0 Mask              */\r
+#define LCD_PAL228_G04_0_Pos                                  5                                                         /*!< LCD PAL228: G04_0 Position          */\r
+#define LCD_PAL228_G04_0_Msk                                  (0x1fUL << LCD_PAL228_G04_0_Pos)                          /*!< LCD PAL228: G04_0 Mask              */\r
+#define LCD_PAL228_B04_0_Pos                                  10                                                        /*!< LCD PAL228: B04_0 Position          */\r
+#define LCD_PAL228_B04_0_Msk                                  (0x1fUL << LCD_PAL228_B04_0_Pos)                          /*!< LCD PAL228: B04_0 Mask              */\r
+#define LCD_PAL228_I0_Pos                                     15                                                        /*!< LCD PAL228: I0 Position             */\r
+#define LCD_PAL228_I0_Msk                                     (0x01UL << LCD_PAL228_I0_Pos)                             /*!< LCD PAL228: I0 Mask                 */\r
+#define LCD_PAL228_R14_0_Pos                                  16                                                        /*!< LCD PAL228: R14_0 Position          */\r
+#define LCD_PAL228_R14_0_Msk                                  (0x1fUL << LCD_PAL228_R14_0_Pos)                          /*!< LCD PAL228: R14_0 Mask              */\r
+#define LCD_PAL228_G14_0_Pos                                  21                                                        /*!< LCD PAL228: G14_0 Position          */\r
+#define LCD_PAL228_G14_0_Msk                                  (0x1fUL << LCD_PAL228_G14_0_Pos)                          /*!< LCD PAL228: G14_0 Mask              */\r
+#define LCD_PAL228_B14_0_Pos                                  26                                                        /*!< LCD PAL228: B14_0 Position          */\r
+#define LCD_PAL228_B14_0_Msk                                  (0x1fUL << LCD_PAL228_B14_0_Pos)                          /*!< LCD PAL228: B14_0 Mask              */\r
+#define LCD_PAL228_I1_Pos                                     31                                                        /*!< LCD PAL228: I1 Position             */\r
+#define LCD_PAL228_I1_Msk                                     (0x01UL << LCD_PAL228_I1_Pos)                             /*!< LCD PAL228: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL229  -------------------------------------------\r
+#define LCD_PAL229_R04_0_Pos                                  0                                                         /*!< LCD PAL229: R04_0 Position          */\r
+#define LCD_PAL229_R04_0_Msk                                  (0x1fUL << LCD_PAL229_R04_0_Pos)                          /*!< LCD PAL229: R04_0 Mask              */\r
+#define LCD_PAL229_G04_0_Pos                                  5                                                         /*!< LCD PAL229: G04_0 Position          */\r
+#define LCD_PAL229_G04_0_Msk                                  (0x1fUL << LCD_PAL229_G04_0_Pos)                          /*!< LCD PAL229: G04_0 Mask              */\r
+#define LCD_PAL229_B04_0_Pos                                  10                                                        /*!< LCD PAL229: B04_0 Position          */\r
+#define LCD_PAL229_B04_0_Msk                                  (0x1fUL << LCD_PAL229_B04_0_Pos)                          /*!< LCD PAL229: B04_0 Mask              */\r
+#define LCD_PAL229_I0_Pos                                     15                                                        /*!< LCD PAL229: I0 Position             */\r
+#define LCD_PAL229_I0_Msk                                     (0x01UL << LCD_PAL229_I0_Pos)                             /*!< LCD PAL229: I0 Mask                 */\r
+#define LCD_PAL229_R14_0_Pos                                  16                                                        /*!< LCD PAL229: R14_0 Position          */\r
+#define LCD_PAL229_R14_0_Msk                                  (0x1fUL << LCD_PAL229_R14_0_Pos)                          /*!< LCD PAL229: R14_0 Mask              */\r
+#define LCD_PAL229_G14_0_Pos                                  21                                                        /*!< LCD PAL229: G14_0 Position          */\r
+#define LCD_PAL229_G14_0_Msk                                  (0x1fUL << LCD_PAL229_G14_0_Pos)                          /*!< LCD PAL229: G14_0 Mask              */\r
+#define LCD_PAL229_B14_0_Pos                                  26                                                        /*!< LCD PAL229: B14_0 Position          */\r
+#define LCD_PAL229_B14_0_Msk                                  (0x1fUL << LCD_PAL229_B14_0_Pos)                          /*!< LCD PAL229: B14_0 Mask              */\r
+#define LCD_PAL229_I1_Pos                                     31                                                        /*!< LCD PAL229: I1 Position             */\r
+#define LCD_PAL229_I1_Msk                                     (0x01UL << LCD_PAL229_I1_Pos)                             /*!< LCD PAL229: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL230  -------------------------------------------\r
+#define LCD_PAL230_R04_0_Pos                                  0                                                         /*!< LCD PAL230: R04_0 Position          */\r
+#define LCD_PAL230_R04_0_Msk                                  (0x1fUL << LCD_PAL230_R04_0_Pos)                          /*!< LCD PAL230: R04_0 Mask              */\r
+#define LCD_PAL230_G04_0_Pos                                  5                                                         /*!< LCD PAL230: G04_0 Position          */\r
+#define LCD_PAL230_G04_0_Msk                                  (0x1fUL << LCD_PAL230_G04_0_Pos)                          /*!< LCD PAL230: G04_0 Mask              */\r
+#define LCD_PAL230_B04_0_Pos                                  10                                                        /*!< LCD PAL230: B04_0 Position          */\r
+#define LCD_PAL230_B04_0_Msk                                  (0x1fUL << LCD_PAL230_B04_0_Pos)                          /*!< LCD PAL230: B04_0 Mask              */\r
+#define LCD_PAL230_I0_Pos                                     15                                                        /*!< LCD PAL230: I0 Position             */\r
+#define LCD_PAL230_I0_Msk                                     (0x01UL << LCD_PAL230_I0_Pos)                             /*!< LCD PAL230: I0 Mask                 */\r
+#define LCD_PAL230_R14_0_Pos                                  16                                                        /*!< LCD PAL230: R14_0 Position          */\r
+#define LCD_PAL230_R14_0_Msk                                  (0x1fUL << LCD_PAL230_R14_0_Pos)                          /*!< LCD PAL230: R14_0 Mask              */\r
+#define LCD_PAL230_G14_0_Pos                                  21                                                        /*!< LCD PAL230: G14_0 Position          */\r
+#define LCD_PAL230_G14_0_Msk                                  (0x1fUL << LCD_PAL230_G14_0_Pos)                          /*!< LCD PAL230: G14_0 Mask              */\r
+#define LCD_PAL230_B14_0_Pos                                  26                                                        /*!< LCD PAL230: B14_0 Position          */\r
+#define LCD_PAL230_B14_0_Msk                                  (0x1fUL << LCD_PAL230_B14_0_Pos)                          /*!< LCD PAL230: B14_0 Mask              */\r
+#define LCD_PAL230_I1_Pos                                     31                                                        /*!< LCD PAL230: I1 Position             */\r
+#define LCD_PAL230_I1_Msk                                     (0x01UL << LCD_PAL230_I1_Pos)                             /*!< LCD PAL230: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL231  -------------------------------------------\r
+#define LCD_PAL231_R04_0_Pos                                  0                                                         /*!< LCD PAL231: R04_0 Position          */\r
+#define LCD_PAL231_R04_0_Msk                                  (0x1fUL << LCD_PAL231_R04_0_Pos)                          /*!< LCD PAL231: R04_0 Mask              */\r
+#define LCD_PAL231_G04_0_Pos                                  5                                                         /*!< LCD PAL231: G04_0 Position          */\r
+#define LCD_PAL231_G04_0_Msk                                  (0x1fUL << LCD_PAL231_G04_0_Pos)                          /*!< LCD PAL231: G04_0 Mask              */\r
+#define LCD_PAL231_B04_0_Pos                                  10                                                        /*!< LCD PAL231: B04_0 Position          */\r
+#define LCD_PAL231_B04_0_Msk                                  (0x1fUL << LCD_PAL231_B04_0_Pos)                          /*!< LCD PAL231: B04_0 Mask              */\r
+#define LCD_PAL231_I0_Pos                                     15                                                        /*!< LCD PAL231: I0 Position             */\r
+#define LCD_PAL231_I0_Msk                                     (0x01UL << LCD_PAL231_I0_Pos)                             /*!< LCD PAL231: I0 Mask                 */\r
+#define LCD_PAL231_R14_0_Pos                                  16                                                        /*!< LCD PAL231: R14_0 Position          */\r
+#define LCD_PAL231_R14_0_Msk                                  (0x1fUL << LCD_PAL231_R14_0_Pos)                          /*!< LCD PAL231: R14_0 Mask              */\r
+#define LCD_PAL231_G14_0_Pos                                  21                                                        /*!< LCD PAL231: G14_0 Position          */\r
+#define LCD_PAL231_G14_0_Msk                                  (0x1fUL << LCD_PAL231_G14_0_Pos)                          /*!< LCD PAL231: G14_0 Mask              */\r
+#define LCD_PAL231_B14_0_Pos                                  26                                                        /*!< LCD PAL231: B14_0 Position          */\r
+#define LCD_PAL231_B14_0_Msk                                  (0x1fUL << LCD_PAL231_B14_0_Pos)                          /*!< LCD PAL231: B14_0 Mask              */\r
+#define LCD_PAL231_I1_Pos                                     31                                                        /*!< LCD PAL231: I1 Position             */\r
+#define LCD_PAL231_I1_Msk                                     (0x01UL << LCD_PAL231_I1_Pos)                             /*!< LCD PAL231: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL232  -------------------------------------------\r
+#define LCD_PAL232_R04_0_Pos                                  0                                                         /*!< LCD PAL232: R04_0 Position          */\r
+#define LCD_PAL232_R04_0_Msk                                  (0x1fUL << LCD_PAL232_R04_0_Pos)                          /*!< LCD PAL232: R04_0 Mask              */\r
+#define LCD_PAL232_G04_0_Pos                                  5                                                         /*!< LCD PAL232: G04_0 Position          */\r
+#define LCD_PAL232_G04_0_Msk                                  (0x1fUL << LCD_PAL232_G04_0_Pos)                          /*!< LCD PAL232: G04_0 Mask              */\r
+#define LCD_PAL232_B04_0_Pos                                  10                                                        /*!< LCD PAL232: B04_0 Position          */\r
+#define LCD_PAL232_B04_0_Msk                                  (0x1fUL << LCD_PAL232_B04_0_Pos)                          /*!< LCD PAL232: B04_0 Mask              */\r
+#define LCD_PAL232_I0_Pos                                     15                                                        /*!< LCD PAL232: I0 Position             */\r
+#define LCD_PAL232_I0_Msk                                     (0x01UL << LCD_PAL232_I0_Pos)                             /*!< LCD PAL232: I0 Mask                 */\r
+#define LCD_PAL232_R14_0_Pos                                  16                                                        /*!< LCD PAL232: R14_0 Position          */\r
+#define LCD_PAL232_R14_0_Msk                                  (0x1fUL << LCD_PAL232_R14_0_Pos)                          /*!< LCD PAL232: R14_0 Mask              */\r
+#define LCD_PAL232_G14_0_Pos                                  21                                                        /*!< LCD PAL232: G14_0 Position          */\r
+#define LCD_PAL232_G14_0_Msk                                  (0x1fUL << LCD_PAL232_G14_0_Pos)                          /*!< LCD PAL232: G14_0 Mask              */\r
+#define LCD_PAL232_B14_0_Pos                                  26                                                        /*!< LCD PAL232: B14_0 Position          */\r
+#define LCD_PAL232_B14_0_Msk                                  (0x1fUL << LCD_PAL232_B14_0_Pos)                          /*!< LCD PAL232: B14_0 Mask              */\r
+#define LCD_PAL232_I1_Pos                                     31                                                        /*!< LCD PAL232: I1 Position             */\r
+#define LCD_PAL232_I1_Msk                                     (0x01UL << LCD_PAL232_I1_Pos)                             /*!< LCD PAL232: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL233  -------------------------------------------\r
+#define LCD_PAL233_R04_0_Pos                                  0                                                         /*!< LCD PAL233: R04_0 Position          */\r
+#define LCD_PAL233_R04_0_Msk                                  (0x1fUL << LCD_PAL233_R04_0_Pos)                          /*!< LCD PAL233: R04_0 Mask              */\r
+#define LCD_PAL233_G04_0_Pos                                  5                                                         /*!< LCD PAL233: G04_0 Position          */\r
+#define LCD_PAL233_G04_0_Msk                                  (0x1fUL << LCD_PAL233_G04_0_Pos)                          /*!< LCD PAL233: G04_0 Mask              */\r
+#define LCD_PAL233_B04_0_Pos                                  10                                                        /*!< LCD PAL233: B04_0 Position          */\r
+#define LCD_PAL233_B04_0_Msk                                  (0x1fUL << LCD_PAL233_B04_0_Pos)                          /*!< LCD PAL233: B04_0 Mask              */\r
+#define LCD_PAL233_I0_Pos                                     15                                                        /*!< LCD PAL233: I0 Position             */\r
+#define LCD_PAL233_I0_Msk                                     (0x01UL << LCD_PAL233_I0_Pos)                             /*!< LCD PAL233: I0 Mask                 */\r
+#define LCD_PAL233_R14_0_Pos                                  16                                                        /*!< LCD PAL233: R14_0 Position          */\r
+#define LCD_PAL233_R14_0_Msk                                  (0x1fUL << LCD_PAL233_R14_0_Pos)                          /*!< LCD PAL233: R14_0 Mask              */\r
+#define LCD_PAL233_G14_0_Pos                                  21                                                        /*!< LCD PAL233: G14_0 Position          */\r
+#define LCD_PAL233_G14_0_Msk                                  (0x1fUL << LCD_PAL233_G14_0_Pos)                          /*!< LCD PAL233: G14_0 Mask              */\r
+#define LCD_PAL233_B14_0_Pos                                  26                                                        /*!< LCD PAL233: B14_0 Position          */\r
+#define LCD_PAL233_B14_0_Msk                                  (0x1fUL << LCD_PAL233_B14_0_Pos)                          /*!< LCD PAL233: B14_0 Mask              */\r
+#define LCD_PAL233_I1_Pos                                     31                                                        /*!< LCD PAL233: I1 Position             */\r
+#define LCD_PAL233_I1_Msk                                     (0x01UL << LCD_PAL233_I1_Pos)                             /*!< LCD PAL233: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL234  -------------------------------------------\r
+#define LCD_PAL234_R04_0_Pos                                  0                                                         /*!< LCD PAL234: R04_0 Position          */\r
+#define LCD_PAL234_R04_0_Msk                                  (0x1fUL << LCD_PAL234_R04_0_Pos)                          /*!< LCD PAL234: R04_0 Mask              */\r
+#define LCD_PAL234_G04_0_Pos                                  5                                                         /*!< LCD PAL234: G04_0 Position          */\r
+#define LCD_PAL234_G04_0_Msk                                  (0x1fUL << LCD_PAL234_G04_0_Pos)                          /*!< LCD PAL234: G04_0 Mask              */\r
+#define LCD_PAL234_B04_0_Pos                                  10                                                        /*!< LCD PAL234: B04_0 Position          */\r
+#define LCD_PAL234_B04_0_Msk                                  (0x1fUL << LCD_PAL234_B04_0_Pos)                          /*!< LCD PAL234: B04_0 Mask              */\r
+#define LCD_PAL234_I0_Pos                                     15                                                        /*!< LCD PAL234: I0 Position             */\r
+#define LCD_PAL234_I0_Msk                                     (0x01UL << LCD_PAL234_I0_Pos)                             /*!< LCD PAL234: I0 Mask                 */\r
+#define LCD_PAL234_R14_0_Pos                                  16                                                        /*!< LCD PAL234: R14_0 Position          */\r
+#define LCD_PAL234_R14_0_Msk                                  (0x1fUL << LCD_PAL234_R14_0_Pos)                          /*!< LCD PAL234: R14_0 Mask              */\r
+#define LCD_PAL234_G14_0_Pos                                  21                                                        /*!< LCD PAL234: G14_0 Position          */\r
+#define LCD_PAL234_G14_0_Msk                                  (0x1fUL << LCD_PAL234_G14_0_Pos)                          /*!< LCD PAL234: G14_0 Mask              */\r
+#define LCD_PAL234_B14_0_Pos                                  26                                                        /*!< LCD PAL234: B14_0 Position          */\r
+#define LCD_PAL234_B14_0_Msk                                  (0x1fUL << LCD_PAL234_B14_0_Pos)                          /*!< LCD PAL234: B14_0 Mask              */\r
+#define LCD_PAL234_I1_Pos                                     31                                                        /*!< LCD PAL234: I1 Position             */\r
+#define LCD_PAL234_I1_Msk                                     (0x01UL << LCD_PAL234_I1_Pos)                             /*!< LCD PAL234: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL235  -------------------------------------------\r
+#define LCD_PAL235_R04_0_Pos                                  0                                                         /*!< LCD PAL235: R04_0 Position          */\r
+#define LCD_PAL235_R04_0_Msk                                  (0x1fUL << LCD_PAL235_R04_0_Pos)                          /*!< LCD PAL235: R04_0 Mask              */\r
+#define LCD_PAL235_G04_0_Pos                                  5                                                         /*!< LCD PAL235: G04_0 Position          */\r
+#define LCD_PAL235_G04_0_Msk                                  (0x1fUL << LCD_PAL235_G04_0_Pos)                          /*!< LCD PAL235: G04_0 Mask              */\r
+#define LCD_PAL235_B04_0_Pos                                  10                                                        /*!< LCD PAL235: B04_0 Position          */\r
+#define LCD_PAL235_B04_0_Msk                                  (0x1fUL << LCD_PAL235_B04_0_Pos)                          /*!< LCD PAL235: B04_0 Mask              */\r
+#define LCD_PAL235_I0_Pos                                     15                                                        /*!< LCD PAL235: I0 Position             */\r
+#define LCD_PAL235_I0_Msk                                     (0x01UL << LCD_PAL235_I0_Pos)                             /*!< LCD PAL235: I0 Mask                 */\r
+#define LCD_PAL235_R14_0_Pos                                  16                                                        /*!< LCD PAL235: R14_0 Position          */\r
+#define LCD_PAL235_R14_0_Msk                                  (0x1fUL << LCD_PAL235_R14_0_Pos)                          /*!< LCD PAL235: R14_0 Mask              */\r
+#define LCD_PAL235_G14_0_Pos                                  21                                                        /*!< LCD PAL235: G14_0 Position          */\r
+#define LCD_PAL235_G14_0_Msk                                  (0x1fUL << LCD_PAL235_G14_0_Pos)                          /*!< LCD PAL235: G14_0 Mask              */\r
+#define LCD_PAL235_B14_0_Pos                                  26                                                        /*!< LCD PAL235: B14_0 Position          */\r
+#define LCD_PAL235_B14_0_Msk                                  (0x1fUL << LCD_PAL235_B14_0_Pos)                          /*!< LCD PAL235: B14_0 Mask              */\r
+#define LCD_PAL235_I1_Pos                                     31                                                        /*!< LCD PAL235: I1 Position             */\r
+#define LCD_PAL235_I1_Msk                                     (0x01UL << LCD_PAL235_I1_Pos)                             /*!< LCD PAL235: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL236  -------------------------------------------\r
+#define LCD_PAL236_R04_0_Pos                                  0                                                         /*!< LCD PAL236: R04_0 Position          */\r
+#define LCD_PAL236_R04_0_Msk                                  (0x1fUL << LCD_PAL236_R04_0_Pos)                          /*!< LCD PAL236: R04_0 Mask              */\r
+#define LCD_PAL236_G04_0_Pos                                  5                                                         /*!< LCD PAL236: G04_0 Position          */\r
+#define LCD_PAL236_G04_0_Msk                                  (0x1fUL << LCD_PAL236_G04_0_Pos)                          /*!< LCD PAL236: G04_0 Mask              */\r
+#define LCD_PAL236_B04_0_Pos                                  10                                                        /*!< LCD PAL236: B04_0 Position          */\r
+#define LCD_PAL236_B04_0_Msk                                  (0x1fUL << LCD_PAL236_B04_0_Pos)                          /*!< LCD PAL236: B04_0 Mask              */\r
+#define LCD_PAL236_I0_Pos                                     15                                                        /*!< LCD PAL236: I0 Position             */\r
+#define LCD_PAL236_I0_Msk                                     (0x01UL << LCD_PAL236_I0_Pos)                             /*!< LCD PAL236: I0 Mask                 */\r
+#define LCD_PAL236_R14_0_Pos                                  16                                                        /*!< LCD PAL236: R14_0 Position          */\r
+#define LCD_PAL236_R14_0_Msk                                  (0x1fUL << LCD_PAL236_R14_0_Pos)                          /*!< LCD PAL236: R14_0 Mask              */\r
+#define LCD_PAL236_G14_0_Pos                                  21                                                        /*!< LCD PAL236: G14_0 Position          */\r
+#define LCD_PAL236_G14_0_Msk                                  (0x1fUL << LCD_PAL236_G14_0_Pos)                          /*!< LCD PAL236: G14_0 Mask              */\r
+#define LCD_PAL236_B14_0_Pos                                  26                                                        /*!< LCD PAL236: B14_0 Position          */\r
+#define LCD_PAL236_B14_0_Msk                                  (0x1fUL << LCD_PAL236_B14_0_Pos)                          /*!< LCD PAL236: B14_0 Mask              */\r
+#define LCD_PAL236_I1_Pos                                     31                                                        /*!< LCD PAL236: I1 Position             */\r
+#define LCD_PAL236_I1_Msk                                     (0x01UL << LCD_PAL236_I1_Pos)                             /*!< LCD PAL236: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL237  -------------------------------------------\r
+#define LCD_PAL237_R04_0_Pos                                  0                                                         /*!< LCD PAL237: R04_0 Position          */\r
+#define LCD_PAL237_R04_0_Msk                                  (0x1fUL << LCD_PAL237_R04_0_Pos)                          /*!< LCD PAL237: R04_0 Mask              */\r
+#define LCD_PAL237_G04_0_Pos                                  5                                                         /*!< LCD PAL237: G04_0 Position          */\r
+#define LCD_PAL237_G04_0_Msk                                  (0x1fUL << LCD_PAL237_G04_0_Pos)                          /*!< LCD PAL237: G04_0 Mask              */\r
+#define LCD_PAL237_B04_0_Pos                                  10                                                        /*!< LCD PAL237: B04_0 Position          */\r
+#define LCD_PAL237_B04_0_Msk                                  (0x1fUL << LCD_PAL237_B04_0_Pos)                          /*!< LCD PAL237: B04_0 Mask              */\r
+#define LCD_PAL237_I0_Pos                                     15                                                        /*!< LCD PAL237: I0 Position             */\r
+#define LCD_PAL237_I0_Msk                                     (0x01UL << LCD_PAL237_I0_Pos)                             /*!< LCD PAL237: I0 Mask                 */\r
+#define LCD_PAL237_R14_0_Pos                                  16                                                        /*!< LCD PAL237: R14_0 Position          */\r
+#define LCD_PAL237_R14_0_Msk                                  (0x1fUL << LCD_PAL237_R14_0_Pos)                          /*!< LCD PAL237: R14_0 Mask              */\r
+#define LCD_PAL237_G14_0_Pos                                  21                                                        /*!< LCD PAL237: G14_0 Position          */\r
+#define LCD_PAL237_G14_0_Msk                                  (0x1fUL << LCD_PAL237_G14_0_Pos)                          /*!< LCD PAL237: G14_0 Mask              */\r
+#define LCD_PAL237_B14_0_Pos                                  26                                                        /*!< LCD PAL237: B14_0 Position          */\r
+#define LCD_PAL237_B14_0_Msk                                  (0x1fUL << LCD_PAL237_B14_0_Pos)                          /*!< LCD PAL237: B14_0 Mask              */\r
+#define LCD_PAL237_I1_Pos                                     31                                                        /*!< LCD PAL237: I1 Position             */\r
+#define LCD_PAL237_I1_Msk                                     (0x01UL << LCD_PAL237_I1_Pos)                             /*!< LCD PAL237: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL238  -------------------------------------------\r
+#define LCD_PAL238_R04_0_Pos                                  0                                                         /*!< LCD PAL238: R04_0 Position          */\r
+#define LCD_PAL238_R04_0_Msk                                  (0x1fUL << LCD_PAL238_R04_0_Pos)                          /*!< LCD PAL238: R04_0 Mask              */\r
+#define LCD_PAL238_G04_0_Pos                                  5                                                         /*!< LCD PAL238: G04_0 Position          */\r
+#define LCD_PAL238_G04_0_Msk                                  (0x1fUL << LCD_PAL238_G04_0_Pos)                          /*!< LCD PAL238: G04_0 Mask              */\r
+#define LCD_PAL238_B04_0_Pos                                  10                                                        /*!< LCD PAL238: B04_0 Position          */\r
+#define LCD_PAL238_B04_0_Msk                                  (0x1fUL << LCD_PAL238_B04_0_Pos)                          /*!< LCD PAL238: B04_0 Mask              */\r
+#define LCD_PAL238_I0_Pos                                     15                                                        /*!< LCD PAL238: I0 Position             */\r
+#define LCD_PAL238_I0_Msk                                     (0x01UL << LCD_PAL238_I0_Pos)                             /*!< LCD PAL238: I0 Mask                 */\r
+#define LCD_PAL238_R14_0_Pos                                  16                                                        /*!< LCD PAL238: R14_0 Position          */\r
+#define LCD_PAL238_R14_0_Msk                                  (0x1fUL << LCD_PAL238_R14_0_Pos)                          /*!< LCD PAL238: R14_0 Mask              */\r
+#define LCD_PAL238_G14_0_Pos                                  21                                                        /*!< LCD PAL238: G14_0 Position          */\r
+#define LCD_PAL238_G14_0_Msk                                  (0x1fUL << LCD_PAL238_G14_0_Pos)                          /*!< LCD PAL238: G14_0 Mask              */\r
+#define LCD_PAL238_B14_0_Pos                                  26                                                        /*!< LCD PAL238: B14_0 Position          */\r
+#define LCD_PAL238_B14_0_Msk                                  (0x1fUL << LCD_PAL238_B14_0_Pos)                          /*!< LCD PAL238: B14_0 Mask              */\r
+#define LCD_PAL238_I1_Pos                                     31                                                        /*!< LCD PAL238: I1 Position             */\r
+#define LCD_PAL238_I1_Msk                                     (0x01UL << LCD_PAL238_I1_Pos)                             /*!< LCD PAL238: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL239  -------------------------------------------\r
+#define LCD_PAL239_R04_0_Pos                                  0                                                         /*!< LCD PAL239: R04_0 Position          */\r
+#define LCD_PAL239_R04_0_Msk                                  (0x1fUL << LCD_PAL239_R04_0_Pos)                          /*!< LCD PAL239: R04_0 Mask              */\r
+#define LCD_PAL239_G04_0_Pos                                  5                                                         /*!< LCD PAL239: G04_0 Position          */\r
+#define LCD_PAL239_G04_0_Msk                                  (0x1fUL << LCD_PAL239_G04_0_Pos)                          /*!< LCD PAL239: G04_0 Mask              */\r
+#define LCD_PAL239_B04_0_Pos                                  10                                                        /*!< LCD PAL239: B04_0 Position          */\r
+#define LCD_PAL239_B04_0_Msk                                  (0x1fUL << LCD_PAL239_B04_0_Pos)                          /*!< LCD PAL239: B04_0 Mask              */\r
+#define LCD_PAL239_I0_Pos                                     15                                                        /*!< LCD PAL239: I0 Position             */\r
+#define LCD_PAL239_I0_Msk                                     (0x01UL << LCD_PAL239_I0_Pos)                             /*!< LCD PAL239: I0 Mask                 */\r
+#define LCD_PAL239_R14_0_Pos                                  16                                                        /*!< LCD PAL239: R14_0 Position          */\r
+#define LCD_PAL239_R14_0_Msk                                  (0x1fUL << LCD_PAL239_R14_0_Pos)                          /*!< LCD PAL239: R14_0 Mask              */\r
+#define LCD_PAL239_G14_0_Pos                                  21                                                        /*!< LCD PAL239: G14_0 Position          */\r
+#define LCD_PAL239_G14_0_Msk                                  (0x1fUL << LCD_PAL239_G14_0_Pos)                          /*!< LCD PAL239: G14_0 Mask              */\r
+#define LCD_PAL239_B14_0_Pos                                  26                                                        /*!< LCD PAL239: B14_0 Position          */\r
+#define LCD_PAL239_B14_0_Msk                                  (0x1fUL << LCD_PAL239_B14_0_Pos)                          /*!< LCD PAL239: B14_0 Mask              */\r
+#define LCD_PAL239_I1_Pos                                     31                                                        /*!< LCD PAL239: I1 Position             */\r
+#define LCD_PAL239_I1_Msk                                     (0x01UL << LCD_PAL239_I1_Pos)                             /*!< LCD PAL239: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL240  -------------------------------------------\r
+#define LCD_PAL240_R04_0_Pos                                  0                                                         /*!< LCD PAL240: R04_0 Position          */\r
+#define LCD_PAL240_R04_0_Msk                                  (0x1fUL << LCD_PAL240_R04_0_Pos)                          /*!< LCD PAL240: R04_0 Mask              */\r
+#define LCD_PAL240_G04_0_Pos                                  5                                                         /*!< LCD PAL240: G04_0 Position          */\r
+#define LCD_PAL240_G04_0_Msk                                  (0x1fUL << LCD_PAL240_G04_0_Pos)                          /*!< LCD PAL240: G04_0 Mask              */\r
+#define LCD_PAL240_B04_0_Pos                                  10                                                        /*!< LCD PAL240: B04_0 Position          */\r
+#define LCD_PAL240_B04_0_Msk                                  (0x1fUL << LCD_PAL240_B04_0_Pos)                          /*!< LCD PAL240: B04_0 Mask              */\r
+#define LCD_PAL240_I0_Pos                                     15                                                        /*!< LCD PAL240: I0 Position             */\r
+#define LCD_PAL240_I0_Msk                                     (0x01UL << LCD_PAL240_I0_Pos)                             /*!< LCD PAL240: I0 Mask                 */\r
+#define LCD_PAL240_R14_0_Pos                                  16                                                        /*!< LCD PAL240: R14_0 Position          */\r
+#define LCD_PAL240_R14_0_Msk                                  (0x1fUL << LCD_PAL240_R14_0_Pos)                          /*!< LCD PAL240: R14_0 Mask              */\r
+#define LCD_PAL240_G14_0_Pos                                  21                                                        /*!< LCD PAL240: G14_0 Position          */\r
+#define LCD_PAL240_G14_0_Msk                                  (0x1fUL << LCD_PAL240_G14_0_Pos)                          /*!< LCD PAL240: G14_0 Mask              */\r
+#define LCD_PAL240_B14_0_Pos                                  26                                                        /*!< LCD PAL240: B14_0 Position          */\r
+#define LCD_PAL240_B14_0_Msk                                  (0x1fUL << LCD_PAL240_B14_0_Pos)                          /*!< LCD PAL240: B14_0 Mask              */\r
+#define LCD_PAL240_I1_Pos                                     31                                                        /*!< LCD PAL240: I1 Position             */\r
+#define LCD_PAL240_I1_Msk                                     (0x01UL << LCD_PAL240_I1_Pos)                             /*!< LCD PAL240: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL241  -------------------------------------------\r
+#define LCD_PAL241_R04_0_Pos                                  0                                                         /*!< LCD PAL241: R04_0 Position          */\r
+#define LCD_PAL241_R04_0_Msk                                  (0x1fUL << LCD_PAL241_R04_0_Pos)                          /*!< LCD PAL241: R04_0 Mask              */\r
+#define LCD_PAL241_G04_0_Pos                                  5                                                         /*!< LCD PAL241: G04_0 Position          */\r
+#define LCD_PAL241_G04_0_Msk                                  (0x1fUL << LCD_PAL241_G04_0_Pos)                          /*!< LCD PAL241: G04_0 Mask              */\r
+#define LCD_PAL241_B04_0_Pos                                  10                                                        /*!< LCD PAL241: B04_0 Position          */\r
+#define LCD_PAL241_B04_0_Msk                                  (0x1fUL << LCD_PAL241_B04_0_Pos)                          /*!< LCD PAL241: B04_0 Mask              */\r
+#define LCD_PAL241_I0_Pos                                     15                                                        /*!< LCD PAL241: I0 Position             */\r
+#define LCD_PAL241_I0_Msk                                     (0x01UL << LCD_PAL241_I0_Pos)                             /*!< LCD PAL241: I0 Mask                 */\r
+#define LCD_PAL241_R14_0_Pos                                  16                                                        /*!< LCD PAL241: R14_0 Position          */\r
+#define LCD_PAL241_R14_0_Msk                                  (0x1fUL << LCD_PAL241_R14_0_Pos)                          /*!< LCD PAL241: R14_0 Mask              */\r
+#define LCD_PAL241_G14_0_Pos                                  21                                                        /*!< LCD PAL241: G14_0 Position          */\r
+#define LCD_PAL241_G14_0_Msk                                  (0x1fUL << LCD_PAL241_G14_0_Pos)                          /*!< LCD PAL241: G14_0 Mask              */\r
+#define LCD_PAL241_B14_0_Pos                                  26                                                        /*!< LCD PAL241: B14_0 Position          */\r
+#define LCD_PAL241_B14_0_Msk                                  (0x1fUL << LCD_PAL241_B14_0_Pos)                          /*!< LCD PAL241: B14_0 Mask              */\r
+#define LCD_PAL241_I1_Pos                                     31                                                        /*!< LCD PAL241: I1 Position             */\r
+#define LCD_PAL241_I1_Msk                                     (0x01UL << LCD_PAL241_I1_Pos)                             /*!< LCD PAL241: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL242  -------------------------------------------\r
+#define LCD_PAL242_R04_0_Pos                                  0                                                         /*!< LCD PAL242: R04_0 Position          */\r
+#define LCD_PAL242_R04_0_Msk                                  (0x1fUL << LCD_PAL242_R04_0_Pos)                          /*!< LCD PAL242: R04_0 Mask              */\r
+#define LCD_PAL242_G04_0_Pos                                  5                                                         /*!< LCD PAL242: G04_0 Position          */\r
+#define LCD_PAL242_G04_0_Msk                                  (0x1fUL << LCD_PAL242_G04_0_Pos)                          /*!< LCD PAL242: G04_0 Mask              */\r
+#define LCD_PAL242_B04_0_Pos                                  10                                                        /*!< LCD PAL242: B04_0 Position          */\r
+#define LCD_PAL242_B04_0_Msk                                  (0x1fUL << LCD_PAL242_B04_0_Pos)                          /*!< LCD PAL242: B04_0 Mask              */\r
+#define LCD_PAL242_I0_Pos                                     15                                                        /*!< LCD PAL242: I0 Position             */\r
+#define LCD_PAL242_I0_Msk                                     (0x01UL << LCD_PAL242_I0_Pos)                             /*!< LCD PAL242: I0 Mask                 */\r
+#define LCD_PAL242_R14_0_Pos                                  16                                                        /*!< LCD PAL242: R14_0 Position          */\r
+#define LCD_PAL242_R14_0_Msk                                  (0x1fUL << LCD_PAL242_R14_0_Pos)                          /*!< LCD PAL242: R14_0 Mask              */\r
+#define LCD_PAL242_G14_0_Pos                                  21                                                        /*!< LCD PAL242: G14_0 Position          */\r
+#define LCD_PAL242_G14_0_Msk                                  (0x1fUL << LCD_PAL242_G14_0_Pos)                          /*!< LCD PAL242: G14_0 Mask              */\r
+#define LCD_PAL242_B14_0_Pos                                  26                                                        /*!< LCD PAL242: B14_0 Position          */\r
+#define LCD_PAL242_B14_0_Msk                                  (0x1fUL << LCD_PAL242_B14_0_Pos)                          /*!< LCD PAL242: B14_0 Mask              */\r
+#define LCD_PAL242_I1_Pos                                     31                                                        /*!< LCD PAL242: I1 Position             */\r
+#define LCD_PAL242_I1_Msk                                     (0x01UL << LCD_PAL242_I1_Pos)                             /*!< LCD PAL242: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL243  -------------------------------------------\r
+#define LCD_PAL243_R04_0_Pos                                  0                                                         /*!< LCD PAL243: R04_0 Position          */\r
+#define LCD_PAL243_R04_0_Msk                                  (0x1fUL << LCD_PAL243_R04_0_Pos)                          /*!< LCD PAL243: R04_0 Mask              */\r
+#define LCD_PAL243_G04_0_Pos                                  5                                                         /*!< LCD PAL243: G04_0 Position          */\r
+#define LCD_PAL243_G04_0_Msk                                  (0x1fUL << LCD_PAL243_G04_0_Pos)                          /*!< LCD PAL243: G04_0 Mask              */\r
+#define LCD_PAL243_B04_0_Pos                                  10                                                        /*!< LCD PAL243: B04_0 Position          */\r
+#define LCD_PAL243_B04_0_Msk                                  (0x1fUL << LCD_PAL243_B04_0_Pos)                          /*!< LCD PAL243: B04_0 Mask              */\r
+#define LCD_PAL243_I0_Pos                                     15                                                        /*!< LCD PAL243: I0 Position             */\r
+#define LCD_PAL243_I0_Msk                                     (0x01UL << LCD_PAL243_I0_Pos)                             /*!< LCD PAL243: I0 Mask                 */\r
+#define LCD_PAL243_R14_0_Pos                                  16                                                        /*!< LCD PAL243: R14_0 Position          */\r
+#define LCD_PAL243_R14_0_Msk                                  (0x1fUL << LCD_PAL243_R14_0_Pos)                          /*!< LCD PAL243: R14_0 Mask              */\r
+#define LCD_PAL243_G14_0_Pos                                  21                                                        /*!< LCD PAL243: G14_0 Position          */\r
+#define LCD_PAL243_G14_0_Msk                                  (0x1fUL << LCD_PAL243_G14_0_Pos)                          /*!< LCD PAL243: G14_0 Mask              */\r
+#define LCD_PAL243_B14_0_Pos                                  26                                                        /*!< LCD PAL243: B14_0 Position          */\r
+#define LCD_PAL243_B14_0_Msk                                  (0x1fUL << LCD_PAL243_B14_0_Pos)                          /*!< LCD PAL243: B14_0 Mask              */\r
+#define LCD_PAL243_I1_Pos                                     31                                                        /*!< LCD PAL243: I1 Position             */\r
+#define LCD_PAL243_I1_Msk                                     (0x01UL << LCD_PAL243_I1_Pos)                             /*!< LCD PAL243: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL244  -------------------------------------------\r
+#define LCD_PAL244_R04_0_Pos                                  0                                                         /*!< LCD PAL244: R04_0 Position          */\r
+#define LCD_PAL244_R04_0_Msk                                  (0x1fUL << LCD_PAL244_R04_0_Pos)                          /*!< LCD PAL244: R04_0 Mask              */\r
+#define LCD_PAL244_G04_0_Pos                                  5                                                         /*!< LCD PAL244: G04_0 Position          */\r
+#define LCD_PAL244_G04_0_Msk                                  (0x1fUL << LCD_PAL244_G04_0_Pos)                          /*!< LCD PAL244: G04_0 Mask              */\r
+#define LCD_PAL244_B04_0_Pos                                  10                                                        /*!< LCD PAL244: B04_0 Position          */\r
+#define LCD_PAL244_B04_0_Msk                                  (0x1fUL << LCD_PAL244_B04_0_Pos)                          /*!< LCD PAL244: B04_0 Mask              */\r
+#define LCD_PAL244_I0_Pos                                     15                                                        /*!< LCD PAL244: I0 Position             */\r
+#define LCD_PAL244_I0_Msk                                     (0x01UL << LCD_PAL244_I0_Pos)                             /*!< LCD PAL244: I0 Mask                 */\r
+#define LCD_PAL244_R14_0_Pos                                  16                                                        /*!< LCD PAL244: R14_0 Position          */\r
+#define LCD_PAL244_R14_0_Msk                                  (0x1fUL << LCD_PAL244_R14_0_Pos)                          /*!< LCD PAL244: R14_0 Mask              */\r
+#define LCD_PAL244_G14_0_Pos                                  21                                                        /*!< LCD PAL244: G14_0 Position          */\r
+#define LCD_PAL244_G14_0_Msk                                  (0x1fUL << LCD_PAL244_G14_0_Pos)                          /*!< LCD PAL244: G14_0 Mask              */\r
+#define LCD_PAL244_B14_0_Pos                                  26                                                        /*!< LCD PAL244: B14_0 Position          */\r
+#define LCD_PAL244_B14_0_Msk                                  (0x1fUL << LCD_PAL244_B14_0_Pos)                          /*!< LCD PAL244: B14_0 Mask              */\r
+#define LCD_PAL244_I1_Pos                                     31                                                        /*!< LCD PAL244: I1 Position             */\r
+#define LCD_PAL244_I1_Msk                                     (0x01UL << LCD_PAL244_I1_Pos)                             /*!< LCD PAL244: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL245  -------------------------------------------\r
+#define LCD_PAL245_R04_0_Pos                                  0                                                         /*!< LCD PAL245: R04_0 Position          */\r
+#define LCD_PAL245_R04_0_Msk                                  (0x1fUL << LCD_PAL245_R04_0_Pos)                          /*!< LCD PAL245: R04_0 Mask              */\r
+#define LCD_PAL245_G04_0_Pos                                  5                                                         /*!< LCD PAL245: G04_0 Position          */\r
+#define LCD_PAL245_G04_0_Msk                                  (0x1fUL << LCD_PAL245_G04_0_Pos)                          /*!< LCD PAL245: G04_0 Mask              */\r
+#define LCD_PAL245_B04_0_Pos                                  10                                                        /*!< LCD PAL245: B04_0 Position          */\r
+#define LCD_PAL245_B04_0_Msk                                  (0x1fUL << LCD_PAL245_B04_0_Pos)                          /*!< LCD PAL245: B04_0 Mask              */\r
+#define LCD_PAL245_I0_Pos                                     15                                                        /*!< LCD PAL245: I0 Position             */\r
+#define LCD_PAL245_I0_Msk                                     (0x01UL << LCD_PAL245_I0_Pos)                             /*!< LCD PAL245: I0 Mask                 */\r
+#define LCD_PAL245_R14_0_Pos                                  16                                                        /*!< LCD PAL245: R14_0 Position          */\r
+#define LCD_PAL245_R14_0_Msk                                  (0x1fUL << LCD_PAL245_R14_0_Pos)                          /*!< LCD PAL245: R14_0 Mask              */\r
+#define LCD_PAL245_G14_0_Pos                                  21                                                        /*!< LCD PAL245: G14_0 Position          */\r
+#define LCD_PAL245_G14_0_Msk                                  (0x1fUL << LCD_PAL245_G14_0_Pos)                          /*!< LCD PAL245: G14_0 Mask              */\r
+#define LCD_PAL245_B14_0_Pos                                  26                                                        /*!< LCD PAL245: B14_0 Position          */\r
+#define LCD_PAL245_B14_0_Msk                                  (0x1fUL << LCD_PAL245_B14_0_Pos)                          /*!< LCD PAL245: B14_0 Mask              */\r
+#define LCD_PAL245_I1_Pos                                     31                                                        /*!< LCD PAL245: I1 Position             */\r
+#define LCD_PAL245_I1_Msk                                     (0x01UL << LCD_PAL245_I1_Pos)                             /*!< LCD PAL245: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL246  -------------------------------------------\r
+#define LCD_PAL246_R04_0_Pos                                  0                                                         /*!< LCD PAL246: R04_0 Position          */\r
+#define LCD_PAL246_R04_0_Msk                                  (0x1fUL << LCD_PAL246_R04_0_Pos)                          /*!< LCD PAL246: R04_0 Mask              */\r
+#define LCD_PAL246_G04_0_Pos                                  5                                                         /*!< LCD PAL246: G04_0 Position          */\r
+#define LCD_PAL246_G04_0_Msk                                  (0x1fUL << LCD_PAL246_G04_0_Pos)                          /*!< LCD PAL246: G04_0 Mask              */\r
+#define LCD_PAL246_B04_0_Pos                                  10                                                        /*!< LCD PAL246: B04_0 Position          */\r
+#define LCD_PAL246_B04_0_Msk                                  (0x1fUL << LCD_PAL246_B04_0_Pos)                          /*!< LCD PAL246: B04_0 Mask              */\r
+#define LCD_PAL246_I0_Pos                                     15                                                        /*!< LCD PAL246: I0 Position             */\r
+#define LCD_PAL246_I0_Msk                                     (0x01UL << LCD_PAL246_I0_Pos)                             /*!< LCD PAL246: I0 Mask                 */\r
+#define LCD_PAL246_R14_0_Pos                                  16                                                        /*!< LCD PAL246: R14_0 Position          */\r
+#define LCD_PAL246_R14_0_Msk                                  (0x1fUL << LCD_PAL246_R14_0_Pos)                          /*!< LCD PAL246: R14_0 Mask              */\r
+#define LCD_PAL246_G14_0_Pos                                  21                                                        /*!< LCD PAL246: G14_0 Position          */\r
+#define LCD_PAL246_G14_0_Msk                                  (0x1fUL << LCD_PAL246_G14_0_Pos)                          /*!< LCD PAL246: G14_0 Mask              */\r
+#define LCD_PAL246_B14_0_Pos                                  26                                                        /*!< LCD PAL246: B14_0 Position          */\r
+#define LCD_PAL246_B14_0_Msk                                  (0x1fUL << LCD_PAL246_B14_0_Pos)                          /*!< LCD PAL246: B14_0 Mask              */\r
+#define LCD_PAL246_I1_Pos                                     31                                                        /*!< LCD PAL246: I1 Position             */\r
+#define LCD_PAL246_I1_Msk                                     (0x01UL << LCD_PAL246_I1_Pos)                             /*!< LCD PAL246: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL247  -------------------------------------------\r
+#define LCD_PAL247_R04_0_Pos                                  0                                                         /*!< LCD PAL247: R04_0 Position          */\r
+#define LCD_PAL247_R04_0_Msk                                  (0x1fUL << LCD_PAL247_R04_0_Pos)                          /*!< LCD PAL247: R04_0 Mask              */\r
+#define LCD_PAL247_G04_0_Pos                                  5                                                         /*!< LCD PAL247: G04_0 Position          */\r
+#define LCD_PAL247_G04_0_Msk                                  (0x1fUL << LCD_PAL247_G04_0_Pos)                          /*!< LCD PAL247: G04_0 Mask              */\r
+#define LCD_PAL247_B04_0_Pos                                  10                                                        /*!< LCD PAL247: B04_0 Position          */\r
+#define LCD_PAL247_B04_0_Msk                                  (0x1fUL << LCD_PAL247_B04_0_Pos)                          /*!< LCD PAL247: B04_0 Mask              */\r
+#define LCD_PAL247_I0_Pos                                     15                                                        /*!< LCD PAL247: I0 Position             */\r
+#define LCD_PAL247_I0_Msk                                     (0x01UL << LCD_PAL247_I0_Pos)                             /*!< LCD PAL247: I0 Mask                 */\r
+#define LCD_PAL247_R14_0_Pos                                  16                                                        /*!< LCD PAL247: R14_0 Position          */\r
+#define LCD_PAL247_R14_0_Msk                                  (0x1fUL << LCD_PAL247_R14_0_Pos)                          /*!< LCD PAL247: R14_0 Mask              */\r
+#define LCD_PAL247_G14_0_Pos                                  21                                                        /*!< LCD PAL247: G14_0 Position          */\r
+#define LCD_PAL247_G14_0_Msk                                  (0x1fUL << LCD_PAL247_G14_0_Pos)                          /*!< LCD PAL247: G14_0 Mask              */\r
+#define LCD_PAL247_B14_0_Pos                                  26                                                        /*!< LCD PAL247: B14_0 Position          */\r
+#define LCD_PAL247_B14_0_Msk                                  (0x1fUL << LCD_PAL247_B14_0_Pos)                          /*!< LCD PAL247: B14_0 Mask              */\r
+#define LCD_PAL247_I1_Pos                                     31                                                        /*!< LCD PAL247: I1 Position             */\r
+#define LCD_PAL247_I1_Msk                                     (0x01UL << LCD_PAL247_I1_Pos)                             /*!< LCD PAL247: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL248  -------------------------------------------\r
+#define LCD_PAL248_R04_0_Pos                                  0                                                         /*!< LCD PAL248: R04_0 Position          */\r
+#define LCD_PAL248_R04_0_Msk                                  (0x1fUL << LCD_PAL248_R04_0_Pos)                          /*!< LCD PAL248: R04_0 Mask              */\r
+#define LCD_PAL248_G04_0_Pos                                  5                                                         /*!< LCD PAL248: G04_0 Position          */\r
+#define LCD_PAL248_G04_0_Msk                                  (0x1fUL << LCD_PAL248_G04_0_Pos)                          /*!< LCD PAL248: G04_0 Mask              */\r
+#define LCD_PAL248_B04_0_Pos                                  10                                                        /*!< LCD PAL248: B04_0 Position          */\r
+#define LCD_PAL248_B04_0_Msk                                  (0x1fUL << LCD_PAL248_B04_0_Pos)                          /*!< LCD PAL248: B04_0 Mask              */\r
+#define LCD_PAL248_I0_Pos                                     15                                                        /*!< LCD PAL248: I0 Position             */\r
+#define LCD_PAL248_I0_Msk                                     (0x01UL << LCD_PAL248_I0_Pos)                             /*!< LCD PAL248: I0 Mask                 */\r
+#define LCD_PAL248_R14_0_Pos                                  16                                                        /*!< LCD PAL248: R14_0 Position          */\r
+#define LCD_PAL248_R14_0_Msk                                  (0x1fUL << LCD_PAL248_R14_0_Pos)                          /*!< LCD PAL248: R14_0 Mask              */\r
+#define LCD_PAL248_G14_0_Pos                                  21                                                        /*!< LCD PAL248: G14_0 Position          */\r
+#define LCD_PAL248_G14_0_Msk                                  (0x1fUL << LCD_PAL248_G14_0_Pos)                          /*!< LCD PAL248: G14_0 Mask              */\r
+#define LCD_PAL248_B14_0_Pos                                  26                                                        /*!< LCD PAL248: B14_0 Position          */\r
+#define LCD_PAL248_B14_0_Msk                                  (0x1fUL << LCD_PAL248_B14_0_Pos)                          /*!< LCD PAL248: B14_0 Mask              */\r
+#define LCD_PAL248_I1_Pos                                     31                                                        /*!< LCD PAL248: I1 Position             */\r
+#define LCD_PAL248_I1_Msk                                     (0x01UL << LCD_PAL248_I1_Pos)                             /*!< LCD PAL248: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL249  -------------------------------------------\r
+#define LCD_PAL249_R04_0_Pos                                  0                                                         /*!< LCD PAL249: R04_0 Position          */\r
+#define LCD_PAL249_R04_0_Msk                                  (0x1fUL << LCD_PAL249_R04_0_Pos)                          /*!< LCD PAL249: R04_0 Mask              */\r
+#define LCD_PAL249_G04_0_Pos                                  5                                                         /*!< LCD PAL249: G04_0 Position          */\r
+#define LCD_PAL249_G04_0_Msk                                  (0x1fUL << LCD_PAL249_G04_0_Pos)                          /*!< LCD PAL249: G04_0 Mask              */\r
+#define LCD_PAL249_B04_0_Pos                                  10                                                        /*!< LCD PAL249: B04_0 Position          */\r
+#define LCD_PAL249_B04_0_Msk                                  (0x1fUL << LCD_PAL249_B04_0_Pos)                          /*!< LCD PAL249: B04_0 Mask              */\r
+#define LCD_PAL249_I0_Pos                                     15                                                        /*!< LCD PAL249: I0 Position             */\r
+#define LCD_PAL249_I0_Msk                                     (0x01UL << LCD_PAL249_I0_Pos)                             /*!< LCD PAL249: I0 Mask                 */\r
+#define LCD_PAL249_R14_0_Pos                                  16                                                        /*!< LCD PAL249: R14_0 Position          */\r
+#define LCD_PAL249_R14_0_Msk                                  (0x1fUL << LCD_PAL249_R14_0_Pos)                          /*!< LCD PAL249: R14_0 Mask              */\r
+#define LCD_PAL249_G14_0_Pos                                  21                                                        /*!< LCD PAL249: G14_0 Position          */\r
+#define LCD_PAL249_G14_0_Msk                                  (0x1fUL << LCD_PAL249_G14_0_Pos)                          /*!< LCD PAL249: G14_0 Mask              */\r
+#define LCD_PAL249_B14_0_Pos                                  26                                                        /*!< LCD PAL249: B14_0 Position          */\r
+#define LCD_PAL249_B14_0_Msk                                  (0x1fUL << LCD_PAL249_B14_0_Pos)                          /*!< LCD PAL249: B14_0 Mask              */\r
+#define LCD_PAL249_I1_Pos                                     31                                                        /*!< LCD PAL249: I1 Position             */\r
+#define LCD_PAL249_I1_Msk                                     (0x01UL << LCD_PAL249_I1_Pos)                             /*!< LCD PAL249: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL250  -------------------------------------------\r
+#define LCD_PAL250_R04_0_Pos                                  0                                                         /*!< LCD PAL250: R04_0 Position          */\r
+#define LCD_PAL250_R04_0_Msk                                  (0x1fUL << LCD_PAL250_R04_0_Pos)                          /*!< LCD PAL250: R04_0 Mask              */\r
+#define LCD_PAL250_G04_0_Pos                                  5                                                         /*!< LCD PAL250: G04_0 Position          */\r
+#define LCD_PAL250_G04_0_Msk                                  (0x1fUL << LCD_PAL250_G04_0_Pos)                          /*!< LCD PAL250: G04_0 Mask              */\r
+#define LCD_PAL250_B04_0_Pos                                  10                                                        /*!< LCD PAL250: B04_0 Position          */\r
+#define LCD_PAL250_B04_0_Msk                                  (0x1fUL << LCD_PAL250_B04_0_Pos)                          /*!< LCD PAL250: B04_0 Mask              */\r
+#define LCD_PAL250_I0_Pos                                     15                                                        /*!< LCD PAL250: I0 Position             */\r
+#define LCD_PAL250_I0_Msk                                     (0x01UL << LCD_PAL250_I0_Pos)                             /*!< LCD PAL250: I0 Mask                 */\r
+#define LCD_PAL250_R14_0_Pos                                  16                                                        /*!< LCD PAL250: R14_0 Position          */\r
+#define LCD_PAL250_R14_0_Msk                                  (0x1fUL << LCD_PAL250_R14_0_Pos)                          /*!< LCD PAL250: R14_0 Mask              */\r
+#define LCD_PAL250_G14_0_Pos                                  21                                                        /*!< LCD PAL250: G14_0 Position          */\r
+#define LCD_PAL250_G14_0_Msk                                  (0x1fUL << LCD_PAL250_G14_0_Pos)                          /*!< LCD PAL250: G14_0 Mask              */\r
+#define LCD_PAL250_B14_0_Pos                                  26                                                        /*!< LCD PAL250: B14_0 Position          */\r
+#define LCD_PAL250_B14_0_Msk                                  (0x1fUL << LCD_PAL250_B14_0_Pos)                          /*!< LCD PAL250: B14_0 Mask              */\r
+#define LCD_PAL250_I1_Pos                                     31                                                        /*!< LCD PAL250: I1 Position             */\r
+#define LCD_PAL250_I1_Msk                                     (0x01UL << LCD_PAL250_I1_Pos)                             /*!< LCD PAL250: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL251  -------------------------------------------\r
+#define LCD_PAL251_R04_0_Pos                                  0                                                         /*!< LCD PAL251: R04_0 Position          */\r
+#define LCD_PAL251_R04_0_Msk                                  (0x1fUL << LCD_PAL251_R04_0_Pos)                          /*!< LCD PAL251: R04_0 Mask              */\r
+#define LCD_PAL251_G04_0_Pos                                  5                                                         /*!< LCD PAL251: G04_0 Position          */\r
+#define LCD_PAL251_G04_0_Msk                                  (0x1fUL << LCD_PAL251_G04_0_Pos)                          /*!< LCD PAL251: G04_0 Mask              */\r
+#define LCD_PAL251_B04_0_Pos                                  10                                                        /*!< LCD PAL251: B04_0 Position          */\r
+#define LCD_PAL251_B04_0_Msk                                  (0x1fUL << LCD_PAL251_B04_0_Pos)                          /*!< LCD PAL251: B04_0 Mask              */\r
+#define LCD_PAL251_I0_Pos                                     15                                                        /*!< LCD PAL251: I0 Position             */\r
+#define LCD_PAL251_I0_Msk                                     (0x01UL << LCD_PAL251_I0_Pos)                             /*!< LCD PAL251: I0 Mask                 */\r
+#define LCD_PAL251_R14_0_Pos                                  16                                                        /*!< LCD PAL251: R14_0 Position          */\r
+#define LCD_PAL251_R14_0_Msk                                  (0x1fUL << LCD_PAL251_R14_0_Pos)                          /*!< LCD PAL251: R14_0 Mask              */\r
+#define LCD_PAL251_G14_0_Pos                                  21                                                        /*!< LCD PAL251: G14_0 Position          */\r
+#define LCD_PAL251_G14_0_Msk                                  (0x1fUL << LCD_PAL251_G14_0_Pos)                          /*!< LCD PAL251: G14_0 Mask              */\r
+#define LCD_PAL251_B14_0_Pos                                  26                                                        /*!< LCD PAL251: B14_0 Position          */\r
+#define LCD_PAL251_B14_0_Msk                                  (0x1fUL << LCD_PAL251_B14_0_Pos)                          /*!< LCD PAL251: B14_0 Mask              */\r
+#define LCD_PAL251_I1_Pos                                     31                                                        /*!< LCD PAL251: I1 Position             */\r
+#define LCD_PAL251_I1_Msk                                     (0x01UL << LCD_PAL251_I1_Pos)                             /*!< LCD PAL251: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL252  -------------------------------------------\r
+#define LCD_PAL252_R04_0_Pos                                  0                                                         /*!< LCD PAL252: R04_0 Position          */\r
+#define LCD_PAL252_R04_0_Msk                                  (0x1fUL << LCD_PAL252_R04_0_Pos)                          /*!< LCD PAL252: R04_0 Mask              */\r
+#define LCD_PAL252_G04_0_Pos                                  5                                                         /*!< LCD PAL252: G04_0 Position          */\r
+#define LCD_PAL252_G04_0_Msk                                  (0x1fUL << LCD_PAL252_G04_0_Pos)                          /*!< LCD PAL252: G04_0 Mask              */\r
+#define LCD_PAL252_B04_0_Pos                                  10                                                        /*!< LCD PAL252: B04_0 Position          */\r
+#define LCD_PAL252_B04_0_Msk                                  (0x1fUL << LCD_PAL252_B04_0_Pos)                          /*!< LCD PAL252: B04_0 Mask              */\r
+#define LCD_PAL252_I0_Pos                                     15                                                        /*!< LCD PAL252: I0 Position             */\r
+#define LCD_PAL252_I0_Msk                                     (0x01UL << LCD_PAL252_I0_Pos)                             /*!< LCD PAL252: I0 Mask                 */\r
+#define LCD_PAL252_R14_0_Pos                                  16                                                        /*!< LCD PAL252: R14_0 Position          */\r
+#define LCD_PAL252_R14_0_Msk                                  (0x1fUL << LCD_PAL252_R14_0_Pos)                          /*!< LCD PAL252: R14_0 Mask              */\r
+#define LCD_PAL252_G14_0_Pos                                  21                                                        /*!< LCD PAL252: G14_0 Position          */\r
+#define LCD_PAL252_G14_0_Msk                                  (0x1fUL << LCD_PAL252_G14_0_Pos)                          /*!< LCD PAL252: G14_0 Mask              */\r
+#define LCD_PAL252_B14_0_Pos                                  26                                                        /*!< LCD PAL252: B14_0 Position          */\r
+#define LCD_PAL252_B14_0_Msk                                  (0x1fUL << LCD_PAL252_B14_0_Pos)                          /*!< LCD PAL252: B14_0 Mask              */\r
+#define LCD_PAL252_I1_Pos                                     31                                                        /*!< LCD PAL252: I1 Position             */\r
+#define LCD_PAL252_I1_Msk                                     (0x01UL << LCD_PAL252_I1_Pos)                             /*!< LCD PAL252: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL253  -------------------------------------------\r
+#define LCD_PAL253_R04_0_Pos                                  0                                                         /*!< LCD PAL253: R04_0 Position          */\r
+#define LCD_PAL253_R04_0_Msk                                  (0x1fUL << LCD_PAL253_R04_0_Pos)                          /*!< LCD PAL253: R04_0 Mask              */\r
+#define LCD_PAL253_G04_0_Pos                                  5                                                         /*!< LCD PAL253: G04_0 Position          */\r
+#define LCD_PAL253_G04_0_Msk                                  (0x1fUL << LCD_PAL253_G04_0_Pos)                          /*!< LCD PAL253: G04_0 Mask              */\r
+#define LCD_PAL253_B04_0_Pos                                  10                                                        /*!< LCD PAL253: B04_0 Position          */\r
+#define LCD_PAL253_B04_0_Msk                                  (0x1fUL << LCD_PAL253_B04_0_Pos)                          /*!< LCD PAL253: B04_0 Mask              */\r
+#define LCD_PAL253_I0_Pos                                     15                                                        /*!< LCD PAL253: I0 Position             */\r
+#define LCD_PAL253_I0_Msk                                     (0x01UL << LCD_PAL253_I0_Pos)                             /*!< LCD PAL253: I0 Mask                 */\r
+#define LCD_PAL253_R14_0_Pos                                  16                                                        /*!< LCD PAL253: R14_0 Position          */\r
+#define LCD_PAL253_R14_0_Msk                                  (0x1fUL << LCD_PAL253_R14_0_Pos)                          /*!< LCD PAL253: R14_0 Mask              */\r
+#define LCD_PAL253_G14_0_Pos                                  21                                                        /*!< LCD PAL253: G14_0 Position          */\r
+#define LCD_PAL253_G14_0_Msk                                  (0x1fUL << LCD_PAL253_G14_0_Pos)                          /*!< LCD PAL253: G14_0 Mask              */\r
+#define LCD_PAL253_B14_0_Pos                                  26                                                        /*!< LCD PAL253: B14_0 Position          */\r
+#define LCD_PAL253_B14_0_Msk                                  (0x1fUL << LCD_PAL253_B14_0_Pos)                          /*!< LCD PAL253: B14_0 Mask              */\r
+#define LCD_PAL253_I1_Pos                                     31                                                        /*!< LCD PAL253: I1 Position             */\r
+#define LCD_PAL253_I1_Msk                                     (0x01UL << LCD_PAL253_I1_Pos)                             /*!< LCD PAL253: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL254  -------------------------------------------\r
+#define LCD_PAL254_R04_0_Pos                                  0                                                         /*!< LCD PAL254: R04_0 Position          */\r
+#define LCD_PAL254_R04_0_Msk                                  (0x1fUL << LCD_PAL254_R04_0_Pos)                          /*!< LCD PAL254: R04_0 Mask              */\r
+#define LCD_PAL254_G04_0_Pos                                  5                                                         /*!< LCD PAL254: G04_0 Position          */\r
+#define LCD_PAL254_G04_0_Msk                                  (0x1fUL << LCD_PAL254_G04_0_Pos)                          /*!< LCD PAL254: G04_0 Mask              */\r
+#define LCD_PAL254_B04_0_Pos                                  10                                                        /*!< LCD PAL254: B04_0 Position          */\r
+#define LCD_PAL254_B04_0_Msk                                  (0x1fUL << LCD_PAL254_B04_0_Pos)                          /*!< LCD PAL254: B04_0 Mask              */\r
+#define LCD_PAL254_I0_Pos                                     15                                                        /*!< LCD PAL254: I0 Position             */\r
+#define LCD_PAL254_I0_Msk                                     (0x01UL << LCD_PAL254_I0_Pos)                             /*!< LCD PAL254: I0 Mask                 */\r
+#define LCD_PAL254_R14_0_Pos                                  16                                                        /*!< LCD PAL254: R14_0 Position          */\r
+#define LCD_PAL254_R14_0_Msk                                  (0x1fUL << LCD_PAL254_R14_0_Pos)                          /*!< LCD PAL254: R14_0 Mask              */\r
+#define LCD_PAL254_G14_0_Pos                                  21                                                        /*!< LCD PAL254: G14_0 Position          */\r
+#define LCD_PAL254_G14_0_Msk                                  (0x1fUL << LCD_PAL254_G14_0_Pos)                          /*!< LCD PAL254: G14_0 Mask              */\r
+#define LCD_PAL254_B14_0_Pos                                  26                                                        /*!< LCD PAL254: B14_0 Position          */\r
+#define LCD_PAL254_B14_0_Msk                                  (0x1fUL << LCD_PAL254_B14_0_Pos)                          /*!< LCD PAL254: B14_0 Mask              */\r
+#define LCD_PAL254_I1_Pos                                     31                                                        /*!< LCD PAL254: I1 Position             */\r
+#define LCD_PAL254_I1_Msk                                     (0x01UL << LCD_PAL254_I1_Pos)                             /*!< LCD PAL254: I1 Mask                 */\r
+\r
+// ---------------------------------------  LCD_PAL255  -------------------------------------------\r
+#define LCD_PAL255_R04_0_Pos                                  0                                                         /*!< LCD PAL255: R04_0 Position          */\r
+#define LCD_PAL255_R04_0_Msk                                  (0x1fUL << LCD_PAL255_R04_0_Pos)                          /*!< LCD PAL255: R04_0 Mask              */\r
+#define LCD_PAL255_G04_0_Pos                                  5                                                         /*!< LCD PAL255: G04_0 Position          */\r
+#define LCD_PAL255_G04_0_Msk                                  (0x1fUL << LCD_PAL255_G04_0_Pos)                          /*!< LCD PAL255: G04_0 Mask              */\r
+#define LCD_PAL255_B04_0_Pos                                  10                                                        /*!< LCD PAL255: B04_0 Position          */\r
+#define LCD_PAL255_B04_0_Msk                                  (0x1fUL << LCD_PAL255_B04_0_Pos)                          /*!< LCD PAL255: B04_0 Mask              */\r
+#define LCD_PAL255_I0_Pos                                     15                                                        /*!< LCD PAL255: I0 Position             */\r
+#define LCD_PAL255_I0_Msk                                     (0x01UL << LCD_PAL255_I0_Pos)                             /*!< LCD PAL255: I0 Mask                 */\r
+#define LCD_PAL255_R14_0_Pos                                  16                                                        /*!< LCD PAL255: R14_0 Position          */\r
+#define LCD_PAL255_R14_0_Msk                                  (0x1fUL << LCD_PAL255_R14_0_Pos)                          /*!< LCD PAL255: R14_0 Mask              */\r
+#define LCD_PAL255_G14_0_Pos                                  21                                                        /*!< LCD PAL255: G14_0 Position          */\r
+#define LCD_PAL255_G14_0_Msk                                  (0x1fUL << LCD_PAL255_G14_0_Pos)                          /*!< LCD PAL255: G14_0 Mask              */\r
+#define LCD_PAL255_B14_0_Pos                                  26                                                        /*!< LCD PAL255: B14_0 Position          */\r
+#define LCD_PAL255_B14_0_Msk                                  (0x1fUL << LCD_PAL255_B14_0_Pos)                          /*!< LCD PAL255: B14_0 Mask              */\r
+#define LCD_PAL255_I1_Pos                                     31                                                        /*!< LCD PAL255: I1 Position             */\r
+#define LCD_PAL255_I1_Msk                                     (0x01UL << LCD_PAL255_I1_Pos)                             /*!< LCD PAL255: I1 Mask                 */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG0  -----------------------------------------\r
+#define LCD_CRSR_IMG0_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG0: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG0_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG0_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG0: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG1  -----------------------------------------\r
+#define LCD_CRSR_IMG1_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG1: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG1_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG1_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG1: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG2  -----------------------------------------\r
+#define LCD_CRSR_IMG2_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG2: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG2_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG2_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG2: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG3  -----------------------------------------\r
+#define LCD_CRSR_IMG3_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG3: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG3_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG3_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG3: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG4  -----------------------------------------\r
+#define LCD_CRSR_IMG4_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG4: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG4_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG4_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG4: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG5  -----------------------------------------\r
+#define LCD_CRSR_IMG5_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG5: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG5_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG5_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG5: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG6  -----------------------------------------\r
+#define LCD_CRSR_IMG6_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG6: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG6_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG6_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG6: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG7  -----------------------------------------\r
+#define LCD_CRSR_IMG7_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG7: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG7_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG7_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG7: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG8  -----------------------------------------\r
+#define LCD_CRSR_IMG8_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG8: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG8_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG8_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG8: CRSR_IMG Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_IMG9  -----------------------------------------\r
+#define LCD_CRSR_IMG9_CRSR_IMG_Pos                            0                                                         /*!< LCD CRSR_IMG9: CRSR_IMG Position    */\r
+#define LCD_CRSR_IMG9_CRSR_IMG_Msk                            (0xffffffffUL << LCD_CRSR_IMG9_CRSR_IMG_Pos)              /*!< LCD CRSR_IMG9: CRSR_IMG Mask        */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG10  -----------------------------------------\r
+#define LCD_CRSR_IMG10_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG10: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG10_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG10_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG10: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG11  -----------------------------------------\r
+#define LCD_CRSR_IMG11_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG11: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG11_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG11_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG11: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG12  -----------------------------------------\r
+#define LCD_CRSR_IMG12_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG12: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG12_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG12_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG12: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG13  -----------------------------------------\r
+#define LCD_CRSR_IMG13_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG13: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG13_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG13_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG13: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG14  -----------------------------------------\r
+#define LCD_CRSR_IMG14_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG14: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG14_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG14_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG14: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG15  -----------------------------------------\r
+#define LCD_CRSR_IMG15_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG15: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG15_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG15_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG15: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG16  -----------------------------------------\r
+#define LCD_CRSR_IMG16_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG16: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG16_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG16_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG16: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG17  -----------------------------------------\r
+#define LCD_CRSR_IMG17_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG17: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG17_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG17_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG17: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG18  -----------------------------------------\r
+#define LCD_CRSR_IMG18_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG18: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG18_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG18_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG18: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG19  -----------------------------------------\r
+#define LCD_CRSR_IMG19_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG19: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG19_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG19_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG19: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG20  -----------------------------------------\r
+#define LCD_CRSR_IMG20_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG20: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG20_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG20_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG20: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG21  -----------------------------------------\r
+#define LCD_CRSR_IMG21_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG21: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG21_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG21_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG21: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG22  -----------------------------------------\r
+#define LCD_CRSR_IMG22_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG22: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG22_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG22_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG22: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG23  -----------------------------------------\r
+#define LCD_CRSR_IMG23_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG23: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG23_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG23_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG23: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG24  -----------------------------------------\r
+#define LCD_CRSR_IMG24_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG24: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG24_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG24_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG24: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG25  -----------------------------------------\r
+#define LCD_CRSR_IMG25_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG25: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG25_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG25_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG25: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG26  -----------------------------------------\r
+#define LCD_CRSR_IMG26_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG26: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG26_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG26_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG26: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG27  -----------------------------------------\r
+#define LCD_CRSR_IMG27_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG27: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG27_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG27_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG27: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG28  -----------------------------------------\r
+#define LCD_CRSR_IMG28_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG28: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG28_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG28_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG28: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG29  -----------------------------------------\r
+#define LCD_CRSR_IMG29_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG29: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG29_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG29_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG29: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG30  -----------------------------------------\r
+#define LCD_CRSR_IMG30_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG30: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG30_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG30_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG30: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG31  -----------------------------------------\r
+#define LCD_CRSR_IMG31_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG31: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG31_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG31_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG31: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG32  -----------------------------------------\r
+#define LCD_CRSR_IMG32_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG32: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG32_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG32_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG32: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG33  -----------------------------------------\r
+#define LCD_CRSR_IMG33_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG33: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG33_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG33_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG33: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG34  -----------------------------------------\r
+#define LCD_CRSR_IMG34_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG34: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG34_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG34_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG34: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG35  -----------------------------------------\r
+#define LCD_CRSR_IMG35_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG35: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG35_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG35_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG35: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG36  -----------------------------------------\r
+#define LCD_CRSR_IMG36_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG36: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG36_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG36_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG36: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG37  -----------------------------------------\r
+#define LCD_CRSR_IMG37_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG37: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG37_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG37_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG37: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG38  -----------------------------------------\r
+#define LCD_CRSR_IMG38_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG38: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG38_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG38_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG38: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG39  -----------------------------------------\r
+#define LCD_CRSR_IMG39_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG39: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG39_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG39_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG39: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG40  -----------------------------------------\r
+#define LCD_CRSR_IMG40_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG40: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG40_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG40_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG40: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG41  -----------------------------------------\r
+#define LCD_CRSR_IMG41_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG41: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG41_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG41_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG41: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG42  -----------------------------------------\r
+#define LCD_CRSR_IMG42_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG42: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG42_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG42_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG42: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG43  -----------------------------------------\r
+#define LCD_CRSR_IMG43_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG43: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG43_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG43_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG43: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG44  -----------------------------------------\r
+#define LCD_CRSR_IMG44_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG44: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG44_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG44_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG44: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG45  -----------------------------------------\r
+#define LCD_CRSR_IMG45_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG45: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG45_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG45_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG45: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG46  -----------------------------------------\r
+#define LCD_CRSR_IMG46_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG46: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG46_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG46_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG46: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG47  -----------------------------------------\r
+#define LCD_CRSR_IMG47_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG47: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG47_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG47_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG47: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG48  -----------------------------------------\r
+#define LCD_CRSR_IMG48_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG48: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG48_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG48_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG48: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG49  -----------------------------------------\r
+#define LCD_CRSR_IMG49_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG49: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG49_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG49_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG49: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG50  -----------------------------------------\r
+#define LCD_CRSR_IMG50_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG50: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG50_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG50_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG50: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG51  -----------------------------------------\r
+#define LCD_CRSR_IMG51_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG51: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG51_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG51_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG51: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG52  -----------------------------------------\r
+#define LCD_CRSR_IMG52_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG52: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG52_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG52_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG52: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG53  -----------------------------------------\r
+#define LCD_CRSR_IMG53_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG53: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG53_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG53_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG53: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG54  -----------------------------------------\r
+#define LCD_CRSR_IMG54_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG54: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG54_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG54_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG54: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG55  -----------------------------------------\r
+#define LCD_CRSR_IMG55_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG55: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG55_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG55_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG55: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG56  -----------------------------------------\r
+#define LCD_CRSR_IMG56_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG56: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG56_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG56_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG56: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG57  -----------------------------------------\r
+#define LCD_CRSR_IMG57_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG57: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG57_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG57_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG57: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG58  -----------------------------------------\r
+#define LCD_CRSR_IMG58_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG58: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG58_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG58_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG58: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG59  -----------------------------------------\r
+#define LCD_CRSR_IMG59_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG59: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG59_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG59_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG59: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG60  -----------------------------------------\r
+#define LCD_CRSR_IMG60_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG60: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG60_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG60_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG60: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG61  -----------------------------------------\r
+#define LCD_CRSR_IMG61_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG61: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG61_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG61_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG61: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG62  -----------------------------------------\r
+#define LCD_CRSR_IMG62_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG62: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG62_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG62_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG62: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG63  -----------------------------------------\r
+#define LCD_CRSR_IMG63_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG63: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG63_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG63_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG63: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG64  -----------------------------------------\r
+#define LCD_CRSR_IMG64_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG64: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG64_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG64_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG64: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG65  -----------------------------------------\r
+#define LCD_CRSR_IMG65_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG65: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG65_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG65_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG65: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG66  -----------------------------------------\r
+#define LCD_CRSR_IMG66_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG66: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG66_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG66_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG66: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG67  -----------------------------------------\r
+#define LCD_CRSR_IMG67_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG67: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG67_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG67_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG67: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG68  -----------------------------------------\r
+#define LCD_CRSR_IMG68_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG68: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG68_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG68_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG68: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG69  -----------------------------------------\r
+#define LCD_CRSR_IMG69_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG69: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG69_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG69_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG69: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG70  -----------------------------------------\r
+#define LCD_CRSR_IMG70_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG70: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG70_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG70_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG70: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG71  -----------------------------------------\r
+#define LCD_CRSR_IMG71_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG71: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG71_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG71_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG71: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG72  -----------------------------------------\r
+#define LCD_CRSR_IMG72_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG72: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG72_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG72_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG72: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG73  -----------------------------------------\r
+#define LCD_CRSR_IMG73_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG73: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG73_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG73_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG73: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG74  -----------------------------------------\r
+#define LCD_CRSR_IMG74_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG74: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG74_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG74_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG74: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG75  -----------------------------------------\r
+#define LCD_CRSR_IMG75_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG75: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG75_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG75_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG75: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG76  -----------------------------------------\r
+#define LCD_CRSR_IMG76_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG76: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG76_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG76_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG76: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG77  -----------------------------------------\r
+#define LCD_CRSR_IMG77_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG77: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG77_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG77_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG77: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG78  -----------------------------------------\r
+#define LCD_CRSR_IMG78_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG78: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG78_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG78_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG78: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG79  -----------------------------------------\r
+#define LCD_CRSR_IMG79_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG79: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG79_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG79_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG79: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG80  -----------------------------------------\r
+#define LCD_CRSR_IMG80_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG80: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG80_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG80_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG80: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG81  -----------------------------------------\r
+#define LCD_CRSR_IMG81_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG81: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG81_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG81_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG81: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG82  -----------------------------------------\r
+#define LCD_CRSR_IMG82_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG82: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG82_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG82_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG82: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG83  -----------------------------------------\r
+#define LCD_CRSR_IMG83_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG83: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG83_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG83_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG83: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG84  -----------------------------------------\r
+#define LCD_CRSR_IMG84_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG84: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG84_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG84_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG84: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG85  -----------------------------------------\r
+#define LCD_CRSR_IMG85_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG85: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG85_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG85_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG85: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG86  -----------------------------------------\r
+#define LCD_CRSR_IMG86_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG86: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG86_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG86_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG86: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG87  -----------------------------------------\r
+#define LCD_CRSR_IMG87_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG87: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG87_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG87_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG87: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG88  -----------------------------------------\r
+#define LCD_CRSR_IMG88_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG88: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG88_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG88_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG88: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG89  -----------------------------------------\r
+#define LCD_CRSR_IMG89_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG89: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG89_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG89_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG89: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG90  -----------------------------------------\r
+#define LCD_CRSR_IMG90_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG90: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG90_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG90_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG90: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG91  -----------------------------------------\r
+#define LCD_CRSR_IMG91_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG91: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG91_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG91_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG91: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG92  -----------------------------------------\r
+#define LCD_CRSR_IMG92_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG92: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG92_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG92_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG92: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG93  -----------------------------------------\r
+#define LCD_CRSR_IMG93_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG93: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG93_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG93_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG93: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG94  -----------------------------------------\r
+#define LCD_CRSR_IMG94_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG94: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG94_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG94_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG94: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG95  -----------------------------------------\r
+#define LCD_CRSR_IMG95_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG95: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG95_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG95_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG95: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG96  -----------------------------------------\r
+#define LCD_CRSR_IMG96_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG96: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG96_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG96_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG96: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG97  -----------------------------------------\r
+#define LCD_CRSR_IMG97_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG97: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG97_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG97_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG97: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG98  -----------------------------------------\r
+#define LCD_CRSR_IMG98_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG98: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG98_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG98_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG98: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG99  -----------------------------------------\r
+#define LCD_CRSR_IMG99_CRSR_IMG_Pos                           0                                                         /*!< LCD CRSR_IMG99: CRSR_IMG Position   */\r
+#define LCD_CRSR_IMG99_CRSR_IMG_Msk                           (0xffffffffUL << LCD_CRSR_IMG99_CRSR_IMG_Pos)             /*!< LCD CRSR_IMG99: CRSR_IMG Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG100  ----------------------------------------\r
+#define LCD_CRSR_IMG100_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG100: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG100_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG100_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG100: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG101  ----------------------------------------\r
+#define LCD_CRSR_IMG101_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG101: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG101_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG101_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG101: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG102  ----------------------------------------\r
+#define LCD_CRSR_IMG102_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG102: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG102_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG102_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG102: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG103  ----------------------------------------\r
+#define LCD_CRSR_IMG103_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG103: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG103_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG103_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG103: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG104  ----------------------------------------\r
+#define LCD_CRSR_IMG104_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG104: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG104_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG104_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG104: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG105  ----------------------------------------\r
+#define LCD_CRSR_IMG105_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG105: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG105_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG105_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG105: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG106  ----------------------------------------\r
+#define LCD_CRSR_IMG106_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG106: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG106_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG106_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG106: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG107  ----------------------------------------\r
+#define LCD_CRSR_IMG107_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG107: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG107_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG107_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG107: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG108  ----------------------------------------\r
+#define LCD_CRSR_IMG108_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG108: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG108_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG108_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG108: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG109  ----------------------------------------\r
+#define LCD_CRSR_IMG109_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG109: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG109_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG109_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG109: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG110  ----------------------------------------\r
+#define LCD_CRSR_IMG110_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG110: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG110_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG110_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG110: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG111  ----------------------------------------\r
+#define LCD_CRSR_IMG111_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG111: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG111_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG111_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG111: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG112  ----------------------------------------\r
+#define LCD_CRSR_IMG112_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG112: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG112_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG112_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG112: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG113  ----------------------------------------\r
+#define LCD_CRSR_IMG113_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG113: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG113_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG113_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG113: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG114  ----------------------------------------\r
+#define LCD_CRSR_IMG114_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG114: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG114_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG114_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG114: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG115  ----------------------------------------\r
+#define LCD_CRSR_IMG115_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG115: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG115_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG115_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG115: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG116  ----------------------------------------\r
+#define LCD_CRSR_IMG116_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG116: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG116_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG116_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG116: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG117  ----------------------------------------\r
+#define LCD_CRSR_IMG117_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG117: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG117_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG117_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG117: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG118  ----------------------------------------\r
+#define LCD_CRSR_IMG118_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG118: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG118_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG118_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG118: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG119  ----------------------------------------\r
+#define LCD_CRSR_IMG119_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG119: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG119_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG119_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG119: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG120  ----------------------------------------\r
+#define LCD_CRSR_IMG120_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG120: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG120_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG120_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG120: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG121  ----------------------------------------\r
+#define LCD_CRSR_IMG121_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG121: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG121_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG121_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG121: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG122  ----------------------------------------\r
+#define LCD_CRSR_IMG122_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG122: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG122_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG122_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG122: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG123  ----------------------------------------\r
+#define LCD_CRSR_IMG123_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG123: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG123_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG123_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG123: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG124  ----------------------------------------\r
+#define LCD_CRSR_IMG124_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG124: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG124_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG124_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG124: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG125  ----------------------------------------\r
+#define LCD_CRSR_IMG125_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG125: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG125_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG125_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG125: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG126  ----------------------------------------\r
+#define LCD_CRSR_IMG126_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG126: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG126_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG126_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG126: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG127  ----------------------------------------\r
+#define LCD_CRSR_IMG127_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG127: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG127_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG127_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG127: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG128  ----------------------------------------\r
+#define LCD_CRSR_IMG128_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG128: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG128_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG128_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG128: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG129  ----------------------------------------\r
+#define LCD_CRSR_IMG129_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG129: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG129_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG129_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG129: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG130  ----------------------------------------\r
+#define LCD_CRSR_IMG130_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG130: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG130_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG130_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG130: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG131  ----------------------------------------\r
+#define LCD_CRSR_IMG131_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG131: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG131_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG131_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG131: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG132  ----------------------------------------\r
+#define LCD_CRSR_IMG132_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG132: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG132_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG132_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG132: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG133  ----------------------------------------\r
+#define LCD_CRSR_IMG133_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG133: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG133_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG133_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG133: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG134  ----------------------------------------\r
+#define LCD_CRSR_IMG134_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG134: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG134_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG134_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG134: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG135  ----------------------------------------\r
+#define LCD_CRSR_IMG135_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG135: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG135_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG135_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG135: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG136  ----------------------------------------\r
+#define LCD_CRSR_IMG136_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG136: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG136_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG136_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG136: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG137  ----------------------------------------\r
+#define LCD_CRSR_IMG137_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG137: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG137_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG137_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG137: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG138  ----------------------------------------\r
+#define LCD_CRSR_IMG138_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG138: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG138_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG138_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG138: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG139  ----------------------------------------\r
+#define LCD_CRSR_IMG139_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG139: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG139_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG139_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG139: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG140  ----------------------------------------\r
+#define LCD_CRSR_IMG140_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG140: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG140_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG140_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG140: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG141  ----------------------------------------\r
+#define LCD_CRSR_IMG141_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG141: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG141_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG141_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG141: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG142  ----------------------------------------\r
+#define LCD_CRSR_IMG142_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG142: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG142_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG142_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG142: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG143  ----------------------------------------\r
+#define LCD_CRSR_IMG143_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG143: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG143_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG143_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG143: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG144  ----------------------------------------\r
+#define LCD_CRSR_IMG144_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG144: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG144_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG144_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG144: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG145  ----------------------------------------\r
+#define LCD_CRSR_IMG145_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG145: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG145_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG145_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG145: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG146  ----------------------------------------\r
+#define LCD_CRSR_IMG146_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG146: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG146_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG146_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG146: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG147  ----------------------------------------\r
+#define LCD_CRSR_IMG147_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG147: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG147_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG147_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG147: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG148  ----------------------------------------\r
+#define LCD_CRSR_IMG148_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG148: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG148_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG148_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG148: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG149  ----------------------------------------\r
+#define LCD_CRSR_IMG149_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG149: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG149_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG149_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG149: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG150  ----------------------------------------\r
+#define LCD_CRSR_IMG150_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG150: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG150_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG150_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG150: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG151  ----------------------------------------\r
+#define LCD_CRSR_IMG151_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG151: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG151_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG151_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG151: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG152  ----------------------------------------\r
+#define LCD_CRSR_IMG152_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG152: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG152_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG152_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG152: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG153  ----------------------------------------\r
+#define LCD_CRSR_IMG153_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG153: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG153_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG153_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG153: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG154  ----------------------------------------\r
+#define LCD_CRSR_IMG154_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG154: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG154_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG154_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG154: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG155  ----------------------------------------\r
+#define LCD_CRSR_IMG155_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG155: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG155_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG155_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG155: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG156  ----------------------------------------\r
+#define LCD_CRSR_IMG156_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG156: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG156_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG156_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG156: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG157  ----------------------------------------\r
+#define LCD_CRSR_IMG157_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG157: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG157_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG157_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG157: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG158  ----------------------------------------\r
+#define LCD_CRSR_IMG158_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG158: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG158_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG158_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG158: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG159  ----------------------------------------\r
+#define LCD_CRSR_IMG159_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG159: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG159_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG159_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG159: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG160  ----------------------------------------\r
+#define LCD_CRSR_IMG160_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG160: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG160_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG160_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG160: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG161  ----------------------------------------\r
+#define LCD_CRSR_IMG161_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG161: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG161_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG161_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG161: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG162  ----------------------------------------\r
+#define LCD_CRSR_IMG162_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG162: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG162_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG162_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG162: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG163  ----------------------------------------\r
+#define LCD_CRSR_IMG163_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG163: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG163_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG163_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG163: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG164  ----------------------------------------\r
+#define LCD_CRSR_IMG164_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG164: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG164_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG164_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG164: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG165  ----------------------------------------\r
+#define LCD_CRSR_IMG165_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG165: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG165_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG165_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG165: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG166  ----------------------------------------\r
+#define LCD_CRSR_IMG166_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG166: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG166_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG166_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG166: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG167  ----------------------------------------\r
+#define LCD_CRSR_IMG167_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG167: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG167_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG167_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG167: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG168  ----------------------------------------\r
+#define LCD_CRSR_IMG168_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG168: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG168_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG168_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG168: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG169  ----------------------------------------\r
+#define LCD_CRSR_IMG169_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG169: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG169_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG169_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG169: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG170  ----------------------------------------\r
+#define LCD_CRSR_IMG170_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG170: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG170_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG170_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG170: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG171  ----------------------------------------\r
+#define LCD_CRSR_IMG171_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG171: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG171_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG171_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG171: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG172  ----------------------------------------\r
+#define LCD_CRSR_IMG172_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG172: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG172_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG172_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG172: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG173  ----------------------------------------\r
+#define LCD_CRSR_IMG173_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG173: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG173_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG173_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG173: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG174  ----------------------------------------\r
+#define LCD_CRSR_IMG174_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG174: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG174_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG174_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG174: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG175  ----------------------------------------\r
+#define LCD_CRSR_IMG175_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG175: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG175_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG175_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG175: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG176  ----------------------------------------\r
+#define LCD_CRSR_IMG176_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG176: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG176_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG176_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG176: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG177  ----------------------------------------\r
+#define LCD_CRSR_IMG177_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG177: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG177_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG177_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG177: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG178  ----------------------------------------\r
+#define LCD_CRSR_IMG178_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG178: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG178_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG178_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG178: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG179  ----------------------------------------\r
+#define LCD_CRSR_IMG179_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG179: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG179_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG179_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG179: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG180  ----------------------------------------\r
+#define LCD_CRSR_IMG180_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG180: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG180_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG180_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG180: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG181  ----------------------------------------\r
+#define LCD_CRSR_IMG181_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG181: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG181_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG181_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG181: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG182  ----------------------------------------\r
+#define LCD_CRSR_IMG182_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG182: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG182_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG182_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG182: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG183  ----------------------------------------\r
+#define LCD_CRSR_IMG183_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG183: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG183_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG183_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG183: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG184  ----------------------------------------\r
+#define LCD_CRSR_IMG184_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG184: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG184_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG184_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG184: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG185  ----------------------------------------\r
+#define LCD_CRSR_IMG185_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG185: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG185_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG185_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG185: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG186  ----------------------------------------\r
+#define LCD_CRSR_IMG186_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG186: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG186_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG186_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG186: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG187  ----------------------------------------\r
+#define LCD_CRSR_IMG187_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG187: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG187_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG187_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG187: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG188  ----------------------------------------\r
+#define LCD_CRSR_IMG188_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG188: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG188_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG188_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG188: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG189  ----------------------------------------\r
+#define LCD_CRSR_IMG189_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG189: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG189_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG189_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG189: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG190  ----------------------------------------\r
+#define LCD_CRSR_IMG190_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG190: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG190_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG190_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG190: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG191  ----------------------------------------\r
+#define LCD_CRSR_IMG191_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG191: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG191_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG191_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG191: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG192  ----------------------------------------\r
+#define LCD_CRSR_IMG192_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG192: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG192_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG192_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG192: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG193  ----------------------------------------\r
+#define LCD_CRSR_IMG193_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG193: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG193_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG193_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG193: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG194  ----------------------------------------\r
+#define LCD_CRSR_IMG194_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG194: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG194_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG194_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG194: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG195  ----------------------------------------\r
+#define LCD_CRSR_IMG195_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG195: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG195_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG195_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG195: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG196  ----------------------------------------\r
+#define LCD_CRSR_IMG196_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG196: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG196_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG196_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG196: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG197  ----------------------------------------\r
+#define LCD_CRSR_IMG197_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG197: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG197_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG197_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG197: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG198  ----------------------------------------\r
+#define LCD_CRSR_IMG198_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG198: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG198_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG198_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG198: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG199  ----------------------------------------\r
+#define LCD_CRSR_IMG199_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG199: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG199_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG199_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG199: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG200  ----------------------------------------\r
+#define LCD_CRSR_IMG200_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG200: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG200_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG200_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG200: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG201  ----------------------------------------\r
+#define LCD_CRSR_IMG201_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG201: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG201_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG201_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG201: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG202  ----------------------------------------\r
+#define LCD_CRSR_IMG202_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG202: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG202_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG202_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG202: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG203  ----------------------------------------\r
+#define LCD_CRSR_IMG203_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG203: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG203_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG203_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG203: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG204  ----------------------------------------\r
+#define LCD_CRSR_IMG204_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG204: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG204_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG204_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG204: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG205  ----------------------------------------\r
+#define LCD_CRSR_IMG205_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG205: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG205_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG205_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG205: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG206  ----------------------------------------\r
+#define LCD_CRSR_IMG206_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG206: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG206_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG206_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG206: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG207  ----------------------------------------\r
+#define LCD_CRSR_IMG207_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG207: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG207_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG207_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG207: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG208  ----------------------------------------\r
+#define LCD_CRSR_IMG208_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG208: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG208_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG208_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG208: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG209  ----------------------------------------\r
+#define LCD_CRSR_IMG209_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG209: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG209_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG209_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG209: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG210  ----------------------------------------\r
+#define LCD_CRSR_IMG210_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG210: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG210_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG210_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG210: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG211  ----------------------------------------\r
+#define LCD_CRSR_IMG211_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG211: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG211_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG211_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG211: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG212  ----------------------------------------\r
+#define LCD_CRSR_IMG212_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG212: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG212_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG212_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG212: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG213  ----------------------------------------\r
+#define LCD_CRSR_IMG213_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG213: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG213_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG213_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG213: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG214  ----------------------------------------\r
+#define LCD_CRSR_IMG214_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG214: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG214_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG214_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG214: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG215  ----------------------------------------\r
+#define LCD_CRSR_IMG215_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG215: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG215_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG215_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG215: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG216  ----------------------------------------\r
+#define LCD_CRSR_IMG216_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG216: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG216_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG216_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG216: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG217  ----------------------------------------\r
+#define LCD_CRSR_IMG217_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG217: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG217_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG217_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG217: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG218  ----------------------------------------\r
+#define LCD_CRSR_IMG218_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG218: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG218_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG218_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG218: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG219  ----------------------------------------\r
+#define LCD_CRSR_IMG219_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG219: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG219_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG219_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG219: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG220  ----------------------------------------\r
+#define LCD_CRSR_IMG220_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG220: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG220_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG220_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG220: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG221  ----------------------------------------\r
+#define LCD_CRSR_IMG221_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG221: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG221_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG221_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG221: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG222  ----------------------------------------\r
+#define LCD_CRSR_IMG222_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG222: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG222_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG222_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG222: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG223  ----------------------------------------\r
+#define LCD_CRSR_IMG223_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG223: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG223_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG223_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG223: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG224  ----------------------------------------\r
+#define LCD_CRSR_IMG224_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG224: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG224_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG224_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG224: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG225  ----------------------------------------\r
+#define LCD_CRSR_IMG225_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG225: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG225_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG225_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG225: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG226  ----------------------------------------\r
+#define LCD_CRSR_IMG226_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG226: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG226_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG226_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG226: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG227  ----------------------------------------\r
+#define LCD_CRSR_IMG227_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG227: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG227_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG227_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG227: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG228  ----------------------------------------\r
+#define LCD_CRSR_IMG228_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG228: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG228_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG228_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG228: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG229  ----------------------------------------\r
+#define LCD_CRSR_IMG229_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG229: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG229_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG229_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG229: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG230  ----------------------------------------\r
+#define LCD_CRSR_IMG230_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG230: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG230_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG230_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG230: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG231  ----------------------------------------\r
+#define LCD_CRSR_IMG231_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG231: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG231_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG231_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG231: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG232  ----------------------------------------\r
+#define LCD_CRSR_IMG232_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG232: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG232_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG232_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG232: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG233  ----------------------------------------\r
+#define LCD_CRSR_IMG233_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG233: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG233_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG233_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG233: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG234  ----------------------------------------\r
+#define LCD_CRSR_IMG234_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG234: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG234_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG234_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG234: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG235  ----------------------------------------\r
+#define LCD_CRSR_IMG235_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG235: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG235_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG235_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG235: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG236  ----------------------------------------\r
+#define LCD_CRSR_IMG236_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG236: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG236_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG236_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG236: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG237  ----------------------------------------\r
+#define LCD_CRSR_IMG237_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG237: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG237_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG237_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG237: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG238  ----------------------------------------\r
+#define LCD_CRSR_IMG238_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG238: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG238_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG238_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG238: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG239  ----------------------------------------\r
+#define LCD_CRSR_IMG239_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG239: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG239_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG239_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG239: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG240  ----------------------------------------\r
+#define LCD_CRSR_IMG240_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG240: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG240_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG240_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG240: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG241  ----------------------------------------\r
+#define LCD_CRSR_IMG241_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG241: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG241_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG241_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG241: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG242  ----------------------------------------\r
+#define LCD_CRSR_IMG242_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG242: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG242_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG242_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG242: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG243  ----------------------------------------\r
+#define LCD_CRSR_IMG243_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG243: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG243_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG243_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG243: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG244  ----------------------------------------\r
+#define LCD_CRSR_IMG244_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG244: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG244_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG244_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG244: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG245  ----------------------------------------\r
+#define LCD_CRSR_IMG245_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG245: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG245_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG245_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG245: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG246  ----------------------------------------\r
+#define LCD_CRSR_IMG246_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG246: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG246_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG246_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG246: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG247  ----------------------------------------\r
+#define LCD_CRSR_IMG247_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG247: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG247_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG247_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG247: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG248  ----------------------------------------\r
+#define LCD_CRSR_IMG248_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG248: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG248_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG248_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG248: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG249  ----------------------------------------\r
+#define LCD_CRSR_IMG249_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG249: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG249_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG249_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG249: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG250  ----------------------------------------\r
+#define LCD_CRSR_IMG250_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG250: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG250_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG250_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG250: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG251  ----------------------------------------\r
+#define LCD_CRSR_IMG251_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG251: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG251_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG251_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG251: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG252  ----------------------------------------\r
+#define LCD_CRSR_IMG252_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG252: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG252_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG252_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG252: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG253  ----------------------------------------\r
+#define LCD_CRSR_IMG253_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG253: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG253_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG253_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG253: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG254  ----------------------------------------\r
+#define LCD_CRSR_IMG254_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG254: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG254_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG254_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG254: CRSR_IMG Mask      */\r
+\r
+// -------------------------------------  LCD_CRSR_IMG255  ----------------------------------------\r
+#define LCD_CRSR_IMG255_CRSR_IMG_Pos                          0                                                         /*!< LCD CRSR_IMG255: CRSR_IMG Position  */\r
+#define LCD_CRSR_IMG255_CRSR_IMG_Msk                          (0xffffffffUL << LCD_CRSR_IMG255_CRSR_IMG_Pos)            /*!< LCD CRSR_IMG255: CRSR_IMG Mask      */\r
+\r
+// --------------------------------------  LCD_CRSR_CTRL  -----------------------------------------\r
+#define LCD_CRSR_CTRL_CrsrOn_Pos                              0                                                         /*!< LCD CRSR_CTRL: CrsrOn Position      */\r
+#define LCD_CRSR_CTRL_CrsrOn_Msk                              (0x01UL << LCD_CRSR_CTRL_CrsrOn_Pos)                      /*!< LCD CRSR_CTRL: CrsrOn Mask          */\r
+#define LCD_CRSR_CTRL_CRSRNUM1_0_Pos                          4                                                         /*!< LCD CRSR_CTRL: CRSRNUM1_0 Position  */\r
+#define LCD_CRSR_CTRL_CRSRNUM1_0_Msk                          (0x03UL << LCD_CRSR_CTRL_CRSRNUM1_0_Pos)                  /*!< LCD CRSR_CTRL: CRSRNUM1_0 Mask      */\r
+\r
+// --------------------------------------  LCD_CRSR_CFG  ------------------------------------------\r
+#define LCD_CRSR_CFG_CrsrSize_Pos                             0                                                         /*!< LCD CRSR_CFG: CrsrSize Position     */\r
+#define LCD_CRSR_CFG_CrsrSize_Msk                             (0x01UL << LCD_CRSR_CFG_CrsrSize_Pos)                     /*!< LCD CRSR_CFG: CrsrSize Mask         */\r
+#define LCD_CRSR_CFG_FRAMESYNC_Pos                            1                                                         /*!< LCD CRSR_CFG: FRAMESYNC Position    */\r
+#define LCD_CRSR_CFG_FRAMESYNC_Msk                            (0x01UL << LCD_CRSR_CFG_FRAMESYNC_Pos)                    /*!< LCD CRSR_CFG: FRAMESYNC Mask        */\r
+\r
+// --------------------------------------  LCD_CRSR_PAL0  -----------------------------------------\r
+#define LCD_CRSR_PAL0_RED_Pos                                 0                                                         /*!< LCD CRSR_PAL0: RED Position         */\r
+#define LCD_CRSR_PAL0_RED_Msk                                 (0x000000ffUL << LCD_CRSR_PAL0_RED_Pos)                   /*!< LCD CRSR_PAL0: RED Mask             */\r
+#define LCD_CRSR_PAL0_GREEN_Pos                               8                                                         /*!< LCD CRSR_PAL0: GREEN Position       */\r
+#define LCD_CRSR_PAL0_GREEN_Msk                               (0x000000ffUL << LCD_CRSR_PAL0_GREEN_Pos)                 /*!< LCD CRSR_PAL0: GREEN Mask           */\r
+#define LCD_CRSR_PAL0_BLUE_Pos                                16                                                        /*!< LCD CRSR_PAL0: BLUE Position        */\r
+#define LCD_CRSR_PAL0_BLUE_Msk                                (0x000000ffUL << LCD_CRSR_PAL0_BLUE_Pos)                  /*!< LCD CRSR_PAL0: BLUE Mask            */\r
+\r
+// --------------------------------------  LCD_CRSR_PAL1  -----------------------------------------\r
+#define LCD_CRSR_PAL1_RED_Pos                                 0                                                         /*!< LCD CRSR_PAL1: RED Position         */\r
+#define LCD_CRSR_PAL1_RED_Msk                                 (0x000000ffUL << LCD_CRSR_PAL1_RED_Pos)                   /*!< LCD CRSR_PAL1: RED Mask             */\r
+#define LCD_CRSR_PAL1_GREEN_Pos                               8                                                         /*!< LCD CRSR_PAL1: GREEN Position       */\r
+#define LCD_CRSR_PAL1_GREEN_Msk                               (0x000000ffUL << LCD_CRSR_PAL1_GREEN_Pos)                 /*!< LCD CRSR_PAL1: GREEN Mask           */\r
+#define LCD_CRSR_PAL1_BLUE_Pos                                16                                                        /*!< LCD CRSR_PAL1: BLUE Position        */\r
+#define LCD_CRSR_PAL1_BLUE_Msk                                (0x000000ffUL << LCD_CRSR_PAL1_BLUE_Pos)                  /*!< LCD CRSR_PAL1: BLUE Mask            */\r
+\r
+// ---------------------------------------  LCD_CRSR_XY  ------------------------------------------\r
+#define LCD_CRSR_XY_CRSRX_Pos                                 0                                                         /*!< LCD CRSR_XY: CRSRX Position         */\r
+#define LCD_CRSR_XY_CRSRX_Msk                                 (0x000003ffUL << LCD_CRSR_XY_CRSRX_Pos)                   /*!< LCD CRSR_XY: CRSRX Mask             */\r
+#define LCD_CRSR_XY_CRSRY_Pos                                 16                                                        /*!< LCD CRSR_XY: CRSRY Position         */\r
+#define LCD_CRSR_XY_CRSRY_Msk                                 (0x000003ffUL << LCD_CRSR_XY_CRSRY_Pos)                   /*!< LCD CRSR_XY: CRSRY Mask             */\r
+\r
+// --------------------------------------  LCD_CRSR_CLIP  -----------------------------------------\r
+#define LCD_CRSR_CLIP_CRSRCLIPX_Pos                           0                                                         /*!< LCD CRSR_CLIP: CRSRCLIPX Position   */\r
+#define LCD_CRSR_CLIP_CRSRCLIPX_Msk                           (0x3fUL << LCD_CRSR_CLIP_CRSRCLIPX_Pos)                   /*!< LCD CRSR_CLIP: CRSRCLIPX Mask       */\r
+#define LCD_CRSR_CLIP_CRSRCLIPY_Pos                           8                                                         /*!< LCD CRSR_CLIP: CRSRCLIPY Position   */\r
+#define LCD_CRSR_CLIP_CRSRCLIPY_Msk                           (0x3fUL << LCD_CRSR_CLIP_CRSRCLIPY_Pos)                   /*!< LCD CRSR_CLIP: CRSRCLIPY Mask       */\r
+\r
+// -------------------------------------  LCD_CRSR_INTMSK  ----------------------------------------\r
+#define LCD_CRSR_INTMSK_CRSRIM_Pos                            0                                                         /*!< LCD CRSR_INTMSK: CRSRIM Position    */\r
+#define LCD_CRSR_INTMSK_CRSRIM_Msk                            (0x01UL << LCD_CRSR_INTMSK_CRSRIM_Pos)                    /*!< LCD CRSR_INTMSK: CRSRIM Mask        */\r
+\r
+// -------------------------------------  LCD_CRSR_INTCLR  ----------------------------------------\r
+#define LCD_CRSR_INTCLR_CRSRIC_Pos                            0                                                         /*!< LCD CRSR_INTCLR: CRSRIC Position    */\r
+#define LCD_CRSR_INTCLR_CRSRIC_Msk                            (0x01UL << LCD_CRSR_INTCLR_CRSRIC_Pos)                    /*!< LCD CRSR_INTCLR: CRSRIC Mask        */\r
+\r
+// -------------------------------------  LCD_CRSR_INTRAW  ----------------------------------------\r
+#define LCD_CRSR_INTRAW_CRSRRIS_Pos                           0                                                         /*!< LCD CRSR_INTRAW: CRSRRIS Position   */\r
+#define LCD_CRSR_INTRAW_CRSRRIS_Msk                           (0x01UL << LCD_CRSR_INTRAW_CRSRRIS_Pos)                   /*!< LCD CRSR_INTRAW: CRSRRIS Mask       */\r
+\r
+// ------------------------------------  LCD_CRSR_INTSTAT  ----------------------------------------\r
+#define LCD_CRSR_INTSTAT_CRSRMIS_Pos                          0                                                         /*!< LCD CRSR_INTSTAT: CRSRMIS Position  */\r
+#define LCD_CRSR_INTSTAT_CRSRMIS_Msk                          (0x01UL << LCD_CRSR_INTSTAT_CRSRMIS_Pos)                  /*!< LCD CRSR_INTSTAT: CRSRMIS Mask      */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                               ETHERNET Position & Mask                               -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------  ETHERNET_MAC_CONFIG  --------------------------------------\r
+#define ETHERNET_MAC_CONFIG_RE_Pos                            2                                                         /*!< ETHERNET MAC_CONFIG: RE Position    */\r
+#define ETHERNET_MAC_CONFIG_RE_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_RE_Pos)                    /*!< ETHERNET MAC_CONFIG: RE Mask        */\r
+#define ETHERNET_MAC_CONFIG_TE_Pos                            3                                                         /*!< ETHERNET MAC_CONFIG: TE Position    */\r
+#define ETHERNET_MAC_CONFIG_TE_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_TE_Pos)                    /*!< ETHERNET MAC_CONFIG: TE Mask        */\r
+#define ETHERNET_MAC_CONFIG_DF_Pos                            4                                                         /*!< ETHERNET MAC_CONFIG: DF Position    */\r
+#define ETHERNET_MAC_CONFIG_DF_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_DF_Pos)                    /*!< ETHERNET MAC_CONFIG: DF Mask        */\r
+#define ETHERNET_MAC_CONFIG_BL_Pos                            5                                                         /*!< ETHERNET MAC_CONFIG: BL Position    */\r
+#define ETHERNET_MAC_CONFIG_BL_Msk                            (0x03UL << ETHERNET_MAC_CONFIG_BL_Pos)                    /*!< ETHERNET MAC_CONFIG: BL Mask        */\r
+#define ETHERNET_MAC_CONFIG_ACS_Pos                           7                                                         /*!< ETHERNET MAC_CONFIG: ACS Position   */\r
+#define ETHERNET_MAC_CONFIG_ACS_Msk                           (0x01UL << ETHERNET_MAC_CONFIG_ACS_Pos)                   /*!< ETHERNET MAC_CONFIG: ACS Mask       */\r
+#define ETHERNET_MAC_CONFIG_DR_Pos                            9                                                         /*!< ETHERNET MAC_CONFIG: DR Position    */\r
+#define ETHERNET_MAC_CONFIG_DR_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_DR_Pos)                    /*!< ETHERNET MAC_CONFIG: DR Mask        */\r
+#define ETHERNET_MAC_CONFIG_IPC_Pos                           10                                                        /*!< ETHERNET MAC_CONFIG: IPC Position   */\r
+#define ETHERNET_MAC_CONFIG_IPC_Msk                           (0x01UL << ETHERNET_MAC_CONFIG_IPC_Pos)                   /*!< ETHERNET MAC_CONFIG: IPC Mask       */\r
+#define ETHERNET_MAC_CONFIG_DM_Pos                            11                                                        /*!< ETHERNET MAC_CONFIG: DM Position    */\r
+#define ETHERNET_MAC_CONFIG_DM_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_DM_Pos)                    /*!< ETHERNET MAC_CONFIG: DM Mask        */\r
+#define ETHERNET_MAC_CONFIG_LM_Pos                            12                                                        /*!< ETHERNET MAC_CONFIG: LM Position    */\r
+#define ETHERNET_MAC_CONFIG_LM_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_LM_Pos)                    /*!< ETHERNET MAC_CONFIG: LM Mask        */\r
+#define ETHERNET_MAC_CONFIG_DO_Pos                            13                                                        /*!< ETHERNET MAC_CONFIG: DO Position    */\r
+#define ETHERNET_MAC_CONFIG_DO_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_DO_Pos)                    /*!< ETHERNET MAC_CONFIG: DO Mask        */\r
+#define ETHERNET_MAC_CONFIG_FES_Pos                           14                                                        /*!< ETHERNET MAC_CONFIG: FES Position   */\r
+#define ETHERNET_MAC_CONFIG_FES_Msk                           (0x01UL << ETHERNET_MAC_CONFIG_FES_Pos)                   /*!< ETHERNET MAC_CONFIG: FES Mask       */\r
+#define ETHERNET_MAC_CONFIG_PS_Pos                            15                                                        /*!< ETHERNET MAC_CONFIG: PS Position    */\r
+#define ETHERNET_MAC_CONFIG_PS_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_PS_Pos)                    /*!< ETHERNET MAC_CONFIG: PS Mask        */\r
+#define ETHERNET_MAC_CONFIG_DCRS_Pos                          16                                                        /*!< ETHERNET MAC_CONFIG: DCRS Position  */\r
+#define ETHERNET_MAC_CONFIG_DCRS_Msk                          (0x01UL << ETHERNET_MAC_CONFIG_DCRS_Pos)                  /*!< ETHERNET MAC_CONFIG: DCRS Mask      */\r
+#define ETHERNET_MAC_CONFIG_IFG_Pos                           17                                                        /*!< ETHERNET MAC_CONFIG: IFG Position   */\r
+#define ETHERNET_MAC_CONFIG_IFG_Msk                           (0x07UL << ETHERNET_MAC_CONFIG_IFG_Pos)                   /*!< ETHERNET MAC_CONFIG: IFG Mask       */\r
+#define ETHERNET_MAC_CONFIG_JE_Pos                            20                                                        /*!< ETHERNET MAC_CONFIG: JE Position    */\r
+#define ETHERNET_MAC_CONFIG_JE_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_JE_Pos)                    /*!< ETHERNET MAC_CONFIG: JE Mask        */\r
+#define ETHERNET_MAC_CONFIG_JD_Pos                            22                                                        /*!< ETHERNET MAC_CONFIG: JD Position    */\r
+#define ETHERNET_MAC_CONFIG_JD_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_JD_Pos)                    /*!< ETHERNET MAC_CONFIG: JD Mask        */\r
+#define ETHERNET_MAC_CONFIG_WD_Pos                            23                                                        /*!< ETHERNET MAC_CONFIG: WD Position    */\r
+#define ETHERNET_MAC_CONFIG_WD_Msk                            (0x01UL << ETHERNET_MAC_CONFIG_WD_Pos)                    /*!< ETHERNET MAC_CONFIG: WD Mask        */\r
+\r
+// --------------------------------  ETHERNET_MAC_FRAME_FILTER  -----------------------------------\r
+#define ETHERNET_MAC_FRAME_FILTER_PR_Pos                      0                                                         /*!< ETHERNET MAC_FRAME_FILTER: PR Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_PR_Msk                      (0x01UL << ETHERNET_MAC_FRAME_FILTER_PR_Pos)              /*!< ETHERNET MAC_FRAME_FILTER: PR Mask  */\r
+#define ETHERNET_MAC_FRAME_FILTER_DAIF_Pos                    3                                                         /*!< ETHERNET MAC_FRAME_FILTER: DAIF Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_DAIF_Msk                    (0x01UL << ETHERNET_MAC_FRAME_FILTER_DAIF_Pos)            /*!< ETHERNET MAC_FRAME_FILTER: DAIF Mask */\r
+#define ETHERNET_MAC_FRAME_FILTER_PM_Pos                      4                                                         /*!< ETHERNET MAC_FRAME_FILTER: PM Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_PM_Msk                      (0x01UL << ETHERNET_MAC_FRAME_FILTER_PM_Pos)              /*!< ETHERNET MAC_FRAME_FILTER: PM Mask  */\r
+#define ETHERNET_MAC_FRAME_FILTER_DBF_Pos                     5                                                         /*!< ETHERNET MAC_FRAME_FILTER: DBF Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_DBF_Msk                     (0x01UL << ETHERNET_MAC_FRAME_FILTER_DBF_Pos)             /*!< ETHERNET MAC_FRAME_FILTER: DBF Mask */\r
+#define ETHERNET_MAC_FRAME_FILTER_PCF_Pos                     6                                                         /*!< ETHERNET MAC_FRAME_FILTER: PCF Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_PCF_Msk                     (0x03UL << ETHERNET_MAC_FRAME_FILTER_PCF_Pos)             /*!< ETHERNET MAC_FRAME_FILTER: PCF Mask */\r
+#define ETHERNET_MAC_FRAME_FILTER_SAIF_Pos                    8                                                         /*!< ETHERNET MAC_FRAME_FILTER: SAIF Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_SAIF_Msk                    (0x01UL << ETHERNET_MAC_FRAME_FILTER_SAIF_Pos)            /*!< ETHERNET MAC_FRAME_FILTER: SAIF Mask */\r
+#define ETHERNET_MAC_FRAME_FILTER_SAF_Pos                     9                                                         /*!< ETHERNET MAC_FRAME_FILTER: SAF Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_SAF_Msk                     (0x01UL << ETHERNET_MAC_FRAME_FILTER_SAF_Pos)             /*!< ETHERNET MAC_FRAME_FILTER: SAF Mask */\r
+#define ETHERNET_MAC_FRAME_FILTER_RA_Pos                      31                                                        /*!< ETHERNET MAC_FRAME_FILTER: RA Position */\r
+#define ETHERNET_MAC_FRAME_FILTER_RA_Msk                      (0x01UL << ETHERNET_MAC_FRAME_FILTER_RA_Pos)              /*!< ETHERNET MAC_FRAME_FILTER: RA Mask  */\r
+\r
+// -------------------------------  ETHERNET_MAC_HASHTABLE_HIGH  ----------------------------------\r
+#define ETHERNET_MAC_HASHTABLE_HIGH_HTH_Pos                   0                                                         /*!< ETHERNET MAC_HASHTABLE_HIGH: HTH Position */\r
+#define ETHERNET_MAC_HASHTABLE_HIGH_HTH_Msk                   (0xffffffffUL << ETHERNET_MAC_HASHTABLE_HIGH_HTH_Pos)     /*!< ETHERNET MAC_HASHTABLE_HIGH: HTH Mask */\r
+\r
+// -------------------------------  ETHERNET_MAC_HASHTABLE_LOW  -----------------------------------\r
+#define ETHERNET_MAC_HASHTABLE_LOW_HTL_Pos                    0                                                         /*!< ETHERNET MAC_HASHTABLE_LOW: HTL Position */\r
+#define ETHERNET_MAC_HASHTABLE_LOW_HTL_Msk                    (0xffffffffUL << ETHERNET_MAC_HASHTABLE_LOW_HTL_Pos)      /*!< ETHERNET MAC_HASHTABLE_LOW: HTL Mask */\r
+\r
+// ----------------------------------  ETHERNET_MAC_MII_ADDR  -------------------------------------\r
+#define ETHERNET_MAC_MII_ADDR_GB_Pos                          0                                                         /*!< ETHERNET MAC_MII_ADDR: GB Position  */\r
+#define ETHERNET_MAC_MII_ADDR_GB_Msk                          (0x01UL << ETHERNET_MAC_MII_ADDR_GB_Pos)                  /*!< ETHERNET MAC_MII_ADDR: GB Mask      */\r
+#define ETHERNET_MAC_MII_ADDR_W_Pos                           1                                                         /*!< ETHERNET MAC_MII_ADDR: W Position   */\r
+#define ETHERNET_MAC_MII_ADDR_W_Msk                           (0x01UL << ETHERNET_MAC_MII_ADDR_W_Pos)                   /*!< ETHERNET MAC_MII_ADDR: W Mask       */\r
+#define ETHERNET_MAC_MII_ADDR_CR_Pos                          2                                                         /*!< ETHERNET MAC_MII_ADDR: CR Position  */\r
+#define ETHERNET_MAC_MII_ADDR_CR_Msk                          (0x0fUL << ETHERNET_MAC_MII_ADDR_CR_Pos)                  /*!< ETHERNET MAC_MII_ADDR: CR Mask      */\r
+#define ETHERNET_MAC_MII_ADDR_GR_Pos                          6                                                         /*!< ETHERNET MAC_MII_ADDR: GR Position  */\r
+#define ETHERNET_MAC_MII_ADDR_GR_Msk                          (0x1fUL << ETHERNET_MAC_MII_ADDR_GR_Pos)                  /*!< ETHERNET MAC_MII_ADDR: GR Mask      */\r
+#define ETHERNET_MAC_MII_ADDR_PA_Pos                          11                                                        /*!< ETHERNET MAC_MII_ADDR: PA Position  */\r
+#define ETHERNET_MAC_MII_ADDR_PA_Msk                          (0x1fUL << ETHERNET_MAC_MII_ADDR_PA_Pos)                  /*!< ETHERNET MAC_MII_ADDR: PA Mask      */\r
+\r
+// ----------------------------------  ETHERNET_MAC_MII_DATA  -------------------------------------\r
+#define ETHERNET_MAC_MII_DATA_GD_Pos                          0                                                         /*!< ETHERNET MAC_MII_DATA: GD Position  */\r
+#define ETHERNET_MAC_MII_DATA_GD_Msk                          (0x0000ffffUL << ETHERNET_MAC_MII_DATA_GD_Pos)            /*!< ETHERNET MAC_MII_DATA: GD Mask      */\r
+\r
+// ---------------------------------  ETHERNET_MAC_FLOW_CTRL  -------------------------------------\r
+#define ETHERNET_MAC_FLOW_CTRL_FCB_Pos                        0                                                         /*!< ETHERNET MAC_FLOW_CTRL: FCB Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_FCB_Msk                        (0x01UL << ETHERNET_MAC_FLOW_CTRL_FCB_Pos)                /*!< ETHERNET MAC_FLOW_CTRL: FCB Mask    */\r
+#define ETHERNET_MAC_FLOW_CTRL_TFE_Pos                        1                                                         /*!< ETHERNET MAC_FLOW_CTRL: TFE Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_TFE_Msk                        (0x01UL << ETHERNET_MAC_FLOW_CTRL_TFE_Pos)                /*!< ETHERNET MAC_FLOW_CTRL: TFE Mask    */\r
+#define ETHERNET_MAC_FLOW_CTRL_RFE_Pos                        2                                                         /*!< ETHERNET MAC_FLOW_CTRL: RFE Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_RFE_Msk                        (0x01UL << ETHERNET_MAC_FLOW_CTRL_RFE_Pos)                /*!< ETHERNET MAC_FLOW_CTRL: RFE Mask    */\r
+#define ETHERNET_MAC_FLOW_CTRL_UP_Pos                         3                                                         /*!< ETHERNET MAC_FLOW_CTRL: UP Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_UP_Msk                         (0x01UL << ETHERNET_MAC_FLOW_CTRL_UP_Pos)                 /*!< ETHERNET MAC_FLOW_CTRL: UP Mask     */\r
+#define ETHERNET_MAC_FLOW_CTRL_PLT_Pos                        4                                                         /*!< ETHERNET MAC_FLOW_CTRL: PLT Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_PLT_Msk                        (0x03UL << ETHERNET_MAC_FLOW_CTRL_PLT_Pos)                /*!< ETHERNET MAC_FLOW_CTRL: PLT Mask    */\r
+#define ETHERNET_MAC_FLOW_CTRL_DZPQ_Pos                       7                                                         /*!< ETHERNET MAC_FLOW_CTRL: DZPQ Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_DZPQ_Msk                       (0x01UL << ETHERNET_MAC_FLOW_CTRL_DZPQ_Pos)               /*!< ETHERNET MAC_FLOW_CTRL: DZPQ Mask   */\r
+#define ETHERNET_MAC_FLOW_CTRL_PT_Pos                         16                                                        /*!< ETHERNET MAC_FLOW_CTRL: PT Position */\r
+#define ETHERNET_MAC_FLOW_CTRL_PT_Msk                         (0x0000ffffUL << ETHERNET_MAC_FLOW_CTRL_PT_Pos)           /*!< ETHERNET MAC_FLOW_CTRL: PT Mask     */\r
+\r
+// ----------------------------------  ETHERNET_MAC_VLAN_TAG  -------------------------------------\r
+#define ETHERNET_MAC_VLAN_TAG_VL_Pos                          0                                                         /*!< ETHERNET MAC_VLAN_TAG: VL Position  */\r
+#define ETHERNET_MAC_VLAN_TAG_VL_Msk                          (0x0000ffffUL << ETHERNET_MAC_VLAN_TAG_VL_Pos)            /*!< ETHERNET MAC_VLAN_TAG: VL Mask      */\r
+#define ETHERNET_MAC_VLAN_TAG_ETV_Pos                         16                                                        /*!< ETHERNET MAC_VLAN_TAG: ETV Position */\r
+#define ETHERNET_MAC_VLAN_TAG_ETV_Msk                         (0x01UL << ETHERNET_MAC_VLAN_TAG_ETV_Pos)                 /*!< ETHERNET MAC_VLAN_TAG: ETV Mask     */\r
+\r
+// -----------------------------------  ETHERNET_MAC_DEBUG  ---------------------------------------\r
+#define ETHERNET_MAC_DEBUG_RXIDLESTAT_Pos                     0                                                         /*!< ETHERNET MAC_DEBUG: RXIDLESTAT Position */\r
+#define ETHERNET_MAC_DEBUG_RXIDLESTAT_Msk                     (0x01UL << ETHERNET_MAC_DEBUG_RXIDLESTAT_Pos)             /*!< ETHERNET MAC_DEBUG: RXIDLESTAT Mask */\r
+#define ETHERNET_MAC_DEBUG_FIFOSTAT0_Pos                      1                                                         /*!< ETHERNET MAC_DEBUG: FIFOSTAT0 Position */\r
+#define ETHERNET_MAC_DEBUG_FIFOSTAT0_Msk                      (0x03UL << ETHERNET_MAC_DEBUG_FIFOSTAT0_Pos)              /*!< ETHERNET MAC_DEBUG: FIFOSTAT0 Mask  */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOSTAT1_Pos                    4                                                         /*!< ETHERNET MAC_DEBUG: RXFIFOSTAT1 Position */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOSTAT1_Msk                    (0x01UL << ETHERNET_MAC_DEBUG_RXFIFOSTAT1_Pos)            /*!< ETHERNET MAC_DEBUG: RXFIFOSTAT1 Mask */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOSTAT_Pos                     5                                                         /*!< ETHERNET MAC_DEBUG: RXFIFOSTAT Position */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOSTAT_Msk                     (0x03UL << ETHERNET_MAC_DEBUG_RXFIFOSTAT_Pos)             /*!< ETHERNET MAC_DEBUG: RXFIFOSTAT Mask */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOLVL_Pos                      8                                                         /*!< ETHERNET MAC_DEBUG: RXFIFOLVL Position */\r
+#define ETHERNET_MAC_DEBUG_RXFIFOLVL_Msk                      (0x03UL << ETHERNET_MAC_DEBUG_RXFIFOLVL_Pos)              /*!< ETHERNET MAC_DEBUG: RXFIFOLVL Mask  */\r
+#define ETHERNET_MAC_DEBUG_TXIDLESTAT_Pos                     16                                                        /*!< ETHERNET MAC_DEBUG: TXIDLESTAT Position */\r
+#define ETHERNET_MAC_DEBUG_TXIDLESTAT_Msk                     (0x01UL << ETHERNET_MAC_DEBUG_TXIDLESTAT_Pos)             /*!< ETHERNET MAC_DEBUG: TXIDLESTAT Mask */\r
+#define ETHERNET_MAC_DEBUG_TXSTAT_Pos                         17                                                        /*!< ETHERNET MAC_DEBUG: TXSTAT Position */\r
+#define ETHERNET_MAC_DEBUG_TXSTAT_Msk                         (0x03UL << ETHERNET_MAC_DEBUG_TXSTAT_Pos)                 /*!< ETHERNET MAC_DEBUG: TXSTAT Mask     */\r
+#define ETHERNET_MAC_DEBUG_PAUSE_Pos                          19                                                        /*!< ETHERNET MAC_DEBUG: PAUSE Position  */\r
+#define ETHERNET_MAC_DEBUG_PAUSE_Msk                          (0x01UL << ETHERNET_MAC_DEBUG_PAUSE_Pos)                  /*!< ETHERNET MAC_DEBUG: PAUSE Mask      */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOSTAT_Pos                     20                                                        /*!< ETHERNET MAC_DEBUG: TXFIFOSTAT Position */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOSTAT_Msk                     (0x03UL << ETHERNET_MAC_DEBUG_TXFIFOSTAT_Pos)             /*!< ETHERNET MAC_DEBUG: TXFIFOSTAT Mask */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOSTAT1_Pos                    22                                                        /*!< ETHERNET MAC_DEBUG: TXFIFOSTAT1 Position */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOSTAT1_Msk                    (0x01UL << ETHERNET_MAC_DEBUG_TXFIFOSTAT1_Pos)            /*!< ETHERNET MAC_DEBUG: TXFIFOSTAT1 Mask */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOLVL_Pos                      24                                                        /*!< ETHERNET MAC_DEBUG: TXFIFOLVL Position */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOLVL_Msk                      (0x01UL << ETHERNET_MAC_DEBUG_TXFIFOLVL_Pos)              /*!< ETHERNET MAC_DEBUG: TXFIFOLVL Mask  */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOFULL_Pos                     25                                                        /*!< ETHERNET MAC_DEBUG: TXFIFOFULL Position */\r
+#define ETHERNET_MAC_DEBUG_TXFIFOFULL_Msk                     (0x01UL << ETHERNET_MAC_DEBUG_TXFIFOFULL_Pos)             /*!< ETHERNET MAC_DEBUG: TXFIFOFULL Mask */\r
+\r
+// --------------------------------  ETHERNET_MAC_RWAKE_FRFLT  ------------------------------------\r
+#define ETHERNET_MAC_RWAKE_FRFLT_ADDR_Pos                     0                                                         /*!< ETHERNET MAC_RWAKE_FRFLT: ADDR Position */\r
+#define ETHERNET_MAC_RWAKE_FRFLT_ADDR_Msk                     (0xffffffffUL << ETHERNET_MAC_RWAKE_FRFLT_ADDR_Pos)       /*!< ETHERNET MAC_RWAKE_FRFLT: ADDR Mask */\r
+\r
+// -------------------------------  ETHERNET_MAC_PMT_CTRL_STAT  -----------------------------------\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_PD_Pos                     0                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: PD Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_PD_Msk                     (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_PD_Pos)             /*!< ETHERNET MAC_PMT_CTRL_STAT: PD Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_MPE_Pos                    1                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: MPE Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_MPE_Msk                    (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_MPE_Pos)            /*!< ETHERNET MAC_PMT_CTRL_STAT: MPE Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFE_Pos                    2                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: WFE Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFE_Msk                    (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_WFE_Pos)            /*!< ETHERNET MAC_PMT_CTRL_STAT: WFE Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_MPR_Pos                    5                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: MPR Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_MPR_Msk                    (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_MPR_Pos)            /*!< ETHERNET MAC_PMT_CTRL_STAT: MPR Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFR_Pos                    6                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: WFR Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFR_Msk                    (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_WFR_Pos)            /*!< ETHERNET MAC_PMT_CTRL_STAT: WFR Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_GU_Pos                     9                                                         /*!< ETHERNET MAC_PMT_CTRL_STAT: GU Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_GU_Msk                     (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_GU_Pos)             /*!< ETHERNET MAC_PMT_CTRL_STAT: GU Mask */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFFRPR_Pos                 31                                                        /*!< ETHERNET MAC_PMT_CTRL_STAT: WFFRPR Position */\r
+#define ETHERNET_MAC_PMT_CTRL_STAT_WFFRPR_Msk                 (0x01UL << ETHERNET_MAC_PMT_CTRL_STAT_WFFRPR_Pos)         /*!< ETHERNET MAC_PMT_CTRL_STAT: WFFRPR Mask */\r
+\r
+// ---------------------------------  ETHERNET_MAC_INTR_MASK  -------------------------------------\r
+#define ETHERNET_MAC_INTR_MASK_PMTMSK_Pos                     3                                                         /*!< ETHERNET MAC_INTR_MASK: PMTMSK Position */\r
+#define ETHERNET_MAC_INTR_MASK_PMTMSK_Msk                     (0x01UL << ETHERNET_MAC_INTR_MASK_PMTMSK_Pos)             /*!< ETHERNET MAC_INTR_MASK: PMTMSK Mask */\r
+\r
+// ---------------------------------  ETHERNET_MAC_ADDR0_HIGH  ------------------------------------\r
+#define ETHERNET_MAC_ADDR0_HIGH_A47_32_Pos                    0                                                         /*!< ETHERNET MAC_ADDR0_HIGH: A47_32 Position */\r
+#define ETHERNET_MAC_ADDR0_HIGH_A47_32_Msk                    (0x0000ffffUL << ETHERNET_MAC_ADDR0_HIGH_A47_32_Pos)      /*!< ETHERNET MAC_ADDR0_HIGH: A47_32 Mask */\r
+#define ETHERNET_MAC_ADDR0_HIGH_MO_Pos                        31                                                        /*!< ETHERNET MAC_ADDR0_HIGH: MO Position */\r
+#define ETHERNET_MAC_ADDR0_HIGH_MO_Msk                        (0x01UL << ETHERNET_MAC_ADDR0_HIGH_MO_Pos)                /*!< ETHERNET MAC_ADDR0_HIGH: MO Mask    */\r
+\r
+// ---------------------------------  ETHERNET_MAC_ADDR0_LOW  -------------------------------------\r
+#define ETHERNET_MAC_ADDR0_LOW_A31_0_Pos                      0                                                         /*!< ETHERNET MAC_ADDR0_LOW: A31_0 Position */\r
+#define ETHERNET_MAC_ADDR0_LOW_A31_0_Msk                      (0xffffffffUL << ETHERNET_MAC_ADDR0_LOW_A31_0_Pos)        /*!< ETHERNET MAC_ADDR0_LOW: A31_0 Mask  */\r
+\r
+// --------------------------------  ETHERNET_MAC_TIMESTP_CTRL  -----------------------------------\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENA_Pos                   0                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENA_Msk                   (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSENA_Pos)           /*!< ETHERNET MAC_TIMESTP_CTRL: TSENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCFUPDT_Pos                1                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSCFUPDT Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCFUPDT_Msk                (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSCFUPDT_Pos)        /*!< ETHERNET MAC_TIMESTP_CTRL: TSCFUPDT Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSINIT_Pos                  2                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSINIT Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSINIT_Msk                  (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSINIT_Pos)          /*!< ETHERNET MAC_TIMESTP_CTRL: TSINIT Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSUPDT_Pos                  3                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSUPDT Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSUPDT_Msk                  (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSUPDT_Pos)          /*!< ETHERNET MAC_TIMESTP_CTRL: TSUPDT Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSTRIG_Pos                  4                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSTRIG Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSTRIG_Msk                  (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSTRIG_Pos)          /*!< ETHERNET MAC_TIMESTP_CTRL: TSTRIG Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSADDREG_Pos                5                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSADDREG Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSADDREG_Msk                (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSADDREG_Pos)        /*!< ETHERNET MAC_TIMESTP_CTRL: TSADDREG Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENALL_Pos                 8                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSENALL Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENALL_Msk                 (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSENALL_Pos)         /*!< ETHERNET MAC_TIMESTP_CTRL: TSENALL Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCTRLSSR_Pos               9                                                         /*!< ETHERNET MAC_TIMESTP_CTRL: TSCTRLSSR Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCTRLSSR_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSCTRLSSR_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSCTRLSSR Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSVER2ENA_Pos               10                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSVER2ENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSVER2ENA_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSVER2ENA_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSVER2ENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPENA_Pos                 11                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPENA_Msk                 (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSIPENA_Pos)         /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPV6ENA_Pos               12                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPV6ENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPV6ENA_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSIPV6ENA_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPV6ENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPV4ENA_Pos               13                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPV4ENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSIPV4ENA_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSIPV4ENA_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSIPV4ENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSEVNTENA_Pos               14                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSEVNTENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSEVNTENA_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSEVNTENA_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSEVNTENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSMSTRENA_Pos               15                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSMSTRENA Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSMSTRENA_Msk               (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSMSTRENA_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSMSTRENA Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCLKTYPE_Pos               16                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSCLKTYPE Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSCLKTYPE_Msk               (0x03UL << ETHERNET_MAC_TIMESTP_CTRL_TSCLKTYPE_Pos)       /*!< ETHERNET MAC_TIMESTP_CTRL: TSCLKTYPE Mask */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENMACADDR_Pos             18                                                        /*!< ETHERNET MAC_TIMESTP_CTRL: TSENMACADDR Position */\r
+#define ETHERNET_MAC_TIMESTP_CTRL_TSENMACADDR_Msk             (0x01UL << ETHERNET_MAC_TIMESTP_CTRL_TSENMACADDR_Pos)     /*!< ETHERNET MAC_TIMESTP_CTRL: TSENMACADDR Mask */\r
+\r
+// ----------------------------------  ETHERNET_DMA_BUS_MODE  -------------------------------------\r
+#define ETHERNET_DMA_BUS_MODE_SWR_Pos                         0                                                         /*!< ETHERNET DMA_BUS_MODE: SWR Position */\r
+#define ETHERNET_DMA_BUS_MODE_SWR_Msk                         (0x01UL << ETHERNET_DMA_BUS_MODE_SWR_Pos)                 /*!< ETHERNET DMA_BUS_MODE: SWR Mask     */\r
+#define ETHERNET_DMA_BUS_MODE_DA_Pos                          1                                                         /*!< ETHERNET DMA_BUS_MODE: DA Position  */\r
+#define ETHERNET_DMA_BUS_MODE_DA_Msk                          (0x01UL << ETHERNET_DMA_BUS_MODE_DA_Pos)                  /*!< ETHERNET DMA_BUS_MODE: DA Mask      */\r
+#define ETHERNET_DMA_BUS_MODE_DSL_Pos                         2                                                         /*!< ETHERNET DMA_BUS_MODE: DSL Position */\r
+#define ETHERNET_DMA_BUS_MODE_DSL_Msk                         (0x1fUL << ETHERNET_DMA_BUS_MODE_DSL_Pos)                 /*!< ETHERNET DMA_BUS_MODE: DSL Mask     */\r
+#define ETHERNET_DMA_BUS_MODE_ATDS_Pos                        7                                                         /*!< ETHERNET DMA_BUS_MODE: ATDS Position */\r
+#define ETHERNET_DMA_BUS_MODE_ATDS_Msk                        (0x01UL << ETHERNET_DMA_BUS_MODE_ATDS_Pos)                /*!< ETHERNET DMA_BUS_MODE: ATDS Mask    */\r
+#define ETHERNET_DMA_BUS_MODE_PBL_Pos                         8                                                         /*!< ETHERNET DMA_BUS_MODE: PBL Position */\r
+#define ETHERNET_DMA_BUS_MODE_PBL_Msk                         (0x3fUL << ETHERNET_DMA_BUS_MODE_PBL_Pos)                 /*!< ETHERNET DMA_BUS_MODE: PBL Mask     */\r
+#define ETHERNET_DMA_BUS_MODE_PR_Pos                          14                                                        /*!< ETHERNET DMA_BUS_MODE: PR Position  */\r
+#define ETHERNET_DMA_BUS_MODE_PR_Msk                          (0x03UL << ETHERNET_DMA_BUS_MODE_PR_Pos)                  /*!< ETHERNET DMA_BUS_MODE: PR Mask      */\r
+#define ETHERNET_DMA_BUS_MODE_FB_Pos                          16                                                        /*!< ETHERNET DMA_BUS_MODE: FB Position  */\r
+#define ETHERNET_DMA_BUS_MODE_FB_Msk                          (0x01UL << ETHERNET_DMA_BUS_MODE_FB_Pos)                  /*!< ETHERNET DMA_BUS_MODE: FB Mask      */\r
+#define ETHERNET_DMA_BUS_MODE_RPBL_Pos                        17                                                        /*!< ETHERNET DMA_BUS_MODE: RPBL Position */\r
+#define ETHERNET_DMA_BUS_MODE_RPBL_Msk                        (0x3fUL << ETHERNET_DMA_BUS_MODE_RPBL_Pos)                /*!< ETHERNET DMA_BUS_MODE: RPBL Mask    */\r
+#define ETHERNET_DMA_BUS_MODE_USP_Pos                         23                                                        /*!< ETHERNET DMA_BUS_MODE: USP Position */\r
+#define ETHERNET_DMA_BUS_MODE_USP_Msk                         (0x01UL << ETHERNET_DMA_BUS_MODE_USP_Pos)                 /*!< ETHERNET DMA_BUS_MODE: USP Mask     */\r
+#define ETHERNET_DMA_BUS_MODE_PBL8X_Pos                       24                                                        /*!< ETHERNET DMA_BUS_MODE: PBL8X Position */\r
+#define ETHERNET_DMA_BUS_MODE_PBL8X_Msk                       (0x01UL << ETHERNET_DMA_BUS_MODE_PBL8X_Pos)               /*!< ETHERNET DMA_BUS_MODE: PBL8X Mask   */\r
+#define ETHERNET_DMA_BUS_MODE_AAL_Pos                         25                                                        /*!< ETHERNET DMA_BUS_MODE: AAL Position */\r
+#define ETHERNET_DMA_BUS_MODE_AAL_Msk                         (0x01UL << ETHERNET_DMA_BUS_MODE_AAL_Pos)                 /*!< ETHERNET DMA_BUS_MODE: AAL Mask     */\r
+#define ETHERNET_DMA_BUS_MODE_MB_Pos                          26                                                        /*!< ETHERNET DMA_BUS_MODE: MB Position  */\r
+#define ETHERNET_DMA_BUS_MODE_MB_Msk                          (0x01UL << ETHERNET_DMA_BUS_MODE_MB_Pos)                  /*!< ETHERNET DMA_BUS_MODE: MB Mask      */\r
+#define ETHERNET_DMA_BUS_MODE_TXPR_Pos                        27                                                        /*!< ETHERNET DMA_BUS_MODE: TXPR Position */\r
+#define ETHERNET_DMA_BUS_MODE_TXPR_Msk                        (0x01UL << ETHERNET_DMA_BUS_MODE_TXPR_Pos)                /*!< ETHERNET DMA_BUS_MODE: TXPR Mask    */\r
+\r
+// -----------------------------  ETHERNET_DMA_TRANS_POLL_DEMAND  ---------------------------------\r
+#define ETHERNET_DMA_TRANS_POLL_DEMAND_TPD_Pos                0                                                         /*!< ETHERNET DMA_TRANS_POLL_DEMAND: TPD Position */\r
+#define ETHERNET_DMA_TRANS_POLL_DEMAND_TPD_Msk                (0xffffffffUL << ETHERNET_DMA_TRANS_POLL_DEMAND_TPD_Pos)  /*!< ETHERNET DMA_TRANS_POLL_DEMAND: TPD Mask */\r
+\r
+// ------------------------------  ETHERNET_DMA_REC_POLL_DEMAND  ----------------------------------\r
+#define ETHERNET_DMA_REC_POLL_DEMAND_RPD_Pos                  0                                                         /*!< ETHERNET DMA_REC_POLL_DEMAND: RPD Position */\r
+#define ETHERNET_DMA_REC_POLL_DEMAND_RPD_Msk                  (0xffffffffUL << ETHERNET_DMA_REC_POLL_DEMAND_RPD_Pos)    /*!< ETHERNET DMA_REC_POLL_DEMAND: RPD Mask */\r
+\r
+// --------------------------------  ETHERNET_DMA_REC_DES_ADDR  -----------------------------------\r
+#define ETHERNET_DMA_REC_DES_ADDR_SRL_Pos                     0                                                         /*!< ETHERNET DMA_REC_DES_ADDR: SRL Position */\r
+#define ETHERNET_DMA_REC_DES_ADDR_SRL_Msk                     (0xffffffffUL << ETHERNET_DMA_REC_DES_ADDR_SRL_Pos)       /*!< ETHERNET DMA_REC_DES_ADDR: SRL Mask */\r
+\r
+// -------------------------------  ETHERNET_DMA_TRANS_DES_ADDR  ----------------------------------\r
+#define ETHERNET_DMA_TRANS_DES_ADDR_SRL_Pos                   0                                                         /*!< ETHERNET DMA_TRANS_DES_ADDR: SRL Position */\r
+#define ETHERNET_DMA_TRANS_DES_ADDR_SRL_Msk                   (0xffffffffUL << ETHERNET_DMA_TRANS_DES_ADDR_SRL_Pos)     /*!< ETHERNET DMA_TRANS_DES_ADDR: SRL Mask */\r
+\r
+// ------------------------------------  ETHERNET_DMA_STAT  ---------------------------------------\r
+#define ETHERNET_DMA_STAT_TI_Pos                              0                                                         /*!< ETHERNET DMA_STAT: TI Position      */\r
+#define ETHERNET_DMA_STAT_TI_Msk                              (0x01UL << ETHERNET_DMA_STAT_TI_Pos)                      /*!< ETHERNET DMA_STAT: TI Mask          */\r
+#define ETHERNET_DMA_STAT_TPS_Pos                             1                                                         /*!< ETHERNET DMA_STAT: TPS Position     */\r
+#define ETHERNET_DMA_STAT_TPS_Msk                             (0x01UL << ETHERNET_DMA_STAT_TPS_Pos)                     /*!< ETHERNET DMA_STAT: TPS Mask         */\r
+#define ETHERNET_DMA_STAT_TU_Pos                              2                                                         /*!< ETHERNET DMA_STAT: TU Position      */\r
+#define ETHERNET_DMA_STAT_TU_Msk                              (0x01UL << ETHERNET_DMA_STAT_TU_Pos)                      /*!< ETHERNET DMA_STAT: TU Mask          */\r
+#define ETHERNET_DMA_STAT_TJT_Pos                             3                                                         /*!< ETHERNET DMA_STAT: TJT Position     */\r
+#define ETHERNET_DMA_STAT_TJT_Msk                             (0x01UL << ETHERNET_DMA_STAT_TJT_Pos)                     /*!< ETHERNET DMA_STAT: TJT Mask         */\r
+#define ETHERNET_DMA_STAT_OVF_Pos                             4                                                         /*!< ETHERNET DMA_STAT: OVF Position     */\r
+#define ETHERNET_DMA_STAT_OVF_Msk                             (0x01UL << ETHERNET_DMA_STAT_OVF_Pos)                     /*!< ETHERNET DMA_STAT: OVF Mask         */\r
+#define ETHERNET_DMA_STAT_UNF_Pos                             5                                                         /*!< ETHERNET DMA_STAT: UNF Position     */\r
+#define ETHERNET_DMA_STAT_UNF_Msk                             (0x01UL << ETHERNET_DMA_STAT_UNF_Pos)                     /*!< ETHERNET DMA_STAT: UNF Mask         */\r
+#define ETHERNET_DMA_STAT_RI_Pos                              6                                                         /*!< ETHERNET DMA_STAT: RI Position      */\r
+#define ETHERNET_DMA_STAT_RI_Msk                              (0x01UL << ETHERNET_DMA_STAT_RI_Pos)                      /*!< ETHERNET DMA_STAT: RI Mask          */\r
+#define ETHERNET_DMA_STAT_RU_Pos                              7                                                         /*!< ETHERNET DMA_STAT: RU Position      */\r
+#define ETHERNET_DMA_STAT_RU_Msk                              (0x01UL << ETHERNET_DMA_STAT_RU_Pos)                      /*!< ETHERNET DMA_STAT: RU Mask          */\r
+#define ETHERNET_DMA_STAT_RPS_Pos                             8                                                         /*!< ETHERNET DMA_STAT: RPS Position     */\r
+#define ETHERNET_DMA_STAT_RPS_Msk                             (0x01UL << ETHERNET_DMA_STAT_RPS_Pos)                     /*!< ETHERNET DMA_STAT: RPS Mask         */\r
+#define ETHERNET_DMA_STAT_RWT_Pos                             9                                                         /*!< ETHERNET DMA_STAT: RWT Position     */\r
+#define ETHERNET_DMA_STAT_RWT_Msk                             (0x01UL << ETHERNET_DMA_STAT_RWT_Pos)                     /*!< ETHERNET DMA_STAT: RWT Mask         */\r
+#define ETHERNET_DMA_STAT_ETI_Pos                             10                                                        /*!< ETHERNET DMA_STAT: ETI Position     */\r
+#define ETHERNET_DMA_STAT_ETI_Msk                             (0x01UL << ETHERNET_DMA_STAT_ETI_Pos)                     /*!< ETHERNET DMA_STAT: ETI Mask         */\r
+#define ETHERNET_DMA_STAT_FBI_Pos                             13                                                        /*!< ETHERNET DMA_STAT: FBI Position     */\r
+#define ETHERNET_DMA_STAT_FBI_Msk                             (0x01UL << ETHERNET_DMA_STAT_FBI_Pos)                     /*!< ETHERNET DMA_STAT: FBI Mask         */\r
+#define ETHERNET_DMA_STAT_ERI_Pos                             14                                                        /*!< ETHERNET DMA_STAT: ERI Position     */\r
+#define ETHERNET_DMA_STAT_ERI_Msk                             (0x01UL << ETHERNET_DMA_STAT_ERI_Pos)                     /*!< ETHERNET DMA_STAT: ERI Mask         */\r
+#define ETHERNET_DMA_STAT_AIE_Pos                             15                                                        /*!< ETHERNET DMA_STAT: AIE Position     */\r
+#define ETHERNET_DMA_STAT_AIE_Msk                             (0x01UL << ETHERNET_DMA_STAT_AIE_Pos)                     /*!< ETHERNET DMA_STAT: AIE Mask         */\r
+#define ETHERNET_DMA_STAT_NIS_Pos                             16                                                        /*!< ETHERNET DMA_STAT: NIS Position     */\r
+#define ETHERNET_DMA_STAT_NIS_Msk                             (0x01UL << ETHERNET_DMA_STAT_NIS_Pos)                     /*!< ETHERNET DMA_STAT: NIS Mask         */\r
+\r
+// ----------------------------------  ETHERNET_DMA_OP_MODE  --------------------------------------\r
+#define ETHERNET_DMA_OP_MODE_SR_Pos                           1                                                         /*!< ETHERNET DMA_OP_MODE: SR Position   */\r
+#define ETHERNET_DMA_OP_MODE_SR_Msk                           (0x01UL << ETHERNET_DMA_OP_MODE_SR_Pos)                   /*!< ETHERNET DMA_OP_MODE: SR Mask       */\r
+#define ETHERNET_DMA_OP_MODE_OSF_Pos                          2                                                         /*!< ETHERNET DMA_OP_MODE: OSF Position  */\r
+#define ETHERNET_DMA_OP_MODE_OSF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_OSF_Pos)                  /*!< ETHERNET DMA_OP_MODE: OSF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_RTC_Pos                          3                                                         /*!< ETHERNET DMA_OP_MODE: RTC Position  */\r
+#define ETHERNET_DMA_OP_MODE_RTC_Msk                          (0x03UL << ETHERNET_DMA_OP_MODE_RTC_Pos)                  /*!< ETHERNET DMA_OP_MODE: RTC Mask      */\r
+#define ETHERNET_DMA_OP_MODE_FUF_Pos                          6                                                         /*!< ETHERNET DMA_OP_MODE: FUF Position  */\r
+#define ETHERNET_DMA_OP_MODE_FUF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_FUF_Pos)                  /*!< ETHERNET DMA_OP_MODE: FUF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_FEF_Pos                          7                                                         /*!< ETHERNET DMA_OP_MODE: FEF Position  */\r
+#define ETHERNET_DMA_OP_MODE_FEF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_FEF_Pos)                  /*!< ETHERNET DMA_OP_MODE: FEF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_ST_Pos                           13                                                        /*!< ETHERNET DMA_OP_MODE: ST Position   */\r
+#define ETHERNET_DMA_OP_MODE_ST_Msk                           (0x01UL << ETHERNET_DMA_OP_MODE_ST_Pos)                   /*!< ETHERNET DMA_OP_MODE: ST Mask       */\r
+#define ETHERNET_DMA_OP_MODE_TTC_Pos                          14                                                        /*!< ETHERNET DMA_OP_MODE: TTC Position  */\r
+#define ETHERNET_DMA_OP_MODE_TTC_Msk                          (0x07UL << ETHERNET_DMA_OP_MODE_TTC_Pos)                  /*!< ETHERNET DMA_OP_MODE: TTC Mask      */\r
+#define ETHERNET_DMA_OP_MODE_FTF_Pos                          20                                                        /*!< ETHERNET DMA_OP_MODE: FTF Position  */\r
+#define ETHERNET_DMA_OP_MODE_FTF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_FTF_Pos)                  /*!< ETHERNET DMA_OP_MODE: FTF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_TSF_Pos                          21                                                        /*!< ETHERNET DMA_OP_MODE: TSF Position  */\r
+#define ETHERNET_DMA_OP_MODE_TSF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_TSF_Pos)                  /*!< ETHERNET DMA_OP_MODE: TSF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_DFF_Pos                          24                                                        /*!< ETHERNET DMA_OP_MODE: DFF Position  */\r
+#define ETHERNET_DMA_OP_MODE_DFF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_DFF_Pos)                  /*!< ETHERNET DMA_OP_MODE: DFF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_RSF_Pos                          25                                                        /*!< ETHERNET DMA_OP_MODE: RSF Position  */\r
+#define ETHERNET_DMA_OP_MODE_RSF_Msk                          (0x01UL << ETHERNET_DMA_OP_MODE_RSF_Pos)                  /*!< ETHERNET DMA_OP_MODE: RSF Mask      */\r
+#define ETHERNET_DMA_OP_MODE_DT_Pos                           26                                                        /*!< ETHERNET DMA_OP_MODE: DT Position   */\r
+#define ETHERNET_DMA_OP_MODE_DT_Msk                           (0x01UL << ETHERNET_DMA_OP_MODE_DT_Pos)                   /*!< ETHERNET DMA_OP_MODE: DT Mask       */\r
+\r
+// -----------------------------------  ETHERNET_DMA_INT_EN  --------------------------------------\r
+#define ETHERNET_DMA_INT_EN_TIE_Pos                           0                                                         /*!< ETHERNET DMA_INT_EN: TIE Position   */\r
+#define ETHERNET_DMA_INT_EN_TIE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_TIE_Pos)                   /*!< ETHERNET DMA_INT_EN: TIE Mask       */\r
+#define ETHERNET_DMA_INT_EN_TSE_Pos                           1                                                         /*!< ETHERNET DMA_INT_EN: TSE Position   */\r
+#define ETHERNET_DMA_INT_EN_TSE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_TSE_Pos)                   /*!< ETHERNET DMA_INT_EN: TSE Mask       */\r
+#define ETHERNET_DMA_INT_EN_TUE_Pos                           2                                                         /*!< ETHERNET DMA_INT_EN: TUE Position   */\r
+#define ETHERNET_DMA_INT_EN_TUE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_TUE_Pos)                   /*!< ETHERNET DMA_INT_EN: TUE Mask       */\r
+#define ETHERNET_DMA_INT_EN_TJE_Pos                           3                                                         /*!< ETHERNET DMA_INT_EN: TJE Position   */\r
+#define ETHERNET_DMA_INT_EN_TJE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_TJE_Pos)                   /*!< ETHERNET DMA_INT_EN: TJE Mask       */\r
+#define ETHERNET_DMA_INT_EN_OVE_Pos                           4                                                         /*!< ETHERNET DMA_INT_EN: OVE Position   */\r
+#define ETHERNET_DMA_INT_EN_OVE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_OVE_Pos)                   /*!< ETHERNET DMA_INT_EN: OVE Mask       */\r
+#define ETHERNET_DMA_INT_EN_UNE_Pos                           5                                                         /*!< ETHERNET DMA_INT_EN: UNE Position   */\r
+#define ETHERNET_DMA_INT_EN_UNE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_UNE_Pos)                   /*!< ETHERNET DMA_INT_EN: UNE Mask       */\r
+#define ETHERNET_DMA_INT_EN_RIE_Pos                           6                                                         /*!< ETHERNET DMA_INT_EN: RIE Position   */\r
+#define ETHERNET_DMA_INT_EN_RIE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_RIE_Pos)                   /*!< ETHERNET DMA_INT_EN: RIE Mask       */\r
+#define ETHERNET_DMA_INT_EN_RUE_Pos                           7                                                         /*!< ETHERNET DMA_INT_EN: RUE Position   */\r
+#define ETHERNET_DMA_INT_EN_RUE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_RUE_Pos)                   /*!< ETHERNET DMA_INT_EN: RUE Mask       */\r
+#define ETHERNET_DMA_INT_EN_RSE_Pos                           8                                                         /*!< ETHERNET DMA_INT_EN: RSE Position   */\r
+#define ETHERNET_DMA_INT_EN_RSE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_RSE_Pos)                   /*!< ETHERNET DMA_INT_EN: RSE Mask       */\r
+#define ETHERNET_DMA_INT_EN_RWE_Pos                           9                                                         /*!< ETHERNET DMA_INT_EN: RWE Position   */\r
+#define ETHERNET_DMA_INT_EN_RWE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_RWE_Pos)                   /*!< ETHERNET DMA_INT_EN: RWE Mask       */\r
+#define ETHERNET_DMA_INT_EN_ETE_Pos                           10                                                        /*!< ETHERNET DMA_INT_EN: ETE Position   */\r
+#define ETHERNET_DMA_INT_EN_ETE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_ETE_Pos)                   /*!< ETHERNET DMA_INT_EN: ETE Mask       */\r
+#define ETHERNET_DMA_INT_EN_FBE_Pos                           13                                                        /*!< ETHERNET DMA_INT_EN: FBE Position   */\r
+#define ETHERNET_DMA_INT_EN_FBE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_FBE_Pos)                   /*!< ETHERNET DMA_INT_EN: FBE Mask       */\r
+#define ETHERNET_DMA_INT_EN_ERE_Pos                           14                                                        /*!< ETHERNET DMA_INT_EN: ERE Position   */\r
+#define ETHERNET_DMA_INT_EN_ERE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_ERE_Pos)                   /*!< ETHERNET DMA_INT_EN: ERE Mask       */\r
+#define ETHERNET_DMA_INT_EN_AIE_Pos                           15                                                        /*!< ETHERNET DMA_INT_EN: AIE Position   */\r
+#define ETHERNET_DMA_INT_EN_AIE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_AIE_Pos)                   /*!< ETHERNET DMA_INT_EN: AIE Mask       */\r
+#define ETHERNET_DMA_INT_EN_NIE_Pos                           16                                                        /*!< ETHERNET DMA_INT_EN: NIE Position   */\r
+#define ETHERNET_DMA_INT_EN_NIE_Msk                           (0x01UL << ETHERNET_DMA_INT_EN_NIE_Pos)                   /*!< ETHERNET DMA_INT_EN: NIE Mask       */\r
+\r
+// ---------------------------------  ETHERNET_DMA_MFRM_BUFOF  ------------------------------------\r
+#define ETHERNET_DMA_MFRM_BUFOF_FMC_Pos                       0                                                         /*!< ETHERNET DMA_MFRM_BUFOF: FMC Position */\r
+#define ETHERNET_DMA_MFRM_BUFOF_FMC_Msk                       (0x0000ffffUL << ETHERNET_DMA_MFRM_BUFOF_FMC_Pos)         /*!< ETHERNET DMA_MFRM_BUFOF: FMC Mask   */\r
+#define ETHERNET_DMA_MFRM_BUFOF_OC_Pos                        16                                                        /*!< ETHERNET DMA_MFRM_BUFOF: OC Position */\r
+#define ETHERNET_DMA_MFRM_BUFOF_OC_Msk                        (0x01UL << ETHERNET_DMA_MFRM_BUFOF_OC_Pos)                /*!< ETHERNET DMA_MFRM_BUFOF: OC Mask    */\r
+#define ETHERNET_DMA_MFRM_BUFOF_FMA_Pos                       17                                                        /*!< ETHERNET DMA_MFRM_BUFOF: FMA Position */\r
+#define ETHERNET_DMA_MFRM_BUFOF_FMA_Msk                       (0x000007ffUL << ETHERNET_DMA_MFRM_BUFOF_FMA_Pos)         /*!< ETHERNET DMA_MFRM_BUFOF: FMA Mask   */\r
+#define ETHERNET_DMA_MFRM_BUFOF_OF_Pos                        28                                                        /*!< ETHERNET DMA_MFRM_BUFOF: OF Position */\r
+#define ETHERNET_DMA_MFRM_BUFOF_OF_Msk                        (0x01UL << ETHERNET_DMA_MFRM_BUFOF_OF_Pos)                /*!< ETHERNET DMA_MFRM_BUFOF: OF Mask    */\r
+\r
+// --------------------------------  ETHERNET_DMA_REC_INT_WDT  ------------------------------------\r
+#define ETHERNET_DMA_REC_INT_WDT_RIWT_Pos                     0                                                         /*!< ETHERNET DMA_REC_INT_WDT: RIWT Position */\r
+#define ETHERNET_DMA_REC_INT_WDT_RIWT_Msk                     (0x000000ffUL << ETHERNET_DMA_REC_INT_WDT_RIWT_Pos)       /*!< ETHERNET DMA_REC_INT_WDT: RIWT Mask */\r
+\r
+// -----------------------------  ETHERNET_DMA_CURHOST_TRANS_DES  ---------------------------------\r
+#define ETHERNET_DMA_CURHOST_TRANS_DES_HTD_Pos                0                                                         /*!< ETHERNET DMA_CURHOST_TRANS_DES: HTD Position */\r
+#define ETHERNET_DMA_CURHOST_TRANS_DES_HTD_Msk                (0xffffffffUL << ETHERNET_DMA_CURHOST_TRANS_DES_HTD_Pos)  /*!< ETHERNET DMA_CURHOST_TRANS_DES: HTD Mask */\r
+\r
+// ------------------------------  ETHERNET_DMA_CURHOST_REC_DES  ----------------------------------\r
+#define ETHERNET_DMA_CURHOST_REC_DES_HRD_Pos                  0                                                         /*!< ETHERNET DMA_CURHOST_REC_DES: HRD Position */\r
+#define ETHERNET_DMA_CURHOST_REC_DES_HRD_Msk                  (0xffffffffUL << ETHERNET_DMA_CURHOST_REC_DES_HRD_Pos)    /*!< ETHERNET DMA_CURHOST_REC_DES: HRD Mask */\r
+\r
+// -----------------------------  ETHERNET_DMA_CURHOST_TRANS_BUF  ---------------------------------\r
+#define ETHERNET_DMA_CURHOST_TRANS_BUF_HTB_Pos                0                                                         /*!< ETHERNET DMA_CURHOST_TRANS_BUF: HTB Position */\r
+#define ETHERNET_DMA_CURHOST_TRANS_BUF_HTB_Msk                (0xffffffffUL << ETHERNET_DMA_CURHOST_TRANS_BUF_HTB_Pos)  /*!< ETHERNET DMA_CURHOST_TRANS_BUF: HTB Mask */\r
+\r
+// ------------------------------  ETHERNET_DMA_CURHOST_REC_BUF  ----------------------------------\r
+#define ETHERNET_DMA_CURHOST_REC_BUF_HRB_Pos                  0                                                         /*!< ETHERNET DMA_CURHOST_REC_BUF: HRB Position */\r
+#define ETHERNET_DMA_CURHOST_REC_BUF_HRB_Msk                  (0xffffffffUL << ETHERNET_DMA_CURHOST_REC_BUF_HRB_Pos)    /*!< ETHERNET DMA_CURHOST_REC_BUF: HRB Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                ATIMER Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------  ATIMER_DOWNCOUNTER  ---------------------------------------\r
+#define ATIMER_DOWNCOUNTER_CVAL_Pos                           0                                                         /*!< ATIMER DOWNCOUNTER: CVAL Position   */\r
+#define ATIMER_DOWNCOUNTER_CVAL_Msk                           (0x0000ffffUL << ATIMER_DOWNCOUNTER_CVAL_Pos)             /*!< ATIMER DOWNCOUNTER: CVAL Mask       */\r
+\r
+// --------------------------------------  ATIMER_PRESET  -----------------------------------------\r
+#define ATIMER_PRESET_PRESETVAL_Pos                           0                                                         /*!< ATIMER PRESET: PRESETVAL Position   */\r
+#define ATIMER_PRESET_PRESETVAL_Msk                           (0x0000ffffUL << ATIMER_PRESET_PRESETVAL_Pos)             /*!< ATIMER PRESET: PRESETVAL Mask       */\r
+\r
+// --------------------------------------  ATIMER_CLR_EN  -----------------------------------------\r
+#define ATIMER_CLR_EN_CLR_EN_Pos                              0                                                         /*!< ATIMER CLR_EN: CLR_EN Position      */\r
+#define ATIMER_CLR_EN_CLR_EN_Msk                              (0x01UL << ATIMER_CLR_EN_CLR_EN_Pos)                      /*!< ATIMER CLR_EN: CLR_EN Mask          */\r
+\r
+// --------------------------------------  ATIMER_SET_EN  -----------------------------------------\r
+#define ATIMER_SET_EN_SET_EN_Pos                              0                                                         /*!< ATIMER SET_EN: SET_EN Position      */\r
+#define ATIMER_SET_EN_SET_EN_Msk                              (0x01UL << ATIMER_SET_EN_SET_EN_Pos)                      /*!< ATIMER SET_EN: SET_EN Mask          */\r
+\r
+// --------------------------------------  ATIMER_STATUS  -----------------------------------------\r
+#define ATIMER_STATUS_STAT_Pos                                0                                                         /*!< ATIMER STATUS: STAT Position        */\r
+#define ATIMER_STATUS_STAT_Msk                                (0x01UL << ATIMER_STATUS_STAT_Pos)                        /*!< ATIMER STATUS: STAT Mask            */\r
+\r
+// --------------------------------------  ATIMER_ENABLE  -----------------------------------------\r
+#define ATIMER_ENABLE_EN_Pos                                  0                                                         /*!< ATIMER ENABLE: EN Position          */\r
+#define ATIMER_ENABLE_EN_Msk                                  (0x01UL << ATIMER_ENABLE_EN_Pos)                          /*!< ATIMER ENABLE: EN Mask              */\r
+\r
+// -------------------------------------  ATIMER_CLR_STAT  ----------------------------------------\r
+#define ATIMER_CLR_STAT_CSTAT_Pos                             0                                                         /*!< ATIMER CLR_STAT: CSTAT Position     */\r
+#define ATIMER_CLR_STAT_CSTAT_Msk                             (0x01UL << ATIMER_CLR_STAT_CSTAT_Pos)                     /*!< ATIMER CLR_STAT: CSTAT Mask         */\r
+\r
+// -------------------------------------  ATIMER_SET_STAT  ----------------------------------------\r
+#define ATIMER_SET_STAT_SSTAT_Pos                             0                                                         /*!< ATIMER SET_STAT: SSTAT Position     */\r
+#define ATIMER_SET_STAT_SSTAT_Msk                             (0x01UL << ATIMER_SET_STAT_SSTAT_Pos)                     /*!< ATIMER SET_STAT: SSTAT Mask         */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                REGFILE Position & Mask                               -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ------------------------------------  REGFILE_REGFILE0  ----------------------------------------\r
+#define REGFILE_REGFILE0_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE0: REGVAL Position   */\r
+#define REGFILE_REGFILE0_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE0_REGVAL_Pos)             /*!< REGFILE REGFILE0: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE1  ----------------------------------------\r
+#define REGFILE_REGFILE1_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE1: REGVAL Position   */\r
+#define REGFILE_REGFILE1_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE1_REGVAL_Pos)             /*!< REGFILE REGFILE1: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE2  ----------------------------------------\r
+#define REGFILE_REGFILE2_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE2: REGVAL Position   */\r
+#define REGFILE_REGFILE2_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE2_REGVAL_Pos)             /*!< REGFILE REGFILE2: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE3  ----------------------------------------\r
+#define REGFILE_REGFILE3_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE3: REGVAL Position   */\r
+#define REGFILE_REGFILE3_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE3_REGVAL_Pos)             /*!< REGFILE REGFILE3: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE4  ----------------------------------------\r
+#define REGFILE_REGFILE4_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE4: REGVAL Position   */\r
+#define REGFILE_REGFILE4_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE4_REGVAL_Pos)             /*!< REGFILE REGFILE4: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE5  ----------------------------------------\r
+#define REGFILE_REGFILE5_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE5: REGVAL Position   */\r
+#define REGFILE_REGFILE5_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE5_REGVAL_Pos)             /*!< REGFILE REGFILE5: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE6  ----------------------------------------\r
+#define REGFILE_REGFILE6_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE6: REGVAL Position   */\r
+#define REGFILE_REGFILE6_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE6_REGVAL_Pos)             /*!< REGFILE REGFILE6: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE7  ----------------------------------------\r
+#define REGFILE_REGFILE7_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE7: REGVAL Position   */\r
+#define REGFILE_REGFILE7_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE7_REGVAL_Pos)             /*!< REGFILE REGFILE7: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE8  ----------------------------------------\r
+#define REGFILE_REGFILE8_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE8: REGVAL Position   */\r
+#define REGFILE_REGFILE8_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE8_REGVAL_Pos)             /*!< REGFILE REGFILE8: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE9  ----------------------------------------\r
+#define REGFILE_REGFILE9_REGVAL_Pos                           0                                                         /*!< REGFILE REGFILE9: REGVAL Position   */\r
+#define REGFILE_REGFILE9_REGVAL_Msk                           (0xffffffffUL << REGFILE_REGFILE9_REGVAL_Pos)             /*!< REGFILE REGFILE9: REGVAL Mask       */\r
+\r
+// ------------------------------------  REGFILE_REGFILE10  ---------------------------------------\r
+#define REGFILE_REGFILE10_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE10: REGVAL Position  */\r
+#define REGFILE_REGFILE10_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE10_REGVAL_Pos)            /*!< REGFILE REGFILE10: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE11  ---------------------------------------\r
+#define REGFILE_REGFILE11_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE11: REGVAL Position  */\r
+#define REGFILE_REGFILE11_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE11_REGVAL_Pos)            /*!< REGFILE REGFILE11: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE12  ---------------------------------------\r
+#define REGFILE_REGFILE12_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE12: REGVAL Position  */\r
+#define REGFILE_REGFILE12_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE12_REGVAL_Pos)            /*!< REGFILE REGFILE12: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE13  ---------------------------------------\r
+#define REGFILE_REGFILE13_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE13: REGVAL Position  */\r
+#define REGFILE_REGFILE13_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE13_REGVAL_Pos)            /*!< REGFILE REGFILE13: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE14  ---------------------------------------\r
+#define REGFILE_REGFILE14_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE14: REGVAL Position  */\r
+#define REGFILE_REGFILE14_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE14_REGVAL_Pos)            /*!< REGFILE REGFILE14: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE15  ---------------------------------------\r
+#define REGFILE_REGFILE15_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE15: REGVAL Position  */\r
+#define REGFILE_REGFILE15_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE15_REGVAL_Pos)            /*!< REGFILE REGFILE15: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE16  ---------------------------------------\r
+#define REGFILE_REGFILE16_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE16: REGVAL Position  */\r
+#define REGFILE_REGFILE16_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE16_REGVAL_Pos)            /*!< REGFILE REGFILE16: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE17  ---------------------------------------\r
+#define REGFILE_REGFILE17_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE17: REGVAL Position  */\r
+#define REGFILE_REGFILE17_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE17_REGVAL_Pos)            /*!< REGFILE REGFILE17: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE18  ---------------------------------------\r
+#define REGFILE_REGFILE18_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE18: REGVAL Position  */\r
+#define REGFILE_REGFILE18_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE18_REGVAL_Pos)            /*!< REGFILE REGFILE18: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE19  ---------------------------------------\r
+#define REGFILE_REGFILE19_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE19: REGVAL Position  */\r
+#define REGFILE_REGFILE19_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE19_REGVAL_Pos)            /*!< REGFILE REGFILE19: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE20  ---------------------------------------\r
+#define REGFILE_REGFILE20_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE20: REGVAL Position  */\r
+#define REGFILE_REGFILE20_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE20_REGVAL_Pos)            /*!< REGFILE REGFILE20: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE21  ---------------------------------------\r
+#define REGFILE_REGFILE21_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE21: REGVAL Position  */\r
+#define REGFILE_REGFILE21_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE21_REGVAL_Pos)            /*!< REGFILE REGFILE21: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE22  ---------------------------------------\r
+#define REGFILE_REGFILE22_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE22: REGVAL Position  */\r
+#define REGFILE_REGFILE22_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE22_REGVAL_Pos)            /*!< REGFILE REGFILE22: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE23  ---------------------------------------\r
+#define REGFILE_REGFILE23_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE23: REGVAL Position  */\r
+#define REGFILE_REGFILE23_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE23_REGVAL_Pos)            /*!< REGFILE REGFILE23: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE24  ---------------------------------------\r
+#define REGFILE_REGFILE24_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE24: REGVAL Position  */\r
+#define REGFILE_REGFILE24_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE24_REGVAL_Pos)            /*!< REGFILE REGFILE24: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE25  ---------------------------------------\r
+#define REGFILE_REGFILE25_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE25: REGVAL Position  */\r
+#define REGFILE_REGFILE25_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE25_REGVAL_Pos)            /*!< REGFILE REGFILE25: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE26  ---------------------------------------\r
+#define REGFILE_REGFILE26_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE26: REGVAL Position  */\r
+#define REGFILE_REGFILE26_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE26_REGVAL_Pos)            /*!< REGFILE REGFILE26: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE27  ---------------------------------------\r
+#define REGFILE_REGFILE27_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE27: REGVAL Position  */\r
+#define REGFILE_REGFILE27_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE27_REGVAL_Pos)            /*!< REGFILE REGFILE27: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE28  ---------------------------------------\r
+#define REGFILE_REGFILE28_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE28: REGVAL Position  */\r
+#define REGFILE_REGFILE28_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE28_REGVAL_Pos)            /*!< REGFILE REGFILE28: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE29  ---------------------------------------\r
+#define REGFILE_REGFILE29_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE29: REGVAL Position  */\r
+#define REGFILE_REGFILE29_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE29_REGVAL_Pos)            /*!< REGFILE REGFILE29: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE30  ---------------------------------------\r
+#define REGFILE_REGFILE30_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE30: REGVAL Position  */\r
+#define REGFILE_REGFILE30_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE30_REGVAL_Pos)            /*!< REGFILE REGFILE30: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE31  ---------------------------------------\r
+#define REGFILE_REGFILE31_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE31: REGVAL Position  */\r
+#define REGFILE_REGFILE31_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE31_REGVAL_Pos)            /*!< REGFILE REGFILE31: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE32  ---------------------------------------\r
+#define REGFILE_REGFILE32_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE32: REGVAL Position  */\r
+#define REGFILE_REGFILE32_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE32_REGVAL_Pos)            /*!< REGFILE REGFILE32: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE33  ---------------------------------------\r
+#define REGFILE_REGFILE33_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE33: REGVAL Position  */\r
+#define REGFILE_REGFILE33_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE33_REGVAL_Pos)            /*!< REGFILE REGFILE33: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE34  ---------------------------------------\r
+#define REGFILE_REGFILE34_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE34: REGVAL Position  */\r
+#define REGFILE_REGFILE34_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE34_REGVAL_Pos)            /*!< REGFILE REGFILE34: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE35  ---------------------------------------\r
+#define REGFILE_REGFILE35_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE35: REGVAL Position  */\r
+#define REGFILE_REGFILE35_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE35_REGVAL_Pos)            /*!< REGFILE REGFILE35: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE36  ---------------------------------------\r
+#define REGFILE_REGFILE36_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE36: REGVAL Position  */\r
+#define REGFILE_REGFILE36_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE36_REGVAL_Pos)            /*!< REGFILE REGFILE36: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE37  ---------------------------------------\r
+#define REGFILE_REGFILE37_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE37: REGVAL Position  */\r
+#define REGFILE_REGFILE37_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE37_REGVAL_Pos)            /*!< REGFILE REGFILE37: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE38  ---------------------------------------\r
+#define REGFILE_REGFILE38_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE38: REGVAL Position  */\r
+#define REGFILE_REGFILE38_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE38_REGVAL_Pos)            /*!< REGFILE REGFILE38: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE39  ---------------------------------------\r
+#define REGFILE_REGFILE39_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE39: REGVAL Position  */\r
+#define REGFILE_REGFILE39_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE39_REGVAL_Pos)            /*!< REGFILE REGFILE39: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE40  ---------------------------------------\r
+#define REGFILE_REGFILE40_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE40: REGVAL Position  */\r
+#define REGFILE_REGFILE40_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE40_REGVAL_Pos)            /*!< REGFILE REGFILE40: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE41  ---------------------------------------\r
+#define REGFILE_REGFILE41_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE41: REGVAL Position  */\r
+#define REGFILE_REGFILE41_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE41_REGVAL_Pos)            /*!< REGFILE REGFILE41: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE42  ---------------------------------------\r
+#define REGFILE_REGFILE42_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE42: REGVAL Position  */\r
+#define REGFILE_REGFILE42_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE42_REGVAL_Pos)            /*!< REGFILE REGFILE42: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE43  ---------------------------------------\r
+#define REGFILE_REGFILE43_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE43: REGVAL Position  */\r
+#define REGFILE_REGFILE43_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE43_REGVAL_Pos)            /*!< REGFILE REGFILE43: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE44  ---------------------------------------\r
+#define REGFILE_REGFILE44_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE44: REGVAL Position  */\r
+#define REGFILE_REGFILE44_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE44_REGVAL_Pos)            /*!< REGFILE REGFILE44: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE45  ---------------------------------------\r
+#define REGFILE_REGFILE45_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE45: REGVAL Position  */\r
+#define REGFILE_REGFILE45_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE45_REGVAL_Pos)            /*!< REGFILE REGFILE45: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE46  ---------------------------------------\r
+#define REGFILE_REGFILE46_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE46: REGVAL Position  */\r
+#define REGFILE_REGFILE46_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE46_REGVAL_Pos)            /*!< REGFILE REGFILE46: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE47  ---------------------------------------\r
+#define REGFILE_REGFILE47_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE47: REGVAL Position  */\r
+#define REGFILE_REGFILE47_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE47_REGVAL_Pos)            /*!< REGFILE REGFILE47: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE48  ---------------------------------------\r
+#define REGFILE_REGFILE48_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE48: REGVAL Position  */\r
+#define REGFILE_REGFILE48_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE48_REGVAL_Pos)            /*!< REGFILE REGFILE48: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE49  ---------------------------------------\r
+#define REGFILE_REGFILE49_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE49: REGVAL Position  */\r
+#define REGFILE_REGFILE49_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE49_REGVAL_Pos)            /*!< REGFILE REGFILE49: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE50  ---------------------------------------\r
+#define REGFILE_REGFILE50_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE50: REGVAL Position  */\r
+#define REGFILE_REGFILE50_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE50_REGVAL_Pos)            /*!< REGFILE REGFILE50: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE51  ---------------------------------------\r
+#define REGFILE_REGFILE51_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE51: REGVAL Position  */\r
+#define REGFILE_REGFILE51_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE51_REGVAL_Pos)            /*!< REGFILE REGFILE51: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE52  ---------------------------------------\r
+#define REGFILE_REGFILE52_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE52: REGVAL Position  */\r
+#define REGFILE_REGFILE52_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE52_REGVAL_Pos)            /*!< REGFILE REGFILE52: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE53  ---------------------------------------\r
+#define REGFILE_REGFILE53_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE53: REGVAL Position  */\r
+#define REGFILE_REGFILE53_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE53_REGVAL_Pos)            /*!< REGFILE REGFILE53: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE54  ---------------------------------------\r
+#define REGFILE_REGFILE54_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE54: REGVAL Position  */\r
+#define REGFILE_REGFILE54_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE54_REGVAL_Pos)            /*!< REGFILE REGFILE54: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE55  ---------------------------------------\r
+#define REGFILE_REGFILE55_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE55: REGVAL Position  */\r
+#define REGFILE_REGFILE55_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE55_REGVAL_Pos)            /*!< REGFILE REGFILE55: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE56  ---------------------------------------\r
+#define REGFILE_REGFILE56_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE56: REGVAL Position  */\r
+#define REGFILE_REGFILE56_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE56_REGVAL_Pos)            /*!< REGFILE REGFILE56: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE57  ---------------------------------------\r
+#define REGFILE_REGFILE57_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE57: REGVAL Position  */\r
+#define REGFILE_REGFILE57_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE57_REGVAL_Pos)            /*!< REGFILE REGFILE57: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE58  ---------------------------------------\r
+#define REGFILE_REGFILE58_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE58: REGVAL Position  */\r
+#define REGFILE_REGFILE58_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE58_REGVAL_Pos)            /*!< REGFILE REGFILE58: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE59  ---------------------------------------\r
+#define REGFILE_REGFILE59_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE59: REGVAL Position  */\r
+#define REGFILE_REGFILE59_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE59_REGVAL_Pos)            /*!< REGFILE REGFILE59: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE60  ---------------------------------------\r
+#define REGFILE_REGFILE60_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE60: REGVAL Position  */\r
+#define REGFILE_REGFILE60_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE60_REGVAL_Pos)            /*!< REGFILE REGFILE60: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE61  ---------------------------------------\r
+#define REGFILE_REGFILE61_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE61: REGVAL Position  */\r
+#define REGFILE_REGFILE61_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE61_REGVAL_Pos)            /*!< REGFILE REGFILE61: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE62  ---------------------------------------\r
+#define REGFILE_REGFILE62_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE62: REGVAL Position  */\r
+#define REGFILE_REGFILE62_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE62_REGVAL_Pos)            /*!< REGFILE REGFILE62: REGVAL Mask      */\r
+\r
+// ------------------------------------  REGFILE_REGFILE63  ---------------------------------------\r
+#define REGFILE_REGFILE63_REGVAL_Pos                          0                                                         /*!< REGFILE REGFILE63: REGVAL Position  */\r
+#define REGFILE_REGFILE63_REGVAL_Msk                          (0xffffffffUL << REGFILE_REGFILE63_REGVAL_Pos)            /*!< REGFILE REGFILE63: REGVAL Mask      */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  PMC Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------  PMC_PD0_SLEEP0_HW_ENA  -------------------------------------\r
+#define PMC_PD0_SLEEP0_HW_ENA_ENA_EVENT0_Pos                  0                                                         /*!< PMC PD0_SLEEP0_HW_ENA: ENA_EVENT0 Position */\r
+#define PMC_PD0_SLEEP0_HW_ENA_ENA_EVENT0_Msk                  (0x01UL << PMC_PD0_SLEEP0_HW_ENA_ENA_EVENT0_Pos)          /*!< PMC PD0_SLEEP0_HW_ENA: ENA_EVENT0 Mask */\r
+\r
+// -----------------------------------  PMC_PD0_SLEEP0_MODE  --------------------------------------\r
+#define PMC_PD0_SLEEP0_MODE_PWR_STATE_Pos                     0                                                         /*!< PMC PD0_SLEEP0_MODE: PWR_STATE Position */\r
+#define PMC_PD0_SLEEP0_MODE_PWR_STATE_Msk                     (0xffffffffUL << PMC_PD0_SLEEP0_MODE_PWR_STATE_Pos)       /*!< PMC PD0_SLEEP0_MODE: PWR_STATE Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 CREG Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  CREG_IRCTRM  ------------------------------------------\r
+#define CREG_IRCTRM_TRM_Pos                                   0                                                         /*!< CREG IRCTRM: TRM Position           */\r
+#define CREG_IRCTRM_TRM_Msk                                   (0x00000fffUL << CREG_IRCTRM_TRM_Pos)                     /*!< CREG IRCTRM: TRM Mask               */\r
+\r
+// ---------------------------------------  CREG_CREG0  -------------------------------------------\r
+#define CREG_CREG0_EN1KHZ_Pos                                 0                                                         /*!< CREG CREG0: EN1KHZ Position         */\r
+#define CREG_CREG0_EN1KHZ_Msk                                 (0x01UL << CREG_CREG0_EN1KHZ_Pos)                         /*!< CREG CREG0: EN1KHZ Mask             */\r
+#define CREG_CREG0_EN32KHZ_Pos                                1                                                         /*!< CREG CREG0: EN32KHZ Position        */\r
+#define CREG_CREG0_EN32KHZ_Msk                                (0x01UL << CREG_CREG0_EN32KHZ_Pos)                        /*!< CREG CREG0: EN32KHZ Mask            */\r
+#define CREG_CREG0_RESET32KHZ_Pos                             2                                                         /*!< CREG CREG0: RESET32KHZ Position     */\r
+#define CREG_CREG0_RESET32KHZ_Msk                             (0x01UL << CREG_CREG0_RESET32KHZ_Pos)                     /*!< CREG CREG0: RESET32KHZ Mask         */\r
+#define CREG_CREG0_32KHZPD_Pos                                3                                                         /*!< CREG CREG0: 32KHZPD Position        */\r
+#define CREG_CREG0_32KHZPD_Msk                                (0x01UL << CREG_CREG0_32KHZPD_Pos)                        /*!< CREG CREG0: 32KHZPD Mask            */\r
+#define CREG_CREG0_USB0PHY_Pos                                5                                                         /*!< CREG CREG0: USB0PHY Position        */\r
+#define CREG_CREG0_USB0PHY_Msk                                (0x01UL << CREG_CREG0_USB0PHY_Pos)                        /*!< CREG CREG0: USB0PHY Mask            */\r
+#define CREG_CREG0_ALARMCTRL_Pos                              6                                                         /*!< CREG CREG0: ALARMCTRL Position      */\r
+#define CREG_CREG0_ALARMCTRL_Msk                              (0x03UL << CREG_CREG0_ALARMCTRL_Pos)                      /*!< CREG CREG0: ALARMCTRL Mask          */\r
+#define CREG_CREG0_BODLVL1_Pos                                8                                                         /*!< CREG CREG0: BODLVL1 Position        */\r
+#define CREG_CREG0_BODLVL1_Msk                                (0x03UL << CREG_CREG0_BODLVL1_Pos)                        /*!< CREG CREG0: BODLVL1 Mask            */\r
+#define CREG_CREG0_BODLVL2_Pos                                10                                                        /*!< CREG CREG0: BODLVL2 Position        */\r
+#define CREG_CREG0_BODLVL2_Msk                                (0x03UL << CREG_CREG0_BODLVL2_Pos)                        /*!< CREG CREG0: BODLVL2 Mask            */\r
+#define CREG_CREG0_WAKEUP0CTRL_Pos                            14                                                        /*!< CREG CREG0: WAKEUP0CTRL Position    */\r
+#define CREG_CREG0_WAKEUP0CTRL_Msk                            (0x03UL << CREG_CREG0_WAKEUP0CTRL_Pos)                    /*!< CREG CREG0: WAKEUP0CTRL Mask        */\r
+#define CREG_CREG0_WAKEUP1CTRL_Pos                            16                                                        /*!< CREG CREG0: WAKEUP1CTRL Position    */\r
+#define CREG_CREG0_WAKEUP1CTRL_Msk                            (0x03UL << CREG_CREG0_WAKEUP1CTRL_Pos)                    /*!< CREG CREG0: WAKEUP1CTRL Mask        */\r
+\r
+// ---------------------------------------  CREG_PMUCON  ------------------------------------------\r
+#define CREG_PMUCON_PWRCTRL_Pos                               0                                                         /*!< CREG PMUCON: PWRCTRL Position       */\r
+#define CREG_PMUCON_PWRCTRL_Msk                               (0x000001ffUL << CREG_PMUCON_PWRCTRL_Pos)                 /*!< CREG PMUCON: PWRCTRL Mask           */\r
+#define CREG_PMUCON_DYNAMICPWRCTRL_Pos                        15                                                        /*!< CREG PMUCON: DYNAMICPWRCTRL Position */\r
+#define CREG_PMUCON_DYNAMICPWRCTRL_Msk                        (0x01UL << CREG_PMUCON_DYNAMICPWRCTRL_Pos)                /*!< CREG PMUCON: DYNAMICPWRCTRL Mask    */\r
+\r
+// --------------------------------------  CREG_M3MEMMAP  -----------------------------------------\r
+#define CREG_M3MEMMAP_M3MAP_Pos                               12                                                        /*!< CREG M3MEMMAP: M3MAP Position       */\r
+#define CREG_M3MEMMAP_M3MAP_Msk                               (0x000fffffUL << CREG_M3MEMMAP_M3MAP_Pos)                 /*!< CREG M3MEMMAP: M3MAP Mask           */\r
+\r
+// ---------------------------------------  CREG_CREG5  -------------------------------------------\r
+#define CREG_CREG5_M3TAPSEL_Pos                               6                                                         /*!< CREG CREG5: M3TAPSEL Position       */\r
+#define CREG_CREG5_M3TAPSEL_Msk                               (0x01UL << CREG_CREG5_M3TAPSEL_Pos)                       /*!< CREG CREG5: M3TAPSEL Mask           */\r
+\r
+// ---------------------------------------  CREG_DMAMUX  ------------------------------------------\r
+#define CREG_DMAMUX_DMAMUXCH0_Pos                             0                                                         /*!< CREG DMAMUX: DMAMUXCH0 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH0_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH0_Pos)                     /*!< CREG DMAMUX: DMAMUXCH0 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH1_Pos                             2                                                         /*!< CREG DMAMUX: DMAMUXCH1 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH1_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH1_Pos)                     /*!< CREG DMAMUX: DMAMUXCH1 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH2_Pos                             4                                                         /*!< CREG DMAMUX: DMAMUXCH2 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH2_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH2_Pos)                     /*!< CREG DMAMUX: DMAMUXCH2 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH3_Pos                             6                                                         /*!< CREG DMAMUX: DMAMUXCH3 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH3_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH3_Pos)                     /*!< CREG DMAMUX: DMAMUXCH3 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH4_Pos                             8                                                         /*!< CREG DMAMUX: DMAMUXCH4 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH4_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH4_Pos)                     /*!< CREG DMAMUX: DMAMUXCH4 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH5_Pos                             10                                                        /*!< CREG DMAMUX: DMAMUXCH5 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH5_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH5_Pos)                     /*!< CREG DMAMUX: DMAMUXCH5 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH6_Pos                             12                                                        /*!< CREG DMAMUX: DMAMUXCH6 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH6_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH6_Pos)                     /*!< CREG DMAMUX: DMAMUXCH6 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH7_Pos                             14                                                        /*!< CREG DMAMUX: DMAMUXCH7 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH7_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH7_Pos)                     /*!< CREG DMAMUX: DMAMUXCH7 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH8_Pos                             16                                                        /*!< CREG DMAMUX: DMAMUXCH8 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH8_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH8_Pos)                     /*!< CREG DMAMUX: DMAMUXCH8 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH9_Pos                             18                                                        /*!< CREG DMAMUX: DMAMUXCH9 Position     */\r
+#define CREG_DMAMUX_DMAMUXCH9_Msk                             (0x03UL << CREG_DMAMUX_DMAMUXCH9_Pos)                     /*!< CREG DMAMUX: DMAMUXCH9 Mask         */\r
+#define CREG_DMAMUX_DMAMUXCH10_Pos                            20                                                        /*!< CREG DMAMUX: DMAMUXCH10 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH10_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH10_Pos)                    /*!< CREG DMAMUX: DMAMUXCH10 Mask        */\r
+#define CREG_DMAMUX_DMAMUXCH11_Pos                            22                                                        /*!< CREG DMAMUX: DMAMUXCH11 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH11_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH11_Pos)                    /*!< CREG DMAMUX: DMAMUXCH11 Mask        */\r
+#define CREG_DMAMUX_DMAMUXCH12_Pos                            24                                                        /*!< CREG DMAMUX: DMAMUXCH12 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH12_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH12_Pos)                    /*!< CREG DMAMUX: DMAMUXCH12 Mask        */\r
+#define CREG_DMAMUX_DMAMUXCH13_Pos                            26                                                        /*!< CREG DMAMUX: DMAMUXCH13 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH13_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH13_Pos)                    /*!< CREG DMAMUX: DMAMUXCH13 Mask        */\r
+#define CREG_DMAMUX_DMAMUXCH14_Pos                            28                                                        /*!< CREG DMAMUX: DMAMUXCH14 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH14_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH14_Pos)                    /*!< CREG DMAMUX: DMAMUXCH14 Mask        */\r
+#define CREG_DMAMUX_DMAMUXCH15_Pos                            30                                                        /*!< CREG DMAMUX: DMAMUXCH15 Position    */\r
+#define CREG_DMAMUX_DMAMUXCH15_Msk                            (0x03UL << CREG_DMAMUX_DMAMUXCH15_Pos)                    /*!< CREG DMAMUX: DMAMUXCH15 Mask        */\r
+\r
+// ---------------------------------------  CREG_ETBCFG  ------------------------------------------\r
+#define CREG_ETBCFG_ETB_Pos                                   0                                                         /*!< CREG ETBCFG: ETB Position           */\r
+#define CREG_ETBCFG_ETB_Msk                                   (0x01UL << CREG_ETBCFG_ETB_Pos)                           /*!< CREG ETBCFG: ETB Mask               */\r
+\r
+// ---------------------------------------  CREG_CREG6  -------------------------------------------\r
+#define CREG_CREG6_ETHMODE_Pos                                0                                                         /*!< CREG CREG6: ETHMODE Position        */\r
+#define CREG_CREG6_ETHMODE_Msk                                (0x07UL << CREG_CREG6_ETHMODE_Pos)                        /*!< CREG CREG6: ETHMODE Mask            */\r
+#define CREG_CREG6_TIMCTRL_Pos                                4                                                         /*!< CREG CREG6: TIMCTRL Position        */\r
+#define CREG_CREG6_TIMCTRL_Msk                                (0x01UL << CREG_CREG6_TIMCTRL_Pos)                        /*!< CREG CREG6: TIMCTRL Mask            */\r
+#define CREG_CREG6_I2S0_TX_SCK_IN_SEL_Pos                     12                                                        /*!< CREG CREG6: I2S0_TX_SCK_IN_SEL Position */\r
+#define CREG_CREG6_I2S0_TX_SCK_IN_SEL_Msk                     (0x01UL << CREG_CREG6_I2S0_TX_SCK_IN_SEL_Pos)             /*!< CREG CREG6: I2S0_TX_SCK_IN_SEL Mask */\r
+#define CREG_CREG6_I2S0_RX_SCK_IN_SEL_Pos                     13                                                        /*!< CREG CREG6: I2S0_RX_SCK_IN_SEL Position */\r
+#define CREG_CREG6_I2S0_RX_SCK_IN_SEL_Msk                     (0x01UL << CREG_CREG6_I2S0_RX_SCK_IN_SEL_Pos)             /*!< CREG CREG6: I2S0_RX_SCK_IN_SEL Mask */\r
+#define CREG_CREG6_I2S1_TX_SCK_IN_SEL_Pos                     14                                                        /*!< CREG CREG6: I2S1_TX_SCK_IN_SEL Position */\r
+#define CREG_CREG6_I2S1_TX_SCK_IN_SEL_Msk                     (0x01UL << CREG_CREG6_I2S1_TX_SCK_IN_SEL_Pos)             /*!< CREG CREG6: I2S1_TX_SCK_IN_SEL Mask */\r
+#define CREG_CREG6_I2S1_RX_SCK_IN_SEL_Pos                     15                                                        /*!< CREG CREG6: I2S1_RX_SCK_IN_SEL Position */\r
+#define CREG_CREG6_I2S1_RX_SCK_IN_SEL_Msk                     (0x01UL << CREG_CREG6_I2S1_RX_SCK_IN_SEL_Pos)             /*!< CREG CREG6: I2S1_RX_SCK_IN_SEL Mask */\r
+#define CREG_CREG6_EMC_CLK_SEL_Pos                            16                                                        /*!< CREG CREG6: EMC_CLK_SEL Position    */\r
+#define CREG_CREG6_EMC_CLK_SEL_Msk                            (0x01UL << CREG_CREG6_EMC_CLK_SEL_Pos)                    /*!< CREG CREG6: EMC_CLK_SEL Mask        */\r
+\r
+// ---------------------------------------  CREG_CHIPID  ------------------------------------------\r
+#define CREG_CHIPID_ID_Pos                                    0                                                         /*!< CREG CHIPID: ID Position            */\r
+#define CREG_CHIPID_ID_Msk                                    (0xffffffffUL << CREG_CHIPID_ID_Pos)                      /*!< CREG CHIPID: ID Mask                */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                              EVENTROUTER Position & Mask                             -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ------------------------------------  EVENTROUTER_HILO  ----------------------------------------\r
+#define EVENTROUTER_HILO_WAKEUP0_L_Pos                        0                                                         /*!< EVENTROUTER HILO: WAKEUP0_L Position */\r
+#define EVENTROUTER_HILO_WAKEUP0_L_Msk                        (0x01UL << EVENTROUTER_HILO_WAKEUP0_L_Pos)                /*!< EVENTROUTER HILO: WAKEUP0_L Mask    */\r
+#define EVENTROUTER_HILO_WAKEUP1_L_Pos                        1                                                         /*!< EVENTROUTER HILO: WAKEUP1_L Position */\r
+#define EVENTROUTER_HILO_WAKEUP1_L_Msk                        (0x01UL << EVENTROUTER_HILO_WAKEUP1_L_Pos)                /*!< EVENTROUTER HILO: WAKEUP1_L Mask    */\r
+#define EVENTROUTER_HILO_WAKEUP2_L_Pos                        2                                                         /*!< EVENTROUTER HILO: WAKEUP2_L Position */\r
+#define EVENTROUTER_HILO_WAKEUP2_L_Msk                        (0x01UL << EVENTROUTER_HILO_WAKEUP2_L_Pos)                /*!< EVENTROUTER HILO: WAKEUP2_L Mask    */\r
+#define EVENTROUTER_HILO_WAKEUP3_L_Pos                        3                                                         /*!< EVENTROUTER HILO: WAKEUP3_L Position */\r
+#define EVENTROUTER_HILO_WAKEUP3_L_Msk                        (0x01UL << EVENTROUTER_HILO_WAKEUP3_L_Pos)                /*!< EVENTROUTER HILO: WAKEUP3_L Mask    */\r
+#define EVENTROUTER_HILO_ATIMER_L_Pos                         4                                                         /*!< EVENTROUTER HILO: ATIMER_L Position */\r
+#define EVENTROUTER_HILO_ATIMER_L_Msk                         (0x01UL << EVENTROUTER_HILO_ATIMER_L_Pos)                 /*!< EVENTROUTER HILO: ATIMER_L Mask     */\r
+#define EVENTROUTER_HILO_RTC_L_Pos                            5                                                         /*!< EVENTROUTER HILO: RTC_L Position    */\r
+#define EVENTROUTER_HILO_RTC_L_Msk                            (0x01UL << EVENTROUTER_HILO_RTC_L_Pos)                    /*!< EVENTROUTER HILO: RTC_L Mask        */\r
+#define EVENTROUTER_HILO_BOD_L_Pos                            6                                                         /*!< EVENTROUTER HILO: BOD_L Position    */\r
+#define EVENTROUTER_HILO_BOD_L_Msk                            (0x01UL << EVENTROUTER_HILO_BOD_L_Pos)                    /*!< EVENTROUTER HILO: BOD_L Mask        */\r
+#define EVENTROUTER_HILO_WWDT_L_Pos                           7                                                         /*!< EVENTROUTER HILO: WWDT_L Position   */\r
+#define EVENTROUTER_HILO_WWDT_L_Msk                           (0x01UL << EVENTROUTER_HILO_WWDT_L_Pos)                   /*!< EVENTROUTER HILO: WWDT_L Mask       */\r
+#define EVENTROUTER_HILO_ETH_L_Pos                            8                                                         /*!< EVENTROUTER HILO: ETH_L Position    */\r
+#define EVENTROUTER_HILO_ETH_L_Msk                            (0x01UL << EVENTROUTER_HILO_ETH_L_Pos)                    /*!< EVENTROUTER HILO: ETH_L Mask        */\r
+#define EVENTROUTER_HILO_USB0_L_Pos                           9                                                         /*!< EVENTROUTER HILO: USB0_L Position   */\r
+#define EVENTROUTER_HILO_USB0_L_Msk                           (0x01UL << EVENTROUTER_HILO_USB0_L_Pos)                   /*!< EVENTROUTER HILO: USB0_L Mask       */\r
+#define EVENTROUTER_HILO_USB1_L_Pos                           10                                                        /*!< EVENTROUTER HILO: USB1_L Position   */\r
+#define EVENTROUTER_HILO_USB1_L_Msk                           (0x01UL << EVENTROUTER_HILO_USB1_L_Pos)                   /*!< EVENTROUTER HILO: USB1_L Mask       */\r
+#define EVENTROUTER_HILO_SDMMC_L_Pos                          11                                                        /*!< EVENTROUTER HILO: SDMMC_L Position  */\r
+#define EVENTROUTER_HILO_SDMMC_L_Msk                          (0x01UL << EVENTROUTER_HILO_SDMMC_L_Pos)                  /*!< EVENTROUTER HILO: SDMMC_L Mask      */\r
+#define EVENTROUTER_HILO_CAN_L_Pos                            12                                                        /*!< EVENTROUTER HILO: CAN_L Position    */\r
+#define EVENTROUTER_HILO_CAN_L_Msk                            (0x01UL << EVENTROUTER_HILO_CAN_L_Pos)                    /*!< EVENTROUTER HILO: CAN_L Mask        */\r
+#define EVENTROUTER_HILO_TIM2_L_Pos                           13                                                        /*!< EVENTROUTER HILO: TIM2_L Position   */\r
+#define EVENTROUTER_HILO_TIM2_L_Msk                           (0x01UL << EVENTROUTER_HILO_TIM2_L_Pos)                   /*!< EVENTROUTER HILO: TIM2_L Mask       */\r
+#define EVENTROUTER_HILO_TIM6_L_Pos                           14                                                        /*!< EVENTROUTER HILO: TIM6_L Position   */\r
+#define EVENTROUTER_HILO_TIM6_L_Msk                           (0x01UL << EVENTROUTER_HILO_TIM6_L_Pos)                   /*!< EVENTROUTER HILO: TIM6_L Mask       */\r
+#define EVENTROUTER_HILO_QEI_L_Pos                            15                                                        /*!< EVENTROUTER HILO: QEI_L Position    */\r
+#define EVENTROUTER_HILO_QEI_L_Msk                            (0x01UL << EVENTROUTER_HILO_QEI_L_Pos)                    /*!< EVENTROUTER HILO: QEI_L Mask        */\r
+#define EVENTROUTER_HILO_TIM14_L_Pos                          16                                                        /*!< EVENTROUTER HILO: TIM14_L Position  */\r
+#define EVENTROUTER_HILO_TIM14_L_Msk                          (0x01UL << EVENTROUTER_HILO_TIM14_L_Pos)                  /*!< EVENTROUTER HILO: TIM14_L Mask      */\r
+#define EVENTROUTER_HILO_RESET_L_Pos                          19                                                        /*!< EVENTROUTER HILO: RESET_L Position  */\r
+#define EVENTROUTER_HILO_RESET_L_Msk                          (0x01UL << EVENTROUTER_HILO_RESET_L_Pos)                  /*!< EVENTROUTER HILO: RESET_L Mask      */\r
+\r
+// ------------------------------------  EVENTROUTER_EDGE  ----------------------------------------\r
+#define EVENTROUTER_EDGE_WAKEUP0_E_Pos                        0                                                         /*!< EVENTROUTER EDGE: WAKEUP0_E Position */\r
+#define EVENTROUTER_EDGE_WAKEUP0_E_Msk                        (0x01UL << EVENTROUTER_EDGE_WAKEUP0_E_Pos)                /*!< EVENTROUTER EDGE: WAKEUP0_E Mask    */\r
+#define EVENTROUTER_EDGE_WAKEUP1_E_Pos                        1                                                         /*!< EVENTROUTER EDGE: WAKEUP1_E Position */\r
+#define EVENTROUTER_EDGE_WAKEUP1_E_Msk                        (0x01UL << EVENTROUTER_EDGE_WAKEUP1_E_Pos)                /*!< EVENTROUTER EDGE: WAKEUP1_E Mask    */\r
+#define EVENTROUTER_EDGE_WAKEUP2_E_Pos                        2                                                         /*!< EVENTROUTER EDGE: WAKEUP2_E Position */\r
+#define EVENTROUTER_EDGE_WAKEUP2_E_Msk                        (0x01UL << EVENTROUTER_EDGE_WAKEUP2_E_Pos)                /*!< EVENTROUTER EDGE: WAKEUP2_E Mask    */\r
+#define EVENTROUTER_EDGE_WAKEUP3_E_Pos                        3                                                         /*!< EVENTROUTER EDGE: WAKEUP3_E Position */\r
+#define EVENTROUTER_EDGE_WAKEUP3_E_Msk                        (0x01UL << EVENTROUTER_EDGE_WAKEUP3_E_Pos)                /*!< EVENTROUTER EDGE: WAKEUP3_E Mask    */\r
+#define EVENTROUTER_EDGE_ATIMER_E_Pos                         4                                                         /*!< EVENTROUTER EDGE: ATIMER_E Position */\r
+#define EVENTROUTER_EDGE_ATIMER_E_Msk                         (0x01UL << EVENTROUTER_EDGE_ATIMER_E_Pos)                 /*!< EVENTROUTER EDGE: ATIMER_E Mask     */\r
+#define EVENTROUTER_EDGE_RTC_E_Pos                            5                                                         /*!< EVENTROUTER EDGE: RTC_E Position    */\r
+#define EVENTROUTER_EDGE_RTC_E_Msk                            (0x01UL << EVENTROUTER_EDGE_RTC_E_Pos)                    /*!< EVENTROUTER EDGE: RTC_E Mask        */\r
+#define EVENTROUTER_EDGE_BOD_E_Pos                            6                                                         /*!< EVENTROUTER EDGE: BOD_E Position    */\r
+#define EVENTROUTER_EDGE_BOD_E_Msk                            (0x01UL << EVENTROUTER_EDGE_BOD_E_Pos)                    /*!< EVENTROUTER EDGE: BOD_E Mask        */\r
+#define EVENTROUTER_EDGE_WWDT_E_Pos                           7                                                         /*!< EVENTROUTER EDGE: WWDT_E Position   */\r
+#define EVENTROUTER_EDGE_WWDT_E_Msk                           (0x01UL << EVENTROUTER_EDGE_WWDT_E_Pos)                   /*!< EVENTROUTER EDGE: WWDT_E Mask       */\r
+#define EVENTROUTER_EDGE_ETH_E_Pos                            8                                                         /*!< EVENTROUTER EDGE: ETH_E Position    */\r
+#define EVENTROUTER_EDGE_ETH_E_Msk                            (0x01UL << EVENTROUTER_EDGE_ETH_E_Pos)                    /*!< EVENTROUTER EDGE: ETH_E Mask        */\r
+#define EVENTROUTER_EDGE_USB0_E_Pos                           9                                                         /*!< EVENTROUTER EDGE: USB0_E Position   */\r
+#define EVENTROUTER_EDGE_USB0_E_Msk                           (0x01UL << EVENTROUTER_EDGE_USB0_E_Pos)                   /*!< EVENTROUTER EDGE: USB0_E Mask       */\r
+#define EVENTROUTER_EDGE_USB1_E_Pos                           10                                                        /*!< EVENTROUTER EDGE: USB1_E Position   */\r
+#define EVENTROUTER_EDGE_USB1_E_Msk                           (0x01UL << EVENTROUTER_EDGE_USB1_E_Pos)                   /*!< EVENTROUTER EDGE: USB1_E Mask       */\r
+#define EVENTROUTER_EDGE_SDMMC_E_Pos                          11                                                        /*!< EVENTROUTER EDGE: SDMMC_E Position  */\r
+#define EVENTROUTER_EDGE_SDMMC_E_Msk                          (0x01UL << EVENTROUTER_EDGE_SDMMC_E_Pos)                  /*!< EVENTROUTER EDGE: SDMMC_E Mask      */\r
+#define EVENTROUTER_EDGE_CAN_E_Pos                            12                                                        /*!< EVENTROUTER EDGE: CAN_E Position    */\r
+#define EVENTROUTER_EDGE_CAN_E_Msk                            (0x01UL << EVENTROUTER_EDGE_CAN_E_Pos)                    /*!< EVENTROUTER EDGE: CAN_E Mask        */\r
+#define EVENTROUTER_EDGE_TIM2_E_Pos                           13                                                        /*!< EVENTROUTER EDGE: TIM2_E Position   */\r
+#define EVENTROUTER_EDGE_TIM2_E_Msk                           (0x01UL << EVENTROUTER_EDGE_TIM2_E_Pos)                   /*!< EVENTROUTER EDGE: TIM2_E Mask       */\r
+#define EVENTROUTER_EDGE_TIM6_E_Pos                           14                                                        /*!< EVENTROUTER EDGE: TIM6_E Position   */\r
+#define EVENTROUTER_EDGE_TIM6_E_Msk                           (0x01UL << EVENTROUTER_EDGE_TIM6_E_Pos)                   /*!< EVENTROUTER EDGE: TIM6_E Mask       */\r
+#define EVENTROUTER_EDGE_QEI_E_Pos                            15                                                        /*!< EVENTROUTER EDGE: QEI_E Position    */\r
+#define EVENTROUTER_EDGE_QEI_E_Msk                            (0x01UL << EVENTROUTER_EDGE_QEI_E_Pos)                    /*!< EVENTROUTER EDGE: QEI_E Mask        */\r
+#define EVENTROUTER_EDGE_TIM14_E_Pos                          16                                                        /*!< EVENTROUTER EDGE: TIM14_E Position  */\r
+#define EVENTROUTER_EDGE_TIM14_E_Msk                          (0x01UL << EVENTROUTER_EDGE_TIM14_E_Pos)                  /*!< EVENTROUTER EDGE: TIM14_E Mask      */\r
+#define EVENTROUTER_EDGE_RESET_E_Pos                          19                                                        /*!< EVENTROUTER EDGE: RESET_E Position  */\r
+#define EVENTROUTER_EDGE_RESET_E_Msk                          (0x01UL << EVENTROUTER_EDGE_RESET_E_Pos)                  /*!< EVENTROUTER EDGE: RESET_E Mask      */\r
+\r
+// -----------------------------------  EVENTROUTER_CLR_EN  ---------------------------------------\r
+#define EVENTROUTER_CLR_EN_WAKEUP0_CLREN_Pos                  0                                                         /*!< EVENTROUTER CLR_EN: WAKEUP0_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_WAKEUP0_CLREN_Msk                  (0x01UL << EVENTROUTER_CLR_EN_WAKEUP0_CLREN_Pos)          /*!< EVENTROUTER CLR_EN: WAKEUP0_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_WAKEUP1_CLREN_Pos                  1                                                         /*!< EVENTROUTER CLR_EN: WAKEUP1_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_WAKEUP1_CLREN_Msk                  (0x01UL << EVENTROUTER_CLR_EN_WAKEUP1_CLREN_Pos)          /*!< EVENTROUTER CLR_EN: WAKEUP1_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_WAKEUP2_CLREN_Pos                  2                                                         /*!< EVENTROUTER CLR_EN: WAKEUP2_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_WAKEUP2_CLREN_Msk                  (0x01UL << EVENTROUTER_CLR_EN_WAKEUP2_CLREN_Pos)          /*!< EVENTROUTER CLR_EN: WAKEUP2_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_WAKEUP3_CLREN_Pos                  3                                                         /*!< EVENTROUTER CLR_EN: WAKEUP3_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_WAKEUP3_CLREN_Msk                  (0x01UL << EVENTROUTER_CLR_EN_WAKEUP3_CLREN_Pos)          /*!< EVENTROUTER CLR_EN: WAKEUP3_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_ATIMER_CLREN_Pos                   4                                                         /*!< EVENTROUTER CLR_EN: ATIMER_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_ATIMER_CLREN_Msk                   (0x01UL << EVENTROUTER_CLR_EN_ATIMER_CLREN_Pos)           /*!< EVENTROUTER CLR_EN: ATIMER_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_RTC_CLREN_Pos                      5                                                         /*!< EVENTROUTER CLR_EN: RTC_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_RTC_CLREN_Msk                      (0x01UL << EVENTROUTER_CLR_EN_RTC_CLREN_Pos)              /*!< EVENTROUTER CLR_EN: RTC_CLREN Mask  */\r
+#define EVENTROUTER_CLR_EN_BOD_CLREN_Pos                      6                                                         /*!< EVENTROUTER CLR_EN: BOD_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_BOD_CLREN_Msk                      (0x01UL << EVENTROUTER_CLR_EN_BOD_CLREN_Pos)              /*!< EVENTROUTER CLR_EN: BOD_CLREN Mask  */\r
+#define EVENTROUTER_CLR_EN_WWDT_CLREN_Pos                     7                                                         /*!< EVENTROUTER CLR_EN: WWDT_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_WWDT_CLREN_Msk                     (0x01UL << EVENTROUTER_CLR_EN_WWDT_CLREN_Pos)             /*!< EVENTROUTER CLR_EN: WWDT_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_ETH_CLREN_Pos                      8                                                         /*!< EVENTROUTER CLR_EN: ETH_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_ETH_CLREN_Msk                      (0x01UL << EVENTROUTER_CLR_EN_ETH_CLREN_Pos)              /*!< EVENTROUTER CLR_EN: ETH_CLREN Mask  */\r
+#define EVENTROUTER_CLR_EN_USB0_CLREN_Pos                     9                                                         /*!< EVENTROUTER CLR_EN: USB0_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_USB0_CLREN_Msk                     (0x01UL << EVENTROUTER_CLR_EN_USB0_CLREN_Pos)             /*!< EVENTROUTER CLR_EN: USB0_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_USB1_CLREN_Pos                     10                                                        /*!< EVENTROUTER CLR_EN: USB1_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_USB1_CLREN_Msk                     (0x01UL << EVENTROUTER_CLR_EN_USB1_CLREN_Pos)             /*!< EVENTROUTER CLR_EN: USB1_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_SDMMC_CLREN_Pos                    11                                                        /*!< EVENTROUTER CLR_EN: SDMMC_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_SDMMC_CLREN_Msk                    (0x01UL << EVENTROUTER_CLR_EN_SDMMC_CLREN_Pos)            /*!< EVENTROUTER CLR_EN: SDMMC_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_CAN_CLREN_Pos                      12                                                        /*!< EVENTROUTER CLR_EN: CAN_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_CAN_CLREN_Msk                      (0x01UL << EVENTROUTER_CLR_EN_CAN_CLREN_Pos)              /*!< EVENTROUTER CLR_EN: CAN_CLREN Mask  */\r
+#define EVENTROUTER_CLR_EN_TIM2_CLREN_Pos                     13                                                        /*!< EVENTROUTER CLR_EN: TIM2_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_TIM2_CLREN_Msk                     (0x01UL << EVENTROUTER_CLR_EN_TIM2_CLREN_Pos)             /*!< EVENTROUTER CLR_EN: TIM2_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_TIM6_CLREN_Pos                     14                                                        /*!< EVENTROUTER CLR_EN: TIM6_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_TIM6_CLREN_Msk                     (0x01UL << EVENTROUTER_CLR_EN_TIM6_CLREN_Pos)             /*!< EVENTROUTER CLR_EN: TIM6_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_QEI_CLREN_Pos                      15                                                        /*!< EVENTROUTER CLR_EN: QEI_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_QEI_CLREN_Msk                      (0x01UL << EVENTROUTER_CLR_EN_QEI_CLREN_Pos)              /*!< EVENTROUTER CLR_EN: QEI_CLREN Mask  */\r
+#define EVENTROUTER_CLR_EN_TIM14_CLREN_Pos                    16                                                        /*!< EVENTROUTER CLR_EN: TIM14_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_TIM14_CLREN_Msk                    (0x01UL << EVENTROUTER_CLR_EN_TIM14_CLREN_Pos)            /*!< EVENTROUTER CLR_EN: TIM14_CLREN Mask */\r
+#define EVENTROUTER_CLR_EN_RESET_CLREN_Pos                    19                                                        /*!< EVENTROUTER CLR_EN: RESET_CLREN Position */\r
+#define EVENTROUTER_CLR_EN_RESET_CLREN_Msk                    (0x01UL << EVENTROUTER_CLR_EN_RESET_CLREN_Pos)            /*!< EVENTROUTER CLR_EN: RESET_CLREN Mask */\r
+\r
+// -----------------------------------  EVENTROUTER_SET_EN  ---------------------------------------\r
+#define EVENTROUTER_SET_EN_WAKEUP0_SETEN_Pos                  0                                                         /*!< EVENTROUTER SET_EN: WAKEUP0_SETEN Position */\r
+#define EVENTROUTER_SET_EN_WAKEUP0_SETEN_Msk                  (0x01UL << EVENTROUTER_SET_EN_WAKEUP0_SETEN_Pos)          /*!< EVENTROUTER SET_EN: WAKEUP0_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_WAKEUP1_SETEN_Pos                  1                                                         /*!< EVENTROUTER SET_EN: WAKEUP1_SETEN Position */\r
+#define EVENTROUTER_SET_EN_WAKEUP1_SETEN_Msk                  (0x01UL << EVENTROUTER_SET_EN_WAKEUP1_SETEN_Pos)          /*!< EVENTROUTER SET_EN: WAKEUP1_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_WAKEUP2_SETEN_Pos                  2                                                         /*!< EVENTROUTER SET_EN: WAKEUP2_SETEN Position */\r
+#define EVENTROUTER_SET_EN_WAKEUP2_SETEN_Msk                  (0x01UL << EVENTROUTER_SET_EN_WAKEUP2_SETEN_Pos)          /*!< EVENTROUTER SET_EN: WAKEUP2_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_WAKEUP3_SETEN_Pos                  3                                                         /*!< EVENTROUTER SET_EN: WAKEUP3_SETEN Position */\r
+#define EVENTROUTER_SET_EN_WAKEUP3_SETEN_Msk                  (0x01UL << EVENTROUTER_SET_EN_WAKEUP3_SETEN_Pos)          /*!< EVENTROUTER SET_EN: WAKEUP3_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_ATIMER_SETEN_Pos                   4                                                         /*!< EVENTROUTER SET_EN: ATIMER_SETEN Position */\r
+#define EVENTROUTER_SET_EN_ATIMER_SETEN_Msk                   (0x01UL << EVENTROUTER_SET_EN_ATIMER_SETEN_Pos)           /*!< EVENTROUTER SET_EN: ATIMER_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_RTC_SETEN_Pos                      5                                                         /*!< EVENTROUTER SET_EN: RTC_SETEN Position */\r
+#define EVENTROUTER_SET_EN_RTC_SETEN_Msk                      (0x01UL << EVENTROUTER_SET_EN_RTC_SETEN_Pos)              /*!< EVENTROUTER SET_EN: RTC_SETEN Mask  */\r
+#define EVENTROUTER_SET_EN_BOD_SETEN_Pos                      6                                                         /*!< EVENTROUTER SET_EN: BOD_SETEN Position */\r
+#define EVENTROUTER_SET_EN_BOD_SETEN_Msk                      (0x01UL << EVENTROUTER_SET_EN_BOD_SETEN_Pos)              /*!< EVENTROUTER SET_EN: BOD_SETEN Mask  */\r
+#define EVENTROUTER_SET_EN_WWDT_SETEN_Pos                     7                                                         /*!< EVENTROUTER SET_EN: WWDT_SETEN Position */\r
+#define EVENTROUTER_SET_EN_WWDT_SETEN_Msk                     (0x01UL << EVENTROUTER_SET_EN_WWDT_SETEN_Pos)             /*!< EVENTROUTER SET_EN: WWDT_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_ETH_SETEN_Pos                      8                                                         /*!< EVENTROUTER SET_EN: ETH_SETEN Position */\r
+#define EVENTROUTER_SET_EN_ETH_SETEN_Msk                      (0x01UL << EVENTROUTER_SET_EN_ETH_SETEN_Pos)              /*!< EVENTROUTER SET_EN: ETH_SETEN Mask  */\r
+#define EVENTROUTER_SET_EN_USB0_SETEN_Pos                     9                                                         /*!< EVENTROUTER SET_EN: USB0_SETEN Position */\r
+#define EVENTROUTER_SET_EN_USB0_SETEN_Msk                     (0x01UL << EVENTROUTER_SET_EN_USB0_SETEN_Pos)             /*!< EVENTROUTER SET_EN: USB0_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_USB1_SETEN_Pos                     10                                                        /*!< EVENTROUTER SET_EN: USB1_SETEN Position */\r
+#define EVENTROUTER_SET_EN_USB1_SETEN_Msk                     (0x01UL << EVENTROUTER_SET_EN_USB1_SETEN_Pos)             /*!< EVENTROUTER SET_EN: USB1_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_SDMMC_SETEN_Pos                    11                                                        /*!< EVENTROUTER SET_EN: SDMMC_SETEN Position */\r
+#define EVENTROUTER_SET_EN_SDMMC_SETEN_Msk                    (0x01UL << EVENTROUTER_SET_EN_SDMMC_SETEN_Pos)            /*!< EVENTROUTER SET_EN: SDMMC_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_CAN_SETEN_Pos                      12                                                        /*!< EVENTROUTER SET_EN: CAN_SETEN Position */\r
+#define EVENTROUTER_SET_EN_CAN_SETEN_Msk                      (0x01UL << EVENTROUTER_SET_EN_CAN_SETEN_Pos)              /*!< EVENTROUTER SET_EN: CAN_SETEN Mask  */\r
+#define EVENTROUTER_SET_EN_TIM2_SETEN_Pos                     13                                                        /*!< EVENTROUTER SET_EN: TIM2_SETEN Position */\r
+#define EVENTROUTER_SET_EN_TIM2_SETEN_Msk                     (0x01UL << EVENTROUTER_SET_EN_TIM2_SETEN_Pos)             /*!< EVENTROUTER SET_EN: TIM2_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_TIM6_SETEN_Pos                     14                                                        /*!< EVENTROUTER SET_EN: TIM6_SETEN Position */\r
+#define EVENTROUTER_SET_EN_TIM6_SETEN_Msk                     (0x01UL << EVENTROUTER_SET_EN_TIM6_SETEN_Pos)             /*!< EVENTROUTER SET_EN: TIM6_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_QEI_SETEN_Pos                      15                                                        /*!< EVENTROUTER SET_EN: QEI_SETEN Position */\r
+#define EVENTROUTER_SET_EN_QEI_SETEN_Msk                      (0x01UL << EVENTROUTER_SET_EN_QEI_SETEN_Pos)              /*!< EVENTROUTER SET_EN: QEI_SETEN Mask  */\r
+#define EVENTROUTER_SET_EN_TIM14_SETEN_Pos                    16                                                        /*!< EVENTROUTER SET_EN: TIM14_SETEN Position */\r
+#define EVENTROUTER_SET_EN_TIM14_SETEN_Msk                    (0x01UL << EVENTROUTER_SET_EN_TIM14_SETEN_Pos)            /*!< EVENTROUTER SET_EN: TIM14_SETEN Mask */\r
+#define EVENTROUTER_SET_EN_RESET_SETEN_Pos                    19                                                        /*!< EVENTROUTER SET_EN: RESET_SETEN Position */\r
+#define EVENTROUTER_SET_EN_RESET_SETEN_Msk                    (0x01UL << EVENTROUTER_SET_EN_RESET_SETEN_Pos)            /*!< EVENTROUTER SET_EN: RESET_SETEN Mask */\r
+\r
+// -----------------------------------  EVENTROUTER_STATUS  ---------------------------------------\r
+#define EVENTROUTER_STATUS_WAKEUP0_ST_Pos                     0                                                         /*!< EVENTROUTER STATUS: WAKEUP0_ST Position */\r
+#define EVENTROUTER_STATUS_WAKEUP0_ST_Msk                     (0x01UL << EVENTROUTER_STATUS_WAKEUP0_ST_Pos)             /*!< EVENTROUTER STATUS: WAKEUP0_ST Mask */\r
+#define EVENTROUTER_STATUS_WAKEUP1_ST_Pos                     1                                                         /*!< EVENTROUTER STATUS: WAKEUP1_ST Position */\r
+#define EVENTROUTER_STATUS_WAKEUP1_ST_Msk                     (0x01UL << EVENTROUTER_STATUS_WAKEUP1_ST_Pos)             /*!< EVENTROUTER STATUS: WAKEUP1_ST Mask */\r
+#define EVENTROUTER_STATUS_WAKEUP2_ST_Pos                     2                                                         /*!< EVENTROUTER STATUS: WAKEUP2_ST Position */\r
+#define EVENTROUTER_STATUS_WAKEUP2_ST_Msk                     (0x01UL << EVENTROUTER_STATUS_WAKEUP2_ST_Pos)             /*!< EVENTROUTER STATUS: WAKEUP2_ST Mask */\r
+#define EVENTROUTER_STATUS_WAKEUP3_ST_Pos                     3                                                         /*!< EVENTROUTER STATUS: WAKEUP3_ST Position */\r
+#define EVENTROUTER_STATUS_WAKEUP3_ST_Msk                     (0x01UL << EVENTROUTER_STATUS_WAKEUP3_ST_Pos)             /*!< EVENTROUTER STATUS: WAKEUP3_ST Mask */\r
+#define EVENTROUTER_STATUS_ATIMER_ST_Pos                      4                                                         /*!< EVENTROUTER STATUS: ATIMER_ST Position */\r
+#define EVENTROUTER_STATUS_ATIMER_ST_Msk                      (0x01UL << EVENTROUTER_STATUS_ATIMER_ST_Pos)              /*!< EVENTROUTER STATUS: ATIMER_ST Mask  */\r
+#define EVENTROUTER_STATUS_RTC_ST_Pos                         5                                                         /*!< EVENTROUTER STATUS: RTC_ST Position */\r
+#define EVENTROUTER_STATUS_RTC_ST_Msk                         (0x01UL << EVENTROUTER_STATUS_RTC_ST_Pos)                 /*!< EVENTROUTER STATUS: RTC_ST Mask     */\r
+#define EVENTROUTER_STATUS_BOD_ST_Pos                         6                                                         /*!< EVENTROUTER STATUS: BOD_ST Position */\r
+#define EVENTROUTER_STATUS_BOD_ST_Msk                         (0x01UL << EVENTROUTER_STATUS_BOD_ST_Pos)                 /*!< EVENTROUTER STATUS: BOD_ST Mask     */\r
+#define EVENTROUTER_STATUS_WWDT_ST_Pos                        7                                                         /*!< EVENTROUTER STATUS: WWDT_ST Position */\r
+#define EVENTROUTER_STATUS_WWDT_ST_Msk                        (0x01UL << EVENTROUTER_STATUS_WWDT_ST_Pos)                /*!< EVENTROUTER STATUS: WWDT_ST Mask    */\r
+#define EVENTROUTER_STATUS_ETH_ST_Pos                         8                                                         /*!< EVENTROUTER STATUS: ETH_ST Position */\r
+#define EVENTROUTER_STATUS_ETH_ST_Msk                         (0x01UL << EVENTROUTER_STATUS_ETH_ST_Pos)                 /*!< EVENTROUTER STATUS: ETH_ST Mask     */\r
+#define EVENTROUTER_STATUS_USB0_ST_Pos                        9                                                         /*!< EVENTROUTER STATUS: USB0_ST Position */\r
+#define EVENTROUTER_STATUS_USB0_ST_Msk                        (0x01UL << EVENTROUTER_STATUS_USB0_ST_Pos)                /*!< EVENTROUTER STATUS: USB0_ST Mask    */\r
+#define EVENTROUTER_STATUS_USB1_ST_Pos                        10                                                        /*!< EVENTROUTER STATUS: USB1_ST Position */\r
+#define EVENTROUTER_STATUS_USB1_ST_Msk                        (0x01UL << EVENTROUTER_STATUS_USB1_ST_Pos)                /*!< EVENTROUTER STATUS: USB1_ST Mask    */\r
+#define EVENTROUTER_STATUS_SDMMC_ST_Pos                       11                                                        /*!< EVENTROUTER STATUS: SDMMC_ST Position */\r
+#define EVENTROUTER_STATUS_SDMMC_ST_Msk                       (0x01UL << EVENTROUTER_STATUS_SDMMC_ST_Pos)               /*!< EVENTROUTER STATUS: SDMMC_ST Mask   */\r
+#define EVENTROUTER_STATUS_CAN_ST_Pos                         12                                                        /*!< EVENTROUTER STATUS: CAN_ST Position */\r
+#define EVENTROUTER_STATUS_CAN_ST_Msk                         (0x01UL << EVENTROUTER_STATUS_CAN_ST_Pos)                 /*!< EVENTROUTER STATUS: CAN_ST Mask     */\r
+#define EVENTROUTER_STATUS_TIM2_ST_Pos                        13                                                        /*!< EVENTROUTER STATUS: TIM2_ST Position */\r
+#define EVENTROUTER_STATUS_TIM2_ST_Msk                        (0x01UL << EVENTROUTER_STATUS_TIM2_ST_Pos)                /*!< EVENTROUTER STATUS: TIM2_ST Mask    */\r
+#define EVENTROUTER_STATUS_TIM6_ST_Pos                        14                                                        /*!< EVENTROUTER STATUS: TIM6_ST Position */\r
+#define EVENTROUTER_STATUS_TIM6_ST_Msk                        (0x01UL << EVENTROUTER_STATUS_TIM6_ST_Pos)                /*!< EVENTROUTER STATUS: TIM6_ST Mask    */\r
+#define EVENTROUTER_STATUS_QEI_ST_Pos                         15                                                        /*!< EVENTROUTER STATUS: QEI_ST Position */\r
+#define EVENTROUTER_STATUS_QEI_ST_Msk                         (0x01UL << EVENTROUTER_STATUS_QEI_ST_Pos)                 /*!< EVENTROUTER STATUS: QEI_ST Mask     */\r
+#define EVENTROUTER_STATUS_TIM14_ST_Pos                       16                                                        /*!< EVENTROUTER STATUS: TIM14_ST Position */\r
+#define EVENTROUTER_STATUS_TIM14_ST_Msk                       (0x01UL << EVENTROUTER_STATUS_TIM14_ST_Pos)               /*!< EVENTROUTER STATUS: TIM14_ST Mask   */\r
+#define EVENTROUTER_STATUS_RESET_ST_Pos                       19                                                        /*!< EVENTROUTER STATUS: RESET_ST Position */\r
+#define EVENTROUTER_STATUS_RESET_ST_Msk                       (0x01UL << EVENTROUTER_STATUS_RESET_ST_Pos)               /*!< EVENTROUTER STATUS: RESET_ST Mask   */\r
+\r
+// -----------------------------------  EVENTROUTER_ENABLE  ---------------------------------------\r
+#define EVENTROUTER_ENABLE_WAKEUP0_EN_Pos                     0                                                         /*!< EVENTROUTER ENABLE: WAKEUP0_EN Position */\r
+#define EVENTROUTER_ENABLE_WAKEUP0_EN_Msk                     (0x01UL << EVENTROUTER_ENABLE_WAKEUP0_EN_Pos)             /*!< EVENTROUTER ENABLE: WAKEUP0_EN Mask */\r
+#define EVENTROUTER_ENABLE_WAKEUP1_EN_Pos                     1                                                         /*!< EVENTROUTER ENABLE: WAKEUP1_EN Position */\r
+#define EVENTROUTER_ENABLE_WAKEUP1_EN_Msk                     (0x01UL << EVENTROUTER_ENABLE_WAKEUP1_EN_Pos)             /*!< EVENTROUTER ENABLE: WAKEUP1_EN Mask */\r
+#define EVENTROUTER_ENABLE_WAKEUP2_EN_Pos                     2                                                         /*!< EVENTROUTER ENABLE: WAKEUP2_EN Position */\r
+#define EVENTROUTER_ENABLE_WAKEUP2_EN_Msk                     (0x01UL << EVENTROUTER_ENABLE_WAKEUP2_EN_Pos)             /*!< EVENTROUTER ENABLE: WAKEUP2_EN Mask */\r
+#define EVENTROUTER_ENABLE_WAKEUP3_EN_Pos                     3                                                         /*!< EVENTROUTER ENABLE: WAKEUP3_EN Position */\r
+#define EVENTROUTER_ENABLE_WAKEUP3_EN_Msk                     (0x01UL << EVENTROUTER_ENABLE_WAKEUP3_EN_Pos)             /*!< EVENTROUTER ENABLE: WAKEUP3_EN Mask */\r
+#define EVENTROUTER_ENABLE_ATIMER_EN_Pos                      4                                                         /*!< EVENTROUTER ENABLE: ATIMER_EN Position */\r
+#define EVENTROUTER_ENABLE_ATIMER_EN_Msk                      (0x01UL << EVENTROUTER_ENABLE_ATIMER_EN_Pos)              /*!< EVENTROUTER ENABLE: ATIMER_EN Mask  */\r
+#define EVENTROUTER_ENABLE_RTC_EN_Pos                         5                                                         /*!< EVENTROUTER ENABLE: RTC_EN Position */\r
+#define EVENTROUTER_ENABLE_RTC_EN_Msk                         (0x01UL << EVENTROUTER_ENABLE_RTC_EN_Pos)                 /*!< EVENTROUTER ENABLE: RTC_EN Mask     */\r
+#define EVENTROUTER_ENABLE_BOD_EN_Pos                         6                                                         /*!< EVENTROUTER ENABLE: BOD_EN Position */\r
+#define EVENTROUTER_ENABLE_BOD_EN_Msk                         (0x01UL << EVENTROUTER_ENABLE_BOD_EN_Pos)                 /*!< EVENTROUTER ENABLE: BOD_EN Mask     */\r
+#define EVENTROUTER_ENABLE_WWDT_EN_Pos                        7                                                         /*!< EVENTROUTER ENABLE: WWDT_EN Position */\r
+#define EVENTROUTER_ENABLE_WWDT_EN_Msk                        (0x01UL << EVENTROUTER_ENABLE_WWDT_EN_Pos)                /*!< EVENTROUTER ENABLE: WWDT_EN Mask    */\r
+#define EVENTROUTER_ENABLE_ETH_EN_Pos                         8                                                         /*!< EVENTROUTER ENABLE: ETH_EN Position */\r
+#define EVENTROUTER_ENABLE_ETH_EN_Msk                         (0x01UL << EVENTROUTER_ENABLE_ETH_EN_Pos)                 /*!< EVENTROUTER ENABLE: ETH_EN Mask     */\r
+#define EVENTROUTER_ENABLE_USB0_EN_Pos                        9                                                         /*!< EVENTROUTER ENABLE: USB0_EN Position */\r
+#define EVENTROUTER_ENABLE_USB0_EN_Msk                        (0x01UL << EVENTROUTER_ENABLE_USB0_EN_Pos)                /*!< EVENTROUTER ENABLE: USB0_EN Mask    */\r
+#define EVENTROUTER_ENABLE_USB1_EN_Pos                        10                                                        /*!< EVENTROUTER ENABLE: USB1_EN Position */\r
+#define EVENTROUTER_ENABLE_USB1_EN_Msk                        (0x01UL << EVENTROUTER_ENABLE_USB1_EN_Pos)                /*!< EVENTROUTER ENABLE: USB1_EN Mask    */\r
+#define EVENTROUTER_ENABLE_SDMMC_EN_Pos                       11                                                        /*!< EVENTROUTER ENABLE: SDMMC_EN Position */\r
+#define EVENTROUTER_ENABLE_SDMMC_EN_Msk                       (0x01UL << EVENTROUTER_ENABLE_SDMMC_EN_Pos)               /*!< EVENTROUTER ENABLE: SDMMC_EN Mask   */\r
+#define EVENTROUTER_ENABLE_CAN_EN_Pos                         12                                                        /*!< EVENTROUTER ENABLE: CAN_EN Position */\r
+#define EVENTROUTER_ENABLE_CAN_EN_Msk                         (0x01UL << EVENTROUTER_ENABLE_CAN_EN_Pos)                 /*!< EVENTROUTER ENABLE: CAN_EN Mask     */\r
+#define EVENTROUTER_ENABLE_TIM2_EN_Pos                        13                                                        /*!< EVENTROUTER ENABLE: TIM2_EN Position */\r
+#define EVENTROUTER_ENABLE_TIM2_EN_Msk                        (0x01UL << EVENTROUTER_ENABLE_TIM2_EN_Pos)                /*!< EVENTROUTER ENABLE: TIM2_EN Mask    */\r
+#define EVENTROUTER_ENABLE_TIM6_EN_Pos                        14                                                        /*!< EVENTROUTER ENABLE: TIM6_EN Position */\r
+#define EVENTROUTER_ENABLE_TIM6_EN_Msk                        (0x01UL << EVENTROUTER_ENABLE_TIM6_EN_Pos)                /*!< EVENTROUTER ENABLE: TIM6_EN Mask    */\r
+#define EVENTROUTER_ENABLE_QEI_EN_Pos                         15                                                        /*!< EVENTROUTER ENABLE: QEI_EN Position */\r
+#define EVENTROUTER_ENABLE_QEI_EN_Msk                         (0x01UL << EVENTROUTER_ENABLE_QEI_EN_Pos)                 /*!< EVENTROUTER ENABLE: QEI_EN Mask     */\r
+#define EVENTROUTER_ENABLE_TIM14_EN_Pos                       16                                                        /*!< EVENTROUTER ENABLE: TIM14_EN Position */\r
+#define EVENTROUTER_ENABLE_TIM14_EN_Msk                       (0x01UL << EVENTROUTER_ENABLE_TIM14_EN_Pos)               /*!< EVENTROUTER ENABLE: TIM14_EN Mask   */\r
+#define EVENTROUTER_ENABLE_RESET_EN_Pos                       19                                                        /*!< EVENTROUTER ENABLE: RESET_EN Position */\r
+#define EVENTROUTER_ENABLE_RESET_EN_Msk                       (0x01UL << EVENTROUTER_ENABLE_RESET_EN_Pos)               /*!< EVENTROUTER ENABLE: RESET_EN Mask   */\r
+\r
+// ----------------------------------  EVENTROUTER_CLR_STAT  --------------------------------------\r
+#define EVENTROUTER_CLR_STAT_WAKEUP0_CLRST_Pos                0                                                         /*!< EVENTROUTER CLR_STAT: WAKEUP0_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP0_CLRST_Msk                (0x01UL << EVENTROUTER_CLR_STAT_WAKEUP0_CLRST_Pos)        /*!< EVENTROUTER CLR_STAT: WAKEUP0_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP1_CLRST_Pos                1                                                         /*!< EVENTROUTER CLR_STAT: WAKEUP1_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP1_CLRST_Msk                (0x01UL << EVENTROUTER_CLR_STAT_WAKEUP1_CLRST_Pos)        /*!< EVENTROUTER CLR_STAT: WAKEUP1_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP2_CLRST_Pos                2                                                         /*!< EVENTROUTER CLR_STAT: WAKEUP2_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP2_CLRST_Msk                (0x01UL << EVENTROUTER_CLR_STAT_WAKEUP2_CLRST_Pos)        /*!< EVENTROUTER CLR_STAT: WAKEUP2_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP3_CLRST_Pos                3                                                         /*!< EVENTROUTER CLR_STAT: WAKEUP3_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_WAKEUP3_CLRST_Msk                (0x01UL << EVENTROUTER_CLR_STAT_WAKEUP3_CLRST_Pos)        /*!< EVENTROUTER CLR_STAT: WAKEUP3_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_ATIMER_CLRST_Pos                 4                                                         /*!< EVENTROUTER CLR_STAT: ATIMER_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_ATIMER_CLRST_Msk                 (0x01UL << EVENTROUTER_CLR_STAT_ATIMER_CLRST_Pos)         /*!< EVENTROUTER CLR_STAT: ATIMER_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_RTC_CLRST_Pos                    5                                                         /*!< EVENTROUTER CLR_STAT: RTC_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_RTC_CLRST_Msk                    (0x01UL << EVENTROUTER_CLR_STAT_RTC_CLRST_Pos)            /*!< EVENTROUTER CLR_STAT: RTC_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_BOD_CLRST_Pos                    6                                                         /*!< EVENTROUTER CLR_STAT: BOD_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_BOD_CLRST_Msk                    (0x01UL << EVENTROUTER_CLR_STAT_BOD_CLRST_Pos)            /*!< EVENTROUTER CLR_STAT: BOD_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_WWDT_CLRST_Pos                   7                                                         /*!< EVENTROUTER CLR_STAT: WWDT_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_WWDT_CLRST_Msk                   (0x01UL << EVENTROUTER_CLR_STAT_WWDT_CLRST_Pos)           /*!< EVENTROUTER CLR_STAT: WWDT_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_ETH_CLRST_Pos                    8                                                         /*!< EVENTROUTER CLR_STAT: ETH_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_ETH_CLRST_Msk                    (0x01UL << EVENTROUTER_CLR_STAT_ETH_CLRST_Pos)            /*!< EVENTROUTER CLR_STAT: ETH_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_USB0_CLRST_Pos                   9                                                         /*!< EVENTROUTER CLR_STAT: USB0_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_USB0_CLRST_Msk                   (0x01UL << EVENTROUTER_CLR_STAT_USB0_CLRST_Pos)           /*!< EVENTROUTER CLR_STAT: USB0_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_USB1_CLRST_Pos                   10                                                        /*!< EVENTROUTER CLR_STAT: USB1_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_USB1_CLRST_Msk                   (0x01UL << EVENTROUTER_CLR_STAT_USB1_CLRST_Pos)           /*!< EVENTROUTER CLR_STAT: USB1_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_SDMMC_CLRST_Pos                  11                                                        /*!< EVENTROUTER CLR_STAT: SDMMC_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_SDMMC_CLRST_Msk                  (0x01UL << EVENTROUTER_CLR_STAT_SDMMC_CLRST_Pos)          /*!< EVENTROUTER CLR_STAT: SDMMC_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_CAN_CLRST_Pos                    12                                                        /*!< EVENTROUTER CLR_STAT: CAN_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_CAN_CLRST_Msk                    (0x01UL << EVENTROUTER_CLR_STAT_CAN_CLRST_Pos)            /*!< EVENTROUTER CLR_STAT: CAN_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_TIM2_CLRST_Pos                   13                                                        /*!< EVENTROUTER CLR_STAT: TIM2_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_TIM2_CLRST_Msk                   (0x01UL << EVENTROUTER_CLR_STAT_TIM2_CLRST_Pos)           /*!< EVENTROUTER CLR_STAT: TIM2_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_TIM6_CLRST_Pos                   14                                                        /*!< EVENTROUTER CLR_STAT: TIM6_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_TIM6_CLRST_Msk                   (0x01UL << EVENTROUTER_CLR_STAT_TIM6_CLRST_Pos)           /*!< EVENTROUTER CLR_STAT: TIM6_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_QEI_CLRST_Pos                    15                                                        /*!< EVENTROUTER CLR_STAT: QEI_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_QEI_CLRST_Msk                    (0x01UL << EVENTROUTER_CLR_STAT_QEI_CLRST_Pos)            /*!< EVENTROUTER CLR_STAT: QEI_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_TIM14_CLRST_Pos                  16                                                        /*!< EVENTROUTER CLR_STAT: TIM14_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_TIM14_CLRST_Msk                  (0x01UL << EVENTROUTER_CLR_STAT_TIM14_CLRST_Pos)          /*!< EVENTROUTER CLR_STAT: TIM14_CLRST Mask */\r
+#define EVENTROUTER_CLR_STAT_RESET_CLRST_Pos                  19                                                        /*!< EVENTROUTER CLR_STAT: RESET_CLRST Position */\r
+#define EVENTROUTER_CLR_STAT_RESET_CLRST_Msk                  (0x01UL << EVENTROUTER_CLR_STAT_RESET_CLRST_Pos)          /*!< EVENTROUTER CLR_STAT: RESET_CLRST Mask */\r
+\r
+// ----------------------------------  EVENTROUTER_SET_STAT  --------------------------------------\r
+#define EVENTROUTER_SET_STAT_WAKEUP0_SETST_Pos                0                                                         /*!< EVENTROUTER SET_STAT: WAKEUP0_SETST Position */\r
+#define EVENTROUTER_SET_STAT_WAKEUP0_SETST_Msk                (0x01UL << EVENTROUTER_SET_STAT_WAKEUP0_SETST_Pos)        /*!< EVENTROUTER SET_STAT: WAKEUP0_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_WAKEUP1_SETST_Pos                1                                                         /*!< EVENTROUTER SET_STAT: WAKEUP1_SETST Position */\r
+#define EVENTROUTER_SET_STAT_WAKEUP1_SETST_Msk                (0x01UL << EVENTROUTER_SET_STAT_WAKEUP1_SETST_Pos)        /*!< EVENTROUTER SET_STAT: WAKEUP1_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_WAKEUP2_SETST_Pos                2                                                         /*!< EVENTROUTER SET_STAT: WAKEUP2_SETST Position */\r
+#define EVENTROUTER_SET_STAT_WAKEUP2_SETST_Msk                (0x01UL << EVENTROUTER_SET_STAT_WAKEUP2_SETST_Pos)        /*!< EVENTROUTER SET_STAT: WAKEUP2_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_WAKEUP3_SETST_Pos                3                                                         /*!< EVENTROUTER SET_STAT: WAKEUP3_SETST Position */\r
+#define EVENTROUTER_SET_STAT_WAKEUP3_SETST_Msk                (0x01UL << EVENTROUTER_SET_STAT_WAKEUP3_SETST_Pos)        /*!< EVENTROUTER SET_STAT: WAKEUP3_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_ATIMER_SETST_Pos                 4                                                         /*!< EVENTROUTER SET_STAT: ATIMER_SETST Position */\r
+#define EVENTROUTER_SET_STAT_ATIMER_SETST_Msk                 (0x01UL << EVENTROUTER_SET_STAT_ATIMER_SETST_Pos)         /*!< EVENTROUTER SET_STAT: ATIMER_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_RTC_SETST_Pos                    5                                                         /*!< EVENTROUTER SET_STAT: RTC_SETST Position */\r
+#define EVENTROUTER_SET_STAT_RTC_SETST_Msk                    (0x01UL << EVENTROUTER_SET_STAT_RTC_SETST_Pos)            /*!< EVENTROUTER SET_STAT: RTC_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_BOD_SETST_Pos                    6                                                         /*!< EVENTROUTER SET_STAT: BOD_SETST Position */\r
+#define EVENTROUTER_SET_STAT_BOD_SETST_Msk                    (0x01UL << EVENTROUTER_SET_STAT_BOD_SETST_Pos)            /*!< EVENTROUTER SET_STAT: BOD_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_WWDT_SETST_Pos                   7                                                         /*!< EVENTROUTER SET_STAT: WWDT_SETST Position */\r
+#define EVENTROUTER_SET_STAT_WWDT_SETST_Msk                   (0x01UL << EVENTROUTER_SET_STAT_WWDT_SETST_Pos)           /*!< EVENTROUTER SET_STAT: WWDT_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_ETH_SETST_Pos                    8                                                         /*!< EVENTROUTER SET_STAT: ETH_SETST Position */\r
+#define EVENTROUTER_SET_STAT_ETH_SETST_Msk                    (0x01UL << EVENTROUTER_SET_STAT_ETH_SETST_Pos)            /*!< EVENTROUTER SET_STAT: ETH_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_USB0_SETST_Pos                   9                                                         /*!< EVENTROUTER SET_STAT: USB0_SETST Position */\r
+#define EVENTROUTER_SET_STAT_USB0_SETST_Msk                   (0x01UL << EVENTROUTER_SET_STAT_USB0_SETST_Pos)           /*!< EVENTROUTER SET_STAT: USB0_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_USB1_SETST_Pos                   10                                                        /*!< EVENTROUTER SET_STAT: USB1_SETST Position */\r
+#define EVENTROUTER_SET_STAT_USB1_SETST_Msk                   (0x01UL << EVENTROUTER_SET_STAT_USB1_SETST_Pos)           /*!< EVENTROUTER SET_STAT: USB1_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_SDMMC_SETST_Pos                  11                                                        /*!< EVENTROUTER SET_STAT: SDMMC_SETST Position */\r
+#define EVENTROUTER_SET_STAT_SDMMC_SETST_Msk                  (0x01UL << EVENTROUTER_SET_STAT_SDMMC_SETST_Pos)          /*!< EVENTROUTER SET_STAT: SDMMC_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_CAN_SETST_Pos                    12                                                        /*!< EVENTROUTER SET_STAT: CAN_SETST Position */\r
+#define EVENTROUTER_SET_STAT_CAN_SETST_Msk                    (0x01UL << EVENTROUTER_SET_STAT_CAN_SETST_Pos)            /*!< EVENTROUTER SET_STAT: CAN_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_TIM2_SETST_Pos                   13                                                        /*!< EVENTROUTER SET_STAT: TIM2_SETST Position */\r
+#define EVENTROUTER_SET_STAT_TIM2_SETST_Msk                   (0x01UL << EVENTROUTER_SET_STAT_TIM2_SETST_Pos)           /*!< EVENTROUTER SET_STAT: TIM2_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_TIM6_SETST_Pos                   14                                                        /*!< EVENTROUTER SET_STAT: TIM6_SETST Position */\r
+#define EVENTROUTER_SET_STAT_TIM6_SETST_Msk                   (0x01UL << EVENTROUTER_SET_STAT_TIM6_SETST_Pos)           /*!< EVENTROUTER SET_STAT: TIM6_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_QEI_SETST_Pos                    15                                                        /*!< EVENTROUTER SET_STAT: QEI_SETST Position */\r
+#define EVENTROUTER_SET_STAT_QEI_SETST_Msk                    (0x01UL << EVENTROUTER_SET_STAT_QEI_SETST_Pos)            /*!< EVENTROUTER SET_STAT: QEI_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_TIM14_SETST_Pos                  16                                                        /*!< EVENTROUTER SET_STAT: TIM14_SETST Position */\r
+#define EVENTROUTER_SET_STAT_TIM14_SETST_Msk                  (0x01UL << EVENTROUTER_SET_STAT_TIM14_SETST_Pos)          /*!< EVENTROUTER SET_STAT: TIM14_SETST Mask */\r
+#define EVENTROUTER_SET_STAT_RESET_SETST_Pos                  19                                                        /*!< EVENTROUTER SET_STAT: RESET_SETST Position */\r
+#define EVENTROUTER_SET_STAT_RESET_SETST_Msk                  (0x01UL << EVENTROUTER_SET_STAT_RESET_SETST_Pos)          /*!< EVENTROUTER SET_STAT: RESET_SETST Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  RTC Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  RTC_ILR  --------------------------------------------\r
+#define RTC_ILR_RTCCIF_Pos                                    0                                                         /*!< RTC ILR: RTCCIF Position            */\r
+#define RTC_ILR_RTCCIF_Msk                                    (0x01UL << RTC_ILR_RTCCIF_Pos)                            /*!< RTC ILR: RTCCIF Mask                */\r
+#define RTC_ILR_RTCALF_Pos                                    1                                                         /*!< RTC ILR: RTCALF Position            */\r
+#define RTC_ILR_RTCALF_Msk                                    (0x01UL << RTC_ILR_RTCALF_Pos)                            /*!< RTC ILR: RTCALF Mask                */\r
+\r
+// -----------------------------------------  RTC_CCR  --------------------------------------------\r
+#define RTC_CCR_CLKEN_Pos                                     0                                                         /*!< RTC CCR: CLKEN Position             */\r
+#define RTC_CCR_CLKEN_Msk                                     (0x01UL << RTC_CCR_CLKEN_Pos)                             /*!< RTC CCR: CLKEN Mask                 */\r
+#define RTC_CCR_CTCRST_Pos                                    1                                                         /*!< RTC CCR: CTCRST Position            */\r
+#define RTC_CCR_CTCRST_Msk                                    (0x01UL << RTC_CCR_CTCRST_Pos)                            /*!< RTC CCR: CTCRST Mask                */\r
+#define RTC_CCR_CCALEN_Pos                                    4                                                         /*!< RTC CCR: CCALEN Position            */\r
+#define RTC_CCR_CCALEN_Msk                                    (0x01UL << RTC_CCR_CCALEN_Pos)                            /*!< RTC CCR: CCALEN Mask                */\r
+\r
+// ----------------------------------------  RTC_CIIR  --------------------------------------------\r
+#define RTC_CIIR_IMSEC_Pos                                    0                                                         /*!< RTC CIIR: IMSEC Position            */\r
+#define RTC_CIIR_IMSEC_Msk                                    (0x01UL << RTC_CIIR_IMSEC_Pos)                            /*!< RTC CIIR: IMSEC Mask                */\r
+#define RTC_CIIR_IMMIN_Pos                                    1                                                         /*!< RTC CIIR: IMMIN Position            */\r
+#define RTC_CIIR_IMMIN_Msk                                    (0x01UL << RTC_CIIR_IMMIN_Pos)                            /*!< RTC CIIR: IMMIN Mask                */\r
+#define RTC_CIIR_IMHOUR_Pos                                   2                                                         /*!< RTC CIIR: IMHOUR Position           */\r
+#define RTC_CIIR_IMHOUR_Msk                                   (0x01UL << RTC_CIIR_IMHOUR_Pos)                           /*!< RTC CIIR: IMHOUR Mask               */\r
+#define RTC_CIIR_IMDOM_Pos                                    3                                                         /*!< RTC CIIR: IMDOM Position            */\r
+#define RTC_CIIR_IMDOM_Msk                                    (0x01UL << RTC_CIIR_IMDOM_Pos)                            /*!< RTC CIIR: IMDOM Mask                */\r
+#define RTC_CIIR_IMDOW_Pos                                    4                                                         /*!< RTC CIIR: IMDOW Position            */\r
+#define RTC_CIIR_IMDOW_Msk                                    (0x01UL << RTC_CIIR_IMDOW_Pos)                            /*!< RTC CIIR: IMDOW Mask                */\r
+#define RTC_CIIR_IMDOY_Pos                                    5                                                         /*!< RTC CIIR: IMDOY Position            */\r
+#define RTC_CIIR_IMDOY_Msk                                    (0x01UL << RTC_CIIR_IMDOY_Pos)                            /*!< RTC CIIR: IMDOY Mask                */\r
+#define RTC_CIIR_IMMON_Pos                                    6                                                         /*!< RTC CIIR: IMMON Position            */\r
+#define RTC_CIIR_IMMON_Msk                                    (0x01UL << RTC_CIIR_IMMON_Pos)                            /*!< RTC CIIR: IMMON Mask                */\r
+#define RTC_CIIR_IMYEAR_Pos                                   7                                                         /*!< RTC CIIR: IMYEAR Position           */\r
+#define RTC_CIIR_IMYEAR_Msk                                   (0x01UL << RTC_CIIR_IMYEAR_Pos)                           /*!< RTC CIIR: IMYEAR Mask               */\r
+\r
+// -----------------------------------------  RTC_AMR  --------------------------------------------\r
+#define RTC_AMR_AMRSEC_Pos                                    0                                                         /*!< RTC AMR: AMRSEC Position            */\r
+#define RTC_AMR_AMRSEC_Msk                                    (0x01UL << RTC_AMR_AMRSEC_Pos)                            /*!< RTC AMR: AMRSEC Mask                */\r
+#define RTC_AMR_AMRMIN_Pos                                    1                                                         /*!< RTC AMR: AMRMIN Position            */\r
+#define RTC_AMR_AMRMIN_Msk                                    (0x01UL << RTC_AMR_AMRMIN_Pos)                            /*!< RTC AMR: AMRMIN Mask                */\r
+#define RTC_AMR_AMRHOUR_Pos                                   2                                                         /*!< RTC AMR: AMRHOUR Position           */\r
+#define RTC_AMR_AMRHOUR_Msk                                   (0x01UL << RTC_AMR_AMRHOUR_Pos)                           /*!< RTC AMR: AMRHOUR Mask               */\r
+#define RTC_AMR_AMRDOM_Pos                                    3                                                         /*!< RTC AMR: AMRDOM Position            */\r
+#define RTC_AMR_AMRDOM_Msk                                    (0x01UL << RTC_AMR_AMRDOM_Pos)                            /*!< RTC AMR: AMRDOM Mask                */\r
+#define RTC_AMR_AMRDOW_Pos                                    4                                                         /*!< RTC AMR: AMRDOW Position            */\r
+#define RTC_AMR_AMRDOW_Msk                                    (0x01UL << RTC_AMR_AMRDOW_Pos)                            /*!< RTC AMR: AMRDOW Mask                */\r
+#define RTC_AMR_AMRDOY_Pos                                    5                                                         /*!< RTC AMR: AMRDOY Position            */\r
+#define RTC_AMR_AMRDOY_Msk                                    (0x01UL << RTC_AMR_AMRDOY_Pos)                            /*!< RTC AMR: AMRDOY Mask                */\r
+#define RTC_AMR_AMRMON_Pos                                    6                                                         /*!< RTC AMR: AMRMON Position            */\r
+#define RTC_AMR_AMRMON_Msk                                    (0x01UL << RTC_AMR_AMRMON_Pos)                            /*!< RTC AMR: AMRMON Mask                */\r
+#define RTC_AMR_AMRYEAR_Pos                                   7                                                         /*!< RTC AMR: AMRYEAR Position           */\r
+#define RTC_AMR_AMRYEAR_Msk                                   (0x01UL << RTC_AMR_AMRYEAR_Pos)                           /*!< RTC AMR: AMRYEAR Mask               */\r
+\r
+// ---------------------------------------  RTC_CTIME0  -------------------------------------------\r
+#define RTC_CTIME0_SECONDS_Pos                                0                                                         /*!< RTC CTIME0: SECONDS Position        */\r
+#define RTC_CTIME0_SECONDS_Msk                                (0x3fUL << RTC_CTIME0_SECONDS_Pos)                        /*!< RTC CTIME0: SECONDS Mask            */\r
+#define RTC_CTIME0_MINUTES_Pos                                8                                                         /*!< RTC CTIME0: MINUTES Position        */\r
+#define RTC_CTIME0_MINUTES_Msk                                (0x3fUL << RTC_CTIME0_MINUTES_Pos)                        /*!< RTC CTIME0: MINUTES Mask            */\r
+#define RTC_CTIME0_HOURS_Pos                                  16                                                        /*!< RTC CTIME0: HOURS Position          */\r
+#define RTC_CTIME0_HOURS_Msk                                  (0x1fUL << RTC_CTIME0_HOURS_Pos)                          /*!< RTC CTIME0: HOURS Mask              */\r
+#define RTC_CTIME0_DOW_Pos                                    24                                                        /*!< RTC CTIME0: DOW Position            */\r
+#define RTC_CTIME0_DOW_Msk                                    (0x07UL << RTC_CTIME0_DOW_Pos)                            /*!< RTC CTIME0: DOW Mask                */\r
+\r
+// ---------------------------------------  RTC_CTIME1  -------------------------------------------\r
+#define RTC_CTIME1_DOM_Pos                                    0                                                         /*!< RTC CTIME1: DOM Position            */\r
+#define RTC_CTIME1_DOM_Msk                                    (0x1fUL << RTC_CTIME1_DOM_Pos)                            /*!< RTC CTIME1: DOM Mask                */\r
+#define RTC_CTIME1_MONTH_Pos                                  8                                                         /*!< RTC CTIME1: MONTH Position          */\r
+#define RTC_CTIME1_MONTH_Msk                                  (0x0fUL << RTC_CTIME1_MONTH_Pos)                          /*!< RTC CTIME1: MONTH Mask              */\r
+#define RTC_CTIME1_YEAR_Pos                                   16                                                        /*!< RTC CTIME1: YEAR Position           */\r
+#define RTC_CTIME1_YEAR_Msk                                   (0x00000fffUL << RTC_CTIME1_YEAR_Pos)                     /*!< RTC CTIME1: YEAR Mask               */\r
+\r
+// ---------------------------------------  RTC_CTIME2  -------------------------------------------\r
+#define RTC_CTIME2_DOY_Pos                                    0                                                         /*!< RTC CTIME2: DOY Position            */\r
+#define RTC_CTIME2_DOY_Msk                                    (0x00000fffUL << RTC_CTIME2_DOY_Pos)                      /*!< RTC CTIME2: DOY Mask                */\r
+\r
+// -----------------------------------------  RTC_SEC  --------------------------------------------\r
+#define RTC_SEC_SECONDS_Pos                                   0                                                         /*!< RTC SEC: SECONDS Position           */\r
+#define RTC_SEC_SECONDS_Msk                                   (0x3fUL << RTC_SEC_SECONDS_Pos)                           /*!< RTC SEC: SECONDS Mask               */\r
+\r
+// -----------------------------------------  RTC_MIN  --------------------------------------------\r
+#define RTC_MIN_MINUTES_Pos                                   0                                                         /*!< RTC MIN: MINUTES Position           */\r
+#define RTC_MIN_MINUTES_Msk                                   (0x3fUL << RTC_MIN_MINUTES_Pos)                           /*!< RTC MIN: MINUTES Mask               */\r
+\r
+// -----------------------------------------  RTC_HRS  --------------------------------------------\r
+#define RTC_HRS_HOURS_Pos                                     0                                                         /*!< RTC HRS: HOURS Position             */\r
+#define RTC_HRS_HOURS_Msk                                     (0x1fUL << RTC_HRS_HOURS_Pos)                             /*!< RTC HRS: HOURS Mask                 */\r
+\r
+// -----------------------------------------  RTC_DOM  --------------------------------------------\r
+#define RTC_DOM_DOM_Pos                                       0                                                         /*!< RTC DOM: DOM Position               */\r
+#define RTC_DOM_DOM_Msk                                       (0x1fUL << RTC_DOM_DOM_Pos)                               /*!< RTC DOM: DOM Mask                   */\r
+\r
+// -----------------------------------------  RTC_DOW  --------------------------------------------\r
+#define RTC_DOW_DOW_Pos                                       0                                                         /*!< RTC DOW: DOW Position               */\r
+#define RTC_DOW_DOW_Msk                                       (0x07UL << RTC_DOW_DOW_Pos)                               /*!< RTC DOW: DOW Mask                   */\r
+\r
+// -----------------------------------------  RTC_DOY  --------------------------------------------\r
+#define RTC_DOY_DOY_Pos                                       0                                                         /*!< RTC DOY: DOY Position               */\r
+#define RTC_DOY_DOY_Msk                                       (0x000001ffUL << RTC_DOY_DOY_Pos)                         /*!< RTC DOY: DOY Mask                   */\r
+\r
+// ----------------------------------------  RTC_MONTH  -------------------------------------------\r
+#define RTC_MONTH_MONTH_Pos                                   0                                                         /*!< RTC MONTH: MONTH Position           */\r
+#define RTC_MONTH_MONTH_Msk                                   (0x0fUL << RTC_MONTH_MONTH_Pos)                           /*!< RTC MONTH: MONTH Mask               */\r
+\r
+// ----------------------------------------  RTC_YEAR  --------------------------------------------\r
+#define RTC_YEAR_YEAR_Pos                                     0                                                         /*!< RTC YEAR: YEAR Position             */\r
+#define RTC_YEAR_YEAR_Msk                                     (0x00000fffUL << RTC_YEAR_YEAR_Pos)                       /*!< RTC YEAR: YEAR Mask                 */\r
+\r
+// -------------------------------------  RTC_CALIBRATION  ----------------------------------------\r
+#define RTC_CALIBRATION_CALVAL_Pos                            0                                                         /*!< RTC CALIBRATION: CALVAL Position    */\r
+#define RTC_CALIBRATION_CALVAL_Msk                            (0x0001ffffUL << RTC_CALIBRATION_CALVAL_Pos)              /*!< RTC CALIBRATION: CALVAL Mask        */\r
+#define RTC_CALIBRATION_CALDIR_Pos                            17                                                        /*!< RTC CALIBRATION: CALDIR Position    */\r
+#define RTC_CALIBRATION_CALDIR_Msk                            (0x01UL << RTC_CALIBRATION_CALDIR_Pos)                    /*!< RTC CALIBRATION: CALDIR Mask        */\r
+\r
+// ----------------------------------------  RTC_ASEC  --------------------------------------------\r
+#define RTC_ASEC_SECONDS_Pos                                  0                                                         /*!< RTC ASEC: SECONDS Position          */\r
+#define RTC_ASEC_SECONDS_Msk                                  (0x3fUL << RTC_ASEC_SECONDS_Pos)                          /*!< RTC ASEC: SECONDS Mask              */\r
+\r
+// ----------------------------------------  RTC_AMIN  --------------------------------------------\r
+#define RTC_AMIN_MINUTES_Pos                                  0                                                         /*!< RTC AMIN: MINUTES Position          */\r
+#define RTC_AMIN_MINUTES_Msk                                  (0x3fUL << RTC_AMIN_MINUTES_Pos)                          /*!< RTC AMIN: MINUTES Mask              */\r
+\r
+// ----------------------------------------  RTC_AHRS  --------------------------------------------\r
+#define RTC_AHRS_HOURS_Pos                                    0                                                         /*!< RTC AHRS: HOURS Position            */\r
+#define RTC_AHRS_HOURS_Msk                                    (0x1fUL << RTC_AHRS_HOURS_Pos)                            /*!< RTC AHRS: HOURS Mask                */\r
+\r
+// ----------------------------------------  RTC_ADOM  --------------------------------------------\r
+#define RTC_ADOM_DOM_Pos                                      0                                                         /*!< RTC ADOM: DOM Position              */\r
+#define RTC_ADOM_DOM_Msk                                      (0x1fUL << RTC_ADOM_DOM_Pos)                              /*!< RTC ADOM: DOM Mask                  */\r
+\r
+// ----------------------------------------  RTC_ADOW  --------------------------------------------\r
+#define RTC_ADOW_DOW_Pos                                      0                                                         /*!< RTC ADOW: DOW Position              */\r
+#define RTC_ADOW_DOW_Msk                                      (0x07UL << RTC_ADOW_DOW_Pos)                              /*!< RTC ADOW: DOW Mask                  */\r
+\r
+// ----------------------------------------  RTC_ADOY  --------------------------------------------\r
+#define RTC_ADOY_DOY_Pos                                      0                                                         /*!< RTC ADOY: DOY Position              */\r
+#define RTC_ADOY_DOY_Msk                                      (0x000001ffUL << RTC_ADOY_DOY_Pos)                        /*!< RTC ADOY: DOY Mask                  */\r
+\r
+// ----------------------------------------  RTC_AMON  --------------------------------------------\r
+#define RTC_AMON_MONTH_Pos                                    0                                                         /*!< RTC AMON: MONTH Position            */\r
+#define RTC_AMON_MONTH_Msk                                    (0x0fUL << RTC_AMON_MONTH_Pos)                            /*!< RTC AMON: MONTH Mask                */\r
+\r
+// ----------------------------------------  RTC_AYRS  --------------------------------------------\r
+#define RTC_AYRS_YEAR_Pos                                     0                                                         /*!< RTC AYRS: YEAR Position             */\r
+#define RTC_AYRS_YEAR_Msk                                     (0x00000fffUL << RTC_AYRS_YEAR_Pos)                       /*!< RTC AYRS: YEAR Mask                 */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  CGU Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// --------------------------------------  CGU_FREQ_MON  ------------------------------------------\r
+#define CGU_FREQ_MON_RCNT_Pos                                 0                                                         /*!< CGU FREQ_MON: RCNT Position         */\r
+#define CGU_FREQ_MON_RCNT_Msk                                 (0x000001ffUL << CGU_FREQ_MON_RCNT_Pos)                   /*!< CGU FREQ_MON: RCNT Mask             */\r
+#define CGU_FREQ_MON_FCNT_Pos                                 9                                                         /*!< CGU FREQ_MON: FCNT Position         */\r
+#define CGU_FREQ_MON_FCNT_Msk                                 (0x00003fffUL << CGU_FREQ_MON_FCNT_Pos)                   /*!< CGU FREQ_MON: FCNT Mask             */\r
+#define CGU_FREQ_MON_MEAS_Pos                                 23                                                        /*!< CGU FREQ_MON: MEAS Position         */\r
+#define CGU_FREQ_MON_MEAS_Msk                                 (0x01UL << CGU_FREQ_MON_MEAS_Pos)                         /*!< CGU FREQ_MON: MEAS Mask             */\r
+#define CGU_FREQ_MON_CLK_SEL_Pos                              24                                                        /*!< CGU FREQ_MON: CLK_SEL Position      */\r
+#define CGU_FREQ_MON_CLK_SEL_Msk                              (0x1fUL << CGU_FREQ_MON_CLK_SEL_Pos)                      /*!< CGU FREQ_MON: CLK_SEL Mask          */\r
+\r
+// ------------------------------------  CGU_XTAL_OSC_CTRL  ---------------------------------------\r
+#define CGU_XTAL_OSC_CTRL_ENABLE_Pos                          0                                                         /*!< CGU XTAL_OSC_CTRL: ENABLE Position  */\r
+#define CGU_XTAL_OSC_CTRL_ENABLE_Msk                          (0x01UL << CGU_XTAL_OSC_CTRL_ENABLE_Pos)                  /*!< CGU XTAL_OSC_CTRL: ENABLE Mask      */\r
+#define CGU_XTAL_OSC_CTRL_BYPASS_Pos                          1                                                         /*!< CGU XTAL_OSC_CTRL: BYPASS Position  */\r
+#define CGU_XTAL_OSC_CTRL_BYPASS_Msk                          (0x01UL << CGU_XTAL_OSC_CTRL_BYPASS_Pos)                  /*!< CGU XTAL_OSC_CTRL: BYPASS Mask      */\r
+#define CGU_XTAL_OSC_CTRL_HF_Pos                              2                                                         /*!< CGU XTAL_OSC_CTRL: HF Position      */\r
+#define CGU_XTAL_OSC_CTRL_HF_Msk                              (0x01UL << CGU_XTAL_OSC_CTRL_HF_Pos)                      /*!< CGU XTAL_OSC_CTRL: HF Mask          */\r
+\r
+// ------------------------------------  CGU_PLL0USB_STAT  ----------------------------------------\r
+#define CGU_PLL0USB_STAT_LOCK_Pos                             0                                                         /*!< CGU PLL0USB_STAT: LOCK Position     */\r
+#define CGU_PLL0USB_STAT_LOCK_Msk                             (0x01UL << CGU_PLL0USB_STAT_LOCK_Pos)                     /*!< CGU PLL0USB_STAT: LOCK Mask         */\r
+#define CGU_PLL0USB_STAT_FR_Pos                               1                                                         /*!< CGU PLL0USB_STAT: FR Position       */\r
+#define CGU_PLL0USB_STAT_FR_Msk                               (0x01UL << CGU_PLL0USB_STAT_FR_Pos)                       /*!< CGU PLL0USB_STAT: FR Mask           */\r
+\r
+// ------------------------------------  CGU_PLL0USB_CTRL  ----------------------------------------\r
+#define CGU_PLL0USB_CTRL_PD_Pos                               0                                                         /*!< CGU PLL0USB_CTRL: PD Position       */\r
+#define CGU_PLL0USB_CTRL_PD_Msk                               (0x01UL << CGU_PLL0USB_CTRL_PD_Pos)                       /*!< CGU PLL0USB_CTRL: PD Mask           */\r
+#define CGU_PLL0USB_CTRL_BYPASS_Pos                           1                                                         /*!< CGU PLL0USB_CTRL: BYPASS Position   */\r
+#define CGU_PLL0USB_CTRL_BYPASS_Msk                           (0x01UL << CGU_PLL0USB_CTRL_BYPASS_Pos)                   /*!< CGU PLL0USB_CTRL: BYPASS Mask       */\r
+#define CGU_PLL0USB_CTRL_DIRECTI_Pos                          2                                                         /*!< CGU PLL0USB_CTRL: DIRECTI Position  */\r
+#define CGU_PLL0USB_CTRL_DIRECTI_Msk                          (0x01UL << CGU_PLL0USB_CTRL_DIRECTI_Pos)                  /*!< CGU PLL0USB_CTRL: DIRECTI Mask      */\r
+#define CGU_PLL0USB_CTRL_DIRECTO_Pos                          3                                                         /*!< CGU PLL0USB_CTRL: DIRECTO Position  */\r
+#define CGU_PLL0USB_CTRL_DIRECTO_Msk                          (0x01UL << CGU_PLL0USB_CTRL_DIRECTO_Pos)                  /*!< CGU PLL0USB_CTRL: DIRECTO Mask      */\r
+#define CGU_PLL0USB_CTRL_CLKEN_Pos                            4                                                         /*!< CGU PLL0USB_CTRL: CLKEN Position    */\r
+#define CGU_PLL0USB_CTRL_CLKEN_Msk                            (0x01UL << CGU_PLL0USB_CTRL_CLKEN_Pos)                    /*!< CGU PLL0USB_CTRL: CLKEN Mask        */\r
+#define CGU_PLL0USB_CTRL_FRM_Pos                              6                                                         /*!< CGU PLL0USB_CTRL: FRM Position      */\r
+#define CGU_PLL0USB_CTRL_FRM_Msk                              (0x01UL << CGU_PLL0USB_CTRL_FRM_Pos)                      /*!< CGU PLL0USB_CTRL: FRM Mask          */\r
+#define CGU_PLL0USB_CTRL_AUTOBLOCK_Pos                        11                                                        /*!< CGU PLL0USB_CTRL: AUTOBLOCK Position */\r
+#define CGU_PLL0USB_CTRL_AUTOBLOCK_Msk                        (0x01UL << CGU_PLL0USB_CTRL_AUTOBLOCK_Pos)                /*!< CGU PLL0USB_CTRL: AUTOBLOCK Mask    */\r
+#define CGU_PLL0USB_CTRL_CLK_SEL_Pos                          24                                                        /*!< CGU PLL0USB_CTRL: CLK_SEL Position  */\r
+#define CGU_PLL0USB_CTRL_CLK_SEL_Msk                          (0x1fUL << CGU_PLL0USB_CTRL_CLK_SEL_Pos)                  /*!< CGU PLL0USB_CTRL: CLK_SEL Mask      */\r
+\r
+// ------------------------------------  CGU_PLL0USB_MDIV  ----------------------------------------\r
+#define CGU_PLL0USB_MDIV_MDEC_Pos                             0                                                         /*!< CGU PLL0USB_MDIV: MDEC Position     */\r
+#define CGU_PLL0USB_MDIV_MDEC_Msk                             (0x0001ffffUL << CGU_PLL0USB_MDIV_MDEC_Pos)               /*!< CGU PLL0USB_MDIV: MDEC Mask         */\r
+#define CGU_PLL0USB_MDIV_SELP_Pos                             17                                                        /*!< CGU PLL0USB_MDIV: SELP Position     */\r
+#define CGU_PLL0USB_MDIV_SELP_Msk                             (0x1fUL << CGU_PLL0USB_MDIV_SELP_Pos)                     /*!< CGU PLL0USB_MDIV: SELP Mask         */\r
+#define CGU_PLL0USB_MDIV_SELI_Pos                             22                                                        /*!< CGU PLL0USB_MDIV: SELI Position     */\r
+#define CGU_PLL0USB_MDIV_SELI_Msk                             (0x3fUL << CGU_PLL0USB_MDIV_SELI_Pos)                     /*!< CGU PLL0USB_MDIV: SELI Mask         */\r
+#define CGU_PLL0USB_MDIV_SELR_Pos                             28                                                        /*!< CGU PLL0USB_MDIV: SELR Position     */\r
+#define CGU_PLL0USB_MDIV_SELR_Msk                             (0x0fUL << CGU_PLL0USB_MDIV_SELR_Pos)                     /*!< CGU PLL0USB_MDIV: SELR Mask         */\r
+\r
+// -----------------------------------  CGU_PLL0USB_NP_DIV  ---------------------------------------\r
+#define CGU_PLL0USB_NP_DIV_PDEC_Pos                           0                                                         /*!< CGU PLL0USB_NP_DIV: PDEC Position   */\r
+#define CGU_PLL0USB_NP_DIV_PDEC_Msk                           (0x7fUL << CGU_PLL0USB_NP_DIV_PDEC_Pos)                   /*!< CGU PLL0USB_NP_DIV: PDEC Mask       */\r
+#define CGU_PLL0USB_NP_DIV_NDEC_Pos                           12                                                        /*!< CGU PLL0USB_NP_DIV: NDEC Position   */\r
+#define CGU_PLL0USB_NP_DIV_NDEC_Msk                           (0x000003ffUL << CGU_PLL0USB_NP_DIV_NDEC_Pos)             /*!< CGU PLL0USB_NP_DIV: NDEC Mask       */\r
+\r
+// -----------------------------------  CGU_PLL0AUDIO_STAT  ---------------------------------------\r
+#define CGU_PLL0AUDIO_STAT_LOCK_Pos                           0                                                         /*!< CGU PLL0AUDIO_STAT: LOCK Position   */\r
+#define CGU_PLL0AUDIO_STAT_LOCK_Msk                           (0x01UL << CGU_PLL0AUDIO_STAT_LOCK_Pos)                   /*!< CGU PLL0AUDIO_STAT: LOCK Mask       */\r
+#define CGU_PLL0AUDIO_STAT_FR_Pos                             1                                                         /*!< CGU PLL0AUDIO_STAT: FR Position     */\r
+#define CGU_PLL0AUDIO_STAT_FR_Msk                             (0x01UL << CGU_PLL0AUDIO_STAT_FR_Pos)                     /*!< CGU PLL0AUDIO_STAT: FR Mask         */\r
+\r
+// -----------------------------------  CGU_PLL0AUDIO_CTRL  ---------------------------------------\r
+#define CGU_PLL0AUDIO_CTRL_PD_Pos                             0                                                         /*!< CGU PLL0AUDIO_CTRL: PD Position     */\r
+#define CGU_PLL0AUDIO_CTRL_PD_Msk                             (0x01UL << CGU_PLL0AUDIO_CTRL_PD_Pos)                     /*!< CGU PLL0AUDIO_CTRL: PD Mask         */\r
+#define CGU_PLL0AUDIO_CTRL_BYPASS_Pos                         1                                                         /*!< CGU PLL0AUDIO_CTRL: BYPASS Position */\r
+#define CGU_PLL0AUDIO_CTRL_BYPASS_Msk                         (0x01UL << CGU_PLL0AUDIO_CTRL_BYPASS_Pos)                 /*!< CGU PLL0AUDIO_CTRL: BYPASS Mask     */\r
+#define CGU_PLL0AUDIO_CTRL_DIRECTI_Pos                        2                                                         /*!< CGU PLL0AUDIO_CTRL: DIRECTI Position */\r
+#define CGU_PLL0AUDIO_CTRL_DIRECTI_Msk                        (0x01UL << CGU_PLL0AUDIO_CTRL_DIRECTI_Pos)                /*!< CGU PLL0AUDIO_CTRL: DIRECTI Mask    */\r
+#define CGU_PLL0AUDIO_CTRL_DIRECTO_Pos                        3                                                         /*!< CGU PLL0AUDIO_CTRL: DIRECTO Position */\r
+#define CGU_PLL0AUDIO_CTRL_DIRECTO_Msk                        (0x01UL << CGU_PLL0AUDIO_CTRL_DIRECTO_Pos)                /*!< CGU PLL0AUDIO_CTRL: DIRECTO Mask    */\r
+#define CGU_PLL0AUDIO_CTRL_CLKEN_Pos                          4                                                         /*!< CGU PLL0AUDIO_CTRL: CLKEN Position  */\r
+#define CGU_PLL0AUDIO_CTRL_CLKEN_Msk                          (0x01UL << CGU_PLL0AUDIO_CTRL_CLKEN_Pos)                  /*!< CGU PLL0AUDIO_CTRL: CLKEN Mask      */\r
+#define CGU_PLL0AUDIO_CTRL_FRM_Pos                            6                                                         /*!< CGU PLL0AUDIO_CTRL: FRM Position    */\r
+#define CGU_PLL0AUDIO_CTRL_FRM_Msk                            (0x01UL << CGU_PLL0AUDIO_CTRL_FRM_Pos)                    /*!< CGU PLL0AUDIO_CTRL: FRM Mask        */\r
+#define CGU_PLL0AUDIO_CTRL_AUTOBLOCK_Pos                      11                                                        /*!< CGU PLL0AUDIO_CTRL: AUTOBLOCK Position */\r
+#define CGU_PLL0AUDIO_CTRL_AUTOBLOCK_Msk                      (0x01UL << CGU_PLL0AUDIO_CTRL_AUTOBLOCK_Pos)              /*!< CGU PLL0AUDIO_CTRL: AUTOBLOCK Mask  */\r
+#define CGU_PLL0AUDIO_CTRL_PLLFRAQ_REQ_Pos                    12                                                        /*!< CGU PLL0AUDIO_CTRL: PLLFRAQ_REQ Position */\r
+#define CGU_PLL0AUDIO_CTRL_PLLFRAQ_REQ_Msk                    (0x01UL << CGU_PLL0AUDIO_CTRL_PLLFRAQ_REQ_Pos)            /*!< CGU PLL0AUDIO_CTRL: PLLFRAQ_REQ Mask */\r
+#define CGU_PLL0AUDIO_CTRL_SEL_EXT_Pos                        13                                                        /*!< CGU PLL0AUDIO_CTRL: SEL_EXT Position */\r
+#define CGU_PLL0AUDIO_CTRL_SEL_EXT_Msk                        (0x01UL << CGU_PLL0AUDIO_CTRL_SEL_EXT_Pos)                /*!< CGU PLL0AUDIO_CTRL: SEL_EXT Mask    */\r
+#define CGU_PLL0AUDIO_CTRL_MOD_PD_Pos                         14                                                        /*!< CGU PLL0AUDIO_CTRL: MOD_PD Position */\r
+#define CGU_PLL0AUDIO_CTRL_MOD_PD_Msk                         (0x01UL << CGU_PLL0AUDIO_CTRL_MOD_PD_Pos)                 /*!< CGU PLL0AUDIO_CTRL: MOD_PD Mask     */\r
+#define CGU_PLL0AUDIO_CTRL_CLK_SEL_Pos                        24                                                        /*!< CGU PLL0AUDIO_CTRL: CLK_SEL Position */\r
+#define CGU_PLL0AUDIO_CTRL_CLK_SEL_Msk                        (0x1fUL << CGU_PLL0AUDIO_CTRL_CLK_SEL_Pos)                /*!< CGU PLL0AUDIO_CTRL: CLK_SEL Mask    */\r
+\r
+// -----------------------------------  CGU_PLL0AUDIO_MDIV  ---------------------------------------\r
+#define CGU_PLL0AUDIO_MDIV_MDEC_Pos                           0                                                         /*!< CGU PLL0AUDIO_MDIV: MDEC Position   */\r
+#define CGU_PLL0AUDIO_MDIV_MDEC_Msk                           (0x0001ffffUL << CGU_PLL0AUDIO_MDIV_MDEC_Pos)             /*!< CGU PLL0AUDIO_MDIV: MDEC Mask       */\r
+\r
+// ----------------------------------  CGU_PLL0AUDIO_NP_DIV  --------------------------------------\r
+#define CGU_PLL0AUDIO_NP_DIV_PDEC_Pos                         0                                                         /*!< CGU PLL0AUDIO_NP_DIV: PDEC Position */\r
+#define CGU_PLL0AUDIO_NP_DIV_PDEC_Msk                         (0x7fUL << CGU_PLL0AUDIO_NP_DIV_PDEC_Pos)                 /*!< CGU PLL0AUDIO_NP_DIV: PDEC Mask     */\r
+#define CGU_PLL0AUDIO_NP_DIV_NDEC_Pos                         12                                                        /*!< CGU PLL0AUDIO_NP_DIV: NDEC Position */\r
+#define CGU_PLL0AUDIO_NP_DIV_NDEC_Msk                         (0x000003ffUL << CGU_PLL0AUDIO_NP_DIV_NDEC_Pos)           /*!< CGU PLL0AUDIO_NP_DIV: NDEC Mask     */\r
+\r
+// -----------------------------------  CGU_PLL0AUDIO_FRAC  ---------------------------------------\r
+#define CGU_PLL0AUDIO_FRAC_PLLFRACT_CTRL_Pos                  0                                                         /*!< CGU PLL0AUDIO_FRAC: PLLFRACT_CTRL Position */\r
+#define CGU_PLL0AUDIO_FRAC_PLLFRACT_CTRL_Msk                  (0x003fffffUL << CGU_PLL0AUDIO_FRAC_PLLFRACT_CTRL_Pos)    /*!< CGU PLL0AUDIO_FRAC: PLLFRACT_CTRL Mask */\r
+\r
+// --------------------------------------  CGU_PLL1_STAT  -----------------------------------------\r
+#define CGU_PLL1_STAT_LOCK_Pos                                0                                                         /*!< CGU PLL1_STAT: LOCK Position        */\r
+#define CGU_PLL1_STAT_LOCK_Msk                                (0x01UL << CGU_PLL1_STAT_LOCK_Pos)                        /*!< CGU PLL1_STAT: LOCK Mask            */\r
+\r
+// --------------------------------------  CGU_PLL1_CTRL  -----------------------------------------\r
+#define CGU_PLL1_CTRL_PD_Pos                                  0                                                         /*!< CGU PLL1_CTRL: PD Position          */\r
+#define CGU_PLL1_CTRL_PD_Msk                                  (0x01UL << CGU_PLL1_CTRL_PD_Pos)                          /*!< CGU PLL1_CTRL: PD Mask              */\r
+#define CGU_PLL1_CTRL_BYPASS_Pos                              1                                                         /*!< CGU PLL1_CTRL: BYPASS Position      */\r
+#define CGU_PLL1_CTRL_BYPASS_Msk                              (0x01UL << CGU_PLL1_CTRL_BYPASS_Pos)                      /*!< CGU PLL1_CTRL: BYPASS Mask          */\r
+#define CGU_PLL1_CTRL_FBSEL_Pos                               6                                                         /*!< CGU PLL1_CTRL: FBSEL Position       */\r
+#define CGU_PLL1_CTRL_FBSEL_Msk                               (0x01UL << CGU_PLL1_CTRL_FBSEL_Pos)                       /*!< CGU PLL1_CTRL: FBSEL Mask           */\r
+#define CGU_PLL1_CTRL_DIRECT_Pos                              7                                                         /*!< CGU PLL1_CTRL: DIRECT Position      */\r
+#define CGU_PLL1_CTRL_DIRECT_Msk                              (0x01UL << CGU_PLL1_CTRL_DIRECT_Pos)                      /*!< CGU PLL1_CTRL: DIRECT Mask          */\r
+#define CGU_PLL1_CTRL_PSEL_Pos                                8                                                         /*!< CGU PLL1_CTRL: PSEL Position        */\r
+#define CGU_PLL1_CTRL_PSEL_Msk                                (0x03UL << CGU_PLL1_CTRL_PSEL_Pos)                        /*!< CGU PLL1_CTRL: PSEL Mask            */\r
+#define CGU_PLL1_CTRL_AUTOBLOCK_Pos                           11                                                        /*!< CGU PLL1_CTRL: AUTOBLOCK Position   */\r
+#define CGU_PLL1_CTRL_AUTOBLOCK_Msk                           (0x01UL << CGU_PLL1_CTRL_AUTOBLOCK_Pos)                   /*!< CGU PLL1_CTRL: AUTOBLOCK Mask       */\r
+#define CGU_PLL1_CTRL_NSEL_Pos                                12                                                        /*!< CGU PLL1_CTRL: NSEL Position        */\r
+#define CGU_PLL1_CTRL_NSEL_Msk                                (0x03UL << CGU_PLL1_CTRL_NSEL_Pos)                        /*!< CGU PLL1_CTRL: NSEL Mask            */\r
+#define CGU_PLL1_CTRL_MSEL_Pos                                16                                                        /*!< CGU PLL1_CTRL: MSEL Position        */\r
+#define CGU_PLL1_CTRL_MSEL_Msk                                (0x000000ffUL << CGU_PLL1_CTRL_MSEL_Pos)                  /*!< CGU PLL1_CTRL: MSEL Mask            */\r
+#define CGU_PLL1_CTRL_CLK_SEL_Pos                             24                                                        /*!< CGU PLL1_CTRL: CLK_SEL Position     */\r
+#define CGU_PLL1_CTRL_CLK_SEL_Msk                             (0x1fUL << CGU_PLL1_CTRL_CLK_SEL_Pos)                     /*!< CGU PLL1_CTRL: CLK_SEL Mask         */\r
+\r
+// -------------------------------------  CGU_IDIVA_CTRL  -----------------------------------------\r
+#define CGU_IDIVA_CTRL_PD_Pos                                 0                                                         /*!< CGU IDIVA_CTRL: PD Position         */\r
+#define CGU_IDIVA_CTRL_PD_Msk                                 (0x01UL << CGU_IDIVA_CTRL_PD_Pos)                         /*!< CGU IDIVA_CTRL: PD Mask             */\r
+#define CGU_IDIVA_CTRL_IDIV_Pos                               2                                                         /*!< CGU IDIVA_CTRL: IDIV Position       */\r
+#define CGU_IDIVA_CTRL_IDIV_Msk                               (0x03UL << CGU_IDIVA_CTRL_IDIV_Pos)                       /*!< CGU IDIVA_CTRL: IDIV Mask           */\r
+#define CGU_IDIVA_CTRL_AUTOBLOCK_Pos                          11                                                        /*!< CGU IDIVA_CTRL: AUTOBLOCK Position  */\r
+#define CGU_IDIVA_CTRL_AUTOBLOCK_Msk                          (0x01UL << CGU_IDIVA_CTRL_AUTOBLOCK_Pos)                  /*!< CGU IDIVA_CTRL: AUTOBLOCK Mask      */\r
+#define CGU_IDIVA_CTRL_CLK_SEL_Pos                            24                                                        /*!< CGU IDIVA_CTRL: CLK_SEL Position    */\r
+#define CGU_IDIVA_CTRL_CLK_SEL_Msk                            (0x1fUL << CGU_IDIVA_CTRL_CLK_SEL_Pos)                    /*!< CGU IDIVA_CTRL: CLK_SEL Mask        */\r
+\r
+// -------------------------------------  CGU_IDIVB_CTRL  -----------------------------------------\r
+#define CGU_IDIVB_CTRL_PD_Pos                                 0                                                         /*!< CGU IDIVB_CTRL: PD Position         */\r
+#define CGU_IDIVB_CTRL_PD_Msk                                 (0x01UL << CGU_IDIVB_CTRL_PD_Pos)                         /*!< CGU IDIVB_CTRL: PD Mask             */\r
+#define CGU_IDIVB_CTRL_IDIV_Pos                               2                                                         /*!< CGU IDIVB_CTRL: IDIV Position       */\r
+#define CGU_IDIVB_CTRL_IDIV_Msk                               (0x0fUL << CGU_IDIVB_CTRL_IDIV_Pos)                       /*!< CGU IDIVB_CTRL: IDIV Mask           */\r
+#define CGU_IDIVB_CTRL_AUTOBLOCK_Pos                          11                                                        /*!< CGU IDIVB_CTRL: AUTOBLOCK Position  */\r
+#define CGU_IDIVB_CTRL_AUTOBLOCK_Msk                          (0x01UL << CGU_IDIVB_CTRL_AUTOBLOCK_Pos)                  /*!< CGU IDIVB_CTRL: AUTOBLOCK Mask      */\r
+#define CGU_IDIVB_CTRL_CLK_SEL_Pos                            24                                                        /*!< CGU IDIVB_CTRL: CLK_SEL Position    */\r
+#define CGU_IDIVB_CTRL_CLK_SEL_Msk                            (0x1fUL << CGU_IDIVB_CTRL_CLK_SEL_Pos)                    /*!< CGU IDIVB_CTRL: CLK_SEL Mask        */\r
+\r
+// -------------------------------------  CGU_IDIVE_CTRL  -----------------------------------------\r
+#define CGU_IDIVE_CTRL_PD_Pos                                 0                                                         /*!< CGU IDIVE_CTRL: PD Position         */\r
+#define CGU_IDIVE_CTRL_PD_Msk                                 (0x01UL << CGU_IDIVE_CTRL_PD_Pos)                         /*!< CGU IDIVE_CTRL: PD Mask             */\r
+#define CGU_IDIVE_CTRL_IDIV_Pos                               2                                                         /*!< CGU IDIVE_CTRL: IDIV Position       */\r
+#define CGU_IDIVE_CTRL_IDIV_Msk                               (0x000000ffUL << CGU_IDIVE_CTRL_IDIV_Pos)                 /*!< CGU IDIVE_CTRL: IDIV Mask           */\r
+#define CGU_IDIVE_CTRL_AUTOBLOCK_Pos                          11                                                        /*!< CGU IDIVE_CTRL: AUTOBLOCK Position  */\r
+#define CGU_IDIVE_CTRL_AUTOBLOCK_Msk                          (0x01UL << CGU_IDIVE_CTRL_AUTOBLOCK_Pos)                  /*!< CGU IDIVE_CTRL: AUTOBLOCK Mask      */\r
+#define CGU_IDIVE_CTRL_CLK_SEL_Pos                            24                                                        /*!< CGU IDIVE_CTRL: CLK_SEL Position    */\r
+#define CGU_IDIVE_CTRL_CLK_SEL_Msk                            (0x1fUL << CGU_IDIVE_CTRL_CLK_SEL_Pos)                    /*!< CGU IDIVE_CTRL: CLK_SEL Mask        */\r
+\r
+// ------------------------------------  CGU_BASE_SAFE_CLK  ---------------------------------------\r
+#define CGU_BASE_SAFE_CLK_PD_Pos                              0                                                         /*!< CGU BASE_SAFE_CLK: PD Position      */\r
+#define CGU_BASE_SAFE_CLK_PD_Msk                              (0x01UL << CGU_BASE_SAFE_CLK_PD_Pos)                      /*!< CGU BASE_SAFE_CLK: PD Mask          */\r
+#define CGU_BASE_SAFE_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_SAFE_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SAFE_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_SAFE_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_SAFE_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_SAFE_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_SAFE_CLK: CLK_SEL Position */\r
+#define CGU_BASE_SAFE_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_SAFE_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_SAFE_CLK: CLK_SEL Mask     */\r
+\r
+// ------------------------------------  CGU_BASE_USB0_CLK  ---------------------------------------\r
+#define CGU_BASE_USB0_CLK_PD_Pos                              0                                                         /*!< CGU BASE_USB0_CLK: PD Position      */\r
+#define CGU_BASE_USB0_CLK_PD_Msk                              (0x01UL << CGU_BASE_USB0_CLK_PD_Pos)                      /*!< CGU BASE_USB0_CLK: PD Mask          */\r
+#define CGU_BASE_USB0_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_USB0_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_USB0_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_USB0_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_USB0_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_USB0_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_USB0_CLK: CLK_SEL Position */\r
+#define CGU_BASE_USB0_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_USB0_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_USB0_CLK: CLK_SEL Mask     */\r
+\r
+// -----------------------------------  CGU_BASE_PERIPH_CLK  --------------------------------------\r
+#define CGU_BASE_PERIPH_CLK_PD_Pos                            0                                                         /*!< CGU BASE_PERIPH_CLK: PD Position    */\r
+#define CGU_BASE_PERIPH_CLK_PD_Msk                            (0x01UL << CGU_BASE_PERIPH_CLK_PD_Pos)                    /*!< CGU BASE_PERIPH_CLK: PD Mask        */\r
+#define CGU_BASE_PERIPH_CLK_AUTOBLOCK_Pos                     11                                                        /*!< CGU BASE_PERIPH_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_PERIPH_CLK_AUTOBLOCK_Msk                     (0x01UL << CGU_BASE_PERIPH_CLK_AUTOBLOCK_Pos)             /*!< CGU BASE_PERIPH_CLK: AUTOBLOCK Mask */\r
+#define CGU_BASE_PERIPH_CLK_CLK_SEL_Pos                       24                                                        /*!< CGU BASE_PERIPH_CLK: CLK_SEL Position */\r
+#define CGU_BASE_PERIPH_CLK_CLK_SEL_Msk                       (0x1fUL << CGU_BASE_PERIPH_CLK_CLK_SEL_Pos)               /*!< CGU BASE_PERIPH_CLK: CLK_SEL Mask   */\r
+\r
+// ------------------------------------  CGU_BASE_USB1_CLK  ---------------------------------------\r
+#define CGU_BASE_USB1_CLK_PD_Pos                              0                                                         /*!< CGU BASE_USB1_CLK: PD Position      */\r
+#define CGU_BASE_USB1_CLK_PD_Msk                              (0x01UL << CGU_BASE_USB1_CLK_PD_Pos)                      /*!< CGU BASE_USB1_CLK: PD Mask          */\r
+#define CGU_BASE_USB1_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_USB1_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_USB1_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_USB1_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_USB1_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_USB1_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_USB1_CLK: CLK_SEL Position */\r
+#define CGU_BASE_USB1_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_USB1_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_USB1_CLK: CLK_SEL Mask     */\r
+\r
+// -------------------------------------  CGU_BASE_M4_CLK  ----------------------------------------\r
+#define CGU_BASE_M4_CLK_PD_Pos                                0                                                         /*!< CGU BASE_M4_CLK: PD Position        */\r
+#define CGU_BASE_M4_CLK_PD_Msk                                (0x01UL << CGU_BASE_M4_CLK_PD_Pos)                        /*!< CGU BASE_M4_CLK: PD Mask            */\r
+#define CGU_BASE_M4_CLK_AUTOBLOCK_Pos                         11                                                        /*!< CGU BASE_M4_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_M4_CLK_AUTOBLOCK_Msk                         (0x01UL << CGU_BASE_M4_CLK_AUTOBLOCK_Pos)                 /*!< CGU BASE_M4_CLK: AUTOBLOCK Mask     */\r
+#define CGU_BASE_M4_CLK_CLK_SEL_Pos                           24                                                        /*!< CGU BASE_M4_CLK: CLK_SEL Position   */\r
+#define CGU_BASE_M4_CLK_CLK_SEL_Msk                           (0x1fUL << CGU_BASE_M4_CLK_CLK_SEL_Pos)                   /*!< CGU BASE_M4_CLK: CLK_SEL Mask       */\r
+\r
+// -----------------------------------  CGU_BASE_SPIFI_CLK  ---------------------------------------\r
+#define CGU_BASE_SPIFI_CLK_PD_Pos                             0                                                         /*!< CGU BASE_SPIFI_CLK: PD Position     */\r
+#define CGU_BASE_SPIFI_CLK_PD_Msk                             (0x01UL << CGU_BASE_SPIFI_CLK_PD_Pos)                     /*!< CGU BASE_SPIFI_CLK: PD Mask         */\r
+#define CGU_BASE_SPIFI_CLK_AUTOBLOCK_Pos                      11                                                        /*!< CGU BASE_SPIFI_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SPIFI_CLK_AUTOBLOCK_Msk                      (0x01UL << CGU_BASE_SPIFI_CLK_AUTOBLOCK_Pos)              /*!< CGU BASE_SPIFI_CLK: AUTOBLOCK Mask  */\r
+#define CGU_BASE_SPIFI_CLK_CLK_SEL_Pos                        24                                                        /*!< CGU BASE_SPIFI_CLK: CLK_SEL Position */\r
+#define CGU_BASE_SPIFI_CLK_CLK_SEL_Msk                        (0x1fUL << CGU_BASE_SPIFI_CLK_CLK_SEL_Pos)                /*!< CGU BASE_SPIFI_CLK: CLK_SEL Mask    */\r
+\r
+// ------------------------------------  CGU_BASE_SPI_CLK  ----------------------------------------\r
+#define CGU_BASE_SPI_CLK_PD_Pos                               0                                                         /*!< CGU BASE_SPI_CLK: PD Position       */\r
+#define CGU_BASE_SPI_CLK_PD_Msk                               (0x01UL << CGU_BASE_SPI_CLK_PD_Pos)                       /*!< CGU BASE_SPI_CLK: PD Mask           */\r
+#define CGU_BASE_SPI_CLK_AUTOBLOCK_Pos                        11                                                        /*!< CGU BASE_SPI_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SPI_CLK_AUTOBLOCK_Msk                        (0x01UL << CGU_BASE_SPI_CLK_AUTOBLOCK_Pos)                /*!< CGU BASE_SPI_CLK: AUTOBLOCK Mask    */\r
+#define CGU_BASE_SPI_CLK_CLK_SEL_Pos                          24                                                        /*!< CGU BASE_SPI_CLK: CLK_SEL Position  */\r
+#define CGU_BASE_SPI_CLK_CLK_SEL_Msk                          (0x1fUL << CGU_BASE_SPI_CLK_CLK_SEL_Pos)                  /*!< CGU BASE_SPI_CLK: CLK_SEL Mask      */\r
+\r
+// -----------------------------------  CGU_BASE_PHY_RX_CLK  --------------------------------------\r
+#define CGU_BASE_PHY_RX_CLK_PD_Pos                            0                                                         /*!< CGU BASE_PHY_RX_CLK: PD Position    */\r
+#define CGU_BASE_PHY_RX_CLK_PD_Msk                            (0x01UL << CGU_BASE_PHY_RX_CLK_PD_Pos)                    /*!< CGU BASE_PHY_RX_CLK: PD Mask        */\r
+#define CGU_BASE_PHY_RX_CLK_AUTOBLOCK_Pos                     11                                                        /*!< CGU BASE_PHY_RX_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_PHY_RX_CLK_AUTOBLOCK_Msk                     (0x01UL << CGU_BASE_PHY_RX_CLK_AUTOBLOCK_Pos)             /*!< CGU BASE_PHY_RX_CLK: AUTOBLOCK Mask */\r
+#define CGU_BASE_PHY_RX_CLK_CLK_SEL_Pos                       24                                                        /*!< CGU BASE_PHY_RX_CLK: CLK_SEL Position */\r
+#define CGU_BASE_PHY_RX_CLK_CLK_SEL_Msk                       (0x1fUL << CGU_BASE_PHY_RX_CLK_CLK_SEL_Pos)               /*!< CGU BASE_PHY_RX_CLK: CLK_SEL Mask   */\r
+\r
+// -----------------------------------  CGU_BASE_PHY_TX_CLK  --------------------------------------\r
+#define CGU_BASE_PHY_TX_CLK_PD_Pos                            0                                                         /*!< CGU BASE_PHY_TX_CLK: PD Position    */\r
+#define CGU_BASE_PHY_TX_CLK_PD_Msk                            (0x01UL << CGU_BASE_PHY_TX_CLK_PD_Pos)                    /*!< CGU BASE_PHY_TX_CLK: PD Mask        */\r
+#define CGU_BASE_PHY_TX_CLK_AUTOBLOCK_Pos                     11                                                        /*!< CGU BASE_PHY_TX_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_PHY_TX_CLK_AUTOBLOCK_Msk                     (0x01UL << CGU_BASE_PHY_TX_CLK_AUTOBLOCK_Pos)             /*!< CGU BASE_PHY_TX_CLK: AUTOBLOCK Mask */\r
+#define CGU_BASE_PHY_TX_CLK_CLK_SEL_Pos                       24                                                        /*!< CGU BASE_PHY_TX_CLK: CLK_SEL Position */\r
+#define CGU_BASE_PHY_TX_CLK_CLK_SEL_Msk                       (0x1fUL << CGU_BASE_PHY_TX_CLK_CLK_SEL_Pos)               /*!< CGU BASE_PHY_TX_CLK: CLK_SEL Mask   */\r
+\r
+// ------------------------------------  CGU_BASE_APB1_CLK  ---------------------------------------\r
+#define CGU_BASE_APB1_CLK_PD_Pos                              0                                                         /*!< CGU BASE_APB1_CLK: PD Position      */\r
+#define CGU_BASE_APB1_CLK_PD_Msk                              (0x01UL << CGU_BASE_APB1_CLK_PD_Pos)                      /*!< CGU BASE_APB1_CLK: PD Mask          */\r
+#define CGU_BASE_APB1_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_APB1_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_APB1_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_APB1_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_APB1_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_APB1_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_APB1_CLK: CLK_SEL Position */\r
+#define CGU_BASE_APB1_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_APB1_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_APB1_CLK: CLK_SEL Mask     */\r
+\r
+// ------------------------------------  CGU_BASE_APB3_CLK  ---------------------------------------\r
+#define CGU_BASE_APB3_CLK_PD_Pos                              0                                                         /*!< CGU BASE_APB3_CLK: PD Position      */\r
+#define CGU_BASE_APB3_CLK_PD_Msk                              (0x01UL << CGU_BASE_APB3_CLK_PD_Pos)                      /*!< CGU BASE_APB3_CLK: PD Mask          */\r
+#define CGU_BASE_APB3_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_APB3_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_APB3_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_APB3_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_APB3_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_APB3_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_APB3_CLK: CLK_SEL Position */\r
+#define CGU_BASE_APB3_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_APB3_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_APB3_CLK: CLK_SEL Mask     */\r
+\r
+// ------------------------------------  CGU_BASE_LCD_CLK  ----------------------------------------\r
+#define CGU_BASE_LCD_CLK_PD_Pos                               0                                                         /*!< CGU BASE_LCD_CLK: PD Position       */\r
+#define CGU_BASE_LCD_CLK_PD_Msk                               (0x01UL << CGU_BASE_LCD_CLK_PD_Pos)                       /*!< CGU BASE_LCD_CLK: PD Mask           */\r
+#define CGU_BASE_LCD_CLK_AUTOBLOCK_Pos                        11                                                        /*!< CGU BASE_LCD_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_LCD_CLK_AUTOBLOCK_Msk                        (0x01UL << CGU_BASE_LCD_CLK_AUTOBLOCK_Pos)                /*!< CGU BASE_LCD_CLK: AUTOBLOCK Mask    */\r
+#define CGU_BASE_LCD_CLK_CLK_SEL_Pos                          24                                                        /*!< CGU BASE_LCD_CLK: CLK_SEL Position  */\r
+#define CGU_BASE_LCD_CLK_CLK_SEL_Msk                          (0x1fUL << CGU_BASE_LCD_CLK_CLK_SEL_Pos)                  /*!< CGU BASE_LCD_CLK: CLK_SEL Mask      */\r
+\r
+// ------------------------------------  CGU_BASE_SDIO_CLK  ---------------------------------------\r
+#define CGU_BASE_SDIO_CLK_PD_Pos                              0                                                         /*!< CGU BASE_SDIO_CLK: PD Position      */\r
+#define CGU_BASE_SDIO_CLK_PD_Msk                              (0x01UL << CGU_BASE_SDIO_CLK_PD_Pos)                      /*!< CGU BASE_SDIO_CLK: PD Mask          */\r
+#define CGU_BASE_SDIO_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_SDIO_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SDIO_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_SDIO_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_SDIO_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_SDIO_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_SDIO_CLK: CLK_SEL Position */\r
+#define CGU_BASE_SDIO_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_SDIO_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_SDIO_CLK: CLK_SEL Mask     */\r
+\r
+// ------------------------------------  CGU_BASE_SSP0_CLK  ---------------------------------------\r
+#define CGU_BASE_SSP0_CLK_PD_Pos                              0                                                         /*!< CGU BASE_SSP0_CLK: PD Position      */\r
+#define CGU_BASE_SSP0_CLK_PD_Msk                              (0x01UL << CGU_BASE_SSP0_CLK_PD_Pos)                      /*!< CGU BASE_SSP0_CLK: PD Mask          */\r
+#define CGU_BASE_SSP0_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_SSP0_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SSP0_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_SSP0_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_SSP0_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_SSP0_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_SSP0_CLK: CLK_SEL Position */\r
+#define CGU_BASE_SSP0_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_SSP0_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_SSP0_CLK: CLK_SEL Mask     */\r
+\r
+// ------------------------------------  CGU_BASE_SSP1_CLK  ---------------------------------------\r
+#define CGU_BASE_SSP1_CLK_PD_Pos                              0                                                         /*!< CGU BASE_SSP1_CLK: PD Position      */\r
+#define CGU_BASE_SSP1_CLK_PD_Msk                              (0x01UL << CGU_BASE_SSP1_CLK_PD_Pos)                      /*!< CGU BASE_SSP1_CLK: PD Mask          */\r
+#define CGU_BASE_SSP1_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_SSP1_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_SSP1_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_SSP1_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_SSP1_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_SSP1_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_SSP1_CLK: CLK_SEL Position */\r
+#define CGU_BASE_SSP1_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_SSP1_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_SSP1_CLK: CLK_SEL Mask     */\r
+\r
+// -----------------------------------  CGU_BASE_UART0_CLK  ---------------------------------------\r
+#define CGU_BASE_UART0_CLK_PD_Pos                             0                                                         /*!< CGU BASE_UART0_CLK: PD Position     */\r
+#define CGU_BASE_UART0_CLK_PD_Msk                             (0x01UL << CGU_BASE_UART0_CLK_PD_Pos)                     /*!< CGU BASE_UART0_CLK: PD Mask         */\r
+#define CGU_BASE_UART0_CLK_AUTOBLOCK_Pos                      11                                                        /*!< CGU BASE_UART0_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_UART0_CLK_AUTOBLOCK_Msk                      (0x01UL << CGU_BASE_UART0_CLK_AUTOBLOCK_Pos)              /*!< CGU BASE_UART0_CLK: AUTOBLOCK Mask  */\r
+#define CGU_BASE_UART0_CLK_CLK_SEL_Pos                        24                                                        /*!< CGU BASE_UART0_CLK: CLK_SEL Position */\r
+#define CGU_BASE_UART0_CLK_CLK_SEL_Msk                        (0x1fUL << CGU_BASE_UART0_CLK_CLK_SEL_Pos)                /*!< CGU BASE_UART0_CLK: CLK_SEL Mask    */\r
+\r
+// -----------------------------------  CGU_BASE_UART1_CLK  ---------------------------------------\r
+#define CGU_BASE_UART1_CLK_PD_Pos                             0                                                         /*!< CGU BASE_UART1_CLK: PD Position     */\r
+#define CGU_BASE_UART1_CLK_PD_Msk                             (0x01UL << CGU_BASE_UART1_CLK_PD_Pos)                     /*!< CGU BASE_UART1_CLK: PD Mask         */\r
+#define CGU_BASE_UART1_CLK_AUTOBLOCK_Pos                      11                                                        /*!< CGU BASE_UART1_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_UART1_CLK_AUTOBLOCK_Msk                      (0x01UL << CGU_BASE_UART1_CLK_AUTOBLOCK_Pos)              /*!< CGU BASE_UART1_CLK: AUTOBLOCK Mask  */\r
+#define CGU_BASE_UART1_CLK_CLK_SEL_Pos                        24                                                        /*!< CGU BASE_UART1_CLK: CLK_SEL Position */\r
+#define CGU_BASE_UART1_CLK_CLK_SEL_Msk                        (0x1fUL << CGU_BASE_UART1_CLK_CLK_SEL_Pos)                /*!< CGU BASE_UART1_CLK: CLK_SEL Mask    */\r
+\r
+// -----------------------------------  CGU_BASE_UART2_CLK  ---------------------------------------\r
+#define CGU_BASE_UART2_CLK_PD_Pos                             0                                                         /*!< CGU BASE_UART2_CLK: PD Position     */\r
+#define CGU_BASE_UART2_CLK_PD_Msk                             (0x01UL << CGU_BASE_UART2_CLK_PD_Pos)                     /*!< CGU BASE_UART2_CLK: PD Mask         */\r
+#define CGU_BASE_UART2_CLK_AUTOBLOCK_Pos                      11                                                        /*!< CGU BASE_UART2_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_UART2_CLK_AUTOBLOCK_Msk                      (0x01UL << CGU_BASE_UART2_CLK_AUTOBLOCK_Pos)              /*!< CGU BASE_UART2_CLK: AUTOBLOCK Mask  */\r
+#define CGU_BASE_UART2_CLK_CLK_SEL_Pos                        24                                                        /*!< CGU BASE_UART2_CLK: CLK_SEL Position */\r
+#define CGU_BASE_UART2_CLK_CLK_SEL_Msk                        (0x1fUL << CGU_BASE_UART2_CLK_CLK_SEL_Pos)                /*!< CGU BASE_UART2_CLK: CLK_SEL Mask    */\r
+\r
+// -----------------------------------  CGU_BASE_UART3_CLK  ---------------------------------------\r
+#define CGU_BASE_UART3_CLK_PD_Pos                             0                                                         /*!< CGU BASE_UART3_CLK: PD Position     */\r
+#define CGU_BASE_UART3_CLK_PD_Msk                             (0x01UL << CGU_BASE_UART3_CLK_PD_Pos)                     /*!< CGU BASE_UART3_CLK: PD Mask         */\r
+#define CGU_BASE_UART3_CLK_AUTOBLOCK_Pos                      11                                                        /*!< CGU BASE_UART3_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_UART3_CLK_AUTOBLOCK_Msk                      (0x01UL << CGU_BASE_UART3_CLK_AUTOBLOCK_Pos)              /*!< CGU BASE_UART3_CLK: AUTOBLOCK Mask  */\r
+#define CGU_BASE_UART3_CLK_CLK_SEL_Pos                        24                                                        /*!< CGU BASE_UART3_CLK: CLK_SEL Position */\r
+#define CGU_BASE_UART3_CLK_CLK_SEL_Msk                        (0x1fUL << CGU_BASE_UART3_CLK_CLK_SEL_Pos)                /*!< CGU BASE_UART3_CLK: CLK_SEL Mask    */\r
+\r
+// ------------------------------------  CGU_BASE_OUT_CLK  ----------------------------------------\r
+#define CGU_BASE_OUT_CLK_PD_Pos                               0                                                         /*!< CGU BASE_OUT_CLK: PD Position       */\r
+#define CGU_BASE_OUT_CLK_PD_Msk                               (0x01UL << CGU_BASE_OUT_CLK_PD_Pos)                       /*!< CGU BASE_OUT_CLK: PD Mask           */\r
+#define CGU_BASE_OUT_CLK_AUTOBLOCK_Pos                        11                                                        /*!< CGU BASE_OUT_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_OUT_CLK_AUTOBLOCK_Msk                        (0x01UL << CGU_BASE_OUT_CLK_AUTOBLOCK_Pos)                /*!< CGU BASE_OUT_CLK: AUTOBLOCK Mask    */\r
+#define CGU_BASE_OUT_CLK_CLK_SEL_Pos                          24                                                        /*!< CGU BASE_OUT_CLK: CLK_SEL Position  */\r
+#define CGU_BASE_OUT_CLK_CLK_SEL_Msk                          (0x1fUL << CGU_BASE_OUT_CLK_CLK_SEL_Pos)                  /*!< CGU BASE_OUT_CLK: CLK_SEL Mask      */\r
+\r
+// ------------------------------------  CGU_BASE_APLL_CLK  ---------------------------------------\r
+#define CGU_BASE_APLL_CLK_PD_Pos                              0                                                         /*!< CGU BASE_APLL_CLK: PD Position      */\r
+#define CGU_BASE_APLL_CLK_PD_Msk                              (0x01UL << CGU_BASE_APLL_CLK_PD_Pos)                      /*!< CGU BASE_APLL_CLK: PD Mask          */\r
+#define CGU_BASE_APLL_CLK_AUTOBLOCK_Pos                       11                                                        /*!< CGU BASE_APLL_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_APLL_CLK_AUTOBLOCK_Msk                       (0x01UL << CGU_BASE_APLL_CLK_AUTOBLOCK_Pos)               /*!< CGU BASE_APLL_CLK: AUTOBLOCK Mask   */\r
+#define CGU_BASE_APLL_CLK_CLK_SEL_Pos                         24                                                        /*!< CGU BASE_APLL_CLK: CLK_SEL Position */\r
+#define CGU_BASE_APLL_CLK_CLK_SEL_Msk                         (0x1fUL << CGU_BASE_APLL_CLK_CLK_SEL_Pos)                 /*!< CGU BASE_APLL_CLK: CLK_SEL Mask     */\r
+\r
+// ----------------------------------  CGU_BASE_CGU_OUT0_CLK  -------------------------------------\r
+#define CGU_BASE_CGU_OUT0_CLK_PD_Pos                          0                                                         /*!< CGU BASE_CGU_OUT0_CLK: PD Position  */\r
+#define CGU_BASE_CGU_OUT0_CLK_PD_Msk                          (0x01UL << CGU_BASE_CGU_OUT0_CLK_PD_Pos)                  /*!< CGU BASE_CGU_OUT0_CLK: PD Mask      */\r
+#define CGU_BASE_CGU_OUT0_CLK_AUTOBLOCK_Pos                   11                                                        /*!< CGU BASE_CGU_OUT0_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_CGU_OUT0_CLK_AUTOBLOCK_Msk                   (0x01UL << CGU_BASE_CGU_OUT0_CLK_AUTOBLOCK_Pos)           /*!< CGU BASE_CGU_OUT0_CLK: AUTOBLOCK Mask */\r
+#define CGU_BASE_CGU_OUT0_CLK_CLK_SEL_Pos                     24                                                        /*!< CGU BASE_CGU_OUT0_CLK: CLK_SEL Position */\r
+#define CGU_BASE_CGU_OUT0_CLK_CLK_SEL_Msk                     (0x1fUL << CGU_BASE_CGU_OUT0_CLK_CLK_SEL_Pos)             /*!< CGU BASE_CGU_OUT0_CLK: CLK_SEL Mask */\r
+\r
+// ----------------------------------  CGU_BASE_CGU_OUT1_CLK  -------------------------------------\r
+#define CGU_BASE_CGU_OUT1_CLK_PD_Pos                          0                                                         /*!< CGU BASE_CGU_OUT1_CLK: PD Position  */\r
+#define CGU_BASE_CGU_OUT1_CLK_PD_Msk                          (0x01UL << CGU_BASE_CGU_OUT1_CLK_PD_Pos)                  /*!< CGU BASE_CGU_OUT1_CLK: PD Mask      */\r
+#define CGU_BASE_CGU_OUT1_CLK_AUTOBLOCK_Pos                   11                                                        /*!< CGU BASE_CGU_OUT1_CLK: AUTOBLOCK Position */\r
+#define CGU_BASE_CGU_OUT1_CLK_AUTOBLOCK_Msk                   (0x01UL << CGU_BASE_CGU_OUT1_CLK_AUTOBLOCK_Pos)           /*!< CGU BASE_CGU_OUT1_CLK: AUTOBLOCK Mask */\r
+#define CGU_BASE_CGU_OUT1_CLK_CLK_SEL_Pos                     24                                                        /*!< CGU BASE_CGU_OUT1_CLK: CLK_SEL Position */\r
+#define CGU_BASE_CGU_OUT1_CLK_CLK_SEL_Msk                     (0x1fUL << CGU_BASE_CGU_OUT1_CLK_CLK_SEL_Pos)             /*!< CGU BASE_CGU_OUT1_CLK: CLK_SEL Mask */\r
+\r
+// -------------------------------------  CGU_IDIVC_CTRL  -----------------------------------------\r
+#define CGU_IDIVC_CTRL_PD_Pos                                 0                                                         /*!< CGU IDIVC_CTRL: PD Position         */\r
+#define CGU_IDIVC_CTRL_PD_Msk                                 (0x01UL << CGU_IDIVC_CTRL_PD_Pos)                         /*!< CGU IDIVC_CTRL: PD Mask             */\r
+#define CGU_IDIVC_CTRL_IDIV_Pos                               2                                                         /*!< CGU IDIVC_CTRL: IDIV Position       */\r
+#define CGU_IDIVC_CTRL_IDIV_Msk                               (0x0fUL << CGU_IDIVC_CTRL_IDIV_Pos)                       /*!< CGU IDIVC_CTRL: IDIV Mask           */\r
+#define CGU_IDIVC_CTRL_AUTOBLOCK_Pos                          11                                                        /*!< CGU IDIVC_CTRL: AUTOBLOCK Position  */\r
+#define CGU_IDIVC_CTRL_AUTOBLOCK_Msk                          (0x01UL << CGU_IDIVC_CTRL_AUTOBLOCK_Pos)                  /*!< CGU IDIVC_CTRL: AUTOBLOCK Mask      */\r
+#define CGU_IDIVC_CTRL_CLK_SEL_Pos                            24                                                        /*!< CGU IDIVC_CTRL: CLK_SEL Position    */\r
+#define CGU_IDIVC_CTRL_CLK_SEL_Msk                            (0x1fUL << CGU_IDIVC_CTRL_CLK_SEL_Pos)                    /*!< CGU IDIVC_CTRL: CLK_SEL Mask        */\r
+\r
+// -------------------------------------  CGU_IDIVD_CTRL  -----------------------------------------\r
+#define CGU_IDIVD_CTRL_PD_Pos                                 0                                                         /*!< CGU IDIVD_CTRL: PD Position         */\r
+#define CGU_IDIVD_CTRL_PD_Msk                                 (0x01UL << CGU_IDIVD_CTRL_PD_Pos)                         /*!< CGU IDIVD_CTRL: PD Mask             */\r
+#define CGU_IDIVD_CTRL_IDIV_Pos                               2                                                         /*!< CGU IDIVD_CTRL: IDIV Position       */\r
+#define CGU_IDIVD_CTRL_IDIV_Msk                               (0x0fUL << CGU_IDIVD_CTRL_IDIV_Pos)                       /*!< CGU IDIVD_CTRL: IDIV Mask           */\r
+#define CGU_IDIVD_CTRL_AUTOBLOCK_Pos                          11                                                        /*!< CGU IDIVD_CTRL: AUTOBLOCK Position  */\r
+#define CGU_IDIVD_CTRL_AUTOBLOCK_Msk                          (0x01UL << CGU_IDIVD_CTRL_AUTOBLOCK_Pos)                  /*!< CGU IDIVD_CTRL: AUTOBLOCK Mask      */\r
+#define CGU_IDIVD_CTRL_CLK_SEL_Pos                            24                                                        /*!< CGU IDIVD_CTRL: CLK_SEL Position    */\r
+#define CGU_IDIVD_CTRL_CLK_SEL_Msk                            (0x1fUL << CGU_IDIVD_CTRL_CLK_SEL_Pos)                    /*!< CGU IDIVD_CTRL: CLK_SEL Mask        */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 CCU1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  CCU1_PM  --------------------------------------------\r
+#define CCU1_PM_PD_Pos                                        0                                                         /*!< CCU1 PM: PD Position                */\r
+#define CCU1_PM_PD_Msk                                        (0x01UL << CCU1_PM_PD_Pos)                                /*!< CCU1 PM: PD Mask                    */\r
+\r
+// -------------------------------------  CCU1_BASE_STAT  -----------------------------------------\r
+#define CCU1_BASE_STAT_BASE_APB3_CLK_IND_Pos                  0                                                         /*!< CCU1 BASE_STAT: BASE_APB3_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_APB3_CLK_IND_Msk                  (0x01UL << CCU1_BASE_STAT_BASE_APB3_CLK_IND_Pos)          /*!< CCU1 BASE_STAT: BASE_APB3_CLK_IND Mask */\r
+#define CCU1_BASE_STAT_BASE_APB1_CLK_IND_Pos                  1                                                         /*!< CCU1 BASE_STAT: BASE_APB1_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_APB1_CLK_IND_Msk                  (0x01UL << CCU1_BASE_STAT_BASE_APB1_CLK_IND_Pos)          /*!< CCU1 BASE_STAT: BASE_APB1_CLK_IND Mask */\r
+#define CCU1_BASE_STAT_BASE_SPIFI_CLK_IND_Pos                 2                                                         /*!< CCU1 BASE_STAT: BASE_SPIFI_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_SPIFI_CLK_IND_Msk                 (0x01UL << CCU1_BASE_STAT_BASE_SPIFI_CLK_IND_Pos)         /*!< CCU1 BASE_STAT: BASE_SPIFI_CLK_IND Mask */\r
+#define CCU1_BASE_STAT_BASE_M3_CLK_IND_Pos                    3                                                         /*!< CCU1 BASE_STAT: BASE_M3_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_M3_CLK_IND_Msk                    (0x01UL << CCU1_BASE_STAT_BASE_M3_CLK_IND_Pos)            /*!< CCU1 BASE_STAT: BASE_M3_CLK_IND Mask */\r
+#define CCU1_BASE_STAT_BASE_USB0_CLK_IND_Pos                  7                                                         /*!< CCU1 BASE_STAT: BASE_USB0_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_USB0_CLK_IND_Msk                  (0x01UL << CCU1_BASE_STAT_BASE_USB0_CLK_IND_Pos)          /*!< CCU1 BASE_STAT: BASE_USB0_CLK_IND Mask */\r
+#define CCU1_BASE_STAT_BASE_USB1_CLK_IND_Pos                  8                                                         /*!< CCU1 BASE_STAT: BASE_USB1_CLK_IND Position */\r
+#define CCU1_BASE_STAT_BASE_USB1_CLK_IND_Msk                  (0x01UL << CCU1_BASE_STAT_BASE_USB1_CLK_IND_Pos)          /*!< CCU1 BASE_STAT: BASE_USB1_CLK_IND Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_APB3_BUS_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_BUS_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_APB3_BUS_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_BUS_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_APB3_BUS_CFG_RUN_Pos)                 /*!< CCU1 CLK_APB3_BUS_CFG: RUN Mask     */\r
+#define CCU1_CLK_APB3_BUS_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_APB3_BUS_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_BUS_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_APB3_BUS_CFG_AUTO_Pos)                /*!< CCU1 CLK_APB3_BUS_CFG: AUTO Mask    */\r
+#define CCU1_CLK_APB3_BUS_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_APB3_BUS_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_BUS_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_APB3_BUS_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_APB3_BUS_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_BUS_STAT  -------------------------------------\r
+#define CCU1_CLK_APB3_BUS_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_BUS_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_BUS_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_BUS_STAT_RUN_Pos)                /*!< CCU1 CLK_APB3_BUS_STAT: RUN Mask    */\r
+#define CCU1_CLK_APB3_BUS_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_BUS_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_BUS_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_BUS_STAT_AUTO_Pos)               /*!< CCU1 CLK_APB3_BUS_STAT: AUTO Mask   */\r
+#define CCU1_CLK_APB3_BUS_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_BUS_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_BUS_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_BUS_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_BUS_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_I2C1_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_I2C1_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_I2C1_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_I2C1_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_I2C1_CFG_RUN_Pos)                /*!< CCU1 CLK_APB3_I2C1_CFG: RUN Mask    */\r
+#define CCU1_CLK_APB3_I2C1_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_I2C1_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_I2C1_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_I2C1_CFG_AUTO_Pos)               /*!< CCU1 CLK_APB3_I2C1_CFG: AUTO Mask   */\r
+#define CCU1_CLK_APB3_I2C1_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_I2C1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_I2C1_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_I2C1_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_I2C1_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_I2C1_STAT  ------------------------------------\r
+#define CCU1_CLK_APB3_I2C1_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB3_I2C1_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_I2C1_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB3_I2C1_STAT_RUN_Pos)               /*!< CCU1 CLK_APB3_I2C1_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB3_I2C1_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB3_I2C1_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_I2C1_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB3_I2C1_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB3_I2C1_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB3_I2C1_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB3_I2C1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_I2C1_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB3_I2C1_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB3_I2C1_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_APB3_DAC_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_DAC_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_APB3_DAC_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_DAC_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_APB3_DAC_CFG_RUN_Pos)                 /*!< CCU1 CLK_APB3_DAC_CFG: RUN Mask     */\r
+#define CCU1_CLK_APB3_DAC_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_APB3_DAC_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_DAC_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_APB3_DAC_CFG_AUTO_Pos)                /*!< CCU1 CLK_APB3_DAC_CFG: AUTO Mask    */\r
+#define CCU1_CLK_APB3_DAC_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_APB3_DAC_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_DAC_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_APB3_DAC_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_APB3_DAC_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_DAC_STAT  -------------------------------------\r
+#define CCU1_CLK_APB3_DAC_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_DAC_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_DAC_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_DAC_STAT_RUN_Pos)                /*!< CCU1 CLK_APB3_DAC_STAT: RUN Mask    */\r
+#define CCU1_CLK_APB3_DAC_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_DAC_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_DAC_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_DAC_STAT_AUTO_Pos)               /*!< CCU1 CLK_APB3_DAC_STAT: AUTO Mask   */\r
+#define CCU1_CLK_APB3_DAC_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_DAC_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_DAC_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_DAC_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_DAC_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_ADC0_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_ADC0_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_ADC0_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_ADC0_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_ADC0_CFG_RUN_Pos)                /*!< CCU1 CLK_APB3_ADC0_CFG: RUN Mask    */\r
+#define CCU1_CLK_APB3_ADC0_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_ADC0_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_ADC0_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_ADC0_CFG_AUTO_Pos)               /*!< CCU1 CLK_APB3_ADC0_CFG: AUTO Mask   */\r
+#define CCU1_CLK_APB3_ADC0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_ADC0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_ADC0_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_ADC0_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_ADC0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_ADC0_STAT  ------------------------------------\r
+#define CCU1_CLK_APB3_ADC0_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB3_ADC0_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_ADC0_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB3_ADC0_STAT_RUN_Pos)               /*!< CCU1 CLK_APB3_ADC0_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB3_ADC0_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB3_ADC0_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_ADC0_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB3_ADC0_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB3_ADC0_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB3_ADC0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB3_ADC0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_ADC0_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB3_ADC0_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB3_ADC0_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_ADC1_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_ADC1_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_ADC1_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_ADC1_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_ADC1_CFG_RUN_Pos)                /*!< CCU1 CLK_APB3_ADC1_CFG: RUN Mask    */\r
+#define CCU1_CLK_APB3_ADC1_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_ADC1_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_ADC1_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_ADC1_CFG_AUTO_Pos)               /*!< CCU1 CLK_APB3_ADC1_CFG: AUTO Mask   */\r
+#define CCU1_CLK_APB3_ADC1_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_ADC1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_ADC1_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_ADC1_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_ADC1_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_ADC1_STAT  ------------------------------------\r
+#define CCU1_CLK_APB3_ADC1_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB3_ADC1_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_ADC1_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB3_ADC1_STAT_RUN_Pos)               /*!< CCU1 CLK_APB3_ADC1_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB3_ADC1_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB3_ADC1_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_ADC1_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB3_ADC1_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB3_ADC1_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB3_ADC1_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB3_ADC1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_ADC1_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB3_ADC1_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB3_ADC1_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_CAN0_CFG  -------------------------------------\r
+#define CCU1_CLK_APB3_CAN0_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB3_CAN0_CFG: RUN Position */\r
+#define CCU1_CLK_APB3_CAN0_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_APB3_CAN0_CFG_RUN_Pos)                /*!< CCU1 CLK_APB3_CAN0_CFG: RUN Mask    */\r
+#define CCU1_CLK_APB3_CAN0_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB3_CAN0_CFG: AUTO Position */\r
+#define CCU1_CLK_APB3_CAN0_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_APB3_CAN0_CFG_AUTO_Pos)               /*!< CCU1 CLK_APB3_CAN0_CFG: AUTO Mask   */\r
+#define CCU1_CLK_APB3_CAN0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB3_CAN0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB3_CAN0_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB3_CAN0_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_APB3_CAN0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB3_CAN0_STAT  ------------------------------------\r
+#define CCU1_CLK_APB3_CAN0_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB3_CAN0_STAT: RUN Position */\r
+#define CCU1_CLK_APB3_CAN0_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB3_CAN0_STAT_RUN_Pos)               /*!< CCU1 CLK_APB3_CAN0_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB3_CAN0_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB3_CAN0_STAT: AUTO Position */\r
+#define CCU1_CLK_APB3_CAN0_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB3_CAN0_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB3_CAN0_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB3_CAN0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB3_CAN0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB3_CAN0_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB3_CAN0_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB3_CAN0_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_APB1_BUS_CFG  -------------------------------------\r
+#define CCU1_CLK_APB1_BUS_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_APB1_BUS_CFG: RUN Position */\r
+#define CCU1_CLK_APB1_BUS_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_APB1_BUS_CFG_RUN_Pos)                 /*!< CCU1 CLK_APB1_BUS_CFG: RUN Mask     */\r
+#define CCU1_CLK_APB1_BUS_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_APB1_BUS_CFG: AUTO Position */\r
+#define CCU1_CLK_APB1_BUS_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_APB1_BUS_CFG_AUTO_Pos)                /*!< CCU1 CLK_APB1_BUS_CFG: AUTO Mask    */\r
+#define CCU1_CLK_APB1_BUS_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_APB1_BUS_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB1_BUS_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_APB1_BUS_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_APB1_BUS_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_APB1_BUS_STAT  -------------------------------------\r
+#define CCU1_CLK_APB1_BUS_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB1_BUS_STAT: RUN Position */\r
+#define CCU1_CLK_APB1_BUS_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_APB1_BUS_STAT_RUN_Pos)                /*!< CCU1 CLK_APB1_BUS_STAT: RUN Mask    */\r
+#define CCU1_CLK_APB1_BUS_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB1_BUS_STAT: AUTO Position */\r
+#define CCU1_CLK_APB1_BUS_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_APB1_BUS_STAT_AUTO_Pos)               /*!< CCU1 CLK_APB1_BUS_STAT: AUTO Mask   */\r
+#define CCU1_CLK_APB1_BUS_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB1_BUS_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB1_BUS_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB1_BUS_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_APB1_BUS_STAT: WAKEUP Mask */\r
+\r
+// ------------------------------  CCU1_CLK_APB1_MOTOCONPWM_CFG  ----------------------------------\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_RUN_Pos                  0                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: RUN Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_RUN_Msk                  (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_CFG_RUN_Pos)          /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: RUN Mask */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_AUTO_Pos                 1                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: AUTO Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_AUTO_Msk                 (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_CFG_AUTO_Pos)         /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: AUTO Mask */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_WAKEUP_Pos               2                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_CFG_WAKEUP_Msk               (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_CFG_WAKEUP_Pos)       /*!< CCU1 CLK_APB1_MOTOCONPWM_CFG: WAKEUP Mask */\r
+\r
+// ------------------------------  CCU1_CLK_APB1_MOTOCONPWM_STAT  ---------------------------------\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_RUN_Pos                 0                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: RUN Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_RUN_Msk                 (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_STAT_RUN_Pos)         /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: RUN Mask */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_AUTO_Pos                1                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: AUTO Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_AUTO_Msk                (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_STAT_AUTO_Pos)        /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: AUTO Mask */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_WAKEUP_Pos              2                                                         /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB1_MOTOCONPWM_STAT_WAKEUP_Msk              (0x01UL << CCU1_CLK_APB1_MOTOCONPWM_STAT_WAKEUP_Pos)      /*!< CCU1 CLK_APB1_MOTOCONPWM_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_ABP1_I2C0_CFG  -------------------------------------\r
+#define CCU1_CLK_ABP1_I2C0_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_ABP1_I2C0_CFG: RUN Position */\r
+#define CCU1_CLK_ABP1_I2C0_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_ABP1_I2C0_CFG_RUN_Pos)                /*!< CCU1 CLK_ABP1_I2C0_CFG: RUN Mask    */\r
+#define CCU1_CLK_ABP1_I2C0_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_ABP1_I2C0_CFG: AUTO Position */\r
+#define CCU1_CLK_ABP1_I2C0_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_ABP1_I2C0_CFG_AUTO_Pos)               /*!< CCU1 CLK_ABP1_I2C0_CFG: AUTO Mask   */\r
+#define CCU1_CLK_ABP1_I2C0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_ABP1_I2C0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_ABP1_I2C0_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_ABP1_I2C0_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_ABP1_I2C0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB1_I2C0_STAT  ------------------------------------\r
+#define CCU1_CLK_APB1_I2C0_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB1_I2C0_STAT: RUN Position */\r
+#define CCU1_CLK_APB1_I2C0_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB1_I2C0_STAT_RUN_Pos)               /*!< CCU1 CLK_APB1_I2C0_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB1_I2C0_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB1_I2C0_STAT: AUTO Position */\r
+#define CCU1_CLK_APB1_I2C0_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB1_I2C0_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB1_I2C0_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB1_I2C0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB1_I2C0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB1_I2C0_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB1_I2C0_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB1_I2C0_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_APB1_I2S_CFG  -------------------------------------\r
+#define CCU1_CLK_APB1_I2S_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_APB1_I2S_CFG: RUN Position */\r
+#define CCU1_CLK_APB1_I2S_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_APB1_I2S_CFG_RUN_Pos)                 /*!< CCU1 CLK_APB1_I2S_CFG: RUN Mask     */\r
+#define CCU1_CLK_APB1_I2S_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_APB1_I2S_CFG: AUTO Position */\r
+#define CCU1_CLK_APB1_I2S_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_APB1_I2S_CFG_AUTO_Pos)                /*!< CCU1 CLK_APB1_I2S_CFG: AUTO Mask    */\r
+#define CCU1_CLK_APB1_I2S_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_APB1_I2S_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB1_I2S_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_APB1_I2S_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_APB1_I2S_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_APB1_I2S_STAT  -------------------------------------\r
+#define CCU1_CLK_APB1_I2S_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB1_I2S_STAT: RUN Position */\r
+#define CCU1_CLK_APB1_I2S_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_APB1_I2S_STAT_RUN_Pos)                /*!< CCU1 CLK_APB1_I2S_STAT: RUN Mask    */\r
+#define CCU1_CLK_APB1_I2S_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB1_I2S_STAT: AUTO Position */\r
+#define CCU1_CLK_APB1_I2S_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_APB1_I2S_STAT_AUTO_Pos)               /*!< CCU1 CLK_APB1_I2S_STAT: AUTO Mask   */\r
+#define CCU1_CLK_APB1_I2S_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB1_I2S_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB1_I2S_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB1_I2S_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_APB1_I2S_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB1_CAN1_CFG  -------------------------------------\r
+#define CCU1_CLK_APB1_CAN1_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_APB1_CAN1_CFG: RUN Position */\r
+#define CCU1_CLK_APB1_CAN1_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_APB1_CAN1_CFG_RUN_Pos)                /*!< CCU1 CLK_APB1_CAN1_CFG: RUN Mask    */\r
+#define CCU1_CLK_APB1_CAN1_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_APB1_CAN1_CFG: AUTO Position */\r
+#define CCU1_CLK_APB1_CAN1_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_APB1_CAN1_CFG_AUTO_Pos)               /*!< CCU1 CLK_APB1_CAN1_CFG: AUTO Mask   */\r
+#define CCU1_CLK_APB1_CAN1_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_APB1_CAN1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_APB1_CAN1_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_APB1_CAN1_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_APB1_CAN1_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_APB1_CAN1_STAT  ------------------------------------\r
+#define CCU1_CLK_APB1_CAN1_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_APB1_CAN1_STAT: RUN Position */\r
+#define CCU1_CLK_APB1_CAN1_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_APB1_CAN1_STAT_RUN_Pos)               /*!< CCU1 CLK_APB1_CAN1_STAT: RUN Mask   */\r
+#define CCU1_CLK_APB1_CAN1_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_APB1_CAN1_STAT: AUTO Position */\r
+#define CCU1_CLK_APB1_CAN1_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_APB1_CAN1_STAT_AUTO_Pos)              /*!< CCU1 CLK_APB1_CAN1_STAT: AUTO Mask  */\r
+#define CCU1_CLK_APB1_CAN1_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_APB1_CAN1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_APB1_CAN1_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_APB1_CAN1_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_APB1_CAN1_STAT: WAKEUP Mask */\r
+\r
+// -----------------------------------  CCU1_CLK_SPIFI_CFG  ---------------------------------------\r
+#define CCU1_CLK_SPIFI_CFG_RUN_Pos                            0                                                         /*!< CCU1 CLK_SPIFI_CFG: RUN Position    */\r
+#define CCU1_CLK_SPIFI_CFG_RUN_Msk                            (0x01UL << CCU1_CLK_SPIFI_CFG_RUN_Pos)                    /*!< CCU1 CLK_SPIFI_CFG: RUN Mask        */\r
+#define CCU1_CLK_SPIFI_CFG_AUTO_Pos                           1                                                         /*!< CCU1 CLK_SPIFI_CFG: AUTO Position   */\r
+#define CCU1_CLK_SPIFI_CFG_AUTO_Msk                           (0x01UL << CCU1_CLK_SPIFI_CFG_AUTO_Pos)                   /*!< CCU1 CLK_SPIFI_CFG: AUTO Mask       */\r
+#define CCU1_CLK_SPIFI_CFG_WAKEUP_Pos                         2                                                         /*!< CCU1 CLK_SPIFI_CFG: WAKEUP Position */\r
+#define CCU1_CLK_SPIFI_CFG_WAKEUP_Msk                         (0x01UL << CCU1_CLK_SPIFI_CFG_WAKEUP_Pos)                 /*!< CCU1 CLK_SPIFI_CFG: WAKEUP Mask     */\r
+\r
+// -----------------------------------  CCU1_CLK_SPIFI_STAT  --------------------------------------\r
+#define CCU1_CLK_SPIFI_STAT_RUN_Pos                           0                                                         /*!< CCU1 CLK_SPIFI_STAT: RUN Position   */\r
+#define CCU1_CLK_SPIFI_STAT_RUN_Msk                           (0x01UL << CCU1_CLK_SPIFI_STAT_RUN_Pos)                   /*!< CCU1 CLK_SPIFI_STAT: RUN Mask       */\r
+#define CCU1_CLK_SPIFI_STAT_AUTO_Pos                          1                                                         /*!< CCU1 CLK_SPIFI_STAT: AUTO Position  */\r
+#define CCU1_CLK_SPIFI_STAT_AUTO_Msk                          (0x01UL << CCU1_CLK_SPIFI_STAT_AUTO_Pos)                  /*!< CCU1 CLK_SPIFI_STAT: AUTO Mask      */\r
+#define CCU1_CLK_SPIFI_STAT_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_SPIFI_STAT: WAKEUP Position */\r
+#define CCU1_CLK_SPIFI_STAT_WAKEUP_Msk                        (0x01UL << CCU1_CLK_SPIFI_STAT_WAKEUP_Pos)                /*!< CCU1 CLK_SPIFI_STAT: WAKEUP Mask    */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_BUS_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_BUS_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_BUS_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_BUS_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_BUS_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_BUS_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_BUS_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_BUS_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_BUS_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_BUS_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_BUS_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_BUS_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_BUS_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_BUS_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_BUS_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_BUS_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_BUS_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_BUS_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_BUS_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_BUS_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_BUS_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_BUS_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_BUS_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_BUS_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_BUS_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_BUS_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_BUS_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_BUS_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_BUS_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_BUS_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_BUS_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_BUS_STAT: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SPIFI_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_SPIFI_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_SPIFI_CFG: RUN Position */\r
+#define CCU1_CLK_M3_SPIFI_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_M3_SPIFI_CFG_RUN_Pos)                 /*!< CCU1 CLK_M3_SPIFI_CFG: RUN Mask     */\r
+#define CCU1_CLK_M3_SPIFI_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_SPIFI_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_SPIFI_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_SPIFI_CFG_AUTO_Pos)                /*!< CCU1 CLK_M3_SPIFI_CFG: AUTO Mask    */\r
+#define CCU1_CLK_M3_SPIFI_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_SPIFI_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SPIFI_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_SPIFI_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_M3_SPIFI_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_SPIFI_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_SPIFI_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_SPIFI_STAT: RUN Position */\r
+#define CCU1_CLK_M3_SPIFI_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_M3_SPIFI_STAT_RUN_Pos)                /*!< CCU1 CLK_M3_SPIFI_STAT: RUN Mask    */\r
+#define CCU1_CLK_M3_SPIFI_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_SPIFI_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SPIFI_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_SPIFI_STAT_AUTO_Pos)               /*!< CCU1 CLK_M3_SPIFI_STAT: AUTO Mask   */\r
+#define CCU1_CLK_M3_SPIFI_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_SPIFI_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SPIFI_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_SPIFI_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_M3_SPIFI_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_GPIO_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_GPIO_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_GPIO_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_GPIO_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_GPIO_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_GPIO_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_GPIO_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_GPIO_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_GPIO_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_GPIO_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_GPIO_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_GPIO_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_GPIO_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_GPIO_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_GPIO_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_GPIO_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_GPIO_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_GPIO_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_GPIO_STAT: RUN Position */\r
+#define CCU1_CLK_M3_GPIO_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_GPIO_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_GPIO_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_GPIO_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_GPIO_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_GPIO_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_GPIO_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_GPIO_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_GPIO_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_GPIO_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_GPIO_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_GPIO_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_GPIO_STAT: WAKEUP Mask  */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_LCD_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_LCD_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_LCD_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_LCD_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_LCD_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_LCD_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_LCD_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_LCD_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_LCD_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_LCD_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_LCD_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_LCD_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_LCD_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_LCD_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_LCD_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_LCD_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_LCD_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_LCD_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_LCD_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_LCD_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_LCD_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_LCD_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_LCD_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_LCD_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_LCD_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_LCD_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_LCD_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_LCD_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_LCD_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_LCD_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_LCD_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_LCD_STAT: WAKEUP Mask   */\r
+\r
+// --------------------------------  CCU1_CLK_M3_ETHERNET_CFG  ------------------------------------\r
+#define CCU1_CLK_M3_ETHERNET_CFG_RUN_Pos                      0                                                         /*!< CCU1 CLK_M3_ETHERNET_CFG: RUN Position */\r
+#define CCU1_CLK_M3_ETHERNET_CFG_RUN_Msk                      (0x01UL << CCU1_CLK_M3_ETHERNET_CFG_RUN_Pos)              /*!< CCU1 CLK_M3_ETHERNET_CFG: RUN Mask  */\r
+#define CCU1_CLK_M3_ETHERNET_CFG_AUTO_Pos                     1                                                         /*!< CCU1 CLK_M3_ETHERNET_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_ETHERNET_CFG_AUTO_Msk                     (0x01UL << CCU1_CLK_M3_ETHERNET_CFG_AUTO_Pos)             /*!< CCU1 CLK_M3_ETHERNET_CFG: AUTO Mask */\r
+#define CCU1_CLK_M3_ETHERNET_CFG_WAKEUP_Pos                   2                                                         /*!< CCU1 CLK_M3_ETHERNET_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_ETHERNET_CFG_WAKEUP_Msk                   (0x01UL << CCU1_CLK_M3_ETHERNET_CFG_WAKEUP_Pos)           /*!< CCU1 CLK_M3_ETHERNET_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU1_CLK_M3_ETHERNET_STAT  -----------------------------------\r
+#define CCU1_CLK_M3_ETHERNET_STAT_RUN_Pos                     0                                                         /*!< CCU1 CLK_M3_ETHERNET_STAT: RUN Position */\r
+#define CCU1_CLK_M3_ETHERNET_STAT_RUN_Msk                     (0x01UL << CCU1_CLK_M3_ETHERNET_STAT_RUN_Pos)             /*!< CCU1 CLK_M3_ETHERNET_STAT: RUN Mask */\r
+#define CCU1_CLK_M3_ETHERNET_STAT_AUTO_Pos                    1                                                         /*!< CCU1 CLK_M3_ETHERNET_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_ETHERNET_STAT_AUTO_Msk                    (0x01UL << CCU1_CLK_M3_ETHERNET_STAT_AUTO_Pos)            /*!< CCU1 CLK_M3_ETHERNET_STAT: AUTO Mask */\r
+#define CCU1_CLK_M3_ETHERNET_STAT_WAKEUP_Pos                  2                                                         /*!< CCU1 CLK_M3_ETHERNET_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_ETHERNET_STAT_WAKEUP_Msk                  (0x01UL << CCU1_CLK_M3_ETHERNET_STAT_WAKEUP_Pos)          /*!< CCU1 CLK_M3_ETHERNET_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_USB0_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_USB0_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_USB0_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_USB0_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_USB0_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_USB0_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_USB0_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_USB0_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_USB0_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_USB0_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_USB0_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_USB0_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_USB0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_USB0_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_USB0_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_USB0_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_USB0_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_USB0_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_USB0_STAT: RUN Position */\r
+#define CCU1_CLK_M3_USB0_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_USB0_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_USB0_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_USB0_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_USB0_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_USB0_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_USB0_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_USB0_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_USB0_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_USB0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_USB0_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_USB0_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_USB0_STAT: WAKEUP Mask  */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_EMC_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_EMC_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_EMC_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_EMC_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_EMC_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_EMC_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_EMC_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_EMC_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_EMC_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_EMC_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_EMC_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_EMC_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_EMC_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_EMC_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_EMC_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_EMC_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_EMC_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_EMC_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_EMC_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_EMC_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_EMC_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_EMC_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_EMC_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_EMC_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_EMC_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_EMC_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_EMC_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_EMC_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_EMC_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_EMC_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_EMC_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_EMC_STAT: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SDIO_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_SDIO_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_SDIO_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_SDIO_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_SDIO_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_SDIO_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_SDIO_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_SDIO_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_SDIO_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_SDIO_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_SDIO_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_SDIO_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_SDIO_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SDIO_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_SDIO_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_SDIO_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SDIO_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_SDIO_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_SDIO_STAT: RUN Position */\r
+#define CCU1_CLK_M3_SDIO_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_SDIO_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_SDIO_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_SDIO_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_SDIO_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SDIO_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_SDIO_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_SDIO_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_SDIO_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_SDIO_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SDIO_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_SDIO_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_SDIO_STAT: WAKEUP Mask  */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_DMA_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_DMA_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_DMA_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_DMA_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_DMA_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_DMA_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_DMA_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_DMA_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_DMA_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_DMA_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_DMA_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_DMA_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_DMA_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_DMA_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_DMA_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_DMA_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_DMA_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_DMA_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_DMA_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_DMA_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_DMA_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_DMA_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_DMA_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_DMA_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_DMA_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_DMA_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_DMA_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_DMA_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_DMA_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_DMA_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_DMA_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_DMA_STAT: WAKEUP Mask   */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_M3CORE_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_M3CORE_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_M3CORE_CFG: RUN Position */\r
+#define CCU1_CLK_M3_M3CORE_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_M3CORE_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_M3CORE_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_M3CORE_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_M3CORE_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_M3CORE_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_M3CORE_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_M3CORE_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_M3CORE_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_M3CORE_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_M3CORE_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_M3CORE_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_M3CORE_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_M3CORE_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_M3CORE_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_M3CORE_STAT: RUN Position */\r
+#define CCU1_CLK_M3_M3CORE_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_M3CORE_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_M3CORE_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_M3CORE_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_M3CORE_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_M3CORE_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_M3CORE_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_M3CORE_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_M3CORE_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_M3CORE_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_M3CORE_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_M3CORE_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_M3CORE_STAT: WAKEUP Mask */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_SCT_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_SCT_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_SCT_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_SCT_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_SCT_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_SCT_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_SCT_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_SCT_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_SCT_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_SCT_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_SCT_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_SCT_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_SCT_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SCT_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_SCT_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_SCT_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SCT_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_SCT_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_SCT_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_SCT_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_SCT_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_SCT_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_SCT_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_SCT_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SCT_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_SCT_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_SCT_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_SCT_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_SCT_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SCT_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_SCT_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_SCT_STAT: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_USB1_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_USB1_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_USB1_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_USB1_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_USB1_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_USB1_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_USB1_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_USB1_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_USB1_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_USB1_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_USB1_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_USB1_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_USB1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_USB1_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_USB1_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_USB1_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_USB1_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_USB1_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_USB1_STAT: RUN Position */\r
+#define CCU1_CLK_M3_USB1_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_USB1_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_USB1_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_USB1_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_USB1_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_USB1_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_USB1_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_USB1_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_USB1_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_USB1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_USB1_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_USB1_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_USB1_STAT: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_EMCDIV_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_EMCDIV_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_EMCDIV_CFG: RUN Position */\r
+#define CCU1_CLK_M3_EMCDIV_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_EMCDIV_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_EMCDIV_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_EMCDIV_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_EMCDIV_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_EMCDIV_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_EMCDIV_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_EMCDIV_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_EMCDIV_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_EMCDIV_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_EMCDIV_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_EMCDIV_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_EMCDIV_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_EMCDIV_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_EMCDIV_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_EMCDIV_STAT: RUN Position */\r
+#define CCU1_CLK_M3_EMCDIV_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_EMCDIV_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_EMCDIV_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_EMCDIV_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_EMCDIV_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_EMCDIV_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_EMCDIV_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_EMCDIV_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_EMCDIV_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_EMCDIV_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_EMCDIV_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_EMCDIV_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_EMCDIV_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_WWDT_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_WWDT_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_WWDT_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_WWDT_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_WWDT_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_WWDT_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_WWDT_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_WWDT_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_WWDT_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_WWDT_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_WWDT_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_WWDT_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_WWDT_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_WWDT_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_WWDT_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_WWDT_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_WWDT_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_WWDT_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_WWDT_STAT: RUN Position */\r
+#define CCU1_CLK_M3_WWDT_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_WWDT_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_WWDT_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_WWDT_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_WWDT_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_WWDT_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_WWDT_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_WWDT_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_WWDT_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_WWDT_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_WWDT_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_WWDT_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_WWDT_STAT: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART0_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_USART0_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_USART0_CFG: RUN Position */\r
+#define CCU1_CLK_M3_USART0_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_USART0_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_USART0_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_USART0_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_USART0_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_USART0_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_USART0_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_USART0_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_USART0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_USART0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART0_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_USART0_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_USART0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART0_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_USART0_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_USART0_STAT: RUN Position */\r
+#define CCU1_CLK_M3_USART0_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_USART0_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_USART0_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_USART0_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_USART0_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_USART0_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_USART0_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_USART0_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_USART0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_USART0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART0_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_USART0_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_USART0_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_UART1_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_UART1_CFG_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_UART1_CFG: RUN Position */\r
+#define CCU1_CLK_M3_UART1_CFG_RUN_Msk                         (0x01UL << CCU1_CLK_M3_UART1_CFG_RUN_Pos)                 /*!< CCU1 CLK_M3_UART1_CFG: RUN Mask     */\r
+#define CCU1_CLK_M3_UART1_CFG_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_UART1_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_UART1_CFG_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_UART1_CFG_AUTO_Pos)                /*!< CCU1 CLK_M3_UART1_CFG: AUTO Mask    */\r
+#define CCU1_CLK_M3_UART1_CFG_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_UART1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_UART1_CFG_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_UART1_CFG_WAKEUP_Pos)              /*!< CCU1 CLK_M3_UART1_CFG: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_UART1_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_UART1_STAT_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_UART1_STAT: RUN Position */\r
+#define CCU1_CLK_M3_UART1_STAT_RUN_Msk                        (0x01UL << CCU1_CLK_M3_UART1_STAT_RUN_Pos)                /*!< CCU1 CLK_M3_UART1_STAT: RUN Mask    */\r
+#define CCU1_CLK_M3_UART1_STAT_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_UART1_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_UART1_STAT_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_UART1_STAT_AUTO_Pos)               /*!< CCU1 CLK_M3_UART1_STAT: AUTO Mask   */\r
+#define CCU1_CLK_M3_UART1_STAT_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_UART1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_UART1_STAT_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_UART1_STAT_WAKEUP_Pos)             /*!< CCU1 CLK_M3_UART1_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SSP0_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_SSP0_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_SSP0_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_SSP0_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_SSP0_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_SSP0_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_SSP0_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_SSP0_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_SSP0_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_SSP0_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_SSP0_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_SSP0_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_SSP0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SSP0_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_SSP0_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_SSP0_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SSP0_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_SSP0_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_SSP0_STAT: RUN Position */\r
+#define CCU1_CLK_M3_SSP0_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_SSP0_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_SSP0_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_SSP0_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_SSP0_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SSP0_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_SSP0_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_SSP0_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_SSP0_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_SSP0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SSP0_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_SSP0_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_SSP0_STAT: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER0_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_TIMER0_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_TIMER0_CFG: RUN Position */\r
+#define CCU1_CLK_M3_TIMER0_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_TIMER0_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_TIMER0_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_TIMER0_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_TIMER0_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER0_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_TIMER0_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_TIMER0_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_TIMER0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_TIMER0_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER0_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_TIMER0_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_TIMER0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER0_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_TIMER0_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_TIMER0_STAT: RUN Position */\r
+#define CCU1_CLK_M3_TIMER0_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_TIMER0_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_TIMER0_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_TIMER0_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_TIMER0_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER0_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_TIMER0_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_TIMER0_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_TIMER0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_TIMER0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER0_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_TIMER0_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_TIMER0_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER1_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_TIMER1_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_TIMER1_CFG: RUN Position */\r
+#define CCU1_CLK_M3_TIMER1_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_TIMER1_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_TIMER1_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_TIMER1_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_TIMER1_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER1_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_TIMER1_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_TIMER1_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_TIMER1_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_TIMER1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER1_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_TIMER1_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_TIMER1_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER1_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_TIMER1_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_TIMER1_STAT: RUN Position */\r
+#define CCU1_CLK_M3_TIMER1_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_TIMER1_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_TIMER1_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_TIMER1_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_TIMER1_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER1_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_TIMER1_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_TIMER1_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_TIMER1_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_TIMER1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER1_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_TIMER1_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_TIMER1_STAT: WAKEUP Mask */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_SCU_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_SCU_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_SCU_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_SCU_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_SCU_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_SCU_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_SCU_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_SCU_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_SCU_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_SCU_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_SCU_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_SCU_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_SCU_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SCU_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_SCU_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_SCU_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SCU_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_SCU_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_SCU_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_SCU_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_SCU_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_SCU_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_SCU_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_SCU_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SCU_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_SCU_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_SCU_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_SCU_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_SCU_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SCU_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_SCU_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_SCU_STAT: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_CREG_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_CREG_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_CREG_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_CREG_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_CREG_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_CREG_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_CREG_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_CREG_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_CREG_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_CREG_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_CREG_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_CREG_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_CREG_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_CREG_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_CREG_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_CREG_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_CREG_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_CREG_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_CREG_STAT: RUN Position */\r
+#define CCU1_CLK_M3_CREG_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_CREG_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_CREG_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_CREG_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_CREG_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_CREG_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_CREG_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_CREG_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_CREG_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_CREG_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_CREG_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_CREG_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_CREG_STAT: WAKEUP Mask  */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_RITIMER_CFG  ------------------------------------\r
+#define CCU1_CLK_M3_RITIMER_CFG_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_RITIMER_CFG: RUN Position */\r
+#define CCU1_CLK_M3_RITIMER_CFG_RUN_Msk                       (0x01UL << CCU1_CLK_M3_RITIMER_CFG_RUN_Pos)               /*!< CCU1 CLK_M3_RITIMER_CFG: RUN Mask   */\r
+#define CCU1_CLK_M3_RITIMER_CFG_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_RITIMER_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_RITIMER_CFG_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_RITIMER_CFG_AUTO_Pos)              /*!< CCU1 CLK_M3_RITIMER_CFG: AUTO Mask  */\r
+#define CCU1_CLK_M3_RITIMER_CFG_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_RITIMER_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_RITIMER_CFG_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_RITIMER_CFG_WAKEUP_Pos)            /*!< CCU1 CLK_M3_RITIMER_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU1_CLK_M3_RITIMER_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_RITIMER_STAT_RUN_Pos                      0                                                         /*!< CCU1 CLK_M3_RITIMER_STAT: RUN Position */\r
+#define CCU1_CLK_M3_RITIMER_STAT_RUN_Msk                      (0x01UL << CCU1_CLK_M3_RITIMER_STAT_RUN_Pos)              /*!< CCU1 CLK_M3_RITIMER_STAT: RUN Mask  */\r
+#define CCU1_CLK_M3_RITIMER_STAT_AUTO_Pos                     1                                                         /*!< CCU1 CLK_M3_RITIMER_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_RITIMER_STAT_AUTO_Msk                     (0x01UL << CCU1_CLK_M3_RITIMER_STAT_AUTO_Pos)             /*!< CCU1 CLK_M3_RITIMER_STAT: AUTO Mask */\r
+#define CCU1_CLK_M3_RITIMER_STAT_WAKEUP_Pos                   2                                                         /*!< CCU1 CLK_M3_RITIMER_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_RITIMER_STAT_WAKEUP_Msk                   (0x01UL << CCU1_CLK_M3_RITIMER_STAT_WAKEUP_Pos)           /*!< CCU1 CLK_M3_RITIMER_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART2_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_USART2_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_USART2_CFG: RUN Position */\r
+#define CCU1_CLK_M3_USART2_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_USART2_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_USART2_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_USART2_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_USART2_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_USART2_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_USART2_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_USART2_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_USART2_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_USART2_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART2_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_USART2_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_USART2_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART2_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_USART2_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_USART2_STAT: RUN Position */\r
+#define CCU1_CLK_M3_USART2_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_USART2_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_USART2_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_USART2_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_USART2_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_USART2_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_USART2_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_USART2_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_USART2_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_USART2_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART2_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_USART2_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_USART2_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART3_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_USART3_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_USART3_CFG: RUN Position */\r
+#define CCU1_CLK_M3_USART3_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_USART3_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_USART3_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_USART3_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_USART3_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_USART3_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_USART3_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_USART3_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_USART3_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_USART3_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART3_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_USART3_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_USART3_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_USART3_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_USART3_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_USART3_STAT: RUN Position */\r
+#define CCU1_CLK_M3_USART3_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_USART3_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_USART3_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_USART3_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_USART3_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_USART3_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_USART3_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_USART3_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_USART3_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_USART3_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_USART3_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_USART3_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_USART3_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER2_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_TIMER2_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_TIMER2_CFG: RUN Position */\r
+#define CCU1_CLK_M3_TIMER2_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_TIMER2_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_TIMER2_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_TIMER2_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_TIMER2_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER2_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_TIMER2_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_TIMER2_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_TIMER2_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_TIMER2_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER2_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_TIMER2_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_TIMER2_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER2_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_TIMER2_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_TIMER2_STAT: RUN Position */\r
+#define CCU1_CLK_M3_TIMER2_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_TIMER2_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_TIMER2_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_TIMER2_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_TIMER2_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER2_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_TIMER2_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_TIMER2_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_TIMER2_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_TIMER2_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER2_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_TIMER2_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_TIMER2_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER3_CFG  -------------------------------------\r
+#define CCU1_CLK_M3_TIMER3_CFG_RUN_Pos                        0                                                         /*!< CCU1 CLK_M3_TIMER3_CFG: RUN Position */\r
+#define CCU1_CLK_M3_TIMER3_CFG_RUN_Msk                        (0x01UL << CCU1_CLK_M3_TIMER3_CFG_RUN_Pos)                /*!< CCU1 CLK_M3_TIMER3_CFG: RUN Mask    */\r
+#define CCU1_CLK_M3_TIMER3_CFG_AUTO_Pos                       1                                                         /*!< CCU1 CLK_M3_TIMER3_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER3_CFG_AUTO_Msk                       (0x01UL << CCU1_CLK_M3_TIMER3_CFG_AUTO_Pos)               /*!< CCU1 CLK_M3_TIMER3_CFG: AUTO Mask   */\r
+#define CCU1_CLK_M3_TIMER3_CFG_WAKEUP_Pos                     2                                                         /*!< CCU1 CLK_M3_TIMER3_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER3_CFG_WAKEUP_Msk                     (0x01UL << CCU1_CLK_M3_TIMER3_CFG_WAKEUP_Pos)             /*!< CCU1 CLK_M3_TIMER3_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU1_CLK_M3_TIMER3_STAT  ------------------------------------\r
+#define CCU1_CLK_M3_TIMER3_STAT_RUN_Pos                       0                                                         /*!< CCU1 CLK_M3_TIMER3_STAT: RUN Position */\r
+#define CCU1_CLK_M3_TIMER3_STAT_RUN_Msk                       (0x01UL << CCU1_CLK_M3_TIMER3_STAT_RUN_Pos)               /*!< CCU1 CLK_M3_TIMER3_STAT: RUN Mask   */\r
+#define CCU1_CLK_M3_TIMER3_STAT_AUTO_Pos                      1                                                         /*!< CCU1 CLK_M3_TIMER3_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_TIMER3_STAT_AUTO_Msk                      (0x01UL << CCU1_CLK_M3_TIMER3_STAT_AUTO_Pos)              /*!< CCU1 CLK_M3_TIMER3_STAT: AUTO Mask  */\r
+#define CCU1_CLK_M3_TIMER3_STAT_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_M3_TIMER3_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_TIMER3_STAT_WAKEUP_Msk                    (0x01UL << CCU1_CLK_M3_TIMER3_STAT_WAKEUP_Pos)            /*!< CCU1 CLK_M3_TIMER3_STAT: WAKEUP Mask */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SSP1_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_SSP1_CFG_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_SSP1_CFG: RUN Position  */\r
+#define CCU1_CLK_M3_SSP1_CFG_RUN_Msk                          (0x01UL << CCU1_CLK_M3_SSP1_CFG_RUN_Pos)                  /*!< CCU1 CLK_M3_SSP1_CFG: RUN Mask      */\r
+#define CCU1_CLK_M3_SSP1_CFG_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_SSP1_CFG: AUTO Position */\r
+#define CCU1_CLK_M3_SSP1_CFG_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_SSP1_CFG_AUTO_Pos)                 /*!< CCU1 CLK_M3_SSP1_CFG: AUTO Mask     */\r
+#define CCU1_CLK_M3_SSP1_CFG_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_SSP1_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_SSP1_CFG_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_SSP1_CFG_WAKEUP_Pos)               /*!< CCU1 CLK_M3_SSP1_CFG: WAKEUP Mask   */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_SSP1_STAT  -------------------------------------\r
+#define CCU1_CLK_M3_SSP1_STAT_RUN_Pos                         0                                                         /*!< CCU1 CLK_M3_SSP1_STAT: RUN Position */\r
+#define CCU1_CLK_M3_SSP1_STAT_RUN_Msk                         (0x01UL << CCU1_CLK_M3_SSP1_STAT_RUN_Pos)                 /*!< CCU1 CLK_M3_SSP1_STAT: RUN Mask     */\r
+#define CCU1_CLK_M3_SSP1_STAT_AUTO_Pos                        1                                                         /*!< CCU1 CLK_M3_SSP1_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_SSP1_STAT_AUTO_Msk                        (0x01UL << CCU1_CLK_M3_SSP1_STAT_AUTO_Pos)                /*!< CCU1 CLK_M3_SSP1_STAT: AUTO Mask    */\r
+#define CCU1_CLK_M3_SSP1_STAT_WAKEUP_Pos                      2                                                         /*!< CCU1 CLK_M3_SSP1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_SSP1_STAT_WAKEUP_Msk                      (0x01UL << CCU1_CLK_M3_SSP1_STAT_WAKEUP_Pos)              /*!< CCU1 CLK_M3_SSP1_STAT: WAKEUP Mask  */\r
+\r
+// -----------------------------------  CCU1_CLK_M3_QEI_CFG  --------------------------------------\r
+#define CCU1_CLK_M3_QEI_CFG_RUN_Pos                           0                                                         /*!< CCU1 CLK_M3_QEI_CFG: RUN Position   */\r
+#define CCU1_CLK_M3_QEI_CFG_RUN_Msk                           (0x01UL << CCU1_CLK_M3_QEI_CFG_RUN_Pos)                   /*!< CCU1 CLK_M3_QEI_CFG: RUN Mask       */\r
+#define CCU1_CLK_M3_QEI_CFG_AUTO_Pos                          1                                                         /*!< CCU1 CLK_M3_QEI_CFG: AUTO Position  */\r
+#define CCU1_CLK_M3_QEI_CFG_AUTO_Msk                          (0x01UL << CCU1_CLK_M3_QEI_CFG_AUTO_Pos)                  /*!< CCU1 CLK_M3_QEI_CFG: AUTO Mask      */\r
+#define CCU1_CLK_M3_QEI_CFG_WAKEUP_Pos                        2                                                         /*!< CCU1 CLK_M3_QEI_CFG: WAKEUP Position */\r
+#define CCU1_CLK_M3_QEI_CFG_WAKEUP_Msk                        (0x01UL << CCU1_CLK_M3_QEI_CFG_WAKEUP_Pos)                /*!< CCU1 CLK_M3_QEI_CFG: WAKEUP Mask    */\r
+\r
+// ----------------------------------  CCU1_CLK_M3_QEI_STAT  --------------------------------------\r
+#define CCU1_CLK_M3_QEI_STAT_RUN_Pos                          0                                                         /*!< CCU1 CLK_M3_QEI_STAT: RUN Position  */\r
+#define CCU1_CLK_M3_QEI_STAT_RUN_Msk                          (0x01UL << CCU1_CLK_M3_QEI_STAT_RUN_Pos)                  /*!< CCU1 CLK_M3_QEI_STAT: RUN Mask      */\r
+#define CCU1_CLK_M3_QEI_STAT_AUTO_Pos                         1                                                         /*!< CCU1 CLK_M3_QEI_STAT: AUTO Position */\r
+#define CCU1_CLK_M3_QEI_STAT_AUTO_Msk                         (0x01UL << CCU1_CLK_M3_QEI_STAT_AUTO_Pos)                 /*!< CCU1 CLK_M3_QEI_STAT: AUTO Mask     */\r
+#define CCU1_CLK_M3_QEI_STAT_WAKEUP_Pos                       2                                                         /*!< CCU1 CLK_M3_QEI_STAT: WAKEUP Position */\r
+#define CCU1_CLK_M3_QEI_STAT_WAKEUP_Msk                       (0x01UL << CCU1_CLK_M3_QEI_STAT_WAKEUP_Pos)               /*!< CCU1 CLK_M3_QEI_STAT: WAKEUP Mask   */\r
+\r
+// ---------------------------------  CCU1_CLK_PERIPH_BUS_CFG  ------------------------------------\r
+#define CCU1_CLK_PERIPH_BUS_CFG_RUN_Pos                       0                                                         /*!< CCU1 CLK_PERIPH_BUS_CFG: RUN Position */\r
+#define CCU1_CLK_PERIPH_BUS_CFG_RUN_Msk                       (0x01UL << CCU1_CLK_PERIPH_BUS_CFG_RUN_Pos)               /*!< CCU1 CLK_PERIPH_BUS_CFG: RUN Mask   */\r
+#define CCU1_CLK_PERIPH_BUS_CFG_AUTO_Pos                      1                                                         /*!< CCU1 CLK_PERIPH_BUS_CFG: AUTO Position */\r
+#define CCU1_CLK_PERIPH_BUS_CFG_AUTO_Msk                      (0x01UL << CCU1_CLK_PERIPH_BUS_CFG_AUTO_Pos)              /*!< CCU1 CLK_PERIPH_BUS_CFG: AUTO Mask  */\r
+#define CCU1_CLK_PERIPH_BUS_CFG_WAKEUP_Pos                    2                                                         /*!< CCU1 CLK_PERIPH_BUS_CFG: WAKEUP Position */\r
+#define CCU1_CLK_PERIPH_BUS_CFG_WAKEUP_Msk                    (0x01UL << CCU1_CLK_PERIPH_BUS_CFG_WAKEUP_Pos)            /*!< CCU1 CLK_PERIPH_BUS_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU1_CLK_PERIPH_BUS_STAT  ------------------------------------\r
+#define CCU1_CLK_PERIPH_BUS_STAT_RUN_Pos                      0                                                         /*!< CCU1 CLK_PERIPH_BUS_STAT: RUN Position */\r
+#define CCU1_CLK_PERIPH_BUS_STAT_RUN_Msk                      (0x01UL << CCU1_CLK_PERIPH_BUS_STAT_RUN_Pos)              /*!< CCU1 CLK_PERIPH_BUS_STAT: RUN Mask  */\r
+#define CCU1_CLK_PERIPH_BUS_STAT_AUTO_Pos                     1                                                         /*!< CCU1 CLK_PERIPH_BUS_STAT: AUTO Position */\r
+#define CCU1_CLK_PERIPH_BUS_STAT_AUTO_Msk                     (0x01UL << CCU1_CLK_PERIPH_BUS_STAT_AUTO_Pos)             /*!< CCU1 CLK_PERIPH_BUS_STAT: AUTO Mask */\r
+#define CCU1_CLK_PERIPH_BUS_STAT_WAKEUP_Pos                   2                                                         /*!< CCU1 CLK_PERIPH_BUS_STAT: WAKEUP Position */\r
+#define CCU1_CLK_PERIPH_BUS_STAT_WAKEUP_Msk                   (0x01UL << CCU1_CLK_PERIPH_BUS_STAT_WAKEUP_Pos)           /*!< CCU1 CLK_PERIPH_BUS_STAT: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU1_CLK_PERIPH_CORE_CFG  ------------------------------------\r
+#define CCU1_CLK_PERIPH_CORE_CFG_RUN_Pos                      0                                                         /*!< CCU1 CLK_PERIPH_CORE_CFG: RUN Position */\r
+#define CCU1_CLK_PERIPH_CORE_CFG_RUN_Msk                      (0x01UL << CCU1_CLK_PERIPH_CORE_CFG_RUN_Pos)              /*!< CCU1 CLK_PERIPH_CORE_CFG: RUN Mask  */\r
+#define CCU1_CLK_PERIPH_CORE_CFG_AUTO_Pos                     1                                                         /*!< CCU1 CLK_PERIPH_CORE_CFG: AUTO Position */\r
+#define CCU1_CLK_PERIPH_CORE_CFG_AUTO_Msk                     (0x01UL << CCU1_CLK_PERIPH_CORE_CFG_AUTO_Pos)             /*!< CCU1 CLK_PERIPH_CORE_CFG: AUTO Mask */\r
+#define CCU1_CLK_PERIPH_CORE_CFG_WAKEUP_Pos                   2                                                         /*!< CCU1 CLK_PERIPH_CORE_CFG: WAKEUP Position */\r
+#define CCU1_CLK_PERIPH_CORE_CFG_WAKEUP_Msk                   (0x01UL << CCU1_CLK_PERIPH_CORE_CFG_WAKEUP_Pos)           /*!< CCU1 CLK_PERIPH_CORE_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU1_CLK_PERIPH_CORE_STAT  -----------------------------------\r
+#define CCU1_CLK_PERIPH_CORE_STAT_RUN_Pos                     0                                                         /*!< CCU1 CLK_PERIPH_CORE_STAT: RUN Position */\r
+#define CCU1_CLK_PERIPH_CORE_STAT_RUN_Msk                     (0x01UL << CCU1_CLK_PERIPH_CORE_STAT_RUN_Pos)             /*!< CCU1 CLK_PERIPH_CORE_STAT: RUN Mask */\r
+#define CCU1_CLK_PERIPH_CORE_STAT_AUTO_Pos                    1                                                         /*!< CCU1 CLK_PERIPH_CORE_STAT: AUTO Position */\r
+#define CCU1_CLK_PERIPH_CORE_STAT_AUTO_Msk                    (0x01UL << CCU1_CLK_PERIPH_CORE_STAT_AUTO_Pos)            /*!< CCU1 CLK_PERIPH_CORE_STAT: AUTO Mask */\r
+#define CCU1_CLK_PERIPH_CORE_STAT_WAKEUP_Pos                  2                                                         /*!< CCU1 CLK_PERIPH_CORE_STAT: WAKEUP Position */\r
+#define CCU1_CLK_PERIPH_CORE_STAT_WAKEUP_Msk                  (0x01UL << CCU1_CLK_PERIPH_CORE_STAT_WAKEUP_Pos)          /*!< CCU1 CLK_PERIPH_CORE_STAT: WAKEUP Mask */\r
+\r
+\r
+// ------------------------------------  CCU1_CLK_USB0_CFG  ---------------------------------------\r
+#define CCU1_CLK_USB0_CFG_RUN_Pos                             0                                                         /*!< CCU1 CLK_USB0_CFG: RUN Position     */\r
+#define CCU1_CLK_USB0_CFG_RUN_Msk                             (0x01UL << CCU1_CLK_USB0_CFG_RUN_Pos)                     /*!< CCU1 CLK_USB0_CFG: RUN Mask         */\r
+#define CCU1_CLK_USB0_CFG_AUTO_Pos                            1                                                         /*!< CCU1 CLK_USB0_CFG: AUTO Position    */\r
+#define CCU1_CLK_USB0_CFG_AUTO_Msk                            (0x01UL << CCU1_CLK_USB0_CFG_AUTO_Pos)                    /*!< CCU1 CLK_USB0_CFG: AUTO Mask        */\r
+#define CCU1_CLK_USB0_CFG_WAKEUP_Pos                          2                                                         /*!< CCU1 CLK_USB0_CFG: WAKEUP Position  */\r
+#define CCU1_CLK_USB0_CFG_WAKEUP_Msk                          (0x01UL << CCU1_CLK_USB0_CFG_WAKEUP_Pos)                  /*!< CCU1 CLK_USB0_CFG: WAKEUP Mask      */\r
+\r
+// -----------------------------------  CCU1_CLK_USB0_STAT  ---------------------------------------\r
+#define CCU1_CLK_USB0_STAT_RUN_Pos                            0                                                         /*!< CCU1 CLK_USB0_STAT: RUN Position    */\r
+#define CCU1_CLK_USB0_STAT_RUN_Msk                            (0x01UL << CCU1_CLK_USB0_STAT_RUN_Pos)                    /*!< CCU1 CLK_USB0_STAT: RUN Mask        */\r
+#define CCU1_CLK_USB0_STAT_AUTO_Pos                           1                                                         /*!< CCU1 CLK_USB0_STAT: AUTO Position   */\r
+#define CCU1_CLK_USB0_STAT_AUTO_Msk                           (0x01UL << CCU1_CLK_USB0_STAT_AUTO_Pos)                   /*!< CCU1 CLK_USB0_STAT: AUTO Mask       */\r
+#define CCU1_CLK_USB0_STAT_WAKEUP_Pos                         2                                                         /*!< CCU1 CLK_USB0_STAT: WAKEUP Position */\r
+#define CCU1_CLK_USB0_STAT_WAKEUP_Msk                         (0x01UL << CCU1_CLK_USB0_STAT_WAKEUP_Pos)                 /*!< CCU1 CLK_USB0_STAT: WAKEUP Mask     */\r
+\r
+// ------------------------------------  CCU1_CLK_USB1_CFG  ---------------------------------------\r
+#define CCU1_CLK_USB1_CFG_RUN_Pos                             0                                                         /*!< CCU1 CLK_USB1_CFG: RUN Position     */\r
+#define CCU1_CLK_USB1_CFG_RUN_Msk                             (0x01UL << CCU1_CLK_USB1_CFG_RUN_Pos)                     /*!< CCU1 CLK_USB1_CFG: RUN Mask         */\r
+#define CCU1_CLK_USB1_CFG_AUTO_Pos                            1                                                         /*!< CCU1 CLK_USB1_CFG: AUTO Position    */\r
+#define CCU1_CLK_USB1_CFG_AUTO_Msk                            (0x01UL << CCU1_CLK_USB1_CFG_AUTO_Pos)                    /*!< CCU1 CLK_USB1_CFG: AUTO Mask        */\r
+#define CCU1_CLK_USB1_CFG_WAKEUP_Pos                          2                                                         /*!< CCU1 CLK_USB1_CFG: WAKEUP Position  */\r
+#define CCU1_CLK_USB1_CFG_WAKEUP_Msk                          (0x01UL << CCU1_CLK_USB1_CFG_WAKEUP_Pos)                  /*!< CCU1 CLK_USB1_CFG: WAKEUP Mask      */\r
+\r
+// -----------------------------------  CCU1_CLK_USB1_STAT  ---------------------------------------\r
+#define CCU1_CLK_USB1_STAT_RUN_Pos                            0                                                         /*!< CCU1 CLK_USB1_STAT: RUN Position    */\r
+#define CCU1_CLK_USB1_STAT_RUN_Msk                            (0x01UL << CCU1_CLK_USB1_STAT_RUN_Pos)                    /*!< CCU1 CLK_USB1_STAT: RUN Mask        */\r
+#define CCU1_CLK_USB1_STAT_AUTO_Pos                           1                                                         /*!< CCU1 CLK_USB1_STAT: AUTO Position   */\r
+#define CCU1_CLK_USB1_STAT_AUTO_Msk                           (0x01UL << CCU1_CLK_USB1_STAT_AUTO_Pos)                   /*!< CCU1 CLK_USB1_STAT: AUTO Mask       */\r
+#define CCU1_CLK_USB1_STAT_WAKEUP_Pos                         2                                                         /*!< CCU1 CLK_USB1_STAT: WAKEUP Position */\r
+#define CCU1_CLK_USB1_STAT_WAKEUP_Msk                         (0x01UL << CCU1_CLK_USB1_STAT_WAKEUP_Pos)                 /*!< CCU1 CLK_USB1_STAT: WAKEUP Mask     */\r
+\r
+// ------------------------------------  CCU1_CLK_VADC_CFG  ---------------------------------------\r
+#define CCU1_CLK_VADC_CFG_RUN_Pos                             0                                                         /*!< CCU1 CLK_VADC_CFG: RUN Position     */\r
+#define CCU1_CLK_VADC_CFG_RUN_Msk                             (0x01UL << CCU1_CLK_VADC_CFG_RUN_Pos)                     /*!< CCU1 CLK_VADC_CFG: RUN Mask         */\r
+#define CCU1_CLK_VADC_CFG_AUTO_Pos                            1                                                         /*!< CCU1 CLK_VADC_CFG: AUTO Position    */\r
+#define CCU1_CLK_VADC_CFG_AUTO_Msk                            (0x01UL << CCU1_CLK_VADC_CFG_AUTO_Pos)                    /*!< CCU1 CLK_VADC_CFG: AUTO Mask        */\r
+#define CCU1_CLK_VADC_CFG_WAKEUP_Pos                          2                                                         /*!< CCU1 CLK_VADC_CFG: WAKEUP Position  */\r
+#define CCU1_CLK_VADC_CFG_WAKEUP_Msk                          (0x01UL << CCU1_CLK_VADC_CFG_WAKEUP_Pos)                  /*!< CCU1 CLK_VADC_CFG: WAKEUP Mask      */\r
+\r
+// -----------------------------------  CCU1_CLK_VADC_STAT  ---------------------------------------\r
+#define CCU1_CLK_VADC_STAT_RUN_Pos                            0                                                         /*!< CCU1 CLK_VADC_STAT: RUN Position    */\r
+#define CCU1_CLK_VADC_STAT_RUN_Msk                            (0x01UL << CCU1_CLK_VADC_STAT_RUN_Pos)                    /*!< CCU1 CLK_VADC_STAT: RUN Mask        */\r
+#define CCU1_CLK_VADC_STAT_AUTO_Pos                           1                                                         /*!< CCU1 CLK_VADC_STAT: AUTO Position   */\r
+#define CCU1_CLK_VADC_STAT_AUTO_Msk                           (0x01UL << CCU1_CLK_VADC_STAT_AUTO_Pos)                   /*!< CCU1 CLK_VADC_STAT: AUTO Mask       */\r
+#define CCU1_CLK_VADC_STAT_WAKEUP_Pos                         2                                                         /*!< CCU1 CLK_VADC_STAT: WAKEUP Position */\r
+#define CCU1_CLK_VADC_STAT_WAKEUP_Msk                         (0x01UL << CCU1_CLK_VADC_STAT_WAKEUP_Pos)                 /*!< CCU1 CLK_VADC_STAT: WAKEUP Mask     */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 CCU2 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  CCU2_PM  --------------------------------------------\r
+#define CCU2_PM_PD_Pos                                        0                                                         /*!< CCU2 PM: PD Position                */\r
+#define CCU2_PM_PD_Msk                                        (0x01UL << CCU2_PM_PD_Pos)                                /*!< CCU2 PM: PD Mask                    */\r
+\r
+// -------------------------------------  CCU2_BASE_STAT  -----------------------------------------\r
+#define CCU2_BASE_STAT_BASE_UART3_CLK_Pos                     1                                                         /*!< CCU2 BASE_STAT: BASE_UART3_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_UART3_CLK_Msk                     (0x01UL << CCU2_BASE_STAT_BASE_UART3_CLK_Pos)             /*!< CCU2 BASE_STAT: BASE_UART3_CLK Mask */\r
+#define CCU2_BASE_STAT_BASE_UART2_CLK_Pos                     2                                                         /*!< CCU2 BASE_STAT: BASE_UART2_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_UART2_CLK_Msk                     (0x01UL << CCU2_BASE_STAT_BASE_UART2_CLK_Pos)             /*!< CCU2 BASE_STAT: BASE_UART2_CLK Mask */\r
+#define CCU2_BASE_STAT_BASE_UART1_CLK_Pos                     3                                                         /*!< CCU2 BASE_STAT: BASE_UART1_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_UART1_CLK_Msk                     (0x01UL << CCU2_BASE_STAT_BASE_UART1_CLK_Pos)             /*!< CCU2 BASE_STAT: BASE_UART1_CLK Mask */\r
+#define CCU2_BASE_STAT_BASE_UART0_CLK_Pos                     4                                                         /*!< CCU2 BASE_STAT: BASE_UART0_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_UART0_CLK_Msk                     (0x01UL << CCU2_BASE_STAT_BASE_UART0_CLK_Pos)             /*!< CCU2 BASE_STAT: BASE_UART0_CLK Mask */\r
+#define CCU2_BASE_STAT_BASE_SSP1_CLK_Pos                      5                                                         /*!< CCU2 BASE_STAT: BASE_SSP1_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_SSP1_CLK_Msk                      (0x01UL << CCU2_BASE_STAT_BASE_SSP1_CLK_Pos)              /*!< CCU2 BASE_STAT: BASE_SSP1_CLK Mask  */\r
+#define CCU2_BASE_STAT_BASE_SSP0_CLK_Pos                      6                                                         /*!< CCU2 BASE_STAT: BASE_SSP0_CLK Position */\r
+#define CCU2_BASE_STAT_BASE_SSP0_CLK_Msk                      (0x01UL << CCU2_BASE_STAT_BASE_SSP0_CLK_Pos)              /*!< CCU2 BASE_STAT: BASE_SSP0_CLK Mask  */\r
+\r
+// -----------------------------------  CCU2_CLK_APLL3_CFG  ---------------------------------------\r
+#define CCU2_CLK_APLL3_CFG_RUN_Pos                            0                                                         /*!< CCU2 CLK_APLL3_CFG: RUN Position    */\r
+#define CCU2_CLK_APLL3_CFG_RUN_Msk                            (0x01UL << CCU2_CLK_APLL3_CFG_RUN_Pos)                    /*!< CCU2 CLK_APLL3_CFG: RUN Mask        */\r
+#define CCU2_CLK_APLL3_CFG_AUTO_Pos                           1                                                         /*!< CCU2 CLK_APLL3_CFG: AUTO Position   */\r
+#define CCU2_CLK_APLL3_CFG_AUTO_Msk                           (0x01UL << CCU2_CLK_APLL3_CFG_AUTO_Pos)                   /*!< CCU2 CLK_APLL3_CFG: AUTO Mask       */\r
+#define CCU2_CLK_APLL3_CFG_WAKEUP_Pos                         2                                                         /*!< CCU2 CLK_APLL3_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APLL3_CFG_WAKEUP_Msk                         (0x01UL << CCU2_CLK_APLL3_CFG_WAKEUP_Pos)                 /*!< CCU2 CLK_APLL3_CFG: WAKEUP Mask     */\r
+\r
+// -----------------------------------  CCU2_CLK_APLL_STAT  ---------------------------------------\r
+#define CCU2_CLK_APLL_STAT_RUN_Pos                            0                                                         /*!< CCU2 CLK_APLL_STAT: RUN Position    */\r
+#define CCU2_CLK_APLL_STAT_RUN_Msk                            (0x01UL << CCU2_CLK_APLL_STAT_RUN_Pos)                    /*!< CCU2 CLK_APLL_STAT: RUN Mask        */\r
+#define CCU2_CLK_APLL_STAT_AUTO_Pos                           1                                                         /*!< CCU2 CLK_APLL_STAT: AUTO Position   */\r
+#define CCU2_CLK_APLL_STAT_AUTO_Msk                           (0x01UL << CCU2_CLK_APLL_STAT_AUTO_Pos)                   /*!< CCU2 CLK_APLL_STAT: AUTO Mask       */\r
+#define CCU2_CLK_APLL_STAT_WAKEUP_Pos                         2                                                         /*!< CCU2 CLK_APLL_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APLL_STAT_WAKEUP_Msk                         (0x01UL << CCU2_CLK_APLL_STAT_WAKEUP_Pos)                 /*!< CCU2 CLK_APLL_STAT: WAKEUP Mask     */\r
+\r
+// --------------------------------  CCU2_CLK_APB2_USART3_CFG  ------------------------------------\r
+#define CCU2_CLK_APB2_USART3_CFG_RUN_Pos                      0                                                         /*!< CCU2 CLK_APB2_USART3_CFG: RUN Position */\r
+#define CCU2_CLK_APB2_USART3_CFG_RUN_Msk                      (0x01UL << CCU2_CLK_APB2_USART3_CFG_RUN_Pos)              /*!< CCU2 CLK_APB2_USART3_CFG: RUN Mask  */\r
+#define CCU2_CLK_APB2_USART3_CFG_AUTO_Pos                     1                                                         /*!< CCU2 CLK_APB2_USART3_CFG: AUTO Position */\r
+#define CCU2_CLK_APB2_USART3_CFG_AUTO_Msk                     (0x01UL << CCU2_CLK_APB2_USART3_CFG_AUTO_Pos)             /*!< CCU2 CLK_APB2_USART3_CFG: AUTO Mask */\r
+#define CCU2_CLK_APB2_USART3_CFG_WAKEUP_Pos                   2                                                         /*!< CCU2 CLK_APB2_USART3_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB2_USART3_CFG_WAKEUP_Msk                   (0x01UL << CCU2_CLK_APB2_USART3_CFG_WAKEUP_Pos)           /*!< CCU2 CLK_APB2_USART3_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB2_USART3_STAT  -----------------------------------\r
+#define CCU2_CLK_APB2_USART3_STAT_RUN_Pos                     0                                                         /*!< CCU2 CLK_APB2_USART3_STAT: RUN Position */\r
+#define CCU2_CLK_APB2_USART3_STAT_RUN_Msk                     (0x01UL << CCU2_CLK_APB2_USART3_STAT_RUN_Pos)             /*!< CCU2 CLK_APB2_USART3_STAT: RUN Mask */\r
+#define CCU2_CLK_APB2_USART3_STAT_AUTO_Pos                    1                                                         /*!< CCU2 CLK_APB2_USART3_STAT: AUTO Position */\r
+#define CCU2_CLK_APB2_USART3_STAT_AUTO_Msk                    (0x01UL << CCU2_CLK_APB2_USART3_STAT_AUTO_Pos)            /*!< CCU2 CLK_APB2_USART3_STAT: AUTO Mask */\r
+#define CCU2_CLK_APB2_USART3_STAT_WAKEUP_Pos                  2                                                         /*!< CCU2 CLK_APB2_USART3_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB2_USART3_STAT_WAKEUP_Msk                  (0x01UL << CCU2_CLK_APB2_USART3_STAT_WAKEUP_Pos)          /*!< CCU2 CLK_APB2_USART3_STAT: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB2_USART2_CFG  ------------------------------------\r
+#define CCU2_CLK_APB2_USART2_CFG_RUN_Pos                      0                                                         /*!< CCU2 CLK_APB2_USART2_CFG: RUN Position */\r
+#define CCU2_CLK_APB2_USART2_CFG_RUN_Msk                      (0x01UL << CCU2_CLK_APB2_USART2_CFG_RUN_Pos)              /*!< CCU2 CLK_APB2_USART2_CFG: RUN Mask  */\r
+#define CCU2_CLK_APB2_USART2_CFG_AUTO_Pos                     1                                                         /*!< CCU2 CLK_APB2_USART2_CFG: AUTO Position */\r
+#define CCU2_CLK_APB2_USART2_CFG_AUTO_Msk                     (0x01UL << CCU2_CLK_APB2_USART2_CFG_AUTO_Pos)             /*!< CCU2 CLK_APB2_USART2_CFG: AUTO Mask */\r
+#define CCU2_CLK_APB2_USART2_CFG_WAKEUP_Pos                   2                                                         /*!< CCU2 CLK_APB2_USART2_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB2_USART2_CFG_WAKEUP_Msk                   (0x01UL << CCU2_CLK_APB2_USART2_CFG_WAKEUP_Pos)           /*!< CCU2 CLK_APB2_USART2_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB2_USART2_STAT  -----------------------------------\r
+#define CCU2_CLK_APB2_USART2_STAT_RUN_Pos                     0                                                         /*!< CCU2 CLK_APB2_USART2_STAT: RUN Position */\r
+#define CCU2_CLK_APB2_USART2_STAT_RUN_Msk                     (0x01UL << CCU2_CLK_APB2_USART2_STAT_RUN_Pos)             /*!< CCU2 CLK_APB2_USART2_STAT: RUN Mask */\r
+#define CCU2_CLK_APB2_USART2_STAT_AUTO_Pos                    1                                                         /*!< CCU2 CLK_APB2_USART2_STAT: AUTO Position */\r
+#define CCU2_CLK_APB2_USART2_STAT_AUTO_Msk                    (0x01UL << CCU2_CLK_APB2_USART2_STAT_AUTO_Pos)            /*!< CCU2 CLK_APB2_USART2_STAT: AUTO Mask */\r
+#define CCU2_CLK_APB2_USART2_STAT_WAKEUP_Pos                  2                                                         /*!< CCU2 CLK_APB2_USART2_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB2_USART2_STAT_WAKEUP_Msk                  (0x01UL << CCU2_CLK_APB2_USART2_STAT_WAKEUP_Pos)          /*!< CCU2 CLK_APB2_USART2_STAT: WAKEUP Mask */\r
+\r
+// -------------------------------  CCU2_CLK_APB0_UART1_BUS_CFG  ----------------------------------\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_RUN_Pos                   0                                                         /*!< CCU2 CLK_APB0_UART1_BUS_CFG: RUN Position */\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_RUN_Msk                   (0x01UL << CCU2_CLK_APB0_UART1_BUS_CFG_RUN_Pos)           /*!< CCU2 CLK_APB0_UART1_BUS_CFG: RUN Mask */\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_AUTO_Pos                  1                                                         /*!< CCU2 CLK_APB0_UART1_BUS_CFG: AUTO Position */\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_AUTO_Msk                  (0x01UL << CCU2_CLK_APB0_UART1_BUS_CFG_AUTO_Pos)          /*!< CCU2 CLK_APB0_UART1_BUS_CFG: AUTO Mask */\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_WAKEUP_Pos                2                                                         /*!< CCU2 CLK_APB0_UART1_BUS_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB0_UART1_BUS_CFG_WAKEUP_Msk                (0x01UL << CCU2_CLK_APB0_UART1_BUS_CFG_WAKEUP_Pos)        /*!< CCU2 CLK_APB0_UART1_BUS_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB0_UART1_STAT  ------------------------------------\r
+#define CCU2_CLK_APB0_UART1_STAT_RUN_Pos                      0                                                         /*!< CCU2 CLK_APB0_UART1_STAT: RUN Position */\r
+#define CCU2_CLK_APB0_UART1_STAT_RUN_Msk                      (0x01UL << CCU2_CLK_APB0_UART1_STAT_RUN_Pos)              /*!< CCU2 CLK_APB0_UART1_STAT: RUN Mask  */\r
+#define CCU2_CLK_APB0_UART1_STAT_AUTO_Pos                     1                                                         /*!< CCU2 CLK_APB0_UART1_STAT: AUTO Position */\r
+#define CCU2_CLK_APB0_UART1_STAT_AUTO_Msk                     (0x01UL << CCU2_CLK_APB0_UART1_STAT_AUTO_Pos)             /*!< CCU2 CLK_APB0_UART1_STAT: AUTO Mask */\r
+#define CCU2_CLK_APB0_UART1_STAT_WAKEUP_Pos                   2                                                         /*!< CCU2 CLK_APB0_UART1_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB0_UART1_STAT_WAKEUP_Msk                   (0x01UL << CCU2_CLK_APB0_UART1_STAT_WAKEUP_Pos)           /*!< CCU2 CLK_APB0_UART1_STAT: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB0_USART0_CFG  ------------------------------------\r
+#define CCU2_CLK_APB0_USART0_CFG_RUN_Pos                      0                                                         /*!< CCU2 CLK_APB0_USART0_CFG: RUN Position */\r
+#define CCU2_CLK_APB0_USART0_CFG_RUN_Msk                      (0x01UL << CCU2_CLK_APB0_USART0_CFG_RUN_Pos)              /*!< CCU2 CLK_APB0_USART0_CFG: RUN Mask  */\r
+#define CCU2_CLK_APB0_USART0_CFG_AUTO_Pos                     1                                                         /*!< CCU2 CLK_APB0_USART0_CFG: AUTO Position */\r
+#define CCU2_CLK_APB0_USART0_CFG_AUTO_Msk                     (0x01UL << CCU2_CLK_APB0_USART0_CFG_AUTO_Pos)             /*!< CCU2 CLK_APB0_USART0_CFG: AUTO Mask */\r
+#define CCU2_CLK_APB0_USART0_CFG_WAKEUP_Pos                   2                                                         /*!< CCU2 CLK_APB0_USART0_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB0_USART0_CFG_WAKEUP_Msk                   (0x01UL << CCU2_CLK_APB0_USART0_CFG_WAKEUP_Pos)           /*!< CCU2 CLK_APB0_USART0_CFG: WAKEUP Mask */\r
+\r
+// --------------------------------  CCU2_CLK_APB0_USART0_STAT  -----------------------------------\r
+#define CCU2_CLK_APB0_USART0_STAT_RUN_Pos                     0                                                         /*!< CCU2 CLK_APB0_USART0_STAT: RUN Position */\r
+#define CCU2_CLK_APB0_USART0_STAT_RUN_Msk                     (0x01UL << CCU2_CLK_APB0_USART0_STAT_RUN_Pos)             /*!< CCU2 CLK_APB0_USART0_STAT: RUN Mask */\r
+#define CCU2_CLK_APB0_USART0_STAT_AUTO_Pos                    1                                                         /*!< CCU2 CLK_APB0_USART0_STAT: AUTO Position */\r
+#define CCU2_CLK_APB0_USART0_STAT_AUTO_Msk                    (0x01UL << CCU2_CLK_APB0_USART0_STAT_AUTO_Pos)            /*!< CCU2 CLK_APB0_USART0_STAT: AUTO Mask */\r
+#define CCU2_CLK_APB0_USART0_STAT_WAKEUP_Pos                  2                                                         /*!< CCU2 CLK_APB0_USART0_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB0_USART0_STAT_WAKEUP_Msk                  (0x01UL << CCU2_CLK_APB0_USART0_STAT_WAKEUP_Pos)          /*!< CCU2 CLK_APB0_USART0_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU2_CLK_APB2_SSP1_CFG  -------------------------------------\r
+#define CCU2_CLK_APB2_SSP1_CFG_RUN_Pos                        0                                                         /*!< CCU2 CLK_APB2_SSP1_CFG: RUN Position */\r
+#define CCU2_CLK_APB2_SSP1_CFG_RUN_Msk                        (0x01UL << CCU2_CLK_APB2_SSP1_CFG_RUN_Pos)                /*!< CCU2 CLK_APB2_SSP1_CFG: RUN Mask    */\r
+#define CCU2_CLK_APB2_SSP1_CFG_AUTO_Pos                       1                                                         /*!< CCU2 CLK_APB2_SSP1_CFG: AUTO Position */\r
+#define CCU2_CLK_APB2_SSP1_CFG_AUTO_Msk                       (0x01UL << CCU2_CLK_APB2_SSP1_CFG_AUTO_Pos)               /*!< CCU2 CLK_APB2_SSP1_CFG: AUTO Mask   */\r
+#define CCU2_CLK_APB2_SSP1_CFG_WAKEUP_Pos                     2                                                         /*!< CCU2 CLK_APB2_SSP1_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB2_SSP1_CFG_WAKEUP_Msk                     (0x01UL << CCU2_CLK_APB2_SSP1_CFG_WAKEUP_Pos)             /*!< CCU2 CLK_APB2_SSP1_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU2_CLK_APB2_SSP1_STAT  ------------------------------------\r
+#define CCU2_CLK_APB2_SSP1_STAT_RUN_Pos                       0                                                         /*!< CCU2 CLK_APB2_SSP1_STAT: RUN Position */\r
+#define CCU2_CLK_APB2_SSP1_STAT_RUN_Msk                       (0x01UL << CCU2_CLK_APB2_SSP1_STAT_RUN_Pos)               /*!< CCU2 CLK_APB2_SSP1_STAT: RUN Mask   */\r
+#define CCU2_CLK_APB2_SSP1_STAT_AUTO_Pos                      1                                                         /*!< CCU2 CLK_APB2_SSP1_STAT: AUTO Position */\r
+#define CCU2_CLK_APB2_SSP1_STAT_AUTO_Msk                      (0x01UL << CCU2_CLK_APB2_SSP1_STAT_AUTO_Pos)              /*!< CCU2 CLK_APB2_SSP1_STAT: AUTO Mask  */\r
+#define CCU2_CLK_APB2_SSP1_STAT_WAKEUP_Pos                    2                                                         /*!< CCU2 CLK_APB2_SSP1_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB2_SSP1_STAT_WAKEUP_Msk                    (0x01UL << CCU2_CLK_APB2_SSP1_STAT_WAKEUP_Pos)            /*!< CCU2 CLK_APB2_SSP1_STAT: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU2_CLK_APB0_SSP0_CFG  -------------------------------------\r
+#define CCU2_CLK_APB0_SSP0_CFG_RUN_Pos                        0                                                         /*!< CCU2 CLK_APB0_SSP0_CFG: RUN Position */\r
+#define CCU2_CLK_APB0_SSP0_CFG_RUN_Msk                        (0x01UL << CCU2_CLK_APB0_SSP0_CFG_RUN_Pos)                /*!< CCU2 CLK_APB0_SSP0_CFG: RUN Mask    */\r
+#define CCU2_CLK_APB0_SSP0_CFG_AUTO_Pos                       1                                                         /*!< CCU2 CLK_APB0_SSP0_CFG: AUTO Position */\r
+#define CCU2_CLK_APB0_SSP0_CFG_AUTO_Msk                       (0x01UL << CCU2_CLK_APB0_SSP0_CFG_AUTO_Pos)               /*!< CCU2 CLK_APB0_SSP0_CFG: AUTO Mask   */\r
+#define CCU2_CLK_APB0_SSP0_CFG_WAKEUP_Pos                     2                                                         /*!< CCU2 CLK_APB0_SSP0_CFG: WAKEUP Position */\r
+#define CCU2_CLK_APB0_SSP0_CFG_WAKEUP_Msk                     (0x01UL << CCU2_CLK_APB0_SSP0_CFG_WAKEUP_Pos)             /*!< CCU2 CLK_APB0_SSP0_CFG: WAKEUP Mask */\r
+\r
+// ---------------------------------  CCU2_CLK_APB0_SSP0_STAT  ------------------------------------\r
+#define CCU2_CLK_APB0_SSP0_STAT_RUN_Pos                       0                                                         /*!< CCU2 CLK_APB0_SSP0_STAT: RUN Position */\r
+#define CCU2_CLK_APB0_SSP0_STAT_RUN_Msk                       (0x01UL << CCU2_CLK_APB0_SSP0_STAT_RUN_Pos)               /*!< CCU2 CLK_APB0_SSP0_STAT: RUN Mask   */\r
+#define CCU2_CLK_APB0_SSP0_STAT_AUTO_Pos                      1                                                         /*!< CCU2 CLK_APB0_SSP0_STAT: AUTO Position */\r
+#define CCU2_CLK_APB0_SSP0_STAT_AUTO_Msk                      (0x01UL << CCU2_CLK_APB0_SSP0_STAT_AUTO_Pos)              /*!< CCU2 CLK_APB0_SSP0_STAT: AUTO Mask  */\r
+#define CCU2_CLK_APB0_SSP0_STAT_WAKEUP_Pos                    2                                                         /*!< CCU2 CLK_APB0_SSP0_STAT: WAKEUP Position */\r
+#define CCU2_CLK_APB0_SSP0_STAT_WAKEUP_Msk                    (0x01UL << CCU2_CLK_APB0_SSP0_STAT_WAKEUP_Pos)            /*!< CCU2 CLK_APB0_SSP0_STAT: WAKEUP Mask */\r
+\r
+// ------------------------------------  CCU2_CLK_SDIO_CFG  ---------------------------------------\r
+#define CCU2_CLK_SDIO_CFG_RUN_Pos                             0                                                         /*!< CCU2 CLK_SDIO_CFG: RUN Position     */\r
+#define CCU2_CLK_SDIO_CFG_RUN_Msk                             (0x01UL << CCU2_CLK_SDIO_CFG_RUN_Pos)                     /*!< CCU2 CLK_SDIO_CFG: RUN Mask         */\r
+#define CCU2_CLK_SDIO_CFG_AUTO_Pos                            1                                                         /*!< CCU2 CLK_SDIO_CFG: AUTO Position    */\r
+#define CCU2_CLK_SDIO_CFG_AUTO_Msk                            (0x01UL << CCU2_CLK_SDIO_CFG_AUTO_Pos)                    /*!< CCU2 CLK_SDIO_CFG: AUTO Mask        */\r
+#define CCU2_CLK_SDIO_CFG_WAKEUP_Pos                          2                                                         /*!< CCU2 CLK_SDIO_CFG: WAKEUP Position  */\r
+#define CCU2_CLK_SDIO_CFG_WAKEUP_Msk                          (0x01UL << CCU2_CLK_SDIO_CFG_WAKEUP_Pos)                  /*!< CCU2 CLK_SDIO_CFG: WAKEUP Mask      */\r
+\r
+// -----------------------------------  CCU2_CLK_SDIO_STAT  ---------------------------------------\r
+#define CCU2_CLK_SDIO_STAT_RUN_Pos                            0                                                         /*!< CCU2 CLK_SDIO_STAT: RUN Position    */\r
+#define CCU2_CLK_SDIO_STAT_RUN_Msk                            (0x01UL << CCU2_CLK_SDIO_STAT_RUN_Pos)                    /*!< CCU2 CLK_SDIO_STAT: RUN Mask        */\r
+#define CCU2_CLK_SDIO_STAT_AUTO_Pos                           1                                                         /*!< CCU2 CLK_SDIO_STAT: AUTO Position   */\r
+#define CCU2_CLK_SDIO_STAT_AUTO_Msk                           (0x01UL << CCU2_CLK_SDIO_STAT_AUTO_Pos)                   /*!< CCU2 CLK_SDIO_STAT: AUTO Mask       */\r
+#define CCU2_CLK_SDIO_STAT_WAKEUP_Pos                         2                                                         /*!< CCU2 CLK_SDIO_STAT: WAKEUP Position */\r
+#define CCU2_CLK_SDIO_STAT_WAKEUP_Msk                         (0x01UL << CCU2_CLK_SDIO_STAT_WAKEUP_Pos)                 /*!< CCU2 CLK_SDIO_STAT: WAKEUP Mask     */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  RGU Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -------------------------------------  RGU_RESET_CTRL0  ----------------------------------------\r
+#define RGU_RESET_CTRL0_CORE_RST_Pos                          0                                                         /*!< RGU RESET_CTRL0: CORE_RST Position  */\r
+#define RGU_RESET_CTRL0_CORE_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_CORE_RST_Pos)                  /*!< RGU RESET_CTRL0: CORE_RST Mask      */\r
+#define RGU_RESET_CTRL0_PERIPH_RST_Pos                        1                                                         /*!< RGU RESET_CTRL0: PERIPH_RST Position */\r
+#define RGU_RESET_CTRL0_PERIPH_RST_Msk                        (0x01UL << RGU_RESET_CTRL0_PERIPH_RST_Pos)                /*!< RGU RESET_CTRL0: PERIPH_RST Mask    */\r
+#define RGU_RESET_CTRL0_MASTER_RST_Pos                        2                                                         /*!< RGU RESET_CTRL0: MASTER_RST Position */\r
+#define RGU_RESET_CTRL0_MASTER_RST_Msk                        (0x01UL << RGU_RESET_CTRL0_MASTER_RST_Pos)                /*!< RGU RESET_CTRL0: MASTER_RST Mask    */\r
+#define RGU_RESET_CTRL0_WWDT_RST_Pos                          4                                                         /*!< RGU RESET_CTRL0: WWDT_RST Position  */\r
+#define RGU_RESET_CTRL0_WWDT_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_WWDT_RST_Pos)                  /*!< RGU RESET_CTRL0: WWDT_RST Mask      */\r
+#define RGU_RESET_CTRL0_CREG_RST_Pos                          5                                                         /*!< RGU RESET_CTRL0: CREG_RST Position  */\r
+#define RGU_RESET_CTRL0_CREG_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_CREG_RST_Pos)                  /*!< RGU RESET_CTRL0: CREG_RST Mask      */\r
+#define RGU_RESET_CTRL0_BUS_RST_Pos                           8                                                         /*!< RGU RESET_CTRL0: BUS_RST Position   */\r
+#define RGU_RESET_CTRL0_BUS_RST_Msk                           (0x01UL << RGU_RESET_CTRL0_BUS_RST_Pos)                   /*!< RGU RESET_CTRL0: BUS_RST Mask       */\r
+#define RGU_RESET_CTRL0_SCU_RST_Pos                           9                                                         /*!< RGU RESET_CTRL0: SCU_RST Position   */\r
+#define RGU_RESET_CTRL0_SCU_RST_Msk                           (0x01UL << RGU_RESET_CTRL0_SCU_RST_Pos)                   /*!< RGU RESET_CTRL0: SCU_RST Mask       */\r
+#define RGU_RESET_CTRL0_PINMUX_RST_Pos                        10                                                        /*!< RGU RESET_CTRL0: PINMUX_RST Position */\r
+#define RGU_RESET_CTRL0_PINMUX_RST_Msk                        (0x01UL << RGU_RESET_CTRL0_PINMUX_RST_Pos)                /*!< RGU RESET_CTRL0: PINMUX_RST Mask    */\r
+#define RGU_RESET_CTRL0_M3_RST_Pos                            13                                                        /*!< RGU RESET_CTRL0: M3_RST Position    */\r
+#define RGU_RESET_CTRL0_M3_RST_Msk                            (0x01UL << RGU_RESET_CTRL0_M3_RST_Pos)                    /*!< RGU RESET_CTRL0: M3_RST Mask        */\r
+#define RGU_RESET_CTRL0_LCD_RST_Pos                           16                                                        /*!< RGU RESET_CTRL0: LCD_RST Position   */\r
+#define RGU_RESET_CTRL0_LCD_RST_Msk                           (0x01UL << RGU_RESET_CTRL0_LCD_RST_Pos)                   /*!< RGU RESET_CTRL0: LCD_RST Mask       */\r
+#define RGU_RESET_CTRL0_USB0_RST_Pos                          17                                                        /*!< RGU RESET_CTRL0: USB0_RST Position  */\r
+#define RGU_RESET_CTRL0_USB0_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_USB0_RST_Pos)                  /*!< RGU RESET_CTRL0: USB0_RST Mask      */\r
+#define RGU_RESET_CTRL0_USB1_RST_Pos                          18                                                        /*!< RGU RESET_CTRL0: USB1_RST Position  */\r
+#define RGU_RESET_CTRL0_USB1_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_USB1_RST_Pos)                  /*!< RGU RESET_CTRL0: USB1_RST Mask      */\r
+#define RGU_RESET_CTRL0_DMA_RST_Pos                           19                                                        /*!< RGU RESET_CTRL0: DMA_RST Position   */\r
+#define RGU_RESET_CTRL0_DMA_RST_Msk                           (0x01UL << RGU_RESET_CTRL0_DMA_RST_Pos)                   /*!< RGU RESET_CTRL0: DMA_RST Mask       */\r
+#define RGU_RESET_CTRL0_SDIO_RST_Pos                          20                                                        /*!< RGU RESET_CTRL0: SDIO_RST Position  */\r
+#define RGU_RESET_CTRL0_SDIO_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_SDIO_RST_Pos)                  /*!< RGU RESET_CTRL0: SDIO_RST Mask      */\r
+#define RGU_RESET_CTRL0_EMC_RST_Pos                           21                                                        /*!< RGU RESET_CTRL0: EMC_RST Position   */\r
+#define RGU_RESET_CTRL0_EMC_RST_Msk                           (0x01UL << RGU_RESET_CTRL0_EMC_RST_Pos)                   /*!< RGU RESET_CTRL0: EMC_RST Mask       */\r
+#define RGU_RESET_CTRL0_ETHERNET_RST_Pos                      22                                                        /*!< RGU RESET_CTRL0: ETHERNET_RST Position */\r
+#define RGU_RESET_CTRL0_ETHERNET_RST_Msk                      (0x01UL << RGU_RESET_CTRL0_ETHERNET_RST_Pos)              /*!< RGU RESET_CTRL0: ETHERNET_RST Mask  */\r
+#define RGU_RESET_CTRL0_GPIO_RST_Pos                          28                                                        /*!< RGU RESET_CTRL0: GPIO_RST Position  */\r
+#define RGU_RESET_CTRL0_GPIO_RST_Msk                          (0x01UL << RGU_RESET_CTRL0_GPIO_RST_Pos)                  /*!< RGU RESET_CTRL0: GPIO_RST Mask      */\r
+\r
+// -------------------------------------  RGU_RESET_CTRL1  ----------------------------------------\r
+#define RGU_RESET_CTRL1_TIMER0_RST_Pos                        0                                                         /*!< RGU RESET_CTRL1: TIMER0_RST Position */\r
+#define RGU_RESET_CTRL1_TIMER0_RST_Msk                        (0x01UL << RGU_RESET_CTRL1_TIMER0_RST_Pos)                /*!< RGU RESET_CTRL1: TIMER0_RST Mask    */\r
+#define RGU_RESET_CTRL1_TIMER1_RST_Pos                        1                                                         /*!< RGU RESET_CTRL1: TIMER1_RST Position */\r
+#define RGU_RESET_CTRL1_TIMER1_RST_Msk                        (0x01UL << RGU_RESET_CTRL1_TIMER1_RST_Pos)                /*!< RGU RESET_CTRL1: TIMER1_RST Mask    */\r
+#define RGU_RESET_CTRL1_TIMER2_RST_Pos                        2                                                         /*!< RGU RESET_CTRL1: TIMER2_RST Position */\r
+#define RGU_RESET_CTRL1_TIMER2_RST_Msk                        (0x01UL << RGU_RESET_CTRL1_TIMER2_RST_Pos)                /*!< RGU RESET_CTRL1: TIMER2_RST Mask    */\r
+#define RGU_RESET_CTRL1_TIMER3_RST_Pos                        3                                                         /*!< RGU RESET_CTRL1: TIMER3_RST Position */\r
+#define RGU_RESET_CTRL1_TIMER3_RST_Msk                        (0x01UL << RGU_RESET_CTRL1_TIMER3_RST_Pos)                /*!< RGU RESET_CTRL1: TIMER3_RST Mask    */\r
+#define RGU_RESET_CTRL1_RITIMER_RST_Pos                       4                                                         /*!< RGU RESET_CTRL1: RITIMER_RST Position */\r
+#define RGU_RESET_CTRL1_RITIMER_RST_Msk                       (0x01UL << RGU_RESET_CTRL1_RITIMER_RST_Pos)               /*!< RGU RESET_CTRL1: RITIMER_RST Mask   */\r
+#define RGU_RESET_CTRL1_SCT_RST_Pos                           5                                                         /*!< RGU RESET_CTRL1: SCT_RST Position   */\r
+#define RGU_RESET_CTRL1_SCT_RST_Msk                           (0x01UL << RGU_RESET_CTRL1_SCT_RST_Pos)                   /*!< RGU RESET_CTRL1: SCT_RST Mask       */\r
+#define RGU_RESET_CTRL1_MOTOCONPWM_RST_Pos                    6                                                         /*!< RGU RESET_CTRL1: MOTOCONPWM_RST Position */\r
+#define RGU_RESET_CTRL1_MOTOCONPWM_RST_Msk                    (0x01UL << RGU_RESET_CTRL1_MOTOCONPWM_RST_Pos)            /*!< RGU RESET_CTRL1: MOTOCONPWM_RST Mask */\r
+#define RGU_RESET_CTRL1_QEI_RST_Pos                           7                                                         /*!< RGU RESET_CTRL1: QEI_RST Position   */\r
+#define RGU_RESET_CTRL1_QEI_RST_Msk                           (0x01UL << RGU_RESET_CTRL1_QEI_RST_Pos)                   /*!< RGU RESET_CTRL1: QEI_RST Mask       */\r
+#define RGU_RESET_CTRL1_ADC0_RST_Pos                          8                                                         /*!< RGU RESET_CTRL1: ADC0_RST Position  */\r
+#define RGU_RESET_CTRL1_ADC0_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_ADC0_RST_Pos)                  /*!< RGU RESET_CTRL1: ADC0_RST Mask      */\r
+#define RGU_RESET_CTRL1_ADC1_RST_Pos                          9                                                         /*!< RGU RESET_CTRL1: ADC1_RST Position  */\r
+#define RGU_RESET_CTRL1_ADC1_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_ADC1_RST_Pos)                  /*!< RGU RESET_CTRL1: ADC1_RST Mask      */\r
+#define RGU_RESET_CTRL1_DAC_RST_Pos                           10                                                        /*!< RGU RESET_CTRL1: DAC_RST Position   */\r
+#define RGU_RESET_CTRL1_DAC_RST_Msk                           (0x01UL << RGU_RESET_CTRL1_DAC_RST_Pos)                   /*!< RGU RESET_CTRL1: DAC_RST Mask       */\r
+#define RGU_RESET_CTRL1_UART0_RST_Pos                         12                                                        /*!< RGU RESET_CTRL1: UART0_RST Position */\r
+#define RGU_RESET_CTRL1_UART0_RST_Msk                         (0x01UL << RGU_RESET_CTRL1_UART0_RST_Pos)                 /*!< RGU RESET_CTRL1: UART0_RST Mask     */\r
+#define RGU_RESET_CTRL1_UART1_RST_Pos                         13                                                        /*!< RGU RESET_CTRL1: UART1_RST Position */\r
+#define RGU_RESET_CTRL1_UART1_RST_Msk                         (0x01UL << RGU_RESET_CTRL1_UART1_RST_Pos)                 /*!< RGU RESET_CTRL1: UART1_RST Mask     */\r
+#define RGU_RESET_CTRL1_UART2_RST_Pos                         14                                                        /*!< RGU RESET_CTRL1: UART2_RST Position */\r
+#define RGU_RESET_CTRL1_UART2_RST_Msk                         (0x01UL << RGU_RESET_CTRL1_UART2_RST_Pos)                 /*!< RGU RESET_CTRL1: UART2_RST Mask     */\r
+#define RGU_RESET_CTRL1_UART3_RST_Pos                         15                                                        /*!< RGU RESET_CTRL1: UART3_RST Position */\r
+#define RGU_RESET_CTRL1_UART3_RST_Msk                         (0x01UL << RGU_RESET_CTRL1_UART3_RST_Pos)                 /*!< RGU RESET_CTRL1: UART3_RST Mask     */\r
+#define RGU_RESET_CTRL1_I2C0_RST_Pos                          16                                                        /*!< RGU RESET_CTRL1: I2C0_RST Position  */\r
+#define RGU_RESET_CTRL1_I2C0_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_I2C0_RST_Pos)                  /*!< RGU RESET_CTRL1: I2C0_RST Mask      */\r
+#define RGU_RESET_CTRL1_I2C1_RST_Pos                          17                                                        /*!< RGU RESET_CTRL1: I2C1_RST Position  */\r
+#define RGU_RESET_CTRL1_I2C1_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_I2C1_RST_Pos)                  /*!< RGU RESET_CTRL1: I2C1_RST Mask      */\r
+#define RGU_RESET_CTRL1_SSP0_RST_Pos                          18                                                        /*!< RGU RESET_CTRL1: SSP0_RST Position  */\r
+#define RGU_RESET_CTRL1_SSP0_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_SSP0_RST_Pos)                  /*!< RGU RESET_CTRL1: SSP0_RST Mask      */\r
+#define RGU_RESET_CTRL1_SSP1_RST_Pos                          19                                                        /*!< RGU RESET_CTRL1: SSP1_RST Position  */\r
+#define RGU_RESET_CTRL1_SSP1_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_SSP1_RST_Pos)                  /*!< RGU RESET_CTRL1: SSP1_RST Mask      */\r
+#define RGU_RESET_CTRL1_I2S_RST_Pos                           20                                                        /*!< RGU RESET_CTRL1: I2S_RST Position   */\r
+#define RGU_RESET_CTRL1_I2S_RST_Msk                           (0x01UL << RGU_RESET_CTRL1_I2S_RST_Pos)                   /*!< RGU RESET_CTRL1: I2S_RST Mask       */\r
+#define RGU_RESET_CTRL1_SPIFI_RST_Pos                         21                                                        /*!< RGU RESET_CTRL1: SPIFI_RST Position */\r
+#define RGU_RESET_CTRL1_SPIFI_RST_Msk                         (0x01UL << RGU_RESET_CTRL1_SPIFI_RST_Pos)                 /*!< RGU RESET_CTRL1: SPIFI_RST Mask     */\r
+#define RGU_RESET_CTRL1_CAN1_RST_Pos                          22                                                        /*!< RGU RESET_CTRL1: CAN1_RST Position  */\r
+#define RGU_RESET_CTRL1_CAN1_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_CAN1_RST_Pos)                  /*!< RGU RESET_CTRL1: CAN1_RST Mask      */\r
+#define RGU_RESET_CTRL1_CAN0_RST_Pos                          23                                                        /*!< RGU RESET_CTRL1: CAN0_RST Position  */\r
+#define RGU_RESET_CTRL1_CAN0_RST_Msk                          (0x01UL << RGU_RESET_CTRL1_CAN0_RST_Pos)                  /*!< RGU RESET_CTRL1: CAN0_RST Mask      */\r
+\r
+// ------------------------------------  RGU_RESET_STATUS0  ---------------------------------------\r
+#define RGU_RESET_STATUS0_CORE_RST_Pos                        0                                                         /*!< RGU RESET_STATUS0: CORE_RST Position */\r
+#define RGU_RESET_STATUS0_CORE_RST_Msk                        (0x03UL << RGU_RESET_STATUS0_CORE_RST_Pos)                /*!< RGU RESET_STATUS0: CORE_RST Mask    */\r
+#define RGU_RESET_STATUS0_PERIPH_RST_Pos                      2                                                         /*!< RGU RESET_STATUS0: PERIPH_RST Position */\r
+#define RGU_RESET_STATUS0_PERIPH_RST_Msk                      (0x03UL << RGU_RESET_STATUS0_PERIPH_RST_Pos)              /*!< RGU RESET_STATUS0: PERIPH_RST Mask  */\r
+#define RGU_RESET_STATUS0_MASTER_RST_Pos                      4                                                         /*!< RGU RESET_STATUS0: MASTER_RST Position */\r
+#define RGU_RESET_STATUS0_MASTER_RST_Msk                      (0x03UL << RGU_RESET_STATUS0_MASTER_RST_Pos)              /*!< RGU RESET_STATUS0: MASTER_RST Mask  */\r
+#define RGU_RESET_STATUS0_WWDT_RST_Pos                        8                                                         /*!< RGU RESET_STATUS0: WWDT_RST Position */\r
+#define RGU_RESET_STATUS0_WWDT_RST_Msk                        (0x03UL << RGU_RESET_STATUS0_WWDT_RST_Pos)                /*!< RGU RESET_STATUS0: WWDT_RST Mask    */\r
+#define RGU_RESET_STATUS0_CREG_RST_Pos                        10                                                        /*!< RGU RESET_STATUS0: CREG_RST Position */\r
+#define RGU_RESET_STATUS0_CREG_RST_Msk                        (0x03UL << RGU_RESET_STATUS0_CREG_RST_Pos)                /*!< RGU RESET_STATUS0: CREG_RST Mask    */\r
+#define RGU_RESET_STATUS0_BUS_RST_Pos                         16                                                        /*!< RGU RESET_STATUS0: BUS_RST Position */\r
+#define RGU_RESET_STATUS0_BUS_RST_Msk                         (0x03UL << RGU_RESET_STATUS0_BUS_RST_Pos)                 /*!< RGU RESET_STATUS0: BUS_RST Mask     */\r
+#define RGU_RESET_STATUS0_SCU_RST_Pos                         18                                                        /*!< RGU RESET_STATUS0: SCU_RST Position */\r
+#define RGU_RESET_STATUS0_SCU_RST_Msk                         (0x03UL << RGU_RESET_STATUS0_SCU_RST_Pos)                 /*!< RGU RESET_STATUS0: SCU_RST Mask     */\r
+#define RGU_RESET_STATUS0_M3_RST_Pos                          26                                                        /*!< RGU RESET_STATUS0: M3_RST Position  */\r
+#define RGU_RESET_STATUS0_M3_RST_Msk                          (0x03UL << RGU_RESET_STATUS0_M3_RST_Pos)                  /*!< RGU RESET_STATUS0: M3_RST Mask      */\r
+\r
+// ------------------------------------  RGU_RESET_STATUS1  ---------------------------------------\r
+#define RGU_RESET_STATUS1_LCD_RST_Pos                         0                                                         /*!< RGU RESET_STATUS1: LCD_RST Position */\r
+#define RGU_RESET_STATUS1_LCD_RST_Msk                         (0x03UL << RGU_RESET_STATUS1_LCD_RST_Pos)                 /*!< RGU RESET_STATUS1: LCD_RST Mask     */\r
+#define RGU_RESET_STATUS1_USB0_RST_Pos                        2                                                         /*!< RGU RESET_STATUS1: USB0_RST Position */\r
+#define RGU_RESET_STATUS1_USB0_RST_Msk                        (0x03UL << RGU_RESET_STATUS1_USB0_RST_Pos)                /*!< RGU RESET_STATUS1: USB0_RST Mask    */\r
+#define RGU_RESET_STATUS1_USB1_RST_Pos                        4                                                         /*!< RGU RESET_STATUS1: USB1_RST Position */\r
+#define RGU_RESET_STATUS1_USB1_RST_Msk                        (0x03UL << RGU_RESET_STATUS1_USB1_RST_Pos)                /*!< RGU RESET_STATUS1: USB1_RST Mask    */\r
+#define RGU_RESET_STATUS1_DMA_RST_Pos                         6                                                         /*!< RGU RESET_STATUS1: DMA_RST Position */\r
+#define RGU_RESET_STATUS1_DMA_RST_Msk                         (0x03UL << RGU_RESET_STATUS1_DMA_RST_Pos)                 /*!< RGU RESET_STATUS1: DMA_RST Mask     */\r
+#define RGU_RESET_STATUS1_SDIO_RST_Pos                        8                                                         /*!< RGU RESET_STATUS1: SDIO_RST Position */\r
+#define RGU_RESET_STATUS1_SDIO_RST_Msk                        (0x03UL << RGU_RESET_STATUS1_SDIO_RST_Pos)                /*!< RGU RESET_STATUS1: SDIO_RST Mask    */\r
+#define RGU_RESET_STATUS1_EMC_RST_Pos                         10                                                        /*!< RGU RESET_STATUS1: EMC_RST Position */\r
+#define RGU_RESET_STATUS1_EMC_RST_Msk                         (0x03UL << RGU_RESET_STATUS1_EMC_RST_Pos)                 /*!< RGU RESET_STATUS1: EMC_RST Mask     */\r
+#define RGU_RESET_STATUS1_ETHERNET_RST_Pos                    12                                                        /*!< RGU RESET_STATUS1: ETHERNET_RST Position */\r
+#define RGU_RESET_STATUS1_ETHERNET_RST_Msk                    (0x03UL << RGU_RESET_STATUS1_ETHERNET_RST_Pos)            /*!< RGU RESET_STATUS1: ETHERNET_RST Mask */\r
+#define RGU_RESET_STATUS1_GPIO_RST_Pos                        24                                                        /*!< RGU RESET_STATUS1: GPIO_RST Position */\r
+#define RGU_RESET_STATUS1_GPIO_RST_Msk                        (0x03UL << RGU_RESET_STATUS1_GPIO_RST_Pos)                /*!< RGU RESET_STATUS1: GPIO_RST Mask    */\r
+\r
+// ------------------------------------  RGU_RESET_STATUS2  ---------------------------------------\r
+#define RGU_RESET_STATUS2_TIMER0_RST_Pos                      0                                                         /*!< RGU RESET_STATUS2: TIMER0_RST Position */\r
+#define RGU_RESET_STATUS2_TIMER0_RST_Msk                      (0x03UL << RGU_RESET_STATUS2_TIMER0_RST_Pos)              /*!< RGU RESET_STATUS2: TIMER0_RST Mask  */\r
+#define RGU_RESET_STATUS2_TIMER1_RST_Pos                      2                                                         /*!< RGU RESET_STATUS2: TIMER1_RST Position */\r
+#define RGU_RESET_STATUS2_TIMER1_RST_Msk                      (0x03UL << RGU_RESET_STATUS2_TIMER1_RST_Pos)              /*!< RGU RESET_STATUS2: TIMER1_RST Mask  */\r
+#define RGU_RESET_STATUS2_TIMER2_RST_Pos                      4                                                         /*!< RGU RESET_STATUS2: TIMER2_RST Position */\r
+#define RGU_RESET_STATUS2_TIMER2_RST_Msk                      (0x03UL << RGU_RESET_STATUS2_TIMER2_RST_Pos)              /*!< RGU RESET_STATUS2: TIMER2_RST Mask  */\r
+#define RGU_RESET_STATUS2_TIMER3_RST_Pos                      6                                                         /*!< RGU RESET_STATUS2: TIMER3_RST Position */\r
+#define RGU_RESET_STATUS2_TIMER3_RST_Msk                      (0x03UL << RGU_RESET_STATUS2_TIMER3_RST_Pos)              /*!< RGU RESET_STATUS2: TIMER3_RST Mask  */\r
+#define RGU_RESET_STATUS2_RITIMER_RST_Pos                     8                                                         /*!< RGU RESET_STATUS2: RITIMER_RST Position */\r
+#define RGU_RESET_STATUS2_RITIMER_RST_Msk                     (0x03UL << RGU_RESET_STATUS2_RITIMER_RST_Pos)             /*!< RGU RESET_STATUS2: RITIMER_RST Mask */\r
+#define RGU_RESET_STATUS2_SCT_RST_Pos                         10                                                        /*!< RGU RESET_STATUS2: SCT_RST Position */\r
+#define RGU_RESET_STATUS2_SCT_RST_Msk                         (0x03UL << RGU_RESET_STATUS2_SCT_RST_Pos)                 /*!< RGU RESET_STATUS2: SCT_RST Mask     */\r
+#define RGU_RESET_STATUS2_MOTOCONPWM_RST_Pos                  12                                                        /*!< RGU RESET_STATUS2: MOTOCONPWM_RST Position */\r
+#define RGU_RESET_STATUS2_MOTOCONPWM_RST_Msk                  (0x03UL << RGU_RESET_STATUS2_MOTOCONPWM_RST_Pos)          /*!< RGU RESET_STATUS2: MOTOCONPWM_RST Mask */\r
+#define RGU_RESET_STATUS2_QEI_RST_Pos                         14                                                        /*!< RGU RESET_STATUS2: QEI_RST Position */\r
+#define RGU_RESET_STATUS2_QEI_RST_Msk                         (0x03UL << RGU_RESET_STATUS2_QEI_RST_Pos)                 /*!< RGU RESET_STATUS2: QEI_RST Mask     */\r
+#define RGU_RESET_STATUS2_ADC0_RST_Pos                        16                                                        /*!< RGU RESET_STATUS2: ADC0_RST Position */\r
+#define RGU_RESET_STATUS2_ADC0_RST_Msk                        (0x03UL << RGU_RESET_STATUS2_ADC0_RST_Pos)                /*!< RGU RESET_STATUS2: ADC0_RST Mask    */\r
+#define RGU_RESET_STATUS2_ADC1_RST_Pos                        18                                                        /*!< RGU RESET_STATUS2: ADC1_RST Position */\r
+#define RGU_RESET_STATUS2_ADC1_RST_Msk                        (0x03UL << RGU_RESET_STATUS2_ADC1_RST_Pos)                /*!< RGU RESET_STATUS2: ADC1_RST Mask    */\r
+#define RGU_RESET_STATUS2_DAC_RST_Pos                         20                                                        /*!< RGU RESET_STATUS2: DAC_RST Position */\r
+#define RGU_RESET_STATUS2_DAC_RST_Msk                         (0x03UL << RGU_RESET_STATUS2_DAC_RST_Pos)                 /*!< RGU RESET_STATUS2: DAC_RST Mask     */\r
+#define RGU_RESET_STATUS2_UART0_RST_Pos                       24                                                        /*!< RGU RESET_STATUS2: UART0_RST Position */\r
+#define RGU_RESET_STATUS2_UART0_RST_Msk                       (0x03UL << RGU_RESET_STATUS2_UART0_RST_Pos)               /*!< RGU RESET_STATUS2: UART0_RST Mask   */\r
+#define RGU_RESET_STATUS2_UART1_RST_Pos                       26                                                        /*!< RGU RESET_STATUS2: UART1_RST Position */\r
+#define RGU_RESET_STATUS2_UART1_RST_Msk                       (0x03UL << RGU_RESET_STATUS2_UART1_RST_Pos)               /*!< RGU RESET_STATUS2: UART1_RST Mask   */\r
+#define RGU_RESET_STATUS2_UART2_RST_Pos                       28                                                        /*!< RGU RESET_STATUS2: UART2_RST Position */\r
+#define RGU_RESET_STATUS2_UART2_RST_Msk                       (0x03UL << RGU_RESET_STATUS2_UART2_RST_Pos)               /*!< RGU RESET_STATUS2: UART2_RST Mask   */\r
+#define RGU_RESET_STATUS2_UART3_RST_Pos                       30                                                        /*!< RGU RESET_STATUS2: UART3_RST Position */\r
+#define RGU_RESET_STATUS2_UART3_RST_Msk                       (0x03UL << RGU_RESET_STATUS2_UART3_RST_Pos)               /*!< RGU RESET_STATUS2: UART3_RST Mask   */\r
+\r
+// ------------------------------------  RGU_RESET_STATUS3  ---------------------------------------\r
+#define RGU_RESET_STATUS3_I2C0_RST_Pos                        0                                                         /*!< RGU RESET_STATUS3: I2C0_RST Position */\r
+#define RGU_RESET_STATUS3_I2C0_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_I2C0_RST_Pos)                /*!< RGU RESET_STATUS3: I2C0_RST Mask    */\r
+#define RGU_RESET_STATUS3_I2C1_RST_Pos                        2                                                         /*!< RGU RESET_STATUS3: I2C1_RST Position */\r
+#define RGU_RESET_STATUS3_I2C1_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_I2C1_RST_Pos)                /*!< RGU RESET_STATUS3: I2C1_RST Mask    */\r
+#define RGU_RESET_STATUS3_SSP0_RST_Pos                        4                                                         /*!< RGU RESET_STATUS3: SSP0_RST Position */\r
+#define RGU_RESET_STATUS3_SSP0_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_SSP0_RST_Pos)                /*!< RGU RESET_STATUS3: SSP0_RST Mask    */\r
+#define RGU_RESET_STATUS3_SSP1_RST_Pos                        6                                                         /*!< RGU RESET_STATUS3: SSP1_RST Position */\r
+#define RGU_RESET_STATUS3_SSP1_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_SSP1_RST_Pos)                /*!< RGU RESET_STATUS3: SSP1_RST Mask    */\r
+#define RGU_RESET_STATUS3_I2S_RST_Pos                         8                                                         /*!< RGU RESET_STATUS3: I2S_RST Position */\r
+#define RGU_RESET_STATUS3_I2S_RST_Msk                         (0x03UL << RGU_RESET_STATUS3_I2S_RST_Pos)                 /*!< RGU RESET_STATUS3: I2S_RST Mask     */\r
+#define RGU_RESET_STATUS3_SPIFI_RST_Pos                       10                                                        /*!< RGU RESET_STATUS3: SPIFI_RST Position */\r
+#define RGU_RESET_STATUS3_SPIFI_RST_Msk                       (0x03UL << RGU_RESET_STATUS3_SPIFI_RST_Pos)               /*!< RGU RESET_STATUS3: SPIFI_RST Mask   */\r
+#define RGU_RESET_STATUS3_CAN1_RST_Pos                        12                                                        /*!< RGU RESET_STATUS3: CAN1_RST Position */\r
+#define RGU_RESET_STATUS3_CAN1_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_CAN1_RST_Pos)                /*!< RGU RESET_STATUS3: CAN1_RST Mask    */\r
+#define RGU_RESET_STATUS3_CAN0_RST_Pos                        14                                                        /*!< RGU RESET_STATUS3: CAN0_RST Position */\r
+#define RGU_RESET_STATUS3_CAN0_RST_Msk                        (0x03UL << RGU_RESET_STATUS3_CAN0_RST_Pos)                /*!< RGU RESET_STATUS3: CAN0_RST Mask    */\r
+\r
+// --------------------------------  RGU_RESET_ACTIVE_STATUS0  ------------------------------------\r
+#define RGU_RESET_ACTIVE_STATUS0_CORE_RST_Pos                 0                                                         /*!< RGU RESET_ACTIVE_STATUS0: CORE_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_CORE_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_CORE_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: CORE_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_PERIPH_RST_Pos               1                                                         /*!< RGU RESET_ACTIVE_STATUS0: PERIPH_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_PERIPH_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS0_PERIPH_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS0: PERIPH_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_MASTER_RST_Pos               2                                                         /*!< RGU RESET_ACTIVE_STATUS0: MASTER_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_MASTER_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS0_MASTER_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS0: MASTER_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_WWDT_RST_Pos                 4                                                         /*!< RGU RESET_ACTIVE_STATUS0: WWDT_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_WWDT_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_WWDT_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: WWDT_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_CREG_RST_Pos                 5                                                         /*!< RGU RESET_ACTIVE_STATUS0: CREG_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_CREG_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_CREG_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: CREG_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_BUS_RST_Pos                  8                                                         /*!< RGU RESET_ACTIVE_STATUS0: BUS_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_BUS_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS0_BUS_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS0: BUS_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_SCU_RST_Pos                  9                                                         /*!< RGU RESET_ACTIVE_STATUS0: SCU_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_SCU_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS0_SCU_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS0: SCU_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_PINMUX_RST_Pos               10                                                        /*!< RGU RESET_ACTIVE_STATUS0: PINMUX_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_PINMUX_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS0_PINMUX_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS0: PINMUX_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_M3_RST_Pos                   13                                                        /*!< RGU RESET_ACTIVE_STATUS0: M3_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_M3_RST_Msk                   (0x01UL << RGU_RESET_ACTIVE_STATUS0_M3_RST_Pos)           /*!< RGU RESET_ACTIVE_STATUS0: M3_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_LCD_RST_Pos                  16                                                        /*!< RGU RESET_ACTIVE_STATUS0: LCD_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_LCD_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS0_LCD_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS0: LCD_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_USB0_RST_Pos                 17                                                        /*!< RGU RESET_ACTIVE_STATUS0: USB0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_USB0_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_USB0_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: USB0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_USB1_RST_Pos                 18                                                        /*!< RGU RESET_ACTIVE_STATUS0: USB1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_USB1_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_USB1_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: USB1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_DMA_RST_Pos                  19                                                        /*!< RGU RESET_ACTIVE_STATUS0: DMA_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_DMA_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS0_DMA_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS0: DMA_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_SDIO_RST_Pos                 20                                                        /*!< RGU RESET_ACTIVE_STATUS0: SDIO_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_SDIO_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_SDIO_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: SDIO_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_EMC_RST_Pos                  21                                                        /*!< RGU RESET_ACTIVE_STATUS0: EMC_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_EMC_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS0_EMC_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS0: EMC_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_ETHERNET_RST_Pos             22                                                        /*!< RGU RESET_ACTIVE_STATUS0: ETHERNET_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_ETHERNET_RST_Msk             (0x01UL << RGU_RESET_ACTIVE_STATUS0_ETHERNET_RST_Pos)     /*!< RGU RESET_ACTIVE_STATUS0: ETHERNET_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS0_GPIO_RST_Pos                 28                                                        /*!< RGU RESET_ACTIVE_STATUS0: GPIO_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS0_GPIO_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS0_GPIO_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS0: GPIO_RST Mask */\r
+\r
+// --------------------------------  RGU_RESET_ACTIVE_STATUS1  ------------------------------------\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER0_RST_Pos               0                                                         /*!< RGU RESET_ACTIVE_STATUS1: TIMER0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER0_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS1_TIMER0_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS1: TIMER0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER1_RST_Pos               1                                                         /*!< RGU RESET_ACTIVE_STATUS1: TIMER1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER1_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS1_TIMER1_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS1: TIMER1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER2_RST_Pos               2                                                         /*!< RGU RESET_ACTIVE_STATUS1: TIMER2_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER2_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS1_TIMER2_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS1: TIMER2_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER3_RST_Pos               3                                                         /*!< RGU RESET_ACTIVE_STATUS1: TIMER3_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_TIMER3_RST_Msk               (0x01UL << RGU_RESET_ACTIVE_STATUS1_TIMER3_RST_Pos)       /*!< RGU RESET_ACTIVE_STATUS1: TIMER3_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_RITIMER_RST_Pos              4                                                         /*!< RGU RESET_ACTIVE_STATUS1: RITIMER_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_RITIMER_RST_Msk              (0x01UL << RGU_RESET_ACTIVE_STATUS1_RITIMER_RST_Pos)      /*!< RGU RESET_ACTIVE_STATUS1: RITIMER_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_SCT_RST_Pos                  5                                                         /*!< RGU RESET_ACTIVE_STATUS1: SCT_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_SCT_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS1_SCT_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS1: SCT_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_MOTOCONPWM_RST_Pos           6                                                         /*!< RGU RESET_ACTIVE_STATUS1: MOTOCONPWM_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_MOTOCONPWM_RST_Msk           (0x01UL << RGU_RESET_ACTIVE_STATUS1_MOTOCONPWM_RST_Pos)   /*!< RGU RESET_ACTIVE_STATUS1: MOTOCONPWM_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_QEI_RST_Pos                  7                                                         /*!< RGU RESET_ACTIVE_STATUS1: QEI_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_QEI_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS1_QEI_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS1: QEI_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_ADC0_RST_Pos                 8                                                         /*!< RGU RESET_ACTIVE_STATUS1: ADC0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_ADC0_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_ADC0_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: ADC0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_ADC1_RST_Pos                 9                                                         /*!< RGU RESET_ACTIVE_STATUS1: ADC1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_ADC1_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_ADC1_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: ADC1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_DAC_RST_Pos                  10                                                        /*!< RGU RESET_ACTIVE_STATUS1: DAC_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_DAC_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS1_DAC_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS1: DAC_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART0_RST_Pos                12                                                        /*!< RGU RESET_ACTIVE_STATUS1: UART0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART0_RST_Msk                (0x01UL << RGU_RESET_ACTIVE_STATUS1_UART0_RST_Pos)        /*!< RGU RESET_ACTIVE_STATUS1: UART0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART1_RST_Pos                13                                                        /*!< RGU RESET_ACTIVE_STATUS1: UART1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART1_RST_Msk                (0x01UL << RGU_RESET_ACTIVE_STATUS1_UART1_RST_Pos)        /*!< RGU RESET_ACTIVE_STATUS1: UART1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART2_RST_Pos                14                                                        /*!< RGU RESET_ACTIVE_STATUS1: UART2_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART2_RST_Msk                (0x01UL << RGU_RESET_ACTIVE_STATUS1_UART2_RST_Pos)        /*!< RGU RESET_ACTIVE_STATUS1: UART2_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART3_RST_Pos                15                                                        /*!< RGU RESET_ACTIVE_STATUS1: UART3_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_UART3_RST_Msk                (0x01UL << RGU_RESET_ACTIVE_STATUS1_UART3_RST_Pos)        /*!< RGU RESET_ACTIVE_STATUS1: UART3_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2C0_RST_Pos                 16                                                        /*!< RGU RESET_ACTIVE_STATUS1: I2C0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2C0_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_I2C0_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: I2C0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2C1_RST_Pos                 17                                                        /*!< RGU RESET_ACTIVE_STATUS1: I2C1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2C1_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_I2C1_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: I2C1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_SSP0_RST_Pos                 18                                                        /*!< RGU RESET_ACTIVE_STATUS1: SSP0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_SSP0_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_SSP0_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: SSP0_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_SSP1_RST_Pos                 19                                                        /*!< RGU RESET_ACTIVE_STATUS1: SSP1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_SSP1_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_SSP1_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: SSP1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2S_RST_Pos                  20                                                        /*!< RGU RESET_ACTIVE_STATUS1: I2S_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_I2S_RST_Msk                  (0x01UL << RGU_RESET_ACTIVE_STATUS1_I2S_RST_Pos)          /*!< RGU RESET_ACTIVE_STATUS1: I2S_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_SPIFI_RST_Pos                21                                                        /*!< RGU RESET_ACTIVE_STATUS1: SPIFI_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_SPIFI_RST_Msk                (0x01UL << RGU_RESET_ACTIVE_STATUS1_SPIFI_RST_Pos)        /*!< RGU RESET_ACTIVE_STATUS1: SPIFI_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_CAN1_RST_Pos                 22                                                        /*!< RGU RESET_ACTIVE_STATUS1: CAN1_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_CAN1_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_CAN1_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: CAN1_RST Mask */\r
+#define RGU_RESET_ACTIVE_STATUS1_CAN0_RST_Pos                 23                                                        /*!< RGU RESET_ACTIVE_STATUS1: CAN0_RST Position */\r
+#define RGU_RESET_ACTIVE_STATUS1_CAN0_RST_Msk                 (0x01UL << RGU_RESET_ACTIVE_STATUS1_CAN0_RST_Pos)         /*!< RGU RESET_ACTIVE_STATUS1: CAN0_RST Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT0  --------------------------------------\r
+#define RGU_RESET_EXT_STAT0_EXT_RESET_Pos                     0                                                         /*!< RGU RESET_EXT_STAT0: EXT_RESET Position */\r
+#define RGU_RESET_EXT_STAT0_EXT_RESET_Msk                     (0x01UL << RGU_RESET_EXT_STAT0_EXT_RESET_Pos)             /*!< RGU RESET_EXT_STAT0: EXT_RESET Mask */\r
+#define RGU_RESET_EXT_STAT0_BOD_RESET_Pos                     4                                                         /*!< RGU RESET_EXT_STAT0: BOD_RESET Position */\r
+#define RGU_RESET_EXT_STAT0_BOD_RESET_Msk                     (0x01UL << RGU_RESET_EXT_STAT0_BOD_RESET_Pos)             /*!< RGU RESET_EXT_STAT0: BOD_RESET Mask */\r
+#define RGU_RESET_EXT_STAT0_WWDT_RESET_Pos                    5                                                         /*!< RGU RESET_EXT_STAT0: WWDT_RESET Position */\r
+#define RGU_RESET_EXT_STAT0_WWDT_RESET_Msk                    (0x01UL << RGU_RESET_EXT_STAT0_WWDT_RESET_Pos)            /*!< RGU RESET_EXT_STAT0: WWDT_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT1  --------------------------------------\r
+#define RGU_RESET_EXT_STAT1_CORE_RESET_Pos                    1                                                         /*!< RGU RESET_EXT_STAT1: CORE_RESET Position */\r
+#define RGU_RESET_EXT_STAT1_CORE_RESET_Msk                    (0x01UL << RGU_RESET_EXT_STAT1_CORE_RESET_Pos)            /*!< RGU RESET_EXT_STAT1: CORE_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT2  --------------------------------------\r
+#define RGU_RESET_EXT_STAT2_PERIPHERAL_RESET_Pos              2                                                         /*!< RGU RESET_EXT_STAT2: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT2_PERIPHERAL_RESET_Msk              (0x01UL << RGU_RESET_EXT_STAT2_PERIPHERAL_RESET_Pos)      /*!< RGU RESET_EXT_STAT2: PERIPHERAL_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT4  --------------------------------------\r
+#define RGU_RESET_EXT_STAT4_CORE_RESET_Pos                    1                                                         /*!< RGU RESET_EXT_STAT4: CORE_RESET Position */\r
+#define RGU_RESET_EXT_STAT4_CORE_RESET_Msk                    (0x01UL << RGU_RESET_EXT_STAT4_CORE_RESET_Pos)            /*!< RGU RESET_EXT_STAT4: CORE_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT5  --------------------------------------\r
+#define RGU_RESET_EXT_STAT5_CORE_RESET_Pos                    1                                                         /*!< RGU RESET_EXT_STAT5: CORE_RESET Position */\r
+#define RGU_RESET_EXT_STAT5_CORE_RESET_Msk                    (0x01UL << RGU_RESET_EXT_STAT5_CORE_RESET_Pos)            /*!< RGU RESET_EXT_STAT5: CORE_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT8  --------------------------------------\r
+#define RGU_RESET_EXT_STAT8_PERIPHERAL_RESET_Pos              2                                                         /*!< RGU RESET_EXT_STAT8: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT8_PERIPHERAL_RESET_Msk              (0x01UL << RGU_RESET_EXT_STAT8_PERIPHERAL_RESET_Pos)      /*!< RGU RESET_EXT_STAT8: PERIPHERAL_RESET Mask */\r
+\r
+// -----------------------------------  RGU_RESET_EXT_STAT9  --------------------------------------\r
+#define RGU_RESET_EXT_STAT9_PERIPHERAL_RESET_Pos              2                                                         /*!< RGU RESET_EXT_STAT9: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT9_PERIPHERAL_RESET_Msk              (0x01UL << RGU_RESET_EXT_STAT9_PERIPHERAL_RESET_Pos)      /*!< RGU RESET_EXT_STAT9: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT13  --------------------------------------\r
+#define RGU_RESET_EXT_STAT13_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT13: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT13_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT13_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT13: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT16  --------------------------------------\r
+#define RGU_RESET_EXT_STAT16_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT16: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT16_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT16_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT16: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT17  --------------------------------------\r
+#define RGU_RESET_EXT_STAT17_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT17: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT17_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT17_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT17: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT18  --------------------------------------\r
+#define RGU_RESET_EXT_STAT18_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT18: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT18_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT18_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT18: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT19  --------------------------------------\r
+#define RGU_RESET_EXT_STAT19_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT19: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT19_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT19_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT19: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT20  --------------------------------------\r
+#define RGU_RESET_EXT_STAT20_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT20: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT20_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT20_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT20: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT21  --------------------------------------\r
+#define RGU_RESET_EXT_STAT21_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT21: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT21_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT21_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT21: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT22  --------------------------------------\r
+#define RGU_RESET_EXT_STAT22_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT22: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT22_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT22_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT22: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT23  --------------------------------------\r
+#define RGU_RESET_EXT_STAT23_MASTER_RESET_Pos                 3                                                         /*!< RGU RESET_EXT_STAT23: MASTER_RESET Position */\r
+#define RGU_RESET_EXT_STAT23_MASTER_RESET_Msk                 (0x01UL << RGU_RESET_EXT_STAT23_MASTER_RESET_Pos)         /*!< RGU RESET_EXT_STAT23: MASTER_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT28  --------------------------------------\r
+#define RGU_RESET_EXT_STAT28_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT28: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT28_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT28_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT28: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT32  --------------------------------------\r
+#define RGU_RESET_EXT_STAT32_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT32: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT32_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT32_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT32: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT33  --------------------------------------\r
+#define RGU_RESET_EXT_STAT33_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT33: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT33_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT33_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT33: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT34  --------------------------------------\r
+#define RGU_RESET_EXT_STAT34_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT34: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT34_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT34_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT34: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT35  --------------------------------------\r
+#define RGU_RESET_EXT_STAT35_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT35: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT35_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT35_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT35: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT36  --------------------------------------\r
+#define RGU_RESET_EXT_STAT36_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT36: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT36_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT36_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT36: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT37  --------------------------------------\r
+#define RGU_RESET_EXT_STAT37_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT37: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT37_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT37_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT37: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT38  --------------------------------------\r
+#define RGU_RESET_EXT_STAT38_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT38: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT38_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT38_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT38: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT39  --------------------------------------\r
+#define RGU_RESET_EXT_STAT39_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT39: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT39_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT39_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT39: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT40  --------------------------------------\r
+#define RGU_RESET_EXT_STAT40_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT40: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT40_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT40_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT40: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT41  --------------------------------------\r
+#define RGU_RESET_EXT_STAT41_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT41: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT41_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT41_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT41: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT42  --------------------------------------\r
+#define RGU_RESET_EXT_STAT42_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT42: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT42_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT42_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT42: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT44  --------------------------------------\r
+#define RGU_RESET_EXT_STAT44_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT44: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT44_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT44_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT44: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT45  --------------------------------------\r
+#define RGU_RESET_EXT_STAT45_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT45: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT45_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT45_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT45: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT46  --------------------------------------\r
+#define RGU_RESET_EXT_STAT46_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT46: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT46_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT46_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT46: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT47  --------------------------------------\r
+#define RGU_RESET_EXT_STAT47_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT47: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT47_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT47_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT47: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT48  --------------------------------------\r
+#define RGU_RESET_EXT_STAT48_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT48: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT48_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT48_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT48: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT49  --------------------------------------\r
+#define RGU_RESET_EXT_STAT49_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT49: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT49_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT49_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT49: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT50  --------------------------------------\r
+#define RGU_RESET_EXT_STAT50_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT50: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT50_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT50_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT50: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT51  --------------------------------------\r
+#define RGU_RESET_EXT_STAT51_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT51: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT51_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT51_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT51: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT52  --------------------------------------\r
+#define RGU_RESET_EXT_STAT52_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT52: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT52_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT52_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT52: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT53  --------------------------------------\r
+#define RGU_RESET_EXT_STAT53_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT53: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT53_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT53_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT53: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT54  --------------------------------------\r
+#define RGU_RESET_EXT_STAT54_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT54: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT54_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT54_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT54: PERIPHERAL_RESET Mask */\r
+\r
+// ----------------------------------  RGU_RESET_EXT_STAT55  --------------------------------------\r
+#define RGU_RESET_EXT_STAT55_PERIPHERAL_RESET_Pos             2                                                         /*!< RGU RESET_EXT_STAT55: PERIPHERAL_RESET Position */\r
+#define RGU_RESET_EXT_STAT55_PERIPHERAL_RESET_Msk             (0x01UL << RGU_RESET_EXT_STAT55_PERIPHERAL_RESET_Pos)     /*!< RGU RESET_EXT_STAT55: PERIPHERAL_RESET Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 WWDT Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  WWDT_MOD  --------------------------------------------\r
+#define WWDT_MOD_WDEN_Pos                                     0                                                         /*!< WWDT MOD: WDEN Position             */\r
+#define WWDT_MOD_WDEN_Msk                                     (0x01UL << WWDT_MOD_WDEN_Pos)                             /*!< WWDT MOD: WDEN Mask                 */\r
+#define WWDT_MOD_WDRESET_Pos                                  1                                                         /*!< WWDT MOD: WDRESET Position          */\r
+#define WWDT_MOD_WDRESET_Msk                                  (0x01UL << WWDT_MOD_WDRESET_Pos)                          /*!< WWDT MOD: WDRESET Mask              */\r
+#define WWDT_MOD_WDTOF_Pos                                    2                                                         /*!< WWDT MOD: WDTOF Position            */\r
+#define WWDT_MOD_WDTOF_Msk                                    (0x01UL << WWDT_MOD_WDTOF_Pos)                            /*!< WWDT MOD: WDTOF Mask                */\r
+#define WWDT_MOD_WDINT_Pos                                    3                                                         /*!< WWDT MOD: WDINT Position            */\r
+#define WWDT_MOD_WDINT_Msk                                    (0x01UL << WWDT_MOD_WDINT_Pos)                            /*!< WWDT MOD: WDINT Mask                */\r
+#define WWDT_MOD_WDPROTECT_Pos                                4                                                         /*!< WWDT MOD: WDPROTECT Position        */\r
+#define WWDT_MOD_WDPROTECT_Msk                                (0x01UL << WWDT_MOD_WDPROTECT_Pos)                        /*!< WWDT MOD: WDPROTECT Mask            */\r
+\r
+// -----------------------------------------  WWDT_TC  --------------------------------------------\r
+#define WWDT_TC_WDTC_Pos                                      0                                                         /*!< WWDT TC: WDTC Position              */\r
+#define WWDT_TC_WDTC_Msk                                      (0x00ffffffUL << WWDT_TC_WDTC_Pos)                        /*!< WWDT TC: WDTC Mask                  */\r
+\r
+// ----------------------------------------  WWDT_FEED  -------------------------------------------\r
+#define WWDT_FEED_Feed_Pos                                    0                                                         /*!< WWDT FEED: Feed Position            */\r
+#define WWDT_FEED_Feed_Msk                                    (0x000000ffUL << WWDT_FEED_Feed_Pos)                      /*!< WWDT FEED: Feed Mask                */\r
+\r
+// -----------------------------------------  WWDT_TV  --------------------------------------------\r
+#define WWDT_TV_Count_Pos                                     0                                                         /*!< WWDT TV: Count Position             */\r
+#define WWDT_TV_Count_Msk                                     (0x00ffffffUL << WWDT_TV_Count_Pos)                       /*!< WWDT TV: Count Mask                 */\r
+\r
+// --------------------------------------  WWDT_WARNINT  ------------------------------------------\r
+#define WWDT_WARNINT_WDWARNINT_Pos                            0                                                         /*!< WWDT WARNINT: WDWARNINT Position    */\r
+#define WWDT_WARNINT_WDWARNINT_Msk                            (0x000003ffUL << WWDT_WARNINT_WDWARNINT_Pos)              /*!< WWDT WARNINT: WDWARNINT Mask        */\r
+\r
+// ---------------------------------------  WWDT_WINDOW  ------------------------------------------\r
+#define WWDT_WINDOW_WDWINDOW_Pos                              0                                                         /*!< WWDT WINDOW: WDWINDOW Position      */\r
+#define WWDT_WINDOW_WDWINDOW_Msk                              (0x00ffffffUL << WWDT_WINDOW_WDWINDOW_Pos)                /*!< WWDT WINDOW: WDWINDOW Mask          */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                USART0 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  USART0_RBR  -------------------------------------------\r
+#define USART0_RBR_RBR_Pos                                    0                                                         /*!< USART0 RBR: RBR Position            */\r
+#define USART0_RBR_RBR_Msk                                    (0x000000ffUL << USART0_RBR_RBR_Pos)                      /*!< USART0 RBR: RBR Mask                */\r
+\r
+// ---------------------------------------  USART0_THR  -------------------------------------------\r
+#define USART0_THR_THR_Pos                                    0                                                         /*!< USART0 THR: THR Position            */\r
+#define USART0_THR_THR_Msk                                    (0x000000ffUL << USART0_THR_THR_Pos)                      /*!< USART0 THR: THR Mask                */\r
+\r
+// ---------------------------------------  USART0_DLL  -------------------------------------------\r
+#define USART0_DLL_DLLSB_Pos                                  0                                                         /*!< USART0 DLL: DLLSB Position          */\r
+#define USART0_DLL_DLLSB_Msk                                  (0x000000ffUL << USART0_DLL_DLLSB_Pos)                    /*!< USART0 DLL: DLLSB Mask              */\r
+\r
+// ---------------------------------------  USART0_DLM  -------------------------------------------\r
+#define USART0_DLM_DLMSB_Pos                                  0                                                         /*!< USART0 DLM: DLMSB Position          */\r
+#define USART0_DLM_DLMSB_Msk                                  (0x000000ffUL << USART0_DLM_DLMSB_Pos)                    /*!< USART0 DLM: DLMSB Mask              */\r
+\r
+// ---------------------------------------  USART0_IER  -------------------------------------------\r
+#define USART0_IER_RBRIE_Pos                                  0                                                         /*!< USART0 IER: RBRIE Position          */\r
+#define USART0_IER_RBRIE_Msk                                  (0x01UL << USART0_IER_RBRIE_Pos)                          /*!< USART0 IER: RBRIE Mask              */\r
+#define USART0_IER_THREIE_Pos                                 1                                                         /*!< USART0 IER: THREIE Position         */\r
+#define USART0_IER_THREIE_Msk                                 (0x01UL << USART0_IER_THREIE_Pos)                         /*!< USART0 IER: THREIE Mask             */\r
+#define USART0_IER_RXIE_Pos                                   2                                                         /*!< USART0 IER: RXIE Position           */\r
+#define USART0_IER_RXIE_Msk                                   (0x01UL << USART0_IER_RXIE_Pos)                           /*!< USART0 IER: RXIE Mask               */\r
+#define USART0_IER_ABEOINTEN_Pos                              8                                                         /*!< USART0 IER: ABEOINTEN Position      */\r
+#define USART0_IER_ABEOINTEN_Msk                              (0x01UL << USART0_IER_ABEOINTEN_Pos)                      /*!< USART0 IER: ABEOINTEN Mask          */\r
+#define USART0_IER_ABTOINTEN_Pos                              9                                                         /*!< USART0 IER: ABTOINTEN Position      */\r
+#define USART0_IER_ABTOINTEN_Msk                              (0x01UL << USART0_IER_ABTOINTEN_Pos)                      /*!< USART0 IER: ABTOINTEN Mask          */\r
+\r
+// ---------------------------------------  USART0_IIR  -------------------------------------------\r
+#define USART0_IIR_INTSTATUS_Pos                              0                                                         /*!< USART0 IIR: INTSTATUS Position      */\r
+#define USART0_IIR_INTSTATUS_Msk                              (0x01UL << USART0_IIR_INTSTATUS_Pos)                      /*!< USART0 IIR: INTSTATUS Mask          */\r
+#define USART0_IIR_INTID_Pos                                  1                                                         /*!< USART0 IIR: INTID Position          */\r
+#define USART0_IIR_INTID_Msk                                  (0x07UL << USART0_IIR_INTID_Pos)                          /*!< USART0 IIR: INTID Mask              */\r
+#define USART0_IIR_FIFOENABLE_Pos                             6                                                         /*!< USART0 IIR: FIFOENABLE Position     */\r
+#define USART0_IIR_FIFOENABLE_Msk                             (0x03UL << USART0_IIR_FIFOENABLE_Pos)                     /*!< USART0 IIR: FIFOENABLE Mask         */\r
+#define USART0_IIR_ABEOINT_Pos                                8                                                         /*!< USART0 IIR: ABEOINT Position        */\r
+#define USART0_IIR_ABEOINT_Msk                                (0x01UL << USART0_IIR_ABEOINT_Pos)                        /*!< USART0 IIR: ABEOINT Mask            */\r
+#define USART0_IIR_ABTOINT_Pos                                9                                                         /*!< USART0 IIR: ABTOINT Position        */\r
+#define USART0_IIR_ABTOINT_Msk                                (0x01UL << USART0_IIR_ABTOINT_Pos)                        /*!< USART0 IIR: ABTOINT Mask            */\r
+\r
+// ---------------------------------------  USART0_FCR  -------------------------------------------\r
+#define USART0_FCR_FIFOEN_Pos                                 0                                                         /*!< USART0 FCR: FIFOEN Position         */\r
+#define USART0_FCR_FIFOEN_Msk                                 (0x01UL << USART0_FCR_FIFOEN_Pos)                         /*!< USART0 FCR: FIFOEN Mask             */\r
+#define USART0_FCR_RXFIFORES_Pos                              1                                                         /*!< USART0 FCR: RXFIFORES Position      */\r
+#define USART0_FCR_RXFIFORES_Msk                              (0x01UL << USART0_FCR_RXFIFORES_Pos)                      /*!< USART0 FCR: RXFIFORES Mask          */\r
+#define USART0_FCR_TXFIFORES_Pos                              2                                                         /*!< USART0 FCR: TXFIFORES Position      */\r
+#define USART0_FCR_TXFIFORES_Msk                              (0x01UL << USART0_FCR_TXFIFORES_Pos)                      /*!< USART0 FCR: TXFIFORES Mask          */\r
+#define USART0_FCR_DMAMODE_Pos                                3                                                         /*!< USART0 FCR: DMAMODE Position        */\r
+#define USART0_FCR_DMAMODE_Msk                                (0x01UL << USART0_FCR_DMAMODE_Pos)                        /*!< USART0 FCR: DMAMODE Mask            */\r
+#define USART0_FCR_RXTRIGLVL_Pos                              6                                                         /*!< USART0 FCR: RXTRIGLVL Position      */\r
+#define USART0_FCR_RXTRIGLVL_Msk                              (0x03UL << USART0_FCR_RXTRIGLVL_Pos)                      /*!< USART0 FCR: RXTRIGLVL Mask          */\r
+\r
+// ---------------------------------------  USART0_LCR  -------------------------------------------\r
+#define USART0_LCR_WLS_Pos                                    0                                                         /*!< USART0 LCR: WLS Position            */\r
+#define USART0_LCR_WLS_Msk                                    (0x03UL << USART0_LCR_WLS_Pos)                            /*!< USART0 LCR: WLS Mask                */\r
+#define USART0_LCR_SBS_Pos                                    2                                                         /*!< USART0 LCR: SBS Position            */\r
+#define USART0_LCR_SBS_Msk                                    (0x01UL << USART0_LCR_SBS_Pos)                            /*!< USART0 LCR: SBS Mask                */\r
+#define USART0_LCR_PE_Pos                                     3                                                         /*!< USART0 LCR: PE Position             */\r
+#define USART0_LCR_PE_Msk                                     (0x01UL << USART0_LCR_PE_Pos)                             /*!< USART0 LCR: PE Mask                 */\r
+#define USART0_LCR_PS_Pos                                     4                                                         /*!< USART0 LCR: PS Position             */\r
+#define USART0_LCR_PS_Msk                                     (0x03UL << USART0_LCR_PS_Pos)                             /*!< USART0 LCR: PS Mask                 */\r
+#define USART0_LCR_BC_Pos                                     6                                                         /*!< USART0 LCR: BC Position             */\r
+#define USART0_LCR_BC_Msk                                     (0x01UL << USART0_LCR_BC_Pos)                             /*!< USART0 LCR: BC Mask                 */\r
+#define USART0_LCR_DLAB_Pos                                   7                                                         /*!< USART0 LCR: DLAB Position           */\r
+#define USART0_LCR_DLAB_Msk                                   (0x01UL << USART0_LCR_DLAB_Pos)                           /*!< USART0 LCR: DLAB Mask               */\r
+\r
+// ---------------------------------------  USART0_LSR  -------------------------------------------\r
+#define USART0_LSR_RDR_Pos                                    0                                                         /*!< USART0 LSR: RDR Position            */\r
+#define USART0_LSR_RDR_Msk                                    (0x01UL << USART0_LSR_RDR_Pos)                            /*!< USART0 LSR: RDR Mask                */\r
+#define USART0_LSR_OE_Pos                                     1                                                         /*!< USART0 LSR: OE Position             */\r
+#define USART0_LSR_OE_Msk                                     (0x01UL << USART0_LSR_OE_Pos)                             /*!< USART0 LSR: OE Mask                 */\r
+#define USART0_LSR_PE_Pos                                     2                                                         /*!< USART0 LSR: PE Position             */\r
+#define USART0_LSR_PE_Msk                                     (0x01UL << USART0_LSR_PE_Pos)                             /*!< USART0 LSR: PE Mask                 */\r
+#define USART0_LSR_FE_Pos                                     3                                                         /*!< USART0 LSR: FE Position             */\r
+#define USART0_LSR_FE_Msk                                     (0x01UL << USART0_LSR_FE_Pos)                             /*!< USART0 LSR: FE Mask                 */\r
+#define USART0_LSR_BI_Pos                                     4                                                         /*!< USART0 LSR: BI Position             */\r
+#define USART0_LSR_BI_Msk                                     (0x01UL << USART0_LSR_BI_Pos)                             /*!< USART0 LSR: BI Mask                 */\r
+#define USART0_LSR_THRE_Pos                                   5                                                         /*!< USART0 LSR: THRE Position           */\r
+#define USART0_LSR_THRE_Msk                                   (0x01UL << USART0_LSR_THRE_Pos)                           /*!< USART0 LSR: THRE Mask               */\r
+#define USART0_LSR_TEMT_Pos                                   6                                                         /*!< USART0 LSR: TEMT Position           */\r
+#define USART0_LSR_TEMT_Msk                                   (0x01UL << USART0_LSR_TEMT_Pos)                           /*!< USART0 LSR: TEMT Mask               */\r
+#define USART0_LSR_RXFE_Pos                                   7                                                         /*!< USART0 LSR: RXFE Position           */\r
+#define USART0_LSR_RXFE_Msk                                   (0x01UL << USART0_LSR_RXFE_Pos)                           /*!< USART0 LSR: RXFE Mask               */\r
+#define USART0_LSR_TXERR_Pos                                  8                                                         /*!< USART0 LSR: TXERR Position          */\r
+#define USART0_LSR_TXERR_Msk                                  (0x01UL << USART0_LSR_TXERR_Pos)                          /*!< USART0 LSR: TXERR Mask              */\r
+\r
+// ---------------------------------------  USART0_SCR  -------------------------------------------\r
+#define USART0_SCR_PAD_Pos                                    0                                                         /*!< USART0 SCR: PAD Position            */\r
+#define USART0_SCR_PAD_Msk                                    (0x000000ffUL << USART0_SCR_PAD_Pos)                      /*!< USART0 SCR: PAD Mask                */\r
+\r
+// ---------------------------------------  USART0_ACR  -------------------------------------------\r
+#define USART0_ACR_START_Pos                                  0                                                         /*!< USART0 ACR: START Position          */\r
+#define USART0_ACR_START_Msk                                  (0x01UL << USART0_ACR_START_Pos)                          /*!< USART0 ACR: START Mask              */\r
+#define USART0_ACR_MODE_Pos                                   1                                                         /*!< USART0 ACR: MODE Position           */\r
+#define USART0_ACR_MODE_Msk                                   (0x01UL << USART0_ACR_MODE_Pos)                           /*!< USART0 ACR: MODE Mask               */\r
+#define USART0_ACR_AUTORESTART_Pos                            2                                                         /*!< USART0 ACR: AUTORESTART Position    */\r
+#define USART0_ACR_AUTORESTART_Msk                            (0x01UL << USART0_ACR_AUTORESTART_Pos)                    /*!< USART0 ACR: AUTORESTART Mask        */\r
+#define USART0_ACR_ABEOINTCLR_Pos                             8                                                         /*!< USART0 ACR: ABEOINTCLR Position     */\r
+#define USART0_ACR_ABEOINTCLR_Msk                             (0x01UL << USART0_ACR_ABEOINTCLR_Pos)                     /*!< USART0 ACR: ABEOINTCLR Mask         */\r
+#define USART0_ACR_ABTOINTCLR_Pos                             9                                                         /*!< USART0 ACR: ABTOINTCLR Position     */\r
+#define USART0_ACR_ABTOINTCLR_Msk                             (0x01UL << USART0_ACR_ABTOINTCLR_Pos)                     /*!< USART0 ACR: ABTOINTCLR Mask         */\r
+\r
+// ---------------------------------------  USART0_ICR  -------------------------------------------\r
+#define USART0_ICR_IRDAEN_Pos                                 0                                                         /*!< USART0 ICR: IRDAEN Position         */\r
+#define USART0_ICR_IRDAEN_Msk                                 (0x01UL << USART0_ICR_IRDAEN_Pos)                         /*!< USART0 ICR: IRDAEN Mask             */\r
+#define USART0_ICR_IRDAINV_Pos                                1                                                         /*!< USART0 ICR: IRDAINV Position        */\r
+#define USART0_ICR_IRDAINV_Msk                                (0x01UL << USART0_ICR_IRDAINV_Pos)                        /*!< USART0 ICR: IRDAINV Mask            */\r
+#define USART0_ICR_FIXPULSEEN_Pos                             2                                                         /*!< USART0 ICR: FIXPULSEEN Position     */\r
+#define USART0_ICR_FIXPULSEEN_Msk                             (0x01UL << USART0_ICR_FIXPULSEEN_Pos)                     /*!< USART0 ICR: FIXPULSEEN Mask         */\r
+#define USART0_ICR_PULSEDIV_Pos                               3                                                         /*!< USART0 ICR: PULSEDIV Position       */\r
+#define USART0_ICR_PULSEDIV_Msk                               (0x07UL << USART0_ICR_PULSEDIV_Pos)                       /*!< USART0 ICR: PULSEDIV Mask           */\r
+\r
+// ---------------------------------------  USART0_FDR  -------------------------------------------\r
+#define USART0_FDR_DIVADDVAL_Pos                              0                                                         /*!< USART0 FDR: DIVADDVAL Position      */\r
+#define USART0_FDR_DIVADDVAL_Msk                              (0x0fUL << USART0_FDR_DIVADDVAL_Pos)                      /*!< USART0 FDR: DIVADDVAL Mask          */\r
+#define USART0_FDR_MULVAL_Pos                                 4                                                         /*!< USART0 FDR: MULVAL Position         */\r
+#define USART0_FDR_MULVAL_Msk                                 (0x0fUL << USART0_FDR_MULVAL_Pos)                         /*!< USART0 FDR: MULVAL Mask             */\r
+\r
+// ---------------------------------------  USART0_OSR  -------------------------------------------\r
+#define USART0_OSR_OSFRAC_Pos                                 1                                                         /*!< USART0 OSR: OSFRAC Position         */\r
+#define USART0_OSR_OSFRAC_Msk                                 (0x07UL << USART0_OSR_OSFRAC_Pos)                         /*!< USART0 OSR: OSFRAC Mask             */\r
+#define USART0_OSR_OSINT_Pos                                  4                                                         /*!< USART0 OSR: OSINT Position          */\r
+#define USART0_OSR_OSINT_Msk                                  (0x0fUL << USART0_OSR_OSINT_Pos)                          /*!< USART0 OSR: OSINT Mask              */\r
+#define USART0_OSR_FDINT_Pos                                  8                                                         /*!< USART0 OSR: FDINT Position          */\r
+#define USART0_OSR_FDINT_Msk                                  (0x7fUL << USART0_OSR_FDINT_Pos)                          /*!< USART0 OSR: FDINT Mask              */\r
+\r
+// ---------------------------------------  USART0_HDEN  ------------------------------------------\r
+#define USART0_HDEN_HDEN_Pos                                  0                                                         /*!< USART0 HDEN: HDEN Position          */\r
+#define USART0_HDEN_HDEN_Msk                                  (0x01UL << USART0_HDEN_HDEN_Pos)                          /*!< USART0 HDEN: HDEN Mask              */\r
+\r
+// -------------------------------------  USART0_SCICTRL  -----------------------------------------\r
+#define USART0_SCICTRL_SCIEN_Pos                              0                                                         /*!< USART0 SCICTRL: SCIEN Position      */\r
+#define USART0_SCICTRL_SCIEN_Msk                              (0x01UL << USART0_SCICTRL_SCIEN_Pos)                      /*!< USART0 SCICTRL: SCIEN Mask          */\r
+#define USART0_SCICTRL_NACKDIS_Pos                            1                                                         /*!< USART0 SCICTRL: NACKDIS Position    */\r
+#define USART0_SCICTRL_NACKDIS_Msk                            (0x01UL << USART0_SCICTRL_NACKDIS_Pos)                    /*!< USART0 SCICTRL: NACKDIS Mask        */\r
+#define USART0_SCICTRL_PROTSEL_Pos                            2                                                         /*!< USART0 SCICTRL: PROTSEL Position    */\r
+#define USART0_SCICTRL_PROTSEL_Msk                            (0x01UL << USART0_SCICTRL_PROTSEL_Pos)                    /*!< USART0 SCICTRL: PROTSEL Mask        */\r
+#define USART0_SCICTRL_TXRETRY_Pos                            5                                                         /*!< USART0 SCICTRL: TXRETRY Position    */\r
+#define USART0_SCICTRL_TXRETRY_Msk                            (0x07UL << USART0_SCICTRL_TXRETRY_Pos)                    /*!< USART0 SCICTRL: TXRETRY Mask        */\r
+#define USART0_SCICTRL_GUARDTIME_Pos                          8                                                         /*!< USART0 SCICTRL: GUARDTIME Position  */\r
+#define USART0_SCICTRL_GUARDTIME_Msk                          (0x000000ffUL << USART0_SCICTRL_GUARDTIME_Pos)            /*!< USART0 SCICTRL: GUARDTIME Mask      */\r
+\r
+// ------------------------------------  USART0_RS485CTRL  ----------------------------------------\r
+#define USART0_RS485CTRL_NMMEN_Pos                            0                                                         /*!< USART0 RS485CTRL: NMMEN Position    */\r
+#define USART0_RS485CTRL_NMMEN_Msk                            (0x01UL << USART0_RS485CTRL_NMMEN_Pos)                    /*!< USART0 RS485CTRL: NMMEN Mask        */\r
+#define USART0_RS485CTRL_RXDIS_Pos                            1                                                         /*!< USART0 RS485CTRL: RXDIS Position    */\r
+#define USART0_RS485CTRL_RXDIS_Msk                            (0x01UL << USART0_RS485CTRL_RXDIS_Pos)                    /*!< USART0 RS485CTRL: RXDIS Mask        */\r
+#define USART0_RS485CTRL_AADEN_Pos                            2                                                         /*!< USART0 RS485CTRL: AADEN Position    */\r
+#define USART0_RS485CTRL_AADEN_Msk                            (0x01UL << USART0_RS485CTRL_AADEN_Pos)                    /*!< USART0 RS485CTRL: AADEN Mask        */\r
+#define USART0_RS485CTRL_DCTRL_Pos                            4                                                         /*!< USART0 RS485CTRL: DCTRL Position    */\r
+#define USART0_RS485CTRL_DCTRL_Msk                            (0x01UL << USART0_RS485CTRL_DCTRL_Pos)                    /*!< USART0 RS485CTRL: DCTRL Mask        */\r
+#define USART0_RS485CTRL_OINV_Pos                             5                                                         /*!< USART0 RS485CTRL: OINV Position     */\r
+#define USART0_RS485CTRL_OINV_Msk                             (0x01UL << USART0_RS485CTRL_OINV_Pos)                     /*!< USART0 RS485CTRL: OINV Mask         */\r
+\r
+// ----------------------------------  USART0_RS485ADRMATCH  --------------------------------------\r
+#define USART0_RS485ADRMATCH_ADRMATCH_Pos                     0                                                         /*!< USART0 RS485ADRMATCH: ADRMATCH Position */\r
+#define USART0_RS485ADRMATCH_ADRMATCH_Msk                     (0x000000ffUL << USART0_RS485ADRMATCH_ADRMATCH_Pos)       /*!< USART0 RS485ADRMATCH: ADRMATCH Mask */\r
+\r
+// -------------------------------------  USART0_RS485DLY  ----------------------------------------\r
+#define USART0_RS485DLY_DLY_Pos                               0                                                         /*!< USART0 RS485DLY: DLY Position       */\r
+#define USART0_RS485DLY_DLY_Msk                               (0x000000ffUL << USART0_RS485DLY_DLY_Pos)                 /*!< USART0 RS485DLY: DLY Mask           */\r
+\r
+// -------------------------------------  USART0_SYNCCTRL  ----------------------------------------\r
+#define USART0_SYNCCTRL_SYNC_Pos                              0                                                         /*!< USART0 SYNCCTRL: SYNC Position      */\r
+#define USART0_SYNCCTRL_SYNC_Msk                              (0x01UL << USART0_SYNCCTRL_SYNC_Pos)                      /*!< USART0 SYNCCTRL: SYNC Mask          */\r
+#define USART0_SYNCCTRL_CSRC_Pos                              1                                                         /*!< USART0 SYNCCTRL: CSRC Position      */\r
+#define USART0_SYNCCTRL_CSRC_Msk                              (0x01UL << USART0_SYNCCTRL_CSRC_Pos)                      /*!< USART0 SYNCCTRL: CSRC Mask          */\r
+#define USART0_SYNCCTRL_FES_Pos                               2                                                         /*!< USART0 SYNCCTRL: FES Position       */\r
+#define USART0_SYNCCTRL_FES_Msk                               (0x01UL << USART0_SYNCCTRL_FES_Pos)                       /*!< USART0 SYNCCTRL: FES Mask           */\r
+#define USART0_SYNCCTRL_TSBYPASS_Pos                          3                                                         /*!< USART0 SYNCCTRL: TSBYPASS Position  */\r
+#define USART0_SYNCCTRL_TSBYPASS_Msk                          (0x01UL << USART0_SYNCCTRL_TSBYPASS_Pos)                  /*!< USART0 SYNCCTRL: TSBYPASS Mask      */\r
+#define USART0_SYNCCTRL_CSCEN_Pos                             4                                                         /*!< USART0 SYNCCTRL: CSCEN Position     */\r
+#define USART0_SYNCCTRL_CSCEN_Msk                             (0x01UL << USART0_SYNCCTRL_CSCEN_Pos)                     /*!< USART0 SYNCCTRL: CSCEN Mask         */\r
+#define USART0_SYNCCTRL_SSSDIS_Pos                            5                                                         /*!< USART0 SYNCCTRL: SSSDIS Position    */\r
+#define USART0_SYNCCTRL_SSSDIS_Msk                            (0x01UL << USART0_SYNCCTRL_SSSDIS_Pos)                    /*!< USART0 SYNCCTRL: SSSDIS Mask        */\r
+#define USART0_SYNCCTRL_CCCLR_Pos                             6                                                         /*!< USART0 SYNCCTRL: CCCLR Position     */\r
+#define USART0_SYNCCTRL_CCCLR_Msk                             (0x01UL << USART0_SYNCCTRL_CCCLR_Pos)                     /*!< USART0 SYNCCTRL: CCCLR Mask         */\r
+\r
+// ---------------------------------------  USART0_TER  -------------------------------------------\r
+#define USART0_TER_TXEN_Pos                                   0                                                         /*!< USART0 TER: TXEN Position           */\r
+#define USART0_TER_TXEN_Msk                                   (0x01UL << USART0_TER_TXEN_Pos)                           /*!< USART0 TER: TXEN Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                USART2 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  USART2_DLL  -------------------------------------------\r
+#define USART2_DLL_DLLSB_Pos                                  0                                                         /*!< USART2 DLL: DLLSB Position          */\r
+#define USART2_DLL_DLLSB_Msk                                  (0x000000ffUL << USART2_DLL_DLLSB_Pos)                    /*!< USART2 DLL: DLLSB Mask              */\r
+\r
+// ---------------------------------------  USART2_THR  -------------------------------------------\r
+#define USART2_THR_THR_Pos                                    0                                                         /*!< USART2 THR: THR Position            */\r
+#define USART2_THR_THR_Msk                                    (0x000000ffUL << USART2_THR_THR_Pos)                      /*!< USART2 THR: THR Mask                */\r
+\r
+// ---------------------------------------  USART2_RBR  -------------------------------------------\r
+#define USART2_RBR_RBR_Pos                                    0                                                         /*!< USART2 RBR: RBR Position            */\r
+#define USART2_RBR_RBR_Msk                                    (0x000000ffUL << USART2_RBR_RBR_Pos)                      /*!< USART2 RBR: RBR Mask                */\r
+\r
+// ---------------------------------------  USART2_IER  -------------------------------------------\r
+#define USART2_IER_RBRIE_Pos                                  0                                                         /*!< USART2 IER: RBRIE Position          */\r
+#define USART2_IER_RBRIE_Msk                                  (0x01UL << USART2_IER_RBRIE_Pos)                          /*!< USART2 IER: RBRIE Mask              */\r
+#define USART2_IER_THREIE_Pos                                 1                                                         /*!< USART2 IER: THREIE Position         */\r
+#define USART2_IER_THREIE_Msk                                 (0x01UL << USART2_IER_THREIE_Pos)                         /*!< USART2 IER: THREIE Mask             */\r
+#define USART2_IER_RXIE_Pos                                   2                                                         /*!< USART2 IER: RXIE Position           */\r
+#define USART2_IER_RXIE_Msk                                   (0x01UL << USART2_IER_RXIE_Pos)                           /*!< USART2 IER: RXIE Mask               */\r
+#define USART2_IER_ABEOINTEN_Pos                              8                                                         /*!< USART2 IER: ABEOINTEN Position      */\r
+#define USART2_IER_ABEOINTEN_Msk                              (0x01UL << USART2_IER_ABEOINTEN_Pos)                      /*!< USART2 IER: ABEOINTEN Mask          */\r
+#define USART2_IER_ABTOINTEN_Pos                              9                                                         /*!< USART2 IER: ABTOINTEN Position      */\r
+#define USART2_IER_ABTOINTEN_Msk                              (0x01UL << USART2_IER_ABTOINTEN_Pos)                      /*!< USART2 IER: ABTOINTEN Mask          */\r
+\r
+// ---------------------------------------  USART2_DLM  -------------------------------------------\r
+#define USART2_DLM_DLMSB_Pos                                  0                                                         /*!< USART2 DLM: DLMSB Position          */\r
+#define USART2_DLM_DLMSB_Msk                                  (0x000000ffUL << USART2_DLM_DLMSB_Pos)                    /*!< USART2 DLM: DLMSB Mask              */\r
+\r
+// ---------------------------------------  USART2_FCR  -------------------------------------------\r
+#define USART2_FCR_FIFOEN_Pos                                 0                                                         /*!< USART2 FCR: FIFOEN Position         */\r
+#define USART2_FCR_FIFOEN_Msk                                 (0x01UL << USART2_FCR_FIFOEN_Pos)                         /*!< USART2 FCR: FIFOEN Mask             */\r
+#define USART2_FCR_RXFIFORES_Pos                              1                                                         /*!< USART2 FCR: RXFIFORES Position      */\r
+#define USART2_FCR_RXFIFORES_Msk                              (0x01UL << USART2_FCR_RXFIFORES_Pos)                      /*!< USART2 FCR: RXFIFORES Mask          */\r
+#define USART2_FCR_TXFIFORES_Pos                              2                                                         /*!< USART2 FCR: TXFIFORES Position      */\r
+#define USART2_FCR_TXFIFORES_Msk                              (0x01UL << USART2_FCR_TXFIFORES_Pos)                      /*!< USART2 FCR: TXFIFORES Mask          */\r
+#define USART2_FCR_DMAMODE_Pos                                3                                                         /*!< USART2 FCR: DMAMODE Position        */\r
+#define USART2_FCR_DMAMODE_Msk                                (0x01UL << USART2_FCR_DMAMODE_Pos)                        /*!< USART2 FCR: DMAMODE Mask            */\r
+#define USART2_FCR_RXTRIGLVL_Pos                              6                                                         /*!< USART2 FCR: RXTRIGLVL Position      */\r
+#define USART2_FCR_RXTRIGLVL_Msk                              (0x03UL << USART2_FCR_RXTRIGLVL_Pos)                      /*!< USART2 FCR: RXTRIGLVL Mask          */\r
+\r
+// ---------------------------------------  USART2_IIR  -------------------------------------------\r
+#define USART2_IIR_INTSTATUS_Pos                              0                                                         /*!< USART2 IIR: INTSTATUS Position      */\r
+#define USART2_IIR_INTSTATUS_Msk                              (0x01UL << USART2_IIR_INTSTATUS_Pos)                      /*!< USART2 IIR: INTSTATUS Mask          */\r
+#define USART2_IIR_INTID_Pos                                  1                                                         /*!< USART2 IIR: INTID Position          */\r
+#define USART2_IIR_INTID_Msk                                  (0x07UL << USART2_IIR_INTID_Pos)                          /*!< USART2 IIR: INTID Mask              */\r
+#define USART2_IIR_FIFOENABLE_Pos                             6                                                         /*!< USART2 IIR: FIFOENABLE Position     */\r
+#define USART2_IIR_FIFOENABLE_Msk                             (0x03UL << USART2_IIR_FIFOENABLE_Pos)                     /*!< USART2 IIR: FIFOENABLE Mask         */\r
+#define USART2_IIR_ABEOINT_Pos                                8                                                         /*!< USART2 IIR: ABEOINT Position        */\r
+#define USART2_IIR_ABEOINT_Msk                                (0x01UL << USART2_IIR_ABEOINT_Pos)                        /*!< USART2 IIR: ABEOINT Mask            */\r
+#define USART2_IIR_ABTOINT_Pos                                9                                                         /*!< USART2 IIR: ABTOINT Position        */\r
+#define USART2_IIR_ABTOINT_Msk                                (0x01UL << USART2_IIR_ABTOINT_Pos)                        /*!< USART2 IIR: ABTOINT Mask            */\r
+\r
+// ---------------------------------------  USART2_LCR  -------------------------------------------\r
+#define USART2_LCR_WLS_Pos                                    0                                                         /*!< USART2 LCR: WLS Position            */\r
+#define USART2_LCR_WLS_Msk                                    (0x03UL << USART2_LCR_WLS_Pos)                            /*!< USART2 LCR: WLS Mask                */\r
+#define USART2_LCR_SBS_Pos                                    2                                                         /*!< USART2 LCR: SBS Position            */\r
+#define USART2_LCR_SBS_Msk                                    (0x01UL << USART2_LCR_SBS_Pos)                            /*!< USART2 LCR: SBS Mask                */\r
+#define USART2_LCR_PE_Pos                                     3                                                         /*!< USART2 LCR: PE Position             */\r
+#define USART2_LCR_PE_Msk                                     (0x01UL << USART2_LCR_PE_Pos)                             /*!< USART2 LCR: PE Mask                 */\r
+#define USART2_LCR_PS_Pos                                     4                                                         /*!< USART2 LCR: PS Position             */\r
+#define USART2_LCR_PS_Msk                                     (0x03UL << USART2_LCR_PS_Pos)                             /*!< USART2 LCR: PS Mask                 */\r
+#define USART2_LCR_BC_Pos                                     6                                                         /*!< USART2 LCR: BC Position             */\r
+#define USART2_LCR_BC_Msk                                     (0x01UL << USART2_LCR_BC_Pos)                             /*!< USART2 LCR: BC Mask                 */\r
+#define USART2_LCR_DLAB_Pos                                   7                                                         /*!< USART2 LCR: DLAB Position           */\r
+#define USART2_LCR_DLAB_Msk                                   (0x01UL << USART2_LCR_DLAB_Pos)                           /*!< USART2 LCR: DLAB Mask               */\r
+\r
+// ---------------------------------------  USART2_LSR  -------------------------------------------\r
+#define USART2_LSR_RDR_Pos                                    0                                                         /*!< USART2 LSR: RDR Position            */\r
+#define USART2_LSR_RDR_Msk                                    (0x01UL << USART2_LSR_RDR_Pos)                            /*!< USART2 LSR: RDR Mask                */\r
+#define USART2_LSR_OE_Pos                                     1                                                         /*!< USART2 LSR: OE Position             */\r
+#define USART2_LSR_OE_Msk                                     (0x01UL << USART2_LSR_OE_Pos)                             /*!< USART2 LSR: OE Mask                 */\r
+#define USART2_LSR_PE_Pos                                     2                                                         /*!< USART2 LSR: PE Position             */\r
+#define USART2_LSR_PE_Msk                                     (0x01UL << USART2_LSR_PE_Pos)                             /*!< USART2 LSR: PE Mask                 */\r
+#define USART2_LSR_FE_Pos                                     3                                                         /*!< USART2 LSR: FE Position             */\r
+#define USART2_LSR_FE_Msk                                     (0x01UL << USART2_LSR_FE_Pos)                             /*!< USART2 LSR: FE Mask                 */\r
+#define USART2_LSR_BI_Pos                                     4                                                         /*!< USART2 LSR: BI Position             */\r
+#define USART2_LSR_BI_Msk                                     (0x01UL << USART2_LSR_BI_Pos)                             /*!< USART2 LSR: BI Mask                 */\r
+#define USART2_LSR_THRE_Pos                                   5                                                         /*!< USART2 LSR: THRE Position           */\r
+#define USART2_LSR_THRE_Msk                                   (0x01UL << USART2_LSR_THRE_Pos)                           /*!< USART2 LSR: THRE Mask               */\r
+#define USART2_LSR_TEMT_Pos                                   6                                                         /*!< USART2 LSR: TEMT Position           */\r
+#define USART2_LSR_TEMT_Msk                                   (0x01UL << USART2_LSR_TEMT_Pos)                           /*!< USART2 LSR: TEMT Mask               */\r
+#define USART2_LSR_RXFE_Pos                                   7                                                         /*!< USART2 LSR: RXFE Position           */\r
+#define USART2_LSR_RXFE_Msk                                   (0x01UL << USART2_LSR_RXFE_Pos)                           /*!< USART2 LSR: RXFE Mask               */\r
+#define USART2_LSR_TXERR_Pos                                  8                                                         /*!< USART2 LSR: TXERR Position          */\r
+#define USART2_LSR_TXERR_Msk                                  (0x01UL << USART2_LSR_TXERR_Pos)                          /*!< USART2 LSR: TXERR Mask              */\r
+\r
+// ---------------------------------------  USART2_SCR  -------------------------------------------\r
+#define USART2_SCR_PAD_Pos                                    0                                                         /*!< USART2 SCR: PAD Position            */\r
+#define USART2_SCR_PAD_Msk                                    (0x000000ffUL << USART2_SCR_PAD_Pos)                      /*!< USART2 SCR: PAD Mask                */\r
+\r
+// ---------------------------------------  USART2_ACR  -------------------------------------------\r
+#define USART2_ACR_START_Pos                                  0                                                         /*!< USART2 ACR: START Position          */\r
+#define USART2_ACR_START_Msk                                  (0x01UL << USART2_ACR_START_Pos)                          /*!< USART2 ACR: START Mask              */\r
+#define USART2_ACR_MODE_Pos                                   1                                                         /*!< USART2 ACR: MODE Position           */\r
+#define USART2_ACR_MODE_Msk                                   (0x01UL << USART2_ACR_MODE_Pos)                           /*!< USART2 ACR: MODE Mask               */\r
+#define USART2_ACR_AUTORESTART_Pos                            2                                                         /*!< USART2 ACR: AUTORESTART Position    */\r
+#define USART2_ACR_AUTORESTART_Msk                            (0x01UL << USART2_ACR_AUTORESTART_Pos)                    /*!< USART2 ACR: AUTORESTART Mask        */\r
+#define USART2_ACR_ABEOINTCLR_Pos                             8                                                         /*!< USART2 ACR: ABEOINTCLR Position     */\r
+#define USART2_ACR_ABEOINTCLR_Msk                             (0x01UL << USART2_ACR_ABEOINTCLR_Pos)                     /*!< USART2 ACR: ABEOINTCLR Mask         */\r
+#define USART2_ACR_ABTOINTCLR_Pos                             9                                                         /*!< USART2 ACR: ABTOINTCLR Position     */\r
+#define USART2_ACR_ABTOINTCLR_Msk                             (0x01UL << USART2_ACR_ABTOINTCLR_Pos)                     /*!< USART2 ACR: ABTOINTCLR Mask         */\r
+\r
+// ---------------------------------------  USART2_ICR  -------------------------------------------\r
+#define USART2_ICR_IRDAEN_Pos                                 0                                                         /*!< USART2 ICR: IRDAEN Position         */\r
+#define USART2_ICR_IRDAEN_Msk                                 (0x01UL << USART2_ICR_IRDAEN_Pos)                         /*!< USART2 ICR: IRDAEN Mask             */\r
+#define USART2_ICR_IRDAINV_Pos                                1                                                         /*!< USART2 ICR: IRDAINV Position        */\r
+#define USART2_ICR_IRDAINV_Msk                                (0x01UL << USART2_ICR_IRDAINV_Pos)                        /*!< USART2 ICR: IRDAINV Mask            */\r
+#define USART2_ICR_FIXPULSEEN_Pos                             2                                                         /*!< USART2 ICR: FIXPULSEEN Position     */\r
+#define USART2_ICR_FIXPULSEEN_Msk                             (0x01UL << USART2_ICR_FIXPULSEEN_Pos)                     /*!< USART2 ICR: FIXPULSEEN Mask         */\r
+#define USART2_ICR_PULSEDIV_Pos                               3                                                         /*!< USART2 ICR: PULSEDIV Position       */\r
+#define USART2_ICR_PULSEDIV_Msk                               (0x07UL << USART2_ICR_PULSEDIV_Pos)                       /*!< USART2 ICR: PULSEDIV Mask           */\r
+\r
+// ---------------------------------------  USART2_FDR  -------------------------------------------\r
+#define USART2_FDR_DIVADDVAL_Pos                              0                                                         /*!< USART2 FDR: DIVADDVAL Position      */\r
+#define USART2_FDR_DIVADDVAL_Msk                              (0x0fUL << USART2_FDR_DIVADDVAL_Pos)                      /*!< USART2 FDR: DIVADDVAL Mask          */\r
+#define USART2_FDR_MULVAL_Pos                                 4                                                         /*!< USART2 FDR: MULVAL Position         */\r
+#define USART2_FDR_MULVAL_Msk                                 (0x0fUL << USART2_FDR_MULVAL_Pos)                         /*!< USART2 FDR: MULVAL Mask             */\r
+\r
+// ---------------------------------------  USART2_OSR  -------------------------------------------\r
+#define USART2_OSR_OSFRAC_Pos                                 1                                                         /*!< USART2 OSR: OSFRAC Position         */\r
+#define USART2_OSR_OSFRAC_Msk                                 (0x07UL << USART2_OSR_OSFRAC_Pos)                         /*!< USART2 OSR: OSFRAC Mask             */\r
+#define USART2_OSR_OSINT_Pos                                  4                                                         /*!< USART2 OSR: OSINT Position          */\r
+#define USART2_OSR_OSINT_Msk                                  (0x0fUL << USART2_OSR_OSINT_Pos)                          /*!< USART2 OSR: OSINT Mask              */\r
+#define USART2_OSR_FDINT_Pos                                  8                                                         /*!< USART2 OSR: FDINT Position          */\r
+#define USART2_OSR_FDINT_Msk                                  (0x7fUL << USART2_OSR_FDINT_Pos)                          /*!< USART2 OSR: FDINT Mask              */\r
+\r
+// ---------------------------------------  USART2_HDEN  ------------------------------------------\r
+#define USART2_HDEN_HDEN_Pos                                  0                                                         /*!< USART2 HDEN: HDEN Position          */\r
+#define USART2_HDEN_HDEN_Msk                                  (0x01UL << USART2_HDEN_HDEN_Pos)                          /*!< USART2 HDEN: HDEN Mask              */\r
+\r
+// -------------------------------------  USART2_SCICTRL  -----------------------------------------\r
+#define USART2_SCICTRL_SCIEN_Pos                              0                                                         /*!< USART2 SCICTRL: SCIEN Position      */\r
+#define USART2_SCICTRL_SCIEN_Msk                              (0x01UL << USART2_SCICTRL_SCIEN_Pos)                      /*!< USART2 SCICTRL: SCIEN Mask          */\r
+#define USART2_SCICTRL_NACKDIS_Pos                            1                                                         /*!< USART2 SCICTRL: NACKDIS Position    */\r
+#define USART2_SCICTRL_NACKDIS_Msk                            (0x01UL << USART2_SCICTRL_NACKDIS_Pos)                    /*!< USART2 SCICTRL: NACKDIS Mask        */\r
+#define USART2_SCICTRL_PROTSEL_Pos                            2                                                         /*!< USART2 SCICTRL: PROTSEL Position    */\r
+#define USART2_SCICTRL_PROTSEL_Msk                            (0x01UL << USART2_SCICTRL_PROTSEL_Pos)                    /*!< USART2 SCICTRL: PROTSEL Mask        */\r
+#define USART2_SCICTRL_TXRETRY_Pos                            5                                                         /*!< USART2 SCICTRL: TXRETRY Position    */\r
+#define USART2_SCICTRL_TXRETRY_Msk                            (0x07UL << USART2_SCICTRL_TXRETRY_Pos)                    /*!< USART2 SCICTRL: TXRETRY Mask        */\r
+#define USART2_SCICTRL_GUARDTIME_Pos                          8                                                         /*!< USART2 SCICTRL: GUARDTIME Position  */\r
+#define USART2_SCICTRL_GUARDTIME_Msk                          (0x000000ffUL << USART2_SCICTRL_GUARDTIME_Pos)            /*!< USART2 SCICTRL: GUARDTIME Mask      */\r
+\r
+// ------------------------------------  USART2_RS485CTRL  ----------------------------------------\r
+#define USART2_RS485CTRL_NMMEN_Pos                            0                                                         /*!< USART2 RS485CTRL: NMMEN Position    */\r
+#define USART2_RS485CTRL_NMMEN_Msk                            (0x01UL << USART2_RS485CTRL_NMMEN_Pos)                    /*!< USART2 RS485CTRL: NMMEN Mask        */\r
+#define USART2_RS485CTRL_RXDIS_Pos                            1                                                         /*!< USART2 RS485CTRL: RXDIS Position    */\r
+#define USART2_RS485CTRL_RXDIS_Msk                            (0x01UL << USART2_RS485CTRL_RXDIS_Pos)                    /*!< USART2 RS485CTRL: RXDIS Mask        */\r
+#define USART2_RS485CTRL_AADEN_Pos                            2                                                         /*!< USART2 RS485CTRL: AADEN Position    */\r
+#define USART2_RS485CTRL_AADEN_Msk                            (0x01UL << USART2_RS485CTRL_AADEN_Pos)                    /*!< USART2 RS485CTRL: AADEN Mask        */\r
+#define USART2_RS485CTRL_DCTRL_Pos                            4                                                         /*!< USART2 RS485CTRL: DCTRL Position    */\r
+#define USART2_RS485CTRL_DCTRL_Msk                            (0x01UL << USART2_RS485CTRL_DCTRL_Pos)                    /*!< USART2 RS485CTRL: DCTRL Mask        */\r
+#define USART2_RS485CTRL_OINV_Pos                             5                                                         /*!< USART2 RS485CTRL: OINV Position     */\r
+#define USART2_RS485CTRL_OINV_Msk                             (0x01UL << USART2_RS485CTRL_OINV_Pos)                     /*!< USART2 RS485CTRL: OINV Mask         */\r
+\r
+// ----------------------------------  USART2_RS485ADRMATCH  --------------------------------------\r
+#define USART2_RS485ADRMATCH_ADRMATCH_Pos                     0                                                         /*!< USART2 RS485ADRMATCH: ADRMATCH Position */\r
+#define USART2_RS485ADRMATCH_ADRMATCH_Msk                     (0x000000ffUL << USART2_RS485ADRMATCH_ADRMATCH_Pos)       /*!< USART2 RS485ADRMATCH: ADRMATCH Mask */\r
+\r
+// -------------------------------------  USART2_RS485DLY  ----------------------------------------\r
+#define USART2_RS485DLY_DLY_Pos                               0                                                         /*!< USART2 RS485DLY: DLY Position       */\r
+#define USART2_RS485DLY_DLY_Msk                               (0x000000ffUL << USART2_RS485DLY_DLY_Pos)                 /*!< USART2 RS485DLY: DLY Mask           */\r
+\r
+// -------------------------------------  USART2_SYNCCTRL  ----------------------------------------\r
+#define USART2_SYNCCTRL_SYNC_Pos                              0                                                         /*!< USART2 SYNCCTRL: SYNC Position      */\r
+#define USART2_SYNCCTRL_SYNC_Msk                              (0x01UL << USART2_SYNCCTRL_SYNC_Pos)                      /*!< USART2 SYNCCTRL: SYNC Mask          */\r
+#define USART2_SYNCCTRL_CSRC_Pos                              1                                                         /*!< USART2 SYNCCTRL: CSRC Position      */\r
+#define USART2_SYNCCTRL_CSRC_Msk                              (0x01UL << USART2_SYNCCTRL_CSRC_Pos)                      /*!< USART2 SYNCCTRL: CSRC Mask          */\r
+#define USART2_SYNCCTRL_FES_Pos                               2                                                         /*!< USART2 SYNCCTRL: FES Position       */\r
+#define USART2_SYNCCTRL_FES_Msk                               (0x01UL << USART2_SYNCCTRL_FES_Pos)                       /*!< USART2 SYNCCTRL: FES Mask           */\r
+#define USART2_SYNCCTRL_TSBYPASS_Pos                          3                                                         /*!< USART2 SYNCCTRL: TSBYPASS Position  */\r
+#define USART2_SYNCCTRL_TSBYPASS_Msk                          (0x01UL << USART2_SYNCCTRL_TSBYPASS_Pos)                  /*!< USART2 SYNCCTRL: TSBYPASS Mask      */\r
+#define USART2_SYNCCTRL_CSCEN_Pos                             4                                                         /*!< USART2 SYNCCTRL: CSCEN Position     */\r
+#define USART2_SYNCCTRL_CSCEN_Msk                             (0x01UL << USART2_SYNCCTRL_CSCEN_Pos)                     /*!< USART2 SYNCCTRL: CSCEN Mask         */\r
+#define USART2_SYNCCTRL_SSSDIS_Pos                            5                                                         /*!< USART2 SYNCCTRL: SSSDIS Position    */\r
+#define USART2_SYNCCTRL_SSSDIS_Msk                            (0x01UL << USART2_SYNCCTRL_SSSDIS_Pos)                    /*!< USART2 SYNCCTRL: SSSDIS Mask        */\r
+#define USART2_SYNCCTRL_CCCLR_Pos                             6                                                         /*!< USART2 SYNCCTRL: CCCLR Position     */\r
+#define USART2_SYNCCTRL_CCCLR_Msk                             (0x01UL << USART2_SYNCCTRL_CCCLR_Pos)                     /*!< USART2 SYNCCTRL: CCCLR Mask         */\r
+\r
+// ---------------------------------------  USART2_TER  -------------------------------------------\r
+#define USART2_TER_TXEN_Pos                                   0                                                         /*!< USART2 TER: TXEN Position           */\r
+#define USART2_TER_TXEN_Msk                                   (0x01UL << USART2_TER_TXEN_Pos)                           /*!< USART2 TER: TXEN Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                USART3 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  USART3_DLL  -------------------------------------------\r
+#define USART3_DLL_DLLSB_Pos                                  0                                                         /*!< USART3 DLL: DLLSB Position          */\r
+#define USART3_DLL_DLLSB_Msk                                  (0x000000ffUL << USART3_DLL_DLLSB_Pos)                    /*!< USART3 DLL: DLLSB Mask              */\r
+\r
+// ---------------------------------------  USART3_THR  -------------------------------------------\r
+#define USART3_THR_THR_Pos                                    0                                                         /*!< USART3 THR: THR Position            */\r
+#define USART3_THR_THR_Msk                                    (0x000000ffUL << USART3_THR_THR_Pos)                      /*!< USART3 THR: THR Mask                */\r
+\r
+// ---------------------------------------  USART3_RBR  -------------------------------------------\r
+#define USART3_RBR_RBR_Pos                                    0                                                         /*!< USART3 RBR: RBR Position            */\r
+#define USART3_RBR_RBR_Msk                                    (0x000000ffUL << USART3_RBR_RBR_Pos)                      /*!< USART3 RBR: RBR Mask                */\r
+\r
+// ---------------------------------------  USART3_IER  -------------------------------------------\r
+#define USART3_IER_RBRIE_Pos                                  0                                                         /*!< USART3 IER: RBRIE Position          */\r
+#define USART3_IER_RBRIE_Msk                                  (0x01UL << USART3_IER_RBRIE_Pos)                          /*!< USART3 IER: RBRIE Mask              */\r
+#define USART3_IER_THREIE_Pos                                 1                                                         /*!< USART3 IER: THREIE Position         */\r
+#define USART3_IER_THREIE_Msk                                 (0x01UL << USART3_IER_THREIE_Pos)                         /*!< USART3 IER: THREIE Mask             */\r
+#define USART3_IER_RXIE_Pos                                   2                                                         /*!< USART3 IER: RXIE Position           */\r
+#define USART3_IER_RXIE_Msk                                   (0x01UL << USART3_IER_RXIE_Pos)                           /*!< USART3 IER: RXIE Mask               */\r
+#define USART3_IER_ABEOINTEN_Pos                              8                                                         /*!< USART3 IER: ABEOINTEN Position      */\r
+#define USART3_IER_ABEOINTEN_Msk                              (0x01UL << USART3_IER_ABEOINTEN_Pos)                      /*!< USART3 IER: ABEOINTEN Mask          */\r
+#define USART3_IER_ABTOINTEN_Pos                              9                                                         /*!< USART3 IER: ABTOINTEN Position      */\r
+#define USART3_IER_ABTOINTEN_Msk                              (0x01UL << USART3_IER_ABTOINTEN_Pos)                      /*!< USART3 IER: ABTOINTEN Mask          */\r
+\r
+// ---------------------------------------  USART3_DLM  -------------------------------------------\r
+#define USART3_DLM_DLMSB_Pos                                  0                                                         /*!< USART3 DLM: DLMSB Position          */\r
+#define USART3_DLM_DLMSB_Msk                                  (0x000000ffUL << USART3_DLM_DLMSB_Pos)                    /*!< USART3 DLM: DLMSB Mask              */\r
+\r
+// ---------------------------------------  USART3_FCR  -------------------------------------------\r
+#define USART3_FCR_FIFOEN_Pos                                 0                                                         /*!< USART3 FCR: FIFOEN Position         */\r
+#define USART3_FCR_FIFOEN_Msk                                 (0x01UL << USART3_FCR_FIFOEN_Pos)                         /*!< USART3 FCR: FIFOEN Mask             */\r
+#define USART3_FCR_RXFIFORES_Pos                              1                                                         /*!< USART3 FCR: RXFIFORES Position      */\r
+#define USART3_FCR_RXFIFORES_Msk                              (0x01UL << USART3_FCR_RXFIFORES_Pos)                      /*!< USART3 FCR: RXFIFORES Mask          */\r
+#define USART3_FCR_TXFIFORES_Pos                              2                                                         /*!< USART3 FCR: TXFIFORES Position      */\r
+#define USART3_FCR_TXFIFORES_Msk                              (0x01UL << USART3_FCR_TXFIFORES_Pos)                      /*!< USART3 FCR: TXFIFORES Mask          */\r
+#define USART3_FCR_DMAMODE_Pos                                3                                                         /*!< USART3 FCR: DMAMODE Position        */\r
+#define USART3_FCR_DMAMODE_Msk                                (0x01UL << USART3_FCR_DMAMODE_Pos)                        /*!< USART3 FCR: DMAMODE Mask            */\r
+#define USART3_FCR_RXTRIGLVL_Pos                              6                                                         /*!< USART3 FCR: RXTRIGLVL Position      */\r
+#define USART3_FCR_RXTRIGLVL_Msk                              (0x03UL << USART3_FCR_RXTRIGLVL_Pos)                      /*!< USART3 FCR: RXTRIGLVL Mask          */\r
+\r
+// ---------------------------------------  USART3_IIR  -------------------------------------------\r
+#define USART3_IIR_INTSTATUS_Pos                              0                                                         /*!< USART3 IIR: INTSTATUS Position      */\r
+#define USART3_IIR_INTSTATUS_Msk                              (0x01UL << USART3_IIR_INTSTATUS_Pos)                      /*!< USART3 IIR: INTSTATUS Mask          */\r
+#define USART3_IIR_INTID_Pos                                  1                                                         /*!< USART3 IIR: INTID Position          */\r
+#define USART3_IIR_INTID_Msk                                  (0x07UL << USART3_IIR_INTID_Pos)                          /*!< USART3 IIR: INTID Mask              */\r
+#define USART3_IIR_FIFOENABLE_Pos                             6                                                         /*!< USART3 IIR: FIFOENABLE Position     */\r
+#define USART3_IIR_FIFOENABLE_Msk                             (0x03UL << USART3_IIR_FIFOENABLE_Pos)                     /*!< USART3 IIR: FIFOENABLE Mask         */\r
+#define USART3_IIR_ABEOINT_Pos                                8                                                         /*!< USART3 IIR: ABEOINT Position        */\r
+#define USART3_IIR_ABEOINT_Msk                                (0x01UL << USART3_IIR_ABEOINT_Pos)                        /*!< USART3 IIR: ABEOINT Mask            */\r
+#define USART3_IIR_ABTOINT_Pos                                9                                                         /*!< USART3 IIR: ABTOINT Position        */\r
+#define USART3_IIR_ABTOINT_Msk                                (0x01UL << USART3_IIR_ABTOINT_Pos)                        /*!< USART3 IIR: ABTOINT Mask            */\r
+\r
+// ---------------------------------------  USART3_LCR  -------------------------------------------\r
+#define USART3_LCR_WLS_Pos                                    0                                                         /*!< USART3 LCR: WLS Position            */\r
+#define USART3_LCR_WLS_Msk                                    (0x03UL << USART3_LCR_WLS_Pos)                            /*!< USART3 LCR: WLS Mask                */\r
+#define USART3_LCR_SBS_Pos                                    2                                                         /*!< USART3 LCR: SBS Position            */\r
+#define USART3_LCR_SBS_Msk                                    (0x01UL << USART3_LCR_SBS_Pos)                            /*!< USART3 LCR: SBS Mask                */\r
+#define USART3_LCR_PE_Pos                                     3                                                         /*!< USART3 LCR: PE Position             */\r
+#define USART3_LCR_PE_Msk                                     (0x01UL << USART3_LCR_PE_Pos)                             /*!< USART3 LCR: PE Mask                 */\r
+#define USART3_LCR_PS_Pos                                     4                                                         /*!< USART3 LCR: PS Position             */\r
+#define USART3_LCR_PS_Msk                                     (0x03UL << USART3_LCR_PS_Pos)                             /*!< USART3 LCR: PS Mask                 */\r
+#define USART3_LCR_BC_Pos                                     6                                                         /*!< USART3 LCR: BC Position             */\r
+#define USART3_LCR_BC_Msk                                     (0x01UL << USART3_LCR_BC_Pos)                             /*!< USART3 LCR: BC Mask                 */\r
+#define USART3_LCR_DLAB_Pos                                   7                                                         /*!< USART3 LCR: DLAB Position           */\r
+#define USART3_LCR_DLAB_Msk                                   (0x01UL << USART3_LCR_DLAB_Pos)                           /*!< USART3 LCR: DLAB Mask               */\r
+\r
+// ---------------------------------------  USART3_LSR  -------------------------------------------\r
+#define USART3_LSR_RDR_Pos                                    0                                                         /*!< USART3 LSR: RDR Position            */\r
+#define USART3_LSR_RDR_Msk                                    (0x01UL << USART3_LSR_RDR_Pos)                            /*!< USART3 LSR: RDR Mask                */\r
+#define USART3_LSR_OE_Pos                                     1                                                         /*!< USART3 LSR: OE Position             */\r
+#define USART3_LSR_OE_Msk                                     (0x01UL << USART3_LSR_OE_Pos)                             /*!< USART3 LSR: OE Mask                 */\r
+#define USART3_LSR_PE_Pos                                     2                                                         /*!< USART3 LSR: PE Position             */\r
+#define USART3_LSR_PE_Msk                                     (0x01UL << USART3_LSR_PE_Pos)                             /*!< USART3 LSR: PE Mask                 */\r
+#define USART3_LSR_FE_Pos                                     3                                                         /*!< USART3 LSR: FE Position             */\r
+#define USART3_LSR_FE_Msk                                     (0x01UL << USART3_LSR_FE_Pos)                             /*!< USART3 LSR: FE Mask                 */\r
+#define USART3_LSR_BI_Pos                                     4                                                         /*!< USART3 LSR: BI Position             */\r
+#define USART3_LSR_BI_Msk                                     (0x01UL << USART3_LSR_BI_Pos)                             /*!< USART3 LSR: BI Mask                 */\r
+#define USART3_LSR_THRE_Pos                                   5                                                         /*!< USART3 LSR: THRE Position           */\r
+#define USART3_LSR_THRE_Msk                                   (0x01UL << USART3_LSR_THRE_Pos)                           /*!< USART3 LSR: THRE Mask               */\r
+#define USART3_LSR_TEMT_Pos                                   6                                                         /*!< USART3 LSR: TEMT Position           */\r
+#define USART3_LSR_TEMT_Msk                                   (0x01UL << USART3_LSR_TEMT_Pos)                           /*!< USART3 LSR: TEMT Mask               */\r
+#define USART3_LSR_RXFE_Pos                                   7                                                         /*!< USART3 LSR: RXFE Position           */\r
+#define USART3_LSR_RXFE_Msk                                   (0x01UL << USART3_LSR_RXFE_Pos)                           /*!< USART3 LSR: RXFE Mask               */\r
+#define USART3_LSR_TXERR_Pos                                  8                                                         /*!< USART3 LSR: TXERR Position          */\r
+#define USART3_LSR_TXERR_Msk                                  (0x01UL << USART3_LSR_TXERR_Pos)                          /*!< USART3 LSR: TXERR Mask              */\r
+\r
+// ---------------------------------------  USART3_SCR  -------------------------------------------\r
+#define USART3_SCR_PAD_Pos                                    0                                                         /*!< USART3 SCR: PAD Position            */\r
+#define USART3_SCR_PAD_Msk                                    (0x000000ffUL << USART3_SCR_PAD_Pos)                      /*!< USART3 SCR: PAD Mask                */\r
+\r
+// ---------------------------------------  USART3_ACR  -------------------------------------------\r
+#define USART3_ACR_START_Pos                                  0                                                         /*!< USART3 ACR: START Position          */\r
+#define USART3_ACR_START_Msk                                  (0x01UL << USART3_ACR_START_Pos)                          /*!< USART3 ACR: START Mask              */\r
+#define USART3_ACR_MODE_Pos                                   1                                                         /*!< USART3 ACR: MODE Position           */\r
+#define USART3_ACR_MODE_Msk                                   (0x01UL << USART3_ACR_MODE_Pos)                           /*!< USART3 ACR: MODE Mask               */\r
+#define USART3_ACR_AUTORESTART_Pos                            2                                                         /*!< USART3 ACR: AUTORESTART Position    */\r
+#define USART3_ACR_AUTORESTART_Msk                            (0x01UL << USART3_ACR_AUTORESTART_Pos)                    /*!< USART3 ACR: AUTORESTART Mask        */\r
+#define USART3_ACR_ABEOINTCLR_Pos                             8                                                         /*!< USART3 ACR: ABEOINTCLR Position     */\r
+#define USART3_ACR_ABEOINTCLR_Msk                             (0x01UL << USART3_ACR_ABEOINTCLR_Pos)                     /*!< USART3 ACR: ABEOINTCLR Mask         */\r
+#define USART3_ACR_ABTOINTCLR_Pos                             9                                                         /*!< USART3 ACR: ABTOINTCLR Position     */\r
+#define USART3_ACR_ABTOINTCLR_Msk                             (0x01UL << USART3_ACR_ABTOINTCLR_Pos)                     /*!< USART3 ACR: ABTOINTCLR Mask         */\r
+\r
+// ---------------------------------------  USART3_ICR  -------------------------------------------\r
+#define USART3_ICR_IRDAEN_Pos                                 0                                                         /*!< USART3 ICR: IRDAEN Position         */\r
+#define USART3_ICR_IRDAEN_Msk                                 (0x01UL << USART3_ICR_IRDAEN_Pos)                         /*!< USART3 ICR: IRDAEN Mask             */\r
+#define USART3_ICR_IRDAINV_Pos                                1                                                         /*!< USART3 ICR: IRDAINV Position        */\r
+#define USART3_ICR_IRDAINV_Msk                                (0x01UL << USART3_ICR_IRDAINV_Pos)                        /*!< USART3 ICR: IRDAINV Mask            */\r
+#define USART3_ICR_FIXPULSEEN_Pos                             2                                                         /*!< USART3 ICR: FIXPULSEEN Position     */\r
+#define USART3_ICR_FIXPULSEEN_Msk                             (0x01UL << USART3_ICR_FIXPULSEEN_Pos)                     /*!< USART3 ICR: FIXPULSEEN Mask         */\r
+#define USART3_ICR_PULSEDIV_Pos                               3                                                         /*!< USART3 ICR: PULSEDIV Position       */\r
+#define USART3_ICR_PULSEDIV_Msk                               (0x07UL << USART3_ICR_PULSEDIV_Pos)                       /*!< USART3 ICR: PULSEDIV Mask           */\r
+\r
+// ---------------------------------------  USART3_FDR  -------------------------------------------\r
+#define USART3_FDR_DIVADDVAL_Pos                              0                                                         /*!< USART3 FDR: DIVADDVAL Position      */\r
+#define USART3_FDR_DIVADDVAL_Msk                              (0x0fUL << USART3_FDR_DIVADDVAL_Pos)                      /*!< USART3 FDR: DIVADDVAL Mask          */\r
+#define USART3_FDR_MULVAL_Pos                                 4                                                         /*!< USART3 FDR: MULVAL Position         */\r
+#define USART3_FDR_MULVAL_Msk                                 (0x0fUL << USART3_FDR_MULVAL_Pos)                         /*!< USART3 FDR: MULVAL Mask             */\r
+\r
+// ---------------------------------------  USART3_OSR  -------------------------------------------\r
+#define USART3_OSR_OSFRAC_Pos                                 1                                                         /*!< USART3 OSR: OSFRAC Position         */\r
+#define USART3_OSR_OSFRAC_Msk                                 (0x07UL << USART3_OSR_OSFRAC_Pos)                         /*!< USART3 OSR: OSFRAC Mask             */\r
+#define USART3_OSR_OSINT_Pos                                  4                                                         /*!< USART3 OSR: OSINT Position          */\r
+#define USART3_OSR_OSINT_Msk                                  (0x0fUL << USART3_OSR_OSINT_Pos)                          /*!< USART3 OSR: OSINT Mask              */\r
+#define USART3_OSR_FDINT_Pos                                  8                                                         /*!< USART3 OSR: FDINT Position          */\r
+#define USART3_OSR_FDINT_Msk                                  (0x7fUL << USART3_OSR_FDINT_Pos)                          /*!< USART3 OSR: FDINT Mask              */\r
+\r
+// ---------------------------------------  USART3_HDEN  ------------------------------------------\r
+#define USART3_HDEN_HDEN_Pos                                  0                                                         /*!< USART3 HDEN: HDEN Position          */\r
+#define USART3_HDEN_HDEN_Msk                                  (0x01UL << USART3_HDEN_HDEN_Pos)                          /*!< USART3 HDEN: HDEN Mask              */\r
+\r
+// -------------------------------------  USART3_SCICTRL  -----------------------------------------\r
+#define USART3_SCICTRL_SCIEN_Pos                              0                                                         /*!< USART3 SCICTRL: SCIEN Position      */\r
+#define USART3_SCICTRL_SCIEN_Msk                              (0x01UL << USART3_SCICTRL_SCIEN_Pos)                      /*!< USART3 SCICTRL: SCIEN Mask          */\r
+#define USART3_SCICTRL_NACKDIS_Pos                            1                                                         /*!< USART3 SCICTRL: NACKDIS Position    */\r
+#define USART3_SCICTRL_NACKDIS_Msk                            (0x01UL << USART3_SCICTRL_NACKDIS_Pos)                    /*!< USART3 SCICTRL: NACKDIS Mask        */\r
+#define USART3_SCICTRL_PROTSEL_Pos                            2                                                         /*!< USART3 SCICTRL: PROTSEL Position    */\r
+#define USART3_SCICTRL_PROTSEL_Msk                            (0x01UL << USART3_SCICTRL_PROTSEL_Pos)                    /*!< USART3 SCICTRL: PROTSEL Mask        */\r
+#define USART3_SCICTRL_TXRETRY_Pos                            5                                                         /*!< USART3 SCICTRL: TXRETRY Position    */\r
+#define USART3_SCICTRL_TXRETRY_Msk                            (0x07UL << USART3_SCICTRL_TXRETRY_Pos)                    /*!< USART3 SCICTRL: TXRETRY Mask        */\r
+#define USART3_SCICTRL_GUARDTIME_Pos                          8                                                         /*!< USART3 SCICTRL: GUARDTIME Position  */\r
+#define USART3_SCICTRL_GUARDTIME_Msk                          (0x000000ffUL << USART3_SCICTRL_GUARDTIME_Pos)            /*!< USART3 SCICTRL: GUARDTIME Mask      */\r
+\r
+// ------------------------------------  USART3_RS485CTRL  ----------------------------------------\r
+#define USART3_RS485CTRL_NMMEN_Pos                            0                                                         /*!< USART3 RS485CTRL: NMMEN Position    */\r
+#define USART3_RS485CTRL_NMMEN_Msk                            (0x01UL << USART3_RS485CTRL_NMMEN_Pos)                    /*!< USART3 RS485CTRL: NMMEN Mask        */\r
+#define USART3_RS485CTRL_RXDIS_Pos                            1                                                         /*!< USART3 RS485CTRL: RXDIS Position    */\r
+#define USART3_RS485CTRL_RXDIS_Msk                            (0x01UL << USART3_RS485CTRL_RXDIS_Pos)                    /*!< USART3 RS485CTRL: RXDIS Mask        */\r
+#define USART3_RS485CTRL_AADEN_Pos                            2                                                         /*!< USART3 RS485CTRL: AADEN Position    */\r
+#define USART3_RS485CTRL_AADEN_Msk                            (0x01UL << USART3_RS485CTRL_AADEN_Pos)                    /*!< USART3 RS485CTRL: AADEN Mask        */\r
+#define USART3_RS485CTRL_DCTRL_Pos                            4                                                         /*!< USART3 RS485CTRL: DCTRL Position    */\r
+#define USART3_RS485CTRL_DCTRL_Msk                            (0x01UL << USART3_RS485CTRL_DCTRL_Pos)                    /*!< USART3 RS485CTRL: DCTRL Mask        */\r
+#define USART3_RS485CTRL_OINV_Pos                             5                                                         /*!< USART3 RS485CTRL: OINV Position     */\r
+#define USART3_RS485CTRL_OINV_Msk                             (0x01UL << USART3_RS485CTRL_OINV_Pos)                     /*!< USART3 RS485CTRL: OINV Mask         */\r
+\r
+// ----------------------------------  USART3_RS485ADRMATCH  --------------------------------------\r
+#define USART3_RS485ADRMATCH_ADRMATCH_Pos                     0                                                         /*!< USART3 RS485ADRMATCH: ADRMATCH Position */\r
+#define USART3_RS485ADRMATCH_ADRMATCH_Msk                     (0x000000ffUL << USART3_RS485ADRMATCH_ADRMATCH_Pos)       /*!< USART3 RS485ADRMATCH: ADRMATCH Mask */\r
+\r
+// -------------------------------------  USART3_RS485DLY  ----------------------------------------\r
+#define USART3_RS485DLY_DLY_Pos                               0                                                         /*!< USART3 RS485DLY: DLY Position       */\r
+#define USART3_RS485DLY_DLY_Msk                               (0x000000ffUL << USART3_RS485DLY_DLY_Pos)                 /*!< USART3 RS485DLY: DLY Mask           */\r
+\r
+// -------------------------------------  USART3_SYNCCTRL  ----------------------------------------\r
+#define USART3_SYNCCTRL_SYNC_Pos                              0                                                         /*!< USART3 SYNCCTRL: SYNC Position      */\r
+#define USART3_SYNCCTRL_SYNC_Msk                              (0x01UL << USART3_SYNCCTRL_SYNC_Pos)                      /*!< USART3 SYNCCTRL: SYNC Mask          */\r
+#define USART3_SYNCCTRL_CSRC_Pos                              1                                                         /*!< USART3 SYNCCTRL: CSRC Position      */\r
+#define USART3_SYNCCTRL_CSRC_Msk                              (0x01UL << USART3_SYNCCTRL_CSRC_Pos)                      /*!< USART3 SYNCCTRL: CSRC Mask          */\r
+#define USART3_SYNCCTRL_FES_Pos                               2                                                         /*!< USART3 SYNCCTRL: FES Position       */\r
+#define USART3_SYNCCTRL_FES_Msk                               (0x01UL << USART3_SYNCCTRL_FES_Pos)                       /*!< USART3 SYNCCTRL: FES Mask           */\r
+#define USART3_SYNCCTRL_TSBYPASS_Pos                          3                                                         /*!< USART3 SYNCCTRL: TSBYPASS Position  */\r
+#define USART3_SYNCCTRL_TSBYPASS_Msk                          (0x01UL << USART3_SYNCCTRL_TSBYPASS_Pos)                  /*!< USART3 SYNCCTRL: TSBYPASS Mask      */\r
+#define USART3_SYNCCTRL_CSCEN_Pos                             4                                                         /*!< USART3 SYNCCTRL: CSCEN Position     */\r
+#define USART3_SYNCCTRL_CSCEN_Msk                             (0x01UL << USART3_SYNCCTRL_CSCEN_Pos)                     /*!< USART3 SYNCCTRL: CSCEN Mask         */\r
+#define USART3_SYNCCTRL_SSSDIS_Pos                            5                                                         /*!< USART3 SYNCCTRL: SSSDIS Position    */\r
+#define USART3_SYNCCTRL_SSSDIS_Msk                            (0x01UL << USART3_SYNCCTRL_SSSDIS_Pos)                    /*!< USART3 SYNCCTRL: SSSDIS Mask        */\r
+#define USART3_SYNCCTRL_CCCLR_Pos                             6                                                         /*!< USART3 SYNCCTRL: CCCLR Position     */\r
+#define USART3_SYNCCTRL_CCCLR_Msk                             (0x01UL << USART3_SYNCCTRL_CCCLR_Pos)                     /*!< USART3 SYNCCTRL: CCCLR Mask         */\r
+\r
+// ---------------------------------------  USART3_TER  -------------------------------------------\r
+#define USART3_TER_TXEN_Pos                                   0                                                         /*!< USART3 TER: TXEN Position           */\r
+#define USART3_TER_TXEN_Msk                                   (0x01UL << USART3_TER_TXEN_Pos)                           /*!< USART3 TER: TXEN Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 UART1 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  UART1_RBR  -------------------------------------------\r
+#define UART1_RBR_RBR_Pos                                     0                                                         /*!< UART1 RBR: RBR Position             */\r
+#define UART1_RBR_RBR_Msk                                     (0x000000ffUL << UART1_RBR_RBR_Pos)                       /*!< UART1 RBR: RBR Mask                 */\r
+\r
+// ----------------------------------------  UART1_THR  -------------------------------------------\r
+#define UART1_THR_THR_Pos                                     0                                                         /*!< UART1 THR: THR Position             */\r
+#define UART1_THR_THR_Msk                                     (0x000000ffUL << UART1_THR_THR_Pos)                       /*!< UART1 THR: THR Mask                 */\r
+\r
+// ----------------------------------------  UART1_DLL  -------------------------------------------\r
+#define UART1_DLL_DLLSB_Pos                                   0                                                         /*!< UART1 DLL: DLLSB Position           */\r
+#define UART1_DLL_DLLSB_Msk                                   (0x000000ffUL << UART1_DLL_DLLSB_Pos)                     /*!< UART1 DLL: DLLSB Mask               */\r
+\r
+// ----------------------------------------  UART1_DLM  -------------------------------------------\r
+#define UART1_DLM_DLMSB_Pos                                   0                                                         /*!< UART1 DLM: DLMSB Position           */\r
+#define UART1_DLM_DLMSB_Msk                                   (0x000000ffUL << UART1_DLM_DLMSB_Pos)                     /*!< UART1 DLM: DLMSB Mask               */\r
+\r
+// ----------------------------------------  UART1_IER  -------------------------------------------\r
+#define UART1_IER_RBRIE_Pos                                   0                                                         /*!< UART1 IER: RBRIE Position           */\r
+#define UART1_IER_RBRIE_Msk                                   (0x01UL << UART1_IER_RBRIE_Pos)                           /*!< UART1 IER: RBRIE Mask               */\r
+#define UART1_IER_THREIE_Pos                                  1                                                         /*!< UART1 IER: THREIE Position          */\r
+#define UART1_IER_THREIE_Msk                                  (0x01UL << UART1_IER_THREIE_Pos)                          /*!< UART1 IER: THREIE Mask              */\r
+#define UART1_IER_RXIE_Pos                                    2                                                         /*!< UART1 IER: RXIE Position            */\r
+#define UART1_IER_RXIE_Msk                                    (0x01UL << UART1_IER_RXIE_Pos)                            /*!< UART1 IER: RXIE Mask                */\r
+#define UART1_IER_MSIE_Pos                                    3                                                         /*!< UART1 IER: MSIE Position            */\r
+#define UART1_IER_MSIE_Msk                                    (0x01UL << UART1_IER_MSIE_Pos)                            /*!< UART1 IER: MSIE Mask                */\r
+#define UART1_IER_CTSIE_Pos                                   7                                                         /*!< UART1 IER: CTSIE Position           */\r
+#define UART1_IER_CTSIE_Msk                                   (0x01UL << UART1_IER_CTSIE_Pos)                           /*!< UART1 IER: CTSIE Mask               */\r
+#define UART1_IER_ABEOIE_Pos                                  8                                                         /*!< UART1 IER: ABEOIE Position          */\r
+#define UART1_IER_ABEOIE_Msk                                  (0x01UL << UART1_IER_ABEOIE_Pos)                          /*!< UART1 IER: ABEOIE Mask              */\r
+#define UART1_IER_ABTOIE_Pos                                  9                                                         /*!< UART1 IER: ABTOIE Position          */\r
+#define UART1_IER_ABTOIE_Msk                                  (0x01UL << UART1_IER_ABTOIE_Pos)                          /*!< UART1 IER: ABTOIE Mask              */\r
+\r
+// ----------------------------------------  UART1_IIR  -------------------------------------------\r
+#define UART1_IIR_INTSTATUS_Pos                               0                                                         /*!< UART1 IIR: INTSTATUS Position       */\r
+#define UART1_IIR_INTSTATUS_Msk                               (0x01UL << UART1_IIR_INTSTATUS_Pos)                       /*!< UART1 IIR: INTSTATUS Mask           */\r
+#define UART1_IIR_INTID_Pos                                   1                                                         /*!< UART1 IIR: INTID Position           */\r
+#define UART1_IIR_INTID_Msk                                   (0x07UL << UART1_IIR_INTID_Pos)                           /*!< UART1 IIR: INTID Mask               */\r
+#define UART1_IIR_FIFOENABLE_Pos                              6                                                         /*!< UART1 IIR: FIFOENABLE Position      */\r
+#define UART1_IIR_FIFOENABLE_Msk                              (0x03UL << UART1_IIR_FIFOENABLE_Pos)                      /*!< UART1 IIR: FIFOENABLE Mask          */\r
+#define UART1_IIR_ABEOINT_Pos                                 8                                                         /*!< UART1 IIR: ABEOINT Position         */\r
+#define UART1_IIR_ABEOINT_Msk                                 (0x01UL << UART1_IIR_ABEOINT_Pos)                         /*!< UART1 IIR: ABEOINT Mask             */\r
+#define UART1_IIR_ABTOINT_Pos                                 9                                                         /*!< UART1 IIR: ABTOINT Position         */\r
+#define UART1_IIR_ABTOINT_Msk                                 (0x01UL << UART1_IIR_ABTOINT_Pos)                         /*!< UART1 IIR: ABTOINT Mask             */\r
+\r
+// ----------------------------------------  UART1_FCR  -------------------------------------------\r
+#define UART1_FCR_FIFOEN_Pos                                  0                                                         /*!< UART1 FCR: FIFOEN Position          */\r
+#define UART1_FCR_FIFOEN_Msk                                  (0x01UL << UART1_FCR_FIFOEN_Pos)                          /*!< UART1 FCR: FIFOEN Mask              */\r
+#define UART1_FCR_RXFIFORES_Pos                               1                                                         /*!< UART1 FCR: RXFIFORES Position       */\r
+#define UART1_FCR_RXFIFORES_Msk                               (0x01UL << UART1_FCR_RXFIFORES_Pos)                       /*!< UART1 FCR: RXFIFORES Mask           */\r
+#define UART1_FCR_TXFIFORES_Pos                               2                                                         /*!< UART1 FCR: TXFIFORES Position       */\r
+#define UART1_FCR_TXFIFORES_Msk                               (0x01UL << UART1_FCR_TXFIFORES_Pos)                       /*!< UART1 FCR: TXFIFORES Mask           */\r
+#define UART1_FCR_DMAMODE_Pos                                 3                                                         /*!< UART1 FCR: DMAMODE Position         */\r
+#define UART1_FCR_DMAMODE_Msk                                 (0x01UL << UART1_FCR_DMAMODE_Pos)                         /*!< UART1 FCR: DMAMODE Mask             */\r
+#define UART1_FCR_RXTRIGLVL_Pos                               6                                                         /*!< UART1 FCR: RXTRIGLVL Position       */\r
+#define UART1_FCR_RXTRIGLVL_Msk                               (0x03UL << UART1_FCR_RXTRIGLVL_Pos)                       /*!< UART1 FCR: RXTRIGLVL Mask           */\r
+\r
+// ----------------------------------------  UART1_LCR  -------------------------------------------\r
+#define UART1_LCR_WLS_Pos                                     0                                                         /*!< UART1 LCR: WLS Position             */\r
+#define UART1_LCR_WLS_Msk                                     (0x03UL << UART1_LCR_WLS_Pos)                             /*!< UART1 LCR: WLS Mask                 */\r
+#define UART1_LCR_SBS_Pos                                     2                                                         /*!< UART1 LCR: SBS Position             */\r
+#define UART1_LCR_SBS_Msk                                     (0x01UL << UART1_LCR_SBS_Pos)                             /*!< UART1 LCR: SBS Mask                 */\r
+#define UART1_LCR_PE_Pos                                      3                                                         /*!< UART1 LCR: PE Position              */\r
+#define UART1_LCR_PE_Msk                                      (0x01UL << UART1_LCR_PE_Pos)                              /*!< UART1 LCR: PE Mask                  */\r
+#define UART1_LCR_PS_Pos                                      4                                                         /*!< UART1 LCR: PS Position              */\r
+#define UART1_LCR_PS_Msk                                      (0x03UL << UART1_LCR_PS_Pos)                              /*!< UART1 LCR: PS Mask                  */\r
+#define UART1_LCR_BC_Pos                                      6                                                         /*!< UART1 LCR: BC Position              */\r
+#define UART1_LCR_BC_Msk                                      (0x01UL << UART1_LCR_BC_Pos)                              /*!< UART1 LCR: BC Mask                  */\r
+#define UART1_LCR_DLAB_Pos                                    7                                                         /*!< UART1 LCR: DLAB Position            */\r
+#define UART1_LCR_DLAB_Msk                                    (0x01UL << UART1_LCR_DLAB_Pos)                            /*!< UART1 LCR: DLAB Mask                */\r
+\r
+// ----------------------------------------  UART1_MCR  -------------------------------------------\r
+#define UART1_MCR_DTRCTRL_Pos                                 0                                                         /*!< UART1 MCR: DTRCTRL Position         */\r
+#define UART1_MCR_DTRCTRL_Msk                                 (0x01UL << UART1_MCR_DTRCTRL_Pos)                         /*!< UART1 MCR: DTRCTRL Mask             */\r
+#define UART1_MCR_RTSCTRL_Pos                                 1                                                         /*!< UART1 MCR: RTSCTRL Position         */\r
+#define UART1_MCR_RTSCTRL_Msk                                 (0x01UL << UART1_MCR_RTSCTRL_Pos)                         /*!< UART1 MCR: RTSCTRL Mask             */\r
+#define UART1_MCR_LMS_Pos                                     4                                                         /*!< UART1 MCR: LMS Position             */\r
+#define UART1_MCR_LMS_Msk                                     (0x01UL << UART1_MCR_LMS_Pos)                             /*!< UART1 MCR: LMS Mask                 */\r
+#define UART1_MCR_RTSEN_Pos                                   6                                                         /*!< UART1 MCR: RTSEN Position           */\r
+#define UART1_MCR_RTSEN_Msk                                   (0x01UL << UART1_MCR_RTSEN_Pos)                           /*!< UART1 MCR: RTSEN Mask               */\r
+#define UART1_MCR_CTSEN_Pos                                   7                                                         /*!< UART1 MCR: CTSEN Position           */\r
+#define UART1_MCR_CTSEN_Msk                                   (0x01UL << UART1_MCR_CTSEN_Pos)                           /*!< UART1 MCR: CTSEN Mask               */\r
+\r
+// ----------------------------------------  UART1_LSR  -------------------------------------------\r
+#define UART1_LSR_RDR_Pos                                     0                                                         /*!< UART1 LSR: RDR Position             */\r
+#define UART1_LSR_RDR_Msk                                     (0x01UL << UART1_LSR_RDR_Pos)                             /*!< UART1 LSR: RDR Mask                 */\r
+#define UART1_LSR_OE_Pos                                      1                                                         /*!< UART1 LSR: OE Position              */\r
+#define UART1_LSR_OE_Msk                                      (0x01UL << UART1_LSR_OE_Pos)                              /*!< UART1 LSR: OE Mask                  */\r
+#define UART1_LSR_PE_Pos                                      2                                                         /*!< UART1 LSR: PE Position              */\r
+#define UART1_LSR_PE_Msk                                      (0x01UL << UART1_LSR_PE_Pos)                              /*!< UART1 LSR: PE Mask                  */\r
+#define UART1_LSR_FE_Pos                                      3                                                         /*!< UART1 LSR: FE Position              */\r
+#define UART1_LSR_FE_Msk                                      (0x01UL << UART1_LSR_FE_Pos)                              /*!< UART1 LSR: FE Mask                  */\r
+#define UART1_LSR_BI_Pos                                      4                                                         /*!< UART1 LSR: BI Position              */\r
+#define UART1_LSR_BI_Msk                                      (0x01UL << UART1_LSR_BI_Pos)                              /*!< UART1 LSR: BI Mask                  */\r
+#define UART1_LSR_THRE_Pos                                    5                                                         /*!< UART1 LSR: THRE Position            */\r
+#define UART1_LSR_THRE_Msk                                    (0x01UL << UART1_LSR_THRE_Pos)                            /*!< UART1 LSR: THRE Mask                */\r
+#define UART1_LSR_TEMT_Pos                                    6                                                         /*!< UART1 LSR: TEMT Position            */\r
+#define UART1_LSR_TEMT_Msk                                    (0x01UL << UART1_LSR_TEMT_Pos)                            /*!< UART1 LSR: TEMT Mask                */\r
+#define UART1_LSR_RXFE_Pos                                    7                                                         /*!< UART1 LSR: RXFE Position            */\r
+#define UART1_LSR_RXFE_Msk                                    (0x01UL << UART1_LSR_RXFE_Pos)                            /*!< UART1 LSR: RXFE Mask                */\r
+\r
+// ----------------------------------------  UART1_MSR  -------------------------------------------\r
+#define UART1_MSR_DCTS_Pos                                    0                                                         /*!< UART1 MSR: DCTS Position            */\r
+#define UART1_MSR_DCTS_Msk                                    (0x01UL << UART1_MSR_DCTS_Pos)                            /*!< UART1 MSR: DCTS Mask                */\r
+#define UART1_MSR_DDSR_Pos                                    1                                                         /*!< UART1 MSR: DDSR Position            */\r
+#define UART1_MSR_DDSR_Msk                                    (0x01UL << UART1_MSR_DDSR_Pos)                            /*!< UART1 MSR: DDSR Mask                */\r
+#define UART1_MSR_TERI_Pos                                    2                                                         /*!< UART1 MSR: TERI Position            */\r
+#define UART1_MSR_TERI_Msk                                    (0x01UL << UART1_MSR_TERI_Pos)                            /*!< UART1 MSR: TERI Mask                */\r
+#define UART1_MSR_DDCD_Pos                                    3                                                         /*!< UART1 MSR: DDCD Position            */\r
+#define UART1_MSR_DDCD_Msk                                    (0x01UL << UART1_MSR_DDCD_Pos)                            /*!< UART1 MSR: DDCD Mask                */\r
+#define UART1_MSR_CTS_Pos                                     4                                                         /*!< UART1 MSR: CTS Position             */\r
+#define UART1_MSR_CTS_Msk                                     (0x01UL << UART1_MSR_CTS_Pos)                             /*!< UART1 MSR: CTS Mask                 */\r
+#define UART1_MSR_DSR_Pos                                     5                                                         /*!< UART1 MSR: DSR Position             */\r
+#define UART1_MSR_DSR_Msk                                     (0x01UL << UART1_MSR_DSR_Pos)                             /*!< UART1 MSR: DSR Mask                 */\r
+#define UART1_MSR_RI_Pos                                      6                                                         /*!< UART1 MSR: RI Position              */\r
+#define UART1_MSR_RI_Msk                                      (0x01UL << UART1_MSR_RI_Pos)                              /*!< UART1 MSR: RI Mask                  */\r
+#define UART1_MSR_DCD_Pos                                     7                                                         /*!< UART1 MSR: DCD Position             */\r
+#define UART1_MSR_DCD_Msk                                     (0x01UL << UART1_MSR_DCD_Pos)                             /*!< UART1 MSR: DCD Mask                 */\r
+\r
+// ----------------------------------------  UART1_SCR  -------------------------------------------\r
+#define UART1_SCR_Pad_Pos                                     0                                                         /*!< UART1 SCR: Pad Position             */\r
+#define UART1_SCR_Pad_Msk                                     (0x000000ffUL << UART1_SCR_Pad_Pos)                       /*!< UART1 SCR: Pad Mask                 */\r
+\r
+// ----------------------------------------  UART1_ACR  -------------------------------------------\r
+#define UART1_ACR_START_Pos                                   0                                                         /*!< UART1 ACR: START Position           */\r
+#define UART1_ACR_START_Msk                                   (0x01UL << UART1_ACR_START_Pos)                           /*!< UART1 ACR: START Mask               */\r
+#define UART1_ACR_MODE_Pos                                    1                                                         /*!< UART1 ACR: MODE Position            */\r
+#define UART1_ACR_MODE_Msk                                    (0x01UL << UART1_ACR_MODE_Pos)                            /*!< UART1 ACR: MODE Mask                */\r
+#define UART1_ACR_AUTORESTART_Pos                             2                                                         /*!< UART1 ACR: AUTORESTART Position     */\r
+#define UART1_ACR_AUTORESTART_Msk                             (0x01UL << UART1_ACR_AUTORESTART_Pos)                     /*!< UART1 ACR: AUTORESTART Mask         */\r
+#define UART1_ACR_ABEOINTCLR_Pos                              8                                                         /*!< UART1 ACR: ABEOINTCLR Position      */\r
+#define UART1_ACR_ABEOINTCLR_Msk                              (0x01UL << UART1_ACR_ABEOINTCLR_Pos)                      /*!< UART1 ACR: ABEOINTCLR Mask          */\r
+#define UART1_ACR_ABTOINTCLR_Pos                              9                                                         /*!< UART1 ACR: ABTOINTCLR Position      */\r
+#define UART1_ACR_ABTOINTCLR_Msk                              (0x01UL << UART1_ACR_ABTOINTCLR_Pos)                      /*!< UART1 ACR: ABTOINTCLR Mask          */\r
+\r
+// ----------------------------------------  UART1_FDR  -------------------------------------------\r
+#define UART1_FDR_DIVADDVAL_Pos                               0                                                         /*!< UART1 FDR: DIVADDVAL Position       */\r
+#define UART1_FDR_DIVADDVAL_Msk                               (0x0fUL << UART1_FDR_DIVADDVAL_Pos)                       /*!< UART1 FDR: DIVADDVAL Mask           */\r
+#define UART1_FDR_MULVAL_Pos                                  4                                                         /*!< UART1 FDR: MULVAL Position          */\r
+#define UART1_FDR_MULVAL_Msk                                  (0x0fUL << UART1_FDR_MULVAL_Pos)                          /*!< UART1 FDR: MULVAL Mask              */\r
+\r
+// ----------------------------------------  UART1_TER  -------------------------------------------\r
+#define UART1_TER_TXEN_Pos                                    7                                                         /*!< UART1 TER: TXEN Position            */\r
+#define UART1_TER_TXEN_Msk                                    (0x01UL << UART1_TER_TXEN_Pos)                            /*!< UART1 TER: TXEN Mask                */\r
+\r
+// -------------------------------------  UART1_RS485CTRL  ----------------------------------------\r
+#define UART1_RS485CTRL_NMMEN_Pos                             0                                                         /*!< UART1 RS485CTRL: NMMEN Position     */\r
+#define UART1_RS485CTRL_NMMEN_Msk                             (0x01UL << UART1_RS485CTRL_NMMEN_Pos)                     /*!< UART1 RS485CTRL: NMMEN Mask         */\r
+#define UART1_RS485CTRL_RXDIS_Pos                             1                                                         /*!< UART1 RS485CTRL: RXDIS Position     */\r
+#define UART1_RS485CTRL_RXDIS_Msk                             (0x01UL << UART1_RS485CTRL_RXDIS_Pos)                     /*!< UART1 RS485CTRL: RXDIS Mask         */\r
+#define UART1_RS485CTRL_AADEN_Pos                             2                                                         /*!< UART1 RS485CTRL: AADEN Position     */\r
+#define UART1_RS485CTRL_AADEN_Msk                             (0x01UL << UART1_RS485CTRL_AADEN_Pos)                     /*!< UART1 RS485CTRL: AADEN Mask         */\r
+#define UART1_RS485CTRL_SEL_Pos                               3                                                         /*!< UART1 RS485CTRL: SEL Position       */\r
+#define UART1_RS485CTRL_SEL_Msk                               (0x01UL << UART1_RS485CTRL_SEL_Pos)                       /*!< UART1 RS485CTRL: SEL Mask           */\r
+#define UART1_RS485CTRL_DCTRL_Pos                             4                                                         /*!< UART1 RS485CTRL: DCTRL Position     */\r
+#define UART1_RS485CTRL_DCTRL_Msk                             (0x01UL << UART1_RS485CTRL_DCTRL_Pos)                     /*!< UART1 RS485CTRL: DCTRL Mask         */\r
+#define UART1_RS485CTRL_OINV_Pos                              5                                                         /*!< UART1 RS485CTRL: OINV Position      */\r
+#define UART1_RS485CTRL_OINV_Msk                              (0x01UL << UART1_RS485CTRL_OINV_Pos)                      /*!< UART1 RS485CTRL: OINV Mask          */\r
+\r
+// -----------------------------------  UART1_RS485ADRMATCH  --------------------------------------\r
+#define UART1_RS485ADRMATCH_ADRMATCH_Pos                      0                                                         /*!< UART1 RS485ADRMATCH: ADRMATCH Position */\r
+#define UART1_RS485ADRMATCH_ADRMATCH_Msk                      (0x000000ffUL << UART1_RS485ADRMATCH_ADRMATCH_Pos)        /*!< UART1 RS485ADRMATCH: ADRMATCH Mask  */\r
+\r
+// -------------------------------------  UART1_RS485DLY  -----------------------------------------\r
+#define UART1_RS485DLY_DLY_Pos                                0                                                         /*!< UART1 RS485DLY: DLY Position        */\r
+#define UART1_RS485DLY_DLY_Msk                                (0x000000ffUL << UART1_RS485DLY_DLY_Pos)                  /*!< UART1 RS485DLY: DLY Mask            */\r
+\r
+// --------------------------------------  UART1_FIFOLVL  -----------------------------------------\r
+#define UART1_FIFOLVL_RXFIFILVL_Pos                           0                                                         /*!< UART1 FIFOLVL: RXFIFILVL Position   */\r
+#define UART1_FIFOLVL_RXFIFILVL_Msk                           (0x0fUL << UART1_FIFOLVL_RXFIFILVL_Pos)                   /*!< UART1 FIFOLVL: RXFIFILVL Mask       */\r
+#define UART1_FIFOLVL_TXFIFOLVL_Pos                           8                                                         /*!< UART1 FIFOLVL: TXFIFOLVL Position   */\r
+#define UART1_FIFOLVL_TXFIFOLVL_Msk                           (0x0fUL << UART1_FIFOLVL_TXFIFOLVL_Pos)                   /*!< UART1 FIFOLVL: TXFIFOLVL Mask       */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 SSP0 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  SSP0_CR0  --------------------------------------------\r
+#define SSP0_CR0_DSS_Pos                                      0                                                         /*!< SSP0 CR0: DSS Position              */\r
+#define SSP0_CR0_DSS_Msk                                      (0x0fUL << SSP0_CR0_DSS_Pos)                              /*!< SSP0 CR0: DSS Mask                  */\r
+#define SSP0_CR0_FRF_Pos                                      4                                                         /*!< SSP0 CR0: FRF Position              */\r
+#define SSP0_CR0_FRF_Msk                                      (0x03UL << SSP0_CR0_FRF_Pos)                              /*!< SSP0 CR0: FRF Mask                  */\r
+#define SSP0_CR0_CPOL_Pos                                     6                                                         /*!< SSP0 CR0: CPOL Position             */\r
+#define SSP0_CR0_CPOL_Msk                                     (0x01UL << SSP0_CR0_CPOL_Pos)                             /*!< SSP0 CR0: CPOL Mask                 */\r
+#define SSP0_CR0_CPHA_Pos                                     7                                                         /*!< SSP0 CR0: CPHA Position             */\r
+#define SSP0_CR0_CPHA_Msk                                     (0x01UL << SSP0_CR0_CPHA_Pos)                             /*!< SSP0 CR0: CPHA Mask                 */\r
+#define SSP0_CR0_SCR_Pos                                      8                                                         /*!< SSP0 CR0: SCR Position              */\r
+#define SSP0_CR0_SCR_Msk                                      (0x000000ffUL << SSP0_CR0_SCR_Pos)                        /*!< SSP0 CR0: SCR Mask                  */\r
+\r
+// ----------------------------------------  SSP0_CR1  --------------------------------------------\r
+#define SSP0_CR1_LBM_Pos                                      0                                                         /*!< SSP0 CR1: LBM Position              */\r
+#define SSP0_CR1_LBM_Msk                                      (0x01UL << SSP0_CR1_LBM_Pos)                              /*!< SSP0 CR1: LBM Mask                  */\r
+#define SSP0_CR1_SSE_Pos                                      1                                                         /*!< SSP0 CR1: SSE Position              */\r
+#define SSP0_CR1_SSE_Msk                                      (0x01UL << SSP0_CR1_SSE_Pos)                              /*!< SSP0 CR1: SSE Mask                  */\r
+#define SSP0_CR1_MS_Pos                                       2                                                         /*!< SSP0 CR1: MS Position               */\r
+#define SSP0_CR1_MS_Msk                                       (0x01UL << SSP0_CR1_MS_Pos)                               /*!< SSP0 CR1: MS Mask                   */\r
+#define SSP0_CR1_SOD_Pos                                      3                                                         /*!< SSP0 CR1: SOD Position              */\r
+#define SSP0_CR1_SOD_Msk                                      (0x01UL << SSP0_CR1_SOD_Pos)                              /*!< SSP0 CR1: SOD Mask                  */\r
+\r
+// -----------------------------------------  SSP0_DR  --------------------------------------------\r
+#define SSP0_DR_DATA_Pos                                      0                                                         /*!< SSP0 DR: DATA Position              */\r
+#define SSP0_DR_DATA_Msk                                      (0x0000ffffUL << SSP0_DR_DATA_Pos)                        /*!< SSP0 DR: DATA Mask                  */\r
+\r
+// -----------------------------------------  SSP0_SR  --------------------------------------------\r
+#define SSP0_SR_TFE_Pos                                       0                                                         /*!< SSP0 SR: TFE Position               */\r
+#define SSP0_SR_TFE_Msk                                       (0x01UL << SSP0_SR_TFE_Pos)                               /*!< SSP0 SR: TFE Mask                   */\r
+#define SSP0_SR_TNF_Pos                                       1                                                         /*!< SSP0 SR: TNF Position               */\r
+#define SSP0_SR_TNF_Msk                                       (0x01UL << SSP0_SR_TNF_Pos)                               /*!< SSP0 SR: TNF Mask                   */\r
+#define SSP0_SR_RNE_Pos                                       2                                                         /*!< SSP0 SR: RNE Position               */\r
+#define SSP0_SR_RNE_Msk                                       (0x01UL << SSP0_SR_RNE_Pos)                               /*!< SSP0 SR: RNE Mask                   */\r
+#define SSP0_SR_RFF_Pos                                       3                                                         /*!< SSP0 SR: RFF Position               */\r
+#define SSP0_SR_RFF_Msk                                       (0x01UL << SSP0_SR_RFF_Pos)                               /*!< SSP0 SR: RFF Mask                   */\r
+#define SSP0_SR_BSY_Pos                                       4                                                         /*!< SSP0 SR: BSY Position               */\r
+#define SSP0_SR_BSY_Msk                                       (0x01UL << SSP0_SR_BSY_Pos)                               /*!< SSP0 SR: BSY Mask                   */\r
+\r
+// ----------------------------------------  SSP0_CPSR  -------------------------------------------\r
+#define SSP0_CPSR_CPSDVSR_Pos                                 0                                                         /*!< SSP0 CPSR: CPSDVSR Position         */\r
+#define SSP0_CPSR_CPSDVSR_Msk                                 (0x000000ffUL << SSP0_CPSR_CPSDVSR_Pos)                   /*!< SSP0 CPSR: CPSDVSR Mask             */\r
+\r
+// ----------------------------------------  SSP0_IMSC  -------------------------------------------\r
+#define SSP0_IMSC_RORIM_Pos                                   0                                                         /*!< SSP0 IMSC: RORIM Position           */\r
+#define SSP0_IMSC_RORIM_Msk                                   (0x01UL << SSP0_IMSC_RORIM_Pos)                           /*!< SSP0 IMSC: RORIM Mask               */\r
+#define SSP0_IMSC_RTIM_Pos                                    1                                                         /*!< SSP0 IMSC: RTIM Position            */\r
+#define SSP0_IMSC_RTIM_Msk                                    (0x01UL << SSP0_IMSC_RTIM_Pos)                            /*!< SSP0 IMSC: RTIM Mask                */\r
+#define SSP0_IMSC_RXIM_Pos                                    2                                                         /*!< SSP0 IMSC: RXIM Position            */\r
+#define SSP0_IMSC_RXIM_Msk                                    (0x01UL << SSP0_IMSC_RXIM_Pos)                            /*!< SSP0 IMSC: RXIM Mask                */\r
+#define SSP0_IMSC_TXIM_Pos                                    3                                                         /*!< SSP0 IMSC: TXIM Position            */\r
+#define SSP0_IMSC_TXIM_Msk                                    (0x01UL << SSP0_IMSC_TXIM_Pos)                            /*!< SSP0 IMSC: TXIM Mask                */\r
+\r
+// ----------------------------------------  SSP0_RIS  --------------------------------------------\r
+#define SSP0_RIS_RORRIS_Pos                                   0                                                         /*!< SSP0 RIS: RORRIS Position           */\r
+#define SSP0_RIS_RORRIS_Msk                                   (0x01UL << SSP0_RIS_RORRIS_Pos)                           /*!< SSP0 RIS: RORRIS Mask               */\r
+#define SSP0_RIS_RTRIS_Pos                                    1                                                         /*!< SSP0 RIS: RTRIS Position            */\r
+#define SSP0_RIS_RTRIS_Msk                                    (0x01UL << SSP0_RIS_RTRIS_Pos)                            /*!< SSP0 RIS: RTRIS Mask                */\r
+#define SSP0_RIS_RXRIS_Pos                                    2                                                         /*!< SSP0 RIS: RXRIS Position            */\r
+#define SSP0_RIS_RXRIS_Msk                                    (0x01UL << SSP0_RIS_RXRIS_Pos)                            /*!< SSP0 RIS: RXRIS Mask                */\r
+#define SSP0_RIS_TXRIS_Pos                                    3                                                         /*!< SSP0 RIS: TXRIS Position            */\r
+#define SSP0_RIS_TXRIS_Msk                                    (0x01UL << SSP0_RIS_TXRIS_Pos)                            /*!< SSP0 RIS: TXRIS Mask                */\r
+\r
+// ----------------------------------------  SSP0_MIS  --------------------------------------------\r
+#define SSP0_MIS_RORMIS_Pos                                   0                                                         /*!< SSP0 MIS: RORMIS Position           */\r
+#define SSP0_MIS_RORMIS_Msk                                   (0x01UL << SSP0_MIS_RORMIS_Pos)                           /*!< SSP0 MIS: RORMIS Mask               */\r
+#define SSP0_MIS_RTMIS_Pos                                    1                                                         /*!< SSP0 MIS: RTMIS Position            */\r
+#define SSP0_MIS_RTMIS_Msk                                    (0x01UL << SSP0_MIS_RTMIS_Pos)                            /*!< SSP0 MIS: RTMIS Mask                */\r
+#define SSP0_MIS_RXMIS_Pos                                    2                                                         /*!< SSP0 MIS: RXMIS Position            */\r
+#define SSP0_MIS_RXMIS_Msk                                    (0x01UL << SSP0_MIS_RXMIS_Pos)                            /*!< SSP0 MIS: RXMIS Mask                */\r
+#define SSP0_MIS_TXMIS_Pos                                    3                                                         /*!< SSP0 MIS: TXMIS Position            */\r
+#define SSP0_MIS_TXMIS_Msk                                    (0x01UL << SSP0_MIS_TXMIS_Pos)                            /*!< SSP0 MIS: TXMIS Mask                */\r
+\r
+// ----------------------------------------  SSP0_ICR  --------------------------------------------\r
+#define SSP0_ICR_RORIC_Pos                                    0                                                         /*!< SSP0 ICR: RORIC Position            */\r
+#define SSP0_ICR_RORIC_Msk                                    (0x01UL << SSP0_ICR_RORIC_Pos)                            /*!< SSP0 ICR: RORIC Mask                */\r
+#define SSP0_ICR_RTIC_Pos                                     1                                                         /*!< SSP0 ICR: RTIC Position             */\r
+#define SSP0_ICR_RTIC_Msk                                     (0x01UL << SSP0_ICR_RTIC_Pos)                             /*!< SSP0 ICR: RTIC Mask                 */\r
+\r
+// ---------------------------------------  SSP0_DMACR  -------------------------------------------\r
+#define SSP0_DMACR_RXDMAE_Pos                                 0                                                         /*!< SSP0 DMACR: RXDMAE Position         */\r
+#define SSP0_DMACR_RXDMAE_Msk                                 (0x01UL << SSP0_DMACR_RXDMAE_Pos)                         /*!< SSP0 DMACR: RXDMAE Mask             */\r
+#define SSP0_DMACR_TXDMAE_Pos                                 1                                                         /*!< SSP0 DMACR: TXDMAE Position         */\r
+#define SSP0_DMACR_TXDMAE_Msk                                 (0x01UL << SSP0_DMACR_TXDMAE_Pos)                         /*!< SSP0 DMACR: TXDMAE Mask             */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 SSP1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  SSP1_CR0  --------------------------------------------\r
+#define SSP1_CR0_DSS_Pos                                      0                                                         /*!< SSP1 CR0: DSS Position              */\r
+#define SSP1_CR0_DSS_Msk                                      (0x0fUL << SSP1_CR0_DSS_Pos)                              /*!< SSP1 CR0: DSS Mask                  */\r
+#define SSP1_CR0_FRF_Pos                                      4                                                         /*!< SSP1 CR0: FRF Position              */\r
+#define SSP1_CR0_FRF_Msk                                      (0x03UL << SSP1_CR0_FRF_Pos)                              /*!< SSP1 CR0: FRF Mask                  */\r
+#define SSP1_CR0_CPOL_Pos                                     6                                                         /*!< SSP1 CR0: CPOL Position             */\r
+#define SSP1_CR0_CPOL_Msk                                     (0x01UL << SSP1_CR0_CPOL_Pos)                             /*!< SSP1 CR0: CPOL Mask                 */\r
+#define SSP1_CR0_CPHA_Pos                                     7                                                         /*!< SSP1 CR0: CPHA Position             */\r
+#define SSP1_CR0_CPHA_Msk                                     (0x01UL << SSP1_CR0_CPHA_Pos)                             /*!< SSP1 CR0: CPHA Mask                 */\r
+#define SSP1_CR0_SCR_Pos                                      8                                                         /*!< SSP1 CR0: SCR Position              */\r
+#define SSP1_CR0_SCR_Msk                                      (0x000000ffUL << SSP1_CR0_SCR_Pos)                        /*!< SSP1 CR0: SCR Mask                  */\r
+\r
+// ----------------------------------------  SSP1_CR1  --------------------------------------------\r
+#define SSP1_CR1_LBM_Pos                                      0                                                         /*!< SSP1 CR1: LBM Position              */\r
+#define SSP1_CR1_LBM_Msk                                      (0x01UL << SSP1_CR1_LBM_Pos)                              /*!< SSP1 CR1: LBM Mask                  */\r
+#define SSP1_CR1_SSE_Pos                                      1                                                         /*!< SSP1 CR1: SSE Position              */\r
+#define SSP1_CR1_SSE_Msk                                      (0x01UL << SSP1_CR1_SSE_Pos)                              /*!< SSP1 CR1: SSE Mask                  */\r
+#define SSP1_CR1_MS_Pos                                       2                                                         /*!< SSP1 CR1: MS Position               */\r
+#define SSP1_CR1_MS_Msk                                       (0x01UL << SSP1_CR1_MS_Pos)                               /*!< SSP1 CR1: MS Mask                   */\r
+#define SSP1_CR1_SOD_Pos                                      3                                                         /*!< SSP1 CR1: SOD Position              */\r
+#define SSP1_CR1_SOD_Msk                                      (0x01UL << SSP1_CR1_SOD_Pos)                              /*!< SSP1 CR1: SOD Mask                  */\r
+\r
+// -----------------------------------------  SSP1_DR  --------------------------------------------\r
+#define SSP1_DR_DATA_Pos                                      0                                                         /*!< SSP1 DR: DATA Position              */\r
+#define SSP1_DR_DATA_Msk                                      (0x0000ffffUL << SSP1_DR_DATA_Pos)                        /*!< SSP1 DR: DATA Mask                  */\r
+\r
+// -----------------------------------------  SSP1_SR  --------------------------------------------\r
+#define SSP1_SR_TFE_Pos                                       0                                                         /*!< SSP1 SR: TFE Position               */\r
+#define SSP1_SR_TFE_Msk                                       (0x01UL << SSP1_SR_TFE_Pos)                               /*!< SSP1 SR: TFE Mask                   */\r
+#define SSP1_SR_TNF_Pos                                       1                                                         /*!< SSP1 SR: TNF Position               */\r
+#define SSP1_SR_TNF_Msk                                       (0x01UL << SSP1_SR_TNF_Pos)                               /*!< SSP1 SR: TNF Mask                   */\r
+#define SSP1_SR_RNE_Pos                                       2                                                         /*!< SSP1 SR: RNE Position               */\r
+#define SSP1_SR_RNE_Msk                                       (0x01UL << SSP1_SR_RNE_Pos)                               /*!< SSP1 SR: RNE Mask                   */\r
+#define SSP1_SR_RFF_Pos                                       3                                                         /*!< SSP1 SR: RFF Position               */\r
+#define SSP1_SR_RFF_Msk                                       (0x01UL << SSP1_SR_RFF_Pos)                               /*!< SSP1 SR: RFF Mask                   */\r
+#define SSP1_SR_BSY_Pos                                       4                                                         /*!< SSP1 SR: BSY Position               */\r
+#define SSP1_SR_BSY_Msk                                       (0x01UL << SSP1_SR_BSY_Pos)                               /*!< SSP1 SR: BSY Mask                   */\r
+\r
+// ----------------------------------------  SSP1_CPSR  -------------------------------------------\r
+#define SSP1_CPSR_CPSDVSR_Pos                                 0                                                         /*!< SSP1 CPSR: CPSDVSR Position         */\r
+#define SSP1_CPSR_CPSDVSR_Msk                                 (0x000000ffUL << SSP1_CPSR_CPSDVSR_Pos)                   /*!< SSP1 CPSR: CPSDVSR Mask             */\r
+\r
+// ----------------------------------------  SSP1_IMSC  -------------------------------------------\r
+#define SSP1_IMSC_RORIM_Pos                                   0                                                         /*!< SSP1 IMSC: RORIM Position           */\r
+#define SSP1_IMSC_RORIM_Msk                                   (0x01UL << SSP1_IMSC_RORIM_Pos)                           /*!< SSP1 IMSC: RORIM Mask               */\r
+#define SSP1_IMSC_RTIM_Pos                                    1                                                         /*!< SSP1 IMSC: RTIM Position            */\r
+#define SSP1_IMSC_RTIM_Msk                                    (0x01UL << SSP1_IMSC_RTIM_Pos)                            /*!< SSP1 IMSC: RTIM Mask                */\r
+#define SSP1_IMSC_RXIM_Pos                                    2                                                         /*!< SSP1 IMSC: RXIM Position            */\r
+#define SSP1_IMSC_RXIM_Msk                                    (0x01UL << SSP1_IMSC_RXIM_Pos)                            /*!< SSP1 IMSC: RXIM Mask                */\r
+#define SSP1_IMSC_TXIM_Pos                                    3                                                         /*!< SSP1 IMSC: TXIM Position            */\r
+#define SSP1_IMSC_TXIM_Msk                                    (0x01UL << SSP1_IMSC_TXIM_Pos)                            /*!< SSP1 IMSC: TXIM Mask                */\r
+\r
+// ----------------------------------------  SSP1_RIS  --------------------------------------------\r
+#define SSP1_RIS_RORRIS_Pos                                   0                                                         /*!< SSP1 RIS: RORRIS Position           */\r
+#define SSP1_RIS_RORRIS_Msk                                   (0x01UL << SSP1_RIS_RORRIS_Pos)                           /*!< SSP1 RIS: RORRIS Mask               */\r
+#define SSP1_RIS_RTRIS_Pos                                    1                                                         /*!< SSP1 RIS: RTRIS Position            */\r
+#define SSP1_RIS_RTRIS_Msk                                    (0x01UL << SSP1_RIS_RTRIS_Pos)                            /*!< SSP1 RIS: RTRIS Mask                */\r
+#define SSP1_RIS_RXRIS_Pos                                    2                                                         /*!< SSP1 RIS: RXRIS Position            */\r
+#define SSP1_RIS_RXRIS_Msk                                    (0x01UL << SSP1_RIS_RXRIS_Pos)                            /*!< SSP1 RIS: RXRIS Mask                */\r
+#define SSP1_RIS_TXRIS_Pos                                    3                                                         /*!< SSP1 RIS: TXRIS Position            */\r
+#define SSP1_RIS_TXRIS_Msk                                    (0x01UL << SSP1_RIS_TXRIS_Pos)                            /*!< SSP1 RIS: TXRIS Mask                */\r
+\r
+// ----------------------------------------  SSP1_MIS  --------------------------------------------\r
+#define SSP1_MIS_RORMIS_Pos                                   0                                                         /*!< SSP1 MIS: RORMIS Position           */\r
+#define SSP1_MIS_RORMIS_Msk                                   (0x01UL << SSP1_MIS_RORMIS_Pos)                           /*!< SSP1 MIS: RORMIS Mask               */\r
+#define SSP1_MIS_RTMIS_Pos                                    1                                                         /*!< SSP1 MIS: RTMIS Position            */\r
+#define SSP1_MIS_RTMIS_Msk                                    (0x01UL << SSP1_MIS_RTMIS_Pos)                            /*!< SSP1 MIS: RTMIS Mask                */\r
+#define SSP1_MIS_RXMIS_Pos                                    2                                                         /*!< SSP1 MIS: RXMIS Position            */\r
+#define SSP1_MIS_RXMIS_Msk                                    (0x01UL << SSP1_MIS_RXMIS_Pos)                            /*!< SSP1 MIS: RXMIS Mask                */\r
+#define SSP1_MIS_TXMIS_Pos                                    3                                                         /*!< SSP1 MIS: TXMIS Position            */\r
+#define SSP1_MIS_TXMIS_Msk                                    (0x01UL << SSP1_MIS_TXMIS_Pos)                            /*!< SSP1 MIS: TXMIS Mask                */\r
+\r
+// ----------------------------------------  SSP1_ICR  --------------------------------------------\r
+#define SSP1_ICR_RORIC_Pos                                    0                                                         /*!< SSP1 ICR: RORIC Position            */\r
+#define SSP1_ICR_RORIC_Msk                                    (0x01UL << SSP1_ICR_RORIC_Pos)                            /*!< SSP1 ICR: RORIC Mask                */\r
+#define SSP1_ICR_RTIC_Pos                                     1                                                         /*!< SSP1 ICR: RTIC Position             */\r
+#define SSP1_ICR_RTIC_Msk                                     (0x01UL << SSP1_ICR_RTIC_Pos)                             /*!< SSP1 ICR: RTIC Mask                 */\r
+\r
+// ---------------------------------------  SSP1_DMACR  -------------------------------------------\r
+#define SSP1_DMACR_RXDMAE_Pos                                 0                                                         /*!< SSP1 DMACR: RXDMAE Position         */\r
+#define SSP1_DMACR_RXDMAE_Msk                                 (0x01UL << SSP1_DMACR_RXDMAE_Pos)                         /*!< SSP1 DMACR: RXDMAE Mask             */\r
+#define SSP1_DMACR_TXDMAE_Pos                                 1                                                         /*!< SSP1 DMACR: TXDMAE Position         */\r
+#define SSP1_DMACR_TXDMAE_Msk                                 (0x01UL << SSP1_DMACR_TXDMAE_Pos)                         /*!< SSP1 DMACR: TXDMAE Mask             */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                TIMER0 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  TIMER0_IR  -------------------------------------------\r
+#define TIMER0_IR_MR0INT_Pos                                  0                                                         /*!< TIMER0 IR: MR0INT Position          */\r
+#define TIMER0_IR_MR0INT_Msk                                  (0x01UL << TIMER0_IR_MR0INT_Pos)                          /*!< TIMER0 IR: MR0INT Mask              */\r
+#define TIMER0_IR_MR1INT_Pos                                  1                                                         /*!< TIMER0 IR: MR1INT Position          */\r
+#define TIMER0_IR_MR1INT_Msk                                  (0x01UL << TIMER0_IR_MR1INT_Pos)                          /*!< TIMER0 IR: MR1INT Mask              */\r
+#define TIMER0_IR_MR2INT_Pos                                  2                                                         /*!< TIMER0 IR: MR2INT Position          */\r
+#define TIMER0_IR_MR2INT_Msk                                  (0x01UL << TIMER0_IR_MR2INT_Pos)                          /*!< TIMER0 IR: MR2INT Mask              */\r
+#define TIMER0_IR_MR3INT_Pos                                  3                                                         /*!< TIMER0 IR: MR3INT Position          */\r
+#define TIMER0_IR_MR3INT_Msk                                  (0x01UL << TIMER0_IR_MR3INT_Pos)                          /*!< TIMER0 IR: MR3INT Mask              */\r
+#define TIMER0_IR_CR0INT_Pos                                  4                                                         /*!< TIMER0 IR: CR0INT Position          */\r
+#define TIMER0_IR_CR0INT_Msk                                  (0x01UL << TIMER0_IR_CR0INT_Pos)                          /*!< TIMER0 IR: CR0INT Mask              */\r
+#define TIMER0_IR_CR1INT_Pos                                  5                                                         /*!< TIMER0 IR: CR1INT Position          */\r
+#define TIMER0_IR_CR1INT_Msk                                  (0x01UL << TIMER0_IR_CR1INT_Pos)                          /*!< TIMER0 IR: CR1INT Mask              */\r
+#define TIMER0_IR_CR2INT_Pos                                  6                                                         /*!< TIMER0 IR: CR2INT Position          */\r
+#define TIMER0_IR_CR2INT_Msk                                  (0x01UL << TIMER0_IR_CR2INT_Pos)                          /*!< TIMER0 IR: CR2INT Mask              */\r
+#define TIMER0_IR_CR3INT_Pos                                  7                                                         /*!< TIMER0 IR: CR3INT Position          */\r
+#define TIMER0_IR_CR3INT_Msk                                  (0x01UL << TIMER0_IR_CR3INT_Pos)                          /*!< TIMER0 IR: CR3INT Mask              */\r
+\r
+// ---------------------------------------  TIMER0_TCR  -------------------------------------------\r
+#define TIMER0_TCR_CEN_Pos                                    0                                                         /*!< TIMER0 TCR: CEN Position            */\r
+#define TIMER0_TCR_CEN_Msk                                    (0x01UL << TIMER0_TCR_CEN_Pos)                            /*!< TIMER0 TCR: CEN Mask                */\r
+#define TIMER0_TCR_CRST_Pos                                   1                                                         /*!< TIMER0 TCR: CRST Position           */\r
+#define TIMER0_TCR_CRST_Msk                                   (0x01UL << TIMER0_TCR_CRST_Pos)                           /*!< TIMER0 TCR: CRST Mask               */\r
+\r
+// ----------------------------------------  TIMER0_TC  -------------------------------------------\r
+#define TIMER0_TC_TC_Pos                                      0                                                         /*!< TIMER0 TC: TC Position              */\r
+#define TIMER0_TC_TC_Msk                                      (0xffffffffUL << TIMER0_TC_TC_Pos)                        /*!< TIMER0 TC: TC Mask                  */\r
+\r
+// ----------------------------------------  TIMER0_PR  -------------------------------------------\r
+#define TIMER0_PR_PM_Pos                                      0                                                         /*!< TIMER0 PR: PM Position              */\r
+#define TIMER0_PR_PM_Msk                                      (0xffffffffUL << TIMER0_PR_PM_Pos)                        /*!< TIMER0 PR: PM Mask                  */\r
+\r
+// ----------------------------------------  TIMER0_PC  -------------------------------------------\r
+#define TIMER0_PC_PC_Pos                                      0                                                         /*!< TIMER0 PC: PC Position              */\r
+#define TIMER0_PC_PC_Msk                                      (0xffffffffUL << TIMER0_PC_PC_Pos)                        /*!< TIMER0 PC: PC Mask                  */\r
+\r
+// ---------------------------------------  TIMER0_MCR  -------------------------------------------\r
+#define TIMER0_MCR_MR0I_Pos                                   0                                                         /*!< TIMER0 MCR: MR0I Position           */\r
+#define TIMER0_MCR_MR0I_Msk                                   (0x01UL << TIMER0_MCR_MR0I_Pos)                           /*!< TIMER0 MCR: MR0I Mask               */\r
+#define TIMER0_MCR_MR0R_Pos                                   1                                                         /*!< TIMER0 MCR: MR0R Position           */\r
+#define TIMER0_MCR_MR0R_Msk                                   (0x01UL << TIMER0_MCR_MR0R_Pos)                           /*!< TIMER0 MCR: MR0R Mask               */\r
+#define TIMER0_MCR_MR0S_Pos                                   2                                                         /*!< TIMER0 MCR: MR0S Position           */\r
+#define TIMER0_MCR_MR0S_Msk                                   (0x01UL << TIMER0_MCR_MR0S_Pos)                           /*!< TIMER0 MCR: MR0S Mask               */\r
+#define TIMER0_MCR_MR1I_Pos                                   3                                                         /*!< TIMER0 MCR: MR1I Position           */\r
+#define TIMER0_MCR_MR1I_Msk                                   (0x01UL << TIMER0_MCR_MR1I_Pos)                           /*!< TIMER0 MCR: MR1I Mask               */\r
+#define TIMER0_MCR_MR1R_Pos                                   4                                                         /*!< TIMER0 MCR: MR1R Position           */\r
+#define TIMER0_MCR_MR1R_Msk                                   (0x01UL << TIMER0_MCR_MR1R_Pos)                           /*!< TIMER0 MCR: MR1R Mask               */\r
+#define TIMER0_MCR_MR1S_Pos                                   5                                                         /*!< TIMER0 MCR: MR1S Position           */\r
+#define TIMER0_MCR_MR1S_Msk                                   (0x01UL << TIMER0_MCR_MR1S_Pos)                           /*!< TIMER0 MCR: MR1S Mask               */\r
+#define TIMER0_MCR_MR2I_Pos                                   6                                                         /*!< TIMER0 MCR: MR2I Position           */\r
+#define TIMER0_MCR_MR2I_Msk                                   (0x01UL << TIMER0_MCR_MR2I_Pos)                           /*!< TIMER0 MCR: MR2I Mask               */\r
+#define TIMER0_MCR_MR2R_Pos                                   7                                                         /*!< TIMER0 MCR: MR2R Position           */\r
+#define TIMER0_MCR_MR2R_Msk                                   (0x01UL << TIMER0_MCR_MR2R_Pos)                           /*!< TIMER0 MCR: MR2R Mask               */\r
+#define TIMER0_MCR_MR2S_Pos                                   8                                                         /*!< TIMER0 MCR: MR2S Position           */\r
+#define TIMER0_MCR_MR2S_Msk                                   (0x01UL << TIMER0_MCR_MR2S_Pos)                           /*!< TIMER0 MCR: MR2S Mask               */\r
+#define TIMER0_MCR_MR3I_Pos                                   9                                                         /*!< TIMER0 MCR: MR3I Position           */\r
+#define TIMER0_MCR_MR3I_Msk                                   (0x01UL << TIMER0_MCR_MR3I_Pos)                           /*!< TIMER0 MCR: MR3I Mask               */\r
+#define TIMER0_MCR_MR3R_Pos                                   10                                                        /*!< TIMER0 MCR: MR3R Position           */\r
+#define TIMER0_MCR_MR3R_Msk                                   (0x01UL << TIMER0_MCR_MR3R_Pos)                           /*!< TIMER0 MCR: MR3R Mask               */\r
+#define TIMER0_MCR_MR3S_Pos                                   11                                                        /*!< TIMER0 MCR: MR3S Position           */\r
+#define TIMER0_MCR_MR3S_Msk                                   (0x01UL << TIMER0_MCR_MR3S_Pos)                           /*!< TIMER0 MCR: MR3S Mask               */\r
+\r
+// ---------------------------------------  TIMER0_MR0  -------------------------------------------\r
+#define TIMER0_MR0_MATCH_Pos                                  0                                                         /*!< TIMER0 MR0: MATCH Position          */\r
+#define TIMER0_MR0_MATCH_Msk                                  (0xffffffffUL << TIMER0_MR0_MATCH_Pos)                    /*!< TIMER0 MR0: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER0_MR1  -------------------------------------------\r
+#define TIMER0_MR1_MATCH_Pos                                  0                                                         /*!< TIMER0 MR1: MATCH Position          */\r
+#define TIMER0_MR1_MATCH_Msk                                  (0xffffffffUL << TIMER0_MR1_MATCH_Pos)                    /*!< TIMER0 MR1: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER0_MR2  -------------------------------------------\r
+#define TIMER0_MR2_MATCH_Pos                                  0                                                         /*!< TIMER0 MR2: MATCH Position          */\r
+#define TIMER0_MR2_MATCH_Msk                                  (0xffffffffUL << TIMER0_MR2_MATCH_Pos)                    /*!< TIMER0 MR2: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER0_MR3  -------------------------------------------\r
+#define TIMER0_MR3_MATCH_Pos                                  0                                                         /*!< TIMER0 MR3: MATCH Position          */\r
+#define TIMER0_MR3_MATCH_Msk                                  (0xffffffffUL << TIMER0_MR3_MATCH_Pos)                    /*!< TIMER0 MR3: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER0_CCR  -------------------------------------------\r
+#define TIMER0_CCR_CAP0RE_Pos                                 0                                                         /*!< TIMER0 CCR: CAP0RE Position         */\r
+#define TIMER0_CCR_CAP0RE_Msk                                 (0x01UL << TIMER0_CCR_CAP0RE_Pos)                         /*!< TIMER0 CCR: CAP0RE Mask             */\r
+#define TIMER0_CCR_CAP0FE_Pos                                 1                                                         /*!< TIMER0 CCR: CAP0FE Position         */\r
+#define TIMER0_CCR_CAP0FE_Msk                                 (0x01UL << TIMER0_CCR_CAP0FE_Pos)                         /*!< TIMER0 CCR: CAP0FE Mask             */\r
+#define TIMER0_CCR_CAP0I_Pos                                  2                                                         /*!< TIMER0 CCR: CAP0I Position          */\r
+#define TIMER0_CCR_CAP0I_Msk                                  (0x01UL << TIMER0_CCR_CAP0I_Pos)                          /*!< TIMER0 CCR: CAP0I Mask              */\r
+#define TIMER0_CCR_CAP1RE_Pos                                 3                                                         /*!< TIMER0 CCR: CAP1RE Position         */\r
+#define TIMER0_CCR_CAP1RE_Msk                                 (0x01UL << TIMER0_CCR_CAP1RE_Pos)                         /*!< TIMER0 CCR: CAP1RE Mask             */\r
+#define TIMER0_CCR_CAP1FE_Pos                                 4                                                         /*!< TIMER0 CCR: CAP1FE Position         */\r
+#define TIMER0_CCR_CAP1FE_Msk                                 (0x01UL << TIMER0_CCR_CAP1FE_Pos)                         /*!< TIMER0 CCR: CAP1FE Mask             */\r
+#define TIMER0_CCR_CAP1I_Pos                                  5                                                         /*!< TIMER0 CCR: CAP1I Position          */\r
+#define TIMER0_CCR_CAP1I_Msk                                  (0x01UL << TIMER0_CCR_CAP1I_Pos)                          /*!< TIMER0 CCR: CAP1I Mask              */\r
+#define TIMER0_CCR_CAP2RE_Pos                                 6                                                         /*!< TIMER0 CCR: CAP2RE Position         */\r
+#define TIMER0_CCR_CAP2RE_Msk                                 (0x01UL << TIMER0_CCR_CAP2RE_Pos)                         /*!< TIMER0 CCR: CAP2RE Mask             */\r
+#define TIMER0_CCR_CAP2FE_Pos                                 7                                                         /*!< TIMER0 CCR: CAP2FE Position         */\r
+#define TIMER0_CCR_CAP2FE_Msk                                 (0x01UL << TIMER0_CCR_CAP2FE_Pos)                         /*!< TIMER0 CCR: CAP2FE Mask             */\r
+#define TIMER0_CCR_CAP2I_Pos                                  8                                                         /*!< TIMER0 CCR: CAP2I Position          */\r
+#define TIMER0_CCR_CAP2I_Msk                                  (0x01UL << TIMER0_CCR_CAP2I_Pos)                          /*!< TIMER0 CCR: CAP2I Mask              */\r
+#define TIMER0_CCR_CAP3RE_Pos                                 9                                                         /*!< TIMER0 CCR: CAP3RE Position         */\r
+#define TIMER0_CCR_CAP3RE_Msk                                 (0x01UL << TIMER0_CCR_CAP3RE_Pos)                         /*!< TIMER0 CCR: CAP3RE Mask             */\r
+#define TIMER0_CCR_CAP3FE_Pos                                 10                                                        /*!< TIMER0 CCR: CAP3FE Position         */\r
+#define TIMER0_CCR_CAP3FE_Msk                                 (0x01UL << TIMER0_CCR_CAP3FE_Pos)                         /*!< TIMER0 CCR: CAP3FE Mask             */\r
+#define TIMER0_CCR_CAP3I_Pos                                  11                                                        /*!< TIMER0 CCR: CAP3I Position          */\r
+#define TIMER0_CCR_CAP3I_Msk                                  (0x01UL << TIMER0_CCR_CAP3I_Pos)                          /*!< TIMER0 CCR: CAP3I Mask              */\r
+\r
+// ---------------------------------------  TIMER0_CR0  -------------------------------------------\r
+#define TIMER0_CR0_CAP_Pos                                    0                                                         /*!< TIMER0 CR0: CAP Position            */\r
+#define TIMER0_CR0_CAP_Msk                                    (0xffffffffUL << TIMER0_CR0_CAP_Pos)                      /*!< TIMER0 CR0: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER0_CR1  -------------------------------------------\r
+#define TIMER0_CR1_CAP_Pos                                    0                                                         /*!< TIMER0 CR1: CAP Position            */\r
+#define TIMER0_CR1_CAP_Msk                                    (0xffffffffUL << TIMER0_CR1_CAP_Pos)                      /*!< TIMER0 CR1: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER0_CR2  -------------------------------------------\r
+#define TIMER0_CR2_CAP_Pos                                    0                                                         /*!< TIMER0 CR2: CAP Position            */\r
+#define TIMER0_CR2_CAP_Msk                                    (0xffffffffUL << TIMER0_CR2_CAP_Pos)                      /*!< TIMER0 CR2: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER0_CR3  -------------------------------------------\r
+#define TIMER0_CR3_CAP_Pos                                    0                                                         /*!< TIMER0 CR3: CAP Position            */\r
+#define TIMER0_CR3_CAP_Msk                                    (0xffffffffUL << TIMER0_CR3_CAP_Pos)                      /*!< TIMER0 CR3: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER0_EMR  -------------------------------------------\r
+#define TIMER0_EMR_EM0_Pos                                    0                                                         /*!< TIMER0 EMR: EM0 Position            */\r
+#define TIMER0_EMR_EM0_Msk                                    (0x01UL << TIMER0_EMR_EM0_Pos)                            /*!< TIMER0 EMR: EM0 Mask                */\r
+#define TIMER0_EMR_EM1_Pos                                    1                                                         /*!< TIMER0 EMR: EM1 Position            */\r
+#define TIMER0_EMR_EM1_Msk                                    (0x01UL << TIMER0_EMR_EM1_Pos)                            /*!< TIMER0 EMR: EM1 Mask                */\r
+#define TIMER0_EMR_EM2_Pos                                    2                                                         /*!< TIMER0 EMR: EM2 Position            */\r
+#define TIMER0_EMR_EM2_Msk                                    (0x01UL << TIMER0_EMR_EM2_Pos)                            /*!< TIMER0 EMR: EM2 Mask                */\r
+#define TIMER0_EMR_EM3_Pos                                    3                                                         /*!< TIMER0 EMR: EM3 Position            */\r
+#define TIMER0_EMR_EM3_Msk                                    (0x01UL << TIMER0_EMR_EM3_Pos)                            /*!< TIMER0 EMR: EM3 Mask                */\r
+#define TIMER0_EMR_EMC0_Pos                                   4                                                         /*!< TIMER0 EMR: EMC0 Position           */\r
+#define TIMER0_EMR_EMC0_Msk                                   (0x03UL << TIMER0_EMR_EMC0_Pos)                           /*!< TIMER0 EMR: EMC0 Mask               */\r
+#define TIMER0_EMR_EMC1_Pos                                   6                                                         /*!< TIMER0 EMR: EMC1 Position           */\r
+#define TIMER0_EMR_EMC1_Msk                                   (0x03UL << TIMER0_EMR_EMC1_Pos)                           /*!< TIMER0 EMR: EMC1 Mask               */\r
+#define TIMER0_EMR_EMC2_Pos                                   8                                                         /*!< TIMER0 EMR: EMC2 Position           */\r
+#define TIMER0_EMR_EMC2_Msk                                   (0x03UL << TIMER0_EMR_EMC2_Pos)                           /*!< TIMER0 EMR: EMC2 Mask               */\r
+#define TIMER0_EMR_EMC3_Pos                                   10                                                        /*!< TIMER0 EMR: EMC3 Position           */\r
+#define TIMER0_EMR_EMC3_Msk                                   (0x03UL << TIMER0_EMR_EMC3_Pos)                           /*!< TIMER0 EMR: EMC3 Mask               */\r
+\r
+// ---------------------------------------  TIMER0_CTCR  ------------------------------------------\r
+#define TIMER0_CTCR_CTMODE_Pos                                0                                                         /*!< TIMER0 CTCR: CTMODE Position        */\r
+#define TIMER0_CTCR_CTMODE_Msk                                (0x03UL << TIMER0_CTCR_CTMODE_Pos)                        /*!< TIMER0 CTCR: CTMODE Mask            */\r
+#define TIMER0_CTCR_CINSEL_Pos                                2                                                         /*!< TIMER0 CTCR: CINSEL Position        */\r
+#define TIMER0_CTCR_CINSEL_Msk                                (0x03UL << TIMER0_CTCR_CINSEL_Pos)                        /*!< TIMER0 CTCR: CINSEL Mask            */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                TIMER1 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  TIMER1_IR  -------------------------------------------\r
+#define TIMER1_IR_MR0INT_Pos                                  0                                                         /*!< TIMER1 IR: MR0INT Position          */\r
+#define TIMER1_IR_MR0INT_Msk                                  (0x01UL << TIMER1_IR_MR0INT_Pos)                          /*!< TIMER1 IR: MR0INT Mask              */\r
+#define TIMER1_IR_MR1INT_Pos                                  1                                                         /*!< TIMER1 IR: MR1INT Position          */\r
+#define TIMER1_IR_MR1INT_Msk                                  (0x01UL << TIMER1_IR_MR1INT_Pos)                          /*!< TIMER1 IR: MR1INT Mask              */\r
+#define TIMER1_IR_MR2INT_Pos                                  2                                                         /*!< TIMER1 IR: MR2INT Position          */\r
+#define TIMER1_IR_MR2INT_Msk                                  (0x01UL << TIMER1_IR_MR2INT_Pos)                          /*!< TIMER1 IR: MR2INT Mask              */\r
+#define TIMER1_IR_MR3INT_Pos                                  3                                                         /*!< TIMER1 IR: MR3INT Position          */\r
+#define TIMER1_IR_MR3INT_Msk                                  (0x01UL << TIMER1_IR_MR3INT_Pos)                          /*!< TIMER1 IR: MR3INT Mask              */\r
+#define TIMER1_IR_CR0INT_Pos                                  4                                                         /*!< TIMER1 IR: CR0INT Position          */\r
+#define TIMER1_IR_CR0INT_Msk                                  (0x01UL << TIMER1_IR_CR0INT_Pos)                          /*!< TIMER1 IR: CR0INT Mask              */\r
+#define TIMER1_IR_CR1INT_Pos                                  5                                                         /*!< TIMER1 IR: CR1INT Position          */\r
+#define TIMER1_IR_CR1INT_Msk                                  (0x01UL << TIMER1_IR_CR1INT_Pos)                          /*!< TIMER1 IR: CR1INT Mask              */\r
+#define TIMER1_IR_CR2INT_Pos                                  6                                                         /*!< TIMER1 IR: CR2INT Position          */\r
+#define TIMER1_IR_CR2INT_Msk                                  (0x01UL << TIMER1_IR_CR2INT_Pos)                          /*!< TIMER1 IR: CR2INT Mask              */\r
+#define TIMER1_IR_CR3INT_Pos                                  7                                                         /*!< TIMER1 IR: CR3INT Position          */\r
+#define TIMER1_IR_CR3INT_Msk                                  (0x01UL << TIMER1_IR_CR3INT_Pos)                          /*!< TIMER1 IR: CR3INT Mask              */\r
+\r
+// ---------------------------------------  TIMER1_TCR  -------------------------------------------\r
+#define TIMER1_TCR_CEN_Pos                                    0                                                         /*!< TIMER1 TCR: CEN Position            */\r
+#define TIMER1_TCR_CEN_Msk                                    (0x01UL << TIMER1_TCR_CEN_Pos)                            /*!< TIMER1 TCR: CEN Mask                */\r
+#define TIMER1_TCR_CRST_Pos                                   1                                                         /*!< TIMER1 TCR: CRST Position           */\r
+#define TIMER1_TCR_CRST_Msk                                   (0x01UL << TIMER1_TCR_CRST_Pos)                           /*!< TIMER1 TCR: CRST Mask               */\r
+\r
+// ----------------------------------------  TIMER1_TC  -------------------------------------------\r
+#define TIMER1_TC_TC_Pos                                      0                                                         /*!< TIMER1 TC: TC Position              */\r
+#define TIMER1_TC_TC_Msk                                      (0xffffffffUL << TIMER1_TC_TC_Pos)                        /*!< TIMER1 TC: TC Mask                  */\r
+\r
+// ----------------------------------------  TIMER1_PR  -------------------------------------------\r
+#define TIMER1_PR_PM_Pos                                      0                                                         /*!< TIMER1 PR: PM Position              */\r
+#define TIMER1_PR_PM_Msk                                      (0xffffffffUL << TIMER1_PR_PM_Pos)                        /*!< TIMER1 PR: PM Mask                  */\r
+\r
+// ----------------------------------------  TIMER1_PC  -------------------------------------------\r
+#define TIMER1_PC_PC_Pos                                      0                                                         /*!< TIMER1 PC: PC Position              */\r
+#define TIMER1_PC_PC_Msk                                      (0xffffffffUL << TIMER1_PC_PC_Pos)                        /*!< TIMER1 PC: PC Mask                  */\r
+\r
+// ---------------------------------------  TIMER1_MCR  -------------------------------------------\r
+#define TIMER1_MCR_MR0I_Pos                                   0                                                         /*!< TIMER1 MCR: MR0I Position           */\r
+#define TIMER1_MCR_MR0I_Msk                                   (0x01UL << TIMER1_MCR_MR0I_Pos)                           /*!< TIMER1 MCR: MR0I Mask               */\r
+#define TIMER1_MCR_MR0R_Pos                                   1                                                         /*!< TIMER1 MCR: MR0R Position           */\r
+#define TIMER1_MCR_MR0R_Msk                                   (0x01UL << TIMER1_MCR_MR0R_Pos)                           /*!< TIMER1 MCR: MR0R Mask               */\r
+#define TIMER1_MCR_MR0S_Pos                                   2                                                         /*!< TIMER1 MCR: MR0S Position           */\r
+#define TIMER1_MCR_MR0S_Msk                                   (0x01UL << TIMER1_MCR_MR0S_Pos)                           /*!< TIMER1 MCR: MR0S Mask               */\r
+#define TIMER1_MCR_MR1I_Pos                                   3                                                         /*!< TIMER1 MCR: MR1I Position           */\r
+#define TIMER1_MCR_MR1I_Msk                                   (0x01UL << TIMER1_MCR_MR1I_Pos)                           /*!< TIMER1 MCR: MR1I Mask               */\r
+#define TIMER1_MCR_MR1R_Pos                                   4                                                         /*!< TIMER1 MCR: MR1R Position           */\r
+#define TIMER1_MCR_MR1R_Msk                                   (0x01UL << TIMER1_MCR_MR1R_Pos)                           /*!< TIMER1 MCR: MR1R Mask               */\r
+#define TIMER1_MCR_MR1S_Pos                                   5                                                         /*!< TIMER1 MCR: MR1S Position           */\r
+#define TIMER1_MCR_MR1S_Msk                                   (0x01UL << TIMER1_MCR_MR1S_Pos)                           /*!< TIMER1 MCR: MR1S Mask               */\r
+#define TIMER1_MCR_MR2I_Pos                                   6                                                         /*!< TIMER1 MCR: MR2I Position           */\r
+#define TIMER1_MCR_MR2I_Msk                                   (0x01UL << TIMER1_MCR_MR2I_Pos)                           /*!< TIMER1 MCR: MR2I Mask               */\r
+#define TIMER1_MCR_MR2R_Pos                                   7                                                         /*!< TIMER1 MCR: MR2R Position           */\r
+#define TIMER1_MCR_MR2R_Msk                                   (0x01UL << TIMER1_MCR_MR2R_Pos)                           /*!< TIMER1 MCR: MR2R Mask               */\r
+#define TIMER1_MCR_MR2S_Pos                                   8                                                         /*!< TIMER1 MCR: MR2S Position           */\r
+#define TIMER1_MCR_MR2S_Msk                                   (0x01UL << TIMER1_MCR_MR2S_Pos)                           /*!< TIMER1 MCR: MR2S Mask               */\r
+#define TIMER1_MCR_MR3I_Pos                                   9                                                         /*!< TIMER1 MCR: MR3I Position           */\r
+#define TIMER1_MCR_MR3I_Msk                                   (0x01UL << TIMER1_MCR_MR3I_Pos)                           /*!< TIMER1 MCR: MR3I Mask               */\r
+#define TIMER1_MCR_MR3R_Pos                                   10                                                        /*!< TIMER1 MCR: MR3R Position           */\r
+#define TIMER1_MCR_MR3R_Msk                                   (0x01UL << TIMER1_MCR_MR3R_Pos)                           /*!< TIMER1 MCR: MR3R Mask               */\r
+#define TIMER1_MCR_MR3S_Pos                                   11                                                        /*!< TIMER1 MCR: MR3S Position           */\r
+#define TIMER1_MCR_MR3S_Msk                                   (0x01UL << TIMER1_MCR_MR3S_Pos)                           /*!< TIMER1 MCR: MR3S Mask               */\r
+\r
+// ---------------------------------------  TIMER1_MR0  -------------------------------------------\r
+#define TIMER1_MR0_MATCH_Pos                                  0                                                         /*!< TIMER1 MR0: MATCH Position          */\r
+#define TIMER1_MR0_MATCH_Msk                                  (0xffffffffUL << TIMER1_MR0_MATCH_Pos)                    /*!< TIMER1 MR0: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER1_MR1  -------------------------------------------\r
+#define TIMER1_MR1_MATCH_Pos                                  0                                                         /*!< TIMER1 MR1: MATCH Position          */\r
+#define TIMER1_MR1_MATCH_Msk                                  (0xffffffffUL << TIMER1_MR1_MATCH_Pos)                    /*!< TIMER1 MR1: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER1_MR2  -------------------------------------------\r
+#define TIMER1_MR2_MATCH_Pos                                  0                                                         /*!< TIMER1 MR2: MATCH Position          */\r
+#define TIMER1_MR2_MATCH_Msk                                  (0xffffffffUL << TIMER1_MR2_MATCH_Pos)                    /*!< TIMER1 MR2: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER1_MR3  -------------------------------------------\r
+#define TIMER1_MR3_MATCH_Pos                                  0                                                         /*!< TIMER1 MR3: MATCH Position          */\r
+#define TIMER1_MR3_MATCH_Msk                                  (0xffffffffUL << TIMER1_MR3_MATCH_Pos)                    /*!< TIMER1 MR3: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER1_CCR  -------------------------------------------\r
+#define TIMER1_CCR_CAP0RE_Pos                                 0                                                         /*!< TIMER1 CCR: CAP0RE Position         */\r
+#define TIMER1_CCR_CAP0RE_Msk                                 (0x01UL << TIMER1_CCR_CAP0RE_Pos)                         /*!< TIMER1 CCR: CAP0RE Mask             */\r
+#define TIMER1_CCR_CAP0FE_Pos                                 1                                                         /*!< TIMER1 CCR: CAP0FE Position         */\r
+#define TIMER1_CCR_CAP0FE_Msk                                 (0x01UL << TIMER1_CCR_CAP0FE_Pos)                         /*!< TIMER1 CCR: CAP0FE Mask             */\r
+#define TIMER1_CCR_CAP0I_Pos                                  2                                                         /*!< TIMER1 CCR: CAP0I Position          */\r
+#define TIMER1_CCR_CAP0I_Msk                                  (0x01UL << TIMER1_CCR_CAP0I_Pos)                          /*!< TIMER1 CCR: CAP0I Mask              */\r
+#define TIMER1_CCR_CAP1RE_Pos                                 3                                                         /*!< TIMER1 CCR: CAP1RE Position         */\r
+#define TIMER1_CCR_CAP1RE_Msk                                 (0x01UL << TIMER1_CCR_CAP1RE_Pos)                         /*!< TIMER1 CCR: CAP1RE Mask             */\r
+#define TIMER1_CCR_CAP1FE_Pos                                 4                                                         /*!< TIMER1 CCR: CAP1FE Position         */\r
+#define TIMER1_CCR_CAP1FE_Msk                                 (0x01UL << TIMER1_CCR_CAP1FE_Pos)                         /*!< TIMER1 CCR: CAP1FE Mask             */\r
+#define TIMER1_CCR_CAP1I_Pos                                  5                                                         /*!< TIMER1 CCR: CAP1I Position          */\r
+#define TIMER1_CCR_CAP1I_Msk                                  (0x01UL << TIMER1_CCR_CAP1I_Pos)                          /*!< TIMER1 CCR: CAP1I Mask              */\r
+#define TIMER1_CCR_CAP2RE_Pos                                 6                                                         /*!< TIMER1 CCR: CAP2RE Position         */\r
+#define TIMER1_CCR_CAP2RE_Msk                                 (0x01UL << TIMER1_CCR_CAP2RE_Pos)                         /*!< TIMER1 CCR: CAP2RE Mask             */\r
+#define TIMER1_CCR_CAP2FE_Pos                                 7                                                         /*!< TIMER1 CCR: CAP2FE Position         */\r
+#define TIMER1_CCR_CAP2FE_Msk                                 (0x01UL << TIMER1_CCR_CAP2FE_Pos)                         /*!< TIMER1 CCR: CAP2FE Mask             */\r
+#define TIMER1_CCR_CAP2I_Pos                                  8                                                         /*!< TIMER1 CCR: CAP2I Position          */\r
+#define TIMER1_CCR_CAP2I_Msk                                  (0x01UL << TIMER1_CCR_CAP2I_Pos)                          /*!< TIMER1 CCR: CAP2I Mask              */\r
+#define TIMER1_CCR_CAP3RE_Pos                                 9                                                         /*!< TIMER1 CCR: CAP3RE Position         */\r
+#define TIMER1_CCR_CAP3RE_Msk                                 (0x01UL << TIMER1_CCR_CAP3RE_Pos)                         /*!< TIMER1 CCR: CAP3RE Mask             */\r
+#define TIMER1_CCR_CAP3FE_Pos                                 10                                                        /*!< TIMER1 CCR: CAP3FE Position         */\r
+#define TIMER1_CCR_CAP3FE_Msk                                 (0x01UL << TIMER1_CCR_CAP3FE_Pos)                         /*!< TIMER1 CCR: CAP3FE Mask             */\r
+#define TIMER1_CCR_CAP3I_Pos                                  11                                                        /*!< TIMER1 CCR: CAP3I Position          */\r
+#define TIMER1_CCR_CAP3I_Msk                                  (0x01UL << TIMER1_CCR_CAP3I_Pos)                          /*!< TIMER1 CCR: CAP3I Mask              */\r
+\r
+// ---------------------------------------  TIMER1_CR0  -------------------------------------------\r
+#define TIMER1_CR0_CAP_Pos                                    0                                                         /*!< TIMER1 CR0: CAP Position            */\r
+#define TIMER1_CR0_CAP_Msk                                    (0xffffffffUL << TIMER1_CR0_CAP_Pos)                      /*!< TIMER1 CR0: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER1_CR1  -------------------------------------------\r
+#define TIMER1_CR1_CAP_Pos                                    0                                                         /*!< TIMER1 CR1: CAP Position            */\r
+#define TIMER1_CR1_CAP_Msk                                    (0xffffffffUL << TIMER1_CR1_CAP_Pos)                      /*!< TIMER1 CR1: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER1_CR2  -------------------------------------------\r
+#define TIMER1_CR2_CAP_Pos                                    0                                                         /*!< TIMER1 CR2: CAP Position            */\r
+#define TIMER1_CR2_CAP_Msk                                    (0xffffffffUL << TIMER1_CR2_CAP_Pos)                      /*!< TIMER1 CR2: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER1_CR3  -------------------------------------------\r
+#define TIMER1_CR3_CAP_Pos                                    0                                                         /*!< TIMER1 CR3: CAP Position            */\r
+#define TIMER1_CR3_CAP_Msk                                    (0xffffffffUL << TIMER1_CR3_CAP_Pos)                      /*!< TIMER1 CR3: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER1_EMR  -------------------------------------------\r
+#define TIMER1_EMR_EM0_Pos                                    0                                                         /*!< TIMER1 EMR: EM0 Position            */\r
+#define TIMER1_EMR_EM0_Msk                                    (0x01UL << TIMER1_EMR_EM0_Pos)                            /*!< TIMER1 EMR: EM0 Mask                */\r
+#define TIMER1_EMR_EM1_Pos                                    1                                                         /*!< TIMER1 EMR: EM1 Position            */\r
+#define TIMER1_EMR_EM1_Msk                                    (0x01UL << TIMER1_EMR_EM1_Pos)                            /*!< TIMER1 EMR: EM1 Mask                */\r
+#define TIMER1_EMR_EM2_Pos                                    2                                                         /*!< TIMER1 EMR: EM2 Position            */\r
+#define TIMER1_EMR_EM2_Msk                                    (0x01UL << TIMER1_EMR_EM2_Pos)                            /*!< TIMER1 EMR: EM2 Mask                */\r
+#define TIMER1_EMR_EM3_Pos                                    3                                                         /*!< TIMER1 EMR: EM3 Position            */\r
+#define TIMER1_EMR_EM3_Msk                                    (0x01UL << TIMER1_EMR_EM3_Pos)                            /*!< TIMER1 EMR: EM3 Mask                */\r
+#define TIMER1_EMR_EMC0_Pos                                   4                                                         /*!< TIMER1 EMR: EMC0 Position           */\r
+#define TIMER1_EMR_EMC0_Msk                                   (0x03UL << TIMER1_EMR_EMC0_Pos)                           /*!< TIMER1 EMR: EMC0 Mask               */\r
+#define TIMER1_EMR_EMC1_Pos                                   6                                                         /*!< TIMER1 EMR: EMC1 Position           */\r
+#define TIMER1_EMR_EMC1_Msk                                   (0x03UL << TIMER1_EMR_EMC1_Pos)                           /*!< TIMER1 EMR: EMC1 Mask               */\r
+#define TIMER1_EMR_EMC2_Pos                                   8                                                         /*!< TIMER1 EMR: EMC2 Position           */\r
+#define TIMER1_EMR_EMC2_Msk                                   (0x03UL << TIMER1_EMR_EMC2_Pos)                           /*!< TIMER1 EMR: EMC2 Mask               */\r
+#define TIMER1_EMR_EMC3_Pos                                   10                                                        /*!< TIMER1 EMR: EMC3 Position           */\r
+#define TIMER1_EMR_EMC3_Msk                                   (0x03UL << TIMER1_EMR_EMC3_Pos)                           /*!< TIMER1 EMR: EMC3 Mask               */\r
+\r
+// ---------------------------------------  TIMER1_CTCR  ------------------------------------------\r
+#define TIMER1_CTCR_CTMODE_Pos                                0                                                         /*!< TIMER1 CTCR: CTMODE Position        */\r
+#define TIMER1_CTCR_CTMODE_Msk                                (0x03UL << TIMER1_CTCR_CTMODE_Pos)                        /*!< TIMER1 CTCR: CTMODE Mask            */\r
+#define TIMER1_CTCR_CINSEL_Pos                                2                                                         /*!< TIMER1 CTCR: CINSEL Position        */\r
+#define TIMER1_CTCR_CINSEL_Msk                                (0x03UL << TIMER1_CTCR_CINSEL_Pos)                        /*!< TIMER1 CTCR: CINSEL Mask            */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                TIMER2 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  TIMER2_IR  -------------------------------------------\r
+#define TIMER2_IR_MR0INT_Pos                                  0                                                         /*!< TIMER2 IR: MR0INT Position          */\r
+#define TIMER2_IR_MR0INT_Msk                                  (0x01UL << TIMER2_IR_MR0INT_Pos)                          /*!< TIMER2 IR: MR0INT Mask              */\r
+#define TIMER2_IR_MR1INT_Pos                                  1                                                         /*!< TIMER2 IR: MR1INT Position          */\r
+#define TIMER2_IR_MR1INT_Msk                                  (0x01UL << TIMER2_IR_MR1INT_Pos)                          /*!< TIMER2 IR: MR1INT Mask              */\r
+#define TIMER2_IR_MR2INT_Pos                                  2                                                         /*!< TIMER2 IR: MR2INT Position          */\r
+#define TIMER2_IR_MR2INT_Msk                                  (0x01UL << TIMER2_IR_MR2INT_Pos)                          /*!< TIMER2 IR: MR2INT Mask              */\r
+#define TIMER2_IR_MR3INT_Pos                                  3                                                         /*!< TIMER2 IR: MR3INT Position          */\r
+#define TIMER2_IR_MR3INT_Msk                                  (0x01UL << TIMER2_IR_MR3INT_Pos)                          /*!< TIMER2 IR: MR3INT Mask              */\r
+#define TIMER2_IR_CR0INT_Pos                                  4                                                         /*!< TIMER2 IR: CR0INT Position          */\r
+#define TIMER2_IR_CR0INT_Msk                                  (0x01UL << TIMER2_IR_CR0INT_Pos)                          /*!< TIMER2 IR: CR0INT Mask              */\r
+#define TIMER2_IR_CR1INT_Pos                                  5                                                         /*!< TIMER2 IR: CR1INT Position          */\r
+#define TIMER2_IR_CR1INT_Msk                                  (0x01UL << TIMER2_IR_CR1INT_Pos)                          /*!< TIMER2 IR: CR1INT Mask              */\r
+#define TIMER2_IR_CR2INT_Pos                                  6                                                         /*!< TIMER2 IR: CR2INT Position          */\r
+#define TIMER2_IR_CR2INT_Msk                                  (0x01UL << TIMER2_IR_CR2INT_Pos)                          /*!< TIMER2 IR: CR2INT Mask              */\r
+#define TIMER2_IR_CR3INT_Pos                                  7                                                         /*!< TIMER2 IR: CR3INT Position          */\r
+#define TIMER2_IR_CR3INT_Msk                                  (0x01UL << TIMER2_IR_CR3INT_Pos)                          /*!< TIMER2 IR: CR3INT Mask              */\r
+\r
+// ---------------------------------------  TIMER2_TCR  -------------------------------------------\r
+#define TIMER2_TCR_CEN_Pos                                    0                                                         /*!< TIMER2 TCR: CEN Position            */\r
+#define TIMER2_TCR_CEN_Msk                                    (0x01UL << TIMER2_TCR_CEN_Pos)                            /*!< TIMER2 TCR: CEN Mask                */\r
+#define TIMER2_TCR_CRST_Pos                                   1                                                         /*!< TIMER2 TCR: CRST Position           */\r
+#define TIMER2_TCR_CRST_Msk                                   (0x01UL << TIMER2_TCR_CRST_Pos)                           /*!< TIMER2 TCR: CRST Mask               */\r
+\r
+// ----------------------------------------  TIMER2_TC  -------------------------------------------\r
+#define TIMER2_TC_TC_Pos                                      0                                                         /*!< TIMER2 TC: TC Position              */\r
+#define TIMER2_TC_TC_Msk                                      (0xffffffffUL << TIMER2_TC_TC_Pos)                        /*!< TIMER2 TC: TC Mask                  */\r
+\r
+// ----------------------------------------  TIMER2_PR  -------------------------------------------\r
+#define TIMER2_PR_PM_Pos                                      0                                                         /*!< TIMER2 PR: PM Position              */\r
+#define TIMER2_PR_PM_Msk                                      (0xffffffffUL << TIMER2_PR_PM_Pos)                        /*!< TIMER2 PR: PM Mask                  */\r
+\r
+// ----------------------------------------  TIMER2_PC  -------------------------------------------\r
+#define TIMER2_PC_PC_Pos                                      0                                                         /*!< TIMER2 PC: PC Position              */\r
+#define TIMER2_PC_PC_Msk                                      (0xffffffffUL << TIMER2_PC_PC_Pos)                        /*!< TIMER2 PC: PC Mask                  */\r
+\r
+// ---------------------------------------  TIMER2_MCR  -------------------------------------------\r
+#define TIMER2_MCR_MR0I_Pos                                   0                                                         /*!< TIMER2 MCR: MR0I Position           */\r
+#define TIMER2_MCR_MR0I_Msk                                   (0x01UL << TIMER2_MCR_MR0I_Pos)                           /*!< TIMER2 MCR: MR0I Mask               */\r
+#define TIMER2_MCR_MR0R_Pos                                   1                                                         /*!< TIMER2 MCR: MR0R Position           */\r
+#define TIMER2_MCR_MR0R_Msk                                   (0x01UL << TIMER2_MCR_MR0R_Pos)                           /*!< TIMER2 MCR: MR0R Mask               */\r
+#define TIMER2_MCR_MR0S_Pos                                   2                                                         /*!< TIMER2 MCR: MR0S Position           */\r
+#define TIMER2_MCR_MR0S_Msk                                   (0x01UL << TIMER2_MCR_MR0S_Pos)                           /*!< TIMER2 MCR: MR0S Mask               */\r
+#define TIMER2_MCR_MR1I_Pos                                   3                                                         /*!< TIMER2 MCR: MR1I Position           */\r
+#define TIMER2_MCR_MR1I_Msk                                   (0x01UL << TIMER2_MCR_MR1I_Pos)                           /*!< TIMER2 MCR: MR1I Mask               */\r
+#define TIMER2_MCR_MR1R_Pos                                   4                                                         /*!< TIMER2 MCR: MR1R Position           */\r
+#define TIMER2_MCR_MR1R_Msk                                   (0x01UL << TIMER2_MCR_MR1R_Pos)                           /*!< TIMER2 MCR: MR1R Mask               */\r
+#define TIMER2_MCR_MR1S_Pos                                   5                                                         /*!< TIMER2 MCR: MR1S Position           */\r
+#define TIMER2_MCR_MR1S_Msk                                   (0x01UL << TIMER2_MCR_MR1S_Pos)                           /*!< TIMER2 MCR: MR1S Mask               */\r
+#define TIMER2_MCR_MR2I_Pos                                   6                                                         /*!< TIMER2 MCR: MR2I Position           */\r
+#define TIMER2_MCR_MR2I_Msk                                   (0x01UL << TIMER2_MCR_MR2I_Pos)                           /*!< TIMER2 MCR: MR2I Mask               */\r
+#define TIMER2_MCR_MR2R_Pos                                   7                                                         /*!< TIMER2 MCR: MR2R Position           */\r
+#define TIMER2_MCR_MR2R_Msk                                   (0x01UL << TIMER2_MCR_MR2R_Pos)                           /*!< TIMER2 MCR: MR2R Mask               */\r
+#define TIMER2_MCR_MR2S_Pos                                   8                                                         /*!< TIMER2 MCR: MR2S Position           */\r
+#define TIMER2_MCR_MR2S_Msk                                   (0x01UL << TIMER2_MCR_MR2S_Pos)                           /*!< TIMER2 MCR: MR2S Mask               */\r
+#define TIMER2_MCR_MR3I_Pos                                   9                                                         /*!< TIMER2 MCR: MR3I Position           */\r
+#define TIMER2_MCR_MR3I_Msk                                   (0x01UL << TIMER2_MCR_MR3I_Pos)                           /*!< TIMER2 MCR: MR3I Mask               */\r
+#define TIMER2_MCR_MR3R_Pos                                   10                                                        /*!< TIMER2 MCR: MR3R Position           */\r
+#define TIMER2_MCR_MR3R_Msk                                   (0x01UL << TIMER2_MCR_MR3R_Pos)                           /*!< TIMER2 MCR: MR3R Mask               */\r
+#define TIMER2_MCR_MR3S_Pos                                   11                                                        /*!< TIMER2 MCR: MR3S Position           */\r
+#define TIMER2_MCR_MR3S_Msk                                   (0x01UL << TIMER2_MCR_MR3S_Pos)                           /*!< TIMER2 MCR: MR3S Mask               */\r
+\r
+// ---------------------------------------  TIMER2_MR0  -------------------------------------------\r
+#define TIMER2_MR0_MATCH_Pos                                  0                                                         /*!< TIMER2 MR0: MATCH Position          */\r
+#define TIMER2_MR0_MATCH_Msk                                  (0xffffffffUL << TIMER2_MR0_MATCH_Pos)                    /*!< TIMER2 MR0: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER2_MR1  -------------------------------------------\r
+#define TIMER2_MR1_MATCH_Pos                                  0                                                         /*!< TIMER2 MR1: MATCH Position          */\r
+#define TIMER2_MR1_MATCH_Msk                                  (0xffffffffUL << TIMER2_MR1_MATCH_Pos)                    /*!< TIMER2 MR1: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER2_MR2  -------------------------------------------\r
+#define TIMER2_MR2_MATCH_Pos                                  0                                                         /*!< TIMER2 MR2: MATCH Position          */\r
+#define TIMER2_MR2_MATCH_Msk                                  (0xffffffffUL << TIMER2_MR2_MATCH_Pos)                    /*!< TIMER2 MR2: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER2_MR3  -------------------------------------------\r
+#define TIMER2_MR3_MATCH_Pos                                  0                                                         /*!< TIMER2 MR3: MATCH Position          */\r
+#define TIMER2_MR3_MATCH_Msk                                  (0xffffffffUL << TIMER2_MR3_MATCH_Pos)                    /*!< TIMER2 MR3: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER2_CCR  -------------------------------------------\r
+#define TIMER2_CCR_CAP0RE_Pos                                 0                                                         /*!< TIMER2 CCR: CAP0RE Position         */\r
+#define TIMER2_CCR_CAP0RE_Msk                                 (0x01UL << TIMER2_CCR_CAP0RE_Pos)                         /*!< TIMER2 CCR: CAP0RE Mask             */\r
+#define TIMER2_CCR_CAP0FE_Pos                                 1                                                         /*!< TIMER2 CCR: CAP0FE Position         */\r
+#define TIMER2_CCR_CAP0FE_Msk                                 (0x01UL << TIMER2_CCR_CAP0FE_Pos)                         /*!< TIMER2 CCR: CAP0FE Mask             */\r
+#define TIMER2_CCR_CAP0I_Pos                                  2                                                         /*!< TIMER2 CCR: CAP0I Position          */\r
+#define TIMER2_CCR_CAP0I_Msk                                  (0x01UL << TIMER2_CCR_CAP0I_Pos)                          /*!< TIMER2 CCR: CAP0I Mask              */\r
+#define TIMER2_CCR_CAP1RE_Pos                                 3                                                         /*!< TIMER2 CCR: CAP1RE Position         */\r
+#define TIMER2_CCR_CAP1RE_Msk                                 (0x01UL << TIMER2_CCR_CAP1RE_Pos)                         /*!< TIMER2 CCR: CAP1RE Mask             */\r
+#define TIMER2_CCR_CAP1FE_Pos                                 4                                                         /*!< TIMER2 CCR: CAP1FE Position         */\r
+#define TIMER2_CCR_CAP1FE_Msk                                 (0x01UL << TIMER2_CCR_CAP1FE_Pos)                         /*!< TIMER2 CCR: CAP1FE Mask             */\r
+#define TIMER2_CCR_CAP1I_Pos                                  5                                                         /*!< TIMER2 CCR: CAP1I Position          */\r
+#define TIMER2_CCR_CAP1I_Msk                                  (0x01UL << TIMER2_CCR_CAP1I_Pos)                          /*!< TIMER2 CCR: CAP1I Mask              */\r
+#define TIMER2_CCR_CAP2RE_Pos                                 6                                                         /*!< TIMER2 CCR: CAP2RE Position         */\r
+#define TIMER2_CCR_CAP2RE_Msk                                 (0x01UL << TIMER2_CCR_CAP2RE_Pos)                         /*!< TIMER2 CCR: CAP2RE Mask             */\r
+#define TIMER2_CCR_CAP2FE_Pos                                 7                                                         /*!< TIMER2 CCR: CAP2FE Position         */\r
+#define TIMER2_CCR_CAP2FE_Msk                                 (0x01UL << TIMER2_CCR_CAP2FE_Pos)                         /*!< TIMER2 CCR: CAP2FE Mask             */\r
+#define TIMER2_CCR_CAP2I_Pos                                  8                                                         /*!< TIMER2 CCR: CAP2I Position          */\r
+#define TIMER2_CCR_CAP2I_Msk                                  (0x01UL << TIMER2_CCR_CAP2I_Pos)                          /*!< TIMER2 CCR: CAP2I Mask              */\r
+#define TIMER2_CCR_CAP3RE_Pos                                 9                                                         /*!< TIMER2 CCR: CAP3RE Position         */\r
+#define TIMER2_CCR_CAP3RE_Msk                                 (0x01UL << TIMER2_CCR_CAP3RE_Pos)                         /*!< TIMER2 CCR: CAP3RE Mask             */\r
+#define TIMER2_CCR_CAP3FE_Pos                                 10                                                        /*!< TIMER2 CCR: CAP3FE Position         */\r
+#define TIMER2_CCR_CAP3FE_Msk                                 (0x01UL << TIMER2_CCR_CAP3FE_Pos)                         /*!< TIMER2 CCR: CAP3FE Mask             */\r
+#define TIMER2_CCR_CAP3I_Pos                                  11                                                        /*!< TIMER2 CCR: CAP3I Position          */\r
+#define TIMER2_CCR_CAP3I_Msk                                  (0x01UL << TIMER2_CCR_CAP3I_Pos)                          /*!< TIMER2 CCR: CAP3I Mask              */\r
+\r
+// ---------------------------------------  TIMER2_CR0  -------------------------------------------\r
+#define TIMER2_CR0_CAP_Pos                                    0                                                         /*!< TIMER2 CR0: CAP Position            */\r
+#define TIMER2_CR0_CAP_Msk                                    (0xffffffffUL << TIMER2_CR0_CAP_Pos)                      /*!< TIMER2 CR0: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER2_CR1  -------------------------------------------\r
+#define TIMER2_CR1_CAP_Pos                                    0                                                         /*!< TIMER2 CR1: CAP Position            */\r
+#define TIMER2_CR1_CAP_Msk                                    (0xffffffffUL << TIMER2_CR1_CAP_Pos)                      /*!< TIMER2 CR1: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER2_CR2  -------------------------------------------\r
+#define TIMER2_CR2_CAP_Pos                                    0                                                         /*!< TIMER2 CR2: CAP Position            */\r
+#define TIMER2_CR2_CAP_Msk                                    (0xffffffffUL << TIMER2_CR2_CAP_Pos)                      /*!< TIMER2 CR2: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER2_CR3  -------------------------------------------\r
+#define TIMER2_CR3_CAP_Pos                                    0                                                         /*!< TIMER2 CR3: CAP Position            */\r
+#define TIMER2_CR3_CAP_Msk                                    (0xffffffffUL << TIMER2_CR3_CAP_Pos)                      /*!< TIMER2 CR3: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER2_EMR  -------------------------------------------\r
+#define TIMER2_EMR_EM0_Pos                                    0                                                         /*!< TIMER2 EMR: EM0 Position            */\r
+#define TIMER2_EMR_EM0_Msk                                    (0x01UL << TIMER2_EMR_EM0_Pos)                            /*!< TIMER2 EMR: EM0 Mask                */\r
+#define TIMER2_EMR_EM1_Pos                                    1                                                         /*!< TIMER2 EMR: EM1 Position            */\r
+#define TIMER2_EMR_EM1_Msk                                    (0x01UL << TIMER2_EMR_EM1_Pos)                            /*!< TIMER2 EMR: EM1 Mask                */\r
+#define TIMER2_EMR_EM2_Pos                                    2                                                         /*!< TIMER2 EMR: EM2 Position            */\r
+#define TIMER2_EMR_EM2_Msk                                    (0x01UL << TIMER2_EMR_EM2_Pos)                            /*!< TIMER2 EMR: EM2 Mask                */\r
+#define TIMER2_EMR_EM3_Pos                                    3                                                         /*!< TIMER2 EMR: EM3 Position            */\r
+#define TIMER2_EMR_EM3_Msk                                    (0x01UL << TIMER2_EMR_EM3_Pos)                            /*!< TIMER2 EMR: EM3 Mask                */\r
+#define TIMER2_EMR_EMC0_Pos                                   4                                                         /*!< TIMER2 EMR: EMC0 Position           */\r
+#define TIMER2_EMR_EMC0_Msk                                   (0x03UL << TIMER2_EMR_EMC0_Pos)                           /*!< TIMER2 EMR: EMC0 Mask               */\r
+#define TIMER2_EMR_EMC1_Pos                                   6                                                         /*!< TIMER2 EMR: EMC1 Position           */\r
+#define TIMER2_EMR_EMC1_Msk                                   (0x03UL << TIMER2_EMR_EMC1_Pos)                           /*!< TIMER2 EMR: EMC1 Mask               */\r
+#define TIMER2_EMR_EMC2_Pos                                   8                                                         /*!< TIMER2 EMR: EMC2 Position           */\r
+#define TIMER2_EMR_EMC2_Msk                                   (0x03UL << TIMER2_EMR_EMC2_Pos)                           /*!< TIMER2 EMR: EMC2 Mask               */\r
+#define TIMER2_EMR_EMC3_Pos                                   10                                                        /*!< TIMER2 EMR: EMC3 Position           */\r
+#define TIMER2_EMR_EMC3_Msk                                   (0x03UL << TIMER2_EMR_EMC3_Pos)                           /*!< TIMER2 EMR: EMC3 Mask               */\r
+\r
+// ---------------------------------------  TIMER2_CTCR  ------------------------------------------\r
+#define TIMER2_CTCR_CTMODE_Pos                                0                                                         /*!< TIMER2 CTCR: CTMODE Position        */\r
+#define TIMER2_CTCR_CTMODE_Msk                                (0x03UL << TIMER2_CTCR_CTMODE_Pos)                        /*!< TIMER2 CTCR: CTMODE Mask            */\r
+#define TIMER2_CTCR_CINSEL_Pos                                2                                                         /*!< TIMER2 CTCR: CINSEL Position        */\r
+#define TIMER2_CTCR_CINSEL_Msk                                (0x03UL << TIMER2_CTCR_CINSEL_Pos)                        /*!< TIMER2 CTCR: CINSEL Mask            */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                TIMER3 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  TIMER3_IR  -------------------------------------------\r
+#define TIMER3_IR_MR0INT_Pos                                  0                                                         /*!< TIMER3 IR: MR0INT Position          */\r
+#define TIMER3_IR_MR0INT_Msk                                  (0x01UL << TIMER3_IR_MR0INT_Pos)                          /*!< TIMER3 IR: MR0INT Mask              */\r
+#define TIMER3_IR_MR1INT_Pos                                  1                                                         /*!< TIMER3 IR: MR1INT Position          */\r
+#define TIMER3_IR_MR1INT_Msk                                  (0x01UL << TIMER3_IR_MR1INT_Pos)                          /*!< TIMER3 IR: MR1INT Mask              */\r
+#define TIMER3_IR_MR2INT_Pos                                  2                                                         /*!< TIMER3 IR: MR2INT Position          */\r
+#define TIMER3_IR_MR2INT_Msk                                  (0x01UL << TIMER3_IR_MR2INT_Pos)                          /*!< TIMER3 IR: MR2INT Mask              */\r
+#define TIMER3_IR_MR3INT_Pos                                  3                                                         /*!< TIMER3 IR: MR3INT Position          */\r
+#define TIMER3_IR_MR3INT_Msk                                  (0x01UL << TIMER3_IR_MR3INT_Pos)                          /*!< TIMER3 IR: MR3INT Mask              */\r
+#define TIMER3_IR_CR0INT_Pos                                  4                                                         /*!< TIMER3 IR: CR0INT Position          */\r
+#define TIMER3_IR_CR0INT_Msk                                  (0x01UL << TIMER3_IR_CR0INT_Pos)                          /*!< TIMER3 IR: CR0INT Mask              */\r
+#define TIMER3_IR_CR1INT_Pos                                  5                                                         /*!< TIMER3 IR: CR1INT Position          */\r
+#define TIMER3_IR_CR1INT_Msk                                  (0x01UL << TIMER3_IR_CR1INT_Pos)                          /*!< TIMER3 IR: CR1INT Mask              */\r
+#define TIMER3_IR_CR2INT_Pos                                  6                                                         /*!< TIMER3 IR: CR2INT Position          */\r
+#define TIMER3_IR_CR2INT_Msk                                  (0x01UL << TIMER3_IR_CR2INT_Pos)                          /*!< TIMER3 IR: CR2INT Mask              */\r
+#define TIMER3_IR_CR3INT_Pos                                  7                                                         /*!< TIMER3 IR: CR3INT Position          */\r
+#define TIMER3_IR_CR3INT_Msk                                  (0x01UL << TIMER3_IR_CR3INT_Pos)                          /*!< TIMER3 IR: CR3INT Mask              */\r
+\r
+// ---------------------------------------  TIMER3_TCR  -------------------------------------------\r
+#define TIMER3_TCR_CEN_Pos                                    0                                                         /*!< TIMER3 TCR: CEN Position            */\r
+#define TIMER3_TCR_CEN_Msk                                    (0x01UL << TIMER3_TCR_CEN_Pos)                            /*!< TIMER3 TCR: CEN Mask                */\r
+#define TIMER3_TCR_CRST_Pos                                   1                                                         /*!< TIMER3 TCR: CRST Position           */\r
+#define TIMER3_TCR_CRST_Msk                                   (0x01UL << TIMER3_TCR_CRST_Pos)                           /*!< TIMER3 TCR: CRST Mask               */\r
+\r
+// ----------------------------------------  TIMER3_TC  -------------------------------------------\r
+#define TIMER3_TC_TC_Pos                                      0                                                         /*!< TIMER3 TC: TC Position              */\r
+#define TIMER3_TC_TC_Msk                                      (0xffffffffUL << TIMER3_TC_TC_Pos)                        /*!< TIMER3 TC: TC Mask                  */\r
+\r
+// ----------------------------------------  TIMER3_PR  -------------------------------------------\r
+#define TIMER3_PR_PM_Pos                                      0                                                         /*!< TIMER3 PR: PM Position              */\r
+#define TIMER3_PR_PM_Msk                                      (0xffffffffUL << TIMER3_PR_PM_Pos)                        /*!< TIMER3 PR: PM Mask                  */\r
+\r
+// ----------------------------------------  TIMER3_PC  -------------------------------------------\r
+#define TIMER3_PC_PC_Pos                                      0                                                         /*!< TIMER3 PC: PC Position              */\r
+#define TIMER3_PC_PC_Msk                                      (0xffffffffUL << TIMER3_PC_PC_Pos)                        /*!< TIMER3 PC: PC Mask                  */\r
+\r
+// ---------------------------------------  TIMER3_MCR  -------------------------------------------\r
+#define TIMER3_MCR_MR0I_Pos                                   0                                                         /*!< TIMER3 MCR: MR0I Position           */\r
+#define TIMER3_MCR_MR0I_Msk                                   (0x01UL << TIMER3_MCR_MR0I_Pos)                           /*!< TIMER3 MCR: MR0I Mask               */\r
+#define TIMER3_MCR_MR0R_Pos                                   1                                                         /*!< TIMER3 MCR: MR0R Position           */\r
+#define TIMER3_MCR_MR0R_Msk                                   (0x01UL << TIMER3_MCR_MR0R_Pos)                           /*!< TIMER3 MCR: MR0R Mask               */\r
+#define TIMER3_MCR_MR0S_Pos                                   2                                                         /*!< TIMER3 MCR: MR0S Position           */\r
+#define TIMER3_MCR_MR0S_Msk                                   (0x01UL << TIMER3_MCR_MR0S_Pos)                           /*!< TIMER3 MCR: MR0S Mask               */\r
+#define TIMER3_MCR_MR1I_Pos                                   3                                                         /*!< TIMER3 MCR: MR1I Position           */\r
+#define TIMER3_MCR_MR1I_Msk                                   (0x01UL << TIMER3_MCR_MR1I_Pos)                           /*!< TIMER3 MCR: MR1I Mask               */\r
+#define TIMER3_MCR_MR1R_Pos                                   4                                                         /*!< TIMER3 MCR: MR1R Position           */\r
+#define TIMER3_MCR_MR1R_Msk                                   (0x01UL << TIMER3_MCR_MR1R_Pos)                           /*!< TIMER3 MCR: MR1R Mask               */\r
+#define TIMER3_MCR_MR1S_Pos                                   5                                                         /*!< TIMER3 MCR: MR1S Position           */\r
+#define TIMER3_MCR_MR1S_Msk                                   (0x01UL << TIMER3_MCR_MR1S_Pos)                           /*!< TIMER3 MCR: MR1S Mask               */\r
+#define TIMER3_MCR_MR2I_Pos                                   6                                                         /*!< TIMER3 MCR: MR2I Position           */\r
+#define TIMER3_MCR_MR2I_Msk                                   (0x01UL << TIMER3_MCR_MR2I_Pos)                           /*!< TIMER3 MCR: MR2I Mask               */\r
+#define TIMER3_MCR_MR2R_Pos                                   7                                                         /*!< TIMER3 MCR: MR2R Position           */\r
+#define TIMER3_MCR_MR2R_Msk                                   (0x01UL << TIMER3_MCR_MR2R_Pos)                           /*!< TIMER3 MCR: MR2R Mask               */\r
+#define TIMER3_MCR_MR2S_Pos                                   8                                                         /*!< TIMER3 MCR: MR2S Position           */\r
+#define TIMER3_MCR_MR2S_Msk                                   (0x01UL << TIMER3_MCR_MR2S_Pos)                           /*!< TIMER3 MCR: MR2S Mask               */\r
+#define TIMER3_MCR_MR3I_Pos                                   9                                                         /*!< TIMER3 MCR: MR3I Position           */\r
+#define TIMER3_MCR_MR3I_Msk                                   (0x01UL << TIMER3_MCR_MR3I_Pos)                           /*!< TIMER3 MCR: MR3I Mask               */\r
+#define TIMER3_MCR_MR3R_Pos                                   10                                                        /*!< TIMER3 MCR: MR3R Position           */\r
+#define TIMER3_MCR_MR3R_Msk                                   (0x01UL << TIMER3_MCR_MR3R_Pos)                           /*!< TIMER3 MCR: MR3R Mask               */\r
+#define TIMER3_MCR_MR3S_Pos                                   11                                                        /*!< TIMER3 MCR: MR3S Position           */\r
+#define TIMER3_MCR_MR3S_Msk                                   (0x01UL << TIMER3_MCR_MR3S_Pos)                           /*!< TIMER3 MCR: MR3S Mask               */\r
+\r
+// ---------------------------------------  TIMER3_MR0  -------------------------------------------\r
+#define TIMER3_MR0_MATCH_Pos                                  0                                                         /*!< TIMER3 MR0: MATCH Position          */\r
+#define TIMER3_MR0_MATCH_Msk                                  (0xffffffffUL << TIMER3_MR0_MATCH_Pos)                    /*!< TIMER3 MR0: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER3_MR1  -------------------------------------------\r
+#define TIMER3_MR1_MATCH_Pos                                  0                                                         /*!< TIMER3 MR1: MATCH Position          */\r
+#define TIMER3_MR1_MATCH_Msk                                  (0xffffffffUL << TIMER3_MR1_MATCH_Pos)                    /*!< TIMER3 MR1: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER3_MR2  -------------------------------------------\r
+#define TIMER3_MR2_MATCH_Pos                                  0                                                         /*!< TIMER3 MR2: MATCH Position          */\r
+#define TIMER3_MR2_MATCH_Msk                                  (0xffffffffUL << TIMER3_MR2_MATCH_Pos)                    /*!< TIMER3 MR2: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER3_MR3  -------------------------------------------\r
+#define TIMER3_MR3_MATCH_Pos                                  0                                                         /*!< TIMER3 MR3: MATCH Position          */\r
+#define TIMER3_MR3_MATCH_Msk                                  (0xffffffffUL << TIMER3_MR3_MATCH_Pos)                    /*!< TIMER3 MR3: MATCH Mask              */\r
+\r
+// ---------------------------------------  TIMER3_CCR  -------------------------------------------\r
+#define TIMER3_CCR_CAP0RE_Pos                                 0                                                         /*!< TIMER3 CCR: CAP0RE Position         */\r
+#define TIMER3_CCR_CAP0RE_Msk                                 (0x01UL << TIMER3_CCR_CAP0RE_Pos)                         /*!< TIMER3 CCR: CAP0RE Mask             */\r
+#define TIMER3_CCR_CAP0FE_Pos                                 1                                                         /*!< TIMER3 CCR: CAP0FE Position         */\r
+#define TIMER3_CCR_CAP0FE_Msk                                 (0x01UL << TIMER3_CCR_CAP0FE_Pos)                         /*!< TIMER3 CCR: CAP0FE Mask             */\r
+#define TIMER3_CCR_CAP0I_Pos                                  2                                                         /*!< TIMER3 CCR: CAP0I Position          */\r
+#define TIMER3_CCR_CAP0I_Msk                                  (0x01UL << TIMER3_CCR_CAP0I_Pos)                          /*!< TIMER3 CCR: CAP0I Mask              */\r
+#define TIMER3_CCR_CAP1RE_Pos                                 3                                                         /*!< TIMER3 CCR: CAP1RE Position         */\r
+#define TIMER3_CCR_CAP1RE_Msk                                 (0x01UL << TIMER3_CCR_CAP1RE_Pos)                         /*!< TIMER3 CCR: CAP1RE Mask             */\r
+#define TIMER3_CCR_CAP1FE_Pos                                 4                                                         /*!< TIMER3 CCR: CAP1FE Position         */\r
+#define TIMER3_CCR_CAP1FE_Msk                                 (0x01UL << TIMER3_CCR_CAP1FE_Pos)                         /*!< TIMER3 CCR: CAP1FE Mask             */\r
+#define TIMER3_CCR_CAP1I_Pos                                  5                                                         /*!< TIMER3 CCR: CAP1I Position          */\r
+#define TIMER3_CCR_CAP1I_Msk                                  (0x01UL << TIMER3_CCR_CAP1I_Pos)                          /*!< TIMER3 CCR: CAP1I Mask              */\r
+#define TIMER3_CCR_CAP2RE_Pos                                 6                                                         /*!< TIMER3 CCR: CAP2RE Position         */\r
+#define TIMER3_CCR_CAP2RE_Msk                                 (0x01UL << TIMER3_CCR_CAP2RE_Pos)                         /*!< TIMER3 CCR: CAP2RE Mask             */\r
+#define TIMER3_CCR_CAP2FE_Pos                                 7                                                         /*!< TIMER3 CCR: CAP2FE Position         */\r
+#define TIMER3_CCR_CAP2FE_Msk                                 (0x01UL << TIMER3_CCR_CAP2FE_Pos)                         /*!< TIMER3 CCR: CAP2FE Mask             */\r
+#define TIMER3_CCR_CAP2I_Pos                                  8                                                         /*!< TIMER3 CCR: CAP2I Position          */\r
+#define TIMER3_CCR_CAP2I_Msk                                  (0x01UL << TIMER3_CCR_CAP2I_Pos)                          /*!< TIMER3 CCR: CAP2I Mask              */\r
+#define TIMER3_CCR_CAP3RE_Pos                                 9                                                         /*!< TIMER3 CCR: CAP3RE Position         */\r
+#define TIMER3_CCR_CAP3RE_Msk                                 (0x01UL << TIMER3_CCR_CAP3RE_Pos)                         /*!< TIMER3 CCR: CAP3RE Mask             */\r
+#define TIMER3_CCR_CAP3FE_Pos                                 10                                                        /*!< TIMER3 CCR: CAP3FE Position         */\r
+#define TIMER3_CCR_CAP3FE_Msk                                 (0x01UL << TIMER3_CCR_CAP3FE_Pos)                         /*!< TIMER3 CCR: CAP3FE Mask             */\r
+#define TIMER3_CCR_CAP3I_Pos                                  11                                                        /*!< TIMER3 CCR: CAP3I Position          */\r
+#define TIMER3_CCR_CAP3I_Msk                                  (0x01UL << TIMER3_CCR_CAP3I_Pos)                          /*!< TIMER3 CCR: CAP3I Mask              */\r
+\r
+// ---------------------------------------  TIMER3_CR0  -------------------------------------------\r
+#define TIMER3_CR0_CAP_Pos                                    0                                                         /*!< TIMER3 CR0: CAP Position            */\r
+#define TIMER3_CR0_CAP_Msk                                    (0xffffffffUL << TIMER3_CR0_CAP_Pos)                      /*!< TIMER3 CR0: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER3_CR1  -------------------------------------------\r
+#define TIMER3_CR1_CAP_Pos                                    0                                                         /*!< TIMER3 CR1: CAP Position            */\r
+#define TIMER3_CR1_CAP_Msk                                    (0xffffffffUL << TIMER3_CR1_CAP_Pos)                      /*!< TIMER3 CR1: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER3_CR2  -------------------------------------------\r
+#define TIMER3_CR2_CAP_Pos                                    0                                                         /*!< TIMER3 CR2: CAP Position            */\r
+#define TIMER3_CR2_CAP_Msk                                    (0xffffffffUL << TIMER3_CR2_CAP_Pos)                      /*!< TIMER3 CR2: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER3_CR3  -------------------------------------------\r
+#define TIMER3_CR3_CAP_Pos                                    0                                                         /*!< TIMER3 CR3: CAP Position            */\r
+#define TIMER3_CR3_CAP_Msk                                    (0xffffffffUL << TIMER3_CR3_CAP_Pos)                      /*!< TIMER3 CR3: CAP Mask                */\r
+\r
+// ---------------------------------------  TIMER3_EMR  -------------------------------------------\r
+#define TIMER3_EMR_EM0_Pos                                    0                                                         /*!< TIMER3 EMR: EM0 Position            */\r
+#define TIMER3_EMR_EM0_Msk                                    (0x01UL << TIMER3_EMR_EM0_Pos)                            /*!< TIMER3 EMR: EM0 Mask                */\r
+#define TIMER3_EMR_EM1_Pos                                    1                                                         /*!< TIMER3 EMR: EM1 Position            */\r
+#define TIMER3_EMR_EM1_Msk                                    (0x01UL << TIMER3_EMR_EM1_Pos)                            /*!< TIMER3 EMR: EM1 Mask                */\r
+#define TIMER3_EMR_EM2_Pos                                    2                                                         /*!< TIMER3 EMR: EM2 Position            */\r
+#define TIMER3_EMR_EM2_Msk                                    (0x01UL << TIMER3_EMR_EM2_Pos)                            /*!< TIMER3 EMR: EM2 Mask                */\r
+#define TIMER3_EMR_EM3_Pos                                    3                                                         /*!< TIMER3 EMR: EM3 Position            */\r
+#define TIMER3_EMR_EM3_Msk                                    (0x01UL << TIMER3_EMR_EM3_Pos)                            /*!< TIMER3 EMR: EM3 Mask                */\r
+#define TIMER3_EMR_EMC0_Pos                                   4                                                         /*!< TIMER3 EMR: EMC0 Position           */\r
+#define TIMER3_EMR_EMC0_Msk                                   (0x03UL << TIMER3_EMR_EMC0_Pos)                           /*!< TIMER3 EMR: EMC0 Mask               */\r
+#define TIMER3_EMR_EMC1_Pos                                   6                                                         /*!< TIMER3 EMR: EMC1 Position           */\r
+#define TIMER3_EMR_EMC1_Msk                                   (0x03UL << TIMER3_EMR_EMC1_Pos)                           /*!< TIMER3 EMR: EMC1 Mask               */\r
+#define TIMER3_EMR_EMC2_Pos                                   8                                                         /*!< TIMER3 EMR: EMC2 Position           */\r
+#define TIMER3_EMR_EMC2_Msk                                   (0x03UL << TIMER3_EMR_EMC2_Pos)                           /*!< TIMER3 EMR: EMC2 Mask               */\r
+#define TIMER3_EMR_EMC3_Pos                                   10                                                        /*!< TIMER3 EMR: EMC3 Position           */\r
+#define TIMER3_EMR_EMC3_Msk                                   (0x03UL << TIMER3_EMR_EMC3_Pos)                           /*!< TIMER3 EMR: EMC3 Mask               */\r
+\r
+// ---------------------------------------  TIMER3_CTCR  ------------------------------------------\r
+#define TIMER3_CTCR_CTMODE_Pos                                0                                                         /*!< TIMER3 CTCR: CTMODE Position        */\r
+#define TIMER3_CTCR_CTMODE_Msk                                (0x03UL << TIMER3_CTCR_CTMODE_Pos)                        /*!< TIMER3 CTCR: CTMODE Mask            */\r
+#define TIMER3_CTCR_CINSEL_Pos                                2                                                         /*!< TIMER3 CTCR: CINSEL Position        */\r
+#define TIMER3_CTCR_CINSEL_Msk                                (0x03UL << TIMER3_CTCR_CINSEL_Pos)                        /*!< TIMER3 CTCR: CINSEL Mask            */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  SCU Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  SCU_SFSP0_0  ------------------------------------------\r
+#define SCU_SFSP0_0_MODE_Pos                                  0                                                         /*!< SCU SFSP0_0: MODE Position          */\r
+#define SCU_SFSP0_0_MODE_Msk                                  (0x07UL << SCU_SFSP0_0_MODE_Pos)                          /*!< SCU SFSP0_0: MODE Mask              */\r
+#define SCU_SFSP0_0_EPD_Pos                                   3                                                         /*!< SCU SFSP0_0: EPD Position           */\r
+#define SCU_SFSP0_0_EPD_Msk                                   (0x01UL << SCU_SFSP0_0_EPD_Pos)                           /*!< SCU SFSP0_0: EPD Mask               */\r
+#define SCU_SFSP0_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP0_0: EPUN Position          */\r
+#define SCU_SFSP0_0_EPUN_Msk                                  (0x01UL << SCU_SFSP0_0_EPUN_Pos)                          /*!< SCU SFSP0_0: EPUN Mask              */\r
+#define SCU_SFSP0_0_EHS_Pos                                   5                                                         /*!< SCU SFSP0_0: EHS Position           */\r
+#define SCU_SFSP0_0_EHS_Msk                                   (0x01UL << SCU_SFSP0_0_EHS_Pos)                           /*!< SCU SFSP0_0: EHS Mask               */\r
+#define SCU_SFSP0_0_EZI_Pos                                   6                                                         /*!< SCU SFSP0_0: EZI Position           */\r
+#define SCU_SFSP0_0_EZI_Msk                                   (0x01UL << SCU_SFSP0_0_EZI_Pos)                           /*!< SCU SFSP0_0: EZI Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP0_1  ------------------------------------------\r
+#define SCU_SFSP0_1_MODE_Pos                                  0                                                         /*!< SCU SFSP0_1: MODE Position          */\r
+#define SCU_SFSP0_1_MODE_Msk                                  (0x07UL << SCU_SFSP0_1_MODE_Pos)                          /*!< SCU SFSP0_1: MODE Mask              */\r
+#define SCU_SFSP0_1_EPD_Pos                                   3                                                         /*!< SCU SFSP0_1: EPD Position           */\r
+#define SCU_SFSP0_1_EPD_Msk                                   (0x01UL << SCU_SFSP0_1_EPD_Pos)                           /*!< SCU SFSP0_1: EPD Mask               */\r
+#define SCU_SFSP0_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP0_1: EPUN Position          */\r
+#define SCU_SFSP0_1_EPUN_Msk                                  (0x01UL << SCU_SFSP0_1_EPUN_Pos)                          /*!< SCU SFSP0_1: EPUN Mask              */\r
+#define SCU_SFSP0_1_EHS_Pos                                   5                                                         /*!< SCU SFSP0_1: EHS Position           */\r
+#define SCU_SFSP0_1_EHS_Msk                                   (0x01UL << SCU_SFSP0_1_EHS_Pos)                           /*!< SCU SFSP0_1: EHS Mask               */\r
+#define SCU_SFSP0_1_EZI_Pos                                   6                                                         /*!< SCU SFSP0_1: EZI Position           */\r
+#define SCU_SFSP0_1_EZI_Msk                                   (0x01UL << SCU_SFSP0_1_EZI_Pos)                           /*!< SCU SFSP0_1: EZI Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_0  ------------------------------------------\r
+#define SCU_SFSP1_0_MODE_Pos                                  0                                                         /*!< SCU SFSP1_0: MODE Position          */\r
+#define SCU_SFSP1_0_MODE_Msk                                  (0x07UL << SCU_SFSP1_0_MODE_Pos)                          /*!< SCU SFSP1_0: MODE Mask              */\r
+#define SCU_SFSP1_0_EPD_Pos                                   3                                                         /*!< SCU SFSP1_0: EPD Position           */\r
+#define SCU_SFSP1_0_EPD_Msk                                   (0x01UL << SCU_SFSP1_0_EPD_Pos)                           /*!< SCU SFSP1_0: EPD Mask               */\r
+#define SCU_SFSP1_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_0: EPUN Position          */\r
+#define SCU_SFSP1_0_EPUN_Msk                                  (0x01UL << SCU_SFSP1_0_EPUN_Pos)                          /*!< SCU SFSP1_0: EPUN Mask              */\r
+#define SCU_SFSP1_0_EHS_Pos                                   5                                                         /*!< SCU SFSP1_0: EHS Position           */\r
+#define SCU_SFSP1_0_EHS_Msk                                   (0x01UL << SCU_SFSP1_0_EHS_Pos)                           /*!< SCU SFSP1_0: EHS Mask               */\r
+#define SCU_SFSP1_0_EZI_Pos                                   6                                                         /*!< SCU SFSP1_0: EZI Position           */\r
+#define SCU_SFSP1_0_EZI_Msk                                   (0x01UL << SCU_SFSP1_0_EZI_Pos)                           /*!< SCU SFSP1_0: EZI Mask               */\r
+#define SCU_SFSP1_0_EHD_Pos                                   8                                                         /*!< SCU SFSP1_0: EHD Position           */\r
+#define SCU_SFSP1_0_EHD_Msk                                   (0x03UL << SCU_SFSP1_0_EHD_Pos)                           /*!< SCU SFSP1_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_1  ------------------------------------------\r
+#define SCU_SFSP1_1_MODE_Pos                                  0                                                         /*!< SCU SFSP1_1: MODE Position          */\r
+#define SCU_SFSP1_1_MODE_Msk                                  (0x07UL << SCU_SFSP1_1_MODE_Pos)                          /*!< SCU SFSP1_1: MODE Mask              */\r
+#define SCU_SFSP1_1_EPD_Pos                                   3                                                         /*!< SCU SFSP1_1: EPD Position           */\r
+#define SCU_SFSP1_1_EPD_Msk                                   (0x01UL << SCU_SFSP1_1_EPD_Pos)                           /*!< SCU SFSP1_1: EPD Mask               */\r
+#define SCU_SFSP1_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_1: EPUN Position          */\r
+#define SCU_SFSP1_1_EPUN_Msk                                  (0x01UL << SCU_SFSP1_1_EPUN_Pos)                          /*!< SCU SFSP1_1: EPUN Mask              */\r
+#define SCU_SFSP1_1_EHS_Pos                                   5                                                         /*!< SCU SFSP1_1: EHS Position           */\r
+#define SCU_SFSP1_1_EHS_Msk                                   (0x01UL << SCU_SFSP1_1_EHS_Pos)                           /*!< SCU SFSP1_1: EHS Mask               */\r
+#define SCU_SFSP1_1_EZI_Pos                                   6                                                         /*!< SCU SFSP1_1: EZI Position           */\r
+#define SCU_SFSP1_1_EZI_Msk                                   (0x01UL << SCU_SFSP1_1_EZI_Pos)                           /*!< SCU SFSP1_1: EZI Mask               */\r
+#define SCU_SFSP1_1_EHD_Pos                                   8                                                         /*!< SCU SFSP1_1: EHD Position           */\r
+#define SCU_SFSP1_1_EHD_Msk                                   (0x03UL << SCU_SFSP1_1_EHD_Pos)                           /*!< SCU SFSP1_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_2  ------------------------------------------\r
+#define SCU_SFSP1_2_MODE_Pos                                  0                                                         /*!< SCU SFSP1_2: MODE Position          */\r
+#define SCU_SFSP1_2_MODE_Msk                                  (0x07UL << SCU_SFSP1_2_MODE_Pos)                          /*!< SCU SFSP1_2: MODE Mask              */\r
+#define SCU_SFSP1_2_EPD_Pos                                   3                                                         /*!< SCU SFSP1_2: EPD Position           */\r
+#define SCU_SFSP1_2_EPD_Msk                                   (0x01UL << SCU_SFSP1_2_EPD_Pos)                           /*!< SCU SFSP1_2: EPD Mask               */\r
+#define SCU_SFSP1_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_2: EPUN Position          */\r
+#define SCU_SFSP1_2_EPUN_Msk                                  (0x01UL << SCU_SFSP1_2_EPUN_Pos)                          /*!< SCU SFSP1_2: EPUN Mask              */\r
+#define SCU_SFSP1_2_EHS_Pos                                   5                                                         /*!< SCU SFSP1_2: EHS Position           */\r
+#define SCU_SFSP1_2_EHS_Msk                                   (0x01UL << SCU_SFSP1_2_EHS_Pos)                           /*!< SCU SFSP1_2: EHS Mask               */\r
+#define SCU_SFSP1_2_EZI_Pos                                   6                                                         /*!< SCU SFSP1_2: EZI Position           */\r
+#define SCU_SFSP1_2_EZI_Msk                                   (0x01UL << SCU_SFSP1_2_EZI_Pos)                           /*!< SCU SFSP1_2: EZI Mask               */\r
+#define SCU_SFSP1_2_EHD_Pos                                   8                                                         /*!< SCU SFSP1_2: EHD Position           */\r
+#define SCU_SFSP1_2_EHD_Msk                                   (0x03UL << SCU_SFSP1_2_EHD_Pos)                           /*!< SCU SFSP1_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_3  ------------------------------------------\r
+#define SCU_SFSP1_3_MODE_Pos                                  0                                                         /*!< SCU SFSP1_3: MODE Position          */\r
+#define SCU_SFSP1_3_MODE_Msk                                  (0x07UL << SCU_SFSP1_3_MODE_Pos)                          /*!< SCU SFSP1_3: MODE Mask              */\r
+#define SCU_SFSP1_3_EPD_Pos                                   3                                                         /*!< SCU SFSP1_3: EPD Position           */\r
+#define SCU_SFSP1_3_EPD_Msk                                   (0x01UL << SCU_SFSP1_3_EPD_Pos)                           /*!< SCU SFSP1_3: EPD Mask               */\r
+#define SCU_SFSP1_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_3: EPUN Position          */\r
+#define SCU_SFSP1_3_EPUN_Msk                                  (0x01UL << SCU_SFSP1_3_EPUN_Pos)                          /*!< SCU SFSP1_3: EPUN Mask              */\r
+#define SCU_SFSP1_3_EHS_Pos                                   5                                                         /*!< SCU SFSP1_3: EHS Position           */\r
+#define SCU_SFSP1_3_EHS_Msk                                   (0x01UL << SCU_SFSP1_3_EHS_Pos)                           /*!< SCU SFSP1_3: EHS Mask               */\r
+#define SCU_SFSP1_3_EZI_Pos                                   6                                                         /*!< SCU SFSP1_3: EZI Position           */\r
+#define SCU_SFSP1_3_EZI_Msk                                   (0x01UL << SCU_SFSP1_3_EZI_Pos)                           /*!< SCU SFSP1_3: EZI Mask               */\r
+#define SCU_SFSP1_3_EHD_Pos                                   8                                                         /*!< SCU SFSP1_3: EHD Position           */\r
+#define SCU_SFSP1_3_EHD_Msk                                   (0x03UL << SCU_SFSP1_3_EHD_Pos)                           /*!< SCU SFSP1_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_4  ------------------------------------------\r
+#define SCU_SFSP1_4_MODE_Pos                                  0                                                         /*!< SCU SFSP1_4: MODE Position          */\r
+#define SCU_SFSP1_4_MODE_Msk                                  (0x07UL << SCU_SFSP1_4_MODE_Pos)                          /*!< SCU SFSP1_4: MODE Mask              */\r
+#define SCU_SFSP1_4_EPD_Pos                                   3                                                         /*!< SCU SFSP1_4: EPD Position           */\r
+#define SCU_SFSP1_4_EPD_Msk                                   (0x01UL << SCU_SFSP1_4_EPD_Pos)                           /*!< SCU SFSP1_4: EPD Mask               */\r
+#define SCU_SFSP1_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_4: EPUN Position          */\r
+#define SCU_SFSP1_4_EPUN_Msk                                  (0x01UL << SCU_SFSP1_4_EPUN_Pos)                          /*!< SCU SFSP1_4: EPUN Mask              */\r
+#define SCU_SFSP1_4_EHS_Pos                                   5                                                         /*!< SCU SFSP1_4: EHS Position           */\r
+#define SCU_SFSP1_4_EHS_Msk                                   (0x01UL << SCU_SFSP1_4_EHS_Pos)                           /*!< SCU SFSP1_4: EHS Mask               */\r
+#define SCU_SFSP1_4_EZI_Pos                                   6                                                         /*!< SCU SFSP1_4: EZI Position           */\r
+#define SCU_SFSP1_4_EZI_Msk                                   (0x01UL << SCU_SFSP1_4_EZI_Pos)                           /*!< SCU SFSP1_4: EZI Mask               */\r
+#define SCU_SFSP1_4_EHD_Pos                                   8                                                         /*!< SCU SFSP1_4: EHD Position           */\r
+#define SCU_SFSP1_4_EHD_Msk                                   (0x03UL << SCU_SFSP1_4_EHD_Pos)                           /*!< SCU SFSP1_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_5  ------------------------------------------\r
+#define SCU_SFSP1_5_MODE_Pos                                  0                                                         /*!< SCU SFSP1_5: MODE Position          */\r
+#define SCU_SFSP1_5_MODE_Msk                                  (0x07UL << SCU_SFSP1_5_MODE_Pos)                          /*!< SCU SFSP1_5: MODE Mask              */\r
+#define SCU_SFSP1_5_EPD_Pos                                   3                                                         /*!< SCU SFSP1_5: EPD Position           */\r
+#define SCU_SFSP1_5_EPD_Msk                                   (0x01UL << SCU_SFSP1_5_EPD_Pos)                           /*!< SCU SFSP1_5: EPD Mask               */\r
+#define SCU_SFSP1_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_5: EPUN Position          */\r
+#define SCU_SFSP1_5_EPUN_Msk                                  (0x01UL << SCU_SFSP1_5_EPUN_Pos)                          /*!< SCU SFSP1_5: EPUN Mask              */\r
+#define SCU_SFSP1_5_EHS_Pos                                   5                                                         /*!< SCU SFSP1_5: EHS Position           */\r
+#define SCU_SFSP1_5_EHS_Msk                                   (0x01UL << SCU_SFSP1_5_EHS_Pos)                           /*!< SCU SFSP1_5: EHS Mask               */\r
+#define SCU_SFSP1_5_EZI_Pos                                   6                                                         /*!< SCU SFSP1_5: EZI Position           */\r
+#define SCU_SFSP1_5_EZI_Msk                                   (0x01UL << SCU_SFSP1_5_EZI_Pos)                           /*!< SCU SFSP1_5: EZI Mask               */\r
+#define SCU_SFSP1_5_EHD_Pos                                   8                                                         /*!< SCU SFSP1_5: EHD Position           */\r
+#define SCU_SFSP1_5_EHD_Msk                                   (0x03UL << SCU_SFSP1_5_EHD_Pos)                           /*!< SCU SFSP1_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_6  ------------------------------------------\r
+#define SCU_SFSP1_6_MODE_Pos                                  0                                                         /*!< SCU SFSP1_6: MODE Position          */\r
+#define SCU_SFSP1_6_MODE_Msk                                  (0x07UL << SCU_SFSP1_6_MODE_Pos)                          /*!< SCU SFSP1_6: MODE Mask              */\r
+#define SCU_SFSP1_6_EPD_Pos                                   3                                                         /*!< SCU SFSP1_6: EPD Position           */\r
+#define SCU_SFSP1_6_EPD_Msk                                   (0x01UL << SCU_SFSP1_6_EPD_Pos)                           /*!< SCU SFSP1_6: EPD Mask               */\r
+#define SCU_SFSP1_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_6: EPUN Position          */\r
+#define SCU_SFSP1_6_EPUN_Msk                                  (0x01UL << SCU_SFSP1_6_EPUN_Pos)                          /*!< SCU SFSP1_6: EPUN Mask              */\r
+#define SCU_SFSP1_6_EHS_Pos                                   5                                                         /*!< SCU SFSP1_6: EHS Position           */\r
+#define SCU_SFSP1_6_EHS_Msk                                   (0x01UL << SCU_SFSP1_6_EHS_Pos)                           /*!< SCU SFSP1_6: EHS Mask               */\r
+#define SCU_SFSP1_6_EZI_Pos                                   6                                                         /*!< SCU SFSP1_6: EZI Position           */\r
+#define SCU_SFSP1_6_EZI_Msk                                   (0x01UL << SCU_SFSP1_6_EZI_Pos)                           /*!< SCU SFSP1_6: EZI Mask               */\r
+#define SCU_SFSP1_6_EHD_Pos                                   8                                                         /*!< SCU SFSP1_6: EHD Position           */\r
+#define SCU_SFSP1_6_EHD_Msk                                   (0x03UL << SCU_SFSP1_6_EHD_Pos)                           /*!< SCU SFSP1_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_7  ------------------------------------------\r
+#define SCU_SFSP1_7_MODE_Pos                                  0                                                         /*!< SCU SFSP1_7: MODE Position          */\r
+#define SCU_SFSP1_7_MODE_Msk                                  (0x07UL << SCU_SFSP1_7_MODE_Pos)                          /*!< SCU SFSP1_7: MODE Mask              */\r
+#define SCU_SFSP1_7_EPD_Pos                                   3                                                         /*!< SCU SFSP1_7: EPD Position           */\r
+#define SCU_SFSP1_7_EPD_Msk                                   (0x01UL << SCU_SFSP1_7_EPD_Pos)                           /*!< SCU SFSP1_7: EPD Mask               */\r
+#define SCU_SFSP1_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_7: EPUN Position          */\r
+#define SCU_SFSP1_7_EPUN_Msk                                  (0x01UL << SCU_SFSP1_7_EPUN_Pos)                          /*!< SCU SFSP1_7: EPUN Mask              */\r
+#define SCU_SFSP1_7_EHS_Pos                                   5                                                         /*!< SCU SFSP1_7: EHS Position           */\r
+#define SCU_SFSP1_7_EHS_Msk                                   (0x01UL << SCU_SFSP1_7_EHS_Pos)                           /*!< SCU SFSP1_7: EHS Mask               */\r
+#define SCU_SFSP1_7_EZI_Pos                                   6                                                         /*!< SCU SFSP1_7: EZI Position           */\r
+#define SCU_SFSP1_7_EZI_Msk                                   (0x01UL << SCU_SFSP1_7_EZI_Pos)                           /*!< SCU SFSP1_7: EZI Mask               */\r
+#define SCU_SFSP1_7_EHD_Pos                                   8                                                         /*!< SCU SFSP1_7: EHD Position           */\r
+#define SCU_SFSP1_7_EHD_Msk                                   (0x03UL << SCU_SFSP1_7_EHD_Pos)                           /*!< SCU SFSP1_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_8  ------------------------------------------\r
+#define SCU_SFSP1_8_MODE_Pos                                  0                                                         /*!< SCU SFSP1_8: MODE Position          */\r
+#define SCU_SFSP1_8_MODE_Msk                                  (0x07UL << SCU_SFSP1_8_MODE_Pos)                          /*!< SCU SFSP1_8: MODE Mask              */\r
+#define SCU_SFSP1_8_EPD_Pos                                   3                                                         /*!< SCU SFSP1_8: EPD Position           */\r
+#define SCU_SFSP1_8_EPD_Msk                                   (0x01UL << SCU_SFSP1_8_EPD_Pos)                           /*!< SCU SFSP1_8: EPD Mask               */\r
+#define SCU_SFSP1_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_8: EPUN Position          */\r
+#define SCU_SFSP1_8_EPUN_Msk                                  (0x01UL << SCU_SFSP1_8_EPUN_Pos)                          /*!< SCU SFSP1_8: EPUN Mask              */\r
+#define SCU_SFSP1_8_EHS_Pos                                   5                                                         /*!< SCU SFSP1_8: EHS Position           */\r
+#define SCU_SFSP1_8_EHS_Msk                                   (0x01UL << SCU_SFSP1_8_EHS_Pos)                           /*!< SCU SFSP1_8: EHS Mask               */\r
+#define SCU_SFSP1_8_EZI_Pos                                   6                                                         /*!< SCU SFSP1_8: EZI Position           */\r
+#define SCU_SFSP1_8_EZI_Msk                                   (0x01UL << SCU_SFSP1_8_EZI_Pos)                           /*!< SCU SFSP1_8: EZI Mask               */\r
+#define SCU_SFSP1_8_EHD_Pos                                   8                                                         /*!< SCU SFSP1_8: EHD Position           */\r
+#define SCU_SFSP1_8_EHD_Msk                                   (0x03UL << SCU_SFSP1_8_EHD_Pos)                           /*!< SCU SFSP1_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP1_9  ------------------------------------------\r
+#define SCU_SFSP1_9_MODE_Pos                                  0                                                         /*!< SCU SFSP1_9: MODE Position          */\r
+#define SCU_SFSP1_9_MODE_Msk                                  (0x07UL << SCU_SFSP1_9_MODE_Pos)                          /*!< SCU SFSP1_9: MODE Mask              */\r
+#define SCU_SFSP1_9_EPD_Pos                                   3                                                         /*!< SCU SFSP1_9: EPD Position           */\r
+#define SCU_SFSP1_9_EPD_Msk                                   (0x01UL << SCU_SFSP1_9_EPD_Pos)                           /*!< SCU SFSP1_9: EPD Mask               */\r
+#define SCU_SFSP1_9_EPUN_Pos                                  4                                                         /*!< SCU SFSP1_9: EPUN Position          */\r
+#define SCU_SFSP1_9_EPUN_Msk                                  (0x01UL << SCU_SFSP1_9_EPUN_Pos)                          /*!< SCU SFSP1_9: EPUN Mask              */\r
+#define SCU_SFSP1_9_EHS_Pos                                   5                                                         /*!< SCU SFSP1_9: EHS Position           */\r
+#define SCU_SFSP1_9_EHS_Msk                                   (0x01UL << SCU_SFSP1_9_EHS_Pos)                           /*!< SCU SFSP1_9: EHS Mask               */\r
+#define SCU_SFSP1_9_EZI_Pos                                   6                                                         /*!< SCU SFSP1_9: EZI Position           */\r
+#define SCU_SFSP1_9_EZI_Msk                                   (0x01UL << SCU_SFSP1_9_EZI_Pos)                           /*!< SCU SFSP1_9: EZI Mask               */\r
+#define SCU_SFSP1_9_EHD_Pos                                   8                                                         /*!< SCU SFSP1_9: EHD Position           */\r
+#define SCU_SFSP1_9_EHD_Msk                                   (0x03UL << SCU_SFSP1_9_EHD_Pos)                           /*!< SCU SFSP1_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSP1_10  ------------------------------------------\r
+#define SCU_SFSP1_10_MODE_Pos                                 0                                                         /*!< SCU SFSP1_10: MODE Position         */\r
+#define SCU_SFSP1_10_MODE_Msk                                 (0x07UL << SCU_SFSP1_10_MODE_Pos)                         /*!< SCU SFSP1_10: MODE Mask             */\r
+#define SCU_SFSP1_10_EPD_Pos                                  3                                                         /*!< SCU SFSP1_10: EPD Position          */\r
+#define SCU_SFSP1_10_EPD_Msk                                  (0x01UL << SCU_SFSP1_10_EPD_Pos)                          /*!< SCU SFSP1_10: EPD Mask              */\r
+#define SCU_SFSP1_10_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_10: EPUN Position         */\r
+#define SCU_SFSP1_10_EPUN_Msk                                 (0x01UL << SCU_SFSP1_10_EPUN_Pos)                         /*!< SCU SFSP1_10: EPUN Mask             */\r
+#define SCU_SFSP1_10_EHS_Pos                                  5                                                         /*!< SCU SFSP1_10: EHS Position          */\r
+#define SCU_SFSP1_10_EHS_Msk                                  (0x01UL << SCU_SFSP1_10_EHS_Pos)                          /*!< SCU SFSP1_10: EHS Mask              */\r
+#define SCU_SFSP1_10_EZI_Pos                                  6                                                         /*!< SCU SFSP1_10: EZI Position          */\r
+#define SCU_SFSP1_10_EZI_Msk                                  (0x01UL << SCU_SFSP1_10_EZI_Pos)                          /*!< SCU SFSP1_10: EZI Mask              */\r
+#define SCU_SFSP1_10_EHD_Pos                                  8                                                         /*!< SCU SFSP1_10: EHD Position          */\r
+#define SCU_SFSP1_10_EHD_Msk                                  (0x03UL << SCU_SFSP1_10_EHD_Pos)                          /*!< SCU SFSP1_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_11  ------------------------------------------\r
+#define SCU_SFSP1_11_MODE_Pos                                 0                                                         /*!< SCU SFSP1_11: MODE Position         */\r
+#define SCU_SFSP1_11_MODE_Msk                                 (0x07UL << SCU_SFSP1_11_MODE_Pos)                         /*!< SCU SFSP1_11: MODE Mask             */\r
+#define SCU_SFSP1_11_EPD_Pos                                  3                                                         /*!< SCU SFSP1_11: EPD Position          */\r
+#define SCU_SFSP1_11_EPD_Msk                                  (0x01UL << SCU_SFSP1_11_EPD_Pos)                          /*!< SCU SFSP1_11: EPD Mask              */\r
+#define SCU_SFSP1_11_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_11: EPUN Position         */\r
+#define SCU_SFSP1_11_EPUN_Msk                                 (0x01UL << SCU_SFSP1_11_EPUN_Pos)                         /*!< SCU SFSP1_11: EPUN Mask             */\r
+#define SCU_SFSP1_11_EHS_Pos                                  5                                                         /*!< SCU SFSP1_11: EHS Position          */\r
+#define SCU_SFSP1_11_EHS_Msk                                  (0x01UL << SCU_SFSP1_11_EHS_Pos)                          /*!< SCU SFSP1_11: EHS Mask              */\r
+#define SCU_SFSP1_11_EZI_Pos                                  6                                                         /*!< SCU SFSP1_11: EZI Position          */\r
+#define SCU_SFSP1_11_EZI_Msk                                  (0x01UL << SCU_SFSP1_11_EZI_Pos)                          /*!< SCU SFSP1_11: EZI Mask              */\r
+#define SCU_SFSP1_11_EHD_Pos                                  8                                                         /*!< SCU SFSP1_11: EHD Position          */\r
+#define SCU_SFSP1_11_EHD_Msk                                  (0x03UL << SCU_SFSP1_11_EHD_Pos)                          /*!< SCU SFSP1_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_12  ------------------------------------------\r
+#define SCU_SFSP1_12_MODE_Pos                                 0                                                         /*!< SCU SFSP1_12: MODE Position         */\r
+#define SCU_SFSP1_12_MODE_Msk                                 (0x07UL << SCU_SFSP1_12_MODE_Pos)                         /*!< SCU SFSP1_12: MODE Mask             */\r
+#define SCU_SFSP1_12_EPD_Pos                                  3                                                         /*!< SCU SFSP1_12: EPD Position          */\r
+#define SCU_SFSP1_12_EPD_Msk                                  (0x01UL << SCU_SFSP1_12_EPD_Pos)                          /*!< SCU SFSP1_12: EPD Mask              */\r
+#define SCU_SFSP1_12_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_12: EPUN Position         */\r
+#define SCU_SFSP1_12_EPUN_Msk                                 (0x01UL << SCU_SFSP1_12_EPUN_Pos)                         /*!< SCU SFSP1_12: EPUN Mask             */\r
+#define SCU_SFSP1_12_EHS_Pos                                  5                                                         /*!< SCU SFSP1_12: EHS Position          */\r
+#define SCU_SFSP1_12_EHS_Msk                                  (0x01UL << SCU_SFSP1_12_EHS_Pos)                          /*!< SCU SFSP1_12: EHS Mask              */\r
+#define SCU_SFSP1_12_EZI_Pos                                  6                                                         /*!< SCU SFSP1_12: EZI Position          */\r
+#define SCU_SFSP1_12_EZI_Msk                                  (0x01UL << SCU_SFSP1_12_EZI_Pos)                          /*!< SCU SFSP1_12: EZI Mask              */\r
+#define SCU_SFSP1_12_EHD_Pos                                  8                                                         /*!< SCU SFSP1_12: EHD Position          */\r
+#define SCU_SFSP1_12_EHD_Msk                                  (0x03UL << SCU_SFSP1_12_EHD_Pos)                          /*!< SCU SFSP1_12: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_13  ------------------------------------------\r
+#define SCU_SFSP1_13_MODE_Pos                                 0                                                         /*!< SCU SFSP1_13: MODE Position         */\r
+#define SCU_SFSP1_13_MODE_Msk                                 (0x07UL << SCU_SFSP1_13_MODE_Pos)                         /*!< SCU SFSP1_13: MODE Mask             */\r
+#define SCU_SFSP1_13_EPD_Pos                                  3                                                         /*!< SCU SFSP1_13: EPD Position          */\r
+#define SCU_SFSP1_13_EPD_Msk                                  (0x01UL << SCU_SFSP1_13_EPD_Pos)                          /*!< SCU SFSP1_13: EPD Mask              */\r
+#define SCU_SFSP1_13_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_13: EPUN Position         */\r
+#define SCU_SFSP1_13_EPUN_Msk                                 (0x01UL << SCU_SFSP1_13_EPUN_Pos)                         /*!< SCU SFSP1_13: EPUN Mask             */\r
+#define SCU_SFSP1_13_EHS_Pos                                  5                                                         /*!< SCU SFSP1_13: EHS Position          */\r
+#define SCU_SFSP1_13_EHS_Msk                                  (0x01UL << SCU_SFSP1_13_EHS_Pos)                          /*!< SCU SFSP1_13: EHS Mask              */\r
+#define SCU_SFSP1_13_EZI_Pos                                  6                                                         /*!< SCU SFSP1_13: EZI Position          */\r
+#define SCU_SFSP1_13_EZI_Msk                                  (0x01UL << SCU_SFSP1_13_EZI_Pos)                          /*!< SCU SFSP1_13: EZI Mask              */\r
+#define SCU_SFSP1_13_EHD_Pos                                  8                                                         /*!< SCU SFSP1_13: EHD Position          */\r
+#define SCU_SFSP1_13_EHD_Msk                                  (0x03UL << SCU_SFSP1_13_EHD_Pos)                          /*!< SCU SFSP1_13: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_14  ------------------------------------------\r
+#define SCU_SFSP1_14_MODE_Pos                                 0                                                         /*!< SCU SFSP1_14: MODE Position         */\r
+#define SCU_SFSP1_14_MODE_Msk                                 (0x07UL << SCU_SFSP1_14_MODE_Pos)                         /*!< SCU SFSP1_14: MODE Mask             */\r
+#define SCU_SFSP1_14_EPD_Pos                                  3                                                         /*!< SCU SFSP1_14: EPD Position          */\r
+#define SCU_SFSP1_14_EPD_Msk                                  (0x01UL << SCU_SFSP1_14_EPD_Pos)                          /*!< SCU SFSP1_14: EPD Mask              */\r
+#define SCU_SFSP1_14_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_14: EPUN Position         */\r
+#define SCU_SFSP1_14_EPUN_Msk                                 (0x01UL << SCU_SFSP1_14_EPUN_Pos)                         /*!< SCU SFSP1_14: EPUN Mask             */\r
+#define SCU_SFSP1_14_EHS_Pos                                  5                                                         /*!< SCU SFSP1_14: EHS Position          */\r
+#define SCU_SFSP1_14_EHS_Msk                                  (0x01UL << SCU_SFSP1_14_EHS_Pos)                          /*!< SCU SFSP1_14: EHS Mask              */\r
+#define SCU_SFSP1_14_EZI_Pos                                  6                                                         /*!< SCU SFSP1_14: EZI Position          */\r
+#define SCU_SFSP1_14_EZI_Msk                                  (0x01UL << SCU_SFSP1_14_EZI_Pos)                          /*!< SCU SFSP1_14: EZI Mask              */\r
+#define SCU_SFSP1_14_EHD_Pos                                  8                                                         /*!< SCU SFSP1_14: EHD Position          */\r
+#define SCU_SFSP1_14_EHD_Msk                                  (0x03UL << SCU_SFSP1_14_EHD_Pos)                          /*!< SCU SFSP1_14: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_15  ------------------------------------------\r
+#define SCU_SFSP1_15_MODE_Pos                                 0                                                         /*!< SCU SFSP1_15: MODE Position         */\r
+#define SCU_SFSP1_15_MODE_Msk                                 (0x07UL << SCU_SFSP1_15_MODE_Pos)                         /*!< SCU SFSP1_15: MODE Mask             */\r
+#define SCU_SFSP1_15_EPD_Pos                                  3                                                         /*!< SCU SFSP1_15: EPD Position          */\r
+#define SCU_SFSP1_15_EPD_Msk                                  (0x01UL << SCU_SFSP1_15_EPD_Pos)                          /*!< SCU SFSP1_15: EPD Mask              */\r
+#define SCU_SFSP1_15_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_15: EPUN Position         */\r
+#define SCU_SFSP1_15_EPUN_Msk                                 (0x01UL << SCU_SFSP1_15_EPUN_Pos)                         /*!< SCU SFSP1_15: EPUN Mask             */\r
+#define SCU_SFSP1_15_EHS_Pos                                  5                                                         /*!< SCU SFSP1_15: EHS Position          */\r
+#define SCU_SFSP1_15_EHS_Msk                                  (0x01UL << SCU_SFSP1_15_EHS_Pos)                          /*!< SCU SFSP1_15: EHS Mask              */\r
+#define SCU_SFSP1_15_EZI_Pos                                  6                                                         /*!< SCU SFSP1_15: EZI Position          */\r
+#define SCU_SFSP1_15_EZI_Msk                                  (0x01UL << SCU_SFSP1_15_EZI_Pos)                          /*!< SCU SFSP1_15: EZI Mask              */\r
+#define SCU_SFSP1_15_EHD_Pos                                  8                                                         /*!< SCU SFSP1_15: EHD Position          */\r
+#define SCU_SFSP1_15_EHD_Msk                                  (0x03UL << SCU_SFSP1_15_EHD_Pos)                          /*!< SCU SFSP1_15: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_16  ------------------------------------------\r
+#define SCU_SFSP1_16_MODE_Pos                                 0                                                         /*!< SCU SFSP1_16: MODE Position         */\r
+#define SCU_SFSP1_16_MODE_Msk                                 (0x07UL << SCU_SFSP1_16_MODE_Pos)                         /*!< SCU SFSP1_16: MODE Mask             */\r
+#define SCU_SFSP1_16_EPD_Pos                                  3                                                         /*!< SCU SFSP1_16: EPD Position          */\r
+#define SCU_SFSP1_16_EPD_Msk                                  (0x01UL << SCU_SFSP1_16_EPD_Pos)                          /*!< SCU SFSP1_16: EPD Mask              */\r
+#define SCU_SFSP1_16_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_16: EPUN Position         */\r
+#define SCU_SFSP1_16_EPUN_Msk                                 (0x01UL << SCU_SFSP1_16_EPUN_Pos)                         /*!< SCU SFSP1_16: EPUN Mask             */\r
+#define SCU_SFSP1_16_EHS_Pos                                  5                                                         /*!< SCU SFSP1_16: EHS Position          */\r
+#define SCU_SFSP1_16_EHS_Msk                                  (0x01UL << SCU_SFSP1_16_EHS_Pos)                          /*!< SCU SFSP1_16: EHS Mask              */\r
+#define SCU_SFSP1_16_EZI_Pos                                  6                                                         /*!< SCU SFSP1_16: EZI Position          */\r
+#define SCU_SFSP1_16_EZI_Msk                                  (0x01UL << SCU_SFSP1_16_EZI_Pos)                          /*!< SCU SFSP1_16: EZI Mask              */\r
+#define SCU_SFSP1_16_EHD_Pos                                  8                                                         /*!< SCU SFSP1_16: EHD Position          */\r
+#define SCU_SFSP1_16_EHD_Msk                                  (0x03UL << SCU_SFSP1_16_EHD_Pos)                          /*!< SCU SFSP1_16: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_17  ------------------------------------------\r
+#define SCU_SFSP1_17_MODE_Pos                                 0                                                         /*!< SCU SFSP1_17: MODE Position         */\r
+#define SCU_SFSP1_17_MODE_Msk                                 (0x07UL << SCU_SFSP1_17_MODE_Pos)                         /*!< SCU SFSP1_17: MODE Mask             */\r
+#define SCU_SFSP1_17_EPD_Pos                                  3                                                         /*!< SCU SFSP1_17: EPD Position          */\r
+#define SCU_SFSP1_17_EPD_Msk                                  (0x01UL << SCU_SFSP1_17_EPD_Pos)                          /*!< SCU SFSP1_17: EPD Mask              */\r
+#define SCU_SFSP1_17_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_17: EPUN Position         */\r
+#define SCU_SFSP1_17_EPUN_Msk                                 (0x01UL << SCU_SFSP1_17_EPUN_Pos)                         /*!< SCU SFSP1_17: EPUN Mask             */\r
+#define SCU_SFSP1_17_EHS_Pos                                  5                                                         /*!< SCU SFSP1_17: EHS Position          */\r
+#define SCU_SFSP1_17_EHS_Msk                                  (0x01UL << SCU_SFSP1_17_EHS_Pos)                          /*!< SCU SFSP1_17: EHS Mask              */\r
+#define SCU_SFSP1_17_EZI_Pos                                  6                                                         /*!< SCU SFSP1_17: EZI Position          */\r
+#define SCU_SFSP1_17_EZI_Msk                                  (0x01UL << SCU_SFSP1_17_EZI_Pos)                          /*!< SCU SFSP1_17: EZI Mask              */\r
+#define SCU_SFSP1_17_EHD_Pos                                  8                                                         /*!< SCU SFSP1_17: EHD Position          */\r
+#define SCU_SFSP1_17_EHD_Msk                                  (0x03UL << SCU_SFSP1_17_EHD_Pos)                          /*!< SCU SFSP1_17: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_18  ------------------------------------------\r
+#define SCU_SFSP1_18_MODE_Pos                                 0                                                         /*!< SCU SFSP1_18: MODE Position         */\r
+#define SCU_SFSP1_18_MODE_Msk                                 (0x07UL << SCU_SFSP1_18_MODE_Pos)                         /*!< SCU SFSP1_18: MODE Mask             */\r
+#define SCU_SFSP1_18_EPD_Pos                                  3                                                         /*!< SCU SFSP1_18: EPD Position          */\r
+#define SCU_SFSP1_18_EPD_Msk                                  (0x01UL << SCU_SFSP1_18_EPD_Pos)                          /*!< SCU SFSP1_18: EPD Mask              */\r
+#define SCU_SFSP1_18_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_18: EPUN Position         */\r
+#define SCU_SFSP1_18_EPUN_Msk                                 (0x01UL << SCU_SFSP1_18_EPUN_Pos)                         /*!< SCU SFSP1_18: EPUN Mask             */\r
+#define SCU_SFSP1_18_EHS_Pos                                  5                                                         /*!< SCU SFSP1_18: EHS Position          */\r
+#define SCU_SFSP1_18_EHS_Msk                                  (0x01UL << SCU_SFSP1_18_EHS_Pos)                          /*!< SCU SFSP1_18: EHS Mask              */\r
+#define SCU_SFSP1_18_EZI_Pos                                  6                                                         /*!< SCU SFSP1_18: EZI Position          */\r
+#define SCU_SFSP1_18_EZI_Msk                                  (0x01UL << SCU_SFSP1_18_EZI_Pos)                          /*!< SCU SFSP1_18: EZI Mask              */\r
+#define SCU_SFSP1_18_EHD_Pos                                  8                                                         /*!< SCU SFSP1_18: EHD Position          */\r
+#define SCU_SFSP1_18_EHD_Msk                                  (0x03UL << SCU_SFSP1_18_EHD_Pos)                          /*!< SCU SFSP1_18: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_19  ------------------------------------------\r
+#define SCU_SFSP1_19_MODE_Pos                                 0                                                         /*!< SCU SFSP1_19: MODE Position         */\r
+#define SCU_SFSP1_19_MODE_Msk                                 (0x07UL << SCU_SFSP1_19_MODE_Pos)                         /*!< SCU SFSP1_19: MODE Mask             */\r
+#define SCU_SFSP1_19_EPD_Pos                                  3                                                         /*!< SCU SFSP1_19: EPD Position          */\r
+#define SCU_SFSP1_19_EPD_Msk                                  (0x01UL << SCU_SFSP1_19_EPD_Pos)                          /*!< SCU SFSP1_19: EPD Mask              */\r
+#define SCU_SFSP1_19_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_19: EPUN Position         */\r
+#define SCU_SFSP1_19_EPUN_Msk                                 (0x01UL << SCU_SFSP1_19_EPUN_Pos)                         /*!< SCU SFSP1_19: EPUN Mask             */\r
+#define SCU_SFSP1_19_EHS_Pos                                  5                                                         /*!< SCU SFSP1_19: EHS Position          */\r
+#define SCU_SFSP1_19_EHS_Msk                                  (0x01UL << SCU_SFSP1_19_EHS_Pos)                          /*!< SCU SFSP1_19: EHS Mask              */\r
+#define SCU_SFSP1_19_EZI_Pos                                  6                                                         /*!< SCU SFSP1_19: EZI Position          */\r
+#define SCU_SFSP1_19_EZI_Msk                                  (0x01UL << SCU_SFSP1_19_EZI_Pos)                          /*!< SCU SFSP1_19: EZI Mask              */\r
+#define SCU_SFSP1_19_EHD_Pos                                  8                                                         /*!< SCU SFSP1_19: EHD Position          */\r
+#define SCU_SFSP1_19_EHD_Msk                                  (0x03UL << SCU_SFSP1_19_EHD_Pos)                          /*!< SCU SFSP1_19: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP1_20  ------------------------------------------\r
+#define SCU_SFSP1_20_MODE_Pos                                 0                                                         /*!< SCU SFSP1_20: MODE Position         */\r
+#define SCU_SFSP1_20_MODE_Msk                                 (0x07UL << SCU_SFSP1_20_MODE_Pos)                         /*!< SCU SFSP1_20: MODE Mask             */\r
+#define SCU_SFSP1_20_EPD_Pos                                  3                                                         /*!< SCU SFSP1_20: EPD Position          */\r
+#define SCU_SFSP1_20_EPD_Msk                                  (0x01UL << SCU_SFSP1_20_EPD_Pos)                          /*!< SCU SFSP1_20: EPD Mask              */\r
+#define SCU_SFSP1_20_EPUN_Pos                                 4                                                         /*!< SCU SFSP1_20: EPUN Position         */\r
+#define SCU_SFSP1_20_EPUN_Msk                                 (0x01UL << SCU_SFSP1_20_EPUN_Pos)                         /*!< SCU SFSP1_20: EPUN Mask             */\r
+#define SCU_SFSP1_20_EHS_Pos                                  5                                                         /*!< SCU SFSP1_20: EHS Position          */\r
+#define SCU_SFSP1_20_EHS_Msk                                  (0x01UL << SCU_SFSP1_20_EHS_Pos)                          /*!< SCU SFSP1_20: EHS Mask              */\r
+#define SCU_SFSP1_20_EZI_Pos                                  6                                                         /*!< SCU SFSP1_20: EZI Position          */\r
+#define SCU_SFSP1_20_EZI_Msk                                  (0x01UL << SCU_SFSP1_20_EZI_Pos)                          /*!< SCU SFSP1_20: EZI Mask              */\r
+#define SCU_SFSP1_20_EHD_Pos                                  8                                                         /*!< SCU SFSP1_20: EHD Position          */\r
+#define SCU_SFSP1_20_EHD_Msk                                  (0x03UL << SCU_SFSP1_20_EHD_Pos)                          /*!< SCU SFSP1_20: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSP2_0  ------------------------------------------\r
+#define SCU_SFSP2_0_MODE_Pos                                  0                                                         /*!< SCU SFSP2_0: MODE Position          */\r
+#define SCU_SFSP2_0_MODE_Msk                                  (0x07UL << SCU_SFSP2_0_MODE_Pos)                          /*!< SCU SFSP2_0: MODE Mask              */\r
+#define SCU_SFSP2_0_EPD_Pos                                   3                                                         /*!< SCU SFSP2_0: EPD Position           */\r
+#define SCU_SFSP2_0_EPD_Msk                                   (0x01UL << SCU_SFSP2_0_EPD_Pos)                           /*!< SCU SFSP2_0: EPD Mask               */\r
+#define SCU_SFSP2_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_0: EPUN Position          */\r
+#define SCU_SFSP2_0_EPUN_Msk                                  (0x01UL << SCU_SFSP2_0_EPUN_Pos)                          /*!< SCU SFSP2_0: EPUN Mask              */\r
+#define SCU_SFSP2_0_EHS_Pos                                   5                                                         /*!< SCU SFSP2_0: EHS Position           */\r
+#define SCU_SFSP2_0_EHS_Msk                                   (0x01UL << SCU_SFSP2_0_EHS_Pos)                           /*!< SCU SFSP2_0: EHS Mask               */\r
+#define SCU_SFSP2_0_EZI_Pos                                   6                                                         /*!< SCU SFSP2_0: EZI Position           */\r
+#define SCU_SFSP2_0_EZI_Msk                                   (0x01UL << SCU_SFSP2_0_EZI_Pos)                           /*!< SCU SFSP2_0: EZI Mask               */\r
+#define SCU_SFSP2_0_EHD_Pos                                   8                                                         /*!< SCU SFSP2_0: EHD Position           */\r
+#define SCU_SFSP2_0_EHD_Msk                                   (0x03UL << SCU_SFSP2_0_EHD_Pos)                           /*!< SCU SFSP2_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_1  ------------------------------------------\r
+#define SCU_SFSP2_1_MODE_Pos                                  0                                                         /*!< SCU SFSP2_1: MODE Position          */\r
+#define SCU_SFSP2_1_MODE_Msk                                  (0x07UL << SCU_SFSP2_1_MODE_Pos)                          /*!< SCU SFSP2_1: MODE Mask              */\r
+#define SCU_SFSP2_1_EPD_Pos                                   3                                                         /*!< SCU SFSP2_1: EPD Position           */\r
+#define SCU_SFSP2_1_EPD_Msk                                   (0x01UL << SCU_SFSP2_1_EPD_Pos)                           /*!< SCU SFSP2_1: EPD Mask               */\r
+#define SCU_SFSP2_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_1: EPUN Position          */\r
+#define SCU_SFSP2_1_EPUN_Msk                                  (0x01UL << SCU_SFSP2_1_EPUN_Pos)                          /*!< SCU SFSP2_1: EPUN Mask              */\r
+#define SCU_SFSP2_1_EHS_Pos                                   5                                                         /*!< SCU SFSP2_1: EHS Position           */\r
+#define SCU_SFSP2_1_EHS_Msk                                   (0x01UL << SCU_SFSP2_1_EHS_Pos)                           /*!< SCU SFSP2_1: EHS Mask               */\r
+#define SCU_SFSP2_1_EZI_Pos                                   6                                                         /*!< SCU SFSP2_1: EZI Position           */\r
+#define SCU_SFSP2_1_EZI_Msk                                   (0x01UL << SCU_SFSP2_1_EZI_Pos)                           /*!< SCU SFSP2_1: EZI Mask               */\r
+#define SCU_SFSP2_1_EHD_Pos                                   8                                                         /*!< SCU SFSP2_1: EHD Position           */\r
+#define SCU_SFSP2_1_EHD_Msk                                   (0x03UL << SCU_SFSP2_1_EHD_Pos)                           /*!< SCU SFSP2_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_2  ------------------------------------------\r
+#define SCU_SFSP2_2_MODE_Pos                                  0                                                         /*!< SCU SFSP2_2: MODE Position          */\r
+#define SCU_SFSP2_2_MODE_Msk                                  (0x07UL << SCU_SFSP2_2_MODE_Pos)                          /*!< SCU SFSP2_2: MODE Mask              */\r
+#define SCU_SFSP2_2_EPD_Pos                                   3                                                         /*!< SCU SFSP2_2: EPD Position           */\r
+#define SCU_SFSP2_2_EPD_Msk                                   (0x01UL << SCU_SFSP2_2_EPD_Pos)                           /*!< SCU SFSP2_2: EPD Mask               */\r
+#define SCU_SFSP2_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_2: EPUN Position          */\r
+#define SCU_SFSP2_2_EPUN_Msk                                  (0x01UL << SCU_SFSP2_2_EPUN_Pos)                          /*!< SCU SFSP2_2: EPUN Mask              */\r
+#define SCU_SFSP2_2_EHS_Pos                                   5                                                         /*!< SCU SFSP2_2: EHS Position           */\r
+#define SCU_SFSP2_2_EHS_Msk                                   (0x01UL << SCU_SFSP2_2_EHS_Pos)                           /*!< SCU SFSP2_2: EHS Mask               */\r
+#define SCU_SFSP2_2_EZI_Pos                                   6                                                         /*!< SCU SFSP2_2: EZI Position           */\r
+#define SCU_SFSP2_2_EZI_Msk                                   (0x01UL << SCU_SFSP2_2_EZI_Pos)                           /*!< SCU SFSP2_2: EZI Mask               */\r
+#define SCU_SFSP2_2_EHD_Pos                                   8                                                         /*!< SCU SFSP2_2: EHD Position           */\r
+#define SCU_SFSP2_2_EHD_Msk                                   (0x03UL << SCU_SFSP2_2_EHD_Pos)                           /*!< SCU SFSP2_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_3  ------------------------------------------\r
+#define SCU_SFSP2_3_MODE_Pos                                  0                                                         /*!< SCU SFSP2_3: MODE Position          */\r
+#define SCU_SFSP2_3_MODE_Msk                                  (0x07UL << SCU_SFSP2_3_MODE_Pos)                          /*!< SCU SFSP2_3: MODE Mask              */\r
+#define SCU_SFSP2_3_EPD_Pos                                   3                                                         /*!< SCU SFSP2_3: EPD Position           */\r
+#define SCU_SFSP2_3_EPD_Msk                                   (0x01UL << SCU_SFSP2_3_EPD_Pos)                           /*!< SCU SFSP2_3: EPD Mask               */\r
+#define SCU_SFSP2_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_3: EPUN Position          */\r
+#define SCU_SFSP2_3_EPUN_Msk                                  (0x01UL << SCU_SFSP2_3_EPUN_Pos)                          /*!< SCU SFSP2_3: EPUN Mask              */\r
+#define SCU_SFSP2_3_EHS_Pos                                   5                                                         /*!< SCU SFSP2_3: EHS Position           */\r
+#define SCU_SFSP2_3_EHS_Msk                                   (0x01UL << SCU_SFSP2_3_EHS_Pos)                           /*!< SCU SFSP2_3: EHS Mask               */\r
+#define SCU_SFSP2_3_EZI_Pos                                   6                                                         /*!< SCU SFSP2_3: EZI Position           */\r
+#define SCU_SFSP2_3_EZI_Msk                                   (0x01UL << SCU_SFSP2_3_EZI_Pos)                           /*!< SCU SFSP2_3: EZI Mask               */\r
+#define SCU_SFSP2_3_EHD_Pos                                   8                                                         /*!< SCU SFSP2_3: EHD Position           */\r
+#define SCU_SFSP2_3_EHD_Msk                                   (0x03UL << SCU_SFSP2_3_EHD_Pos)                           /*!< SCU SFSP2_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_4  ------------------------------------------\r
+#define SCU_SFSP2_4_MODE_Pos                                  0                                                         /*!< SCU SFSP2_4: MODE Position          */\r
+#define SCU_SFSP2_4_MODE_Msk                                  (0x07UL << SCU_SFSP2_4_MODE_Pos)                          /*!< SCU SFSP2_4: MODE Mask              */\r
+#define SCU_SFSP2_4_EPD_Pos                                   3                                                         /*!< SCU SFSP2_4: EPD Position           */\r
+#define SCU_SFSP2_4_EPD_Msk                                   (0x01UL << SCU_SFSP2_4_EPD_Pos)                           /*!< SCU SFSP2_4: EPD Mask               */\r
+#define SCU_SFSP2_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_4: EPUN Position          */\r
+#define SCU_SFSP2_4_EPUN_Msk                                  (0x01UL << SCU_SFSP2_4_EPUN_Pos)                          /*!< SCU SFSP2_4: EPUN Mask              */\r
+#define SCU_SFSP2_4_EHS_Pos                                   5                                                         /*!< SCU SFSP2_4: EHS Position           */\r
+#define SCU_SFSP2_4_EHS_Msk                                   (0x01UL << SCU_SFSP2_4_EHS_Pos)                           /*!< SCU SFSP2_4: EHS Mask               */\r
+#define SCU_SFSP2_4_EZI_Pos                                   6                                                         /*!< SCU SFSP2_4: EZI Position           */\r
+#define SCU_SFSP2_4_EZI_Msk                                   (0x01UL << SCU_SFSP2_4_EZI_Pos)                           /*!< SCU SFSP2_4: EZI Mask               */\r
+#define SCU_SFSP2_4_EHD_Pos                                   8                                                         /*!< SCU SFSP2_4: EHD Position           */\r
+#define SCU_SFSP2_4_EHD_Msk                                   (0x03UL << SCU_SFSP2_4_EHD_Pos)                           /*!< SCU SFSP2_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_5  ------------------------------------------\r
+#define SCU_SFSP2_5_MODE_Pos                                  0                                                         /*!< SCU SFSP2_5: MODE Position          */\r
+#define SCU_SFSP2_5_MODE_Msk                                  (0x07UL << SCU_SFSP2_5_MODE_Pos)                          /*!< SCU SFSP2_5: MODE Mask              */\r
+#define SCU_SFSP2_5_EPD_Pos                                   3                                                         /*!< SCU SFSP2_5: EPD Position           */\r
+#define SCU_SFSP2_5_EPD_Msk                                   (0x01UL << SCU_SFSP2_5_EPD_Pos)                           /*!< SCU SFSP2_5: EPD Mask               */\r
+#define SCU_SFSP2_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_5: EPUN Position          */\r
+#define SCU_SFSP2_5_EPUN_Msk                                  (0x01UL << SCU_SFSP2_5_EPUN_Pos)                          /*!< SCU SFSP2_5: EPUN Mask              */\r
+#define SCU_SFSP2_5_EHS_Pos                                   5                                                         /*!< SCU SFSP2_5: EHS Position           */\r
+#define SCU_SFSP2_5_EHS_Msk                                   (0x01UL << SCU_SFSP2_5_EHS_Pos)                           /*!< SCU SFSP2_5: EHS Mask               */\r
+#define SCU_SFSP2_5_EZI_Pos                                   6                                                         /*!< SCU SFSP2_5: EZI Position           */\r
+#define SCU_SFSP2_5_EZI_Msk                                   (0x01UL << SCU_SFSP2_5_EZI_Pos)                           /*!< SCU SFSP2_5: EZI Mask               */\r
+#define SCU_SFSP2_5_EHD_Pos                                   8                                                         /*!< SCU SFSP2_5: EHD Position           */\r
+#define SCU_SFSP2_5_EHD_Msk                                   (0x03UL << SCU_SFSP2_5_EHD_Pos)                           /*!< SCU SFSP2_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_6  ------------------------------------------\r
+#define SCU_SFSP2_6_MODE_Pos                                  0                                                         /*!< SCU SFSP2_6: MODE Position          */\r
+#define SCU_SFSP2_6_MODE_Msk                                  (0x07UL << SCU_SFSP2_6_MODE_Pos)                          /*!< SCU SFSP2_6: MODE Mask              */\r
+#define SCU_SFSP2_6_EPD_Pos                                   3                                                         /*!< SCU SFSP2_6: EPD Position           */\r
+#define SCU_SFSP2_6_EPD_Msk                                   (0x01UL << SCU_SFSP2_6_EPD_Pos)                           /*!< SCU SFSP2_6: EPD Mask               */\r
+#define SCU_SFSP2_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_6: EPUN Position          */\r
+#define SCU_SFSP2_6_EPUN_Msk                                  (0x01UL << SCU_SFSP2_6_EPUN_Pos)                          /*!< SCU SFSP2_6: EPUN Mask              */\r
+#define SCU_SFSP2_6_EHS_Pos                                   5                                                         /*!< SCU SFSP2_6: EHS Position           */\r
+#define SCU_SFSP2_6_EHS_Msk                                   (0x01UL << SCU_SFSP2_6_EHS_Pos)                           /*!< SCU SFSP2_6: EHS Mask               */\r
+#define SCU_SFSP2_6_EZI_Pos                                   6                                                         /*!< SCU SFSP2_6: EZI Position           */\r
+#define SCU_SFSP2_6_EZI_Msk                                   (0x01UL << SCU_SFSP2_6_EZI_Pos)                           /*!< SCU SFSP2_6: EZI Mask               */\r
+#define SCU_SFSP2_6_EHD_Pos                                   8                                                         /*!< SCU SFSP2_6: EHD Position           */\r
+#define SCU_SFSP2_6_EHD_Msk                                   (0x03UL << SCU_SFSP2_6_EHD_Pos)                           /*!< SCU SFSP2_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_7  ------------------------------------------\r
+#define SCU_SFSP2_7_MODE_Pos                                  0                                                         /*!< SCU SFSP2_7: MODE Position          */\r
+#define SCU_SFSP2_7_MODE_Msk                                  (0x07UL << SCU_SFSP2_7_MODE_Pos)                          /*!< SCU SFSP2_7: MODE Mask              */\r
+#define SCU_SFSP2_7_EPD_Pos                                   3                                                         /*!< SCU SFSP2_7: EPD Position           */\r
+#define SCU_SFSP2_7_EPD_Msk                                   (0x01UL << SCU_SFSP2_7_EPD_Pos)                           /*!< SCU SFSP2_7: EPD Mask               */\r
+#define SCU_SFSP2_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_7: EPUN Position          */\r
+#define SCU_SFSP2_7_EPUN_Msk                                  (0x01UL << SCU_SFSP2_7_EPUN_Pos)                          /*!< SCU SFSP2_7: EPUN Mask              */\r
+#define SCU_SFSP2_7_EHS_Pos                                   5                                                         /*!< SCU SFSP2_7: EHS Position           */\r
+#define SCU_SFSP2_7_EHS_Msk                                   (0x01UL << SCU_SFSP2_7_EHS_Pos)                           /*!< SCU SFSP2_7: EHS Mask               */\r
+#define SCU_SFSP2_7_EZI_Pos                                   6                                                         /*!< SCU SFSP2_7: EZI Position           */\r
+#define SCU_SFSP2_7_EZI_Msk                                   (0x01UL << SCU_SFSP2_7_EZI_Pos)                           /*!< SCU SFSP2_7: EZI Mask               */\r
+#define SCU_SFSP2_7_EHD_Pos                                   8                                                         /*!< SCU SFSP2_7: EHD Position           */\r
+#define SCU_SFSP2_7_EHD_Msk                                   (0x03UL << SCU_SFSP2_7_EHD_Pos)                           /*!< SCU SFSP2_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_8  ------------------------------------------\r
+#define SCU_SFSP2_8_MODE_Pos                                  0                                                         /*!< SCU SFSP2_8: MODE Position          */\r
+#define SCU_SFSP2_8_MODE_Msk                                  (0x07UL << SCU_SFSP2_8_MODE_Pos)                          /*!< SCU SFSP2_8: MODE Mask              */\r
+#define SCU_SFSP2_8_EPD_Pos                                   3                                                         /*!< SCU SFSP2_8: EPD Position           */\r
+#define SCU_SFSP2_8_EPD_Msk                                   (0x01UL << SCU_SFSP2_8_EPD_Pos)                           /*!< SCU SFSP2_8: EPD Mask               */\r
+#define SCU_SFSP2_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_8: EPUN Position          */\r
+#define SCU_SFSP2_8_EPUN_Msk                                  (0x01UL << SCU_SFSP2_8_EPUN_Pos)                          /*!< SCU SFSP2_8: EPUN Mask              */\r
+#define SCU_SFSP2_8_EHS_Pos                                   5                                                         /*!< SCU SFSP2_8: EHS Position           */\r
+#define SCU_SFSP2_8_EHS_Msk                                   (0x01UL << SCU_SFSP2_8_EHS_Pos)                           /*!< SCU SFSP2_8: EHS Mask               */\r
+#define SCU_SFSP2_8_EZI_Pos                                   6                                                         /*!< SCU SFSP2_8: EZI Position           */\r
+#define SCU_SFSP2_8_EZI_Msk                                   (0x01UL << SCU_SFSP2_8_EZI_Pos)                           /*!< SCU SFSP2_8: EZI Mask               */\r
+#define SCU_SFSP2_8_EHD_Pos                                   8                                                         /*!< SCU SFSP2_8: EHD Position           */\r
+#define SCU_SFSP2_8_EHD_Msk                                   (0x03UL << SCU_SFSP2_8_EHD_Pos)                           /*!< SCU SFSP2_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP2_9  ------------------------------------------\r
+#define SCU_SFSP2_9_MODE_Pos                                  0                                                         /*!< SCU SFSP2_9: MODE Position          */\r
+#define SCU_SFSP2_9_MODE_Msk                                  (0x07UL << SCU_SFSP2_9_MODE_Pos)                          /*!< SCU SFSP2_9: MODE Mask              */\r
+#define SCU_SFSP2_9_EPD_Pos                                   3                                                         /*!< SCU SFSP2_9: EPD Position           */\r
+#define SCU_SFSP2_9_EPD_Msk                                   (0x01UL << SCU_SFSP2_9_EPD_Pos)                           /*!< SCU SFSP2_9: EPD Mask               */\r
+#define SCU_SFSP2_9_EPUN_Pos                                  4                                                         /*!< SCU SFSP2_9: EPUN Position          */\r
+#define SCU_SFSP2_9_EPUN_Msk                                  (0x01UL << SCU_SFSP2_9_EPUN_Pos)                          /*!< SCU SFSP2_9: EPUN Mask              */\r
+#define SCU_SFSP2_9_EHS_Pos                                   5                                                         /*!< SCU SFSP2_9: EHS Position           */\r
+#define SCU_SFSP2_9_EHS_Msk                                   (0x01UL << SCU_SFSP2_9_EHS_Pos)                           /*!< SCU SFSP2_9: EHS Mask               */\r
+#define SCU_SFSP2_9_EZI_Pos                                   6                                                         /*!< SCU SFSP2_9: EZI Position           */\r
+#define SCU_SFSP2_9_EZI_Msk                                   (0x01UL << SCU_SFSP2_9_EZI_Pos)                           /*!< SCU SFSP2_9: EZI Mask               */\r
+#define SCU_SFSP2_9_EHD_Pos                                   8                                                         /*!< SCU SFSP2_9: EHD Position           */\r
+#define SCU_SFSP2_9_EHD_Msk                                   (0x03UL << SCU_SFSP2_9_EHD_Pos)                           /*!< SCU SFSP2_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSP2_10  ------------------------------------------\r
+#define SCU_SFSP2_10_MODE_Pos                                 0                                                         /*!< SCU SFSP2_10: MODE Position         */\r
+#define SCU_SFSP2_10_MODE_Msk                                 (0x07UL << SCU_SFSP2_10_MODE_Pos)                         /*!< SCU SFSP2_10: MODE Mask             */\r
+#define SCU_SFSP2_10_EPD_Pos                                  3                                                         /*!< SCU SFSP2_10: EPD Position          */\r
+#define SCU_SFSP2_10_EPD_Msk                                  (0x01UL << SCU_SFSP2_10_EPD_Pos)                          /*!< SCU SFSP2_10: EPD Mask              */\r
+#define SCU_SFSP2_10_EPUN_Pos                                 4                                                         /*!< SCU SFSP2_10: EPUN Position         */\r
+#define SCU_SFSP2_10_EPUN_Msk                                 (0x01UL << SCU_SFSP2_10_EPUN_Pos)                         /*!< SCU SFSP2_10: EPUN Mask             */\r
+#define SCU_SFSP2_10_EHS_Pos                                  5                                                         /*!< SCU SFSP2_10: EHS Position          */\r
+#define SCU_SFSP2_10_EHS_Msk                                  (0x01UL << SCU_SFSP2_10_EHS_Pos)                          /*!< SCU SFSP2_10: EHS Mask              */\r
+#define SCU_SFSP2_10_EZI_Pos                                  6                                                         /*!< SCU SFSP2_10: EZI Position          */\r
+#define SCU_SFSP2_10_EZI_Msk                                  (0x01UL << SCU_SFSP2_10_EZI_Pos)                          /*!< SCU SFSP2_10: EZI Mask              */\r
+#define SCU_SFSP2_10_EHD_Pos                                  8                                                         /*!< SCU SFSP2_10: EHD Position          */\r
+#define SCU_SFSP2_10_EHD_Msk                                  (0x03UL << SCU_SFSP2_10_EHD_Pos)                          /*!< SCU SFSP2_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP2_11  ------------------------------------------\r
+#define SCU_SFSP2_11_MODE_Pos                                 0                                                         /*!< SCU SFSP2_11: MODE Position         */\r
+#define SCU_SFSP2_11_MODE_Msk                                 (0x07UL << SCU_SFSP2_11_MODE_Pos)                         /*!< SCU SFSP2_11: MODE Mask             */\r
+#define SCU_SFSP2_11_EPD_Pos                                  3                                                         /*!< SCU SFSP2_11: EPD Position          */\r
+#define SCU_SFSP2_11_EPD_Msk                                  (0x01UL << SCU_SFSP2_11_EPD_Pos)                          /*!< SCU SFSP2_11: EPD Mask              */\r
+#define SCU_SFSP2_11_EPUN_Pos                                 4                                                         /*!< SCU SFSP2_11: EPUN Position         */\r
+#define SCU_SFSP2_11_EPUN_Msk                                 (0x01UL << SCU_SFSP2_11_EPUN_Pos)                         /*!< SCU SFSP2_11: EPUN Mask             */\r
+#define SCU_SFSP2_11_EHS_Pos                                  5                                                         /*!< SCU SFSP2_11: EHS Position          */\r
+#define SCU_SFSP2_11_EHS_Msk                                  (0x01UL << SCU_SFSP2_11_EHS_Pos)                          /*!< SCU SFSP2_11: EHS Mask              */\r
+#define SCU_SFSP2_11_EZI_Pos                                  6                                                         /*!< SCU SFSP2_11: EZI Position          */\r
+#define SCU_SFSP2_11_EZI_Msk                                  (0x01UL << SCU_SFSP2_11_EZI_Pos)                          /*!< SCU SFSP2_11: EZI Mask              */\r
+#define SCU_SFSP2_11_EHD_Pos                                  8                                                         /*!< SCU SFSP2_11: EHD Position          */\r
+#define SCU_SFSP2_11_EHD_Msk                                  (0x03UL << SCU_SFSP2_11_EHD_Pos)                          /*!< SCU SFSP2_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP2_12  ------------------------------------------\r
+#define SCU_SFSP2_12_MODE_Pos                                 0                                                         /*!< SCU SFSP2_12: MODE Position         */\r
+#define SCU_SFSP2_12_MODE_Msk                                 (0x07UL << SCU_SFSP2_12_MODE_Pos)                         /*!< SCU SFSP2_12: MODE Mask             */\r
+#define SCU_SFSP2_12_EPD_Pos                                  3                                                         /*!< SCU SFSP2_12: EPD Position          */\r
+#define SCU_SFSP2_12_EPD_Msk                                  (0x01UL << SCU_SFSP2_12_EPD_Pos)                          /*!< SCU SFSP2_12: EPD Mask              */\r
+#define SCU_SFSP2_12_EPUN_Pos                                 4                                                         /*!< SCU SFSP2_12: EPUN Position         */\r
+#define SCU_SFSP2_12_EPUN_Msk                                 (0x01UL << SCU_SFSP2_12_EPUN_Pos)                         /*!< SCU SFSP2_12: EPUN Mask             */\r
+#define SCU_SFSP2_12_EHS_Pos                                  5                                                         /*!< SCU SFSP2_12: EHS Position          */\r
+#define SCU_SFSP2_12_EHS_Msk                                  (0x01UL << SCU_SFSP2_12_EHS_Pos)                          /*!< SCU SFSP2_12: EHS Mask              */\r
+#define SCU_SFSP2_12_EZI_Pos                                  6                                                         /*!< SCU SFSP2_12: EZI Position          */\r
+#define SCU_SFSP2_12_EZI_Msk                                  (0x01UL << SCU_SFSP2_12_EZI_Pos)                          /*!< SCU SFSP2_12: EZI Mask              */\r
+#define SCU_SFSP2_12_EHD_Pos                                  8                                                         /*!< SCU SFSP2_12: EHD Position          */\r
+#define SCU_SFSP2_12_EHD_Msk                                  (0x03UL << SCU_SFSP2_12_EHD_Pos)                          /*!< SCU SFSP2_12: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP2_13  ------------------------------------------\r
+#define SCU_SFSP2_13_MODE_Pos                                 0                                                         /*!< SCU SFSP2_13: MODE Position         */\r
+#define SCU_SFSP2_13_MODE_Msk                                 (0x07UL << SCU_SFSP2_13_MODE_Pos)                         /*!< SCU SFSP2_13: MODE Mask             */\r
+#define SCU_SFSP2_13_EPD_Pos                                  3                                                         /*!< SCU SFSP2_13: EPD Position          */\r
+#define SCU_SFSP2_13_EPD_Msk                                  (0x01UL << SCU_SFSP2_13_EPD_Pos)                          /*!< SCU SFSP2_13: EPD Mask              */\r
+#define SCU_SFSP2_13_EPUN_Pos                                 4                                                         /*!< SCU SFSP2_13: EPUN Position         */\r
+#define SCU_SFSP2_13_EPUN_Msk                                 (0x01UL << SCU_SFSP2_13_EPUN_Pos)                         /*!< SCU SFSP2_13: EPUN Mask             */\r
+#define SCU_SFSP2_13_EHS_Pos                                  5                                                         /*!< SCU SFSP2_13: EHS Position          */\r
+#define SCU_SFSP2_13_EHS_Msk                                  (0x01UL << SCU_SFSP2_13_EHS_Pos)                          /*!< SCU SFSP2_13: EHS Mask              */\r
+#define SCU_SFSP2_13_EZI_Pos                                  6                                                         /*!< SCU SFSP2_13: EZI Position          */\r
+#define SCU_SFSP2_13_EZI_Msk                                  (0x01UL << SCU_SFSP2_13_EZI_Pos)                          /*!< SCU SFSP2_13: EZI Mask              */\r
+#define SCU_SFSP2_13_EHD_Pos                                  8                                                         /*!< SCU SFSP2_13: EHD Position          */\r
+#define SCU_SFSP2_13_EHD_Msk                                  (0x03UL << SCU_SFSP2_13_EHD_Pos)                          /*!< SCU SFSP2_13: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSP3_0  ------------------------------------------\r
+#define SCU_SFSP3_0_MODE_Pos                                  0                                                         /*!< SCU SFSP3_0: MODE Position          */\r
+#define SCU_SFSP3_0_MODE_Msk                                  (0x07UL << SCU_SFSP3_0_MODE_Pos)                          /*!< SCU SFSP3_0: MODE Mask              */\r
+#define SCU_SFSP3_0_EPD_Pos                                   3                                                         /*!< SCU SFSP3_0: EPD Position           */\r
+#define SCU_SFSP3_0_EPD_Msk                                   (0x01UL << SCU_SFSP3_0_EPD_Pos)                           /*!< SCU SFSP3_0: EPD Mask               */\r
+#define SCU_SFSP3_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_0: EPUN Position          */\r
+#define SCU_SFSP3_0_EPUN_Msk                                  (0x01UL << SCU_SFSP3_0_EPUN_Pos)                          /*!< SCU SFSP3_0: EPUN Mask              */\r
+#define SCU_SFSP3_0_EHS_Pos                                   5                                                         /*!< SCU SFSP3_0: EHS Position           */\r
+#define SCU_SFSP3_0_EHS_Msk                                   (0x01UL << SCU_SFSP3_0_EHS_Pos)                           /*!< SCU SFSP3_0: EHS Mask               */\r
+#define SCU_SFSP3_0_EZI_Pos                                   6                                                         /*!< SCU SFSP3_0: EZI Position           */\r
+#define SCU_SFSP3_0_EZI_Msk                                   (0x01UL << SCU_SFSP3_0_EZI_Pos)                           /*!< SCU SFSP3_0: EZI Mask               */\r
+#define SCU_SFSP3_0_EHD_Pos                                   8                                                         /*!< SCU SFSP3_0: EHD Position           */\r
+#define SCU_SFSP3_0_EHD_Msk                                   (0x03UL << SCU_SFSP3_0_EHD_Pos)                           /*!< SCU SFSP3_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_1  ------------------------------------------\r
+#define SCU_SFSP3_1_MODE_Pos                                  0                                                         /*!< SCU SFSP3_1: MODE Position          */\r
+#define SCU_SFSP3_1_MODE_Msk                                  (0x07UL << SCU_SFSP3_1_MODE_Pos)                          /*!< SCU SFSP3_1: MODE Mask              */\r
+#define SCU_SFSP3_1_EPD_Pos                                   3                                                         /*!< SCU SFSP3_1: EPD Position           */\r
+#define SCU_SFSP3_1_EPD_Msk                                   (0x01UL << SCU_SFSP3_1_EPD_Pos)                           /*!< SCU SFSP3_1: EPD Mask               */\r
+#define SCU_SFSP3_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_1: EPUN Position          */\r
+#define SCU_SFSP3_1_EPUN_Msk                                  (0x01UL << SCU_SFSP3_1_EPUN_Pos)                          /*!< SCU SFSP3_1: EPUN Mask              */\r
+#define SCU_SFSP3_1_EHS_Pos                                   5                                                         /*!< SCU SFSP3_1: EHS Position           */\r
+#define SCU_SFSP3_1_EHS_Msk                                   (0x01UL << SCU_SFSP3_1_EHS_Pos)                           /*!< SCU SFSP3_1: EHS Mask               */\r
+#define SCU_SFSP3_1_EZI_Pos                                   6                                                         /*!< SCU SFSP3_1: EZI Position           */\r
+#define SCU_SFSP3_1_EZI_Msk                                   (0x01UL << SCU_SFSP3_1_EZI_Pos)                           /*!< SCU SFSP3_1: EZI Mask               */\r
+#define SCU_SFSP3_1_EHD_Pos                                   8                                                         /*!< SCU SFSP3_1: EHD Position           */\r
+#define SCU_SFSP3_1_EHD_Msk                                   (0x03UL << SCU_SFSP3_1_EHD_Pos)                           /*!< SCU SFSP3_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_2  ------------------------------------------\r
+#define SCU_SFSP3_2_MODE_Pos                                  0                                                         /*!< SCU SFSP3_2: MODE Position          */\r
+#define SCU_SFSP3_2_MODE_Msk                                  (0x07UL << SCU_SFSP3_2_MODE_Pos)                          /*!< SCU SFSP3_2: MODE Mask              */\r
+#define SCU_SFSP3_2_EPD_Pos                                   3                                                         /*!< SCU SFSP3_2: EPD Position           */\r
+#define SCU_SFSP3_2_EPD_Msk                                   (0x01UL << SCU_SFSP3_2_EPD_Pos)                           /*!< SCU SFSP3_2: EPD Mask               */\r
+#define SCU_SFSP3_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_2: EPUN Position          */\r
+#define SCU_SFSP3_2_EPUN_Msk                                  (0x01UL << SCU_SFSP3_2_EPUN_Pos)                          /*!< SCU SFSP3_2: EPUN Mask              */\r
+#define SCU_SFSP3_2_EHS_Pos                                   5                                                         /*!< SCU SFSP3_2: EHS Position           */\r
+#define SCU_SFSP3_2_EHS_Msk                                   (0x01UL << SCU_SFSP3_2_EHS_Pos)                           /*!< SCU SFSP3_2: EHS Mask               */\r
+#define SCU_SFSP3_2_EZI_Pos                                   6                                                         /*!< SCU SFSP3_2: EZI Position           */\r
+#define SCU_SFSP3_2_EZI_Msk                                   (0x01UL << SCU_SFSP3_2_EZI_Pos)                           /*!< SCU SFSP3_2: EZI Mask               */\r
+#define SCU_SFSP3_2_EHD_Pos                                   8                                                         /*!< SCU SFSP3_2: EHD Position           */\r
+#define SCU_SFSP3_2_EHD_Msk                                   (0x03UL << SCU_SFSP3_2_EHD_Pos)                           /*!< SCU SFSP3_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_3  ------------------------------------------\r
+#define SCU_SFSP3_3_MODE_Pos                                  0                                                         /*!< SCU SFSP3_3: MODE Position          */\r
+#define SCU_SFSP3_3_MODE_Msk                                  (0x07UL << SCU_SFSP3_3_MODE_Pos)                          /*!< SCU SFSP3_3: MODE Mask              */\r
+#define SCU_SFSP3_3_EPD_Pos                                   3                                                         /*!< SCU SFSP3_3: EPD Position           */\r
+#define SCU_SFSP3_3_EPD_Msk                                   (0x01UL << SCU_SFSP3_3_EPD_Pos)                           /*!< SCU SFSP3_3: EPD Mask               */\r
+#define SCU_SFSP3_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_3: EPUN Position          */\r
+#define SCU_SFSP3_3_EPUN_Msk                                  (0x01UL << SCU_SFSP3_3_EPUN_Pos)                          /*!< SCU SFSP3_3: EPUN Mask              */\r
+#define SCU_SFSP3_3_EHS_Pos                                   5                                                         /*!< SCU SFSP3_3: EHS Position           */\r
+#define SCU_SFSP3_3_EHS_Msk                                   (0x01UL << SCU_SFSP3_3_EHS_Pos)                           /*!< SCU SFSP3_3: EHS Mask               */\r
+#define SCU_SFSP3_3_EZI_Pos                                   6                                                         /*!< SCU SFSP3_3: EZI Position           */\r
+#define SCU_SFSP3_3_EZI_Msk                                   (0x01UL << SCU_SFSP3_3_EZI_Pos)                           /*!< SCU SFSP3_3: EZI Mask               */\r
+#define SCU_SFSP3_3_EHD_Pos                                   8                                                         /*!< SCU SFSP3_3: EHD Position           */\r
+#define SCU_SFSP3_3_EHD_Msk                                   (0x03UL << SCU_SFSP3_3_EHD_Pos)                           /*!< SCU SFSP3_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_4  ------------------------------------------\r
+#define SCU_SFSP3_4_MODE_Pos                                  0                                                         /*!< SCU SFSP3_4: MODE Position          */\r
+#define SCU_SFSP3_4_MODE_Msk                                  (0x07UL << SCU_SFSP3_4_MODE_Pos)                          /*!< SCU SFSP3_4: MODE Mask              */\r
+#define SCU_SFSP3_4_EPD_Pos                                   3                                                         /*!< SCU SFSP3_4: EPD Position           */\r
+#define SCU_SFSP3_4_EPD_Msk                                   (0x01UL << SCU_SFSP3_4_EPD_Pos)                           /*!< SCU SFSP3_4: EPD Mask               */\r
+#define SCU_SFSP3_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_4: EPUN Position          */\r
+#define SCU_SFSP3_4_EPUN_Msk                                  (0x01UL << SCU_SFSP3_4_EPUN_Pos)                          /*!< SCU SFSP3_4: EPUN Mask              */\r
+#define SCU_SFSP3_4_EHS_Pos                                   5                                                         /*!< SCU SFSP3_4: EHS Position           */\r
+#define SCU_SFSP3_4_EHS_Msk                                   (0x01UL << SCU_SFSP3_4_EHS_Pos)                           /*!< SCU SFSP3_4: EHS Mask               */\r
+#define SCU_SFSP3_4_EZI_Pos                                   6                                                         /*!< SCU SFSP3_4: EZI Position           */\r
+#define SCU_SFSP3_4_EZI_Msk                                   (0x01UL << SCU_SFSP3_4_EZI_Pos)                           /*!< SCU SFSP3_4: EZI Mask               */\r
+#define SCU_SFSP3_4_EHD_Pos                                   8                                                         /*!< SCU SFSP3_4: EHD Position           */\r
+#define SCU_SFSP3_4_EHD_Msk                                   (0x03UL << SCU_SFSP3_4_EHD_Pos)                           /*!< SCU SFSP3_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_5  ------------------------------------------\r
+#define SCU_SFSP3_5_MODE_Pos                                  0                                                         /*!< SCU SFSP3_5: MODE Position          */\r
+#define SCU_SFSP3_5_MODE_Msk                                  (0x07UL << SCU_SFSP3_5_MODE_Pos)                          /*!< SCU SFSP3_5: MODE Mask              */\r
+#define SCU_SFSP3_5_EPD_Pos                                   3                                                         /*!< SCU SFSP3_5: EPD Position           */\r
+#define SCU_SFSP3_5_EPD_Msk                                   (0x01UL << SCU_SFSP3_5_EPD_Pos)                           /*!< SCU SFSP3_5: EPD Mask               */\r
+#define SCU_SFSP3_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_5: EPUN Position          */\r
+#define SCU_SFSP3_5_EPUN_Msk                                  (0x01UL << SCU_SFSP3_5_EPUN_Pos)                          /*!< SCU SFSP3_5: EPUN Mask              */\r
+#define SCU_SFSP3_5_EHS_Pos                                   5                                                         /*!< SCU SFSP3_5: EHS Position           */\r
+#define SCU_SFSP3_5_EHS_Msk                                   (0x01UL << SCU_SFSP3_5_EHS_Pos)                           /*!< SCU SFSP3_5: EHS Mask               */\r
+#define SCU_SFSP3_5_EZI_Pos                                   6                                                         /*!< SCU SFSP3_5: EZI Position           */\r
+#define SCU_SFSP3_5_EZI_Msk                                   (0x01UL << SCU_SFSP3_5_EZI_Pos)                           /*!< SCU SFSP3_5: EZI Mask               */\r
+#define SCU_SFSP3_5_EHD_Pos                                   8                                                         /*!< SCU SFSP3_5: EHD Position           */\r
+#define SCU_SFSP3_5_EHD_Msk                                   (0x03UL << SCU_SFSP3_5_EHD_Pos)                           /*!< SCU SFSP3_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_6  ------------------------------------------\r
+#define SCU_SFSP3_6_MODE_Pos                                  0                                                         /*!< SCU SFSP3_6: MODE Position          */\r
+#define SCU_SFSP3_6_MODE_Msk                                  (0x07UL << SCU_SFSP3_6_MODE_Pos)                          /*!< SCU SFSP3_6: MODE Mask              */\r
+#define SCU_SFSP3_6_EPD_Pos                                   3                                                         /*!< SCU SFSP3_6: EPD Position           */\r
+#define SCU_SFSP3_6_EPD_Msk                                   (0x01UL << SCU_SFSP3_6_EPD_Pos)                           /*!< SCU SFSP3_6: EPD Mask               */\r
+#define SCU_SFSP3_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_6: EPUN Position          */\r
+#define SCU_SFSP3_6_EPUN_Msk                                  (0x01UL << SCU_SFSP3_6_EPUN_Pos)                          /*!< SCU SFSP3_6: EPUN Mask              */\r
+#define SCU_SFSP3_6_EHS_Pos                                   5                                                         /*!< SCU SFSP3_6: EHS Position           */\r
+#define SCU_SFSP3_6_EHS_Msk                                   (0x01UL << SCU_SFSP3_6_EHS_Pos)                           /*!< SCU SFSP3_6: EHS Mask               */\r
+#define SCU_SFSP3_6_EZI_Pos                                   6                                                         /*!< SCU SFSP3_6: EZI Position           */\r
+#define SCU_SFSP3_6_EZI_Msk                                   (0x01UL << SCU_SFSP3_6_EZI_Pos)                           /*!< SCU SFSP3_6: EZI Mask               */\r
+#define SCU_SFSP3_6_EHD_Pos                                   8                                                         /*!< SCU SFSP3_6: EHD Position           */\r
+#define SCU_SFSP3_6_EHD_Msk                                   (0x03UL << SCU_SFSP3_6_EHD_Pos)                           /*!< SCU SFSP3_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_7  ------------------------------------------\r
+#define SCU_SFSP3_7_MODE_Pos                                  0                                                         /*!< SCU SFSP3_7: MODE Position          */\r
+#define SCU_SFSP3_7_MODE_Msk                                  (0x07UL << SCU_SFSP3_7_MODE_Pos)                          /*!< SCU SFSP3_7: MODE Mask              */\r
+#define SCU_SFSP3_7_EPD_Pos                                   3                                                         /*!< SCU SFSP3_7: EPD Position           */\r
+#define SCU_SFSP3_7_EPD_Msk                                   (0x01UL << SCU_SFSP3_7_EPD_Pos)                           /*!< SCU SFSP3_7: EPD Mask               */\r
+#define SCU_SFSP3_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_7: EPUN Position          */\r
+#define SCU_SFSP3_7_EPUN_Msk                                  (0x01UL << SCU_SFSP3_7_EPUN_Pos)                          /*!< SCU SFSP3_7: EPUN Mask              */\r
+#define SCU_SFSP3_7_EHS_Pos                                   5                                                         /*!< SCU SFSP3_7: EHS Position           */\r
+#define SCU_SFSP3_7_EHS_Msk                                   (0x01UL << SCU_SFSP3_7_EHS_Pos)                           /*!< SCU SFSP3_7: EHS Mask               */\r
+#define SCU_SFSP3_7_EZI_Pos                                   6                                                         /*!< SCU SFSP3_7: EZI Position           */\r
+#define SCU_SFSP3_7_EZI_Msk                                   (0x01UL << SCU_SFSP3_7_EZI_Pos)                           /*!< SCU SFSP3_7: EZI Mask               */\r
+#define SCU_SFSP3_7_EHD_Pos                                   8                                                         /*!< SCU SFSP3_7: EHD Position           */\r
+#define SCU_SFSP3_7_EHD_Msk                                   (0x03UL << SCU_SFSP3_7_EHD_Pos)                           /*!< SCU SFSP3_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP3_8  ------------------------------------------\r
+#define SCU_SFSP3_8_MODE_Pos                                  0                                                         /*!< SCU SFSP3_8: MODE Position          */\r
+#define SCU_SFSP3_8_MODE_Msk                                  (0x07UL << SCU_SFSP3_8_MODE_Pos)                          /*!< SCU SFSP3_8: MODE Mask              */\r
+#define SCU_SFSP3_8_EPD_Pos                                   3                                                         /*!< SCU SFSP3_8: EPD Position           */\r
+#define SCU_SFSP3_8_EPD_Msk                                   (0x01UL << SCU_SFSP3_8_EPD_Pos)                           /*!< SCU SFSP3_8: EPD Mask               */\r
+#define SCU_SFSP3_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP3_8: EPUN Position          */\r
+#define SCU_SFSP3_8_EPUN_Msk                                  (0x01UL << SCU_SFSP3_8_EPUN_Pos)                          /*!< SCU SFSP3_8: EPUN Mask              */\r
+#define SCU_SFSP3_8_EHS_Pos                                   5                                                         /*!< SCU SFSP3_8: EHS Position           */\r
+#define SCU_SFSP3_8_EHS_Msk                                   (0x01UL << SCU_SFSP3_8_EHS_Pos)                           /*!< SCU SFSP3_8: EHS Mask               */\r
+#define SCU_SFSP3_8_EZI_Pos                                   6                                                         /*!< SCU SFSP3_8: EZI Position           */\r
+#define SCU_SFSP3_8_EZI_Msk                                   (0x01UL << SCU_SFSP3_8_EZI_Pos)                           /*!< SCU SFSP3_8: EZI Mask               */\r
+#define SCU_SFSP3_8_EHD_Pos                                   8                                                         /*!< SCU SFSP3_8: EHD Position           */\r
+#define SCU_SFSP3_8_EHD_Msk                                   (0x03UL << SCU_SFSP3_8_EHD_Pos)                           /*!< SCU SFSP3_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_0  ------------------------------------------\r
+#define SCU_SFSP4_0_MODE_Pos                                  0                                                         /*!< SCU SFSP4_0: MODE Position          */\r
+#define SCU_SFSP4_0_MODE_Msk                                  (0x07UL << SCU_SFSP4_0_MODE_Pos)                          /*!< SCU SFSP4_0: MODE Mask              */\r
+#define SCU_SFSP4_0_EPD_Pos                                   3                                                         /*!< SCU SFSP4_0: EPD Position           */\r
+#define SCU_SFSP4_0_EPD_Msk                                   (0x01UL << SCU_SFSP4_0_EPD_Pos)                           /*!< SCU SFSP4_0: EPD Mask               */\r
+#define SCU_SFSP4_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_0: EPUN Position          */\r
+#define SCU_SFSP4_0_EPUN_Msk                                  (0x01UL << SCU_SFSP4_0_EPUN_Pos)                          /*!< SCU SFSP4_0: EPUN Mask              */\r
+#define SCU_SFSP4_0_EHS_Pos                                   5                                                         /*!< SCU SFSP4_0: EHS Position           */\r
+#define SCU_SFSP4_0_EHS_Msk                                   (0x01UL << SCU_SFSP4_0_EHS_Pos)                           /*!< SCU SFSP4_0: EHS Mask               */\r
+#define SCU_SFSP4_0_EZI_Pos                                   6                                                         /*!< SCU SFSP4_0: EZI Position           */\r
+#define SCU_SFSP4_0_EZI_Msk                                   (0x01UL << SCU_SFSP4_0_EZI_Pos)                           /*!< SCU SFSP4_0: EZI Mask               */\r
+#define SCU_SFSP4_0_EHD_Pos                                   8                                                         /*!< SCU SFSP4_0: EHD Position           */\r
+#define SCU_SFSP4_0_EHD_Msk                                   (0x03UL << SCU_SFSP4_0_EHD_Pos)                           /*!< SCU SFSP4_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_1  ------------------------------------------\r
+#define SCU_SFSP4_1_MODE_Pos                                  0                                                         /*!< SCU SFSP4_1: MODE Position          */\r
+#define SCU_SFSP4_1_MODE_Msk                                  (0x07UL << SCU_SFSP4_1_MODE_Pos)                          /*!< SCU SFSP4_1: MODE Mask              */\r
+#define SCU_SFSP4_1_EPD_Pos                                   3                                                         /*!< SCU SFSP4_1: EPD Position           */\r
+#define SCU_SFSP4_1_EPD_Msk                                   (0x01UL << SCU_SFSP4_1_EPD_Pos)                           /*!< SCU SFSP4_1: EPD Mask               */\r
+#define SCU_SFSP4_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_1: EPUN Position          */\r
+#define SCU_SFSP4_1_EPUN_Msk                                  (0x01UL << SCU_SFSP4_1_EPUN_Pos)                          /*!< SCU SFSP4_1: EPUN Mask              */\r
+#define SCU_SFSP4_1_EHS_Pos                                   5                                                         /*!< SCU SFSP4_1: EHS Position           */\r
+#define SCU_SFSP4_1_EHS_Msk                                   (0x01UL << SCU_SFSP4_1_EHS_Pos)                           /*!< SCU SFSP4_1: EHS Mask               */\r
+#define SCU_SFSP4_1_EZI_Pos                                   6                                                         /*!< SCU SFSP4_1: EZI Position           */\r
+#define SCU_SFSP4_1_EZI_Msk                                   (0x01UL << SCU_SFSP4_1_EZI_Pos)                           /*!< SCU SFSP4_1: EZI Mask               */\r
+#define SCU_SFSP4_1_EHD_Pos                                   8                                                         /*!< SCU SFSP4_1: EHD Position           */\r
+#define SCU_SFSP4_1_EHD_Msk                                   (0x03UL << SCU_SFSP4_1_EHD_Pos)                           /*!< SCU SFSP4_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_2  ------------------------------------------\r
+#define SCU_SFSP4_2_MODE_Pos                                  0                                                         /*!< SCU SFSP4_2: MODE Position          */\r
+#define SCU_SFSP4_2_MODE_Msk                                  (0x07UL << SCU_SFSP4_2_MODE_Pos)                          /*!< SCU SFSP4_2: MODE Mask              */\r
+#define SCU_SFSP4_2_EPD_Pos                                   3                                                         /*!< SCU SFSP4_2: EPD Position           */\r
+#define SCU_SFSP4_2_EPD_Msk                                   (0x01UL << SCU_SFSP4_2_EPD_Pos)                           /*!< SCU SFSP4_2: EPD Mask               */\r
+#define SCU_SFSP4_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_2: EPUN Position          */\r
+#define SCU_SFSP4_2_EPUN_Msk                                  (0x01UL << SCU_SFSP4_2_EPUN_Pos)                          /*!< SCU SFSP4_2: EPUN Mask              */\r
+#define SCU_SFSP4_2_EHS_Pos                                   5                                                         /*!< SCU SFSP4_2: EHS Position           */\r
+#define SCU_SFSP4_2_EHS_Msk                                   (0x01UL << SCU_SFSP4_2_EHS_Pos)                           /*!< SCU SFSP4_2: EHS Mask               */\r
+#define SCU_SFSP4_2_EZI_Pos                                   6                                                         /*!< SCU SFSP4_2: EZI Position           */\r
+#define SCU_SFSP4_2_EZI_Msk                                   (0x01UL << SCU_SFSP4_2_EZI_Pos)                           /*!< SCU SFSP4_2: EZI Mask               */\r
+#define SCU_SFSP4_2_EHD_Pos                                   8                                                         /*!< SCU SFSP4_2: EHD Position           */\r
+#define SCU_SFSP4_2_EHD_Msk                                   (0x03UL << SCU_SFSP4_2_EHD_Pos)                           /*!< SCU SFSP4_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_3  ------------------------------------------\r
+#define SCU_SFSP4_3_MODE_Pos                                  0                                                         /*!< SCU SFSP4_3: MODE Position          */\r
+#define SCU_SFSP4_3_MODE_Msk                                  (0x07UL << SCU_SFSP4_3_MODE_Pos)                          /*!< SCU SFSP4_3: MODE Mask              */\r
+#define SCU_SFSP4_3_EPD_Pos                                   3                                                         /*!< SCU SFSP4_3: EPD Position           */\r
+#define SCU_SFSP4_3_EPD_Msk                                   (0x01UL << SCU_SFSP4_3_EPD_Pos)                           /*!< SCU SFSP4_3: EPD Mask               */\r
+#define SCU_SFSP4_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_3: EPUN Position          */\r
+#define SCU_SFSP4_3_EPUN_Msk                                  (0x01UL << SCU_SFSP4_3_EPUN_Pos)                          /*!< SCU SFSP4_3: EPUN Mask              */\r
+#define SCU_SFSP4_3_EHS_Pos                                   5                                                         /*!< SCU SFSP4_3: EHS Position           */\r
+#define SCU_SFSP4_3_EHS_Msk                                   (0x01UL << SCU_SFSP4_3_EHS_Pos)                           /*!< SCU SFSP4_3: EHS Mask               */\r
+#define SCU_SFSP4_3_EZI_Pos                                   6                                                         /*!< SCU SFSP4_3: EZI Position           */\r
+#define SCU_SFSP4_3_EZI_Msk                                   (0x01UL << SCU_SFSP4_3_EZI_Pos)                           /*!< SCU SFSP4_3: EZI Mask               */\r
+#define SCU_SFSP4_3_EHD_Pos                                   8                                                         /*!< SCU SFSP4_3: EHD Position           */\r
+#define SCU_SFSP4_3_EHD_Msk                                   (0x03UL << SCU_SFSP4_3_EHD_Pos)                           /*!< SCU SFSP4_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_4  ------------------------------------------\r
+#define SCU_SFSP4_4_MODE_Pos                                  0                                                         /*!< SCU SFSP4_4: MODE Position          */\r
+#define SCU_SFSP4_4_MODE_Msk                                  (0x07UL << SCU_SFSP4_4_MODE_Pos)                          /*!< SCU SFSP4_4: MODE Mask              */\r
+#define SCU_SFSP4_4_EPD_Pos                                   3                                                         /*!< SCU SFSP4_4: EPD Position           */\r
+#define SCU_SFSP4_4_EPD_Msk                                   (0x01UL << SCU_SFSP4_4_EPD_Pos)                           /*!< SCU SFSP4_4: EPD Mask               */\r
+#define SCU_SFSP4_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_4: EPUN Position          */\r
+#define SCU_SFSP4_4_EPUN_Msk                                  (0x01UL << SCU_SFSP4_4_EPUN_Pos)                          /*!< SCU SFSP4_4: EPUN Mask              */\r
+#define SCU_SFSP4_4_EHS_Pos                                   5                                                         /*!< SCU SFSP4_4: EHS Position           */\r
+#define SCU_SFSP4_4_EHS_Msk                                   (0x01UL << SCU_SFSP4_4_EHS_Pos)                           /*!< SCU SFSP4_4: EHS Mask               */\r
+#define SCU_SFSP4_4_EZI_Pos                                   6                                                         /*!< SCU SFSP4_4: EZI Position           */\r
+#define SCU_SFSP4_4_EZI_Msk                                   (0x01UL << SCU_SFSP4_4_EZI_Pos)                           /*!< SCU SFSP4_4: EZI Mask               */\r
+#define SCU_SFSP4_4_EHD_Pos                                   8                                                         /*!< SCU SFSP4_4: EHD Position           */\r
+#define SCU_SFSP4_4_EHD_Msk                                   (0x03UL << SCU_SFSP4_4_EHD_Pos)                           /*!< SCU SFSP4_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_5  ------------------------------------------\r
+#define SCU_SFSP4_5_MODE_Pos                                  0                                                         /*!< SCU SFSP4_5: MODE Position          */\r
+#define SCU_SFSP4_5_MODE_Msk                                  (0x07UL << SCU_SFSP4_5_MODE_Pos)                          /*!< SCU SFSP4_5: MODE Mask              */\r
+#define SCU_SFSP4_5_EPD_Pos                                   3                                                         /*!< SCU SFSP4_5: EPD Position           */\r
+#define SCU_SFSP4_5_EPD_Msk                                   (0x01UL << SCU_SFSP4_5_EPD_Pos)                           /*!< SCU SFSP4_5: EPD Mask               */\r
+#define SCU_SFSP4_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_5: EPUN Position          */\r
+#define SCU_SFSP4_5_EPUN_Msk                                  (0x01UL << SCU_SFSP4_5_EPUN_Pos)                          /*!< SCU SFSP4_5: EPUN Mask              */\r
+#define SCU_SFSP4_5_EHS_Pos                                   5                                                         /*!< SCU SFSP4_5: EHS Position           */\r
+#define SCU_SFSP4_5_EHS_Msk                                   (0x01UL << SCU_SFSP4_5_EHS_Pos)                           /*!< SCU SFSP4_5: EHS Mask               */\r
+#define SCU_SFSP4_5_EZI_Pos                                   6                                                         /*!< SCU SFSP4_5: EZI Position           */\r
+#define SCU_SFSP4_5_EZI_Msk                                   (0x01UL << SCU_SFSP4_5_EZI_Pos)                           /*!< SCU SFSP4_5: EZI Mask               */\r
+#define SCU_SFSP4_5_EHD_Pos                                   8                                                         /*!< SCU SFSP4_5: EHD Position           */\r
+#define SCU_SFSP4_5_EHD_Msk                                   (0x03UL << SCU_SFSP4_5_EHD_Pos)                           /*!< SCU SFSP4_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_6  ------------------------------------------\r
+#define SCU_SFSP4_6_MODE_Pos                                  0                                                         /*!< SCU SFSP4_6: MODE Position          */\r
+#define SCU_SFSP4_6_MODE_Msk                                  (0x07UL << SCU_SFSP4_6_MODE_Pos)                          /*!< SCU SFSP4_6: MODE Mask              */\r
+#define SCU_SFSP4_6_EPD_Pos                                   3                                                         /*!< SCU SFSP4_6: EPD Position           */\r
+#define SCU_SFSP4_6_EPD_Msk                                   (0x01UL << SCU_SFSP4_6_EPD_Pos)                           /*!< SCU SFSP4_6: EPD Mask               */\r
+#define SCU_SFSP4_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_6: EPUN Position          */\r
+#define SCU_SFSP4_6_EPUN_Msk                                  (0x01UL << SCU_SFSP4_6_EPUN_Pos)                          /*!< SCU SFSP4_6: EPUN Mask              */\r
+#define SCU_SFSP4_6_EHS_Pos                                   5                                                         /*!< SCU SFSP4_6: EHS Position           */\r
+#define SCU_SFSP4_6_EHS_Msk                                   (0x01UL << SCU_SFSP4_6_EHS_Pos)                           /*!< SCU SFSP4_6: EHS Mask               */\r
+#define SCU_SFSP4_6_EZI_Pos                                   6                                                         /*!< SCU SFSP4_6: EZI Position           */\r
+#define SCU_SFSP4_6_EZI_Msk                                   (0x01UL << SCU_SFSP4_6_EZI_Pos)                           /*!< SCU SFSP4_6: EZI Mask               */\r
+#define SCU_SFSP4_6_EHD_Pos                                   8                                                         /*!< SCU SFSP4_6: EHD Position           */\r
+#define SCU_SFSP4_6_EHD_Msk                                   (0x03UL << SCU_SFSP4_6_EHD_Pos)                           /*!< SCU SFSP4_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_7  ------------------------------------------\r
+#define SCU_SFSP4_7_MODE_Pos                                  0                                                         /*!< SCU SFSP4_7: MODE Position          */\r
+#define SCU_SFSP4_7_MODE_Msk                                  (0x07UL << SCU_SFSP4_7_MODE_Pos)                          /*!< SCU SFSP4_7: MODE Mask              */\r
+#define SCU_SFSP4_7_EPD_Pos                                   3                                                         /*!< SCU SFSP4_7: EPD Position           */\r
+#define SCU_SFSP4_7_EPD_Msk                                   (0x01UL << SCU_SFSP4_7_EPD_Pos)                           /*!< SCU SFSP4_7: EPD Mask               */\r
+#define SCU_SFSP4_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_7: EPUN Position          */\r
+#define SCU_SFSP4_7_EPUN_Msk                                  (0x01UL << SCU_SFSP4_7_EPUN_Pos)                          /*!< SCU SFSP4_7: EPUN Mask              */\r
+#define SCU_SFSP4_7_EHS_Pos                                   5                                                         /*!< SCU SFSP4_7: EHS Position           */\r
+#define SCU_SFSP4_7_EHS_Msk                                   (0x01UL << SCU_SFSP4_7_EHS_Pos)                           /*!< SCU SFSP4_7: EHS Mask               */\r
+#define SCU_SFSP4_7_EZI_Pos                                   6                                                         /*!< SCU SFSP4_7: EZI Position           */\r
+#define SCU_SFSP4_7_EZI_Msk                                   (0x01UL << SCU_SFSP4_7_EZI_Pos)                           /*!< SCU SFSP4_7: EZI Mask               */\r
+#define SCU_SFSP4_7_EHD_Pos                                   8                                                         /*!< SCU SFSP4_7: EHD Position           */\r
+#define SCU_SFSP4_7_EHD_Msk                                   (0x03UL << SCU_SFSP4_7_EHD_Pos)                           /*!< SCU SFSP4_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_8  ------------------------------------------\r
+#define SCU_SFSP4_8_MODE_Pos                                  0                                                         /*!< SCU SFSP4_8: MODE Position          */\r
+#define SCU_SFSP4_8_MODE_Msk                                  (0x07UL << SCU_SFSP4_8_MODE_Pos)                          /*!< SCU SFSP4_8: MODE Mask              */\r
+#define SCU_SFSP4_8_EPD_Pos                                   3                                                         /*!< SCU SFSP4_8: EPD Position           */\r
+#define SCU_SFSP4_8_EPD_Msk                                   (0x01UL << SCU_SFSP4_8_EPD_Pos)                           /*!< SCU SFSP4_8: EPD Mask               */\r
+#define SCU_SFSP4_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_8: EPUN Position          */\r
+#define SCU_SFSP4_8_EPUN_Msk                                  (0x01UL << SCU_SFSP4_8_EPUN_Pos)                          /*!< SCU SFSP4_8: EPUN Mask              */\r
+#define SCU_SFSP4_8_EHS_Pos                                   5                                                         /*!< SCU SFSP4_8: EHS Position           */\r
+#define SCU_SFSP4_8_EHS_Msk                                   (0x01UL << SCU_SFSP4_8_EHS_Pos)                           /*!< SCU SFSP4_8: EHS Mask               */\r
+#define SCU_SFSP4_8_EZI_Pos                                   6                                                         /*!< SCU SFSP4_8: EZI Position           */\r
+#define SCU_SFSP4_8_EZI_Msk                                   (0x01UL << SCU_SFSP4_8_EZI_Pos)                           /*!< SCU SFSP4_8: EZI Mask               */\r
+#define SCU_SFSP4_8_EHD_Pos                                   8                                                         /*!< SCU SFSP4_8: EHD Position           */\r
+#define SCU_SFSP4_8_EHD_Msk                                   (0x03UL << SCU_SFSP4_8_EHD_Pos)                           /*!< SCU SFSP4_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP4_9  ------------------------------------------\r
+#define SCU_SFSP4_9_MODE_Pos                                  0                                                         /*!< SCU SFSP4_9: MODE Position          */\r
+#define SCU_SFSP4_9_MODE_Msk                                  (0x07UL << SCU_SFSP4_9_MODE_Pos)                          /*!< SCU SFSP4_9: MODE Mask              */\r
+#define SCU_SFSP4_9_EPD_Pos                                   3                                                         /*!< SCU SFSP4_9: EPD Position           */\r
+#define SCU_SFSP4_9_EPD_Msk                                   (0x01UL << SCU_SFSP4_9_EPD_Pos)                           /*!< SCU SFSP4_9: EPD Mask               */\r
+#define SCU_SFSP4_9_EPUN_Pos                                  4                                                         /*!< SCU SFSP4_9: EPUN Position          */\r
+#define SCU_SFSP4_9_EPUN_Msk                                  (0x01UL << SCU_SFSP4_9_EPUN_Pos)                          /*!< SCU SFSP4_9: EPUN Mask              */\r
+#define SCU_SFSP4_9_EHS_Pos                                   5                                                         /*!< SCU SFSP4_9: EHS Position           */\r
+#define SCU_SFSP4_9_EHS_Msk                                   (0x01UL << SCU_SFSP4_9_EHS_Pos)                           /*!< SCU SFSP4_9: EHS Mask               */\r
+#define SCU_SFSP4_9_EZI_Pos                                   6                                                         /*!< SCU SFSP4_9: EZI Position           */\r
+#define SCU_SFSP4_9_EZI_Msk                                   (0x01UL << SCU_SFSP4_9_EZI_Pos)                           /*!< SCU SFSP4_9: EZI Mask               */\r
+#define SCU_SFSP4_9_EHD_Pos                                   8                                                         /*!< SCU SFSP4_9: EHD Position           */\r
+#define SCU_SFSP4_9_EHD_Msk                                   (0x03UL << SCU_SFSP4_9_EHD_Pos)                           /*!< SCU SFSP4_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSP4_10  ------------------------------------------\r
+#define SCU_SFSP4_10_MODE_Pos                                 0                                                         /*!< SCU SFSP4_10: MODE Position         */\r
+#define SCU_SFSP4_10_MODE_Msk                                 (0x07UL << SCU_SFSP4_10_MODE_Pos)                         /*!< SCU SFSP4_10: MODE Mask             */\r
+#define SCU_SFSP4_10_EPD_Pos                                  3                                                         /*!< SCU SFSP4_10: EPD Position          */\r
+#define SCU_SFSP4_10_EPD_Msk                                  (0x01UL << SCU_SFSP4_10_EPD_Pos)                          /*!< SCU SFSP4_10: EPD Mask              */\r
+#define SCU_SFSP4_10_EPUN_Pos                                 4                                                         /*!< SCU SFSP4_10: EPUN Position         */\r
+#define SCU_SFSP4_10_EPUN_Msk                                 (0x01UL << SCU_SFSP4_10_EPUN_Pos)                         /*!< SCU SFSP4_10: EPUN Mask             */\r
+#define SCU_SFSP4_10_EHS_Pos                                  5                                                         /*!< SCU SFSP4_10: EHS Position          */\r
+#define SCU_SFSP4_10_EHS_Msk                                  (0x01UL << SCU_SFSP4_10_EHS_Pos)                          /*!< SCU SFSP4_10: EHS Mask              */\r
+#define SCU_SFSP4_10_EZI_Pos                                  6                                                         /*!< SCU SFSP4_10: EZI Position          */\r
+#define SCU_SFSP4_10_EZI_Msk                                  (0x01UL << SCU_SFSP4_10_EZI_Pos)                          /*!< SCU SFSP4_10: EZI Mask              */\r
+#define SCU_SFSP4_10_EHD_Pos                                  8                                                         /*!< SCU SFSP4_10: EHD Position          */\r
+#define SCU_SFSP4_10_EHD_Msk                                  (0x03UL << SCU_SFSP4_10_EHD_Pos)                          /*!< SCU SFSP4_10: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSP5_0  ------------------------------------------\r
+#define SCU_SFSP5_0_MODE_Pos                                  0                                                         /*!< SCU SFSP5_0: MODE Position          */\r
+#define SCU_SFSP5_0_MODE_Msk                                  (0x07UL << SCU_SFSP5_0_MODE_Pos)                          /*!< SCU SFSP5_0: MODE Mask              */\r
+#define SCU_SFSP5_0_EPD_Pos                                   3                                                         /*!< SCU SFSP5_0: EPD Position           */\r
+#define SCU_SFSP5_0_EPD_Msk                                   (0x01UL << SCU_SFSP5_0_EPD_Pos)                           /*!< SCU SFSP5_0: EPD Mask               */\r
+#define SCU_SFSP5_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_0: EPUN Position          */\r
+#define SCU_SFSP5_0_EPUN_Msk                                  (0x01UL << SCU_SFSP5_0_EPUN_Pos)                          /*!< SCU SFSP5_0: EPUN Mask              */\r
+#define SCU_SFSP5_0_EHS_Pos                                   5                                                         /*!< SCU SFSP5_0: EHS Position           */\r
+#define SCU_SFSP5_0_EHS_Msk                                   (0x01UL << SCU_SFSP5_0_EHS_Pos)                           /*!< SCU SFSP5_0: EHS Mask               */\r
+#define SCU_SFSP5_0_EZI_Pos                                   6                                                         /*!< SCU SFSP5_0: EZI Position           */\r
+#define SCU_SFSP5_0_EZI_Msk                                   (0x01UL << SCU_SFSP5_0_EZI_Pos)                           /*!< SCU SFSP5_0: EZI Mask               */\r
+#define SCU_SFSP5_0_EHD_Pos                                   8                                                         /*!< SCU SFSP5_0: EHD Position           */\r
+#define SCU_SFSP5_0_EHD_Msk                                   (0x03UL << SCU_SFSP5_0_EHD_Pos)                           /*!< SCU SFSP5_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_1  ------------------------------------------\r
+#define SCU_SFSP5_1_MODE_Pos                                  0                                                         /*!< SCU SFSP5_1: MODE Position          */\r
+#define SCU_SFSP5_1_MODE_Msk                                  (0x07UL << SCU_SFSP5_1_MODE_Pos)                          /*!< SCU SFSP5_1: MODE Mask              */\r
+#define SCU_SFSP5_1_EPD_Pos                                   3                                                         /*!< SCU SFSP5_1: EPD Position           */\r
+#define SCU_SFSP5_1_EPD_Msk                                   (0x01UL << SCU_SFSP5_1_EPD_Pos)                           /*!< SCU SFSP5_1: EPD Mask               */\r
+#define SCU_SFSP5_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_1: EPUN Position          */\r
+#define SCU_SFSP5_1_EPUN_Msk                                  (0x01UL << SCU_SFSP5_1_EPUN_Pos)                          /*!< SCU SFSP5_1: EPUN Mask              */\r
+#define SCU_SFSP5_1_EHS_Pos                                   5                                                         /*!< SCU SFSP5_1: EHS Position           */\r
+#define SCU_SFSP5_1_EHS_Msk                                   (0x01UL << SCU_SFSP5_1_EHS_Pos)                           /*!< SCU SFSP5_1: EHS Mask               */\r
+#define SCU_SFSP5_1_EZI_Pos                                   6                                                         /*!< SCU SFSP5_1: EZI Position           */\r
+#define SCU_SFSP5_1_EZI_Msk                                   (0x01UL << SCU_SFSP5_1_EZI_Pos)                           /*!< SCU SFSP5_1: EZI Mask               */\r
+#define SCU_SFSP5_1_EHD_Pos                                   8                                                         /*!< SCU SFSP5_1: EHD Position           */\r
+#define SCU_SFSP5_1_EHD_Msk                                   (0x03UL << SCU_SFSP5_1_EHD_Pos)                           /*!< SCU SFSP5_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_2  ------------------------------------------\r
+#define SCU_SFSP5_2_MODE_Pos                                  0                                                         /*!< SCU SFSP5_2: MODE Position          */\r
+#define SCU_SFSP5_2_MODE_Msk                                  (0x07UL << SCU_SFSP5_2_MODE_Pos)                          /*!< SCU SFSP5_2: MODE Mask              */\r
+#define SCU_SFSP5_2_EPD_Pos                                   3                                                         /*!< SCU SFSP5_2: EPD Position           */\r
+#define SCU_SFSP5_2_EPD_Msk                                   (0x01UL << SCU_SFSP5_2_EPD_Pos)                           /*!< SCU SFSP5_2: EPD Mask               */\r
+#define SCU_SFSP5_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_2: EPUN Position          */\r
+#define SCU_SFSP5_2_EPUN_Msk                                  (0x01UL << SCU_SFSP5_2_EPUN_Pos)                          /*!< SCU SFSP5_2: EPUN Mask              */\r
+#define SCU_SFSP5_2_EHS_Pos                                   5                                                         /*!< SCU SFSP5_2: EHS Position           */\r
+#define SCU_SFSP5_2_EHS_Msk                                   (0x01UL << SCU_SFSP5_2_EHS_Pos)                           /*!< SCU SFSP5_2: EHS Mask               */\r
+#define SCU_SFSP5_2_EZI_Pos                                   6                                                         /*!< SCU SFSP5_2: EZI Position           */\r
+#define SCU_SFSP5_2_EZI_Msk                                   (0x01UL << SCU_SFSP5_2_EZI_Pos)                           /*!< SCU SFSP5_2: EZI Mask               */\r
+#define SCU_SFSP5_2_EHD_Pos                                   8                                                         /*!< SCU SFSP5_2: EHD Position           */\r
+#define SCU_SFSP5_2_EHD_Msk                                   (0x03UL << SCU_SFSP5_2_EHD_Pos)                           /*!< SCU SFSP5_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_3  ------------------------------------------\r
+#define SCU_SFSP5_3_MODE_Pos                                  0                                                         /*!< SCU SFSP5_3: MODE Position          */\r
+#define SCU_SFSP5_3_MODE_Msk                                  (0x07UL << SCU_SFSP5_3_MODE_Pos)                          /*!< SCU SFSP5_3: MODE Mask              */\r
+#define SCU_SFSP5_3_EPD_Pos                                   3                                                         /*!< SCU SFSP5_3: EPD Position           */\r
+#define SCU_SFSP5_3_EPD_Msk                                   (0x01UL << SCU_SFSP5_3_EPD_Pos)                           /*!< SCU SFSP5_3: EPD Mask               */\r
+#define SCU_SFSP5_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_3: EPUN Position          */\r
+#define SCU_SFSP5_3_EPUN_Msk                                  (0x01UL << SCU_SFSP5_3_EPUN_Pos)                          /*!< SCU SFSP5_3: EPUN Mask              */\r
+#define SCU_SFSP5_3_EHS_Pos                                   5                                                         /*!< SCU SFSP5_3: EHS Position           */\r
+#define SCU_SFSP5_3_EHS_Msk                                   (0x01UL << SCU_SFSP5_3_EHS_Pos)                           /*!< SCU SFSP5_3: EHS Mask               */\r
+#define SCU_SFSP5_3_EZI_Pos                                   6                                                         /*!< SCU SFSP5_3: EZI Position           */\r
+#define SCU_SFSP5_3_EZI_Msk                                   (0x01UL << SCU_SFSP5_3_EZI_Pos)                           /*!< SCU SFSP5_3: EZI Mask               */\r
+#define SCU_SFSP5_3_EHD_Pos                                   8                                                         /*!< SCU SFSP5_3: EHD Position           */\r
+#define SCU_SFSP5_3_EHD_Msk                                   (0x03UL << SCU_SFSP5_3_EHD_Pos)                           /*!< SCU SFSP5_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_4  ------------------------------------------\r
+#define SCU_SFSP5_4_MODE_Pos                                  0                                                         /*!< SCU SFSP5_4: MODE Position          */\r
+#define SCU_SFSP5_4_MODE_Msk                                  (0x07UL << SCU_SFSP5_4_MODE_Pos)                          /*!< SCU SFSP5_4: MODE Mask              */\r
+#define SCU_SFSP5_4_EPD_Pos                                   3                                                         /*!< SCU SFSP5_4: EPD Position           */\r
+#define SCU_SFSP5_4_EPD_Msk                                   (0x01UL << SCU_SFSP5_4_EPD_Pos)                           /*!< SCU SFSP5_4: EPD Mask               */\r
+#define SCU_SFSP5_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_4: EPUN Position          */\r
+#define SCU_SFSP5_4_EPUN_Msk                                  (0x01UL << SCU_SFSP5_4_EPUN_Pos)                          /*!< SCU SFSP5_4: EPUN Mask              */\r
+#define SCU_SFSP5_4_EHS_Pos                                   5                                                         /*!< SCU SFSP5_4: EHS Position           */\r
+#define SCU_SFSP5_4_EHS_Msk                                   (0x01UL << SCU_SFSP5_4_EHS_Pos)                           /*!< SCU SFSP5_4: EHS Mask               */\r
+#define SCU_SFSP5_4_EZI_Pos                                   6                                                         /*!< SCU SFSP5_4: EZI Position           */\r
+#define SCU_SFSP5_4_EZI_Msk                                   (0x01UL << SCU_SFSP5_4_EZI_Pos)                           /*!< SCU SFSP5_4: EZI Mask               */\r
+#define SCU_SFSP5_4_EHD_Pos                                   8                                                         /*!< SCU SFSP5_4: EHD Position           */\r
+#define SCU_SFSP5_4_EHD_Msk                                   (0x03UL << SCU_SFSP5_4_EHD_Pos)                           /*!< SCU SFSP5_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_5  ------------------------------------------\r
+#define SCU_SFSP5_5_MODE_Pos                                  0                                                         /*!< SCU SFSP5_5: MODE Position          */\r
+#define SCU_SFSP5_5_MODE_Msk                                  (0x07UL << SCU_SFSP5_5_MODE_Pos)                          /*!< SCU SFSP5_5: MODE Mask              */\r
+#define SCU_SFSP5_5_EPD_Pos                                   3                                                         /*!< SCU SFSP5_5: EPD Position           */\r
+#define SCU_SFSP5_5_EPD_Msk                                   (0x01UL << SCU_SFSP5_5_EPD_Pos)                           /*!< SCU SFSP5_5: EPD Mask               */\r
+#define SCU_SFSP5_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_5: EPUN Position          */\r
+#define SCU_SFSP5_5_EPUN_Msk                                  (0x01UL << SCU_SFSP5_5_EPUN_Pos)                          /*!< SCU SFSP5_5: EPUN Mask              */\r
+#define SCU_SFSP5_5_EHS_Pos                                   5                                                         /*!< SCU SFSP5_5: EHS Position           */\r
+#define SCU_SFSP5_5_EHS_Msk                                   (0x01UL << SCU_SFSP5_5_EHS_Pos)                           /*!< SCU SFSP5_5: EHS Mask               */\r
+#define SCU_SFSP5_5_EZI_Pos                                   6                                                         /*!< SCU SFSP5_5: EZI Position           */\r
+#define SCU_SFSP5_5_EZI_Msk                                   (0x01UL << SCU_SFSP5_5_EZI_Pos)                           /*!< SCU SFSP5_5: EZI Mask               */\r
+#define SCU_SFSP5_5_EHD_Pos                                   8                                                         /*!< SCU SFSP5_5: EHD Position           */\r
+#define SCU_SFSP5_5_EHD_Msk                                   (0x03UL << SCU_SFSP5_5_EHD_Pos)                           /*!< SCU SFSP5_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_6  ------------------------------------------\r
+#define SCU_SFSP5_6_MODE_Pos                                  0                                                         /*!< SCU SFSP5_6: MODE Position          */\r
+#define SCU_SFSP5_6_MODE_Msk                                  (0x07UL << SCU_SFSP5_6_MODE_Pos)                          /*!< SCU SFSP5_6: MODE Mask              */\r
+#define SCU_SFSP5_6_EPD_Pos                                   3                                                         /*!< SCU SFSP5_6: EPD Position           */\r
+#define SCU_SFSP5_6_EPD_Msk                                   (0x01UL << SCU_SFSP5_6_EPD_Pos)                           /*!< SCU SFSP5_6: EPD Mask               */\r
+#define SCU_SFSP5_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_6: EPUN Position          */\r
+#define SCU_SFSP5_6_EPUN_Msk                                  (0x01UL << SCU_SFSP5_6_EPUN_Pos)                          /*!< SCU SFSP5_6: EPUN Mask              */\r
+#define SCU_SFSP5_6_EHS_Pos                                   5                                                         /*!< SCU SFSP5_6: EHS Position           */\r
+#define SCU_SFSP5_6_EHS_Msk                                   (0x01UL << SCU_SFSP5_6_EHS_Pos)                           /*!< SCU SFSP5_6: EHS Mask               */\r
+#define SCU_SFSP5_6_EZI_Pos                                   6                                                         /*!< SCU SFSP5_6: EZI Position           */\r
+#define SCU_SFSP5_6_EZI_Msk                                   (0x01UL << SCU_SFSP5_6_EZI_Pos)                           /*!< SCU SFSP5_6: EZI Mask               */\r
+#define SCU_SFSP5_6_EHD_Pos                                   8                                                         /*!< SCU SFSP5_6: EHD Position           */\r
+#define SCU_SFSP5_6_EHD_Msk                                   (0x03UL << SCU_SFSP5_6_EHD_Pos)                           /*!< SCU SFSP5_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP5_7  ------------------------------------------\r
+#define SCU_SFSP5_7_MODE_Pos                                  0                                                         /*!< SCU SFSP5_7: MODE Position          */\r
+#define SCU_SFSP5_7_MODE_Msk                                  (0x07UL << SCU_SFSP5_7_MODE_Pos)                          /*!< SCU SFSP5_7: MODE Mask              */\r
+#define SCU_SFSP5_7_EPD_Pos                                   3                                                         /*!< SCU SFSP5_7: EPD Position           */\r
+#define SCU_SFSP5_7_EPD_Msk                                   (0x01UL << SCU_SFSP5_7_EPD_Pos)                           /*!< SCU SFSP5_7: EPD Mask               */\r
+#define SCU_SFSP5_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP5_7: EPUN Position          */\r
+#define SCU_SFSP5_7_EPUN_Msk                                  (0x01UL << SCU_SFSP5_7_EPUN_Pos)                          /*!< SCU SFSP5_7: EPUN Mask              */\r
+#define SCU_SFSP5_7_EHS_Pos                                   5                                                         /*!< SCU SFSP5_7: EHS Position           */\r
+#define SCU_SFSP5_7_EHS_Msk                                   (0x01UL << SCU_SFSP5_7_EHS_Pos)                           /*!< SCU SFSP5_7: EHS Mask               */\r
+#define SCU_SFSP5_7_EZI_Pos                                   6                                                         /*!< SCU SFSP5_7: EZI Position           */\r
+#define SCU_SFSP5_7_EZI_Msk                                   (0x01UL << SCU_SFSP5_7_EZI_Pos)                           /*!< SCU SFSP5_7: EZI Mask               */\r
+#define SCU_SFSP5_7_EHD_Pos                                   8                                                         /*!< SCU SFSP5_7: EHD Position           */\r
+#define SCU_SFSP5_7_EHD_Msk                                   (0x03UL << SCU_SFSP5_7_EHD_Pos)                           /*!< SCU SFSP5_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_0  ------------------------------------------\r
+#define SCU_SFSP6_0_MODE_Pos                                  0                                                         /*!< SCU SFSP6_0: MODE Position          */\r
+#define SCU_SFSP6_0_MODE_Msk                                  (0x07UL << SCU_SFSP6_0_MODE_Pos)                          /*!< SCU SFSP6_0: MODE Mask              */\r
+#define SCU_SFSP6_0_EPD_Pos                                   3                                                         /*!< SCU SFSP6_0: EPD Position           */\r
+#define SCU_SFSP6_0_EPD_Msk                                   (0x01UL << SCU_SFSP6_0_EPD_Pos)                           /*!< SCU SFSP6_0: EPD Mask               */\r
+#define SCU_SFSP6_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_0: EPUN Position          */\r
+#define SCU_SFSP6_0_EPUN_Msk                                  (0x01UL << SCU_SFSP6_0_EPUN_Pos)                          /*!< SCU SFSP6_0: EPUN Mask              */\r
+#define SCU_SFSP6_0_EHS_Pos                                   5                                                         /*!< SCU SFSP6_0: EHS Position           */\r
+#define SCU_SFSP6_0_EHS_Msk                                   (0x01UL << SCU_SFSP6_0_EHS_Pos)                           /*!< SCU SFSP6_0: EHS Mask               */\r
+#define SCU_SFSP6_0_EZI_Pos                                   6                                                         /*!< SCU SFSP6_0: EZI Position           */\r
+#define SCU_SFSP6_0_EZI_Msk                                   (0x01UL << SCU_SFSP6_0_EZI_Pos)                           /*!< SCU SFSP6_0: EZI Mask               */\r
+#define SCU_SFSP6_0_EHD_Pos                                   8                                                         /*!< SCU SFSP6_0: EHD Position           */\r
+#define SCU_SFSP6_0_EHD_Msk                                   (0x03UL << SCU_SFSP6_0_EHD_Pos)                           /*!< SCU SFSP6_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_1  ------------------------------------------\r
+#define SCU_SFSP6_1_MODE_Pos                                  0                                                         /*!< SCU SFSP6_1: MODE Position          */\r
+#define SCU_SFSP6_1_MODE_Msk                                  (0x07UL << SCU_SFSP6_1_MODE_Pos)                          /*!< SCU SFSP6_1: MODE Mask              */\r
+#define SCU_SFSP6_1_EPD_Pos                                   3                                                         /*!< SCU SFSP6_1: EPD Position           */\r
+#define SCU_SFSP6_1_EPD_Msk                                   (0x01UL << SCU_SFSP6_1_EPD_Pos)                           /*!< SCU SFSP6_1: EPD Mask               */\r
+#define SCU_SFSP6_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_1: EPUN Position          */\r
+#define SCU_SFSP6_1_EPUN_Msk                                  (0x01UL << SCU_SFSP6_1_EPUN_Pos)                          /*!< SCU SFSP6_1: EPUN Mask              */\r
+#define SCU_SFSP6_1_EHS_Pos                                   5                                                         /*!< SCU SFSP6_1: EHS Position           */\r
+#define SCU_SFSP6_1_EHS_Msk                                   (0x01UL << SCU_SFSP6_1_EHS_Pos)                           /*!< SCU SFSP6_1: EHS Mask               */\r
+#define SCU_SFSP6_1_EZI_Pos                                   6                                                         /*!< SCU SFSP6_1: EZI Position           */\r
+#define SCU_SFSP6_1_EZI_Msk                                   (0x01UL << SCU_SFSP6_1_EZI_Pos)                           /*!< SCU SFSP6_1: EZI Mask               */\r
+#define SCU_SFSP6_1_EHD_Pos                                   8                                                         /*!< SCU SFSP6_1: EHD Position           */\r
+#define SCU_SFSP6_1_EHD_Msk                                   (0x03UL << SCU_SFSP6_1_EHD_Pos)                           /*!< SCU SFSP6_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_2  ------------------------------------------\r
+#define SCU_SFSP6_2_MODE_Pos                                  0                                                         /*!< SCU SFSP6_2: MODE Position          */\r
+#define SCU_SFSP6_2_MODE_Msk                                  (0x07UL << SCU_SFSP6_2_MODE_Pos)                          /*!< SCU SFSP6_2: MODE Mask              */\r
+#define SCU_SFSP6_2_EPD_Pos                                   3                                                         /*!< SCU SFSP6_2: EPD Position           */\r
+#define SCU_SFSP6_2_EPD_Msk                                   (0x01UL << SCU_SFSP6_2_EPD_Pos)                           /*!< SCU SFSP6_2: EPD Mask               */\r
+#define SCU_SFSP6_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_2: EPUN Position          */\r
+#define SCU_SFSP6_2_EPUN_Msk                                  (0x01UL << SCU_SFSP6_2_EPUN_Pos)                          /*!< SCU SFSP6_2: EPUN Mask              */\r
+#define SCU_SFSP6_2_EHS_Pos                                   5                                                         /*!< SCU SFSP6_2: EHS Position           */\r
+#define SCU_SFSP6_2_EHS_Msk                                   (0x01UL << SCU_SFSP6_2_EHS_Pos)                           /*!< SCU SFSP6_2: EHS Mask               */\r
+#define SCU_SFSP6_2_EZI_Pos                                   6                                                         /*!< SCU SFSP6_2: EZI Position           */\r
+#define SCU_SFSP6_2_EZI_Msk                                   (0x01UL << SCU_SFSP6_2_EZI_Pos)                           /*!< SCU SFSP6_2: EZI Mask               */\r
+#define SCU_SFSP6_2_EHD_Pos                                   8                                                         /*!< SCU SFSP6_2: EHD Position           */\r
+#define SCU_SFSP6_2_EHD_Msk                                   (0x03UL << SCU_SFSP6_2_EHD_Pos)                           /*!< SCU SFSP6_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_3  ------------------------------------------\r
+#define SCU_SFSP6_3_MODE_Pos                                  0                                                         /*!< SCU SFSP6_3: MODE Position          */\r
+#define SCU_SFSP6_3_MODE_Msk                                  (0x07UL << SCU_SFSP6_3_MODE_Pos)                          /*!< SCU SFSP6_3: MODE Mask              */\r
+#define SCU_SFSP6_3_EPD_Pos                                   3                                                         /*!< SCU SFSP6_3: EPD Position           */\r
+#define SCU_SFSP6_3_EPD_Msk                                   (0x01UL << SCU_SFSP6_3_EPD_Pos)                           /*!< SCU SFSP6_3: EPD Mask               */\r
+#define SCU_SFSP6_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_3: EPUN Position          */\r
+#define SCU_SFSP6_3_EPUN_Msk                                  (0x01UL << SCU_SFSP6_3_EPUN_Pos)                          /*!< SCU SFSP6_3: EPUN Mask              */\r
+#define SCU_SFSP6_3_EHS_Pos                                   5                                                         /*!< SCU SFSP6_3: EHS Position           */\r
+#define SCU_SFSP6_3_EHS_Msk                                   (0x01UL << SCU_SFSP6_3_EHS_Pos)                           /*!< SCU SFSP6_3: EHS Mask               */\r
+#define SCU_SFSP6_3_EZI_Pos                                   6                                                         /*!< SCU SFSP6_3: EZI Position           */\r
+#define SCU_SFSP6_3_EZI_Msk                                   (0x01UL << SCU_SFSP6_3_EZI_Pos)                           /*!< SCU SFSP6_3: EZI Mask               */\r
+#define SCU_SFSP6_3_EHD_Pos                                   8                                                         /*!< SCU SFSP6_3: EHD Position           */\r
+#define SCU_SFSP6_3_EHD_Msk                                   (0x03UL << SCU_SFSP6_3_EHD_Pos)                           /*!< SCU SFSP6_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_4  ------------------------------------------\r
+#define SCU_SFSP6_4_MODE_Pos                                  0                                                         /*!< SCU SFSP6_4: MODE Position          */\r
+#define SCU_SFSP6_4_MODE_Msk                                  (0x07UL << SCU_SFSP6_4_MODE_Pos)                          /*!< SCU SFSP6_4: MODE Mask              */\r
+#define SCU_SFSP6_4_EPD_Pos                                   3                                                         /*!< SCU SFSP6_4: EPD Position           */\r
+#define SCU_SFSP6_4_EPD_Msk                                   (0x01UL << SCU_SFSP6_4_EPD_Pos)                           /*!< SCU SFSP6_4: EPD Mask               */\r
+#define SCU_SFSP6_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_4: EPUN Position          */\r
+#define SCU_SFSP6_4_EPUN_Msk                                  (0x01UL << SCU_SFSP6_4_EPUN_Pos)                          /*!< SCU SFSP6_4: EPUN Mask              */\r
+#define SCU_SFSP6_4_EHS_Pos                                   5                                                         /*!< SCU SFSP6_4: EHS Position           */\r
+#define SCU_SFSP6_4_EHS_Msk                                   (0x01UL << SCU_SFSP6_4_EHS_Pos)                           /*!< SCU SFSP6_4: EHS Mask               */\r
+#define SCU_SFSP6_4_EZI_Pos                                   6                                                         /*!< SCU SFSP6_4: EZI Position           */\r
+#define SCU_SFSP6_4_EZI_Msk                                   (0x01UL << SCU_SFSP6_4_EZI_Pos)                           /*!< SCU SFSP6_4: EZI Mask               */\r
+#define SCU_SFSP6_4_EHD_Pos                                   8                                                         /*!< SCU SFSP6_4: EHD Position           */\r
+#define SCU_SFSP6_4_EHD_Msk                                   (0x03UL << SCU_SFSP6_4_EHD_Pos)                           /*!< SCU SFSP6_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_5  ------------------------------------------\r
+#define SCU_SFSP6_5_MODE_Pos                                  0                                                         /*!< SCU SFSP6_5: MODE Position          */\r
+#define SCU_SFSP6_5_MODE_Msk                                  (0x07UL << SCU_SFSP6_5_MODE_Pos)                          /*!< SCU SFSP6_5: MODE Mask              */\r
+#define SCU_SFSP6_5_EPD_Pos                                   3                                                         /*!< SCU SFSP6_5: EPD Position           */\r
+#define SCU_SFSP6_5_EPD_Msk                                   (0x01UL << SCU_SFSP6_5_EPD_Pos)                           /*!< SCU SFSP6_5: EPD Mask               */\r
+#define SCU_SFSP6_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_5: EPUN Position          */\r
+#define SCU_SFSP6_5_EPUN_Msk                                  (0x01UL << SCU_SFSP6_5_EPUN_Pos)                          /*!< SCU SFSP6_5: EPUN Mask              */\r
+#define SCU_SFSP6_5_EHS_Pos                                   5                                                         /*!< SCU SFSP6_5: EHS Position           */\r
+#define SCU_SFSP6_5_EHS_Msk                                   (0x01UL << SCU_SFSP6_5_EHS_Pos)                           /*!< SCU SFSP6_5: EHS Mask               */\r
+#define SCU_SFSP6_5_EZI_Pos                                   6                                                         /*!< SCU SFSP6_5: EZI Position           */\r
+#define SCU_SFSP6_5_EZI_Msk                                   (0x01UL << SCU_SFSP6_5_EZI_Pos)                           /*!< SCU SFSP6_5: EZI Mask               */\r
+#define SCU_SFSP6_5_EHD_Pos                                   8                                                         /*!< SCU SFSP6_5: EHD Position           */\r
+#define SCU_SFSP6_5_EHD_Msk                                   (0x03UL << SCU_SFSP6_5_EHD_Pos)                           /*!< SCU SFSP6_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_6  ------------------------------------------\r
+#define SCU_SFSP6_6_MODE_Pos                                  0                                                         /*!< SCU SFSP6_6: MODE Position          */\r
+#define SCU_SFSP6_6_MODE_Msk                                  (0x07UL << SCU_SFSP6_6_MODE_Pos)                          /*!< SCU SFSP6_6: MODE Mask              */\r
+#define SCU_SFSP6_6_EPD_Pos                                   3                                                         /*!< SCU SFSP6_6: EPD Position           */\r
+#define SCU_SFSP6_6_EPD_Msk                                   (0x01UL << SCU_SFSP6_6_EPD_Pos)                           /*!< SCU SFSP6_6: EPD Mask               */\r
+#define SCU_SFSP6_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_6: EPUN Position          */\r
+#define SCU_SFSP6_6_EPUN_Msk                                  (0x01UL << SCU_SFSP6_6_EPUN_Pos)                          /*!< SCU SFSP6_6: EPUN Mask              */\r
+#define SCU_SFSP6_6_EHS_Pos                                   5                                                         /*!< SCU SFSP6_6: EHS Position           */\r
+#define SCU_SFSP6_6_EHS_Msk                                   (0x01UL << SCU_SFSP6_6_EHS_Pos)                           /*!< SCU SFSP6_6: EHS Mask               */\r
+#define SCU_SFSP6_6_EZI_Pos                                   6                                                         /*!< SCU SFSP6_6: EZI Position           */\r
+#define SCU_SFSP6_6_EZI_Msk                                   (0x01UL << SCU_SFSP6_6_EZI_Pos)                           /*!< SCU SFSP6_6: EZI Mask               */\r
+#define SCU_SFSP6_6_EHD_Pos                                   8                                                         /*!< SCU SFSP6_6: EHD Position           */\r
+#define SCU_SFSP6_6_EHD_Msk                                   (0x03UL << SCU_SFSP6_6_EHD_Pos)                           /*!< SCU SFSP6_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_7  ------------------------------------------\r
+#define SCU_SFSP6_7_MODE_Pos                                  0                                                         /*!< SCU SFSP6_7: MODE Position          */\r
+#define SCU_SFSP6_7_MODE_Msk                                  (0x07UL << SCU_SFSP6_7_MODE_Pos)                          /*!< SCU SFSP6_7: MODE Mask              */\r
+#define SCU_SFSP6_7_EPD_Pos                                   3                                                         /*!< SCU SFSP6_7: EPD Position           */\r
+#define SCU_SFSP6_7_EPD_Msk                                   (0x01UL << SCU_SFSP6_7_EPD_Pos)                           /*!< SCU SFSP6_7: EPD Mask               */\r
+#define SCU_SFSP6_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_7: EPUN Position          */\r
+#define SCU_SFSP6_7_EPUN_Msk                                  (0x01UL << SCU_SFSP6_7_EPUN_Pos)                          /*!< SCU SFSP6_7: EPUN Mask              */\r
+#define SCU_SFSP6_7_EHS_Pos                                   5                                                         /*!< SCU SFSP6_7: EHS Position           */\r
+#define SCU_SFSP6_7_EHS_Msk                                   (0x01UL << SCU_SFSP6_7_EHS_Pos)                           /*!< SCU SFSP6_7: EHS Mask               */\r
+#define SCU_SFSP6_7_EZI_Pos                                   6                                                         /*!< SCU SFSP6_7: EZI Position           */\r
+#define SCU_SFSP6_7_EZI_Msk                                   (0x01UL << SCU_SFSP6_7_EZI_Pos)                           /*!< SCU SFSP6_7: EZI Mask               */\r
+#define SCU_SFSP6_7_EHD_Pos                                   8                                                         /*!< SCU SFSP6_7: EHD Position           */\r
+#define SCU_SFSP6_7_EHD_Msk                                   (0x03UL << SCU_SFSP6_7_EHD_Pos)                           /*!< SCU SFSP6_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_8  ------------------------------------------\r
+#define SCU_SFSP6_8_MODE_Pos                                  0                                                         /*!< SCU SFSP6_8: MODE Position          */\r
+#define SCU_SFSP6_8_MODE_Msk                                  (0x07UL << SCU_SFSP6_8_MODE_Pos)                          /*!< SCU SFSP6_8: MODE Mask              */\r
+#define SCU_SFSP6_8_EPD_Pos                                   3                                                         /*!< SCU SFSP6_8: EPD Position           */\r
+#define SCU_SFSP6_8_EPD_Msk                                   (0x01UL << SCU_SFSP6_8_EPD_Pos)                           /*!< SCU SFSP6_8: EPD Mask               */\r
+#define SCU_SFSP6_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_8: EPUN Position          */\r
+#define SCU_SFSP6_8_EPUN_Msk                                  (0x01UL << SCU_SFSP6_8_EPUN_Pos)                          /*!< SCU SFSP6_8: EPUN Mask              */\r
+#define SCU_SFSP6_8_EHS_Pos                                   5                                                         /*!< SCU SFSP6_8: EHS Position           */\r
+#define SCU_SFSP6_8_EHS_Msk                                   (0x01UL << SCU_SFSP6_8_EHS_Pos)                           /*!< SCU SFSP6_8: EHS Mask               */\r
+#define SCU_SFSP6_8_EZI_Pos                                   6                                                         /*!< SCU SFSP6_8: EZI Position           */\r
+#define SCU_SFSP6_8_EZI_Msk                                   (0x01UL << SCU_SFSP6_8_EZI_Pos)                           /*!< SCU SFSP6_8: EZI Mask               */\r
+#define SCU_SFSP6_8_EHD_Pos                                   8                                                         /*!< SCU SFSP6_8: EHD Position           */\r
+#define SCU_SFSP6_8_EHD_Msk                                   (0x03UL << SCU_SFSP6_8_EHD_Pos)                           /*!< SCU SFSP6_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP6_9  ------------------------------------------\r
+#define SCU_SFSP6_9_MODE_Pos                                  0                                                         /*!< SCU SFSP6_9: MODE Position          */\r
+#define SCU_SFSP6_9_MODE_Msk                                  (0x07UL << SCU_SFSP6_9_MODE_Pos)                          /*!< SCU SFSP6_9: MODE Mask              */\r
+#define SCU_SFSP6_9_EPD_Pos                                   3                                                         /*!< SCU SFSP6_9: EPD Position           */\r
+#define SCU_SFSP6_9_EPD_Msk                                   (0x01UL << SCU_SFSP6_9_EPD_Pos)                           /*!< SCU SFSP6_9: EPD Mask               */\r
+#define SCU_SFSP6_9_EPUN_Pos                                  4                                                         /*!< SCU SFSP6_9: EPUN Position          */\r
+#define SCU_SFSP6_9_EPUN_Msk                                  (0x01UL << SCU_SFSP6_9_EPUN_Pos)                          /*!< SCU SFSP6_9: EPUN Mask              */\r
+#define SCU_SFSP6_9_EHS_Pos                                   5                                                         /*!< SCU SFSP6_9: EHS Position           */\r
+#define SCU_SFSP6_9_EHS_Msk                                   (0x01UL << SCU_SFSP6_9_EHS_Pos)                           /*!< SCU SFSP6_9: EHS Mask               */\r
+#define SCU_SFSP6_9_EZI_Pos                                   6                                                         /*!< SCU SFSP6_9: EZI Position           */\r
+#define SCU_SFSP6_9_EZI_Msk                                   (0x01UL << SCU_SFSP6_9_EZI_Pos)                           /*!< SCU SFSP6_9: EZI Mask               */\r
+#define SCU_SFSP6_9_EHD_Pos                                   8                                                         /*!< SCU SFSP6_9: EHD Position           */\r
+#define SCU_SFSP6_9_EHD_Msk                                   (0x03UL << SCU_SFSP6_9_EHD_Pos)                           /*!< SCU SFSP6_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSP6_10  ------------------------------------------\r
+#define SCU_SFSP6_10_MODE_Pos                                 0                                                         /*!< SCU SFSP6_10: MODE Position         */\r
+#define SCU_SFSP6_10_MODE_Msk                                 (0x07UL << SCU_SFSP6_10_MODE_Pos)                         /*!< SCU SFSP6_10: MODE Mask             */\r
+#define SCU_SFSP6_10_EPD_Pos                                  3                                                         /*!< SCU SFSP6_10: EPD Position          */\r
+#define SCU_SFSP6_10_EPD_Msk                                  (0x01UL << SCU_SFSP6_10_EPD_Pos)                          /*!< SCU SFSP6_10: EPD Mask              */\r
+#define SCU_SFSP6_10_EPUN_Pos                                 4                                                         /*!< SCU SFSP6_10: EPUN Position         */\r
+#define SCU_SFSP6_10_EPUN_Msk                                 (0x01UL << SCU_SFSP6_10_EPUN_Pos)                         /*!< SCU SFSP6_10: EPUN Mask             */\r
+#define SCU_SFSP6_10_EHS_Pos                                  5                                                         /*!< SCU SFSP6_10: EHS Position          */\r
+#define SCU_SFSP6_10_EHS_Msk                                  (0x01UL << SCU_SFSP6_10_EHS_Pos)                          /*!< SCU SFSP6_10: EHS Mask              */\r
+#define SCU_SFSP6_10_EZI_Pos                                  6                                                         /*!< SCU SFSP6_10: EZI Position          */\r
+#define SCU_SFSP6_10_EZI_Msk                                  (0x01UL << SCU_SFSP6_10_EZI_Pos)                          /*!< SCU SFSP6_10: EZI Mask              */\r
+#define SCU_SFSP6_10_EHD_Pos                                  8                                                         /*!< SCU SFSP6_10: EHD Position          */\r
+#define SCU_SFSP6_10_EHD_Msk                                  (0x03UL << SCU_SFSP6_10_EHD_Pos)                          /*!< SCU SFSP6_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP6_11  ------------------------------------------\r
+#define SCU_SFSP6_11_MODE_Pos                                 0                                                         /*!< SCU SFSP6_11: MODE Position         */\r
+#define SCU_SFSP6_11_MODE_Msk                                 (0x07UL << SCU_SFSP6_11_MODE_Pos)                         /*!< SCU SFSP6_11: MODE Mask             */\r
+#define SCU_SFSP6_11_EPD_Pos                                  3                                                         /*!< SCU SFSP6_11: EPD Position          */\r
+#define SCU_SFSP6_11_EPD_Msk                                  (0x01UL << SCU_SFSP6_11_EPD_Pos)                          /*!< SCU SFSP6_11: EPD Mask              */\r
+#define SCU_SFSP6_11_EPUN_Pos                                 4                                                         /*!< SCU SFSP6_11: EPUN Position         */\r
+#define SCU_SFSP6_11_EPUN_Msk                                 (0x01UL << SCU_SFSP6_11_EPUN_Pos)                         /*!< SCU SFSP6_11: EPUN Mask             */\r
+#define SCU_SFSP6_11_EHS_Pos                                  5                                                         /*!< SCU SFSP6_11: EHS Position          */\r
+#define SCU_SFSP6_11_EHS_Msk                                  (0x01UL << SCU_SFSP6_11_EHS_Pos)                          /*!< SCU SFSP6_11: EHS Mask              */\r
+#define SCU_SFSP6_11_EZI_Pos                                  6                                                         /*!< SCU SFSP6_11: EZI Position          */\r
+#define SCU_SFSP6_11_EZI_Msk                                  (0x01UL << SCU_SFSP6_11_EZI_Pos)                          /*!< SCU SFSP6_11: EZI Mask              */\r
+#define SCU_SFSP6_11_EHD_Pos                                  8                                                         /*!< SCU SFSP6_11: EHD Position          */\r
+#define SCU_SFSP6_11_EHD_Msk                                  (0x03UL << SCU_SFSP6_11_EHD_Pos)                          /*!< SCU SFSP6_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSP6_12  ------------------------------------------\r
+#define SCU_SFSP6_12_MODE_Pos                                 0                                                         /*!< SCU SFSP6_12: MODE Position         */\r
+#define SCU_SFSP6_12_MODE_Msk                                 (0x07UL << SCU_SFSP6_12_MODE_Pos)                         /*!< SCU SFSP6_12: MODE Mask             */\r
+#define SCU_SFSP6_12_EPD_Pos                                  3                                                         /*!< SCU SFSP6_12: EPD Position          */\r
+#define SCU_SFSP6_12_EPD_Msk                                  (0x01UL << SCU_SFSP6_12_EPD_Pos)                          /*!< SCU SFSP6_12: EPD Mask              */\r
+#define SCU_SFSP6_12_EPUN_Pos                                 4                                                         /*!< SCU SFSP6_12: EPUN Position         */\r
+#define SCU_SFSP6_12_EPUN_Msk                                 (0x01UL << SCU_SFSP6_12_EPUN_Pos)                         /*!< SCU SFSP6_12: EPUN Mask             */\r
+#define SCU_SFSP6_12_EHS_Pos                                  5                                                         /*!< SCU SFSP6_12: EHS Position          */\r
+#define SCU_SFSP6_12_EHS_Msk                                  (0x01UL << SCU_SFSP6_12_EHS_Pos)                          /*!< SCU SFSP6_12: EHS Mask              */\r
+#define SCU_SFSP6_12_EZI_Pos                                  6                                                         /*!< SCU SFSP6_12: EZI Position          */\r
+#define SCU_SFSP6_12_EZI_Msk                                  (0x01UL << SCU_SFSP6_12_EZI_Pos)                          /*!< SCU SFSP6_12: EZI Mask              */\r
+#define SCU_SFSP6_12_EHD_Pos                                  8                                                         /*!< SCU SFSP6_12: EHD Position          */\r
+#define SCU_SFSP6_12_EHD_Msk                                  (0x03UL << SCU_SFSP6_12_EHD_Pos)                          /*!< SCU SFSP6_12: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSP7_0  ------------------------------------------\r
+#define SCU_SFSP7_0_MODE_Pos                                  0                                                         /*!< SCU SFSP7_0: MODE Position          */\r
+#define SCU_SFSP7_0_MODE_Msk                                  (0x07UL << SCU_SFSP7_0_MODE_Pos)                          /*!< SCU SFSP7_0: MODE Mask              */\r
+#define SCU_SFSP7_0_EPD_Pos                                   3                                                         /*!< SCU SFSP7_0: EPD Position           */\r
+#define SCU_SFSP7_0_EPD_Msk                                   (0x01UL << SCU_SFSP7_0_EPD_Pos)                           /*!< SCU SFSP7_0: EPD Mask               */\r
+#define SCU_SFSP7_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_0: EPUN Position          */\r
+#define SCU_SFSP7_0_EPUN_Msk                                  (0x01UL << SCU_SFSP7_0_EPUN_Pos)                          /*!< SCU SFSP7_0: EPUN Mask              */\r
+#define SCU_SFSP7_0_EHS_Pos                                   5                                                         /*!< SCU SFSP7_0: EHS Position           */\r
+#define SCU_SFSP7_0_EHS_Msk                                   (0x01UL << SCU_SFSP7_0_EHS_Pos)                           /*!< SCU SFSP7_0: EHS Mask               */\r
+#define SCU_SFSP7_0_EZI_Pos                                   6                                                         /*!< SCU SFSP7_0: EZI Position           */\r
+#define SCU_SFSP7_0_EZI_Msk                                   (0x01UL << SCU_SFSP7_0_EZI_Pos)                           /*!< SCU SFSP7_0: EZI Mask               */\r
+#define SCU_SFSP7_0_EHD_Pos                                   8                                                         /*!< SCU SFSP7_0: EHD Position           */\r
+#define SCU_SFSP7_0_EHD_Msk                                   (0x03UL << SCU_SFSP7_0_EHD_Pos)                           /*!< SCU SFSP7_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_1  ------------------------------------------\r
+#define SCU_SFSP7_1_MODE_Pos                                  0                                                         /*!< SCU SFSP7_1: MODE Position          */\r
+#define SCU_SFSP7_1_MODE_Msk                                  (0x07UL << SCU_SFSP7_1_MODE_Pos)                          /*!< SCU SFSP7_1: MODE Mask              */\r
+#define SCU_SFSP7_1_EPD_Pos                                   3                                                         /*!< SCU SFSP7_1: EPD Position           */\r
+#define SCU_SFSP7_1_EPD_Msk                                   (0x01UL << SCU_SFSP7_1_EPD_Pos)                           /*!< SCU SFSP7_1: EPD Mask               */\r
+#define SCU_SFSP7_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_1: EPUN Position          */\r
+#define SCU_SFSP7_1_EPUN_Msk                                  (0x01UL << SCU_SFSP7_1_EPUN_Pos)                          /*!< SCU SFSP7_1: EPUN Mask              */\r
+#define SCU_SFSP7_1_EHS_Pos                                   5                                                         /*!< SCU SFSP7_1: EHS Position           */\r
+#define SCU_SFSP7_1_EHS_Msk                                   (0x01UL << SCU_SFSP7_1_EHS_Pos)                           /*!< SCU SFSP7_1: EHS Mask               */\r
+#define SCU_SFSP7_1_EZI_Pos                                   6                                                         /*!< SCU SFSP7_1: EZI Position           */\r
+#define SCU_SFSP7_1_EZI_Msk                                   (0x01UL << SCU_SFSP7_1_EZI_Pos)                           /*!< SCU SFSP7_1: EZI Mask               */\r
+#define SCU_SFSP7_1_EHD_Pos                                   8                                                         /*!< SCU SFSP7_1: EHD Position           */\r
+#define SCU_SFSP7_1_EHD_Msk                                   (0x03UL << SCU_SFSP7_1_EHD_Pos)                           /*!< SCU SFSP7_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_2  ------------------------------------------\r
+#define SCU_SFSP7_2_MODE_Pos                                  0                                                         /*!< SCU SFSP7_2: MODE Position          */\r
+#define SCU_SFSP7_2_MODE_Msk                                  (0x07UL << SCU_SFSP7_2_MODE_Pos)                          /*!< SCU SFSP7_2: MODE Mask              */\r
+#define SCU_SFSP7_2_EPD_Pos                                   3                                                         /*!< SCU SFSP7_2: EPD Position           */\r
+#define SCU_SFSP7_2_EPD_Msk                                   (0x01UL << SCU_SFSP7_2_EPD_Pos)                           /*!< SCU SFSP7_2: EPD Mask               */\r
+#define SCU_SFSP7_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_2: EPUN Position          */\r
+#define SCU_SFSP7_2_EPUN_Msk                                  (0x01UL << SCU_SFSP7_2_EPUN_Pos)                          /*!< SCU SFSP7_2: EPUN Mask              */\r
+#define SCU_SFSP7_2_EHS_Pos                                   5                                                         /*!< SCU SFSP7_2: EHS Position           */\r
+#define SCU_SFSP7_2_EHS_Msk                                   (0x01UL << SCU_SFSP7_2_EHS_Pos)                           /*!< SCU SFSP7_2: EHS Mask               */\r
+#define SCU_SFSP7_2_EZI_Pos                                   6                                                         /*!< SCU SFSP7_2: EZI Position           */\r
+#define SCU_SFSP7_2_EZI_Msk                                   (0x01UL << SCU_SFSP7_2_EZI_Pos)                           /*!< SCU SFSP7_2: EZI Mask               */\r
+#define SCU_SFSP7_2_EHD_Pos                                   8                                                         /*!< SCU SFSP7_2: EHD Position           */\r
+#define SCU_SFSP7_2_EHD_Msk                                   (0x03UL << SCU_SFSP7_2_EHD_Pos)                           /*!< SCU SFSP7_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_3  ------------------------------------------\r
+#define SCU_SFSP7_3_MODE_Pos                                  0                                                         /*!< SCU SFSP7_3: MODE Position          */\r
+#define SCU_SFSP7_3_MODE_Msk                                  (0x07UL << SCU_SFSP7_3_MODE_Pos)                          /*!< SCU SFSP7_3: MODE Mask              */\r
+#define SCU_SFSP7_3_EPD_Pos                                   3                                                         /*!< SCU SFSP7_3: EPD Position           */\r
+#define SCU_SFSP7_3_EPD_Msk                                   (0x01UL << SCU_SFSP7_3_EPD_Pos)                           /*!< SCU SFSP7_3: EPD Mask               */\r
+#define SCU_SFSP7_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_3: EPUN Position          */\r
+#define SCU_SFSP7_3_EPUN_Msk                                  (0x01UL << SCU_SFSP7_3_EPUN_Pos)                          /*!< SCU SFSP7_3: EPUN Mask              */\r
+#define SCU_SFSP7_3_EHS_Pos                                   5                                                         /*!< SCU SFSP7_3: EHS Position           */\r
+#define SCU_SFSP7_3_EHS_Msk                                   (0x01UL << SCU_SFSP7_3_EHS_Pos)                           /*!< SCU SFSP7_3: EHS Mask               */\r
+#define SCU_SFSP7_3_EZI_Pos                                   6                                                         /*!< SCU SFSP7_3: EZI Position           */\r
+#define SCU_SFSP7_3_EZI_Msk                                   (0x01UL << SCU_SFSP7_3_EZI_Pos)                           /*!< SCU SFSP7_3: EZI Mask               */\r
+#define SCU_SFSP7_3_EHD_Pos                                   8                                                         /*!< SCU SFSP7_3: EHD Position           */\r
+#define SCU_SFSP7_3_EHD_Msk                                   (0x03UL << SCU_SFSP7_3_EHD_Pos)                           /*!< SCU SFSP7_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_4  ------------------------------------------\r
+#define SCU_SFSP7_4_MODE_Pos                                  0                                                         /*!< SCU SFSP7_4: MODE Position          */\r
+#define SCU_SFSP7_4_MODE_Msk                                  (0x07UL << SCU_SFSP7_4_MODE_Pos)                          /*!< SCU SFSP7_4: MODE Mask              */\r
+#define SCU_SFSP7_4_EPD_Pos                                   3                                                         /*!< SCU SFSP7_4: EPD Position           */\r
+#define SCU_SFSP7_4_EPD_Msk                                   (0x01UL << SCU_SFSP7_4_EPD_Pos)                           /*!< SCU SFSP7_4: EPD Mask               */\r
+#define SCU_SFSP7_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_4: EPUN Position          */\r
+#define SCU_SFSP7_4_EPUN_Msk                                  (0x01UL << SCU_SFSP7_4_EPUN_Pos)                          /*!< SCU SFSP7_4: EPUN Mask              */\r
+#define SCU_SFSP7_4_EHS_Pos                                   5                                                         /*!< SCU SFSP7_4: EHS Position           */\r
+#define SCU_SFSP7_4_EHS_Msk                                   (0x01UL << SCU_SFSP7_4_EHS_Pos)                           /*!< SCU SFSP7_4: EHS Mask               */\r
+#define SCU_SFSP7_4_EZI_Pos                                   6                                                         /*!< SCU SFSP7_4: EZI Position           */\r
+#define SCU_SFSP7_4_EZI_Msk                                   (0x01UL << SCU_SFSP7_4_EZI_Pos)                           /*!< SCU SFSP7_4: EZI Mask               */\r
+#define SCU_SFSP7_4_EHD_Pos                                   8                                                         /*!< SCU SFSP7_4: EHD Position           */\r
+#define SCU_SFSP7_4_EHD_Msk                                   (0x03UL << SCU_SFSP7_4_EHD_Pos)                           /*!< SCU SFSP7_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_5  ------------------------------------------\r
+#define SCU_SFSP7_5_MODE_Pos                                  0                                                         /*!< SCU SFSP7_5: MODE Position          */\r
+#define SCU_SFSP7_5_MODE_Msk                                  (0x07UL << SCU_SFSP7_5_MODE_Pos)                          /*!< SCU SFSP7_5: MODE Mask              */\r
+#define SCU_SFSP7_5_EPD_Pos                                   3                                                         /*!< SCU SFSP7_5: EPD Position           */\r
+#define SCU_SFSP7_5_EPD_Msk                                   (0x01UL << SCU_SFSP7_5_EPD_Pos)                           /*!< SCU SFSP7_5: EPD Mask               */\r
+#define SCU_SFSP7_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_5: EPUN Position          */\r
+#define SCU_SFSP7_5_EPUN_Msk                                  (0x01UL << SCU_SFSP7_5_EPUN_Pos)                          /*!< SCU SFSP7_5: EPUN Mask              */\r
+#define SCU_SFSP7_5_EHS_Pos                                   5                                                         /*!< SCU SFSP7_5: EHS Position           */\r
+#define SCU_SFSP7_5_EHS_Msk                                   (0x01UL << SCU_SFSP7_5_EHS_Pos)                           /*!< SCU SFSP7_5: EHS Mask               */\r
+#define SCU_SFSP7_5_EZI_Pos                                   6                                                         /*!< SCU SFSP7_5: EZI Position           */\r
+#define SCU_SFSP7_5_EZI_Msk                                   (0x01UL << SCU_SFSP7_5_EZI_Pos)                           /*!< SCU SFSP7_5: EZI Mask               */\r
+#define SCU_SFSP7_5_EHD_Pos                                   8                                                         /*!< SCU SFSP7_5: EHD Position           */\r
+#define SCU_SFSP7_5_EHD_Msk                                   (0x03UL << SCU_SFSP7_5_EHD_Pos)                           /*!< SCU SFSP7_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_6  ------------------------------------------\r
+#define SCU_SFSP7_6_MODE_Pos                                  0                                                         /*!< SCU SFSP7_6: MODE Position          */\r
+#define SCU_SFSP7_6_MODE_Msk                                  (0x07UL << SCU_SFSP7_6_MODE_Pos)                          /*!< SCU SFSP7_6: MODE Mask              */\r
+#define SCU_SFSP7_6_EPD_Pos                                   3                                                         /*!< SCU SFSP7_6: EPD Position           */\r
+#define SCU_SFSP7_6_EPD_Msk                                   (0x01UL << SCU_SFSP7_6_EPD_Pos)                           /*!< SCU SFSP7_6: EPD Mask               */\r
+#define SCU_SFSP7_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_6: EPUN Position          */\r
+#define SCU_SFSP7_6_EPUN_Msk                                  (0x01UL << SCU_SFSP7_6_EPUN_Pos)                          /*!< SCU SFSP7_6: EPUN Mask              */\r
+#define SCU_SFSP7_6_EHS_Pos                                   5                                                         /*!< SCU SFSP7_6: EHS Position           */\r
+#define SCU_SFSP7_6_EHS_Msk                                   (0x01UL << SCU_SFSP7_6_EHS_Pos)                           /*!< SCU SFSP7_6: EHS Mask               */\r
+#define SCU_SFSP7_6_EZI_Pos                                   6                                                         /*!< SCU SFSP7_6: EZI Position           */\r
+#define SCU_SFSP7_6_EZI_Msk                                   (0x01UL << SCU_SFSP7_6_EZI_Pos)                           /*!< SCU SFSP7_6: EZI Mask               */\r
+#define SCU_SFSP7_6_EHD_Pos                                   8                                                         /*!< SCU SFSP7_6: EHD Position           */\r
+#define SCU_SFSP7_6_EHD_Msk                                   (0x03UL << SCU_SFSP7_6_EHD_Pos)                           /*!< SCU SFSP7_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP7_7  ------------------------------------------\r
+#define SCU_SFSP7_7_MODE_Pos                                  0                                                         /*!< SCU SFSP7_7: MODE Position          */\r
+#define SCU_SFSP7_7_MODE_Msk                                  (0x07UL << SCU_SFSP7_7_MODE_Pos)                          /*!< SCU SFSP7_7: MODE Mask              */\r
+#define SCU_SFSP7_7_EPD_Pos                                   3                                                         /*!< SCU SFSP7_7: EPD Position           */\r
+#define SCU_SFSP7_7_EPD_Msk                                   (0x01UL << SCU_SFSP7_7_EPD_Pos)                           /*!< SCU SFSP7_7: EPD Mask               */\r
+#define SCU_SFSP7_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP7_7: EPUN Position          */\r
+#define SCU_SFSP7_7_EPUN_Msk                                  (0x01UL << SCU_SFSP7_7_EPUN_Pos)                          /*!< SCU SFSP7_7: EPUN Mask              */\r
+#define SCU_SFSP7_7_EHS_Pos                                   5                                                         /*!< SCU SFSP7_7: EHS Position           */\r
+#define SCU_SFSP7_7_EHS_Msk                                   (0x01UL << SCU_SFSP7_7_EHS_Pos)                           /*!< SCU SFSP7_7: EHS Mask               */\r
+#define SCU_SFSP7_7_EZI_Pos                                   6                                                         /*!< SCU SFSP7_7: EZI Position           */\r
+#define SCU_SFSP7_7_EZI_Msk                                   (0x01UL << SCU_SFSP7_7_EZI_Pos)                           /*!< SCU SFSP7_7: EZI Mask               */\r
+#define SCU_SFSP7_7_EHD_Pos                                   8                                                         /*!< SCU SFSP7_7: EHD Position           */\r
+#define SCU_SFSP7_7_EHD_Msk                                   (0x03UL << SCU_SFSP7_7_EHD_Pos)                           /*!< SCU SFSP7_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_0  ------------------------------------------\r
+#define SCU_SFSP8_0_MODE_Pos                                  0                                                         /*!< SCU SFSP8_0: MODE Position          */\r
+#define SCU_SFSP8_0_MODE_Msk                                  (0x07UL << SCU_SFSP8_0_MODE_Pos)                          /*!< SCU SFSP8_0: MODE Mask              */\r
+#define SCU_SFSP8_0_EPD_Pos                                   3                                                         /*!< SCU SFSP8_0: EPD Position           */\r
+#define SCU_SFSP8_0_EPD_Msk                                   (0x01UL << SCU_SFSP8_0_EPD_Pos)                           /*!< SCU SFSP8_0: EPD Mask               */\r
+#define SCU_SFSP8_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_0: EPUN Position          */\r
+#define SCU_SFSP8_0_EPUN_Msk                                  (0x01UL << SCU_SFSP8_0_EPUN_Pos)                          /*!< SCU SFSP8_0: EPUN Mask              */\r
+#define SCU_SFSP8_0_EHS_Pos                                   5                                                         /*!< SCU SFSP8_0: EHS Position           */\r
+#define SCU_SFSP8_0_EHS_Msk                                   (0x01UL << SCU_SFSP8_0_EHS_Pos)                           /*!< SCU SFSP8_0: EHS Mask               */\r
+#define SCU_SFSP8_0_EZI_Pos                                   6                                                         /*!< SCU SFSP8_0: EZI Position           */\r
+#define SCU_SFSP8_0_EZI_Msk                                   (0x01UL << SCU_SFSP8_0_EZI_Pos)                           /*!< SCU SFSP8_0: EZI Mask               */\r
+#define SCU_SFSP8_0_EHD_Pos                                   8                                                         /*!< SCU SFSP8_0: EHD Position           */\r
+#define SCU_SFSP8_0_EHD_Msk                                   (0x03UL << SCU_SFSP8_0_EHD_Pos)                           /*!< SCU SFSP8_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_1  ------------------------------------------\r
+#define SCU_SFSP8_1_MODE_Pos                                  0                                                         /*!< SCU SFSP8_1: MODE Position          */\r
+#define SCU_SFSP8_1_MODE_Msk                                  (0x07UL << SCU_SFSP8_1_MODE_Pos)                          /*!< SCU SFSP8_1: MODE Mask              */\r
+#define SCU_SFSP8_1_EPD_Pos                                   3                                                         /*!< SCU SFSP8_1: EPD Position           */\r
+#define SCU_SFSP8_1_EPD_Msk                                   (0x01UL << SCU_SFSP8_1_EPD_Pos)                           /*!< SCU SFSP8_1: EPD Mask               */\r
+#define SCU_SFSP8_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_1: EPUN Position          */\r
+#define SCU_SFSP8_1_EPUN_Msk                                  (0x01UL << SCU_SFSP8_1_EPUN_Pos)                          /*!< SCU SFSP8_1: EPUN Mask              */\r
+#define SCU_SFSP8_1_EHS_Pos                                   5                                                         /*!< SCU SFSP8_1: EHS Position           */\r
+#define SCU_SFSP8_1_EHS_Msk                                   (0x01UL << SCU_SFSP8_1_EHS_Pos)                           /*!< SCU SFSP8_1: EHS Mask               */\r
+#define SCU_SFSP8_1_EZI_Pos                                   6                                                         /*!< SCU SFSP8_1: EZI Position           */\r
+#define SCU_SFSP8_1_EZI_Msk                                   (0x01UL << SCU_SFSP8_1_EZI_Pos)                           /*!< SCU SFSP8_1: EZI Mask               */\r
+#define SCU_SFSP8_1_EHD_Pos                                   8                                                         /*!< SCU SFSP8_1: EHD Position           */\r
+#define SCU_SFSP8_1_EHD_Msk                                   (0x03UL << SCU_SFSP8_1_EHD_Pos)                           /*!< SCU SFSP8_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_2  ------------------------------------------\r
+#define SCU_SFSP8_2_MODE_Pos                                  0                                                         /*!< SCU SFSP8_2: MODE Position          */\r
+#define SCU_SFSP8_2_MODE_Msk                                  (0x07UL << SCU_SFSP8_2_MODE_Pos)                          /*!< SCU SFSP8_2: MODE Mask              */\r
+#define SCU_SFSP8_2_EPD_Pos                                   3                                                         /*!< SCU SFSP8_2: EPD Position           */\r
+#define SCU_SFSP8_2_EPD_Msk                                   (0x01UL << SCU_SFSP8_2_EPD_Pos)                           /*!< SCU SFSP8_2: EPD Mask               */\r
+#define SCU_SFSP8_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_2: EPUN Position          */\r
+#define SCU_SFSP8_2_EPUN_Msk                                  (0x01UL << SCU_SFSP8_2_EPUN_Pos)                          /*!< SCU SFSP8_2: EPUN Mask              */\r
+#define SCU_SFSP8_2_EHS_Pos                                   5                                                         /*!< SCU SFSP8_2: EHS Position           */\r
+#define SCU_SFSP8_2_EHS_Msk                                   (0x01UL << SCU_SFSP8_2_EHS_Pos)                           /*!< SCU SFSP8_2: EHS Mask               */\r
+#define SCU_SFSP8_2_EZI_Pos                                   6                                                         /*!< SCU SFSP8_2: EZI Position           */\r
+#define SCU_SFSP8_2_EZI_Msk                                   (0x01UL << SCU_SFSP8_2_EZI_Pos)                           /*!< SCU SFSP8_2: EZI Mask               */\r
+#define SCU_SFSP8_2_EHD_Pos                                   8                                                         /*!< SCU SFSP8_2: EHD Position           */\r
+#define SCU_SFSP8_2_EHD_Msk                                   (0x03UL << SCU_SFSP8_2_EHD_Pos)                           /*!< SCU SFSP8_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_3  ------------------------------------------\r
+#define SCU_SFSP8_3_MODE_Pos                                  0                                                         /*!< SCU SFSP8_3: MODE Position          */\r
+#define SCU_SFSP8_3_MODE_Msk                                  (0x07UL << SCU_SFSP8_3_MODE_Pos)                          /*!< SCU SFSP8_3: MODE Mask              */\r
+#define SCU_SFSP8_3_EPD_Pos                                   3                                                         /*!< SCU SFSP8_3: EPD Position           */\r
+#define SCU_SFSP8_3_EPD_Msk                                   (0x01UL << SCU_SFSP8_3_EPD_Pos)                           /*!< SCU SFSP8_3: EPD Mask               */\r
+#define SCU_SFSP8_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_3: EPUN Position          */\r
+#define SCU_SFSP8_3_EPUN_Msk                                  (0x01UL << SCU_SFSP8_3_EPUN_Pos)                          /*!< SCU SFSP8_3: EPUN Mask              */\r
+#define SCU_SFSP8_3_EHS_Pos                                   5                                                         /*!< SCU SFSP8_3: EHS Position           */\r
+#define SCU_SFSP8_3_EHS_Msk                                   (0x01UL << SCU_SFSP8_3_EHS_Pos)                           /*!< SCU SFSP8_3: EHS Mask               */\r
+#define SCU_SFSP8_3_EZI_Pos                                   6                                                         /*!< SCU SFSP8_3: EZI Position           */\r
+#define SCU_SFSP8_3_EZI_Msk                                   (0x01UL << SCU_SFSP8_3_EZI_Pos)                           /*!< SCU SFSP8_3: EZI Mask               */\r
+#define SCU_SFSP8_3_EHD_Pos                                   8                                                         /*!< SCU SFSP8_3: EHD Position           */\r
+#define SCU_SFSP8_3_EHD_Msk                                   (0x03UL << SCU_SFSP8_3_EHD_Pos)                           /*!< SCU SFSP8_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_4  ------------------------------------------\r
+#define SCU_SFSP8_4_MODE_Pos                                  0                                                         /*!< SCU SFSP8_4: MODE Position          */\r
+#define SCU_SFSP8_4_MODE_Msk                                  (0x07UL << SCU_SFSP8_4_MODE_Pos)                          /*!< SCU SFSP8_4: MODE Mask              */\r
+#define SCU_SFSP8_4_EPD_Pos                                   3                                                         /*!< SCU SFSP8_4: EPD Position           */\r
+#define SCU_SFSP8_4_EPD_Msk                                   (0x01UL << SCU_SFSP8_4_EPD_Pos)                           /*!< SCU SFSP8_4: EPD Mask               */\r
+#define SCU_SFSP8_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_4: EPUN Position          */\r
+#define SCU_SFSP8_4_EPUN_Msk                                  (0x01UL << SCU_SFSP8_4_EPUN_Pos)                          /*!< SCU SFSP8_4: EPUN Mask              */\r
+#define SCU_SFSP8_4_EHS_Pos                                   5                                                         /*!< SCU SFSP8_4: EHS Position           */\r
+#define SCU_SFSP8_4_EHS_Msk                                   (0x01UL << SCU_SFSP8_4_EHS_Pos)                           /*!< SCU SFSP8_4: EHS Mask               */\r
+#define SCU_SFSP8_4_EZI_Pos                                   6                                                         /*!< SCU SFSP8_4: EZI Position           */\r
+#define SCU_SFSP8_4_EZI_Msk                                   (0x01UL << SCU_SFSP8_4_EZI_Pos)                           /*!< SCU SFSP8_4: EZI Mask               */\r
+#define SCU_SFSP8_4_EHD_Pos                                   8                                                         /*!< SCU SFSP8_4: EHD Position           */\r
+#define SCU_SFSP8_4_EHD_Msk                                   (0x03UL << SCU_SFSP8_4_EHD_Pos)                           /*!< SCU SFSP8_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_5  ------------------------------------------\r
+#define SCU_SFSP8_5_MODE_Pos                                  0                                                         /*!< SCU SFSP8_5: MODE Position          */\r
+#define SCU_SFSP8_5_MODE_Msk                                  (0x07UL << SCU_SFSP8_5_MODE_Pos)                          /*!< SCU SFSP8_5: MODE Mask              */\r
+#define SCU_SFSP8_5_EPD_Pos                                   3                                                         /*!< SCU SFSP8_5: EPD Position           */\r
+#define SCU_SFSP8_5_EPD_Msk                                   (0x01UL << SCU_SFSP8_5_EPD_Pos)                           /*!< SCU SFSP8_5: EPD Mask               */\r
+#define SCU_SFSP8_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_5: EPUN Position          */\r
+#define SCU_SFSP8_5_EPUN_Msk                                  (0x01UL << SCU_SFSP8_5_EPUN_Pos)                          /*!< SCU SFSP8_5: EPUN Mask              */\r
+#define SCU_SFSP8_5_EHS_Pos                                   5                                                         /*!< SCU SFSP8_5: EHS Position           */\r
+#define SCU_SFSP8_5_EHS_Msk                                   (0x01UL << SCU_SFSP8_5_EHS_Pos)                           /*!< SCU SFSP8_5: EHS Mask               */\r
+#define SCU_SFSP8_5_EZI_Pos                                   6                                                         /*!< SCU SFSP8_5: EZI Position           */\r
+#define SCU_SFSP8_5_EZI_Msk                                   (0x01UL << SCU_SFSP8_5_EZI_Pos)                           /*!< SCU SFSP8_5: EZI Mask               */\r
+#define SCU_SFSP8_5_EHD_Pos                                   8                                                         /*!< SCU SFSP8_5: EHD Position           */\r
+#define SCU_SFSP8_5_EHD_Msk                                   (0x03UL << SCU_SFSP8_5_EHD_Pos)                           /*!< SCU SFSP8_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_6  ------------------------------------------\r
+#define SCU_SFSP8_6_MODE_Pos                                  0                                                         /*!< SCU SFSP8_6: MODE Position          */\r
+#define SCU_SFSP8_6_MODE_Msk                                  (0x07UL << SCU_SFSP8_6_MODE_Pos)                          /*!< SCU SFSP8_6: MODE Mask              */\r
+#define SCU_SFSP8_6_EPD_Pos                                   3                                                         /*!< SCU SFSP8_6: EPD Position           */\r
+#define SCU_SFSP8_6_EPD_Msk                                   (0x01UL << SCU_SFSP8_6_EPD_Pos)                           /*!< SCU SFSP8_6: EPD Mask               */\r
+#define SCU_SFSP8_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_6: EPUN Position          */\r
+#define SCU_SFSP8_6_EPUN_Msk                                  (0x01UL << SCU_SFSP8_6_EPUN_Pos)                          /*!< SCU SFSP8_6: EPUN Mask              */\r
+#define SCU_SFSP8_6_EHS_Pos                                   5                                                         /*!< SCU SFSP8_6: EHS Position           */\r
+#define SCU_SFSP8_6_EHS_Msk                                   (0x01UL << SCU_SFSP8_6_EHS_Pos)                           /*!< SCU SFSP8_6: EHS Mask               */\r
+#define SCU_SFSP8_6_EZI_Pos                                   6                                                         /*!< SCU SFSP8_6: EZI Position           */\r
+#define SCU_SFSP8_6_EZI_Msk                                   (0x01UL << SCU_SFSP8_6_EZI_Pos)                           /*!< SCU SFSP8_6: EZI Mask               */\r
+#define SCU_SFSP8_6_EHD_Pos                                   8                                                         /*!< SCU SFSP8_6: EHD Position           */\r
+#define SCU_SFSP8_6_EHD_Msk                                   (0x03UL << SCU_SFSP8_6_EHD_Pos)                           /*!< SCU SFSP8_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_7  ------------------------------------------\r
+#define SCU_SFSP8_7_MODE_Pos                                  0                                                         /*!< SCU SFSP8_7: MODE Position          */\r
+#define SCU_SFSP8_7_MODE_Msk                                  (0x07UL << SCU_SFSP8_7_MODE_Pos)                          /*!< SCU SFSP8_7: MODE Mask              */\r
+#define SCU_SFSP8_7_EPD_Pos                                   3                                                         /*!< SCU SFSP8_7: EPD Position           */\r
+#define SCU_SFSP8_7_EPD_Msk                                   (0x01UL << SCU_SFSP8_7_EPD_Pos)                           /*!< SCU SFSP8_7: EPD Mask               */\r
+#define SCU_SFSP8_7_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_7: EPUN Position          */\r
+#define SCU_SFSP8_7_EPUN_Msk                                  (0x01UL << SCU_SFSP8_7_EPUN_Pos)                          /*!< SCU SFSP8_7: EPUN Mask              */\r
+#define SCU_SFSP8_7_EHS_Pos                                   5                                                         /*!< SCU SFSP8_7: EHS Position           */\r
+#define SCU_SFSP8_7_EHS_Msk                                   (0x01UL << SCU_SFSP8_7_EHS_Pos)                           /*!< SCU SFSP8_7: EHS Mask               */\r
+#define SCU_SFSP8_7_EZI_Pos                                   6                                                         /*!< SCU SFSP8_7: EZI Position           */\r
+#define SCU_SFSP8_7_EZI_Msk                                   (0x01UL << SCU_SFSP8_7_EZI_Pos)                           /*!< SCU SFSP8_7: EZI Mask               */\r
+#define SCU_SFSP8_7_EHD_Pos                                   8                                                         /*!< SCU SFSP8_7: EHD Position           */\r
+#define SCU_SFSP8_7_EHD_Msk                                   (0x03UL << SCU_SFSP8_7_EHD_Pos)                           /*!< SCU SFSP8_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP8_8  ------------------------------------------\r
+#define SCU_SFSP8_8_MODE_Pos                                  0                                                         /*!< SCU SFSP8_8: MODE Position          */\r
+#define SCU_SFSP8_8_MODE_Msk                                  (0x07UL << SCU_SFSP8_8_MODE_Pos)                          /*!< SCU SFSP8_8: MODE Mask              */\r
+#define SCU_SFSP8_8_EPD_Pos                                   3                                                         /*!< SCU SFSP8_8: EPD Position           */\r
+#define SCU_SFSP8_8_EPD_Msk                                   (0x01UL << SCU_SFSP8_8_EPD_Pos)                           /*!< SCU SFSP8_8: EPD Mask               */\r
+#define SCU_SFSP8_8_EPUN_Pos                                  4                                                         /*!< SCU SFSP8_8: EPUN Position          */\r
+#define SCU_SFSP8_8_EPUN_Msk                                  (0x01UL << SCU_SFSP8_8_EPUN_Pos)                          /*!< SCU SFSP8_8: EPUN Mask              */\r
+#define SCU_SFSP8_8_EHS_Pos                                   5                                                         /*!< SCU SFSP8_8: EHS Position           */\r
+#define SCU_SFSP8_8_EHS_Msk                                   (0x01UL << SCU_SFSP8_8_EHS_Pos)                           /*!< SCU SFSP8_8: EHS Mask               */\r
+#define SCU_SFSP8_8_EZI_Pos                                   6                                                         /*!< SCU SFSP8_8: EZI Position           */\r
+#define SCU_SFSP8_8_EZI_Msk                                   (0x01UL << SCU_SFSP8_8_EZI_Pos)                           /*!< SCU SFSP8_8: EZI Mask               */\r
+#define SCU_SFSP8_8_EHD_Pos                                   8                                                         /*!< SCU SFSP8_8: EHD Position           */\r
+#define SCU_SFSP8_8_EHD_Msk                                   (0x03UL << SCU_SFSP8_8_EHD_Pos)                           /*!< SCU SFSP8_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_0  ------------------------------------------\r
+#define SCU_SFSP9_0_MODE_Pos                                  0                                                         /*!< SCU SFSP9_0: MODE Position          */\r
+#define SCU_SFSP9_0_MODE_Msk                                  (0x07UL << SCU_SFSP9_0_MODE_Pos)                          /*!< SCU SFSP9_0: MODE Mask              */\r
+#define SCU_SFSP9_0_EPD_Pos                                   3                                                         /*!< SCU SFSP9_0: EPD Position           */\r
+#define SCU_SFSP9_0_EPD_Msk                                   (0x01UL << SCU_SFSP9_0_EPD_Pos)                           /*!< SCU SFSP9_0: EPD Mask               */\r
+#define SCU_SFSP9_0_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_0: EPUN Position          */\r
+#define SCU_SFSP9_0_EPUN_Msk                                  (0x01UL << SCU_SFSP9_0_EPUN_Pos)                          /*!< SCU SFSP9_0: EPUN Mask              */\r
+#define SCU_SFSP9_0_EHS_Pos                                   5                                                         /*!< SCU SFSP9_0: EHS Position           */\r
+#define SCU_SFSP9_0_EHS_Msk                                   (0x01UL << SCU_SFSP9_0_EHS_Pos)                           /*!< SCU SFSP9_0: EHS Mask               */\r
+#define SCU_SFSP9_0_EZI_Pos                                   6                                                         /*!< SCU SFSP9_0: EZI Position           */\r
+#define SCU_SFSP9_0_EZI_Msk                                   (0x01UL << SCU_SFSP9_0_EZI_Pos)                           /*!< SCU SFSP9_0: EZI Mask               */\r
+#define SCU_SFSP9_0_EHD_Pos                                   8                                                         /*!< SCU SFSP9_0: EHD Position           */\r
+#define SCU_SFSP9_0_EHD_Msk                                   (0x03UL << SCU_SFSP9_0_EHD_Pos)                           /*!< SCU SFSP9_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_1  ------------------------------------------\r
+#define SCU_SFSP9_1_MODE_Pos                                  0                                                         /*!< SCU SFSP9_1: MODE Position          */\r
+#define SCU_SFSP9_1_MODE_Msk                                  (0x07UL << SCU_SFSP9_1_MODE_Pos)                          /*!< SCU SFSP9_1: MODE Mask              */\r
+#define SCU_SFSP9_1_EPD_Pos                                   3                                                         /*!< SCU SFSP9_1: EPD Position           */\r
+#define SCU_SFSP9_1_EPD_Msk                                   (0x01UL << SCU_SFSP9_1_EPD_Pos)                           /*!< SCU SFSP9_1: EPD Mask               */\r
+#define SCU_SFSP9_1_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_1: EPUN Position          */\r
+#define SCU_SFSP9_1_EPUN_Msk                                  (0x01UL << SCU_SFSP9_1_EPUN_Pos)                          /*!< SCU SFSP9_1: EPUN Mask              */\r
+#define SCU_SFSP9_1_EHS_Pos                                   5                                                         /*!< SCU SFSP9_1: EHS Position           */\r
+#define SCU_SFSP9_1_EHS_Msk                                   (0x01UL << SCU_SFSP9_1_EHS_Pos)                           /*!< SCU SFSP9_1: EHS Mask               */\r
+#define SCU_SFSP9_1_EZI_Pos                                   6                                                         /*!< SCU SFSP9_1: EZI Position           */\r
+#define SCU_SFSP9_1_EZI_Msk                                   (0x01UL << SCU_SFSP9_1_EZI_Pos)                           /*!< SCU SFSP9_1: EZI Mask               */\r
+#define SCU_SFSP9_1_EHD_Pos                                   8                                                         /*!< SCU SFSP9_1: EHD Position           */\r
+#define SCU_SFSP9_1_EHD_Msk                                   (0x03UL << SCU_SFSP9_1_EHD_Pos)                           /*!< SCU SFSP9_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_2  ------------------------------------------\r
+#define SCU_SFSP9_2_MODE_Pos                                  0                                                         /*!< SCU SFSP9_2: MODE Position          */\r
+#define SCU_SFSP9_2_MODE_Msk                                  (0x07UL << SCU_SFSP9_2_MODE_Pos)                          /*!< SCU SFSP9_2: MODE Mask              */\r
+#define SCU_SFSP9_2_EPD_Pos                                   3                                                         /*!< SCU SFSP9_2: EPD Position           */\r
+#define SCU_SFSP9_2_EPD_Msk                                   (0x01UL << SCU_SFSP9_2_EPD_Pos)                           /*!< SCU SFSP9_2: EPD Mask               */\r
+#define SCU_SFSP9_2_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_2: EPUN Position          */\r
+#define SCU_SFSP9_2_EPUN_Msk                                  (0x01UL << SCU_SFSP9_2_EPUN_Pos)                          /*!< SCU SFSP9_2: EPUN Mask              */\r
+#define SCU_SFSP9_2_EHS_Pos                                   5                                                         /*!< SCU SFSP9_2: EHS Position           */\r
+#define SCU_SFSP9_2_EHS_Msk                                   (0x01UL << SCU_SFSP9_2_EHS_Pos)                           /*!< SCU SFSP9_2: EHS Mask               */\r
+#define SCU_SFSP9_2_EZI_Pos                                   6                                                         /*!< SCU SFSP9_2: EZI Position           */\r
+#define SCU_SFSP9_2_EZI_Msk                                   (0x01UL << SCU_SFSP9_2_EZI_Pos)                           /*!< SCU SFSP9_2: EZI Mask               */\r
+#define SCU_SFSP9_2_EHD_Pos                                   8                                                         /*!< SCU SFSP9_2: EHD Position           */\r
+#define SCU_SFSP9_2_EHD_Msk                                   (0x03UL << SCU_SFSP9_2_EHD_Pos)                           /*!< SCU SFSP9_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_3  ------------------------------------------\r
+#define SCU_SFSP9_3_MODE_Pos                                  0                                                         /*!< SCU SFSP9_3: MODE Position          */\r
+#define SCU_SFSP9_3_MODE_Msk                                  (0x07UL << SCU_SFSP9_3_MODE_Pos)                          /*!< SCU SFSP9_3: MODE Mask              */\r
+#define SCU_SFSP9_3_EPD_Pos                                   3                                                         /*!< SCU SFSP9_3: EPD Position           */\r
+#define SCU_SFSP9_3_EPD_Msk                                   (0x01UL << SCU_SFSP9_3_EPD_Pos)                           /*!< SCU SFSP9_3: EPD Mask               */\r
+#define SCU_SFSP9_3_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_3: EPUN Position          */\r
+#define SCU_SFSP9_3_EPUN_Msk                                  (0x01UL << SCU_SFSP9_3_EPUN_Pos)                          /*!< SCU SFSP9_3: EPUN Mask              */\r
+#define SCU_SFSP9_3_EHS_Pos                                   5                                                         /*!< SCU SFSP9_3: EHS Position           */\r
+#define SCU_SFSP9_3_EHS_Msk                                   (0x01UL << SCU_SFSP9_3_EHS_Pos)                           /*!< SCU SFSP9_3: EHS Mask               */\r
+#define SCU_SFSP9_3_EZI_Pos                                   6                                                         /*!< SCU SFSP9_3: EZI Position           */\r
+#define SCU_SFSP9_3_EZI_Msk                                   (0x01UL << SCU_SFSP9_3_EZI_Pos)                           /*!< SCU SFSP9_3: EZI Mask               */\r
+#define SCU_SFSP9_3_EHD_Pos                                   8                                                         /*!< SCU SFSP9_3: EHD Position           */\r
+#define SCU_SFSP9_3_EHD_Msk                                   (0x03UL << SCU_SFSP9_3_EHD_Pos)                           /*!< SCU SFSP9_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_4  ------------------------------------------\r
+#define SCU_SFSP9_4_MODE_Pos                                  0                                                         /*!< SCU SFSP9_4: MODE Position          */\r
+#define SCU_SFSP9_4_MODE_Msk                                  (0x07UL << SCU_SFSP9_4_MODE_Pos)                          /*!< SCU SFSP9_4: MODE Mask              */\r
+#define SCU_SFSP9_4_EPD_Pos                                   3                                                         /*!< SCU SFSP9_4: EPD Position           */\r
+#define SCU_SFSP9_4_EPD_Msk                                   (0x01UL << SCU_SFSP9_4_EPD_Pos)                           /*!< SCU SFSP9_4: EPD Mask               */\r
+#define SCU_SFSP9_4_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_4: EPUN Position          */\r
+#define SCU_SFSP9_4_EPUN_Msk                                  (0x01UL << SCU_SFSP9_4_EPUN_Pos)                          /*!< SCU SFSP9_4: EPUN Mask              */\r
+#define SCU_SFSP9_4_EHS_Pos                                   5                                                         /*!< SCU SFSP9_4: EHS Position           */\r
+#define SCU_SFSP9_4_EHS_Msk                                   (0x01UL << SCU_SFSP9_4_EHS_Pos)                           /*!< SCU SFSP9_4: EHS Mask               */\r
+#define SCU_SFSP9_4_EZI_Pos                                   6                                                         /*!< SCU SFSP9_4: EZI Position           */\r
+#define SCU_SFSP9_4_EZI_Msk                                   (0x01UL << SCU_SFSP9_4_EZI_Pos)                           /*!< SCU SFSP9_4: EZI Mask               */\r
+#define SCU_SFSP9_4_EHD_Pos                                   8                                                         /*!< SCU SFSP9_4: EHD Position           */\r
+#define SCU_SFSP9_4_EHD_Msk                                   (0x03UL << SCU_SFSP9_4_EHD_Pos)                           /*!< SCU SFSP9_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_5  ------------------------------------------\r
+#define SCU_SFSP9_5_MODE_Pos                                  0                                                         /*!< SCU SFSP9_5: MODE Position          */\r
+#define SCU_SFSP9_5_MODE_Msk                                  (0x07UL << SCU_SFSP9_5_MODE_Pos)                          /*!< SCU SFSP9_5: MODE Mask              */\r
+#define SCU_SFSP9_5_EPD_Pos                                   3                                                         /*!< SCU SFSP9_5: EPD Position           */\r
+#define SCU_SFSP9_5_EPD_Msk                                   (0x01UL << SCU_SFSP9_5_EPD_Pos)                           /*!< SCU SFSP9_5: EPD Mask               */\r
+#define SCU_SFSP9_5_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_5: EPUN Position          */\r
+#define SCU_SFSP9_5_EPUN_Msk                                  (0x01UL << SCU_SFSP9_5_EPUN_Pos)                          /*!< SCU SFSP9_5: EPUN Mask              */\r
+#define SCU_SFSP9_5_EHS_Pos                                   5                                                         /*!< SCU SFSP9_5: EHS Position           */\r
+#define SCU_SFSP9_5_EHS_Msk                                   (0x01UL << SCU_SFSP9_5_EHS_Pos)                           /*!< SCU SFSP9_5: EHS Mask               */\r
+#define SCU_SFSP9_5_EZI_Pos                                   6                                                         /*!< SCU SFSP9_5: EZI Position           */\r
+#define SCU_SFSP9_5_EZI_Msk                                   (0x01UL << SCU_SFSP9_5_EZI_Pos)                           /*!< SCU SFSP9_5: EZI Mask               */\r
+#define SCU_SFSP9_5_EHD_Pos                                   8                                                         /*!< SCU SFSP9_5: EHD Position           */\r
+#define SCU_SFSP9_5_EHD_Msk                                   (0x03UL << SCU_SFSP9_5_EHD_Pos)                           /*!< SCU SFSP9_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSP9_6  ------------------------------------------\r
+#define SCU_SFSP9_6_MODE_Pos                                  0                                                         /*!< SCU SFSP9_6: MODE Position          */\r
+#define SCU_SFSP9_6_MODE_Msk                                  (0x07UL << SCU_SFSP9_6_MODE_Pos)                          /*!< SCU SFSP9_6: MODE Mask              */\r
+#define SCU_SFSP9_6_EPD_Pos                                   3                                                         /*!< SCU SFSP9_6: EPD Position           */\r
+#define SCU_SFSP9_6_EPD_Msk                                   (0x01UL << SCU_SFSP9_6_EPD_Pos)                           /*!< SCU SFSP9_6: EPD Mask               */\r
+#define SCU_SFSP9_6_EPUN_Pos                                  4                                                         /*!< SCU SFSP9_6: EPUN Position          */\r
+#define SCU_SFSP9_6_EPUN_Msk                                  (0x01UL << SCU_SFSP9_6_EPUN_Pos)                          /*!< SCU SFSP9_6: EPUN Mask              */\r
+#define SCU_SFSP9_6_EHS_Pos                                   5                                                         /*!< SCU SFSP9_6: EHS Position           */\r
+#define SCU_SFSP9_6_EHS_Msk                                   (0x01UL << SCU_SFSP9_6_EHS_Pos)                           /*!< SCU SFSP9_6: EHS Mask               */\r
+#define SCU_SFSP9_6_EZI_Pos                                   6                                                         /*!< SCU SFSP9_6: EZI Position           */\r
+#define SCU_SFSP9_6_EZI_Msk                                   (0x01UL << SCU_SFSP9_6_EZI_Pos)                           /*!< SCU SFSP9_6: EZI Mask               */\r
+#define SCU_SFSP9_6_EHD_Pos                                   8                                                         /*!< SCU SFSP9_6: EHD Position           */\r
+#define SCU_SFSP9_6_EHD_Msk                                   (0x03UL << SCU_SFSP9_6_EHD_Pos)                           /*!< SCU SFSP9_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPA_0  ------------------------------------------\r
+#define SCU_SFSPA_0_MODE_Pos                                  0                                                         /*!< SCU SFSPA_0: MODE Position          */\r
+#define SCU_SFSPA_0_MODE_Msk                                  (0x07UL << SCU_SFSPA_0_MODE_Pos)                          /*!< SCU SFSPA_0: MODE Mask              */\r
+#define SCU_SFSPA_0_EPD_Pos                                   3                                                         /*!< SCU SFSPA_0: EPD Position           */\r
+#define SCU_SFSPA_0_EPD_Msk                                   (0x01UL << SCU_SFSPA_0_EPD_Pos)                           /*!< SCU SFSPA_0: EPD Mask               */\r
+#define SCU_SFSPA_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPA_0: EPUN Position          */\r
+#define SCU_SFSPA_0_EPUN_Msk                                  (0x01UL << SCU_SFSPA_0_EPUN_Pos)                          /*!< SCU SFSPA_0: EPUN Mask              */\r
+#define SCU_SFSPA_0_EHS_Pos                                   5                                                         /*!< SCU SFSPA_0: EHS Position           */\r
+#define SCU_SFSPA_0_EHS_Msk                                   (0x01UL << SCU_SFSPA_0_EHS_Pos)                           /*!< SCU SFSPA_0: EHS Mask               */\r
+#define SCU_SFSPA_0_EZI_Pos                                   6                                                         /*!< SCU SFSPA_0: EZI Position           */\r
+#define SCU_SFSPA_0_EZI_Msk                                   (0x01UL << SCU_SFSPA_0_EZI_Pos)                           /*!< SCU SFSPA_0: EZI Mask               */\r
+#define SCU_SFSPA_0_EHD_Pos                                   8                                                         /*!< SCU SFSPA_0: EHD Position           */\r
+#define SCU_SFSPA_0_EHD_Msk                                   (0x03UL << SCU_SFSPA_0_EHD_Pos)                           /*!< SCU SFSPA_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPA_1  ------------------------------------------\r
+#define SCU_SFSPA_1_MODE_Pos                                  0                                                         /*!< SCU SFSPA_1: MODE Position          */\r
+#define SCU_SFSPA_1_MODE_Msk                                  (0x07UL << SCU_SFSPA_1_MODE_Pos)                          /*!< SCU SFSPA_1: MODE Mask              */\r
+#define SCU_SFSPA_1_EPD_Pos                                   3                                                         /*!< SCU SFSPA_1: EPD Position           */\r
+#define SCU_SFSPA_1_EPD_Msk                                   (0x01UL << SCU_SFSPA_1_EPD_Pos)                           /*!< SCU SFSPA_1: EPD Mask               */\r
+#define SCU_SFSPA_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPA_1: EPUN Position          */\r
+#define SCU_SFSPA_1_EPUN_Msk                                  (0x01UL << SCU_SFSPA_1_EPUN_Pos)                          /*!< SCU SFSPA_1: EPUN Mask              */\r
+#define SCU_SFSPA_1_EHS_Pos                                   5                                                         /*!< SCU SFSPA_1: EHS Position           */\r
+#define SCU_SFSPA_1_EHS_Msk                                   (0x01UL << SCU_SFSPA_1_EHS_Pos)                           /*!< SCU SFSPA_1: EHS Mask               */\r
+#define SCU_SFSPA_1_EZI_Pos                                   6                                                         /*!< SCU SFSPA_1: EZI Position           */\r
+#define SCU_SFSPA_1_EZI_Msk                                   (0x01UL << SCU_SFSPA_1_EZI_Pos)                           /*!< SCU SFSPA_1: EZI Mask               */\r
+#define SCU_SFSPA_1_EHD_Pos                                   8                                                         /*!< SCU SFSPA_1: EHD Position           */\r
+#define SCU_SFSPA_1_EHD_Msk                                   (0x03UL << SCU_SFSPA_1_EHD_Pos)                           /*!< SCU SFSPA_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPA_2  ------------------------------------------\r
+#define SCU_SFSPA_2_MODE_Pos                                  0                                                         /*!< SCU SFSPA_2: MODE Position          */\r
+#define SCU_SFSPA_2_MODE_Msk                                  (0x07UL << SCU_SFSPA_2_MODE_Pos)                          /*!< SCU SFSPA_2: MODE Mask              */\r
+#define SCU_SFSPA_2_EPD_Pos                                   3                                                         /*!< SCU SFSPA_2: EPD Position           */\r
+#define SCU_SFSPA_2_EPD_Msk                                   (0x01UL << SCU_SFSPA_2_EPD_Pos)                           /*!< SCU SFSPA_2: EPD Mask               */\r
+#define SCU_SFSPA_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPA_2: EPUN Position          */\r
+#define SCU_SFSPA_2_EPUN_Msk                                  (0x01UL << SCU_SFSPA_2_EPUN_Pos)                          /*!< SCU SFSPA_2: EPUN Mask              */\r
+#define SCU_SFSPA_2_EHS_Pos                                   5                                                         /*!< SCU SFSPA_2: EHS Position           */\r
+#define SCU_SFSPA_2_EHS_Msk                                   (0x01UL << SCU_SFSPA_2_EHS_Pos)                           /*!< SCU SFSPA_2: EHS Mask               */\r
+#define SCU_SFSPA_2_EZI_Pos                                   6                                                         /*!< SCU SFSPA_2: EZI Position           */\r
+#define SCU_SFSPA_2_EZI_Msk                                   (0x01UL << SCU_SFSPA_2_EZI_Pos)                           /*!< SCU SFSPA_2: EZI Mask               */\r
+#define SCU_SFSPA_2_EHD_Pos                                   8                                                         /*!< SCU SFSPA_2: EHD Position           */\r
+#define SCU_SFSPA_2_EHD_Msk                                   (0x03UL << SCU_SFSPA_2_EHD_Pos)                           /*!< SCU SFSPA_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPA_3  ------------------------------------------\r
+#define SCU_SFSPA_3_MODE_Pos                                  0                                                         /*!< SCU SFSPA_3: MODE Position          */\r
+#define SCU_SFSPA_3_MODE_Msk                                  (0x07UL << SCU_SFSPA_3_MODE_Pos)                          /*!< SCU SFSPA_3: MODE Mask              */\r
+#define SCU_SFSPA_3_EPD_Pos                                   3                                                         /*!< SCU SFSPA_3: EPD Position           */\r
+#define SCU_SFSPA_3_EPD_Msk                                   (0x01UL << SCU_SFSPA_3_EPD_Pos)                           /*!< SCU SFSPA_3: EPD Mask               */\r
+#define SCU_SFSPA_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPA_3: EPUN Position          */\r
+#define SCU_SFSPA_3_EPUN_Msk                                  (0x01UL << SCU_SFSPA_3_EPUN_Pos)                          /*!< SCU SFSPA_3: EPUN Mask              */\r
+#define SCU_SFSPA_3_EHS_Pos                                   5                                                         /*!< SCU SFSPA_3: EHS Position           */\r
+#define SCU_SFSPA_3_EHS_Msk                                   (0x01UL << SCU_SFSPA_3_EHS_Pos)                           /*!< SCU SFSPA_3: EHS Mask               */\r
+#define SCU_SFSPA_3_EZI_Pos                                   6                                                         /*!< SCU SFSPA_3: EZI Position           */\r
+#define SCU_SFSPA_3_EZI_Msk                                   (0x01UL << SCU_SFSPA_3_EZI_Pos)                           /*!< SCU SFSPA_3: EZI Mask               */\r
+#define SCU_SFSPA_3_EHD_Pos                                   8                                                         /*!< SCU SFSPA_3: EHD Position           */\r
+#define SCU_SFSPA_3_EHD_Msk                                   (0x03UL << SCU_SFSPA_3_EHD_Pos)                           /*!< SCU SFSPA_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPA_4  ------------------------------------------\r
+#define SCU_SFSPA_4_MODE_Pos                                  0                                                         /*!< SCU SFSPA_4: MODE Position          */\r
+#define SCU_SFSPA_4_MODE_Msk                                  (0x07UL << SCU_SFSPA_4_MODE_Pos)                          /*!< SCU SFSPA_4: MODE Mask              */\r
+#define SCU_SFSPA_4_EPD_Pos                                   3                                                         /*!< SCU SFSPA_4: EPD Position           */\r
+#define SCU_SFSPA_4_EPD_Msk                                   (0x01UL << SCU_SFSPA_4_EPD_Pos)                           /*!< SCU SFSPA_4: EPD Mask               */\r
+#define SCU_SFSPA_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPA_4: EPUN Position          */\r
+#define SCU_SFSPA_4_EPUN_Msk                                  (0x01UL << SCU_SFSPA_4_EPUN_Pos)                          /*!< SCU SFSPA_4: EPUN Mask              */\r
+#define SCU_SFSPA_4_EHS_Pos                                   5                                                         /*!< SCU SFSPA_4: EHS Position           */\r
+#define SCU_SFSPA_4_EHS_Msk                                   (0x01UL << SCU_SFSPA_4_EHS_Pos)                           /*!< SCU SFSPA_4: EHS Mask               */\r
+#define SCU_SFSPA_4_EZI_Pos                                   6                                                         /*!< SCU SFSPA_4: EZI Position           */\r
+#define SCU_SFSPA_4_EZI_Msk                                   (0x01UL << SCU_SFSPA_4_EZI_Pos)                           /*!< SCU SFSPA_4: EZI Mask               */\r
+#define SCU_SFSPA_4_EHD_Pos                                   8                                                         /*!< SCU SFSPA_4: EHD Position           */\r
+#define SCU_SFSPA_4_EHD_Msk                                   (0x03UL << SCU_SFSPA_4_EHD_Pos)                           /*!< SCU SFSPA_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_0  ------------------------------------------\r
+#define SCU_SFSPB_0_MODE_Pos                                  0                                                         /*!< SCU SFSPB_0: MODE Position          */\r
+#define SCU_SFSPB_0_MODE_Msk                                  (0x07UL << SCU_SFSPB_0_MODE_Pos)                          /*!< SCU SFSPB_0: MODE Mask              */\r
+#define SCU_SFSPB_0_EPD_Pos                                   3                                                         /*!< SCU SFSPB_0: EPD Position           */\r
+#define SCU_SFSPB_0_EPD_Msk                                   (0x01UL << SCU_SFSPB_0_EPD_Pos)                           /*!< SCU SFSPB_0: EPD Mask               */\r
+#define SCU_SFSPB_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_0: EPUN Position          */\r
+#define SCU_SFSPB_0_EPUN_Msk                                  (0x01UL << SCU_SFSPB_0_EPUN_Pos)                          /*!< SCU SFSPB_0: EPUN Mask              */\r
+#define SCU_SFSPB_0_EHS_Pos                                   5                                                         /*!< SCU SFSPB_0: EHS Position           */\r
+#define SCU_SFSPB_0_EHS_Msk                                   (0x01UL << SCU_SFSPB_0_EHS_Pos)                           /*!< SCU SFSPB_0: EHS Mask               */\r
+#define SCU_SFSPB_0_EZI_Pos                                   6                                                         /*!< SCU SFSPB_0: EZI Position           */\r
+#define SCU_SFSPB_0_EZI_Msk                                   (0x01UL << SCU_SFSPB_0_EZI_Pos)                           /*!< SCU SFSPB_0: EZI Mask               */\r
+#define SCU_SFSPB_0_EHD_Pos                                   8                                                         /*!< SCU SFSPB_0: EHD Position           */\r
+#define SCU_SFSPB_0_EHD_Msk                                   (0x03UL << SCU_SFSPB_0_EHD_Pos)                           /*!< SCU SFSPB_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_1  ------------------------------------------\r
+#define SCU_SFSPB_1_MODE_Pos                                  0                                                         /*!< SCU SFSPB_1: MODE Position          */\r
+#define SCU_SFSPB_1_MODE_Msk                                  (0x07UL << SCU_SFSPB_1_MODE_Pos)                          /*!< SCU SFSPB_1: MODE Mask              */\r
+#define SCU_SFSPB_1_EPD_Pos                                   3                                                         /*!< SCU SFSPB_1: EPD Position           */\r
+#define SCU_SFSPB_1_EPD_Msk                                   (0x01UL << SCU_SFSPB_1_EPD_Pos)                           /*!< SCU SFSPB_1: EPD Mask               */\r
+#define SCU_SFSPB_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_1: EPUN Position          */\r
+#define SCU_SFSPB_1_EPUN_Msk                                  (0x01UL << SCU_SFSPB_1_EPUN_Pos)                          /*!< SCU SFSPB_1: EPUN Mask              */\r
+#define SCU_SFSPB_1_EHS_Pos                                   5                                                         /*!< SCU SFSPB_1: EHS Position           */\r
+#define SCU_SFSPB_1_EHS_Msk                                   (0x01UL << SCU_SFSPB_1_EHS_Pos)                           /*!< SCU SFSPB_1: EHS Mask               */\r
+#define SCU_SFSPB_1_EZI_Pos                                   6                                                         /*!< SCU SFSPB_1: EZI Position           */\r
+#define SCU_SFSPB_1_EZI_Msk                                   (0x01UL << SCU_SFSPB_1_EZI_Pos)                           /*!< SCU SFSPB_1: EZI Mask               */\r
+#define SCU_SFSPB_1_EHD_Pos                                   8                                                         /*!< SCU SFSPB_1: EHD Position           */\r
+#define SCU_SFSPB_1_EHD_Msk                                   (0x03UL << SCU_SFSPB_1_EHD_Pos)                           /*!< SCU SFSPB_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_2  ------------------------------------------\r
+#define SCU_SFSPB_2_MODE_Pos                                  0                                                         /*!< SCU SFSPB_2: MODE Position          */\r
+#define SCU_SFSPB_2_MODE_Msk                                  (0x07UL << SCU_SFSPB_2_MODE_Pos)                          /*!< SCU SFSPB_2: MODE Mask              */\r
+#define SCU_SFSPB_2_EPD_Pos                                   3                                                         /*!< SCU SFSPB_2: EPD Position           */\r
+#define SCU_SFSPB_2_EPD_Msk                                   (0x01UL << SCU_SFSPB_2_EPD_Pos)                           /*!< SCU SFSPB_2: EPD Mask               */\r
+#define SCU_SFSPB_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_2: EPUN Position          */\r
+#define SCU_SFSPB_2_EPUN_Msk                                  (0x01UL << SCU_SFSPB_2_EPUN_Pos)                          /*!< SCU SFSPB_2: EPUN Mask              */\r
+#define SCU_SFSPB_2_EHS_Pos                                   5                                                         /*!< SCU SFSPB_2: EHS Position           */\r
+#define SCU_SFSPB_2_EHS_Msk                                   (0x01UL << SCU_SFSPB_2_EHS_Pos)                           /*!< SCU SFSPB_2: EHS Mask               */\r
+#define SCU_SFSPB_2_EZI_Pos                                   6                                                         /*!< SCU SFSPB_2: EZI Position           */\r
+#define SCU_SFSPB_2_EZI_Msk                                   (0x01UL << SCU_SFSPB_2_EZI_Pos)                           /*!< SCU SFSPB_2: EZI Mask               */\r
+#define SCU_SFSPB_2_EHD_Pos                                   8                                                         /*!< SCU SFSPB_2: EHD Position           */\r
+#define SCU_SFSPB_2_EHD_Msk                                   (0x03UL << SCU_SFSPB_2_EHD_Pos)                           /*!< SCU SFSPB_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_3  ------------------------------------------\r
+#define SCU_SFSPB_3_MODE_Pos                                  0                                                         /*!< SCU SFSPB_3: MODE Position          */\r
+#define SCU_SFSPB_3_MODE_Msk                                  (0x07UL << SCU_SFSPB_3_MODE_Pos)                          /*!< SCU SFSPB_3: MODE Mask              */\r
+#define SCU_SFSPB_3_EPD_Pos                                   3                                                         /*!< SCU SFSPB_3: EPD Position           */\r
+#define SCU_SFSPB_3_EPD_Msk                                   (0x01UL << SCU_SFSPB_3_EPD_Pos)                           /*!< SCU SFSPB_3: EPD Mask               */\r
+#define SCU_SFSPB_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_3: EPUN Position          */\r
+#define SCU_SFSPB_3_EPUN_Msk                                  (0x01UL << SCU_SFSPB_3_EPUN_Pos)                          /*!< SCU SFSPB_3: EPUN Mask              */\r
+#define SCU_SFSPB_3_EHS_Pos                                   5                                                         /*!< SCU SFSPB_3: EHS Position           */\r
+#define SCU_SFSPB_3_EHS_Msk                                   (0x01UL << SCU_SFSPB_3_EHS_Pos)                           /*!< SCU SFSPB_3: EHS Mask               */\r
+#define SCU_SFSPB_3_EZI_Pos                                   6                                                         /*!< SCU SFSPB_3: EZI Position           */\r
+#define SCU_SFSPB_3_EZI_Msk                                   (0x01UL << SCU_SFSPB_3_EZI_Pos)                           /*!< SCU SFSPB_3: EZI Mask               */\r
+#define SCU_SFSPB_3_EHD_Pos                                   8                                                         /*!< SCU SFSPB_3: EHD Position           */\r
+#define SCU_SFSPB_3_EHD_Msk                                   (0x03UL << SCU_SFSPB_3_EHD_Pos)                           /*!< SCU SFSPB_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_4  ------------------------------------------\r
+#define SCU_SFSPB_4_MODE_Pos                                  0                                                         /*!< SCU SFSPB_4: MODE Position          */\r
+#define SCU_SFSPB_4_MODE_Msk                                  (0x07UL << SCU_SFSPB_4_MODE_Pos)                          /*!< SCU SFSPB_4: MODE Mask              */\r
+#define SCU_SFSPB_4_EPD_Pos                                   3                                                         /*!< SCU SFSPB_4: EPD Position           */\r
+#define SCU_SFSPB_4_EPD_Msk                                   (0x01UL << SCU_SFSPB_4_EPD_Pos)                           /*!< SCU SFSPB_4: EPD Mask               */\r
+#define SCU_SFSPB_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_4: EPUN Position          */\r
+#define SCU_SFSPB_4_EPUN_Msk                                  (0x01UL << SCU_SFSPB_4_EPUN_Pos)                          /*!< SCU SFSPB_4: EPUN Mask              */\r
+#define SCU_SFSPB_4_EHS_Pos                                   5                                                         /*!< SCU SFSPB_4: EHS Position           */\r
+#define SCU_SFSPB_4_EHS_Msk                                   (0x01UL << SCU_SFSPB_4_EHS_Pos)                           /*!< SCU SFSPB_4: EHS Mask               */\r
+#define SCU_SFSPB_4_EZI_Pos                                   6                                                         /*!< SCU SFSPB_4: EZI Position           */\r
+#define SCU_SFSPB_4_EZI_Msk                                   (0x01UL << SCU_SFSPB_4_EZI_Pos)                           /*!< SCU SFSPB_4: EZI Mask               */\r
+#define SCU_SFSPB_4_EHD_Pos                                   8                                                         /*!< SCU SFSPB_4: EHD Position           */\r
+#define SCU_SFSPB_4_EHD_Msk                                   (0x03UL << SCU_SFSPB_4_EHD_Pos)                           /*!< SCU SFSPB_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_5  ------------------------------------------\r
+#define SCU_SFSPB_5_MODE_Pos                                  0                                                         /*!< SCU SFSPB_5: MODE Position          */\r
+#define SCU_SFSPB_5_MODE_Msk                                  (0x07UL << SCU_SFSPB_5_MODE_Pos)                          /*!< SCU SFSPB_5: MODE Mask              */\r
+#define SCU_SFSPB_5_EPD_Pos                                   3                                                         /*!< SCU SFSPB_5: EPD Position           */\r
+#define SCU_SFSPB_5_EPD_Msk                                   (0x01UL << SCU_SFSPB_5_EPD_Pos)                           /*!< SCU SFSPB_5: EPD Mask               */\r
+#define SCU_SFSPB_5_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_5: EPUN Position          */\r
+#define SCU_SFSPB_5_EPUN_Msk                                  (0x01UL << SCU_SFSPB_5_EPUN_Pos)                          /*!< SCU SFSPB_5: EPUN Mask              */\r
+#define SCU_SFSPB_5_EHS_Pos                                   5                                                         /*!< SCU SFSPB_5: EHS Position           */\r
+#define SCU_SFSPB_5_EHS_Msk                                   (0x01UL << SCU_SFSPB_5_EHS_Pos)                           /*!< SCU SFSPB_5: EHS Mask               */\r
+#define SCU_SFSPB_5_EZI_Pos                                   6                                                         /*!< SCU SFSPB_5: EZI Position           */\r
+#define SCU_SFSPB_5_EZI_Msk                                   (0x01UL << SCU_SFSPB_5_EZI_Pos)                           /*!< SCU SFSPB_5: EZI Mask               */\r
+#define SCU_SFSPB_5_EHD_Pos                                   8                                                         /*!< SCU SFSPB_5: EHD Position           */\r
+#define SCU_SFSPB_5_EHD_Msk                                   (0x03UL << SCU_SFSPB_5_EHD_Pos)                           /*!< SCU SFSPB_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPB_6  ------------------------------------------\r
+#define SCU_SFSPB_6_MODE_Pos                                  0                                                         /*!< SCU SFSPB_6: MODE Position          */\r
+#define SCU_SFSPB_6_MODE_Msk                                  (0x07UL << SCU_SFSPB_6_MODE_Pos)                          /*!< SCU SFSPB_6: MODE Mask              */\r
+#define SCU_SFSPB_6_EPD_Pos                                   3                                                         /*!< SCU SFSPB_6: EPD Position           */\r
+#define SCU_SFSPB_6_EPD_Msk                                   (0x01UL << SCU_SFSPB_6_EPD_Pos)                           /*!< SCU SFSPB_6: EPD Mask               */\r
+#define SCU_SFSPB_6_EPUN_Pos                                  4                                                         /*!< SCU SFSPB_6: EPUN Position          */\r
+#define SCU_SFSPB_6_EPUN_Msk                                  (0x01UL << SCU_SFSPB_6_EPUN_Pos)                          /*!< SCU SFSPB_6: EPUN Mask              */\r
+#define SCU_SFSPB_6_EHS_Pos                                   5                                                         /*!< SCU SFSPB_6: EHS Position           */\r
+#define SCU_SFSPB_6_EHS_Msk                                   (0x01UL << SCU_SFSPB_6_EHS_Pos)                           /*!< SCU SFSPB_6: EHS Mask               */\r
+#define SCU_SFSPB_6_EZI_Pos                                   6                                                         /*!< SCU SFSPB_6: EZI Position           */\r
+#define SCU_SFSPB_6_EZI_Msk                                   (0x01UL << SCU_SFSPB_6_EZI_Pos)                           /*!< SCU SFSPB_6: EZI Mask               */\r
+#define SCU_SFSPB_6_EHD_Pos                                   8                                                         /*!< SCU SFSPB_6: EHD Position           */\r
+#define SCU_SFSPB_6_EHD_Msk                                   (0x03UL << SCU_SFSPB_6_EHD_Pos)                           /*!< SCU SFSPB_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_0  ------------------------------------------\r
+#define SCU_SFSPC_0_MODE_Pos                                  0                                                         /*!< SCU SFSPC_0: MODE Position          */\r
+#define SCU_SFSPC_0_MODE_Msk                                  (0x07UL << SCU_SFSPC_0_MODE_Pos)                          /*!< SCU SFSPC_0: MODE Mask              */\r
+#define SCU_SFSPC_0_EPD_Pos                                   3                                                         /*!< SCU SFSPC_0: EPD Position           */\r
+#define SCU_SFSPC_0_EPD_Msk                                   (0x01UL << SCU_SFSPC_0_EPD_Pos)                           /*!< SCU SFSPC_0: EPD Mask               */\r
+#define SCU_SFSPC_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_0: EPUN Position          */\r
+#define SCU_SFSPC_0_EPUN_Msk                                  (0x01UL << SCU_SFSPC_0_EPUN_Pos)                          /*!< SCU SFSPC_0: EPUN Mask              */\r
+#define SCU_SFSPC_0_EHS_Pos                                   5                                                         /*!< SCU SFSPC_0: EHS Position           */\r
+#define SCU_SFSPC_0_EHS_Msk                                   (0x01UL << SCU_SFSPC_0_EHS_Pos)                           /*!< SCU SFSPC_0: EHS Mask               */\r
+#define SCU_SFSPC_0_EZI_Pos                                   6                                                         /*!< SCU SFSPC_0: EZI Position           */\r
+#define SCU_SFSPC_0_EZI_Msk                                   (0x01UL << SCU_SFSPC_0_EZI_Pos)                           /*!< SCU SFSPC_0: EZI Mask               */\r
+#define SCU_SFSPC_0_EHD_Pos                                   8                                                         /*!< SCU SFSPC_0: EHD Position           */\r
+#define SCU_SFSPC_0_EHD_Msk                                   (0x03UL << SCU_SFSPC_0_EHD_Pos)                           /*!< SCU SFSPC_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_1  ------------------------------------------\r
+#define SCU_SFSPC_1_MODE_Pos                                  0                                                         /*!< SCU SFSPC_1: MODE Position          */\r
+#define SCU_SFSPC_1_MODE_Msk                                  (0x07UL << SCU_SFSPC_1_MODE_Pos)                          /*!< SCU SFSPC_1: MODE Mask              */\r
+#define SCU_SFSPC_1_EPD_Pos                                   3                                                         /*!< SCU SFSPC_1: EPD Position           */\r
+#define SCU_SFSPC_1_EPD_Msk                                   (0x01UL << SCU_SFSPC_1_EPD_Pos)                           /*!< SCU SFSPC_1: EPD Mask               */\r
+#define SCU_SFSPC_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_1: EPUN Position          */\r
+#define SCU_SFSPC_1_EPUN_Msk                                  (0x01UL << SCU_SFSPC_1_EPUN_Pos)                          /*!< SCU SFSPC_1: EPUN Mask              */\r
+#define SCU_SFSPC_1_EHS_Pos                                   5                                                         /*!< SCU SFSPC_1: EHS Position           */\r
+#define SCU_SFSPC_1_EHS_Msk                                   (0x01UL << SCU_SFSPC_1_EHS_Pos)                           /*!< SCU SFSPC_1: EHS Mask               */\r
+#define SCU_SFSPC_1_EZI_Pos                                   6                                                         /*!< SCU SFSPC_1: EZI Position           */\r
+#define SCU_SFSPC_1_EZI_Msk                                   (0x01UL << SCU_SFSPC_1_EZI_Pos)                           /*!< SCU SFSPC_1: EZI Mask               */\r
+#define SCU_SFSPC_1_EHD_Pos                                   8                                                         /*!< SCU SFSPC_1: EHD Position           */\r
+#define SCU_SFSPC_1_EHD_Msk                                   (0x03UL << SCU_SFSPC_1_EHD_Pos)                           /*!< SCU SFSPC_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_2  ------------------------------------------\r
+#define SCU_SFSPC_2_MODE_Pos                                  0                                                         /*!< SCU SFSPC_2: MODE Position          */\r
+#define SCU_SFSPC_2_MODE_Msk                                  (0x07UL << SCU_SFSPC_2_MODE_Pos)                          /*!< SCU SFSPC_2: MODE Mask              */\r
+#define SCU_SFSPC_2_EPD_Pos                                   3                                                         /*!< SCU SFSPC_2: EPD Position           */\r
+#define SCU_SFSPC_2_EPD_Msk                                   (0x01UL << SCU_SFSPC_2_EPD_Pos)                           /*!< SCU SFSPC_2: EPD Mask               */\r
+#define SCU_SFSPC_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_2: EPUN Position          */\r
+#define SCU_SFSPC_2_EPUN_Msk                                  (0x01UL << SCU_SFSPC_2_EPUN_Pos)                          /*!< SCU SFSPC_2: EPUN Mask              */\r
+#define SCU_SFSPC_2_EHS_Pos                                   5                                                         /*!< SCU SFSPC_2: EHS Position           */\r
+#define SCU_SFSPC_2_EHS_Msk                                   (0x01UL << SCU_SFSPC_2_EHS_Pos)                           /*!< SCU SFSPC_2: EHS Mask               */\r
+#define SCU_SFSPC_2_EZI_Pos                                   6                                                         /*!< SCU SFSPC_2: EZI Position           */\r
+#define SCU_SFSPC_2_EZI_Msk                                   (0x01UL << SCU_SFSPC_2_EZI_Pos)                           /*!< SCU SFSPC_2: EZI Mask               */\r
+#define SCU_SFSPC_2_EHD_Pos                                   8                                                         /*!< SCU SFSPC_2: EHD Position           */\r
+#define SCU_SFSPC_2_EHD_Msk                                   (0x03UL << SCU_SFSPC_2_EHD_Pos)                           /*!< SCU SFSPC_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_3  ------------------------------------------\r
+#define SCU_SFSPC_3_MODE_Pos                                  0                                                         /*!< SCU SFSPC_3: MODE Position          */\r
+#define SCU_SFSPC_3_MODE_Msk                                  (0x07UL << SCU_SFSPC_3_MODE_Pos)                          /*!< SCU SFSPC_3: MODE Mask              */\r
+#define SCU_SFSPC_3_EPD_Pos                                   3                                                         /*!< SCU SFSPC_3: EPD Position           */\r
+#define SCU_SFSPC_3_EPD_Msk                                   (0x01UL << SCU_SFSPC_3_EPD_Pos)                           /*!< SCU SFSPC_3: EPD Mask               */\r
+#define SCU_SFSPC_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_3: EPUN Position          */\r
+#define SCU_SFSPC_3_EPUN_Msk                                  (0x01UL << SCU_SFSPC_3_EPUN_Pos)                          /*!< SCU SFSPC_3: EPUN Mask              */\r
+#define SCU_SFSPC_3_EHS_Pos                                   5                                                         /*!< SCU SFSPC_3: EHS Position           */\r
+#define SCU_SFSPC_3_EHS_Msk                                   (0x01UL << SCU_SFSPC_3_EHS_Pos)                           /*!< SCU SFSPC_3: EHS Mask               */\r
+#define SCU_SFSPC_3_EZI_Pos                                   6                                                         /*!< SCU SFSPC_3: EZI Position           */\r
+#define SCU_SFSPC_3_EZI_Msk                                   (0x01UL << SCU_SFSPC_3_EZI_Pos)                           /*!< SCU SFSPC_3: EZI Mask               */\r
+#define SCU_SFSPC_3_EHD_Pos                                   8                                                         /*!< SCU SFSPC_3: EHD Position           */\r
+#define SCU_SFSPC_3_EHD_Msk                                   (0x03UL << SCU_SFSPC_3_EHD_Pos)                           /*!< SCU SFSPC_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_4  ------------------------------------------\r
+#define SCU_SFSPC_4_MODE_Pos                                  0                                                         /*!< SCU SFSPC_4: MODE Position          */\r
+#define SCU_SFSPC_4_MODE_Msk                                  (0x07UL << SCU_SFSPC_4_MODE_Pos)                          /*!< SCU SFSPC_4: MODE Mask              */\r
+#define SCU_SFSPC_4_EPD_Pos                                   3                                                         /*!< SCU SFSPC_4: EPD Position           */\r
+#define SCU_SFSPC_4_EPD_Msk                                   (0x01UL << SCU_SFSPC_4_EPD_Pos)                           /*!< SCU SFSPC_4: EPD Mask               */\r
+#define SCU_SFSPC_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_4: EPUN Position          */\r
+#define SCU_SFSPC_4_EPUN_Msk                                  (0x01UL << SCU_SFSPC_4_EPUN_Pos)                          /*!< SCU SFSPC_4: EPUN Mask              */\r
+#define SCU_SFSPC_4_EHS_Pos                                   5                                                         /*!< SCU SFSPC_4: EHS Position           */\r
+#define SCU_SFSPC_4_EHS_Msk                                   (0x01UL << SCU_SFSPC_4_EHS_Pos)                           /*!< SCU SFSPC_4: EHS Mask               */\r
+#define SCU_SFSPC_4_EZI_Pos                                   6                                                         /*!< SCU SFSPC_4: EZI Position           */\r
+#define SCU_SFSPC_4_EZI_Msk                                   (0x01UL << SCU_SFSPC_4_EZI_Pos)                           /*!< SCU SFSPC_4: EZI Mask               */\r
+#define SCU_SFSPC_4_EHD_Pos                                   8                                                         /*!< SCU SFSPC_4: EHD Position           */\r
+#define SCU_SFSPC_4_EHD_Msk                                   (0x03UL << SCU_SFSPC_4_EHD_Pos)                           /*!< SCU SFSPC_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_5  ------------------------------------------\r
+#define SCU_SFSPC_5_MODE_Pos                                  0                                                         /*!< SCU SFSPC_5: MODE Position          */\r
+#define SCU_SFSPC_5_MODE_Msk                                  (0x07UL << SCU_SFSPC_5_MODE_Pos)                          /*!< SCU SFSPC_5: MODE Mask              */\r
+#define SCU_SFSPC_5_EPD_Pos                                   3                                                         /*!< SCU SFSPC_5: EPD Position           */\r
+#define SCU_SFSPC_5_EPD_Msk                                   (0x01UL << SCU_SFSPC_5_EPD_Pos)                           /*!< SCU SFSPC_5: EPD Mask               */\r
+#define SCU_SFSPC_5_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_5: EPUN Position          */\r
+#define SCU_SFSPC_5_EPUN_Msk                                  (0x01UL << SCU_SFSPC_5_EPUN_Pos)                          /*!< SCU SFSPC_5: EPUN Mask              */\r
+#define SCU_SFSPC_5_EHS_Pos                                   5                                                         /*!< SCU SFSPC_5: EHS Position           */\r
+#define SCU_SFSPC_5_EHS_Msk                                   (0x01UL << SCU_SFSPC_5_EHS_Pos)                           /*!< SCU SFSPC_5: EHS Mask               */\r
+#define SCU_SFSPC_5_EZI_Pos                                   6                                                         /*!< SCU SFSPC_5: EZI Position           */\r
+#define SCU_SFSPC_5_EZI_Msk                                   (0x01UL << SCU_SFSPC_5_EZI_Pos)                           /*!< SCU SFSPC_5: EZI Mask               */\r
+#define SCU_SFSPC_5_EHD_Pos                                   8                                                         /*!< SCU SFSPC_5: EHD Position           */\r
+#define SCU_SFSPC_5_EHD_Msk                                   (0x03UL << SCU_SFSPC_5_EHD_Pos)                           /*!< SCU SFSPC_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_6  ------------------------------------------\r
+#define SCU_SFSPC_6_MODE_Pos                                  0                                                         /*!< SCU SFSPC_6: MODE Position          */\r
+#define SCU_SFSPC_6_MODE_Msk                                  (0x07UL << SCU_SFSPC_6_MODE_Pos)                          /*!< SCU SFSPC_6: MODE Mask              */\r
+#define SCU_SFSPC_6_EPD_Pos                                   3                                                         /*!< SCU SFSPC_6: EPD Position           */\r
+#define SCU_SFSPC_6_EPD_Msk                                   (0x01UL << SCU_SFSPC_6_EPD_Pos)                           /*!< SCU SFSPC_6: EPD Mask               */\r
+#define SCU_SFSPC_6_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_6: EPUN Position          */\r
+#define SCU_SFSPC_6_EPUN_Msk                                  (0x01UL << SCU_SFSPC_6_EPUN_Pos)                          /*!< SCU SFSPC_6: EPUN Mask              */\r
+#define SCU_SFSPC_6_EHS_Pos                                   5                                                         /*!< SCU SFSPC_6: EHS Position           */\r
+#define SCU_SFSPC_6_EHS_Msk                                   (0x01UL << SCU_SFSPC_6_EHS_Pos)                           /*!< SCU SFSPC_6: EHS Mask               */\r
+#define SCU_SFSPC_6_EZI_Pos                                   6                                                         /*!< SCU SFSPC_6: EZI Position           */\r
+#define SCU_SFSPC_6_EZI_Msk                                   (0x01UL << SCU_SFSPC_6_EZI_Pos)                           /*!< SCU SFSPC_6: EZI Mask               */\r
+#define SCU_SFSPC_6_EHD_Pos                                   8                                                         /*!< SCU SFSPC_6: EHD Position           */\r
+#define SCU_SFSPC_6_EHD_Msk                                   (0x03UL << SCU_SFSPC_6_EHD_Pos)                           /*!< SCU SFSPC_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_7  ------------------------------------------\r
+#define SCU_SFSPC_7_MODE_Pos                                  0                                                         /*!< SCU SFSPC_7: MODE Position          */\r
+#define SCU_SFSPC_7_MODE_Msk                                  (0x07UL << SCU_SFSPC_7_MODE_Pos)                          /*!< SCU SFSPC_7: MODE Mask              */\r
+#define SCU_SFSPC_7_EPD_Pos                                   3                                                         /*!< SCU SFSPC_7: EPD Position           */\r
+#define SCU_SFSPC_7_EPD_Msk                                   (0x01UL << SCU_SFSPC_7_EPD_Pos)                           /*!< SCU SFSPC_7: EPD Mask               */\r
+#define SCU_SFSPC_7_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_7: EPUN Position          */\r
+#define SCU_SFSPC_7_EPUN_Msk                                  (0x01UL << SCU_SFSPC_7_EPUN_Pos)                          /*!< SCU SFSPC_7: EPUN Mask              */\r
+#define SCU_SFSPC_7_EHS_Pos                                   5                                                         /*!< SCU SFSPC_7: EHS Position           */\r
+#define SCU_SFSPC_7_EHS_Msk                                   (0x01UL << SCU_SFSPC_7_EHS_Pos)                           /*!< SCU SFSPC_7: EHS Mask               */\r
+#define SCU_SFSPC_7_EZI_Pos                                   6                                                         /*!< SCU SFSPC_7: EZI Position           */\r
+#define SCU_SFSPC_7_EZI_Msk                                   (0x01UL << SCU_SFSPC_7_EZI_Pos)                           /*!< SCU SFSPC_7: EZI Mask               */\r
+#define SCU_SFSPC_7_EHD_Pos                                   8                                                         /*!< SCU SFSPC_7: EHD Position           */\r
+#define SCU_SFSPC_7_EHD_Msk                                   (0x03UL << SCU_SFSPC_7_EHD_Pos)                           /*!< SCU SFSPC_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_8  ------------------------------------------\r
+#define SCU_SFSPC_8_MODE_Pos                                  0                                                         /*!< SCU SFSPC_8: MODE Position          */\r
+#define SCU_SFSPC_8_MODE_Msk                                  (0x07UL << SCU_SFSPC_8_MODE_Pos)                          /*!< SCU SFSPC_8: MODE Mask              */\r
+#define SCU_SFSPC_8_EPD_Pos                                   3                                                         /*!< SCU SFSPC_8: EPD Position           */\r
+#define SCU_SFSPC_8_EPD_Msk                                   (0x01UL << SCU_SFSPC_8_EPD_Pos)                           /*!< SCU SFSPC_8: EPD Mask               */\r
+#define SCU_SFSPC_8_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_8: EPUN Position          */\r
+#define SCU_SFSPC_8_EPUN_Msk                                  (0x01UL << SCU_SFSPC_8_EPUN_Pos)                          /*!< SCU SFSPC_8: EPUN Mask              */\r
+#define SCU_SFSPC_8_EHS_Pos                                   5                                                         /*!< SCU SFSPC_8: EHS Position           */\r
+#define SCU_SFSPC_8_EHS_Msk                                   (0x01UL << SCU_SFSPC_8_EHS_Pos)                           /*!< SCU SFSPC_8: EHS Mask               */\r
+#define SCU_SFSPC_8_EZI_Pos                                   6                                                         /*!< SCU SFSPC_8: EZI Position           */\r
+#define SCU_SFSPC_8_EZI_Msk                                   (0x01UL << SCU_SFSPC_8_EZI_Pos)                           /*!< SCU SFSPC_8: EZI Mask               */\r
+#define SCU_SFSPC_8_EHD_Pos                                   8                                                         /*!< SCU SFSPC_8: EHD Position           */\r
+#define SCU_SFSPC_8_EHD_Msk                                   (0x03UL << SCU_SFSPC_8_EHD_Pos)                           /*!< SCU SFSPC_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPC_9  ------------------------------------------\r
+#define SCU_SFSPC_9_MODE_Pos                                  0                                                         /*!< SCU SFSPC_9: MODE Position          */\r
+#define SCU_SFSPC_9_MODE_Msk                                  (0x07UL << SCU_SFSPC_9_MODE_Pos)                          /*!< SCU SFSPC_9: MODE Mask              */\r
+#define SCU_SFSPC_9_EPD_Pos                                   3                                                         /*!< SCU SFSPC_9: EPD Position           */\r
+#define SCU_SFSPC_9_EPD_Msk                                   (0x01UL << SCU_SFSPC_9_EPD_Pos)                           /*!< SCU SFSPC_9: EPD Mask               */\r
+#define SCU_SFSPC_9_EPUN_Pos                                  4                                                         /*!< SCU SFSPC_9: EPUN Position          */\r
+#define SCU_SFSPC_9_EPUN_Msk                                  (0x01UL << SCU_SFSPC_9_EPUN_Pos)                          /*!< SCU SFSPC_9: EPUN Mask              */\r
+#define SCU_SFSPC_9_EHS_Pos                                   5                                                         /*!< SCU SFSPC_9: EHS Position           */\r
+#define SCU_SFSPC_9_EHS_Msk                                   (0x01UL << SCU_SFSPC_9_EHS_Pos)                           /*!< SCU SFSPC_9: EHS Mask               */\r
+#define SCU_SFSPC_9_EZI_Pos                                   6                                                         /*!< SCU SFSPC_9: EZI Position           */\r
+#define SCU_SFSPC_9_EZI_Msk                                   (0x01UL << SCU_SFSPC_9_EZI_Pos)                           /*!< SCU SFSPC_9: EZI Mask               */\r
+#define SCU_SFSPC_9_EHD_Pos                                   8                                                         /*!< SCU SFSPC_9: EHD Position           */\r
+#define SCU_SFSPC_9_EHD_Msk                                   (0x03UL << SCU_SFSPC_9_EHD_Pos)                           /*!< SCU SFSPC_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSPC_10  ------------------------------------------\r
+#define SCU_SFSPC_10_MODE_Pos                                 0                                                         /*!< SCU SFSPC_10: MODE Position         */\r
+#define SCU_SFSPC_10_MODE_Msk                                 (0x07UL << SCU_SFSPC_10_MODE_Pos)                         /*!< SCU SFSPC_10: MODE Mask             */\r
+#define SCU_SFSPC_10_EPD_Pos                                  3                                                         /*!< SCU SFSPC_10: EPD Position          */\r
+#define SCU_SFSPC_10_EPD_Msk                                  (0x01UL << SCU_SFSPC_10_EPD_Pos)                          /*!< SCU SFSPC_10: EPD Mask              */\r
+#define SCU_SFSPC_10_EPUN_Pos                                 4                                                         /*!< SCU SFSPC_10: EPUN Position         */\r
+#define SCU_SFSPC_10_EPUN_Msk                                 (0x01UL << SCU_SFSPC_10_EPUN_Pos)                         /*!< SCU SFSPC_10: EPUN Mask             */\r
+#define SCU_SFSPC_10_EHS_Pos                                  5                                                         /*!< SCU SFSPC_10: EHS Position          */\r
+#define SCU_SFSPC_10_EHS_Msk                                  (0x01UL << SCU_SFSPC_10_EHS_Pos)                          /*!< SCU SFSPC_10: EHS Mask              */\r
+#define SCU_SFSPC_10_EZI_Pos                                  6                                                         /*!< SCU SFSPC_10: EZI Position          */\r
+#define SCU_SFSPC_10_EZI_Msk                                  (0x01UL << SCU_SFSPC_10_EZI_Pos)                          /*!< SCU SFSPC_10: EZI Mask              */\r
+#define SCU_SFSPC_10_EHD_Pos                                  8                                                         /*!< SCU SFSPC_10: EHD Position          */\r
+#define SCU_SFSPC_10_EHD_Msk                                  (0x03UL << SCU_SFSPC_10_EHD_Pos)                          /*!< SCU SFSPC_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPC_11  ------------------------------------------\r
+#define SCU_SFSPC_11_MODE_Pos                                 0                                                         /*!< SCU SFSPC_11: MODE Position         */\r
+#define SCU_SFSPC_11_MODE_Msk                                 (0x07UL << SCU_SFSPC_11_MODE_Pos)                         /*!< SCU SFSPC_11: MODE Mask             */\r
+#define SCU_SFSPC_11_EPD_Pos                                  3                                                         /*!< SCU SFSPC_11: EPD Position          */\r
+#define SCU_SFSPC_11_EPD_Msk                                  (0x01UL << SCU_SFSPC_11_EPD_Pos)                          /*!< SCU SFSPC_11: EPD Mask              */\r
+#define SCU_SFSPC_11_EPUN_Pos                                 4                                                         /*!< SCU SFSPC_11: EPUN Position         */\r
+#define SCU_SFSPC_11_EPUN_Msk                                 (0x01UL << SCU_SFSPC_11_EPUN_Pos)                         /*!< SCU SFSPC_11: EPUN Mask             */\r
+#define SCU_SFSPC_11_EHS_Pos                                  5                                                         /*!< SCU SFSPC_11: EHS Position          */\r
+#define SCU_SFSPC_11_EHS_Msk                                  (0x01UL << SCU_SFSPC_11_EHS_Pos)                          /*!< SCU SFSPC_11: EHS Mask              */\r
+#define SCU_SFSPC_11_EZI_Pos                                  6                                                         /*!< SCU SFSPC_11: EZI Position          */\r
+#define SCU_SFSPC_11_EZI_Msk                                  (0x01UL << SCU_SFSPC_11_EZI_Pos)                          /*!< SCU SFSPC_11: EZI Mask              */\r
+#define SCU_SFSPC_11_EHD_Pos                                  8                                                         /*!< SCU SFSPC_11: EHD Position          */\r
+#define SCU_SFSPC_11_EHD_Msk                                  (0x03UL << SCU_SFSPC_11_EHD_Pos)                          /*!< SCU SFSPC_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPC_12  ------------------------------------------\r
+#define SCU_SFSPC_12_MODE_Pos                                 0                                                         /*!< SCU SFSPC_12: MODE Position         */\r
+#define SCU_SFSPC_12_MODE_Msk                                 (0x07UL << SCU_SFSPC_12_MODE_Pos)                         /*!< SCU SFSPC_12: MODE Mask             */\r
+#define SCU_SFSPC_12_EPD_Pos                                  3                                                         /*!< SCU SFSPC_12: EPD Position          */\r
+#define SCU_SFSPC_12_EPD_Msk                                  (0x01UL << SCU_SFSPC_12_EPD_Pos)                          /*!< SCU SFSPC_12: EPD Mask              */\r
+#define SCU_SFSPC_12_EPUN_Pos                                 4                                                         /*!< SCU SFSPC_12: EPUN Position         */\r
+#define SCU_SFSPC_12_EPUN_Msk                                 (0x01UL << SCU_SFSPC_12_EPUN_Pos)                         /*!< SCU SFSPC_12: EPUN Mask             */\r
+#define SCU_SFSPC_12_EHS_Pos                                  5                                                         /*!< SCU SFSPC_12: EHS Position          */\r
+#define SCU_SFSPC_12_EHS_Msk                                  (0x01UL << SCU_SFSPC_12_EHS_Pos)                          /*!< SCU SFSPC_12: EHS Mask              */\r
+#define SCU_SFSPC_12_EZI_Pos                                  6                                                         /*!< SCU SFSPC_12: EZI Position          */\r
+#define SCU_SFSPC_12_EZI_Msk                                  (0x01UL << SCU_SFSPC_12_EZI_Pos)                          /*!< SCU SFSPC_12: EZI Mask              */\r
+#define SCU_SFSPC_12_EHD_Pos                                  8                                                         /*!< SCU SFSPC_12: EHD Position          */\r
+#define SCU_SFSPC_12_EHD_Msk                                  (0x03UL << SCU_SFSPC_12_EHD_Pos)                          /*!< SCU SFSPC_12: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPC_13  ------------------------------------------\r
+#define SCU_SFSPC_13_MODE_Pos                                 0                                                         /*!< SCU SFSPC_13: MODE Position         */\r
+#define SCU_SFSPC_13_MODE_Msk                                 (0x07UL << SCU_SFSPC_13_MODE_Pos)                         /*!< SCU SFSPC_13: MODE Mask             */\r
+#define SCU_SFSPC_13_EPD_Pos                                  3                                                         /*!< SCU SFSPC_13: EPD Position          */\r
+#define SCU_SFSPC_13_EPD_Msk                                  (0x01UL << SCU_SFSPC_13_EPD_Pos)                          /*!< SCU SFSPC_13: EPD Mask              */\r
+#define SCU_SFSPC_13_EPUN_Pos                                 4                                                         /*!< SCU SFSPC_13: EPUN Position         */\r
+#define SCU_SFSPC_13_EPUN_Msk                                 (0x01UL << SCU_SFSPC_13_EPUN_Pos)                         /*!< SCU SFSPC_13: EPUN Mask             */\r
+#define SCU_SFSPC_13_EHS_Pos                                  5                                                         /*!< SCU SFSPC_13: EHS Position          */\r
+#define SCU_SFSPC_13_EHS_Msk                                  (0x01UL << SCU_SFSPC_13_EHS_Pos)                          /*!< SCU SFSPC_13: EHS Mask              */\r
+#define SCU_SFSPC_13_EZI_Pos                                  6                                                         /*!< SCU SFSPC_13: EZI Position          */\r
+#define SCU_SFSPC_13_EZI_Msk                                  (0x01UL << SCU_SFSPC_13_EZI_Pos)                          /*!< SCU SFSPC_13: EZI Mask              */\r
+#define SCU_SFSPC_13_EHD_Pos                                  8                                                         /*!< SCU SFSPC_13: EHD Position          */\r
+#define SCU_SFSPC_13_EHD_Msk                                  (0x03UL << SCU_SFSPC_13_EHD_Pos)                          /*!< SCU SFSPC_13: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPC_14  ------------------------------------------\r
+#define SCU_SFSPC_14_MODE_Pos                                 0                                                         /*!< SCU SFSPC_14: MODE Position         */\r
+#define SCU_SFSPC_14_MODE_Msk                                 (0x07UL << SCU_SFSPC_14_MODE_Pos)                         /*!< SCU SFSPC_14: MODE Mask             */\r
+#define SCU_SFSPC_14_EPD_Pos                                  3                                                         /*!< SCU SFSPC_14: EPD Position          */\r
+#define SCU_SFSPC_14_EPD_Msk                                  (0x01UL << SCU_SFSPC_14_EPD_Pos)                          /*!< SCU SFSPC_14: EPD Mask              */\r
+#define SCU_SFSPC_14_EPUN_Pos                                 4                                                         /*!< SCU SFSPC_14: EPUN Position         */\r
+#define SCU_SFSPC_14_EPUN_Msk                                 (0x01UL << SCU_SFSPC_14_EPUN_Pos)                         /*!< SCU SFSPC_14: EPUN Mask             */\r
+#define SCU_SFSPC_14_EHS_Pos                                  5                                                         /*!< SCU SFSPC_14: EHS Position          */\r
+#define SCU_SFSPC_14_EHS_Msk                                  (0x01UL << SCU_SFSPC_14_EHS_Pos)                          /*!< SCU SFSPC_14: EHS Mask              */\r
+#define SCU_SFSPC_14_EZI_Pos                                  6                                                         /*!< SCU SFSPC_14: EZI Position          */\r
+#define SCU_SFSPC_14_EZI_Msk                                  (0x01UL << SCU_SFSPC_14_EZI_Pos)                          /*!< SCU SFSPC_14: EZI Mask              */\r
+#define SCU_SFSPC_14_EHD_Pos                                  8                                                         /*!< SCU SFSPC_14: EHD Position          */\r
+#define SCU_SFSPC_14_EHD_Msk                                  (0x03UL << SCU_SFSPC_14_EHD_Pos)                          /*!< SCU SFSPC_14: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSPD_0  ------------------------------------------\r
+#define SCU_SFSPD_0_MODE_Pos                                  0                                                         /*!< SCU SFSPD_0: MODE Position          */\r
+#define SCU_SFSPD_0_MODE_Msk                                  (0x07UL << SCU_SFSPD_0_MODE_Pos)                          /*!< SCU SFSPD_0: MODE Mask              */\r
+#define SCU_SFSPD_0_EPD_Pos                                   3                                                         /*!< SCU SFSPD_0: EPD Position           */\r
+#define SCU_SFSPD_0_EPD_Msk                                   (0x01UL << SCU_SFSPD_0_EPD_Pos)                           /*!< SCU SFSPD_0: EPD Mask               */\r
+#define SCU_SFSPD_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_0: EPUN Position          */\r
+#define SCU_SFSPD_0_EPUN_Msk                                  (0x01UL << SCU_SFSPD_0_EPUN_Pos)                          /*!< SCU SFSPD_0: EPUN Mask              */\r
+#define SCU_SFSPD_0_EHS_Pos                                   5                                                         /*!< SCU SFSPD_0: EHS Position           */\r
+#define SCU_SFSPD_0_EHS_Msk                                   (0x01UL << SCU_SFSPD_0_EHS_Pos)                           /*!< SCU SFSPD_0: EHS Mask               */\r
+#define SCU_SFSPD_0_EZI_Pos                                   6                                                         /*!< SCU SFSPD_0: EZI Position           */\r
+#define SCU_SFSPD_0_EZI_Msk                                   (0x01UL << SCU_SFSPD_0_EZI_Pos)                           /*!< SCU SFSPD_0: EZI Mask               */\r
+#define SCU_SFSPD_0_EHD_Pos                                   8                                                         /*!< SCU SFSPD_0: EHD Position           */\r
+#define SCU_SFSPD_0_EHD_Msk                                   (0x03UL << SCU_SFSPD_0_EHD_Pos)                           /*!< SCU SFSPD_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_1  ------------------------------------------\r
+#define SCU_SFSPD_1_MODE_Pos                                  0                                                         /*!< SCU SFSPD_1: MODE Position          */\r
+#define SCU_SFSPD_1_MODE_Msk                                  (0x07UL << SCU_SFSPD_1_MODE_Pos)                          /*!< SCU SFSPD_1: MODE Mask              */\r
+#define SCU_SFSPD_1_EPD_Pos                                   3                                                         /*!< SCU SFSPD_1: EPD Position           */\r
+#define SCU_SFSPD_1_EPD_Msk                                   (0x01UL << SCU_SFSPD_1_EPD_Pos)                           /*!< SCU SFSPD_1: EPD Mask               */\r
+#define SCU_SFSPD_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_1: EPUN Position          */\r
+#define SCU_SFSPD_1_EPUN_Msk                                  (0x01UL << SCU_SFSPD_1_EPUN_Pos)                          /*!< SCU SFSPD_1: EPUN Mask              */\r
+#define SCU_SFSPD_1_EHS_Pos                                   5                                                         /*!< SCU SFSPD_1: EHS Position           */\r
+#define SCU_SFSPD_1_EHS_Msk                                   (0x01UL << SCU_SFSPD_1_EHS_Pos)                           /*!< SCU SFSPD_1: EHS Mask               */\r
+#define SCU_SFSPD_1_EZI_Pos                                   6                                                         /*!< SCU SFSPD_1: EZI Position           */\r
+#define SCU_SFSPD_1_EZI_Msk                                   (0x01UL << SCU_SFSPD_1_EZI_Pos)                           /*!< SCU SFSPD_1: EZI Mask               */\r
+#define SCU_SFSPD_1_EHD_Pos                                   8                                                         /*!< SCU SFSPD_1: EHD Position           */\r
+#define SCU_SFSPD_1_EHD_Msk                                   (0x03UL << SCU_SFSPD_1_EHD_Pos)                           /*!< SCU SFSPD_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_2  ------------------------------------------\r
+#define SCU_SFSPD_2_MODE_Pos                                  0                                                         /*!< SCU SFSPD_2: MODE Position          */\r
+#define SCU_SFSPD_2_MODE_Msk                                  (0x07UL << SCU_SFSPD_2_MODE_Pos)                          /*!< SCU SFSPD_2: MODE Mask              */\r
+#define SCU_SFSPD_2_EPD_Pos                                   3                                                         /*!< SCU SFSPD_2: EPD Position           */\r
+#define SCU_SFSPD_2_EPD_Msk                                   (0x01UL << SCU_SFSPD_2_EPD_Pos)                           /*!< SCU SFSPD_2: EPD Mask               */\r
+#define SCU_SFSPD_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_2: EPUN Position          */\r
+#define SCU_SFSPD_2_EPUN_Msk                                  (0x01UL << SCU_SFSPD_2_EPUN_Pos)                          /*!< SCU SFSPD_2: EPUN Mask              */\r
+#define SCU_SFSPD_2_EHS_Pos                                   5                                                         /*!< SCU SFSPD_2: EHS Position           */\r
+#define SCU_SFSPD_2_EHS_Msk                                   (0x01UL << SCU_SFSPD_2_EHS_Pos)                           /*!< SCU SFSPD_2: EHS Mask               */\r
+#define SCU_SFSPD_2_EZI_Pos                                   6                                                         /*!< SCU SFSPD_2: EZI Position           */\r
+#define SCU_SFSPD_2_EZI_Msk                                   (0x01UL << SCU_SFSPD_2_EZI_Pos)                           /*!< SCU SFSPD_2: EZI Mask               */\r
+#define SCU_SFSPD_2_EHD_Pos                                   8                                                         /*!< SCU SFSPD_2: EHD Position           */\r
+#define SCU_SFSPD_2_EHD_Msk                                   (0x03UL << SCU_SFSPD_2_EHD_Pos)                           /*!< SCU SFSPD_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_3  ------------------------------------------\r
+#define SCU_SFSPD_3_MODE_Pos                                  0                                                         /*!< SCU SFSPD_3: MODE Position          */\r
+#define SCU_SFSPD_3_MODE_Msk                                  (0x07UL << SCU_SFSPD_3_MODE_Pos)                          /*!< SCU SFSPD_3: MODE Mask              */\r
+#define SCU_SFSPD_3_EPD_Pos                                   3                                                         /*!< SCU SFSPD_3: EPD Position           */\r
+#define SCU_SFSPD_3_EPD_Msk                                   (0x01UL << SCU_SFSPD_3_EPD_Pos)                           /*!< SCU SFSPD_3: EPD Mask               */\r
+#define SCU_SFSPD_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_3: EPUN Position          */\r
+#define SCU_SFSPD_3_EPUN_Msk                                  (0x01UL << SCU_SFSPD_3_EPUN_Pos)                          /*!< SCU SFSPD_3: EPUN Mask              */\r
+#define SCU_SFSPD_3_EHS_Pos                                   5                                                         /*!< SCU SFSPD_3: EHS Position           */\r
+#define SCU_SFSPD_3_EHS_Msk                                   (0x01UL << SCU_SFSPD_3_EHS_Pos)                           /*!< SCU SFSPD_3: EHS Mask               */\r
+#define SCU_SFSPD_3_EZI_Pos                                   6                                                         /*!< SCU SFSPD_3: EZI Position           */\r
+#define SCU_SFSPD_3_EZI_Msk                                   (0x01UL << SCU_SFSPD_3_EZI_Pos)                           /*!< SCU SFSPD_3: EZI Mask               */\r
+#define SCU_SFSPD_3_EHD_Pos                                   8                                                         /*!< SCU SFSPD_3: EHD Position           */\r
+#define SCU_SFSPD_3_EHD_Msk                                   (0x03UL << SCU_SFSPD_3_EHD_Pos)                           /*!< SCU SFSPD_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_4  ------------------------------------------\r
+#define SCU_SFSPD_4_MODE_Pos                                  0                                                         /*!< SCU SFSPD_4: MODE Position          */\r
+#define SCU_SFSPD_4_MODE_Msk                                  (0x07UL << SCU_SFSPD_4_MODE_Pos)                          /*!< SCU SFSPD_4: MODE Mask              */\r
+#define SCU_SFSPD_4_EPD_Pos                                   3                                                         /*!< SCU SFSPD_4: EPD Position           */\r
+#define SCU_SFSPD_4_EPD_Msk                                   (0x01UL << SCU_SFSPD_4_EPD_Pos)                           /*!< SCU SFSPD_4: EPD Mask               */\r
+#define SCU_SFSPD_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_4: EPUN Position          */\r
+#define SCU_SFSPD_4_EPUN_Msk                                  (0x01UL << SCU_SFSPD_4_EPUN_Pos)                          /*!< SCU SFSPD_4: EPUN Mask              */\r
+#define SCU_SFSPD_4_EHS_Pos                                   5                                                         /*!< SCU SFSPD_4: EHS Position           */\r
+#define SCU_SFSPD_4_EHS_Msk                                   (0x01UL << SCU_SFSPD_4_EHS_Pos)                           /*!< SCU SFSPD_4: EHS Mask               */\r
+#define SCU_SFSPD_4_EZI_Pos                                   6                                                         /*!< SCU SFSPD_4: EZI Position           */\r
+#define SCU_SFSPD_4_EZI_Msk                                   (0x01UL << SCU_SFSPD_4_EZI_Pos)                           /*!< SCU SFSPD_4: EZI Mask               */\r
+#define SCU_SFSPD_4_EHD_Pos                                   8                                                         /*!< SCU SFSPD_4: EHD Position           */\r
+#define SCU_SFSPD_4_EHD_Msk                                   (0x03UL << SCU_SFSPD_4_EHD_Pos)                           /*!< SCU SFSPD_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_5  ------------------------------------------\r
+#define SCU_SFSPD_5_MODE_Pos                                  0                                                         /*!< SCU SFSPD_5: MODE Position          */\r
+#define SCU_SFSPD_5_MODE_Msk                                  (0x07UL << SCU_SFSPD_5_MODE_Pos)                          /*!< SCU SFSPD_5: MODE Mask              */\r
+#define SCU_SFSPD_5_EPD_Pos                                   3                                                         /*!< SCU SFSPD_5: EPD Position           */\r
+#define SCU_SFSPD_5_EPD_Msk                                   (0x01UL << SCU_SFSPD_5_EPD_Pos)                           /*!< SCU SFSPD_5: EPD Mask               */\r
+#define SCU_SFSPD_5_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_5: EPUN Position          */\r
+#define SCU_SFSPD_5_EPUN_Msk                                  (0x01UL << SCU_SFSPD_5_EPUN_Pos)                          /*!< SCU SFSPD_5: EPUN Mask              */\r
+#define SCU_SFSPD_5_EHS_Pos                                   5                                                         /*!< SCU SFSPD_5: EHS Position           */\r
+#define SCU_SFSPD_5_EHS_Msk                                   (0x01UL << SCU_SFSPD_5_EHS_Pos)                           /*!< SCU SFSPD_5: EHS Mask               */\r
+#define SCU_SFSPD_5_EZI_Pos                                   6                                                         /*!< SCU SFSPD_5: EZI Position           */\r
+#define SCU_SFSPD_5_EZI_Msk                                   (0x01UL << SCU_SFSPD_5_EZI_Pos)                           /*!< SCU SFSPD_5: EZI Mask               */\r
+#define SCU_SFSPD_5_EHD_Pos                                   8                                                         /*!< SCU SFSPD_5: EHD Position           */\r
+#define SCU_SFSPD_5_EHD_Msk                                   (0x03UL << SCU_SFSPD_5_EHD_Pos)                           /*!< SCU SFSPD_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_6  ------------------------------------------\r
+#define SCU_SFSPD_6_MODE_Pos                                  0                                                         /*!< SCU SFSPD_6: MODE Position          */\r
+#define SCU_SFSPD_6_MODE_Msk                                  (0x07UL << SCU_SFSPD_6_MODE_Pos)                          /*!< SCU SFSPD_6: MODE Mask              */\r
+#define SCU_SFSPD_6_EPD_Pos                                   3                                                         /*!< SCU SFSPD_6: EPD Position           */\r
+#define SCU_SFSPD_6_EPD_Msk                                   (0x01UL << SCU_SFSPD_6_EPD_Pos)                           /*!< SCU SFSPD_6: EPD Mask               */\r
+#define SCU_SFSPD_6_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_6: EPUN Position          */\r
+#define SCU_SFSPD_6_EPUN_Msk                                  (0x01UL << SCU_SFSPD_6_EPUN_Pos)                          /*!< SCU SFSPD_6: EPUN Mask              */\r
+#define SCU_SFSPD_6_EHS_Pos                                   5                                                         /*!< SCU SFSPD_6: EHS Position           */\r
+#define SCU_SFSPD_6_EHS_Msk                                   (0x01UL << SCU_SFSPD_6_EHS_Pos)                           /*!< SCU SFSPD_6: EHS Mask               */\r
+#define SCU_SFSPD_6_EZI_Pos                                   6                                                         /*!< SCU SFSPD_6: EZI Position           */\r
+#define SCU_SFSPD_6_EZI_Msk                                   (0x01UL << SCU_SFSPD_6_EZI_Pos)                           /*!< SCU SFSPD_6: EZI Mask               */\r
+#define SCU_SFSPD_6_EHD_Pos                                   8                                                         /*!< SCU SFSPD_6: EHD Position           */\r
+#define SCU_SFSPD_6_EHD_Msk                                   (0x03UL << SCU_SFSPD_6_EHD_Pos)                           /*!< SCU SFSPD_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_7  ------------------------------------------\r
+#define SCU_SFSPD_7_MODE_Pos                                  0                                                         /*!< SCU SFSPD_7: MODE Position          */\r
+#define SCU_SFSPD_7_MODE_Msk                                  (0x07UL << SCU_SFSPD_7_MODE_Pos)                          /*!< SCU SFSPD_7: MODE Mask              */\r
+#define SCU_SFSPD_7_EPD_Pos                                   3                                                         /*!< SCU SFSPD_7: EPD Position           */\r
+#define SCU_SFSPD_7_EPD_Msk                                   (0x01UL << SCU_SFSPD_7_EPD_Pos)                           /*!< SCU SFSPD_7: EPD Mask               */\r
+#define SCU_SFSPD_7_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_7: EPUN Position          */\r
+#define SCU_SFSPD_7_EPUN_Msk                                  (0x01UL << SCU_SFSPD_7_EPUN_Pos)                          /*!< SCU SFSPD_7: EPUN Mask              */\r
+#define SCU_SFSPD_7_EHS_Pos                                   5                                                         /*!< SCU SFSPD_7: EHS Position           */\r
+#define SCU_SFSPD_7_EHS_Msk                                   (0x01UL << SCU_SFSPD_7_EHS_Pos)                           /*!< SCU SFSPD_7: EHS Mask               */\r
+#define SCU_SFSPD_7_EZI_Pos                                   6                                                         /*!< SCU SFSPD_7: EZI Position           */\r
+#define SCU_SFSPD_7_EZI_Msk                                   (0x01UL << SCU_SFSPD_7_EZI_Pos)                           /*!< SCU SFSPD_7: EZI Mask               */\r
+#define SCU_SFSPD_7_EHD_Pos                                   8                                                         /*!< SCU SFSPD_7: EHD Position           */\r
+#define SCU_SFSPD_7_EHD_Msk                                   (0x03UL << SCU_SFSPD_7_EHD_Pos)                           /*!< SCU SFSPD_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_8  ------------------------------------------\r
+#define SCU_SFSPD_8_MODE_Pos                                  0                                                         /*!< SCU SFSPD_8: MODE Position          */\r
+#define SCU_SFSPD_8_MODE_Msk                                  (0x07UL << SCU_SFSPD_8_MODE_Pos)                          /*!< SCU SFSPD_8: MODE Mask              */\r
+#define SCU_SFSPD_8_EPD_Pos                                   3                                                         /*!< SCU SFSPD_8: EPD Position           */\r
+#define SCU_SFSPD_8_EPD_Msk                                   (0x01UL << SCU_SFSPD_8_EPD_Pos)                           /*!< SCU SFSPD_8: EPD Mask               */\r
+#define SCU_SFSPD_8_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_8: EPUN Position          */\r
+#define SCU_SFSPD_8_EPUN_Msk                                  (0x01UL << SCU_SFSPD_8_EPUN_Pos)                          /*!< SCU SFSPD_8: EPUN Mask              */\r
+#define SCU_SFSPD_8_EHS_Pos                                   5                                                         /*!< SCU SFSPD_8: EHS Position           */\r
+#define SCU_SFSPD_8_EHS_Msk                                   (0x01UL << SCU_SFSPD_8_EHS_Pos)                           /*!< SCU SFSPD_8: EHS Mask               */\r
+#define SCU_SFSPD_8_EZI_Pos                                   6                                                         /*!< SCU SFSPD_8: EZI Position           */\r
+#define SCU_SFSPD_8_EZI_Msk                                   (0x01UL << SCU_SFSPD_8_EZI_Pos)                           /*!< SCU SFSPD_8: EZI Mask               */\r
+#define SCU_SFSPD_8_EHD_Pos                                   8                                                         /*!< SCU SFSPD_8: EHD Position           */\r
+#define SCU_SFSPD_8_EHD_Msk                                   (0x03UL << SCU_SFSPD_8_EHD_Pos)                           /*!< SCU SFSPD_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPD_9  ------------------------------------------\r
+#define SCU_SFSPD_9_MODE_Pos                                  0                                                         /*!< SCU SFSPD_9: MODE Position          */\r
+#define SCU_SFSPD_9_MODE_Msk                                  (0x07UL << SCU_SFSPD_9_MODE_Pos)                          /*!< SCU SFSPD_9: MODE Mask              */\r
+#define SCU_SFSPD_9_EPD_Pos                                   3                                                         /*!< SCU SFSPD_9: EPD Position           */\r
+#define SCU_SFSPD_9_EPD_Msk                                   (0x01UL << SCU_SFSPD_9_EPD_Pos)                           /*!< SCU SFSPD_9: EPD Mask               */\r
+#define SCU_SFSPD_9_EPUN_Pos                                  4                                                         /*!< SCU SFSPD_9: EPUN Position          */\r
+#define SCU_SFSPD_9_EPUN_Msk                                  (0x01UL << SCU_SFSPD_9_EPUN_Pos)                          /*!< SCU SFSPD_9: EPUN Mask              */\r
+#define SCU_SFSPD_9_EHS_Pos                                   5                                                         /*!< SCU SFSPD_9: EHS Position           */\r
+#define SCU_SFSPD_9_EHS_Msk                                   (0x01UL << SCU_SFSPD_9_EHS_Pos)                           /*!< SCU SFSPD_9: EHS Mask               */\r
+#define SCU_SFSPD_9_EZI_Pos                                   6                                                         /*!< SCU SFSPD_9: EZI Position           */\r
+#define SCU_SFSPD_9_EZI_Msk                                   (0x01UL << SCU_SFSPD_9_EZI_Pos)                           /*!< SCU SFSPD_9: EZI Mask               */\r
+#define SCU_SFSPD_9_EHD_Pos                                   8                                                         /*!< SCU SFSPD_9: EHD Position           */\r
+#define SCU_SFSPD_9_EHD_Msk                                   (0x03UL << SCU_SFSPD_9_EHD_Pos)                           /*!< SCU SFSPD_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSPD_10  ------------------------------------------\r
+#define SCU_SFSPD_10_MODE_Pos                                 0                                                         /*!< SCU SFSPD_10: MODE Position         */\r
+#define SCU_SFSPD_10_MODE_Msk                                 (0x07UL << SCU_SFSPD_10_MODE_Pos)                         /*!< SCU SFSPD_10: MODE Mask             */\r
+#define SCU_SFSPD_10_EPD_Pos                                  3                                                         /*!< SCU SFSPD_10: EPD Position          */\r
+#define SCU_SFSPD_10_EPD_Msk                                  (0x01UL << SCU_SFSPD_10_EPD_Pos)                          /*!< SCU SFSPD_10: EPD Mask              */\r
+#define SCU_SFSPD_10_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_10: EPUN Position         */\r
+#define SCU_SFSPD_10_EPUN_Msk                                 (0x01UL << SCU_SFSPD_10_EPUN_Pos)                         /*!< SCU SFSPD_10: EPUN Mask             */\r
+#define SCU_SFSPD_10_EHS_Pos                                  5                                                         /*!< SCU SFSPD_10: EHS Position          */\r
+#define SCU_SFSPD_10_EHS_Msk                                  (0x01UL << SCU_SFSPD_10_EHS_Pos)                          /*!< SCU SFSPD_10: EHS Mask              */\r
+#define SCU_SFSPD_10_EZI_Pos                                  6                                                         /*!< SCU SFSPD_10: EZI Position          */\r
+#define SCU_SFSPD_10_EZI_Msk                                  (0x01UL << SCU_SFSPD_10_EZI_Pos)                          /*!< SCU SFSPD_10: EZI Mask              */\r
+#define SCU_SFSPD_10_EHD_Pos                                  8                                                         /*!< SCU SFSPD_10: EHD Position          */\r
+#define SCU_SFSPD_10_EHD_Msk                                  (0x03UL << SCU_SFSPD_10_EHD_Pos)                          /*!< SCU SFSPD_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_11  ------------------------------------------\r
+#define SCU_SFSPD_11_MODE_Pos                                 0                                                         /*!< SCU SFSPD_11: MODE Position         */\r
+#define SCU_SFSPD_11_MODE_Msk                                 (0x07UL << SCU_SFSPD_11_MODE_Pos)                         /*!< SCU SFSPD_11: MODE Mask             */\r
+#define SCU_SFSPD_11_EPD_Pos                                  3                                                         /*!< SCU SFSPD_11: EPD Position          */\r
+#define SCU_SFSPD_11_EPD_Msk                                  (0x01UL << SCU_SFSPD_11_EPD_Pos)                          /*!< SCU SFSPD_11: EPD Mask              */\r
+#define SCU_SFSPD_11_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_11: EPUN Position         */\r
+#define SCU_SFSPD_11_EPUN_Msk                                 (0x01UL << SCU_SFSPD_11_EPUN_Pos)                         /*!< SCU SFSPD_11: EPUN Mask             */\r
+#define SCU_SFSPD_11_EHS_Pos                                  5                                                         /*!< SCU SFSPD_11: EHS Position          */\r
+#define SCU_SFSPD_11_EHS_Msk                                  (0x01UL << SCU_SFSPD_11_EHS_Pos)                          /*!< SCU SFSPD_11: EHS Mask              */\r
+#define SCU_SFSPD_11_EZI_Pos                                  6                                                         /*!< SCU SFSPD_11: EZI Position          */\r
+#define SCU_SFSPD_11_EZI_Msk                                  (0x01UL << SCU_SFSPD_11_EZI_Pos)                          /*!< SCU SFSPD_11: EZI Mask              */\r
+#define SCU_SFSPD_11_EHD_Pos                                  8                                                         /*!< SCU SFSPD_11: EHD Position          */\r
+#define SCU_SFSPD_11_EHD_Msk                                  (0x03UL << SCU_SFSPD_11_EHD_Pos)                          /*!< SCU SFSPD_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_12  ------------------------------------------\r
+#define SCU_SFSPD_12_MODE_Pos                                 0                                                         /*!< SCU SFSPD_12: MODE Position         */\r
+#define SCU_SFSPD_12_MODE_Msk                                 (0x07UL << SCU_SFSPD_12_MODE_Pos)                         /*!< SCU SFSPD_12: MODE Mask             */\r
+#define SCU_SFSPD_12_EPD_Pos                                  3                                                         /*!< SCU SFSPD_12: EPD Position          */\r
+#define SCU_SFSPD_12_EPD_Msk                                  (0x01UL << SCU_SFSPD_12_EPD_Pos)                          /*!< SCU SFSPD_12: EPD Mask              */\r
+#define SCU_SFSPD_12_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_12: EPUN Position         */\r
+#define SCU_SFSPD_12_EPUN_Msk                                 (0x01UL << SCU_SFSPD_12_EPUN_Pos)                         /*!< SCU SFSPD_12: EPUN Mask             */\r
+#define SCU_SFSPD_12_EHS_Pos                                  5                                                         /*!< SCU SFSPD_12: EHS Position          */\r
+#define SCU_SFSPD_12_EHS_Msk                                  (0x01UL << SCU_SFSPD_12_EHS_Pos)                          /*!< SCU SFSPD_12: EHS Mask              */\r
+#define SCU_SFSPD_12_EZI_Pos                                  6                                                         /*!< SCU SFSPD_12: EZI Position          */\r
+#define SCU_SFSPD_12_EZI_Msk                                  (0x01UL << SCU_SFSPD_12_EZI_Pos)                          /*!< SCU SFSPD_12: EZI Mask              */\r
+#define SCU_SFSPD_12_EHD_Pos                                  8                                                         /*!< SCU SFSPD_12: EHD Position          */\r
+#define SCU_SFSPD_12_EHD_Msk                                  (0x03UL << SCU_SFSPD_12_EHD_Pos)                          /*!< SCU SFSPD_12: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_13  ------------------------------------------\r
+#define SCU_SFSPD_13_MODE_Pos                                 0                                                         /*!< SCU SFSPD_13: MODE Position         */\r
+#define SCU_SFSPD_13_MODE_Msk                                 (0x07UL << SCU_SFSPD_13_MODE_Pos)                         /*!< SCU SFSPD_13: MODE Mask             */\r
+#define SCU_SFSPD_13_EPD_Pos                                  3                                                         /*!< SCU SFSPD_13: EPD Position          */\r
+#define SCU_SFSPD_13_EPD_Msk                                  (0x01UL << SCU_SFSPD_13_EPD_Pos)                          /*!< SCU SFSPD_13: EPD Mask              */\r
+#define SCU_SFSPD_13_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_13: EPUN Position         */\r
+#define SCU_SFSPD_13_EPUN_Msk                                 (0x01UL << SCU_SFSPD_13_EPUN_Pos)                         /*!< SCU SFSPD_13: EPUN Mask             */\r
+#define SCU_SFSPD_13_EHS_Pos                                  5                                                         /*!< SCU SFSPD_13: EHS Position          */\r
+#define SCU_SFSPD_13_EHS_Msk                                  (0x01UL << SCU_SFSPD_13_EHS_Pos)                          /*!< SCU SFSPD_13: EHS Mask              */\r
+#define SCU_SFSPD_13_EZI_Pos                                  6                                                         /*!< SCU SFSPD_13: EZI Position          */\r
+#define SCU_SFSPD_13_EZI_Msk                                  (0x01UL << SCU_SFSPD_13_EZI_Pos)                          /*!< SCU SFSPD_13: EZI Mask              */\r
+#define SCU_SFSPD_13_EHD_Pos                                  8                                                         /*!< SCU SFSPD_13: EHD Position          */\r
+#define SCU_SFSPD_13_EHD_Msk                                  (0x03UL << SCU_SFSPD_13_EHD_Pos)                          /*!< SCU SFSPD_13: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_14  ------------------------------------------\r
+#define SCU_SFSPD_14_MODE_Pos                                 0                                                         /*!< SCU SFSPD_14: MODE Position         */\r
+#define SCU_SFSPD_14_MODE_Msk                                 (0x07UL << SCU_SFSPD_14_MODE_Pos)                         /*!< SCU SFSPD_14: MODE Mask             */\r
+#define SCU_SFSPD_14_EPD_Pos                                  3                                                         /*!< SCU SFSPD_14: EPD Position          */\r
+#define SCU_SFSPD_14_EPD_Msk                                  (0x01UL << SCU_SFSPD_14_EPD_Pos)                          /*!< SCU SFSPD_14: EPD Mask              */\r
+#define SCU_SFSPD_14_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_14: EPUN Position         */\r
+#define SCU_SFSPD_14_EPUN_Msk                                 (0x01UL << SCU_SFSPD_14_EPUN_Pos)                         /*!< SCU SFSPD_14: EPUN Mask             */\r
+#define SCU_SFSPD_14_EHS_Pos                                  5                                                         /*!< SCU SFSPD_14: EHS Position          */\r
+#define SCU_SFSPD_14_EHS_Msk                                  (0x01UL << SCU_SFSPD_14_EHS_Pos)                          /*!< SCU SFSPD_14: EHS Mask              */\r
+#define SCU_SFSPD_14_EZI_Pos                                  6                                                         /*!< SCU SFSPD_14: EZI Position          */\r
+#define SCU_SFSPD_14_EZI_Msk                                  (0x01UL << SCU_SFSPD_14_EZI_Pos)                          /*!< SCU SFSPD_14: EZI Mask              */\r
+#define SCU_SFSPD_14_EHD_Pos                                  8                                                         /*!< SCU SFSPD_14: EHD Position          */\r
+#define SCU_SFSPD_14_EHD_Msk                                  (0x03UL << SCU_SFSPD_14_EHD_Pos)                          /*!< SCU SFSPD_14: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_15  ------------------------------------------\r
+#define SCU_SFSPD_15_MODE_Pos                                 0                                                         /*!< SCU SFSPD_15: MODE Position         */\r
+#define SCU_SFSPD_15_MODE_Msk                                 (0x07UL << SCU_SFSPD_15_MODE_Pos)                         /*!< SCU SFSPD_15: MODE Mask             */\r
+#define SCU_SFSPD_15_EPD_Pos                                  3                                                         /*!< SCU SFSPD_15: EPD Position          */\r
+#define SCU_SFSPD_15_EPD_Msk                                  (0x01UL << SCU_SFSPD_15_EPD_Pos)                          /*!< SCU SFSPD_15: EPD Mask              */\r
+#define SCU_SFSPD_15_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_15: EPUN Position         */\r
+#define SCU_SFSPD_15_EPUN_Msk                                 (0x01UL << SCU_SFSPD_15_EPUN_Pos)                         /*!< SCU SFSPD_15: EPUN Mask             */\r
+#define SCU_SFSPD_15_EHS_Pos                                  5                                                         /*!< SCU SFSPD_15: EHS Position          */\r
+#define SCU_SFSPD_15_EHS_Msk                                  (0x01UL << SCU_SFSPD_15_EHS_Pos)                          /*!< SCU SFSPD_15: EHS Mask              */\r
+#define SCU_SFSPD_15_EZI_Pos                                  6                                                         /*!< SCU SFSPD_15: EZI Position          */\r
+#define SCU_SFSPD_15_EZI_Msk                                  (0x01UL << SCU_SFSPD_15_EZI_Pos)                          /*!< SCU SFSPD_15: EZI Mask              */\r
+#define SCU_SFSPD_15_EHD_Pos                                  8                                                         /*!< SCU SFSPD_15: EHD Position          */\r
+#define SCU_SFSPD_15_EHD_Msk                                  (0x03UL << SCU_SFSPD_15_EHD_Pos)                          /*!< SCU SFSPD_15: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPD_16  ------------------------------------------\r
+#define SCU_SFSPD_16_MODE_Pos                                 0                                                         /*!< SCU SFSPD_16: MODE Position         */\r
+#define SCU_SFSPD_16_MODE_Msk                                 (0x07UL << SCU_SFSPD_16_MODE_Pos)                         /*!< SCU SFSPD_16: MODE Mask             */\r
+#define SCU_SFSPD_16_EPD_Pos                                  3                                                         /*!< SCU SFSPD_16: EPD Position          */\r
+#define SCU_SFSPD_16_EPD_Msk                                  (0x01UL << SCU_SFSPD_16_EPD_Pos)                          /*!< SCU SFSPD_16: EPD Mask              */\r
+#define SCU_SFSPD_16_EPUN_Pos                                 4                                                         /*!< SCU SFSPD_16: EPUN Position         */\r
+#define SCU_SFSPD_16_EPUN_Msk                                 (0x01UL << SCU_SFSPD_16_EPUN_Pos)                         /*!< SCU SFSPD_16: EPUN Mask             */\r
+#define SCU_SFSPD_16_EHS_Pos                                  5                                                         /*!< SCU SFSPD_16: EHS Position          */\r
+#define SCU_SFSPD_16_EHS_Msk                                  (0x01UL << SCU_SFSPD_16_EHS_Pos)                          /*!< SCU SFSPD_16: EHS Mask              */\r
+#define SCU_SFSPD_16_EZI_Pos                                  6                                                         /*!< SCU SFSPD_16: EZI Position          */\r
+#define SCU_SFSPD_16_EZI_Msk                                  (0x01UL << SCU_SFSPD_16_EZI_Pos)                          /*!< SCU SFSPD_16: EZI Mask              */\r
+#define SCU_SFSPD_16_EHD_Pos                                  8                                                         /*!< SCU SFSPD_16: EHD Position          */\r
+#define SCU_SFSPD_16_EHD_Msk                                  (0x03UL << SCU_SFSPD_16_EHD_Pos)                          /*!< SCU SFSPD_16: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSPE_0  ------------------------------------------\r
+#define SCU_SFSPE_0_MODE_Pos                                  0                                                         /*!< SCU SFSPE_0: MODE Position          */\r
+#define SCU_SFSPE_0_MODE_Msk                                  (0x07UL << SCU_SFSPE_0_MODE_Pos)                          /*!< SCU SFSPE_0: MODE Mask              */\r
+#define SCU_SFSPE_0_EPD_Pos                                   3                                                         /*!< SCU SFSPE_0: EPD Position           */\r
+#define SCU_SFSPE_0_EPD_Msk                                   (0x01UL << SCU_SFSPE_0_EPD_Pos)                           /*!< SCU SFSPE_0: EPD Mask               */\r
+#define SCU_SFSPE_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_0: EPUN Position          */\r
+#define SCU_SFSPE_0_EPUN_Msk                                  (0x01UL << SCU_SFSPE_0_EPUN_Pos)                          /*!< SCU SFSPE_0: EPUN Mask              */\r
+#define SCU_SFSPE_0_EHS_Pos                                   5                                                         /*!< SCU SFSPE_0: EHS Position           */\r
+#define SCU_SFSPE_0_EHS_Msk                                   (0x01UL << SCU_SFSPE_0_EHS_Pos)                           /*!< SCU SFSPE_0: EHS Mask               */\r
+#define SCU_SFSPE_0_EZI_Pos                                   6                                                         /*!< SCU SFSPE_0: EZI Position           */\r
+#define SCU_SFSPE_0_EZI_Msk                                   (0x01UL << SCU_SFSPE_0_EZI_Pos)                           /*!< SCU SFSPE_0: EZI Mask               */\r
+#define SCU_SFSPE_0_EHD_Pos                                   8                                                         /*!< SCU SFSPE_0: EHD Position           */\r
+#define SCU_SFSPE_0_EHD_Msk                                   (0x03UL << SCU_SFSPE_0_EHD_Pos)                           /*!< SCU SFSPE_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_1  ------------------------------------------\r
+#define SCU_SFSPE_1_MODE_Pos                                  0                                                         /*!< SCU SFSPE_1: MODE Position          */\r
+#define SCU_SFSPE_1_MODE_Msk                                  (0x07UL << SCU_SFSPE_1_MODE_Pos)                          /*!< SCU SFSPE_1: MODE Mask              */\r
+#define SCU_SFSPE_1_EPD_Pos                                   3                                                         /*!< SCU SFSPE_1: EPD Position           */\r
+#define SCU_SFSPE_1_EPD_Msk                                   (0x01UL << SCU_SFSPE_1_EPD_Pos)                           /*!< SCU SFSPE_1: EPD Mask               */\r
+#define SCU_SFSPE_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_1: EPUN Position          */\r
+#define SCU_SFSPE_1_EPUN_Msk                                  (0x01UL << SCU_SFSPE_1_EPUN_Pos)                          /*!< SCU SFSPE_1: EPUN Mask              */\r
+#define SCU_SFSPE_1_EHS_Pos                                   5                                                         /*!< SCU SFSPE_1: EHS Position           */\r
+#define SCU_SFSPE_1_EHS_Msk                                   (0x01UL << SCU_SFSPE_1_EHS_Pos)                           /*!< SCU SFSPE_1: EHS Mask               */\r
+#define SCU_SFSPE_1_EZI_Pos                                   6                                                         /*!< SCU SFSPE_1: EZI Position           */\r
+#define SCU_SFSPE_1_EZI_Msk                                   (0x01UL << SCU_SFSPE_1_EZI_Pos)                           /*!< SCU SFSPE_1: EZI Mask               */\r
+#define SCU_SFSPE_1_EHD_Pos                                   8                                                         /*!< SCU SFSPE_1: EHD Position           */\r
+#define SCU_SFSPE_1_EHD_Msk                                   (0x03UL << SCU_SFSPE_1_EHD_Pos)                           /*!< SCU SFSPE_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_2  ------------------------------------------\r
+#define SCU_SFSPE_2_MODE_Pos                                  0                                                         /*!< SCU SFSPE_2: MODE Position          */\r
+#define SCU_SFSPE_2_MODE_Msk                                  (0x07UL << SCU_SFSPE_2_MODE_Pos)                          /*!< SCU SFSPE_2: MODE Mask              */\r
+#define SCU_SFSPE_2_EPD_Pos                                   3                                                         /*!< SCU SFSPE_2: EPD Position           */\r
+#define SCU_SFSPE_2_EPD_Msk                                   (0x01UL << SCU_SFSPE_2_EPD_Pos)                           /*!< SCU SFSPE_2: EPD Mask               */\r
+#define SCU_SFSPE_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_2: EPUN Position          */\r
+#define SCU_SFSPE_2_EPUN_Msk                                  (0x01UL << SCU_SFSPE_2_EPUN_Pos)                          /*!< SCU SFSPE_2: EPUN Mask              */\r
+#define SCU_SFSPE_2_EHS_Pos                                   5                                                         /*!< SCU SFSPE_2: EHS Position           */\r
+#define SCU_SFSPE_2_EHS_Msk                                   (0x01UL << SCU_SFSPE_2_EHS_Pos)                           /*!< SCU SFSPE_2: EHS Mask               */\r
+#define SCU_SFSPE_2_EZI_Pos                                   6                                                         /*!< SCU SFSPE_2: EZI Position           */\r
+#define SCU_SFSPE_2_EZI_Msk                                   (0x01UL << SCU_SFSPE_2_EZI_Pos)                           /*!< SCU SFSPE_2: EZI Mask               */\r
+#define SCU_SFSPE_2_EHD_Pos                                   8                                                         /*!< SCU SFSPE_2: EHD Position           */\r
+#define SCU_SFSPE_2_EHD_Msk                                   (0x03UL << SCU_SFSPE_2_EHD_Pos)                           /*!< SCU SFSPE_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_3  ------------------------------------------\r
+#define SCU_SFSPE_3_MODE_Pos                                  0                                                         /*!< SCU SFSPE_3: MODE Position          */\r
+#define SCU_SFSPE_3_MODE_Msk                                  (0x07UL << SCU_SFSPE_3_MODE_Pos)                          /*!< SCU SFSPE_3: MODE Mask              */\r
+#define SCU_SFSPE_3_EPD_Pos                                   3                                                         /*!< SCU SFSPE_3: EPD Position           */\r
+#define SCU_SFSPE_3_EPD_Msk                                   (0x01UL << SCU_SFSPE_3_EPD_Pos)                           /*!< SCU SFSPE_3: EPD Mask               */\r
+#define SCU_SFSPE_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_3: EPUN Position          */\r
+#define SCU_SFSPE_3_EPUN_Msk                                  (0x01UL << SCU_SFSPE_3_EPUN_Pos)                          /*!< SCU SFSPE_3: EPUN Mask              */\r
+#define SCU_SFSPE_3_EHS_Pos                                   5                                                         /*!< SCU SFSPE_3: EHS Position           */\r
+#define SCU_SFSPE_3_EHS_Msk                                   (0x01UL << SCU_SFSPE_3_EHS_Pos)                           /*!< SCU SFSPE_3: EHS Mask               */\r
+#define SCU_SFSPE_3_EZI_Pos                                   6                                                         /*!< SCU SFSPE_3: EZI Position           */\r
+#define SCU_SFSPE_3_EZI_Msk                                   (0x01UL << SCU_SFSPE_3_EZI_Pos)                           /*!< SCU SFSPE_3: EZI Mask               */\r
+#define SCU_SFSPE_3_EHD_Pos                                   8                                                         /*!< SCU SFSPE_3: EHD Position           */\r
+#define SCU_SFSPE_3_EHD_Msk                                   (0x03UL << SCU_SFSPE_3_EHD_Pos)                           /*!< SCU SFSPE_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_4  ------------------------------------------\r
+#define SCU_SFSPE_4_MODE_Pos                                  0                                                         /*!< SCU SFSPE_4: MODE Position          */\r
+#define SCU_SFSPE_4_MODE_Msk                                  (0x07UL << SCU_SFSPE_4_MODE_Pos)                          /*!< SCU SFSPE_4: MODE Mask              */\r
+#define SCU_SFSPE_4_EPD_Pos                                   3                                                         /*!< SCU SFSPE_4: EPD Position           */\r
+#define SCU_SFSPE_4_EPD_Msk                                   (0x01UL << SCU_SFSPE_4_EPD_Pos)                           /*!< SCU SFSPE_4: EPD Mask               */\r
+#define SCU_SFSPE_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_4: EPUN Position          */\r
+#define SCU_SFSPE_4_EPUN_Msk                                  (0x01UL << SCU_SFSPE_4_EPUN_Pos)                          /*!< SCU SFSPE_4: EPUN Mask              */\r
+#define SCU_SFSPE_4_EHS_Pos                                   5                                                         /*!< SCU SFSPE_4: EHS Position           */\r
+#define SCU_SFSPE_4_EHS_Msk                                   (0x01UL << SCU_SFSPE_4_EHS_Pos)                           /*!< SCU SFSPE_4: EHS Mask               */\r
+#define SCU_SFSPE_4_EZI_Pos                                   6                                                         /*!< SCU SFSPE_4: EZI Position           */\r
+#define SCU_SFSPE_4_EZI_Msk                                   (0x01UL << SCU_SFSPE_4_EZI_Pos)                           /*!< SCU SFSPE_4: EZI Mask               */\r
+#define SCU_SFSPE_4_EHD_Pos                                   8                                                         /*!< SCU SFSPE_4: EHD Position           */\r
+#define SCU_SFSPE_4_EHD_Msk                                   (0x03UL << SCU_SFSPE_4_EHD_Pos)                           /*!< SCU SFSPE_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_5  ------------------------------------------\r
+#define SCU_SFSPE_5_MODE_Pos                                  0                                                         /*!< SCU SFSPE_5: MODE Position          */\r
+#define SCU_SFSPE_5_MODE_Msk                                  (0x07UL << SCU_SFSPE_5_MODE_Pos)                          /*!< SCU SFSPE_5: MODE Mask              */\r
+#define SCU_SFSPE_5_EPD_Pos                                   3                                                         /*!< SCU SFSPE_5: EPD Position           */\r
+#define SCU_SFSPE_5_EPD_Msk                                   (0x01UL << SCU_SFSPE_5_EPD_Pos)                           /*!< SCU SFSPE_5: EPD Mask               */\r
+#define SCU_SFSPE_5_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_5: EPUN Position          */\r
+#define SCU_SFSPE_5_EPUN_Msk                                  (0x01UL << SCU_SFSPE_5_EPUN_Pos)                          /*!< SCU SFSPE_5: EPUN Mask              */\r
+#define SCU_SFSPE_5_EHS_Pos                                   5                                                         /*!< SCU SFSPE_5: EHS Position           */\r
+#define SCU_SFSPE_5_EHS_Msk                                   (0x01UL << SCU_SFSPE_5_EHS_Pos)                           /*!< SCU SFSPE_5: EHS Mask               */\r
+#define SCU_SFSPE_5_EZI_Pos                                   6                                                         /*!< SCU SFSPE_5: EZI Position           */\r
+#define SCU_SFSPE_5_EZI_Msk                                   (0x01UL << SCU_SFSPE_5_EZI_Pos)                           /*!< SCU SFSPE_5: EZI Mask               */\r
+#define SCU_SFSPE_5_EHD_Pos                                   8                                                         /*!< SCU SFSPE_5: EHD Position           */\r
+#define SCU_SFSPE_5_EHD_Msk                                   (0x03UL << SCU_SFSPE_5_EHD_Pos)                           /*!< SCU SFSPE_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_6  ------------------------------------------\r
+#define SCU_SFSPE_6_MODE_Pos                                  0                                                         /*!< SCU SFSPE_6: MODE Position          */\r
+#define SCU_SFSPE_6_MODE_Msk                                  (0x07UL << SCU_SFSPE_6_MODE_Pos)                          /*!< SCU SFSPE_6: MODE Mask              */\r
+#define SCU_SFSPE_6_EPD_Pos                                   3                                                         /*!< SCU SFSPE_6: EPD Position           */\r
+#define SCU_SFSPE_6_EPD_Msk                                   (0x01UL << SCU_SFSPE_6_EPD_Pos)                           /*!< SCU SFSPE_6: EPD Mask               */\r
+#define SCU_SFSPE_6_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_6: EPUN Position          */\r
+#define SCU_SFSPE_6_EPUN_Msk                                  (0x01UL << SCU_SFSPE_6_EPUN_Pos)                          /*!< SCU SFSPE_6: EPUN Mask              */\r
+#define SCU_SFSPE_6_EHS_Pos                                   5                                                         /*!< SCU SFSPE_6: EHS Position           */\r
+#define SCU_SFSPE_6_EHS_Msk                                   (0x01UL << SCU_SFSPE_6_EHS_Pos)                           /*!< SCU SFSPE_6: EHS Mask               */\r
+#define SCU_SFSPE_6_EZI_Pos                                   6                                                         /*!< SCU SFSPE_6: EZI Position           */\r
+#define SCU_SFSPE_6_EZI_Msk                                   (0x01UL << SCU_SFSPE_6_EZI_Pos)                           /*!< SCU SFSPE_6: EZI Mask               */\r
+#define SCU_SFSPE_6_EHD_Pos                                   8                                                         /*!< SCU SFSPE_6: EHD Position           */\r
+#define SCU_SFSPE_6_EHD_Msk                                   (0x03UL << SCU_SFSPE_6_EHD_Pos)                           /*!< SCU SFSPE_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_7  ------------------------------------------\r
+#define SCU_SFSPE_7_MODE_Pos                                  0                                                         /*!< SCU SFSPE_7: MODE Position          */\r
+#define SCU_SFSPE_7_MODE_Msk                                  (0x07UL << SCU_SFSPE_7_MODE_Pos)                          /*!< SCU SFSPE_7: MODE Mask              */\r
+#define SCU_SFSPE_7_EPD_Pos                                   3                                                         /*!< SCU SFSPE_7: EPD Position           */\r
+#define SCU_SFSPE_7_EPD_Msk                                   (0x01UL << SCU_SFSPE_7_EPD_Pos)                           /*!< SCU SFSPE_7: EPD Mask               */\r
+#define SCU_SFSPE_7_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_7: EPUN Position          */\r
+#define SCU_SFSPE_7_EPUN_Msk                                  (0x01UL << SCU_SFSPE_7_EPUN_Pos)                          /*!< SCU SFSPE_7: EPUN Mask              */\r
+#define SCU_SFSPE_7_EHS_Pos                                   5                                                         /*!< SCU SFSPE_7: EHS Position           */\r
+#define SCU_SFSPE_7_EHS_Msk                                   (0x01UL << SCU_SFSPE_7_EHS_Pos)                           /*!< SCU SFSPE_7: EHS Mask               */\r
+#define SCU_SFSPE_7_EZI_Pos                                   6                                                         /*!< SCU SFSPE_7: EZI Position           */\r
+#define SCU_SFSPE_7_EZI_Msk                                   (0x01UL << SCU_SFSPE_7_EZI_Pos)                           /*!< SCU SFSPE_7: EZI Mask               */\r
+#define SCU_SFSPE_7_EHD_Pos                                   8                                                         /*!< SCU SFSPE_7: EHD Position           */\r
+#define SCU_SFSPE_7_EHD_Msk                                   (0x03UL << SCU_SFSPE_7_EHD_Pos)                           /*!< SCU SFSPE_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_8  ------------------------------------------\r
+#define SCU_SFSPE_8_MODE_Pos                                  0                                                         /*!< SCU SFSPE_8: MODE Position          */\r
+#define SCU_SFSPE_8_MODE_Msk                                  (0x07UL << SCU_SFSPE_8_MODE_Pos)                          /*!< SCU SFSPE_8: MODE Mask              */\r
+#define SCU_SFSPE_8_EPD_Pos                                   3                                                         /*!< SCU SFSPE_8: EPD Position           */\r
+#define SCU_SFSPE_8_EPD_Msk                                   (0x01UL << SCU_SFSPE_8_EPD_Pos)                           /*!< SCU SFSPE_8: EPD Mask               */\r
+#define SCU_SFSPE_8_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_8: EPUN Position          */\r
+#define SCU_SFSPE_8_EPUN_Msk                                  (0x01UL << SCU_SFSPE_8_EPUN_Pos)                          /*!< SCU SFSPE_8: EPUN Mask              */\r
+#define SCU_SFSPE_8_EHS_Pos                                   5                                                         /*!< SCU SFSPE_8: EHS Position           */\r
+#define SCU_SFSPE_8_EHS_Msk                                   (0x01UL << SCU_SFSPE_8_EHS_Pos)                           /*!< SCU SFSPE_8: EHS Mask               */\r
+#define SCU_SFSPE_8_EZI_Pos                                   6                                                         /*!< SCU SFSPE_8: EZI Position           */\r
+#define SCU_SFSPE_8_EZI_Msk                                   (0x01UL << SCU_SFSPE_8_EZI_Pos)                           /*!< SCU SFSPE_8: EZI Mask               */\r
+#define SCU_SFSPE_8_EHD_Pos                                   8                                                         /*!< SCU SFSPE_8: EHD Position           */\r
+#define SCU_SFSPE_8_EHD_Msk                                   (0x03UL << SCU_SFSPE_8_EHD_Pos)                           /*!< SCU SFSPE_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPE_9  ------------------------------------------\r
+#define SCU_SFSPE_9_MODE_Pos                                  0                                                         /*!< SCU SFSPE_9: MODE Position          */\r
+#define SCU_SFSPE_9_MODE_Msk                                  (0x07UL << SCU_SFSPE_9_MODE_Pos)                          /*!< SCU SFSPE_9: MODE Mask              */\r
+#define SCU_SFSPE_9_EPD_Pos                                   3                                                         /*!< SCU SFSPE_9: EPD Position           */\r
+#define SCU_SFSPE_9_EPD_Msk                                   (0x01UL << SCU_SFSPE_9_EPD_Pos)                           /*!< SCU SFSPE_9: EPD Mask               */\r
+#define SCU_SFSPE_9_EPUN_Pos                                  4                                                         /*!< SCU SFSPE_9: EPUN Position          */\r
+#define SCU_SFSPE_9_EPUN_Msk                                  (0x01UL << SCU_SFSPE_9_EPUN_Pos)                          /*!< SCU SFSPE_9: EPUN Mask              */\r
+#define SCU_SFSPE_9_EHS_Pos                                   5                                                         /*!< SCU SFSPE_9: EHS Position           */\r
+#define SCU_SFSPE_9_EHS_Msk                                   (0x01UL << SCU_SFSPE_9_EHS_Pos)                           /*!< SCU SFSPE_9: EHS Mask               */\r
+#define SCU_SFSPE_9_EZI_Pos                                   6                                                         /*!< SCU SFSPE_9: EZI Position           */\r
+#define SCU_SFSPE_9_EZI_Msk                                   (0x01UL << SCU_SFSPE_9_EZI_Pos)                           /*!< SCU SFSPE_9: EZI Mask               */\r
+#define SCU_SFSPE_9_EHD_Pos                                   8                                                         /*!< SCU SFSPE_9: EHD Position           */\r
+#define SCU_SFSPE_9_EHD_Msk                                   (0x03UL << SCU_SFSPE_9_EHD_Pos)                           /*!< SCU SFSPE_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSPE_10  ------------------------------------------\r
+#define SCU_SFSPE_10_MODE_Pos                                 0                                                         /*!< SCU SFSPE_10: MODE Position         */\r
+#define SCU_SFSPE_10_MODE_Msk                                 (0x07UL << SCU_SFSPE_10_MODE_Pos)                         /*!< SCU SFSPE_10: MODE Mask             */\r
+#define SCU_SFSPE_10_EPD_Pos                                  3                                                         /*!< SCU SFSPE_10: EPD Position          */\r
+#define SCU_SFSPE_10_EPD_Msk                                  (0x01UL << SCU_SFSPE_10_EPD_Pos)                          /*!< SCU SFSPE_10: EPD Mask              */\r
+#define SCU_SFSPE_10_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_10: EPUN Position         */\r
+#define SCU_SFSPE_10_EPUN_Msk                                 (0x01UL << SCU_SFSPE_10_EPUN_Pos)                         /*!< SCU SFSPE_10: EPUN Mask             */\r
+#define SCU_SFSPE_10_EHS_Pos                                  5                                                         /*!< SCU SFSPE_10: EHS Position          */\r
+#define SCU_SFSPE_10_EHS_Msk                                  (0x01UL << SCU_SFSPE_10_EHS_Pos)                          /*!< SCU SFSPE_10: EHS Mask              */\r
+#define SCU_SFSPE_10_EZI_Pos                                  6                                                         /*!< SCU SFSPE_10: EZI Position          */\r
+#define SCU_SFSPE_10_EZI_Msk                                  (0x01UL << SCU_SFSPE_10_EZI_Pos)                          /*!< SCU SFSPE_10: EZI Mask              */\r
+#define SCU_SFSPE_10_EHD_Pos                                  8                                                         /*!< SCU SFSPE_10: EHD Position          */\r
+#define SCU_SFSPE_10_EHD_Msk                                  (0x03UL << SCU_SFSPE_10_EHD_Pos)                          /*!< SCU SFSPE_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPE_11  ------------------------------------------\r
+#define SCU_SFSPE_11_MODE_Pos                                 0                                                         /*!< SCU SFSPE_11: MODE Position         */\r
+#define SCU_SFSPE_11_MODE_Msk                                 (0x07UL << SCU_SFSPE_11_MODE_Pos)                         /*!< SCU SFSPE_11: MODE Mask             */\r
+#define SCU_SFSPE_11_EPD_Pos                                  3                                                         /*!< SCU SFSPE_11: EPD Position          */\r
+#define SCU_SFSPE_11_EPD_Msk                                  (0x01UL << SCU_SFSPE_11_EPD_Pos)                          /*!< SCU SFSPE_11: EPD Mask              */\r
+#define SCU_SFSPE_11_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_11: EPUN Position         */\r
+#define SCU_SFSPE_11_EPUN_Msk                                 (0x01UL << SCU_SFSPE_11_EPUN_Pos)                         /*!< SCU SFSPE_11: EPUN Mask             */\r
+#define SCU_SFSPE_11_EHS_Pos                                  5                                                         /*!< SCU SFSPE_11: EHS Position          */\r
+#define SCU_SFSPE_11_EHS_Msk                                  (0x01UL << SCU_SFSPE_11_EHS_Pos)                          /*!< SCU SFSPE_11: EHS Mask              */\r
+#define SCU_SFSPE_11_EZI_Pos                                  6                                                         /*!< SCU SFSPE_11: EZI Position          */\r
+#define SCU_SFSPE_11_EZI_Msk                                  (0x01UL << SCU_SFSPE_11_EZI_Pos)                          /*!< SCU SFSPE_11: EZI Mask              */\r
+#define SCU_SFSPE_11_EHD_Pos                                  8                                                         /*!< SCU SFSPE_11: EHD Position          */\r
+#define SCU_SFSPE_11_EHD_Msk                                  (0x03UL << SCU_SFSPE_11_EHD_Pos)                          /*!< SCU SFSPE_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPE_12  ------------------------------------------\r
+#define SCU_SFSPE_12_MODE_Pos                                 0                                                         /*!< SCU SFSPE_12: MODE Position         */\r
+#define SCU_SFSPE_12_MODE_Msk                                 (0x07UL << SCU_SFSPE_12_MODE_Pos)                         /*!< SCU SFSPE_12: MODE Mask             */\r
+#define SCU_SFSPE_12_EPD_Pos                                  3                                                         /*!< SCU SFSPE_12: EPD Position          */\r
+#define SCU_SFSPE_12_EPD_Msk                                  (0x01UL << SCU_SFSPE_12_EPD_Pos)                          /*!< SCU SFSPE_12: EPD Mask              */\r
+#define SCU_SFSPE_12_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_12: EPUN Position         */\r
+#define SCU_SFSPE_12_EPUN_Msk                                 (0x01UL << SCU_SFSPE_12_EPUN_Pos)                         /*!< SCU SFSPE_12: EPUN Mask             */\r
+#define SCU_SFSPE_12_EHS_Pos                                  5                                                         /*!< SCU SFSPE_12: EHS Position          */\r
+#define SCU_SFSPE_12_EHS_Msk                                  (0x01UL << SCU_SFSPE_12_EHS_Pos)                          /*!< SCU SFSPE_12: EHS Mask              */\r
+#define SCU_SFSPE_12_EZI_Pos                                  6                                                         /*!< SCU SFSPE_12: EZI Position          */\r
+#define SCU_SFSPE_12_EZI_Msk                                  (0x01UL << SCU_SFSPE_12_EZI_Pos)                          /*!< SCU SFSPE_12: EZI Mask              */\r
+#define SCU_SFSPE_12_EHD_Pos                                  8                                                         /*!< SCU SFSPE_12: EHD Position          */\r
+#define SCU_SFSPE_12_EHD_Msk                                  (0x03UL << SCU_SFSPE_12_EHD_Pos)                          /*!< SCU SFSPE_12: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPE_13  ------------------------------------------\r
+#define SCU_SFSPE_13_MODE_Pos                                 0                                                         /*!< SCU SFSPE_13: MODE Position         */\r
+#define SCU_SFSPE_13_MODE_Msk                                 (0x07UL << SCU_SFSPE_13_MODE_Pos)                         /*!< SCU SFSPE_13: MODE Mask             */\r
+#define SCU_SFSPE_13_EPD_Pos                                  3                                                         /*!< SCU SFSPE_13: EPD Position          */\r
+#define SCU_SFSPE_13_EPD_Msk                                  (0x01UL << SCU_SFSPE_13_EPD_Pos)                          /*!< SCU SFSPE_13: EPD Mask              */\r
+#define SCU_SFSPE_13_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_13: EPUN Position         */\r
+#define SCU_SFSPE_13_EPUN_Msk                                 (0x01UL << SCU_SFSPE_13_EPUN_Pos)                         /*!< SCU SFSPE_13: EPUN Mask             */\r
+#define SCU_SFSPE_13_EHS_Pos                                  5                                                         /*!< SCU SFSPE_13: EHS Position          */\r
+#define SCU_SFSPE_13_EHS_Msk                                  (0x01UL << SCU_SFSPE_13_EHS_Pos)                          /*!< SCU SFSPE_13: EHS Mask              */\r
+#define SCU_SFSPE_13_EZI_Pos                                  6                                                         /*!< SCU SFSPE_13: EZI Position          */\r
+#define SCU_SFSPE_13_EZI_Msk                                  (0x01UL << SCU_SFSPE_13_EZI_Pos)                          /*!< SCU SFSPE_13: EZI Mask              */\r
+#define SCU_SFSPE_13_EHD_Pos                                  8                                                         /*!< SCU SFSPE_13: EHD Position          */\r
+#define SCU_SFSPE_13_EHD_Msk                                  (0x03UL << SCU_SFSPE_13_EHD_Pos)                          /*!< SCU SFSPE_13: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPE_14  ------------------------------------------\r
+#define SCU_SFSPE_14_MODE_Pos                                 0                                                         /*!< SCU SFSPE_14: MODE Position         */\r
+#define SCU_SFSPE_14_MODE_Msk                                 (0x07UL << SCU_SFSPE_14_MODE_Pos)                         /*!< SCU SFSPE_14: MODE Mask             */\r
+#define SCU_SFSPE_14_EPD_Pos                                  3                                                         /*!< SCU SFSPE_14: EPD Position          */\r
+#define SCU_SFSPE_14_EPD_Msk                                  (0x01UL << SCU_SFSPE_14_EPD_Pos)                          /*!< SCU SFSPE_14: EPD Mask              */\r
+#define SCU_SFSPE_14_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_14: EPUN Position         */\r
+#define SCU_SFSPE_14_EPUN_Msk                                 (0x01UL << SCU_SFSPE_14_EPUN_Pos)                         /*!< SCU SFSPE_14: EPUN Mask             */\r
+#define SCU_SFSPE_14_EHS_Pos                                  5                                                         /*!< SCU SFSPE_14: EHS Position          */\r
+#define SCU_SFSPE_14_EHS_Msk                                  (0x01UL << SCU_SFSPE_14_EHS_Pos)                          /*!< SCU SFSPE_14: EHS Mask              */\r
+#define SCU_SFSPE_14_EZI_Pos                                  6                                                         /*!< SCU SFSPE_14: EZI Position          */\r
+#define SCU_SFSPE_14_EZI_Msk                                  (0x01UL << SCU_SFSPE_14_EZI_Pos)                          /*!< SCU SFSPE_14: EZI Mask              */\r
+#define SCU_SFSPE_14_EHD_Pos                                  8                                                         /*!< SCU SFSPE_14: EHD Position          */\r
+#define SCU_SFSPE_14_EHD_Msk                                  (0x03UL << SCU_SFSPE_14_EHD_Pos)                          /*!< SCU SFSPE_14: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPE_15  ------------------------------------------\r
+#define SCU_SFSPE_15_MODE_Pos                                 0                                                         /*!< SCU SFSPE_15: MODE Position         */\r
+#define SCU_SFSPE_15_MODE_Msk                                 (0x07UL << SCU_SFSPE_15_MODE_Pos)                         /*!< SCU SFSPE_15: MODE Mask             */\r
+#define SCU_SFSPE_15_EPD_Pos                                  3                                                         /*!< SCU SFSPE_15: EPD Position          */\r
+#define SCU_SFSPE_15_EPD_Msk                                  (0x01UL << SCU_SFSPE_15_EPD_Pos)                          /*!< SCU SFSPE_15: EPD Mask              */\r
+#define SCU_SFSPE_15_EPUN_Pos                                 4                                                         /*!< SCU SFSPE_15: EPUN Position         */\r
+#define SCU_SFSPE_15_EPUN_Msk                                 (0x01UL << SCU_SFSPE_15_EPUN_Pos)                         /*!< SCU SFSPE_15: EPUN Mask             */\r
+#define SCU_SFSPE_15_EHS_Pos                                  5                                                         /*!< SCU SFSPE_15: EHS Position          */\r
+#define SCU_SFSPE_15_EHS_Msk                                  (0x01UL << SCU_SFSPE_15_EHS_Pos)                          /*!< SCU SFSPE_15: EHS Mask              */\r
+#define SCU_SFSPE_15_EZI_Pos                                  6                                                         /*!< SCU SFSPE_15: EZI Position          */\r
+#define SCU_SFSPE_15_EZI_Msk                                  (0x01UL << SCU_SFSPE_15_EZI_Pos)                          /*!< SCU SFSPE_15: EZI Mask              */\r
+#define SCU_SFSPE_15_EHD_Pos                                  8                                                         /*!< SCU SFSPE_15: EHD Position          */\r
+#define SCU_SFSPE_15_EHD_Msk                                  (0x03UL << SCU_SFSPE_15_EHD_Pos)                          /*!< SCU SFSPE_15: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSPF_0  ------------------------------------------\r
+#define SCU_SFSPF_0_MODE_Pos                                  0                                                         /*!< SCU SFSPF_0: MODE Position          */\r
+#define SCU_SFSPF_0_MODE_Msk                                  (0x07UL << SCU_SFSPF_0_MODE_Pos)                          /*!< SCU SFSPF_0: MODE Mask              */\r
+#define SCU_SFSPF_0_EPD_Pos                                   3                                                         /*!< SCU SFSPF_0: EPD Position           */\r
+#define SCU_SFSPF_0_EPD_Msk                                   (0x01UL << SCU_SFSPF_0_EPD_Pos)                           /*!< SCU SFSPF_0: EPD Mask               */\r
+#define SCU_SFSPF_0_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_0: EPUN Position          */\r
+#define SCU_SFSPF_0_EPUN_Msk                                  (0x01UL << SCU_SFSPF_0_EPUN_Pos)                          /*!< SCU SFSPF_0: EPUN Mask              */\r
+#define SCU_SFSPF_0_EHS_Pos                                   5                                                         /*!< SCU SFSPF_0: EHS Position           */\r
+#define SCU_SFSPF_0_EHS_Msk                                   (0x01UL << SCU_SFSPF_0_EHS_Pos)                           /*!< SCU SFSPF_0: EHS Mask               */\r
+#define SCU_SFSPF_0_EZI_Pos                                   6                                                         /*!< SCU SFSPF_0: EZI Position           */\r
+#define SCU_SFSPF_0_EZI_Msk                                   (0x01UL << SCU_SFSPF_0_EZI_Pos)                           /*!< SCU SFSPF_0: EZI Mask               */\r
+#define SCU_SFSPF_0_EHD_Pos                                   8                                                         /*!< SCU SFSPF_0: EHD Position           */\r
+#define SCU_SFSPF_0_EHD_Msk                                   (0x03UL << SCU_SFSPF_0_EHD_Pos)                           /*!< SCU SFSPF_0: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_1  ------------------------------------------\r
+#define SCU_SFSPF_1_MODE_Pos                                  0                                                         /*!< SCU SFSPF_1: MODE Position          */\r
+#define SCU_SFSPF_1_MODE_Msk                                  (0x07UL << SCU_SFSPF_1_MODE_Pos)                          /*!< SCU SFSPF_1: MODE Mask              */\r
+#define SCU_SFSPF_1_EPD_Pos                                   3                                                         /*!< SCU SFSPF_1: EPD Position           */\r
+#define SCU_SFSPF_1_EPD_Msk                                   (0x01UL << SCU_SFSPF_1_EPD_Pos)                           /*!< SCU SFSPF_1: EPD Mask               */\r
+#define SCU_SFSPF_1_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_1: EPUN Position          */\r
+#define SCU_SFSPF_1_EPUN_Msk                                  (0x01UL << SCU_SFSPF_1_EPUN_Pos)                          /*!< SCU SFSPF_1: EPUN Mask              */\r
+#define SCU_SFSPF_1_EHS_Pos                                   5                                                         /*!< SCU SFSPF_1: EHS Position           */\r
+#define SCU_SFSPF_1_EHS_Msk                                   (0x01UL << SCU_SFSPF_1_EHS_Pos)                           /*!< SCU SFSPF_1: EHS Mask               */\r
+#define SCU_SFSPF_1_EZI_Pos                                   6                                                         /*!< SCU SFSPF_1: EZI Position           */\r
+#define SCU_SFSPF_1_EZI_Msk                                   (0x01UL << SCU_SFSPF_1_EZI_Pos)                           /*!< SCU SFSPF_1: EZI Mask               */\r
+#define SCU_SFSPF_1_EHD_Pos                                   8                                                         /*!< SCU SFSPF_1: EHD Position           */\r
+#define SCU_SFSPF_1_EHD_Msk                                   (0x03UL << SCU_SFSPF_1_EHD_Pos)                           /*!< SCU SFSPF_1: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_2  ------------------------------------------\r
+#define SCU_SFSPF_2_MODE_Pos                                  0                                                         /*!< SCU SFSPF_2: MODE Position          */\r
+#define SCU_SFSPF_2_MODE_Msk                                  (0x07UL << SCU_SFSPF_2_MODE_Pos)                          /*!< SCU SFSPF_2: MODE Mask              */\r
+#define SCU_SFSPF_2_EPD_Pos                                   3                                                         /*!< SCU SFSPF_2: EPD Position           */\r
+#define SCU_SFSPF_2_EPD_Msk                                   (0x01UL << SCU_SFSPF_2_EPD_Pos)                           /*!< SCU SFSPF_2: EPD Mask               */\r
+#define SCU_SFSPF_2_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_2: EPUN Position          */\r
+#define SCU_SFSPF_2_EPUN_Msk                                  (0x01UL << SCU_SFSPF_2_EPUN_Pos)                          /*!< SCU SFSPF_2: EPUN Mask              */\r
+#define SCU_SFSPF_2_EHS_Pos                                   5                                                         /*!< SCU SFSPF_2: EHS Position           */\r
+#define SCU_SFSPF_2_EHS_Msk                                   (0x01UL << SCU_SFSPF_2_EHS_Pos)                           /*!< SCU SFSPF_2: EHS Mask               */\r
+#define SCU_SFSPF_2_EZI_Pos                                   6                                                         /*!< SCU SFSPF_2: EZI Position           */\r
+#define SCU_SFSPF_2_EZI_Msk                                   (0x01UL << SCU_SFSPF_2_EZI_Pos)                           /*!< SCU SFSPF_2: EZI Mask               */\r
+#define SCU_SFSPF_2_EHD_Pos                                   8                                                         /*!< SCU SFSPF_2: EHD Position           */\r
+#define SCU_SFSPF_2_EHD_Msk                                   (0x03UL << SCU_SFSPF_2_EHD_Pos)                           /*!< SCU SFSPF_2: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_3  ------------------------------------------\r
+#define SCU_SFSPF_3_MODE_Pos                                  0                                                         /*!< SCU SFSPF_3: MODE Position          */\r
+#define SCU_SFSPF_3_MODE_Msk                                  (0x07UL << SCU_SFSPF_3_MODE_Pos)                          /*!< SCU SFSPF_3: MODE Mask              */\r
+#define SCU_SFSPF_3_EPD_Pos                                   3                                                         /*!< SCU SFSPF_3: EPD Position           */\r
+#define SCU_SFSPF_3_EPD_Msk                                   (0x01UL << SCU_SFSPF_3_EPD_Pos)                           /*!< SCU SFSPF_3: EPD Mask               */\r
+#define SCU_SFSPF_3_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_3: EPUN Position          */\r
+#define SCU_SFSPF_3_EPUN_Msk                                  (0x01UL << SCU_SFSPF_3_EPUN_Pos)                          /*!< SCU SFSPF_3: EPUN Mask              */\r
+#define SCU_SFSPF_3_EHS_Pos                                   5                                                         /*!< SCU SFSPF_3: EHS Position           */\r
+#define SCU_SFSPF_3_EHS_Msk                                   (0x01UL << SCU_SFSPF_3_EHS_Pos)                           /*!< SCU SFSPF_3: EHS Mask               */\r
+#define SCU_SFSPF_3_EZI_Pos                                   6                                                         /*!< SCU SFSPF_3: EZI Position           */\r
+#define SCU_SFSPF_3_EZI_Msk                                   (0x01UL << SCU_SFSPF_3_EZI_Pos)                           /*!< SCU SFSPF_3: EZI Mask               */\r
+#define SCU_SFSPF_3_EHD_Pos                                   8                                                         /*!< SCU SFSPF_3: EHD Position           */\r
+#define SCU_SFSPF_3_EHD_Msk                                   (0x03UL << SCU_SFSPF_3_EHD_Pos)                           /*!< SCU SFSPF_3: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_4  ------------------------------------------\r
+#define SCU_SFSPF_4_MODE_Pos                                  0                                                         /*!< SCU SFSPF_4: MODE Position          */\r
+#define SCU_SFSPF_4_MODE_Msk                                  (0x07UL << SCU_SFSPF_4_MODE_Pos)                          /*!< SCU SFSPF_4: MODE Mask              */\r
+#define SCU_SFSPF_4_EPD_Pos                                   3                                                         /*!< SCU SFSPF_4: EPD Position           */\r
+#define SCU_SFSPF_4_EPD_Msk                                   (0x01UL << SCU_SFSPF_4_EPD_Pos)                           /*!< SCU SFSPF_4: EPD Mask               */\r
+#define SCU_SFSPF_4_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_4: EPUN Position          */\r
+#define SCU_SFSPF_4_EPUN_Msk                                  (0x01UL << SCU_SFSPF_4_EPUN_Pos)                          /*!< SCU SFSPF_4: EPUN Mask              */\r
+#define SCU_SFSPF_4_EHS_Pos                                   5                                                         /*!< SCU SFSPF_4: EHS Position           */\r
+#define SCU_SFSPF_4_EHS_Msk                                   (0x01UL << SCU_SFSPF_4_EHS_Pos)                           /*!< SCU SFSPF_4: EHS Mask               */\r
+#define SCU_SFSPF_4_EZI_Pos                                   6                                                         /*!< SCU SFSPF_4: EZI Position           */\r
+#define SCU_SFSPF_4_EZI_Msk                                   (0x01UL << SCU_SFSPF_4_EZI_Pos)                           /*!< SCU SFSPF_4: EZI Mask               */\r
+#define SCU_SFSPF_4_EHD_Pos                                   8                                                         /*!< SCU SFSPF_4: EHD Position           */\r
+#define SCU_SFSPF_4_EHD_Msk                                   (0x03UL << SCU_SFSPF_4_EHD_Pos)                           /*!< SCU SFSPF_4: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_5  ------------------------------------------\r
+#define SCU_SFSPF_5_MODE_Pos                                  0                                                         /*!< SCU SFSPF_5: MODE Position          */\r
+#define SCU_SFSPF_5_MODE_Msk                                  (0x07UL << SCU_SFSPF_5_MODE_Pos)                          /*!< SCU SFSPF_5: MODE Mask              */\r
+#define SCU_SFSPF_5_EPD_Pos                                   3                                                         /*!< SCU SFSPF_5: EPD Position           */\r
+#define SCU_SFSPF_5_EPD_Msk                                   (0x01UL << SCU_SFSPF_5_EPD_Pos)                           /*!< SCU SFSPF_5: EPD Mask               */\r
+#define SCU_SFSPF_5_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_5: EPUN Position          */\r
+#define SCU_SFSPF_5_EPUN_Msk                                  (0x01UL << SCU_SFSPF_5_EPUN_Pos)                          /*!< SCU SFSPF_5: EPUN Mask              */\r
+#define SCU_SFSPF_5_EHS_Pos                                   5                                                         /*!< SCU SFSPF_5: EHS Position           */\r
+#define SCU_SFSPF_5_EHS_Msk                                   (0x01UL << SCU_SFSPF_5_EHS_Pos)                           /*!< SCU SFSPF_5: EHS Mask               */\r
+#define SCU_SFSPF_5_EZI_Pos                                   6                                                         /*!< SCU SFSPF_5: EZI Position           */\r
+#define SCU_SFSPF_5_EZI_Msk                                   (0x01UL << SCU_SFSPF_5_EZI_Pos)                           /*!< SCU SFSPF_5: EZI Mask               */\r
+#define SCU_SFSPF_5_EHD_Pos                                   8                                                         /*!< SCU SFSPF_5: EHD Position           */\r
+#define SCU_SFSPF_5_EHD_Msk                                   (0x03UL << SCU_SFSPF_5_EHD_Pos)                           /*!< SCU SFSPF_5: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_6  ------------------------------------------\r
+#define SCU_SFSPF_6_MODE_Pos                                  0                                                         /*!< SCU SFSPF_6: MODE Position          */\r
+#define SCU_SFSPF_6_MODE_Msk                                  (0x07UL << SCU_SFSPF_6_MODE_Pos)                          /*!< SCU SFSPF_6: MODE Mask              */\r
+#define SCU_SFSPF_6_EPD_Pos                                   3                                                         /*!< SCU SFSPF_6: EPD Position           */\r
+#define SCU_SFSPF_6_EPD_Msk                                   (0x01UL << SCU_SFSPF_6_EPD_Pos)                           /*!< SCU SFSPF_6: EPD Mask               */\r
+#define SCU_SFSPF_6_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_6: EPUN Position          */\r
+#define SCU_SFSPF_6_EPUN_Msk                                  (0x01UL << SCU_SFSPF_6_EPUN_Pos)                          /*!< SCU SFSPF_6: EPUN Mask              */\r
+#define SCU_SFSPF_6_EHS_Pos                                   5                                                         /*!< SCU SFSPF_6: EHS Position           */\r
+#define SCU_SFSPF_6_EHS_Msk                                   (0x01UL << SCU_SFSPF_6_EHS_Pos)                           /*!< SCU SFSPF_6: EHS Mask               */\r
+#define SCU_SFSPF_6_EZI_Pos                                   6                                                         /*!< SCU SFSPF_6: EZI Position           */\r
+#define SCU_SFSPF_6_EZI_Msk                                   (0x01UL << SCU_SFSPF_6_EZI_Pos)                           /*!< SCU SFSPF_6: EZI Mask               */\r
+#define SCU_SFSPF_6_EHD_Pos                                   8                                                         /*!< SCU SFSPF_6: EHD Position           */\r
+#define SCU_SFSPF_6_EHD_Msk                                   (0x03UL << SCU_SFSPF_6_EHD_Pos)                           /*!< SCU SFSPF_6: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_7  ------------------------------------------\r
+#define SCU_SFSPF_7_MODE_Pos                                  0                                                         /*!< SCU SFSPF_7: MODE Position          */\r
+#define SCU_SFSPF_7_MODE_Msk                                  (0x07UL << SCU_SFSPF_7_MODE_Pos)                          /*!< SCU SFSPF_7: MODE Mask              */\r
+#define SCU_SFSPF_7_EPD_Pos                                   3                                                         /*!< SCU SFSPF_7: EPD Position           */\r
+#define SCU_SFSPF_7_EPD_Msk                                   (0x01UL << SCU_SFSPF_7_EPD_Pos)                           /*!< SCU SFSPF_7: EPD Mask               */\r
+#define SCU_SFSPF_7_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_7: EPUN Position          */\r
+#define SCU_SFSPF_7_EPUN_Msk                                  (0x01UL << SCU_SFSPF_7_EPUN_Pos)                          /*!< SCU SFSPF_7: EPUN Mask              */\r
+#define SCU_SFSPF_7_EHS_Pos                                   5                                                         /*!< SCU SFSPF_7: EHS Position           */\r
+#define SCU_SFSPF_7_EHS_Msk                                   (0x01UL << SCU_SFSPF_7_EHS_Pos)                           /*!< SCU SFSPF_7: EHS Mask               */\r
+#define SCU_SFSPF_7_EZI_Pos                                   6                                                         /*!< SCU SFSPF_7: EZI Position           */\r
+#define SCU_SFSPF_7_EZI_Msk                                   (0x01UL << SCU_SFSPF_7_EZI_Pos)                           /*!< SCU SFSPF_7: EZI Mask               */\r
+#define SCU_SFSPF_7_EHD_Pos                                   8                                                         /*!< SCU SFSPF_7: EHD Position           */\r
+#define SCU_SFSPF_7_EHD_Msk                                   (0x03UL << SCU_SFSPF_7_EHD_Pos)                           /*!< SCU SFSPF_7: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_8  ------------------------------------------\r
+#define SCU_SFSPF_8_MODE_Pos                                  0                                                         /*!< SCU SFSPF_8: MODE Position          */\r
+#define SCU_SFSPF_8_MODE_Msk                                  (0x07UL << SCU_SFSPF_8_MODE_Pos)                          /*!< SCU SFSPF_8: MODE Mask              */\r
+#define SCU_SFSPF_8_EPD_Pos                                   3                                                         /*!< SCU SFSPF_8: EPD Position           */\r
+#define SCU_SFSPF_8_EPD_Msk                                   (0x01UL << SCU_SFSPF_8_EPD_Pos)                           /*!< SCU SFSPF_8: EPD Mask               */\r
+#define SCU_SFSPF_8_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_8: EPUN Position          */\r
+#define SCU_SFSPF_8_EPUN_Msk                                  (0x01UL << SCU_SFSPF_8_EPUN_Pos)                          /*!< SCU SFSPF_8: EPUN Mask              */\r
+#define SCU_SFSPF_8_EHS_Pos                                   5                                                         /*!< SCU SFSPF_8: EHS Position           */\r
+#define SCU_SFSPF_8_EHS_Msk                                   (0x01UL << SCU_SFSPF_8_EHS_Pos)                           /*!< SCU SFSPF_8: EHS Mask               */\r
+#define SCU_SFSPF_8_EZI_Pos                                   6                                                         /*!< SCU SFSPF_8: EZI Position           */\r
+#define SCU_SFSPF_8_EZI_Msk                                   (0x01UL << SCU_SFSPF_8_EZI_Pos)                           /*!< SCU SFSPF_8: EZI Mask               */\r
+#define SCU_SFSPF_8_EHD_Pos                                   8                                                         /*!< SCU SFSPF_8: EHD Position           */\r
+#define SCU_SFSPF_8_EHD_Msk                                   (0x03UL << SCU_SFSPF_8_EHD_Pos)                           /*!< SCU SFSPF_8: EHD Mask               */\r
+\r
+// ---------------------------------------  SCU_SFSPF_9  ------------------------------------------\r
+#define SCU_SFSPF_9_MODE_Pos                                  0                                                         /*!< SCU SFSPF_9: MODE Position          */\r
+#define SCU_SFSPF_9_MODE_Msk                                  (0x07UL << SCU_SFSPF_9_MODE_Pos)                          /*!< SCU SFSPF_9: MODE Mask              */\r
+#define SCU_SFSPF_9_EPD_Pos                                   3                                                         /*!< SCU SFSPF_9: EPD Position           */\r
+#define SCU_SFSPF_9_EPD_Msk                                   (0x01UL << SCU_SFSPF_9_EPD_Pos)                           /*!< SCU SFSPF_9: EPD Mask               */\r
+#define SCU_SFSPF_9_EPUN_Pos                                  4                                                         /*!< SCU SFSPF_9: EPUN Position          */\r
+#define SCU_SFSPF_9_EPUN_Msk                                  (0x01UL << SCU_SFSPF_9_EPUN_Pos)                          /*!< SCU SFSPF_9: EPUN Mask              */\r
+#define SCU_SFSPF_9_EHS_Pos                                   5                                                         /*!< SCU SFSPF_9: EHS Position           */\r
+#define SCU_SFSPF_9_EHS_Msk                                   (0x01UL << SCU_SFSPF_9_EHS_Pos)                           /*!< SCU SFSPF_9: EHS Mask               */\r
+#define SCU_SFSPF_9_EZI_Pos                                   6                                                         /*!< SCU SFSPF_9: EZI Position           */\r
+#define SCU_SFSPF_9_EZI_Msk                                   (0x01UL << SCU_SFSPF_9_EZI_Pos)                           /*!< SCU SFSPF_9: EZI Mask               */\r
+#define SCU_SFSPF_9_EHD_Pos                                   8                                                         /*!< SCU SFSPF_9: EHD Position           */\r
+#define SCU_SFSPF_9_EHD_Msk                                   (0x03UL << SCU_SFSPF_9_EHD_Pos)                           /*!< SCU SFSPF_9: EHD Mask               */\r
+\r
+// --------------------------------------  SCU_SFSPF_10  ------------------------------------------\r
+#define SCU_SFSPF_10_MODE_Pos                                 0                                                         /*!< SCU SFSPF_10: MODE Position         */\r
+#define SCU_SFSPF_10_MODE_Msk                                 (0x07UL << SCU_SFSPF_10_MODE_Pos)                         /*!< SCU SFSPF_10: MODE Mask             */\r
+#define SCU_SFSPF_10_EPD_Pos                                  3                                                         /*!< SCU SFSPF_10: EPD Position          */\r
+#define SCU_SFSPF_10_EPD_Msk                                  (0x01UL << SCU_SFSPF_10_EPD_Pos)                          /*!< SCU SFSPF_10: EPD Mask              */\r
+#define SCU_SFSPF_10_EPUN_Pos                                 4                                                         /*!< SCU SFSPF_10: EPUN Position         */\r
+#define SCU_SFSPF_10_EPUN_Msk                                 (0x01UL << SCU_SFSPF_10_EPUN_Pos)                         /*!< SCU SFSPF_10: EPUN Mask             */\r
+#define SCU_SFSPF_10_EHS_Pos                                  5                                                         /*!< SCU SFSPF_10: EHS Position          */\r
+#define SCU_SFSPF_10_EHS_Msk                                  (0x01UL << SCU_SFSPF_10_EHS_Pos)                          /*!< SCU SFSPF_10: EHS Mask              */\r
+#define SCU_SFSPF_10_EZI_Pos                                  6                                                         /*!< SCU SFSPF_10: EZI Position          */\r
+#define SCU_SFSPF_10_EZI_Msk                                  (0x01UL << SCU_SFSPF_10_EZI_Pos)                          /*!< SCU SFSPF_10: EZI Mask              */\r
+#define SCU_SFSPF_10_EHD_Pos                                  8                                                         /*!< SCU SFSPF_10: EHD Position          */\r
+#define SCU_SFSPF_10_EHD_Msk                                  (0x03UL << SCU_SFSPF_10_EHD_Pos)                          /*!< SCU SFSPF_10: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSPF_11  ------------------------------------------\r
+#define SCU_SFSPF_11_MODE_Pos                                 0                                                         /*!< SCU SFSPF_11: MODE Position         */\r
+#define SCU_SFSPF_11_MODE_Msk                                 (0x07UL << SCU_SFSPF_11_MODE_Pos)                         /*!< SCU SFSPF_11: MODE Mask             */\r
+#define SCU_SFSPF_11_EPD_Pos                                  3                                                         /*!< SCU SFSPF_11: EPD Position          */\r
+#define SCU_SFSPF_11_EPD_Msk                                  (0x01UL << SCU_SFSPF_11_EPD_Pos)                          /*!< SCU SFSPF_11: EPD Mask              */\r
+#define SCU_SFSPF_11_EPUN_Pos                                 4                                                         /*!< SCU SFSPF_11: EPUN Position         */\r
+#define SCU_SFSPF_11_EPUN_Msk                                 (0x01UL << SCU_SFSPF_11_EPUN_Pos)                         /*!< SCU SFSPF_11: EPUN Mask             */\r
+#define SCU_SFSPF_11_EHS_Pos                                  5                                                         /*!< SCU SFSPF_11: EHS Position          */\r
+#define SCU_SFSPF_11_EHS_Msk                                  (0x01UL << SCU_SFSPF_11_EHS_Pos)                          /*!< SCU SFSPF_11: EHS Mask              */\r
+#define SCU_SFSPF_11_EZI_Pos                                  6                                                         /*!< SCU SFSPF_11: EZI Position          */\r
+#define SCU_SFSPF_11_EZI_Msk                                  (0x01UL << SCU_SFSPF_11_EZI_Pos)                          /*!< SCU SFSPF_11: EZI Mask              */\r
+#define SCU_SFSPF_11_EHD_Pos                                  8                                                         /*!< SCU SFSPF_11: EHD Position          */\r
+#define SCU_SFSPF_11_EHD_Msk                                  (0x03UL << SCU_SFSPF_11_EHD_Pos)                          /*!< SCU SFSPF_11: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSCLK_0  ------------------------------------------\r
+#define SCU_SFSCLK_0_MODE_Pos                                 0                                                         /*!< SCU SFSCLK_0: MODE Position         */\r
+#define SCU_SFSCLK_0_MODE_Msk                                 (0x07UL << SCU_SFSCLK_0_MODE_Pos)                         /*!< SCU SFSCLK_0: MODE Mask             */\r
+#define SCU_SFSCLK_0_EPD_Pos                                  3                                                         /*!< SCU SFSCLK_0: EPD Position          */\r
+#define SCU_SFSCLK_0_EPD_Msk                                  (0x01UL << SCU_SFSCLK_0_EPD_Pos)                          /*!< SCU SFSCLK_0: EPD Mask              */\r
+#define SCU_SFSCLK_0_EPUN_Pos                                 4                                                         /*!< SCU SFSCLK_0: EPUN Position         */\r
+#define SCU_SFSCLK_0_EPUN_Msk                                 (0x01UL << SCU_SFSCLK_0_EPUN_Pos)                         /*!< SCU SFSCLK_0: EPUN Mask             */\r
+#define SCU_SFSCLK_0_EHS_Pos                                  5                                                         /*!< SCU SFSCLK_0: EHS Position          */\r
+#define SCU_SFSCLK_0_EHS_Msk                                  (0x01UL << SCU_SFSCLK_0_EHS_Pos)                          /*!< SCU SFSCLK_0: EHS Mask              */\r
+#define SCU_SFSCLK_0_EZI_Pos                                  6                                                         /*!< SCU SFSCLK_0: EZI Position          */\r
+#define SCU_SFSCLK_0_EZI_Msk                                  (0x01UL << SCU_SFSCLK_0_EZI_Pos)                          /*!< SCU SFSCLK_0: EZI Mask              */\r
+#define SCU_SFSCLK_0_EHD_Pos                                  8                                                         /*!< SCU SFSCLK_0: EHD Position          */\r
+#define SCU_SFSCLK_0_EHD_Msk                                  (0x03UL << SCU_SFSCLK_0_EHD_Pos)                          /*!< SCU SFSCLK_0: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSCLK_1  ------------------------------------------\r
+#define SCU_SFSCLK_1_MODE_Pos                                 0                                                         /*!< SCU SFSCLK_1: MODE Position         */\r
+#define SCU_SFSCLK_1_MODE_Msk                                 (0x07UL << SCU_SFSCLK_1_MODE_Pos)                         /*!< SCU SFSCLK_1: MODE Mask             */\r
+#define SCU_SFSCLK_1_EPD_Pos                                  3                                                         /*!< SCU SFSCLK_1: EPD Position          */\r
+#define SCU_SFSCLK_1_EPD_Msk                                  (0x01UL << SCU_SFSCLK_1_EPD_Pos)                          /*!< SCU SFSCLK_1: EPD Mask              */\r
+#define SCU_SFSCLK_1_EPUN_Pos                                 4                                                         /*!< SCU SFSCLK_1: EPUN Position         */\r
+#define SCU_SFSCLK_1_EPUN_Msk                                 (0x01UL << SCU_SFSCLK_1_EPUN_Pos)                         /*!< SCU SFSCLK_1: EPUN Mask             */\r
+#define SCU_SFSCLK_1_EHS_Pos                                  5                                                         /*!< SCU SFSCLK_1: EHS Position          */\r
+#define SCU_SFSCLK_1_EHS_Msk                                  (0x01UL << SCU_SFSCLK_1_EHS_Pos)                          /*!< SCU SFSCLK_1: EHS Mask              */\r
+#define SCU_SFSCLK_1_EZI_Pos                                  6                                                         /*!< SCU SFSCLK_1: EZI Position          */\r
+#define SCU_SFSCLK_1_EZI_Msk                                  (0x01UL << SCU_SFSCLK_1_EZI_Pos)                          /*!< SCU SFSCLK_1: EZI Mask              */\r
+#define SCU_SFSCLK_1_EHD_Pos                                  8                                                         /*!< SCU SFSCLK_1: EHD Position          */\r
+#define SCU_SFSCLK_1_EHD_Msk                                  (0x03UL << SCU_SFSCLK_1_EHD_Pos)                          /*!< SCU SFSCLK_1: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSCLK_2  ------------------------------------------\r
+#define SCU_SFSCLK_2_MODE_Pos                                 0                                                         /*!< SCU SFSCLK_2: MODE Position         */\r
+#define SCU_SFSCLK_2_MODE_Msk                                 (0x07UL << SCU_SFSCLK_2_MODE_Pos)                         /*!< SCU SFSCLK_2: MODE Mask             */\r
+#define SCU_SFSCLK_2_EPD_Pos                                  3                                                         /*!< SCU SFSCLK_2: EPD Position          */\r
+#define SCU_SFSCLK_2_EPD_Msk                                  (0x01UL << SCU_SFSCLK_2_EPD_Pos)                          /*!< SCU SFSCLK_2: EPD Mask              */\r
+#define SCU_SFSCLK_2_EPUN_Pos                                 4                                                         /*!< SCU SFSCLK_2: EPUN Position         */\r
+#define SCU_SFSCLK_2_EPUN_Msk                                 (0x01UL << SCU_SFSCLK_2_EPUN_Pos)                         /*!< SCU SFSCLK_2: EPUN Mask             */\r
+#define SCU_SFSCLK_2_EHS_Pos                                  5                                                         /*!< SCU SFSCLK_2: EHS Position          */\r
+#define SCU_SFSCLK_2_EHS_Msk                                  (0x01UL << SCU_SFSCLK_2_EHS_Pos)                          /*!< SCU SFSCLK_2: EHS Mask              */\r
+#define SCU_SFSCLK_2_EZI_Pos                                  6                                                         /*!< SCU SFSCLK_2: EZI Position          */\r
+#define SCU_SFSCLK_2_EZI_Msk                                  (0x01UL << SCU_SFSCLK_2_EZI_Pos)                          /*!< SCU SFSCLK_2: EZI Mask              */\r
+#define SCU_SFSCLK_2_EHD_Pos                                  8                                                         /*!< SCU SFSCLK_2: EHD Position          */\r
+#define SCU_SFSCLK_2_EHD_Msk                                  (0x03UL << SCU_SFSCLK_2_EHD_Pos)                          /*!< SCU SFSCLK_2: EHD Mask              */\r
+\r
+// --------------------------------------  SCU_SFSCLK_3  ------------------------------------------\r
+#define SCU_SFSCLK_3_MODE_Pos                                 0                                                         /*!< SCU SFSCLK_3: MODE Position         */\r
+#define SCU_SFSCLK_3_MODE_Msk                                 (0x07UL << SCU_SFSCLK_3_MODE_Pos)                         /*!< SCU SFSCLK_3: MODE Mask             */\r
+#define SCU_SFSCLK_3_EPD_Pos                                  3                                                         /*!< SCU SFSCLK_3: EPD Position          */\r
+#define SCU_SFSCLK_3_EPD_Msk                                  (0x01UL << SCU_SFSCLK_3_EPD_Pos)                          /*!< SCU SFSCLK_3: EPD Mask              */\r
+#define SCU_SFSCLK_3_EPUN_Pos                                 4                                                         /*!< SCU SFSCLK_3: EPUN Position         */\r
+#define SCU_SFSCLK_3_EPUN_Msk                                 (0x01UL << SCU_SFSCLK_3_EPUN_Pos)                         /*!< SCU SFSCLK_3: EPUN Mask             */\r
+#define SCU_SFSCLK_3_EHS_Pos                                  5                                                         /*!< SCU SFSCLK_3: EHS Position          */\r
+#define SCU_SFSCLK_3_EHS_Msk                                  (0x01UL << SCU_SFSCLK_3_EHS_Pos)                          /*!< SCU SFSCLK_3: EHS Mask              */\r
+#define SCU_SFSCLK_3_EZI_Pos                                  6                                                         /*!< SCU SFSCLK_3: EZI Position          */\r
+#define SCU_SFSCLK_3_EZI_Msk                                  (0x01UL << SCU_SFSCLK_3_EZI_Pos)                          /*!< SCU SFSCLK_3: EZI Mask              */\r
+#define SCU_SFSCLK_3_EHD_Pos                                  8                                                         /*!< SCU SFSCLK_3: EHD Position          */\r
+#define SCU_SFSCLK_3_EHD_Msk                                  (0x03UL << SCU_SFSCLK_3_EHD_Pos)                          /*!< SCU SFSCLK_3: EHD Mask              */\r
+\r
+// ---------------------------------------  SCU_SFSUSB  -------------------------------------------\r
+#define SCU_SFSUSB_USB_AIM_Pos                                0                                                         /*!< SCU SFSUSB: USB_AIM Position        */\r
+#define SCU_SFSUSB_USB_AIM_Msk                                (0x01UL << SCU_SFSUSB_USB_AIM_Pos)                        /*!< SCU SFSUSB: USB_AIM Mask            */\r
+#define SCU_SFSUSB_USB_ESEA_Pos                               1                                                         /*!< SCU SFSUSB: USB_ESEA Position       */\r
+#define SCU_SFSUSB_USB_ESEA_Msk                               (0x01UL << SCU_SFSUSB_USB_ESEA_Pos)                       /*!< SCU SFSUSB: USB_ESEA Mask           */\r
+\r
+// ---------------------------------------  SCU_SFSI2C0  ------------------------------------------\r
+#define SCU_SFSI2C0_SDA_EHS_Pos                               0                                                         /*!< SCU SFSI2C0: SDA_EHS Position       */\r
+#define SCU_SFSI2C0_SDA_EHS_Msk                               (0x01UL << SCU_SFSI2C0_SDA_EHS_Pos)                       /*!< SCU SFSI2C0: SDA_EHS Mask           */\r
+#define SCU_SFSI2C0_SCL_EHS_Pos                               1                                                         /*!< SCU SFSI2C0: SCL_EHS Position       */\r
+#define SCU_SFSI2C0_SCL_EHS_Msk                               (0x01UL << SCU_SFSI2C0_SCL_EHS_Pos)                       /*!< SCU SFSI2C0: SCL_EHS Mask           */\r
+#define SCU_SFSI2C0_SCL_ECS_Pos                               2                                                         /*!< SCU SFSI2C0: SCL_ECS Position       */\r
+#define SCU_SFSI2C0_SCL_ECS_Msk                               (0x01UL << SCU_SFSI2C0_SCL_ECS_Pos)                       /*!< SCU SFSI2C0: SCL_ECS Mask           */\r
+\r
+// ---------------------------------------  SCU_ENAIO0  -------------------------------------------\r
+#define SCU_ENAIO0_ADC0_0_Pos                                 0                                                         /*!< SCU ENAIO0: ADC0_0 Position         */\r
+#define SCU_ENAIO0_ADC0_0_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_0_Pos)                         /*!< SCU ENAIO0: ADC0_0 Mask             */\r
+#define SCU_ENAIO0_ADC0_1_Pos                                 1                                                         /*!< SCU ENAIO0: ADC0_1 Position         */\r
+#define SCU_ENAIO0_ADC0_1_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_1_Pos)                         /*!< SCU ENAIO0: ADC0_1 Mask             */\r
+#define SCU_ENAIO0_ADC0_2_Pos                                 2                                                         /*!< SCU ENAIO0: ADC0_2 Position         */\r
+#define SCU_ENAIO0_ADC0_2_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_2_Pos)                         /*!< SCU ENAIO0: ADC0_2 Mask             */\r
+#define SCU_ENAIO0_ADC0_3_Pos                                 3                                                         /*!< SCU ENAIO0: ADC0_3 Position         */\r
+#define SCU_ENAIO0_ADC0_3_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_3_Pos)                         /*!< SCU ENAIO0: ADC0_3 Mask             */\r
+#define SCU_ENAIO0_ADC0_4_Pos                                 4                                                         /*!< SCU ENAIO0: ADC0_4 Position         */\r
+#define SCU_ENAIO0_ADC0_4_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_4_Pos)                         /*!< SCU ENAIO0: ADC0_4 Mask             */\r
+#define SCU_ENAIO0_ADC0_5_Pos                                 5                                                         /*!< SCU ENAIO0: ADC0_5 Position         */\r
+#define SCU_ENAIO0_ADC0_5_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_5_Pos)                         /*!< SCU ENAIO0: ADC0_5 Mask             */\r
+#define SCU_ENAIO0_ADC0_6_Pos                                 6                                                         /*!< SCU ENAIO0: ADC0_6 Position         */\r
+#define SCU_ENAIO0_ADC0_6_Msk                                 (0x01UL << SCU_ENAIO0_ADC0_6_Pos)                         /*!< SCU ENAIO0: ADC0_6 Mask             */\r
+\r
+// ---------------------------------------  SCU_ENAIO1  -------------------------------------------\r
+#define SCU_ENAIO1_ADC1_0_Pos                                 0                                                         /*!< SCU ENAIO1: ADC1_0 Position         */\r
+#define SCU_ENAIO1_ADC1_0_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_0_Pos)                         /*!< SCU ENAIO1: ADC1_0 Mask             */\r
+#define SCU_ENAIO1_ADC1_1_Pos                                 1                                                         /*!< SCU ENAIO1: ADC1_1 Position         */\r
+#define SCU_ENAIO1_ADC1_1_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_1_Pos)                         /*!< SCU ENAIO1: ADC1_1 Mask             */\r
+#define SCU_ENAIO1_ADC1_2_Pos                                 2                                                         /*!< SCU ENAIO1: ADC1_2 Position         */\r
+#define SCU_ENAIO1_ADC1_2_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_2_Pos)                         /*!< SCU ENAIO1: ADC1_2 Mask             */\r
+#define SCU_ENAIO1_ADC1_3_Pos                                 3                                                         /*!< SCU ENAIO1: ADC1_3 Position         */\r
+#define SCU_ENAIO1_ADC1_3_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_3_Pos)                         /*!< SCU ENAIO1: ADC1_3 Mask             */\r
+#define SCU_ENAIO1_ADC1_4_Pos                                 4                                                         /*!< SCU ENAIO1: ADC1_4 Position         */\r
+#define SCU_ENAIO1_ADC1_4_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_4_Pos)                         /*!< SCU ENAIO1: ADC1_4 Mask             */\r
+#define SCU_ENAIO1_ADC1_5_Pos                                 5                                                         /*!< SCU ENAIO1: ADC1_5 Position         */\r
+#define SCU_ENAIO1_ADC1_5_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_5_Pos)                         /*!< SCU ENAIO1: ADC1_5 Mask             */\r
+#define SCU_ENAIO1_ADC1_6_Pos                                 6                                                         /*!< SCU ENAIO1: ADC1_6 Position         */\r
+#define SCU_ENAIO1_ADC1_6_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_6_Pos)                         /*!< SCU ENAIO1: ADC1_6 Mask             */\r
+#define SCU_ENAIO1_ADC1_7_Pos                                 7                                                         /*!< SCU ENAIO1: ADC1_7 Position         */\r
+#define SCU_ENAIO1_ADC1_7_Msk                                 (0x01UL << SCU_ENAIO1_ADC1_7_Pos)                         /*!< SCU ENAIO1: ADC1_7 Mask             */\r
+\r
+// ---------------------------------------  SCU_ENAIO2  -------------------------------------------\r
+#define SCU_ENAIO2_DAC_Pos                                    0                                                         /*!< SCU ENAIO2: DAC Position            */\r
+#define SCU_ENAIO2_DAC_Msk                                    (0x01UL << SCU_ENAIO2_DAC_Pos)                            /*!< SCU ENAIO2: DAC Mask                */\r
+#define SCU_ENAIO2_BG_Pos                                     4                                                         /*!< SCU ENAIO2: BG Position             */\r
+#define SCU_ENAIO2_BG_Msk                                     (0x01UL << SCU_ENAIO2_BG_Pos)                             /*!< SCU ENAIO2: BG Mask                 */\r
+\r
+// -------------------------------------  SCU_EMCDELAYCLK  ----------------------------------------\r
+#define SCU_EMCDELAYCLK_CLK0_DELAY_Pos                        0                                                         /*!< SCU EMCDELAYCLK: CLK0_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CLK0_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CLK0_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CLK0_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CLK1_DELAY_Pos                        4                                                         /*!< SCU EMCDELAYCLK: CLK1_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CLK1_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CLK1_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CLK1_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CLK2_DELAY_Pos                        8                                                         /*!< SCU EMCDELAYCLK: CLK2_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CLK2_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CLK2_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CLK2_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CLK3_DELAY_Pos                        12                                                        /*!< SCU EMCDELAYCLK: CLK3_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CLK3_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CLK3_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CLK3_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CKE0_DELAY_Pos                        16                                                        /*!< SCU EMCDELAYCLK: CKE0_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CKE0_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CKE0_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CKE0_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CKE1_DELAY_Pos                        20                                                        /*!< SCU EMCDELAYCLK: CKE1_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CKE1_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CKE1_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CKE1_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CKE2_DELAY_Pos                        24                                                        /*!< SCU EMCDELAYCLK: CKE2_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CKE2_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CKE2_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CKE2_DELAY Mask    */\r
+#define SCU_EMCDELAYCLK_CKE3_DELAY_Pos                        28                                                        /*!< SCU EMCDELAYCLK: CKE3_DELAY Position */\r
+#define SCU_EMCDELAYCLK_CKE3_DELAY_Msk                        (0x07UL << SCU_EMCDELAYCLK_CKE3_DELAY_Pos)                /*!< SCU EMCDELAYCLK: CKE3_DELAY Mask    */\r
+\r
+// --------------------------------------  SCU_PINTSEL0  ------------------------------------------\r
+#define SCU_PINTSEL0_INTPIN0_Pos                              0                                                         /*!< SCU PINTSEL0: INTPIN0 Position      */\r
+#define SCU_PINTSEL0_INTPIN0_Msk                              (0x1fUL << SCU_PINTSEL0_INTPIN0_Pos)                      /*!< SCU PINTSEL0: INTPIN0 Mask          */\r
+#define SCU_PINTSEL0_PORTSEL0_Pos                             5                                                         /*!< SCU PINTSEL0: PORTSEL0 Position     */\r
+#define SCU_PINTSEL0_PORTSEL0_Msk                             (0x07UL << SCU_PINTSEL0_PORTSEL0_Pos)                     /*!< SCU PINTSEL0: PORTSEL0 Mask         */\r
+#define SCU_PINTSEL0_INTPIN1_Pos                              8                                                         /*!< SCU PINTSEL0: INTPIN1 Position      */\r
+#define SCU_PINTSEL0_INTPIN1_Msk                              (0x1fUL << SCU_PINTSEL0_INTPIN1_Pos)                      /*!< SCU PINTSEL0: INTPIN1 Mask          */\r
+#define SCU_PINTSEL0_PORTSEL1_Pos                             13                                                        /*!< SCU PINTSEL0: PORTSEL1 Position     */\r
+#define SCU_PINTSEL0_PORTSEL1_Msk                             (0x07UL << SCU_PINTSEL0_PORTSEL1_Pos)                     /*!< SCU PINTSEL0: PORTSEL1 Mask         */\r
+#define SCU_PINTSEL0_INTPIN2_Pos                              16                                                        /*!< SCU PINTSEL0: INTPIN2 Position      */\r
+#define SCU_PINTSEL0_INTPIN2_Msk                              (0x1fUL << SCU_PINTSEL0_INTPIN2_Pos)                      /*!< SCU PINTSEL0: INTPIN2 Mask          */\r
+#define SCU_PINTSEL0_PORTSEL2_Pos                             21                                                        /*!< SCU PINTSEL0: PORTSEL2 Position     */\r
+#define SCU_PINTSEL0_PORTSEL2_Msk                             (0x07UL << SCU_PINTSEL0_PORTSEL2_Pos)                     /*!< SCU PINTSEL0: PORTSEL2 Mask         */\r
+#define SCU_PINTSEL0_INTPIN3_Pos                              24                                                        /*!< SCU PINTSEL0: INTPIN3 Position      */\r
+#define SCU_PINTSEL0_INTPIN3_Msk                              (0x1fUL << SCU_PINTSEL0_INTPIN3_Pos)                      /*!< SCU PINTSEL0: INTPIN3 Mask          */\r
+#define SCU_PINTSEL0_PORTSEL3_Pos                             29                                                        /*!< SCU PINTSEL0: PORTSEL3 Position     */\r
+#define SCU_PINTSEL0_PORTSEL3_Msk                             (0x07UL << SCU_PINTSEL0_PORTSEL3_Pos)                     /*!< SCU PINTSEL0: PORTSEL3 Mask         */\r
+\r
+// --------------------------------------  SCU_PINTSEL1  ------------------------------------------\r
+#define SCU_PINTSEL1_INTPIN4_Pos                              0                                                         /*!< SCU PINTSEL1: INTPIN4 Position      */\r
+#define SCU_PINTSEL1_INTPIN4_Msk                              (0x1fUL << SCU_PINTSEL1_INTPIN4_Pos)                      /*!< SCU PINTSEL1: INTPIN4 Mask          */\r
+#define SCU_PINTSEL1_PORTSEL4_Pos                             5                                                         /*!< SCU PINTSEL1: PORTSEL4 Position     */\r
+#define SCU_PINTSEL1_PORTSEL4_Msk                             (0x07UL << SCU_PINTSEL1_PORTSEL4_Pos)                     /*!< SCU PINTSEL1: PORTSEL4 Mask         */\r
+#define SCU_PINTSEL1_INTPIN5_Pos                              8                                                         /*!< SCU PINTSEL1: INTPIN5 Position      */\r
+#define SCU_PINTSEL1_INTPIN5_Msk                              (0x1fUL << SCU_PINTSEL1_INTPIN5_Pos)                      /*!< SCU PINTSEL1: INTPIN5 Mask          */\r
+#define SCU_PINTSEL1_PORTSEL5_Pos                             13                                                        /*!< SCU PINTSEL1: PORTSEL5 Position     */\r
+#define SCU_PINTSEL1_PORTSEL5_Msk                             (0x07UL << SCU_PINTSEL1_PORTSEL5_Pos)                     /*!< SCU PINTSEL1: PORTSEL5 Mask         */\r
+#define SCU_PINTSEL1_INTPIN6_Pos                              16                                                        /*!< SCU PINTSEL1: INTPIN6 Position      */\r
+#define SCU_PINTSEL1_INTPIN6_Msk                              (0x1fUL << SCU_PINTSEL1_INTPIN6_Pos)                      /*!< SCU PINTSEL1: INTPIN6 Mask          */\r
+#define SCU_PINTSEL1_PORTSEL6_Pos                             21                                                        /*!< SCU PINTSEL1: PORTSEL6 Position     */\r
+#define SCU_PINTSEL1_PORTSEL6_Msk                             (0x07UL << SCU_PINTSEL1_PORTSEL6_Pos)                     /*!< SCU PINTSEL1: PORTSEL6 Mask         */\r
+#define SCU_PINTSEL1_INTPIN7_Pos                              24                                                        /*!< SCU PINTSEL1: INTPIN7 Position      */\r
+#define SCU_PINTSEL1_INTPIN7_Msk                              (0x1fUL << SCU_PINTSEL1_INTPIN7_Pos)                      /*!< SCU PINTSEL1: INTPIN7 Mask          */\r
+#define SCU_PINTSEL1_PORTSEL7_Pos                             29                                                        /*!< SCU PINTSEL1: PORTSEL7 Position     */\r
+#define SCU_PINTSEL1_PORTSEL7_Msk                             (0x07UL << SCU_PINTSEL1_PORTSEL7_Pos)                     /*!< SCU PINTSEL1: PORTSEL7 Mask         */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                             GPIO_PIN_INT Position & Mask                             -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ------------------------------------  GPIO_PIN_INT_ISEL  ---------------------------------------\r
+#define GPIO_PIN_INT_ISEL_PMODE0_Pos                          0                                                         /*!< GPIO_PIN_INT ISEL: PMODE0 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE0_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE0_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE0 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE1_Pos                          1                                                         /*!< GPIO_PIN_INT ISEL: PMODE1 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE1_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE1_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE1 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE2_Pos                          2                                                         /*!< GPIO_PIN_INT ISEL: PMODE2 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE2_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE2_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE2 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE3_Pos                          3                                                         /*!< GPIO_PIN_INT ISEL: PMODE3 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE3_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE3_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE3 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE4_Pos                          4                                                         /*!< GPIO_PIN_INT ISEL: PMODE4 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE4_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE4_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE4 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE5_Pos                          5                                                         /*!< GPIO_PIN_INT ISEL: PMODE5 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE5_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE5_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE5 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE6_Pos                          6                                                         /*!< GPIO_PIN_INT ISEL: PMODE6 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE6_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE6_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE6 Mask      */\r
+#define GPIO_PIN_INT_ISEL_PMODE7_Pos                          7                                                         /*!< GPIO_PIN_INT ISEL: PMODE7 Position  */\r
+#define GPIO_PIN_INT_ISEL_PMODE7_Msk                          (0x01UL << GPIO_PIN_INT_ISEL_PMODE7_Pos)                  /*!< GPIO_PIN_INT ISEL: PMODE7 Mask      */\r
+\r
+// ------------------------------------  GPIO_PIN_INT_IENR  ---------------------------------------\r
+#define GPIO_PIN_INT_IENR_ENRL0_Pos                           0                                                         /*!< GPIO_PIN_INT IENR: ENRL0 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL0_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL0_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL0 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL1_Pos                           1                                                         /*!< GPIO_PIN_INT IENR: ENRL1 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL1_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL1_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL1 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL2_Pos                           2                                                         /*!< GPIO_PIN_INT IENR: ENRL2 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL2_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL2_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL2 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL3_Pos                           3                                                         /*!< GPIO_PIN_INT IENR: ENRL3 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL3_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL3_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL3 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL4_Pos                           4                                                         /*!< GPIO_PIN_INT IENR: ENRL4 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL4_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL4_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL4 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL5_Pos                           5                                                         /*!< GPIO_PIN_INT IENR: ENRL5 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL5_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL5_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL5 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL6_Pos                           6                                                         /*!< GPIO_PIN_INT IENR: ENRL6 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL6_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL6_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL6 Mask       */\r
+#define GPIO_PIN_INT_IENR_ENRL7_Pos                           7                                                         /*!< GPIO_PIN_INT IENR: ENRL7 Position   */\r
+#define GPIO_PIN_INT_IENR_ENRL7_Msk                           (0x01UL << GPIO_PIN_INT_IENR_ENRL7_Pos)                   /*!< GPIO_PIN_INT IENR: ENRL7 Mask       */\r
+\r
+// -----------------------------------  GPIO_PIN_INT_SIENR  ---------------------------------------\r
+#define GPIO_PIN_INT_SIENR_SETENRL0_Pos                       0                                                         /*!< GPIO_PIN_INT SIENR: SETENRL0 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL0_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL0_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL0 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL1_Pos                       1                                                         /*!< GPIO_PIN_INT SIENR: SETENRL1 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL1_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL1_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL1 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL2_Pos                       2                                                         /*!< GPIO_PIN_INT SIENR: SETENRL2 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL2_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL2_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL2 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL3_Pos                       3                                                         /*!< GPIO_PIN_INT SIENR: SETENRL3 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL3_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL3_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL3 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL4_Pos                       4                                                         /*!< GPIO_PIN_INT SIENR: SETENRL4 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL4_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL4_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL4 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL5_Pos                       5                                                         /*!< GPIO_PIN_INT SIENR: SETENRL5 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL5_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL5_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL5 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL6_Pos                       6                                                         /*!< GPIO_PIN_INT SIENR: SETENRL6 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL6_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL6_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL6 Mask   */\r
+#define GPIO_PIN_INT_SIENR_SETENRL7_Pos                       7                                                         /*!< GPIO_PIN_INT SIENR: SETENRL7 Position */\r
+#define GPIO_PIN_INT_SIENR_SETENRL7_Msk                       (0x01UL << GPIO_PIN_INT_SIENR_SETENRL7_Pos)               /*!< GPIO_PIN_INT SIENR: SETENRL7 Mask   */\r
+\r
+// -----------------------------------  GPIO_PIN_INT_CIENR  ---------------------------------------\r
+#define GPIO_PIN_INT_CIENR_CENRL0_Pos                         0                                                         /*!< GPIO_PIN_INT CIENR: CENRL0 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL0_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL0_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL0 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL1_Pos                         1                                                         /*!< GPIO_PIN_INT CIENR: CENRL1 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL1_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL1_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL1 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL2_Pos                         2                                                         /*!< GPIO_PIN_INT CIENR: CENRL2 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL2_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL2_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL2 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL3_Pos                         3                                                         /*!< GPIO_PIN_INT CIENR: CENRL3 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL3_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL3_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL3 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL4_Pos                         4                                                         /*!< GPIO_PIN_INT CIENR: CENRL4 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL4_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL4_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL4 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL5_Pos                         5                                                         /*!< GPIO_PIN_INT CIENR: CENRL5 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL5_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL5_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL5 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL6_Pos                         6                                                         /*!< GPIO_PIN_INT CIENR: CENRL6 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL6_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL6_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL6 Mask     */\r
+#define GPIO_PIN_INT_CIENR_CENRL7_Pos                         7                                                         /*!< GPIO_PIN_INT CIENR: CENRL7 Position */\r
+#define GPIO_PIN_INT_CIENR_CENRL7_Msk                         (0x01UL << GPIO_PIN_INT_CIENR_CENRL7_Pos)                 /*!< GPIO_PIN_INT CIENR: CENRL7 Mask     */\r
+\r
+// ------------------------------------  GPIO_PIN_INT_IENF  ---------------------------------------\r
+#define GPIO_PIN_INT_IENF_ENAF0_Pos                           0                                                         /*!< GPIO_PIN_INT IENF: ENAF0 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF0_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF0_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF0 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF1_Pos                           1                                                         /*!< GPIO_PIN_INT IENF: ENAF1 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF1_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF1_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF1 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF2_Pos                           2                                                         /*!< GPIO_PIN_INT IENF: ENAF2 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF2_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF2_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF2 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF3_Pos                           3                                                         /*!< GPIO_PIN_INT IENF: ENAF3 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF3_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF3_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF3 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF4_Pos                           4                                                         /*!< GPIO_PIN_INT IENF: ENAF4 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF4_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF4_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF4 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF5_Pos                           5                                                         /*!< GPIO_PIN_INT IENF: ENAF5 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF5_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF5_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF5 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF6_Pos                           6                                                         /*!< GPIO_PIN_INT IENF: ENAF6 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF6_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF6_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF6 Mask       */\r
+#define GPIO_PIN_INT_IENF_ENAF7_Pos                           7                                                         /*!< GPIO_PIN_INT IENF: ENAF7 Position   */\r
+#define GPIO_PIN_INT_IENF_ENAF7_Msk                           (0x01UL << GPIO_PIN_INT_IENF_ENAF7_Pos)                   /*!< GPIO_PIN_INT IENF: ENAF7 Mask       */\r
+\r
+// -----------------------------------  GPIO_PIN_INT_SIENF  ---------------------------------------\r
+#define GPIO_PIN_INT_SIENF_SETENAF0_Pos                       0                                                         /*!< GPIO_PIN_INT SIENF: SETENAF0 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF0_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF0_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF0 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF1_Pos                       1                                                         /*!< GPIO_PIN_INT SIENF: SETENAF1 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF1_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF1_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF1 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF2_Pos                       2                                                         /*!< GPIO_PIN_INT SIENF: SETENAF2 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF2_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF2_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF2 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF3_Pos                       3                                                         /*!< GPIO_PIN_INT SIENF: SETENAF3 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF3_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF3_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF3 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF4_Pos                       4                                                         /*!< GPIO_PIN_INT SIENF: SETENAF4 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF4_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF4_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF4 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF5_Pos                       5                                                         /*!< GPIO_PIN_INT SIENF: SETENAF5 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF5_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF5_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF5 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF6_Pos                       6                                                         /*!< GPIO_PIN_INT SIENF: SETENAF6 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF6_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF6_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF6 Mask   */\r
+#define GPIO_PIN_INT_SIENF_SETENAF7_Pos                       7                                                         /*!< GPIO_PIN_INT SIENF: SETENAF7 Position */\r
+#define GPIO_PIN_INT_SIENF_SETENAF7_Msk                       (0x01UL << GPIO_PIN_INT_SIENF_SETENAF7_Pos)               /*!< GPIO_PIN_INT SIENF: SETENAF7 Mask   */\r
+\r
+// -----------------------------------  GPIO_PIN_INT_CIENF  ---------------------------------------\r
+#define GPIO_PIN_INT_CIENF_CENAF0_Pos                         0                                                         /*!< GPIO_PIN_INT CIENF: CENAF0 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF0_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF0_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF0 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF1_Pos                         1                                                         /*!< GPIO_PIN_INT CIENF: CENAF1 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF1_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF1_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF1 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF2_Pos                         2                                                         /*!< GPIO_PIN_INT CIENF: CENAF2 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF2_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF2_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF2 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF3_Pos                         3                                                         /*!< GPIO_PIN_INT CIENF: CENAF3 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF3_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF3_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF3 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF4_Pos                         4                                                         /*!< GPIO_PIN_INT CIENF: CENAF4 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF4_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF4_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF4 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF5_Pos                         5                                                         /*!< GPIO_PIN_INT CIENF: CENAF5 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF5_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF5_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF5 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF6_Pos                         6                                                         /*!< GPIO_PIN_INT CIENF: CENAF6 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF6_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF6_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF6 Mask     */\r
+#define GPIO_PIN_INT_CIENF_CENAF7_Pos                         7                                                         /*!< GPIO_PIN_INT CIENF: CENAF7 Position */\r
+#define GPIO_PIN_INT_CIENF_CENAF7_Msk                         (0x01UL << GPIO_PIN_INT_CIENF_CENAF7_Pos)                 /*!< GPIO_PIN_INT CIENF: CENAF7 Mask     */\r
+\r
+// ------------------------------------  GPIO_PIN_INT_RISE  ---------------------------------------\r
+#define GPIO_PIN_INT_RISE_RDET0_Pos                           0                                                         /*!< GPIO_PIN_INT RISE: RDET0 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET0_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET0_Pos)                   /*!< GPIO_PIN_INT RISE: RDET0 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET1_Pos                           1                                                         /*!< GPIO_PIN_INT RISE: RDET1 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET1_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET1_Pos)                   /*!< GPIO_PIN_INT RISE: RDET1 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET2_Pos                           2                                                         /*!< GPIO_PIN_INT RISE: RDET2 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET2_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET2_Pos)                   /*!< GPIO_PIN_INT RISE: RDET2 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET3_Pos                           3                                                         /*!< GPIO_PIN_INT RISE: RDET3 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET3_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET3_Pos)                   /*!< GPIO_PIN_INT RISE: RDET3 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET4_Pos                           4                                                         /*!< GPIO_PIN_INT RISE: RDET4 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET4_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET4_Pos)                   /*!< GPIO_PIN_INT RISE: RDET4 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET5_Pos                           5                                                         /*!< GPIO_PIN_INT RISE: RDET5 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET5_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET5_Pos)                   /*!< GPIO_PIN_INT RISE: RDET5 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET6_Pos                           6                                                         /*!< GPIO_PIN_INT RISE: RDET6 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET6_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET6_Pos)                   /*!< GPIO_PIN_INT RISE: RDET6 Mask       */\r
+#define GPIO_PIN_INT_RISE_RDET7_Pos                           7                                                         /*!< GPIO_PIN_INT RISE: RDET7 Position   */\r
+#define GPIO_PIN_INT_RISE_RDET7_Msk                           (0x01UL << GPIO_PIN_INT_RISE_RDET7_Pos)                   /*!< GPIO_PIN_INT RISE: RDET7 Mask       */\r
+\r
+// ------------------------------------  GPIO_PIN_INT_FALL  ---------------------------------------\r
+#define GPIO_PIN_INT_FALL_FDET0_Pos                           0                                                         /*!< GPIO_PIN_INT FALL: FDET0 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET0_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET0_Pos)                   /*!< GPIO_PIN_INT FALL: FDET0 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET1_Pos                           1                                                         /*!< GPIO_PIN_INT FALL: FDET1 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET1_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET1_Pos)                   /*!< GPIO_PIN_INT FALL: FDET1 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET2_Pos                           2                                                         /*!< GPIO_PIN_INT FALL: FDET2 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET2_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET2_Pos)                   /*!< GPIO_PIN_INT FALL: FDET2 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET3_Pos                           3                                                         /*!< GPIO_PIN_INT FALL: FDET3 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET3_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET3_Pos)                   /*!< GPIO_PIN_INT FALL: FDET3 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET4_Pos                           4                                                         /*!< GPIO_PIN_INT FALL: FDET4 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET4_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET4_Pos)                   /*!< GPIO_PIN_INT FALL: FDET4 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET5_Pos                           5                                                         /*!< GPIO_PIN_INT FALL: FDET5 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET5_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET5_Pos)                   /*!< GPIO_PIN_INT FALL: FDET5 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET6_Pos                           6                                                         /*!< GPIO_PIN_INT FALL: FDET6 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET6_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET6_Pos)                   /*!< GPIO_PIN_INT FALL: FDET6 Mask       */\r
+#define GPIO_PIN_INT_FALL_FDET7_Pos                           7                                                         /*!< GPIO_PIN_INT FALL: FDET7 Position   */\r
+#define GPIO_PIN_INT_FALL_FDET7_Msk                           (0x01UL << GPIO_PIN_INT_FALL_FDET7_Pos)                   /*!< GPIO_PIN_INT FALL: FDET7 Mask       */\r
+\r
+// ------------------------------------  GPIO_PIN_INT_IST  ----------------------------------------\r
+#define GPIO_PIN_INT_IST_PSTAT0_Pos                           0                                                         /*!< GPIO_PIN_INT IST: PSTAT0 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT0_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT0_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT0 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT1_Pos                           1                                                         /*!< GPIO_PIN_INT IST: PSTAT1 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT1_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT1_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT1 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT2_Pos                           2                                                         /*!< GPIO_PIN_INT IST: PSTAT2 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT2_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT2_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT2 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT3_Pos                           3                                                         /*!< GPIO_PIN_INT IST: PSTAT3 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT3_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT3_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT3 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT4_Pos                           4                                                         /*!< GPIO_PIN_INT IST: PSTAT4 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT4_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT4_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT4 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT5_Pos                           5                                                         /*!< GPIO_PIN_INT IST: PSTAT5 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT5_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT5_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT5 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT6_Pos                           6                                                         /*!< GPIO_PIN_INT IST: PSTAT6 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT6_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT6_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT6 Mask       */\r
+#define GPIO_PIN_INT_IST_PSTAT7_Pos                           7                                                         /*!< GPIO_PIN_INT IST: PSTAT7 Position   */\r
+#define GPIO_PIN_INT_IST_PSTAT7_Msk                           (0x01UL << GPIO_PIN_INT_IST_PSTAT7_Pos)                   /*!< GPIO_PIN_INT IST: PSTAT7 Mask       */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                            GPIO_GROUP_INTn Position & Mask                           -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------  GPIO_GROUP_INTn_CTRL  --------------------------------------\r
+#define GPIO_GROUP_INTn_CTRL_INT_Pos                          0                                                         /*!< GPIO_GROUP_INTn CTRL: INT Position  */\r
+#define GPIO_GROUP_INTn_CTRL_INT_Msk                          (0x01UL << GPIO_GROUP_INTn_CTRL_INT_Pos)                  /*!< GPIO_GROUP_INTn CTRL: INT Mask      */\r
+#define GPIO_GROUP_INTn_CTRL_COMB_Pos                         1                                                         /*!< GPIO_GROUP_INTn CTRL: COMB Position */\r
+#define GPIO_GROUP_INTn_CTRL_COMB_Msk                         (0x01UL << GPIO_GROUP_INTn_CTRL_COMB_Pos)                 /*!< GPIO_GROUP_INTn CTRL: COMB Mask     */\r
+#define GPIO_GROUP_INTn_CTRL_TRIG_Pos                         2                                                         /*!< GPIO_GROUP_INTn CTRL: TRIG Position */\r
+#define GPIO_GROUP_INTn_CTRL_TRIG_Msk                         (0x01UL << GPIO_GROUP_INTn_CTRL_TRIG_Pos)                 /*!< GPIO_GROUP_INTn CTRL: TRIG Mask     */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL0  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL0: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL0: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL0: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL0_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL0_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL0: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL1  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL1: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL1: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL1: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL1_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL1_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL1: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL2  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL2: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL2: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL2: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL2_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL2_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL2: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL3  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL3: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL3: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL3: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL3_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL3_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL3: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL4  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL4: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL4: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL4: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL4_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL4_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL4: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL5  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL5: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL5: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL5: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL5_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL5_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL5: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL6  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL6: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL6: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL6: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL6_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL6_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL6: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_POL7  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_0_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_1_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_2_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_3_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_4_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_5_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_6_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_7_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_8_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_POL7: POL_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_9_Pos)           /*!< GPIO_GROUP_INTn PORT_POL7: POL_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_10_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_11_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_12_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_13_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_14_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_15_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_16_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_17_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_18_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_19_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_20_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_21_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_22_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_23_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_24_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_25_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_26_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_27_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_28_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_29_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_30_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_POL7: POL_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_POL7_POL_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_POL7_POL_31_Pos)          /*!< GPIO_GROUP_INTn PORT_POL7: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA0  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA0_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA0_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA0: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA1  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA1_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA1_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA1: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA2  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA2_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA2_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA2: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA3  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA3_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA3_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA3: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA4  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA4_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA4_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA4: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA5  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA5_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA5_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA5: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA6  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA6_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA6_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA6: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INTn_PORT_ENA7  -----------------------------------\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_0 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_0_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_0 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_1 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_1_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_1 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_2 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_2_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_2 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_3 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_3_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_3 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_4 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_4_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_4 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_5 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_5_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_5 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_6 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_6_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_6 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_7 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_7_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_7 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_8 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_8_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_8 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_9 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_9_Pos)           /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_9 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_10 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_10_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_10 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_11 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_11_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_11 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_12 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_12_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_12 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_13 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_13_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_13 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_14 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_14_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_14 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_15 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_15_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_15 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_16 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_16_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_16 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_17 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_17_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_17 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_18 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_18_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_18 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_19 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_19_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_19 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_20 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_20_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_20 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_21 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_21_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_21 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_22 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_22_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_22 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_23 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_23_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_23 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_24 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_24_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_24 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_25 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_25_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_25 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_26 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_26_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_26 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_27 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_27_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_27 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_28 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_28_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_28 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_29 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_29_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_29 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_30 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_30_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_30 Mask */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_31 Position */\r
+#define GPIO_GROUP_INTn_PORT_ENA7_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INTn_PORT_ENA7_ENA_31_Pos)          /*!< GPIO_GROUP_INTn PORT_ENA7: ENA_31 Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                            GPIO_GROUP_INT1 Position & Mask                           -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------  GPIO_GROUP_INT1_CTRL  --------------------------------------\r
+#define GPIO_GROUP_INT1_CTRL_INT_Pos                          0                                                         /*!< GPIO_GROUP_INT1 CTRL: INT Position  */\r
+#define GPIO_GROUP_INT1_CTRL_INT_Msk                          (0x01UL << GPIO_GROUP_INT1_CTRL_INT_Pos)                  /*!< GPIO_GROUP_INT1 CTRL: INT Mask      */\r
+#define GPIO_GROUP_INT1_CTRL_COMB_Pos                         1                                                         /*!< GPIO_GROUP_INT1 CTRL: COMB Position */\r
+#define GPIO_GROUP_INT1_CTRL_COMB_Msk                         (0x01UL << GPIO_GROUP_INT1_CTRL_COMB_Pos)                 /*!< GPIO_GROUP_INT1 CTRL: COMB Mask     */\r
+#define GPIO_GROUP_INT1_CTRL_TRIG_Pos                         2                                                         /*!< GPIO_GROUP_INT1 CTRL: TRIG Position */\r
+#define GPIO_GROUP_INT1_CTRL_TRIG_Msk                         (0x01UL << GPIO_GROUP_INT1_CTRL_TRIG_Pos)                 /*!< GPIO_GROUP_INT1 CTRL: TRIG Mask     */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL0  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL0: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL0: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL0: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL0_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL0_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL0: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL1  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL1: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL1: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL1: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL1_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL1_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL1: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL2  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL2: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL2: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL2: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL2_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL2_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL2: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL3  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL3: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL3: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL3: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL3_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL3_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL3: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL4  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL4: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL4: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL4: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL4_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL4_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL4: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL5  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL5: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL5: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL5: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL5_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL5_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL5: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL6  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL6: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL6: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL6: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL6_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL6_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL6: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_POL7  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_POL7: POL_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_POL7: POL_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_POL7: POL_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_POL7_POL_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_POL7_POL_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_POL7: POL_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA0  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA0_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA0_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA0: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA1  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA1_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA1_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA1: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA2  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA2_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA2_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA2: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA3  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA3_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA3_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA3: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA4  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA4_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA4_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA4: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA5  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA5_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA5_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA5: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA6  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA6_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA6_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA6: ENA_31 Mask */\r
+\r
+// --------------------------------  GPIO_GROUP_INT1_PORT_ENA7  -----------------------------------\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_0_Pos                   0                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_0 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_0_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_0_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_0 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_1_Pos                   1                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_1 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_1_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_1_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_1 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_2_Pos                   2                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_2 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_2_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_2_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_2 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_3_Pos                   3                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_3 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_3_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_3_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_3 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_4_Pos                   4                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_4 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_4_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_4_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_4 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_5_Pos                   5                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_5 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_5_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_5_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_5 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_6_Pos                   6                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_6 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_6_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_6_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_6 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_7_Pos                   7                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_7 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_7_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_7_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_7 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_8_Pos                   8                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_8 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_8_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_8_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_8 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_9_Pos                   9                                                         /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_9 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_9_Msk                   (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_9_Pos)           /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_9 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_10_Pos                  10                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_10 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_10_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_10_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_10 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_11_Pos                  11                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_11 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_11_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_11_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_11 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_12_Pos                  12                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_12 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_12_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_12_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_12 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_13_Pos                  13                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_13 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_13_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_13_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_13 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_14_Pos                  14                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_14 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_14_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_14_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_14 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_15_Pos                  15                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_15 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_15_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_15_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_15 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_16_Pos                  16                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_16 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_16_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_16_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_16 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_17_Pos                  17                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_17 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_17_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_17_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_17 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_18_Pos                  18                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_18 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_18_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_18_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_18 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_19_Pos                  19                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_19 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_19_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_19_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_19 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_20_Pos                  20                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_20 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_20_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_20_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_20 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_21_Pos                  21                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_21 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_21_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_21_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_21 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_22_Pos                  22                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_22 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_22_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_22_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_22 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_23_Pos                  23                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_23 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_23_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_23_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_23 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_24_Pos                  24                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_24 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_24_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_24_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_24 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_25_Pos                  25                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_25 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_25_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_25_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_25 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_26_Pos                  26                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_26 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_26_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_26_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_26 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_27_Pos                  27                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_27 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_27_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_27_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_27 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_28_Pos                  28                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_28 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_28_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_28_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_28 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_29_Pos                  29                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_29 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_29_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_29_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_29 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_30_Pos                  30                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_30 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_30_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_30_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_30 Mask */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_31_Pos                  31                                                        /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_31 Position */\r
+#define GPIO_GROUP_INT1_PORT_ENA7_ENA_31_Msk                  (0x01UL << GPIO_GROUP_INT1_PORT_ENA7_ENA_31_Pos)          /*!< GPIO_GROUP_INT1 PORT_ENA7: ENA_31 Mask */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 MCPWM Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  MCPWM_CON  -------------------------------------------\r
+#define MCPWM_CON_RUN0_Pos                                    0                                                         /*!< MCPWM CON: RUN0 Position            */\r
+#define MCPWM_CON_RUN0_Msk                                    (0x01UL << MCPWM_CON_RUN0_Pos)                            /*!< MCPWM CON: RUN0 Mask                */\r
+#define MCPWM_CON_CENTER0_Pos                                 1                                                         /*!< MCPWM CON: CENTER0 Position         */\r
+#define MCPWM_CON_CENTER0_Msk                                 (0x01UL << MCPWM_CON_CENTER0_Pos)                         /*!< MCPWM CON: CENTER0 Mask             */\r
+#define MCPWM_CON_POLA0_Pos                                   2                                                         /*!< MCPWM CON: POLA0 Position           */\r
+#define MCPWM_CON_POLA0_Msk                                   (0x01UL << MCPWM_CON_POLA0_Pos)                           /*!< MCPWM CON: POLA0 Mask               */\r
+#define MCPWM_CON_DTE0_Pos                                    3                                                         /*!< MCPWM CON: DTE0 Position            */\r
+#define MCPWM_CON_DTE0_Msk                                    (0x01UL << MCPWM_CON_DTE0_Pos)                            /*!< MCPWM CON: DTE0 Mask                */\r
+#define MCPWM_CON_DISUP0_Pos                                  4                                                         /*!< MCPWM CON: DISUP0 Position          */\r
+#define MCPWM_CON_DISUP0_Msk                                  (0x01UL << MCPWM_CON_DISUP0_Pos)                          /*!< MCPWM CON: DISUP0 Mask              */\r
+#define MCPWM_CON_RUN1_Pos                                    8                                                         /*!< MCPWM CON: RUN1 Position            */\r
+#define MCPWM_CON_RUN1_Msk                                    (0x01UL << MCPWM_CON_RUN1_Pos)                            /*!< MCPWM CON: RUN1 Mask                */\r
+#define MCPWM_CON_CENTER1_Pos                                 9                                                         /*!< MCPWM CON: CENTER1 Position         */\r
+#define MCPWM_CON_CENTER1_Msk                                 (0x01UL << MCPWM_CON_CENTER1_Pos)                         /*!< MCPWM CON: CENTER1 Mask             */\r
+#define MCPWM_CON_POLA1_Pos                                   10                                                        /*!< MCPWM CON: POLA1 Position           */\r
+#define MCPWM_CON_POLA1_Msk                                   (0x01UL << MCPWM_CON_POLA1_Pos)                           /*!< MCPWM CON: POLA1 Mask               */\r
+#define MCPWM_CON_DTE1_Pos                                    11                                                        /*!< MCPWM CON: DTE1 Position            */\r
+#define MCPWM_CON_DTE1_Msk                                    (0x01UL << MCPWM_CON_DTE1_Pos)                            /*!< MCPWM CON: DTE1 Mask                */\r
+#define MCPWM_CON_DISUP1_Pos                                  12                                                        /*!< MCPWM CON: DISUP1 Position          */\r
+#define MCPWM_CON_DISUP1_Msk                                  (0x01UL << MCPWM_CON_DISUP1_Pos)                          /*!< MCPWM CON: DISUP1 Mask              */\r
+#define MCPWM_CON_RUN2_Pos                                    16                                                        /*!< MCPWM CON: RUN2 Position            */\r
+#define MCPWM_CON_RUN2_Msk                                    (0x01UL << MCPWM_CON_RUN2_Pos)                            /*!< MCPWM CON: RUN2 Mask                */\r
+#define MCPWM_CON_CENTER2_Pos                                 17                                                        /*!< MCPWM CON: CENTER2 Position         */\r
+#define MCPWM_CON_CENTER2_Msk                                 (0x01UL << MCPWM_CON_CENTER2_Pos)                         /*!< MCPWM CON: CENTER2 Mask             */\r
+#define MCPWM_CON_POLA2_Pos                                   18                                                        /*!< MCPWM CON: POLA2 Position           */\r
+#define MCPWM_CON_POLA2_Msk                                   (0x01UL << MCPWM_CON_POLA2_Pos)                           /*!< MCPWM CON: POLA2 Mask               */\r
+#define MCPWM_CON_DTE2_Pos                                    19                                                        /*!< MCPWM CON: DTE2 Position            */\r
+#define MCPWM_CON_DTE2_Msk                                    (0x01UL << MCPWM_CON_DTE2_Pos)                            /*!< MCPWM CON: DTE2 Mask                */\r
+#define MCPWM_CON_DISUP2_Pos                                  20                                                        /*!< MCPWM CON: DISUP2 Position          */\r
+#define MCPWM_CON_DISUP2_Msk                                  (0x01UL << MCPWM_CON_DISUP2_Pos)                          /*!< MCPWM CON: DISUP2 Mask              */\r
+#define MCPWM_CON_INVBDC_Pos                                  29                                                        /*!< MCPWM CON: INVBDC Position          */\r
+#define MCPWM_CON_INVBDC_Msk                                  (0x01UL << MCPWM_CON_INVBDC_Pos)                          /*!< MCPWM CON: INVBDC Mask              */\r
+#define MCPWM_CON_ACMODE_Pos                                  30                                                        /*!< MCPWM CON: ACMODE Position          */\r
+#define MCPWM_CON_ACMODE_Msk                                  (0x01UL << MCPWM_CON_ACMODE_Pos)                          /*!< MCPWM CON: ACMODE Mask              */\r
+#define MCPWM_CON_DCMODE_Pos                                  31                                                        /*!< MCPWM CON: DCMODE Position          */\r
+#define MCPWM_CON_DCMODE_Msk                                  (0x01UL << MCPWM_CON_DCMODE_Pos)                          /*!< MCPWM CON: DCMODE Mask              */\r
+\r
+// --------------------------------------  MCPWM_CON_SET  -----------------------------------------\r
+#define MCPWM_CON_SET_RUN0_SET_Pos                            0                                                         /*!< MCPWM CON_SET: RUN0_SET Position    */\r
+#define MCPWM_CON_SET_RUN0_SET_Msk                            (0x01UL << MCPWM_CON_SET_RUN0_SET_Pos)                    /*!< MCPWM CON_SET: RUN0_SET Mask        */\r
+#define MCPWM_CON_SET_CENTER0_SET_Pos                         1                                                         /*!< MCPWM CON_SET: CENTER0_SET Position */\r
+#define MCPWM_CON_SET_CENTER0_SET_Msk                         (0x01UL << MCPWM_CON_SET_CENTER0_SET_Pos)                 /*!< MCPWM CON_SET: CENTER0_SET Mask     */\r
+#define MCPWM_CON_SET_POLA0_SET_Pos                           2                                                         /*!< MCPWM CON_SET: POLA0_SET Position   */\r
+#define MCPWM_CON_SET_POLA0_SET_Msk                           (0x01UL << MCPWM_CON_SET_POLA0_SET_Pos)                   /*!< MCPWM CON_SET: POLA0_SET Mask       */\r
+#define MCPWM_CON_SET_DTE0_SET_Pos                            3                                                         /*!< MCPWM CON_SET: DTE0_SET Position    */\r
+#define MCPWM_CON_SET_DTE0_SET_Msk                            (0x01UL << MCPWM_CON_SET_DTE0_SET_Pos)                    /*!< MCPWM CON_SET: DTE0_SET Mask        */\r
+#define MCPWM_CON_SET_DISUP0_SET_Pos                          4                                                         /*!< MCPWM CON_SET: DISUP0_SET Position  */\r
+#define MCPWM_CON_SET_DISUP0_SET_Msk                          (0x01UL << MCPWM_CON_SET_DISUP0_SET_Pos)                  /*!< MCPWM CON_SET: DISUP0_SET Mask      */\r
+#define MCPWM_CON_SET_RUN1_SET_Pos                            8                                                         /*!< MCPWM CON_SET: RUN1_SET Position    */\r
+#define MCPWM_CON_SET_RUN1_SET_Msk                            (0x01UL << MCPWM_CON_SET_RUN1_SET_Pos)                    /*!< MCPWM CON_SET: RUN1_SET Mask        */\r
+#define MCPWM_CON_SET_CENTER1_SET_Pos                         9                                                         /*!< MCPWM CON_SET: CENTER1_SET Position */\r
+#define MCPWM_CON_SET_CENTER1_SET_Msk                         (0x01UL << MCPWM_CON_SET_CENTER1_SET_Pos)                 /*!< MCPWM CON_SET: CENTER1_SET Mask     */\r
+#define MCPWM_CON_SET_POLA1_SET_Pos                           10                                                        /*!< MCPWM CON_SET: POLA1_SET Position   */\r
+#define MCPWM_CON_SET_POLA1_SET_Msk                           (0x01UL << MCPWM_CON_SET_POLA1_SET_Pos)                   /*!< MCPWM CON_SET: POLA1_SET Mask       */\r
+#define MCPWM_CON_SET_DTE1_SET_Pos                            11                                                        /*!< MCPWM CON_SET: DTE1_SET Position    */\r
+#define MCPWM_CON_SET_DTE1_SET_Msk                            (0x01UL << MCPWM_CON_SET_DTE1_SET_Pos)                    /*!< MCPWM CON_SET: DTE1_SET Mask        */\r
+#define MCPWM_CON_SET_DISUP1_SET_Pos                          12                                                        /*!< MCPWM CON_SET: DISUP1_SET Position  */\r
+#define MCPWM_CON_SET_DISUP1_SET_Msk                          (0x01UL << MCPWM_CON_SET_DISUP1_SET_Pos)                  /*!< MCPWM CON_SET: DISUP1_SET Mask      */\r
+#define MCPWM_CON_SET_RUN2_SET_Pos                            16                                                        /*!< MCPWM CON_SET: RUN2_SET Position    */\r
+#define MCPWM_CON_SET_RUN2_SET_Msk                            (0x01UL << MCPWM_CON_SET_RUN2_SET_Pos)                    /*!< MCPWM CON_SET: RUN2_SET Mask        */\r
+#define MCPWM_CON_SET_CENTER2_SET_Pos                         17                                                        /*!< MCPWM CON_SET: CENTER2_SET Position */\r
+#define MCPWM_CON_SET_CENTER2_SET_Msk                         (0x01UL << MCPWM_CON_SET_CENTER2_SET_Pos)                 /*!< MCPWM CON_SET: CENTER2_SET Mask     */\r
+#define MCPWM_CON_SET_POLA2_SET_Pos                           18                                                        /*!< MCPWM CON_SET: POLA2_SET Position   */\r
+#define MCPWM_CON_SET_POLA2_SET_Msk                           (0x01UL << MCPWM_CON_SET_POLA2_SET_Pos)                   /*!< MCPWM CON_SET: POLA2_SET Mask       */\r
+#define MCPWM_CON_SET_DTE2_SET_Pos                            19                                                        /*!< MCPWM CON_SET: DTE2_SET Position    */\r
+#define MCPWM_CON_SET_DTE2_SET_Msk                            (0x01UL << MCPWM_CON_SET_DTE2_SET_Pos)                    /*!< MCPWM CON_SET: DTE2_SET Mask        */\r
+#define MCPWM_CON_SET_DISUP2_SET_Pos                          20                                                        /*!< MCPWM CON_SET: DISUP2_SET Position  */\r
+#define MCPWM_CON_SET_DISUP2_SET_Msk                          (0x01UL << MCPWM_CON_SET_DISUP2_SET_Pos)                  /*!< MCPWM CON_SET: DISUP2_SET Mask      */\r
+#define MCPWM_CON_SET_INVBDC_SET_Pos                          29                                                        /*!< MCPWM CON_SET: INVBDC_SET Position  */\r
+#define MCPWM_CON_SET_INVBDC_SET_Msk                          (0x01UL << MCPWM_CON_SET_INVBDC_SET_Pos)                  /*!< MCPWM CON_SET: INVBDC_SET Mask      */\r
+#define MCPWM_CON_SET_ACMODE_SET_Pos                          30                                                        /*!< MCPWM CON_SET: ACMODE_SET Position  */\r
+#define MCPWM_CON_SET_ACMODE_SET_Msk                          (0x01UL << MCPWM_CON_SET_ACMODE_SET_Pos)                  /*!< MCPWM CON_SET: ACMODE_SET Mask      */\r
+#define MCPWM_CON_SET_DCMODE_SET_Pos                          31                                                        /*!< MCPWM CON_SET: DCMODE_SET Position  */\r
+#define MCPWM_CON_SET_DCMODE_SET_Msk                          (0x01UL << MCPWM_CON_SET_DCMODE_SET_Pos)                  /*!< MCPWM CON_SET: DCMODE_SET Mask      */\r
+\r
+// --------------------------------------  MCPWM_CON_CLR  -----------------------------------------\r
+#define MCPWM_CON_CLR_RUN0_CLR_Pos                            0                                                         /*!< MCPWM CON_CLR: RUN0_CLR Position    */\r
+#define MCPWM_CON_CLR_RUN0_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_RUN0_CLR_Pos)                    /*!< MCPWM CON_CLR: RUN0_CLR Mask        */\r
+#define MCPWM_CON_CLR_CENTER0_CLR_Pos                         1                                                         /*!< MCPWM CON_CLR: CENTER0_CLR Position */\r
+#define MCPWM_CON_CLR_CENTER0_CLR_Msk                         (0x01UL << MCPWM_CON_CLR_CENTER0_CLR_Pos)                 /*!< MCPWM CON_CLR: CENTER0_CLR Mask     */\r
+#define MCPWM_CON_CLR_POLA0_CLR_Pos                           2                                                         /*!< MCPWM CON_CLR: POLA0_CLR Position   */\r
+#define MCPWM_CON_CLR_POLA0_CLR_Msk                           (0x01UL << MCPWM_CON_CLR_POLA0_CLR_Pos)                   /*!< MCPWM CON_CLR: POLA0_CLR Mask       */\r
+#define MCPWM_CON_CLR_DTE0_CLR_Pos                            3                                                         /*!< MCPWM CON_CLR: DTE0_CLR Position    */\r
+#define MCPWM_CON_CLR_DTE0_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_DTE0_CLR_Pos)                    /*!< MCPWM CON_CLR: DTE0_CLR Mask        */\r
+#define MCPWM_CON_CLR_DISUP0_CLR_Pos                          4                                                         /*!< MCPWM CON_CLR: DISUP0_CLR Position  */\r
+#define MCPWM_CON_CLR_DISUP0_CLR_Msk                          (0x01UL << MCPWM_CON_CLR_DISUP0_CLR_Pos)                  /*!< MCPWM CON_CLR: DISUP0_CLR Mask      */\r
+#define MCPWM_CON_CLR_RUN1_CLR_Pos                            8                                                         /*!< MCPWM CON_CLR: RUN1_CLR Position    */\r
+#define MCPWM_CON_CLR_RUN1_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_RUN1_CLR_Pos)                    /*!< MCPWM CON_CLR: RUN1_CLR Mask        */\r
+#define MCPWM_CON_CLR_CENTER1_CLR_Pos                         9                                                         /*!< MCPWM CON_CLR: CENTER1_CLR Position */\r
+#define MCPWM_CON_CLR_CENTER1_CLR_Msk                         (0x01UL << MCPWM_CON_CLR_CENTER1_CLR_Pos)                 /*!< MCPWM CON_CLR: CENTER1_CLR Mask     */\r
+#define MCPWM_CON_CLR_POLA1_CLR_Pos                           10                                                        /*!< MCPWM CON_CLR: POLA1_CLR Position   */\r
+#define MCPWM_CON_CLR_POLA1_CLR_Msk                           (0x01UL << MCPWM_CON_CLR_POLA1_CLR_Pos)                   /*!< MCPWM CON_CLR: POLA1_CLR Mask       */\r
+#define MCPWM_CON_CLR_DTE1_CLR_Pos                            11                                                        /*!< MCPWM CON_CLR: DTE1_CLR Position    */\r
+#define MCPWM_CON_CLR_DTE1_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_DTE1_CLR_Pos)                    /*!< MCPWM CON_CLR: DTE1_CLR Mask        */\r
+#define MCPWM_CON_CLR_DISUP1_CLR_Pos                          12                                                        /*!< MCPWM CON_CLR: DISUP1_CLR Position  */\r
+#define MCPWM_CON_CLR_DISUP1_CLR_Msk                          (0x01UL << MCPWM_CON_CLR_DISUP1_CLR_Pos)                  /*!< MCPWM CON_CLR: DISUP1_CLR Mask      */\r
+#define MCPWM_CON_CLR_RUN2_CLR_Pos                            16                                                        /*!< MCPWM CON_CLR: RUN2_CLR Position    */\r
+#define MCPWM_CON_CLR_RUN2_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_RUN2_CLR_Pos)                    /*!< MCPWM CON_CLR: RUN2_CLR Mask        */\r
+#define MCPWM_CON_CLR_CENTER2_CLR_Pos                         17                                                        /*!< MCPWM CON_CLR: CENTER2_CLR Position */\r
+#define MCPWM_CON_CLR_CENTER2_CLR_Msk                         (0x01UL << MCPWM_CON_CLR_CENTER2_CLR_Pos)                 /*!< MCPWM CON_CLR: CENTER2_CLR Mask     */\r
+#define MCPWM_CON_CLR_POLA2_CLR_Pos                           18                                                        /*!< MCPWM CON_CLR: POLA2_CLR Position   */\r
+#define MCPWM_CON_CLR_POLA2_CLR_Msk                           (0x01UL << MCPWM_CON_CLR_POLA2_CLR_Pos)                   /*!< MCPWM CON_CLR: POLA2_CLR Mask       */\r
+#define MCPWM_CON_CLR_DTE2_CLR_Pos                            19                                                        /*!< MCPWM CON_CLR: DTE2_CLR Position    */\r
+#define MCPWM_CON_CLR_DTE2_CLR_Msk                            (0x01UL << MCPWM_CON_CLR_DTE2_CLR_Pos)                    /*!< MCPWM CON_CLR: DTE2_CLR Mask        */\r
+#define MCPWM_CON_CLR_DISUP2_CLR_Pos                          20                                                        /*!< MCPWM CON_CLR: DISUP2_CLR Position  */\r
+#define MCPWM_CON_CLR_DISUP2_CLR_Msk                          (0x01UL << MCPWM_CON_CLR_DISUP2_CLR_Pos)                  /*!< MCPWM CON_CLR: DISUP2_CLR Mask      */\r
+#define MCPWM_CON_CLR_INVBDC_CLR_Pos                          29                                                        /*!< MCPWM CON_CLR: INVBDC_CLR Position  */\r
+#define MCPWM_CON_CLR_INVBDC_CLR_Msk                          (0x01UL << MCPWM_CON_CLR_INVBDC_CLR_Pos)                  /*!< MCPWM CON_CLR: INVBDC_CLR Mask      */\r
+#define MCPWM_CON_CLR_ACMOD_CLR_Pos                           30                                                        /*!< MCPWM CON_CLR: ACMOD_CLR Position   */\r
+#define MCPWM_CON_CLR_ACMOD_CLR_Msk                           (0x01UL << MCPWM_CON_CLR_ACMOD_CLR_Pos)                   /*!< MCPWM CON_CLR: ACMOD_CLR Mask       */\r
+#define MCPWM_CON_CLR_DCMODE_CLR_Pos                          31                                                        /*!< MCPWM CON_CLR: DCMODE_CLR Position  */\r
+#define MCPWM_CON_CLR_DCMODE_CLR_Msk                          (0x01UL << MCPWM_CON_CLR_DCMODE_CLR_Pos)                  /*!< MCPWM CON_CLR: DCMODE_CLR Mask      */\r
+\r
+// --------------------------------------  MCPWM_CAPCON  ------------------------------------------\r
+#define MCPWM_CAPCON_CAP0MCI0_RE_Pos                          0                                                         /*!< MCPWM CAPCON: CAP0MCI0_RE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI0_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI0_RE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI0_RE Mask      */\r
+#define MCPWM_CAPCON_CAP0MCI0_FE_Pos                          1                                                         /*!< MCPWM CAPCON: CAP0MCI0_FE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI0_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI0_FE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI0_FE Mask      */\r
+#define MCPWM_CAPCON_CAP0MCI1_RE_Pos                          2                                                         /*!< MCPWM CAPCON: CAP0MCI1_RE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI1_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI1_RE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI1_RE Mask      */\r
+#define MCPWM_CAPCON_CAP0MCI1_FE_Pos                          3                                                         /*!< MCPWM CAPCON: CAP0MCI1_FE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI1_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI1_FE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI1_FE Mask      */\r
+#define MCPWM_CAPCON_CAP0MCI2_RE_Pos                          4                                                         /*!< MCPWM CAPCON: CAP0MCI2_RE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI2_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI2_RE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI2_RE Mask      */\r
+#define MCPWM_CAPCON_CAP0MCI2_FE_Pos                          5                                                         /*!< MCPWM CAPCON: CAP0MCI2_FE Position  */\r
+#define MCPWM_CAPCON_CAP0MCI2_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP0MCI2_FE_Pos)                  /*!< MCPWM CAPCON: CAP0MCI2_FE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI0_RE_Pos                          6                                                         /*!< MCPWM CAPCON: CAP1MCI0_RE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI0_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI0_RE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI0_RE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI0_FE_Pos                          7                                                         /*!< MCPWM CAPCON: CAP1MCI0_FE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI0_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI0_FE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI0_FE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI1_RE_Pos                          8                                                         /*!< MCPWM CAPCON: CAP1MCI1_RE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI1_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI1_RE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI1_RE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI1_FE_Pos                          9                                                         /*!< MCPWM CAPCON: CAP1MCI1_FE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI1_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI1_FE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI1_FE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI2_RE_Pos                          10                                                        /*!< MCPWM CAPCON: CAP1MCI2_RE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI2_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI2_RE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI2_RE Mask      */\r
+#define MCPWM_CAPCON_CAP1MCI2_FE_Pos                          11                                                        /*!< MCPWM CAPCON: CAP1MCI2_FE Position  */\r
+#define MCPWM_CAPCON_CAP1MCI2_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP1MCI2_FE_Pos)                  /*!< MCPWM CAPCON: CAP1MCI2_FE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI0_RE_Pos                          12                                                        /*!< MCPWM CAPCON: CAP2MCI0_RE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI0_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI0_RE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI0_RE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI0_FE_Pos                          13                                                        /*!< MCPWM CAPCON: CAP2MCI0_FE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI0_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI0_FE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI0_FE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI1_RE_Pos                          14                                                        /*!< MCPWM CAPCON: CAP2MCI1_RE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI1_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI1_RE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI1_RE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI1_FE_Pos                          15                                                        /*!< MCPWM CAPCON: CAP2MCI1_FE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI1_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI1_FE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI1_FE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI2_RE_Pos                          16                                                        /*!< MCPWM CAPCON: CAP2MCI2_RE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI2_RE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI2_RE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI2_RE Mask      */\r
+#define MCPWM_CAPCON_CAP2MCI2_FE_Pos                          17                                                        /*!< MCPWM CAPCON: CAP2MCI2_FE Position  */\r
+#define MCPWM_CAPCON_CAP2MCI2_FE_Msk                          (0x01UL << MCPWM_CAPCON_CAP2MCI2_FE_Pos)                  /*!< MCPWM CAPCON: CAP2MCI2_FE Mask      */\r
+#define MCPWM_CAPCON_RT0_Pos                                  18                                                        /*!< MCPWM CAPCON: RT0 Position          */\r
+#define MCPWM_CAPCON_RT0_Msk                                  (0x01UL << MCPWM_CAPCON_RT0_Pos)                          /*!< MCPWM CAPCON: RT0 Mask              */\r
+#define MCPWM_CAPCON_RT1_Pos                                  19                                                        /*!< MCPWM CAPCON: RT1 Position          */\r
+#define MCPWM_CAPCON_RT1_Msk                                  (0x01UL << MCPWM_CAPCON_RT1_Pos)                          /*!< MCPWM CAPCON: RT1 Mask              */\r
+#define MCPWM_CAPCON_RT2_Pos                                  20                                                        /*!< MCPWM CAPCON: RT2 Position          */\r
+#define MCPWM_CAPCON_RT2_Msk                                  (0x01UL << MCPWM_CAPCON_RT2_Pos)                          /*!< MCPWM CAPCON: RT2 Mask              */\r
+#define MCPWM_CAPCON_HNFCAP0_Pos                              21                                                        /*!< MCPWM CAPCON: HNFCAP0 Position      */\r
+#define MCPWM_CAPCON_HNFCAP0_Msk                              (0x01UL << MCPWM_CAPCON_HNFCAP0_Pos)                      /*!< MCPWM CAPCON: HNFCAP0 Mask          */\r
+#define MCPWM_CAPCON_HNFCAP1_Pos                              22                                                        /*!< MCPWM CAPCON: HNFCAP1 Position      */\r
+#define MCPWM_CAPCON_HNFCAP1_Msk                              (0x01UL << MCPWM_CAPCON_HNFCAP1_Pos)                      /*!< MCPWM CAPCON: HNFCAP1 Mask          */\r
+#define MCPWM_CAPCON_HNFCAP2_Pos                              23                                                        /*!< MCPWM CAPCON: HNFCAP2 Position      */\r
+#define MCPWM_CAPCON_HNFCAP2_Msk                              (0x01UL << MCPWM_CAPCON_HNFCAP2_Pos)                      /*!< MCPWM CAPCON: HNFCAP2 Mask          */\r
+\r
+// ------------------------------------  MCPWM_CAPCON_SET  ----------------------------------------\r
+#define MCPWM_CAPCON_SET_CAP0MCI0_RE_SET_Pos                  0                                                         /*!< MCPWM CAPCON_SET: CAP0MCI0_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI0_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI0_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI0_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP0MCI0_FE_SET_Pos                  1                                                         /*!< MCPWM CAPCON_SET: CAP0MCI0_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI0_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI0_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI0_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP0MCI1_RE_SET_Pos                  2                                                         /*!< MCPWM CAPCON_SET: CAP0MCI1_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI1_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI1_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI1_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP0MCI1_FE_SET_Pos                  3                                                         /*!< MCPWM CAPCON_SET: CAP0MCI1_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI1_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI1_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI1_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP0MCI2_RE_SET_Pos                  4                                                         /*!< MCPWM CAPCON_SET: CAP0MCI2_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI2_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI2_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI2_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP0MCI2_FE_SET_Pos                  5                                                         /*!< MCPWM CAPCON_SET: CAP0MCI2_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP0MCI2_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP0MCI2_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP0MCI2_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI0_RE_SET_Pos                  6                                                         /*!< MCPWM CAPCON_SET: CAP1MCI0_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI0_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI0_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI0_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI0_FE_SET_Pos                  7                                                         /*!< MCPWM CAPCON_SET: CAP1MCI0_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI0_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI0_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI0_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI1_RE_SET_Pos                  8                                                         /*!< MCPWM CAPCON_SET: CAP1MCI1_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI1_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI1_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI1_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI1_FE_SET_Pos                  9                                                         /*!< MCPWM CAPCON_SET: CAP1MCI1_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI1_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI1_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI1_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI2_RE_SET_Pos                  10                                                        /*!< MCPWM CAPCON_SET: CAP1MCI2_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI2_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI2_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI2_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP1MCI2_FE_SET_Pos                  11                                                        /*!< MCPWM CAPCON_SET: CAP1MCI2_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP1MCI2_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP1MCI2_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP1MCI2_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI0_RE_SET_Pos                  12                                                        /*!< MCPWM CAPCON_SET: CAP2MCI0_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI0_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI0_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI0_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI0_FE_SET_Pos                  13                                                        /*!< MCPWM CAPCON_SET: CAP2MCI0_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI0_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI0_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI0_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI1_RE_SET_Pos                  14                                                        /*!< MCPWM CAPCON_SET: CAP2MCI1_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI1_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI1_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI1_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI1_FE_SET_Pos                  15                                                        /*!< MCPWM CAPCON_SET: CAP2MCI1_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI1_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI1_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI1_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI2_RE_SET_Pos                  16                                                        /*!< MCPWM CAPCON_SET: CAP2MCI2_RE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI2_RE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI2_RE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI2_RE_SET Mask */\r
+#define MCPWM_CAPCON_SET_CAP2MCI2_FE_SET_Pos                  17                                                        /*!< MCPWM CAPCON_SET: CAP2MCI2_FE_SET Position */\r
+#define MCPWM_CAPCON_SET_CAP2MCI2_FE_SET_Msk                  (0x01UL << MCPWM_CAPCON_SET_CAP2MCI2_FE_SET_Pos)          /*!< MCPWM CAPCON_SET: CAP2MCI2_FE_SET Mask */\r
+#define MCPWM_CAPCON_SET_RT0_SET_Pos                          18                                                        /*!< MCPWM CAPCON_SET: RT0_SET Position  */\r
+#define MCPWM_CAPCON_SET_RT0_SET_Msk                          (0x01UL << MCPWM_CAPCON_SET_RT0_SET_Pos)                  /*!< MCPWM CAPCON_SET: RT0_SET Mask      */\r
+#define MCPWM_CAPCON_SET_RT1_SET_Pos                          19                                                        /*!< MCPWM CAPCON_SET: RT1_SET Position  */\r
+#define MCPWM_CAPCON_SET_RT1_SET_Msk                          (0x01UL << MCPWM_CAPCON_SET_RT1_SET_Pos)                  /*!< MCPWM CAPCON_SET: RT1_SET Mask      */\r
+#define MCPWM_CAPCON_SET_RT2_SET_Pos                          20                                                        /*!< MCPWM CAPCON_SET: RT2_SET Position  */\r
+#define MCPWM_CAPCON_SET_RT2_SET_Msk                          (0x01UL << MCPWM_CAPCON_SET_RT2_SET_Pos)                  /*!< MCPWM CAPCON_SET: RT2_SET Mask      */\r
+#define MCPWM_CAPCON_SET_HNFCAP0_SET_Pos                      21                                                        /*!< MCPWM CAPCON_SET: HNFCAP0_SET Position */\r
+#define MCPWM_CAPCON_SET_HNFCAP0_SET_Msk                      (0x01UL << MCPWM_CAPCON_SET_HNFCAP0_SET_Pos)              /*!< MCPWM CAPCON_SET: HNFCAP0_SET Mask  */\r
+#define MCPWM_CAPCON_SET_HNFCAP1_SET_Pos                      22                                                        /*!< MCPWM CAPCON_SET: HNFCAP1_SET Position */\r
+#define MCPWM_CAPCON_SET_HNFCAP1_SET_Msk                      (0x01UL << MCPWM_CAPCON_SET_HNFCAP1_SET_Pos)              /*!< MCPWM CAPCON_SET: HNFCAP1_SET Mask  */\r
+#define MCPWM_CAPCON_SET_HNFCAP2_SET_Pos                      23                                                        /*!< MCPWM CAPCON_SET: HNFCAP2_SET Position */\r
+#define MCPWM_CAPCON_SET_HNFCAP2_SET_Msk                      (0x01UL << MCPWM_CAPCON_SET_HNFCAP2_SET_Pos)              /*!< MCPWM CAPCON_SET: HNFCAP2_SET Mask  */\r
+\r
+// ------------------------------------  MCPWM_CAPCON_CLR  ----------------------------------------\r
+#define MCPWM_CAPCON_CLR_CAP0MCI0_RE_CLR_Pos                  0                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI0_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI0_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI0_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI0_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI0_FE_CLR_Pos                  1                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI0_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI0_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI0_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI0_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI1_RE_CLR_Pos                  2                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI1_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI1_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI1_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI1_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI1_FE_CLR_Pos                  3                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI1_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI1_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI1_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI1_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI2_RE_CLR_Pos                  4                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI2_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI2_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI2_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI2_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI2_FE_CLR_Pos                  5                                                         /*!< MCPWM CAPCON_CLR: CAP0MCI2_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP0MCI2_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP0MCI2_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP0MCI2_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI0_RE_CLR_Pos                  6                                                         /*!< MCPWM CAPCON_CLR: CAP1MCI0_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI0_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI0_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI0_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI0_FE_CLR_Pos                  7                                                         /*!< MCPWM CAPCON_CLR: CAP1MCI0_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI0_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI0_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI0_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI1_RE_CLR_Pos                  8                                                         /*!< MCPWM CAPCON_CLR: CAP1MCI1_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI1_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI1_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI1_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI1_FE_CLR_Pos                  9                                                         /*!< MCPWM CAPCON_CLR: CAP1MCI1_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI1_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI1_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI1_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI2_RE_CLR_Pos                  10                                                        /*!< MCPWM CAPCON_CLR: CAP1MCI2_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI2_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI2_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI2_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI2_FE_CLR_Pos                  11                                                        /*!< MCPWM CAPCON_CLR: CAP1MCI2_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP1MCI2_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP1MCI2_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP1MCI2_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI0_RE_CLR_Pos                  12                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI0_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI0_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI0_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI0_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI0_FE_CLR_Pos                  13                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI0_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI0_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI0_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI0_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI1_RE_CLR_Pos                  14                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI1_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI1_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI1_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI1_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI1_FE_CLR_Pos                  15                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI1_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI1_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI1_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI1_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI2_RE_CLR_Pos                  16                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI2_RE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI2_RE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI2_RE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI2_RE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI2_FE_CLR_Pos                  17                                                        /*!< MCPWM CAPCON_CLR: CAP2MCI2_FE_CLR Position */\r
+#define MCPWM_CAPCON_CLR_CAP2MCI2_FE_CLR_Msk                  (0x01UL << MCPWM_CAPCON_CLR_CAP2MCI2_FE_CLR_Pos)          /*!< MCPWM CAPCON_CLR: CAP2MCI2_FE_CLR Mask */\r
+#define MCPWM_CAPCON_CLR_RT0_CLR_Pos                          18                                                        /*!< MCPWM CAPCON_CLR: RT0_CLR Position  */\r
+#define MCPWM_CAPCON_CLR_RT0_CLR_Msk                          (0x01UL << MCPWM_CAPCON_CLR_RT0_CLR_Pos)                  /*!< MCPWM CAPCON_CLR: RT0_CLR Mask      */\r
+#define MCPWM_CAPCON_CLR_RT1_CLR_Pos                          19                                                        /*!< MCPWM CAPCON_CLR: RT1_CLR Position  */\r
+#define MCPWM_CAPCON_CLR_RT1_CLR_Msk                          (0x01UL << MCPWM_CAPCON_CLR_RT1_CLR_Pos)                  /*!< MCPWM CAPCON_CLR: RT1_CLR Mask      */\r
+#define MCPWM_CAPCON_CLR_RT2_CLR_Pos                          20                                                        /*!< MCPWM CAPCON_CLR: RT2_CLR Position  */\r
+#define MCPWM_CAPCON_CLR_RT2_CLR_Msk                          (0x01UL << MCPWM_CAPCON_CLR_RT2_CLR_Pos)                  /*!< MCPWM CAPCON_CLR: RT2_CLR Mask      */\r
+#define MCPWM_CAPCON_CLR_HNFCAP0_CLR_Pos                      21                                                        /*!< MCPWM CAPCON_CLR: HNFCAP0_CLR Position */\r
+#define MCPWM_CAPCON_CLR_HNFCAP0_CLR_Msk                      (0x01UL << MCPWM_CAPCON_CLR_HNFCAP0_CLR_Pos)              /*!< MCPWM CAPCON_CLR: HNFCAP0_CLR Mask  */\r
+#define MCPWM_CAPCON_CLR_HNFCAP1_CLR_Pos                      22                                                        /*!< MCPWM CAPCON_CLR: HNFCAP1_CLR Position */\r
+#define MCPWM_CAPCON_CLR_HNFCAP1_CLR_Msk                      (0x01UL << MCPWM_CAPCON_CLR_HNFCAP1_CLR_Pos)              /*!< MCPWM CAPCON_CLR: HNFCAP1_CLR Mask  */\r
+#define MCPWM_CAPCON_CLR_HNFCAP2_CLR_Pos                      23                                                        /*!< MCPWM CAPCON_CLR: HNFCAP2_CLR Position */\r
+#define MCPWM_CAPCON_CLR_HNFCAP2_CLR_Msk                      (0x01UL << MCPWM_CAPCON_CLR_HNFCAP2_CLR_Pos)              /*!< MCPWM CAPCON_CLR: HNFCAP2_CLR Mask  */\r
+\r
+// ----------------------------------------  MCPWM_TC0  -------------------------------------------\r
+#define MCPWM_TC0_MCTC_Pos                                    0                                                         /*!< MCPWM TC0: MCTC Position            */\r
+#define MCPWM_TC0_MCTC_Msk                                    (0xffffffffUL << MCPWM_TC0_MCTC_Pos)                      /*!< MCPWM TC0: MCTC Mask                */\r
+\r
+// ----------------------------------------  MCPWM_TC1  -------------------------------------------\r
+#define MCPWM_TC1_MCTC_Pos                                    0                                                         /*!< MCPWM TC1: MCTC Position            */\r
+#define MCPWM_TC1_MCTC_Msk                                    (0xffffffffUL << MCPWM_TC1_MCTC_Pos)                      /*!< MCPWM TC1: MCTC Mask                */\r
+\r
+// ----------------------------------------  MCPWM_TC2  -------------------------------------------\r
+#define MCPWM_TC2_MCTC_Pos                                    0                                                         /*!< MCPWM TC2: MCTC Position            */\r
+#define MCPWM_TC2_MCTC_Msk                                    (0xffffffffUL << MCPWM_TC2_MCTC_Pos)                      /*!< MCPWM TC2: MCTC Mask                */\r
+\r
+// ---------------------------------------  MCPWM_LIM0  -------------------------------------------\r
+#define MCPWM_LIM0_MCLIM_Pos                                  0                                                         /*!< MCPWM LIM0: MCLIM Position          */\r
+#define MCPWM_LIM0_MCLIM_Msk                                  (0xffffffffUL << MCPWM_LIM0_MCLIM_Pos)                    /*!< MCPWM LIM0: MCLIM Mask              */\r
+\r
+// ---------------------------------------  MCPWM_LIM1  -------------------------------------------\r
+#define MCPWM_LIM1_MCLIM_Pos                                  0                                                         /*!< MCPWM LIM1: MCLIM Position          */\r
+#define MCPWM_LIM1_MCLIM_Msk                                  (0xffffffffUL << MCPWM_LIM1_MCLIM_Pos)                    /*!< MCPWM LIM1: MCLIM Mask              */\r
+\r
+// ---------------------------------------  MCPWM_LIM2  -------------------------------------------\r
+#define MCPWM_LIM2_MCLIM_Pos                                  0                                                         /*!< MCPWM LIM2: MCLIM Position          */\r
+#define MCPWM_LIM2_MCLIM_Msk                                  (0xffffffffUL << MCPWM_LIM2_MCLIM_Pos)                    /*!< MCPWM LIM2: MCLIM Mask              */\r
+\r
+// ---------------------------------------  MCPWM_MAT0  -------------------------------------------\r
+#define MCPWM_MAT0_MCMAT_Pos                                  0                                                         /*!< MCPWM MAT0: MCMAT Position          */\r
+#define MCPWM_MAT0_MCMAT_Msk                                  (0xffffffffUL << MCPWM_MAT0_MCMAT_Pos)                    /*!< MCPWM MAT0: MCMAT Mask              */\r
+\r
+// ---------------------------------------  MCPWM_MAT1  -------------------------------------------\r
+#define MCPWM_MAT1_MCMAT_Pos                                  0                                                         /*!< MCPWM MAT1: MCMAT Position          */\r
+#define MCPWM_MAT1_MCMAT_Msk                                  (0xffffffffUL << MCPWM_MAT1_MCMAT_Pos)                    /*!< MCPWM MAT1: MCMAT Mask              */\r
+\r
+// ---------------------------------------  MCPWM_MAT2  -------------------------------------------\r
+#define MCPWM_MAT2_MCMAT_Pos                                  0                                                         /*!< MCPWM MAT2: MCMAT Position          */\r
+#define MCPWM_MAT2_MCMAT_Msk                                  (0xffffffffUL << MCPWM_MAT2_MCMAT_Pos)                    /*!< MCPWM MAT2: MCMAT Mask              */\r
+\r
+// ----------------------------------------  MCPWM_DT  --------------------------------------------\r
+#define MCPWM_DT_DT0_Pos                                      0                                                         /*!< MCPWM DT: DT0 Position              */\r
+#define MCPWM_DT_DT0_Msk                                      (0x000003ffUL << MCPWM_DT_DT0_Pos)                        /*!< MCPWM DT: DT0 Mask                  */\r
+#define MCPWM_DT_DT1_Pos                                      10                                                        /*!< MCPWM DT: DT1 Position              */\r
+#define MCPWM_DT_DT1_Msk                                      (0x000003ffUL << MCPWM_DT_DT1_Pos)                        /*!< MCPWM DT: DT1 Mask                  */\r
+#define MCPWM_DT_DT2_Pos                                      20                                                        /*!< MCPWM DT: DT2 Position              */\r
+#define MCPWM_DT_DT2_Msk                                      (0x000003ffUL << MCPWM_DT_DT2_Pos)                        /*!< MCPWM DT: DT2 Mask                  */\r
+\r
+// ----------------------------------------  MCPWM_CCP  -------------------------------------------\r
+#define MCPWM_CCP_CCPA0_Pos                                   0                                                         /*!< MCPWM CCP: CCPA0 Position           */\r
+#define MCPWM_CCP_CCPA0_Msk                                   (0x01UL << MCPWM_CCP_CCPA0_Pos)                           /*!< MCPWM CCP: CCPA0 Mask               */\r
+#define MCPWM_CCP_CCPB0_Pos                                   1                                                         /*!< MCPWM CCP: CCPB0 Position           */\r
+#define MCPWM_CCP_CCPB0_Msk                                   (0x01UL << MCPWM_CCP_CCPB0_Pos)                           /*!< MCPWM CCP: CCPB0 Mask               */\r
+#define MCPWM_CCP_CCPA1_Pos                                   2                                                         /*!< MCPWM CCP: CCPA1 Position           */\r
+#define MCPWM_CCP_CCPA1_Msk                                   (0x01UL << MCPWM_CCP_CCPA1_Pos)                           /*!< MCPWM CCP: CCPA1 Mask               */\r
+#define MCPWM_CCP_CCPB1_Pos                                   3                                                         /*!< MCPWM CCP: CCPB1 Position           */\r
+#define MCPWM_CCP_CCPB1_Msk                                   (0x01UL << MCPWM_CCP_CCPB1_Pos)                           /*!< MCPWM CCP: CCPB1 Mask               */\r
+#define MCPWM_CCP_CCPA2_Pos                                   4                                                         /*!< MCPWM CCP: CCPA2 Position           */\r
+#define MCPWM_CCP_CCPA2_Msk                                   (0x01UL << MCPWM_CCP_CCPA2_Pos)                           /*!< MCPWM CCP: CCPA2 Mask               */\r
+#define MCPWM_CCP_CCPB2_Pos                                   5                                                         /*!< MCPWM CCP: CCPB2 Position           */\r
+#define MCPWM_CCP_CCPB2_Msk                                   (0x01UL << MCPWM_CCP_CCPB2_Pos)                           /*!< MCPWM CCP: CCPB2 Mask               */\r
+\r
+// ---------------------------------------  MCPWM_CAP0  -------------------------------------------\r
+#define MCPWM_CAP0_CAP_Pos                                    0                                                         /*!< MCPWM CAP0: CAP Position            */\r
+#define MCPWM_CAP0_CAP_Msk                                    (0xffffffffUL << MCPWM_CAP0_CAP_Pos)                      /*!< MCPWM CAP0: CAP Mask                */\r
+\r
+// ---------------------------------------  MCPWM_CAP1  -------------------------------------------\r
+#define MCPWM_CAP1_CAP_Pos                                    0                                                         /*!< MCPWM CAP1: CAP Position            */\r
+#define MCPWM_CAP1_CAP_Msk                                    (0xffffffffUL << MCPWM_CAP1_CAP_Pos)                      /*!< MCPWM CAP1: CAP Mask                */\r
+\r
+// ---------------------------------------  MCPWM_CAP2  -------------------------------------------\r
+#define MCPWM_CAP2_CAP_Pos                                    0                                                         /*!< MCPWM CAP2: CAP Position            */\r
+#define MCPWM_CAP2_CAP_Msk                                    (0xffffffffUL << MCPWM_CAP2_CAP_Pos)                      /*!< MCPWM CAP2: CAP Mask                */\r
+\r
+// ---------------------------------------  MCPWM_INTEN  ------------------------------------------\r
+#define MCPWM_INTEN_ILIM0_Pos                                 0                                                         /*!< MCPWM INTEN: ILIM0 Position         */\r
+#define MCPWM_INTEN_ILIM0_Msk                                 (0x01UL << MCPWM_INTEN_ILIM0_Pos)                         /*!< MCPWM INTEN: ILIM0 Mask             */\r
+#define MCPWM_INTEN_IMAT0_Pos                                 1                                                         /*!< MCPWM INTEN: IMAT0 Position         */\r
+#define MCPWM_INTEN_IMAT0_Msk                                 (0x01UL << MCPWM_INTEN_IMAT0_Pos)                         /*!< MCPWM INTEN: IMAT0 Mask             */\r
+#define MCPWM_INTEN_ICAP0_Pos                                 2                                                         /*!< MCPWM INTEN: ICAP0 Position         */\r
+#define MCPWM_INTEN_ICAP0_Msk                                 (0x01UL << MCPWM_INTEN_ICAP0_Pos)                         /*!< MCPWM INTEN: ICAP0 Mask             */\r
+#define MCPWM_INTEN_ILIM1_Pos                                 4                                                         /*!< MCPWM INTEN: ILIM1 Position         */\r
+#define MCPWM_INTEN_ILIM1_Msk                                 (0x01UL << MCPWM_INTEN_ILIM1_Pos)                         /*!< MCPWM INTEN: ILIM1 Mask             */\r
+#define MCPWM_INTEN_IMAT1_Pos                                 5                                                         /*!< MCPWM INTEN: IMAT1 Position         */\r
+#define MCPWM_INTEN_IMAT1_Msk                                 (0x01UL << MCPWM_INTEN_IMAT1_Pos)                         /*!< MCPWM INTEN: IMAT1 Mask             */\r
+#define MCPWM_INTEN_ICAP1_Pos                                 6                                                         /*!< MCPWM INTEN: ICAP1 Position         */\r
+#define MCPWM_INTEN_ICAP1_Msk                                 (0x01UL << MCPWM_INTEN_ICAP1_Pos)                         /*!< MCPWM INTEN: ICAP1 Mask             */\r
+#define MCPWM_INTEN_ILIM2_Pos                                 8                                                         /*!< MCPWM INTEN: ILIM2 Position         */\r
+#define MCPWM_INTEN_ILIM2_Msk                                 (0x01UL << MCPWM_INTEN_ILIM2_Pos)                         /*!< MCPWM INTEN: ILIM2 Mask             */\r
+#define MCPWM_INTEN_IMAT2_Pos                                 9                                                         /*!< MCPWM INTEN: IMAT2 Position         */\r
+#define MCPWM_INTEN_IMAT2_Msk                                 (0x01UL << MCPWM_INTEN_IMAT2_Pos)                         /*!< MCPWM INTEN: IMAT2 Mask             */\r
+#define MCPWM_INTEN_ICAP2_Pos                                 10                                                        /*!< MCPWM INTEN: ICAP2 Position         */\r
+#define MCPWM_INTEN_ICAP2_Msk                                 (0x01UL << MCPWM_INTEN_ICAP2_Pos)                         /*!< MCPWM INTEN: ICAP2 Mask             */\r
+#define MCPWM_INTEN_ABORT_Pos                                 15                                                        /*!< MCPWM INTEN: ABORT Position         */\r
+#define MCPWM_INTEN_ABORT_Msk                                 (0x01UL << MCPWM_INTEN_ABORT_Pos)                         /*!< MCPWM INTEN: ABORT Mask             */\r
+\r
+// -------------------------------------  MCPWM_INTEN_SET  ----------------------------------------\r
+#define MCPWM_INTEN_SET_ILIM0_SET_Pos                         0                                                         /*!< MCPWM INTEN_SET: ILIM0_SET Position */\r
+#define MCPWM_INTEN_SET_ILIM0_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ILIM0_SET_Pos)                 /*!< MCPWM INTEN_SET: ILIM0_SET Mask     */\r
+#define MCPWM_INTEN_SET_IMAT0_SET_Pos                         1                                                         /*!< MCPWM INTEN_SET: IMAT0_SET Position */\r
+#define MCPWM_INTEN_SET_IMAT0_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_IMAT0_SET_Pos)                 /*!< MCPWM INTEN_SET: IMAT0_SET Mask     */\r
+#define MCPWM_INTEN_SET_ICAP0_SET_Pos                         2                                                         /*!< MCPWM INTEN_SET: ICAP0_SET Position */\r
+#define MCPWM_INTEN_SET_ICAP0_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ICAP0_SET_Pos)                 /*!< MCPWM INTEN_SET: ICAP0_SET Mask     */\r
+#define MCPWM_INTEN_SET_ILIM1_SET_Pos                         4                                                         /*!< MCPWM INTEN_SET: ILIM1_SET Position */\r
+#define MCPWM_INTEN_SET_ILIM1_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ILIM1_SET_Pos)                 /*!< MCPWM INTEN_SET: ILIM1_SET Mask     */\r
+#define MCPWM_INTEN_SET_IMAT1_SET_Pos                         5                                                         /*!< MCPWM INTEN_SET: IMAT1_SET Position */\r
+#define MCPWM_INTEN_SET_IMAT1_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_IMAT1_SET_Pos)                 /*!< MCPWM INTEN_SET: IMAT1_SET Mask     */\r
+#define MCPWM_INTEN_SET_ICAP1_SET_Pos                         6                                                         /*!< MCPWM INTEN_SET: ICAP1_SET Position */\r
+#define MCPWM_INTEN_SET_ICAP1_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ICAP1_SET_Pos)                 /*!< MCPWM INTEN_SET: ICAP1_SET Mask     */\r
+#define MCPWM_INTEN_SET_ILIM2_SET_Pos                         9                                                         /*!< MCPWM INTEN_SET: ILIM2_SET Position */\r
+#define MCPWM_INTEN_SET_ILIM2_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ILIM2_SET_Pos)                 /*!< MCPWM INTEN_SET: ILIM2_SET Mask     */\r
+#define MCPWM_INTEN_SET_IMAT2_SET_Pos                         10                                                        /*!< MCPWM INTEN_SET: IMAT2_SET Position */\r
+#define MCPWM_INTEN_SET_IMAT2_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_IMAT2_SET_Pos)                 /*!< MCPWM INTEN_SET: IMAT2_SET Mask     */\r
+#define MCPWM_INTEN_SET_ICAP2_SET_Pos                         11                                                        /*!< MCPWM INTEN_SET: ICAP2_SET Position */\r
+#define MCPWM_INTEN_SET_ICAP2_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ICAP2_SET_Pos)                 /*!< MCPWM INTEN_SET: ICAP2_SET Mask     */\r
+#define MCPWM_INTEN_SET_ABORT_SET_Pos                         15                                                        /*!< MCPWM INTEN_SET: ABORT_SET Position */\r
+#define MCPWM_INTEN_SET_ABORT_SET_Msk                         (0x01UL << MCPWM_INTEN_SET_ABORT_SET_Pos)                 /*!< MCPWM INTEN_SET: ABORT_SET Mask     */\r
+\r
+// -------------------------------------  MCPWM_INTEN_CLR  ----------------------------------------\r
+#define MCPWM_INTEN_CLR_ILIM0_CLR_Pos                         0                                                         /*!< MCPWM INTEN_CLR: ILIM0_CLR Position */\r
+#define MCPWM_INTEN_CLR_ILIM0_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ILIM0_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ILIM0_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_IMAT0_CLR_Pos                         1                                                         /*!< MCPWM INTEN_CLR: IMAT0_CLR Position */\r
+#define MCPWM_INTEN_CLR_IMAT0_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_IMAT0_CLR_Pos)                 /*!< MCPWM INTEN_CLR: IMAT0_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ICAP0_CLR_Pos                         2                                                         /*!< MCPWM INTEN_CLR: ICAP0_CLR Position */\r
+#define MCPWM_INTEN_CLR_ICAP0_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ICAP0_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ICAP0_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ILIM1_CLR_Pos                         4                                                         /*!< MCPWM INTEN_CLR: ILIM1_CLR Position */\r
+#define MCPWM_INTEN_CLR_ILIM1_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ILIM1_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ILIM1_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_IMAT1_CLR_Pos                         5                                                         /*!< MCPWM INTEN_CLR: IMAT1_CLR Position */\r
+#define MCPWM_INTEN_CLR_IMAT1_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_IMAT1_CLR_Pos)                 /*!< MCPWM INTEN_CLR: IMAT1_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ICAP1_CLR_Pos                         6                                                         /*!< MCPWM INTEN_CLR: ICAP1_CLR Position */\r
+#define MCPWM_INTEN_CLR_ICAP1_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ICAP1_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ICAP1_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ILIM2_CLR_Pos                         8                                                         /*!< MCPWM INTEN_CLR: ILIM2_CLR Position */\r
+#define MCPWM_INTEN_CLR_ILIM2_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ILIM2_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ILIM2_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_IMAT2_CLR_Pos                         9                                                         /*!< MCPWM INTEN_CLR: IMAT2_CLR Position */\r
+#define MCPWM_INTEN_CLR_IMAT2_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_IMAT2_CLR_Pos)                 /*!< MCPWM INTEN_CLR: IMAT2_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ICAP2_CLR_Pos                         10                                                        /*!< MCPWM INTEN_CLR: ICAP2_CLR Position */\r
+#define MCPWM_INTEN_CLR_ICAP2_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ICAP2_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ICAP2_CLR Mask     */\r
+#define MCPWM_INTEN_CLR_ABORT_CLR_Pos                         15                                                        /*!< MCPWM INTEN_CLR: ABORT_CLR Position */\r
+#define MCPWM_INTEN_CLR_ABORT_CLR_Msk                         (0x01UL << MCPWM_INTEN_CLR_ABORT_CLR_Pos)                 /*!< MCPWM INTEN_CLR: ABORT_CLR Mask     */\r
+\r
+// --------------------------------------  MCPWM_CNTCON  ------------------------------------------\r
+#define MCPWM_CNTCON_TC0MCI0_RE_Pos                           0                                                         /*!< MCPWM CNTCON: TC0MCI0_RE Position   */\r
+#define MCPWM_CNTCON_TC0MCI0_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI0_RE_Pos)                   /*!< MCPWM CNTCON: TC0MCI0_RE Mask       */\r
+#define MCPWM_CNTCON_TC0MCI0_FE_Pos                           1                                                         /*!< MCPWM CNTCON: TC0MCI0_FE Position   */\r
+#define MCPWM_CNTCON_TC0MCI0_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI0_FE_Pos)                   /*!< MCPWM CNTCON: TC0MCI0_FE Mask       */\r
+#define MCPWM_CNTCON_TC0MCI1_RE_Pos                           2                                                         /*!< MCPWM CNTCON: TC0MCI1_RE Position   */\r
+#define MCPWM_CNTCON_TC0MCI1_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI1_RE_Pos)                   /*!< MCPWM CNTCON: TC0MCI1_RE Mask       */\r
+#define MCPWM_CNTCON_TC0MCI1_FE_Pos                           3                                                         /*!< MCPWM CNTCON: TC0MCI1_FE Position   */\r
+#define MCPWM_CNTCON_TC0MCI1_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI1_FE_Pos)                   /*!< MCPWM CNTCON: TC0MCI1_FE Mask       */\r
+#define MCPWM_CNTCON_TC0MCI2_RE_Pos                           4                                                         /*!< MCPWM CNTCON: TC0MCI2_RE Position   */\r
+#define MCPWM_CNTCON_TC0MCI2_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI2_RE_Pos)                   /*!< MCPWM CNTCON: TC0MCI2_RE Mask       */\r
+#define MCPWM_CNTCON_TC0MCI2_FE_Pos                           5                                                         /*!< MCPWM CNTCON: TC0MCI2_FE Position   */\r
+#define MCPWM_CNTCON_TC0MCI2_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC0MCI2_FE_Pos)                   /*!< MCPWM CNTCON: TC0MCI2_FE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI0_RE_Pos                           6                                                         /*!< MCPWM CNTCON: TC1MCI0_RE Position   */\r
+#define MCPWM_CNTCON_TC1MCI0_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI0_RE_Pos)                   /*!< MCPWM CNTCON: TC1MCI0_RE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI0_FE_Pos                           7                                                         /*!< MCPWM CNTCON: TC1MCI0_FE Position   */\r
+#define MCPWM_CNTCON_TC1MCI0_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI0_FE_Pos)                   /*!< MCPWM CNTCON: TC1MCI0_FE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI1_RE_Pos                           8                                                         /*!< MCPWM CNTCON: TC1MCI1_RE Position   */\r
+#define MCPWM_CNTCON_TC1MCI1_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI1_RE_Pos)                   /*!< MCPWM CNTCON: TC1MCI1_RE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI1_FE_Pos                           9                                                         /*!< MCPWM CNTCON: TC1MCI1_FE Position   */\r
+#define MCPWM_CNTCON_TC1MCI1_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI1_FE_Pos)                   /*!< MCPWM CNTCON: TC1MCI1_FE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI2_RE_Pos                           10                                                        /*!< MCPWM CNTCON: TC1MCI2_RE Position   */\r
+#define MCPWM_CNTCON_TC1MCI2_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI2_RE_Pos)                   /*!< MCPWM CNTCON: TC1MCI2_RE Mask       */\r
+#define MCPWM_CNTCON_TC1MCI2_FE_Pos                           11                                                        /*!< MCPWM CNTCON: TC1MCI2_FE Position   */\r
+#define MCPWM_CNTCON_TC1MCI2_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC1MCI2_FE_Pos)                   /*!< MCPWM CNTCON: TC1MCI2_FE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI0_RE_Pos                           12                                                        /*!< MCPWM CNTCON: TC2MCI0_RE Position   */\r
+#define MCPWM_CNTCON_TC2MCI0_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI0_RE_Pos)                   /*!< MCPWM CNTCON: TC2MCI0_RE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI0_FE_Pos                           13                                                        /*!< MCPWM CNTCON: TC2MCI0_FE Position   */\r
+#define MCPWM_CNTCON_TC2MCI0_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI0_FE_Pos)                   /*!< MCPWM CNTCON: TC2MCI0_FE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI1_RE_Pos                           14                                                        /*!< MCPWM CNTCON: TC2MCI1_RE Position   */\r
+#define MCPWM_CNTCON_TC2MCI1_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI1_RE_Pos)                   /*!< MCPWM CNTCON: TC2MCI1_RE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI1_FE_Pos                           15                                                        /*!< MCPWM CNTCON: TC2MCI1_FE Position   */\r
+#define MCPWM_CNTCON_TC2MCI1_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI1_FE_Pos)                   /*!< MCPWM CNTCON: TC2MCI1_FE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI2_RE_Pos                           16                                                        /*!< MCPWM CNTCON: TC2MCI2_RE Position   */\r
+#define MCPWM_CNTCON_TC2MCI2_RE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI2_RE_Pos)                   /*!< MCPWM CNTCON: TC2MCI2_RE Mask       */\r
+#define MCPWM_CNTCON_TC2MCI2_FE_Pos                           17                                                        /*!< MCPWM CNTCON: TC2MCI2_FE Position   */\r
+#define MCPWM_CNTCON_TC2MCI2_FE_Msk                           (0x01UL << MCPWM_CNTCON_TC2MCI2_FE_Pos)                   /*!< MCPWM CNTCON: TC2MCI2_FE Mask       */\r
+#define MCPWM_CNTCON_CNTR0_Pos                                29                                                        /*!< MCPWM CNTCON: CNTR0 Position        */\r
+#define MCPWM_CNTCON_CNTR0_Msk                                (0x01UL << MCPWM_CNTCON_CNTR0_Pos)                        /*!< MCPWM CNTCON: CNTR0 Mask            */\r
+#define MCPWM_CNTCON_CNTR1_Pos                                30                                                        /*!< MCPWM CNTCON: CNTR1 Position        */\r
+#define MCPWM_CNTCON_CNTR1_Msk                                (0x01UL << MCPWM_CNTCON_CNTR1_Pos)                        /*!< MCPWM CNTCON: CNTR1 Mask            */\r
+#define MCPWM_CNTCON_CNTR2_Pos                                31                                                        /*!< MCPWM CNTCON: CNTR2 Position        */\r
+#define MCPWM_CNTCON_CNTR2_Msk                                (0x01UL << MCPWM_CNTCON_CNTR2_Pos)                        /*!< MCPWM CNTCON: CNTR2 Mask            */\r
+\r
+// ------------------------------------  MCPWM_CNTCON_SET  ----------------------------------------\r
+#define MCPWM_CNTCON_SET_TC0MCI0_RE_SET_Pos                   0                                                         /*!< MCPWM CNTCON_SET: TC0MCI0_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI0_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI0_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI0_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC0MCI0_FE_SET_Pos                   1                                                         /*!< MCPWM CNTCON_SET: TC0MCI0_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI0_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI0_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI0_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC0MCI1_RE_SET_Pos                   2                                                         /*!< MCPWM CNTCON_SET: TC0MCI1_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI1_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI1_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI1_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC0MCI1_FE_SET_Pos                   3                                                         /*!< MCPWM CNTCON_SET: TC0MCI1_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI1_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI1_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI1_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC0MCI2_RE_SET_Pos                   4                                                         /*!< MCPWM CNTCON_SET: TC0MCI2_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI2_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI2_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI2_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC0MCI2_FE_SET_Pos                   5                                                         /*!< MCPWM CNTCON_SET: TC0MCI2_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC0MCI2_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC0MCI2_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC0MCI2_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI0_RE_SET_Pos                   6                                                         /*!< MCPWM CNTCON_SET: TC1MCI0_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI0_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI0_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI0_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI0_FE_SET_Pos                   7                                                         /*!< MCPWM CNTCON_SET: TC1MCI0_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI0_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI0_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI0_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI1_RE_SET_Pos                   8                                                         /*!< MCPWM CNTCON_SET: TC1MCI1_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI1_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI1_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI1_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI1_FE_SET_Pos                   9                                                         /*!< MCPWM CNTCON_SET: TC1MCI1_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI1_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI1_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI1_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI2_RE_SET_Pos                   10                                                        /*!< MCPWM CNTCON_SET: TC1MCI2_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI2_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI2_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI2_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC1MCI2_FE_SET_Pos                   11                                                        /*!< MCPWM CNTCON_SET: TC1MCI2_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC1MCI2_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC1MCI2_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC1MCI2_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI0_RE_SET_Pos                   12                                                        /*!< MCPWM CNTCON_SET: TC2MCI0_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI0_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI0_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI0_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI0_FE_SET_Pos                   13                                                        /*!< MCPWM CNTCON_SET: TC2MCI0_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI0_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI0_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI0_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI1_RE_SET_Pos                   14                                                        /*!< MCPWM CNTCON_SET: TC2MCI1_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI1_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI1_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI1_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI1_FE_SET_Pos                   15                                                        /*!< MCPWM CNTCON_SET: TC2MCI1_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI1_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI1_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI1_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI2_RE_SET_Pos                   16                                                        /*!< MCPWM CNTCON_SET: TC2MCI2_RE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI2_RE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI2_RE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI2_RE_SET Mask */\r
+#define MCPWM_CNTCON_SET_TC2MCI2_FE_SET_Pos                   17                                                        /*!< MCPWM CNTCON_SET: TC2MCI2_FE_SET Position */\r
+#define MCPWM_CNTCON_SET_TC2MCI2_FE_SET_Msk                   (0x01UL << MCPWM_CNTCON_SET_TC2MCI2_FE_SET_Pos)           /*!< MCPWM CNTCON_SET: TC2MCI2_FE_SET Mask */\r
+#define MCPWM_CNTCON_SET_CNTR0_SET_Pos                        29                                                        /*!< MCPWM CNTCON_SET: CNTR0_SET Position */\r
+#define MCPWM_CNTCON_SET_CNTR0_SET_Msk                        (0x01UL << MCPWM_CNTCON_SET_CNTR0_SET_Pos)                /*!< MCPWM CNTCON_SET: CNTR0_SET Mask    */\r
+#define MCPWM_CNTCON_SET_CNTR1_SET_Pos                        30                                                        /*!< MCPWM CNTCON_SET: CNTR1_SET Position */\r
+#define MCPWM_CNTCON_SET_CNTR1_SET_Msk                        (0x01UL << MCPWM_CNTCON_SET_CNTR1_SET_Pos)                /*!< MCPWM CNTCON_SET: CNTR1_SET Mask    */\r
+#define MCPWM_CNTCON_SET_CNTR2_SET_Pos                        31                                                        /*!< MCPWM CNTCON_SET: CNTR2_SET Position */\r
+#define MCPWM_CNTCON_SET_CNTR2_SET_Msk                        (0x01UL << MCPWM_CNTCON_SET_CNTR2_SET_Pos)                /*!< MCPWM CNTCON_SET: CNTR2_SET Mask    */\r
+\r
+// ------------------------------------  MCPWM_CNTCON_CLR  ----------------------------------------\r
+#define MCPWM_CNTCON_CLR_TC0MCI0_RE_CLR_Pos                   0                                                         /*!< MCPWM CNTCON_CLR: TC0MCI0_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI0_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC0MCI0_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC0MCI0_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC0MCI0_FE_CLR_Pos                   1                                                         /*!< MCPWM CNTCON_CLR: TC0MCI0_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI0_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC0MCI0_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC0MCI0_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC0MCI1_RE_CLR_Pos                   2                                                         /*!< MCPWM CNTCON_CLR: TC0MCI1_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI1_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC0MCI1_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC0MCI1_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC0MCI1_FE_CLR_Pos                   3                                                         /*!< MCPWM CNTCON_CLR: TC0MCI1_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI1_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC0MCI1_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC0MCI1_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC0MCI2_RE_Pos                       4                                                         /*!< MCPWM CNTCON_CLR: TC0MCI2_RE Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI2_RE_Msk                       (0x01UL << MCPWM_CNTCON_CLR_TC0MCI2_RE_Pos)               /*!< MCPWM CNTCON_CLR: TC0MCI2_RE Mask   */\r
+#define MCPWM_CNTCON_CLR_TC0MCI2_FE_CLR_Pos                   5                                                         /*!< MCPWM CNTCON_CLR: TC0MCI2_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC0MCI2_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC0MCI2_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC0MCI2_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI0_RE_CLR_Pos                   6                                                         /*!< MCPWM CNTCON_CLR: TC1MCI0_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI0_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI0_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI0_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI0_FE_CLR_Pos                   7                                                         /*!< MCPWM CNTCON_CLR: TC1MCI0_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI0_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI0_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI0_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI1_RE_CLR_Pos                   8                                                         /*!< MCPWM CNTCON_CLR: TC1MCI1_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI1_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI1_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI1_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI1_FE_CLR_Pos                   9                                                         /*!< MCPWM CNTCON_CLR: TC1MCI1_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI1_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI1_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI1_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI2_RE_CLR_Pos                   10                                                        /*!< MCPWM CNTCON_CLR: TC1MCI2_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI2_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI2_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI2_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC1MCI2_FE_CLR_Pos                   11                                                        /*!< MCPWM CNTCON_CLR: TC1MCI2_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC1MCI2_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC1MCI2_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC1MCI2_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI0_RE_CLR_Pos                   12                                                        /*!< MCPWM CNTCON_CLR: TC2MCI0_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI0_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI0_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI0_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI0_FE_CLR_Pos                   13                                                        /*!< MCPWM CNTCON_CLR: TC2MCI0_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI0_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI0_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI0_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI1_RE_CLR_Pos                   14                                                        /*!< MCPWM CNTCON_CLR: TC2MCI1_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI1_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI1_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI1_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI1_FE_CLR_Pos                   15                                                        /*!< MCPWM CNTCON_CLR: TC2MCI1_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI1_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI1_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI1_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI2_RE_CLR_Pos                   16                                                        /*!< MCPWM CNTCON_CLR: TC2MCI2_RE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI2_RE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI2_RE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI2_RE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_TC2MCI2_FE_CLR_Pos                   17                                                        /*!< MCPWM CNTCON_CLR: TC2MCI2_FE_CLR Position */\r
+#define MCPWM_CNTCON_CLR_TC2MCI2_FE_CLR_Msk                   (0x01UL << MCPWM_CNTCON_CLR_TC2MCI2_FE_CLR_Pos)           /*!< MCPWM CNTCON_CLR: TC2MCI2_FE_CLR Mask */\r
+#define MCPWM_CNTCON_CLR_CNTR0_CLR_Pos                        29                                                        /*!< MCPWM CNTCON_CLR: CNTR0_CLR Position */\r
+#define MCPWM_CNTCON_CLR_CNTR0_CLR_Msk                        (0x01UL << MCPWM_CNTCON_CLR_CNTR0_CLR_Pos)                /*!< MCPWM CNTCON_CLR: CNTR0_CLR Mask    */\r
+#define MCPWM_CNTCON_CLR_CNTR1_CLR_Pos                        30                                                        /*!< MCPWM CNTCON_CLR: CNTR1_CLR Position */\r
+#define MCPWM_CNTCON_CLR_CNTR1_CLR_Msk                        (0x01UL << MCPWM_CNTCON_CLR_CNTR1_CLR_Pos)                /*!< MCPWM CNTCON_CLR: CNTR1_CLR Mask    */\r
+#define MCPWM_CNTCON_CLR_CNTR2_CLR_Pos                        31                                                        /*!< MCPWM CNTCON_CLR: CNTR2_CLR Position */\r
+#define MCPWM_CNTCON_CLR_CNTR2_CLR_Msk                        (0x01UL << MCPWM_CNTCON_CLR_CNTR2_CLR_Pos)                /*!< MCPWM CNTCON_CLR: CNTR2_CLR Mask    */\r
+\r
+// ---------------------------------------  MCPWM_INTF  -------------------------------------------\r
+#define MCPWM_INTF_ILIM0_F_Pos                                0                                                         /*!< MCPWM INTF: ILIM0_F Position        */\r
+#define MCPWM_INTF_ILIM0_F_Msk                                (0x01UL << MCPWM_INTF_ILIM0_F_Pos)                        /*!< MCPWM INTF: ILIM0_F Mask            */\r
+#define MCPWM_INTF_IMAT0_F_Pos                                1                                                         /*!< MCPWM INTF: IMAT0_F Position        */\r
+#define MCPWM_INTF_IMAT0_F_Msk                                (0x01UL << MCPWM_INTF_IMAT0_F_Pos)                        /*!< MCPWM INTF: IMAT0_F Mask            */\r
+#define MCPWM_INTF_ICAP0_F_Pos                                2                                                         /*!< MCPWM INTF: ICAP0_F Position        */\r
+#define MCPWM_INTF_ICAP0_F_Msk                                (0x01UL << MCPWM_INTF_ICAP0_F_Pos)                        /*!< MCPWM INTF: ICAP0_F Mask            */\r
+#define MCPWM_INTF_ILIM1_F_Pos                                4                                                         /*!< MCPWM INTF: ILIM1_F Position        */\r
+#define MCPWM_INTF_ILIM1_F_Msk                                (0x01UL << MCPWM_INTF_ILIM1_F_Pos)                        /*!< MCPWM INTF: ILIM1_F Mask            */\r
+#define MCPWM_INTF_IMAT1_F_Pos                                5                                                         /*!< MCPWM INTF: IMAT1_F Position        */\r
+#define MCPWM_INTF_IMAT1_F_Msk                                (0x01UL << MCPWM_INTF_IMAT1_F_Pos)                        /*!< MCPWM INTF: IMAT1_F Mask            */\r
+#define MCPWM_INTF_ICAP1_F_Pos                                6                                                         /*!< MCPWM INTF: ICAP1_F Position        */\r
+#define MCPWM_INTF_ICAP1_F_Msk                                (0x01UL << MCPWM_INTF_ICAP1_F_Pos)                        /*!< MCPWM INTF: ICAP1_F Mask            */\r
+#define MCPWM_INTF_ILIM2_F_Pos                                8                                                         /*!< MCPWM INTF: ILIM2_F Position        */\r
+#define MCPWM_INTF_ILIM2_F_Msk                                (0x01UL << MCPWM_INTF_ILIM2_F_Pos)                        /*!< MCPWM INTF: ILIM2_F Mask            */\r
+#define MCPWM_INTF_IMAT2_F_Pos                                9                                                         /*!< MCPWM INTF: IMAT2_F Position        */\r
+#define MCPWM_INTF_IMAT2_F_Msk                                (0x01UL << MCPWM_INTF_IMAT2_F_Pos)                        /*!< MCPWM INTF: IMAT2_F Mask            */\r
+#define MCPWM_INTF_ICAP2_F_Pos                                10                                                        /*!< MCPWM INTF: ICAP2_F Position        */\r
+#define MCPWM_INTF_ICAP2_F_Msk                                (0x01UL << MCPWM_INTF_ICAP2_F_Pos)                        /*!< MCPWM INTF: ICAP2_F Mask            */\r
+#define MCPWM_INTF_ABORT_F_Pos                                15                                                        /*!< MCPWM INTF: ABORT_F Position        */\r
+#define MCPWM_INTF_ABORT_F_Msk                                (0x01UL << MCPWM_INTF_ABORT_F_Pos)                        /*!< MCPWM INTF: ABORT_F Mask            */\r
+\r
+// -------------------------------------  MCPWM_INTF_SET  -----------------------------------------\r
+#define MCPWM_INTF_SET_ILIM0_F_SET_Pos                        0                                                         /*!< MCPWM INTF_SET: ILIM0_F_SET Position */\r
+#define MCPWM_INTF_SET_ILIM0_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ILIM0_F_SET_Pos)                /*!< MCPWM INTF_SET: ILIM0_F_SET Mask    */\r
+#define MCPWM_INTF_SET_IMAT0_F_SET_Pos                        1                                                         /*!< MCPWM INTF_SET: IMAT0_F_SET Position */\r
+#define MCPWM_INTF_SET_IMAT0_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_IMAT0_F_SET_Pos)                /*!< MCPWM INTF_SET: IMAT0_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ICAP0_F_SET_Pos                        2                                                         /*!< MCPWM INTF_SET: ICAP0_F_SET Position */\r
+#define MCPWM_INTF_SET_ICAP0_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ICAP0_F_SET_Pos)                /*!< MCPWM INTF_SET: ICAP0_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ILIM1_F_SET_Pos                        4                                                         /*!< MCPWM INTF_SET: ILIM1_F_SET Position */\r
+#define MCPWM_INTF_SET_ILIM1_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ILIM1_F_SET_Pos)                /*!< MCPWM INTF_SET: ILIM1_F_SET Mask    */\r
+#define MCPWM_INTF_SET_IMAT1_F_SET_Pos                        5                                                         /*!< MCPWM INTF_SET: IMAT1_F_SET Position */\r
+#define MCPWM_INTF_SET_IMAT1_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_IMAT1_F_SET_Pos)                /*!< MCPWM INTF_SET: IMAT1_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ICAP1_F_SET_Pos                        6                                                         /*!< MCPWM INTF_SET: ICAP1_F_SET Position */\r
+#define MCPWM_INTF_SET_ICAP1_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ICAP1_F_SET_Pos)                /*!< MCPWM INTF_SET: ICAP1_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ILIM2_F_SET_Pos                        8                                                         /*!< MCPWM INTF_SET: ILIM2_F_SET Position */\r
+#define MCPWM_INTF_SET_ILIM2_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ILIM2_F_SET_Pos)                /*!< MCPWM INTF_SET: ILIM2_F_SET Mask    */\r
+#define MCPWM_INTF_SET_IMAT2_F_SET_Pos                        9                                                         /*!< MCPWM INTF_SET: IMAT2_F_SET Position */\r
+#define MCPWM_INTF_SET_IMAT2_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_IMAT2_F_SET_Pos)                /*!< MCPWM INTF_SET: IMAT2_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ICAP2_F_SET_Pos                        10                                                        /*!< MCPWM INTF_SET: ICAP2_F_SET Position */\r
+#define MCPWM_INTF_SET_ICAP2_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ICAP2_F_SET_Pos)                /*!< MCPWM INTF_SET: ICAP2_F_SET Mask    */\r
+#define MCPWM_INTF_SET_ABORT_F_SET_Pos                        15                                                        /*!< MCPWM INTF_SET: ABORT_F_SET Position */\r
+#define MCPWM_INTF_SET_ABORT_F_SET_Msk                        (0x01UL << MCPWM_INTF_SET_ABORT_F_SET_Pos)                /*!< MCPWM INTF_SET: ABORT_F_SET Mask    */\r
+\r
+// -------------------------------------  MCPWM_INTF_CLR  -----------------------------------------\r
+#define MCPWM_INTF_CLR_ILIM0_F_CLR_Pos                        0                                                         /*!< MCPWM INTF_CLR: ILIM0_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ILIM0_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ILIM0_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ILIM0_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_IMAT0_F_CLR_Pos                        1                                                         /*!< MCPWM INTF_CLR: IMAT0_F_CLR Position */\r
+#define MCPWM_INTF_CLR_IMAT0_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_IMAT0_F_CLR_Pos)                /*!< MCPWM INTF_CLR: IMAT0_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ICAP0_F_CLR_Pos                        2                                                         /*!< MCPWM INTF_CLR: ICAP0_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ICAP0_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ICAP0_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ICAP0_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ILIM1_F_CLR_Pos                        4                                                         /*!< MCPWM INTF_CLR: ILIM1_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ILIM1_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ILIM1_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ILIM1_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_IMAT1_F_CLR_Pos                        5                                                         /*!< MCPWM INTF_CLR: IMAT1_F_CLR Position */\r
+#define MCPWM_INTF_CLR_IMAT1_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_IMAT1_F_CLR_Pos)                /*!< MCPWM INTF_CLR: IMAT1_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ICAP1_F_CLR_Pos                        6                                                         /*!< MCPWM INTF_CLR: ICAP1_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ICAP1_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ICAP1_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ICAP1_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ILIM2_F_CLR_Pos                        8                                                         /*!< MCPWM INTF_CLR: ILIM2_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ILIM2_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ILIM2_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ILIM2_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_IMAT2_F_CLR_Pos                        9                                                         /*!< MCPWM INTF_CLR: IMAT2_F_CLR Position */\r
+#define MCPWM_INTF_CLR_IMAT2_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_IMAT2_F_CLR_Pos)                /*!< MCPWM INTF_CLR: IMAT2_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ICAP2_F_CLR_Pos                        10                                                        /*!< MCPWM INTF_CLR: ICAP2_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ICAP2_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ICAP2_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ICAP2_F_CLR Mask    */\r
+#define MCPWM_INTF_CLR_ABORT_F_CLR_Pos                        15                                                        /*!< MCPWM INTF_CLR: ABORT_F_CLR Position */\r
+#define MCPWM_INTF_CLR_ABORT_F_CLR_Msk                        (0x01UL << MCPWM_INTF_CLR_ABORT_F_CLR_Pos)                /*!< MCPWM INTF_CLR: ABORT_F_CLR Mask    */\r
+\r
+// --------------------------------------  MCPWM_CAP_CLR  -----------------------------------------\r
+#define MCPWM_CAP_CLR_CAP_CLR0_Pos                            0                                                         /*!< MCPWM CAP_CLR: CAP_CLR0 Position    */\r
+#define MCPWM_CAP_CLR_CAP_CLR0_Msk                            (0x01UL << MCPWM_CAP_CLR_CAP_CLR0_Pos)                    /*!< MCPWM CAP_CLR: CAP_CLR0 Mask        */\r
+#define MCPWM_CAP_CLR_CAP_CLR1_Pos                            1                                                         /*!< MCPWM CAP_CLR: CAP_CLR1 Position    */\r
+#define MCPWM_CAP_CLR_CAP_CLR1_Msk                            (0x01UL << MCPWM_CAP_CLR_CAP_CLR1_Pos)                    /*!< MCPWM CAP_CLR: CAP_CLR1 Mask        */\r
+#define MCPWM_CAP_CLR_CAP_CLR2_Pos                            2                                                         /*!< MCPWM CAP_CLR: CAP_CLR2 Position    */\r
+#define MCPWM_CAP_CLR_CAP_CLR2_Msk                            (0x01UL << MCPWM_CAP_CLR_CAP_CLR2_Pos)                    /*!< MCPWM CAP_CLR: CAP_CLR2 Mask        */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 I2C0 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  I2C0_CONSET  ------------------------------------------\r
+#define I2C0_CONSET_AA_Pos                                    2                                                         /*!< I2C0 CONSET: AA Position            */\r
+#define I2C0_CONSET_AA_Msk                                    (0x01UL << I2C0_CONSET_AA_Pos)                            /*!< I2C0 CONSET: AA Mask                */\r
+#define I2C0_CONSET_SI_Pos                                    3                                                         /*!< I2C0 CONSET: SI Position            */\r
+#define I2C0_CONSET_SI_Msk                                    (0x01UL << I2C0_CONSET_SI_Pos)                            /*!< I2C0 CONSET: SI Mask                */\r
+#define I2C0_CONSET_STO_Pos                                   4                                                         /*!< I2C0 CONSET: STO Position           */\r
+#define I2C0_CONSET_STO_Msk                                   (0x01UL << I2C0_CONSET_STO_Pos)                           /*!< I2C0 CONSET: STO Mask               */\r
+#define I2C0_CONSET_STA_Pos                                   5                                                         /*!< I2C0 CONSET: STA Position           */\r
+#define I2C0_CONSET_STA_Msk                                   (0x01UL << I2C0_CONSET_STA_Pos)                           /*!< I2C0 CONSET: STA Mask               */\r
+#define I2C0_CONSET_I2EN_Pos                                  6                                                         /*!< I2C0 CONSET: I2EN Position          */\r
+#define I2C0_CONSET_I2EN_Msk                                  (0x01UL << I2C0_CONSET_I2EN_Pos)                          /*!< I2C0 CONSET: I2EN Mask              */\r
+\r
+// ----------------------------------------  I2C0_STAT  -------------------------------------------\r
+#define I2C0_STAT_Status_Pos                                  3                                                         /*!< I2C0 STAT: Status Position          */\r
+#define I2C0_STAT_Status_Msk                                  (0x1fUL << I2C0_STAT_Status_Pos)                          /*!< I2C0 STAT: Status Mask              */\r
+\r
+// ----------------------------------------  I2C0_DAT  --------------------------------------------\r
+#define I2C0_DAT_Data_Pos                                     0                                                         /*!< I2C0 DAT: Data Position             */\r
+#define I2C0_DAT_Data_Msk                                     (0x000000ffUL << I2C0_DAT_Data_Pos)                       /*!< I2C0 DAT: Data Mask                 */\r
+\r
+// ----------------------------------------  I2C0_ADR0  -------------------------------------------\r
+#define I2C0_ADR0_GC_Pos                                      0                                                         /*!< I2C0 ADR0: GC Position              */\r
+#define I2C0_ADR0_GC_Msk                                      (0x01UL << I2C0_ADR0_GC_Pos)                              /*!< I2C0 ADR0: GC Mask                  */\r
+#define I2C0_ADR0_Address_Pos                                 1                                                         /*!< I2C0 ADR0: Address Position         */\r
+#define I2C0_ADR0_Address_Msk                                 (0x7fUL << I2C0_ADR0_Address_Pos)                         /*!< I2C0 ADR0: Address Mask             */\r
+\r
+// ----------------------------------------  I2C0_SCLH  -------------------------------------------\r
+#define I2C0_SCLH_SCLH_Pos                                    0                                                         /*!< I2C0 SCLH: SCLH Position            */\r
+#define I2C0_SCLH_SCLH_Msk                                    (0x0000ffffUL << I2C0_SCLH_SCLH_Pos)                      /*!< I2C0 SCLH: SCLH Mask                */\r
+\r
+// ----------------------------------------  I2C0_SCLL  -------------------------------------------\r
+#define I2C0_SCLL_SCLL_Pos                                    0                                                         /*!< I2C0 SCLL: SCLL Position            */\r
+#define I2C0_SCLL_SCLL_Msk                                    (0x0000ffffUL << I2C0_SCLL_SCLL_Pos)                      /*!< I2C0 SCLL: SCLL Mask                */\r
+\r
+// ---------------------------------------  I2C0_CONCLR  ------------------------------------------\r
+#define I2C0_CONCLR_AAC_Pos                                   2                                                         /*!< I2C0 CONCLR: AAC Position           */\r
+#define I2C0_CONCLR_AAC_Msk                                   (0x01UL << I2C0_CONCLR_AAC_Pos)                           /*!< I2C0 CONCLR: AAC Mask               */\r
+#define I2C0_CONCLR_SIC_Pos                                   3                                                         /*!< I2C0 CONCLR: SIC Position           */\r
+#define I2C0_CONCLR_SIC_Msk                                   (0x01UL << I2C0_CONCLR_SIC_Pos)                           /*!< I2C0 CONCLR: SIC Mask               */\r
+#define I2C0_CONCLR_STAC_Pos                                  5                                                         /*!< I2C0 CONCLR: STAC Position          */\r
+#define I2C0_CONCLR_STAC_Msk                                  (0x01UL << I2C0_CONCLR_STAC_Pos)                          /*!< I2C0 CONCLR: STAC Mask              */\r
+#define I2C0_CONCLR_I2ENC_Pos                                 6                                                         /*!< I2C0 CONCLR: I2ENC Position         */\r
+#define I2C0_CONCLR_I2ENC_Msk                                 (0x01UL << I2C0_CONCLR_I2ENC_Pos)                         /*!< I2C0 CONCLR: I2ENC Mask             */\r
+\r
+// ---------------------------------------  I2C0_MMCTRL  ------------------------------------------\r
+#define I2C0_MMCTRL_MM_ENA_Pos                                0                                                         /*!< I2C0 MMCTRL: MM_ENA Position        */\r
+#define I2C0_MMCTRL_MM_ENA_Msk                                (0x01UL << I2C0_MMCTRL_MM_ENA_Pos)                        /*!< I2C0 MMCTRL: MM_ENA Mask            */\r
+#define I2C0_MMCTRL_ENA_SCL_Pos                               1                                                         /*!< I2C0 MMCTRL: ENA_SCL Position       */\r
+#define I2C0_MMCTRL_ENA_SCL_Msk                               (0x01UL << I2C0_MMCTRL_ENA_SCL_Pos)                       /*!< I2C0 MMCTRL: ENA_SCL Mask           */\r
+#define I2C0_MMCTRL_MATCH_ALL_Pos                             2                                                         /*!< I2C0 MMCTRL: MATCH_ALL Position     */\r
+#define I2C0_MMCTRL_MATCH_ALL_Msk                             (0x01UL << I2C0_MMCTRL_MATCH_ALL_Pos)                     /*!< I2C0 MMCTRL: MATCH_ALL Mask         */\r
+\r
+// ----------------------------------------  I2C0_ADR1  -------------------------------------------\r
+#define I2C0_ADR1_GC_Pos                                      0                                                         /*!< I2C0 ADR1: GC Position              */\r
+#define I2C0_ADR1_GC_Msk                                      (0x01UL << I2C0_ADR1_GC_Pos)                              /*!< I2C0 ADR1: GC Mask                  */\r
+#define I2C0_ADR1_Address_Pos                                 1                                                         /*!< I2C0 ADR1: Address Position         */\r
+#define I2C0_ADR1_Address_Msk                                 (0x7fUL << I2C0_ADR1_Address_Pos)                         /*!< I2C0 ADR1: Address Mask             */\r
+\r
+// ----------------------------------------  I2C0_ADR2  -------------------------------------------\r
+#define I2C0_ADR2_GC_Pos                                      0                                                         /*!< I2C0 ADR2: GC Position              */\r
+#define I2C0_ADR2_GC_Msk                                      (0x01UL << I2C0_ADR2_GC_Pos)                              /*!< I2C0 ADR2: GC Mask                  */\r
+#define I2C0_ADR2_Address_Pos                                 1                                                         /*!< I2C0 ADR2: Address Position         */\r
+#define I2C0_ADR2_Address_Msk                                 (0x7fUL << I2C0_ADR2_Address_Pos)                         /*!< I2C0 ADR2: Address Mask             */\r
+\r
+// ----------------------------------------  I2C0_ADR3  -------------------------------------------\r
+#define I2C0_ADR3_GC_Pos                                      0                                                         /*!< I2C0 ADR3: GC Position              */\r
+#define I2C0_ADR3_GC_Msk                                      (0x01UL << I2C0_ADR3_GC_Pos)                              /*!< I2C0 ADR3: GC Mask                  */\r
+#define I2C0_ADR3_Address_Pos                                 1                                                         /*!< I2C0 ADR3: Address Position         */\r
+#define I2C0_ADR3_Address_Msk                                 (0x7fUL << I2C0_ADR3_Address_Pos)                         /*!< I2C0 ADR3: Address Mask             */\r
+\r
+// ------------------------------------  I2C0_DATA_BUFFER  ----------------------------------------\r
+#define I2C0_DATA_BUFFER_Data_Pos                             0                                                         /*!< I2C0 DATA_BUFFER: Data Position     */\r
+#define I2C0_DATA_BUFFER_Data_Msk                             (0x000000ffUL << I2C0_DATA_BUFFER_Data_Pos)               /*!< I2C0 DATA_BUFFER: Data Mask         */\r
+\r
+// ---------------------------------------  I2C0_MASK0  -------------------------------------------\r
+#define I2C0_MASK0_MASK_Pos                                   1                                                         /*!< I2C0 MASK0: MASK Position           */\r
+#define I2C0_MASK0_MASK_Msk                                   (0x7fUL << I2C0_MASK0_MASK_Pos)                           /*!< I2C0 MASK0: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C0_MASK1  -------------------------------------------\r
+#define I2C0_MASK1_MASK_Pos                                   1                                                         /*!< I2C0 MASK1: MASK Position           */\r
+#define I2C0_MASK1_MASK_Msk                                   (0x7fUL << I2C0_MASK1_MASK_Pos)                           /*!< I2C0 MASK1: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C0_MASK2  -------------------------------------------\r
+#define I2C0_MASK2_MASK_Pos                                   1                                                         /*!< I2C0 MASK2: MASK Position           */\r
+#define I2C0_MASK2_MASK_Msk                                   (0x7fUL << I2C0_MASK2_MASK_Pos)                           /*!< I2C0 MASK2: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C0_MASK3  -------------------------------------------\r
+#define I2C0_MASK3_MASK_Pos                                   1                                                         /*!< I2C0 MASK3: MASK Position           */\r
+#define I2C0_MASK3_MASK_Msk                                   (0x7fUL << I2C0_MASK3_MASK_Pos)                           /*!< I2C0 MASK3: MASK Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 I2C1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  I2C1_CONSET  ------------------------------------------\r
+#define I2C1_CONSET_AA_Pos                                    2                                                         /*!< I2C1 CONSET: AA Position            */\r
+#define I2C1_CONSET_AA_Msk                                    (0x01UL << I2C1_CONSET_AA_Pos)                            /*!< I2C1 CONSET: AA Mask                */\r
+#define I2C1_CONSET_SI_Pos                                    3                                                         /*!< I2C1 CONSET: SI Position            */\r
+#define I2C1_CONSET_SI_Msk                                    (0x01UL << I2C1_CONSET_SI_Pos)                            /*!< I2C1 CONSET: SI Mask                */\r
+#define I2C1_CONSET_STO_Pos                                   4                                                         /*!< I2C1 CONSET: STO Position           */\r
+#define I2C1_CONSET_STO_Msk                                   (0x01UL << I2C1_CONSET_STO_Pos)                           /*!< I2C1 CONSET: STO Mask               */\r
+#define I2C1_CONSET_STA_Pos                                   5                                                         /*!< I2C1 CONSET: STA Position           */\r
+#define I2C1_CONSET_STA_Msk                                   (0x01UL << I2C1_CONSET_STA_Pos)                           /*!< I2C1 CONSET: STA Mask               */\r
+#define I2C1_CONSET_I2EN_Pos                                  6                                                         /*!< I2C1 CONSET: I2EN Position          */\r
+#define I2C1_CONSET_I2EN_Msk                                  (0x01UL << I2C1_CONSET_I2EN_Pos)                          /*!< I2C1 CONSET: I2EN Mask              */\r
+\r
+// ----------------------------------------  I2C1_STAT  -------------------------------------------\r
+#define I2C1_STAT_Status_Pos                                  3                                                         /*!< I2C1 STAT: Status Position          */\r
+#define I2C1_STAT_Status_Msk                                  (0x1fUL << I2C1_STAT_Status_Pos)                          /*!< I2C1 STAT: Status Mask              */\r
+\r
+// ----------------------------------------  I2C1_DAT  --------------------------------------------\r
+#define I2C1_DAT_Data_Pos                                     0                                                         /*!< I2C1 DAT: Data Position             */\r
+#define I2C1_DAT_Data_Msk                                     (0x000000ffUL << I2C1_DAT_Data_Pos)                       /*!< I2C1 DAT: Data Mask                 */\r
+\r
+// ----------------------------------------  I2C1_ADR0  -------------------------------------------\r
+#define I2C1_ADR0_GC_Pos                                      0                                                         /*!< I2C1 ADR0: GC Position              */\r
+#define I2C1_ADR0_GC_Msk                                      (0x01UL << I2C1_ADR0_GC_Pos)                              /*!< I2C1 ADR0: GC Mask                  */\r
+#define I2C1_ADR0_Address_Pos                                 1                                                         /*!< I2C1 ADR0: Address Position         */\r
+#define I2C1_ADR0_Address_Msk                                 (0x7fUL << I2C1_ADR0_Address_Pos)                         /*!< I2C1 ADR0: Address Mask             */\r
+\r
+// ----------------------------------------  I2C1_SCLH  -------------------------------------------\r
+#define I2C1_SCLH_SCLH_Pos                                    0                                                         /*!< I2C1 SCLH: SCLH Position            */\r
+#define I2C1_SCLH_SCLH_Msk                                    (0x0000ffffUL << I2C1_SCLH_SCLH_Pos)                      /*!< I2C1 SCLH: SCLH Mask                */\r
+\r
+// ----------------------------------------  I2C1_SCLL  -------------------------------------------\r
+#define I2C1_SCLL_SCLL_Pos                                    0                                                         /*!< I2C1 SCLL: SCLL Position            */\r
+#define I2C1_SCLL_SCLL_Msk                                    (0x0000ffffUL << I2C1_SCLL_SCLL_Pos)                      /*!< I2C1 SCLL: SCLL Mask                */\r
+\r
+// ---------------------------------------  I2C1_CONCLR  ------------------------------------------\r
+#define I2C1_CONCLR_AAC_Pos                                   2                                                         /*!< I2C1 CONCLR: AAC Position           */\r
+#define I2C1_CONCLR_AAC_Msk                                   (0x01UL << I2C1_CONCLR_AAC_Pos)                           /*!< I2C1 CONCLR: AAC Mask               */\r
+#define I2C1_CONCLR_SIC_Pos                                   3                                                         /*!< I2C1 CONCLR: SIC Position           */\r
+#define I2C1_CONCLR_SIC_Msk                                   (0x01UL << I2C1_CONCLR_SIC_Pos)                           /*!< I2C1 CONCLR: SIC Mask               */\r
+#define I2C1_CONCLR_STAC_Pos                                  5                                                         /*!< I2C1 CONCLR: STAC Position          */\r
+#define I2C1_CONCLR_STAC_Msk                                  (0x01UL << I2C1_CONCLR_STAC_Pos)                          /*!< I2C1 CONCLR: STAC Mask              */\r
+#define I2C1_CONCLR_I2ENC_Pos                                 6                                                         /*!< I2C1 CONCLR: I2ENC Position         */\r
+#define I2C1_CONCLR_I2ENC_Msk                                 (0x01UL << I2C1_CONCLR_I2ENC_Pos)                         /*!< I2C1 CONCLR: I2ENC Mask             */\r
+\r
+// ---------------------------------------  I2C1_MMCTRL  ------------------------------------------\r
+#define I2C1_MMCTRL_MM_ENA_Pos                                0                                                         /*!< I2C1 MMCTRL: MM_ENA Position        */\r
+#define I2C1_MMCTRL_MM_ENA_Msk                                (0x01UL << I2C1_MMCTRL_MM_ENA_Pos)                        /*!< I2C1 MMCTRL: MM_ENA Mask            */\r
+#define I2C1_MMCTRL_ENA_SCL_Pos                               1                                                         /*!< I2C1 MMCTRL: ENA_SCL Position       */\r
+#define I2C1_MMCTRL_ENA_SCL_Msk                               (0x01UL << I2C1_MMCTRL_ENA_SCL_Pos)                       /*!< I2C1 MMCTRL: ENA_SCL Mask           */\r
+#define I2C1_MMCTRL_MATCH_ALL_Pos                             2                                                         /*!< I2C1 MMCTRL: MATCH_ALL Position     */\r
+#define I2C1_MMCTRL_MATCH_ALL_Msk                             (0x01UL << I2C1_MMCTRL_MATCH_ALL_Pos)                     /*!< I2C1 MMCTRL: MATCH_ALL Mask         */\r
+\r
+// ----------------------------------------  I2C1_ADR1  -------------------------------------------\r
+#define I2C1_ADR1_GC_Pos                                      0                                                         /*!< I2C1 ADR1: GC Position              */\r
+#define I2C1_ADR1_GC_Msk                                      (0x01UL << I2C1_ADR1_GC_Pos)                              /*!< I2C1 ADR1: GC Mask                  */\r
+#define I2C1_ADR1_Address_Pos                                 1                                                         /*!< I2C1 ADR1: Address Position         */\r
+#define I2C1_ADR1_Address_Msk                                 (0x7fUL << I2C1_ADR1_Address_Pos)                         /*!< I2C1 ADR1: Address Mask             */\r
+\r
+// ----------------------------------------  I2C1_ADR2  -------------------------------------------\r
+#define I2C1_ADR2_GC_Pos                                      0                                                         /*!< I2C1 ADR2: GC Position              */\r
+#define I2C1_ADR2_GC_Msk                                      (0x01UL << I2C1_ADR2_GC_Pos)                              /*!< I2C1 ADR2: GC Mask                  */\r
+#define I2C1_ADR2_Address_Pos                                 1                                                         /*!< I2C1 ADR2: Address Position         */\r
+#define I2C1_ADR2_Address_Msk                                 (0x7fUL << I2C1_ADR2_Address_Pos)                         /*!< I2C1 ADR2: Address Mask             */\r
+\r
+// ----------------------------------------  I2C1_ADR3  -------------------------------------------\r
+#define I2C1_ADR3_GC_Pos                                      0                                                         /*!< I2C1 ADR3: GC Position              */\r
+#define I2C1_ADR3_GC_Msk                                      (0x01UL << I2C1_ADR3_GC_Pos)                              /*!< I2C1 ADR3: GC Mask                  */\r
+#define I2C1_ADR3_Address_Pos                                 1                                                         /*!< I2C1 ADR3: Address Position         */\r
+#define I2C1_ADR3_Address_Msk                                 (0x7fUL << I2C1_ADR3_Address_Pos)                         /*!< I2C1 ADR3: Address Mask             */\r
+\r
+// ------------------------------------  I2C1_DATA_BUFFER  ----------------------------------------\r
+#define I2C1_DATA_BUFFER_Data_Pos                             0                                                         /*!< I2C1 DATA_BUFFER: Data Position     */\r
+#define I2C1_DATA_BUFFER_Data_Msk                             (0x000000ffUL << I2C1_DATA_BUFFER_Data_Pos)               /*!< I2C1 DATA_BUFFER: Data Mask         */\r
+\r
+// ---------------------------------------  I2C1_MASK0  -------------------------------------------\r
+#define I2C1_MASK0_MASK_Pos                                   1                                                         /*!< I2C1 MASK0: MASK Position           */\r
+#define I2C1_MASK0_MASK_Msk                                   (0x7fUL << I2C1_MASK0_MASK_Pos)                           /*!< I2C1 MASK0: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C1_MASK1  -------------------------------------------\r
+#define I2C1_MASK1_MASK_Pos                                   1                                                         /*!< I2C1 MASK1: MASK Position           */\r
+#define I2C1_MASK1_MASK_Msk                                   (0x7fUL << I2C1_MASK1_MASK_Pos)                           /*!< I2C1 MASK1: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C1_MASK2  -------------------------------------------\r
+#define I2C1_MASK2_MASK_Pos                                   1                                                         /*!< I2C1 MASK2: MASK Position           */\r
+#define I2C1_MASK2_MASK_Msk                                   (0x7fUL << I2C1_MASK2_MASK_Pos)                           /*!< I2C1 MASK2: MASK Mask               */\r
+\r
+// ---------------------------------------  I2C1_MASK3  -------------------------------------------\r
+#define I2C1_MASK3_MASK_Pos                                   1                                                         /*!< I2C1 MASK3: MASK Position           */\r
+#define I2C1_MASK3_MASK_Msk                                   (0x7fUL << I2C1_MASK3_MASK_Pos)                           /*!< I2C1 MASK3: MASK Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 I2S0 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  I2S0_DAO  --------------------------------------------\r
+#define I2S0_DAO_WORDWIDTH_Pos                                0                                                         /*!< I2S0 DAO: WORDWIDTH Position        */\r
+#define I2S0_DAO_WORDWIDTH_Msk                                (0x03UL << I2S0_DAO_WORDWIDTH_Pos)                        /*!< I2S0 DAO: WORDWIDTH Mask            */\r
+#define I2S0_DAO_MONO_Pos                                     2                                                         /*!< I2S0 DAO: MONO Position             */\r
+#define I2S0_DAO_MONO_Msk                                     (0x01UL << I2S0_DAO_MONO_Pos)                             /*!< I2S0 DAO: MONO Mask                 */\r
+#define I2S0_DAO_STOP_Pos                                     3                                                         /*!< I2S0 DAO: STOP Position             */\r
+#define I2S0_DAO_STOP_Msk                                     (0x01UL << I2S0_DAO_STOP_Pos)                             /*!< I2S0 DAO: STOP Mask                 */\r
+#define I2S0_DAO_RESET_Pos                                    4                                                         /*!< I2S0 DAO: RESET Position            */\r
+#define I2S0_DAO_RESET_Msk                                    (0x01UL << I2S0_DAO_RESET_Pos)                            /*!< I2S0 DAO: RESET Mask                */\r
+#define I2S0_DAO_WS_SEL_Pos                                   5                                                         /*!< I2S0 DAO: WS_SEL Position           */\r
+#define I2S0_DAO_WS_SEL_Msk                                   (0x01UL << I2S0_DAO_WS_SEL_Pos)                           /*!< I2S0 DAO: WS_SEL Mask               */\r
+#define I2S0_DAO_WS_HALFPERIOD_Pos                            6                                                         /*!< I2S0 DAO: WS_HALFPERIOD Position    */\r
+#define I2S0_DAO_WS_HALFPERIOD_Msk                            (0x000001ffUL << I2S0_DAO_WS_HALFPERIOD_Pos)              /*!< I2S0 DAO: WS_HALFPERIOD Mask        */\r
+#define I2S0_DAO_MUTE_Pos                                     15                                                        /*!< I2S0 DAO: MUTE Position             */\r
+#define I2S0_DAO_MUTE_Msk                                     (0x01UL << I2S0_DAO_MUTE_Pos)                             /*!< I2S0 DAO: MUTE Mask                 */\r
+\r
+// ----------------------------------------  I2S0_DAI  --------------------------------------------\r
+#define I2S0_DAI_WORDWIDTH_Pos                                0                                                         /*!< I2S0 DAI: WORDWIDTH Position        */\r
+#define I2S0_DAI_WORDWIDTH_Msk                                (0x03UL << I2S0_DAI_WORDWIDTH_Pos)                        /*!< I2S0 DAI: WORDWIDTH Mask            */\r
+#define I2S0_DAI_MONO_Pos                                     2                                                         /*!< I2S0 DAI: MONO Position             */\r
+#define I2S0_DAI_MONO_Msk                                     (0x01UL << I2S0_DAI_MONO_Pos)                             /*!< I2S0 DAI: MONO Mask                 */\r
+#define I2S0_DAI_STOP_Pos                                     3                                                         /*!< I2S0 DAI: STOP Position             */\r
+#define I2S0_DAI_STOP_Msk                                     (0x01UL << I2S0_DAI_STOP_Pos)                             /*!< I2S0 DAI: STOP Mask                 */\r
+#define I2S0_DAI_RESET_Pos                                    4                                                         /*!< I2S0 DAI: RESET Position            */\r
+#define I2S0_DAI_RESET_Msk                                    (0x01UL << I2S0_DAI_RESET_Pos)                            /*!< I2S0 DAI: RESET Mask                */\r
+#define I2S0_DAI_WS_SEL_Pos                                   5                                                         /*!< I2S0 DAI: WS_SEL Position           */\r
+#define I2S0_DAI_WS_SEL_Msk                                   (0x01UL << I2S0_DAI_WS_SEL_Pos)                           /*!< I2S0 DAI: WS_SEL Mask               */\r
+#define I2S0_DAI_WS_HALFPERIOD_Pos                            6                                                         /*!< I2S0 DAI: WS_HALFPERIOD Position    */\r
+#define I2S0_DAI_WS_HALFPERIOD_Msk                            (0x000001ffUL << I2S0_DAI_WS_HALFPERIOD_Pos)              /*!< I2S0 DAI: WS_HALFPERIOD Mask        */\r
+\r
+// ---------------------------------------  I2S0_TXFIFO  ------------------------------------------\r
+#define I2S0_TXFIFO_I2STXFIFO_Pos                             0                                                         /*!< I2S0 TXFIFO: I2STXFIFO Position     */\r
+#define I2S0_TXFIFO_I2STXFIFO_Msk                             (0xffffffffUL << I2S0_TXFIFO_I2STXFIFO_Pos)               /*!< I2S0 TXFIFO: I2STXFIFO Mask         */\r
+\r
+// ---------------------------------------  I2S0_RXFIFO  ------------------------------------------\r
+#define I2S0_RXFIFO_I2SRXFIFO_Pos                             0                                                         /*!< I2S0 RXFIFO: I2SRXFIFO Position     */\r
+#define I2S0_RXFIFO_I2SRXFIFO_Msk                             (0xffffffffUL << I2S0_RXFIFO_I2SRXFIFO_Pos)               /*!< I2S0 RXFIFO: I2SRXFIFO Mask         */\r
+\r
+// ---------------------------------------  I2S0_STATE  -------------------------------------------\r
+#define I2S0_STATE_IRQ_Pos                                    0                                                         /*!< I2S0 STATE: IRQ Position            */\r
+#define I2S0_STATE_IRQ_Msk                                    (0x01UL << I2S0_STATE_IRQ_Pos)                            /*!< I2S0 STATE: IRQ Mask                */\r
+#define I2S0_STATE_DMAREQ1_Pos                                1                                                         /*!< I2S0 STATE: DMAREQ1 Position        */\r
+#define I2S0_STATE_DMAREQ1_Msk                                (0x01UL << I2S0_STATE_DMAREQ1_Pos)                        /*!< I2S0 STATE: DMAREQ1 Mask            */\r
+#define I2S0_STATE_DMAREQ2_Pos                                2                                                         /*!< I2S0 STATE: DMAREQ2 Position        */\r
+#define I2S0_STATE_DMAREQ2_Msk                                (0x01UL << I2S0_STATE_DMAREQ2_Pos)                        /*!< I2S0 STATE: DMAREQ2 Mask            */\r
+#define I2S0_STATE_RX_LEVEL_Pos                               8                                                         /*!< I2S0 STATE: RX_LEVEL Position       */\r
+#define I2S0_STATE_RX_LEVEL_Msk                               (0x0fUL << I2S0_STATE_RX_LEVEL_Pos)                       /*!< I2S0 STATE: RX_LEVEL Mask           */\r
+#define I2S0_STATE_TX_LEVEL_Pos                               16                                                        /*!< I2S0 STATE: TX_LEVEL Position       */\r
+#define I2S0_STATE_TX_LEVEL_Msk                               (0x0fUL << I2S0_STATE_TX_LEVEL_Pos)                       /*!< I2S0 STATE: TX_LEVEL Mask           */\r
+\r
+// ----------------------------------------  I2S0_DMA1  -------------------------------------------\r
+#define I2S0_DMA1_RX_DMA1_ENABLE_Pos                          0                                                         /*!< I2S0 DMA1: RX_DMA1_ENABLE Position  */\r
+#define I2S0_DMA1_RX_DMA1_ENABLE_Msk                          (0x01UL << I2S0_DMA1_RX_DMA1_ENABLE_Pos)                  /*!< I2S0 DMA1: RX_DMA1_ENABLE Mask      */\r
+#define I2S0_DMA1_TX_DMA1_ENABLE_Pos                          1                                                         /*!< I2S0 DMA1: TX_DMA1_ENABLE Position  */\r
+#define I2S0_DMA1_TX_DMA1_ENABLE_Msk                          (0x01UL << I2S0_DMA1_TX_DMA1_ENABLE_Pos)                  /*!< I2S0 DMA1: TX_DMA1_ENABLE Mask      */\r
+#define I2S0_DMA1_RX_DEPTH_DMA1_Pos                           8                                                         /*!< I2S0 DMA1: RX_DEPTH_DMA1 Position   */\r
+#define I2S0_DMA1_RX_DEPTH_DMA1_Msk                           (0x0fUL << I2S0_DMA1_RX_DEPTH_DMA1_Pos)                   /*!< I2S0 DMA1: RX_DEPTH_DMA1 Mask       */\r
+#define I2S0_DMA1_TX_DEPTH_DMA1_Pos                           16                                                        /*!< I2S0 DMA1: TX_DEPTH_DMA1 Position   */\r
+#define I2S0_DMA1_TX_DEPTH_DMA1_Msk                           (0x0fUL << I2S0_DMA1_TX_DEPTH_DMA1_Pos)                   /*!< I2S0 DMA1: TX_DEPTH_DMA1 Mask       */\r
+\r
+// ----------------------------------------  I2S0_DMA2  -------------------------------------------\r
+#define I2S0_DMA2_RX_DMA2_ENABLE_Pos                          0                                                         /*!< I2S0 DMA2: RX_DMA2_ENABLE Position  */\r
+#define I2S0_DMA2_RX_DMA2_ENABLE_Msk                          (0x01UL << I2S0_DMA2_RX_DMA2_ENABLE_Pos)                  /*!< I2S0 DMA2: RX_DMA2_ENABLE Mask      */\r
+#define I2S0_DMA2_TX_DMA2_ENABLE_Pos                          1                                                         /*!< I2S0 DMA2: TX_DMA2_ENABLE Position  */\r
+#define I2S0_DMA2_TX_DMA2_ENABLE_Msk                          (0x01UL << I2S0_DMA2_TX_DMA2_ENABLE_Pos)                  /*!< I2S0 DMA2: TX_DMA2_ENABLE Mask      */\r
+#define I2S0_DMA2_RX_DEPTH_DMA2_Pos                           8                                                         /*!< I2S0 DMA2: RX_DEPTH_DMA2 Position   */\r
+#define I2S0_DMA2_RX_DEPTH_DMA2_Msk                           (0x0fUL << I2S0_DMA2_RX_DEPTH_DMA2_Pos)                   /*!< I2S0 DMA2: RX_DEPTH_DMA2 Mask       */\r
+#define I2S0_DMA2_TX_DEPTH_DMA2_Pos                           16                                                        /*!< I2S0 DMA2: TX_DEPTH_DMA2 Position   */\r
+#define I2S0_DMA2_TX_DEPTH_DMA2_Msk                           (0x0fUL << I2S0_DMA2_TX_DEPTH_DMA2_Pos)                   /*!< I2S0 DMA2: TX_DEPTH_DMA2 Mask       */\r
+\r
+// ----------------------------------------  I2S0_IRQ  --------------------------------------------\r
+#define I2S0_IRQ_RX_IRQ_ENABLE_Pos                            0                                                         /*!< I2S0 IRQ: RX_IRQ_ENABLE Position    */\r
+#define I2S0_IRQ_RX_IRQ_ENABLE_Msk                            (0x01UL << I2S0_IRQ_RX_IRQ_ENABLE_Pos)                    /*!< I2S0 IRQ: RX_IRQ_ENABLE Mask        */\r
+#define I2S0_IRQ_TX_IRQ_ENABLE_Pos                            1                                                         /*!< I2S0 IRQ: TX_IRQ_ENABLE Position    */\r
+#define I2S0_IRQ_TX_IRQ_ENABLE_Msk                            (0x01UL << I2S0_IRQ_TX_IRQ_ENABLE_Pos)                    /*!< I2S0 IRQ: TX_IRQ_ENABLE Mask        */\r
+#define I2S0_IRQ_RX_DEPTH_IRQ_Pos                             8                                                         /*!< I2S0 IRQ: RX_DEPTH_IRQ Position     */\r
+#define I2S0_IRQ_RX_DEPTH_IRQ_Msk                             (0x0fUL << I2S0_IRQ_RX_DEPTH_IRQ_Pos)                     /*!< I2S0 IRQ: RX_DEPTH_IRQ Mask         */\r
+#define I2S0_IRQ_TX_DEPTH_IRQ_Pos                             16                                                        /*!< I2S0 IRQ: TX_DEPTH_IRQ Position     */\r
+#define I2S0_IRQ_TX_DEPTH_IRQ_Msk                             (0x0fUL << I2S0_IRQ_TX_DEPTH_IRQ_Pos)                     /*!< I2S0 IRQ: TX_DEPTH_IRQ Mask         */\r
+\r
+// ---------------------------------------  I2S0_TXRATE  ------------------------------------------\r
+#define I2S0_TXRATE_Y_DIVIDER_Pos                             0                                                         /*!< I2S0 TXRATE: Y_DIVIDER Position     */\r
+#define I2S0_TXRATE_Y_DIVIDER_Msk                             (0x000000ffUL << I2S0_TXRATE_Y_DIVIDER_Pos)               /*!< I2S0 TXRATE: Y_DIVIDER Mask         */\r
+#define I2S0_TXRATE_X_DIVIDER_Pos                             8                                                         /*!< I2S0 TXRATE: X_DIVIDER Position     */\r
+#define I2S0_TXRATE_X_DIVIDER_Msk                             (0x000000ffUL << I2S0_TXRATE_X_DIVIDER_Pos)               /*!< I2S0 TXRATE: X_DIVIDER Mask         */\r
+\r
+// ---------------------------------------  I2S0_RXRATE  ------------------------------------------\r
+#define I2S0_RXRATE_Y_DIVIDER_Pos                             0                                                         /*!< I2S0 RXRATE: Y_DIVIDER Position     */\r
+#define I2S0_RXRATE_Y_DIVIDER_Msk                             (0x000000ffUL << I2S0_RXRATE_Y_DIVIDER_Pos)               /*!< I2S0 RXRATE: Y_DIVIDER Mask         */\r
+#define I2S0_RXRATE_X_DIVIDER_Pos                             8                                                         /*!< I2S0 RXRATE: X_DIVIDER Position     */\r
+#define I2S0_RXRATE_X_DIVIDER_Msk                             (0x000000ffUL << I2S0_RXRATE_X_DIVIDER_Pos)               /*!< I2S0 RXRATE: X_DIVIDER Mask         */\r
+\r
+// -------------------------------------  I2S0_TXBITRATE  -----------------------------------------\r
+#define I2S0_TXBITRATE_TX_BITRATE_Pos                         0                                                         /*!< I2S0 TXBITRATE: TX_BITRATE Position */\r
+#define I2S0_TXBITRATE_TX_BITRATE_Msk                         (0x3fUL << I2S0_TXBITRATE_TX_BITRATE_Pos)                 /*!< I2S0 TXBITRATE: TX_BITRATE Mask     */\r
+\r
+// -------------------------------------  I2S0_RXBITRATE  -----------------------------------------\r
+#define I2S0_RXBITRATE_RX_BITRATE_Pos                         0                                                         /*!< I2S0 RXBITRATE: RX_BITRATE Position */\r
+#define I2S0_RXBITRATE_RX_BITRATE_Msk                         (0x3fUL << I2S0_RXBITRATE_RX_BITRATE_Pos)                 /*!< I2S0 RXBITRATE: RX_BITRATE Mask     */\r
+\r
+// ---------------------------------------  I2S0_TXMODE  ------------------------------------------\r
+#define I2S0_TXMODE_TXCLKSEL_Pos                              0                                                         /*!< I2S0 TXMODE: TXCLKSEL Position      */\r
+#define I2S0_TXMODE_TXCLKSEL_Msk                              (0x03UL << I2S0_TXMODE_TXCLKSEL_Pos)                      /*!< I2S0 TXMODE: TXCLKSEL Mask          */\r
+#define I2S0_TXMODE_TX4PIN_Pos                                2                                                         /*!< I2S0 TXMODE: TX4PIN Position        */\r
+#define I2S0_TXMODE_TX4PIN_Msk                                (0x01UL << I2S0_TXMODE_TX4PIN_Pos)                        /*!< I2S0 TXMODE: TX4PIN Mask            */\r
+#define I2S0_TXMODE_TXMCENA_Pos                               3                                                         /*!< I2S0 TXMODE: TXMCENA Position       */\r
+#define I2S0_TXMODE_TXMCENA_Msk                               (0x01UL << I2S0_TXMODE_TXMCENA_Pos)                       /*!< I2S0 TXMODE: TXMCENA Mask           */\r
+\r
+// ---------------------------------------  I2S0_RXMODE  ------------------------------------------\r
+#define I2S0_RXMODE_RXCLKSEL_Pos                              0                                                         /*!< I2S0 RXMODE: RXCLKSEL Position      */\r
+#define I2S0_RXMODE_RXCLKSEL_Msk                              (0x03UL << I2S0_RXMODE_RXCLKSEL_Pos)                      /*!< I2S0 RXMODE: RXCLKSEL Mask          */\r
+#define I2S0_RXMODE_RX4PIN_Pos                                2                                                         /*!< I2S0 RXMODE: RX4PIN Position        */\r
+#define I2S0_RXMODE_RX4PIN_Msk                                (0x01UL << I2S0_RXMODE_RX4PIN_Pos)                        /*!< I2S0 RXMODE: RX4PIN Mask            */\r
+#define I2S0_RXMODE_RXMCENA_Pos                               3                                                         /*!< I2S0 RXMODE: RXMCENA Position       */\r
+#define I2S0_RXMODE_RXMCENA_Msk                               (0x01UL << I2S0_RXMODE_RXMCENA_Pos)                       /*!< I2S0 RXMODE: RXMCENA Mask           */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 I2S1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ----------------------------------------  I2S1_DAO  --------------------------------------------\r
+#define I2S1_DAO_WORDWIDTH_Pos                                0                                                         /*!< I2S1 DAO: WORDWIDTH Position        */\r
+#define I2S1_DAO_WORDWIDTH_Msk                                (0x03UL << I2S1_DAO_WORDWIDTH_Pos)                        /*!< I2S1 DAO: WORDWIDTH Mask            */\r
+#define I2S1_DAO_MONO_Pos                                     2                                                         /*!< I2S1 DAO: MONO Position             */\r
+#define I2S1_DAO_MONO_Msk                                     (0x01UL << I2S1_DAO_MONO_Pos)                             /*!< I2S1 DAO: MONO Mask                 */\r
+#define I2S1_DAO_STOP_Pos                                     3                                                         /*!< I2S1 DAO: STOP Position             */\r
+#define I2S1_DAO_STOP_Msk                                     (0x01UL << I2S1_DAO_STOP_Pos)                             /*!< I2S1 DAO: STOP Mask                 */\r
+#define I2S1_DAO_RESET_Pos                                    4                                                         /*!< I2S1 DAO: RESET Position            */\r
+#define I2S1_DAO_RESET_Msk                                    (0x01UL << I2S1_DAO_RESET_Pos)                            /*!< I2S1 DAO: RESET Mask                */\r
+#define I2S1_DAO_WS_SEL_Pos                                   5                                                         /*!< I2S1 DAO: WS_SEL Position           */\r
+#define I2S1_DAO_WS_SEL_Msk                                   (0x01UL << I2S1_DAO_WS_SEL_Pos)                           /*!< I2S1 DAO: WS_SEL Mask               */\r
+#define I2S1_DAO_WS_HALFPERIOD_Pos                            6                                                         /*!< I2S1 DAO: WS_HALFPERIOD Position    */\r
+#define I2S1_DAO_WS_HALFPERIOD_Msk                            (0x000001ffUL << I2S1_DAO_WS_HALFPERIOD_Pos)              /*!< I2S1 DAO: WS_HALFPERIOD Mask        */\r
+#define I2S1_DAO_MUTE_Pos                                     15                                                        /*!< I2S1 DAO: MUTE Position             */\r
+#define I2S1_DAO_MUTE_Msk                                     (0x01UL << I2S1_DAO_MUTE_Pos)                             /*!< I2S1 DAO: MUTE Mask                 */\r
+\r
+// ----------------------------------------  I2S1_DAI  --------------------------------------------\r
+#define I2S1_DAI_WORDWIDTH_Pos                                0                                                         /*!< I2S1 DAI: WORDWIDTH Position        */\r
+#define I2S1_DAI_WORDWIDTH_Msk                                (0x03UL << I2S1_DAI_WORDWIDTH_Pos)                        /*!< I2S1 DAI: WORDWIDTH Mask            */\r
+#define I2S1_DAI_MONO_Pos                                     2                                                         /*!< I2S1 DAI: MONO Position             */\r
+#define I2S1_DAI_MONO_Msk                                     (0x01UL << I2S1_DAI_MONO_Pos)                             /*!< I2S1 DAI: MONO Mask                 */\r
+#define I2S1_DAI_STOP_Pos                                     3                                                         /*!< I2S1 DAI: STOP Position             */\r
+#define I2S1_DAI_STOP_Msk                                     (0x01UL << I2S1_DAI_STOP_Pos)                             /*!< I2S1 DAI: STOP Mask                 */\r
+#define I2S1_DAI_RESET_Pos                                    4                                                         /*!< I2S1 DAI: RESET Position            */\r
+#define I2S1_DAI_RESET_Msk                                    (0x01UL << I2S1_DAI_RESET_Pos)                            /*!< I2S1 DAI: RESET Mask                */\r
+#define I2S1_DAI_WS_SEL_Pos                                   5                                                         /*!< I2S1 DAI: WS_SEL Position           */\r
+#define I2S1_DAI_WS_SEL_Msk                                   (0x01UL << I2S1_DAI_WS_SEL_Pos)                           /*!< I2S1 DAI: WS_SEL Mask               */\r
+#define I2S1_DAI_WS_HALFPERIOD_Pos                            6                                                         /*!< I2S1 DAI: WS_HALFPERIOD Position    */\r
+#define I2S1_DAI_WS_HALFPERIOD_Msk                            (0x000001ffUL << I2S1_DAI_WS_HALFPERIOD_Pos)              /*!< I2S1 DAI: WS_HALFPERIOD Mask        */\r
+\r
+// ---------------------------------------  I2S1_TXFIFO  ------------------------------------------\r
+#define I2S1_TXFIFO_I2STXFIFO_Pos                             0                                                         /*!< I2S1 TXFIFO: I2STXFIFO Position     */\r
+#define I2S1_TXFIFO_I2STXFIFO_Msk                             (0xffffffffUL << I2S1_TXFIFO_I2STXFIFO_Pos)               /*!< I2S1 TXFIFO: I2STXFIFO Mask         */\r
+\r
+// ---------------------------------------  I2S1_RXFIFO  ------------------------------------------\r
+#define I2S1_RXFIFO_I2SRXFIFO_Pos                             0                                                         /*!< I2S1 RXFIFO: I2SRXFIFO Position     */\r
+#define I2S1_RXFIFO_I2SRXFIFO_Msk                             (0xffffffffUL << I2S1_RXFIFO_I2SRXFIFO_Pos)               /*!< I2S1 RXFIFO: I2SRXFIFO Mask         */\r
+\r
+// ---------------------------------------  I2S1_STATE  -------------------------------------------\r
+#define I2S1_STATE_IRQ_Pos                                    0                                                         /*!< I2S1 STATE: IRQ Position            */\r
+#define I2S1_STATE_IRQ_Msk                                    (0x01UL << I2S1_STATE_IRQ_Pos)                            /*!< I2S1 STATE: IRQ Mask                */\r
+#define I2S1_STATE_DMAREQ1_Pos                                1                                                         /*!< I2S1 STATE: DMAREQ1 Position        */\r
+#define I2S1_STATE_DMAREQ1_Msk                                (0x01UL << I2S1_STATE_DMAREQ1_Pos)                        /*!< I2S1 STATE: DMAREQ1 Mask            */\r
+#define I2S1_STATE_DMAREQ2_Pos                                2                                                         /*!< I2S1 STATE: DMAREQ2 Position        */\r
+#define I2S1_STATE_DMAREQ2_Msk                                (0x01UL << I2S1_STATE_DMAREQ2_Pos)                        /*!< I2S1 STATE: DMAREQ2 Mask            */\r
+#define I2S1_STATE_RX_LEVEL_Pos                               8                                                         /*!< I2S1 STATE: RX_LEVEL Position       */\r
+#define I2S1_STATE_RX_LEVEL_Msk                               (0x0fUL << I2S1_STATE_RX_LEVEL_Pos)                       /*!< I2S1 STATE: RX_LEVEL Mask           */\r
+#define I2S1_STATE_TX_LEVEL_Pos                               16                                                        /*!< I2S1 STATE: TX_LEVEL Position       */\r
+#define I2S1_STATE_TX_LEVEL_Msk                               (0x0fUL << I2S1_STATE_TX_LEVEL_Pos)                       /*!< I2S1 STATE: TX_LEVEL Mask           */\r
+\r
+// ----------------------------------------  I2S1_DMA1  -------------------------------------------\r
+#define I2S1_DMA1_RX_DMA1_ENABLE_Pos                          0                                                         /*!< I2S1 DMA1: RX_DMA1_ENABLE Position  */\r
+#define I2S1_DMA1_RX_DMA1_ENABLE_Msk                          (0x01UL << I2S1_DMA1_RX_DMA1_ENABLE_Pos)                  /*!< I2S1 DMA1: RX_DMA1_ENABLE Mask      */\r
+#define I2S1_DMA1_TX_DMA1_ENABLE_Pos                          1                                                         /*!< I2S1 DMA1: TX_DMA1_ENABLE Position  */\r
+#define I2S1_DMA1_TX_DMA1_ENABLE_Msk                          (0x01UL << I2S1_DMA1_TX_DMA1_ENABLE_Pos)                  /*!< I2S1 DMA1: TX_DMA1_ENABLE Mask      */\r
+#define I2S1_DMA1_RX_DEPTH_DMA1_Pos                           8                                                         /*!< I2S1 DMA1: RX_DEPTH_DMA1 Position   */\r
+#define I2S1_DMA1_RX_DEPTH_DMA1_Msk                           (0x0fUL << I2S1_DMA1_RX_DEPTH_DMA1_Pos)                   /*!< I2S1 DMA1: RX_DEPTH_DMA1 Mask       */\r
+#define I2S1_DMA1_TX_DEPTH_DMA1_Pos                           16                                                        /*!< I2S1 DMA1: TX_DEPTH_DMA1 Position   */\r
+#define I2S1_DMA1_TX_DEPTH_DMA1_Msk                           (0x0fUL << I2S1_DMA1_TX_DEPTH_DMA1_Pos)                   /*!< I2S1 DMA1: TX_DEPTH_DMA1 Mask       */\r
+\r
+// ----------------------------------------  I2S1_DMA2  -------------------------------------------\r
+#define I2S1_DMA2_RX_DMA2_ENABLE_Pos                          0                                                         /*!< I2S1 DMA2: RX_DMA2_ENABLE Position  */\r
+#define I2S1_DMA2_RX_DMA2_ENABLE_Msk                          (0x01UL << I2S1_DMA2_RX_DMA2_ENABLE_Pos)                  /*!< I2S1 DMA2: RX_DMA2_ENABLE Mask      */\r
+#define I2S1_DMA2_TX_DMA2_ENABLE_Pos                          1                                                         /*!< I2S1 DMA2: TX_DMA2_ENABLE Position  */\r
+#define I2S1_DMA2_TX_DMA2_ENABLE_Msk                          (0x01UL << I2S1_DMA2_TX_DMA2_ENABLE_Pos)                  /*!< I2S1 DMA2: TX_DMA2_ENABLE Mask      */\r
+#define I2S1_DMA2_RX_DEPTH_DMA2_Pos                           8                                                         /*!< I2S1 DMA2: RX_DEPTH_DMA2 Position   */\r
+#define I2S1_DMA2_RX_DEPTH_DMA2_Msk                           (0x0fUL << I2S1_DMA2_RX_DEPTH_DMA2_Pos)                   /*!< I2S1 DMA2: RX_DEPTH_DMA2 Mask       */\r
+#define I2S1_DMA2_TX_DEPTH_DMA2_Pos                           16                                                        /*!< I2S1 DMA2: TX_DEPTH_DMA2 Position   */\r
+#define I2S1_DMA2_TX_DEPTH_DMA2_Msk                           (0x0fUL << I2S1_DMA2_TX_DEPTH_DMA2_Pos)                   /*!< I2S1 DMA2: TX_DEPTH_DMA2 Mask       */\r
+\r
+// ----------------------------------------  I2S1_IRQ  --------------------------------------------\r
+#define I2S1_IRQ_RX_IRQ_ENABLE_Pos                            0                                                         /*!< I2S1 IRQ: RX_IRQ_ENABLE Position    */\r
+#define I2S1_IRQ_RX_IRQ_ENABLE_Msk                            (0x01UL << I2S1_IRQ_RX_IRQ_ENABLE_Pos)                    /*!< I2S1 IRQ: RX_IRQ_ENABLE Mask        */\r
+#define I2S1_IRQ_TX_IRQ_ENABLE_Pos                            1                                                         /*!< I2S1 IRQ: TX_IRQ_ENABLE Position    */\r
+#define I2S1_IRQ_TX_IRQ_ENABLE_Msk                            (0x01UL << I2S1_IRQ_TX_IRQ_ENABLE_Pos)                    /*!< I2S1 IRQ: TX_IRQ_ENABLE Mask        */\r
+#define I2S1_IRQ_RX_DEPTH_IRQ_Pos                             8                                                         /*!< I2S1 IRQ: RX_DEPTH_IRQ Position     */\r
+#define I2S1_IRQ_RX_DEPTH_IRQ_Msk                             (0x0fUL << I2S1_IRQ_RX_DEPTH_IRQ_Pos)                     /*!< I2S1 IRQ: RX_DEPTH_IRQ Mask         */\r
+#define I2S1_IRQ_TX_DEPTH_IRQ_Pos                             16                                                        /*!< I2S1 IRQ: TX_DEPTH_IRQ Position     */\r
+#define I2S1_IRQ_TX_DEPTH_IRQ_Msk                             (0x0fUL << I2S1_IRQ_TX_DEPTH_IRQ_Pos)                     /*!< I2S1 IRQ: TX_DEPTH_IRQ Mask         */\r
+\r
+// ---------------------------------------  I2S1_TXRATE  ------------------------------------------\r
+#define I2S1_TXRATE_Y_DIVIDER_Pos                             0                                                         /*!< I2S1 TXRATE: Y_DIVIDER Position     */\r
+#define I2S1_TXRATE_Y_DIVIDER_Msk                             (0x000000ffUL << I2S1_TXRATE_Y_DIVIDER_Pos)               /*!< I2S1 TXRATE: Y_DIVIDER Mask         */\r
+#define I2S1_TXRATE_X_DIVIDER_Pos                             8                                                         /*!< I2S1 TXRATE: X_DIVIDER Position     */\r
+#define I2S1_TXRATE_X_DIVIDER_Msk                             (0x000000ffUL << I2S1_TXRATE_X_DIVIDER_Pos)               /*!< I2S1 TXRATE: X_DIVIDER Mask         */\r
+\r
+// ---------------------------------------  I2S1_RXRATE  ------------------------------------------\r
+#define I2S1_RXRATE_Y_DIVIDER_Pos                             0                                                         /*!< I2S1 RXRATE: Y_DIVIDER Position     */\r
+#define I2S1_RXRATE_Y_DIVIDER_Msk                             (0x000000ffUL << I2S1_RXRATE_Y_DIVIDER_Pos)               /*!< I2S1 RXRATE: Y_DIVIDER Mask         */\r
+#define I2S1_RXRATE_X_DIVIDER_Pos                             8                                                         /*!< I2S1 RXRATE: X_DIVIDER Position     */\r
+#define I2S1_RXRATE_X_DIVIDER_Msk                             (0x000000ffUL << I2S1_RXRATE_X_DIVIDER_Pos)               /*!< I2S1 RXRATE: X_DIVIDER Mask         */\r
+\r
+// -------------------------------------  I2S1_TXBITRATE  -----------------------------------------\r
+#define I2S1_TXBITRATE_TX_BITRATE_Pos                         0                                                         /*!< I2S1 TXBITRATE: TX_BITRATE Position */\r
+#define I2S1_TXBITRATE_TX_BITRATE_Msk                         (0x3fUL << I2S1_TXBITRATE_TX_BITRATE_Pos)                 /*!< I2S1 TXBITRATE: TX_BITRATE Mask     */\r
+\r
+// -------------------------------------  I2S1_RXBITRATE  -----------------------------------------\r
+#define I2S1_RXBITRATE_RX_BITRATE_Pos                         0                                                         /*!< I2S1 RXBITRATE: RX_BITRATE Position */\r
+#define I2S1_RXBITRATE_RX_BITRATE_Msk                         (0x3fUL << I2S1_RXBITRATE_RX_BITRATE_Pos)                 /*!< I2S1 RXBITRATE: RX_BITRATE Mask     */\r
+\r
+// ---------------------------------------  I2S1_TXMODE  ------------------------------------------\r
+#define I2S1_TXMODE_TXCLKSEL_Pos                              0                                                         /*!< I2S1 TXMODE: TXCLKSEL Position      */\r
+#define I2S1_TXMODE_TXCLKSEL_Msk                              (0x03UL << I2S1_TXMODE_TXCLKSEL_Pos)                      /*!< I2S1 TXMODE: TXCLKSEL Mask          */\r
+#define I2S1_TXMODE_TX4PIN_Pos                                2                                                         /*!< I2S1 TXMODE: TX4PIN Position        */\r
+#define I2S1_TXMODE_TX4PIN_Msk                                (0x01UL << I2S1_TXMODE_TX4PIN_Pos)                        /*!< I2S1 TXMODE: TX4PIN Mask            */\r
+#define I2S1_TXMODE_TXMCENA_Pos                               3                                                         /*!< I2S1 TXMODE: TXMCENA Position       */\r
+#define I2S1_TXMODE_TXMCENA_Msk                               (0x01UL << I2S1_TXMODE_TXMCENA_Pos)                       /*!< I2S1 TXMODE: TXMCENA Mask           */\r
+\r
+// ---------------------------------------  I2S1_RXMODE  ------------------------------------------\r
+#define I2S1_RXMODE_RXCLKSEL_Pos                              0                                                         /*!< I2S1 RXMODE: RXCLKSEL Position      */\r
+#define I2S1_RXMODE_RXCLKSEL_Msk                              (0x03UL << I2S1_RXMODE_RXCLKSEL_Pos)                      /*!< I2S1 RXMODE: RXCLKSEL Mask          */\r
+#define I2S1_RXMODE_RX4PIN_Pos                                2                                                         /*!< I2S1 RXMODE: RX4PIN Position        */\r
+#define I2S1_RXMODE_RX4PIN_Msk                                (0x01UL << I2S1_RXMODE_RX4PIN_Pos)                        /*!< I2S1 RXMODE: RX4PIN Mask            */\r
+#define I2S1_RXMODE_RXMCENA_Pos                               3                                                         /*!< I2S1 RXMODE: RXMCENA Position       */\r
+#define I2S1_RXMODE_RXMCENA_Msk                               (0x01UL << I2S1_RXMODE_RXMCENA_Pos)                       /*!< I2S1 RXMODE: RXMCENA Mask           */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                C_CAN1 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  C_CAN1_CNTL  ------------------------------------------\r
+#define C_CAN1_CNTL_INIT_Pos                                  0                                                         /*!< C_CAN1 CNTL: INIT Position          */\r
+#define C_CAN1_CNTL_INIT_Msk                                  (0x01UL << C_CAN1_CNTL_INIT_Pos)                          /*!< C_CAN1 CNTL: INIT Mask              */\r
+#define C_CAN1_CNTL_IE_Pos                                    1                                                         /*!< C_CAN1 CNTL: IE Position            */\r
+#define C_CAN1_CNTL_IE_Msk                                    (0x01UL << C_CAN1_CNTL_IE_Pos)                            /*!< C_CAN1 CNTL: IE Mask                */\r
+#define C_CAN1_CNTL_SIE_Pos                                   2                                                         /*!< C_CAN1 CNTL: SIE Position           */\r
+#define C_CAN1_CNTL_SIE_Msk                                   (0x01UL << C_CAN1_CNTL_SIE_Pos)                           /*!< C_CAN1 CNTL: SIE Mask               */\r
+#define C_CAN1_CNTL_EIE_Pos                                   3                                                         /*!< C_CAN1 CNTL: EIE Position           */\r
+#define C_CAN1_CNTL_EIE_Msk                                   (0x01UL << C_CAN1_CNTL_EIE_Pos)                           /*!< C_CAN1 CNTL: EIE Mask               */\r
+#define C_CAN1_CNTL_DAR_Pos                                   5                                                         /*!< C_CAN1 CNTL: DAR Position           */\r
+#define C_CAN1_CNTL_DAR_Msk                                   (0x01UL << C_CAN1_CNTL_DAR_Pos)                           /*!< C_CAN1 CNTL: DAR Mask               */\r
+#define C_CAN1_CNTL_CCE_Pos                                   6                                                         /*!< C_CAN1 CNTL: CCE Position           */\r
+#define C_CAN1_CNTL_CCE_Msk                                   (0x01UL << C_CAN1_CNTL_CCE_Pos)                           /*!< C_CAN1 CNTL: CCE Mask               */\r
+#define C_CAN1_CNTL_TEST_Pos                                  7                                                         /*!< C_CAN1 CNTL: TEST Position          */\r
+#define C_CAN1_CNTL_TEST_Msk                                  (0x01UL << C_CAN1_CNTL_TEST_Pos)                          /*!< C_CAN1 CNTL: TEST Mask              */\r
+\r
+// ---------------------------------------  C_CAN1_STAT  ------------------------------------------\r
+#define C_CAN1_STAT_LEC_Pos                                   0                                                         /*!< C_CAN1 STAT: LEC Position           */\r
+#define C_CAN1_STAT_LEC_Msk                                   (0x07UL << C_CAN1_STAT_LEC_Pos)                           /*!< C_CAN1 STAT: LEC Mask               */\r
+#define C_CAN1_STAT_TXOK_Pos                                  3                                                         /*!< C_CAN1 STAT: TXOK Position          */\r
+#define C_CAN1_STAT_TXOK_Msk                                  (0x01UL << C_CAN1_STAT_TXOK_Pos)                          /*!< C_CAN1 STAT: TXOK Mask              */\r
+#define C_CAN1_STAT_RXOK_Pos                                  4                                                         /*!< C_CAN1 STAT: RXOK Position          */\r
+#define C_CAN1_STAT_RXOK_Msk                                  (0x01UL << C_CAN1_STAT_RXOK_Pos)                          /*!< C_CAN1 STAT: RXOK Mask              */\r
+#define C_CAN1_STAT_EPASS_Pos                                 5                                                         /*!< C_CAN1 STAT: EPASS Position         */\r
+#define C_CAN1_STAT_EPASS_Msk                                 (0x01UL << C_CAN1_STAT_EPASS_Pos)                         /*!< C_CAN1 STAT: EPASS Mask             */\r
+#define C_CAN1_STAT_EWARN_Pos                                 6                                                         /*!< C_CAN1 STAT: EWARN Position         */\r
+#define C_CAN1_STAT_EWARN_Msk                                 (0x01UL << C_CAN1_STAT_EWARN_Pos)                         /*!< C_CAN1 STAT: EWARN Mask             */\r
+#define C_CAN1_STAT_BOFF_Pos                                  7                                                         /*!< C_CAN1 STAT: BOFF Position          */\r
+#define C_CAN1_STAT_BOFF_Msk                                  (0x01UL << C_CAN1_STAT_BOFF_Pos)                          /*!< C_CAN1 STAT: BOFF Mask              */\r
+\r
+// ----------------------------------------  C_CAN1_EC  -------------------------------------------\r
+#define C_CAN1_EC_TEC_7_0_Pos                                 0                                                         /*!< C_CAN1 EC: TEC_7_0 Position         */\r
+#define C_CAN1_EC_TEC_7_0_Msk                                 (0x000000ffUL << C_CAN1_EC_TEC_7_0_Pos)                   /*!< C_CAN1 EC: TEC_7_0 Mask             */\r
+#define C_CAN1_EC_REC_6_0_Pos                                 8                                                         /*!< C_CAN1 EC: REC_6_0 Position         */\r
+#define C_CAN1_EC_REC_6_0_Msk                                 (0x7fUL << C_CAN1_EC_REC_6_0_Pos)                         /*!< C_CAN1 EC: REC_6_0 Mask             */\r
+#define C_CAN1_EC_RP_Pos                                      15                                                        /*!< C_CAN1 EC: RP Position              */\r
+#define C_CAN1_EC_RP_Msk                                      (0x01UL << C_CAN1_EC_RP_Pos)                              /*!< C_CAN1 EC: RP Mask                  */\r
+\r
+// ----------------------------------------  C_CAN1_BT  -------------------------------------------\r
+#define C_CAN1_BT_BRP_Pos                                     0                                                         /*!< C_CAN1 BT: BRP Position             */\r
+#define C_CAN1_BT_BRP_Msk                                     (0x3fUL << C_CAN1_BT_BRP_Pos)                             /*!< C_CAN1 BT: BRP Mask                 */\r
+#define C_CAN1_BT_SJW_Pos                                     6                                                         /*!< C_CAN1 BT: SJW Position             */\r
+#define C_CAN1_BT_SJW_Msk                                     (0x03UL << C_CAN1_BT_SJW_Pos)                             /*!< C_CAN1 BT: SJW Mask                 */\r
+#define C_CAN1_BT_TSEG1_Pos                                   8                                                         /*!< C_CAN1 BT: TSEG1 Position           */\r
+#define C_CAN1_BT_TSEG1_Msk                                   (0x0fUL << C_CAN1_BT_TSEG1_Pos)                           /*!< C_CAN1 BT: TSEG1 Mask               */\r
+#define C_CAN1_BT_TSEG2_Pos                                   12                                                        /*!< C_CAN1 BT: TSEG2 Position           */\r
+#define C_CAN1_BT_TSEG2_Msk                                   (0x07UL << C_CAN1_BT_TSEG2_Pos)                           /*!< C_CAN1 BT: TSEG2 Mask               */\r
+\r
+// ---------------------------------------  C_CAN1_INT  -------------------------------------------\r
+#define C_CAN1_INT_INTID15_0_Pos                              0                                                         /*!< C_CAN1 INT: INTID15_0 Position      */\r
+#define C_CAN1_INT_INTID15_0_Msk                              (0x0000ffffUL << C_CAN1_INT_INTID15_0_Pos)                /*!< C_CAN1 INT: INTID15_0 Mask          */\r
+\r
+// ---------------------------------------  C_CAN1_TEST  ------------------------------------------\r
+#define C_CAN1_TEST_BASIC_Pos                                 2                                                         /*!< C_CAN1 TEST: BASIC Position         */\r
+#define C_CAN1_TEST_BASIC_Msk                                 (0x01UL << C_CAN1_TEST_BASIC_Pos)                         /*!< C_CAN1 TEST: BASIC Mask             */\r
+#define C_CAN1_TEST_SILENT_Pos                                3                                                         /*!< C_CAN1 TEST: SILENT Position        */\r
+#define C_CAN1_TEST_SILENT_Msk                                (0x01UL << C_CAN1_TEST_SILENT_Pos)                        /*!< C_CAN1 TEST: SILENT Mask            */\r
+#define C_CAN1_TEST_LBACK_Pos                                 4                                                         /*!< C_CAN1 TEST: LBACK Position         */\r
+#define C_CAN1_TEST_LBACK_Msk                                 (0x01UL << C_CAN1_TEST_LBACK_Pos)                         /*!< C_CAN1 TEST: LBACK Mask             */\r
+#define C_CAN1_TEST_TX1_0_Pos                                 5                                                         /*!< C_CAN1 TEST: TX1_0 Position         */\r
+#define C_CAN1_TEST_TX1_0_Msk                                 (0x03UL << C_CAN1_TEST_TX1_0_Pos)                         /*!< C_CAN1 TEST: TX1_0 Mask             */\r
+#define C_CAN1_TEST_RX_Pos                                    7                                                         /*!< C_CAN1 TEST: RX Position            */\r
+#define C_CAN1_TEST_RX_Msk                                    (0x01UL << C_CAN1_TEST_RX_Pos)                            /*!< C_CAN1 TEST: RX Mask                */\r
+\r
+// ---------------------------------------  C_CAN1_BRPE  ------------------------------------------\r
+#define C_CAN1_BRPE_BRPE_Pos                                  0                                                         /*!< C_CAN1 BRPE: BRPE Position          */\r
+#define C_CAN1_BRPE_BRPE_Msk                                  (0x0fUL << C_CAN1_BRPE_BRPE_Pos)                          /*!< C_CAN1 BRPE: BRPE Mask              */\r
+\r
+// ------------------------------------  C_CAN1_IF1_CMDREQ  ---------------------------------------\r
+#define C_CAN1_IF1_CMDREQ_MESSNUM_Pos                         0                                                         /*!< C_CAN1 IF1_CMDREQ: MESSNUM Position */\r
+#define C_CAN1_IF1_CMDREQ_MESSNUM_Msk                         (0x3fUL << C_CAN1_IF1_CMDREQ_MESSNUM_Pos)                 /*!< C_CAN1 IF1_CMDREQ: MESSNUM Mask     */\r
+#define C_CAN1_IF1_CMDREQ_BUSY_Pos                            15                                                        /*!< C_CAN1 IF1_CMDREQ: BUSY Position    */\r
+#define C_CAN1_IF1_CMDREQ_BUSY_Msk                            (0x01UL << C_CAN1_IF1_CMDREQ_BUSY_Pos)                    /*!< C_CAN1 IF1_CMDREQ: BUSY Mask        */\r
+\r
+// -----------------------------------  C_CAN1_IF1_CMDMSK_W  --------------------------------------\r
+#define C_CAN1_IF1_CMDMSK_W_DATA_B_Pos                        0                                                         /*!< C_CAN1 IF1_CMDMSK_W: DATA_B Position */\r
+#define C_CAN1_IF1_CMDMSK_W_DATA_B_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_W_DATA_B_Pos)                /*!< C_CAN1 IF1_CMDMSK_W: DATA_B Mask    */\r
+#define C_CAN1_IF1_CMDMSK_W_DATA_A_Pos                        1                                                         /*!< C_CAN1 IF1_CMDMSK_W: DATA_A Position */\r
+#define C_CAN1_IF1_CMDMSK_W_DATA_A_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_W_DATA_A_Pos)                /*!< C_CAN1 IF1_CMDMSK_W: DATA_A Mask    */\r
+#define C_CAN1_IF1_CMDMSK_W_TXRQST_Pos                        2                                                         /*!< C_CAN1 IF1_CMDMSK_W: TXRQST Position */\r
+#define C_CAN1_IF1_CMDMSK_W_TXRQST_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_W_TXRQST_Pos)                /*!< C_CAN1 IF1_CMDMSK_W: TXRQST Mask    */\r
+#define C_CAN1_IF1_CMDMSK_W_CLRINTPND_Pos                     3                                                         /*!< C_CAN1 IF1_CMDMSK_W: CLRINTPND Position */\r
+#define C_CAN1_IF1_CMDMSK_W_CLRINTPND_Msk                     (0x01UL << C_CAN1_IF1_CMDMSK_W_CLRINTPND_Pos)             /*!< C_CAN1 IF1_CMDMSK_W: CLRINTPND Mask */\r
+#define C_CAN1_IF1_CMDMSK_W_CTRL_Pos                          4                                                         /*!< C_CAN1 IF1_CMDMSK_W: CTRL Position  */\r
+#define C_CAN1_IF1_CMDMSK_W_CTRL_Msk                          (0x01UL << C_CAN1_IF1_CMDMSK_W_CTRL_Pos)                  /*!< C_CAN1 IF1_CMDMSK_W: CTRL Mask      */\r
+#define C_CAN1_IF1_CMDMSK_W_ARB_Pos                           5                                                         /*!< C_CAN1 IF1_CMDMSK_W: ARB Position   */\r
+#define C_CAN1_IF1_CMDMSK_W_ARB_Msk                           (0x01UL << C_CAN1_IF1_CMDMSK_W_ARB_Pos)                   /*!< C_CAN1 IF1_CMDMSK_W: ARB Mask       */\r
+#define C_CAN1_IF1_CMDMSK_W_MASK_Pos                          6                                                         /*!< C_CAN1 IF1_CMDMSK_W: MASK Position  */\r
+#define C_CAN1_IF1_CMDMSK_W_MASK_Msk                          (0x01UL << C_CAN1_IF1_CMDMSK_W_MASK_Pos)                  /*!< C_CAN1 IF1_CMDMSK_W: MASK Mask      */\r
+#define C_CAN1_IF1_CMDMSK_W_WR_RD_Pos                         7                                                         /*!< C_CAN1 IF1_CMDMSK_W: WR_RD Position */\r
+#define C_CAN1_IF1_CMDMSK_W_WR_RD_Msk                         (0x01UL << C_CAN1_IF1_CMDMSK_W_WR_RD_Pos)                 /*!< C_CAN1 IF1_CMDMSK_W: WR_RD Mask     */\r
+\r
+// -----------------------------------  C_CAN1_IF1_CMDMSK_R  --------------------------------------\r
+#define C_CAN1_IF1_CMDMSK_R_DATA_B_Pos                        0                                                         /*!< C_CAN1 IF1_CMDMSK_R: DATA_B Position */\r
+#define C_CAN1_IF1_CMDMSK_R_DATA_B_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_R_DATA_B_Pos)                /*!< C_CAN1 IF1_CMDMSK_R: DATA_B Mask    */\r
+#define C_CAN1_IF1_CMDMSK_R_DATA_A_Pos                        1                                                         /*!< C_CAN1 IF1_CMDMSK_R: DATA_A Position */\r
+#define C_CAN1_IF1_CMDMSK_R_DATA_A_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_R_DATA_A_Pos)                /*!< C_CAN1 IF1_CMDMSK_R: DATA_A Mask    */\r
+#define C_CAN1_IF1_CMDMSK_R_NEWDAT_Pos                        2                                                         /*!< C_CAN1 IF1_CMDMSK_R: NEWDAT Position */\r
+#define C_CAN1_IF1_CMDMSK_R_NEWDAT_Msk                        (0x01UL << C_CAN1_IF1_CMDMSK_R_NEWDAT_Pos)                /*!< C_CAN1 IF1_CMDMSK_R: NEWDAT Mask    */\r
+#define C_CAN1_IF1_CMDMSK_R_CLRINTPND_Pos                     3                                                         /*!< C_CAN1 IF1_CMDMSK_R: CLRINTPND Position */\r
+#define C_CAN1_IF1_CMDMSK_R_CLRINTPND_Msk                     (0x01UL << C_CAN1_IF1_CMDMSK_R_CLRINTPND_Pos)             /*!< C_CAN1 IF1_CMDMSK_R: CLRINTPND Mask */\r
+#define C_CAN1_IF1_CMDMSK_R_CTRL_Pos                          4                                                         /*!< C_CAN1 IF1_CMDMSK_R: CTRL Position  */\r
+#define C_CAN1_IF1_CMDMSK_R_CTRL_Msk                          (0x01UL << C_CAN1_IF1_CMDMSK_R_CTRL_Pos)                  /*!< C_CAN1 IF1_CMDMSK_R: CTRL Mask      */\r
+#define C_CAN1_IF1_CMDMSK_R_ARB_Pos                           5                                                         /*!< C_CAN1 IF1_CMDMSK_R: ARB Position   */\r
+#define C_CAN1_IF1_CMDMSK_R_ARB_Msk                           (0x01UL << C_CAN1_IF1_CMDMSK_R_ARB_Pos)                   /*!< C_CAN1 IF1_CMDMSK_R: ARB Mask       */\r
+#define C_CAN1_IF1_CMDMSK_R_MASK_Pos                          6                                                         /*!< C_CAN1 IF1_CMDMSK_R: MASK Position  */\r
+#define C_CAN1_IF1_CMDMSK_R_MASK_Msk                          (0x01UL << C_CAN1_IF1_CMDMSK_R_MASK_Pos)                  /*!< C_CAN1 IF1_CMDMSK_R: MASK Mask      */\r
+#define C_CAN1_IF1_CMDMSK_R_WR_RD_Pos                         7                                                         /*!< C_CAN1 IF1_CMDMSK_R: WR_RD Position */\r
+#define C_CAN1_IF1_CMDMSK_R_WR_RD_Msk                         (0x01UL << C_CAN1_IF1_CMDMSK_R_WR_RD_Pos)                 /*!< C_CAN1 IF1_CMDMSK_R: WR_RD Mask     */\r
+\r
+// -------------------------------------  C_CAN1_IF1_MSK1  ----------------------------------------\r
+#define C_CAN1_IF1_MSK1_MSK15_0_Pos                           0                                                         /*!< C_CAN1 IF1_MSK1: MSK15_0 Position   */\r
+#define C_CAN1_IF1_MSK1_MSK15_0_Msk                           (0x0000ffffUL << C_CAN1_IF1_MSK1_MSK15_0_Pos)             /*!< C_CAN1 IF1_MSK1: MSK15_0 Mask       */\r
+\r
+// -------------------------------------  C_CAN1_IF1_MSK2  ----------------------------------------\r
+#define C_CAN1_IF1_MSK2_MSK28_16_Pos                          0                                                         /*!< C_CAN1 IF1_MSK2: MSK28_16 Position  */\r
+#define C_CAN1_IF1_MSK2_MSK28_16_Msk                          (0x00001fffUL << C_CAN1_IF1_MSK2_MSK28_16_Pos)            /*!< C_CAN1 IF1_MSK2: MSK28_16 Mask      */\r
+#define C_CAN1_IF1_MSK2_MDIR_Pos                              14                                                        /*!< C_CAN1 IF1_MSK2: MDIR Position      */\r
+#define C_CAN1_IF1_MSK2_MDIR_Msk                              (0x01UL << C_CAN1_IF1_MSK2_MDIR_Pos)                      /*!< C_CAN1 IF1_MSK2: MDIR Mask          */\r
+#define C_CAN1_IF1_MSK2_MXTD_Pos                              15                                                        /*!< C_CAN1 IF1_MSK2: MXTD Position      */\r
+#define C_CAN1_IF1_MSK2_MXTD_Msk                              (0x01UL << C_CAN1_IF1_MSK2_MXTD_Pos)                      /*!< C_CAN1 IF1_MSK2: MXTD Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF1_ARB1  ----------------------------------------\r
+#define C_CAN1_IF1_ARB1_ID15_0_Pos                            0                                                         /*!< C_CAN1 IF1_ARB1: ID15_0 Position    */\r
+#define C_CAN1_IF1_ARB1_ID15_0_Msk                            (0x0000ffffUL << C_CAN1_IF1_ARB1_ID15_0_Pos)              /*!< C_CAN1 IF1_ARB1: ID15_0 Mask        */\r
+\r
+// -------------------------------------  C_CAN1_IF1_ARB2  ----------------------------------------\r
+#define C_CAN1_IF1_ARB2_ID28_16_Pos                           0                                                         /*!< C_CAN1 IF1_ARB2: ID28_16 Position   */\r
+#define C_CAN1_IF1_ARB2_ID28_16_Msk                           (0x00001fffUL << C_CAN1_IF1_ARB2_ID28_16_Pos)             /*!< C_CAN1 IF1_ARB2: ID28_16 Mask       */\r
+#define C_CAN1_IF1_ARB2_DIR_Pos                               13                                                        /*!< C_CAN1 IF1_ARB2: DIR Position       */\r
+#define C_CAN1_IF1_ARB2_DIR_Msk                               (0x01UL << C_CAN1_IF1_ARB2_DIR_Pos)                       /*!< C_CAN1 IF1_ARB2: DIR Mask           */\r
+#define C_CAN1_IF1_ARB2_XTD_Pos                               14                                                        /*!< C_CAN1 IF1_ARB2: XTD Position       */\r
+#define C_CAN1_IF1_ARB2_XTD_Msk                               (0x01UL << C_CAN1_IF1_ARB2_XTD_Pos)                       /*!< C_CAN1 IF1_ARB2: XTD Mask           */\r
+#define C_CAN1_IF1_ARB2_MSGVAL_Pos                            15                                                        /*!< C_CAN1 IF1_ARB2: MSGVAL Position    */\r
+#define C_CAN1_IF1_ARB2_MSGVAL_Msk                            (0x01UL << C_CAN1_IF1_ARB2_MSGVAL_Pos)                    /*!< C_CAN1 IF1_ARB2: MSGVAL Mask        */\r
+\r
+// ------------------------------------  C_CAN1_IF1_MCTRL  ----------------------------------------\r
+#define C_CAN1_IF1_MCTRL_DLC3_0_Pos                           0                                                         /*!< C_CAN1 IF1_MCTRL: DLC3_0 Position   */\r
+#define C_CAN1_IF1_MCTRL_DLC3_0_Msk                           (0x0fUL << C_CAN1_IF1_MCTRL_DLC3_0_Pos)                   /*!< C_CAN1 IF1_MCTRL: DLC3_0 Mask       */\r
+#define C_CAN1_IF1_MCTRL_EOB_Pos                              7                                                         /*!< C_CAN1 IF1_MCTRL: EOB Position      */\r
+#define C_CAN1_IF1_MCTRL_EOB_Msk                              (0x01UL << C_CAN1_IF1_MCTRL_EOB_Pos)                      /*!< C_CAN1 IF1_MCTRL: EOB Mask          */\r
+#define C_CAN1_IF1_MCTRL_TXRQST_Pos                           8                                                         /*!< C_CAN1 IF1_MCTRL: TXRQST Position   */\r
+#define C_CAN1_IF1_MCTRL_TXRQST_Msk                           (0x01UL << C_CAN1_IF1_MCTRL_TXRQST_Pos)                   /*!< C_CAN1 IF1_MCTRL: TXRQST Mask       */\r
+#define C_CAN1_IF1_MCTRL_RMTEN_Pos                            9                                                         /*!< C_CAN1 IF1_MCTRL: RMTEN Position    */\r
+#define C_CAN1_IF1_MCTRL_RMTEN_Msk                            (0x01UL << C_CAN1_IF1_MCTRL_RMTEN_Pos)                    /*!< C_CAN1 IF1_MCTRL: RMTEN Mask        */\r
+#define C_CAN1_IF1_MCTRL_RXIE_Pos                             10                                                        /*!< C_CAN1 IF1_MCTRL: RXIE Position     */\r
+#define C_CAN1_IF1_MCTRL_RXIE_Msk                             (0x01UL << C_CAN1_IF1_MCTRL_RXIE_Pos)                     /*!< C_CAN1 IF1_MCTRL: RXIE Mask         */\r
+#define C_CAN1_IF1_MCTRL_TXIE_Pos                             11                                                        /*!< C_CAN1 IF1_MCTRL: TXIE Position     */\r
+#define C_CAN1_IF1_MCTRL_TXIE_Msk                             (0x01UL << C_CAN1_IF1_MCTRL_TXIE_Pos)                     /*!< C_CAN1 IF1_MCTRL: TXIE Mask         */\r
+#define C_CAN1_IF1_MCTRL_UMASK_Pos                            12                                                        /*!< C_CAN1 IF1_MCTRL: UMASK Position    */\r
+#define C_CAN1_IF1_MCTRL_UMASK_Msk                            (0x01UL << C_CAN1_IF1_MCTRL_UMASK_Pos)                    /*!< C_CAN1 IF1_MCTRL: UMASK Mask        */\r
+#define C_CAN1_IF1_MCTRL_INTPND_Pos                           13                                                        /*!< C_CAN1 IF1_MCTRL: INTPND Position   */\r
+#define C_CAN1_IF1_MCTRL_INTPND_Msk                           (0x01UL << C_CAN1_IF1_MCTRL_INTPND_Pos)                   /*!< C_CAN1 IF1_MCTRL: INTPND Mask       */\r
+#define C_CAN1_IF1_MCTRL_MSGLST_Pos                           14                                                        /*!< C_CAN1 IF1_MCTRL: MSGLST Position   */\r
+#define C_CAN1_IF1_MCTRL_MSGLST_Msk                           (0x01UL << C_CAN1_IF1_MCTRL_MSGLST_Pos)                   /*!< C_CAN1 IF1_MCTRL: MSGLST Mask       */\r
+#define C_CAN1_IF1_MCTRL_NEWDAT_Pos                           15                                                        /*!< C_CAN1 IF1_MCTRL: NEWDAT Position   */\r
+#define C_CAN1_IF1_MCTRL_NEWDAT_Msk                           (0x01UL << C_CAN1_IF1_MCTRL_NEWDAT_Pos)                   /*!< C_CAN1 IF1_MCTRL: NEWDAT Mask       */\r
+\r
+// -------------------------------------  C_CAN1_IF1_DA1  -----------------------------------------\r
+#define C_CAN1_IF1_DA1_DATA0_Pos                              0                                                         /*!< C_CAN1 IF1_DA1: DATA0 Position      */\r
+#define C_CAN1_IF1_DA1_DATA0_Msk                              (0x000000ffUL << C_CAN1_IF1_DA1_DATA0_Pos)                /*!< C_CAN1 IF1_DA1: DATA0 Mask          */\r
+#define C_CAN1_IF1_DA1_DATA1_Pos                              8                                                         /*!< C_CAN1 IF1_DA1: DATA1 Position      */\r
+#define C_CAN1_IF1_DA1_DATA1_Msk                              (0x000000ffUL << C_CAN1_IF1_DA1_DATA1_Pos)                /*!< C_CAN1 IF1_DA1: DATA1 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF1_DA2  -----------------------------------------\r
+#define C_CAN1_IF1_DA2_DATA2_Pos                              0                                                         /*!< C_CAN1 IF1_DA2: DATA2 Position      */\r
+#define C_CAN1_IF1_DA2_DATA2_Msk                              (0x000000ffUL << C_CAN1_IF1_DA2_DATA2_Pos)                /*!< C_CAN1 IF1_DA2: DATA2 Mask          */\r
+#define C_CAN1_IF1_DA2_DATA3_Pos                              8                                                         /*!< C_CAN1 IF1_DA2: DATA3 Position      */\r
+#define C_CAN1_IF1_DA2_DATA3_Msk                              (0x000000ffUL << C_CAN1_IF1_DA2_DATA3_Pos)                /*!< C_CAN1 IF1_DA2: DATA3 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF1_DB1  -----------------------------------------\r
+#define C_CAN1_IF1_DB1_DATA4_Pos                              0                                                         /*!< C_CAN1 IF1_DB1: DATA4 Position      */\r
+#define C_CAN1_IF1_DB1_DATA4_Msk                              (0x000000ffUL << C_CAN1_IF1_DB1_DATA4_Pos)                /*!< C_CAN1 IF1_DB1: DATA4 Mask          */\r
+#define C_CAN1_IF1_DB1_DATA5_Pos                              8                                                         /*!< C_CAN1 IF1_DB1: DATA5 Position      */\r
+#define C_CAN1_IF1_DB1_DATA5_Msk                              (0x000000ffUL << C_CAN1_IF1_DB1_DATA5_Pos)                /*!< C_CAN1 IF1_DB1: DATA5 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF1_DB2  -----------------------------------------\r
+#define C_CAN1_IF1_DB2_DATA6_Pos                              0                                                         /*!< C_CAN1 IF1_DB2: DATA6 Position      */\r
+#define C_CAN1_IF1_DB2_DATA6_Msk                              (0x000000ffUL << C_CAN1_IF1_DB2_DATA6_Pos)                /*!< C_CAN1 IF1_DB2: DATA6 Mask          */\r
+#define C_CAN1_IF1_DB2_DATA7_Pos                              8                                                         /*!< C_CAN1 IF1_DB2: DATA7 Position      */\r
+#define C_CAN1_IF1_DB2_DATA7_Msk                              (0x000000ffUL << C_CAN1_IF1_DB2_DATA7_Pos)                /*!< C_CAN1 IF1_DB2: DATA7 Mask          */\r
+\r
+// ------------------------------------  C_CAN1_IF2_CMDREQ  ---------------------------------------\r
+#define C_CAN1_IF2_CMDREQ_MESSNUM_Pos                         0                                                         /*!< C_CAN1 IF2_CMDREQ: MESSNUM Position */\r
+#define C_CAN1_IF2_CMDREQ_MESSNUM_Msk                         (0x3fUL << C_CAN1_IF2_CMDREQ_MESSNUM_Pos)                 /*!< C_CAN1 IF2_CMDREQ: MESSNUM Mask     */\r
+#define C_CAN1_IF2_CMDREQ_BUSY_Pos                            15                                                        /*!< C_CAN1 IF2_CMDREQ: BUSY Position    */\r
+#define C_CAN1_IF2_CMDREQ_BUSY_Msk                            (0x01UL << C_CAN1_IF2_CMDREQ_BUSY_Pos)                    /*!< C_CAN1 IF2_CMDREQ: BUSY Mask        */\r
+\r
+// -----------------------------------  C_CAN1_IF2_CMDMSK_W  --------------------------------------\r
+#define C_CAN1_IF2_CMDMSK_W_DATA_B_Pos                        0                                                         /*!< C_CAN1 IF2_CMDMSK_W: DATA_B Position */\r
+#define C_CAN1_IF2_CMDMSK_W_DATA_B_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_W_DATA_B_Pos)                /*!< C_CAN1 IF2_CMDMSK_W: DATA_B Mask    */\r
+#define C_CAN1_IF2_CMDMSK_W_DATA_A_Pos                        1                                                         /*!< C_CAN1 IF2_CMDMSK_W: DATA_A Position */\r
+#define C_CAN1_IF2_CMDMSK_W_DATA_A_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_W_DATA_A_Pos)                /*!< C_CAN1 IF2_CMDMSK_W: DATA_A Mask    */\r
+#define C_CAN1_IF2_CMDMSK_W_TXRQST_Pos                        2                                                         /*!< C_CAN1 IF2_CMDMSK_W: TXRQST Position */\r
+#define C_CAN1_IF2_CMDMSK_W_TXRQST_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_W_TXRQST_Pos)                /*!< C_CAN1 IF2_CMDMSK_W: TXRQST Mask    */\r
+#define C_CAN1_IF2_CMDMSK_W_CLRINTPND_Pos                     3                                                         /*!< C_CAN1 IF2_CMDMSK_W: CLRINTPND Position */\r
+#define C_CAN1_IF2_CMDMSK_W_CLRINTPND_Msk                     (0x01UL << C_CAN1_IF2_CMDMSK_W_CLRINTPND_Pos)             /*!< C_CAN1 IF2_CMDMSK_W: CLRINTPND Mask */\r
+#define C_CAN1_IF2_CMDMSK_W_CTRL_Pos                          4                                                         /*!< C_CAN1 IF2_CMDMSK_W: CTRL Position  */\r
+#define C_CAN1_IF2_CMDMSK_W_CTRL_Msk                          (0x01UL << C_CAN1_IF2_CMDMSK_W_CTRL_Pos)                  /*!< C_CAN1 IF2_CMDMSK_W: CTRL Mask      */\r
+#define C_CAN1_IF2_CMDMSK_W_ARB_Pos                           5                                                         /*!< C_CAN1 IF2_CMDMSK_W: ARB Position   */\r
+#define C_CAN1_IF2_CMDMSK_W_ARB_Msk                           (0x01UL << C_CAN1_IF2_CMDMSK_W_ARB_Pos)                   /*!< C_CAN1 IF2_CMDMSK_W: ARB Mask       */\r
+#define C_CAN1_IF2_CMDMSK_W_MASK_Pos                          6                                                         /*!< C_CAN1 IF2_CMDMSK_W: MASK Position  */\r
+#define C_CAN1_IF2_CMDMSK_W_MASK_Msk                          (0x01UL << C_CAN1_IF2_CMDMSK_W_MASK_Pos)                  /*!< C_CAN1 IF2_CMDMSK_W: MASK Mask      */\r
+#define C_CAN1_IF2_CMDMSK_W_WR_RD_Pos                         7                                                         /*!< C_CAN1 IF2_CMDMSK_W: WR_RD Position */\r
+#define C_CAN1_IF2_CMDMSK_W_WR_RD_Msk                         (0x01UL << C_CAN1_IF2_CMDMSK_W_WR_RD_Pos)                 /*!< C_CAN1 IF2_CMDMSK_W: WR_RD Mask     */\r
+\r
+// -----------------------------------  C_CAN1_IF2_CMDMSK_R  --------------------------------------\r
+#define C_CAN1_IF2_CMDMSK_R_DATA_B_Pos                        0                                                         /*!< C_CAN1 IF2_CMDMSK_R: DATA_B Position */\r
+#define C_CAN1_IF2_CMDMSK_R_DATA_B_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_R_DATA_B_Pos)                /*!< C_CAN1 IF2_CMDMSK_R: DATA_B Mask    */\r
+#define C_CAN1_IF2_CMDMSK_R_DATA_A_Pos                        1                                                         /*!< C_CAN1 IF2_CMDMSK_R: DATA_A Position */\r
+#define C_CAN1_IF2_CMDMSK_R_DATA_A_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_R_DATA_A_Pos)                /*!< C_CAN1 IF2_CMDMSK_R: DATA_A Mask    */\r
+#define C_CAN1_IF2_CMDMSK_R_NEWDAT_Pos                        2                                                         /*!< C_CAN1 IF2_CMDMSK_R: NEWDAT Position */\r
+#define C_CAN1_IF2_CMDMSK_R_NEWDAT_Msk                        (0x01UL << C_CAN1_IF2_CMDMSK_R_NEWDAT_Pos)                /*!< C_CAN1 IF2_CMDMSK_R: NEWDAT Mask    */\r
+#define C_CAN1_IF2_CMDMSK_R_CLRINTPND_Pos                     3                                                         /*!< C_CAN1 IF2_CMDMSK_R: CLRINTPND Position */\r
+#define C_CAN1_IF2_CMDMSK_R_CLRINTPND_Msk                     (0x01UL << C_CAN1_IF2_CMDMSK_R_CLRINTPND_Pos)             /*!< C_CAN1 IF2_CMDMSK_R: CLRINTPND Mask */\r
+#define C_CAN1_IF2_CMDMSK_R_CTRL_Pos                          4                                                         /*!< C_CAN1 IF2_CMDMSK_R: CTRL Position  */\r
+#define C_CAN1_IF2_CMDMSK_R_CTRL_Msk                          (0x01UL << C_CAN1_IF2_CMDMSK_R_CTRL_Pos)                  /*!< C_CAN1 IF2_CMDMSK_R: CTRL Mask      */\r
+#define C_CAN1_IF2_CMDMSK_R_ARB_Pos                           5                                                         /*!< C_CAN1 IF2_CMDMSK_R: ARB Position   */\r
+#define C_CAN1_IF2_CMDMSK_R_ARB_Msk                           (0x01UL << C_CAN1_IF2_CMDMSK_R_ARB_Pos)                   /*!< C_CAN1 IF2_CMDMSK_R: ARB Mask       */\r
+#define C_CAN1_IF2_CMDMSK_R_MASK_Pos                          6                                                         /*!< C_CAN1 IF2_CMDMSK_R: MASK Position  */\r
+#define C_CAN1_IF2_CMDMSK_R_MASK_Msk                          (0x01UL << C_CAN1_IF2_CMDMSK_R_MASK_Pos)                  /*!< C_CAN1 IF2_CMDMSK_R: MASK Mask      */\r
+#define C_CAN1_IF2_CMDMSK_R_WR_RD_Pos                         7                                                         /*!< C_CAN1 IF2_CMDMSK_R: WR_RD Position */\r
+#define C_CAN1_IF2_CMDMSK_R_WR_RD_Msk                         (0x01UL << C_CAN1_IF2_CMDMSK_R_WR_RD_Pos)                 /*!< C_CAN1 IF2_CMDMSK_R: WR_RD Mask     */\r
+\r
+// -------------------------------------  C_CAN1_IF2_MSK1  ----------------------------------------\r
+#define C_CAN1_IF2_MSK1_MSK15_0_Pos                           0                                                         /*!< C_CAN1 IF2_MSK1: MSK15_0 Position   */\r
+#define C_CAN1_IF2_MSK1_MSK15_0_Msk                           (0x0000ffffUL << C_CAN1_IF2_MSK1_MSK15_0_Pos)             /*!< C_CAN1 IF2_MSK1: MSK15_0 Mask       */\r
+\r
+// -------------------------------------  C_CAN1_IF2_MSK2  ----------------------------------------\r
+#define C_CAN1_IF2_MSK2_MSK28_16_Pos                          0                                                         /*!< C_CAN1 IF2_MSK2: MSK28_16 Position  */\r
+#define C_CAN1_IF2_MSK2_MSK28_16_Msk                          (0x00001fffUL << C_CAN1_IF2_MSK2_MSK28_16_Pos)            /*!< C_CAN1 IF2_MSK2: MSK28_16 Mask      */\r
+#define C_CAN1_IF2_MSK2_MDIR_Pos                              14                                                        /*!< C_CAN1 IF2_MSK2: MDIR Position      */\r
+#define C_CAN1_IF2_MSK2_MDIR_Msk                              (0x01UL << C_CAN1_IF2_MSK2_MDIR_Pos)                      /*!< C_CAN1 IF2_MSK2: MDIR Mask          */\r
+#define C_CAN1_IF2_MSK2_MXTD_Pos                              15                                                        /*!< C_CAN1 IF2_MSK2: MXTD Position      */\r
+#define C_CAN1_IF2_MSK2_MXTD_Msk                              (0x01UL << C_CAN1_IF2_MSK2_MXTD_Pos)                      /*!< C_CAN1 IF2_MSK2: MXTD Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF2_ARB1  ----------------------------------------\r
+#define C_CAN1_IF2_ARB1_ID15_0_Pos                            0                                                         /*!< C_CAN1 IF2_ARB1: ID15_0 Position    */\r
+#define C_CAN1_IF2_ARB1_ID15_0_Msk                            (0x0000ffffUL << C_CAN1_IF2_ARB1_ID15_0_Pos)              /*!< C_CAN1 IF2_ARB1: ID15_0 Mask        */\r
+\r
+// -------------------------------------  C_CAN1_IF2_ARB2  ----------------------------------------\r
+#define C_CAN1_IF2_ARB2_ID28_16_Pos                           0                                                         /*!< C_CAN1 IF2_ARB2: ID28_16 Position   */\r
+#define C_CAN1_IF2_ARB2_ID28_16_Msk                           (0x00001fffUL << C_CAN1_IF2_ARB2_ID28_16_Pos)             /*!< C_CAN1 IF2_ARB2: ID28_16 Mask       */\r
+#define C_CAN1_IF2_ARB2_DIR_Pos                               13                                                        /*!< C_CAN1 IF2_ARB2: DIR Position       */\r
+#define C_CAN1_IF2_ARB2_DIR_Msk                               (0x01UL << C_CAN1_IF2_ARB2_DIR_Pos)                       /*!< C_CAN1 IF2_ARB2: DIR Mask           */\r
+#define C_CAN1_IF2_ARB2_XTD_Pos                               14                                                        /*!< C_CAN1 IF2_ARB2: XTD Position       */\r
+#define C_CAN1_IF2_ARB2_XTD_Msk                               (0x01UL << C_CAN1_IF2_ARB2_XTD_Pos)                       /*!< C_CAN1 IF2_ARB2: XTD Mask           */\r
+#define C_CAN1_IF2_ARB2_MSGVAL_Pos                            15                                                        /*!< C_CAN1 IF2_ARB2: MSGVAL Position    */\r
+#define C_CAN1_IF2_ARB2_MSGVAL_Msk                            (0x01UL << C_CAN1_IF2_ARB2_MSGVAL_Pos)                    /*!< C_CAN1 IF2_ARB2: MSGVAL Mask        */\r
+\r
+// ------------------------------------  C_CAN1_IF2_MCTRL  ----------------------------------------\r
+#define C_CAN1_IF2_MCTRL_DLC3_0_Pos                           0                                                         /*!< C_CAN1 IF2_MCTRL: DLC3_0 Position   */\r
+#define C_CAN1_IF2_MCTRL_DLC3_0_Msk                           (0x0fUL << C_CAN1_IF2_MCTRL_DLC3_0_Pos)                   /*!< C_CAN1 IF2_MCTRL: DLC3_0 Mask       */\r
+#define C_CAN1_IF2_MCTRL_EOB_Pos                              7                                                         /*!< C_CAN1 IF2_MCTRL: EOB Position      */\r
+#define C_CAN1_IF2_MCTRL_EOB_Msk                              (0x01UL << C_CAN1_IF2_MCTRL_EOB_Pos)                      /*!< C_CAN1 IF2_MCTRL: EOB Mask          */\r
+#define C_CAN1_IF2_MCTRL_TXRQST_Pos                           8                                                         /*!< C_CAN1 IF2_MCTRL: TXRQST Position   */\r
+#define C_CAN1_IF2_MCTRL_TXRQST_Msk                           (0x01UL << C_CAN1_IF2_MCTRL_TXRQST_Pos)                   /*!< C_CAN1 IF2_MCTRL: TXRQST Mask       */\r
+#define C_CAN1_IF2_MCTRL_RMTEN_Pos                            9                                                         /*!< C_CAN1 IF2_MCTRL: RMTEN Position    */\r
+#define C_CAN1_IF2_MCTRL_RMTEN_Msk                            (0x01UL << C_CAN1_IF2_MCTRL_RMTEN_Pos)                    /*!< C_CAN1 IF2_MCTRL: RMTEN Mask        */\r
+#define C_CAN1_IF2_MCTRL_RXIE_Pos                             10                                                        /*!< C_CAN1 IF2_MCTRL: RXIE Position     */\r
+#define C_CAN1_IF2_MCTRL_RXIE_Msk                             (0x01UL << C_CAN1_IF2_MCTRL_RXIE_Pos)                     /*!< C_CAN1 IF2_MCTRL: RXIE Mask         */\r
+#define C_CAN1_IF2_MCTRL_TXIE_Pos                             11                                                        /*!< C_CAN1 IF2_MCTRL: TXIE Position     */\r
+#define C_CAN1_IF2_MCTRL_TXIE_Msk                             (0x01UL << C_CAN1_IF2_MCTRL_TXIE_Pos)                     /*!< C_CAN1 IF2_MCTRL: TXIE Mask         */\r
+#define C_CAN1_IF2_MCTRL_UMASK_Pos                            12                                                        /*!< C_CAN1 IF2_MCTRL: UMASK Position    */\r
+#define C_CAN1_IF2_MCTRL_UMASK_Msk                            (0x01UL << C_CAN1_IF2_MCTRL_UMASK_Pos)                    /*!< C_CAN1 IF2_MCTRL: UMASK Mask        */\r
+#define C_CAN1_IF2_MCTRL_INTPND_Pos                           13                                                        /*!< C_CAN1 IF2_MCTRL: INTPND Position   */\r
+#define C_CAN1_IF2_MCTRL_INTPND_Msk                           (0x01UL << C_CAN1_IF2_MCTRL_INTPND_Pos)                   /*!< C_CAN1 IF2_MCTRL: INTPND Mask       */\r
+#define C_CAN1_IF2_MCTRL_MSGLST_Pos                           14                                                        /*!< C_CAN1 IF2_MCTRL: MSGLST Position   */\r
+#define C_CAN1_IF2_MCTRL_MSGLST_Msk                           (0x01UL << C_CAN1_IF2_MCTRL_MSGLST_Pos)                   /*!< C_CAN1 IF2_MCTRL: MSGLST Mask       */\r
+#define C_CAN1_IF2_MCTRL_NEWDAT_Pos                           15                                                        /*!< C_CAN1 IF2_MCTRL: NEWDAT Position   */\r
+#define C_CAN1_IF2_MCTRL_NEWDAT_Msk                           (0x01UL << C_CAN1_IF2_MCTRL_NEWDAT_Pos)                   /*!< C_CAN1 IF2_MCTRL: NEWDAT Mask       */\r
+\r
+// -------------------------------------  C_CAN1_IF2_DA1  -----------------------------------------\r
+#define C_CAN1_IF2_DA1_DATA0_Pos                              0                                                         /*!< C_CAN1 IF2_DA1: DATA0 Position      */\r
+#define C_CAN1_IF2_DA1_DATA0_Msk                              (0x000000ffUL << C_CAN1_IF2_DA1_DATA0_Pos)                /*!< C_CAN1 IF2_DA1: DATA0 Mask          */\r
+#define C_CAN1_IF2_DA1_DATA1_Pos                              8                                                         /*!< C_CAN1 IF2_DA1: DATA1 Position      */\r
+#define C_CAN1_IF2_DA1_DATA1_Msk                              (0x000000ffUL << C_CAN1_IF2_DA1_DATA1_Pos)                /*!< C_CAN1 IF2_DA1: DATA1 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF2_DA2  -----------------------------------------\r
+#define C_CAN1_IF2_DA2_DATA2_Pos                              0                                                         /*!< C_CAN1 IF2_DA2: DATA2 Position      */\r
+#define C_CAN1_IF2_DA2_DATA2_Msk                              (0x000000ffUL << C_CAN1_IF2_DA2_DATA2_Pos)                /*!< C_CAN1 IF2_DA2: DATA2 Mask          */\r
+#define C_CAN1_IF2_DA2_DATA3_Pos                              8                                                         /*!< C_CAN1 IF2_DA2: DATA3 Position      */\r
+#define C_CAN1_IF2_DA2_DATA3_Msk                              (0x000000ffUL << C_CAN1_IF2_DA2_DATA3_Pos)                /*!< C_CAN1 IF2_DA2: DATA3 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF2_DB1  -----------------------------------------\r
+#define C_CAN1_IF2_DB1_DATA4_Pos                              0                                                         /*!< C_CAN1 IF2_DB1: DATA4 Position      */\r
+#define C_CAN1_IF2_DB1_DATA4_Msk                              (0x000000ffUL << C_CAN1_IF2_DB1_DATA4_Pos)                /*!< C_CAN1 IF2_DB1: DATA4 Mask          */\r
+#define C_CAN1_IF2_DB1_DATA5_Pos                              8                                                         /*!< C_CAN1 IF2_DB1: DATA5 Position      */\r
+#define C_CAN1_IF2_DB1_DATA5_Msk                              (0x000000ffUL << C_CAN1_IF2_DB1_DATA5_Pos)                /*!< C_CAN1 IF2_DB1: DATA5 Mask          */\r
+\r
+// -------------------------------------  C_CAN1_IF2_DB2  -----------------------------------------\r
+#define C_CAN1_IF2_DB2_DATA6_Pos                              0                                                         /*!< C_CAN1 IF2_DB2: DATA6 Position      */\r
+#define C_CAN1_IF2_DB2_DATA6_Msk                              (0x000000ffUL << C_CAN1_IF2_DB2_DATA6_Pos)                /*!< C_CAN1 IF2_DB2: DATA6 Mask          */\r
+#define C_CAN1_IF2_DB2_DATA7_Pos                              8                                                         /*!< C_CAN1 IF2_DB2: DATA7 Position      */\r
+#define C_CAN1_IF2_DB2_DATA7_Msk                              (0x000000ffUL << C_CAN1_IF2_DB2_DATA7_Pos)                /*!< C_CAN1 IF2_DB2: DATA7 Mask          */\r
+\r
+// --------------------------------------  C_CAN1_TXREQ1  -----------------------------------------\r
+#define C_CAN1_TXREQ1_TXRQST16_1_Pos                          0                                                         /*!< C_CAN1 TXREQ1: TXRQST16_1 Position  */\r
+#define C_CAN1_TXREQ1_TXRQST16_1_Msk                          (0x0000ffffUL << C_CAN1_TXREQ1_TXRQST16_1_Pos)            /*!< C_CAN1 TXREQ1: TXRQST16_1 Mask      */\r
+\r
+// --------------------------------------  C_CAN1_TXREQ2  -----------------------------------------\r
+#define C_CAN1_TXREQ2_TXRQST32_17_Pos                         0                                                         /*!< C_CAN1 TXREQ2: TXRQST32_17 Position */\r
+#define C_CAN1_TXREQ2_TXRQST32_17_Msk                         (0x0000ffffUL << C_CAN1_TXREQ2_TXRQST32_17_Pos)           /*!< C_CAN1 TXREQ2: TXRQST32_17 Mask     */\r
+\r
+// ---------------------------------------  C_CAN1_ND1  -------------------------------------------\r
+#define C_CAN1_ND1_NEWDAT16_1_Pos                             0                                                         /*!< C_CAN1 ND1: NEWDAT16_1 Position     */\r
+#define C_CAN1_ND1_NEWDAT16_1_Msk                             (0x0000ffffUL << C_CAN1_ND1_NEWDAT16_1_Pos)               /*!< C_CAN1 ND1: NEWDAT16_1 Mask         */\r
+\r
+// ---------------------------------------  C_CAN1_ND2  -------------------------------------------\r
+#define C_CAN1_ND2_NEWDAT32_17_Pos                            0                                                         /*!< C_CAN1 ND2: NEWDAT32_17 Position    */\r
+#define C_CAN1_ND2_NEWDAT32_17_Msk                            (0x0000ffffUL << C_CAN1_ND2_NEWDAT32_17_Pos)              /*!< C_CAN1 ND2: NEWDAT32_17 Mask        */\r
+\r
+// ---------------------------------------  C_CAN1_IR1  -------------------------------------------\r
+#define C_CAN1_IR1_INTPND16_1_Pos                             0                                                         /*!< C_CAN1 IR1: INTPND16_1 Position     */\r
+#define C_CAN1_IR1_INTPND16_1_Msk                             (0x0000ffffUL << C_CAN1_IR1_INTPND16_1_Pos)               /*!< C_CAN1 IR1: INTPND16_1 Mask         */\r
+\r
+// ---------------------------------------  C_CAN1_IR2  -------------------------------------------\r
+#define C_CAN1_IR2_INTPND32_17_Pos                            0                                                         /*!< C_CAN1 IR2: INTPND32_17 Position    */\r
+#define C_CAN1_IR2_INTPND32_17_Msk                            (0x0000ffffUL << C_CAN1_IR2_INTPND32_17_Pos)              /*!< C_CAN1 IR2: INTPND32_17 Mask        */\r
+\r
+// --------------------------------------  C_CAN1_MSGV1  ------------------------------------------\r
+#define C_CAN1_MSGV1_MSGVAL16_1_Pos                           0                                                         /*!< C_CAN1 MSGV1: MSGVAL16_1 Position   */\r
+#define C_CAN1_MSGV1_MSGVAL16_1_Msk                           (0x0000ffffUL << C_CAN1_MSGV1_MSGVAL16_1_Pos)             /*!< C_CAN1 MSGV1: MSGVAL16_1 Mask       */\r
+\r
+// --------------------------------------  C_CAN1_MSGV2  ------------------------------------------\r
+#define C_CAN1_MSGV2_MSGVAL32_17_Pos                          0                                                         /*!< C_CAN1 MSGV2: MSGVAL32_17 Position  */\r
+#define C_CAN1_MSGV2_MSGVAL32_17_Msk                          (0x0000ffffUL << C_CAN1_MSGV2_MSGVAL32_17_Pos)            /*!< C_CAN1 MSGV2: MSGVAL32_17 Mask      */\r
+\r
+// --------------------------------------  C_CAN1_CLKDIV  -----------------------------------------\r
+#define C_CAN1_CLKDIV_CLKDIVVAL_Pos                           0                                                         /*!< C_CAN1 CLKDIV: CLKDIVVAL Position   */\r
+#define C_CAN1_CLKDIV_CLKDIVVAL_Msk                           (0x0fUL << C_CAN1_CLKDIV_CLKDIVVAL_Pos)                   /*!< C_CAN1 CLKDIV: CLKDIVVAL Mask       */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                RITIMER Position & Mask                               -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -------------------------------------  RITIMER_COMPVAL  ----------------------------------------\r
+#define RITIMER_COMPVAL_RICOMP_Pos                            0                                                         /*!< RITIMER COMPVAL: RICOMP Position    */\r
+#define RITIMER_COMPVAL_RICOMP_Msk                            (0xffffffffUL << RITIMER_COMPVAL_RICOMP_Pos)              /*!< RITIMER COMPVAL: RICOMP Mask        */\r
+\r
+// --------------------------------------  RITIMER_MASK  ------------------------------------------\r
+#define RITIMER_MASK_RIMASK_Pos                               0                                                         /*!< RITIMER MASK: RIMASK Position       */\r
+#define RITIMER_MASK_RIMASK_Msk                               (0xffffffffUL << RITIMER_MASK_RIMASK_Pos)                 /*!< RITIMER MASK: RIMASK Mask           */\r
+\r
+// --------------------------------------  RITIMER_CTRL  ------------------------------------------\r
+#define RITIMER_CTRL_RITINT_Pos                               0                                                         /*!< RITIMER CTRL: RITINT Position       */\r
+#define RITIMER_CTRL_RITINT_Msk                               (0x01UL << RITIMER_CTRL_RITINT_Pos)                       /*!< RITIMER CTRL: RITINT Mask           */\r
+#define RITIMER_CTRL_RITENCLR_Pos                             1                                                         /*!< RITIMER CTRL: RITENCLR Position     */\r
+#define RITIMER_CTRL_RITENCLR_Msk                             (0x01UL << RITIMER_CTRL_RITENCLR_Pos)                     /*!< RITIMER CTRL: RITENCLR Mask         */\r
+#define RITIMER_CTRL_RITENBR_Pos                              2                                                         /*!< RITIMER CTRL: RITENBR Position      */\r
+#define RITIMER_CTRL_RITENBR_Msk                              (0x01UL << RITIMER_CTRL_RITENBR_Pos)                      /*!< RITIMER CTRL: RITENBR Mask          */\r
+#define RITIMER_CTRL_RITEN_Pos                                3                                                         /*!< RITIMER CTRL: RITEN Position        */\r
+#define RITIMER_CTRL_RITEN_Msk                                (0x01UL << RITIMER_CTRL_RITEN_Pos)                        /*!< RITIMER CTRL: RITEN Mask            */\r
+\r
+// -------------------------------------  RITIMER_COUNTER  ----------------------------------------\r
+#define RITIMER_COUNTER_RICOUNTER_Pos                         0                                                         /*!< RITIMER COUNTER: RICOUNTER Position */\r
+#define RITIMER_COUNTER_RICOUNTER_Msk                         (0xffffffffUL << RITIMER_COUNTER_RICOUNTER_Pos)           /*!< RITIMER COUNTER: RICOUNTER Mask     */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  QEI Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  QEI_CON  --------------------------------------------\r
+#define QEI_CON_RESP_Pos                                      0                                                         /*!< QEI CON: RESP Position              */\r
+#define QEI_CON_RESP_Msk                                      (0x01UL << QEI_CON_RESP_Pos)                              /*!< QEI CON: RESP Mask                  */\r
+#define QEI_CON_RESPI_Pos                                     1                                                         /*!< QEI CON: RESPI Position             */\r
+#define QEI_CON_RESPI_Msk                                     (0x01UL << QEI_CON_RESPI_Pos)                             /*!< QEI CON: RESPI Mask                 */\r
+#define QEI_CON_RESV_Pos                                      2                                                         /*!< QEI CON: RESV Position              */\r
+#define QEI_CON_RESV_Msk                                      (0x01UL << QEI_CON_RESV_Pos)                              /*!< QEI CON: RESV Mask                  */\r
+#define QEI_CON_RESI_Pos                                      3                                                         /*!< QEI CON: RESI Position              */\r
+#define QEI_CON_RESI_Msk                                      (0x01UL << QEI_CON_RESI_Pos)                              /*!< QEI CON: RESI Mask                  */\r
+\r
+// ----------------------------------------  QEI_STAT  --------------------------------------------\r
+#define QEI_STAT_DIR_Pos                                      0                                                         /*!< QEI STAT: DIR Position              */\r
+#define QEI_STAT_DIR_Msk                                      (0x01UL << QEI_STAT_DIR_Pos)                              /*!< QEI STAT: DIR Mask                  */\r
+\r
+// ----------------------------------------  QEI_CONF  --------------------------------------------\r
+#define QEI_CONF_DIRINV_Pos                                   0                                                         /*!< QEI CONF: DIRINV Position           */\r
+#define QEI_CONF_DIRINV_Msk                                   (0x01UL << QEI_CONF_DIRINV_Pos)                           /*!< QEI CONF: DIRINV Mask               */\r
+#define QEI_CONF_SIGMODE_Pos                                  1                                                         /*!< QEI CONF: SIGMODE Position          */\r
+#define QEI_CONF_SIGMODE_Msk                                  (0x01UL << QEI_CONF_SIGMODE_Pos)                          /*!< QEI CONF: SIGMODE Mask              */\r
+#define QEI_CONF_CAPMODE_Pos                                  2                                                         /*!< QEI CONF: CAPMODE Position          */\r
+#define QEI_CONF_CAPMODE_Msk                                  (0x01UL << QEI_CONF_CAPMODE_Pos)                          /*!< QEI CONF: CAPMODE Mask              */\r
+#define QEI_CONF_INVINX_Pos                                   3                                                         /*!< QEI CONF: INVINX Position           */\r
+#define QEI_CONF_INVINX_Msk                                   (0x01UL << QEI_CONF_INVINX_Pos)                           /*!< QEI CONF: INVINX Mask               */\r
+#define QEI_CONF_CRESPI_Pos                                   4                                                         /*!< QEI CONF: CRESPI Position           */\r
+#define QEI_CONF_CRESPI_Msk                                   (0x01UL << QEI_CONF_CRESPI_Pos)                           /*!< QEI CONF: CRESPI Mask               */\r
+#define QEI_CONF_INXGATE_Pos                                  16                                                        /*!< QEI CONF: INXGATE Position          */\r
+#define QEI_CONF_INXGATE_Msk                                  (0x0fUL << QEI_CONF_INXGATE_Pos)                          /*!< QEI CONF: INXGATE Mask              */\r
+\r
+// -----------------------------------------  QEI_POS  --------------------------------------------\r
+#define QEI_POS_POS_Pos                                       0                                                         /*!< QEI POS: POS Position               */\r
+#define QEI_POS_POS_Msk                                       (0xffffffffUL << QEI_POS_POS_Pos)                         /*!< QEI POS: POS Mask                   */\r
+\r
+// ---------------------------------------  QEI_MAXPOS  -------------------------------------------\r
+#define QEI_MAXPOS_MAXPOS_Pos                                 0                                                         /*!< QEI MAXPOS: MAXPOS Position         */\r
+#define QEI_MAXPOS_MAXPOS_Msk                                 (0xffffffffUL << QEI_MAXPOS_MAXPOS_Pos)                   /*!< QEI MAXPOS: MAXPOS Mask             */\r
+\r
+// ---------------------------------------  QEI_CMPOS0  -------------------------------------------\r
+#define QEI_CMPOS0_PCMP0_Pos                                  0                                                         /*!< QEI CMPOS0: PCMP0 Position          */\r
+#define QEI_CMPOS0_PCMP0_Msk                                  (0xffffffffUL << QEI_CMPOS0_PCMP0_Pos)                    /*!< QEI CMPOS0: PCMP0 Mask              */\r
+\r
+// ---------------------------------------  QEI_CMPOS1  -------------------------------------------\r
+#define QEI_CMPOS1_PCMP1_Pos                                  0                                                         /*!< QEI CMPOS1: PCMP1 Position          */\r
+#define QEI_CMPOS1_PCMP1_Msk                                  (0xffffffffUL << QEI_CMPOS1_PCMP1_Pos)                    /*!< QEI CMPOS1: PCMP1 Mask              */\r
+\r
+// ---------------------------------------  QEI_CMPOS2  -------------------------------------------\r
+#define QEI_CMPOS2_PCMP2_Pos                                  0                                                         /*!< QEI CMPOS2: PCMP2 Position          */\r
+#define QEI_CMPOS2_PCMP2_Msk                                  (0xffffffffUL << QEI_CMPOS2_PCMP2_Pos)                    /*!< QEI CMPOS2: PCMP2 Mask              */\r
+\r
+// ---------------------------------------  QEI_INXCNT  -------------------------------------------\r
+#define QEI_INXCNT_ENCPOS_Pos                                 0                                                         /*!< QEI INXCNT: ENCPOS Position         */\r
+#define QEI_INXCNT_ENCPOS_Msk                                 (0xffffffffUL << QEI_INXCNT_ENCPOS_Pos)                   /*!< QEI INXCNT: ENCPOS Mask             */\r
+\r
+// ---------------------------------------  QEI_INXCMP0  ------------------------------------------\r
+#define QEI_INXCMP0_ICMP0_Pos                                 0                                                         /*!< QEI INXCMP0: ICMP0 Position         */\r
+#define QEI_INXCMP0_ICMP0_Msk                                 (0xffffffffUL << QEI_INXCMP0_ICMP0_Pos)                   /*!< QEI INXCMP0: ICMP0 Mask             */\r
+\r
+// ----------------------------------------  QEI_LOAD  --------------------------------------------\r
+#define QEI_LOAD_VELLOAD_Pos                                  0                                                         /*!< QEI LOAD: VELLOAD Position          */\r
+#define QEI_LOAD_VELLOAD_Msk                                  (0xffffffffUL << QEI_LOAD_VELLOAD_Pos)                    /*!< QEI LOAD: VELLOAD Mask              */\r
+\r
+// ----------------------------------------  QEI_TIME  --------------------------------------------\r
+#define QEI_TIME_VELVAL_Pos                                   0                                                         /*!< QEI TIME: VELVAL Position           */\r
+#define QEI_TIME_VELVAL_Msk                                   (0xffffffffUL << QEI_TIME_VELVAL_Pos)                     /*!< QEI TIME: VELVAL Mask               */\r
+\r
+// -----------------------------------------  QEI_VEL  --------------------------------------------\r
+#define QEI_VEL_VELPC_Pos                                     0                                                         /*!< QEI VEL: VELPC Position             */\r
+#define QEI_VEL_VELPC_Msk                                     (0xffffffffUL << QEI_VEL_VELPC_Pos)                       /*!< QEI VEL: VELPC Mask                 */\r
+\r
+// -----------------------------------------  QEI_CAP  --------------------------------------------\r
+#define QEI_CAP_VELCAP_Pos                                    0                                                         /*!< QEI CAP: VELCAP Position            */\r
+#define QEI_CAP_VELCAP_Msk                                    (0xffffffffUL << QEI_CAP_VELCAP_Pos)                      /*!< QEI CAP: VELCAP Mask                */\r
+\r
+// ---------------------------------------  QEI_VELCOMP  ------------------------------------------\r
+#define QEI_VELCOMP_VELCMP_Pos                                0                                                         /*!< QEI VELCOMP: VELCMP Position        */\r
+#define QEI_VELCOMP_VELCMP_Msk                                (0xffffffffUL << QEI_VELCOMP_VELCMP_Pos)                  /*!< QEI VELCOMP: VELCMP Mask            */\r
+\r
+// --------------------------------------  QEI_FILTERPHA  -----------------------------------------\r
+#define QEI_FILTERPHA_FILTA_Pos                               0                                                         /*!< QEI FILTERPHA: FILTA Position       */\r
+#define QEI_FILTERPHA_FILTA_Msk                               (0xffffffffUL << QEI_FILTERPHA_FILTA_Pos)                 /*!< QEI FILTERPHA: FILTA Mask           */\r
+\r
+// --------------------------------------  QEI_FILTERPHB  -----------------------------------------\r
+#define QEI_FILTERPHB_FILTB_Pos                               0                                                         /*!< QEI FILTERPHB: FILTB Position       */\r
+#define QEI_FILTERPHB_FILTB_Msk                               (0xffffffffUL << QEI_FILTERPHB_FILTB_Pos)                 /*!< QEI FILTERPHB: FILTB Mask           */\r
+\r
+// --------------------------------------  QEI_FILTERINX  -----------------------------------------\r
+#define QEI_FILTERINX_FITLINX_Pos                             0                                                         /*!< QEI FILTERINX: FITLINX Position     */\r
+#define QEI_FILTERINX_FITLINX_Msk                             (0xffffffffUL << QEI_FILTERINX_FITLINX_Pos)               /*!< QEI FILTERINX: FITLINX Mask         */\r
+\r
+// ---------------------------------------  QEI_WINDOW  -------------------------------------------\r
+#define QEI_WINDOW_WINDOW_Pos                                 0                                                         /*!< QEI WINDOW: WINDOW Position         */\r
+#define QEI_WINDOW_WINDOW_Msk                                 (0xffffffffUL << QEI_WINDOW_WINDOW_Pos)                   /*!< QEI WINDOW: WINDOW Mask             */\r
+\r
+// ---------------------------------------  QEI_INXCMP1  ------------------------------------------\r
+#define QEI_INXCMP1_ICMP1_Pos                                 0                                                         /*!< QEI INXCMP1: ICMP1 Position         */\r
+#define QEI_INXCMP1_ICMP1_Msk                                 (0xffffffffUL << QEI_INXCMP1_ICMP1_Pos)                   /*!< QEI INXCMP1: ICMP1 Mask             */\r
+\r
+// ---------------------------------------  QEI_INXCMP2  ------------------------------------------\r
+#define QEI_INXCMP2_ICMP2_Pos                                 0                                                         /*!< QEI INXCMP2: ICMP2 Position         */\r
+#define QEI_INXCMP2_ICMP2_Msk                                 (0xffffffffUL << QEI_INXCMP2_ICMP2_Pos)                   /*!< QEI INXCMP2: ICMP2 Mask             */\r
+\r
+// -----------------------------------------  QEI_IEC  --------------------------------------------\r
+#define QEI_IEC_INX_EN_Pos                                    0                                                         /*!< QEI IEC: INX_EN Position            */\r
+#define QEI_IEC_INX_EN_Msk                                    (0x01UL << QEI_IEC_INX_EN_Pos)                            /*!< QEI IEC: INX_EN Mask                */\r
+#define QEI_IEC_TIM_EN_Pos                                    1                                                         /*!< QEI IEC: TIM_EN Position            */\r
+#define QEI_IEC_TIM_EN_Msk                                    (0x01UL << QEI_IEC_TIM_EN_Pos)                            /*!< QEI IEC: TIM_EN Mask                */\r
+#define QEI_IEC_VELC_EN_Pos                                   2                                                         /*!< QEI IEC: VELC_EN Position           */\r
+#define QEI_IEC_VELC_EN_Msk                                   (0x01UL << QEI_IEC_VELC_EN_Pos)                           /*!< QEI IEC: VELC_EN Mask               */\r
+#define QEI_IEC_DIR_EN_Pos                                    3                                                         /*!< QEI IEC: DIR_EN Position            */\r
+#define QEI_IEC_DIR_EN_Msk                                    (0x01UL << QEI_IEC_DIR_EN_Pos)                            /*!< QEI IEC: DIR_EN Mask                */\r
+#define QEI_IEC_ERR_EN_Pos                                    4                                                         /*!< QEI IEC: ERR_EN Position            */\r
+#define QEI_IEC_ERR_EN_Msk                                    (0x01UL << QEI_IEC_ERR_EN_Pos)                            /*!< QEI IEC: ERR_EN Mask                */\r
+#define QEI_IEC_ENCLK_EN_Pos                                  5                                                         /*!< QEI IEC: ENCLK_EN Position          */\r
+#define QEI_IEC_ENCLK_EN_Msk                                  (0x01UL << QEI_IEC_ENCLK_EN_Pos)                          /*!< QEI IEC: ENCLK_EN Mask              */\r
+#define QEI_IEC_POS0_Int_Pos                                  6                                                         /*!< QEI IEC: POS0_Int Position          */\r
+#define QEI_IEC_POS0_Int_Msk                                  (0x01UL << QEI_IEC_POS0_Int_Pos)                          /*!< QEI IEC: POS0_Int Mask              */\r
+#define QEI_IEC_POS1_Int_Pos                                  7                                                         /*!< QEI IEC: POS1_Int Position          */\r
+#define QEI_IEC_POS1_Int_Msk                                  (0x01UL << QEI_IEC_POS1_Int_Pos)                          /*!< QEI IEC: POS1_Int Mask              */\r
+#define QEI_IEC_POS2_Int_Pos                                  8                                                         /*!< QEI IEC: POS2_Int Position          */\r
+#define QEI_IEC_POS2_Int_Msk                                  (0x01UL << QEI_IEC_POS2_Int_Pos)                          /*!< QEI IEC: POS2_Int Mask              */\r
+#define QEI_IEC_REV_Int_Pos                                   9                                                         /*!< QEI IEC: REV_Int Position           */\r
+#define QEI_IEC_REV_Int_Msk                                   (0x01UL << QEI_IEC_REV_Int_Pos)                           /*!< QEI IEC: REV_Int Mask               */\r
+#define QEI_IEC_POS0REV_Int_Pos                               10                                                        /*!< QEI IEC: POS0REV_Int Position       */\r
+#define QEI_IEC_POS0REV_Int_Msk                               (0x01UL << QEI_IEC_POS0REV_Int_Pos)                       /*!< QEI IEC: POS0REV_Int Mask           */\r
+#define QEI_IEC_POS1REV_Int_Pos                               11                                                        /*!< QEI IEC: POS1REV_Int Position       */\r
+#define QEI_IEC_POS1REV_Int_Msk                               (0x01UL << QEI_IEC_POS1REV_Int_Pos)                       /*!< QEI IEC: POS1REV_Int Mask           */\r
+#define QEI_IEC_POS2REV_Int_Pos                               12                                                        /*!< QEI IEC: POS2REV_Int Position       */\r
+#define QEI_IEC_POS2REV_Int_Msk                               (0x01UL << QEI_IEC_POS2REV_Int_Pos)                       /*!< QEI IEC: POS2REV_Int Mask           */\r
+#define QEI_IEC_REV1_Int_Pos                                  13                                                        /*!< QEI IEC: REV1_Int Position          */\r
+#define QEI_IEC_REV1_Int_Msk                                  (0x01UL << QEI_IEC_REV1_Int_Pos)                          /*!< QEI IEC: REV1_Int Mask              */\r
+#define QEI_IEC_REV2_Int_Pos                                  14                                                        /*!< QEI IEC: REV2_Int Position          */\r
+#define QEI_IEC_REV2_Int_Msk                                  (0x01UL << QEI_IEC_REV2_Int_Pos)                          /*!< QEI IEC: REV2_Int Mask              */\r
+#define QEI_IEC_MAXPOS_Int_Pos                                15                                                        /*!< QEI IEC: MAXPOS_Int Position        */\r
+#define QEI_IEC_MAXPOS_Int_Msk                                (0x01UL << QEI_IEC_MAXPOS_Int_Pos)                        /*!< QEI IEC: MAXPOS_Int Mask            */\r
+\r
+// -----------------------------------------  QEI_IES  --------------------------------------------\r
+#define QEI_IES_INX_EN_Pos                                    0                                                         /*!< QEI IES: INX_EN Position            */\r
+#define QEI_IES_INX_EN_Msk                                    (0x01UL << QEI_IES_INX_EN_Pos)                            /*!< QEI IES: INX_EN Mask                */\r
+#define QEI_IES_TIM_EN_Pos                                    1                                                         /*!< QEI IES: TIM_EN Position            */\r
+#define QEI_IES_TIM_EN_Msk                                    (0x01UL << QEI_IES_TIM_EN_Pos)                            /*!< QEI IES: TIM_EN Mask                */\r
+#define QEI_IES_VELC_EN_Pos                                   2                                                         /*!< QEI IES: VELC_EN Position           */\r
+#define QEI_IES_VELC_EN_Msk                                   (0x01UL << QEI_IES_VELC_EN_Pos)                           /*!< QEI IES: VELC_EN Mask               */\r
+#define QEI_IES_DIR_EN_Pos                                    3                                                         /*!< QEI IES: DIR_EN Position            */\r
+#define QEI_IES_DIR_EN_Msk                                    (0x01UL << QEI_IES_DIR_EN_Pos)                            /*!< QEI IES: DIR_EN Mask                */\r
+#define QEI_IES_ERR_EN_Pos                                    4                                                         /*!< QEI IES: ERR_EN Position            */\r
+#define QEI_IES_ERR_EN_Msk                                    (0x01UL << QEI_IES_ERR_EN_Pos)                            /*!< QEI IES: ERR_EN Mask                */\r
+#define QEI_IES_ENCLK_EN_Pos                                  5                                                         /*!< QEI IES: ENCLK_EN Position          */\r
+#define QEI_IES_ENCLK_EN_Msk                                  (0x01UL << QEI_IES_ENCLK_EN_Pos)                          /*!< QEI IES: ENCLK_EN Mask              */\r
+#define QEI_IES_POS0_Int_Pos                                  6                                                         /*!< QEI IES: POS0_Int Position          */\r
+#define QEI_IES_POS0_Int_Msk                                  (0x01UL << QEI_IES_POS0_Int_Pos)                          /*!< QEI IES: POS0_Int Mask              */\r
+#define QEI_IES_POS1_Int_Pos                                  7                                                         /*!< QEI IES: POS1_Int Position          */\r
+#define QEI_IES_POS1_Int_Msk                                  (0x01UL << QEI_IES_POS1_Int_Pos)                          /*!< QEI IES: POS1_Int Mask              */\r
+#define QEI_IES_POS2_Int_Pos                                  8                                                         /*!< QEI IES: POS2_Int Position          */\r
+#define QEI_IES_POS2_Int_Msk                                  (0x01UL << QEI_IES_POS2_Int_Pos)                          /*!< QEI IES: POS2_Int Mask              */\r
+#define QEI_IES_REV_Int_Pos                                   9                                                         /*!< QEI IES: REV_Int Position           */\r
+#define QEI_IES_REV_Int_Msk                                   (0x01UL << QEI_IES_REV_Int_Pos)                           /*!< QEI IES: REV_Int Mask               */\r
+#define QEI_IES_POS0REV_Int_Pos                               10                                                        /*!< QEI IES: POS0REV_Int Position       */\r
+#define QEI_IES_POS0REV_Int_Msk                               (0x01UL << QEI_IES_POS0REV_Int_Pos)                       /*!< QEI IES: POS0REV_Int Mask           */\r
+#define QEI_IES_POS1REV_Int_Pos                               11                                                        /*!< QEI IES: POS1REV_Int Position       */\r
+#define QEI_IES_POS1REV_Int_Msk                               (0x01UL << QEI_IES_POS1REV_Int_Pos)                       /*!< QEI IES: POS1REV_Int Mask           */\r
+#define QEI_IES_POS2REV_Int_Pos                               12                                                        /*!< QEI IES: POS2REV_Int Position       */\r
+#define QEI_IES_POS2REV_Int_Msk                               (0x01UL << QEI_IES_POS2REV_Int_Pos)                       /*!< QEI IES: POS2REV_Int Mask           */\r
+#define QEI_IES_REV1_Int_Pos                                  13                                                        /*!< QEI IES: REV1_Int Position          */\r
+#define QEI_IES_REV1_Int_Msk                                  (0x01UL << QEI_IES_REV1_Int_Pos)                          /*!< QEI IES: REV1_Int Mask              */\r
+#define QEI_IES_REV2_Int_Pos                                  14                                                        /*!< QEI IES: REV2_Int Position          */\r
+#define QEI_IES_REV2_Int_Msk                                  (0x01UL << QEI_IES_REV2_Int_Pos)                          /*!< QEI IES: REV2_Int Mask              */\r
+#define QEI_IES_MAXPOS_Int_Pos                                15                                                        /*!< QEI IES: MAXPOS_Int Position        */\r
+#define QEI_IES_MAXPOS_Int_Msk                                (0x01UL << QEI_IES_MAXPOS_Int_Pos)                        /*!< QEI IES: MAXPOS_Int Mask            */\r
+\r
+// ---------------------------------------  QEI_INTSTAT  ------------------------------------------\r
+#define QEI_INTSTAT_INX_Int_Pos                               0                                                         /*!< QEI INTSTAT: INX_Int Position       */\r
+#define QEI_INTSTAT_INX_Int_Msk                               (0x01UL << QEI_INTSTAT_INX_Int_Pos)                       /*!< QEI INTSTAT: INX_Int Mask           */\r
+#define QEI_INTSTAT_TIM_Int_Pos                               1                                                         /*!< QEI INTSTAT: TIM_Int Position       */\r
+#define QEI_INTSTAT_TIM_Int_Msk                               (0x01UL << QEI_INTSTAT_TIM_Int_Pos)                       /*!< QEI INTSTAT: TIM_Int Mask           */\r
+#define QEI_INTSTAT_VELC_Int_Pos                              2                                                         /*!< QEI INTSTAT: VELC_Int Position      */\r
+#define QEI_INTSTAT_VELC_Int_Msk                              (0x01UL << QEI_INTSTAT_VELC_Int_Pos)                      /*!< QEI INTSTAT: VELC_Int Mask          */\r
+#define QEI_INTSTAT_DIR_Int_Pos                               3                                                         /*!< QEI INTSTAT: DIR_Int Position       */\r
+#define QEI_INTSTAT_DIR_Int_Msk                               (0x01UL << QEI_INTSTAT_DIR_Int_Pos)                       /*!< QEI INTSTAT: DIR_Int Mask           */\r
+#define QEI_INTSTAT_ERR_Int_Pos                               4                                                         /*!< QEI INTSTAT: ERR_Int Position       */\r
+#define QEI_INTSTAT_ERR_Int_Msk                               (0x01UL << QEI_INTSTAT_ERR_Int_Pos)                       /*!< QEI INTSTAT: ERR_Int Mask           */\r
+#define QEI_INTSTAT_ENCLK_Int_Pos                             5                                                         /*!< QEI INTSTAT: ENCLK_Int Position     */\r
+#define QEI_INTSTAT_ENCLK_Int_Msk                             (0x01UL << QEI_INTSTAT_ENCLK_Int_Pos)                     /*!< QEI INTSTAT: ENCLK_Int Mask         */\r
+#define QEI_INTSTAT_POS0_Int_Pos                              6                                                         /*!< QEI INTSTAT: POS0_Int Position      */\r
+#define QEI_INTSTAT_POS0_Int_Msk                              (0x01UL << QEI_INTSTAT_POS0_Int_Pos)                      /*!< QEI INTSTAT: POS0_Int Mask          */\r
+#define QEI_INTSTAT_POS1_Int_Pos                              7                                                         /*!< QEI INTSTAT: POS1_Int Position      */\r
+#define QEI_INTSTAT_POS1_Int_Msk                              (0x01UL << QEI_INTSTAT_POS1_Int_Pos)                      /*!< QEI INTSTAT: POS1_Int Mask          */\r
+#define QEI_INTSTAT_POS2_Int_Pos                              8                                                         /*!< QEI INTSTAT: POS2_Int Position      */\r
+#define QEI_INTSTAT_POS2_Int_Msk                              (0x01UL << QEI_INTSTAT_POS2_Int_Pos)                      /*!< QEI INTSTAT: POS2_Int Mask          */\r
+#define QEI_INTSTAT_REV_Int_Pos                               9                                                         /*!< QEI INTSTAT: REV_Int Position       */\r
+#define QEI_INTSTAT_REV_Int_Msk                               (0x01UL << QEI_INTSTAT_REV_Int_Pos)                       /*!< QEI INTSTAT: REV_Int Mask           */\r
+#define QEI_INTSTAT_POS0REV_Int_Pos                           10                                                        /*!< QEI INTSTAT: POS0REV_Int Position   */\r
+#define QEI_INTSTAT_POS0REV_Int_Msk                           (0x01UL << QEI_INTSTAT_POS0REV_Int_Pos)                   /*!< QEI INTSTAT: POS0REV_Int Mask       */\r
+#define QEI_INTSTAT_POS1REV_Int_Pos                           11                                                        /*!< QEI INTSTAT: POS1REV_Int Position   */\r
+#define QEI_INTSTAT_POS1REV_Int_Msk                           (0x01UL << QEI_INTSTAT_POS1REV_Int_Pos)                   /*!< QEI INTSTAT: POS1REV_Int Mask       */\r
+#define QEI_INTSTAT_POS2REV_Int_Pos                           12                                                        /*!< QEI INTSTAT: POS2REV_Int Position   */\r
+#define QEI_INTSTAT_POS2REV_Int_Msk                           (0x01UL << QEI_INTSTAT_POS2REV_Int_Pos)                   /*!< QEI INTSTAT: POS2REV_Int Mask       */\r
+#define QEI_INTSTAT_REV1_Int_Pos                              13                                                        /*!< QEI INTSTAT: REV1_Int Position      */\r
+#define QEI_INTSTAT_REV1_Int_Msk                              (0x01UL << QEI_INTSTAT_REV1_Int_Pos)                      /*!< QEI INTSTAT: REV1_Int Mask          */\r
+#define QEI_INTSTAT_REV2_Int_Pos                              14                                                        /*!< QEI INTSTAT: REV2_Int Position      */\r
+#define QEI_INTSTAT_REV2_Int_Msk                              (0x01UL << QEI_INTSTAT_REV2_Int_Pos)                      /*!< QEI INTSTAT: REV2_Int Mask          */\r
+#define QEI_INTSTAT_MAXPOS_Int_Pos                            15                                                        /*!< QEI INTSTAT: MAXPOS_Int Position    */\r
+#define QEI_INTSTAT_MAXPOS_Int_Msk                            (0x01UL << QEI_INTSTAT_MAXPOS_Int_Pos)                    /*!< QEI INTSTAT: MAXPOS_Int Mask        */\r
+\r
+// -----------------------------------------  QEI_IE  ---------------------------------------------\r
+#define QEI_IE_INX_Int_Pos                                    0                                                         /*!< QEI IE: INX_Int Position            */\r
+#define QEI_IE_INX_Int_Msk                                    (0x01UL << QEI_IE_INX_Int_Pos)                            /*!< QEI IE: INX_Int Mask                */\r
+#define QEI_IE_TIM_Int_Pos                                    1                                                         /*!< QEI IE: TIM_Int Position            */\r
+#define QEI_IE_TIM_Int_Msk                                    (0x01UL << QEI_IE_TIM_Int_Pos)                            /*!< QEI IE: TIM_Int Mask                */\r
+#define QEI_IE_VELC_Int_Pos                                   2                                                         /*!< QEI IE: VELC_Int Position           */\r
+#define QEI_IE_VELC_Int_Msk                                   (0x01UL << QEI_IE_VELC_Int_Pos)                           /*!< QEI IE: VELC_Int Mask               */\r
+#define QEI_IE_DIR_Int_Pos                                    3                                                         /*!< QEI IE: DIR_Int Position            */\r
+#define QEI_IE_DIR_Int_Msk                                    (0x01UL << QEI_IE_DIR_Int_Pos)                            /*!< QEI IE: DIR_Int Mask                */\r
+#define QEI_IE_ERR_Int_Pos                                    4                                                         /*!< QEI IE: ERR_Int Position            */\r
+#define QEI_IE_ERR_Int_Msk                                    (0x01UL << QEI_IE_ERR_Int_Pos)                            /*!< QEI IE: ERR_Int Mask                */\r
+#define QEI_IE_ENCLK_Int_Pos                                  5                                                         /*!< QEI IE: ENCLK_Int Position          */\r
+#define QEI_IE_ENCLK_Int_Msk                                  (0x01UL << QEI_IE_ENCLK_Int_Pos)                          /*!< QEI IE: ENCLK_Int Mask              */\r
+#define QEI_IE_POS0_Int_Pos                                   6                                                         /*!< QEI IE: POS0_Int Position           */\r
+#define QEI_IE_POS0_Int_Msk                                   (0x01UL << QEI_IE_POS0_Int_Pos)                           /*!< QEI IE: POS0_Int Mask               */\r
+#define QEI_IE_POS1_Int_Pos                                   7                                                         /*!< QEI IE: POS1_Int Position           */\r
+#define QEI_IE_POS1_Int_Msk                                   (0x01UL << QEI_IE_POS1_Int_Pos)                           /*!< QEI IE: POS1_Int Mask               */\r
+#define QEI_IE_POS2_Int_Pos                                   8                                                         /*!< QEI IE: POS2_Int Position           */\r
+#define QEI_IE_POS2_Int_Msk                                   (0x01UL << QEI_IE_POS2_Int_Pos)                           /*!< QEI IE: POS2_Int Mask               */\r
+#define QEI_IE_REV_Int_Pos                                    9                                                         /*!< QEI IE: REV_Int Position            */\r
+#define QEI_IE_REV_Int_Msk                                    (0x01UL << QEI_IE_REV_Int_Pos)                            /*!< QEI IE: REV_Int Mask                */\r
+#define QEI_IE_POS0REV_Int_Pos                                10                                                        /*!< QEI IE: POS0REV_Int Position        */\r
+#define QEI_IE_POS0REV_Int_Msk                                (0x01UL << QEI_IE_POS0REV_Int_Pos)                        /*!< QEI IE: POS0REV_Int Mask            */\r
+#define QEI_IE_POS1REV_Int_Pos                                11                                                        /*!< QEI IE: POS1REV_Int Position        */\r
+#define QEI_IE_POS1REV_Int_Msk                                (0x01UL << QEI_IE_POS1REV_Int_Pos)                        /*!< QEI IE: POS1REV_Int Mask            */\r
+#define QEI_IE_POS2REV_Int_Pos                                12                                                        /*!< QEI IE: POS2REV_Int Position        */\r
+#define QEI_IE_POS2REV_Int_Msk                                (0x01UL << QEI_IE_POS2REV_Int_Pos)                        /*!< QEI IE: POS2REV_Int Mask            */\r
+#define QEI_IE_REV1_Int_Pos                                   13                                                        /*!< QEI IE: REV1_Int Position           */\r
+#define QEI_IE_REV1_Int_Msk                                   (0x01UL << QEI_IE_REV1_Int_Pos)                           /*!< QEI IE: REV1_Int Mask               */\r
+#define QEI_IE_REV2_Int_Pos                                   14                                                        /*!< QEI IE: REV2_Int Position           */\r
+#define QEI_IE_REV2_Int_Msk                                   (0x01UL << QEI_IE_REV2_Int_Pos)                           /*!< QEI IE: REV2_Int Mask               */\r
+#define QEI_IE_MAXPOS_Int_Pos                                 15                                                        /*!< QEI IE: MAXPOS_Int Position         */\r
+#define QEI_IE_MAXPOS_Int_Msk                                 (0x01UL << QEI_IE_MAXPOS_Int_Pos)                         /*!< QEI IE: MAXPOS_Int Mask             */\r
+\r
+// -----------------------------------------  QEI_CLR  --------------------------------------------\r
+#define QEI_CLR_INX_Int_Pos                                   0                                                         /*!< QEI CLR: INX_Int Position           */\r
+#define QEI_CLR_INX_Int_Msk                                   (0x01UL << QEI_CLR_INX_Int_Pos)                           /*!< QEI CLR: INX_Int Mask               */\r
+#define QEI_CLR_TIM_Int_Pos                                   1                                                         /*!< QEI CLR: TIM_Int Position           */\r
+#define QEI_CLR_TIM_Int_Msk                                   (0x01UL << QEI_CLR_TIM_Int_Pos)                           /*!< QEI CLR: TIM_Int Mask               */\r
+#define QEI_CLR_VELC_Int_Pos                                  2                                                         /*!< QEI CLR: VELC_Int Position          */\r
+#define QEI_CLR_VELC_Int_Msk                                  (0x01UL << QEI_CLR_VELC_Int_Pos)                          /*!< QEI CLR: VELC_Int Mask              */\r
+#define QEI_CLR_DIR_Int_Pos                                   3                                                         /*!< QEI CLR: DIR_Int Position           */\r
+#define QEI_CLR_DIR_Int_Msk                                   (0x01UL << QEI_CLR_DIR_Int_Pos)                           /*!< QEI CLR: DIR_Int Mask               */\r
+#define QEI_CLR_ERR_Int_Pos                                   4                                                         /*!< QEI CLR: ERR_Int Position           */\r
+#define QEI_CLR_ERR_Int_Msk                                   (0x01UL << QEI_CLR_ERR_Int_Pos)                           /*!< QEI CLR: ERR_Int Mask               */\r
+#define QEI_CLR_ENCLK_Int_Pos                                 5                                                         /*!< QEI CLR: ENCLK_Int Position         */\r
+#define QEI_CLR_ENCLK_Int_Msk                                 (0x01UL << QEI_CLR_ENCLK_Int_Pos)                         /*!< QEI CLR: ENCLK_Int Mask             */\r
+#define QEI_CLR_POS0_Int_Pos                                  6                                                         /*!< QEI CLR: POS0_Int Position          */\r
+#define QEI_CLR_POS0_Int_Msk                                  (0x01UL << QEI_CLR_POS0_Int_Pos)                          /*!< QEI CLR: POS0_Int Mask              */\r
+#define QEI_CLR_POS1_Int_Pos                                  7                                                         /*!< QEI CLR: POS1_Int Position          */\r
+#define QEI_CLR_POS1_Int_Msk                                  (0x01UL << QEI_CLR_POS1_Int_Pos)                          /*!< QEI CLR: POS1_Int Mask              */\r
+#define QEI_CLR_POS2_Int_Pos                                  8                                                         /*!< QEI CLR: POS2_Int Position          */\r
+#define QEI_CLR_POS2_Int_Msk                                  (0x01UL << QEI_CLR_POS2_Int_Pos)                          /*!< QEI CLR: POS2_Int Mask              */\r
+#define QEI_CLR_REV_Int_Pos                                   9                                                         /*!< QEI CLR: REV_Int Position           */\r
+#define QEI_CLR_REV_Int_Msk                                   (0x01UL << QEI_CLR_REV_Int_Pos)                           /*!< QEI CLR: REV_Int Mask               */\r
+#define QEI_CLR_POS0REV_Int_Pos                               10                                                        /*!< QEI CLR: POS0REV_Int Position       */\r
+#define QEI_CLR_POS0REV_Int_Msk                               (0x01UL << QEI_CLR_POS0REV_Int_Pos)                       /*!< QEI CLR: POS0REV_Int Mask           */\r
+#define QEI_CLR_POS1REV_Int_Pos                               11                                                        /*!< QEI CLR: POS1REV_Int Position       */\r
+#define QEI_CLR_POS1REV_Int_Msk                               (0x01UL << QEI_CLR_POS1REV_Int_Pos)                       /*!< QEI CLR: POS1REV_Int Mask           */\r
+#define QEI_CLR_REV1_Int_Pos                                  13                                                        /*!< QEI CLR: REV1_Int Position          */\r
+#define QEI_CLR_REV1_Int_Msk                                  (0x01UL << QEI_CLR_REV1_Int_Pos)                          /*!< QEI CLR: REV1_Int Mask              */\r
+#define QEI_CLR_REV2_Int_Pos                                  14                                                        /*!< QEI CLR: REV2_Int Position          */\r
+#define QEI_CLR_REV2_Int_Msk                                  (0x01UL << QEI_CLR_REV2_Int_Pos)                          /*!< QEI CLR: REV2_Int Mask              */\r
+#define QEI_CLR_MAXPOS_Int_Pos                                15                                                        /*!< QEI CLR: MAXPOS_Int Position        */\r
+#define QEI_CLR_MAXPOS_Int_Msk                                (0x01UL << QEI_CLR_MAXPOS_Int_Pos)                        /*!< QEI CLR: MAXPOS_Int Mask            */\r
+\r
+// -----------------------------------------  QEI_SET  --------------------------------------------\r
+#define QEI_SET_INX_Int_Pos                                   0                                                         /*!< QEI SET: INX_Int Position           */\r
+#define QEI_SET_INX_Int_Msk                                   (0x01UL << QEI_SET_INX_Int_Pos)                           /*!< QEI SET: INX_Int Mask               */\r
+#define QEI_SET_TIM_Int_Pos                                   1                                                         /*!< QEI SET: TIM_Int Position           */\r
+#define QEI_SET_TIM_Int_Msk                                   (0x01UL << QEI_SET_TIM_Int_Pos)                           /*!< QEI SET: TIM_Int Mask               */\r
+#define QEI_SET_VELC_Int_Pos                                  2                                                         /*!< QEI SET: VELC_Int Position          */\r
+#define QEI_SET_VELC_Int_Msk                                  (0x01UL << QEI_SET_VELC_Int_Pos)                          /*!< QEI SET: VELC_Int Mask              */\r
+#define QEI_SET_DIR_Int_Pos                                   3                                                         /*!< QEI SET: DIR_Int Position           */\r
+#define QEI_SET_DIR_Int_Msk                                   (0x01UL << QEI_SET_DIR_Int_Pos)                           /*!< QEI SET: DIR_Int Mask               */\r
+#define QEI_SET_ERR_Int_Pos                                   4                                                         /*!< QEI SET: ERR_Int Position           */\r
+#define QEI_SET_ERR_Int_Msk                                   (0x01UL << QEI_SET_ERR_Int_Pos)                           /*!< QEI SET: ERR_Int Mask               */\r
+#define QEI_SET_ENCLK_Int_Pos                                 5                                                         /*!< QEI SET: ENCLK_Int Position         */\r
+#define QEI_SET_ENCLK_Int_Msk                                 (0x01UL << QEI_SET_ENCLK_Int_Pos)                         /*!< QEI SET: ENCLK_Int Mask             */\r
+#define QEI_SET_POS0_Int_Pos                                  6                                                         /*!< QEI SET: POS0_Int Position          */\r
+#define QEI_SET_POS0_Int_Msk                                  (0x01UL << QEI_SET_POS0_Int_Pos)                          /*!< QEI SET: POS0_Int Mask              */\r
+#define QEI_SET_POS1_Int_Pos                                  7                                                         /*!< QEI SET: POS1_Int Position          */\r
+#define QEI_SET_POS1_Int_Msk                                  (0x01UL << QEI_SET_POS1_Int_Pos)                          /*!< QEI SET: POS1_Int Mask              */\r
+#define QEI_SET_POS2_Int_Pos                                  8                                                         /*!< QEI SET: POS2_Int Position          */\r
+#define QEI_SET_POS2_Int_Msk                                  (0x01UL << QEI_SET_POS2_Int_Pos)                          /*!< QEI SET: POS2_Int Mask              */\r
+#define QEI_SET_REV_Int_Pos                                   9                                                         /*!< QEI SET: REV_Int Position           */\r
+#define QEI_SET_REV_Int_Msk                                   (0x01UL << QEI_SET_REV_Int_Pos)                           /*!< QEI SET: REV_Int Mask               */\r
+#define QEI_SET_POS0REV_Int_Pos                               10                                                        /*!< QEI SET: POS0REV_Int Position       */\r
+#define QEI_SET_POS0REV_Int_Msk                               (0x01UL << QEI_SET_POS0REV_Int_Pos)                       /*!< QEI SET: POS0REV_Int Mask           */\r
+#define QEI_SET_POS1REV_Int_Pos                               11                                                        /*!< QEI SET: POS1REV_Int Position       */\r
+#define QEI_SET_POS1REV_Int_Msk                               (0x01UL << QEI_SET_POS1REV_Int_Pos)                       /*!< QEI SET: POS1REV_Int Mask           */\r
+#define QEI_SET_POS2REV_Int_Pos                               12                                                        /*!< QEI SET: POS2REV_Int Position       */\r
+#define QEI_SET_POS2REV_Int_Msk                               (0x01UL << QEI_SET_POS2REV_Int_Pos)                       /*!< QEI SET: POS2REV_Int Mask           */\r
+#define QEI_SET_REV1_Int_Pos                                  13                                                        /*!< QEI SET: REV1_Int Position          */\r
+#define QEI_SET_REV1_Int_Msk                                  (0x01UL << QEI_SET_REV1_Int_Pos)                          /*!< QEI SET: REV1_Int Mask              */\r
+#define QEI_SET_REV2_Int_Pos                                  14                                                        /*!< QEI SET: REV2_Int Position          */\r
+#define QEI_SET_REV2_Int_Msk                                  (0x01UL << QEI_SET_REV2_Int_Pos)                          /*!< QEI SET: REV2_Int Mask              */\r
+#define QEI_SET_MAXPOS_Int_Pos                                15                                                        /*!< QEI SET: MAXPOS_Int Position        */\r
+#define QEI_SET_MAXPOS_Int_Msk                                (0x01UL << QEI_SET_MAXPOS_Int_Pos)                        /*!< QEI SET: MAXPOS_Int Mask            */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 GIMA Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -------------------------------------  GIMA_CAP0_0_IN  -----------------------------------------\r
+#define GIMA_CAP0_0_IN_INV_Pos                                0                                                         /*!< GIMA CAP0_0_IN: INV Position        */\r
+#define GIMA_CAP0_0_IN_INV_Msk                                (0x01UL << GIMA_CAP0_0_IN_INV_Pos)                        /*!< GIMA CAP0_0_IN: INV Mask            */\r
+#define GIMA_CAP0_0_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP0_0_IN: EDGE Position       */\r
+#define GIMA_CAP0_0_IN_EDGE_Msk                               (0x01UL << GIMA_CAP0_0_IN_EDGE_Pos)                       /*!< GIMA CAP0_0_IN: EDGE Mask           */\r
+#define GIMA_CAP0_0_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP0_0_IN: SYNCH Position      */\r
+#define GIMA_CAP0_0_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP0_0_IN_SYNCH_Pos)                      /*!< GIMA CAP0_0_IN: SYNCH Mask          */\r
+#define GIMA_CAP0_0_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP0_0_IN: PULSE Position      */\r
+#define GIMA_CAP0_0_IN_PULSE_Msk                              (0x01UL << GIMA_CAP0_0_IN_PULSE_Pos)                      /*!< GIMA CAP0_0_IN: PULSE Mask          */\r
+#define GIMA_CAP0_0_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP0_0_IN: SELECT Position     */\r
+#define GIMA_CAP0_0_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP0_0_IN_SELECT_Pos)                     /*!< GIMA CAP0_0_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP0_1_IN  -----------------------------------------\r
+#define GIMA_CAP0_1_IN_INV_Pos                                0                                                         /*!< GIMA CAP0_1_IN: INV Position        */\r
+#define GIMA_CAP0_1_IN_INV_Msk                                (0x01UL << GIMA_CAP0_1_IN_INV_Pos)                        /*!< GIMA CAP0_1_IN: INV Mask            */\r
+#define GIMA_CAP0_1_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP0_1_IN: EDGE Position       */\r
+#define GIMA_CAP0_1_IN_EDGE_Msk                               (0x01UL << GIMA_CAP0_1_IN_EDGE_Pos)                       /*!< GIMA CAP0_1_IN: EDGE Mask           */\r
+#define GIMA_CAP0_1_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP0_1_IN: SYNCH Position      */\r
+#define GIMA_CAP0_1_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP0_1_IN_SYNCH_Pos)                      /*!< GIMA CAP0_1_IN: SYNCH Mask          */\r
+#define GIMA_CAP0_1_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP0_1_IN: PULSE Position      */\r
+#define GIMA_CAP0_1_IN_PULSE_Msk                              (0x01UL << GIMA_CAP0_1_IN_PULSE_Pos)                      /*!< GIMA CAP0_1_IN: PULSE Mask          */\r
+#define GIMA_CAP0_1_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP0_1_IN: SELECT Position     */\r
+#define GIMA_CAP0_1_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP0_1_IN_SELECT_Pos)                     /*!< GIMA CAP0_1_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP0_2_IN  -----------------------------------------\r
+#define GIMA_CAP0_2_IN_INV_Pos                                0                                                         /*!< GIMA CAP0_2_IN: INV Position        */\r
+#define GIMA_CAP0_2_IN_INV_Msk                                (0x01UL << GIMA_CAP0_2_IN_INV_Pos)                        /*!< GIMA CAP0_2_IN: INV Mask            */\r
+#define GIMA_CAP0_2_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP0_2_IN: EDGE Position       */\r
+#define GIMA_CAP0_2_IN_EDGE_Msk                               (0x01UL << GIMA_CAP0_2_IN_EDGE_Pos)                       /*!< GIMA CAP0_2_IN: EDGE Mask           */\r
+#define GIMA_CAP0_2_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP0_2_IN: SYNCH Position      */\r
+#define GIMA_CAP0_2_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP0_2_IN_SYNCH_Pos)                      /*!< GIMA CAP0_2_IN: SYNCH Mask          */\r
+#define GIMA_CAP0_2_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP0_2_IN: PULSE Position      */\r
+#define GIMA_CAP0_2_IN_PULSE_Msk                              (0x01UL << GIMA_CAP0_2_IN_PULSE_Pos)                      /*!< GIMA CAP0_2_IN: PULSE Mask          */\r
+#define GIMA_CAP0_2_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP0_2_IN: SELECT Position     */\r
+#define GIMA_CAP0_2_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP0_2_IN_SELECT_Pos)                     /*!< GIMA CAP0_2_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP0_3_IN  -----------------------------------------\r
+#define GIMA_CAP0_3_IN_INV_Pos                                0                                                         /*!< GIMA CAP0_3_IN: INV Position        */\r
+#define GIMA_CAP0_3_IN_INV_Msk                                (0x01UL << GIMA_CAP0_3_IN_INV_Pos)                        /*!< GIMA CAP0_3_IN: INV Mask            */\r
+#define GIMA_CAP0_3_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP0_3_IN: EDGE Position       */\r
+#define GIMA_CAP0_3_IN_EDGE_Msk                               (0x01UL << GIMA_CAP0_3_IN_EDGE_Pos)                       /*!< GIMA CAP0_3_IN: EDGE Mask           */\r
+#define GIMA_CAP0_3_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP0_3_IN: SYNCH Position      */\r
+#define GIMA_CAP0_3_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP0_3_IN_SYNCH_Pos)                      /*!< GIMA CAP0_3_IN: SYNCH Mask          */\r
+#define GIMA_CAP0_3_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP0_3_IN: PULSE Position      */\r
+#define GIMA_CAP0_3_IN_PULSE_Msk                              (0x01UL << GIMA_CAP0_3_IN_PULSE_Pos)                      /*!< GIMA CAP0_3_IN: PULSE Mask          */\r
+#define GIMA_CAP0_3_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP0_3_IN: SELECT Position     */\r
+#define GIMA_CAP0_3_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP0_3_IN_SELECT_Pos)                     /*!< GIMA CAP0_3_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP1_0_IN  -----------------------------------------\r
+#define GIMA_CAP1_0_IN_INV_Pos                                0                                                         /*!< GIMA CAP1_0_IN: INV Position        */\r
+#define GIMA_CAP1_0_IN_INV_Msk                                (0x01UL << GIMA_CAP1_0_IN_INV_Pos)                        /*!< GIMA CAP1_0_IN: INV Mask            */\r
+#define GIMA_CAP1_0_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP1_0_IN: EDGE Position       */\r
+#define GIMA_CAP1_0_IN_EDGE_Msk                               (0x01UL << GIMA_CAP1_0_IN_EDGE_Pos)                       /*!< GIMA CAP1_0_IN: EDGE Mask           */\r
+#define GIMA_CAP1_0_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP1_0_IN: SYNCH Position      */\r
+#define GIMA_CAP1_0_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP1_0_IN_SYNCH_Pos)                      /*!< GIMA CAP1_0_IN: SYNCH Mask          */\r
+#define GIMA_CAP1_0_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP1_0_IN: PULSE Position      */\r
+#define GIMA_CAP1_0_IN_PULSE_Msk                              (0x01UL << GIMA_CAP1_0_IN_PULSE_Pos)                      /*!< GIMA CAP1_0_IN: PULSE Mask          */\r
+#define GIMA_CAP1_0_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP1_0_IN: SELECT Position     */\r
+#define GIMA_CAP1_0_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP1_0_IN_SELECT_Pos)                     /*!< GIMA CAP1_0_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP1_1_IN  -----------------------------------------\r
+#define GIMA_CAP1_1_IN_INV_Pos                                0                                                         /*!< GIMA CAP1_1_IN: INV Position        */\r
+#define GIMA_CAP1_1_IN_INV_Msk                                (0x01UL << GIMA_CAP1_1_IN_INV_Pos)                        /*!< GIMA CAP1_1_IN: INV Mask            */\r
+#define GIMA_CAP1_1_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP1_1_IN: EDGE Position       */\r
+#define GIMA_CAP1_1_IN_EDGE_Msk                               (0x01UL << GIMA_CAP1_1_IN_EDGE_Pos)                       /*!< GIMA CAP1_1_IN: EDGE Mask           */\r
+#define GIMA_CAP1_1_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP1_1_IN: SYNCH Position      */\r
+#define GIMA_CAP1_1_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP1_1_IN_SYNCH_Pos)                      /*!< GIMA CAP1_1_IN: SYNCH Mask          */\r
+#define GIMA_CAP1_1_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP1_1_IN: PULSE Position      */\r
+#define GIMA_CAP1_1_IN_PULSE_Msk                              (0x01UL << GIMA_CAP1_1_IN_PULSE_Pos)                      /*!< GIMA CAP1_1_IN: PULSE Mask          */\r
+#define GIMA_CAP1_1_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP1_1_IN: SELECT Position     */\r
+#define GIMA_CAP1_1_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP1_1_IN_SELECT_Pos)                     /*!< GIMA CAP1_1_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP1_2_IN  -----------------------------------------\r
+#define GIMA_CAP1_2_IN_INV_Pos                                0                                                         /*!< GIMA CAP1_2_IN: INV Position        */\r
+#define GIMA_CAP1_2_IN_INV_Msk                                (0x01UL << GIMA_CAP1_2_IN_INV_Pos)                        /*!< GIMA CAP1_2_IN: INV Mask            */\r
+#define GIMA_CAP1_2_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP1_2_IN: EDGE Position       */\r
+#define GIMA_CAP1_2_IN_EDGE_Msk                               (0x01UL << GIMA_CAP1_2_IN_EDGE_Pos)                       /*!< GIMA CAP1_2_IN: EDGE Mask           */\r
+#define GIMA_CAP1_2_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP1_2_IN: SYNCH Position      */\r
+#define GIMA_CAP1_2_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP1_2_IN_SYNCH_Pos)                      /*!< GIMA CAP1_2_IN: SYNCH Mask          */\r
+#define GIMA_CAP1_2_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP1_2_IN: PULSE Position      */\r
+#define GIMA_CAP1_2_IN_PULSE_Msk                              (0x01UL << GIMA_CAP1_2_IN_PULSE_Pos)                      /*!< GIMA CAP1_2_IN: PULSE Mask          */\r
+#define GIMA_CAP1_2_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP1_2_IN: SELECT Position     */\r
+#define GIMA_CAP1_2_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP1_2_IN_SELECT_Pos)                     /*!< GIMA CAP1_2_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP1_3_IN  -----------------------------------------\r
+#define GIMA_CAP1_3_IN_INV_Pos                                0                                                         /*!< GIMA CAP1_3_IN: INV Position        */\r
+#define GIMA_CAP1_3_IN_INV_Msk                                (0x01UL << GIMA_CAP1_3_IN_INV_Pos)                        /*!< GIMA CAP1_3_IN: INV Mask            */\r
+#define GIMA_CAP1_3_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP1_3_IN: EDGE Position       */\r
+#define GIMA_CAP1_3_IN_EDGE_Msk                               (0x01UL << GIMA_CAP1_3_IN_EDGE_Pos)                       /*!< GIMA CAP1_3_IN: EDGE Mask           */\r
+#define GIMA_CAP1_3_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP1_3_IN: SYNCH Position      */\r
+#define GIMA_CAP1_3_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP1_3_IN_SYNCH_Pos)                      /*!< GIMA CAP1_3_IN: SYNCH Mask          */\r
+#define GIMA_CAP1_3_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP1_3_IN: PULSE Position      */\r
+#define GIMA_CAP1_3_IN_PULSE_Msk                              (0x01UL << GIMA_CAP1_3_IN_PULSE_Pos)                      /*!< GIMA CAP1_3_IN: PULSE Mask          */\r
+#define GIMA_CAP1_3_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP1_3_IN: SELECT Position     */\r
+#define GIMA_CAP1_3_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP1_3_IN_SELECT_Pos)                     /*!< GIMA CAP1_3_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP2_0_IN  -----------------------------------------\r
+#define GIMA_CAP2_0_IN_INV_Pos                                0                                                         /*!< GIMA CAP2_0_IN: INV Position        */\r
+#define GIMA_CAP2_0_IN_INV_Msk                                (0x01UL << GIMA_CAP2_0_IN_INV_Pos)                        /*!< GIMA CAP2_0_IN: INV Mask            */\r
+#define GIMA_CAP2_0_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP2_0_IN: EDGE Position       */\r
+#define GIMA_CAP2_0_IN_EDGE_Msk                               (0x01UL << GIMA_CAP2_0_IN_EDGE_Pos)                       /*!< GIMA CAP2_0_IN: EDGE Mask           */\r
+#define GIMA_CAP2_0_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP2_0_IN: SYNCH Position      */\r
+#define GIMA_CAP2_0_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP2_0_IN_SYNCH_Pos)                      /*!< GIMA CAP2_0_IN: SYNCH Mask          */\r
+#define GIMA_CAP2_0_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP2_0_IN: PULSE Position      */\r
+#define GIMA_CAP2_0_IN_PULSE_Msk                              (0x01UL << GIMA_CAP2_0_IN_PULSE_Pos)                      /*!< GIMA CAP2_0_IN: PULSE Mask          */\r
+#define GIMA_CAP2_0_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP2_0_IN: SELECT Position     */\r
+#define GIMA_CAP2_0_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP2_0_IN_SELECT_Pos)                     /*!< GIMA CAP2_0_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP2_1_IN  -----------------------------------------\r
+#define GIMA_CAP2_1_IN_INV_Pos                                0                                                         /*!< GIMA CAP2_1_IN: INV Position        */\r
+#define GIMA_CAP2_1_IN_INV_Msk                                (0x01UL << GIMA_CAP2_1_IN_INV_Pos)                        /*!< GIMA CAP2_1_IN: INV Mask            */\r
+#define GIMA_CAP2_1_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP2_1_IN: EDGE Position       */\r
+#define GIMA_CAP2_1_IN_EDGE_Msk                               (0x01UL << GIMA_CAP2_1_IN_EDGE_Pos)                       /*!< GIMA CAP2_1_IN: EDGE Mask           */\r
+#define GIMA_CAP2_1_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP2_1_IN: SYNCH Position      */\r
+#define GIMA_CAP2_1_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP2_1_IN_SYNCH_Pos)                      /*!< GIMA CAP2_1_IN: SYNCH Mask          */\r
+#define GIMA_CAP2_1_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP2_1_IN: PULSE Position      */\r
+#define GIMA_CAP2_1_IN_PULSE_Msk                              (0x01UL << GIMA_CAP2_1_IN_PULSE_Pos)                      /*!< GIMA CAP2_1_IN: PULSE Mask          */\r
+#define GIMA_CAP2_1_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP2_1_IN: SELECT Position     */\r
+#define GIMA_CAP2_1_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP2_1_IN_SELECT_Pos)                     /*!< GIMA CAP2_1_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP2_2_IN  -----------------------------------------\r
+#define GIMA_CAP2_2_IN_INV_Pos                                0                                                         /*!< GIMA CAP2_2_IN: INV Position        */\r
+#define GIMA_CAP2_2_IN_INV_Msk                                (0x01UL << GIMA_CAP2_2_IN_INV_Pos)                        /*!< GIMA CAP2_2_IN: INV Mask            */\r
+#define GIMA_CAP2_2_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP2_2_IN: EDGE Position       */\r
+#define GIMA_CAP2_2_IN_EDGE_Msk                               (0x01UL << GIMA_CAP2_2_IN_EDGE_Pos)                       /*!< GIMA CAP2_2_IN: EDGE Mask           */\r
+#define GIMA_CAP2_2_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP2_2_IN: SYNCH Position      */\r
+#define GIMA_CAP2_2_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP2_2_IN_SYNCH_Pos)                      /*!< GIMA CAP2_2_IN: SYNCH Mask          */\r
+#define GIMA_CAP2_2_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP2_2_IN: PULSE Position      */\r
+#define GIMA_CAP2_2_IN_PULSE_Msk                              (0x01UL << GIMA_CAP2_2_IN_PULSE_Pos)                      /*!< GIMA CAP2_2_IN: PULSE Mask          */\r
+#define GIMA_CAP2_2_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP2_2_IN: SELECT Position     */\r
+#define GIMA_CAP2_2_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP2_2_IN_SELECT_Pos)                     /*!< GIMA CAP2_2_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP2_3_IN  -----------------------------------------\r
+#define GIMA_CAP2_3_IN_INV_Pos                                0                                                         /*!< GIMA CAP2_3_IN: INV Position        */\r
+#define GIMA_CAP2_3_IN_INV_Msk                                (0x01UL << GIMA_CAP2_3_IN_INV_Pos)                        /*!< GIMA CAP2_3_IN: INV Mask            */\r
+#define GIMA_CAP2_3_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP2_3_IN: EDGE Position       */\r
+#define GIMA_CAP2_3_IN_EDGE_Msk                               (0x01UL << GIMA_CAP2_3_IN_EDGE_Pos)                       /*!< GIMA CAP2_3_IN: EDGE Mask           */\r
+#define GIMA_CAP2_3_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP2_3_IN: SYNCH Position      */\r
+#define GIMA_CAP2_3_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP2_3_IN_SYNCH_Pos)                      /*!< GIMA CAP2_3_IN: SYNCH Mask          */\r
+#define GIMA_CAP2_3_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP2_3_IN: PULSE Position      */\r
+#define GIMA_CAP2_3_IN_PULSE_Msk                              (0x01UL << GIMA_CAP2_3_IN_PULSE_Pos)                      /*!< GIMA CAP2_3_IN: PULSE Mask          */\r
+#define GIMA_CAP2_3_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP2_3_IN: SELECT Position     */\r
+#define GIMA_CAP2_3_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP2_3_IN_SELECT_Pos)                     /*!< GIMA CAP2_3_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP3_0_IN  -----------------------------------------\r
+#define GIMA_CAP3_0_IN_INV_Pos                                0                                                         /*!< GIMA CAP3_0_IN: INV Position        */\r
+#define GIMA_CAP3_0_IN_INV_Msk                                (0x01UL << GIMA_CAP3_0_IN_INV_Pos)                        /*!< GIMA CAP3_0_IN: INV Mask            */\r
+#define GIMA_CAP3_0_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP3_0_IN: EDGE Position       */\r
+#define GIMA_CAP3_0_IN_EDGE_Msk                               (0x01UL << GIMA_CAP3_0_IN_EDGE_Pos)                       /*!< GIMA CAP3_0_IN: EDGE Mask           */\r
+#define GIMA_CAP3_0_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP3_0_IN: SYNCH Position      */\r
+#define GIMA_CAP3_0_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP3_0_IN_SYNCH_Pos)                      /*!< GIMA CAP3_0_IN: SYNCH Mask          */\r
+#define GIMA_CAP3_0_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP3_0_IN: PULSE Position      */\r
+#define GIMA_CAP3_0_IN_PULSE_Msk                              (0x01UL << GIMA_CAP3_0_IN_PULSE_Pos)                      /*!< GIMA CAP3_0_IN: PULSE Mask          */\r
+#define GIMA_CAP3_0_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP3_0_IN: SELECT Position     */\r
+#define GIMA_CAP3_0_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP3_0_IN_SELECT_Pos)                     /*!< GIMA CAP3_0_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP3_1_IN  -----------------------------------------\r
+#define GIMA_CAP3_1_IN_INV_Pos                                0                                                         /*!< GIMA CAP3_1_IN: INV Position        */\r
+#define GIMA_CAP3_1_IN_INV_Msk                                (0x01UL << GIMA_CAP3_1_IN_INV_Pos)                        /*!< GIMA CAP3_1_IN: INV Mask            */\r
+#define GIMA_CAP3_1_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP3_1_IN: EDGE Position       */\r
+#define GIMA_CAP3_1_IN_EDGE_Msk                               (0x01UL << GIMA_CAP3_1_IN_EDGE_Pos)                       /*!< GIMA CAP3_1_IN: EDGE Mask           */\r
+#define GIMA_CAP3_1_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP3_1_IN: SYNCH Position      */\r
+#define GIMA_CAP3_1_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP3_1_IN_SYNCH_Pos)                      /*!< GIMA CAP3_1_IN: SYNCH Mask          */\r
+#define GIMA_CAP3_1_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP3_1_IN: PULSE Position      */\r
+#define GIMA_CAP3_1_IN_PULSE_Msk                              (0x01UL << GIMA_CAP3_1_IN_PULSE_Pos)                      /*!< GIMA CAP3_1_IN: PULSE Mask          */\r
+#define GIMA_CAP3_1_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP3_1_IN: SELECT Position     */\r
+#define GIMA_CAP3_1_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP3_1_IN_SELECT_Pos)                     /*!< GIMA CAP3_1_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP3_2_IN  -----------------------------------------\r
+#define GIMA_CAP3_2_IN_INV_Pos                                0                                                         /*!< GIMA CAP3_2_IN: INV Position        */\r
+#define GIMA_CAP3_2_IN_INV_Msk                                (0x01UL << GIMA_CAP3_2_IN_INV_Pos)                        /*!< GIMA CAP3_2_IN: INV Mask            */\r
+#define GIMA_CAP3_2_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP3_2_IN: EDGE Position       */\r
+#define GIMA_CAP3_2_IN_EDGE_Msk                               (0x01UL << GIMA_CAP3_2_IN_EDGE_Pos)                       /*!< GIMA CAP3_2_IN: EDGE Mask           */\r
+#define GIMA_CAP3_2_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP3_2_IN: SYNCH Position      */\r
+#define GIMA_CAP3_2_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP3_2_IN_SYNCH_Pos)                      /*!< GIMA CAP3_2_IN: SYNCH Mask          */\r
+#define GIMA_CAP3_2_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP3_2_IN: PULSE Position      */\r
+#define GIMA_CAP3_2_IN_PULSE_Msk                              (0x01UL << GIMA_CAP3_2_IN_PULSE_Pos)                      /*!< GIMA CAP3_2_IN: PULSE Mask          */\r
+#define GIMA_CAP3_2_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP3_2_IN: SELECT Position     */\r
+#define GIMA_CAP3_2_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP3_2_IN_SELECT_Pos)                     /*!< GIMA CAP3_2_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CAP3_3_IN  -----------------------------------------\r
+#define GIMA_CAP3_3_IN_INV_Pos                                0                                                         /*!< GIMA CAP3_3_IN: INV Position        */\r
+#define GIMA_CAP3_3_IN_INV_Msk                                (0x01UL << GIMA_CAP3_3_IN_INV_Pos)                        /*!< GIMA CAP3_3_IN: INV Mask            */\r
+#define GIMA_CAP3_3_IN_EDGE_Pos                               1                                                         /*!< GIMA CAP3_3_IN: EDGE Position       */\r
+#define GIMA_CAP3_3_IN_EDGE_Msk                               (0x01UL << GIMA_CAP3_3_IN_EDGE_Pos)                       /*!< GIMA CAP3_3_IN: EDGE Mask           */\r
+#define GIMA_CAP3_3_IN_SYNCH_Pos                              2                                                         /*!< GIMA CAP3_3_IN: SYNCH Position      */\r
+#define GIMA_CAP3_3_IN_SYNCH_Msk                              (0x01UL << GIMA_CAP3_3_IN_SYNCH_Pos)                      /*!< GIMA CAP3_3_IN: SYNCH Mask          */\r
+#define GIMA_CAP3_3_IN_PULSE_Pos                              3                                                         /*!< GIMA CAP3_3_IN: PULSE Position      */\r
+#define GIMA_CAP3_3_IN_PULSE_Msk                              (0x01UL << GIMA_CAP3_3_IN_PULSE_Pos)                      /*!< GIMA CAP3_3_IN: PULSE Mask          */\r
+#define GIMA_CAP3_3_IN_SELECT_Pos                             4                                                         /*!< GIMA CAP3_3_IN: SELECT Position     */\r
+#define GIMA_CAP3_3_IN_SELECT_Msk                             (0x0fUL << GIMA_CAP3_3_IN_SELECT_Pos)                     /*!< GIMA CAP3_3_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_0_IN  -----------------------------------------\r
+#define GIMA_CTIN_0_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_0_IN: INV Position        */\r
+#define GIMA_CTIN_0_IN_INV_Msk                                (0x01UL << GIMA_CTIN_0_IN_INV_Pos)                        /*!< GIMA CTIN_0_IN: INV Mask            */\r
+#define GIMA_CTIN_0_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_0_IN: EDGE Position       */\r
+#define GIMA_CTIN_0_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_0_IN_EDGE_Pos)                       /*!< GIMA CTIN_0_IN: EDGE Mask           */\r
+#define GIMA_CTIN_0_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_0_IN: SYNCH Position      */\r
+#define GIMA_CTIN_0_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_0_IN_SYNCH_Pos)                      /*!< GIMA CTIN_0_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_0_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_0_IN: PULSE Position      */\r
+#define GIMA_CTIN_0_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_0_IN_PULSE_Pos)                      /*!< GIMA CTIN_0_IN: PULSE Mask          */\r
+#define GIMA_CTIN_0_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_0_IN: SELECT Position     */\r
+#define GIMA_CTIN_0_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_0_IN_SELECT_Pos)                     /*!< GIMA CTIN_0_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_1_IN  -----------------------------------------\r
+#define GIMA_CTIN_1_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_1_IN: INV Position        */\r
+#define GIMA_CTIN_1_IN_INV_Msk                                (0x01UL << GIMA_CTIN_1_IN_INV_Pos)                        /*!< GIMA CTIN_1_IN: INV Mask            */\r
+#define GIMA_CTIN_1_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_1_IN: EDGE Position       */\r
+#define GIMA_CTIN_1_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_1_IN_EDGE_Pos)                       /*!< GIMA CTIN_1_IN: EDGE Mask           */\r
+#define GIMA_CTIN_1_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_1_IN: SYNCH Position      */\r
+#define GIMA_CTIN_1_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_1_IN_SYNCH_Pos)                      /*!< GIMA CTIN_1_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_1_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_1_IN: PULSE Position      */\r
+#define GIMA_CTIN_1_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_1_IN_PULSE_Pos)                      /*!< GIMA CTIN_1_IN: PULSE Mask          */\r
+#define GIMA_CTIN_1_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_1_IN: SELECT Position     */\r
+#define GIMA_CTIN_1_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_1_IN_SELECT_Pos)                     /*!< GIMA CTIN_1_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_2_IN  -----------------------------------------\r
+#define GIMA_CTIN_2_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_2_IN: INV Position        */\r
+#define GIMA_CTIN_2_IN_INV_Msk                                (0x01UL << GIMA_CTIN_2_IN_INV_Pos)                        /*!< GIMA CTIN_2_IN: INV Mask            */\r
+#define GIMA_CTIN_2_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_2_IN: EDGE Position       */\r
+#define GIMA_CTIN_2_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_2_IN_EDGE_Pos)                       /*!< GIMA CTIN_2_IN: EDGE Mask           */\r
+#define GIMA_CTIN_2_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_2_IN: SYNCH Position      */\r
+#define GIMA_CTIN_2_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_2_IN_SYNCH_Pos)                      /*!< GIMA CTIN_2_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_2_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_2_IN: PULSE Position      */\r
+#define GIMA_CTIN_2_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_2_IN_PULSE_Pos)                      /*!< GIMA CTIN_2_IN: PULSE Mask          */\r
+#define GIMA_CTIN_2_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_2_IN: SELECT Position     */\r
+#define GIMA_CTIN_2_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_2_IN_SELECT_Pos)                     /*!< GIMA CTIN_2_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_3_IN  -----------------------------------------\r
+#define GIMA_CTIN_3_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_3_IN: INV Position        */\r
+#define GIMA_CTIN_3_IN_INV_Msk                                (0x01UL << GIMA_CTIN_3_IN_INV_Pos)                        /*!< GIMA CTIN_3_IN: INV Mask            */\r
+#define GIMA_CTIN_3_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_3_IN: EDGE Position       */\r
+#define GIMA_CTIN_3_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_3_IN_EDGE_Pos)                       /*!< GIMA CTIN_3_IN: EDGE Mask           */\r
+#define GIMA_CTIN_3_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_3_IN: SYNCH Position      */\r
+#define GIMA_CTIN_3_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_3_IN_SYNCH_Pos)                      /*!< GIMA CTIN_3_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_3_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_3_IN: PULSE Position      */\r
+#define GIMA_CTIN_3_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_3_IN_PULSE_Pos)                      /*!< GIMA CTIN_3_IN: PULSE Mask          */\r
+#define GIMA_CTIN_3_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_3_IN: SELECT Position     */\r
+#define GIMA_CTIN_3_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_3_IN_SELECT_Pos)                     /*!< GIMA CTIN_3_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_4_IN  -----------------------------------------\r
+#define GIMA_CTIN_4_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_4_IN: INV Position        */\r
+#define GIMA_CTIN_4_IN_INV_Msk                                (0x01UL << GIMA_CTIN_4_IN_INV_Pos)                        /*!< GIMA CTIN_4_IN: INV Mask            */\r
+#define GIMA_CTIN_4_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_4_IN: EDGE Position       */\r
+#define GIMA_CTIN_4_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_4_IN_EDGE_Pos)                       /*!< GIMA CTIN_4_IN: EDGE Mask           */\r
+#define GIMA_CTIN_4_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_4_IN: SYNCH Position      */\r
+#define GIMA_CTIN_4_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_4_IN_SYNCH_Pos)                      /*!< GIMA CTIN_4_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_4_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_4_IN: PULSE Position      */\r
+#define GIMA_CTIN_4_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_4_IN_PULSE_Pos)                      /*!< GIMA CTIN_4_IN: PULSE Mask          */\r
+#define GIMA_CTIN_4_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_4_IN: SELECT Position     */\r
+#define GIMA_CTIN_4_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_4_IN_SELECT_Pos)                     /*!< GIMA CTIN_4_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_5_IN  -----------------------------------------\r
+#define GIMA_CTIN_5_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_5_IN: INV Position        */\r
+#define GIMA_CTIN_5_IN_INV_Msk                                (0x01UL << GIMA_CTIN_5_IN_INV_Pos)                        /*!< GIMA CTIN_5_IN: INV Mask            */\r
+#define GIMA_CTIN_5_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_5_IN: EDGE Position       */\r
+#define GIMA_CTIN_5_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_5_IN_EDGE_Pos)                       /*!< GIMA CTIN_5_IN: EDGE Mask           */\r
+#define GIMA_CTIN_5_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_5_IN: SYNCH Position      */\r
+#define GIMA_CTIN_5_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_5_IN_SYNCH_Pos)                      /*!< GIMA CTIN_5_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_5_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_5_IN: PULSE Position      */\r
+#define GIMA_CTIN_5_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_5_IN_PULSE_Pos)                      /*!< GIMA CTIN_5_IN: PULSE Mask          */\r
+#define GIMA_CTIN_5_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_5_IN: SELECT Position     */\r
+#define GIMA_CTIN_5_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_5_IN_SELECT_Pos)                     /*!< GIMA CTIN_5_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_6_IN  -----------------------------------------\r
+#define GIMA_CTIN_6_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_6_IN: INV Position        */\r
+#define GIMA_CTIN_6_IN_INV_Msk                                (0x01UL << GIMA_CTIN_6_IN_INV_Pos)                        /*!< GIMA CTIN_6_IN: INV Mask            */\r
+#define GIMA_CTIN_6_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_6_IN: EDGE Position       */\r
+#define GIMA_CTIN_6_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_6_IN_EDGE_Pos)                       /*!< GIMA CTIN_6_IN: EDGE Mask           */\r
+#define GIMA_CTIN_6_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_6_IN: SYNCH Position      */\r
+#define GIMA_CTIN_6_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_6_IN_SYNCH_Pos)                      /*!< GIMA CTIN_6_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_6_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_6_IN: PULSE Position      */\r
+#define GIMA_CTIN_6_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_6_IN_PULSE_Pos)                      /*!< GIMA CTIN_6_IN: PULSE Mask          */\r
+#define GIMA_CTIN_6_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_6_IN: SELECT Position     */\r
+#define GIMA_CTIN_6_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_6_IN_SELECT_Pos)                     /*!< GIMA CTIN_6_IN: SELECT Mask         */\r
+\r
+// -------------------------------------  GIMA_CTIN_7_IN  -----------------------------------------\r
+#define GIMA_CTIN_7_IN_INV_Pos                                0                                                         /*!< GIMA CTIN_7_IN: INV Position        */\r
+#define GIMA_CTIN_7_IN_INV_Msk                                (0x01UL << GIMA_CTIN_7_IN_INV_Pos)                        /*!< GIMA CTIN_7_IN: INV Mask            */\r
+#define GIMA_CTIN_7_IN_EDGE_Pos                               1                                                         /*!< GIMA CTIN_7_IN: EDGE Position       */\r
+#define GIMA_CTIN_7_IN_EDGE_Msk                               (0x01UL << GIMA_CTIN_7_IN_EDGE_Pos)                       /*!< GIMA CTIN_7_IN: EDGE Mask           */\r
+#define GIMA_CTIN_7_IN_SYNCH_Pos                              2                                                         /*!< GIMA CTIN_7_IN: SYNCH Position      */\r
+#define GIMA_CTIN_7_IN_SYNCH_Msk                              (0x01UL << GIMA_CTIN_7_IN_SYNCH_Pos)                      /*!< GIMA CTIN_7_IN: SYNCH Mask          */\r
+#define GIMA_CTIN_7_IN_PULSE_Pos                              3                                                         /*!< GIMA CTIN_7_IN: PULSE Position      */\r
+#define GIMA_CTIN_7_IN_PULSE_Msk                              (0x01UL << GIMA_CTIN_7_IN_PULSE_Pos)                      /*!< GIMA CTIN_7_IN: PULSE Mask          */\r
+#define GIMA_CTIN_7_IN_SELECT_Pos                             4                                                         /*!< GIMA CTIN_7_IN: SELECT Position     */\r
+#define GIMA_CTIN_7_IN_SELECT_Msk                             (0x0fUL << GIMA_CTIN_7_IN_SELECT_Pos)                     /*!< GIMA CTIN_7_IN: SELECT Mask         */\r
+\r
+// ----------------------------------  GIMA_VADC_TRIGGER_IN  --------------------------------------\r
+#define GIMA_VADC_TRIGGER_IN_INV_Pos                          0                                                         /*!< GIMA VADC_TRIGGER_IN: INV Position  */\r
+#define GIMA_VADC_TRIGGER_IN_INV_Msk                          (0x01UL << GIMA_VADC_TRIGGER_IN_INV_Pos)                  /*!< GIMA VADC_TRIGGER_IN: INV Mask      */\r
+#define GIMA_VADC_TRIGGER_IN_EDGE_Pos                         1                                                         /*!< GIMA VADC_TRIGGER_IN: EDGE Position */\r
+#define GIMA_VADC_TRIGGER_IN_EDGE_Msk                         (0x01UL << GIMA_VADC_TRIGGER_IN_EDGE_Pos)                 /*!< GIMA VADC_TRIGGER_IN: EDGE Mask     */\r
+#define GIMA_VADC_TRIGGER_IN_SYNCH_Pos                        2                                                         /*!< GIMA VADC_TRIGGER_IN: SYNCH Position */\r
+#define GIMA_VADC_TRIGGER_IN_SYNCH_Msk                        (0x01UL << GIMA_VADC_TRIGGER_IN_SYNCH_Pos)                /*!< GIMA VADC_TRIGGER_IN: SYNCH Mask    */\r
+#define GIMA_VADC_TRIGGER_IN_PULSE_Pos                        3                                                         /*!< GIMA VADC_TRIGGER_IN: PULSE Position */\r
+#define GIMA_VADC_TRIGGER_IN_PULSE_Msk                        (0x01UL << GIMA_VADC_TRIGGER_IN_PULSE_Pos)                /*!< GIMA VADC_TRIGGER_IN: PULSE Mask    */\r
+#define GIMA_VADC_TRIGGER_IN_SELECT_Pos                       4                                                         /*!< GIMA VADC_TRIGGER_IN: SELECT Position */\r
+#define GIMA_VADC_TRIGGER_IN_SELECT_Msk                       (0x0fUL << GIMA_VADC_TRIGGER_IN_SELECT_Pos)               /*!< GIMA VADC_TRIGGER_IN: SELECT Mask   */\r
+\r
+// ---------------------------------  GIMA_EVENTROUTER_13_IN  -------------------------------------\r
+#define GIMA_EVENTROUTER_13_IN_INV_Pos                        0                                                         /*!< GIMA EVENTROUTER_13_IN: INV Position */\r
+#define GIMA_EVENTROUTER_13_IN_INV_Msk                        (0x01UL << GIMA_EVENTROUTER_13_IN_INV_Pos)                /*!< GIMA EVENTROUTER_13_IN: INV Mask    */\r
+#define GIMA_EVENTROUTER_13_IN_EDGE_Pos                       1                                                         /*!< GIMA EVENTROUTER_13_IN: EDGE Position */\r
+#define GIMA_EVENTROUTER_13_IN_EDGE_Msk                       (0x01UL << GIMA_EVENTROUTER_13_IN_EDGE_Pos)               /*!< GIMA EVENTROUTER_13_IN: EDGE Mask   */\r
+#define GIMA_EVENTROUTER_13_IN_SYNCH_Pos                      2                                                         /*!< GIMA EVENTROUTER_13_IN: SYNCH Position */\r
+#define GIMA_EVENTROUTER_13_IN_SYNCH_Msk                      (0x01UL << GIMA_EVENTROUTER_13_IN_SYNCH_Pos)              /*!< GIMA EVENTROUTER_13_IN: SYNCH Mask  */\r
+#define GIMA_EVENTROUTER_13_IN_PULSE_Pos                      3                                                         /*!< GIMA EVENTROUTER_13_IN: PULSE Position */\r
+#define GIMA_EVENTROUTER_13_IN_PULSE_Msk                      (0x01UL << GIMA_EVENTROUTER_13_IN_PULSE_Pos)              /*!< GIMA EVENTROUTER_13_IN: PULSE Mask  */\r
+#define GIMA_EVENTROUTER_13_IN_SELECT_Pos                     4                                                         /*!< GIMA EVENTROUTER_13_IN: SELECT Position */\r
+#define GIMA_EVENTROUTER_13_IN_SELECT_Msk                     (0x0fUL << GIMA_EVENTROUTER_13_IN_SELECT_Pos)             /*!< GIMA EVENTROUTER_13_IN: SELECT Mask */\r
+\r
+// ---------------------------------  GIMA_EVENTROUTER_14_IN  -------------------------------------\r
+#define GIMA_EVENTROUTER_14_IN_INV_Pos                        0                                                         /*!< GIMA EVENTROUTER_14_IN: INV Position */\r
+#define GIMA_EVENTROUTER_14_IN_INV_Msk                        (0x01UL << GIMA_EVENTROUTER_14_IN_INV_Pos)                /*!< GIMA EVENTROUTER_14_IN: INV Mask    */\r
+#define GIMA_EVENTROUTER_14_IN_EDGE_Pos                       1                                                         /*!< GIMA EVENTROUTER_14_IN: EDGE Position */\r
+#define GIMA_EVENTROUTER_14_IN_EDGE_Msk                       (0x01UL << GIMA_EVENTROUTER_14_IN_EDGE_Pos)               /*!< GIMA EVENTROUTER_14_IN: EDGE Mask   */\r
+#define GIMA_EVENTROUTER_14_IN_SYNCH_Pos                      2                                                         /*!< GIMA EVENTROUTER_14_IN: SYNCH Position */\r
+#define GIMA_EVENTROUTER_14_IN_SYNCH_Msk                      (0x01UL << GIMA_EVENTROUTER_14_IN_SYNCH_Pos)              /*!< GIMA EVENTROUTER_14_IN: SYNCH Mask  */\r
+#define GIMA_EVENTROUTER_14_IN_PULSE_Pos                      3                                                         /*!< GIMA EVENTROUTER_14_IN: PULSE Position */\r
+#define GIMA_EVENTROUTER_14_IN_PULSE_Msk                      (0x01UL << GIMA_EVENTROUTER_14_IN_PULSE_Pos)              /*!< GIMA EVENTROUTER_14_IN: PULSE Mask  */\r
+#define GIMA_EVENTROUTER_14_IN_SELECT_Pos                     4                                                         /*!< GIMA EVENTROUTER_14_IN: SELECT Position */\r
+#define GIMA_EVENTROUTER_14_IN_SELECT_Msk                     (0x0fUL << GIMA_EVENTROUTER_14_IN_SELECT_Pos)             /*!< GIMA EVENTROUTER_14_IN: SELECT Mask */\r
+\r
+// ---------------------------------  GIMA_EVENTROUTER_16_IN  -------------------------------------\r
+#define GIMA_EVENTROUTER_16_IN_INV_Pos                        0                                                         /*!< GIMA EVENTROUTER_16_IN: INV Position */\r
+#define GIMA_EVENTROUTER_16_IN_INV_Msk                        (0x01UL << GIMA_EVENTROUTER_16_IN_INV_Pos)                /*!< GIMA EVENTROUTER_16_IN: INV Mask    */\r
+#define GIMA_EVENTROUTER_16_IN_EDGE_Pos                       1                                                         /*!< GIMA EVENTROUTER_16_IN: EDGE Position */\r
+#define GIMA_EVENTROUTER_16_IN_EDGE_Msk                       (0x01UL << GIMA_EVENTROUTER_16_IN_EDGE_Pos)               /*!< GIMA EVENTROUTER_16_IN: EDGE Mask   */\r
+#define GIMA_EVENTROUTER_16_IN_SYNCH_Pos                      2                                                         /*!< GIMA EVENTROUTER_16_IN: SYNCH Position */\r
+#define GIMA_EVENTROUTER_16_IN_SYNCH_Msk                      (0x01UL << GIMA_EVENTROUTER_16_IN_SYNCH_Pos)              /*!< GIMA EVENTROUTER_16_IN: SYNCH Mask  */\r
+#define GIMA_EVENTROUTER_16_IN_PULSE_Pos                      3                                                         /*!< GIMA EVENTROUTER_16_IN: PULSE Position */\r
+#define GIMA_EVENTROUTER_16_IN_PULSE_Msk                      (0x01UL << GIMA_EVENTROUTER_16_IN_PULSE_Pos)              /*!< GIMA EVENTROUTER_16_IN: PULSE Mask  */\r
+#define GIMA_EVENTROUTER_16_IN_SELECT_Pos                     4                                                         /*!< GIMA EVENTROUTER_16_IN: SELECT Position */\r
+#define GIMA_EVENTROUTER_16_IN_SELECT_Msk                     (0x0fUL << GIMA_EVENTROUTER_16_IN_SELECT_Pos)             /*!< GIMA EVENTROUTER_16_IN: SELECT Mask */\r
+\r
+// ------------------------------------  GIMA_ADCSTART0_IN  ---------------------------------------\r
+#define GIMA_ADCSTART0_IN_INV_Pos                             0                                                         /*!< GIMA ADCSTART0_IN: INV Position     */\r
+#define GIMA_ADCSTART0_IN_INV_Msk                             (0x01UL << GIMA_ADCSTART0_IN_INV_Pos)                     /*!< GIMA ADCSTART0_IN: INV Mask         */\r
+#define GIMA_ADCSTART0_IN_EDGE_Pos                            1                                                         /*!< GIMA ADCSTART0_IN: EDGE Position    */\r
+#define GIMA_ADCSTART0_IN_EDGE_Msk                            (0x01UL << GIMA_ADCSTART0_IN_EDGE_Pos)                    /*!< GIMA ADCSTART0_IN: EDGE Mask        */\r
+#define GIMA_ADCSTART0_IN_SYNCH_Pos                           2                                                         /*!< GIMA ADCSTART0_IN: SYNCH Position   */\r
+#define GIMA_ADCSTART0_IN_SYNCH_Msk                           (0x01UL << GIMA_ADCSTART0_IN_SYNCH_Pos)                   /*!< GIMA ADCSTART0_IN: SYNCH Mask       */\r
+#define GIMA_ADCSTART0_IN_PULSE_Pos                           3                                                         /*!< GIMA ADCSTART0_IN: PULSE Position   */\r
+#define GIMA_ADCSTART0_IN_PULSE_Msk                           (0x01UL << GIMA_ADCSTART0_IN_PULSE_Pos)                   /*!< GIMA ADCSTART0_IN: PULSE Mask       */\r
+#define GIMA_ADCSTART0_IN_SELECT_Pos                          4                                                         /*!< GIMA ADCSTART0_IN: SELECT Position  */\r
+#define GIMA_ADCSTART0_IN_SELECT_Msk                          (0x0fUL << GIMA_ADCSTART0_IN_SELECT_Pos)                  /*!< GIMA ADCSTART0_IN: SELECT Mask      */\r
+\r
+// ------------------------------------  GIMA_ADCSTART1_IN  ---------------------------------------\r
+#define GIMA_ADCSTART1_IN_INV_Pos                             0                                                         /*!< GIMA ADCSTART1_IN: INV Position     */\r
+#define GIMA_ADCSTART1_IN_INV_Msk                             (0x01UL << GIMA_ADCSTART1_IN_INV_Pos)                     /*!< GIMA ADCSTART1_IN: INV Mask         */\r
+#define GIMA_ADCSTART1_IN_EDGE_Pos                            1                                                         /*!< GIMA ADCSTART1_IN: EDGE Position    */\r
+#define GIMA_ADCSTART1_IN_EDGE_Msk                            (0x01UL << GIMA_ADCSTART1_IN_EDGE_Pos)                    /*!< GIMA ADCSTART1_IN: EDGE Mask        */\r
+#define GIMA_ADCSTART1_IN_SYNCH_Pos                           2                                                         /*!< GIMA ADCSTART1_IN: SYNCH Position   */\r
+#define GIMA_ADCSTART1_IN_SYNCH_Msk                           (0x01UL << GIMA_ADCSTART1_IN_SYNCH_Pos)                   /*!< GIMA ADCSTART1_IN: SYNCH Mask       */\r
+#define GIMA_ADCSTART1_IN_PULSE_Pos                           3                                                         /*!< GIMA ADCSTART1_IN: PULSE Position   */\r
+#define GIMA_ADCSTART1_IN_PULSE_Msk                           (0x01UL << GIMA_ADCSTART1_IN_PULSE_Pos)                   /*!< GIMA ADCSTART1_IN: PULSE Mask       */\r
+#define GIMA_ADCSTART1_IN_SELECT_Pos                          4                                                         /*!< GIMA ADCSTART1_IN: SELECT Position  */\r
+#define GIMA_ADCSTART1_IN_SELECT_Msk                          (0x0fUL << GIMA_ADCSTART1_IN_SELECT_Pos)                  /*!< GIMA ADCSTART1_IN: SELECT Mask      */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                  DAC Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  DAC_CR  ---------------------------------------------\r
+#define DAC_CR_VALUE_Pos                                      6                                                         /*!< DAC CR: VALUE Position              */\r
+#define DAC_CR_VALUE_Msk                                      (0x000003ffUL << DAC_CR_VALUE_Pos)                        /*!< DAC CR: VALUE Mask                  */\r
+#define DAC_CR_BIAS_Pos                                       16                                                        /*!< DAC CR: BIAS Position               */\r
+#define DAC_CR_BIAS_Msk                                       (0x01UL << DAC_CR_BIAS_Pos)                               /*!< DAC CR: BIAS Mask                   */\r
+\r
+// ----------------------------------------  DAC_CTRL  --------------------------------------------\r
+#define DAC_CTRL_INT_DMA_REQ_Pos                              0                                                         /*!< DAC CTRL: INT_DMA_REQ Position      */\r
+#define DAC_CTRL_INT_DMA_REQ_Msk                              (0x01UL << DAC_CTRL_INT_DMA_REQ_Pos)                      /*!< DAC CTRL: INT_DMA_REQ Mask          */\r
+#define DAC_CTRL_DBLBUF_ENA_Pos                               1                                                         /*!< DAC CTRL: DBLBUF_ENA Position       */\r
+#define DAC_CTRL_DBLBUF_ENA_Msk                               (0x01UL << DAC_CTRL_DBLBUF_ENA_Pos)                       /*!< DAC CTRL: DBLBUF_ENA Mask           */\r
+#define DAC_CTRL_CNT_ENA_Pos                                  2                                                         /*!< DAC CTRL: CNT_ENA Position          */\r
+#define DAC_CTRL_CNT_ENA_Msk                                  (0x01UL << DAC_CTRL_CNT_ENA_Pos)                          /*!< DAC CTRL: CNT_ENA Mask              */\r
+#define DAC_CTRL_DMA_ENA_Pos                                  3                                                         /*!< DAC CTRL: DMA_ENA Position          */\r
+#define DAC_CTRL_DMA_ENA_Msk                                  (0x01UL << DAC_CTRL_DMA_ENA_Pos)                          /*!< DAC CTRL: DMA_ENA Mask              */\r
+\r
+// ---------------------------------------  DAC_CNTVAL  -------------------------------------------\r
+#define DAC_CNTVAL_VALUE_Pos                                  0                                                         /*!< DAC CNTVAL: VALUE Position          */\r
+#define DAC_CNTVAL_VALUE_Msk                                  (0x0000ffffUL << DAC_CNTVAL_VALUE_Pos)                    /*!< DAC CNTVAL: VALUE Mask              */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                C_CAN0 Position & Mask                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// ---------------------------------------  C_CAN0_CNTL  ------------------------------------------\r
+#define C_CAN0_CNTL_INIT_Pos                                  0                                                         /*!< C_CAN0 CNTL: INIT Position          */\r
+#define C_CAN0_CNTL_INIT_Msk                                  (0x01UL << C_CAN0_CNTL_INIT_Pos)                          /*!< C_CAN0 CNTL: INIT Mask              */\r
+#define C_CAN0_CNTL_IE_Pos                                    1                                                         /*!< C_CAN0 CNTL: IE Position            */\r
+#define C_CAN0_CNTL_IE_Msk                                    (0x01UL << C_CAN0_CNTL_IE_Pos)                            /*!< C_CAN0 CNTL: IE Mask                */\r
+#define C_CAN0_CNTL_SIE_Pos                                   2                                                         /*!< C_CAN0 CNTL: SIE Position           */\r
+#define C_CAN0_CNTL_SIE_Msk                                   (0x01UL << C_CAN0_CNTL_SIE_Pos)                           /*!< C_CAN0 CNTL: SIE Mask               */\r
+#define C_CAN0_CNTL_EIE_Pos                                   3                                                         /*!< C_CAN0 CNTL: EIE Position           */\r
+#define C_CAN0_CNTL_EIE_Msk                                   (0x01UL << C_CAN0_CNTL_EIE_Pos)                           /*!< C_CAN0 CNTL: EIE Mask               */\r
+#define C_CAN0_CNTL_DAR_Pos                                   5                                                         /*!< C_CAN0 CNTL: DAR Position           */\r
+#define C_CAN0_CNTL_DAR_Msk                                   (0x01UL << C_CAN0_CNTL_DAR_Pos)                           /*!< C_CAN0 CNTL: DAR Mask               */\r
+#define C_CAN0_CNTL_CCE_Pos                                   6                                                         /*!< C_CAN0 CNTL: CCE Position           */\r
+#define C_CAN0_CNTL_CCE_Msk                                   (0x01UL << C_CAN0_CNTL_CCE_Pos)                           /*!< C_CAN0 CNTL: CCE Mask               */\r
+#define C_CAN0_CNTL_TEST_Pos                                  7                                                         /*!< C_CAN0 CNTL: TEST Position          */\r
+#define C_CAN0_CNTL_TEST_Msk                                  (0x01UL << C_CAN0_CNTL_TEST_Pos)                          /*!< C_CAN0 CNTL: TEST Mask              */\r
+\r
+// ---------------------------------------  C_CAN0_STAT  ------------------------------------------\r
+#define C_CAN0_STAT_LEC_Pos                                   0                                                         /*!< C_CAN0 STAT: LEC Position           */\r
+#define C_CAN0_STAT_LEC_Msk                                   (0x07UL << C_CAN0_STAT_LEC_Pos)                           /*!< C_CAN0 STAT: LEC Mask               */\r
+#define C_CAN0_STAT_TXOK_Pos                                  3                                                         /*!< C_CAN0 STAT: TXOK Position          */\r
+#define C_CAN0_STAT_TXOK_Msk                                  (0x01UL << C_CAN0_STAT_TXOK_Pos)                          /*!< C_CAN0 STAT: TXOK Mask              */\r
+#define C_CAN0_STAT_RXOK_Pos                                  4                                                         /*!< C_CAN0 STAT: RXOK Position          */\r
+#define C_CAN0_STAT_RXOK_Msk                                  (0x01UL << C_CAN0_STAT_RXOK_Pos)                          /*!< C_CAN0 STAT: RXOK Mask              */\r
+#define C_CAN0_STAT_EPASS_Pos                                 5                                                         /*!< C_CAN0 STAT: EPASS Position         */\r
+#define C_CAN0_STAT_EPASS_Msk                                 (0x01UL << C_CAN0_STAT_EPASS_Pos)                         /*!< C_CAN0 STAT: EPASS Mask             */\r
+#define C_CAN0_STAT_EWARN_Pos                                 6                                                         /*!< C_CAN0 STAT: EWARN Position         */\r
+#define C_CAN0_STAT_EWARN_Msk                                 (0x01UL << C_CAN0_STAT_EWARN_Pos)                         /*!< C_CAN0 STAT: EWARN Mask             */\r
+#define C_CAN0_STAT_BOFF_Pos                                  7                                                         /*!< C_CAN0 STAT: BOFF Position          */\r
+#define C_CAN0_STAT_BOFF_Msk                                  (0x01UL << C_CAN0_STAT_BOFF_Pos)                          /*!< C_CAN0 STAT: BOFF Mask              */\r
+\r
+// ----------------------------------------  C_CAN0_EC  -------------------------------------------\r
+#define C_CAN0_EC_TEC_7_0_Pos                                 0                                                         /*!< C_CAN0 EC: TEC_7_0 Position         */\r
+#define C_CAN0_EC_TEC_7_0_Msk                                 (0x000000ffUL << C_CAN0_EC_TEC_7_0_Pos)                   /*!< C_CAN0 EC: TEC_7_0 Mask             */\r
+#define C_CAN0_EC_REC_6_0_Pos                                 8                                                         /*!< C_CAN0 EC: REC_6_0 Position         */\r
+#define C_CAN0_EC_REC_6_0_Msk                                 (0x7fUL << C_CAN0_EC_REC_6_0_Pos)                         /*!< C_CAN0 EC: REC_6_0 Mask             */\r
+#define C_CAN0_EC_RP_Pos                                      15                                                        /*!< C_CAN0 EC: RP Position              */\r
+#define C_CAN0_EC_RP_Msk                                      (0x01UL << C_CAN0_EC_RP_Pos)                              /*!< C_CAN0 EC: RP Mask                  */\r
+\r
+// ----------------------------------------  C_CAN0_BT  -------------------------------------------\r
+#define C_CAN0_BT_BRP_Pos                                     0                                                         /*!< C_CAN0 BT: BRP Position             */\r
+#define C_CAN0_BT_BRP_Msk                                     (0x3fUL << C_CAN0_BT_BRP_Pos)                             /*!< C_CAN0 BT: BRP Mask                 */\r
+#define C_CAN0_BT_SJW_Pos                                     6                                                         /*!< C_CAN0 BT: SJW Position             */\r
+#define C_CAN0_BT_SJW_Msk                                     (0x03UL << C_CAN0_BT_SJW_Pos)                             /*!< C_CAN0 BT: SJW Mask                 */\r
+#define C_CAN0_BT_TSEG1_Pos                                   8                                                         /*!< C_CAN0 BT: TSEG1 Position           */\r
+#define C_CAN0_BT_TSEG1_Msk                                   (0x0fUL << C_CAN0_BT_TSEG1_Pos)                           /*!< C_CAN0 BT: TSEG1 Mask               */\r
+#define C_CAN0_BT_TSEG2_Pos                                   12                                                        /*!< C_CAN0 BT: TSEG2 Position           */\r
+#define C_CAN0_BT_TSEG2_Msk                                   (0x07UL << C_CAN0_BT_TSEG2_Pos)                           /*!< C_CAN0 BT: TSEG2 Mask               */\r
+\r
+// ---------------------------------------  C_CAN0_INT  -------------------------------------------\r
+#define C_CAN0_INT_INTID15_0_Pos                              0                                                         /*!< C_CAN0 INT: INTID15_0 Position      */\r
+#define C_CAN0_INT_INTID15_0_Msk                              (0x0000ffffUL << C_CAN0_INT_INTID15_0_Pos)                /*!< C_CAN0 INT: INTID15_0 Mask          */\r
+\r
+// ---------------------------------------  C_CAN0_TEST  ------------------------------------------\r
+#define C_CAN0_TEST_BASIC_Pos                                 2                                                         /*!< C_CAN0 TEST: BASIC Position         */\r
+#define C_CAN0_TEST_BASIC_Msk                                 (0x01UL << C_CAN0_TEST_BASIC_Pos)                         /*!< C_CAN0 TEST: BASIC Mask             */\r
+#define C_CAN0_TEST_SILENT_Pos                                3                                                         /*!< C_CAN0 TEST: SILENT Position        */\r
+#define C_CAN0_TEST_SILENT_Msk                                (0x01UL << C_CAN0_TEST_SILENT_Pos)                        /*!< C_CAN0 TEST: SILENT Mask            */\r
+#define C_CAN0_TEST_LBACK_Pos                                 4                                                         /*!< C_CAN0 TEST: LBACK Position         */\r
+#define C_CAN0_TEST_LBACK_Msk                                 (0x01UL << C_CAN0_TEST_LBACK_Pos)                         /*!< C_CAN0 TEST: LBACK Mask             */\r
+#define C_CAN0_TEST_TX1_0_Pos                                 5                                                         /*!< C_CAN0 TEST: TX1_0 Position         */\r
+#define C_CAN0_TEST_TX1_0_Msk                                 (0x03UL << C_CAN0_TEST_TX1_0_Pos)                         /*!< C_CAN0 TEST: TX1_0 Mask             */\r
+#define C_CAN0_TEST_RX_Pos                                    7                                                         /*!< C_CAN0 TEST: RX Position            */\r
+#define C_CAN0_TEST_RX_Msk                                    (0x01UL << C_CAN0_TEST_RX_Pos)                            /*!< C_CAN0 TEST: RX Mask                */\r
+\r
+// ---------------------------------------  C_CAN0_BRPE  ------------------------------------------\r
+#define C_CAN0_BRPE_BRPE_Pos                                  0                                                         /*!< C_CAN0 BRPE: BRPE Position          */\r
+#define C_CAN0_BRPE_BRPE_Msk                                  (0x0fUL << C_CAN0_BRPE_BRPE_Pos)                          /*!< C_CAN0 BRPE: BRPE Mask              */\r
+\r
+// ------------------------------------  C_CAN0_IF1_CMDREQ  ---------------------------------------\r
+#define C_CAN0_IF1_CMDREQ_MESSNUM_Pos                         0                                                         /*!< C_CAN0 IF1_CMDREQ: MESSNUM Position */\r
+#define C_CAN0_IF1_CMDREQ_MESSNUM_Msk                         (0x3fUL << C_CAN0_IF1_CMDREQ_MESSNUM_Pos)                 /*!< C_CAN0 IF1_CMDREQ: MESSNUM Mask     */\r
+#define C_CAN0_IF1_CMDREQ_BUSY_Pos                            15                                                        /*!< C_CAN0 IF1_CMDREQ: BUSY Position    */\r
+#define C_CAN0_IF1_CMDREQ_BUSY_Msk                            (0x01UL << C_CAN0_IF1_CMDREQ_BUSY_Pos)                    /*!< C_CAN0 IF1_CMDREQ: BUSY Mask        */\r
+\r
+// -----------------------------------  C_CAN0_IF1_CMDMSK_R  --------------------------------------\r
+#define C_CAN0_IF1_CMDMSK_R_DATA_B_Pos                        0                                                         /*!< C_CAN0 IF1_CMDMSK_R: DATA_B Position */\r
+#define C_CAN0_IF1_CMDMSK_R_DATA_B_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_R_DATA_B_Pos)                /*!< C_CAN0 IF1_CMDMSK_R: DATA_B Mask    */\r
+#define C_CAN0_IF1_CMDMSK_R_DATA_A_Pos                        1                                                         /*!< C_CAN0 IF1_CMDMSK_R: DATA_A Position */\r
+#define C_CAN0_IF1_CMDMSK_R_DATA_A_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_R_DATA_A_Pos)                /*!< C_CAN0 IF1_CMDMSK_R: DATA_A Mask    */\r
+#define C_CAN0_IF1_CMDMSK_R_NEWDAT_Pos                        2                                                         /*!< C_CAN0 IF1_CMDMSK_R: NEWDAT Position */\r
+#define C_CAN0_IF1_CMDMSK_R_NEWDAT_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_R_NEWDAT_Pos)                /*!< C_CAN0 IF1_CMDMSK_R: NEWDAT Mask    */\r
+#define C_CAN0_IF1_CMDMSK_R_CLRINTPND_Pos                     3                                                         /*!< C_CAN0 IF1_CMDMSK_R: CLRINTPND Position */\r
+#define C_CAN0_IF1_CMDMSK_R_CLRINTPND_Msk                     (0x01UL << C_CAN0_IF1_CMDMSK_R_CLRINTPND_Pos)             /*!< C_CAN0 IF1_CMDMSK_R: CLRINTPND Mask */\r
+#define C_CAN0_IF1_CMDMSK_R_CTRL_Pos                          4                                                         /*!< C_CAN0 IF1_CMDMSK_R: CTRL Position  */\r
+#define C_CAN0_IF1_CMDMSK_R_CTRL_Msk                          (0x01UL << C_CAN0_IF1_CMDMSK_R_CTRL_Pos)                  /*!< C_CAN0 IF1_CMDMSK_R: CTRL Mask      */\r
+#define C_CAN0_IF1_CMDMSK_R_ARB_Pos                           5                                                         /*!< C_CAN0 IF1_CMDMSK_R: ARB Position   */\r
+#define C_CAN0_IF1_CMDMSK_R_ARB_Msk                           (0x01UL << C_CAN0_IF1_CMDMSK_R_ARB_Pos)                   /*!< C_CAN0 IF1_CMDMSK_R: ARB Mask       */\r
+#define C_CAN0_IF1_CMDMSK_R_MASK_Pos                          6                                                         /*!< C_CAN0 IF1_CMDMSK_R: MASK Position  */\r
+#define C_CAN0_IF1_CMDMSK_R_MASK_Msk                          (0x01UL << C_CAN0_IF1_CMDMSK_R_MASK_Pos)                  /*!< C_CAN0 IF1_CMDMSK_R: MASK Mask      */\r
+#define C_CAN0_IF1_CMDMSK_R_WR_RD_Pos                         7                                                         /*!< C_CAN0 IF1_CMDMSK_R: WR_RD Position */\r
+#define C_CAN0_IF1_CMDMSK_R_WR_RD_Msk                         (0x01UL << C_CAN0_IF1_CMDMSK_R_WR_RD_Pos)                 /*!< C_CAN0 IF1_CMDMSK_R: WR_RD Mask     */\r
+\r
+// -----------------------------------  C_CAN0_IF1_CMDMSK_W  --------------------------------------\r
+#define C_CAN0_IF1_CMDMSK_W_DATA_B_Pos                        0                                                         /*!< C_CAN0 IF1_CMDMSK_W: DATA_B Position */\r
+#define C_CAN0_IF1_CMDMSK_W_DATA_B_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_W_DATA_B_Pos)                /*!< C_CAN0 IF1_CMDMSK_W: DATA_B Mask    */\r
+#define C_CAN0_IF1_CMDMSK_W_DATA_A_Pos                        1                                                         /*!< C_CAN0 IF1_CMDMSK_W: DATA_A Position */\r
+#define C_CAN0_IF1_CMDMSK_W_DATA_A_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_W_DATA_A_Pos)                /*!< C_CAN0 IF1_CMDMSK_W: DATA_A Mask    */\r
+#define C_CAN0_IF1_CMDMSK_W_TXRQST_Pos                        2                                                         /*!< C_CAN0 IF1_CMDMSK_W: TXRQST Position */\r
+#define C_CAN0_IF1_CMDMSK_W_TXRQST_Msk                        (0x01UL << C_CAN0_IF1_CMDMSK_W_TXRQST_Pos)                /*!< C_CAN0 IF1_CMDMSK_W: TXRQST Mask    */\r
+#define C_CAN0_IF1_CMDMSK_W_CLRINTPND_Pos                     3                                                         /*!< C_CAN0 IF1_CMDMSK_W: CLRINTPND Position */\r
+#define C_CAN0_IF1_CMDMSK_W_CLRINTPND_Msk                     (0x01UL << C_CAN0_IF1_CMDMSK_W_CLRINTPND_Pos)             /*!< C_CAN0 IF1_CMDMSK_W: CLRINTPND Mask */\r
+#define C_CAN0_IF1_CMDMSK_W_CTRL_Pos                          4                                                         /*!< C_CAN0 IF1_CMDMSK_W: CTRL Position  */\r
+#define C_CAN0_IF1_CMDMSK_W_CTRL_Msk                          (0x01UL << C_CAN0_IF1_CMDMSK_W_CTRL_Pos)                  /*!< C_CAN0 IF1_CMDMSK_W: CTRL Mask      */\r
+#define C_CAN0_IF1_CMDMSK_W_ARB_Pos                           5                                                         /*!< C_CAN0 IF1_CMDMSK_W: ARB Position   */\r
+#define C_CAN0_IF1_CMDMSK_W_ARB_Msk                           (0x01UL << C_CAN0_IF1_CMDMSK_W_ARB_Pos)                   /*!< C_CAN0 IF1_CMDMSK_W: ARB Mask       */\r
+#define C_CAN0_IF1_CMDMSK_W_MASK_Pos                          6                                                         /*!< C_CAN0 IF1_CMDMSK_W: MASK Position  */\r
+#define C_CAN0_IF1_CMDMSK_W_MASK_Msk                          (0x01UL << C_CAN0_IF1_CMDMSK_W_MASK_Pos)                  /*!< C_CAN0 IF1_CMDMSK_W: MASK Mask      */\r
+#define C_CAN0_IF1_CMDMSK_W_WR_RD_Pos                         7                                                         /*!< C_CAN0 IF1_CMDMSK_W: WR_RD Position */\r
+#define C_CAN0_IF1_CMDMSK_W_WR_RD_Msk                         (0x01UL << C_CAN0_IF1_CMDMSK_W_WR_RD_Pos)                 /*!< C_CAN0 IF1_CMDMSK_W: WR_RD Mask     */\r
+\r
+// -------------------------------------  C_CAN0_IF1_MSK1  ----------------------------------------\r
+#define C_CAN0_IF1_MSK1_MSK15_0_Pos                           0                                                         /*!< C_CAN0 IF1_MSK1: MSK15_0 Position   */\r
+#define C_CAN0_IF1_MSK1_MSK15_0_Msk                           (0x0000ffffUL << C_CAN0_IF1_MSK1_MSK15_0_Pos)             /*!< C_CAN0 IF1_MSK1: MSK15_0 Mask       */\r
+\r
+// -------------------------------------  C_CAN0_IF1_MSK2  ----------------------------------------\r
+#define C_CAN0_IF1_MSK2_MSK28_16_Pos                          0                                                         /*!< C_CAN0 IF1_MSK2: MSK28_16 Position  */\r
+#define C_CAN0_IF1_MSK2_MSK28_16_Msk                          (0x00001fffUL << C_CAN0_IF1_MSK2_MSK28_16_Pos)            /*!< C_CAN0 IF1_MSK2: MSK28_16 Mask      */\r
+#define C_CAN0_IF1_MSK2_MDIR_Pos                              14                                                        /*!< C_CAN0 IF1_MSK2: MDIR Position      */\r
+#define C_CAN0_IF1_MSK2_MDIR_Msk                              (0x01UL << C_CAN0_IF1_MSK2_MDIR_Pos)                      /*!< C_CAN0 IF1_MSK2: MDIR Mask          */\r
+#define C_CAN0_IF1_MSK2_MXTD_Pos                              15                                                        /*!< C_CAN0 IF1_MSK2: MXTD Position      */\r
+#define C_CAN0_IF1_MSK2_MXTD_Msk                              (0x01UL << C_CAN0_IF1_MSK2_MXTD_Pos)                      /*!< C_CAN0 IF1_MSK2: MXTD Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF1_ARB1  ----------------------------------------\r
+#define C_CAN0_IF1_ARB1_ID15_0_Pos                            0                                                         /*!< C_CAN0 IF1_ARB1: ID15_0 Position    */\r
+#define C_CAN0_IF1_ARB1_ID15_0_Msk                            (0x0000ffffUL << C_CAN0_IF1_ARB1_ID15_0_Pos)              /*!< C_CAN0 IF1_ARB1: ID15_0 Mask        */\r
+\r
+// -------------------------------------  C_CAN0_IF1_ARB2  ----------------------------------------\r
+#define C_CAN0_IF1_ARB2_ID28_16_Pos                           0                                                         /*!< C_CAN0 IF1_ARB2: ID28_16 Position   */\r
+#define C_CAN0_IF1_ARB2_ID28_16_Msk                           (0x00001fffUL << C_CAN0_IF1_ARB2_ID28_16_Pos)             /*!< C_CAN0 IF1_ARB2: ID28_16 Mask       */\r
+#define C_CAN0_IF1_ARB2_DIR_Pos                               13                                                        /*!< C_CAN0 IF1_ARB2: DIR Position       */\r
+#define C_CAN0_IF1_ARB2_DIR_Msk                               (0x01UL << C_CAN0_IF1_ARB2_DIR_Pos)                       /*!< C_CAN0 IF1_ARB2: DIR Mask           */\r
+#define C_CAN0_IF1_ARB2_XTD_Pos                               14                                                        /*!< C_CAN0 IF1_ARB2: XTD Position       */\r
+#define C_CAN0_IF1_ARB2_XTD_Msk                               (0x01UL << C_CAN0_IF1_ARB2_XTD_Pos)                       /*!< C_CAN0 IF1_ARB2: XTD Mask           */\r
+#define C_CAN0_IF1_ARB2_MSGVAL_Pos                            15                                                        /*!< C_CAN0 IF1_ARB2: MSGVAL Position    */\r
+#define C_CAN0_IF1_ARB2_MSGVAL_Msk                            (0x01UL << C_CAN0_IF1_ARB2_MSGVAL_Pos)                    /*!< C_CAN0 IF1_ARB2: MSGVAL Mask        */\r
+\r
+// ------------------------------------  C_CAN0_IF1_MCTRL  ----------------------------------------\r
+#define C_CAN0_IF1_MCTRL_DLC3_0_Pos                           0                                                         /*!< C_CAN0 IF1_MCTRL: DLC3_0 Position   */\r
+#define C_CAN0_IF1_MCTRL_DLC3_0_Msk                           (0x0fUL << C_CAN0_IF1_MCTRL_DLC3_0_Pos)                   /*!< C_CAN0 IF1_MCTRL: DLC3_0 Mask       */\r
+#define C_CAN0_IF1_MCTRL_EOB_Pos                              7                                                         /*!< C_CAN0 IF1_MCTRL: EOB Position      */\r
+#define C_CAN0_IF1_MCTRL_EOB_Msk                              (0x01UL << C_CAN0_IF1_MCTRL_EOB_Pos)                      /*!< C_CAN0 IF1_MCTRL: EOB Mask          */\r
+#define C_CAN0_IF1_MCTRL_TXRQST_Pos                           8                                                         /*!< C_CAN0 IF1_MCTRL: TXRQST Position   */\r
+#define C_CAN0_IF1_MCTRL_TXRQST_Msk                           (0x01UL << C_CAN0_IF1_MCTRL_TXRQST_Pos)                   /*!< C_CAN0 IF1_MCTRL: TXRQST Mask       */\r
+#define C_CAN0_IF1_MCTRL_RMTEN_Pos                            9                                                         /*!< C_CAN0 IF1_MCTRL: RMTEN Position    */\r
+#define C_CAN0_IF1_MCTRL_RMTEN_Msk                            (0x01UL << C_CAN0_IF1_MCTRL_RMTEN_Pos)                    /*!< C_CAN0 IF1_MCTRL: RMTEN Mask        */\r
+#define C_CAN0_IF1_MCTRL_RXIE_Pos                             10                                                        /*!< C_CAN0 IF1_MCTRL: RXIE Position     */\r
+#define C_CAN0_IF1_MCTRL_RXIE_Msk                             (0x01UL << C_CAN0_IF1_MCTRL_RXIE_Pos)                     /*!< C_CAN0 IF1_MCTRL: RXIE Mask         */\r
+#define C_CAN0_IF1_MCTRL_TXIE_Pos                             11                                                        /*!< C_CAN0 IF1_MCTRL: TXIE Position     */\r
+#define C_CAN0_IF1_MCTRL_TXIE_Msk                             (0x01UL << C_CAN0_IF1_MCTRL_TXIE_Pos)                     /*!< C_CAN0 IF1_MCTRL: TXIE Mask         */\r
+#define C_CAN0_IF1_MCTRL_UMASK_Pos                            12                                                        /*!< C_CAN0 IF1_MCTRL: UMASK Position    */\r
+#define C_CAN0_IF1_MCTRL_UMASK_Msk                            (0x01UL << C_CAN0_IF1_MCTRL_UMASK_Pos)                    /*!< C_CAN0 IF1_MCTRL: UMASK Mask        */\r
+#define C_CAN0_IF1_MCTRL_INTPND_Pos                           13                                                        /*!< C_CAN0 IF1_MCTRL: INTPND Position   */\r
+#define C_CAN0_IF1_MCTRL_INTPND_Msk                           (0x01UL << C_CAN0_IF1_MCTRL_INTPND_Pos)                   /*!< C_CAN0 IF1_MCTRL: INTPND Mask       */\r
+#define C_CAN0_IF1_MCTRL_MSGLST_Pos                           14                                                        /*!< C_CAN0 IF1_MCTRL: MSGLST Position   */\r
+#define C_CAN0_IF1_MCTRL_MSGLST_Msk                           (0x01UL << C_CAN0_IF1_MCTRL_MSGLST_Pos)                   /*!< C_CAN0 IF1_MCTRL: MSGLST Mask       */\r
+#define C_CAN0_IF1_MCTRL_NEWDAT_Pos                           15                                                        /*!< C_CAN0 IF1_MCTRL: NEWDAT Position   */\r
+#define C_CAN0_IF1_MCTRL_NEWDAT_Msk                           (0x01UL << C_CAN0_IF1_MCTRL_NEWDAT_Pos)                   /*!< C_CAN0 IF1_MCTRL: NEWDAT Mask       */\r
+\r
+// -------------------------------------  C_CAN0_IF1_DA1  -----------------------------------------\r
+#define C_CAN0_IF1_DA1_DATA0_Pos                              0                                                         /*!< C_CAN0 IF1_DA1: DATA0 Position      */\r
+#define C_CAN0_IF1_DA1_DATA0_Msk                              (0x000000ffUL << C_CAN0_IF1_DA1_DATA0_Pos)                /*!< C_CAN0 IF1_DA1: DATA0 Mask          */\r
+#define C_CAN0_IF1_DA1_DATA1_Pos                              8                                                         /*!< C_CAN0 IF1_DA1: DATA1 Position      */\r
+#define C_CAN0_IF1_DA1_DATA1_Msk                              (0x000000ffUL << C_CAN0_IF1_DA1_DATA1_Pos)                /*!< C_CAN0 IF1_DA1: DATA1 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF1_DA2  -----------------------------------------\r
+#define C_CAN0_IF1_DA2_DATA2_Pos                              0                                                         /*!< C_CAN0 IF1_DA2: DATA2 Position      */\r
+#define C_CAN0_IF1_DA2_DATA2_Msk                              (0x000000ffUL << C_CAN0_IF1_DA2_DATA2_Pos)                /*!< C_CAN0 IF1_DA2: DATA2 Mask          */\r
+#define C_CAN0_IF1_DA2_DATA3_Pos                              8                                                         /*!< C_CAN0 IF1_DA2: DATA3 Position      */\r
+#define C_CAN0_IF1_DA2_DATA3_Msk                              (0x000000ffUL << C_CAN0_IF1_DA2_DATA3_Pos)                /*!< C_CAN0 IF1_DA2: DATA3 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF1_DB1  -----------------------------------------\r
+#define C_CAN0_IF1_DB1_DATA4_Pos                              0                                                         /*!< C_CAN0 IF1_DB1: DATA4 Position      */\r
+#define C_CAN0_IF1_DB1_DATA4_Msk                              (0x000000ffUL << C_CAN0_IF1_DB1_DATA4_Pos)                /*!< C_CAN0 IF1_DB1: DATA4 Mask          */\r
+#define C_CAN0_IF1_DB1_DATA5_Pos                              8                                                         /*!< C_CAN0 IF1_DB1: DATA5 Position      */\r
+#define C_CAN0_IF1_DB1_DATA5_Msk                              (0x000000ffUL << C_CAN0_IF1_DB1_DATA5_Pos)                /*!< C_CAN0 IF1_DB1: DATA5 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF1_DB2  -----------------------------------------\r
+#define C_CAN0_IF1_DB2_DATA6_Pos                              0                                                         /*!< C_CAN0 IF1_DB2: DATA6 Position      */\r
+#define C_CAN0_IF1_DB2_DATA6_Msk                              (0x000000ffUL << C_CAN0_IF1_DB2_DATA6_Pos)                /*!< C_CAN0 IF1_DB2: DATA6 Mask          */\r
+#define C_CAN0_IF1_DB2_DATA7_Pos                              8                                                         /*!< C_CAN0 IF1_DB2: DATA7 Position      */\r
+#define C_CAN0_IF1_DB2_DATA7_Msk                              (0x000000ffUL << C_CAN0_IF1_DB2_DATA7_Pos)                /*!< C_CAN0 IF1_DB2: DATA7 Mask          */\r
+\r
+// ------------------------------------  C_CAN0_IF2_CMDREQ  ---------------------------------------\r
+#define C_CAN0_IF2_CMDREQ_MESSNUM_Pos                         0                                                         /*!< C_CAN0 IF2_CMDREQ: MESSNUM Position */\r
+#define C_CAN0_IF2_CMDREQ_MESSNUM_Msk                         (0x3fUL << C_CAN0_IF2_CMDREQ_MESSNUM_Pos)                 /*!< C_CAN0 IF2_CMDREQ: MESSNUM Mask     */\r
+#define C_CAN0_IF2_CMDREQ_BUSY_Pos                            15                                                        /*!< C_CAN0 IF2_CMDREQ: BUSY Position    */\r
+#define C_CAN0_IF2_CMDREQ_BUSY_Msk                            (0x01UL << C_CAN0_IF2_CMDREQ_BUSY_Pos)                    /*!< C_CAN0 IF2_CMDREQ: BUSY Mask        */\r
+\r
+// -----------------------------------  C_CAN0_IF2_CMDMSK_R  --------------------------------------\r
+#define C_CAN0_IF2_CMDMSK_R_DATA_B_Pos                        0                                                         /*!< C_CAN0 IF2_CMDMSK_R: DATA_B Position */\r
+#define C_CAN0_IF2_CMDMSK_R_DATA_B_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_R_DATA_B_Pos)                /*!< C_CAN0 IF2_CMDMSK_R: DATA_B Mask    */\r
+#define C_CAN0_IF2_CMDMSK_R_DATA_A_Pos                        1                                                         /*!< C_CAN0 IF2_CMDMSK_R: DATA_A Position */\r
+#define C_CAN0_IF2_CMDMSK_R_DATA_A_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_R_DATA_A_Pos)                /*!< C_CAN0 IF2_CMDMSK_R: DATA_A Mask    */\r
+#define C_CAN0_IF2_CMDMSK_R_NEWDAT_Pos                        2                                                         /*!< C_CAN0 IF2_CMDMSK_R: NEWDAT Position */\r
+#define C_CAN0_IF2_CMDMSK_R_NEWDAT_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_R_NEWDAT_Pos)                /*!< C_CAN0 IF2_CMDMSK_R: NEWDAT Mask    */\r
+#define C_CAN0_IF2_CMDMSK_R_CLRINTPND_Pos                     3                                                         /*!< C_CAN0 IF2_CMDMSK_R: CLRINTPND Position */\r
+#define C_CAN0_IF2_CMDMSK_R_CLRINTPND_Msk                     (0x01UL << C_CAN0_IF2_CMDMSK_R_CLRINTPND_Pos)             /*!< C_CAN0 IF2_CMDMSK_R: CLRINTPND Mask */\r
+#define C_CAN0_IF2_CMDMSK_R_CTRL_Pos                          4                                                         /*!< C_CAN0 IF2_CMDMSK_R: CTRL Position  */\r
+#define C_CAN0_IF2_CMDMSK_R_CTRL_Msk                          (0x01UL << C_CAN0_IF2_CMDMSK_R_CTRL_Pos)                  /*!< C_CAN0 IF2_CMDMSK_R: CTRL Mask      */\r
+#define C_CAN0_IF2_CMDMSK_R_ARB_Pos                           5                                                         /*!< C_CAN0 IF2_CMDMSK_R: ARB Position   */\r
+#define C_CAN0_IF2_CMDMSK_R_ARB_Msk                           (0x01UL << C_CAN0_IF2_CMDMSK_R_ARB_Pos)                   /*!< C_CAN0 IF2_CMDMSK_R: ARB Mask       */\r
+#define C_CAN0_IF2_CMDMSK_R_MASK_Pos                          6                                                         /*!< C_CAN0 IF2_CMDMSK_R: MASK Position  */\r
+#define C_CAN0_IF2_CMDMSK_R_MASK_Msk                          (0x01UL << C_CAN0_IF2_CMDMSK_R_MASK_Pos)                  /*!< C_CAN0 IF2_CMDMSK_R: MASK Mask      */\r
+#define C_CAN0_IF2_CMDMSK_R_WR_RD_Pos                         7                                                         /*!< C_CAN0 IF2_CMDMSK_R: WR_RD Position */\r
+#define C_CAN0_IF2_CMDMSK_R_WR_RD_Msk                         (0x01UL << C_CAN0_IF2_CMDMSK_R_WR_RD_Pos)                 /*!< C_CAN0 IF2_CMDMSK_R: WR_RD Mask     */\r
+\r
+// -----------------------------------  C_CAN0_IF2_CMDMSK_W  --------------------------------------\r
+#define C_CAN0_IF2_CMDMSK_W_DATA_B_Pos                        0                                                         /*!< C_CAN0 IF2_CMDMSK_W: DATA_B Position */\r
+#define C_CAN0_IF2_CMDMSK_W_DATA_B_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_W_DATA_B_Pos)                /*!< C_CAN0 IF2_CMDMSK_W: DATA_B Mask    */\r
+#define C_CAN0_IF2_CMDMSK_W_DATA_A_Pos                        1                                                         /*!< C_CAN0 IF2_CMDMSK_W: DATA_A Position */\r
+#define C_CAN0_IF2_CMDMSK_W_DATA_A_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_W_DATA_A_Pos)                /*!< C_CAN0 IF2_CMDMSK_W: DATA_A Mask    */\r
+#define C_CAN0_IF2_CMDMSK_W_TXRQST_Pos                        2                                                         /*!< C_CAN0 IF2_CMDMSK_W: TXRQST Position */\r
+#define C_CAN0_IF2_CMDMSK_W_TXRQST_Msk                        (0x01UL << C_CAN0_IF2_CMDMSK_W_TXRQST_Pos)                /*!< C_CAN0 IF2_CMDMSK_W: TXRQST Mask    */\r
+#define C_CAN0_IF2_CMDMSK_W_CLRINTPND_Pos                     3                                                         /*!< C_CAN0 IF2_CMDMSK_W: CLRINTPND Position */\r
+#define C_CAN0_IF2_CMDMSK_W_CLRINTPND_Msk                     (0x01UL << C_CAN0_IF2_CMDMSK_W_CLRINTPND_Pos)             /*!< C_CAN0 IF2_CMDMSK_W: CLRINTPND Mask */\r
+#define C_CAN0_IF2_CMDMSK_W_CTRL_Pos                          4                                                         /*!< C_CAN0 IF2_CMDMSK_W: CTRL Position  */\r
+#define C_CAN0_IF2_CMDMSK_W_CTRL_Msk                          (0x01UL << C_CAN0_IF2_CMDMSK_W_CTRL_Pos)                  /*!< C_CAN0 IF2_CMDMSK_W: CTRL Mask      */\r
+#define C_CAN0_IF2_CMDMSK_W_ARB_Pos                           5                                                         /*!< C_CAN0 IF2_CMDMSK_W: ARB Position   */\r
+#define C_CAN0_IF2_CMDMSK_W_ARB_Msk                           (0x01UL << C_CAN0_IF2_CMDMSK_W_ARB_Pos)                   /*!< C_CAN0 IF2_CMDMSK_W: ARB Mask       */\r
+#define C_CAN0_IF2_CMDMSK_W_MASK_Pos                          6                                                         /*!< C_CAN0 IF2_CMDMSK_W: MASK Position  */\r
+#define C_CAN0_IF2_CMDMSK_W_MASK_Msk                          (0x01UL << C_CAN0_IF2_CMDMSK_W_MASK_Pos)                  /*!< C_CAN0 IF2_CMDMSK_W: MASK Mask      */\r
+#define C_CAN0_IF2_CMDMSK_W_WR_RD_Pos                         7                                                         /*!< C_CAN0 IF2_CMDMSK_W: WR_RD Position */\r
+#define C_CAN0_IF2_CMDMSK_W_WR_RD_Msk                         (0x01UL << C_CAN0_IF2_CMDMSK_W_WR_RD_Pos)                 /*!< C_CAN0 IF2_CMDMSK_W: WR_RD Mask     */\r
+\r
+// -------------------------------------  C_CAN0_IF2_MSK1  ----------------------------------------\r
+#define C_CAN0_IF2_MSK1_MSK15_0_Pos                           0                                                         /*!< C_CAN0 IF2_MSK1: MSK15_0 Position   */\r
+#define C_CAN0_IF2_MSK1_MSK15_0_Msk                           (0x0000ffffUL << C_CAN0_IF2_MSK1_MSK15_0_Pos)             /*!< C_CAN0 IF2_MSK1: MSK15_0 Mask       */\r
+\r
+// -------------------------------------  C_CAN0_IF2_MSK2  ----------------------------------------\r
+#define C_CAN0_IF2_MSK2_MSK28_16_Pos                          0                                                         /*!< C_CAN0 IF2_MSK2: MSK28_16 Position  */\r
+#define C_CAN0_IF2_MSK2_MSK28_16_Msk                          (0x00001fffUL << C_CAN0_IF2_MSK2_MSK28_16_Pos)            /*!< C_CAN0 IF2_MSK2: MSK28_16 Mask      */\r
+#define C_CAN0_IF2_MSK2_MDIR_Pos                              14                                                        /*!< C_CAN0 IF2_MSK2: MDIR Position      */\r
+#define C_CAN0_IF2_MSK2_MDIR_Msk                              (0x01UL << C_CAN0_IF2_MSK2_MDIR_Pos)                      /*!< C_CAN0 IF2_MSK2: MDIR Mask          */\r
+#define C_CAN0_IF2_MSK2_MXTD_Pos                              15                                                        /*!< C_CAN0 IF2_MSK2: MXTD Position      */\r
+#define C_CAN0_IF2_MSK2_MXTD_Msk                              (0x01UL << C_CAN0_IF2_MSK2_MXTD_Pos)                      /*!< C_CAN0 IF2_MSK2: MXTD Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF2_ARB1  ----------------------------------------\r
+#define C_CAN0_IF2_ARB1_ID15_0_Pos                            0                                                         /*!< C_CAN0 IF2_ARB1: ID15_0 Position    */\r
+#define C_CAN0_IF2_ARB1_ID15_0_Msk                            (0x0000ffffUL << C_CAN0_IF2_ARB1_ID15_0_Pos)              /*!< C_CAN0 IF2_ARB1: ID15_0 Mask        */\r
+\r
+// -------------------------------------  C_CAN0_IF2_ARB2  ----------------------------------------\r
+#define C_CAN0_IF2_ARB2_ID28_16_Pos                           0                                                         /*!< C_CAN0 IF2_ARB2: ID28_16 Position   */\r
+#define C_CAN0_IF2_ARB2_ID28_16_Msk                           (0x00001fffUL << C_CAN0_IF2_ARB2_ID28_16_Pos)             /*!< C_CAN0 IF2_ARB2: ID28_16 Mask       */\r
+#define C_CAN0_IF2_ARB2_DIR_Pos                               13                                                        /*!< C_CAN0 IF2_ARB2: DIR Position       */\r
+#define C_CAN0_IF2_ARB2_DIR_Msk                               (0x01UL << C_CAN0_IF2_ARB2_DIR_Pos)                       /*!< C_CAN0 IF2_ARB2: DIR Mask           */\r
+#define C_CAN0_IF2_ARB2_XTD_Pos                               14                                                        /*!< C_CAN0 IF2_ARB2: XTD Position       */\r
+#define C_CAN0_IF2_ARB2_XTD_Msk                               (0x01UL << C_CAN0_IF2_ARB2_XTD_Pos)                       /*!< C_CAN0 IF2_ARB2: XTD Mask           */\r
+#define C_CAN0_IF2_ARB2_MSGVAL_Pos                            15                                                        /*!< C_CAN0 IF2_ARB2: MSGVAL Position    */\r
+#define C_CAN0_IF2_ARB2_MSGVAL_Msk                            (0x01UL << C_CAN0_IF2_ARB2_MSGVAL_Pos)                    /*!< C_CAN0 IF2_ARB2: MSGVAL Mask        */\r
+\r
+// ------------------------------------  C_CAN0_IF2_MCTRL  ----------------------------------------\r
+#define C_CAN0_IF2_MCTRL_DLC3_0_Pos                           0                                                         /*!< C_CAN0 IF2_MCTRL: DLC3_0 Position   */\r
+#define C_CAN0_IF2_MCTRL_DLC3_0_Msk                           (0x0fUL << C_CAN0_IF2_MCTRL_DLC3_0_Pos)                   /*!< C_CAN0 IF2_MCTRL: DLC3_0 Mask       */\r
+#define C_CAN0_IF2_MCTRL_EOB_Pos                              7                                                         /*!< C_CAN0 IF2_MCTRL: EOB Position      */\r
+#define C_CAN0_IF2_MCTRL_EOB_Msk                              (0x01UL << C_CAN0_IF2_MCTRL_EOB_Pos)                      /*!< C_CAN0 IF2_MCTRL: EOB Mask          */\r
+#define C_CAN0_IF2_MCTRL_TXRQST_Pos                           8                                                         /*!< C_CAN0 IF2_MCTRL: TXRQST Position   */\r
+#define C_CAN0_IF2_MCTRL_TXRQST_Msk                           (0x01UL << C_CAN0_IF2_MCTRL_TXRQST_Pos)                   /*!< C_CAN0 IF2_MCTRL: TXRQST Mask       */\r
+#define C_CAN0_IF2_MCTRL_RMTEN_Pos                            9                                                         /*!< C_CAN0 IF2_MCTRL: RMTEN Position    */\r
+#define C_CAN0_IF2_MCTRL_RMTEN_Msk                            (0x01UL << C_CAN0_IF2_MCTRL_RMTEN_Pos)                    /*!< C_CAN0 IF2_MCTRL: RMTEN Mask        */\r
+#define C_CAN0_IF2_MCTRL_RXIE_Pos                             10                                                        /*!< C_CAN0 IF2_MCTRL: RXIE Position     */\r
+#define C_CAN0_IF2_MCTRL_RXIE_Msk                             (0x01UL << C_CAN0_IF2_MCTRL_RXIE_Pos)                     /*!< C_CAN0 IF2_MCTRL: RXIE Mask         */\r
+#define C_CAN0_IF2_MCTRL_TXIE_Pos                             11                                                        /*!< C_CAN0 IF2_MCTRL: TXIE Position     */\r
+#define C_CAN0_IF2_MCTRL_TXIE_Msk                             (0x01UL << C_CAN0_IF2_MCTRL_TXIE_Pos)                     /*!< C_CAN0 IF2_MCTRL: TXIE Mask         */\r
+#define C_CAN0_IF2_MCTRL_UMASK_Pos                            12                                                        /*!< C_CAN0 IF2_MCTRL: UMASK Position    */\r
+#define C_CAN0_IF2_MCTRL_UMASK_Msk                            (0x01UL << C_CAN0_IF2_MCTRL_UMASK_Pos)                    /*!< C_CAN0 IF2_MCTRL: UMASK Mask        */\r
+#define C_CAN0_IF2_MCTRL_INTPND_Pos                           13                                                        /*!< C_CAN0 IF2_MCTRL: INTPND Position   */\r
+#define C_CAN0_IF2_MCTRL_INTPND_Msk                           (0x01UL << C_CAN0_IF2_MCTRL_INTPND_Pos)                   /*!< C_CAN0 IF2_MCTRL: INTPND Mask       */\r
+#define C_CAN0_IF2_MCTRL_MSGLST_Pos                           14                                                        /*!< C_CAN0 IF2_MCTRL: MSGLST Position   */\r
+#define C_CAN0_IF2_MCTRL_MSGLST_Msk                           (0x01UL << C_CAN0_IF2_MCTRL_MSGLST_Pos)                   /*!< C_CAN0 IF2_MCTRL: MSGLST Mask       */\r
+#define C_CAN0_IF2_MCTRL_NEWDAT_Pos                           15                                                        /*!< C_CAN0 IF2_MCTRL: NEWDAT Position   */\r
+#define C_CAN0_IF2_MCTRL_NEWDAT_Msk                           (0x01UL << C_CAN0_IF2_MCTRL_NEWDAT_Pos)                   /*!< C_CAN0 IF2_MCTRL: NEWDAT Mask       */\r
+\r
+// -------------------------------------  C_CAN0_IF2_DA1  -----------------------------------------\r
+#define C_CAN0_IF2_DA1_DATA0_Pos                              0                                                         /*!< C_CAN0 IF2_DA1: DATA0 Position      */\r
+#define C_CAN0_IF2_DA1_DATA0_Msk                              (0x000000ffUL << C_CAN0_IF2_DA1_DATA0_Pos)                /*!< C_CAN0 IF2_DA1: DATA0 Mask          */\r
+#define C_CAN0_IF2_DA1_DATA1_Pos                              8                                                         /*!< C_CAN0 IF2_DA1: DATA1 Position      */\r
+#define C_CAN0_IF2_DA1_DATA1_Msk                              (0x000000ffUL << C_CAN0_IF2_DA1_DATA1_Pos)                /*!< C_CAN0 IF2_DA1: DATA1 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF2_DA2  -----------------------------------------\r
+#define C_CAN0_IF2_DA2_DATA2_Pos                              0                                                         /*!< C_CAN0 IF2_DA2: DATA2 Position      */\r
+#define C_CAN0_IF2_DA2_DATA2_Msk                              (0x000000ffUL << C_CAN0_IF2_DA2_DATA2_Pos)                /*!< C_CAN0 IF2_DA2: DATA2 Mask          */\r
+#define C_CAN0_IF2_DA2_DATA3_Pos                              8                                                         /*!< C_CAN0 IF2_DA2: DATA3 Position      */\r
+#define C_CAN0_IF2_DA2_DATA3_Msk                              (0x000000ffUL << C_CAN0_IF2_DA2_DATA3_Pos)                /*!< C_CAN0 IF2_DA2: DATA3 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF2_DB1  -----------------------------------------\r
+#define C_CAN0_IF2_DB1_DATA4_Pos                              0                                                         /*!< C_CAN0 IF2_DB1: DATA4 Position      */\r
+#define C_CAN0_IF2_DB1_DATA4_Msk                              (0x000000ffUL << C_CAN0_IF2_DB1_DATA4_Pos)                /*!< C_CAN0 IF2_DB1: DATA4 Mask          */\r
+#define C_CAN0_IF2_DB1_DATA5_Pos                              8                                                         /*!< C_CAN0 IF2_DB1: DATA5 Position      */\r
+#define C_CAN0_IF2_DB1_DATA5_Msk                              (0x000000ffUL << C_CAN0_IF2_DB1_DATA5_Pos)                /*!< C_CAN0 IF2_DB1: DATA5 Mask          */\r
+\r
+// -------------------------------------  C_CAN0_IF2_DB2  -----------------------------------------\r
+#define C_CAN0_IF2_DB2_DATA6_Pos                              0                                                         /*!< C_CAN0 IF2_DB2: DATA6 Position      */\r
+#define C_CAN0_IF2_DB2_DATA6_Msk                              (0x000000ffUL << C_CAN0_IF2_DB2_DATA6_Pos)                /*!< C_CAN0 IF2_DB2: DATA6 Mask          */\r
+#define C_CAN0_IF2_DB2_DATA7_Pos                              8                                                         /*!< C_CAN0 IF2_DB2: DATA7 Position      */\r
+#define C_CAN0_IF2_DB2_DATA7_Msk                              (0x000000ffUL << C_CAN0_IF2_DB2_DATA7_Pos)                /*!< C_CAN0 IF2_DB2: DATA7 Mask          */\r
+\r
+// --------------------------------------  C_CAN0_TXREQ1  -----------------------------------------\r
+#define C_CAN0_TXREQ1_TXRQST16_1_Pos                          0                                                         /*!< C_CAN0 TXREQ1: TXRQST16_1 Position  */\r
+#define C_CAN0_TXREQ1_TXRQST16_1_Msk                          (0x0000ffffUL << C_CAN0_TXREQ1_TXRQST16_1_Pos)            /*!< C_CAN0 TXREQ1: TXRQST16_1 Mask      */\r
+\r
+// --------------------------------------  C_CAN0_TXREQ2  -----------------------------------------\r
+#define C_CAN0_TXREQ2_TXRQST32_17_Pos                         0                                                         /*!< C_CAN0 TXREQ2: TXRQST32_17 Position */\r
+#define C_CAN0_TXREQ2_TXRQST32_17_Msk                         (0x0000ffffUL << C_CAN0_TXREQ2_TXRQST32_17_Pos)           /*!< C_CAN0 TXREQ2: TXRQST32_17 Mask     */\r
+\r
+// ---------------------------------------  C_CAN0_ND1  -------------------------------------------\r
+#define C_CAN0_ND1_NEWDAT16_1_Pos                             0                                                         /*!< C_CAN0 ND1: NEWDAT16_1 Position     */\r
+#define C_CAN0_ND1_NEWDAT16_1_Msk                             (0x0000ffffUL << C_CAN0_ND1_NEWDAT16_1_Pos)               /*!< C_CAN0 ND1: NEWDAT16_1 Mask         */\r
+\r
+// ---------------------------------------  C_CAN0_ND2  -------------------------------------------\r
+#define C_CAN0_ND2_NEWDAT32_17_Pos                            0                                                         /*!< C_CAN0 ND2: NEWDAT32_17 Position    */\r
+#define C_CAN0_ND2_NEWDAT32_17_Msk                            (0x0000ffffUL << C_CAN0_ND2_NEWDAT32_17_Pos)              /*!< C_CAN0 ND2: NEWDAT32_17 Mask        */\r
+\r
+// ---------------------------------------  C_CAN0_IR1  -------------------------------------------\r
+#define C_CAN0_IR1_INTPND16_1_Pos                             0                                                         /*!< C_CAN0 IR1: INTPND16_1 Position     */\r
+#define C_CAN0_IR1_INTPND16_1_Msk                             (0x0000ffffUL << C_CAN0_IR1_INTPND16_1_Pos)               /*!< C_CAN0 IR1: INTPND16_1 Mask         */\r
+\r
+// ---------------------------------------  C_CAN0_IR2  -------------------------------------------\r
+#define C_CAN0_IR2_INTPND32_17_Pos                            0                                                         /*!< C_CAN0 IR2: INTPND32_17 Position    */\r
+#define C_CAN0_IR2_INTPND32_17_Msk                            (0x0000ffffUL << C_CAN0_IR2_INTPND32_17_Pos)              /*!< C_CAN0 IR2: INTPND32_17 Mask        */\r
+\r
+// --------------------------------------  C_CAN0_MSGV1  ------------------------------------------\r
+#define C_CAN0_MSGV1_MSGVAL16_1_Pos                           0                                                         /*!< C_CAN0 MSGV1: MSGVAL16_1 Position   */\r
+#define C_CAN0_MSGV1_MSGVAL16_1_Msk                           (0x0000ffffUL << C_CAN0_MSGV1_MSGVAL16_1_Pos)             /*!< C_CAN0 MSGV1: MSGVAL16_1 Mask       */\r
+\r
+// --------------------------------------  C_CAN0_MSGV2  ------------------------------------------\r
+#define C_CAN0_MSGV2_MSGVAL32_17_Pos                          0                                                         /*!< C_CAN0 MSGV2: MSGVAL32_17 Position  */\r
+#define C_CAN0_MSGV2_MSGVAL32_17_Msk                          (0x0000ffffUL << C_CAN0_MSGV2_MSGVAL32_17_Pos)            /*!< C_CAN0 MSGV2: MSGVAL32_17 Mask      */\r
+\r
+// --------------------------------------  C_CAN0_CLKDIV  -----------------------------------------\r
+#define C_CAN0_CLKDIV_CLKDIVVAL_Pos                           0                                                         /*!< C_CAN0 CLKDIV: CLKDIVVAL Position   */\r
+#define C_CAN0_CLKDIV_CLKDIVVAL_Msk                           (0x0fUL << C_CAN0_CLKDIV_CLKDIVVAL_Pos)                   /*!< C_CAN0 CLKDIV: CLKDIVVAL Mask       */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 ADC0 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  ADC0_CR  --------------------------------------------\r
+#define ADC0_CR_SEL_Pos                                       0                                                         /*!< ADC0 CR: SEL Position               */\r
+#define ADC0_CR_SEL_Msk                                       (0x000000ffUL << ADC0_CR_SEL_Pos)                         /*!< ADC0 CR: SEL Mask                   */\r
+#define ADC0_CR_CLKDIV_Pos                                    8                                                         /*!< ADC0 CR: CLKDIV Position            */\r
+#define ADC0_CR_CLKDIV_Msk                                    (0x000000ffUL << ADC0_CR_CLKDIV_Pos)                      /*!< ADC0 CR: CLKDIV Mask                */\r
+#define ADC0_CR_BURST_Pos                                     16                                                        /*!< ADC0 CR: BURST Position             */\r
+#define ADC0_CR_BURST_Msk                                     (0x01UL << ADC0_CR_BURST_Pos)                             /*!< ADC0 CR: BURST Mask                 */\r
+#define ADC0_CR_CLKS_Pos                                      17                                                        /*!< ADC0 CR: CLKS Position              */\r
+#define ADC0_CR_CLKS_Msk                                      (0x07UL << ADC0_CR_CLKS_Pos)                              /*!< ADC0 CR: CLKS Mask                  */\r
+#define ADC0_CR_PDN_Pos                                       21                                                        /*!< ADC0 CR: PDN Position               */\r
+#define ADC0_CR_PDN_Msk                                       (0x01UL << ADC0_CR_PDN_Pos)                               /*!< ADC0 CR: PDN Mask                   */\r
+#define ADC0_CR_START_Pos                                     24                                                        /*!< ADC0 CR: START Position             */\r
+#define ADC0_CR_START_Msk                                     (0x07UL << ADC0_CR_START_Pos)                             /*!< ADC0 CR: START Mask                 */\r
+#define ADC0_CR_EDGE_Pos                                      27                                                        /*!< ADC0 CR: EDGE Position              */\r
+#define ADC0_CR_EDGE_Msk                                      (0x01UL << ADC0_CR_EDGE_Pos)                              /*!< ADC0 CR: EDGE Mask                  */\r
+\r
+// ----------------------------------------  ADC0_GDR  --------------------------------------------\r
+#define ADC0_GDR_V_VREF_Pos                                   6                                                         /*!< ADC0 GDR: V_VREF Position           */\r
+#define ADC0_GDR_V_VREF_Msk                                   (0x000003ffUL << ADC0_GDR_V_VREF_Pos)                     /*!< ADC0 GDR: V_VREF Mask               */\r
+#define ADC0_GDR_CHN_Pos                                      24                                                        /*!< ADC0 GDR: CHN Position              */\r
+#define ADC0_GDR_CHN_Msk                                      (0x07UL << ADC0_GDR_CHN_Pos)                              /*!< ADC0 GDR: CHN Mask                  */\r
+#define ADC0_GDR_OVERRUN_Pos                                  30                                                        /*!< ADC0 GDR: OVERRUN Position          */\r
+#define ADC0_GDR_OVERRUN_Msk                                  (0x01UL << ADC0_GDR_OVERRUN_Pos)                          /*!< ADC0 GDR: OVERRUN Mask              */\r
+#define ADC0_GDR_DONE_Pos                                     31                                                        /*!< ADC0 GDR: DONE Position             */\r
+#define ADC0_GDR_DONE_Msk                                     (0x01UL << ADC0_GDR_DONE_Pos)                             /*!< ADC0 GDR: DONE Mask                 */\r
+\r
+// ---------------------------------------  ADC0_INTEN  -------------------------------------------\r
+#define ADC0_INTEN_ADINTEN_Pos                                0                                                         /*!< ADC0 INTEN: ADINTEN Position        */\r
+#define ADC0_INTEN_ADINTEN_Msk                                (0x000000ffUL << ADC0_INTEN_ADINTEN_Pos)                  /*!< ADC0 INTEN: ADINTEN Mask            */\r
+#define ADC0_INTEN_ADGINTEN_Pos                               8                                                         /*!< ADC0 INTEN: ADGINTEN Position       */\r
+#define ADC0_INTEN_ADGINTEN_Msk                               (0x01UL << ADC0_INTEN_ADGINTEN_Pos)                       /*!< ADC0 INTEN: ADGINTEN Mask           */\r
+\r
+// ----------------------------------------  ADC0_DR0  --------------------------------------------\r
+#define ADC0_DR0_V_VREF_Pos                                   6                                                         /*!< ADC0 DR0: V_VREF Position           */\r
+#define ADC0_DR0_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR0_V_VREF_Pos)                     /*!< ADC0 DR0: V_VREF Mask               */\r
+#define ADC0_DR0_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR0: OVERRUN Position          */\r
+#define ADC0_DR0_OVERRUN_Msk                                  (0x01UL << ADC0_DR0_OVERRUN_Pos)                          /*!< ADC0 DR0: OVERRUN Mask              */\r
+#define ADC0_DR0_DONE_Pos                                     31                                                        /*!< ADC0 DR0: DONE Position             */\r
+#define ADC0_DR0_DONE_Msk                                     (0x01UL << ADC0_DR0_DONE_Pos)                             /*!< ADC0 DR0: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR1  --------------------------------------------\r
+#define ADC0_DR1_V_VREF_Pos                                   6                                                         /*!< ADC0 DR1: V_VREF Position           */\r
+#define ADC0_DR1_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR1_V_VREF_Pos)                     /*!< ADC0 DR1: V_VREF Mask               */\r
+#define ADC0_DR1_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR1: OVERRUN Position          */\r
+#define ADC0_DR1_OVERRUN_Msk                                  (0x01UL << ADC0_DR1_OVERRUN_Pos)                          /*!< ADC0 DR1: OVERRUN Mask              */\r
+#define ADC0_DR1_DONE_Pos                                     31                                                        /*!< ADC0 DR1: DONE Position             */\r
+#define ADC0_DR1_DONE_Msk                                     (0x01UL << ADC0_DR1_DONE_Pos)                             /*!< ADC0 DR1: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR2  --------------------------------------------\r
+#define ADC0_DR2_V_VREF_Pos                                   6                                                         /*!< ADC0 DR2: V_VREF Position           */\r
+#define ADC0_DR2_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR2_V_VREF_Pos)                     /*!< ADC0 DR2: V_VREF Mask               */\r
+#define ADC0_DR2_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR2: OVERRUN Position          */\r
+#define ADC0_DR2_OVERRUN_Msk                                  (0x01UL << ADC0_DR2_OVERRUN_Pos)                          /*!< ADC0 DR2: OVERRUN Mask              */\r
+#define ADC0_DR2_DONE_Pos                                     31                                                        /*!< ADC0 DR2: DONE Position             */\r
+#define ADC0_DR2_DONE_Msk                                     (0x01UL << ADC0_DR2_DONE_Pos)                             /*!< ADC0 DR2: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR3  --------------------------------------------\r
+#define ADC0_DR3_V_VREF_Pos                                   6                                                         /*!< ADC0 DR3: V_VREF Position           */\r
+#define ADC0_DR3_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR3_V_VREF_Pos)                     /*!< ADC0 DR3: V_VREF Mask               */\r
+#define ADC0_DR3_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR3: OVERRUN Position          */\r
+#define ADC0_DR3_OVERRUN_Msk                                  (0x01UL << ADC0_DR3_OVERRUN_Pos)                          /*!< ADC0 DR3: OVERRUN Mask              */\r
+#define ADC0_DR3_DONE_Pos                                     31                                                        /*!< ADC0 DR3: DONE Position             */\r
+#define ADC0_DR3_DONE_Msk                                     (0x01UL << ADC0_DR3_DONE_Pos)                             /*!< ADC0 DR3: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR4  --------------------------------------------\r
+#define ADC0_DR4_V_VREF_Pos                                   6                                                         /*!< ADC0 DR4: V_VREF Position           */\r
+#define ADC0_DR4_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR4_V_VREF_Pos)                     /*!< ADC0 DR4: V_VREF Mask               */\r
+#define ADC0_DR4_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR4: OVERRUN Position          */\r
+#define ADC0_DR4_OVERRUN_Msk                                  (0x01UL << ADC0_DR4_OVERRUN_Pos)                          /*!< ADC0 DR4: OVERRUN Mask              */\r
+#define ADC0_DR4_DONE_Pos                                     31                                                        /*!< ADC0 DR4: DONE Position             */\r
+#define ADC0_DR4_DONE_Msk                                     (0x01UL << ADC0_DR4_DONE_Pos)                             /*!< ADC0 DR4: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR5  --------------------------------------------\r
+#define ADC0_DR5_V_VREF_Pos                                   6                                                         /*!< ADC0 DR5: V_VREF Position           */\r
+#define ADC0_DR5_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR5_V_VREF_Pos)                     /*!< ADC0 DR5: V_VREF Mask               */\r
+#define ADC0_DR5_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR5: OVERRUN Position          */\r
+#define ADC0_DR5_OVERRUN_Msk                                  (0x01UL << ADC0_DR5_OVERRUN_Pos)                          /*!< ADC0 DR5: OVERRUN Mask              */\r
+#define ADC0_DR5_DONE_Pos                                     31                                                        /*!< ADC0 DR5: DONE Position             */\r
+#define ADC0_DR5_DONE_Msk                                     (0x01UL << ADC0_DR5_DONE_Pos)                             /*!< ADC0 DR5: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR6  --------------------------------------------\r
+#define ADC0_DR6_V_VREF_Pos                                   6                                                         /*!< ADC0 DR6: V_VREF Position           */\r
+#define ADC0_DR6_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR6_V_VREF_Pos)                     /*!< ADC0 DR6: V_VREF Mask               */\r
+#define ADC0_DR6_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR6: OVERRUN Position          */\r
+#define ADC0_DR6_OVERRUN_Msk                                  (0x01UL << ADC0_DR6_OVERRUN_Pos)                          /*!< ADC0 DR6: OVERRUN Mask              */\r
+#define ADC0_DR6_DONE_Pos                                     31                                                        /*!< ADC0 DR6: DONE Position             */\r
+#define ADC0_DR6_DONE_Msk                                     (0x01UL << ADC0_DR6_DONE_Pos)                             /*!< ADC0 DR6: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_DR7  --------------------------------------------\r
+#define ADC0_DR7_V_VREF_Pos                                   6                                                         /*!< ADC0 DR7: V_VREF Position           */\r
+#define ADC0_DR7_V_VREF_Msk                                   (0x000003ffUL << ADC0_DR7_V_VREF_Pos)                     /*!< ADC0 DR7: V_VREF Mask               */\r
+#define ADC0_DR7_OVERRUN_Pos                                  30                                                        /*!< ADC0 DR7: OVERRUN Position          */\r
+#define ADC0_DR7_OVERRUN_Msk                                  (0x01UL << ADC0_DR7_OVERRUN_Pos)                          /*!< ADC0 DR7: OVERRUN Mask              */\r
+#define ADC0_DR7_DONE_Pos                                     31                                                        /*!< ADC0 DR7: DONE Position             */\r
+#define ADC0_DR7_DONE_Msk                                     (0x01UL << ADC0_DR7_DONE_Pos)                             /*!< ADC0 DR7: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC0_STAT  -------------------------------------------\r
+#define ADC0_STAT_DONE_Pos                                    0                                                         /*!< ADC0 STAT: DONE Position            */\r
+#define ADC0_STAT_DONE_Msk                                    (0x000000ffUL << ADC0_STAT_DONE_Pos)                      /*!< ADC0 STAT: DONE Mask                */\r
+#define ADC0_STAT_OVERUN_Pos                                  8                                                         /*!< ADC0 STAT: OVERUN Position          */\r
+#define ADC0_STAT_OVERUN_Msk                                  (0x000000ffUL << ADC0_STAT_OVERUN_Pos)                    /*!< ADC0 STAT: OVERUN Mask              */\r
+#define ADC0_STAT_ADINT_Pos                                   16                                                        /*!< ADC0 STAT: ADINT Position           */\r
+#define ADC0_STAT_ADINT_Msk                                   (0x01UL << ADC0_STAT_ADINT_Pos)                           /*!< ADC0 STAT: ADINT Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 ADC1 Position & Mask                                 -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// -----------------------------------------  ADC1_CR  --------------------------------------------\r
+#define ADC1_CR_SEL_Pos                                       0                                                         /*!< ADC1 CR: SEL Position               */\r
+#define ADC1_CR_SEL_Msk                                       (0x000000ffUL << ADC1_CR_SEL_Pos)                         /*!< ADC1 CR: SEL Mask                   */\r
+#define ADC1_CR_CLKDIV_Pos                                    8                                                         /*!< ADC1 CR: CLKDIV Position            */\r
+#define ADC1_CR_CLKDIV_Msk                                    (0x000000ffUL << ADC1_CR_CLKDIV_Pos)                      /*!< ADC1 CR: CLKDIV Mask                */\r
+#define ADC1_CR_BURST_Pos                                     16                                                        /*!< ADC1 CR: BURST Position             */\r
+#define ADC1_CR_BURST_Msk                                     (0x01UL << ADC1_CR_BURST_Pos)                             /*!< ADC1 CR: BURST Mask                 */\r
+#define ADC1_CR_CLKS_Pos                                      17                                                        /*!< ADC1 CR: CLKS Position              */\r
+#define ADC1_CR_CLKS_Msk                                      (0x07UL << ADC1_CR_CLKS_Pos)                              /*!< ADC1 CR: CLKS Mask                  */\r
+#define ADC1_CR_PDN_Pos                                       21                                                        /*!< ADC1 CR: PDN Position               */\r
+#define ADC1_CR_PDN_Msk                                       (0x01UL << ADC1_CR_PDN_Pos)                               /*!< ADC1 CR: PDN Mask                   */\r
+#define ADC1_CR_START_Pos                                     24                                                        /*!< ADC1 CR: START Position             */\r
+#define ADC1_CR_START_Msk                                     (0x07UL << ADC1_CR_START_Pos)                             /*!< ADC1 CR: START Mask                 */\r
+#define ADC1_CR_EDGE_Pos                                      27                                                        /*!< ADC1 CR: EDGE Position              */\r
+#define ADC1_CR_EDGE_Msk                                      (0x01UL << ADC1_CR_EDGE_Pos)                              /*!< ADC1 CR: EDGE Mask                  */\r
+\r
+// ----------------------------------------  ADC1_GDR  --------------------------------------------\r
+#define ADC1_GDR_V_VREF_Pos                                   6                                                         /*!< ADC1 GDR: V_VREF Position           */\r
+#define ADC1_GDR_V_VREF_Msk                                   (0x000003ffUL << ADC1_GDR_V_VREF_Pos)                     /*!< ADC1 GDR: V_VREF Mask               */\r
+#define ADC1_GDR_CHN_Pos                                      24                                                        /*!< ADC1 GDR: CHN Position              */\r
+#define ADC1_GDR_CHN_Msk                                      (0x07UL << ADC1_GDR_CHN_Pos)                              /*!< ADC1 GDR: CHN Mask                  */\r
+#define ADC1_GDR_OVERRUN_Pos                                  30                                                        /*!< ADC1 GDR: OVERRUN Position          */\r
+#define ADC1_GDR_OVERRUN_Msk                                  (0x01UL << ADC1_GDR_OVERRUN_Pos)                          /*!< ADC1 GDR: OVERRUN Mask              */\r
+#define ADC1_GDR_DONE_Pos                                     31                                                        /*!< ADC1 GDR: DONE Position             */\r
+#define ADC1_GDR_DONE_Msk                                     (0x01UL << ADC1_GDR_DONE_Pos)                             /*!< ADC1 GDR: DONE Mask                 */\r
+\r
+// ---------------------------------------  ADC1_INTEN  -------------------------------------------\r
+#define ADC1_INTEN_ADINTEN_Pos                                0                                                         /*!< ADC1 INTEN: ADINTEN Position        */\r
+#define ADC1_INTEN_ADINTEN_Msk                                (0x000000ffUL << ADC1_INTEN_ADINTEN_Pos)                  /*!< ADC1 INTEN: ADINTEN Mask            */\r
+#define ADC1_INTEN_ADGINTEN_Pos                               8                                                         /*!< ADC1 INTEN: ADGINTEN Position       */\r
+#define ADC1_INTEN_ADGINTEN_Msk                               (0x01UL << ADC1_INTEN_ADGINTEN_Pos)                       /*!< ADC1 INTEN: ADGINTEN Mask           */\r
+\r
+// ----------------------------------------  ADC1_DR0  --------------------------------------------\r
+#define ADC1_DR0_V_VREF_Pos                                   6                                                         /*!< ADC1 DR0: V_VREF Position           */\r
+#define ADC1_DR0_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR0_V_VREF_Pos)                     /*!< ADC1 DR0: V_VREF Mask               */\r
+#define ADC1_DR0_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR0: OVERRUN Position          */\r
+#define ADC1_DR0_OVERRUN_Msk                                  (0x01UL << ADC1_DR0_OVERRUN_Pos)                          /*!< ADC1 DR0: OVERRUN Mask              */\r
+#define ADC1_DR0_DONE_Pos                                     31                                                        /*!< ADC1 DR0: DONE Position             */\r
+#define ADC1_DR0_DONE_Msk                                     (0x01UL << ADC1_DR0_DONE_Pos)                             /*!< ADC1 DR0: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR1  --------------------------------------------\r
+#define ADC1_DR1_V_VREF_Pos                                   6                                                         /*!< ADC1 DR1: V_VREF Position           */\r
+#define ADC1_DR1_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR1_V_VREF_Pos)                     /*!< ADC1 DR1: V_VREF Mask               */\r
+#define ADC1_DR1_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR1: OVERRUN Position          */\r
+#define ADC1_DR1_OVERRUN_Msk                                  (0x01UL << ADC1_DR1_OVERRUN_Pos)                          /*!< ADC1 DR1: OVERRUN Mask              */\r
+#define ADC1_DR1_DONE_Pos                                     31                                                        /*!< ADC1 DR1: DONE Position             */\r
+#define ADC1_DR1_DONE_Msk                                     (0x01UL << ADC1_DR1_DONE_Pos)                             /*!< ADC1 DR1: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR2  --------------------------------------------\r
+#define ADC1_DR2_V_VREF_Pos                                   6                                                         /*!< ADC1 DR2: V_VREF Position           */\r
+#define ADC1_DR2_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR2_V_VREF_Pos)                     /*!< ADC1 DR2: V_VREF Mask               */\r
+#define ADC1_DR2_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR2: OVERRUN Position          */\r
+#define ADC1_DR2_OVERRUN_Msk                                  (0x01UL << ADC1_DR2_OVERRUN_Pos)                          /*!< ADC1 DR2: OVERRUN Mask              */\r
+#define ADC1_DR2_DONE_Pos                                     31                                                        /*!< ADC1 DR2: DONE Position             */\r
+#define ADC1_DR2_DONE_Msk                                     (0x01UL << ADC1_DR2_DONE_Pos)                             /*!< ADC1 DR2: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR3  --------------------------------------------\r
+#define ADC1_DR3_V_VREF_Pos                                   6                                                         /*!< ADC1 DR3: V_VREF Position           */\r
+#define ADC1_DR3_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR3_V_VREF_Pos)                     /*!< ADC1 DR3: V_VREF Mask               */\r
+#define ADC1_DR3_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR3: OVERRUN Position          */\r
+#define ADC1_DR3_OVERRUN_Msk                                  (0x01UL << ADC1_DR3_OVERRUN_Pos)                          /*!< ADC1 DR3: OVERRUN Mask              */\r
+#define ADC1_DR3_DONE_Pos                                     31                                                        /*!< ADC1 DR3: DONE Position             */\r
+#define ADC1_DR3_DONE_Msk                                     (0x01UL << ADC1_DR3_DONE_Pos)                             /*!< ADC1 DR3: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR4  --------------------------------------------\r
+#define ADC1_DR4_V_VREF_Pos                                   6                                                         /*!< ADC1 DR4: V_VREF Position           */\r
+#define ADC1_DR4_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR4_V_VREF_Pos)                     /*!< ADC1 DR4: V_VREF Mask               */\r
+#define ADC1_DR4_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR4: OVERRUN Position          */\r
+#define ADC1_DR4_OVERRUN_Msk                                  (0x01UL << ADC1_DR4_OVERRUN_Pos)                          /*!< ADC1 DR4: OVERRUN Mask              */\r
+#define ADC1_DR4_DONE_Pos                                     31                                                        /*!< ADC1 DR4: DONE Position             */\r
+#define ADC1_DR4_DONE_Msk                                     (0x01UL << ADC1_DR4_DONE_Pos)                             /*!< ADC1 DR4: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR5  --------------------------------------------\r
+#define ADC1_DR5_V_VREF_Pos                                   6                                                         /*!< ADC1 DR5: V_VREF Position           */\r
+#define ADC1_DR5_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR5_V_VREF_Pos)                     /*!< ADC1 DR5: V_VREF Mask               */\r
+#define ADC1_DR5_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR5: OVERRUN Position          */\r
+#define ADC1_DR5_OVERRUN_Msk                                  (0x01UL << ADC1_DR5_OVERRUN_Pos)                          /*!< ADC1 DR5: OVERRUN Mask              */\r
+#define ADC1_DR5_DONE_Pos                                     31                                                        /*!< ADC1 DR5: DONE Position             */\r
+#define ADC1_DR5_DONE_Msk                                     (0x01UL << ADC1_DR5_DONE_Pos)                             /*!< ADC1 DR5: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR6  --------------------------------------------\r
+#define ADC1_DR6_V_VREF_Pos                                   6                                                         /*!< ADC1 DR6: V_VREF Position           */\r
+#define ADC1_DR6_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR6_V_VREF_Pos)                     /*!< ADC1 DR6: V_VREF Mask               */\r
+#define ADC1_DR6_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR6: OVERRUN Position          */\r
+#define ADC1_DR6_OVERRUN_Msk                                  (0x01UL << ADC1_DR6_OVERRUN_Pos)                          /*!< ADC1 DR6: OVERRUN Mask              */\r
+#define ADC1_DR6_DONE_Pos                                     31                                                        /*!< ADC1 DR6: DONE Position             */\r
+#define ADC1_DR6_DONE_Msk                                     (0x01UL << ADC1_DR6_DONE_Pos)                             /*!< ADC1 DR6: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_DR7  --------------------------------------------\r
+#define ADC1_DR7_V_VREF_Pos                                   6                                                         /*!< ADC1 DR7: V_VREF Position           */\r
+#define ADC1_DR7_V_VREF_Msk                                   (0x000003ffUL << ADC1_DR7_V_VREF_Pos)                     /*!< ADC1 DR7: V_VREF Mask               */\r
+#define ADC1_DR7_OVERRUN_Pos                                  30                                                        /*!< ADC1 DR7: OVERRUN Position          */\r
+#define ADC1_DR7_OVERRUN_Msk                                  (0x01UL << ADC1_DR7_OVERRUN_Pos)                          /*!< ADC1 DR7: OVERRUN Mask              */\r
+#define ADC1_DR7_DONE_Pos                                     31                                                        /*!< ADC1 DR7: DONE Position             */\r
+#define ADC1_DR7_DONE_Msk                                     (0x01UL << ADC1_DR7_DONE_Pos)                             /*!< ADC1 DR7: DONE Mask                 */\r
+\r
+// ----------------------------------------  ADC1_STAT  -------------------------------------------\r
+#define ADC1_STAT_DONE_Pos                                    0                                                         /*!< ADC1 STAT: DONE Position            */\r
+#define ADC1_STAT_DONE_Msk                                    (0x000000ffUL << ADC1_STAT_DONE_Pos)                      /*!< ADC1 STAT: DONE Mask                */\r
+#define ADC1_STAT_OVERUN_Pos                                  8                                                         /*!< ADC1 STAT: OVERUN Position          */\r
+#define ADC1_STAT_OVERUN_Msk                                  (0x000000ffUL << ADC1_STAT_OVERUN_Pos)                    /*!< ADC1 STAT: OVERUN Mask              */\r
+#define ADC1_STAT_ADINT_Pos                                   16                                                        /*!< ADC1 STAT: ADINT Position           */\r
+#define ADC1_STAT_ADINT_Msk                                   (0x01UL << ADC1_STAT_ADINT_Pos)                           /*!< ADC1 STAT: ADINT Mask               */\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                               GPIO_PORT Position & Mask                              -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+\r
+// --------------------------------------  GPIO_PORT_B0  ------------------------------------------\r
+#define GPIO_PORT_B0_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B0: PBYTE Position        */\r
+#define GPIO_PORT_B0_PBYTE_Msk                                (0x01UL << GPIO_PORT_B0_PBYTE_Pos)                        /*!< GPIO_PORT B0: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B1  ------------------------------------------\r
+#define GPIO_PORT_B1_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B1: PBYTE Position        */\r
+#define GPIO_PORT_B1_PBYTE_Msk                                (0x01UL << GPIO_PORT_B1_PBYTE_Pos)                        /*!< GPIO_PORT B1: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B2  ------------------------------------------\r
+#define GPIO_PORT_B2_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B2: PBYTE Position        */\r
+#define GPIO_PORT_B2_PBYTE_Msk                                (0x01UL << GPIO_PORT_B2_PBYTE_Pos)                        /*!< GPIO_PORT B2: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B3  ------------------------------------------\r
+#define GPIO_PORT_B3_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B3: PBYTE Position        */\r
+#define GPIO_PORT_B3_PBYTE_Msk                                (0x01UL << GPIO_PORT_B3_PBYTE_Pos)                        /*!< GPIO_PORT B3: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B4  ------------------------------------------\r
+#define GPIO_PORT_B4_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B4: PBYTE Position        */\r
+#define GPIO_PORT_B4_PBYTE_Msk                                (0x01UL << GPIO_PORT_B4_PBYTE_Pos)                        /*!< GPIO_PORT B4: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B5  ------------------------------------------\r
+#define GPIO_PORT_B5_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B5: PBYTE Position        */\r
+#define GPIO_PORT_B5_PBYTE_Msk                                (0x01UL << GPIO_PORT_B5_PBYTE_Pos)                        /*!< GPIO_PORT B5: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B6  ------------------------------------------\r
+#define GPIO_PORT_B6_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B6: PBYTE Position        */\r
+#define GPIO_PORT_B6_PBYTE_Msk                                (0x01UL << GPIO_PORT_B6_PBYTE_Pos)                        /*!< GPIO_PORT B6: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B7  ------------------------------------------\r
+#define GPIO_PORT_B7_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B7: PBYTE Position        */\r
+#define GPIO_PORT_B7_PBYTE_Msk                                (0x01UL << GPIO_PORT_B7_PBYTE_Pos)                        /*!< GPIO_PORT B7: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B8  ------------------------------------------\r
+#define GPIO_PORT_B8_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B8: PBYTE Position        */\r
+#define GPIO_PORT_B8_PBYTE_Msk                                (0x01UL << GPIO_PORT_B8_PBYTE_Pos)                        /*!< GPIO_PORT B8: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B9  ------------------------------------------\r
+#define GPIO_PORT_B9_PBYTE_Pos                                0                                                         /*!< GPIO_PORT B9: PBYTE Position        */\r
+#define GPIO_PORT_B9_PBYTE_Msk                                (0x01UL << GPIO_PORT_B9_PBYTE_Pos)                        /*!< GPIO_PORT B9: PBYTE Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_B10  -----------------------------------------\r
+#define GPIO_PORT_B10_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B10: PBYTE Position       */\r
+#define GPIO_PORT_B10_PBYTE_Msk                               (0x01UL << GPIO_PORT_B10_PBYTE_Pos)                       /*!< GPIO_PORT B10: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B11  -----------------------------------------\r
+#define GPIO_PORT_B11_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B11: PBYTE Position       */\r
+#define GPIO_PORT_B11_PBYTE_Msk                               (0x01UL << GPIO_PORT_B11_PBYTE_Pos)                       /*!< GPIO_PORT B11: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B12  -----------------------------------------\r
+#define GPIO_PORT_B12_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B12: PBYTE Position       */\r
+#define GPIO_PORT_B12_PBYTE_Msk                               (0x01UL << GPIO_PORT_B12_PBYTE_Pos)                       /*!< GPIO_PORT B12: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B13  -----------------------------------------\r
+#define GPIO_PORT_B13_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B13: PBYTE Position       */\r
+#define GPIO_PORT_B13_PBYTE_Msk                               (0x01UL << GPIO_PORT_B13_PBYTE_Pos)                       /*!< GPIO_PORT B13: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B14  -----------------------------------------\r
+#define GPIO_PORT_B14_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B14: PBYTE Position       */\r
+#define GPIO_PORT_B14_PBYTE_Msk                               (0x01UL << GPIO_PORT_B14_PBYTE_Pos)                       /*!< GPIO_PORT B14: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B15  -----------------------------------------\r
+#define GPIO_PORT_B15_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B15: PBYTE Position       */\r
+#define GPIO_PORT_B15_PBYTE_Msk                               (0x01UL << GPIO_PORT_B15_PBYTE_Pos)                       /*!< GPIO_PORT B15: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B16  -----------------------------------------\r
+#define GPIO_PORT_B16_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B16: PBYTE Position       */\r
+#define GPIO_PORT_B16_PBYTE_Msk                               (0x01UL << GPIO_PORT_B16_PBYTE_Pos)                       /*!< GPIO_PORT B16: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B17  -----------------------------------------\r
+#define GPIO_PORT_B17_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B17: PBYTE Position       */\r
+#define GPIO_PORT_B17_PBYTE_Msk                               (0x01UL << GPIO_PORT_B17_PBYTE_Pos)                       /*!< GPIO_PORT B17: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B18  -----------------------------------------\r
+#define GPIO_PORT_B18_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B18: PBYTE Position       */\r
+#define GPIO_PORT_B18_PBYTE_Msk                               (0x01UL << GPIO_PORT_B18_PBYTE_Pos)                       /*!< GPIO_PORT B18: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B19  -----------------------------------------\r
+#define GPIO_PORT_B19_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B19: PBYTE Position       */\r
+#define GPIO_PORT_B19_PBYTE_Msk                               (0x01UL << GPIO_PORT_B19_PBYTE_Pos)                       /*!< GPIO_PORT B19: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B20  -----------------------------------------\r
+#define GPIO_PORT_B20_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B20: PBYTE Position       */\r
+#define GPIO_PORT_B20_PBYTE_Msk                               (0x01UL << GPIO_PORT_B20_PBYTE_Pos)                       /*!< GPIO_PORT B20: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B21  -----------------------------------------\r
+#define GPIO_PORT_B21_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B21: PBYTE Position       */\r
+#define GPIO_PORT_B21_PBYTE_Msk                               (0x01UL << GPIO_PORT_B21_PBYTE_Pos)                       /*!< GPIO_PORT B21: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B22  -----------------------------------------\r
+#define GPIO_PORT_B22_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B22: PBYTE Position       */\r
+#define GPIO_PORT_B22_PBYTE_Msk                               (0x01UL << GPIO_PORT_B22_PBYTE_Pos)                       /*!< GPIO_PORT B22: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B23  -----------------------------------------\r
+#define GPIO_PORT_B23_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B23: PBYTE Position       */\r
+#define GPIO_PORT_B23_PBYTE_Msk                               (0x01UL << GPIO_PORT_B23_PBYTE_Pos)                       /*!< GPIO_PORT B23: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B24  -----------------------------------------\r
+#define GPIO_PORT_B24_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B24: PBYTE Position       */\r
+#define GPIO_PORT_B24_PBYTE_Msk                               (0x01UL << GPIO_PORT_B24_PBYTE_Pos)                       /*!< GPIO_PORT B24: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B25  -----------------------------------------\r
+#define GPIO_PORT_B25_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B25: PBYTE Position       */\r
+#define GPIO_PORT_B25_PBYTE_Msk                               (0x01UL << GPIO_PORT_B25_PBYTE_Pos)                       /*!< GPIO_PORT B25: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B26  -----------------------------------------\r
+#define GPIO_PORT_B26_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B26: PBYTE Position       */\r
+#define GPIO_PORT_B26_PBYTE_Msk                               (0x01UL << GPIO_PORT_B26_PBYTE_Pos)                       /*!< GPIO_PORT B26: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B27  -----------------------------------------\r
+#define GPIO_PORT_B27_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B27: PBYTE Position       */\r
+#define GPIO_PORT_B27_PBYTE_Msk                               (0x01UL << GPIO_PORT_B27_PBYTE_Pos)                       /*!< GPIO_PORT B27: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B28  -----------------------------------------\r
+#define GPIO_PORT_B28_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B28: PBYTE Position       */\r
+#define GPIO_PORT_B28_PBYTE_Msk                               (0x01UL << GPIO_PORT_B28_PBYTE_Pos)                       /*!< GPIO_PORT B28: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B29  -----------------------------------------\r
+#define GPIO_PORT_B29_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B29: PBYTE Position       */\r
+#define GPIO_PORT_B29_PBYTE_Msk                               (0x01UL << GPIO_PORT_B29_PBYTE_Pos)                       /*!< GPIO_PORT B29: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B30  -----------------------------------------\r
+#define GPIO_PORT_B30_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B30: PBYTE Position       */\r
+#define GPIO_PORT_B30_PBYTE_Msk                               (0x01UL << GPIO_PORT_B30_PBYTE_Pos)                       /*!< GPIO_PORT B30: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B31  -----------------------------------------\r
+#define GPIO_PORT_B31_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B31: PBYTE Position       */\r
+#define GPIO_PORT_B31_PBYTE_Msk                               (0x01UL << GPIO_PORT_B31_PBYTE_Pos)                       /*!< GPIO_PORT B31: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B32  -----------------------------------------\r
+#define GPIO_PORT_B32_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B32: PBYTE Position       */\r
+#define GPIO_PORT_B32_PBYTE_Msk                               (0x01UL << GPIO_PORT_B32_PBYTE_Pos)                       /*!< GPIO_PORT B32: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B33  -----------------------------------------\r
+#define GPIO_PORT_B33_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B33: PBYTE Position       */\r
+#define GPIO_PORT_B33_PBYTE_Msk                               (0x01UL << GPIO_PORT_B33_PBYTE_Pos)                       /*!< GPIO_PORT B33: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B34  -----------------------------------------\r
+#define GPIO_PORT_B34_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B34: PBYTE Position       */\r
+#define GPIO_PORT_B34_PBYTE_Msk                               (0x01UL << GPIO_PORT_B34_PBYTE_Pos)                       /*!< GPIO_PORT B34: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B35  -----------------------------------------\r
+#define GPIO_PORT_B35_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B35: PBYTE Position       */\r
+#define GPIO_PORT_B35_PBYTE_Msk                               (0x01UL << GPIO_PORT_B35_PBYTE_Pos)                       /*!< GPIO_PORT B35: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B36  -----------------------------------------\r
+#define GPIO_PORT_B36_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B36: PBYTE Position       */\r
+#define GPIO_PORT_B36_PBYTE_Msk                               (0x01UL << GPIO_PORT_B36_PBYTE_Pos)                       /*!< GPIO_PORT B36: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B37  -----------------------------------------\r
+#define GPIO_PORT_B37_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B37: PBYTE Position       */\r
+#define GPIO_PORT_B37_PBYTE_Msk                               (0x01UL << GPIO_PORT_B37_PBYTE_Pos)                       /*!< GPIO_PORT B37: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B38  -----------------------------------------\r
+#define GPIO_PORT_B38_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B38: PBYTE Position       */\r
+#define GPIO_PORT_B38_PBYTE_Msk                               (0x01UL << GPIO_PORT_B38_PBYTE_Pos)                       /*!< GPIO_PORT B38: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B39  -----------------------------------------\r
+#define GPIO_PORT_B39_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B39: PBYTE Position       */\r
+#define GPIO_PORT_B39_PBYTE_Msk                               (0x01UL << GPIO_PORT_B39_PBYTE_Pos)                       /*!< GPIO_PORT B39: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B40  -----------------------------------------\r
+#define GPIO_PORT_B40_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B40: PBYTE Position       */\r
+#define GPIO_PORT_B40_PBYTE_Msk                               (0x01UL << GPIO_PORT_B40_PBYTE_Pos)                       /*!< GPIO_PORT B40: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B41  -----------------------------------------\r
+#define GPIO_PORT_B41_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B41: PBYTE Position       */\r
+#define GPIO_PORT_B41_PBYTE_Msk                               (0x01UL << GPIO_PORT_B41_PBYTE_Pos)                       /*!< GPIO_PORT B41: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B42  -----------------------------------------\r
+#define GPIO_PORT_B42_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B42: PBYTE Position       */\r
+#define GPIO_PORT_B42_PBYTE_Msk                               (0x01UL << GPIO_PORT_B42_PBYTE_Pos)                       /*!< GPIO_PORT B42: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B43  -----------------------------------------\r
+#define GPIO_PORT_B43_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B43: PBYTE Position       */\r
+#define GPIO_PORT_B43_PBYTE_Msk                               (0x01UL << GPIO_PORT_B43_PBYTE_Pos)                       /*!< GPIO_PORT B43: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B44  -----------------------------------------\r
+#define GPIO_PORT_B44_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B44: PBYTE Position       */\r
+#define GPIO_PORT_B44_PBYTE_Msk                               (0x01UL << GPIO_PORT_B44_PBYTE_Pos)                       /*!< GPIO_PORT B44: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B45  -----------------------------------------\r
+#define GPIO_PORT_B45_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B45: PBYTE Position       */\r
+#define GPIO_PORT_B45_PBYTE_Msk                               (0x01UL << GPIO_PORT_B45_PBYTE_Pos)                       /*!< GPIO_PORT B45: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B46  -----------------------------------------\r
+#define GPIO_PORT_B46_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B46: PBYTE Position       */\r
+#define GPIO_PORT_B46_PBYTE_Msk                               (0x01UL << GPIO_PORT_B46_PBYTE_Pos)                       /*!< GPIO_PORT B46: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B47  -----------------------------------------\r
+#define GPIO_PORT_B47_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B47: PBYTE Position       */\r
+#define GPIO_PORT_B47_PBYTE_Msk                               (0x01UL << GPIO_PORT_B47_PBYTE_Pos)                       /*!< GPIO_PORT B47: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B48  -----------------------------------------\r
+#define GPIO_PORT_B48_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B48: PBYTE Position       */\r
+#define GPIO_PORT_B48_PBYTE_Msk                               (0x01UL << GPIO_PORT_B48_PBYTE_Pos)                       /*!< GPIO_PORT B48: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B49  -----------------------------------------\r
+#define GPIO_PORT_B49_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B49: PBYTE Position       */\r
+#define GPIO_PORT_B49_PBYTE_Msk                               (0x01UL << GPIO_PORT_B49_PBYTE_Pos)                       /*!< GPIO_PORT B49: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B50  -----------------------------------------\r
+#define GPIO_PORT_B50_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B50: PBYTE Position       */\r
+#define GPIO_PORT_B50_PBYTE_Msk                               (0x01UL << GPIO_PORT_B50_PBYTE_Pos)                       /*!< GPIO_PORT B50: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B51  -----------------------------------------\r
+#define GPIO_PORT_B51_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B51: PBYTE Position       */\r
+#define GPIO_PORT_B51_PBYTE_Msk                               (0x01UL << GPIO_PORT_B51_PBYTE_Pos)                       /*!< GPIO_PORT B51: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B52  -----------------------------------------\r
+#define GPIO_PORT_B52_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B52: PBYTE Position       */\r
+#define GPIO_PORT_B52_PBYTE_Msk                               (0x01UL << GPIO_PORT_B52_PBYTE_Pos)                       /*!< GPIO_PORT B52: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B53  -----------------------------------------\r
+#define GPIO_PORT_B53_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B53: PBYTE Position       */\r
+#define GPIO_PORT_B53_PBYTE_Msk                               (0x01UL << GPIO_PORT_B53_PBYTE_Pos)                       /*!< GPIO_PORT B53: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B54  -----------------------------------------\r
+#define GPIO_PORT_B54_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B54: PBYTE Position       */\r
+#define GPIO_PORT_B54_PBYTE_Msk                               (0x01UL << GPIO_PORT_B54_PBYTE_Pos)                       /*!< GPIO_PORT B54: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B55  -----------------------------------------\r
+#define GPIO_PORT_B55_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B55: PBYTE Position       */\r
+#define GPIO_PORT_B55_PBYTE_Msk                               (0x01UL << GPIO_PORT_B55_PBYTE_Pos)                       /*!< GPIO_PORT B55: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B56  -----------------------------------------\r
+#define GPIO_PORT_B56_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B56: PBYTE Position       */\r
+#define GPIO_PORT_B56_PBYTE_Msk                               (0x01UL << GPIO_PORT_B56_PBYTE_Pos)                       /*!< GPIO_PORT B56: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B57  -----------------------------------------\r
+#define GPIO_PORT_B57_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B57: PBYTE Position       */\r
+#define GPIO_PORT_B57_PBYTE_Msk                               (0x01UL << GPIO_PORT_B57_PBYTE_Pos)                       /*!< GPIO_PORT B57: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B58  -----------------------------------------\r
+#define GPIO_PORT_B58_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B58: PBYTE Position       */\r
+#define GPIO_PORT_B58_PBYTE_Msk                               (0x01UL << GPIO_PORT_B58_PBYTE_Pos)                       /*!< GPIO_PORT B58: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B59  -----------------------------------------\r
+#define GPIO_PORT_B59_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B59: PBYTE Position       */\r
+#define GPIO_PORT_B59_PBYTE_Msk                               (0x01UL << GPIO_PORT_B59_PBYTE_Pos)                       /*!< GPIO_PORT B59: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B60  -----------------------------------------\r
+#define GPIO_PORT_B60_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B60: PBYTE Position       */\r
+#define GPIO_PORT_B60_PBYTE_Msk                               (0x01UL << GPIO_PORT_B60_PBYTE_Pos)                       /*!< GPIO_PORT B60: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B61  -----------------------------------------\r
+#define GPIO_PORT_B61_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B61: PBYTE Position       */\r
+#define GPIO_PORT_B61_PBYTE_Msk                               (0x01UL << GPIO_PORT_B61_PBYTE_Pos)                       /*!< GPIO_PORT B61: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B62  -----------------------------------------\r
+#define GPIO_PORT_B62_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B62: PBYTE Position       */\r
+#define GPIO_PORT_B62_PBYTE_Msk                               (0x01UL << GPIO_PORT_B62_PBYTE_Pos)                       /*!< GPIO_PORT B62: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B63  -----------------------------------------\r
+#define GPIO_PORT_B63_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B63: PBYTE Position       */\r
+#define GPIO_PORT_B63_PBYTE_Msk                               (0x01UL << GPIO_PORT_B63_PBYTE_Pos)                       /*!< GPIO_PORT B63: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B64  -----------------------------------------\r
+#define GPIO_PORT_B64_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B64: PBYTE Position       */\r
+#define GPIO_PORT_B64_PBYTE_Msk                               (0x01UL << GPIO_PORT_B64_PBYTE_Pos)                       /*!< GPIO_PORT B64: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B65  -----------------------------------------\r
+#define GPIO_PORT_B65_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B65: PBYTE Position       */\r
+#define GPIO_PORT_B65_PBYTE_Msk                               (0x01UL << GPIO_PORT_B65_PBYTE_Pos)                       /*!< GPIO_PORT B65: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B66  -----------------------------------------\r
+#define GPIO_PORT_B66_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B66: PBYTE Position       */\r
+#define GPIO_PORT_B66_PBYTE_Msk                               (0x01UL << GPIO_PORT_B66_PBYTE_Pos)                       /*!< GPIO_PORT B66: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B67  -----------------------------------------\r
+#define GPIO_PORT_B67_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B67: PBYTE Position       */\r
+#define GPIO_PORT_B67_PBYTE_Msk                               (0x01UL << GPIO_PORT_B67_PBYTE_Pos)                       /*!< GPIO_PORT B67: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B68  -----------------------------------------\r
+#define GPIO_PORT_B68_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B68: PBYTE Position       */\r
+#define GPIO_PORT_B68_PBYTE_Msk                               (0x01UL << GPIO_PORT_B68_PBYTE_Pos)                       /*!< GPIO_PORT B68: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B69  -----------------------------------------\r
+#define GPIO_PORT_B69_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B69: PBYTE Position       */\r
+#define GPIO_PORT_B69_PBYTE_Msk                               (0x01UL << GPIO_PORT_B69_PBYTE_Pos)                       /*!< GPIO_PORT B69: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B70  -----------------------------------------\r
+#define GPIO_PORT_B70_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B70: PBYTE Position       */\r
+#define GPIO_PORT_B70_PBYTE_Msk                               (0x01UL << GPIO_PORT_B70_PBYTE_Pos)                       /*!< GPIO_PORT B70: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B71  -----------------------------------------\r
+#define GPIO_PORT_B71_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B71: PBYTE Position       */\r
+#define GPIO_PORT_B71_PBYTE_Msk                               (0x01UL << GPIO_PORT_B71_PBYTE_Pos)                       /*!< GPIO_PORT B71: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B72  -----------------------------------------\r
+#define GPIO_PORT_B72_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B72: PBYTE Position       */\r
+#define GPIO_PORT_B72_PBYTE_Msk                               (0x01UL << GPIO_PORT_B72_PBYTE_Pos)                       /*!< GPIO_PORT B72: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B73  -----------------------------------------\r
+#define GPIO_PORT_B73_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B73: PBYTE Position       */\r
+#define GPIO_PORT_B73_PBYTE_Msk                               (0x01UL << GPIO_PORT_B73_PBYTE_Pos)                       /*!< GPIO_PORT B73: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B74  -----------------------------------------\r
+#define GPIO_PORT_B74_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B74: PBYTE Position       */\r
+#define GPIO_PORT_B74_PBYTE_Msk                               (0x01UL << GPIO_PORT_B74_PBYTE_Pos)                       /*!< GPIO_PORT B74: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B75  -----------------------------------------\r
+#define GPIO_PORT_B75_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B75: PBYTE Position       */\r
+#define GPIO_PORT_B75_PBYTE_Msk                               (0x01UL << GPIO_PORT_B75_PBYTE_Pos)                       /*!< GPIO_PORT B75: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B76  -----------------------------------------\r
+#define GPIO_PORT_B76_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B76: PBYTE Position       */\r
+#define GPIO_PORT_B76_PBYTE_Msk                               (0x01UL << GPIO_PORT_B76_PBYTE_Pos)                       /*!< GPIO_PORT B76: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B77  -----------------------------------------\r
+#define GPIO_PORT_B77_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B77: PBYTE Position       */\r
+#define GPIO_PORT_B77_PBYTE_Msk                               (0x01UL << GPIO_PORT_B77_PBYTE_Pos)                       /*!< GPIO_PORT B77: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B78  -----------------------------------------\r
+#define GPIO_PORT_B78_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B78: PBYTE Position       */\r
+#define GPIO_PORT_B78_PBYTE_Msk                               (0x01UL << GPIO_PORT_B78_PBYTE_Pos)                       /*!< GPIO_PORT B78: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B79  -----------------------------------------\r
+#define GPIO_PORT_B79_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B79: PBYTE Position       */\r
+#define GPIO_PORT_B79_PBYTE_Msk                               (0x01UL << GPIO_PORT_B79_PBYTE_Pos)                       /*!< GPIO_PORT B79: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B80  -----------------------------------------\r
+#define GPIO_PORT_B80_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B80: PBYTE Position       */\r
+#define GPIO_PORT_B80_PBYTE_Msk                               (0x01UL << GPIO_PORT_B80_PBYTE_Pos)                       /*!< GPIO_PORT B80: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B81  -----------------------------------------\r
+#define GPIO_PORT_B81_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B81: PBYTE Position       */\r
+#define GPIO_PORT_B81_PBYTE_Msk                               (0x01UL << GPIO_PORT_B81_PBYTE_Pos)                       /*!< GPIO_PORT B81: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B82  -----------------------------------------\r
+#define GPIO_PORT_B82_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B82: PBYTE Position       */\r
+#define GPIO_PORT_B82_PBYTE_Msk                               (0x01UL << GPIO_PORT_B82_PBYTE_Pos)                       /*!< GPIO_PORT B82: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B83  -----------------------------------------\r
+#define GPIO_PORT_B83_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B83: PBYTE Position       */\r
+#define GPIO_PORT_B83_PBYTE_Msk                               (0x01UL << GPIO_PORT_B83_PBYTE_Pos)                       /*!< GPIO_PORT B83: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B84  -----------------------------------------\r
+#define GPIO_PORT_B84_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B84: PBYTE Position       */\r
+#define GPIO_PORT_B84_PBYTE_Msk                               (0x01UL << GPIO_PORT_B84_PBYTE_Pos)                       /*!< GPIO_PORT B84: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B85  -----------------------------------------\r
+#define GPIO_PORT_B85_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B85: PBYTE Position       */\r
+#define GPIO_PORT_B85_PBYTE_Msk                               (0x01UL << GPIO_PORT_B85_PBYTE_Pos)                       /*!< GPIO_PORT B85: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B86  -----------------------------------------\r
+#define GPIO_PORT_B86_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B86: PBYTE Position       */\r
+#define GPIO_PORT_B86_PBYTE_Msk                               (0x01UL << GPIO_PORT_B86_PBYTE_Pos)                       /*!< GPIO_PORT B86: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B87  -----------------------------------------\r
+#define GPIO_PORT_B87_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B87: PBYTE Position       */\r
+#define GPIO_PORT_B87_PBYTE_Msk                               (0x01UL << GPIO_PORT_B87_PBYTE_Pos)                       /*!< GPIO_PORT B87: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B88  -----------------------------------------\r
+#define GPIO_PORT_B88_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B88: PBYTE Position       */\r
+#define GPIO_PORT_B88_PBYTE_Msk                               (0x01UL << GPIO_PORT_B88_PBYTE_Pos)                       /*!< GPIO_PORT B88: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B89  -----------------------------------------\r
+#define GPIO_PORT_B89_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B89: PBYTE Position       */\r
+#define GPIO_PORT_B89_PBYTE_Msk                               (0x01UL << GPIO_PORT_B89_PBYTE_Pos)                       /*!< GPIO_PORT B89: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B90  -----------------------------------------\r
+#define GPIO_PORT_B90_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B90: PBYTE Position       */\r
+#define GPIO_PORT_B90_PBYTE_Msk                               (0x01UL << GPIO_PORT_B90_PBYTE_Pos)                       /*!< GPIO_PORT B90: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B91  -----------------------------------------\r
+#define GPIO_PORT_B91_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B91: PBYTE Position       */\r
+#define GPIO_PORT_B91_PBYTE_Msk                               (0x01UL << GPIO_PORT_B91_PBYTE_Pos)                       /*!< GPIO_PORT B91: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B92  -----------------------------------------\r
+#define GPIO_PORT_B92_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B92: PBYTE Position       */\r
+#define GPIO_PORT_B92_PBYTE_Msk                               (0x01UL << GPIO_PORT_B92_PBYTE_Pos)                       /*!< GPIO_PORT B92: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B93  -----------------------------------------\r
+#define GPIO_PORT_B93_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B93: PBYTE Position       */\r
+#define GPIO_PORT_B93_PBYTE_Msk                               (0x01UL << GPIO_PORT_B93_PBYTE_Pos)                       /*!< GPIO_PORT B93: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B94  -----------------------------------------\r
+#define GPIO_PORT_B94_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B94: PBYTE Position       */\r
+#define GPIO_PORT_B94_PBYTE_Msk                               (0x01UL << GPIO_PORT_B94_PBYTE_Pos)                       /*!< GPIO_PORT B94: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B95  -----------------------------------------\r
+#define GPIO_PORT_B95_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B95: PBYTE Position       */\r
+#define GPIO_PORT_B95_PBYTE_Msk                               (0x01UL << GPIO_PORT_B95_PBYTE_Pos)                       /*!< GPIO_PORT B95: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B96  -----------------------------------------\r
+#define GPIO_PORT_B96_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B96: PBYTE Position       */\r
+#define GPIO_PORT_B96_PBYTE_Msk                               (0x01UL << GPIO_PORT_B96_PBYTE_Pos)                       /*!< GPIO_PORT B96: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B97  -----------------------------------------\r
+#define GPIO_PORT_B97_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B97: PBYTE Position       */\r
+#define GPIO_PORT_B97_PBYTE_Msk                               (0x01UL << GPIO_PORT_B97_PBYTE_Pos)                       /*!< GPIO_PORT B97: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B98  -----------------------------------------\r
+#define GPIO_PORT_B98_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B98: PBYTE Position       */\r
+#define GPIO_PORT_B98_PBYTE_Msk                               (0x01UL << GPIO_PORT_B98_PBYTE_Pos)                       /*!< GPIO_PORT B98: PBYTE Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_B99  -----------------------------------------\r
+#define GPIO_PORT_B99_PBYTE_Pos                               0                                                         /*!< GPIO_PORT B99: PBYTE Position       */\r
+#define GPIO_PORT_B99_PBYTE_Msk                               (0x01UL << GPIO_PORT_B99_PBYTE_Pos)                       /*!< GPIO_PORT B99: PBYTE Mask           */\r
+\r
+// -------------------------------------  GPIO_PORT_B100  -----------------------------------------\r
+#define GPIO_PORT_B100_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B100: PBYTE Position      */\r
+#define GPIO_PORT_B100_PBYTE_Msk                              (0x01UL << GPIO_PORT_B100_PBYTE_Pos)                      /*!< GPIO_PORT B100: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B101  -----------------------------------------\r
+#define GPIO_PORT_B101_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B101: PBYTE Position      */\r
+#define GPIO_PORT_B101_PBYTE_Msk                              (0x01UL << GPIO_PORT_B101_PBYTE_Pos)                      /*!< GPIO_PORT B101: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B102  -----------------------------------------\r
+#define GPIO_PORT_B102_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B102: PBYTE Position      */\r
+#define GPIO_PORT_B102_PBYTE_Msk                              (0x01UL << GPIO_PORT_B102_PBYTE_Pos)                      /*!< GPIO_PORT B102: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B103  -----------------------------------------\r
+#define GPIO_PORT_B103_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B103: PBYTE Position      */\r
+#define GPIO_PORT_B103_PBYTE_Msk                              (0x01UL << GPIO_PORT_B103_PBYTE_Pos)                      /*!< GPIO_PORT B103: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B104  -----------------------------------------\r
+#define GPIO_PORT_B104_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B104: PBYTE Position      */\r
+#define GPIO_PORT_B104_PBYTE_Msk                              (0x01UL << GPIO_PORT_B104_PBYTE_Pos)                      /*!< GPIO_PORT B104: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B105  -----------------------------------------\r
+#define GPIO_PORT_B105_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B105: PBYTE Position      */\r
+#define GPIO_PORT_B105_PBYTE_Msk                              (0x01UL << GPIO_PORT_B105_PBYTE_Pos)                      /*!< GPIO_PORT B105: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B106  -----------------------------------------\r
+#define GPIO_PORT_B106_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B106: PBYTE Position      */\r
+#define GPIO_PORT_B106_PBYTE_Msk                              (0x01UL << GPIO_PORT_B106_PBYTE_Pos)                      /*!< GPIO_PORT B106: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B107  -----------------------------------------\r
+#define GPIO_PORT_B107_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B107: PBYTE Position      */\r
+#define GPIO_PORT_B107_PBYTE_Msk                              (0x01UL << GPIO_PORT_B107_PBYTE_Pos)                      /*!< GPIO_PORT B107: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B108  -----------------------------------------\r
+#define GPIO_PORT_B108_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B108: PBYTE Position      */\r
+#define GPIO_PORT_B108_PBYTE_Msk                              (0x01UL << GPIO_PORT_B108_PBYTE_Pos)                      /*!< GPIO_PORT B108: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B109  -----------------------------------------\r
+#define GPIO_PORT_B109_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B109: PBYTE Position      */\r
+#define GPIO_PORT_B109_PBYTE_Msk                              (0x01UL << GPIO_PORT_B109_PBYTE_Pos)                      /*!< GPIO_PORT B109: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B110  -----------------------------------------\r
+#define GPIO_PORT_B110_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B110: PBYTE Position      */\r
+#define GPIO_PORT_B110_PBYTE_Msk                              (0x01UL << GPIO_PORT_B110_PBYTE_Pos)                      /*!< GPIO_PORT B110: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B111  -----------------------------------------\r
+#define GPIO_PORT_B111_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B111: PBYTE Position      */\r
+#define GPIO_PORT_B111_PBYTE_Msk                              (0x01UL << GPIO_PORT_B111_PBYTE_Pos)                      /*!< GPIO_PORT B111: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B112  -----------------------------------------\r
+#define GPIO_PORT_B112_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B112: PBYTE Position      */\r
+#define GPIO_PORT_B112_PBYTE_Msk                              (0x01UL << GPIO_PORT_B112_PBYTE_Pos)                      /*!< GPIO_PORT B112: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B113  -----------------------------------------\r
+#define GPIO_PORT_B113_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B113: PBYTE Position      */\r
+#define GPIO_PORT_B113_PBYTE_Msk                              (0x01UL << GPIO_PORT_B113_PBYTE_Pos)                      /*!< GPIO_PORT B113: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B114  -----------------------------------------\r
+#define GPIO_PORT_B114_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B114: PBYTE Position      */\r
+#define GPIO_PORT_B114_PBYTE_Msk                              (0x01UL << GPIO_PORT_B114_PBYTE_Pos)                      /*!< GPIO_PORT B114: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B115  -----------------------------------------\r
+#define GPIO_PORT_B115_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B115: PBYTE Position      */\r
+#define GPIO_PORT_B115_PBYTE_Msk                              (0x01UL << GPIO_PORT_B115_PBYTE_Pos)                      /*!< GPIO_PORT B115: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B116  -----------------------------------------\r
+#define GPIO_PORT_B116_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B116: PBYTE Position      */\r
+#define GPIO_PORT_B116_PBYTE_Msk                              (0x01UL << GPIO_PORT_B116_PBYTE_Pos)                      /*!< GPIO_PORT B116: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B117  -----------------------------------------\r
+#define GPIO_PORT_B117_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B117: PBYTE Position      */\r
+#define GPIO_PORT_B117_PBYTE_Msk                              (0x01UL << GPIO_PORT_B117_PBYTE_Pos)                      /*!< GPIO_PORT B117: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B118  -----------------------------------------\r
+#define GPIO_PORT_B118_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B118: PBYTE Position      */\r
+#define GPIO_PORT_B118_PBYTE_Msk                              (0x01UL << GPIO_PORT_B118_PBYTE_Pos)                      /*!< GPIO_PORT B118: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B119  -----------------------------------------\r
+#define GPIO_PORT_B119_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B119: PBYTE Position      */\r
+#define GPIO_PORT_B119_PBYTE_Msk                              (0x01UL << GPIO_PORT_B119_PBYTE_Pos)                      /*!< GPIO_PORT B119: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B120  -----------------------------------------\r
+#define GPIO_PORT_B120_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B120: PBYTE Position      */\r
+#define GPIO_PORT_B120_PBYTE_Msk                              (0x01UL << GPIO_PORT_B120_PBYTE_Pos)                      /*!< GPIO_PORT B120: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B121  -----------------------------------------\r
+#define GPIO_PORT_B121_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B121: PBYTE Position      */\r
+#define GPIO_PORT_B121_PBYTE_Msk                              (0x01UL << GPIO_PORT_B121_PBYTE_Pos)                      /*!< GPIO_PORT B121: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B122  -----------------------------------------\r
+#define GPIO_PORT_B122_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B122: PBYTE Position      */\r
+#define GPIO_PORT_B122_PBYTE_Msk                              (0x01UL << GPIO_PORT_B122_PBYTE_Pos)                      /*!< GPIO_PORT B122: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B123  -----------------------------------------\r
+#define GPIO_PORT_B123_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B123: PBYTE Position      */\r
+#define GPIO_PORT_B123_PBYTE_Msk                              (0x01UL << GPIO_PORT_B123_PBYTE_Pos)                      /*!< GPIO_PORT B123: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B124  -----------------------------------------\r
+#define GPIO_PORT_B124_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B124: PBYTE Position      */\r
+#define GPIO_PORT_B124_PBYTE_Msk                              (0x01UL << GPIO_PORT_B124_PBYTE_Pos)                      /*!< GPIO_PORT B124: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B125  -----------------------------------------\r
+#define GPIO_PORT_B125_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B125: PBYTE Position      */\r
+#define GPIO_PORT_B125_PBYTE_Msk                              (0x01UL << GPIO_PORT_B125_PBYTE_Pos)                      /*!< GPIO_PORT B125: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B126  -----------------------------------------\r
+#define GPIO_PORT_B126_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B126: PBYTE Position      */\r
+#define GPIO_PORT_B126_PBYTE_Msk                              (0x01UL << GPIO_PORT_B126_PBYTE_Pos)                      /*!< GPIO_PORT B126: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B127  -----------------------------------------\r
+#define GPIO_PORT_B127_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B127: PBYTE Position      */\r
+#define GPIO_PORT_B127_PBYTE_Msk                              (0x01UL << GPIO_PORT_B127_PBYTE_Pos)                      /*!< GPIO_PORT B127: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B128  -----------------------------------------\r
+#define GPIO_PORT_B128_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B128: PBYTE Position      */\r
+#define GPIO_PORT_B128_PBYTE_Msk                              (0x01UL << GPIO_PORT_B128_PBYTE_Pos)                      /*!< GPIO_PORT B128: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B129  -----------------------------------------\r
+#define GPIO_PORT_B129_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B129: PBYTE Position      */\r
+#define GPIO_PORT_B129_PBYTE_Msk                              (0x01UL << GPIO_PORT_B129_PBYTE_Pos)                      /*!< GPIO_PORT B129: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B130  -----------------------------------------\r
+#define GPIO_PORT_B130_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B130: PBYTE Position      */\r
+#define GPIO_PORT_B130_PBYTE_Msk                              (0x01UL << GPIO_PORT_B130_PBYTE_Pos)                      /*!< GPIO_PORT B130: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B131  -----------------------------------------\r
+#define GPIO_PORT_B131_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B131: PBYTE Position      */\r
+#define GPIO_PORT_B131_PBYTE_Msk                              (0x01UL << GPIO_PORT_B131_PBYTE_Pos)                      /*!< GPIO_PORT B131: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B132  -----------------------------------------\r
+#define GPIO_PORT_B132_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B132: PBYTE Position      */\r
+#define GPIO_PORT_B132_PBYTE_Msk                              (0x01UL << GPIO_PORT_B132_PBYTE_Pos)                      /*!< GPIO_PORT B132: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B133  -----------------------------------------\r
+#define GPIO_PORT_B133_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B133: PBYTE Position      */\r
+#define GPIO_PORT_B133_PBYTE_Msk                              (0x01UL << GPIO_PORT_B133_PBYTE_Pos)                      /*!< GPIO_PORT B133: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B134  -----------------------------------------\r
+#define GPIO_PORT_B134_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B134: PBYTE Position      */\r
+#define GPIO_PORT_B134_PBYTE_Msk                              (0x01UL << GPIO_PORT_B134_PBYTE_Pos)                      /*!< GPIO_PORT B134: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B135  -----------------------------------------\r
+#define GPIO_PORT_B135_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B135: PBYTE Position      */\r
+#define GPIO_PORT_B135_PBYTE_Msk                              (0x01UL << GPIO_PORT_B135_PBYTE_Pos)                      /*!< GPIO_PORT B135: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B136  -----------------------------------------\r
+#define GPIO_PORT_B136_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B136: PBYTE Position      */\r
+#define GPIO_PORT_B136_PBYTE_Msk                              (0x01UL << GPIO_PORT_B136_PBYTE_Pos)                      /*!< GPIO_PORT B136: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B137  -----------------------------------------\r
+#define GPIO_PORT_B137_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B137: PBYTE Position      */\r
+#define GPIO_PORT_B137_PBYTE_Msk                              (0x01UL << GPIO_PORT_B137_PBYTE_Pos)                      /*!< GPIO_PORT B137: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B138  -----------------------------------------\r
+#define GPIO_PORT_B138_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B138: PBYTE Position      */\r
+#define GPIO_PORT_B138_PBYTE_Msk                              (0x01UL << GPIO_PORT_B138_PBYTE_Pos)                      /*!< GPIO_PORT B138: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B139  -----------------------------------------\r
+#define GPIO_PORT_B139_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B139: PBYTE Position      */\r
+#define GPIO_PORT_B139_PBYTE_Msk                              (0x01UL << GPIO_PORT_B139_PBYTE_Pos)                      /*!< GPIO_PORT B139: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B140  -----------------------------------------\r
+#define GPIO_PORT_B140_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B140: PBYTE Position      */\r
+#define GPIO_PORT_B140_PBYTE_Msk                              (0x01UL << GPIO_PORT_B140_PBYTE_Pos)                      /*!< GPIO_PORT B140: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B141  -----------------------------------------\r
+#define GPIO_PORT_B141_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B141: PBYTE Position      */\r
+#define GPIO_PORT_B141_PBYTE_Msk                              (0x01UL << GPIO_PORT_B141_PBYTE_Pos)                      /*!< GPIO_PORT B141: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B142  -----------------------------------------\r
+#define GPIO_PORT_B142_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B142: PBYTE Position      */\r
+#define GPIO_PORT_B142_PBYTE_Msk                              (0x01UL << GPIO_PORT_B142_PBYTE_Pos)                      /*!< GPIO_PORT B142: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B143  -----------------------------------------\r
+#define GPIO_PORT_B143_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B143: PBYTE Position      */\r
+#define GPIO_PORT_B143_PBYTE_Msk                              (0x01UL << GPIO_PORT_B143_PBYTE_Pos)                      /*!< GPIO_PORT B143: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B144  -----------------------------------------\r
+#define GPIO_PORT_B144_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B144: PBYTE Position      */\r
+#define GPIO_PORT_B144_PBYTE_Msk                              (0x01UL << GPIO_PORT_B144_PBYTE_Pos)                      /*!< GPIO_PORT B144: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B145  -----------------------------------------\r
+#define GPIO_PORT_B145_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B145: PBYTE Position      */\r
+#define GPIO_PORT_B145_PBYTE_Msk                              (0x01UL << GPIO_PORT_B145_PBYTE_Pos)                      /*!< GPIO_PORT B145: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B146  -----------------------------------------\r
+#define GPIO_PORT_B146_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B146: PBYTE Position      */\r
+#define GPIO_PORT_B146_PBYTE_Msk                              (0x01UL << GPIO_PORT_B146_PBYTE_Pos)                      /*!< GPIO_PORT B146: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B147  -----------------------------------------\r
+#define GPIO_PORT_B147_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B147: PBYTE Position      */\r
+#define GPIO_PORT_B147_PBYTE_Msk                              (0x01UL << GPIO_PORT_B147_PBYTE_Pos)                      /*!< GPIO_PORT B147: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B148  -----------------------------------------\r
+#define GPIO_PORT_B148_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B148: PBYTE Position      */\r
+#define GPIO_PORT_B148_PBYTE_Msk                              (0x01UL << GPIO_PORT_B148_PBYTE_Pos)                      /*!< GPIO_PORT B148: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B149  -----------------------------------------\r
+#define GPIO_PORT_B149_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B149: PBYTE Position      */\r
+#define GPIO_PORT_B149_PBYTE_Msk                              (0x01UL << GPIO_PORT_B149_PBYTE_Pos)                      /*!< GPIO_PORT B149: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B150  -----------------------------------------\r
+#define GPIO_PORT_B150_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B150: PBYTE Position      */\r
+#define GPIO_PORT_B150_PBYTE_Msk                              (0x01UL << GPIO_PORT_B150_PBYTE_Pos)                      /*!< GPIO_PORT B150: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B151  -----------------------------------------\r
+#define GPIO_PORT_B151_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B151: PBYTE Position      */\r
+#define GPIO_PORT_B151_PBYTE_Msk                              (0x01UL << GPIO_PORT_B151_PBYTE_Pos)                      /*!< GPIO_PORT B151: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B152  -----------------------------------------\r
+#define GPIO_PORT_B152_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B152: PBYTE Position      */\r
+#define GPIO_PORT_B152_PBYTE_Msk                              (0x01UL << GPIO_PORT_B152_PBYTE_Pos)                      /*!< GPIO_PORT B152: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B153  -----------------------------------------\r
+#define GPIO_PORT_B153_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B153: PBYTE Position      */\r
+#define GPIO_PORT_B153_PBYTE_Msk                              (0x01UL << GPIO_PORT_B153_PBYTE_Pos)                      /*!< GPIO_PORT B153: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B154  -----------------------------------------\r
+#define GPIO_PORT_B154_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B154: PBYTE Position      */\r
+#define GPIO_PORT_B154_PBYTE_Msk                              (0x01UL << GPIO_PORT_B154_PBYTE_Pos)                      /*!< GPIO_PORT B154: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B155  -----------------------------------------\r
+#define GPIO_PORT_B155_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B155: PBYTE Position      */\r
+#define GPIO_PORT_B155_PBYTE_Msk                              (0x01UL << GPIO_PORT_B155_PBYTE_Pos)                      /*!< GPIO_PORT B155: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B156  -----------------------------------------\r
+#define GPIO_PORT_B156_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B156: PBYTE Position      */\r
+#define GPIO_PORT_B156_PBYTE_Msk                              (0x01UL << GPIO_PORT_B156_PBYTE_Pos)                      /*!< GPIO_PORT B156: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B157  -----------------------------------------\r
+#define GPIO_PORT_B157_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B157: PBYTE Position      */\r
+#define GPIO_PORT_B157_PBYTE_Msk                              (0x01UL << GPIO_PORT_B157_PBYTE_Pos)                      /*!< GPIO_PORT B157: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B158  -----------------------------------------\r
+#define GPIO_PORT_B158_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B158: PBYTE Position      */\r
+#define GPIO_PORT_B158_PBYTE_Msk                              (0x01UL << GPIO_PORT_B158_PBYTE_Pos)                      /*!< GPIO_PORT B158: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B159  -----------------------------------------\r
+#define GPIO_PORT_B159_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B159: PBYTE Position      */\r
+#define GPIO_PORT_B159_PBYTE_Msk                              (0x01UL << GPIO_PORT_B159_PBYTE_Pos)                      /*!< GPIO_PORT B159: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B160  -----------------------------------------\r
+#define GPIO_PORT_B160_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B160: PBYTE Position      */\r
+#define GPIO_PORT_B160_PBYTE_Msk                              (0x01UL << GPIO_PORT_B160_PBYTE_Pos)                      /*!< GPIO_PORT B160: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B161  -----------------------------------------\r
+#define GPIO_PORT_B161_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B161: PBYTE Position      */\r
+#define GPIO_PORT_B161_PBYTE_Msk                              (0x01UL << GPIO_PORT_B161_PBYTE_Pos)                      /*!< GPIO_PORT B161: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B162  -----------------------------------------\r
+#define GPIO_PORT_B162_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B162: PBYTE Position      */\r
+#define GPIO_PORT_B162_PBYTE_Msk                              (0x01UL << GPIO_PORT_B162_PBYTE_Pos)                      /*!< GPIO_PORT B162: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B163  -----------------------------------------\r
+#define GPIO_PORT_B163_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B163: PBYTE Position      */\r
+#define GPIO_PORT_B163_PBYTE_Msk                              (0x01UL << GPIO_PORT_B163_PBYTE_Pos)                      /*!< GPIO_PORT B163: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B164  -----------------------------------------\r
+#define GPIO_PORT_B164_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B164: PBYTE Position      */\r
+#define GPIO_PORT_B164_PBYTE_Msk                              (0x01UL << GPIO_PORT_B164_PBYTE_Pos)                      /*!< GPIO_PORT B164: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B165  -----------------------------------------\r
+#define GPIO_PORT_B165_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B165: PBYTE Position      */\r
+#define GPIO_PORT_B165_PBYTE_Msk                              (0x01UL << GPIO_PORT_B165_PBYTE_Pos)                      /*!< GPIO_PORT B165: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B166  -----------------------------------------\r
+#define GPIO_PORT_B166_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B166: PBYTE Position      */\r
+#define GPIO_PORT_B166_PBYTE_Msk                              (0x01UL << GPIO_PORT_B166_PBYTE_Pos)                      /*!< GPIO_PORT B166: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B167  -----------------------------------------\r
+#define GPIO_PORT_B167_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B167: PBYTE Position      */\r
+#define GPIO_PORT_B167_PBYTE_Msk                              (0x01UL << GPIO_PORT_B167_PBYTE_Pos)                      /*!< GPIO_PORT B167: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B168  -----------------------------------------\r
+#define GPIO_PORT_B168_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B168: PBYTE Position      */\r
+#define GPIO_PORT_B168_PBYTE_Msk                              (0x01UL << GPIO_PORT_B168_PBYTE_Pos)                      /*!< GPIO_PORT B168: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B169  -----------------------------------------\r
+#define GPIO_PORT_B169_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B169: PBYTE Position      */\r
+#define GPIO_PORT_B169_PBYTE_Msk                              (0x01UL << GPIO_PORT_B169_PBYTE_Pos)                      /*!< GPIO_PORT B169: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B170  -----------------------------------------\r
+#define GPIO_PORT_B170_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B170: PBYTE Position      */\r
+#define GPIO_PORT_B170_PBYTE_Msk                              (0x01UL << GPIO_PORT_B170_PBYTE_Pos)                      /*!< GPIO_PORT B170: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B171  -----------------------------------------\r
+#define GPIO_PORT_B171_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B171: PBYTE Position      */\r
+#define GPIO_PORT_B171_PBYTE_Msk                              (0x01UL << GPIO_PORT_B171_PBYTE_Pos)                      /*!< GPIO_PORT B171: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B172  -----------------------------------------\r
+#define GPIO_PORT_B172_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B172: PBYTE Position      */\r
+#define GPIO_PORT_B172_PBYTE_Msk                              (0x01UL << GPIO_PORT_B172_PBYTE_Pos)                      /*!< GPIO_PORT B172: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B173  -----------------------------------------\r
+#define GPIO_PORT_B173_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B173: PBYTE Position      */\r
+#define GPIO_PORT_B173_PBYTE_Msk                              (0x01UL << GPIO_PORT_B173_PBYTE_Pos)                      /*!< GPIO_PORT B173: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B174  -----------------------------------------\r
+#define GPIO_PORT_B174_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B174: PBYTE Position      */\r
+#define GPIO_PORT_B174_PBYTE_Msk                              (0x01UL << GPIO_PORT_B174_PBYTE_Pos)                      /*!< GPIO_PORT B174: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B175  -----------------------------------------\r
+#define GPIO_PORT_B175_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B175: PBYTE Position      */\r
+#define GPIO_PORT_B175_PBYTE_Msk                              (0x01UL << GPIO_PORT_B175_PBYTE_Pos)                      /*!< GPIO_PORT B175: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B176  -----------------------------------------\r
+#define GPIO_PORT_B176_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B176: PBYTE Position      */\r
+#define GPIO_PORT_B176_PBYTE_Msk                              (0x01UL << GPIO_PORT_B176_PBYTE_Pos)                      /*!< GPIO_PORT B176: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B177  -----------------------------------------\r
+#define GPIO_PORT_B177_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B177: PBYTE Position      */\r
+#define GPIO_PORT_B177_PBYTE_Msk                              (0x01UL << GPIO_PORT_B177_PBYTE_Pos)                      /*!< GPIO_PORT B177: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B178  -----------------------------------------\r
+#define GPIO_PORT_B178_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B178: PBYTE Position      */\r
+#define GPIO_PORT_B178_PBYTE_Msk                              (0x01UL << GPIO_PORT_B178_PBYTE_Pos)                      /*!< GPIO_PORT B178: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B179  -----------------------------------------\r
+#define GPIO_PORT_B179_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B179: PBYTE Position      */\r
+#define GPIO_PORT_B179_PBYTE_Msk                              (0x01UL << GPIO_PORT_B179_PBYTE_Pos)                      /*!< GPIO_PORT B179: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B180  -----------------------------------------\r
+#define GPIO_PORT_B180_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B180: PBYTE Position      */\r
+#define GPIO_PORT_B180_PBYTE_Msk                              (0x01UL << GPIO_PORT_B180_PBYTE_Pos)                      /*!< GPIO_PORT B180: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B181  -----------------------------------------\r
+#define GPIO_PORT_B181_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B181: PBYTE Position      */\r
+#define GPIO_PORT_B181_PBYTE_Msk                              (0x01UL << GPIO_PORT_B181_PBYTE_Pos)                      /*!< GPIO_PORT B181: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B182  -----------------------------------------\r
+#define GPIO_PORT_B182_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B182: PBYTE Position      */\r
+#define GPIO_PORT_B182_PBYTE_Msk                              (0x01UL << GPIO_PORT_B182_PBYTE_Pos)                      /*!< GPIO_PORT B182: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B183  -----------------------------------------\r
+#define GPIO_PORT_B183_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B183: PBYTE Position      */\r
+#define GPIO_PORT_B183_PBYTE_Msk                              (0x01UL << GPIO_PORT_B183_PBYTE_Pos)                      /*!< GPIO_PORT B183: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B184  -----------------------------------------\r
+#define GPIO_PORT_B184_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B184: PBYTE Position      */\r
+#define GPIO_PORT_B184_PBYTE_Msk                              (0x01UL << GPIO_PORT_B184_PBYTE_Pos)                      /*!< GPIO_PORT B184: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B185  -----------------------------------------\r
+#define GPIO_PORT_B185_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B185: PBYTE Position      */\r
+#define GPIO_PORT_B185_PBYTE_Msk                              (0x01UL << GPIO_PORT_B185_PBYTE_Pos)                      /*!< GPIO_PORT B185: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B186  -----------------------------------------\r
+#define GPIO_PORT_B186_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B186: PBYTE Position      */\r
+#define GPIO_PORT_B186_PBYTE_Msk                              (0x01UL << GPIO_PORT_B186_PBYTE_Pos)                      /*!< GPIO_PORT B186: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B187  -----------------------------------------\r
+#define GPIO_PORT_B187_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B187: PBYTE Position      */\r
+#define GPIO_PORT_B187_PBYTE_Msk                              (0x01UL << GPIO_PORT_B187_PBYTE_Pos)                      /*!< GPIO_PORT B187: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B188  -----------------------------------------\r
+#define GPIO_PORT_B188_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B188: PBYTE Position      */\r
+#define GPIO_PORT_B188_PBYTE_Msk                              (0x01UL << GPIO_PORT_B188_PBYTE_Pos)                      /*!< GPIO_PORT B188: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B189  -----------------------------------------\r
+#define GPIO_PORT_B189_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B189: PBYTE Position      */\r
+#define GPIO_PORT_B189_PBYTE_Msk                              (0x01UL << GPIO_PORT_B189_PBYTE_Pos)                      /*!< GPIO_PORT B189: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B190  -----------------------------------------\r
+#define GPIO_PORT_B190_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B190: PBYTE Position      */\r
+#define GPIO_PORT_B190_PBYTE_Msk                              (0x01UL << GPIO_PORT_B190_PBYTE_Pos)                      /*!< GPIO_PORT B190: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B191  -----------------------------------------\r
+#define GPIO_PORT_B191_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B191: PBYTE Position      */\r
+#define GPIO_PORT_B191_PBYTE_Msk                              (0x01UL << GPIO_PORT_B191_PBYTE_Pos)                      /*!< GPIO_PORT B191: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B192  -----------------------------------------\r
+#define GPIO_PORT_B192_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B192: PBYTE Position      */\r
+#define GPIO_PORT_B192_PBYTE_Msk                              (0x01UL << GPIO_PORT_B192_PBYTE_Pos)                      /*!< GPIO_PORT B192: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B193  -----------------------------------------\r
+#define GPIO_PORT_B193_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B193: PBYTE Position      */\r
+#define GPIO_PORT_B193_PBYTE_Msk                              (0x01UL << GPIO_PORT_B193_PBYTE_Pos)                      /*!< GPIO_PORT B193: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B194  -----------------------------------------\r
+#define GPIO_PORT_B194_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B194: PBYTE Position      */\r
+#define GPIO_PORT_B194_PBYTE_Msk                              (0x01UL << GPIO_PORT_B194_PBYTE_Pos)                      /*!< GPIO_PORT B194: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B195  -----------------------------------------\r
+#define GPIO_PORT_B195_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B195: PBYTE Position      */\r
+#define GPIO_PORT_B195_PBYTE_Msk                              (0x01UL << GPIO_PORT_B195_PBYTE_Pos)                      /*!< GPIO_PORT B195: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B196  -----------------------------------------\r
+#define GPIO_PORT_B196_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B196: PBYTE Position      */\r
+#define GPIO_PORT_B196_PBYTE_Msk                              (0x01UL << GPIO_PORT_B196_PBYTE_Pos)                      /*!< GPIO_PORT B196: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B197  -----------------------------------------\r
+#define GPIO_PORT_B197_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B197: PBYTE Position      */\r
+#define GPIO_PORT_B197_PBYTE_Msk                              (0x01UL << GPIO_PORT_B197_PBYTE_Pos)                      /*!< GPIO_PORT B197: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B198  -----------------------------------------\r
+#define GPIO_PORT_B198_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B198: PBYTE Position      */\r
+#define GPIO_PORT_B198_PBYTE_Msk                              (0x01UL << GPIO_PORT_B198_PBYTE_Pos)                      /*!< GPIO_PORT B198: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B199  -----------------------------------------\r
+#define GPIO_PORT_B199_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B199: PBYTE Position      */\r
+#define GPIO_PORT_B199_PBYTE_Msk                              (0x01UL << GPIO_PORT_B199_PBYTE_Pos)                      /*!< GPIO_PORT B199: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B200  -----------------------------------------\r
+#define GPIO_PORT_B200_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B200: PBYTE Position      */\r
+#define GPIO_PORT_B200_PBYTE_Msk                              (0x01UL << GPIO_PORT_B200_PBYTE_Pos)                      /*!< GPIO_PORT B200: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B201  -----------------------------------------\r
+#define GPIO_PORT_B201_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B201: PBYTE Position      */\r
+#define GPIO_PORT_B201_PBYTE_Msk                              (0x01UL << GPIO_PORT_B201_PBYTE_Pos)                      /*!< GPIO_PORT B201: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B202  -----------------------------------------\r
+#define GPIO_PORT_B202_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B202: PBYTE Position      */\r
+#define GPIO_PORT_B202_PBYTE_Msk                              (0x01UL << GPIO_PORT_B202_PBYTE_Pos)                      /*!< GPIO_PORT B202: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B203  -----------------------------------------\r
+#define GPIO_PORT_B203_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B203: PBYTE Position      */\r
+#define GPIO_PORT_B203_PBYTE_Msk                              (0x01UL << GPIO_PORT_B203_PBYTE_Pos)                      /*!< GPIO_PORT B203: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B204  -----------------------------------------\r
+#define GPIO_PORT_B204_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B204: PBYTE Position      */\r
+#define GPIO_PORT_B204_PBYTE_Msk                              (0x01UL << GPIO_PORT_B204_PBYTE_Pos)                      /*!< GPIO_PORT B204: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B205  -----------------------------------------\r
+#define GPIO_PORT_B205_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B205: PBYTE Position      */\r
+#define GPIO_PORT_B205_PBYTE_Msk                              (0x01UL << GPIO_PORT_B205_PBYTE_Pos)                      /*!< GPIO_PORT B205: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B206  -----------------------------------------\r
+#define GPIO_PORT_B206_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B206: PBYTE Position      */\r
+#define GPIO_PORT_B206_PBYTE_Msk                              (0x01UL << GPIO_PORT_B206_PBYTE_Pos)                      /*!< GPIO_PORT B206: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B207  -----------------------------------------\r
+#define GPIO_PORT_B207_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B207: PBYTE Position      */\r
+#define GPIO_PORT_B207_PBYTE_Msk                              (0x01UL << GPIO_PORT_B207_PBYTE_Pos)                      /*!< GPIO_PORT B207: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B208  -----------------------------------------\r
+#define GPIO_PORT_B208_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B208: PBYTE Position      */\r
+#define GPIO_PORT_B208_PBYTE_Msk                              (0x01UL << GPIO_PORT_B208_PBYTE_Pos)                      /*!< GPIO_PORT B208: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B209  -----------------------------------------\r
+#define GPIO_PORT_B209_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B209: PBYTE Position      */\r
+#define GPIO_PORT_B209_PBYTE_Msk                              (0x01UL << GPIO_PORT_B209_PBYTE_Pos)                      /*!< GPIO_PORT B209: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B210  -----------------------------------------\r
+#define GPIO_PORT_B210_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B210: PBYTE Position      */\r
+#define GPIO_PORT_B210_PBYTE_Msk                              (0x01UL << GPIO_PORT_B210_PBYTE_Pos)                      /*!< GPIO_PORT B210: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B211  -----------------------------------------\r
+#define GPIO_PORT_B211_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B211: PBYTE Position      */\r
+#define GPIO_PORT_B211_PBYTE_Msk                              (0x01UL << GPIO_PORT_B211_PBYTE_Pos)                      /*!< GPIO_PORT B211: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B212  -----------------------------------------\r
+#define GPIO_PORT_B212_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B212: PBYTE Position      */\r
+#define GPIO_PORT_B212_PBYTE_Msk                              (0x01UL << GPIO_PORT_B212_PBYTE_Pos)                      /*!< GPIO_PORT B212: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B213  -----------------------------------------\r
+#define GPIO_PORT_B213_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B213: PBYTE Position      */\r
+#define GPIO_PORT_B213_PBYTE_Msk                              (0x01UL << GPIO_PORT_B213_PBYTE_Pos)                      /*!< GPIO_PORT B213: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B214  -----------------------------------------\r
+#define GPIO_PORT_B214_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B214: PBYTE Position      */\r
+#define GPIO_PORT_B214_PBYTE_Msk                              (0x01UL << GPIO_PORT_B214_PBYTE_Pos)                      /*!< GPIO_PORT B214: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B215  -----------------------------------------\r
+#define GPIO_PORT_B215_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B215: PBYTE Position      */\r
+#define GPIO_PORT_B215_PBYTE_Msk                              (0x01UL << GPIO_PORT_B215_PBYTE_Pos)                      /*!< GPIO_PORT B215: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B216  -----------------------------------------\r
+#define GPIO_PORT_B216_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B216: PBYTE Position      */\r
+#define GPIO_PORT_B216_PBYTE_Msk                              (0x01UL << GPIO_PORT_B216_PBYTE_Pos)                      /*!< GPIO_PORT B216: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B217  -----------------------------------------\r
+#define GPIO_PORT_B217_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B217: PBYTE Position      */\r
+#define GPIO_PORT_B217_PBYTE_Msk                              (0x01UL << GPIO_PORT_B217_PBYTE_Pos)                      /*!< GPIO_PORT B217: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B218  -----------------------------------------\r
+#define GPIO_PORT_B218_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B218: PBYTE Position      */\r
+#define GPIO_PORT_B218_PBYTE_Msk                              (0x01UL << GPIO_PORT_B218_PBYTE_Pos)                      /*!< GPIO_PORT B218: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B219  -----------------------------------------\r
+#define GPIO_PORT_B219_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B219: PBYTE Position      */\r
+#define GPIO_PORT_B219_PBYTE_Msk                              (0x01UL << GPIO_PORT_B219_PBYTE_Pos)                      /*!< GPIO_PORT B219: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B220  -----------------------------------------\r
+#define GPIO_PORT_B220_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B220: PBYTE Position      */\r
+#define GPIO_PORT_B220_PBYTE_Msk                              (0x01UL << GPIO_PORT_B220_PBYTE_Pos)                      /*!< GPIO_PORT B220: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B221  -----------------------------------------\r
+#define GPIO_PORT_B221_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B221: PBYTE Position      */\r
+#define GPIO_PORT_B221_PBYTE_Msk                              (0x01UL << GPIO_PORT_B221_PBYTE_Pos)                      /*!< GPIO_PORT B221: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B222  -----------------------------------------\r
+#define GPIO_PORT_B222_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B222: PBYTE Position      */\r
+#define GPIO_PORT_B222_PBYTE_Msk                              (0x01UL << GPIO_PORT_B222_PBYTE_Pos)                      /*!< GPIO_PORT B222: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B223  -----------------------------------------\r
+#define GPIO_PORT_B223_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B223: PBYTE Position      */\r
+#define GPIO_PORT_B223_PBYTE_Msk                              (0x01UL << GPIO_PORT_B223_PBYTE_Pos)                      /*!< GPIO_PORT B223: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B224  -----------------------------------------\r
+#define GPIO_PORT_B224_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B224: PBYTE Position      */\r
+#define GPIO_PORT_B224_PBYTE_Msk                              (0x01UL << GPIO_PORT_B224_PBYTE_Pos)                      /*!< GPIO_PORT B224: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B225  -----------------------------------------\r
+#define GPIO_PORT_B225_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B225: PBYTE Position      */\r
+#define GPIO_PORT_B225_PBYTE_Msk                              (0x01UL << GPIO_PORT_B225_PBYTE_Pos)                      /*!< GPIO_PORT B225: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B226  -----------------------------------------\r
+#define GPIO_PORT_B226_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B226: PBYTE Position      */\r
+#define GPIO_PORT_B226_PBYTE_Msk                              (0x01UL << GPIO_PORT_B226_PBYTE_Pos)                      /*!< GPIO_PORT B226: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B227  -----------------------------------------\r
+#define GPIO_PORT_B227_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B227: PBYTE Position      */\r
+#define GPIO_PORT_B227_PBYTE_Msk                              (0x01UL << GPIO_PORT_B227_PBYTE_Pos)                      /*!< GPIO_PORT B227: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B228  -----------------------------------------\r
+#define GPIO_PORT_B228_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B228: PBYTE Position      */\r
+#define GPIO_PORT_B228_PBYTE_Msk                              (0x01UL << GPIO_PORT_B228_PBYTE_Pos)                      /*!< GPIO_PORT B228: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B229  -----------------------------------------\r
+#define GPIO_PORT_B229_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B229: PBYTE Position      */\r
+#define GPIO_PORT_B229_PBYTE_Msk                              (0x01UL << GPIO_PORT_B229_PBYTE_Pos)                      /*!< GPIO_PORT B229: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B230  -----------------------------------------\r
+#define GPIO_PORT_B230_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B230: PBYTE Position      */\r
+#define GPIO_PORT_B230_PBYTE_Msk                              (0x01UL << GPIO_PORT_B230_PBYTE_Pos)                      /*!< GPIO_PORT B230: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B231  -----------------------------------------\r
+#define GPIO_PORT_B231_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B231: PBYTE Position      */\r
+#define GPIO_PORT_B231_PBYTE_Msk                              (0x01UL << GPIO_PORT_B231_PBYTE_Pos)                      /*!< GPIO_PORT B231: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B232  -----------------------------------------\r
+#define GPIO_PORT_B232_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B232: PBYTE Position      */\r
+#define GPIO_PORT_B232_PBYTE_Msk                              (0x01UL << GPIO_PORT_B232_PBYTE_Pos)                      /*!< GPIO_PORT B232: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B233  -----------------------------------------\r
+#define GPIO_PORT_B233_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B233: PBYTE Position      */\r
+#define GPIO_PORT_B233_PBYTE_Msk                              (0x01UL << GPIO_PORT_B233_PBYTE_Pos)                      /*!< GPIO_PORT B233: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B234  -----------------------------------------\r
+#define GPIO_PORT_B234_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B234: PBYTE Position      */\r
+#define GPIO_PORT_B234_PBYTE_Msk                              (0x01UL << GPIO_PORT_B234_PBYTE_Pos)                      /*!< GPIO_PORT B234: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B235  -----------------------------------------\r
+#define GPIO_PORT_B235_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B235: PBYTE Position      */\r
+#define GPIO_PORT_B235_PBYTE_Msk                              (0x01UL << GPIO_PORT_B235_PBYTE_Pos)                      /*!< GPIO_PORT B235: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B236  -----------------------------------------\r
+#define GPIO_PORT_B236_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B236: PBYTE Position      */\r
+#define GPIO_PORT_B236_PBYTE_Msk                              (0x01UL << GPIO_PORT_B236_PBYTE_Pos)                      /*!< GPIO_PORT B236: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B237  -----------------------------------------\r
+#define GPIO_PORT_B237_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B237: PBYTE Position      */\r
+#define GPIO_PORT_B237_PBYTE_Msk                              (0x01UL << GPIO_PORT_B237_PBYTE_Pos)                      /*!< GPIO_PORT B237: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B238  -----------------------------------------\r
+#define GPIO_PORT_B238_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B238: PBYTE Position      */\r
+#define GPIO_PORT_B238_PBYTE_Msk                              (0x01UL << GPIO_PORT_B238_PBYTE_Pos)                      /*!< GPIO_PORT B238: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B239  -----------------------------------------\r
+#define GPIO_PORT_B239_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B239: PBYTE Position      */\r
+#define GPIO_PORT_B239_PBYTE_Msk                              (0x01UL << GPIO_PORT_B239_PBYTE_Pos)                      /*!< GPIO_PORT B239: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B240  -----------------------------------------\r
+#define GPIO_PORT_B240_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B240: PBYTE Position      */\r
+#define GPIO_PORT_B240_PBYTE_Msk                              (0x01UL << GPIO_PORT_B240_PBYTE_Pos)                      /*!< GPIO_PORT B240: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B241  -----------------------------------------\r
+#define GPIO_PORT_B241_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B241: PBYTE Position      */\r
+#define GPIO_PORT_B241_PBYTE_Msk                              (0x01UL << GPIO_PORT_B241_PBYTE_Pos)                      /*!< GPIO_PORT B241: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B242  -----------------------------------------\r
+#define GPIO_PORT_B242_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B242: PBYTE Position      */\r
+#define GPIO_PORT_B242_PBYTE_Msk                              (0x01UL << GPIO_PORT_B242_PBYTE_Pos)                      /*!< GPIO_PORT B242: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B243  -----------------------------------------\r
+#define GPIO_PORT_B243_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B243: PBYTE Position      */\r
+#define GPIO_PORT_B243_PBYTE_Msk                              (0x01UL << GPIO_PORT_B243_PBYTE_Pos)                      /*!< GPIO_PORT B243: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B244  -----------------------------------------\r
+#define GPIO_PORT_B244_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B244: PBYTE Position      */\r
+#define GPIO_PORT_B244_PBYTE_Msk                              (0x01UL << GPIO_PORT_B244_PBYTE_Pos)                      /*!< GPIO_PORT B244: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B245  -----------------------------------------\r
+#define GPIO_PORT_B245_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B245: PBYTE Position      */\r
+#define GPIO_PORT_B245_PBYTE_Msk                              (0x01UL << GPIO_PORT_B245_PBYTE_Pos)                      /*!< GPIO_PORT B245: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B246  -----------------------------------------\r
+#define GPIO_PORT_B246_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B246: PBYTE Position      */\r
+#define GPIO_PORT_B246_PBYTE_Msk                              (0x01UL << GPIO_PORT_B246_PBYTE_Pos)                      /*!< GPIO_PORT B246: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B247  -----------------------------------------\r
+#define GPIO_PORT_B247_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B247: PBYTE Position      */\r
+#define GPIO_PORT_B247_PBYTE_Msk                              (0x01UL << GPIO_PORT_B247_PBYTE_Pos)                      /*!< GPIO_PORT B247: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B248  -----------------------------------------\r
+#define GPIO_PORT_B248_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B248: PBYTE Position      */\r
+#define GPIO_PORT_B248_PBYTE_Msk                              (0x01UL << GPIO_PORT_B248_PBYTE_Pos)                      /*!< GPIO_PORT B248: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B249  -----------------------------------------\r
+#define GPIO_PORT_B249_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B249: PBYTE Position      */\r
+#define GPIO_PORT_B249_PBYTE_Msk                              (0x01UL << GPIO_PORT_B249_PBYTE_Pos)                      /*!< GPIO_PORT B249: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B250  -----------------------------------------\r
+#define GPIO_PORT_B250_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B250: PBYTE Position      */\r
+#define GPIO_PORT_B250_PBYTE_Msk                              (0x01UL << GPIO_PORT_B250_PBYTE_Pos)                      /*!< GPIO_PORT B250: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B251  -----------------------------------------\r
+#define GPIO_PORT_B251_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B251: PBYTE Position      */\r
+#define GPIO_PORT_B251_PBYTE_Msk                              (0x01UL << GPIO_PORT_B251_PBYTE_Pos)                      /*!< GPIO_PORT B251: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B252  -----------------------------------------\r
+#define GPIO_PORT_B252_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B252: PBYTE Position      */\r
+#define GPIO_PORT_B252_PBYTE_Msk                              (0x01UL << GPIO_PORT_B252_PBYTE_Pos)                      /*!< GPIO_PORT B252: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B253  -----------------------------------------\r
+#define GPIO_PORT_B253_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B253: PBYTE Position      */\r
+#define GPIO_PORT_B253_PBYTE_Msk                              (0x01UL << GPIO_PORT_B253_PBYTE_Pos)                      /*!< GPIO_PORT B253: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B254  -----------------------------------------\r
+#define GPIO_PORT_B254_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B254: PBYTE Position      */\r
+#define GPIO_PORT_B254_PBYTE_Msk                              (0x01UL << GPIO_PORT_B254_PBYTE_Pos)                      /*!< GPIO_PORT B254: PBYTE Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_B255  -----------------------------------------\r
+#define GPIO_PORT_B255_PBYTE_Pos                              0                                                         /*!< GPIO_PORT B255: PBYTE Position      */\r
+#define GPIO_PORT_B255_PBYTE_Msk                              (0x01UL << GPIO_PORT_B255_PBYTE_Pos)                      /*!< GPIO_PORT B255: PBYTE Mask          */\r
+\r
+// --------------------------------------  GPIO_PORT_W0  ------------------------------------------\r
+#define GPIO_PORT_W0_PWORD_Pos                                0                                                         /*!< GPIO_PORT W0: PWORD Position        */\r
+#define GPIO_PORT_W0_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W0_PWORD_Pos)                  /*!< GPIO_PORT W0: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W1  ------------------------------------------\r
+#define GPIO_PORT_W1_PWORD_Pos                                0                                                         /*!< GPIO_PORT W1: PWORD Position        */\r
+#define GPIO_PORT_W1_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W1_PWORD_Pos)                  /*!< GPIO_PORT W1: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W2  ------------------------------------------\r
+#define GPIO_PORT_W2_PWORD_Pos                                0                                                         /*!< GPIO_PORT W2: PWORD Position        */\r
+#define GPIO_PORT_W2_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W2_PWORD_Pos)                  /*!< GPIO_PORT W2: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W3  ------------------------------------------\r
+#define GPIO_PORT_W3_PWORD_Pos                                0                                                         /*!< GPIO_PORT W3: PWORD Position        */\r
+#define GPIO_PORT_W3_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W3_PWORD_Pos)                  /*!< GPIO_PORT W3: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W4  ------------------------------------------\r
+#define GPIO_PORT_W4_PWORD_Pos                                0                                                         /*!< GPIO_PORT W4: PWORD Position        */\r
+#define GPIO_PORT_W4_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W4_PWORD_Pos)                  /*!< GPIO_PORT W4: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W5  ------------------------------------------\r
+#define GPIO_PORT_W5_PWORD_Pos                                0                                                         /*!< GPIO_PORT W5: PWORD Position        */\r
+#define GPIO_PORT_W5_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W5_PWORD_Pos)                  /*!< GPIO_PORT W5: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W6  ------------------------------------------\r
+#define GPIO_PORT_W6_PWORD_Pos                                0                                                         /*!< GPIO_PORT W6: PWORD Position        */\r
+#define GPIO_PORT_W6_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W6_PWORD_Pos)                  /*!< GPIO_PORT W6: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W7  ------------------------------------------\r
+#define GPIO_PORT_W7_PWORD_Pos                                0                                                         /*!< GPIO_PORT W7: PWORD Position        */\r
+#define GPIO_PORT_W7_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W7_PWORD_Pos)                  /*!< GPIO_PORT W7: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W8  ------------------------------------------\r
+#define GPIO_PORT_W8_PWORD_Pos                                0                                                         /*!< GPIO_PORT W8: PWORD Position        */\r
+#define GPIO_PORT_W8_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W8_PWORD_Pos)                  /*!< GPIO_PORT W8: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W9  ------------------------------------------\r
+#define GPIO_PORT_W9_PWORD_Pos                                0                                                         /*!< GPIO_PORT W9: PWORD Position        */\r
+#define GPIO_PORT_W9_PWORD_Msk                                (0xffffffffUL << GPIO_PORT_W9_PWORD_Pos)                  /*!< GPIO_PORT W9: PWORD Mask            */\r
+\r
+// --------------------------------------  GPIO_PORT_W10  -----------------------------------------\r
+#define GPIO_PORT_W10_PWORD_Pos                               0                                                         /*!< GPIO_PORT W10: PWORD Position       */\r
+#define GPIO_PORT_W10_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W10_PWORD_Pos)                 /*!< GPIO_PORT W10: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W11  -----------------------------------------\r
+#define GPIO_PORT_W11_PWORD_Pos                               0                                                         /*!< GPIO_PORT W11: PWORD Position       */\r
+#define GPIO_PORT_W11_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W11_PWORD_Pos)                 /*!< GPIO_PORT W11: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W12  -----------------------------------------\r
+#define GPIO_PORT_W12_PWORD_Pos                               0                                                         /*!< GPIO_PORT W12: PWORD Position       */\r
+#define GPIO_PORT_W12_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W12_PWORD_Pos)                 /*!< GPIO_PORT W12: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W13  -----------------------------------------\r
+#define GPIO_PORT_W13_PWORD_Pos                               0                                                         /*!< GPIO_PORT W13: PWORD Position       */\r
+#define GPIO_PORT_W13_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W13_PWORD_Pos)                 /*!< GPIO_PORT W13: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W14  -----------------------------------------\r
+#define GPIO_PORT_W14_PWORD_Pos                               0                                                         /*!< GPIO_PORT W14: PWORD Position       */\r
+#define GPIO_PORT_W14_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W14_PWORD_Pos)                 /*!< GPIO_PORT W14: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W15  -----------------------------------------\r
+#define GPIO_PORT_W15_PWORD_Pos                               0                                                         /*!< GPIO_PORT W15: PWORD Position       */\r
+#define GPIO_PORT_W15_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W15_PWORD_Pos)                 /*!< GPIO_PORT W15: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W16  -----------------------------------------\r
+#define GPIO_PORT_W16_PWORD_Pos                               0                                                         /*!< GPIO_PORT W16: PWORD Position       */\r
+#define GPIO_PORT_W16_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W16_PWORD_Pos)                 /*!< GPIO_PORT W16: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W17  -----------------------------------------\r
+#define GPIO_PORT_W17_PWORD_Pos                               0                                                         /*!< GPIO_PORT W17: PWORD Position       */\r
+#define GPIO_PORT_W17_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W17_PWORD_Pos)                 /*!< GPIO_PORT W17: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W18  -----------------------------------------\r
+#define GPIO_PORT_W18_PWORD_Pos                               0                                                         /*!< GPIO_PORT W18: PWORD Position       */\r
+#define GPIO_PORT_W18_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W18_PWORD_Pos)                 /*!< GPIO_PORT W18: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W19  -----------------------------------------\r
+#define GPIO_PORT_W19_PWORD_Pos                               0                                                         /*!< GPIO_PORT W19: PWORD Position       */\r
+#define GPIO_PORT_W19_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W19_PWORD_Pos)                 /*!< GPIO_PORT W19: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W20  -----------------------------------------\r
+#define GPIO_PORT_W20_PWORD_Pos                               0                                                         /*!< GPIO_PORT W20: PWORD Position       */\r
+#define GPIO_PORT_W20_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W20_PWORD_Pos)                 /*!< GPIO_PORT W20: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W21  -----------------------------------------\r
+#define GPIO_PORT_W21_PWORD_Pos                               0                                                         /*!< GPIO_PORT W21: PWORD Position       */\r
+#define GPIO_PORT_W21_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W21_PWORD_Pos)                 /*!< GPIO_PORT W21: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W22  -----------------------------------------\r
+#define GPIO_PORT_W22_PWORD_Pos                               0                                                         /*!< GPIO_PORT W22: PWORD Position       */\r
+#define GPIO_PORT_W22_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W22_PWORD_Pos)                 /*!< GPIO_PORT W22: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W23  -----------------------------------------\r
+#define GPIO_PORT_W23_PWORD_Pos                               0                                                         /*!< GPIO_PORT W23: PWORD Position       */\r
+#define GPIO_PORT_W23_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W23_PWORD_Pos)                 /*!< GPIO_PORT W23: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W24  -----------------------------------------\r
+#define GPIO_PORT_W24_PWORD_Pos                               0                                                         /*!< GPIO_PORT W24: PWORD Position       */\r
+#define GPIO_PORT_W24_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W24_PWORD_Pos)                 /*!< GPIO_PORT W24: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W25  -----------------------------------------\r
+#define GPIO_PORT_W25_PWORD_Pos                               0                                                         /*!< GPIO_PORT W25: PWORD Position       */\r
+#define GPIO_PORT_W25_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W25_PWORD_Pos)                 /*!< GPIO_PORT W25: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W26  -----------------------------------------\r
+#define GPIO_PORT_W26_PWORD_Pos                               0                                                         /*!< GPIO_PORT W26: PWORD Position       */\r
+#define GPIO_PORT_W26_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W26_PWORD_Pos)                 /*!< GPIO_PORT W26: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W27  -----------------------------------------\r
+#define GPIO_PORT_W27_PWORD_Pos                               0                                                         /*!< GPIO_PORT W27: PWORD Position       */\r
+#define GPIO_PORT_W27_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W27_PWORD_Pos)                 /*!< GPIO_PORT W27: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W28  -----------------------------------------\r
+#define GPIO_PORT_W28_PWORD_Pos                               0                                                         /*!< GPIO_PORT W28: PWORD Position       */\r
+#define GPIO_PORT_W28_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W28_PWORD_Pos)                 /*!< GPIO_PORT W28: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W29  -----------------------------------------\r
+#define GPIO_PORT_W29_PWORD_Pos                               0                                                         /*!< GPIO_PORT W29: PWORD Position       */\r
+#define GPIO_PORT_W29_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W29_PWORD_Pos)                 /*!< GPIO_PORT W29: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W30  -----------------------------------------\r
+#define GPIO_PORT_W30_PWORD_Pos                               0                                                         /*!< GPIO_PORT W30: PWORD Position       */\r
+#define GPIO_PORT_W30_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W30_PWORD_Pos)                 /*!< GPIO_PORT W30: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W31  -----------------------------------------\r
+#define GPIO_PORT_W31_PWORD_Pos                               0                                                         /*!< GPIO_PORT W31: PWORD Position       */\r
+#define GPIO_PORT_W31_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W31_PWORD_Pos)                 /*!< GPIO_PORT W31: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W32  -----------------------------------------\r
+#define GPIO_PORT_W32_PWORD_Pos                               0                                                         /*!< GPIO_PORT W32: PWORD Position       */\r
+#define GPIO_PORT_W32_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W32_PWORD_Pos)                 /*!< GPIO_PORT W32: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W33  -----------------------------------------\r
+#define GPIO_PORT_W33_PWORD_Pos                               0                                                         /*!< GPIO_PORT W33: PWORD Position       */\r
+#define GPIO_PORT_W33_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W33_PWORD_Pos)                 /*!< GPIO_PORT W33: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W34  -----------------------------------------\r
+#define GPIO_PORT_W34_PWORD_Pos                               0                                                         /*!< GPIO_PORT W34: PWORD Position       */\r
+#define GPIO_PORT_W34_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W34_PWORD_Pos)                 /*!< GPIO_PORT W34: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W35  -----------------------------------------\r
+#define GPIO_PORT_W35_PWORD_Pos                               0                                                         /*!< GPIO_PORT W35: PWORD Position       */\r
+#define GPIO_PORT_W35_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W35_PWORD_Pos)                 /*!< GPIO_PORT W35: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W36  -----------------------------------------\r
+#define GPIO_PORT_W36_PWORD_Pos                               0                                                         /*!< GPIO_PORT W36: PWORD Position       */\r
+#define GPIO_PORT_W36_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W36_PWORD_Pos)                 /*!< GPIO_PORT W36: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W37  -----------------------------------------\r
+#define GPIO_PORT_W37_PWORD_Pos                               0                                                         /*!< GPIO_PORT W37: PWORD Position       */\r
+#define GPIO_PORT_W37_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W37_PWORD_Pos)                 /*!< GPIO_PORT W37: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W38  -----------------------------------------\r
+#define GPIO_PORT_W38_PWORD_Pos                               0                                                         /*!< GPIO_PORT W38: PWORD Position       */\r
+#define GPIO_PORT_W38_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W38_PWORD_Pos)                 /*!< GPIO_PORT W38: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W39  -----------------------------------------\r
+#define GPIO_PORT_W39_PWORD_Pos                               0                                                         /*!< GPIO_PORT W39: PWORD Position       */\r
+#define GPIO_PORT_W39_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W39_PWORD_Pos)                 /*!< GPIO_PORT W39: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W40  -----------------------------------------\r
+#define GPIO_PORT_W40_PWORD_Pos                               0                                                         /*!< GPIO_PORT W40: PWORD Position       */\r
+#define GPIO_PORT_W40_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W40_PWORD_Pos)                 /*!< GPIO_PORT W40: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W41  -----------------------------------------\r
+#define GPIO_PORT_W41_PWORD_Pos                               0                                                         /*!< GPIO_PORT W41: PWORD Position       */\r
+#define GPIO_PORT_W41_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W41_PWORD_Pos)                 /*!< GPIO_PORT W41: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W42  -----------------------------------------\r
+#define GPIO_PORT_W42_PWORD_Pos                               0                                                         /*!< GPIO_PORT W42: PWORD Position       */\r
+#define GPIO_PORT_W42_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W42_PWORD_Pos)                 /*!< GPIO_PORT W42: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W43  -----------------------------------------\r
+#define GPIO_PORT_W43_PWORD_Pos                               0                                                         /*!< GPIO_PORT W43: PWORD Position       */\r
+#define GPIO_PORT_W43_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W43_PWORD_Pos)                 /*!< GPIO_PORT W43: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W44  -----------------------------------------\r
+#define GPIO_PORT_W44_PWORD_Pos                               0                                                         /*!< GPIO_PORT W44: PWORD Position       */\r
+#define GPIO_PORT_W44_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W44_PWORD_Pos)                 /*!< GPIO_PORT W44: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W45  -----------------------------------------\r
+#define GPIO_PORT_W45_PWORD_Pos                               0                                                         /*!< GPIO_PORT W45: PWORD Position       */\r
+#define GPIO_PORT_W45_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W45_PWORD_Pos)                 /*!< GPIO_PORT W45: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W46  -----------------------------------------\r
+#define GPIO_PORT_W46_PWORD_Pos                               0                                                         /*!< GPIO_PORT W46: PWORD Position       */\r
+#define GPIO_PORT_W46_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W46_PWORD_Pos)                 /*!< GPIO_PORT W46: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W47  -----------------------------------------\r
+#define GPIO_PORT_W47_PWORD_Pos                               0                                                         /*!< GPIO_PORT W47: PWORD Position       */\r
+#define GPIO_PORT_W47_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W47_PWORD_Pos)                 /*!< GPIO_PORT W47: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W48  -----------------------------------------\r
+#define GPIO_PORT_W48_PWORD_Pos                               0                                                         /*!< GPIO_PORT W48: PWORD Position       */\r
+#define GPIO_PORT_W48_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W48_PWORD_Pos)                 /*!< GPIO_PORT W48: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W49  -----------------------------------------\r
+#define GPIO_PORT_W49_PWORD_Pos                               0                                                         /*!< GPIO_PORT W49: PWORD Position       */\r
+#define GPIO_PORT_W49_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W49_PWORD_Pos)                 /*!< GPIO_PORT W49: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W50  -----------------------------------------\r
+#define GPIO_PORT_W50_PWORD_Pos                               0                                                         /*!< GPIO_PORT W50: PWORD Position       */\r
+#define GPIO_PORT_W50_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W50_PWORD_Pos)                 /*!< GPIO_PORT W50: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W51  -----------------------------------------\r
+#define GPIO_PORT_W51_PWORD_Pos                               0                                                         /*!< GPIO_PORT W51: PWORD Position       */\r
+#define GPIO_PORT_W51_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W51_PWORD_Pos)                 /*!< GPIO_PORT W51: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W52  -----------------------------------------\r
+#define GPIO_PORT_W52_PWORD_Pos                               0                                                         /*!< GPIO_PORT W52: PWORD Position       */\r
+#define GPIO_PORT_W52_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W52_PWORD_Pos)                 /*!< GPIO_PORT W52: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W53  -----------------------------------------\r
+#define GPIO_PORT_W53_PWORD_Pos                               0                                                         /*!< GPIO_PORT W53: PWORD Position       */\r
+#define GPIO_PORT_W53_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W53_PWORD_Pos)                 /*!< GPIO_PORT W53: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W54  -----------------------------------------\r
+#define GPIO_PORT_W54_PWORD_Pos                               0                                                         /*!< GPIO_PORT W54: PWORD Position       */\r
+#define GPIO_PORT_W54_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W54_PWORD_Pos)                 /*!< GPIO_PORT W54: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W55  -----------------------------------------\r
+#define GPIO_PORT_W55_PWORD_Pos                               0                                                         /*!< GPIO_PORT W55: PWORD Position       */\r
+#define GPIO_PORT_W55_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W55_PWORD_Pos)                 /*!< GPIO_PORT W55: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W56  -----------------------------------------\r
+#define GPIO_PORT_W56_PWORD_Pos                               0                                                         /*!< GPIO_PORT W56: PWORD Position       */\r
+#define GPIO_PORT_W56_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W56_PWORD_Pos)                 /*!< GPIO_PORT W56: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W57  -----------------------------------------\r
+#define GPIO_PORT_W57_PWORD_Pos                               0                                                         /*!< GPIO_PORT W57: PWORD Position       */\r
+#define GPIO_PORT_W57_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W57_PWORD_Pos)                 /*!< GPIO_PORT W57: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W58  -----------------------------------------\r
+#define GPIO_PORT_W58_PWORD_Pos                               0                                                         /*!< GPIO_PORT W58: PWORD Position       */\r
+#define GPIO_PORT_W58_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W58_PWORD_Pos)                 /*!< GPIO_PORT W58: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W59  -----------------------------------------\r
+#define GPIO_PORT_W59_PWORD_Pos                               0                                                         /*!< GPIO_PORT W59: PWORD Position       */\r
+#define GPIO_PORT_W59_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W59_PWORD_Pos)                 /*!< GPIO_PORT W59: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W60  -----------------------------------------\r
+#define GPIO_PORT_W60_PWORD_Pos                               0                                                         /*!< GPIO_PORT W60: PWORD Position       */\r
+#define GPIO_PORT_W60_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W60_PWORD_Pos)                 /*!< GPIO_PORT W60: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W61  -----------------------------------------\r
+#define GPIO_PORT_W61_PWORD_Pos                               0                                                         /*!< GPIO_PORT W61: PWORD Position       */\r
+#define GPIO_PORT_W61_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W61_PWORD_Pos)                 /*!< GPIO_PORT W61: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W62  -----------------------------------------\r
+#define GPIO_PORT_W62_PWORD_Pos                               0                                                         /*!< GPIO_PORT W62: PWORD Position       */\r
+#define GPIO_PORT_W62_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W62_PWORD_Pos)                 /*!< GPIO_PORT W62: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W63  -----------------------------------------\r
+#define GPIO_PORT_W63_PWORD_Pos                               0                                                         /*!< GPIO_PORT W63: PWORD Position       */\r
+#define GPIO_PORT_W63_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W63_PWORD_Pos)                 /*!< GPIO_PORT W63: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W64  -----------------------------------------\r
+#define GPIO_PORT_W64_PWORD_Pos                               0                                                         /*!< GPIO_PORT W64: PWORD Position       */\r
+#define GPIO_PORT_W64_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W64_PWORD_Pos)                 /*!< GPIO_PORT W64: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W65  -----------------------------------------\r
+#define GPIO_PORT_W65_PWORD_Pos                               0                                                         /*!< GPIO_PORT W65: PWORD Position       */\r
+#define GPIO_PORT_W65_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W65_PWORD_Pos)                 /*!< GPIO_PORT W65: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W66  -----------------------------------------\r
+#define GPIO_PORT_W66_PWORD_Pos                               0                                                         /*!< GPIO_PORT W66: PWORD Position       */\r
+#define GPIO_PORT_W66_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W66_PWORD_Pos)                 /*!< GPIO_PORT W66: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W67  -----------------------------------------\r
+#define GPIO_PORT_W67_PWORD_Pos                               0                                                         /*!< GPIO_PORT W67: PWORD Position       */\r
+#define GPIO_PORT_W67_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W67_PWORD_Pos)                 /*!< GPIO_PORT W67: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W68  -----------------------------------------\r
+#define GPIO_PORT_W68_PWORD_Pos                               0                                                         /*!< GPIO_PORT W68: PWORD Position       */\r
+#define GPIO_PORT_W68_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W68_PWORD_Pos)                 /*!< GPIO_PORT W68: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W69  -----------------------------------------\r
+#define GPIO_PORT_W69_PWORD_Pos                               0                                                         /*!< GPIO_PORT W69: PWORD Position       */\r
+#define GPIO_PORT_W69_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W69_PWORD_Pos)                 /*!< GPIO_PORT W69: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W70  -----------------------------------------\r
+#define GPIO_PORT_W70_PWORD_Pos                               0                                                         /*!< GPIO_PORT W70: PWORD Position       */\r
+#define GPIO_PORT_W70_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W70_PWORD_Pos)                 /*!< GPIO_PORT W70: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W71  -----------------------------------------\r
+#define GPIO_PORT_W71_PWORD_Pos                               0                                                         /*!< GPIO_PORT W71: PWORD Position       */\r
+#define GPIO_PORT_W71_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W71_PWORD_Pos)                 /*!< GPIO_PORT W71: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W72  -----------------------------------------\r
+#define GPIO_PORT_W72_PWORD_Pos                               0                                                         /*!< GPIO_PORT W72: PWORD Position       */\r
+#define GPIO_PORT_W72_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W72_PWORD_Pos)                 /*!< GPIO_PORT W72: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W73  -----------------------------------------\r
+#define GPIO_PORT_W73_PWORD_Pos                               0                                                         /*!< GPIO_PORT W73: PWORD Position       */\r
+#define GPIO_PORT_W73_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W73_PWORD_Pos)                 /*!< GPIO_PORT W73: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W74  -----------------------------------------\r
+#define GPIO_PORT_W74_PWORD_Pos                               0                                                         /*!< GPIO_PORT W74: PWORD Position       */\r
+#define GPIO_PORT_W74_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W74_PWORD_Pos)                 /*!< GPIO_PORT W74: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W75  -----------------------------------------\r
+#define GPIO_PORT_W75_PWORD_Pos                               0                                                         /*!< GPIO_PORT W75: PWORD Position       */\r
+#define GPIO_PORT_W75_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W75_PWORD_Pos)                 /*!< GPIO_PORT W75: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W76  -----------------------------------------\r
+#define GPIO_PORT_W76_PWORD_Pos                               0                                                         /*!< GPIO_PORT W76: PWORD Position       */\r
+#define GPIO_PORT_W76_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W76_PWORD_Pos)                 /*!< GPIO_PORT W76: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W77  -----------------------------------------\r
+#define GPIO_PORT_W77_PWORD_Pos                               0                                                         /*!< GPIO_PORT W77: PWORD Position       */\r
+#define GPIO_PORT_W77_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W77_PWORD_Pos)                 /*!< GPIO_PORT W77: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W78  -----------------------------------------\r
+#define GPIO_PORT_W78_PWORD_Pos                               0                                                         /*!< GPIO_PORT W78: PWORD Position       */\r
+#define GPIO_PORT_W78_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W78_PWORD_Pos)                 /*!< GPIO_PORT W78: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W79  -----------------------------------------\r
+#define GPIO_PORT_W79_PWORD_Pos                               0                                                         /*!< GPIO_PORT W79: PWORD Position       */\r
+#define GPIO_PORT_W79_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W79_PWORD_Pos)                 /*!< GPIO_PORT W79: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W80  -----------------------------------------\r
+#define GPIO_PORT_W80_PWORD_Pos                               0                                                         /*!< GPIO_PORT W80: PWORD Position       */\r
+#define GPIO_PORT_W80_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W80_PWORD_Pos)                 /*!< GPIO_PORT W80: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W81  -----------------------------------------\r
+#define GPIO_PORT_W81_PWORD_Pos                               0                                                         /*!< GPIO_PORT W81: PWORD Position       */\r
+#define GPIO_PORT_W81_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W81_PWORD_Pos)                 /*!< GPIO_PORT W81: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W82  -----------------------------------------\r
+#define GPIO_PORT_W82_PWORD_Pos                               0                                                         /*!< GPIO_PORT W82: PWORD Position       */\r
+#define GPIO_PORT_W82_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W82_PWORD_Pos)                 /*!< GPIO_PORT W82: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W83  -----------------------------------------\r
+#define GPIO_PORT_W83_PWORD_Pos                               0                                                         /*!< GPIO_PORT W83: PWORD Position       */\r
+#define GPIO_PORT_W83_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W83_PWORD_Pos)                 /*!< GPIO_PORT W83: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W84  -----------------------------------------\r
+#define GPIO_PORT_W84_PWORD_Pos                               0                                                         /*!< GPIO_PORT W84: PWORD Position       */\r
+#define GPIO_PORT_W84_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W84_PWORD_Pos)                 /*!< GPIO_PORT W84: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W85  -----------------------------------------\r
+#define GPIO_PORT_W85_PWORD_Pos                               0                                                         /*!< GPIO_PORT W85: PWORD Position       */\r
+#define GPIO_PORT_W85_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W85_PWORD_Pos)                 /*!< GPIO_PORT W85: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W86  -----------------------------------------\r
+#define GPIO_PORT_W86_PWORD_Pos                               0                                                         /*!< GPIO_PORT W86: PWORD Position       */\r
+#define GPIO_PORT_W86_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W86_PWORD_Pos)                 /*!< GPIO_PORT W86: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W87  -----------------------------------------\r
+#define GPIO_PORT_W87_PWORD_Pos                               0                                                         /*!< GPIO_PORT W87: PWORD Position       */\r
+#define GPIO_PORT_W87_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W87_PWORD_Pos)                 /*!< GPIO_PORT W87: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W88  -----------------------------------------\r
+#define GPIO_PORT_W88_PWORD_Pos                               0                                                         /*!< GPIO_PORT W88: PWORD Position       */\r
+#define GPIO_PORT_W88_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W88_PWORD_Pos)                 /*!< GPIO_PORT W88: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W89  -----------------------------------------\r
+#define GPIO_PORT_W89_PWORD_Pos                               0                                                         /*!< GPIO_PORT W89: PWORD Position       */\r
+#define GPIO_PORT_W89_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W89_PWORD_Pos)                 /*!< GPIO_PORT W89: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W90  -----------------------------------------\r
+#define GPIO_PORT_W90_PWORD_Pos                               0                                                         /*!< GPIO_PORT W90: PWORD Position       */\r
+#define GPIO_PORT_W90_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W90_PWORD_Pos)                 /*!< GPIO_PORT W90: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W91  -----------------------------------------\r
+#define GPIO_PORT_W91_PWORD_Pos                               0                                                         /*!< GPIO_PORT W91: PWORD Position       */\r
+#define GPIO_PORT_W91_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W91_PWORD_Pos)                 /*!< GPIO_PORT W91: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W92  -----------------------------------------\r
+#define GPIO_PORT_W92_PWORD_Pos                               0                                                         /*!< GPIO_PORT W92: PWORD Position       */\r
+#define GPIO_PORT_W92_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W92_PWORD_Pos)                 /*!< GPIO_PORT W92: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W93  -----------------------------------------\r
+#define GPIO_PORT_W93_PWORD_Pos                               0                                                         /*!< GPIO_PORT W93: PWORD Position       */\r
+#define GPIO_PORT_W93_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W93_PWORD_Pos)                 /*!< GPIO_PORT W93: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W94  -----------------------------------------\r
+#define GPIO_PORT_W94_PWORD_Pos                               0                                                         /*!< GPIO_PORT W94: PWORD Position       */\r
+#define GPIO_PORT_W94_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W94_PWORD_Pos)                 /*!< GPIO_PORT W94: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W95  -----------------------------------------\r
+#define GPIO_PORT_W95_PWORD_Pos                               0                                                         /*!< GPIO_PORT W95: PWORD Position       */\r
+#define GPIO_PORT_W95_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W95_PWORD_Pos)                 /*!< GPIO_PORT W95: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W96  -----------------------------------------\r
+#define GPIO_PORT_W96_PWORD_Pos                               0                                                         /*!< GPIO_PORT W96: PWORD Position       */\r
+#define GPIO_PORT_W96_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W96_PWORD_Pos)                 /*!< GPIO_PORT W96: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W97  -----------------------------------------\r
+#define GPIO_PORT_W97_PWORD_Pos                               0                                                         /*!< GPIO_PORT W97: PWORD Position       */\r
+#define GPIO_PORT_W97_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W97_PWORD_Pos)                 /*!< GPIO_PORT W97: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W98  -----------------------------------------\r
+#define GPIO_PORT_W98_PWORD_Pos                               0                                                         /*!< GPIO_PORT W98: PWORD Position       */\r
+#define GPIO_PORT_W98_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W98_PWORD_Pos)                 /*!< GPIO_PORT W98: PWORD Mask           */\r
+\r
+// --------------------------------------  GPIO_PORT_W99  -----------------------------------------\r
+#define GPIO_PORT_W99_PWORD_Pos                               0                                                         /*!< GPIO_PORT W99: PWORD Position       */\r
+#define GPIO_PORT_W99_PWORD_Msk                               (0xffffffffUL << GPIO_PORT_W99_PWORD_Pos)                 /*!< GPIO_PORT W99: PWORD Mask           */\r
+\r
+// -------------------------------------  GPIO_PORT_W100  -----------------------------------------\r
+#define GPIO_PORT_W100_PWORD_Pos                              0                                                         /*!< GPIO_PORT W100: PWORD Position      */\r
+#define GPIO_PORT_W100_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W100_PWORD_Pos)                /*!< GPIO_PORT W100: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W101  -----------------------------------------\r
+#define GPIO_PORT_W101_PWORD_Pos                              0                                                         /*!< GPIO_PORT W101: PWORD Position      */\r
+#define GPIO_PORT_W101_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W101_PWORD_Pos)                /*!< GPIO_PORT W101: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W102  -----------------------------------------\r
+#define GPIO_PORT_W102_PWORD_Pos                              0                                                         /*!< GPIO_PORT W102: PWORD Position      */\r
+#define GPIO_PORT_W102_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W102_PWORD_Pos)                /*!< GPIO_PORT W102: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W103  -----------------------------------------\r
+#define GPIO_PORT_W103_PWORD_Pos                              0                                                         /*!< GPIO_PORT W103: PWORD Position      */\r
+#define GPIO_PORT_W103_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W103_PWORD_Pos)                /*!< GPIO_PORT W103: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W104  -----------------------------------------\r
+#define GPIO_PORT_W104_PWORD_Pos                              0                                                         /*!< GPIO_PORT W104: PWORD Position      */\r
+#define GPIO_PORT_W104_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W104_PWORD_Pos)                /*!< GPIO_PORT W104: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W105  -----------------------------------------\r
+#define GPIO_PORT_W105_PWORD_Pos                              0                                                         /*!< GPIO_PORT W105: PWORD Position      */\r
+#define GPIO_PORT_W105_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W105_PWORD_Pos)                /*!< GPIO_PORT W105: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W106  -----------------------------------------\r
+#define GPIO_PORT_W106_PWORD_Pos                              0                                                         /*!< GPIO_PORT W106: PWORD Position      */\r
+#define GPIO_PORT_W106_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W106_PWORD_Pos)                /*!< GPIO_PORT W106: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W107  -----------------------------------------\r
+#define GPIO_PORT_W107_PWORD_Pos                              0                                                         /*!< GPIO_PORT W107: PWORD Position      */\r
+#define GPIO_PORT_W107_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W107_PWORD_Pos)                /*!< GPIO_PORT W107: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W108  -----------------------------------------\r
+#define GPIO_PORT_W108_PWORD_Pos                              0                                                         /*!< GPIO_PORT W108: PWORD Position      */\r
+#define GPIO_PORT_W108_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W108_PWORD_Pos)                /*!< GPIO_PORT W108: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W109  -----------------------------------------\r
+#define GPIO_PORT_W109_PWORD_Pos                              0                                                         /*!< GPIO_PORT W109: PWORD Position      */\r
+#define GPIO_PORT_W109_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W109_PWORD_Pos)                /*!< GPIO_PORT W109: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W110  -----------------------------------------\r
+#define GPIO_PORT_W110_PWORD_Pos                              0                                                         /*!< GPIO_PORT W110: PWORD Position      */\r
+#define GPIO_PORT_W110_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W110_PWORD_Pos)                /*!< GPIO_PORT W110: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W111  -----------------------------------------\r
+#define GPIO_PORT_W111_PWORD_Pos                              0                                                         /*!< GPIO_PORT W111: PWORD Position      */\r
+#define GPIO_PORT_W111_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W111_PWORD_Pos)                /*!< GPIO_PORT W111: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W112  -----------------------------------------\r
+#define GPIO_PORT_W112_PWORD_Pos                              0                                                         /*!< GPIO_PORT W112: PWORD Position      */\r
+#define GPIO_PORT_W112_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W112_PWORD_Pos)                /*!< GPIO_PORT W112: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W113  -----------------------------------------\r
+#define GPIO_PORT_W113_PWORD_Pos                              0                                                         /*!< GPIO_PORT W113: PWORD Position      */\r
+#define GPIO_PORT_W113_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W113_PWORD_Pos)                /*!< GPIO_PORT W113: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W114  -----------------------------------------\r
+#define GPIO_PORT_W114_PWORD_Pos                              0                                                         /*!< GPIO_PORT W114: PWORD Position      */\r
+#define GPIO_PORT_W114_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W114_PWORD_Pos)                /*!< GPIO_PORT W114: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W115  -----------------------------------------\r
+#define GPIO_PORT_W115_PWORD_Pos                              0                                                         /*!< GPIO_PORT W115: PWORD Position      */\r
+#define GPIO_PORT_W115_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W115_PWORD_Pos)                /*!< GPIO_PORT W115: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W116  -----------------------------------------\r
+#define GPIO_PORT_W116_PWORD_Pos                              0                                                         /*!< GPIO_PORT W116: PWORD Position      */\r
+#define GPIO_PORT_W116_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W116_PWORD_Pos)                /*!< GPIO_PORT W116: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W117  -----------------------------------------\r
+#define GPIO_PORT_W117_PWORD_Pos                              0                                                         /*!< GPIO_PORT W117: PWORD Position      */\r
+#define GPIO_PORT_W117_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W117_PWORD_Pos)                /*!< GPIO_PORT W117: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W118  -----------------------------------------\r
+#define GPIO_PORT_W118_PWORD_Pos                              0                                                         /*!< GPIO_PORT W118: PWORD Position      */\r
+#define GPIO_PORT_W118_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W118_PWORD_Pos)                /*!< GPIO_PORT W118: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W119  -----------------------------------------\r
+#define GPIO_PORT_W119_PWORD_Pos                              0                                                         /*!< GPIO_PORT W119: PWORD Position      */\r
+#define GPIO_PORT_W119_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W119_PWORD_Pos)                /*!< GPIO_PORT W119: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W120  -----------------------------------------\r
+#define GPIO_PORT_W120_PWORD_Pos                              0                                                         /*!< GPIO_PORT W120: PWORD Position      */\r
+#define GPIO_PORT_W120_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W120_PWORD_Pos)                /*!< GPIO_PORT W120: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W121  -----------------------------------------\r
+#define GPIO_PORT_W121_PWORD_Pos                              0                                                         /*!< GPIO_PORT W121: PWORD Position      */\r
+#define GPIO_PORT_W121_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W121_PWORD_Pos)                /*!< GPIO_PORT W121: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W122  -----------------------------------------\r
+#define GPIO_PORT_W122_PWORD_Pos                              0                                                         /*!< GPIO_PORT W122: PWORD Position      */\r
+#define GPIO_PORT_W122_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W122_PWORD_Pos)                /*!< GPIO_PORT W122: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W123  -----------------------------------------\r
+#define GPIO_PORT_W123_PWORD_Pos                              0                                                         /*!< GPIO_PORT W123: PWORD Position      */\r
+#define GPIO_PORT_W123_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W123_PWORD_Pos)                /*!< GPIO_PORT W123: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W124  -----------------------------------------\r
+#define GPIO_PORT_W124_PWORD_Pos                              0                                                         /*!< GPIO_PORT W124: PWORD Position      */\r
+#define GPIO_PORT_W124_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W124_PWORD_Pos)                /*!< GPIO_PORT W124: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W125  -----------------------------------------\r
+#define GPIO_PORT_W125_PWORD_Pos                              0                                                         /*!< GPIO_PORT W125: PWORD Position      */\r
+#define GPIO_PORT_W125_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W125_PWORD_Pos)                /*!< GPIO_PORT W125: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W126  -----------------------------------------\r
+#define GPIO_PORT_W126_PWORD_Pos                              0                                                         /*!< GPIO_PORT W126: PWORD Position      */\r
+#define GPIO_PORT_W126_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W126_PWORD_Pos)                /*!< GPIO_PORT W126: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W127  -----------------------------------------\r
+#define GPIO_PORT_W127_PWORD_Pos                              0                                                         /*!< GPIO_PORT W127: PWORD Position      */\r
+#define GPIO_PORT_W127_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W127_PWORD_Pos)                /*!< GPIO_PORT W127: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W128  -----------------------------------------\r
+#define GPIO_PORT_W128_PWORD_Pos                              0                                                         /*!< GPIO_PORT W128: PWORD Position      */\r
+#define GPIO_PORT_W128_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W128_PWORD_Pos)                /*!< GPIO_PORT W128: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W129  -----------------------------------------\r
+#define GPIO_PORT_W129_PWORD_Pos                              0                                                         /*!< GPIO_PORT W129: PWORD Position      */\r
+#define GPIO_PORT_W129_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W129_PWORD_Pos)                /*!< GPIO_PORT W129: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W130  -----------------------------------------\r
+#define GPIO_PORT_W130_PWORD_Pos                              0                                                         /*!< GPIO_PORT W130: PWORD Position      */\r
+#define GPIO_PORT_W130_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W130_PWORD_Pos)                /*!< GPIO_PORT W130: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W131  -----------------------------------------\r
+#define GPIO_PORT_W131_PWORD_Pos                              0                                                         /*!< GPIO_PORT W131: PWORD Position      */\r
+#define GPIO_PORT_W131_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W131_PWORD_Pos)                /*!< GPIO_PORT W131: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W132  -----------------------------------------\r
+#define GPIO_PORT_W132_PWORD_Pos                              0                                                         /*!< GPIO_PORT W132: PWORD Position      */\r
+#define GPIO_PORT_W132_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W132_PWORD_Pos)                /*!< GPIO_PORT W132: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W133  -----------------------------------------\r
+#define GPIO_PORT_W133_PWORD_Pos                              0                                                         /*!< GPIO_PORT W133: PWORD Position      */\r
+#define GPIO_PORT_W133_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W133_PWORD_Pos)                /*!< GPIO_PORT W133: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W134  -----------------------------------------\r
+#define GPIO_PORT_W134_PWORD_Pos                              0                                                         /*!< GPIO_PORT W134: PWORD Position      */\r
+#define GPIO_PORT_W134_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W134_PWORD_Pos)                /*!< GPIO_PORT W134: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W135  -----------------------------------------\r
+#define GPIO_PORT_W135_PWORD_Pos                              0                                                         /*!< GPIO_PORT W135: PWORD Position      */\r
+#define GPIO_PORT_W135_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W135_PWORD_Pos)                /*!< GPIO_PORT W135: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W136  -----------------------------------------\r
+#define GPIO_PORT_W136_PWORD_Pos                              0                                                         /*!< GPIO_PORT W136: PWORD Position      */\r
+#define GPIO_PORT_W136_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W136_PWORD_Pos)                /*!< GPIO_PORT W136: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W137  -----------------------------------------\r
+#define GPIO_PORT_W137_PWORD_Pos                              0                                                         /*!< GPIO_PORT W137: PWORD Position      */\r
+#define GPIO_PORT_W137_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W137_PWORD_Pos)                /*!< GPIO_PORT W137: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W138  -----------------------------------------\r
+#define GPIO_PORT_W138_PWORD_Pos                              0                                                         /*!< GPIO_PORT W138: PWORD Position      */\r
+#define GPIO_PORT_W138_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W138_PWORD_Pos)                /*!< GPIO_PORT W138: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W139  -----------------------------------------\r
+#define GPIO_PORT_W139_PWORD_Pos                              0                                                         /*!< GPIO_PORT W139: PWORD Position      */\r
+#define GPIO_PORT_W139_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W139_PWORD_Pos)                /*!< GPIO_PORT W139: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W140  -----------------------------------------\r
+#define GPIO_PORT_W140_PWORD_Pos                              0                                                         /*!< GPIO_PORT W140: PWORD Position      */\r
+#define GPIO_PORT_W140_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W140_PWORD_Pos)                /*!< GPIO_PORT W140: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W141  -----------------------------------------\r
+#define GPIO_PORT_W141_PWORD_Pos                              0                                                         /*!< GPIO_PORT W141: PWORD Position      */\r
+#define GPIO_PORT_W141_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W141_PWORD_Pos)                /*!< GPIO_PORT W141: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W142  -----------------------------------------\r
+#define GPIO_PORT_W142_PWORD_Pos                              0                                                         /*!< GPIO_PORT W142: PWORD Position      */\r
+#define GPIO_PORT_W142_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W142_PWORD_Pos)                /*!< GPIO_PORT W142: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W143  -----------------------------------------\r
+#define GPIO_PORT_W143_PWORD_Pos                              0                                                         /*!< GPIO_PORT W143: PWORD Position      */\r
+#define GPIO_PORT_W143_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W143_PWORD_Pos)                /*!< GPIO_PORT W143: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W144  -----------------------------------------\r
+#define GPIO_PORT_W144_PWORD_Pos                              0                                                         /*!< GPIO_PORT W144: PWORD Position      */\r
+#define GPIO_PORT_W144_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W144_PWORD_Pos)                /*!< GPIO_PORT W144: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W145  -----------------------------------------\r
+#define GPIO_PORT_W145_PWORD_Pos                              0                                                         /*!< GPIO_PORT W145: PWORD Position      */\r
+#define GPIO_PORT_W145_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W145_PWORD_Pos)                /*!< GPIO_PORT W145: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W146  -----------------------------------------\r
+#define GPIO_PORT_W146_PWORD_Pos                              0                                                         /*!< GPIO_PORT W146: PWORD Position      */\r
+#define GPIO_PORT_W146_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W146_PWORD_Pos)                /*!< GPIO_PORT W146: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W147  -----------------------------------------\r
+#define GPIO_PORT_W147_PWORD_Pos                              0                                                         /*!< GPIO_PORT W147: PWORD Position      */\r
+#define GPIO_PORT_W147_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W147_PWORD_Pos)                /*!< GPIO_PORT W147: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W148  -----------------------------------------\r
+#define GPIO_PORT_W148_PWORD_Pos                              0                                                         /*!< GPIO_PORT W148: PWORD Position      */\r
+#define GPIO_PORT_W148_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W148_PWORD_Pos)                /*!< GPIO_PORT W148: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W149  -----------------------------------------\r
+#define GPIO_PORT_W149_PWORD_Pos                              0                                                         /*!< GPIO_PORT W149: PWORD Position      */\r
+#define GPIO_PORT_W149_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W149_PWORD_Pos)                /*!< GPIO_PORT W149: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W150  -----------------------------------------\r
+#define GPIO_PORT_W150_PWORD_Pos                              0                                                         /*!< GPIO_PORT W150: PWORD Position      */\r
+#define GPIO_PORT_W150_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W150_PWORD_Pos)                /*!< GPIO_PORT W150: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W151  -----------------------------------------\r
+#define GPIO_PORT_W151_PWORD_Pos                              0                                                         /*!< GPIO_PORT W151: PWORD Position      */\r
+#define GPIO_PORT_W151_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W151_PWORD_Pos)                /*!< GPIO_PORT W151: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W152  -----------------------------------------\r
+#define GPIO_PORT_W152_PWORD_Pos                              0                                                         /*!< GPIO_PORT W152: PWORD Position      */\r
+#define GPIO_PORT_W152_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W152_PWORD_Pos)                /*!< GPIO_PORT W152: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W153  -----------------------------------------\r
+#define GPIO_PORT_W153_PWORD_Pos                              0                                                         /*!< GPIO_PORT W153: PWORD Position      */\r
+#define GPIO_PORT_W153_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W153_PWORD_Pos)                /*!< GPIO_PORT W153: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W154  -----------------------------------------\r
+#define GPIO_PORT_W154_PWORD_Pos                              0                                                         /*!< GPIO_PORT W154: PWORD Position      */\r
+#define GPIO_PORT_W154_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W154_PWORD_Pos)                /*!< GPIO_PORT W154: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W155  -----------------------------------------\r
+#define GPIO_PORT_W155_PWORD_Pos                              0                                                         /*!< GPIO_PORT W155: PWORD Position      */\r
+#define GPIO_PORT_W155_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W155_PWORD_Pos)                /*!< GPIO_PORT W155: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W156  -----------------------------------------\r
+#define GPIO_PORT_W156_PWORD_Pos                              0                                                         /*!< GPIO_PORT W156: PWORD Position      */\r
+#define GPIO_PORT_W156_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W156_PWORD_Pos)                /*!< GPIO_PORT W156: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W157  -----------------------------------------\r
+#define GPIO_PORT_W157_PWORD_Pos                              0                                                         /*!< GPIO_PORT W157: PWORD Position      */\r
+#define GPIO_PORT_W157_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W157_PWORD_Pos)                /*!< GPIO_PORT W157: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W158  -----------------------------------------\r
+#define GPIO_PORT_W158_PWORD_Pos                              0                                                         /*!< GPIO_PORT W158: PWORD Position      */\r
+#define GPIO_PORT_W158_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W158_PWORD_Pos)                /*!< GPIO_PORT W158: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W159  -----------------------------------------\r
+#define GPIO_PORT_W159_PWORD_Pos                              0                                                         /*!< GPIO_PORT W159: PWORD Position      */\r
+#define GPIO_PORT_W159_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W159_PWORD_Pos)                /*!< GPIO_PORT W159: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W160  -----------------------------------------\r
+#define GPIO_PORT_W160_PWORD_Pos                              0                                                         /*!< GPIO_PORT W160: PWORD Position      */\r
+#define GPIO_PORT_W160_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W160_PWORD_Pos)                /*!< GPIO_PORT W160: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W161  -----------------------------------------\r
+#define GPIO_PORT_W161_PWORD_Pos                              0                                                         /*!< GPIO_PORT W161: PWORD Position      */\r
+#define GPIO_PORT_W161_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W161_PWORD_Pos)                /*!< GPIO_PORT W161: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W162  -----------------------------------------\r
+#define GPIO_PORT_W162_PWORD_Pos                              0                                                         /*!< GPIO_PORT W162: PWORD Position      */\r
+#define GPIO_PORT_W162_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W162_PWORD_Pos)                /*!< GPIO_PORT W162: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W163  -----------------------------------------\r
+#define GPIO_PORT_W163_PWORD_Pos                              0                                                         /*!< GPIO_PORT W163: PWORD Position      */\r
+#define GPIO_PORT_W163_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W163_PWORD_Pos)                /*!< GPIO_PORT W163: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W164  -----------------------------------------\r
+#define GPIO_PORT_W164_PWORD_Pos                              0                                                         /*!< GPIO_PORT W164: PWORD Position      */\r
+#define GPIO_PORT_W164_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W164_PWORD_Pos)                /*!< GPIO_PORT W164: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W165  -----------------------------------------\r
+#define GPIO_PORT_W165_PWORD_Pos                              0                                                         /*!< GPIO_PORT W165: PWORD Position      */\r
+#define GPIO_PORT_W165_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W165_PWORD_Pos)                /*!< GPIO_PORT W165: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W166  -----------------------------------------\r
+#define GPIO_PORT_W166_PWORD_Pos                              0                                                         /*!< GPIO_PORT W166: PWORD Position      */\r
+#define GPIO_PORT_W166_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W166_PWORD_Pos)                /*!< GPIO_PORT W166: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W167  -----------------------------------------\r
+#define GPIO_PORT_W167_PWORD_Pos                              0                                                         /*!< GPIO_PORT W167: PWORD Position      */\r
+#define GPIO_PORT_W167_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W167_PWORD_Pos)                /*!< GPIO_PORT W167: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W168  -----------------------------------------\r
+#define GPIO_PORT_W168_PWORD_Pos                              0                                                         /*!< GPIO_PORT W168: PWORD Position      */\r
+#define GPIO_PORT_W168_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W168_PWORD_Pos)                /*!< GPIO_PORT W168: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W169  -----------------------------------------\r
+#define GPIO_PORT_W169_PWORD_Pos                              0                                                         /*!< GPIO_PORT W169: PWORD Position      */\r
+#define GPIO_PORT_W169_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W169_PWORD_Pos)                /*!< GPIO_PORT W169: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W170  -----------------------------------------\r
+#define GPIO_PORT_W170_PWORD_Pos                              0                                                         /*!< GPIO_PORT W170: PWORD Position      */\r
+#define GPIO_PORT_W170_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W170_PWORD_Pos)                /*!< GPIO_PORT W170: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W171  -----------------------------------------\r
+#define GPIO_PORT_W171_PWORD_Pos                              0                                                         /*!< GPIO_PORT W171: PWORD Position      */\r
+#define GPIO_PORT_W171_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W171_PWORD_Pos)                /*!< GPIO_PORT W171: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W172  -----------------------------------------\r
+#define GPIO_PORT_W172_PWORD_Pos                              0                                                         /*!< GPIO_PORT W172: PWORD Position      */\r
+#define GPIO_PORT_W172_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W172_PWORD_Pos)                /*!< GPIO_PORT W172: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W173  -----------------------------------------\r
+#define GPIO_PORT_W173_PWORD_Pos                              0                                                         /*!< GPIO_PORT W173: PWORD Position      */\r
+#define GPIO_PORT_W173_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W173_PWORD_Pos)                /*!< GPIO_PORT W173: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W174  -----------------------------------------\r
+#define GPIO_PORT_W174_PWORD_Pos                              0                                                         /*!< GPIO_PORT W174: PWORD Position      */\r
+#define GPIO_PORT_W174_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W174_PWORD_Pos)                /*!< GPIO_PORT W174: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W175  -----------------------------------------\r
+#define GPIO_PORT_W175_PWORD_Pos                              0                                                         /*!< GPIO_PORT W175: PWORD Position      */\r
+#define GPIO_PORT_W175_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W175_PWORD_Pos)                /*!< GPIO_PORT W175: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W176  -----------------------------------------\r
+#define GPIO_PORT_W176_PWORD_Pos                              0                                                         /*!< GPIO_PORT W176: PWORD Position      */\r
+#define GPIO_PORT_W176_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W176_PWORD_Pos)                /*!< GPIO_PORT W176: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W177  -----------------------------------------\r
+#define GPIO_PORT_W177_PWORD_Pos                              0                                                         /*!< GPIO_PORT W177: PWORD Position      */\r
+#define GPIO_PORT_W177_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W177_PWORD_Pos)                /*!< GPIO_PORT W177: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W178  -----------------------------------------\r
+#define GPIO_PORT_W178_PWORD_Pos                              0                                                         /*!< GPIO_PORT W178: PWORD Position      */\r
+#define GPIO_PORT_W178_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W178_PWORD_Pos)                /*!< GPIO_PORT W178: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W179  -----------------------------------------\r
+#define GPIO_PORT_W179_PWORD_Pos                              0                                                         /*!< GPIO_PORT W179: PWORD Position      */\r
+#define GPIO_PORT_W179_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W179_PWORD_Pos)                /*!< GPIO_PORT W179: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W180  -----------------------------------------\r
+#define GPIO_PORT_W180_PWORD_Pos                              0                                                         /*!< GPIO_PORT W180: PWORD Position      */\r
+#define GPIO_PORT_W180_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W180_PWORD_Pos)                /*!< GPIO_PORT W180: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W181  -----------------------------------------\r
+#define GPIO_PORT_W181_PWORD_Pos                              0                                                         /*!< GPIO_PORT W181: PWORD Position      */\r
+#define GPIO_PORT_W181_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W181_PWORD_Pos)                /*!< GPIO_PORT W181: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W182  -----------------------------------------\r
+#define GPIO_PORT_W182_PWORD_Pos                              0                                                         /*!< GPIO_PORT W182: PWORD Position      */\r
+#define GPIO_PORT_W182_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W182_PWORD_Pos)                /*!< GPIO_PORT W182: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W183  -----------------------------------------\r
+#define GPIO_PORT_W183_PWORD_Pos                              0                                                         /*!< GPIO_PORT W183: PWORD Position      */\r
+#define GPIO_PORT_W183_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W183_PWORD_Pos)                /*!< GPIO_PORT W183: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W184  -----------------------------------------\r
+#define GPIO_PORT_W184_PWORD_Pos                              0                                                         /*!< GPIO_PORT W184: PWORD Position      */\r
+#define GPIO_PORT_W184_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W184_PWORD_Pos)                /*!< GPIO_PORT W184: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W185  -----------------------------------------\r
+#define GPIO_PORT_W185_PWORD_Pos                              0                                                         /*!< GPIO_PORT W185: PWORD Position      */\r
+#define GPIO_PORT_W185_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W185_PWORD_Pos)                /*!< GPIO_PORT W185: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W186  -----------------------------------------\r
+#define GPIO_PORT_W186_PWORD_Pos                              0                                                         /*!< GPIO_PORT W186: PWORD Position      */\r
+#define GPIO_PORT_W186_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W186_PWORD_Pos)                /*!< GPIO_PORT W186: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W187  -----------------------------------------\r
+#define GPIO_PORT_W187_PWORD_Pos                              0                                                         /*!< GPIO_PORT W187: PWORD Position      */\r
+#define GPIO_PORT_W187_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W187_PWORD_Pos)                /*!< GPIO_PORT W187: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W188  -----------------------------------------\r
+#define GPIO_PORT_W188_PWORD_Pos                              0                                                         /*!< GPIO_PORT W188: PWORD Position      */\r
+#define GPIO_PORT_W188_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W188_PWORD_Pos)                /*!< GPIO_PORT W188: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W189  -----------------------------------------\r
+#define GPIO_PORT_W189_PWORD_Pos                              0                                                         /*!< GPIO_PORT W189: PWORD Position      */\r
+#define GPIO_PORT_W189_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W189_PWORD_Pos)                /*!< GPIO_PORT W189: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W190  -----------------------------------------\r
+#define GPIO_PORT_W190_PWORD_Pos                              0                                                         /*!< GPIO_PORT W190: PWORD Position      */\r
+#define GPIO_PORT_W190_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W190_PWORD_Pos)                /*!< GPIO_PORT W190: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W191  -----------------------------------------\r
+#define GPIO_PORT_W191_PWORD_Pos                              0                                                         /*!< GPIO_PORT W191: PWORD Position      */\r
+#define GPIO_PORT_W191_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W191_PWORD_Pos)                /*!< GPIO_PORT W191: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W192  -----------------------------------------\r
+#define GPIO_PORT_W192_PWORD_Pos                              0                                                         /*!< GPIO_PORT W192: PWORD Position      */\r
+#define GPIO_PORT_W192_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W192_PWORD_Pos)                /*!< GPIO_PORT W192: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W193  -----------------------------------------\r
+#define GPIO_PORT_W193_PWORD_Pos                              0                                                         /*!< GPIO_PORT W193: PWORD Position      */\r
+#define GPIO_PORT_W193_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W193_PWORD_Pos)                /*!< GPIO_PORT W193: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W194  -----------------------------------------\r
+#define GPIO_PORT_W194_PWORD_Pos                              0                                                         /*!< GPIO_PORT W194: PWORD Position      */\r
+#define GPIO_PORT_W194_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W194_PWORD_Pos)                /*!< GPIO_PORT W194: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W195  -----------------------------------------\r
+#define GPIO_PORT_W195_PWORD_Pos                              0                                                         /*!< GPIO_PORT W195: PWORD Position      */\r
+#define GPIO_PORT_W195_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W195_PWORD_Pos)                /*!< GPIO_PORT W195: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W196  -----------------------------------------\r
+#define GPIO_PORT_W196_PWORD_Pos                              0                                                         /*!< GPIO_PORT W196: PWORD Position      */\r
+#define GPIO_PORT_W196_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W196_PWORD_Pos)                /*!< GPIO_PORT W196: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W197  -----------------------------------------\r
+#define GPIO_PORT_W197_PWORD_Pos                              0                                                         /*!< GPIO_PORT W197: PWORD Position      */\r
+#define GPIO_PORT_W197_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W197_PWORD_Pos)                /*!< GPIO_PORT W197: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W198  -----------------------------------------\r
+#define GPIO_PORT_W198_PWORD_Pos                              0                                                         /*!< GPIO_PORT W198: PWORD Position      */\r
+#define GPIO_PORT_W198_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W198_PWORD_Pos)                /*!< GPIO_PORT W198: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W199  -----------------------------------------\r
+#define GPIO_PORT_W199_PWORD_Pos                              0                                                         /*!< GPIO_PORT W199: PWORD Position      */\r
+#define GPIO_PORT_W199_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W199_PWORD_Pos)                /*!< GPIO_PORT W199: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W200  -----------------------------------------\r
+#define GPIO_PORT_W200_PWORD_Pos                              0                                                         /*!< GPIO_PORT W200: PWORD Position      */\r
+#define GPIO_PORT_W200_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W200_PWORD_Pos)                /*!< GPIO_PORT W200: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W201  -----------------------------------------\r
+#define GPIO_PORT_W201_PWORD_Pos                              0                                                         /*!< GPIO_PORT W201: PWORD Position      */\r
+#define GPIO_PORT_W201_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W201_PWORD_Pos)                /*!< GPIO_PORT W201: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W202  -----------------------------------------\r
+#define GPIO_PORT_W202_PWORD_Pos                              0                                                         /*!< GPIO_PORT W202: PWORD Position      */\r
+#define GPIO_PORT_W202_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W202_PWORD_Pos)                /*!< GPIO_PORT W202: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W203  -----------------------------------------\r
+#define GPIO_PORT_W203_PWORD_Pos                              0                                                         /*!< GPIO_PORT W203: PWORD Position      */\r
+#define GPIO_PORT_W203_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W203_PWORD_Pos)                /*!< GPIO_PORT W203: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W204  -----------------------------------------\r
+#define GPIO_PORT_W204_PWORD_Pos                              0                                                         /*!< GPIO_PORT W204: PWORD Position      */\r
+#define GPIO_PORT_W204_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W204_PWORD_Pos)                /*!< GPIO_PORT W204: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W205  -----------------------------------------\r
+#define GPIO_PORT_W205_PWORD_Pos                              0                                                         /*!< GPIO_PORT W205: PWORD Position      */\r
+#define GPIO_PORT_W205_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W205_PWORD_Pos)                /*!< GPIO_PORT W205: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W206  -----------------------------------------\r
+#define GPIO_PORT_W206_PWORD_Pos                              0                                                         /*!< GPIO_PORT W206: PWORD Position      */\r
+#define GPIO_PORT_W206_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W206_PWORD_Pos)                /*!< GPIO_PORT W206: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W207  -----------------------------------------\r
+#define GPIO_PORT_W207_PWORD_Pos                              0                                                         /*!< GPIO_PORT W207: PWORD Position      */\r
+#define GPIO_PORT_W207_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W207_PWORD_Pos)                /*!< GPIO_PORT W207: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W208  -----------------------------------------\r
+#define GPIO_PORT_W208_PWORD_Pos                              0                                                         /*!< GPIO_PORT W208: PWORD Position      */\r
+#define GPIO_PORT_W208_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W208_PWORD_Pos)                /*!< GPIO_PORT W208: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W209  -----------------------------------------\r
+#define GPIO_PORT_W209_PWORD_Pos                              0                                                         /*!< GPIO_PORT W209: PWORD Position      */\r
+#define GPIO_PORT_W209_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W209_PWORD_Pos)                /*!< GPIO_PORT W209: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W210  -----------------------------------------\r
+#define GPIO_PORT_W210_PWORD_Pos                              0                                                         /*!< GPIO_PORT W210: PWORD Position      */\r
+#define GPIO_PORT_W210_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W210_PWORD_Pos)                /*!< GPIO_PORT W210: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W211  -----------------------------------------\r
+#define GPIO_PORT_W211_PWORD_Pos                              0                                                         /*!< GPIO_PORT W211: PWORD Position      */\r
+#define GPIO_PORT_W211_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W211_PWORD_Pos)                /*!< GPIO_PORT W211: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W212  -----------------------------------------\r
+#define GPIO_PORT_W212_PWORD_Pos                              0                                                         /*!< GPIO_PORT W212: PWORD Position      */\r
+#define GPIO_PORT_W212_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W212_PWORD_Pos)                /*!< GPIO_PORT W212: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W213  -----------------------------------------\r
+#define GPIO_PORT_W213_PWORD_Pos                              0                                                         /*!< GPIO_PORT W213: PWORD Position      */\r
+#define GPIO_PORT_W213_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W213_PWORD_Pos)                /*!< GPIO_PORT W213: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W214  -----------------------------------------\r
+#define GPIO_PORT_W214_PWORD_Pos                              0                                                         /*!< GPIO_PORT W214: PWORD Position      */\r
+#define GPIO_PORT_W214_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W214_PWORD_Pos)                /*!< GPIO_PORT W214: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W215  -----------------------------------------\r
+#define GPIO_PORT_W215_PWORD_Pos                              0                                                         /*!< GPIO_PORT W215: PWORD Position      */\r
+#define GPIO_PORT_W215_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W215_PWORD_Pos)                /*!< GPIO_PORT W215: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W216  -----------------------------------------\r
+#define GPIO_PORT_W216_PWORD_Pos                              0                                                         /*!< GPIO_PORT W216: PWORD Position      */\r
+#define GPIO_PORT_W216_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W216_PWORD_Pos)                /*!< GPIO_PORT W216: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W217  -----------------------------------------\r
+#define GPIO_PORT_W217_PWORD_Pos                              0                                                         /*!< GPIO_PORT W217: PWORD Position      */\r
+#define GPIO_PORT_W217_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W217_PWORD_Pos)                /*!< GPIO_PORT W217: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W218  -----------------------------------------\r
+#define GPIO_PORT_W218_PWORD_Pos                              0                                                         /*!< GPIO_PORT W218: PWORD Position      */\r
+#define GPIO_PORT_W218_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W218_PWORD_Pos)                /*!< GPIO_PORT W218: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W219  -----------------------------------------\r
+#define GPIO_PORT_W219_PWORD_Pos                              0                                                         /*!< GPIO_PORT W219: PWORD Position      */\r
+#define GPIO_PORT_W219_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W219_PWORD_Pos)                /*!< GPIO_PORT W219: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W220  -----------------------------------------\r
+#define GPIO_PORT_W220_PWORD_Pos                              0                                                         /*!< GPIO_PORT W220: PWORD Position      */\r
+#define GPIO_PORT_W220_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W220_PWORD_Pos)                /*!< GPIO_PORT W220: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W221  -----------------------------------------\r
+#define GPIO_PORT_W221_PWORD_Pos                              0                                                         /*!< GPIO_PORT W221: PWORD Position      */\r
+#define GPIO_PORT_W221_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W221_PWORD_Pos)                /*!< GPIO_PORT W221: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W222  -----------------------------------------\r
+#define GPIO_PORT_W222_PWORD_Pos                              0                                                         /*!< GPIO_PORT W222: PWORD Position      */\r
+#define GPIO_PORT_W222_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W222_PWORD_Pos)                /*!< GPIO_PORT W222: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W223  -----------------------------------------\r
+#define GPIO_PORT_W223_PWORD_Pos                              0                                                         /*!< GPIO_PORT W223: PWORD Position      */\r
+#define GPIO_PORT_W223_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W223_PWORD_Pos)                /*!< GPIO_PORT W223: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W224  -----------------------------------------\r
+#define GPIO_PORT_W224_PWORD_Pos                              0                                                         /*!< GPIO_PORT W224: PWORD Position      */\r
+#define GPIO_PORT_W224_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W224_PWORD_Pos)                /*!< GPIO_PORT W224: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W225  -----------------------------------------\r
+#define GPIO_PORT_W225_PWORD_Pos                              0                                                         /*!< GPIO_PORT W225: PWORD Position      */\r
+#define GPIO_PORT_W225_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W225_PWORD_Pos)                /*!< GPIO_PORT W225: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W226  -----------------------------------------\r
+#define GPIO_PORT_W226_PWORD_Pos                              0                                                         /*!< GPIO_PORT W226: PWORD Position      */\r
+#define GPIO_PORT_W226_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W226_PWORD_Pos)                /*!< GPIO_PORT W226: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W227  -----------------------------------------\r
+#define GPIO_PORT_W227_PWORD_Pos                              0                                                         /*!< GPIO_PORT W227: PWORD Position      */\r
+#define GPIO_PORT_W227_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W227_PWORD_Pos)                /*!< GPIO_PORT W227: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W228  -----------------------------------------\r
+#define GPIO_PORT_W228_PWORD_Pos                              0                                                         /*!< GPIO_PORT W228: PWORD Position      */\r
+#define GPIO_PORT_W228_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W228_PWORD_Pos)                /*!< GPIO_PORT W228: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W229  -----------------------------------------\r
+#define GPIO_PORT_W229_PWORD_Pos                              0                                                         /*!< GPIO_PORT W229: PWORD Position      */\r
+#define GPIO_PORT_W229_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W229_PWORD_Pos)                /*!< GPIO_PORT W229: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W230  -----------------------------------------\r
+#define GPIO_PORT_W230_PWORD_Pos                              0                                                         /*!< GPIO_PORT W230: PWORD Position      */\r
+#define GPIO_PORT_W230_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W230_PWORD_Pos)                /*!< GPIO_PORT W230: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W231  -----------------------------------------\r
+#define GPIO_PORT_W231_PWORD_Pos                              0                                                         /*!< GPIO_PORT W231: PWORD Position      */\r
+#define GPIO_PORT_W231_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W231_PWORD_Pos)                /*!< GPIO_PORT W231: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W232  -----------------------------------------\r
+#define GPIO_PORT_W232_PWORD_Pos                              0                                                         /*!< GPIO_PORT W232: PWORD Position      */\r
+#define GPIO_PORT_W232_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W232_PWORD_Pos)                /*!< GPIO_PORT W232: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W233  -----------------------------------------\r
+#define GPIO_PORT_W233_PWORD_Pos                              0                                                         /*!< GPIO_PORT W233: PWORD Position      */\r
+#define GPIO_PORT_W233_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W233_PWORD_Pos)                /*!< GPIO_PORT W233: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W234  -----------------------------------------\r
+#define GPIO_PORT_W234_PWORD_Pos                              0                                                         /*!< GPIO_PORT W234: PWORD Position      */\r
+#define GPIO_PORT_W234_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W234_PWORD_Pos)                /*!< GPIO_PORT W234: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W235  -----------------------------------------\r
+#define GPIO_PORT_W235_PWORD_Pos                              0                                                         /*!< GPIO_PORT W235: PWORD Position      */\r
+#define GPIO_PORT_W235_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W235_PWORD_Pos)                /*!< GPIO_PORT W235: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W236  -----------------------------------------\r
+#define GPIO_PORT_W236_PWORD_Pos                              0                                                         /*!< GPIO_PORT W236: PWORD Position      */\r
+#define GPIO_PORT_W236_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W236_PWORD_Pos)                /*!< GPIO_PORT W236: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W237  -----------------------------------------\r
+#define GPIO_PORT_W237_PWORD_Pos                              0                                                         /*!< GPIO_PORT W237: PWORD Position      */\r
+#define GPIO_PORT_W237_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W237_PWORD_Pos)                /*!< GPIO_PORT W237: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W238  -----------------------------------------\r
+#define GPIO_PORT_W238_PWORD_Pos                              0                                                         /*!< GPIO_PORT W238: PWORD Position      */\r
+#define GPIO_PORT_W238_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W238_PWORD_Pos)                /*!< GPIO_PORT W238: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W239  -----------------------------------------\r
+#define GPIO_PORT_W239_PWORD_Pos                              0                                                         /*!< GPIO_PORT W239: PWORD Position      */\r
+#define GPIO_PORT_W239_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W239_PWORD_Pos)                /*!< GPIO_PORT W239: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W240  -----------------------------------------\r
+#define GPIO_PORT_W240_PWORD_Pos                              0                                                         /*!< GPIO_PORT W240: PWORD Position      */\r
+#define GPIO_PORT_W240_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W240_PWORD_Pos)                /*!< GPIO_PORT W240: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W241  -----------------------------------------\r
+#define GPIO_PORT_W241_PWORD_Pos                              0                                                         /*!< GPIO_PORT W241: PWORD Position      */\r
+#define GPIO_PORT_W241_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W241_PWORD_Pos)                /*!< GPIO_PORT W241: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W242  -----------------------------------------\r
+#define GPIO_PORT_W242_PWORD_Pos                              0                                                         /*!< GPIO_PORT W242: PWORD Position      */\r
+#define GPIO_PORT_W242_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W242_PWORD_Pos)                /*!< GPIO_PORT W242: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W243  -----------------------------------------\r
+#define GPIO_PORT_W243_PWORD_Pos                              0                                                         /*!< GPIO_PORT W243: PWORD Position      */\r
+#define GPIO_PORT_W243_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W243_PWORD_Pos)                /*!< GPIO_PORT W243: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W244  -----------------------------------------\r
+#define GPIO_PORT_W244_PWORD_Pos                              0                                                         /*!< GPIO_PORT W244: PWORD Position      */\r
+#define GPIO_PORT_W244_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W244_PWORD_Pos)                /*!< GPIO_PORT W244: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W245  -----------------------------------------\r
+#define GPIO_PORT_W245_PWORD_Pos                              0                                                         /*!< GPIO_PORT W245: PWORD Position      */\r
+#define GPIO_PORT_W245_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W245_PWORD_Pos)                /*!< GPIO_PORT W245: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W246  -----------------------------------------\r
+#define GPIO_PORT_W246_PWORD_Pos                              0                                                         /*!< GPIO_PORT W246: PWORD Position      */\r
+#define GPIO_PORT_W246_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W246_PWORD_Pos)                /*!< GPIO_PORT W246: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W247  -----------------------------------------\r
+#define GPIO_PORT_W247_PWORD_Pos                              0                                                         /*!< GPIO_PORT W247: PWORD Position      */\r
+#define GPIO_PORT_W247_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W247_PWORD_Pos)                /*!< GPIO_PORT W247: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W248  -----------------------------------------\r
+#define GPIO_PORT_W248_PWORD_Pos                              0                                                         /*!< GPIO_PORT W248: PWORD Position      */\r
+#define GPIO_PORT_W248_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W248_PWORD_Pos)                /*!< GPIO_PORT W248: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W249  -----------------------------------------\r
+#define GPIO_PORT_W249_PWORD_Pos                              0                                                         /*!< GPIO_PORT W249: PWORD Position      */\r
+#define GPIO_PORT_W249_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W249_PWORD_Pos)                /*!< GPIO_PORT W249: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W250  -----------------------------------------\r
+#define GPIO_PORT_W250_PWORD_Pos                              0                                                         /*!< GPIO_PORT W250: PWORD Position      */\r
+#define GPIO_PORT_W250_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W250_PWORD_Pos)                /*!< GPIO_PORT W250: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W251  -----------------------------------------\r
+#define GPIO_PORT_W251_PWORD_Pos                              0                                                         /*!< GPIO_PORT W251: PWORD Position      */\r
+#define GPIO_PORT_W251_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W251_PWORD_Pos)                /*!< GPIO_PORT W251: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W252  -----------------------------------------\r
+#define GPIO_PORT_W252_PWORD_Pos                              0                                                         /*!< GPIO_PORT W252: PWORD Position      */\r
+#define GPIO_PORT_W252_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W252_PWORD_Pos)                /*!< GPIO_PORT W252: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W253  -----------------------------------------\r
+#define GPIO_PORT_W253_PWORD_Pos                              0                                                         /*!< GPIO_PORT W253: PWORD Position      */\r
+#define GPIO_PORT_W253_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W253_PWORD_Pos)                /*!< GPIO_PORT W253: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W254  -----------------------------------------\r
+#define GPIO_PORT_W254_PWORD_Pos                              0                                                         /*!< GPIO_PORT W254: PWORD Position      */\r
+#define GPIO_PORT_W254_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W254_PWORD_Pos)                /*!< GPIO_PORT W254: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_W255  -----------------------------------------\r
+#define GPIO_PORT_W255_PWORD_Pos                              0                                                         /*!< GPIO_PORT W255: PWORD Position      */\r
+#define GPIO_PORT_W255_PWORD_Msk                              (0xffffffffUL << GPIO_PORT_W255_PWORD_Pos)                /*!< GPIO_PORT W255: PWORD Mask          */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR0  -----------------------------------------\r
+#define GPIO_PORT_DIR0_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR0: DIRP0 Position      */\r
+#define GPIO_PORT_DIR0_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP0_Pos)                      /*!< GPIO_PORT DIR0: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR0: DIRP1 Position      */\r
+#define GPIO_PORT_DIR0_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP1_Pos)                      /*!< GPIO_PORT DIR0: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR0: DIRP2 Position      */\r
+#define GPIO_PORT_DIR0_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP2_Pos)                      /*!< GPIO_PORT DIR0: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR0: DIRP3 Position      */\r
+#define GPIO_PORT_DIR0_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP3_Pos)                      /*!< GPIO_PORT DIR0: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR0: DIRP4 Position      */\r
+#define GPIO_PORT_DIR0_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP4_Pos)                      /*!< GPIO_PORT DIR0: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR0: DIRP5 Position      */\r
+#define GPIO_PORT_DIR0_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP5_Pos)                      /*!< GPIO_PORT DIR0: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR0: DIRP6 Position      */\r
+#define GPIO_PORT_DIR0_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP6_Pos)                      /*!< GPIO_PORT DIR0: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR0: DIRP7 Position      */\r
+#define GPIO_PORT_DIR0_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP7_Pos)                      /*!< GPIO_PORT DIR0: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR0: DIRP8 Position      */\r
+#define GPIO_PORT_DIR0_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP8_Pos)                      /*!< GPIO_PORT DIR0: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR0: DIRP9 Position      */\r
+#define GPIO_PORT_DIR0_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR0_DIRP9_Pos)                      /*!< GPIO_PORT DIR0: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR0_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR0: DIRP10 Position     */\r
+#define GPIO_PORT_DIR0_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP10_Pos)                     /*!< GPIO_PORT DIR0: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR0: DIRP11 Position     */\r
+#define GPIO_PORT_DIR0_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP11_Pos)                     /*!< GPIO_PORT DIR0: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR0: DIRP12 Position     */\r
+#define GPIO_PORT_DIR0_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP12_Pos)                     /*!< GPIO_PORT DIR0: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR0: DIRP13 Position     */\r
+#define GPIO_PORT_DIR0_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP13_Pos)                     /*!< GPIO_PORT DIR0: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR0: DIRP14 Position     */\r
+#define GPIO_PORT_DIR0_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP14_Pos)                     /*!< GPIO_PORT DIR0: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR0: DIRP15 Position     */\r
+#define GPIO_PORT_DIR0_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP15_Pos)                     /*!< GPIO_PORT DIR0: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR0: DIRP16 Position     */\r
+#define GPIO_PORT_DIR0_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP16_Pos)                     /*!< GPIO_PORT DIR0: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR0: DIRP17 Position     */\r
+#define GPIO_PORT_DIR0_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP17_Pos)                     /*!< GPIO_PORT DIR0: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR0: DIRP18 Position     */\r
+#define GPIO_PORT_DIR0_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP18_Pos)                     /*!< GPIO_PORT DIR0: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR0: DIRP19 Position     */\r
+#define GPIO_PORT_DIR0_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP19_Pos)                     /*!< GPIO_PORT DIR0: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR0: DIRP20 Position     */\r
+#define GPIO_PORT_DIR0_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP20_Pos)                     /*!< GPIO_PORT DIR0: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR0: DIRP21 Position     */\r
+#define GPIO_PORT_DIR0_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP21_Pos)                     /*!< GPIO_PORT DIR0: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR0: DIRP22 Position     */\r
+#define GPIO_PORT_DIR0_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP22_Pos)                     /*!< GPIO_PORT DIR0: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR0: DIRP23 Position     */\r
+#define GPIO_PORT_DIR0_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP23_Pos)                     /*!< GPIO_PORT DIR0: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR0: DIRP24 Position     */\r
+#define GPIO_PORT_DIR0_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP24_Pos)                     /*!< GPIO_PORT DIR0: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR0: DIRP25 Position     */\r
+#define GPIO_PORT_DIR0_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP25_Pos)                     /*!< GPIO_PORT DIR0: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR0: DIRP26 Position     */\r
+#define GPIO_PORT_DIR0_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP26_Pos)                     /*!< GPIO_PORT DIR0: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR0: DIRP27 Position     */\r
+#define GPIO_PORT_DIR0_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP27_Pos)                     /*!< GPIO_PORT DIR0: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR0: DIRP28 Position     */\r
+#define GPIO_PORT_DIR0_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP28_Pos)                     /*!< GPIO_PORT DIR0: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR0: DIRP29 Position     */\r
+#define GPIO_PORT_DIR0_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP29_Pos)                     /*!< GPIO_PORT DIR0: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR0: DIRP30 Position     */\r
+#define GPIO_PORT_DIR0_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP30_Pos)                     /*!< GPIO_PORT DIR0: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR0_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR0: DIRP31 Position     */\r
+#define GPIO_PORT_DIR0_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR0_DIRP31_Pos)                     /*!< GPIO_PORT DIR0: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR1  -----------------------------------------\r
+#define GPIO_PORT_DIR1_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR1: DIRP0 Position      */\r
+#define GPIO_PORT_DIR1_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP0_Pos)                      /*!< GPIO_PORT DIR1: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR1: DIRP1 Position      */\r
+#define GPIO_PORT_DIR1_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP1_Pos)                      /*!< GPIO_PORT DIR1: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR1: DIRP2 Position      */\r
+#define GPIO_PORT_DIR1_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP2_Pos)                      /*!< GPIO_PORT DIR1: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR1: DIRP3 Position      */\r
+#define GPIO_PORT_DIR1_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP3_Pos)                      /*!< GPIO_PORT DIR1: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR1: DIRP4 Position      */\r
+#define GPIO_PORT_DIR1_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP4_Pos)                      /*!< GPIO_PORT DIR1: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR1: DIRP5 Position      */\r
+#define GPIO_PORT_DIR1_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP5_Pos)                      /*!< GPIO_PORT DIR1: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR1: DIRP6 Position      */\r
+#define GPIO_PORT_DIR1_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP6_Pos)                      /*!< GPIO_PORT DIR1: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR1: DIRP7 Position      */\r
+#define GPIO_PORT_DIR1_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP7_Pos)                      /*!< GPIO_PORT DIR1: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR1: DIRP8 Position      */\r
+#define GPIO_PORT_DIR1_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP8_Pos)                      /*!< GPIO_PORT DIR1: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR1: DIRP9 Position      */\r
+#define GPIO_PORT_DIR1_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR1_DIRP9_Pos)                      /*!< GPIO_PORT DIR1: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR1_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR1: DIRP10 Position     */\r
+#define GPIO_PORT_DIR1_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP10_Pos)                     /*!< GPIO_PORT DIR1: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR1: DIRP11 Position     */\r
+#define GPIO_PORT_DIR1_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP11_Pos)                     /*!< GPIO_PORT DIR1: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR1: DIRP12 Position     */\r
+#define GPIO_PORT_DIR1_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP12_Pos)                     /*!< GPIO_PORT DIR1: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR1: DIRP13 Position     */\r
+#define GPIO_PORT_DIR1_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP13_Pos)                     /*!< GPIO_PORT DIR1: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR1: DIRP14 Position     */\r
+#define GPIO_PORT_DIR1_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP14_Pos)                     /*!< GPIO_PORT DIR1: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR1: DIRP15 Position     */\r
+#define GPIO_PORT_DIR1_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP15_Pos)                     /*!< GPIO_PORT DIR1: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR1: DIRP16 Position     */\r
+#define GPIO_PORT_DIR1_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP16_Pos)                     /*!< GPIO_PORT DIR1: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR1: DIRP17 Position     */\r
+#define GPIO_PORT_DIR1_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP17_Pos)                     /*!< GPIO_PORT DIR1: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR1: DIRP18 Position     */\r
+#define GPIO_PORT_DIR1_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP18_Pos)                     /*!< GPIO_PORT DIR1: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR1: DIRP19 Position     */\r
+#define GPIO_PORT_DIR1_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP19_Pos)                     /*!< GPIO_PORT DIR1: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR1: DIRP20 Position     */\r
+#define GPIO_PORT_DIR1_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP20_Pos)                     /*!< GPIO_PORT DIR1: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR1: DIRP21 Position     */\r
+#define GPIO_PORT_DIR1_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP21_Pos)                     /*!< GPIO_PORT DIR1: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR1: DIRP22 Position     */\r
+#define GPIO_PORT_DIR1_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP22_Pos)                     /*!< GPIO_PORT DIR1: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR1: DIRP23 Position     */\r
+#define GPIO_PORT_DIR1_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP23_Pos)                     /*!< GPIO_PORT DIR1: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR1: DIRP24 Position     */\r
+#define GPIO_PORT_DIR1_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP24_Pos)                     /*!< GPIO_PORT DIR1: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR1: DIRP25 Position     */\r
+#define GPIO_PORT_DIR1_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP25_Pos)                     /*!< GPIO_PORT DIR1: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR1: DIRP26 Position     */\r
+#define GPIO_PORT_DIR1_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP26_Pos)                     /*!< GPIO_PORT DIR1: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR1: DIRP27 Position     */\r
+#define GPIO_PORT_DIR1_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP27_Pos)                     /*!< GPIO_PORT DIR1: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR1: DIRP28 Position     */\r
+#define GPIO_PORT_DIR1_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP28_Pos)                     /*!< GPIO_PORT DIR1: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR1: DIRP29 Position     */\r
+#define GPIO_PORT_DIR1_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP29_Pos)                     /*!< GPIO_PORT DIR1: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR1: DIRP30 Position     */\r
+#define GPIO_PORT_DIR1_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP30_Pos)                     /*!< GPIO_PORT DIR1: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR1_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR1: DIRP31 Position     */\r
+#define GPIO_PORT_DIR1_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR1_DIRP31_Pos)                     /*!< GPIO_PORT DIR1: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR2  -----------------------------------------\r
+#define GPIO_PORT_DIR2_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR2: DIRP0 Position      */\r
+#define GPIO_PORT_DIR2_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP0_Pos)                      /*!< GPIO_PORT DIR2: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR2: DIRP1 Position      */\r
+#define GPIO_PORT_DIR2_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP1_Pos)                      /*!< GPIO_PORT DIR2: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR2: DIRP2 Position      */\r
+#define GPIO_PORT_DIR2_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP2_Pos)                      /*!< GPIO_PORT DIR2: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR2: DIRP3 Position      */\r
+#define GPIO_PORT_DIR2_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP3_Pos)                      /*!< GPIO_PORT DIR2: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR2: DIRP4 Position      */\r
+#define GPIO_PORT_DIR2_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP4_Pos)                      /*!< GPIO_PORT DIR2: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR2: DIRP5 Position      */\r
+#define GPIO_PORT_DIR2_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP5_Pos)                      /*!< GPIO_PORT DIR2: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR2: DIRP6 Position      */\r
+#define GPIO_PORT_DIR2_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP6_Pos)                      /*!< GPIO_PORT DIR2: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR2: DIRP7 Position      */\r
+#define GPIO_PORT_DIR2_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP7_Pos)                      /*!< GPIO_PORT DIR2: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR2: DIRP8 Position      */\r
+#define GPIO_PORT_DIR2_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP8_Pos)                      /*!< GPIO_PORT DIR2: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR2: DIRP9 Position      */\r
+#define GPIO_PORT_DIR2_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR2_DIRP9_Pos)                      /*!< GPIO_PORT DIR2: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR2_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR2: DIRP10 Position     */\r
+#define GPIO_PORT_DIR2_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP10_Pos)                     /*!< GPIO_PORT DIR2: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR2: DIRP11 Position     */\r
+#define GPIO_PORT_DIR2_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP11_Pos)                     /*!< GPIO_PORT DIR2: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR2: DIRP12 Position     */\r
+#define GPIO_PORT_DIR2_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP12_Pos)                     /*!< GPIO_PORT DIR2: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR2: DIRP13 Position     */\r
+#define GPIO_PORT_DIR2_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP13_Pos)                     /*!< GPIO_PORT DIR2: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR2: DIRP14 Position     */\r
+#define GPIO_PORT_DIR2_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP14_Pos)                     /*!< GPIO_PORT DIR2: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR2: DIRP15 Position     */\r
+#define GPIO_PORT_DIR2_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP15_Pos)                     /*!< GPIO_PORT DIR2: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR2: DIRP16 Position     */\r
+#define GPIO_PORT_DIR2_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP16_Pos)                     /*!< GPIO_PORT DIR2: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR2: DIRP17 Position     */\r
+#define GPIO_PORT_DIR2_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP17_Pos)                     /*!< GPIO_PORT DIR2: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR2: DIRP18 Position     */\r
+#define GPIO_PORT_DIR2_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP18_Pos)                     /*!< GPIO_PORT DIR2: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR2: DIRP19 Position     */\r
+#define GPIO_PORT_DIR2_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP19_Pos)                     /*!< GPIO_PORT DIR2: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR2: DIRP20 Position     */\r
+#define GPIO_PORT_DIR2_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP20_Pos)                     /*!< GPIO_PORT DIR2: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR2: DIRP21 Position     */\r
+#define GPIO_PORT_DIR2_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP21_Pos)                     /*!< GPIO_PORT DIR2: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR2: DIRP22 Position     */\r
+#define GPIO_PORT_DIR2_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP22_Pos)                     /*!< GPIO_PORT DIR2: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR2: DIRP23 Position     */\r
+#define GPIO_PORT_DIR2_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP23_Pos)                     /*!< GPIO_PORT DIR2: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR2: DIRP24 Position     */\r
+#define GPIO_PORT_DIR2_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP24_Pos)                     /*!< GPIO_PORT DIR2: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR2: DIRP25 Position     */\r
+#define GPIO_PORT_DIR2_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP25_Pos)                     /*!< GPIO_PORT DIR2: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR2: DIRP26 Position     */\r
+#define GPIO_PORT_DIR2_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP26_Pos)                     /*!< GPIO_PORT DIR2: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR2: DIRP27 Position     */\r
+#define GPIO_PORT_DIR2_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP27_Pos)                     /*!< GPIO_PORT DIR2: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR2: DIRP28 Position     */\r
+#define GPIO_PORT_DIR2_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP28_Pos)                     /*!< GPIO_PORT DIR2: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR2: DIRP29 Position     */\r
+#define GPIO_PORT_DIR2_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP29_Pos)                     /*!< GPIO_PORT DIR2: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR2: DIRP30 Position     */\r
+#define GPIO_PORT_DIR2_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP30_Pos)                     /*!< GPIO_PORT DIR2: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR2_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR2: DIRP31 Position     */\r
+#define GPIO_PORT_DIR2_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR2_DIRP31_Pos)                     /*!< GPIO_PORT DIR2: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR3  -----------------------------------------\r
+#define GPIO_PORT_DIR3_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR3: DIRP0 Position      */\r
+#define GPIO_PORT_DIR3_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP0_Pos)                      /*!< GPIO_PORT DIR3: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR3: DIRP1 Position      */\r
+#define GPIO_PORT_DIR3_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP1_Pos)                      /*!< GPIO_PORT DIR3: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR3: DIRP2 Position      */\r
+#define GPIO_PORT_DIR3_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP2_Pos)                      /*!< GPIO_PORT DIR3: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR3: DIRP3 Position      */\r
+#define GPIO_PORT_DIR3_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP3_Pos)                      /*!< GPIO_PORT DIR3: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR3: DIRP4 Position      */\r
+#define GPIO_PORT_DIR3_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP4_Pos)                      /*!< GPIO_PORT DIR3: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR3: DIRP5 Position      */\r
+#define GPIO_PORT_DIR3_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP5_Pos)                      /*!< GPIO_PORT DIR3: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR3: DIRP6 Position      */\r
+#define GPIO_PORT_DIR3_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP6_Pos)                      /*!< GPIO_PORT DIR3: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR3: DIRP7 Position      */\r
+#define GPIO_PORT_DIR3_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP7_Pos)                      /*!< GPIO_PORT DIR3: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR3: DIRP8 Position      */\r
+#define GPIO_PORT_DIR3_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP8_Pos)                      /*!< GPIO_PORT DIR3: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR3: DIRP9 Position      */\r
+#define GPIO_PORT_DIR3_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR3_DIRP9_Pos)                      /*!< GPIO_PORT DIR3: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR3_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR3: DIRP10 Position     */\r
+#define GPIO_PORT_DIR3_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP10_Pos)                     /*!< GPIO_PORT DIR3: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR3: DIRP11 Position     */\r
+#define GPIO_PORT_DIR3_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP11_Pos)                     /*!< GPIO_PORT DIR3: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR3: DIRP12 Position     */\r
+#define GPIO_PORT_DIR3_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP12_Pos)                     /*!< GPIO_PORT DIR3: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR3: DIRP13 Position     */\r
+#define GPIO_PORT_DIR3_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP13_Pos)                     /*!< GPIO_PORT DIR3: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR3: DIRP14 Position     */\r
+#define GPIO_PORT_DIR3_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP14_Pos)                     /*!< GPIO_PORT DIR3: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR3: DIRP15 Position     */\r
+#define GPIO_PORT_DIR3_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP15_Pos)                     /*!< GPIO_PORT DIR3: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR3: DIRP16 Position     */\r
+#define GPIO_PORT_DIR3_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP16_Pos)                     /*!< GPIO_PORT DIR3: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR3: DIRP17 Position     */\r
+#define GPIO_PORT_DIR3_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP17_Pos)                     /*!< GPIO_PORT DIR3: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR3: DIRP18 Position     */\r
+#define GPIO_PORT_DIR3_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP18_Pos)                     /*!< GPIO_PORT DIR3: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR3: DIRP19 Position     */\r
+#define GPIO_PORT_DIR3_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP19_Pos)                     /*!< GPIO_PORT DIR3: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR3: DIRP20 Position     */\r
+#define GPIO_PORT_DIR3_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP20_Pos)                     /*!< GPIO_PORT DIR3: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR3: DIRP21 Position     */\r
+#define GPIO_PORT_DIR3_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP21_Pos)                     /*!< GPIO_PORT DIR3: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR3: DIRP22 Position     */\r
+#define GPIO_PORT_DIR3_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP22_Pos)                     /*!< GPIO_PORT DIR3: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR3: DIRP23 Position     */\r
+#define GPIO_PORT_DIR3_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP23_Pos)                     /*!< GPIO_PORT DIR3: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR3: DIRP24 Position     */\r
+#define GPIO_PORT_DIR3_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP24_Pos)                     /*!< GPIO_PORT DIR3: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR3: DIRP25 Position     */\r
+#define GPIO_PORT_DIR3_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP25_Pos)                     /*!< GPIO_PORT DIR3: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR3: DIRP26 Position     */\r
+#define GPIO_PORT_DIR3_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP26_Pos)                     /*!< GPIO_PORT DIR3: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR3: DIRP27 Position     */\r
+#define GPIO_PORT_DIR3_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP27_Pos)                     /*!< GPIO_PORT DIR3: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR3: DIRP28 Position     */\r
+#define GPIO_PORT_DIR3_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP28_Pos)                     /*!< GPIO_PORT DIR3: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR3: DIRP29 Position     */\r
+#define GPIO_PORT_DIR3_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP29_Pos)                     /*!< GPIO_PORT DIR3: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR3: DIRP30 Position     */\r
+#define GPIO_PORT_DIR3_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP30_Pos)                     /*!< GPIO_PORT DIR3: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR3_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR3: DIRP31 Position     */\r
+#define GPIO_PORT_DIR3_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR3_DIRP31_Pos)                     /*!< GPIO_PORT DIR3: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR4  -----------------------------------------\r
+#define GPIO_PORT_DIR4_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR4: DIRP0 Position      */\r
+#define GPIO_PORT_DIR4_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP0_Pos)                      /*!< GPIO_PORT DIR4: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR4: DIRP1 Position      */\r
+#define GPIO_PORT_DIR4_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP1_Pos)                      /*!< GPIO_PORT DIR4: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR4: DIRP2 Position      */\r
+#define GPIO_PORT_DIR4_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP2_Pos)                      /*!< GPIO_PORT DIR4: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR4: DIRP3 Position      */\r
+#define GPIO_PORT_DIR4_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP3_Pos)                      /*!< GPIO_PORT DIR4: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR4: DIRP4 Position      */\r
+#define GPIO_PORT_DIR4_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP4_Pos)                      /*!< GPIO_PORT DIR4: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR4: DIRP5 Position      */\r
+#define GPIO_PORT_DIR4_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP5_Pos)                      /*!< GPIO_PORT DIR4: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR4: DIRP6 Position      */\r
+#define GPIO_PORT_DIR4_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP6_Pos)                      /*!< GPIO_PORT DIR4: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR4: DIRP7 Position      */\r
+#define GPIO_PORT_DIR4_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP7_Pos)                      /*!< GPIO_PORT DIR4: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR4: DIRP8 Position      */\r
+#define GPIO_PORT_DIR4_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP8_Pos)                      /*!< GPIO_PORT DIR4: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR4: DIRP9 Position      */\r
+#define GPIO_PORT_DIR4_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR4_DIRP9_Pos)                      /*!< GPIO_PORT DIR4: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR4_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR4: DIRP10 Position     */\r
+#define GPIO_PORT_DIR4_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP10_Pos)                     /*!< GPIO_PORT DIR4: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR4: DIRP11 Position     */\r
+#define GPIO_PORT_DIR4_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP11_Pos)                     /*!< GPIO_PORT DIR4: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR4: DIRP12 Position     */\r
+#define GPIO_PORT_DIR4_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP12_Pos)                     /*!< GPIO_PORT DIR4: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR4: DIRP13 Position     */\r
+#define GPIO_PORT_DIR4_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP13_Pos)                     /*!< GPIO_PORT DIR4: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR4: DIRP14 Position     */\r
+#define GPIO_PORT_DIR4_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP14_Pos)                     /*!< GPIO_PORT DIR4: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR4: DIRP15 Position     */\r
+#define GPIO_PORT_DIR4_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP15_Pos)                     /*!< GPIO_PORT DIR4: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR4: DIRP16 Position     */\r
+#define GPIO_PORT_DIR4_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP16_Pos)                     /*!< GPIO_PORT DIR4: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR4: DIRP17 Position     */\r
+#define GPIO_PORT_DIR4_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP17_Pos)                     /*!< GPIO_PORT DIR4: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR4: DIRP18 Position     */\r
+#define GPIO_PORT_DIR4_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP18_Pos)                     /*!< GPIO_PORT DIR4: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR4: DIRP19 Position     */\r
+#define GPIO_PORT_DIR4_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP19_Pos)                     /*!< GPIO_PORT DIR4: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR4: DIRP20 Position     */\r
+#define GPIO_PORT_DIR4_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP20_Pos)                     /*!< GPIO_PORT DIR4: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR4: DIRP21 Position     */\r
+#define GPIO_PORT_DIR4_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP21_Pos)                     /*!< GPIO_PORT DIR4: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR4: DIRP22 Position     */\r
+#define GPIO_PORT_DIR4_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP22_Pos)                     /*!< GPIO_PORT DIR4: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR4: DIRP23 Position     */\r
+#define GPIO_PORT_DIR4_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP23_Pos)                     /*!< GPIO_PORT DIR4: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR4: DIRP24 Position     */\r
+#define GPIO_PORT_DIR4_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP24_Pos)                     /*!< GPIO_PORT DIR4: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR4: DIRP25 Position     */\r
+#define GPIO_PORT_DIR4_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP25_Pos)                     /*!< GPIO_PORT DIR4: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR4: DIRP26 Position     */\r
+#define GPIO_PORT_DIR4_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP26_Pos)                     /*!< GPIO_PORT DIR4: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR4: DIRP27 Position     */\r
+#define GPIO_PORT_DIR4_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP27_Pos)                     /*!< GPIO_PORT DIR4: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR4: DIRP28 Position     */\r
+#define GPIO_PORT_DIR4_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP28_Pos)                     /*!< GPIO_PORT DIR4: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR4: DIRP29 Position     */\r
+#define GPIO_PORT_DIR4_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP29_Pos)                     /*!< GPIO_PORT DIR4: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR4: DIRP30 Position     */\r
+#define GPIO_PORT_DIR4_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP30_Pos)                     /*!< GPIO_PORT DIR4: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR4_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR4: DIRP31 Position     */\r
+#define GPIO_PORT_DIR4_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR4_DIRP31_Pos)                     /*!< GPIO_PORT DIR4: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR5  -----------------------------------------\r
+#define GPIO_PORT_DIR5_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR5: DIRP0 Position      */\r
+#define GPIO_PORT_DIR5_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP0_Pos)                      /*!< GPIO_PORT DIR5: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR5: DIRP1 Position      */\r
+#define GPIO_PORT_DIR5_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP1_Pos)                      /*!< GPIO_PORT DIR5: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR5: DIRP2 Position      */\r
+#define GPIO_PORT_DIR5_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP2_Pos)                      /*!< GPIO_PORT DIR5: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR5: DIRP3 Position      */\r
+#define GPIO_PORT_DIR5_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP3_Pos)                      /*!< GPIO_PORT DIR5: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR5: DIRP4 Position      */\r
+#define GPIO_PORT_DIR5_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP4_Pos)                      /*!< GPIO_PORT DIR5: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR5: DIRP5 Position      */\r
+#define GPIO_PORT_DIR5_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP5_Pos)                      /*!< GPIO_PORT DIR5: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR5: DIRP6 Position      */\r
+#define GPIO_PORT_DIR5_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP6_Pos)                      /*!< GPIO_PORT DIR5: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR5: DIRP7 Position      */\r
+#define GPIO_PORT_DIR5_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP7_Pos)                      /*!< GPIO_PORT DIR5: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR5: DIRP8 Position      */\r
+#define GPIO_PORT_DIR5_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP8_Pos)                      /*!< GPIO_PORT DIR5: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR5: DIRP9 Position      */\r
+#define GPIO_PORT_DIR5_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR5_DIRP9_Pos)                      /*!< GPIO_PORT DIR5: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR5_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR5: DIRP10 Position     */\r
+#define GPIO_PORT_DIR5_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP10_Pos)                     /*!< GPIO_PORT DIR5: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR5: DIRP11 Position     */\r
+#define GPIO_PORT_DIR5_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP11_Pos)                     /*!< GPIO_PORT DIR5: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR5: DIRP12 Position     */\r
+#define GPIO_PORT_DIR5_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP12_Pos)                     /*!< GPIO_PORT DIR5: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR5: DIRP13 Position     */\r
+#define GPIO_PORT_DIR5_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP13_Pos)                     /*!< GPIO_PORT DIR5: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR5: DIRP14 Position     */\r
+#define GPIO_PORT_DIR5_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP14_Pos)                     /*!< GPIO_PORT DIR5: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR5: DIRP15 Position     */\r
+#define GPIO_PORT_DIR5_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP15_Pos)                     /*!< GPIO_PORT DIR5: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR5: DIRP16 Position     */\r
+#define GPIO_PORT_DIR5_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP16_Pos)                     /*!< GPIO_PORT DIR5: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR5: DIRP17 Position     */\r
+#define GPIO_PORT_DIR5_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP17_Pos)                     /*!< GPIO_PORT DIR5: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR5: DIRP18 Position     */\r
+#define GPIO_PORT_DIR5_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP18_Pos)                     /*!< GPIO_PORT DIR5: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR5: DIRP19 Position     */\r
+#define GPIO_PORT_DIR5_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP19_Pos)                     /*!< GPIO_PORT DIR5: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR5: DIRP20 Position     */\r
+#define GPIO_PORT_DIR5_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP20_Pos)                     /*!< GPIO_PORT DIR5: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR5: DIRP21 Position     */\r
+#define GPIO_PORT_DIR5_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP21_Pos)                     /*!< GPIO_PORT DIR5: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR5: DIRP22 Position     */\r
+#define GPIO_PORT_DIR5_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP22_Pos)                     /*!< GPIO_PORT DIR5: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR5: DIRP23 Position     */\r
+#define GPIO_PORT_DIR5_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP23_Pos)                     /*!< GPIO_PORT DIR5: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR5: DIRP24 Position     */\r
+#define GPIO_PORT_DIR5_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP24_Pos)                     /*!< GPIO_PORT DIR5: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR5: DIRP25 Position     */\r
+#define GPIO_PORT_DIR5_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP25_Pos)                     /*!< GPIO_PORT DIR5: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR5: DIRP26 Position     */\r
+#define GPIO_PORT_DIR5_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP26_Pos)                     /*!< GPIO_PORT DIR5: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR5: DIRP27 Position     */\r
+#define GPIO_PORT_DIR5_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP27_Pos)                     /*!< GPIO_PORT DIR5: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR5: DIRP28 Position     */\r
+#define GPIO_PORT_DIR5_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP28_Pos)                     /*!< GPIO_PORT DIR5: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR5: DIRP29 Position     */\r
+#define GPIO_PORT_DIR5_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP29_Pos)                     /*!< GPIO_PORT DIR5: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR5: DIRP30 Position     */\r
+#define GPIO_PORT_DIR5_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP30_Pos)                     /*!< GPIO_PORT DIR5: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR5_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR5: DIRP31 Position     */\r
+#define GPIO_PORT_DIR5_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR5_DIRP31_Pos)                     /*!< GPIO_PORT DIR5: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR6  -----------------------------------------\r
+#define GPIO_PORT_DIR6_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR6: DIRP0 Position      */\r
+#define GPIO_PORT_DIR6_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP0_Pos)                      /*!< GPIO_PORT DIR6: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR6: DIRP1 Position      */\r
+#define GPIO_PORT_DIR6_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP1_Pos)                      /*!< GPIO_PORT DIR6: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR6: DIRP2 Position      */\r
+#define GPIO_PORT_DIR6_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP2_Pos)                      /*!< GPIO_PORT DIR6: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR6: DIRP3 Position      */\r
+#define GPIO_PORT_DIR6_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP3_Pos)                      /*!< GPIO_PORT DIR6: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR6: DIRP4 Position      */\r
+#define GPIO_PORT_DIR6_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP4_Pos)                      /*!< GPIO_PORT DIR6: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR6: DIRP5 Position      */\r
+#define GPIO_PORT_DIR6_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP5_Pos)                      /*!< GPIO_PORT DIR6: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR6: DIRP6 Position      */\r
+#define GPIO_PORT_DIR6_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP6_Pos)                      /*!< GPIO_PORT DIR6: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR6: DIRP7 Position      */\r
+#define GPIO_PORT_DIR6_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP7_Pos)                      /*!< GPIO_PORT DIR6: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR6: DIRP8 Position      */\r
+#define GPIO_PORT_DIR6_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP8_Pos)                      /*!< GPIO_PORT DIR6: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR6: DIRP9 Position      */\r
+#define GPIO_PORT_DIR6_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR6_DIRP9_Pos)                      /*!< GPIO_PORT DIR6: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR6_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR6: DIRP10 Position     */\r
+#define GPIO_PORT_DIR6_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP10_Pos)                     /*!< GPIO_PORT DIR6: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR6: DIRP11 Position     */\r
+#define GPIO_PORT_DIR6_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP11_Pos)                     /*!< GPIO_PORT DIR6: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR6: DIRP12 Position     */\r
+#define GPIO_PORT_DIR6_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP12_Pos)                     /*!< GPIO_PORT DIR6: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR6: DIRP13 Position     */\r
+#define GPIO_PORT_DIR6_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP13_Pos)                     /*!< GPIO_PORT DIR6: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR6: DIRP14 Position     */\r
+#define GPIO_PORT_DIR6_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP14_Pos)                     /*!< GPIO_PORT DIR6: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR6: DIRP15 Position     */\r
+#define GPIO_PORT_DIR6_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP15_Pos)                     /*!< GPIO_PORT DIR6: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR6: DIRP16 Position     */\r
+#define GPIO_PORT_DIR6_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP16_Pos)                     /*!< GPIO_PORT DIR6: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR6: DIRP17 Position     */\r
+#define GPIO_PORT_DIR6_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP17_Pos)                     /*!< GPIO_PORT DIR6: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR6: DIRP18 Position     */\r
+#define GPIO_PORT_DIR6_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP18_Pos)                     /*!< GPIO_PORT DIR6: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR6: DIRP19 Position     */\r
+#define GPIO_PORT_DIR6_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP19_Pos)                     /*!< GPIO_PORT DIR6: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR6: DIRP20 Position     */\r
+#define GPIO_PORT_DIR6_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP20_Pos)                     /*!< GPIO_PORT DIR6: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR6: DIRP21 Position     */\r
+#define GPIO_PORT_DIR6_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP21_Pos)                     /*!< GPIO_PORT DIR6: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR6: DIRP22 Position     */\r
+#define GPIO_PORT_DIR6_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP22_Pos)                     /*!< GPIO_PORT DIR6: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR6: DIRP23 Position     */\r
+#define GPIO_PORT_DIR6_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP23_Pos)                     /*!< GPIO_PORT DIR6: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR6: DIRP24 Position     */\r
+#define GPIO_PORT_DIR6_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP24_Pos)                     /*!< GPIO_PORT DIR6: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR6: DIRP25 Position     */\r
+#define GPIO_PORT_DIR6_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP25_Pos)                     /*!< GPIO_PORT DIR6: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR6: DIRP26 Position     */\r
+#define GPIO_PORT_DIR6_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP26_Pos)                     /*!< GPIO_PORT DIR6: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR6: DIRP27 Position     */\r
+#define GPIO_PORT_DIR6_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP27_Pos)                     /*!< GPIO_PORT DIR6: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR6: DIRP28 Position     */\r
+#define GPIO_PORT_DIR6_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP28_Pos)                     /*!< GPIO_PORT DIR6: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR6: DIRP29 Position     */\r
+#define GPIO_PORT_DIR6_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP29_Pos)                     /*!< GPIO_PORT DIR6: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR6: DIRP30 Position     */\r
+#define GPIO_PORT_DIR6_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP30_Pos)                     /*!< GPIO_PORT DIR6: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR6_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR6: DIRP31 Position     */\r
+#define GPIO_PORT_DIR6_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR6_DIRP31_Pos)                     /*!< GPIO_PORT DIR6: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_DIR7  -----------------------------------------\r
+#define GPIO_PORT_DIR7_DIRP0_Pos                              0                                                         /*!< GPIO_PORT DIR7: DIRP0 Position      */\r
+#define GPIO_PORT_DIR7_DIRP0_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP0_Pos)                      /*!< GPIO_PORT DIR7: DIRP0 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP1_Pos                              1                                                         /*!< GPIO_PORT DIR7: DIRP1 Position      */\r
+#define GPIO_PORT_DIR7_DIRP1_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP1_Pos)                      /*!< GPIO_PORT DIR7: DIRP1 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP2_Pos                              2                                                         /*!< GPIO_PORT DIR7: DIRP2 Position      */\r
+#define GPIO_PORT_DIR7_DIRP2_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP2_Pos)                      /*!< GPIO_PORT DIR7: DIRP2 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP3_Pos                              3                                                         /*!< GPIO_PORT DIR7: DIRP3 Position      */\r
+#define GPIO_PORT_DIR7_DIRP3_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP3_Pos)                      /*!< GPIO_PORT DIR7: DIRP3 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP4_Pos                              4                                                         /*!< GPIO_PORT DIR7: DIRP4 Position      */\r
+#define GPIO_PORT_DIR7_DIRP4_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP4_Pos)                      /*!< GPIO_PORT DIR7: DIRP4 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP5_Pos                              5                                                         /*!< GPIO_PORT DIR7: DIRP5 Position      */\r
+#define GPIO_PORT_DIR7_DIRP5_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP5_Pos)                      /*!< GPIO_PORT DIR7: DIRP5 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP6_Pos                              6                                                         /*!< GPIO_PORT DIR7: DIRP6 Position      */\r
+#define GPIO_PORT_DIR7_DIRP6_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP6_Pos)                      /*!< GPIO_PORT DIR7: DIRP6 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP7_Pos                              7                                                         /*!< GPIO_PORT DIR7: DIRP7 Position      */\r
+#define GPIO_PORT_DIR7_DIRP7_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP7_Pos)                      /*!< GPIO_PORT DIR7: DIRP7 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP8_Pos                              8                                                         /*!< GPIO_PORT DIR7: DIRP8 Position      */\r
+#define GPIO_PORT_DIR7_DIRP8_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP8_Pos)                      /*!< GPIO_PORT DIR7: DIRP8 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP9_Pos                              9                                                         /*!< GPIO_PORT DIR7: DIRP9 Position      */\r
+#define GPIO_PORT_DIR7_DIRP9_Msk                              (0x01UL << GPIO_PORT_DIR7_DIRP9_Pos)                      /*!< GPIO_PORT DIR7: DIRP9 Mask          */\r
+#define GPIO_PORT_DIR7_DIRP10_Pos                             10                                                        /*!< GPIO_PORT DIR7: DIRP10 Position     */\r
+#define GPIO_PORT_DIR7_DIRP10_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP10_Pos)                     /*!< GPIO_PORT DIR7: DIRP10 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP11_Pos                             11                                                        /*!< GPIO_PORT DIR7: DIRP11 Position     */\r
+#define GPIO_PORT_DIR7_DIRP11_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP11_Pos)                     /*!< GPIO_PORT DIR7: DIRP11 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP12_Pos                             12                                                        /*!< GPIO_PORT DIR7: DIRP12 Position     */\r
+#define GPIO_PORT_DIR7_DIRP12_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP12_Pos)                     /*!< GPIO_PORT DIR7: DIRP12 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP13_Pos                             13                                                        /*!< GPIO_PORT DIR7: DIRP13 Position     */\r
+#define GPIO_PORT_DIR7_DIRP13_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP13_Pos)                     /*!< GPIO_PORT DIR7: DIRP13 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP14_Pos                             14                                                        /*!< GPIO_PORT DIR7: DIRP14 Position     */\r
+#define GPIO_PORT_DIR7_DIRP14_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP14_Pos)                     /*!< GPIO_PORT DIR7: DIRP14 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP15_Pos                             15                                                        /*!< GPIO_PORT DIR7: DIRP15 Position     */\r
+#define GPIO_PORT_DIR7_DIRP15_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP15_Pos)                     /*!< GPIO_PORT DIR7: DIRP15 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP16_Pos                             16                                                        /*!< GPIO_PORT DIR7: DIRP16 Position     */\r
+#define GPIO_PORT_DIR7_DIRP16_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP16_Pos)                     /*!< GPIO_PORT DIR7: DIRP16 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP17_Pos                             17                                                        /*!< GPIO_PORT DIR7: DIRP17 Position     */\r
+#define GPIO_PORT_DIR7_DIRP17_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP17_Pos)                     /*!< GPIO_PORT DIR7: DIRP17 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP18_Pos                             18                                                        /*!< GPIO_PORT DIR7: DIRP18 Position     */\r
+#define GPIO_PORT_DIR7_DIRP18_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP18_Pos)                     /*!< GPIO_PORT DIR7: DIRP18 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP19_Pos                             19                                                        /*!< GPIO_PORT DIR7: DIRP19 Position     */\r
+#define GPIO_PORT_DIR7_DIRP19_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP19_Pos)                     /*!< GPIO_PORT DIR7: DIRP19 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP20_Pos                             20                                                        /*!< GPIO_PORT DIR7: DIRP20 Position     */\r
+#define GPIO_PORT_DIR7_DIRP20_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP20_Pos)                     /*!< GPIO_PORT DIR7: DIRP20 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP21_Pos                             21                                                        /*!< GPIO_PORT DIR7: DIRP21 Position     */\r
+#define GPIO_PORT_DIR7_DIRP21_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP21_Pos)                     /*!< GPIO_PORT DIR7: DIRP21 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP22_Pos                             22                                                        /*!< GPIO_PORT DIR7: DIRP22 Position     */\r
+#define GPIO_PORT_DIR7_DIRP22_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP22_Pos)                     /*!< GPIO_PORT DIR7: DIRP22 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP23_Pos                             23                                                        /*!< GPIO_PORT DIR7: DIRP23 Position     */\r
+#define GPIO_PORT_DIR7_DIRP23_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP23_Pos)                     /*!< GPIO_PORT DIR7: DIRP23 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP24_Pos                             24                                                        /*!< GPIO_PORT DIR7: DIRP24 Position     */\r
+#define GPIO_PORT_DIR7_DIRP24_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP24_Pos)                     /*!< GPIO_PORT DIR7: DIRP24 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP25_Pos                             25                                                        /*!< GPIO_PORT DIR7: DIRP25 Position     */\r
+#define GPIO_PORT_DIR7_DIRP25_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP25_Pos)                     /*!< GPIO_PORT DIR7: DIRP25 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP26_Pos                             26                                                        /*!< GPIO_PORT DIR7: DIRP26 Position     */\r
+#define GPIO_PORT_DIR7_DIRP26_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP26_Pos)                     /*!< GPIO_PORT DIR7: DIRP26 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP27_Pos                             27                                                        /*!< GPIO_PORT DIR7: DIRP27 Position     */\r
+#define GPIO_PORT_DIR7_DIRP27_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP27_Pos)                     /*!< GPIO_PORT DIR7: DIRP27 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP28_Pos                             28                                                        /*!< GPIO_PORT DIR7: DIRP28 Position     */\r
+#define GPIO_PORT_DIR7_DIRP28_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP28_Pos)                     /*!< GPIO_PORT DIR7: DIRP28 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP29_Pos                             29                                                        /*!< GPIO_PORT DIR7: DIRP29 Position     */\r
+#define GPIO_PORT_DIR7_DIRP29_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP29_Pos)                     /*!< GPIO_PORT DIR7: DIRP29 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP30_Pos                             30                                                        /*!< GPIO_PORT DIR7: DIRP30 Position     */\r
+#define GPIO_PORT_DIR7_DIRP30_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP30_Pos)                     /*!< GPIO_PORT DIR7: DIRP30 Mask         */\r
+#define GPIO_PORT_DIR7_DIRP31_Pos                             31                                                        /*!< GPIO_PORT DIR7: DIRP31 Position     */\r
+#define GPIO_PORT_DIR7_DIRP31_Msk                             (0x01UL << GPIO_PORT_DIR7_DIRP31_Pos)                     /*!< GPIO_PORT DIR7: DIRP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK0  ----------------------------------------\r
+#define GPIO_PORT_MASK0_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK0: MASKP0 Position    */\r
+#define GPIO_PORT_MASK0_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP0_Pos)                    /*!< GPIO_PORT MASK0: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK0: MASKP1 Position    */\r
+#define GPIO_PORT_MASK0_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP1_Pos)                    /*!< GPIO_PORT MASK0: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK0: MASKP2 Position    */\r
+#define GPIO_PORT_MASK0_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP2_Pos)                    /*!< GPIO_PORT MASK0: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK0: MASKP3 Position    */\r
+#define GPIO_PORT_MASK0_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP3_Pos)                    /*!< GPIO_PORT MASK0: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK0: MASKP4 Position    */\r
+#define GPIO_PORT_MASK0_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP4_Pos)                    /*!< GPIO_PORT MASK0: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK0: MASKP5 Position    */\r
+#define GPIO_PORT_MASK0_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP5_Pos)                    /*!< GPIO_PORT MASK0: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK0: MASKP6 Position    */\r
+#define GPIO_PORT_MASK0_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP6_Pos)                    /*!< GPIO_PORT MASK0: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK0: MASKP7 Position    */\r
+#define GPIO_PORT_MASK0_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP7_Pos)                    /*!< GPIO_PORT MASK0: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK0: MASKP8 Position    */\r
+#define GPIO_PORT_MASK0_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP8_Pos)                    /*!< GPIO_PORT MASK0: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK0: MASKP9 Position    */\r
+#define GPIO_PORT_MASK0_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK0_MASKP9_Pos)                    /*!< GPIO_PORT MASK0: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK0_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK0: MASKP10 Position   */\r
+#define GPIO_PORT_MASK0_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP10_Pos)                   /*!< GPIO_PORT MASK0: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK0: MASKP11 Position   */\r
+#define GPIO_PORT_MASK0_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP11_Pos)                   /*!< GPIO_PORT MASK0: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK0: MASKP12 Position   */\r
+#define GPIO_PORT_MASK0_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP12_Pos)                   /*!< GPIO_PORT MASK0: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK0: MASKP13 Position   */\r
+#define GPIO_PORT_MASK0_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP13_Pos)                   /*!< GPIO_PORT MASK0: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK0: MASKP14 Position   */\r
+#define GPIO_PORT_MASK0_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP14_Pos)                   /*!< GPIO_PORT MASK0: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK0: MASKP15 Position   */\r
+#define GPIO_PORT_MASK0_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP15_Pos)                   /*!< GPIO_PORT MASK0: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK0: MASKP16 Position   */\r
+#define GPIO_PORT_MASK0_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP16_Pos)                   /*!< GPIO_PORT MASK0: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK0: MASKP17 Position   */\r
+#define GPIO_PORT_MASK0_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP17_Pos)                   /*!< GPIO_PORT MASK0: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK0: MASKP18 Position   */\r
+#define GPIO_PORT_MASK0_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP18_Pos)                   /*!< GPIO_PORT MASK0: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK0: MASKP19 Position   */\r
+#define GPIO_PORT_MASK0_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP19_Pos)                   /*!< GPIO_PORT MASK0: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK0: MASKP20 Position   */\r
+#define GPIO_PORT_MASK0_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP20_Pos)                   /*!< GPIO_PORT MASK0: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK0: MASKP21 Position   */\r
+#define GPIO_PORT_MASK0_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP21_Pos)                   /*!< GPIO_PORT MASK0: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK0: MASKP22 Position   */\r
+#define GPIO_PORT_MASK0_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP22_Pos)                   /*!< GPIO_PORT MASK0: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK0: MASKP23 Position   */\r
+#define GPIO_PORT_MASK0_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP23_Pos)                   /*!< GPIO_PORT MASK0: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK0: MASKP24 Position   */\r
+#define GPIO_PORT_MASK0_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP24_Pos)                   /*!< GPIO_PORT MASK0: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK0: MASKP25 Position   */\r
+#define GPIO_PORT_MASK0_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP25_Pos)                   /*!< GPIO_PORT MASK0: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK0: MASKP26 Position   */\r
+#define GPIO_PORT_MASK0_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP26_Pos)                   /*!< GPIO_PORT MASK0: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK0: MASKP27 Position   */\r
+#define GPIO_PORT_MASK0_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP27_Pos)                   /*!< GPIO_PORT MASK0: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK0: MASKP28 Position   */\r
+#define GPIO_PORT_MASK0_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP28_Pos)                   /*!< GPIO_PORT MASK0: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK0: MASKP29 Position   */\r
+#define GPIO_PORT_MASK0_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP29_Pos)                   /*!< GPIO_PORT MASK0: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK0: MASKP30 Position   */\r
+#define GPIO_PORT_MASK0_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP30_Pos)                   /*!< GPIO_PORT MASK0: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK0_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK0: MASKP31 Position   */\r
+#define GPIO_PORT_MASK0_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK0_MASKP31_Pos)                   /*!< GPIO_PORT MASK0: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK1  ----------------------------------------\r
+#define GPIO_PORT_MASK1_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK1: MASKP0 Position    */\r
+#define GPIO_PORT_MASK1_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP0_Pos)                    /*!< GPIO_PORT MASK1: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK1: MASKP1 Position    */\r
+#define GPIO_PORT_MASK1_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP1_Pos)                    /*!< GPIO_PORT MASK1: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK1: MASKP2 Position    */\r
+#define GPIO_PORT_MASK1_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP2_Pos)                    /*!< GPIO_PORT MASK1: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK1: MASKP3 Position    */\r
+#define GPIO_PORT_MASK1_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP3_Pos)                    /*!< GPIO_PORT MASK1: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK1: MASKP4 Position    */\r
+#define GPIO_PORT_MASK1_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP4_Pos)                    /*!< GPIO_PORT MASK1: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK1: MASKP5 Position    */\r
+#define GPIO_PORT_MASK1_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP5_Pos)                    /*!< GPIO_PORT MASK1: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK1: MASKP6 Position    */\r
+#define GPIO_PORT_MASK1_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP6_Pos)                    /*!< GPIO_PORT MASK1: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK1: MASKP7 Position    */\r
+#define GPIO_PORT_MASK1_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP7_Pos)                    /*!< GPIO_PORT MASK1: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK1: MASKP8 Position    */\r
+#define GPIO_PORT_MASK1_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP8_Pos)                    /*!< GPIO_PORT MASK1: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK1: MASKP9 Position    */\r
+#define GPIO_PORT_MASK1_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK1_MASKP9_Pos)                    /*!< GPIO_PORT MASK1: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK1_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK1: MASKP10 Position   */\r
+#define GPIO_PORT_MASK1_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP10_Pos)                   /*!< GPIO_PORT MASK1: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK1: MASKP11 Position   */\r
+#define GPIO_PORT_MASK1_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP11_Pos)                   /*!< GPIO_PORT MASK1: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK1: MASKP12 Position   */\r
+#define GPIO_PORT_MASK1_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP12_Pos)                   /*!< GPIO_PORT MASK1: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK1: MASKP13 Position   */\r
+#define GPIO_PORT_MASK1_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP13_Pos)                   /*!< GPIO_PORT MASK1: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK1: MASKP14 Position   */\r
+#define GPIO_PORT_MASK1_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP14_Pos)                   /*!< GPIO_PORT MASK1: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK1: MASKP15 Position   */\r
+#define GPIO_PORT_MASK1_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP15_Pos)                   /*!< GPIO_PORT MASK1: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK1: MASKP16 Position   */\r
+#define GPIO_PORT_MASK1_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP16_Pos)                   /*!< GPIO_PORT MASK1: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK1: MASKP17 Position   */\r
+#define GPIO_PORT_MASK1_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP17_Pos)                   /*!< GPIO_PORT MASK1: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK1: MASKP18 Position   */\r
+#define GPIO_PORT_MASK1_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP18_Pos)                   /*!< GPIO_PORT MASK1: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK1: MASKP19 Position   */\r
+#define GPIO_PORT_MASK1_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP19_Pos)                   /*!< GPIO_PORT MASK1: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK1: MASKP20 Position   */\r
+#define GPIO_PORT_MASK1_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP20_Pos)                   /*!< GPIO_PORT MASK1: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK1: MASKP21 Position   */\r
+#define GPIO_PORT_MASK1_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP21_Pos)                   /*!< GPIO_PORT MASK1: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK1: MASKP22 Position   */\r
+#define GPIO_PORT_MASK1_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP22_Pos)                   /*!< GPIO_PORT MASK1: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK1: MASKP23 Position   */\r
+#define GPIO_PORT_MASK1_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP23_Pos)                   /*!< GPIO_PORT MASK1: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK1: MASKP24 Position   */\r
+#define GPIO_PORT_MASK1_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP24_Pos)                   /*!< GPIO_PORT MASK1: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK1: MASKP25 Position   */\r
+#define GPIO_PORT_MASK1_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP25_Pos)                   /*!< GPIO_PORT MASK1: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK1: MASKP26 Position   */\r
+#define GPIO_PORT_MASK1_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP26_Pos)                   /*!< GPIO_PORT MASK1: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK1: MASKP27 Position   */\r
+#define GPIO_PORT_MASK1_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP27_Pos)                   /*!< GPIO_PORT MASK1: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK1: MASKP28 Position   */\r
+#define GPIO_PORT_MASK1_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP28_Pos)                   /*!< GPIO_PORT MASK1: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK1: MASKP29 Position   */\r
+#define GPIO_PORT_MASK1_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP29_Pos)                   /*!< GPIO_PORT MASK1: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK1: MASKP30 Position   */\r
+#define GPIO_PORT_MASK1_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP30_Pos)                   /*!< GPIO_PORT MASK1: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK1_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK1: MASKP31 Position   */\r
+#define GPIO_PORT_MASK1_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK1_MASKP31_Pos)                   /*!< GPIO_PORT MASK1: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK2  ----------------------------------------\r
+#define GPIO_PORT_MASK2_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK2: MASKP0 Position    */\r
+#define GPIO_PORT_MASK2_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP0_Pos)                    /*!< GPIO_PORT MASK2: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK2: MASKP1 Position    */\r
+#define GPIO_PORT_MASK2_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP1_Pos)                    /*!< GPIO_PORT MASK2: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK2: MASKP2 Position    */\r
+#define GPIO_PORT_MASK2_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP2_Pos)                    /*!< GPIO_PORT MASK2: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK2: MASKP3 Position    */\r
+#define GPIO_PORT_MASK2_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP3_Pos)                    /*!< GPIO_PORT MASK2: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK2: MASKP4 Position    */\r
+#define GPIO_PORT_MASK2_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP4_Pos)                    /*!< GPIO_PORT MASK2: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK2: MASKP5 Position    */\r
+#define GPIO_PORT_MASK2_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP5_Pos)                    /*!< GPIO_PORT MASK2: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK2: MASKP6 Position    */\r
+#define GPIO_PORT_MASK2_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP6_Pos)                    /*!< GPIO_PORT MASK2: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK2: MASKP7 Position    */\r
+#define GPIO_PORT_MASK2_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP7_Pos)                    /*!< GPIO_PORT MASK2: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK2: MASKP8 Position    */\r
+#define GPIO_PORT_MASK2_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP8_Pos)                    /*!< GPIO_PORT MASK2: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK2: MASKP9 Position    */\r
+#define GPIO_PORT_MASK2_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK2_MASKP9_Pos)                    /*!< GPIO_PORT MASK2: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK2_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK2: MASKP10 Position   */\r
+#define GPIO_PORT_MASK2_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP10_Pos)                   /*!< GPIO_PORT MASK2: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK2: MASKP11 Position   */\r
+#define GPIO_PORT_MASK2_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP11_Pos)                   /*!< GPIO_PORT MASK2: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK2: MASKP12 Position   */\r
+#define GPIO_PORT_MASK2_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP12_Pos)                   /*!< GPIO_PORT MASK2: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK2: MASKP13 Position   */\r
+#define GPIO_PORT_MASK2_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP13_Pos)                   /*!< GPIO_PORT MASK2: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK2: MASKP14 Position   */\r
+#define GPIO_PORT_MASK2_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP14_Pos)                   /*!< GPIO_PORT MASK2: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK2: MASKP15 Position   */\r
+#define GPIO_PORT_MASK2_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP15_Pos)                   /*!< GPIO_PORT MASK2: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK2: MASKP16 Position   */\r
+#define GPIO_PORT_MASK2_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP16_Pos)                   /*!< GPIO_PORT MASK2: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK2: MASKP17 Position   */\r
+#define GPIO_PORT_MASK2_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP17_Pos)                   /*!< GPIO_PORT MASK2: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK2: MASKP18 Position   */\r
+#define GPIO_PORT_MASK2_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP18_Pos)                   /*!< GPIO_PORT MASK2: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK2: MASKP19 Position   */\r
+#define GPIO_PORT_MASK2_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP19_Pos)                   /*!< GPIO_PORT MASK2: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK2: MASKP20 Position   */\r
+#define GPIO_PORT_MASK2_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP20_Pos)                   /*!< GPIO_PORT MASK2: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK2: MASKP21 Position   */\r
+#define GPIO_PORT_MASK2_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP21_Pos)                   /*!< GPIO_PORT MASK2: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK2: MASKP22 Position   */\r
+#define GPIO_PORT_MASK2_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP22_Pos)                   /*!< GPIO_PORT MASK2: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK2: MASKP23 Position   */\r
+#define GPIO_PORT_MASK2_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP23_Pos)                   /*!< GPIO_PORT MASK2: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK2: MASKP24 Position   */\r
+#define GPIO_PORT_MASK2_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP24_Pos)                   /*!< GPIO_PORT MASK2: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK2: MASKP25 Position   */\r
+#define GPIO_PORT_MASK2_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP25_Pos)                   /*!< GPIO_PORT MASK2: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK2: MASKP26 Position   */\r
+#define GPIO_PORT_MASK2_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP26_Pos)                   /*!< GPIO_PORT MASK2: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK2: MASKP27 Position   */\r
+#define GPIO_PORT_MASK2_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP27_Pos)                   /*!< GPIO_PORT MASK2: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK2: MASKP28 Position   */\r
+#define GPIO_PORT_MASK2_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP28_Pos)                   /*!< GPIO_PORT MASK2: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK2: MASKP29 Position   */\r
+#define GPIO_PORT_MASK2_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP29_Pos)                   /*!< GPIO_PORT MASK2: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK2: MASKP30 Position   */\r
+#define GPIO_PORT_MASK2_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP30_Pos)                   /*!< GPIO_PORT MASK2: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK2_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK2: MASKP31 Position   */\r
+#define GPIO_PORT_MASK2_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK2_MASKP31_Pos)                   /*!< GPIO_PORT MASK2: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK3  ----------------------------------------\r
+#define GPIO_PORT_MASK3_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK3: MASKP0 Position    */\r
+#define GPIO_PORT_MASK3_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP0_Pos)                    /*!< GPIO_PORT MASK3: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK3: MASKP1 Position    */\r
+#define GPIO_PORT_MASK3_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP1_Pos)                    /*!< GPIO_PORT MASK3: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK3: MASKP2 Position    */\r
+#define GPIO_PORT_MASK3_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP2_Pos)                    /*!< GPIO_PORT MASK3: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK3: MASKP3 Position    */\r
+#define GPIO_PORT_MASK3_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP3_Pos)                    /*!< GPIO_PORT MASK3: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK3: MASKP4 Position    */\r
+#define GPIO_PORT_MASK3_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP4_Pos)                    /*!< GPIO_PORT MASK3: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK3: MASKP5 Position    */\r
+#define GPIO_PORT_MASK3_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP5_Pos)                    /*!< GPIO_PORT MASK3: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK3: MASKP6 Position    */\r
+#define GPIO_PORT_MASK3_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP6_Pos)                    /*!< GPIO_PORT MASK3: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK3: MASKP7 Position    */\r
+#define GPIO_PORT_MASK3_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP7_Pos)                    /*!< GPIO_PORT MASK3: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK3: MASKP8 Position    */\r
+#define GPIO_PORT_MASK3_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP8_Pos)                    /*!< GPIO_PORT MASK3: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK3: MASKP9 Position    */\r
+#define GPIO_PORT_MASK3_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK3_MASKP9_Pos)                    /*!< GPIO_PORT MASK3: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK3_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK3: MASKP10 Position   */\r
+#define GPIO_PORT_MASK3_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP10_Pos)                   /*!< GPIO_PORT MASK3: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK3: MASKP11 Position   */\r
+#define GPIO_PORT_MASK3_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP11_Pos)                   /*!< GPIO_PORT MASK3: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK3: MASKP12 Position   */\r
+#define GPIO_PORT_MASK3_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP12_Pos)                   /*!< GPIO_PORT MASK3: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK3: MASKP13 Position   */\r
+#define GPIO_PORT_MASK3_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP13_Pos)                   /*!< GPIO_PORT MASK3: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK3: MASKP14 Position   */\r
+#define GPIO_PORT_MASK3_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP14_Pos)                   /*!< GPIO_PORT MASK3: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK3: MASKP15 Position   */\r
+#define GPIO_PORT_MASK3_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP15_Pos)                   /*!< GPIO_PORT MASK3: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK3: MASKP16 Position   */\r
+#define GPIO_PORT_MASK3_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP16_Pos)                   /*!< GPIO_PORT MASK3: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK3: MASKP17 Position   */\r
+#define GPIO_PORT_MASK3_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP17_Pos)                   /*!< GPIO_PORT MASK3: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK3: MASKP18 Position   */\r
+#define GPIO_PORT_MASK3_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP18_Pos)                   /*!< GPIO_PORT MASK3: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK3: MASKP19 Position   */\r
+#define GPIO_PORT_MASK3_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP19_Pos)                   /*!< GPIO_PORT MASK3: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK3: MASKP20 Position   */\r
+#define GPIO_PORT_MASK3_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP20_Pos)                   /*!< GPIO_PORT MASK3: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK3: MASKP21 Position   */\r
+#define GPIO_PORT_MASK3_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP21_Pos)                   /*!< GPIO_PORT MASK3: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK3: MASKP22 Position   */\r
+#define GPIO_PORT_MASK3_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP22_Pos)                   /*!< GPIO_PORT MASK3: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK3: MASKP23 Position   */\r
+#define GPIO_PORT_MASK3_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP23_Pos)                   /*!< GPIO_PORT MASK3: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK3: MASKP24 Position   */\r
+#define GPIO_PORT_MASK3_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP24_Pos)                   /*!< GPIO_PORT MASK3: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK3: MASKP25 Position   */\r
+#define GPIO_PORT_MASK3_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP25_Pos)                   /*!< GPIO_PORT MASK3: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK3: MASKP26 Position   */\r
+#define GPIO_PORT_MASK3_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP26_Pos)                   /*!< GPIO_PORT MASK3: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK3: MASKP27 Position   */\r
+#define GPIO_PORT_MASK3_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP27_Pos)                   /*!< GPIO_PORT MASK3: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK3: MASKP28 Position   */\r
+#define GPIO_PORT_MASK3_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP28_Pos)                   /*!< GPIO_PORT MASK3: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK3: MASKP29 Position   */\r
+#define GPIO_PORT_MASK3_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP29_Pos)                   /*!< GPIO_PORT MASK3: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK3: MASKP30 Position   */\r
+#define GPIO_PORT_MASK3_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP30_Pos)                   /*!< GPIO_PORT MASK3: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK3_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK3: MASKP31 Position   */\r
+#define GPIO_PORT_MASK3_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK3_MASKP31_Pos)                   /*!< GPIO_PORT MASK3: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK4  ----------------------------------------\r
+#define GPIO_PORT_MASK4_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK4: MASKP0 Position    */\r
+#define GPIO_PORT_MASK4_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP0_Pos)                    /*!< GPIO_PORT MASK4: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK4: MASKP1 Position    */\r
+#define GPIO_PORT_MASK4_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP1_Pos)                    /*!< GPIO_PORT MASK4: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK4: MASKP2 Position    */\r
+#define GPIO_PORT_MASK4_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP2_Pos)                    /*!< GPIO_PORT MASK4: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK4: MASKP3 Position    */\r
+#define GPIO_PORT_MASK4_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP3_Pos)                    /*!< GPIO_PORT MASK4: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK4: MASKP4 Position    */\r
+#define GPIO_PORT_MASK4_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP4_Pos)                    /*!< GPIO_PORT MASK4: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK4: MASKP5 Position    */\r
+#define GPIO_PORT_MASK4_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP5_Pos)                    /*!< GPIO_PORT MASK4: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK4: MASKP6 Position    */\r
+#define GPIO_PORT_MASK4_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP6_Pos)                    /*!< GPIO_PORT MASK4: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK4: MASKP7 Position    */\r
+#define GPIO_PORT_MASK4_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP7_Pos)                    /*!< GPIO_PORT MASK4: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK4: MASKP8 Position    */\r
+#define GPIO_PORT_MASK4_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP8_Pos)                    /*!< GPIO_PORT MASK4: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK4: MASKP9 Position    */\r
+#define GPIO_PORT_MASK4_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK4_MASKP9_Pos)                    /*!< GPIO_PORT MASK4: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK4_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK4: MASKP10 Position   */\r
+#define GPIO_PORT_MASK4_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP10_Pos)                   /*!< GPIO_PORT MASK4: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK4: MASKP11 Position   */\r
+#define GPIO_PORT_MASK4_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP11_Pos)                   /*!< GPIO_PORT MASK4: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK4: MASKP12 Position   */\r
+#define GPIO_PORT_MASK4_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP12_Pos)                   /*!< GPIO_PORT MASK4: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK4: MASKP13 Position   */\r
+#define GPIO_PORT_MASK4_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP13_Pos)                   /*!< GPIO_PORT MASK4: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK4: MASKP14 Position   */\r
+#define GPIO_PORT_MASK4_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP14_Pos)                   /*!< GPIO_PORT MASK4: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK4: MASKP15 Position   */\r
+#define GPIO_PORT_MASK4_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP15_Pos)                   /*!< GPIO_PORT MASK4: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK4: MASKP16 Position   */\r
+#define GPIO_PORT_MASK4_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP16_Pos)                   /*!< GPIO_PORT MASK4: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK4: MASKP17 Position   */\r
+#define GPIO_PORT_MASK4_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP17_Pos)                   /*!< GPIO_PORT MASK4: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK4: MASKP18 Position   */\r
+#define GPIO_PORT_MASK4_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP18_Pos)                   /*!< GPIO_PORT MASK4: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK4: MASKP19 Position   */\r
+#define GPIO_PORT_MASK4_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP19_Pos)                   /*!< GPIO_PORT MASK4: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK4: MASKP20 Position   */\r
+#define GPIO_PORT_MASK4_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP20_Pos)                   /*!< GPIO_PORT MASK4: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK4: MASKP21 Position   */\r
+#define GPIO_PORT_MASK4_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP21_Pos)                   /*!< GPIO_PORT MASK4: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK4: MASKP22 Position   */\r
+#define GPIO_PORT_MASK4_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP22_Pos)                   /*!< GPIO_PORT MASK4: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK4: MASKP23 Position   */\r
+#define GPIO_PORT_MASK4_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP23_Pos)                   /*!< GPIO_PORT MASK4: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK4: MASKP24 Position   */\r
+#define GPIO_PORT_MASK4_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP24_Pos)                   /*!< GPIO_PORT MASK4: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK4: MASKP25 Position   */\r
+#define GPIO_PORT_MASK4_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP25_Pos)                   /*!< GPIO_PORT MASK4: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK4: MASKP26 Position   */\r
+#define GPIO_PORT_MASK4_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP26_Pos)                   /*!< GPIO_PORT MASK4: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK4: MASKP27 Position   */\r
+#define GPIO_PORT_MASK4_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP27_Pos)                   /*!< GPIO_PORT MASK4: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK4: MASKP28 Position   */\r
+#define GPIO_PORT_MASK4_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP28_Pos)                   /*!< GPIO_PORT MASK4: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK4: MASKP29 Position   */\r
+#define GPIO_PORT_MASK4_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP29_Pos)                   /*!< GPIO_PORT MASK4: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK4: MASKP30 Position   */\r
+#define GPIO_PORT_MASK4_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP30_Pos)                   /*!< GPIO_PORT MASK4: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK4_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK4: MASKP31 Position   */\r
+#define GPIO_PORT_MASK4_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK4_MASKP31_Pos)                   /*!< GPIO_PORT MASK4: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK5  ----------------------------------------\r
+#define GPIO_PORT_MASK5_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK5: MASKP0 Position    */\r
+#define GPIO_PORT_MASK5_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP0_Pos)                    /*!< GPIO_PORT MASK5: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK5: MASKP1 Position    */\r
+#define GPIO_PORT_MASK5_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP1_Pos)                    /*!< GPIO_PORT MASK5: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK5: MASKP2 Position    */\r
+#define GPIO_PORT_MASK5_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP2_Pos)                    /*!< GPIO_PORT MASK5: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK5: MASKP3 Position    */\r
+#define GPIO_PORT_MASK5_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP3_Pos)                    /*!< GPIO_PORT MASK5: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK5: MASKP4 Position    */\r
+#define GPIO_PORT_MASK5_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP4_Pos)                    /*!< GPIO_PORT MASK5: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK5: MASKP5 Position    */\r
+#define GPIO_PORT_MASK5_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP5_Pos)                    /*!< GPIO_PORT MASK5: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK5: MASKP6 Position    */\r
+#define GPIO_PORT_MASK5_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP6_Pos)                    /*!< GPIO_PORT MASK5: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK5: MASKP7 Position    */\r
+#define GPIO_PORT_MASK5_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP7_Pos)                    /*!< GPIO_PORT MASK5: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK5: MASKP8 Position    */\r
+#define GPIO_PORT_MASK5_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP8_Pos)                    /*!< GPIO_PORT MASK5: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK5: MASKP9 Position    */\r
+#define GPIO_PORT_MASK5_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK5_MASKP9_Pos)                    /*!< GPIO_PORT MASK5: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK5_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK5: MASKP10 Position   */\r
+#define GPIO_PORT_MASK5_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP10_Pos)                   /*!< GPIO_PORT MASK5: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK5: MASKP11 Position   */\r
+#define GPIO_PORT_MASK5_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP11_Pos)                   /*!< GPIO_PORT MASK5: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK5: MASKP12 Position   */\r
+#define GPIO_PORT_MASK5_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP12_Pos)                   /*!< GPIO_PORT MASK5: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK5: MASKP13 Position   */\r
+#define GPIO_PORT_MASK5_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP13_Pos)                   /*!< GPIO_PORT MASK5: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK5: MASKP14 Position   */\r
+#define GPIO_PORT_MASK5_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP14_Pos)                   /*!< GPIO_PORT MASK5: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK5: MASKP15 Position   */\r
+#define GPIO_PORT_MASK5_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP15_Pos)                   /*!< GPIO_PORT MASK5: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK5: MASKP16 Position   */\r
+#define GPIO_PORT_MASK5_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP16_Pos)                   /*!< GPIO_PORT MASK5: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK5: MASKP17 Position   */\r
+#define GPIO_PORT_MASK5_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP17_Pos)                   /*!< GPIO_PORT MASK5: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK5: MASKP18 Position   */\r
+#define GPIO_PORT_MASK5_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP18_Pos)                   /*!< GPIO_PORT MASK5: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK5: MASKP19 Position   */\r
+#define GPIO_PORT_MASK5_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP19_Pos)                   /*!< GPIO_PORT MASK5: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK5: MASKP20 Position   */\r
+#define GPIO_PORT_MASK5_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP20_Pos)                   /*!< GPIO_PORT MASK5: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK5: MASKP21 Position   */\r
+#define GPIO_PORT_MASK5_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP21_Pos)                   /*!< GPIO_PORT MASK5: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK5: MASKP22 Position   */\r
+#define GPIO_PORT_MASK5_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP22_Pos)                   /*!< GPIO_PORT MASK5: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK5: MASKP23 Position   */\r
+#define GPIO_PORT_MASK5_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP23_Pos)                   /*!< GPIO_PORT MASK5: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK5: MASKP24 Position   */\r
+#define GPIO_PORT_MASK5_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP24_Pos)                   /*!< GPIO_PORT MASK5: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK5: MASKP25 Position   */\r
+#define GPIO_PORT_MASK5_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP25_Pos)                   /*!< GPIO_PORT MASK5: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK5: MASKP26 Position   */\r
+#define GPIO_PORT_MASK5_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP26_Pos)                   /*!< GPIO_PORT MASK5: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK5: MASKP27 Position   */\r
+#define GPIO_PORT_MASK5_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP27_Pos)                   /*!< GPIO_PORT MASK5: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK5: MASKP28 Position   */\r
+#define GPIO_PORT_MASK5_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP28_Pos)                   /*!< GPIO_PORT MASK5: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK5: MASKP29 Position   */\r
+#define GPIO_PORT_MASK5_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP29_Pos)                   /*!< GPIO_PORT MASK5: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK5: MASKP30 Position   */\r
+#define GPIO_PORT_MASK5_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP30_Pos)                   /*!< GPIO_PORT MASK5: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK5_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK5: MASKP31 Position   */\r
+#define GPIO_PORT_MASK5_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK5_MASKP31_Pos)                   /*!< GPIO_PORT MASK5: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK6  ----------------------------------------\r
+#define GPIO_PORT_MASK6_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK6: MASKP0 Position    */\r
+#define GPIO_PORT_MASK6_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP0_Pos)                    /*!< GPIO_PORT MASK6: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK6: MASKP1 Position    */\r
+#define GPIO_PORT_MASK6_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP1_Pos)                    /*!< GPIO_PORT MASK6: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK6: MASKP2 Position    */\r
+#define GPIO_PORT_MASK6_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP2_Pos)                    /*!< GPIO_PORT MASK6: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK6: MASKP3 Position    */\r
+#define GPIO_PORT_MASK6_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP3_Pos)                    /*!< GPIO_PORT MASK6: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK6: MASKP4 Position    */\r
+#define GPIO_PORT_MASK6_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP4_Pos)                    /*!< GPIO_PORT MASK6: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK6: MASKP5 Position    */\r
+#define GPIO_PORT_MASK6_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP5_Pos)                    /*!< GPIO_PORT MASK6: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK6: MASKP6 Position    */\r
+#define GPIO_PORT_MASK6_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP6_Pos)                    /*!< GPIO_PORT MASK6: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK6: MASKP7 Position    */\r
+#define GPIO_PORT_MASK6_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP7_Pos)                    /*!< GPIO_PORT MASK6: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK6: MASKP8 Position    */\r
+#define GPIO_PORT_MASK6_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP8_Pos)                    /*!< GPIO_PORT MASK6: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK6: MASKP9 Position    */\r
+#define GPIO_PORT_MASK6_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK6_MASKP9_Pos)                    /*!< GPIO_PORT MASK6: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK6_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK6: MASKP10 Position   */\r
+#define GPIO_PORT_MASK6_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP10_Pos)                   /*!< GPIO_PORT MASK6: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK6: MASKP11 Position   */\r
+#define GPIO_PORT_MASK6_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP11_Pos)                   /*!< GPIO_PORT MASK6: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK6: MASKP12 Position   */\r
+#define GPIO_PORT_MASK6_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP12_Pos)                   /*!< GPIO_PORT MASK6: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK6: MASKP13 Position   */\r
+#define GPIO_PORT_MASK6_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP13_Pos)                   /*!< GPIO_PORT MASK6: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK6: MASKP14 Position   */\r
+#define GPIO_PORT_MASK6_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP14_Pos)                   /*!< GPIO_PORT MASK6: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK6: MASKP15 Position   */\r
+#define GPIO_PORT_MASK6_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP15_Pos)                   /*!< GPIO_PORT MASK6: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK6: MASKP16 Position   */\r
+#define GPIO_PORT_MASK6_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP16_Pos)                   /*!< GPIO_PORT MASK6: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK6: MASKP17 Position   */\r
+#define GPIO_PORT_MASK6_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP17_Pos)                   /*!< GPIO_PORT MASK6: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK6: MASKP18 Position   */\r
+#define GPIO_PORT_MASK6_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP18_Pos)                   /*!< GPIO_PORT MASK6: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK6: MASKP19 Position   */\r
+#define GPIO_PORT_MASK6_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP19_Pos)                   /*!< GPIO_PORT MASK6: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK6: MASKP20 Position   */\r
+#define GPIO_PORT_MASK6_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP20_Pos)                   /*!< GPIO_PORT MASK6: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK6: MASKP21 Position   */\r
+#define GPIO_PORT_MASK6_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP21_Pos)                   /*!< GPIO_PORT MASK6: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK6: MASKP22 Position   */\r
+#define GPIO_PORT_MASK6_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP22_Pos)                   /*!< GPIO_PORT MASK6: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK6: MASKP23 Position   */\r
+#define GPIO_PORT_MASK6_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP23_Pos)                   /*!< GPIO_PORT MASK6: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK6: MASKP24 Position   */\r
+#define GPIO_PORT_MASK6_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP24_Pos)                   /*!< GPIO_PORT MASK6: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK6: MASKP25 Position   */\r
+#define GPIO_PORT_MASK6_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP25_Pos)                   /*!< GPIO_PORT MASK6: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK6: MASKP26 Position   */\r
+#define GPIO_PORT_MASK6_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP26_Pos)                   /*!< GPIO_PORT MASK6: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK6: MASKP27 Position   */\r
+#define GPIO_PORT_MASK6_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP27_Pos)                   /*!< GPIO_PORT MASK6: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK6: MASKP28 Position   */\r
+#define GPIO_PORT_MASK6_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP28_Pos)                   /*!< GPIO_PORT MASK6: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK6: MASKP29 Position   */\r
+#define GPIO_PORT_MASK6_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP29_Pos)                   /*!< GPIO_PORT MASK6: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK6: MASKP30 Position   */\r
+#define GPIO_PORT_MASK6_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP30_Pos)                   /*!< GPIO_PORT MASK6: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK6_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK6: MASKP31 Position   */\r
+#define GPIO_PORT_MASK6_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK6_MASKP31_Pos)                   /*!< GPIO_PORT MASK6: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_MASK7  ----------------------------------------\r
+#define GPIO_PORT_MASK7_MASKP0_Pos                            0                                                         /*!< GPIO_PORT MASK7: MASKP0 Position    */\r
+#define GPIO_PORT_MASK7_MASKP0_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP0_Pos)                    /*!< GPIO_PORT MASK7: MASKP0 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP1_Pos                            1                                                         /*!< GPIO_PORT MASK7: MASKP1 Position    */\r
+#define GPIO_PORT_MASK7_MASKP1_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP1_Pos)                    /*!< GPIO_PORT MASK7: MASKP1 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP2_Pos                            2                                                         /*!< GPIO_PORT MASK7: MASKP2 Position    */\r
+#define GPIO_PORT_MASK7_MASKP2_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP2_Pos)                    /*!< GPIO_PORT MASK7: MASKP2 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP3_Pos                            3                                                         /*!< GPIO_PORT MASK7: MASKP3 Position    */\r
+#define GPIO_PORT_MASK7_MASKP3_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP3_Pos)                    /*!< GPIO_PORT MASK7: MASKP3 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP4_Pos                            4                                                         /*!< GPIO_PORT MASK7: MASKP4 Position    */\r
+#define GPIO_PORT_MASK7_MASKP4_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP4_Pos)                    /*!< GPIO_PORT MASK7: MASKP4 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP5_Pos                            5                                                         /*!< GPIO_PORT MASK7: MASKP5 Position    */\r
+#define GPIO_PORT_MASK7_MASKP5_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP5_Pos)                    /*!< GPIO_PORT MASK7: MASKP5 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP6_Pos                            6                                                         /*!< GPIO_PORT MASK7: MASKP6 Position    */\r
+#define GPIO_PORT_MASK7_MASKP6_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP6_Pos)                    /*!< GPIO_PORT MASK7: MASKP6 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP7_Pos                            7                                                         /*!< GPIO_PORT MASK7: MASKP7 Position    */\r
+#define GPIO_PORT_MASK7_MASKP7_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP7_Pos)                    /*!< GPIO_PORT MASK7: MASKP7 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP8_Pos                            8                                                         /*!< GPIO_PORT MASK7: MASKP8 Position    */\r
+#define GPIO_PORT_MASK7_MASKP8_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP8_Pos)                    /*!< GPIO_PORT MASK7: MASKP8 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP9_Pos                            9                                                         /*!< GPIO_PORT MASK7: MASKP9 Position    */\r
+#define GPIO_PORT_MASK7_MASKP9_Msk                            (0x01UL << GPIO_PORT_MASK7_MASKP9_Pos)                    /*!< GPIO_PORT MASK7: MASKP9 Mask        */\r
+#define GPIO_PORT_MASK7_MASKP10_Pos                           10                                                        /*!< GPIO_PORT MASK7: MASKP10 Position   */\r
+#define GPIO_PORT_MASK7_MASKP10_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP10_Pos)                   /*!< GPIO_PORT MASK7: MASKP10 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP11_Pos                           11                                                        /*!< GPIO_PORT MASK7: MASKP11 Position   */\r
+#define GPIO_PORT_MASK7_MASKP11_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP11_Pos)                   /*!< GPIO_PORT MASK7: MASKP11 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP12_Pos                           12                                                        /*!< GPIO_PORT MASK7: MASKP12 Position   */\r
+#define GPIO_PORT_MASK7_MASKP12_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP12_Pos)                   /*!< GPIO_PORT MASK7: MASKP12 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP13_Pos                           13                                                        /*!< GPIO_PORT MASK7: MASKP13 Position   */\r
+#define GPIO_PORT_MASK7_MASKP13_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP13_Pos)                   /*!< GPIO_PORT MASK7: MASKP13 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP14_Pos                           14                                                        /*!< GPIO_PORT MASK7: MASKP14 Position   */\r
+#define GPIO_PORT_MASK7_MASKP14_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP14_Pos)                   /*!< GPIO_PORT MASK7: MASKP14 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP15_Pos                           15                                                        /*!< GPIO_PORT MASK7: MASKP15 Position   */\r
+#define GPIO_PORT_MASK7_MASKP15_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP15_Pos)                   /*!< GPIO_PORT MASK7: MASKP15 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP16_Pos                           16                                                        /*!< GPIO_PORT MASK7: MASKP16 Position   */\r
+#define GPIO_PORT_MASK7_MASKP16_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP16_Pos)                   /*!< GPIO_PORT MASK7: MASKP16 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP17_Pos                           17                                                        /*!< GPIO_PORT MASK7: MASKP17 Position   */\r
+#define GPIO_PORT_MASK7_MASKP17_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP17_Pos)                   /*!< GPIO_PORT MASK7: MASKP17 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP18_Pos                           18                                                        /*!< GPIO_PORT MASK7: MASKP18 Position   */\r
+#define GPIO_PORT_MASK7_MASKP18_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP18_Pos)                   /*!< GPIO_PORT MASK7: MASKP18 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP19_Pos                           19                                                        /*!< GPIO_PORT MASK7: MASKP19 Position   */\r
+#define GPIO_PORT_MASK7_MASKP19_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP19_Pos)                   /*!< GPIO_PORT MASK7: MASKP19 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP20_Pos                           20                                                        /*!< GPIO_PORT MASK7: MASKP20 Position   */\r
+#define GPIO_PORT_MASK7_MASKP20_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP20_Pos)                   /*!< GPIO_PORT MASK7: MASKP20 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP21_Pos                           21                                                        /*!< GPIO_PORT MASK7: MASKP21 Position   */\r
+#define GPIO_PORT_MASK7_MASKP21_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP21_Pos)                   /*!< GPIO_PORT MASK7: MASKP21 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP22_Pos                           22                                                        /*!< GPIO_PORT MASK7: MASKP22 Position   */\r
+#define GPIO_PORT_MASK7_MASKP22_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP22_Pos)                   /*!< GPIO_PORT MASK7: MASKP22 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP23_Pos                           23                                                        /*!< GPIO_PORT MASK7: MASKP23 Position   */\r
+#define GPIO_PORT_MASK7_MASKP23_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP23_Pos)                   /*!< GPIO_PORT MASK7: MASKP23 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP24_Pos                           24                                                        /*!< GPIO_PORT MASK7: MASKP24 Position   */\r
+#define GPIO_PORT_MASK7_MASKP24_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP24_Pos)                   /*!< GPIO_PORT MASK7: MASKP24 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP25_Pos                           25                                                        /*!< GPIO_PORT MASK7: MASKP25 Position   */\r
+#define GPIO_PORT_MASK7_MASKP25_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP25_Pos)                   /*!< GPIO_PORT MASK7: MASKP25 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP26_Pos                           26                                                        /*!< GPIO_PORT MASK7: MASKP26 Position   */\r
+#define GPIO_PORT_MASK7_MASKP26_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP26_Pos)                   /*!< GPIO_PORT MASK7: MASKP26 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP27_Pos                           27                                                        /*!< GPIO_PORT MASK7: MASKP27 Position   */\r
+#define GPIO_PORT_MASK7_MASKP27_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP27_Pos)                   /*!< GPIO_PORT MASK7: MASKP27 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP28_Pos                           28                                                        /*!< GPIO_PORT MASK7: MASKP28 Position   */\r
+#define GPIO_PORT_MASK7_MASKP28_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP28_Pos)                   /*!< GPIO_PORT MASK7: MASKP28 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP29_Pos                           29                                                        /*!< GPIO_PORT MASK7: MASKP29 Position   */\r
+#define GPIO_PORT_MASK7_MASKP29_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP29_Pos)                   /*!< GPIO_PORT MASK7: MASKP29 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP30_Pos                           30                                                        /*!< GPIO_PORT MASK7: MASKP30 Position   */\r
+#define GPIO_PORT_MASK7_MASKP30_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP30_Pos)                   /*!< GPIO_PORT MASK7: MASKP30 Mask       */\r
+#define GPIO_PORT_MASK7_MASKP31_Pos                           31                                                        /*!< GPIO_PORT MASK7: MASKP31 Position   */\r
+#define GPIO_PORT_MASK7_MASKP31_Msk                           (0x01UL << GPIO_PORT_MASK7_MASKP31_Pos)                   /*!< GPIO_PORT MASK7: MASKP31 Mask       */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN0  -----------------------------------------\r
+#define GPIO_PORT_PIN0_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN0: PORT0 Position      */\r
+#define GPIO_PORT_PIN0_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT0_Pos)                      /*!< GPIO_PORT PIN0: PORT0 Mask          */\r
+#define GPIO_PORT_PIN0_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN0: PORT1 Position      */\r
+#define GPIO_PORT_PIN0_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT1_Pos)                      /*!< GPIO_PORT PIN0: PORT1 Mask          */\r
+#define GPIO_PORT_PIN0_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN0: PORT2 Position      */\r
+#define GPIO_PORT_PIN0_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT2_Pos)                      /*!< GPIO_PORT PIN0: PORT2 Mask          */\r
+#define GPIO_PORT_PIN0_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN0: PORT3 Position      */\r
+#define GPIO_PORT_PIN0_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT3_Pos)                      /*!< GPIO_PORT PIN0: PORT3 Mask          */\r
+#define GPIO_PORT_PIN0_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN0: PORT4 Position      */\r
+#define GPIO_PORT_PIN0_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT4_Pos)                      /*!< GPIO_PORT PIN0: PORT4 Mask          */\r
+#define GPIO_PORT_PIN0_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN0: PORT5 Position      */\r
+#define GPIO_PORT_PIN0_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT5_Pos)                      /*!< GPIO_PORT PIN0: PORT5 Mask          */\r
+#define GPIO_PORT_PIN0_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN0: PORT6 Position      */\r
+#define GPIO_PORT_PIN0_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT6_Pos)                      /*!< GPIO_PORT PIN0: PORT6 Mask          */\r
+#define GPIO_PORT_PIN0_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN0: PORT7 Position      */\r
+#define GPIO_PORT_PIN0_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT7_Pos)                      /*!< GPIO_PORT PIN0: PORT7 Mask          */\r
+#define GPIO_PORT_PIN0_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN0: PORT8 Position      */\r
+#define GPIO_PORT_PIN0_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT8_Pos)                      /*!< GPIO_PORT PIN0: PORT8 Mask          */\r
+#define GPIO_PORT_PIN0_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN0: PORT9 Position      */\r
+#define GPIO_PORT_PIN0_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN0_PORT9_Pos)                      /*!< GPIO_PORT PIN0: PORT9 Mask          */\r
+#define GPIO_PORT_PIN0_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN0: PORT10 Position     */\r
+#define GPIO_PORT_PIN0_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT10_Pos)                     /*!< GPIO_PORT PIN0: PORT10 Mask         */\r
+#define GPIO_PORT_PIN0_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN0: PORT11 Position     */\r
+#define GPIO_PORT_PIN0_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT11_Pos)                     /*!< GPIO_PORT PIN0: PORT11 Mask         */\r
+#define GPIO_PORT_PIN0_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN0: PORT12 Position     */\r
+#define GPIO_PORT_PIN0_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT12_Pos)                     /*!< GPIO_PORT PIN0: PORT12 Mask         */\r
+#define GPIO_PORT_PIN0_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN0: PORT13 Position     */\r
+#define GPIO_PORT_PIN0_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT13_Pos)                     /*!< GPIO_PORT PIN0: PORT13 Mask         */\r
+#define GPIO_PORT_PIN0_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN0: PORT14 Position     */\r
+#define GPIO_PORT_PIN0_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT14_Pos)                     /*!< GPIO_PORT PIN0: PORT14 Mask         */\r
+#define GPIO_PORT_PIN0_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN0: PORT15 Position     */\r
+#define GPIO_PORT_PIN0_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT15_Pos)                     /*!< GPIO_PORT PIN0: PORT15 Mask         */\r
+#define GPIO_PORT_PIN0_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN0: PORT16 Position     */\r
+#define GPIO_PORT_PIN0_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT16_Pos)                     /*!< GPIO_PORT PIN0: PORT16 Mask         */\r
+#define GPIO_PORT_PIN0_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN0: PORT17 Position     */\r
+#define GPIO_PORT_PIN0_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT17_Pos)                     /*!< GPIO_PORT PIN0: PORT17 Mask         */\r
+#define GPIO_PORT_PIN0_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN0: PORT18 Position     */\r
+#define GPIO_PORT_PIN0_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT18_Pos)                     /*!< GPIO_PORT PIN0: PORT18 Mask         */\r
+#define GPIO_PORT_PIN0_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN0: PORT19 Position     */\r
+#define GPIO_PORT_PIN0_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT19_Pos)                     /*!< GPIO_PORT PIN0: PORT19 Mask         */\r
+#define GPIO_PORT_PIN0_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN0: PORT20 Position     */\r
+#define GPIO_PORT_PIN0_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT20_Pos)                     /*!< GPIO_PORT PIN0: PORT20 Mask         */\r
+#define GPIO_PORT_PIN0_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN0: PORT21 Position     */\r
+#define GPIO_PORT_PIN0_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT21_Pos)                     /*!< GPIO_PORT PIN0: PORT21 Mask         */\r
+#define GPIO_PORT_PIN0_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN0: PORT22 Position     */\r
+#define GPIO_PORT_PIN0_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT22_Pos)                     /*!< GPIO_PORT PIN0: PORT22 Mask         */\r
+#define GPIO_PORT_PIN0_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN0: PORT23 Position     */\r
+#define GPIO_PORT_PIN0_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT23_Pos)                     /*!< GPIO_PORT PIN0: PORT23 Mask         */\r
+#define GPIO_PORT_PIN0_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN0: PORT24 Position     */\r
+#define GPIO_PORT_PIN0_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT24_Pos)                     /*!< GPIO_PORT PIN0: PORT24 Mask         */\r
+#define GPIO_PORT_PIN0_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN0: PORT25 Position     */\r
+#define GPIO_PORT_PIN0_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT25_Pos)                     /*!< GPIO_PORT PIN0: PORT25 Mask         */\r
+#define GPIO_PORT_PIN0_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN0: PORT26 Position     */\r
+#define GPIO_PORT_PIN0_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT26_Pos)                     /*!< GPIO_PORT PIN0: PORT26 Mask         */\r
+#define GPIO_PORT_PIN0_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN0: PORT27 Position     */\r
+#define GPIO_PORT_PIN0_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT27_Pos)                     /*!< GPIO_PORT PIN0: PORT27 Mask         */\r
+#define GPIO_PORT_PIN0_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN0: PORT28 Position     */\r
+#define GPIO_PORT_PIN0_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT28_Pos)                     /*!< GPIO_PORT PIN0: PORT28 Mask         */\r
+#define GPIO_PORT_PIN0_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN0: PORT29 Position     */\r
+#define GPIO_PORT_PIN0_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT29_Pos)                     /*!< GPIO_PORT PIN0: PORT29 Mask         */\r
+#define GPIO_PORT_PIN0_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN0: PORT30 Position     */\r
+#define GPIO_PORT_PIN0_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT30_Pos)                     /*!< GPIO_PORT PIN0: PORT30 Mask         */\r
+#define GPIO_PORT_PIN0_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN0: PORT31 Position     */\r
+#define GPIO_PORT_PIN0_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN0_PORT31_Pos)                     /*!< GPIO_PORT PIN0: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN1  -----------------------------------------\r
+#define GPIO_PORT_PIN1_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN1: PORT0 Position      */\r
+#define GPIO_PORT_PIN1_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT0_Pos)                      /*!< GPIO_PORT PIN1: PORT0 Mask          */\r
+#define GPIO_PORT_PIN1_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN1: PORT1 Position      */\r
+#define GPIO_PORT_PIN1_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT1_Pos)                      /*!< GPIO_PORT PIN1: PORT1 Mask          */\r
+#define GPIO_PORT_PIN1_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN1: PORT2 Position      */\r
+#define GPIO_PORT_PIN1_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT2_Pos)                      /*!< GPIO_PORT PIN1: PORT2 Mask          */\r
+#define GPIO_PORT_PIN1_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN1: PORT3 Position      */\r
+#define GPIO_PORT_PIN1_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT3_Pos)                      /*!< GPIO_PORT PIN1: PORT3 Mask          */\r
+#define GPIO_PORT_PIN1_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN1: PORT4 Position      */\r
+#define GPIO_PORT_PIN1_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT4_Pos)                      /*!< GPIO_PORT PIN1: PORT4 Mask          */\r
+#define GPIO_PORT_PIN1_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN1: PORT5 Position      */\r
+#define GPIO_PORT_PIN1_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT5_Pos)                      /*!< GPIO_PORT PIN1: PORT5 Mask          */\r
+#define GPIO_PORT_PIN1_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN1: PORT6 Position      */\r
+#define GPIO_PORT_PIN1_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT6_Pos)                      /*!< GPIO_PORT PIN1: PORT6 Mask          */\r
+#define GPIO_PORT_PIN1_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN1: PORT7 Position      */\r
+#define GPIO_PORT_PIN1_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT7_Pos)                      /*!< GPIO_PORT PIN1: PORT7 Mask          */\r
+#define GPIO_PORT_PIN1_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN1: PORT8 Position      */\r
+#define GPIO_PORT_PIN1_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT8_Pos)                      /*!< GPIO_PORT PIN1: PORT8 Mask          */\r
+#define GPIO_PORT_PIN1_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN1: PORT9 Position      */\r
+#define GPIO_PORT_PIN1_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN1_PORT9_Pos)                      /*!< GPIO_PORT PIN1: PORT9 Mask          */\r
+#define GPIO_PORT_PIN1_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN1: PORT10 Position     */\r
+#define GPIO_PORT_PIN1_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT10_Pos)                     /*!< GPIO_PORT PIN1: PORT10 Mask         */\r
+#define GPIO_PORT_PIN1_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN1: PORT11 Position     */\r
+#define GPIO_PORT_PIN1_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT11_Pos)                     /*!< GPIO_PORT PIN1: PORT11 Mask         */\r
+#define GPIO_PORT_PIN1_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN1: PORT12 Position     */\r
+#define GPIO_PORT_PIN1_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT12_Pos)                     /*!< GPIO_PORT PIN1: PORT12 Mask         */\r
+#define GPIO_PORT_PIN1_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN1: PORT13 Position     */\r
+#define GPIO_PORT_PIN1_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT13_Pos)                     /*!< GPIO_PORT PIN1: PORT13 Mask         */\r
+#define GPIO_PORT_PIN1_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN1: PORT14 Position     */\r
+#define GPIO_PORT_PIN1_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT14_Pos)                     /*!< GPIO_PORT PIN1: PORT14 Mask         */\r
+#define GPIO_PORT_PIN1_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN1: PORT15 Position     */\r
+#define GPIO_PORT_PIN1_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT15_Pos)                     /*!< GPIO_PORT PIN1: PORT15 Mask         */\r
+#define GPIO_PORT_PIN1_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN1: PORT16 Position     */\r
+#define GPIO_PORT_PIN1_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT16_Pos)                     /*!< GPIO_PORT PIN1: PORT16 Mask         */\r
+#define GPIO_PORT_PIN1_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN1: PORT17 Position     */\r
+#define GPIO_PORT_PIN1_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT17_Pos)                     /*!< GPIO_PORT PIN1: PORT17 Mask         */\r
+#define GPIO_PORT_PIN1_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN1: PORT18 Position     */\r
+#define GPIO_PORT_PIN1_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT18_Pos)                     /*!< GPIO_PORT PIN1: PORT18 Mask         */\r
+#define GPIO_PORT_PIN1_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN1: PORT19 Position     */\r
+#define GPIO_PORT_PIN1_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT19_Pos)                     /*!< GPIO_PORT PIN1: PORT19 Mask         */\r
+#define GPIO_PORT_PIN1_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN1: PORT20 Position     */\r
+#define GPIO_PORT_PIN1_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT20_Pos)                     /*!< GPIO_PORT PIN1: PORT20 Mask         */\r
+#define GPIO_PORT_PIN1_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN1: PORT21 Position     */\r
+#define GPIO_PORT_PIN1_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT21_Pos)                     /*!< GPIO_PORT PIN1: PORT21 Mask         */\r
+#define GPIO_PORT_PIN1_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN1: PORT22 Position     */\r
+#define GPIO_PORT_PIN1_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT22_Pos)                     /*!< GPIO_PORT PIN1: PORT22 Mask         */\r
+#define GPIO_PORT_PIN1_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN1: PORT23 Position     */\r
+#define GPIO_PORT_PIN1_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT23_Pos)                     /*!< GPIO_PORT PIN1: PORT23 Mask         */\r
+#define GPIO_PORT_PIN1_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN1: PORT24 Position     */\r
+#define GPIO_PORT_PIN1_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT24_Pos)                     /*!< GPIO_PORT PIN1: PORT24 Mask         */\r
+#define GPIO_PORT_PIN1_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN1: PORT25 Position     */\r
+#define GPIO_PORT_PIN1_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT25_Pos)                     /*!< GPIO_PORT PIN1: PORT25 Mask         */\r
+#define GPIO_PORT_PIN1_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN1: PORT26 Position     */\r
+#define GPIO_PORT_PIN1_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT26_Pos)                     /*!< GPIO_PORT PIN1: PORT26 Mask         */\r
+#define GPIO_PORT_PIN1_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN1: PORT27 Position     */\r
+#define GPIO_PORT_PIN1_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT27_Pos)                     /*!< GPIO_PORT PIN1: PORT27 Mask         */\r
+#define GPIO_PORT_PIN1_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN1: PORT28 Position     */\r
+#define GPIO_PORT_PIN1_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT28_Pos)                     /*!< GPIO_PORT PIN1: PORT28 Mask         */\r
+#define GPIO_PORT_PIN1_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN1: PORT29 Position     */\r
+#define GPIO_PORT_PIN1_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT29_Pos)                     /*!< GPIO_PORT PIN1: PORT29 Mask         */\r
+#define GPIO_PORT_PIN1_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN1: PORT30 Position     */\r
+#define GPIO_PORT_PIN1_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT30_Pos)                     /*!< GPIO_PORT PIN1: PORT30 Mask         */\r
+#define GPIO_PORT_PIN1_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN1: PORT31 Position     */\r
+#define GPIO_PORT_PIN1_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN1_PORT31_Pos)                     /*!< GPIO_PORT PIN1: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN2  -----------------------------------------\r
+#define GPIO_PORT_PIN2_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN2: PORT0 Position      */\r
+#define GPIO_PORT_PIN2_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT0_Pos)                      /*!< GPIO_PORT PIN2: PORT0 Mask          */\r
+#define GPIO_PORT_PIN2_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN2: PORT1 Position      */\r
+#define GPIO_PORT_PIN2_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT1_Pos)                      /*!< GPIO_PORT PIN2: PORT1 Mask          */\r
+#define GPIO_PORT_PIN2_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN2: PORT2 Position      */\r
+#define GPIO_PORT_PIN2_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT2_Pos)                      /*!< GPIO_PORT PIN2: PORT2 Mask          */\r
+#define GPIO_PORT_PIN2_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN2: PORT3 Position      */\r
+#define GPIO_PORT_PIN2_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT3_Pos)                      /*!< GPIO_PORT PIN2: PORT3 Mask          */\r
+#define GPIO_PORT_PIN2_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN2: PORT4 Position      */\r
+#define GPIO_PORT_PIN2_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT4_Pos)                      /*!< GPIO_PORT PIN2: PORT4 Mask          */\r
+#define GPIO_PORT_PIN2_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN2: PORT5 Position      */\r
+#define GPIO_PORT_PIN2_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT5_Pos)                      /*!< GPIO_PORT PIN2: PORT5 Mask          */\r
+#define GPIO_PORT_PIN2_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN2: PORT6 Position      */\r
+#define GPIO_PORT_PIN2_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT6_Pos)                      /*!< GPIO_PORT PIN2: PORT6 Mask          */\r
+#define GPIO_PORT_PIN2_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN2: PORT7 Position      */\r
+#define GPIO_PORT_PIN2_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT7_Pos)                      /*!< GPIO_PORT PIN2: PORT7 Mask          */\r
+#define GPIO_PORT_PIN2_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN2: PORT8 Position      */\r
+#define GPIO_PORT_PIN2_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT8_Pos)                      /*!< GPIO_PORT PIN2: PORT8 Mask          */\r
+#define GPIO_PORT_PIN2_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN2: PORT9 Position      */\r
+#define GPIO_PORT_PIN2_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN2_PORT9_Pos)                      /*!< GPIO_PORT PIN2: PORT9 Mask          */\r
+#define GPIO_PORT_PIN2_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN2: PORT10 Position     */\r
+#define GPIO_PORT_PIN2_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT10_Pos)                     /*!< GPIO_PORT PIN2: PORT10 Mask         */\r
+#define GPIO_PORT_PIN2_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN2: PORT11 Position     */\r
+#define GPIO_PORT_PIN2_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT11_Pos)                     /*!< GPIO_PORT PIN2: PORT11 Mask         */\r
+#define GPIO_PORT_PIN2_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN2: PORT12 Position     */\r
+#define GPIO_PORT_PIN2_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT12_Pos)                     /*!< GPIO_PORT PIN2: PORT12 Mask         */\r
+#define GPIO_PORT_PIN2_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN2: PORT13 Position     */\r
+#define GPIO_PORT_PIN2_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT13_Pos)                     /*!< GPIO_PORT PIN2: PORT13 Mask         */\r
+#define GPIO_PORT_PIN2_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN2: PORT14 Position     */\r
+#define GPIO_PORT_PIN2_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT14_Pos)                     /*!< GPIO_PORT PIN2: PORT14 Mask         */\r
+#define GPIO_PORT_PIN2_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN2: PORT15 Position     */\r
+#define GPIO_PORT_PIN2_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT15_Pos)                     /*!< GPIO_PORT PIN2: PORT15 Mask         */\r
+#define GPIO_PORT_PIN2_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN2: PORT16 Position     */\r
+#define GPIO_PORT_PIN2_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT16_Pos)                     /*!< GPIO_PORT PIN2: PORT16 Mask         */\r
+#define GPIO_PORT_PIN2_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN2: PORT17 Position     */\r
+#define GPIO_PORT_PIN2_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT17_Pos)                     /*!< GPIO_PORT PIN2: PORT17 Mask         */\r
+#define GPIO_PORT_PIN2_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN2: PORT18 Position     */\r
+#define GPIO_PORT_PIN2_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT18_Pos)                     /*!< GPIO_PORT PIN2: PORT18 Mask         */\r
+#define GPIO_PORT_PIN2_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN2: PORT19 Position     */\r
+#define GPIO_PORT_PIN2_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT19_Pos)                     /*!< GPIO_PORT PIN2: PORT19 Mask         */\r
+#define GPIO_PORT_PIN2_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN2: PORT20 Position     */\r
+#define GPIO_PORT_PIN2_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT20_Pos)                     /*!< GPIO_PORT PIN2: PORT20 Mask         */\r
+#define GPIO_PORT_PIN2_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN2: PORT21 Position     */\r
+#define GPIO_PORT_PIN2_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT21_Pos)                     /*!< GPIO_PORT PIN2: PORT21 Mask         */\r
+#define GPIO_PORT_PIN2_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN2: PORT22 Position     */\r
+#define GPIO_PORT_PIN2_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT22_Pos)                     /*!< GPIO_PORT PIN2: PORT22 Mask         */\r
+#define GPIO_PORT_PIN2_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN2: PORT23 Position     */\r
+#define GPIO_PORT_PIN2_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT23_Pos)                     /*!< GPIO_PORT PIN2: PORT23 Mask         */\r
+#define GPIO_PORT_PIN2_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN2: PORT24 Position     */\r
+#define GPIO_PORT_PIN2_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT24_Pos)                     /*!< GPIO_PORT PIN2: PORT24 Mask         */\r
+#define GPIO_PORT_PIN2_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN2: PORT25 Position     */\r
+#define GPIO_PORT_PIN2_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT25_Pos)                     /*!< GPIO_PORT PIN2: PORT25 Mask         */\r
+#define GPIO_PORT_PIN2_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN2: PORT26 Position     */\r
+#define GPIO_PORT_PIN2_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT26_Pos)                     /*!< GPIO_PORT PIN2: PORT26 Mask         */\r
+#define GPIO_PORT_PIN2_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN2: PORT27 Position     */\r
+#define GPIO_PORT_PIN2_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT27_Pos)                     /*!< GPIO_PORT PIN2: PORT27 Mask         */\r
+#define GPIO_PORT_PIN2_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN2: PORT28 Position     */\r
+#define GPIO_PORT_PIN2_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT28_Pos)                     /*!< GPIO_PORT PIN2: PORT28 Mask         */\r
+#define GPIO_PORT_PIN2_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN2: PORT29 Position     */\r
+#define GPIO_PORT_PIN2_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT29_Pos)                     /*!< GPIO_PORT PIN2: PORT29 Mask         */\r
+#define GPIO_PORT_PIN2_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN2: PORT30 Position     */\r
+#define GPIO_PORT_PIN2_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT30_Pos)                     /*!< GPIO_PORT PIN2: PORT30 Mask         */\r
+#define GPIO_PORT_PIN2_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN2: PORT31 Position     */\r
+#define GPIO_PORT_PIN2_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN2_PORT31_Pos)                     /*!< GPIO_PORT PIN2: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN3  -----------------------------------------\r
+#define GPIO_PORT_PIN3_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN3: PORT0 Position      */\r
+#define GPIO_PORT_PIN3_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT0_Pos)                      /*!< GPIO_PORT PIN3: PORT0 Mask          */\r
+#define GPIO_PORT_PIN3_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN3: PORT1 Position      */\r
+#define GPIO_PORT_PIN3_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT1_Pos)                      /*!< GPIO_PORT PIN3: PORT1 Mask          */\r
+#define GPIO_PORT_PIN3_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN3: PORT2 Position      */\r
+#define GPIO_PORT_PIN3_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT2_Pos)                      /*!< GPIO_PORT PIN3: PORT2 Mask          */\r
+#define GPIO_PORT_PIN3_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN3: PORT3 Position      */\r
+#define GPIO_PORT_PIN3_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT3_Pos)                      /*!< GPIO_PORT PIN3: PORT3 Mask          */\r
+#define GPIO_PORT_PIN3_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN3: PORT4 Position      */\r
+#define GPIO_PORT_PIN3_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT4_Pos)                      /*!< GPIO_PORT PIN3: PORT4 Mask          */\r
+#define GPIO_PORT_PIN3_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN3: PORT5 Position      */\r
+#define GPIO_PORT_PIN3_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT5_Pos)                      /*!< GPIO_PORT PIN3: PORT5 Mask          */\r
+#define GPIO_PORT_PIN3_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN3: PORT6 Position      */\r
+#define GPIO_PORT_PIN3_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT6_Pos)                      /*!< GPIO_PORT PIN3: PORT6 Mask          */\r
+#define GPIO_PORT_PIN3_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN3: PORT7 Position      */\r
+#define GPIO_PORT_PIN3_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT7_Pos)                      /*!< GPIO_PORT PIN3: PORT7 Mask          */\r
+#define GPIO_PORT_PIN3_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN3: PORT8 Position      */\r
+#define GPIO_PORT_PIN3_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT8_Pos)                      /*!< GPIO_PORT PIN3: PORT8 Mask          */\r
+#define GPIO_PORT_PIN3_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN3: PORT9 Position      */\r
+#define GPIO_PORT_PIN3_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN3_PORT9_Pos)                      /*!< GPIO_PORT PIN3: PORT9 Mask          */\r
+#define GPIO_PORT_PIN3_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN3: PORT10 Position     */\r
+#define GPIO_PORT_PIN3_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT10_Pos)                     /*!< GPIO_PORT PIN3: PORT10 Mask         */\r
+#define GPIO_PORT_PIN3_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN3: PORT11 Position     */\r
+#define GPIO_PORT_PIN3_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT11_Pos)                     /*!< GPIO_PORT PIN3: PORT11 Mask         */\r
+#define GPIO_PORT_PIN3_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN3: PORT12 Position     */\r
+#define GPIO_PORT_PIN3_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT12_Pos)                     /*!< GPIO_PORT PIN3: PORT12 Mask         */\r
+#define GPIO_PORT_PIN3_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN3: PORT13 Position     */\r
+#define GPIO_PORT_PIN3_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT13_Pos)                     /*!< GPIO_PORT PIN3: PORT13 Mask         */\r
+#define GPIO_PORT_PIN3_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN3: PORT14 Position     */\r
+#define GPIO_PORT_PIN3_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT14_Pos)                     /*!< GPIO_PORT PIN3: PORT14 Mask         */\r
+#define GPIO_PORT_PIN3_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN3: PORT15 Position     */\r
+#define GPIO_PORT_PIN3_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT15_Pos)                     /*!< GPIO_PORT PIN3: PORT15 Mask         */\r
+#define GPIO_PORT_PIN3_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN3: PORT16 Position     */\r
+#define GPIO_PORT_PIN3_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT16_Pos)                     /*!< GPIO_PORT PIN3: PORT16 Mask         */\r
+#define GPIO_PORT_PIN3_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN3: PORT17 Position     */\r
+#define GPIO_PORT_PIN3_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT17_Pos)                     /*!< GPIO_PORT PIN3: PORT17 Mask         */\r
+#define GPIO_PORT_PIN3_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN3: PORT18 Position     */\r
+#define GPIO_PORT_PIN3_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT18_Pos)                     /*!< GPIO_PORT PIN3: PORT18 Mask         */\r
+#define GPIO_PORT_PIN3_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN3: PORT19 Position     */\r
+#define GPIO_PORT_PIN3_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT19_Pos)                     /*!< GPIO_PORT PIN3: PORT19 Mask         */\r
+#define GPIO_PORT_PIN3_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN3: PORT20 Position     */\r
+#define GPIO_PORT_PIN3_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT20_Pos)                     /*!< GPIO_PORT PIN3: PORT20 Mask         */\r
+#define GPIO_PORT_PIN3_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN3: PORT21 Position     */\r
+#define GPIO_PORT_PIN3_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT21_Pos)                     /*!< GPIO_PORT PIN3: PORT21 Mask         */\r
+#define GPIO_PORT_PIN3_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN3: PORT22 Position     */\r
+#define GPIO_PORT_PIN3_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT22_Pos)                     /*!< GPIO_PORT PIN3: PORT22 Mask         */\r
+#define GPIO_PORT_PIN3_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN3: PORT23 Position     */\r
+#define GPIO_PORT_PIN3_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT23_Pos)                     /*!< GPIO_PORT PIN3: PORT23 Mask         */\r
+#define GPIO_PORT_PIN3_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN3: PORT24 Position     */\r
+#define GPIO_PORT_PIN3_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT24_Pos)                     /*!< GPIO_PORT PIN3: PORT24 Mask         */\r
+#define GPIO_PORT_PIN3_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN3: PORT25 Position     */\r
+#define GPIO_PORT_PIN3_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT25_Pos)                     /*!< GPIO_PORT PIN3: PORT25 Mask         */\r
+#define GPIO_PORT_PIN3_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN3: PORT26 Position     */\r
+#define GPIO_PORT_PIN3_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT26_Pos)                     /*!< GPIO_PORT PIN3: PORT26 Mask         */\r
+#define GPIO_PORT_PIN3_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN3: PORT27 Position     */\r
+#define GPIO_PORT_PIN3_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT27_Pos)                     /*!< GPIO_PORT PIN3: PORT27 Mask         */\r
+#define GPIO_PORT_PIN3_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN3: PORT28 Position     */\r
+#define GPIO_PORT_PIN3_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT28_Pos)                     /*!< GPIO_PORT PIN3: PORT28 Mask         */\r
+#define GPIO_PORT_PIN3_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN3: PORT29 Position     */\r
+#define GPIO_PORT_PIN3_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT29_Pos)                     /*!< GPIO_PORT PIN3: PORT29 Mask         */\r
+#define GPIO_PORT_PIN3_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN3: PORT30 Position     */\r
+#define GPIO_PORT_PIN3_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT30_Pos)                     /*!< GPIO_PORT PIN3: PORT30 Mask         */\r
+#define GPIO_PORT_PIN3_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN3: PORT31 Position     */\r
+#define GPIO_PORT_PIN3_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN3_PORT31_Pos)                     /*!< GPIO_PORT PIN3: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN4  -----------------------------------------\r
+#define GPIO_PORT_PIN4_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN4: PORT0 Position      */\r
+#define GPIO_PORT_PIN4_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT0_Pos)                      /*!< GPIO_PORT PIN4: PORT0 Mask          */\r
+#define GPIO_PORT_PIN4_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN4: PORT1 Position      */\r
+#define GPIO_PORT_PIN4_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT1_Pos)                      /*!< GPIO_PORT PIN4: PORT1 Mask          */\r
+#define GPIO_PORT_PIN4_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN4: PORT2 Position      */\r
+#define GPIO_PORT_PIN4_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT2_Pos)                      /*!< GPIO_PORT PIN4: PORT2 Mask          */\r
+#define GPIO_PORT_PIN4_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN4: PORT3 Position      */\r
+#define GPIO_PORT_PIN4_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT3_Pos)                      /*!< GPIO_PORT PIN4: PORT3 Mask          */\r
+#define GPIO_PORT_PIN4_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN4: PORT4 Position      */\r
+#define GPIO_PORT_PIN4_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT4_Pos)                      /*!< GPIO_PORT PIN4: PORT4 Mask          */\r
+#define GPIO_PORT_PIN4_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN4: PORT5 Position      */\r
+#define GPIO_PORT_PIN4_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT5_Pos)                      /*!< GPIO_PORT PIN4: PORT5 Mask          */\r
+#define GPIO_PORT_PIN4_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN4: PORT6 Position      */\r
+#define GPIO_PORT_PIN4_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT6_Pos)                      /*!< GPIO_PORT PIN4: PORT6 Mask          */\r
+#define GPIO_PORT_PIN4_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN4: PORT7 Position      */\r
+#define GPIO_PORT_PIN4_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT7_Pos)                      /*!< GPIO_PORT PIN4: PORT7 Mask          */\r
+#define GPIO_PORT_PIN4_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN4: PORT8 Position      */\r
+#define GPIO_PORT_PIN4_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT8_Pos)                      /*!< GPIO_PORT PIN4: PORT8 Mask          */\r
+#define GPIO_PORT_PIN4_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN4: PORT9 Position      */\r
+#define GPIO_PORT_PIN4_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN4_PORT9_Pos)                      /*!< GPIO_PORT PIN4: PORT9 Mask          */\r
+#define GPIO_PORT_PIN4_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN4: PORT10 Position     */\r
+#define GPIO_PORT_PIN4_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT10_Pos)                     /*!< GPIO_PORT PIN4: PORT10 Mask         */\r
+#define GPIO_PORT_PIN4_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN4: PORT11 Position     */\r
+#define GPIO_PORT_PIN4_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT11_Pos)                     /*!< GPIO_PORT PIN4: PORT11 Mask         */\r
+#define GPIO_PORT_PIN4_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN4: PORT12 Position     */\r
+#define GPIO_PORT_PIN4_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT12_Pos)                     /*!< GPIO_PORT PIN4: PORT12 Mask         */\r
+#define GPIO_PORT_PIN4_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN4: PORT13 Position     */\r
+#define GPIO_PORT_PIN4_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT13_Pos)                     /*!< GPIO_PORT PIN4: PORT13 Mask         */\r
+#define GPIO_PORT_PIN4_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN4: PORT14 Position     */\r
+#define GPIO_PORT_PIN4_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT14_Pos)                     /*!< GPIO_PORT PIN4: PORT14 Mask         */\r
+#define GPIO_PORT_PIN4_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN4: PORT15 Position     */\r
+#define GPIO_PORT_PIN4_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT15_Pos)                     /*!< GPIO_PORT PIN4: PORT15 Mask         */\r
+#define GPIO_PORT_PIN4_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN4: PORT16 Position     */\r
+#define GPIO_PORT_PIN4_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT16_Pos)                     /*!< GPIO_PORT PIN4: PORT16 Mask         */\r
+#define GPIO_PORT_PIN4_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN4: PORT17 Position     */\r
+#define GPIO_PORT_PIN4_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT17_Pos)                     /*!< GPIO_PORT PIN4: PORT17 Mask         */\r
+#define GPIO_PORT_PIN4_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN4: PORT18 Position     */\r
+#define GPIO_PORT_PIN4_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT18_Pos)                     /*!< GPIO_PORT PIN4: PORT18 Mask         */\r
+#define GPIO_PORT_PIN4_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN4: PORT19 Position     */\r
+#define GPIO_PORT_PIN4_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT19_Pos)                     /*!< GPIO_PORT PIN4: PORT19 Mask         */\r
+#define GPIO_PORT_PIN4_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN4: PORT20 Position     */\r
+#define GPIO_PORT_PIN4_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT20_Pos)                     /*!< GPIO_PORT PIN4: PORT20 Mask         */\r
+#define GPIO_PORT_PIN4_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN4: PORT21 Position     */\r
+#define GPIO_PORT_PIN4_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT21_Pos)                     /*!< GPIO_PORT PIN4: PORT21 Mask         */\r
+#define GPIO_PORT_PIN4_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN4: PORT22 Position     */\r
+#define GPIO_PORT_PIN4_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT22_Pos)                     /*!< GPIO_PORT PIN4: PORT22 Mask         */\r
+#define GPIO_PORT_PIN4_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN4: PORT23 Position     */\r
+#define GPIO_PORT_PIN4_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT23_Pos)                     /*!< GPIO_PORT PIN4: PORT23 Mask         */\r
+#define GPIO_PORT_PIN4_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN4: PORT24 Position     */\r
+#define GPIO_PORT_PIN4_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT24_Pos)                     /*!< GPIO_PORT PIN4: PORT24 Mask         */\r
+#define GPIO_PORT_PIN4_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN4: PORT25 Position     */\r
+#define GPIO_PORT_PIN4_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT25_Pos)                     /*!< GPIO_PORT PIN4: PORT25 Mask         */\r
+#define GPIO_PORT_PIN4_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN4: PORT26 Position     */\r
+#define GPIO_PORT_PIN4_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT26_Pos)                     /*!< GPIO_PORT PIN4: PORT26 Mask         */\r
+#define GPIO_PORT_PIN4_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN4: PORT27 Position     */\r
+#define GPIO_PORT_PIN4_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT27_Pos)                     /*!< GPIO_PORT PIN4: PORT27 Mask         */\r
+#define GPIO_PORT_PIN4_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN4: PORT28 Position     */\r
+#define GPIO_PORT_PIN4_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT28_Pos)                     /*!< GPIO_PORT PIN4: PORT28 Mask         */\r
+#define GPIO_PORT_PIN4_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN4: PORT29 Position     */\r
+#define GPIO_PORT_PIN4_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT29_Pos)                     /*!< GPIO_PORT PIN4: PORT29 Mask         */\r
+#define GPIO_PORT_PIN4_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN4: PORT30 Position     */\r
+#define GPIO_PORT_PIN4_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT30_Pos)                     /*!< GPIO_PORT PIN4: PORT30 Mask         */\r
+#define GPIO_PORT_PIN4_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN4: PORT31 Position     */\r
+#define GPIO_PORT_PIN4_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN4_PORT31_Pos)                     /*!< GPIO_PORT PIN4: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN5  -----------------------------------------\r
+#define GPIO_PORT_PIN5_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN5: PORT0 Position      */\r
+#define GPIO_PORT_PIN5_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT0_Pos)                      /*!< GPIO_PORT PIN5: PORT0 Mask          */\r
+#define GPIO_PORT_PIN5_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN5: PORT1 Position      */\r
+#define GPIO_PORT_PIN5_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT1_Pos)                      /*!< GPIO_PORT PIN5: PORT1 Mask          */\r
+#define GPIO_PORT_PIN5_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN5: PORT2 Position      */\r
+#define GPIO_PORT_PIN5_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT2_Pos)                      /*!< GPIO_PORT PIN5: PORT2 Mask          */\r
+#define GPIO_PORT_PIN5_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN5: PORT3 Position      */\r
+#define GPIO_PORT_PIN5_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT3_Pos)                      /*!< GPIO_PORT PIN5: PORT3 Mask          */\r
+#define GPIO_PORT_PIN5_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN5: PORT4 Position      */\r
+#define GPIO_PORT_PIN5_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT4_Pos)                      /*!< GPIO_PORT PIN5: PORT4 Mask          */\r
+#define GPIO_PORT_PIN5_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN5: PORT5 Position      */\r
+#define GPIO_PORT_PIN5_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT5_Pos)                      /*!< GPIO_PORT PIN5: PORT5 Mask          */\r
+#define GPIO_PORT_PIN5_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN5: PORT6 Position      */\r
+#define GPIO_PORT_PIN5_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT6_Pos)                      /*!< GPIO_PORT PIN5: PORT6 Mask          */\r
+#define GPIO_PORT_PIN5_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN5: PORT7 Position      */\r
+#define GPIO_PORT_PIN5_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT7_Pos)                      /*!< GPIO_PORT PIN5: PORT7 Mask          */\r
+#define GPIO_PORT_PIN5_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN5: PORT8 Position      */\r
+#define GPIO_PORT_PIN5_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT8_Pos)                      /*!< GPIO_PORT PIN5: PORT8 Mask          */\r
+#define GPIO_PORT_PIN5_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN5: PORT9 Position      */\r
+#define GPIO_PORT_PIN5_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN5_PORT9_Pos)                      /*!< GPIO_PORT PIN5: PORT9 Mask          */\r
+#define GPIO_PORT_PIN5_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN5: PORT10 Position     */\r
+#define GPIO_PORT_PIN5_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT10_Pos)                     /*!< GPIO_PORT PIN5: PORT10 Mask         */\r
+#define GPIO_PORT_PIN5_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN5: PORT11 Position     */\r
+#define GPIO_PORT_PIN5_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT11_Pos)                     /*!< GPIO_PORT PIN5: PORT11 Mask         */\r
+#define GPIO_PORT_PIN5_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN5: PORT12 Position     */\r
+#define GPIO_PORT_PIN5_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT12_Pos)                     /*!< GPIO_PORT PIN5: PORT12 Mask         */\r
+#define GPIO_PORT_PIN5_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN5: PORT13 Position     */\r
+#define GPIO_PORT_PIN5_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT13_Pos)                     /*!< GPIO_PORT PIN5: PORT13 Mask         */\r
+#define GPIO_PORT_PIN5_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN5: PORT14 Position     */\r
+#define GPIO_PORT_PIN5_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT14_Pos)                     /*!< GPIO_PORT PIN5: PORT14 Mask         */\r
+#define GPIO_PORT_PIN5_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN5: PORT15 Position     */\r
+#define GPIO_PORT_PIN5_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT15_Pos)                     /*!< GPIO_PORT PIN5: PORT15 Mask         */\r
+#define GPIO_PORT_PIN5_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN5: PORT16 Position     */\r
+#define GPIO_PORT_PIN5_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT16_Pos)                     /*!< GPIO_PORT PIN5: PORT16 Mask         */\r
+#define GPIO_PORT_PIN5_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN5: PORT17 Position     */\r
+#define GPIO_PORT_PIN5_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT17_Pos)                     /*!< GPIO_PORT PIN5: PORT17 Mask         */\r
+#define GPIO_PORT_PIN5_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN5: PORT18 Position     */\r
+#define GPIO_PORT_PIN5_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT18_Pos)                     /*!< GPIO_PORT PIN5: PORT18 Mask         */\r
+#define GPIO_PORT_PIN5_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN5: PORT19 Position     */\r
+#define GPIO_PORT_PIN5_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT19_Pos)                     /*!< GPIO_PORT PIN5: PORT19 Mask         */\r
+#define GPIO_PORT_PIN5_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN5: PORT20 Position     */\r
+#define GPIO_PORT_PIN5_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT20_Pos)                     /*!< GPIO_PORT PIN5: PORT20 Mask         */\r
+#define GPIO_PORT_PIN5_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN5: PORT21 Position     */\r
+#define GPIO_PORT_PIN5_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT21_Pos)                     /*!< GPIO_PORT PIN5: PORT21 Mask         */\r
+#define GPIO_PORT_PIN5_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN5: PORT22 Position     */\r
+#define GPIO_PORT_PIN5_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT22_Pos)                     /*!< GPIO_PORT PIN5: PORT22 Mask         */\r
+#define GPIO_PORT_PIN5_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN5: PORT23 Position     */\r
+#define GPIO_PORT_PIN5_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT23_Pos)                     /*!< GPIO_PORT PIN5: PORT23 Mask         */\r
+#define GPIO_PORT_PIN5_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN5: PORT24 Position     */\r
+#define GPIO_PORT_PIN5_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT24_Pos)                     /*!< GPIO_PORT PIN5: PORT24 Mask         */\r
+#define GPIO_PORT_PIN5_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN5: PORT25 Position     */\r
+#define GPIO_PORT_PIN5_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT25_Pos)                     /*!< GPIO_PORT PIN5: PORT25 Mask         */\r
+#define GPIO_PORT_PIN5_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN5: PORT26 Position     */\r
+#define GPIO_PORT_PIN5_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT26_Pos)                     /*!< GPIO_PORT PIN5: PORT26 Mask         */\r
+#define GPIO_PORT_PIN5_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN5: PORT27 Position     */\r
+#define GPIO_PORT_PIN5_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT27_Pos)                     /*!< GPIO_PORT PIN5: PORT27 Mask         */\r
+#define GPIO_PORT_PIN5_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN5: PORT28 Position     */\r
+#define GPIO_PORT_PIN5_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT28_Pos)                     /*!< GPIO_PORT PIN5: PORT28 Mask         */\r
+#define GPIO_PORT_PIN5_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN5: PORT29 Position     */\r
+#define GPIO_PORT_PIN5_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT29_Pos)                     /*!< GPIO_PORT PIN5: PORT29 Mask         */\r
+#define GPIO_PORT_PIN5_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN5: PORT30 Position     */\r
+#define GPIO_PORT_PIN5_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT30_Pos)                     /*!< GPIO_PORT PIN5: PORT30 Mask         */\r
+#define GPIO_PORT_PIN5_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN5: PORT31 Position     */\r
+#define GPIO_PORT_PIN5_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN5_PORT31_Pos)                     /*!< GPIO_PORT PIN5: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN6  -----------------------------------------\r
+#define GPIO_PORT_PIN6_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN6: PORT0 Position      */\r
+#define GPIO_PORT_PIN6_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT0_Pos)                      /*!< GPIO_PORT PIN6: PORT0 Mask          */\r
+#define GPIO_PORT_PIN6_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN6: PORT1 Position      */\r
+#define GPIO_PORT_PIN6_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT1_Pos)                      /*!< GPIO_PORT PIN6: PORT1 Mask          */\r
+#define GPIO_PORT_PIN6_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN6: PORT2 Position      */\r
+#define GPIO_PORT_PIN6_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT2_Pos)                      /*!< GPIO_PORT PIN6: PORT2 Mask          */\r
+#define GPIO_PORT_PIN6_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN6: PORT3 Position      */\r
+#define GPIO_PORT_PIN6_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT3_Pos)                      /*!< GPIO_PORT PIN6: PORT3 Mask          */\r
+#define GPIO_PORT_PIN6_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN6: PORT4 Position      */\r
+#define GPIO_PORT_PIN6_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT4_Pos)                      /*!< GPIO_PORT PIN6: PORT4 Mask          */\r
+#define GPIO_PORT_PIN6_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN6: PORT5 Position      */\r
+#define GPIO_PORT_PIN6_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT5_Pos)                      /*!< GPIO_PORT PIN6: PORT5 Mask          */\r
+#define GPIO_PORT_PIN6_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN6: PORT6 Position      */\r
+#define GPIO_PORT_PIN6_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT6_Pos)                      /*!< GPIO_PORT PIN6: PORT6 Mask          */\r
+#define GPIO_PORT_PIN6_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN6: PORT7 Position      */\r
+#define GPIO_PORT_PIN6_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT7_Pos)                      /*!< GPIO_PORT PIN6: PORT7 Mask          */\r
+#define GPIO_PORT_PIN6_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN6: PORT8 Position      */\r
+#define GPIO_PORT_PIN6_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT8_Pos)                      /*!< GPIO_PORT PIN6: PORT8 Mask          */\r
+#define GPIO_PORT_PIN6_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN6: PORT9 Position      */\r
+#define GPIO_PORT_PIN6_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN6_PORT9_Pos)                      /*!< GPIO_PORT PIN6: PORT9 Mask          */\r
+#define GPIO_PORT_PIN6_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN6: PORT10 Position     */\r
+#define GPIO_PORT_PIN6_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT10_Pos)                     /*!< GPIO_PORT PIN6: PORT10 Mask         */\r
+#define GPIO_PORT_PIN6_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN6: PORT11 Position     */\r
+#define GPIO_PORT_PIN6_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT11_Pos)                     /*!< GPIO_PORT PIN6: PORT11 Mask         */\r
+#define GPIO_PORT_PIN6_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN6: PORT12 Position     */\r
+#define GPIO_PORT_PIN6_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT12_Pos)                     /*!< GPIO_PORT PIN6: PORT12 Mask         */\r
+#define GPIO_PORT_PIN6_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN6: PORT13 Position     */\r
+#define GPIO_PORT_PIN6_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT13_Pos)                     /*!< GPIO_PORT PIN6: PORT13 Mask         */\r
+#define GPIO_PORT_PIN6_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN6: PORT14 Position     */\r
+#define GPIO_PORT_PIN6_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT14_Pos)                     /*!< GPIO_PORT PIN6: PORT14 Mask         */\r
+#define GPIO_PORT_PIN6_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN6: PORT15 Position     */\r
+#define GPIO_PORT_PIN6_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT15_Pos)                     /*!< GPIO_PORT PIN6: PORT15 Mask         */\r
+#define GPIO_PORT_PIN6_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN6: PORT16 Position     */\r
+#define GPIO_PORT_PIN6_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT16_Pos)                     /*!< GPIO_PORT PIN6: PORT16 Mask         */\r
+#define GPIO_PORT_PIN6_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN6: PORT17 Position     */\r
+#define GPIO_PORT_PIN6_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT17_Pos)                     /*!< GPIO_PORT PIN6: PORT17 Mask         */\r
+#define GPIO_PORT_PIN6_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN6: PORT18 Position     */\r
+#define GPIO_PORT_PIN6_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT18_Pos)                     /*!< GPIO_PORT PIN6: PORT18 Mask         */\r
+#define GPIO_PORT_PIN6_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN6: PORT19 Position     */\r
+#define GPIO_PORT_PIN6_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT19_Pos)                     /*!< GPIO_PORT PIN6: PORT19 Mask         */\r
+#define GPIO_PORT_PIN6_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN6: PORT20 Position     */\r
+#define GPIO_PORT_PIN6_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT20_Pos)                     /*!< GPIO_PORT PIN6: PORT20 Mask         */\r
+#define GPIO_PORT_PIN6_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN6: PORT21 Position     */\r
+#define GPIO_PORT_PIN6_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT21_Pos)                     /*!< GPIO_PORT PIN6: PORT21 Mask         */\r
+#define GPIO_PORT_PIN6_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN6: PORT22 Position     */\r
+#define GPIO_PORT_PIN6_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT22_Pos)                     /*!< GPIO_PORT PIN6: PORT22 Mask         */\r
+#define GPIO_PORT_PIN6_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN6: PORT23 Position     */\r
+#define GPIO_PORT_PIN6_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT23_Pos)                     /*!< GPIO_PORT PIN6: PORT23 Mask         */\r
+#define GPIO_PORT_PIN6_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN6: PORT24 Position     */\r
+#define GPIO_PORT_PIN6_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT24_Pos)                     /*!< GPIO_PORT PIN6: PORT24 Mask         */\r
+#define GPIO_PORT_PIN6_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN6: PORT25 Position     */\r
+#define GPIO_PORT_PIN6_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT25_Pos)                     /*!< GPIO_PORT PIN6: PORT25 Mask         */\r
+#define GPIO_PORT_PIN6_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN6: PORT26 Position     */\r
+#define GPIO_PORT_PIN6_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT26_Pos)                     /*!< GPIO_PORT PIN6: PORT26 Mask         */\r
+#define GPIO_PORT_PIN6_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN6: PORT27 Position     */\r
+#define GPIO_PORT_PIN6_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT27_Pos)                     /*!< GPIO_PORT PIN6: PORT27 Mask         */\r
+#define GPIO_PORT_PIN6_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN6: PORT28 Position     */\r
+#define GPIO_PORT_PIN6_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT28_Pos)                     /*!< GPIO_PORT PIN6: PORT28 Mask         */\r
+#define GPIO_PORT_PIN6_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN6: PORT29 Position     */\r
+#define GPIO_PORT_PIN6_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT29_Pos)                     /*!< GPIO_PORT PIN6: PORT29 Mask         */\r
+#define GPIO_PORT_PIN6_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN6: PORT30 Position     */\r
+#define GPIO_PORT_PIN6_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT30_Pos)                     /*!< GPIO_PORT PIN6: PORT30 Mask         */\r
+#define GPIO_PORT_PIN6_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN6: PORT31 Position     */\r
+#define GPIO_PORT_PIN6_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN6_PORT31_Pos)                     /*!< GPIO_PORT PIN6: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_PIN7  -----------------------------------------\r
+#define GPIO_PORT_PIN7_PORT0_Pos                              0                                                         /*!< GPIO_PORT PIN7: PORT0 Position      */\r
+#define GPIO_PORT_PIN7_PORT0_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT0_Pos)                      /*!< GPIO_PORT PIN7: PORT0 Mask          */\r
+#define GPIO_PORT_PIN7_PORT1_Pos                              1                                                         /*!< GPIO_PORT PIN7: PORT1 Position      */\r
+#define GPIO_PORT_PIN7_PORT1_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT1_Pos)                      /*!< GPIO_PORT PIN7: PORT1 Mask          */\r
+#define GPIO_PORT_PIN7_PORT2_Pos                              2                                                         /*!< GPIO_PORT PIN7: PORT2 Position      */\r
+#define GPIO_PORT_PIN7_PORT2_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT2_Pos)                      /*!< GPIO_PORT PIN7: PORT2 Mask          */\r
+#define GPIO_PORT_PIN7_PORT3_Pos                              3                                                         /*!< GPIO_PORT PIN7: PORT3 Position      */\r
+#define GPIO_PORT_PIN7_PORT3_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT3_Pos)                      /*!< GPIO_PORT PIN7: PORT3 Mask          */\r
+#define GPIO_PORT_PIN7_PORT4_Pos                              4                                                         /*!< GPIO_PORT PIN7: PORT4 Position      */\r
+#define GPIO_PORT_PIN7_PORT4_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT4_Pos)                      /*!< GPIO_PORT PIN7: PORT4 Mask          */\r
+#define GPIO_PORT_PIN7_PORT5_Pos                              5                                                         /*!< GPIO_PORT PIN7: PORT5 Position      */\r
+#define GPIO_PORT_PIN7_PORT5_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT5_Pos)                      /*!< GPIO_PORT PIN7: PORT5 Mask          */\r
+#define GPIO_PORT_PIN7_PORT6_Pos                              6                                                         /*!< GPIO_PORT PIN7: PORT6 Position      */\r
+#define GPIO_PORT_PIN7_PORT6_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT6_Pos)                      /*!< GPIO_PORT PIN7: PORT6 Mask          */\r
+#define GPIO_PORT_PIN7_PORT7_Pos                              7                                                         /*!< GPIO_PORT PIN7: PORT7 Position      */\r
+#define GPIO_PORT_PIN7_PORT7_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT7_Pos)                      /*!< GPIO_PORT PIN7: PORT7 Mask          */\r
+#define GPIO_PORT_PIN7_PORT8_Pos                              8                                                         /*!< GPIO_PORT PIN7: PORT8 Position      */\r
+#define GPIO_PORT_PIN7_PORT8_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT8_Pos)                      /*!< GPIO_PORT PIN7: PORT8 Mask          */\r
+#define GPIO_PORT_PIN7_PORT9_Pos                              9                                                         /*!< GPIO_PORT PIN7: PORT9 Position      */\r
+#define GPIO_PORT_PIN7_PORT9_Msk                              (0x01UL << GPIO_PORT_PIN7_PORT9_Pos)                      /*!< GPIO_PORT PIN7: PORT9 Mask          */\r
+#define GPIO_PORT_PIN7_PORT10_Pos                             10                                                        /*!< GPIO_PORT PIN7: PORT10 Position     */\r
+#define GPIO_PORT_PIN7_PORT10_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT10_Pos)                     /*!< GPIO_PORT PIN7: PORT10 Mask         */\r
+#define GPIO_PORT_PIN7_PORT11_Pos                             11                                                        /*!< GPIO_PORT PIN7: PORT11 Position     */\r
+#define GPIO_PORT_PIN7_PORT11_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT11_Pos)                     /*!< GPIO_PORT PIN7: PORT11 Mask         */\r
+#define GPIO_PORT_PIN7_PORT12_Pos                             12                                                        /*!< GPIO_PORT PIN7: PORT12 Position     */\r
+#define GPIO_PORT_PIN7_PORT12_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT12_Pos)                     /*!< GPIO_PORT PIN7: PORT12 Mask         */\r
+#define GPIO_PORT_PIN7_PORT13_Pos                             13                                                        /*!< GPIO_PORT PIN7: PORT13 Position     */\r
+#define GPIO_PORT_PIN7_PORT13_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT13_Pos)                     /*!< GPIO_PORT PIN7: PORT13 Mask         */\r
+#define GPIO_PORT_PIN7_PORT14_Pos                             14                                                        /*!< GPIO_PORT PIN7: PORT14 Position     */\r
+#define GPIO_PORT_PIN7_PORT14_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT14_Pos)                     /*!< GPIO_PORT PIN7: PORT14 Mask         */\r
+#define GPIO_PORT_PIN7_PORT15_Pos                             15                                                        /*!< GPIO_PORT PIN7: PORT15 Position     */\r
+#define GPIO_PORT_PIN7_PORT15_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT15_Pos)                     /*!< GPIO_PORT PIN7: PORT15 Mask         */\r
+#define GPIO_PORT_PIN7_PORT16_Pos                             16                                                        /*!< GPIO_PORT PIN7: PORT16 Position     */\r
+#define GPIO_PORT_PIN7_PORT16_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT16_Pos)                     /*!< GPIO_PORT PIN7: PORT16 Mask         */\r
+#define GPIO_PORT_PIN7_PORT17_Pos                             17                                                        /*!< GPIO_PORT PIN7: PORT17 Position     */\r
+#define GPIO_PORT_PIN7_PORT17_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT17_Pos)                     /*!< GPIO_PORT PIN7: PORT17 Mask         */\r
+#define GPIO_PORT_PIN7_PORT18_Pos                             18                                                        /*!< GPIO_PORT PIN7: PORT18 Position     */\r
+#define GPIO_PORT_PIN7_PORT18_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT18_Pos)                     /*!< GPIO_PORT PIN7: PORT18 Mask         */\r
+#define GPIO_PORT_PIN7_PORT19_Pos                             19                                                        /*!< GPIO_PORT PIN7: PORT19 Position     */\r
+#define GPIO_PORT_PIN7_PORT19_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT19_Pos)                     /*!< GPIO_PORT PIN7: PORT19 Mask         */\r
+#define GPIO_PORT_PIN7_PORT20_Pos                             20                                                        /*!< GPIO_PORT PIN7: PORT20 Position     */\r
+#define GPIO_PORT_PIN7_PORT20_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT20_Pos)                     /*!< GPIO_PORT PIN7: PORT20 Mask         */\r
+#define GPIO_PORT_PIN7_PORT21_Pos                             21                                                        /*!< GPIO_PORT PIN7: PORT21 Position     */\r
+#define GPIO_PORT_PIN7_PORT21_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT21_Pos)                     /*!< GPIO_PORT PIN7: PORT21 Mask         */\r
+#define GPIO_PORT_PIN7_PORT22_Pos                             22                                                        /*!< GPIO_PORT PIN7: PORT22 Position     */\r
+#define GPIO_PORT_PIN7_PORT22_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT22_Pos)                     /*!< GPIO_PORT PIN7: PORT22 Mask         */\r
+#define GPIO_PORT_PIN7_PORT23_Pos                             23                                                        /*!< GPIO_PORT PIN7: PORT23 Position     */\r
+#define GPIO_PORT_PIN7_PORT23_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT23_Pos)                     /*!< GPIO_PORT PIN7: PORT23 Mask         */\r
+#define GPIO_PORT_PIN7_PORT24_Pos                             24                                                        /*!< GPIO_PORT PIN7: PORT24 Position     */\r
+#define GPIO_PORT_PIN7_PORT24_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT24_Pos)                     /*!< GPIO_PORT PIN7: PORT24 Mask         */\r
+#define GPIO_PORT_PIN7_PORT25_Pos                             25                                                        /*!< GPIO_PORT PIN7: PORT25 Position     */\r
+#define GPIO_PORT_PIN7_PORT25_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT25_Pos)                     /*!< GPIO_PORT PIN7: PORT25 Mask         */\r
+#define GPIO_PORT_PIN7_PORT26_Pos                             26                                                        /*!< GPIO_PORT PIN7: PORT26 Position     */\r
+#define GPIO_PORT_PIN7_PORT26_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT26_Pos)                     /*!< GPIO_PORT PIN7: PORT26 Mask         */\r
+#define GPIO_PORT_PIN7_PORT27_Pos                             27                                                        /*!< GPIO_PORT PIN7: PORT27 Position     */\r
+#define GPIO_PORT_PIN7_PORT27_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT27_Pos)                     /*!< GPIO_PORT PIN7: PORT27 Mask         */\r
+#define GPIO_PORT_PIN7_PORT28_Pos                             28                                                        /*!< GPIO_PORT PIN7: PORT28 Position     */\r
+#define GPIO_PORT_PIN7_PORT28_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT28_Pos)                     /*!< GPIO_PORT PIN7: PORT28 Mask         */\r
+#define GPIO_PORT_PIN7_PORT29_Pos                             29                                                        /*!< GPIO_PORT PIN7: PORT29 Position     */\r
+#define GPIO_PORT_PIN7_PORT29_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT29_Pos)                     /*!< GPIO_PORT PIN7: PORT29 Mask         */\r
+#define GPIO_PORT_PIN7_PORT30_Pos                             30                                                        /*!< GPIO_PORT PIN7: PORT30 Position     */\r
+#define GPIO_PORT_PIN7_PORT30_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT30_Pos)                     /*!< GPIO_PORT PIN7: PORT30 Mask         */\r
+#define GPIO_PORT_PIN7_PORT31_Pos                             31                                                        /*!< GPIO_PORT PIN7: PORT31 Position     */\r
+#define GPIO_PORT_PIN7_PORT31_Msk                             (0x01UL << GPIO_PORT_PIN7_PORT31_Pos)                     /*!< GPIO_PORT PIN7: PORT31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN0  ----------------------------------------\r
+#define GPIO_PORT_MPIN0_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN0: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN0: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN0: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN0: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN0: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN0: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN0: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN0: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN0: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN0: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN0_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN0_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN0: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN0_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN0: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN0: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN0: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN0: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN0: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN0: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN0: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN0: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN0: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN0: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN0: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN0: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN0: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN0: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN0: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN0: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN0: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN0: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN0: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN0: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN0: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN0_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN0: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN0_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN0_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN0: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN1  ----------------------------------------\r
+#define GPIO_PORT_MPIN1_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN1: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN1: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN1: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN1: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN1: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN1: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN1: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN1: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN1: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN1: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN1_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN1_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN1: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN1_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN1: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN1: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN1: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN1: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN1: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN1: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN1: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN1: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN1: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN1: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN1: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN1: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN1: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN1: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN1: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN1: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN1: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN1: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN1: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN1: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN1: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN1_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN1: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN1_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN1_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN1: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN2  ----------------------------------------\r
+#define GPIO_PORT_MPIN2_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN2: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN2: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN2: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN2: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN2: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN2: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN2: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN2: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN2: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN2: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN2_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN2_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN2: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN2_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN2: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN2: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN2: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN2: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN2: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN2: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN2: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN2: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN2: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN2: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN2: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN2: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN2: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN2: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN2: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN2: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN2: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN2: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN2: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN2: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN2: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN2_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN2: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN2_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN2_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN2: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN3  ----------------------------------------\r
+#define GPIO_PORT_MPIN3_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN3: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN3: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN3: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN3: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN3: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN3: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN3: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN3: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN3: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN3: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN3_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN3_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN3: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN3_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN3: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN3: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN3: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN3: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN3: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN3: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN3: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN3: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN3: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN3: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN3: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN3: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN3: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN3: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN3: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN3: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN3: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN3: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN3: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN3: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN3: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN3_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN3: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN3_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN3_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN3: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN4  ----------------------------------------\r
+#define GPIO_PORT_MPIN4_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN4: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN4: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN4: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN4: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN4: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN4: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN4: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN4: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN4: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN4: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN4_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN4_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN4: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN4_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN4: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN4: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN4: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN4: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN4: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN4: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN4: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN4: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN4: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN4: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN4: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN4: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN4: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN4: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN4: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN4: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN4: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN4: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN4: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN4: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN4: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN4_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN4: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN4_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN4_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN4: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN5  ----------------------------------------\r
+#define GPIO_PORT_MPIN5_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN5: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN5: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN5: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN5: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN5: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN5: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN5: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN5: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN5: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN5: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN5_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN5_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN5: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN5_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN5: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN5: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN5: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN5: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN5: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN5: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN5: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN5: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN5: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN5: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN5: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN5: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN5: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN5: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN5: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN5: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN5: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN5: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN5: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN5: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN5: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN5_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN5: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN5_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN5_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN5: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN6  ----------------------------------------\r
+#define GPIO_PORT_MPIN6_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN6: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN6: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN6: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN6: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN6: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN6: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN6: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN6: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN6: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN6: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN6_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN6_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN6: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN6_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN6: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN6: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN6: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN6: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN6: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN6: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN6: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN6: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN6: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN6: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN6: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN6: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN6: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN6: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN6: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN6: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN6: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN6: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN6: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN6: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN6: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN6_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN6: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN6_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN6_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN6: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_MPIN7  ----------------------------------------\r
+#define GPIO_PORT_MPIN7_MPORTP0_Pos                           0                                                         /*!< GPIO_PORT MPIN7: MPORTP0 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP0_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP0_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP0 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP1_Pos                           1                                                         /*!< GPIO_PORT MPIN7: MPORTP1 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP1_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP1_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP1 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP2_Pos                           2                                                         /*!< GPIO_PORT MPIN7: MPORTP2 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP2_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP2_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP2 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP3_Pos                           3                                                         /*!< GPIO_PORT MPIN7: MPORTP3 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP3_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP3_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP3 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP4_Pos                           4                                                         /*!< GPIO_PORT MPIN7: MPORTP4 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP4_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP4_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP4 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP5_Pos                           5                                                         /*!< GPIO_PORT MPIN7: MPORTP5 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP5_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP5_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP5 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP6_Pos                           6                                                         /*!< GPIO_PORT MPIN7: MPORTP6 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP6_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP6_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP6 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP7_Pos                           7                                                         /*!< GPIO_PORT MPIN7: MPORTP7 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP7_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP7_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP7 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP8_Pos                           8                                                         /*!< GPIO_PORT MPIN7: MPORTP8 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP8_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP8_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP8 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP9_Pos                           9                                                         /*!< GPIO_PORT MPIN7: MPORTP9 Position   */\r
+#define GPIO_PORT_MPIN7_MPORTP9_Msk                           (0x01UL << GPIO_PORT_MPIN7_MPORTP9_Pos)                   /*!< GPIO_PORT MPIN7: MPORTP9 Mask       */\r
+#define GPIO_PORT_MPIN7_MPORTP10_Pos                          10                                                        /*!< GPIO_PORT MPIN7: MPORTP10 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP10_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP10_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP10 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP11_Pos                          11                                                        /*!< GPIO_PORT MPIN7: MPORTP11 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP11_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP11_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP11 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP12_Pos                          12                                                        /*!< GPIO_PORT MPIN7: MPORTP12 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP12_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP12_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP12 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP13_Pos                          13                                                        /*!< GPIO_PORT MPIN7: MPORTP13 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP13_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP13_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP13 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP14_Pos                          14                                                        /*!< GPIO_PORT MPIN7: MPORTP14 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP14_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP14_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP14 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP15_Pos                          15                                                        /*!< GPIO_PORT MPIN7: MPORTP15 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP15_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP15_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP15 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP16_Pos                          16                                                        /*!< GPIO_PORT MPIN7: MPORTP16 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP16_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP16_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP16 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP17_Pos                          17                                                        /*!< GPIO_PORT MPIN7: MPORTP17 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP17_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP17_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP17 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP18_Pos                          18                                                        /*!< GPIO_PORT MPIN7: MPORTP18 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP18_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP18_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP18 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP19_Pos                          19                                                        /*!< GPIO_PORT MPIN7: MPORTP19 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP19_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP19_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP19 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP20_Pos                          20                                                        /*!< GPIO_PORT MPIN7: MPORTP20 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP20_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP20_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP20 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP21_Pos                          21                                                        /*!< GPIO_PORT MPIN7: MPORTP21 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP21_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP21_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP21 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP22_Pos                          22                                                        /*!< GPIO_PORT MPIN7: MPORTP22 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP22_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP22_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP22 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP23_Pos                          23                                                        /*!< GPIO_PORT MPIN7: MPORTP23 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP23_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP23_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP23 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP24_Pos                          24                                                        /*!< GPIO_PORT MPIN7: MPORTP24 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP24_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP24_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP24 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP25_Pos                          25                                                        /*!< GPIO_PORT MPIN7: MPORTP25 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP25_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP25_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP25 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP26_Pos                          26                                                        /*!< GPIO_PORT MPIN7: MPORTP26 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP26_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP26_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP26 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP27_Pos                          27                                                        /*!< GPIO_PORT MPIN7: MPORTP27 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP27_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP27_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP27 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP28_Pos                          28                                                        /*!< GPIO_PORT MPIN7: MPORTP28 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP28_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP28_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP28 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP29_Pos                          29                                                        /*!< GPIO_PORT MPIN7: MPORTP29 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP29_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP29_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP29 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP30_Pos                          30                                                        /*!< GPIO_PORT MPIN7: MPORTP30 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP30_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP30_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP30 Mask      */\r
+#define GPIO_PORT_MPIN7_MPORTP31_Pos                          31                                                        /*!< GPIO_PORT MPIN7: MPORTP31 Position  */\r
+#define GPIO_PORT_MPIN7_MPORTP31_Msk                          (0x01UL << GPIO_PORT_MPIN7_MPORTP31_Pos)                  /*!< GPIO_PORT MPIN7: MPORTP31 Mask      */\r
+\r
+// -------------------------------------  GPIO_PORT_SET0  -----------------------------------------\r
+#define GPIO_PORT_SET0_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET0: SETP0 Position      */\r
+#define GPIO_PORT_SET0_SETP0_Msk                              (0x01UL << GPIO_PORT_SET0_SETP0_Pos)                      /*!< GPIO_PORT SET0: SETP0 Mask          */\r
+#define GPIO_PORT_SET0_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET0: SETP1 Position      */\r
+#define GPIO_PORT_SET0_SETP1_Msk                              (0x01UL << GPIO_PORT_SET0_SETP1_Pos)                      /*!< GPIO_PORT SET0: SETP1 Mask          */\r
+#define GPIO_PORT_SET0_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET0: SETP2 Position      */\r
+#define GPIO_PORT_SET0_SETP2_Msk                              (0x01UL << GPIO_PORT_SET0_SETP2_Pos)                      /*!< GPIO_PORT SET0: SETP2 Mask          */\r
+#define GPIO_PORT_SET0_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET0: SETP3 Position      */\r
+#define GPIO_PORT_SET0_SETP3_Msk                              (0x01UL << GPIO_PORT_SET0_SETP3_Pos)                      /*!< GPIO_PORT SET0: SETP3 Mask          */\r
+#define GPIO_PORT_SET0_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET0: SETP4 Position      */\r
+#define GPIO_PORT_SET0_SETP4_Msk                              (0x01UL << GPIO_PORT_SET0_SETP4_Pos)                      /*!< GPIO_PORT SET0: SETP4 Mask          */\r
+#define GPIO_PORT_SET0_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET0: SETP5 Position      */\r
+#define GPIO_PORT_SET0_SETP5_Msk                              (0x01UL << GPIO_PORT_SET0_SETP5_Pos)                      /*!< GPIO_PORT SET0: SETP5 Mask          */\r
+#define GPIO_PORT_SET0_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET0: SETP6 Position      */\r
+#define GPIO_PORT_SET0_SETP6_Msk                              (0x01UL << GPIO_PORT_SET0_SETP6_Pos)                      /*!< GPIO_PORT SET0: SETP6 Mask          */\r
+#define GPIO_PORT_SET0_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET0: SETP7 Position      */\r
+#define GPIO_PORT_SET0_SETP7_Msk                              (0x01UL << GPIO_PORT_SET0_SETP7_Pos)                      /*!< GPIO_PORT SET0: SETP7 Mask          */\r
+#define GPIO_PORT_SET0_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET0: SETP8 Position      */\r
+#define GPIO_PORT_SET0_SETP8_Msk                              (0x01UL << GPIO_PORT_SET0_SETP8_Pos)                      /*!< GPIO_PORT SET0: SETP8 Mask          */\r
+#define GPIO_PORT_SET0_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET0: SETP9 Position      */\r
+#define GPIO_PORT_SET0_SETP9_Msk                              (0x01UL << GPIO_PORT_SET0_SETP9_Pos)                      /*!< GPIO_PORT SET0: SETP9 Mask          */\r
+#define GPIO_PORT_SET0_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET0: SETP10 Position     */\r
+#define GPIO_PORT_SET0_SETP10_Msk                             (0x01UL << GPIO_PORT_SET0_SETP10_Pos)                     /*!< GPIO_PORT SET0: SETP10 Mask         */\r
+#define GPIO_PORT_SET0_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET0: SETP11 Position     */\r
+#define GPIO_PORT_SET0_SETP11_Msk                             (0x01UL << GPIO_PORT_SET0_SETP11_Pos)                     /*!< GPIO_PORT SET0: SETP11 Mask         */\r
+#define GPIO_PORT_SET0_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET0: SETP12 Position     */\r
+#define GPIO_PORT_SET0_SETP12_Msk                             (0x01UL << GPIO_PORT_SET0_SETP12_Pos)                     /*!< GPIO_PORT SET0: SETP12 Mask         */\r
+#define GPIO_PORT_SET0_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET0: SETP13 Position     */\r
+#define GPIO_PORT_SET0_SETP13_Msk                             (0x01UL << GPIO_PORT_SET0_SETP13_Pos)                     /*!< GPIO_PORT SET0: SETP13 Mask         */\r
+#define GPIO_PORT_SET0_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET0: SETP14 Position     */\r
+#define GPIO_PORT_SET0_SETP14_Msk                             (0x01UL << GPIO_PORT_SET0_SETP14_Pos)                     /*!< GPIO_PORT SET0: SETP14 Mask         */\r
+#define GPIO_PORT_SET0_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET0: SETP15 Position     */\r
+#define GPIO_PORT_SET0_SETP15_Msk                             (0x01UL << GPIO_PORT_SET0_SETP15_Pos)                     /*!< GPIO_PORT SET0: SETP15 Mask         */\r
+#define GPIO_PORT_SET0_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET0: SETP16 Position     */\r
+#define GPIO_PORT_SET0_SETP16_Msk                             (0x01UL << GPIO_PORT_SET0_SETP16_Pos)                     /*!< GPIO_PORT SET0: SETP16 Mask         */\r
+#define GPIO_PORT_SET0_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET0: SETP17 Position     */\r
+#define GPIO_PORT_SET0_SETP17_Msk                             (0x01UL << GPIO_PORT_SET0_SETP17_Pos)                     /*!< GPIO_PORT SET0: SETP17 Mask         */\r
+#define GPIO_PORT_SET0_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET0: SETP18 Position     */\r
+#define GPIO_PORT_SET0_SETP18_Msk                             (0x01UL << GPIO_PORT_SET0_SETP18_Pos)                     /*!< GPIO_PORT SET0: SETP18 Mask         */\r
+#define GPIO_PORT_SET0_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET0: SETP19 Position     */\r
+#define GPIO_PORT_SET0_SETP19_Msk                             (0x01UL << GPIO_PORT_SET0_SETP19_Pos)                     /*!< GPIO_PORT SET0: SETP19 Mask         */\r
+#define GPIO_PORT_SET0_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET0: SETP20 Position     */\r
+#define GPIO_PORT_SET0_SETP20_Msk                             (0x01UL << GPIO_PORT_SET0_SETP20_Pos)                     /*!< GPIO_PORT SET0: SETP20 Mask         */\r
+#define GPIO_PORT_SET0_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET0: SETP21 Position     */\r
+#define GPIO_PORT_SET0_SETP21_Msk                             (0x01UL << GPIO_PORT_SET0_SETP21_Pos)                     /*!< GPIO_PORT SET0: SETP21 Mask         */\r
+#define GPIO_PORT_SET0_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET0: SETP22 Position     */\r
+#define GPIO_PORT_SET0_SETP22_Msk                             (0x01UL << GPIO_PORT_SET0_SETP22_Pos)                     /*!< GPIO_PORT SET0: SETP22 Mask         */\r
+#define GPIO_PORT_SET0_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET0: SETP23 Position     */\r
+#define GPIO_PORT_SET0_SETP23_Msk                             (0x01UL << GPIO_PORT_SET0_SETP23_Pos)                     /*!< GPIO_PORT SET0: SETP23 Mask         */\r
+#define GPIO_PORT_SET0_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET0: SETP24 Position     */\r
+#define GPIO_PORT_SET0_SETP24_Msk                             (0x01UL << GPIO_PORT_SET0_SETP24_Pos)                     /*!< GPIO_PORT SET0: SETP24 Mask         */\r
+#define GPIO_PORT_SET0_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET0: SETP25 Position     */\r
+#define GPIO_PORT_SET0_SETP25_Msk                             (0x01UL << GPIO_PORT_SET0_SETP25_Pos)                     /*!< GPIO_PORT SET0: SETP25 Mask         */\r
+#define GPIO_PORT_SET0_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET0: SETP26 Position     */\r
+#define GPIO_PORT_SET0_SETP26_Msk                             (0x01UL << GPIO_PORT_SET0_SETP26_Pos)                     /*!< GPIO_PORT SET0: SETP26 Mask         */\r
+#define GPIO_PORT_SET0_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET0: SETP27 Position     */\r
+#define GPIO_PORT_SET0_SETP27_Msk                             (0x01UL << GPIO_PORT_SET0_SETP27_Pos)                     /*!< GPIO_PORT SET0: SETP27 Mask         */\r
+#define GPIO_PORT_SET0_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET0: SETP28 Position     */\r
+#define GPIO_PORT_SET0_SETP28_Msk                             (0x01UL << GPIO_PORT_SET0_SETP28_Pos)                     /*!< GPIO_PORT SET0: SETP28 Mask         */\r
+#define GPIO_PORT_SET0_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET0: SETP29 Position     */\r
+#define GPIO_PORT_SET0_SETP29_Msk                             (0x01UL << GPIO_PORT_SET0_SETP29_Pos)                     /*!< GPIO_PORT SET0: SETP29 Mask         */\r
+#define GPIO_PORT_SET0_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET0: SETP30 Position     */\r
+#define GPIO_PORT_SET0_SETP30_Msk                             (0x01UL << GPIO_PORT_SET0_SETP30_Pos)                     /*!< GPIO_PORT SET0: SETP30 Mask         */\r
+#define GPIO_PORT_SET0_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET0: SETP31 Position     */\r
+#define GPIO_PORT_SET0_SETP31_Msk                             (0x01UL << GPIO_PORT_SET0_SETP31_Pos)                     /*!< GPIO_PORT SET0: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET1  -----------------------------------------\r
+#define GPIO_PORT_SET1_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET1: SETP0 Position      */\r
+#define GPIO_PORT_SET1_SETP0_Msk                              (0x01UL << GPIO_PORT_SET1_SETP0_Pos)                      /*!< GPIO_PORT SET1: SETP0 Mask          */\r
+#define GPIO_PORT_SET1_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET1: SETP1 Position      */\r
+#define GPIO_PORT_SET1_SETP1_Msk                              (0x01UL << GPIO_PORT_SET1_SETP1_Pos)                      /*!< GPIO_PORT SET1: SETP1 Mask          */\r
+#define GPIO_PORT_SET1_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET1: SETP2 Position      */\r
+#define GPIO_PORT_SET1_SETP2_Msk                              (0x01UL << GPIO_PORT_SET1_SETP2_Pos)                      /*!< GPIO_PORT SET1: SETP2 Mask          */\r
+#define GPIO_PORT_SET1_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET1: SETP3 Position      */\r
+#define GPIO_PORT_SET1_SETP3_Msk                              (0x01UL << GPIO_PORT_SET1_SETP3_Pos)                      /*!< GPIO_PORT SET1: SETP3 Mask          */\r
+#define GPIO_PORT_SET1_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET1: SETP4 Position      */\r
+#define GPIO_PORT_SET1_SETP4_Msk                              (0x01UL << GPIO_PORT_SET1_SETP4_Pos)                      /*!< GPIO_PORT SET1: SETP4 Mask          */\r
+#define GPIO_PORT_SET1_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET1: SETP5 Position      */\r
+#define GPIO_PORT_SET1_SETP5_Msk                              (0x01UL << GPIO_PORT_SET1_SETP5_Pos)                      /*!< GPIO_PORT SET1: SETP5 Mask          */\r
+#define GPIO_PORT_SET1_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET1: SETP6 Position      */\r
+#define GPIO_PORT_SET1_SETP6_Msk                              (0x01UL << GPIO_PORT_SET1_SETP6_Pos)                      /*!< GPIO_PORT SET1: SETP6 Mask          */\r
+#define GPIO_PORT_SET1_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET1: SETP7 Position      */\r
+#define GPIO_PORT_SET1_SETP7_Msk                              (0x01UL << GPIO_PORT_SET1_SETP7_Pos)                      /*!< GPIO_PORT SET1: SETP7 Mask          */\r
+#define GPIO_PORT_SET1_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET1: SETP8 Position      */\r
+#define GPIO_PORT_SET1_SETP8_Msk                              (0x01UL << GPIO_PORT_SET1_SETP8_Pos)                      /*!< GPIO_PORT SET1: SETP8 Mask          */\r
+#define GPIO_PORT_SET1_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET1: SETP9 Position      */\r
+#define GPIO_PORT_SET1_SETP9_Msk                              (0x01UL << GPIO_PORT_SET1_SETP9_Pos)                      /*!< GPIO_PORT SET1: SETP9 Mask          */\r
+#define GPIO_PORT_SET1_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET1: SETP10 Position     */\r
+#define GPIO_PORT_SET1_SETP10_Msk                             (0x01UL << GPIO_PORT_SET1_SETP10_Pos)                     /*!< GPIO_PORT SET1: SETP10 Mask         */\r
+#define GPIO_PORT_SET1_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET1: SETP11 Position     */\r
+#define GPIO_PORT_SET1_SETP11_Msk                             (0x01UL << GPIO_PORT_SET1_SETP11_Pos)                     /*!< GPIO_PORT SET1: SETP11 Mask         */\r
+#define GPIO_PORT_SET1_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET1: SETP12 Position     */\r
+#define GPIO_PORT_SET1_SETP12_Msk                             (0x01UL << GPIO_PORT_SET1_SETP12_Pos)                     /*!< GPIO_PORT SET1: SETP12 Mask         */\r
+#define GPIO_PORT_SET1_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET1: SETP13 Position     */\r
+#define GPIO_PORT_SET1_SETP13_Msk                             (0x01UL << GPIO_PORT_SET1_SETP13_Pos)                     /*!< GPIO_PORT SET1: SETP13 Mask         */\r
+#define GPIO_PORT_SET1_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET1: SETP14 Position     */\r
+#define GPIO_PORT_SET1_SETP14_Msk                             (0x01UL << GPIO_PORT_SET1_SETP14_Pos)                     /*!< GPIO_PORT SET1: SETP14 Mask         */\r
+#define GPIO_PORT_SET1_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET1: SETP15 Position     */\r
+#define GPIO_PORT_SET1_SETP15_Msk                             (0x01UL << GPIO_PORT_SET1_SETP15_Pos)                     /*!< GPIO_PORT SET1: SETP15 Mask         */\r
+#define GPIO_PORT_SET1_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET1: SETP16 Position     */\r
+#define GPIO_PORT_SET1_SETP16_Msk                             (0x01UL << GPIO_PORT_SET1_SETP16_Pos)                     /*!< GPIO_PORT SET1: SETP16 Mask         */\r
+#define GPIO_PORT_SET1_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET1: SETP17 Position     */\r
+#define GPIO_PORT_SET1_SETP17_Msk                             (0x01UL << GPIO_PORT_SET1_SETP17_Pos)                     /*!< GPIO_PORT SET1: SETP17 Mask         */\r
+#define GPIO_PORT_SET1_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET1: SETP18 Position     */\r
+#define GPIO_PORT_SET1_SETP18_Msk                             (0x01UL << GPIO_PORT_SET1_SETP18_Pos)                     /*!< GPIO_PORT SET1: SETP18 Mask         */\r
+#define GPIO_PORT_SET1_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET1: SETP19 Position     */\r
+#define GPIO_PORT_SET1_SETP19_Msk                             (0x01UL << GPIO_PORT_SET1_SETP19_Pos)                     /*!< GPIO_PORT SET1: SETP19 Mask         */\r
+#define GPIO_PORT_SET1_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET1: SETP20 Position     */\r
+#define GPIO_PORT_SET1_SETP20_Msk                             (0x01UL << GPIO_PORT_SET1_SETP20_Pos)                     /*!< GPIO_PORT SET1: SETP20 Mask         */\r
+#define GPIO_PORT_SET1_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET1: SETP21 Position     */\r
+#define GPIO_PORT_SET1_SETP21_Msk                             (0x01UL << GPIO_PORT_SET1_SETP21_Pos)                     /*!< GPIO_PORT SET1: SETP21 Mask         */\r
+#define GPIO_PORT_SET1_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET1: SETP22 Position     */\r
+#define GPIO_PORT_SET1_SETP22_Msk                             (0x01UL << GPIO_PORT_SET1_SETP22_Pos)                     /*!< GPIO_PORT SET1: SETP22 Mask         */\r
+#define GPIO_PORT_SET1_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET1: SETP23 Position     */\r
+#define GPIO_PORT_SET1_SETP23_Msk                             (0x01UL << GPIO_PORT_SET1_SETP23_Pos)                     /*!< GPIO_PORT SET1: SETP23 Mask         */\r
+#define GPIO_PORT_SET1_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET1: SETP24 Position     */\r
+#define GPIO_PORT_SET1_SETP24_Msk                             (0x01UL << GPIO_PORT_SET1_SETP24_Pos)                     /*!< GPIO_PORT SET1: SETP24 Mask         */\r
+#define GPIO_PORT_SET1_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET1: SETP25 Position     */\r
+#define GPIO_PORT_SET1_SETP25_Msk                             (0x01UL << GPIO_PORT_SET1_SETP25_Pos)                     /*!< GPIO_PORT SET1: SETP25 Mask         */\r
+#define GPIO_PORT_SET1_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET1: SETP26 Position     */\r
+#define GPIO_PORT_SET1_SETP26_Msk                             (0x01UL << GPIO_PORT_SET1_SETP26_Pos)                     /*!< GPIO_PORT SET1: SETP26 Mask         */\r
+#define GPIO_PORT_SET1_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET1: SETP27 Position     */\r
+#define GPIO_PORT_SET1_SETP27_Msk                             (0x01UL << GPIO_PORT_SET1_SETP27_Pos)                     /*!< GPIO_PORT SET1: SETP27 Mask         */\r
+#define GPIO_PORT_SET1_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET1: SETP28 Position     */\r
+#define GPIO_PORT_SET1_SETP28_Msk                             (0x01UL << GPIO_PORT_SET1_SETP28_Pos)                     /*!< GPIO_PORT SET1: SETP28 Mask         */\r
+#define GPIO_PORT_SET1_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET1: SETP29 Position     */\r
+#define GPIO_PORT_SET1_SETP29_Msk                             (0x01UL << GPIO_PORT_SET1_SETP29_Pos)                     /*!< GPIO_PORT SET1: SETP29 Mask         */\r
+#define GPIO_PORT_SET1_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET1: SETP30 Position     */\r
+#define GPIO_PORT_SET1_SETP30_Msk                             (0x01UL << GPIO_PORT_SET1_SETP30_Pos)                     /*!< GPIO_PORT SET1: SETP30 Mask         */\r
+#define GPIO_PORT_SET1_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET1: SETP31 Position     */\r
+#define GPIO_PORT_SET1_SETP31_Msk                             (0x01UL << GPIO_PORT_SET1_SETP31_Pos)                     /*!< GPIO_PORT SET1: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET2  -----------------------------------------\r
+#define GPIO_PORT_SET2_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET2: SETP0 Position      */\r
+#define GPIO_PORT_SET2_SETP0_Msk                              (0x01UL << GPIO_PORT_SET2_SETP0_Pos)                      /*!< GPIO_PORT SET2: SETP0 Mask          */\r
+#define GPIO_PORT_SET2_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET2: SETP1 Position      */\r
+#define GPIO_PORT_SET2_SETP1_Msk                              (0x01UL << GPIO_PORT_SET2_SETP1_Pos)                      /*!< GPIO_PORT SET2: SETP1 Mask          */\r
+#define GPIO_PORT_SET2_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET2: SETP2 Position      */\r
+#define GPIO_PORT_SET2_SETP2_Msk                              (0x01UL << GPIO_PORT_SET2_SETP2_Pos)                      /*!< GPIO_PORT SET2: SETP2 Mask          */\r
+#define GPIO_PORT_SET2_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET2: SETP3 Position      */\r
+#define GPIO_PORT_SET2_SETP3_Msk                              (0x01UL << GPIO_PORT_SET2_SETP3_Pos)                      /*!< GPIO_PORT SET2: SETP3 Mask          */\r
+#define GPIO_PORT_SET2_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET2: SETP4 Position      */\r
+#define GPIO_PORT_SET2_SETP4_Msk                              (0x01UL << GPIO_PORT_SET2_SETP4_Pos)                      /*!< GPIO_PORT SET2: SETP4 Mask          */\r
+#define GPIO_PORT_SET2_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET2: SETP5 Position      */\r
+#define GPIO_PORT_SET2_SETP5_Msk                              (0x01UL << GPIO_PORT_SET2_SETP5_Pos)                      /*!< GPIO_PORT SET2: SETP5 Mask          */\r
+#define GPIO_PORT_SET2_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET2: SETP6 Position      */\r
+#define GPIO_PORT_SET2_SETP6_Msk                              (0x01UL << GPIO_PORT_SET2_SETP6_Pos)                      /*!< GPIO_PORT SET2: SETP6 Mask          */\r
+#define GPIO_PORT_SET2_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET2: SETP7 Position      */\r
+#define GPIO_PORT_SET2_SETP7_Msk                              (0x01UL << GPIO_PORT_SET2_SETP7_Pos)                      /*!< GPIO_PORT SET2: SETP7 Mask          */\r
+#define GPIO_PORT_SET2_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET2: SETP8 Position      */\r
+#define GPIO_PORT_SET2_SETP8_Msk                              (0x01UL << GPIO_PORT_SET2_SETP8_Pos)                      /*!< GPIO_PORT SET2: SETP8 Mask          */\r
+#define GPIO_PORT_SET2_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET2: SETP9 Position      */\r
+#define GPIO_PORT_SET2_SETP9_Msk                              (0x01UL << GPIO_PORT_SET2_SETP9_Pos)                      /*!< GPIO_PORT SET2: SETP9 Mask          */\r
+#define GPIO_PORT_SET2_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET2: SETP10 Position     */\r
+#define GPIO_PORT_SET2_SETP10_Msk                             (0x01UL << GPIO_PORT_SET2_SETP10_Pos)                     /*!< GPIO_PORT SET2: SETP10 Mask         */\r
+#define GPIO_PORT_SET2_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET2: SETP11 Position     */\r
+#define GPIO_PORT_SET2_SETP11_Msk                             (0x01UL << GPIO_PORT_SET2_SETP11_Pos)                     /*!< GPIO_PORT SET2: SETP11 Mask         */\r
+#define GPIO_PORT_SET2_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET2: SETP12 Position     */\r
+#define GPIO_PORT_SET2_SETP12_Msk                             (0x01UL << GPIO_PORT_SET2_SETP12_Pos)                     /*!< GPIO_PORT SET2: SETP12 Mask         */\r
+#define GPIO_PORT_SET2_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET2: SETP13 Position     */\r
+#define GPIO_PORT_SET2_SETP13_Msk                             (0x01UL << GPIO_PORT_SET2_SETP13_Pos)                     /*!< GPIO_PORT SET2: SETP13 Mask         */\r
+#define GPIO_PORT_SET2_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET2: SETP14 Position     */\r
+#define GPIO_PORT_SET2_SETP14_Msk                             (0x01UL << GPIO_PORT_SET2_SETP14_Pos)                     /*!< GPIO_PORT SET2: SETP14 Mask         */\r
+#define GPIO_PORT_SET2_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET2: SETP15 Position     */\r
+#define GPIO_PORT_SET2_SETP15_Msk                             (0x01UL << GPIO_PORT_SET2_SETP15_Pos)                     /*!< GPIO_PORT SET2: SETP15 Mask         */\r
+#define GPIO_PORT_SET2_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET2: SETP16 Position     */\r
+#define GPIO_PORT_SET2_SETP16_Msk                             (0x01UL << GPIO_PORT_SET2_SETP16_Pos)                     /*!< GPIO_PORT SET2: SETP16 Mask         */\r
+#define GPIO_PORT_SET2_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET2: SETP17 Position     */\r
+#define GPIO_PORT_SET2_SETP17_Msk                             (0x01UL << GPIO_PORT_SET2_SETP17_Pos)                     /*!< GPIO_PORT SET2: SETP17 Mask         */\r
+#define GPIO_PORT_SET2_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET2: SETP18 Position     */\r
+#define GPIO_PORT_SET2_SETP18_Msk                             (0x01UL << GPIO_PORT_SET2_SETP18_Pos)                     /*!< GPIO_PORT SET2: SETP18 Mask         */\r
+#define GPIO_PORT_SET2_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET2: SETP19 Position     */\r
+#define GPIO_PORT_SET2_SETP19_Msk                             (0x01UL << GPIO_PORT_SET2_SETP19_Pos)                     /*!< GPIO_PORT SET2: SETP19 Mask         */\r
+#define GPIO_PORT_SET2_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET2: SETP20 Position     */\r
+#define GPIO_PORT_SET2_SETP20_Msk                             (0x01UL << GPIO_PORT_SET2_SETP20_Pos)                     /*!< GPIO_PORT SET2: SETP20 Mask         */\r
+#define GPIO_PORT_SET2_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET2: SETP21 Position     */\r
+#define GPIO_PORT_SET2_SETP21_Msk                             (0x01UL << GPIO_PORT_SET2_SETP21_Pos)                     /*!< GPIO_PORT SET2: SETP21 Mask         */\r
+#define GPIO_PORT_SET2_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET2: SETP22 Position     */\r
+#define GPIO_PORT_SET2_SETP22_Msk                             (0x01UL << GPIO_PORT_SET2_SETP22_Pos)                     /*!< GPIO_PORT SET2: SETP22 Mask         */\r
+#define GPIO_PORT_SET2_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET2: SETP23 Position     */\r
+#define GPIO_PORT_SET2_SETP23_Msk                             (0x01UL << GPIO_PORT_SET2_SETP23_Pos)                     /*!< GPIO_PORT SET2: SETP23 Mask         */\r
+#define GPIO_PORT_SET2_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET2: SETP24 Position     */\r
+#define GPIO_PORT_SET2_SETP24_Msk                             (0x01UL << GPIO_PORT_SET2_SETP24_Pos)                     /*!< GPIO_PORT SET2: SETP24 Mask         */\r
+#define GPIO_PORT_SET2_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET2: SETP25 Position     */\r
+#define GPIO_PORT_SET2_SETP25_Msk                             (0x01UL << GPIO_PORT_SET2_SETP25_Pos)                     /*!< GPIO_PORT SET2: SETP25 Mask         */\r
+#define GPIO_PORT_SET2_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET2: SETP26 Position     */\r
+#define GPIO_PORT_SET2_SETP26_Msk                             (0x01UL << GPIO_PORT_SET2_SETP26_Pos)                     /*!< GPIO_PORT SET2: SETP26 Mask         */\r
+#define GPIO_PORT_SET2_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET2: SETP27 Position     */\r
+#define GPIO_PORT_SET2_SETP27_Msk                             (0x01UL << GPIO_PORT_SET2_SETP27_Pos)                     /*!< GPIO_PORT SET2: SETP27 Mask         */\r
+#define GPIO_PORT_SET2_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET2: SETP28 Position     */\r
+#define GPIO_PORT_SET2_SETP28_Msk                             (0x01UL << GPIO_PORT_SET2_SETP28_Pos)                     /*!< GPIO_PORT SET2: SETP28 Mask         */\r
+#define GPIO_PORT_SET2_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET2: SETP29 Position     */\r
+#define GPIO_PORT_SET2_SETP29_Msk                             (0x01UL << GPIO_PORT_SET2_SETP29_Pos)                     /*!< GPIO_PORT SET2: SETP29 Mask         */\r
+#define GPIO_PORT_SET2_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET2: SETP30 Position     */\r
+#define GPIO_PORT_SET2_SETP30_Msk                             (0x01UL << GPIO_PORT_SET2_SETP30_Pos)                     /*!< GPIO_PORT SET2: SETP30 Mask         */\r
+#define GPIO_PORT_SET2_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET2: SETP31 Position     */\r
+#define GPIO_PORT_SET2_SETP31_Msk                             (0x01UL << GPIO_PORT_SET2_SETP31_Pos)                     /*!< GPIO_PORT SET2: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET3  -----------------------------------------\r
+#define GPIO_PORT_SET3_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET3: SETP0 Position      */\r
+#define GPIO_PORT_SET3_SETP0_Msk                              (0x01UL << GPIO_PORT_SET3_SETP0_Pos)                      /*!< GPIO_PORT SET3: SETP0 Mask          */\r
+#define GPIO_PORT_SET3_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET3: SETP1 Position      */\r
+#define GPIO_PORT_SET3_SETP1_Msk                              (0x01UL << GPIO_PORT_SET3_SETP1_Pos)                      /*!< GPIO_PORT SET3: SETP1 Mask          */\r
+#define GPIO_PORT_SET3_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET3: SETP2 Position      */\r
+#define GPIO_PORT_SET3_SETP2_Msk                              (0x01UL << GPIO_PORT_SET3_SETP2_Pos)                      /*!< GPIO_PORT SET3: SETP2 Mask          */\r
+#define GPIO_PORT_SET3_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET3: SETP3 Position      */\r
+#define GPIO_PORT_SET3_SETP3_Msk                              (0x01UL << GPIO_PORT_SET3_SETP3_Pos)                      /*!< GPIO_PORT SET3: SETP3 Mask          */\r
+#define GPIO_PORT_SET3_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET3: SETP4 Position      */\r
+#define GPIO_PORT_SET3_SETP4_Msk                              (0x01UL << GPIO_PORT_SET3_SETP4_Pos)                      /*!< GPIO_PORT SET3: SETP4 Mask          */\r
+#define GPIO_PORT_SET3_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET3: SETP5 Position      */\r
+#define GPIO_PORT_SET3_SETP5_Msk                              (0x01UL << GPIO_PORT_SET3_SETP5_Pos)                      /*!< GPIO_PORT SET3: SETP5 Mask          */\r
+#define GPIO_PORT_SET3_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET3: SETP6 Position      */\r
+#define GPIO_PORT_SET3_SETP6_Msk                              (0x01UL << GPIO_PORT_SET3_SETP6_Pos)                      /*!< GPIO_PORT SET3: SETP6 Mask          */\r
+#define GPIO_PORT_SET3_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET3: SETP7 Position      */\r
+#define GPIO_PORT_SET3_SETP7_Msk                              (0x01UL << GPIO_PORT_SET3_SETP7_Pos)                      /*!< GPIO_PORT SET3: SETP7 Mask          */\r
+#define GPIO_PORT_SET3_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET3: SETP8 Position      */\r
+#define GPIO_PORT_SET3_SETP8_Msk                              (0x01UL << GPIO_PORT_SET3_SETP8_Pos)                      /*!< GPIO_PORT SET3: SETP8 Mask          */\r
+#define GPIO_PORT_SET3_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET3: SETP9 Position      */\r
+#define GPIO_PORT_SET3_SETP9_Msk                              (0x01UL << GPIO_PORT_SET3_SETP9_Pos)                      /*!< GPIO_PORT SET3: SETP9 Mask          */\r
+#define GPIO_PORT_SET3_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET3: SETP10 Position     */\r
+#define GPIO_PORT_SET3_SETP10_Msk                             (0x01UL << GPIO_PORT_SET3_SETP10_Pos)                     /*!< GPIO_PORT SET3: SETP10 Mask         */\r
+#define GPIO_PORT_SET3_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET3: SETP11 Position     */\r
+#define GPIO_PORT_SET3_SETP11_Msk                             (0x01UL << GPIO_PORT_SET3_SETP11_Pos)                     /*!< GPIO_PORT SET3: SETP11 Mask         */\r
+#define GPIO_PORT_SET3_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET3: SETP12 Position     */\r
+#define GPIO_PORT_SET3_SETP12_Msk                             (0x01UL << GPIO_PORT_SET3_SETP12_Pos)                     /*!< GPIO_PORT SET3: SETP12 Mask         */\r
+#define GPIO_PORT_SET3_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET3: SETP13 Position     */\r
+#define GPIO_PORT_SET3_SETP13_Msk                             (0x01UL << GPIO_PORT_SET3_SETP13_Pos)                     /*!< GPIO_PORT SET3: SETP13 Mask         */\r
+#define GPIO_PORT_SET3_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET3: SETP14 Position     */\r
+#define GPIO_PORT_SET3_SETP14_Msk                             (0x01UL << GPIO_PORT_SET3_SETP14_Pos)                     /*!< GPIO_PORT SET3: SETP14 Mask         */\r
+#define GPIO_PORT_SET3_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET3: SETP15 Position     */\r
+#define GPIO_PORT_SET3_SETP15_Msk                             (0x01UL << GPIO_PORT_SET3_SETP15_Pos)                     /*!< GPIO_PORT SET3: SETP15 Mask         */\r
+#define GPIO_PORT_SET3_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET3: SETP16 Position     */\r
+#define GPIO_PORT_SET3_SETP16_Msk                             (0x01UL << GPIO_PORT_SET3_SETP16_Pos)                     /*!< GPIO_PORT SET3: SETP16 Mask         */\r
+#define GPIO_PORT_SET3_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET3: SETP17 Position     */\r
+#define GPIO_PORT_SET3_SETP17_Msk                             (0x01UL << GPIO_PORT_SET3_SETP17_Pos)                     /*!< GPIO_PORT SET3: SETP17 Mask         */\r
+#define GPIO_PORT_SET3_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET3: SETP18 Position     */\r
+#define GPIO_PORT_SET3_SETP18_Msk                             (0x01UL << GPIO_PORT_SET3_SETP18_Pos)                     /*!< GPIO_PORT SET3: SETP18 Mask         */\r
+#define GPIO_PORT_SET3_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET3: SETP19 Position     */\r
+#define GPIO_PORT_SET3_SETP19_Msk                             (0x01UL << GPIO_PORT_SET3_SETP19_Pos)                     /*!< GPIO_PORT SET3: SETP19 Mask         */\r
+#define GPIO_PORT_SET3_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET3: SETP20 Position     */\r
+#define GPIO_PORT_SET3_SETP20_Msk                             (0x01UL << GPIO_PORT_SET3_SETP20_Pos)                     /*!< GPIO_PORT SET3: SETP20 Mask         */\r
+#define GPIO_PORT_SET3_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET3: SETP21 Position     */\r
+#define GPIO_PORT_SET3_SETP21_Msk                             (0x01UL << GPIO_PORT_SET3_SETP21_Pos)                     /*!< GPIO_PORT SET3: SETP21 Mask         */\r
+#define GPIO_PORT_SET3_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET3: SETP22 Position     */\r
+#define GPIO_PORT_SET3_SETP22_Msk                             (0x01UL << GPIO_PORT_SET3_SETP22_Pos)                     /*!< GPIO_PORT SET3: SETP22 Mask         */\r
+#define GPIO_PORT_SET3_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET3: SETP23 Position     */\r
+#define GPIO_PORT_SET3_SETP23_Msk                             (0x01UL << GPIO_PORT_SET3_SETP23_Pos)                     /*!< GPIO_PORT SET3: SETP23 Mask         */\r
+#define GPIO_PORT_SET3_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET3: SETP24 Position     */\r
+#define GPIO_PORT_SET3_SETP24_Msk                             (0x01UL << GPIO_PORT_SET3_SETP24_Pos)                     /*!< GPIO_PORT SET3: SETP24 Mask         */\r
+#define GPIO_PORT_SET3_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET3: SETP25 Position     */\r
+#define GPIO_PORT_SET3_SETP25_Msk                             (0x01UL << GPIO_PORT_SET3_SETP25_Pos)                     /*!< GPIO_PORT SET3: SETP25 Mask         */\r
+#define GPIO_PORT_SET3_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET3: SETP26 Position     */\r
+#define GPIO_PORT_SET3_SETP26_Msk                             (0x01UL << GPIO_PORT_SET3_SETP26_Pos)                     /*!< GPIO_PORT SET3: SETP26 Mask         */\r
+#define GPIO_PORT_SET3_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET3: SETP27 Position     */\r
+#define GPIO_PORT_SET3_SETP27_Msk                             (0x01UL << GPIO_PORT_SET3_SETP27_Pos)                     /*!< GPIO_PORT SET3: SETP27 Mask         */\r
+#define GPIO_PORT_SET3_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET3: SETP28 Position     */\r
+#define GPIO_PORT_SET3_SETP28_Msk                             (0x01UL << GPIO_PORT_SET3_SETP28_Pos)                     /*!< GPIO_PORT SET3: SETP28 Mask         */\r
+#define GPIO_PORT_SET3_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET3: SETP29 Position     */\r
+#define GPIO_PORT_SET3_SETP29_Msk                             (0x01UL << GPIO_PORT_SET3_SETP29_Pos)                     /*!< GPIO_PORT SET3: SETP29 Mask         */\r
+#define GPIO_PORT_SET3_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET3: SETP30 Position     */\r
+#define GPIO_PORT_SET3_SETP30_Msk                             (0x01UL << GPIO_PORT_SET3_SETP30_Pos)                     /*!< GPIO_PORT SET3: SETP30 Mask         */\r
+#define GPIO_PORT_SET3_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET3: SETP31 Position     */\r
+#define GPIO_PORT_SET3_SETP31_Msk                             (0x01UL << GPIO_PORT_SET3_SETP31_Pos)                     /*!< GPIO_PORT SET3: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET4  -----------------------------------------\r
+#define GPIO_PORT_SET4_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET4: SETP0 Position      */\r
+#define GPIO_PORT_SET4_SETP0_Msk                              (0x01UL << GPIO_PORT_SET4_SETP0_Pos)                      /*!< GPIO_PORT SET4: SETP0 Mask          */\r
+#define GPIO_PORT_SET4_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET4: SETP1 Position      */\r
+#define GPIO_PORT_SET4_SETP1_Msk                              (0x01UL << GPIO_PORT_SET4_SETP1_Pos)                      /*!< GPIO_PORT SET4: SETP1 Mask          */\r
+#define GPIO_PORT_SET4_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET4: SETP2 Position      */\r
+#define GPIO_PORT_SET4_SETP2_Msk                              (0x01UL << GPIO_PORT_SET4_SETP2_Pos)                      /*!< GPIO_PORT SET4: SETP2 Mask          */\r
+#define GPIO_PORT_SET4_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET4: SETP3 Position      */\r
+#define GPIO_PORT_SET4_SETP3_Msk                              (0x01UL << GPIO_PORT_SET4_SETP3_Pos)                      /*!< GPIO_PORT SET4: SETP3 Mask          */\r
+#define GPIO_PORT_SET4_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET4: SETP4 Position      */\r
+#define GPIO_PORT_SET4_SETP4_Msk                              (0x01UL << GPIO_PORT_SET4_SETP4_Pos)                      /*!< GPIO_PORT SET4: SETP4 Mask          */\r
+#define GPIO_PORT_SET4_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET4: SETP5 Position      */\r
+#define GPIO_PORT_SET4_SETP5_Msk                              (0x01UL << GPIO_PORT_SET4_SETP5_Pos)                      /*!< GPIO_PORT SET4: SETP5 Mask          */\r
+#define GPIO_PORT_SET4_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET4: SETP6 Position      */\r
+#define GPIO_PORT_SET4_SETP6_Msk                              (0x01UL << GPIO_PORT_SET4_SETP6_Pos)                      /*!< GPIO_PORT SET4: SETP6 Mask          */\r
+#define GPIO_PORT_SET4_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET4: SETP7 Position      */\r
+#define GPIO_PORT_SET4_SETP7_Msk                              (0x01UL << GPIO_PORT_SET4_SETP7_Pos)                      /*!< GPIO_PORT SET4: SETP7 Mask          */\r
+#define GPIO_PORT_SET4_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET4: SETP8 Position      */\r
+#define GPIO_PORT_SET4_SETP8_Msk                              (0x01UL << GPIO_PORT_SET4_SETP8_Pos)                      /*!< GPIO_PORT SET4: SETP8 Mask          */\r
+#define GPIO_PORT_SET4_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET4: SETP9 Position      */\r
+#define GPIO_PORT_SET4_SETP9_Msk                              (0x01UL << GPIO_PORT_SET4_SETP9_Pos)                      /*!< GPIO_PORT SET4: SETP9 Mask          */\r
+#define GPIO_PORT_SET4_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET4: SETP10 Position     */\r
+#define GPIO_PORT_SET4_SETP10_Msk                             (0x01UL << GPIO_PORT_SET4_SETP10_Pos)                     /*!< GPIO_PORT SET4: SETP10 Mask         */\r
+#define GPIO_PORT_SET4_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET4: SETP11 Position     */\r
+#define GPIO_PORT_SET4_SETP11_Msk                             (0x01UL << GPIO_PORT_SET4_SETP11_Pos)                     /*!< GPIO_PORT SET4: SETP11 Mask         */\r
+#define GPIO_PORT_SET4_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET4: SETP12 Position     */\r
+#define GPIO_PORT_SET4_SETP12_Msk                             (0x01UL << GPIO_PORT_SET4_SETP12_Pos)                     /*!< GPIO_PORT SET4: SETP12 Mask         */\r
+#define GPIO_PORT_SET4_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET4: SETP13 Position     */\r
+#define GPIO_PORT_SET4_SETP13_Msk                             (0x01UL << GPIO_PORT_SET4_SETP13_Pos)                     /*!< GPIO_PORT SET4: SETP13 Mask         */\r
+#define GPIO_PORT_SET4_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET4: SETP14 Position     */\r
+#define GPIO_PORT_SET4_SETP14_Msk                             (0x01UL << GPIO_PORT_SET4_SETP14_Pos)                     /*!< GPIO_PORT SET4: SETP14 Mask         */\r
+#define GPIO_PORT_SET4_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET4: SETP15 Position     */\r
+#define GPIO_PORT_SET4_SETP15_Msk                             (0x01UL << GPIO_PORT_SET4_SETP15_Pos)                     /*!< GPIO_PORT SET4: SETP15 Mask         */\r
+#define GPIO_PORT_SET4_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET4: SETP16 Position     */\r
+#define GPIO_PORT_SET4_SETP16_Msk                             (0x01UL << GPIO_PORT_SET4_SETP16_Pos)                     /*!< GPIO_PORT SET4: SETP16 Mask         */\r
+#define GPIO_PORT_SET4_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET4: SETP17 Position     */\r
+#define GPIO_PORT_SET4_SETP17_Msk                             (0x01UL << GPIO_PORT_SET4_SETP17_Pos)                     /*!< GPIO_PORT SET4: SETP17 Mask         */\r
+#define GPIO_PORT_SET4_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET4: SETP18 Position     */\r
+#define GPIO_PORT_SET4_SETP18_Msk                             (0x01UL << GPIO_PORT_SET4_SETP18_Pos)                     /*!< GPIO_PORT SET4: SETP18 Mask         */\r
+#define GPIO_PORT_SET4_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET4: SETP19 Position     */\r
+#define GPIO_PORT_SET4_SETP19_Msk                             (0x01UL << GPIO_PORT_SET4_SETP19_Pos)                     /*!< GPIO_PORT SET4: SETP19 Mask         */\r
+#define GPIO_PORT_SET4_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET4: SETP20 Position     */\r
+#define GPIO_PORT_SET4_SETP20_Msk                             (0x01UL << GPIO_PORT_SET4_SETP20_Pos)                     /*!< GPIO_PORT SET4: SETP20 Mask         */\r
+#define GPIO_PORT_SET4_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET4: SETP21 Position     */\r
+#define GPIO_PORT_SET4_SETP21_Msk                             (0x01UL << GPIO_PORT_SET4_SETP21_Pos)                     /*!< GPIO_PORT SET4: SETP21 Mask         */\r
+#define GPIO_PORT_SET4_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET4: SETP22 Position     */\r
+#define GPIO_PORT_SET4_SETP22_Msk                             (0x01UL << GPIO_PORT_SET4_SETP22_Pos)                     /*!< GPIO_PORT SET4: SETP22 Mask         */\r
+#define GPIO_PORT_SET4_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET4: SETP23 Position     */\r
+#define GPIO_PORT_SET4_SETP23_Msk                             (0x01UL << GPIO_PORT_SET4_SETP23_Pos)                     /*!< GPIO_PORT SET4: SETP23 Mask         */\r
+#define GPIO_PORT_SET4_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET4: SETP24 Position     */\r
+#define GPIO_PORT_SET4_SETP24_Msk                             (0x01UL << GPIO_PORT_SET4_SETP24_Pos)                     /*!< GPIO_PORT SET4: SETP24 Mask         */\r
+#define GPIO_PORT_SET4_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET4: SETP25 Position     */\r
+#define GPIO_PORT_SET4_SETP25_Msk                             (0x01UL << GPIO_PORT_SET4_SETP25_Pos)                     /*!< GPIO_PORT SET4: SETP25 Mask         */\r
+#define GPIO_PORT_SET4_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET4: SETP26 Position     */\r
+#define GPIO_PORT_SET4_SETP26_Msk                             (0x01UL << GPIO_PORT_SET4_SETP26_Pos)                     /*!< GPIO_PORT SET4: SETP26 Mask         */\r
+#define GPIO_PORT_SET4_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET4: SETP27 Position     */\r
+#define GPIO_PORT_SET4_SETP27_Msk                             (0x01UL << GPIO_PORT_SET4_SETP27_Pos)                     /*!< GPIO_PORT SET4: SETP27 Mask         */\r
+#define GPIO_PORT_SET4_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET4: SETP28 Position     */\r
+#define GPIO_PORT_SET4_SETP28_Msk                             (0x01UL << GPIO_PORT_SET4_SETP28_Pos)                     /*!< GPIO_PORT SET4: SETP28 Mask         */\r
+#define GPIO_PORT_SET4_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET4: SETP29 Position     */\r
+#define GPIO_PORT_SET4_SETP29_Msk                             (0x01UL << GPIO_PORT_SET4_SETP29_Pos)                     /*!< GPIO_PORT SET4: SETP29 Mask         */\r
+#define GPIO_PORT_SET4_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET4: SETP30 Position     */\r
+#define GPIO_PORT_SET4_SETP30_Msk                             (0x01UL << GPIO_PORT_SET4_SETP30_Pos)                     /*!< GPIO_PORT SET4: SETP30 Mask         */\r
+#define GPIO_PORT_SET4_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET4: SETP31 Position     */\r
+#define GPIO_PORT_SET4_SETP31_Msk                             (0x01UL << GPIO_PORT_SET4_SETP31_Pos)                     /*!< GPIO_PORT SET4: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET5  -----------------------------------------\r
+#define GPIO_PORT_SET5_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET5: SETP0 Position      */\r
+#define GPIO_PORT_SET5_SETP0_Msk                              (0x01UL << GPIO_PORT_SET5_SETP0_Pos)                      /*!< GPIO_PORT SET5: SETP0 Mask          */\r
+#define GPIO_PORT_SET5_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET5: SETP1 Position      */\r
+#define GPIO_PORT_SET5_SETP1_Msk                              (0x01UL << GPIO_PORT_SET5_SETP1_Pos)                      /*!< GPIO_PORT SET5: SETP1 Mask          */\r
+#define GPIO_PORT_SET5_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET5: SETP2 Position      */\r
+#define GPIO_PORT_SET5_SETP2_Msk                              (0x01UL << GPIO_PORT_SET5_SETP2_Pos)                      /*!< GPIO_PORT SET5: SETP2 Mask          */\r
+#define GPIO_PORT_SET5_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET5: SETP3 Position      */\r
+#define GPIO_PORT_SET5_SETP3_Msk                              (0x01UL << GPIO_PORT_SET5_SETP3_Pos)                      /*!< GPIO_PORT SET5: SETP3 Mask          */\r
+#define GPIO_PORT_SET5_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET5: SETP4 Position      */\r
+#define GPIO_PORT_SET5_SETP4_Msk                              (0x01UL << GPIO_PORT_SET5_SETP4_Pos)                      /*!< GPIO_PORT SET5: SETP4 Mask          */\r
+#define GPIO_PORT_SET5_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET5: SETP5 Position      */\r
+#define GPIO_PORT_SET5_SETP5_Msk                              (0x01UL << GPIO_PORT_SET5_SETP5_Pos)                      /*!< GPIO_PORT SET5: SETP5 Mask          */\r
+#define GPIO_PORT_SET5_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET5: SETP6 Position      */\r
+#define GPIO_PORT_SET5_SETP6_Msk                              (0x01UL << GPIO_PORT_SET5_SETP6_Pos)                      /*!< GPIO_PORT SET5: SETP6 Mask          */\r
+#define GPIO_PORT_SET5_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET5: SETP7 Position      */\r
+#define GPIO_PORT_SET5_SETP7_Msk                              (0x01UL << GPIO_PORT_SET5_SETP7_Pos)                      /*!< GPIO_PORT SET5: SETP7 Mask          */\r
+#define GPIO_PORT_SET5_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET5: SETP8 Position      */\r
+#define GPIO_PORT_SET5_SETP8_Msk                              (0x01UL << GPIO_PORT_SET5_SETP8_Pos)                      /*!< GPIO_PORT SET5: SETP8 Mask          */\r
+#define GPIO_PORT_SET5_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET5: SETP9 Position      */\r
+#define GPIO_PORT_SET5_SETP9_Msk                              (0x01UL << GPIO_PORT_SET5_SETP9_Pos)                      /*!< GPIO_PORT SET5: SETP9 Mask          */\r
+#define GPIO_PORT_SET5_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET5: SETP10 Position     */\r
+#define GPIO_PORT_SET5_SETP10_Msk                             (0x01UL << GPIO_PORT_SET5_SETP10_Pos)                     /*!< GPIO_PORT SET5: SETP10 Mask         */\r
+#define GPIO_PORT_SET5_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET5: SETP11 Position     */\r
+#define GPIO_PORT_SET5_SETP11_Msk                             (0x01UL << GPIO_PORT_SET5_SETP11_Pos)                     /*!< GPIO_PORT SET5: SETP11 Mask         */\r
+#define GPIO_PORT_SET5_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET5: SETP12 Position     */\r
+#define GPIO_PORT_SET5_SETP12_Msk                             (0x01UL << GPIO_PORT_SET5_SETP12_Pos)                     /*!< GPIO_PORT SET5: SETP12 Mask         */\r
+#define GPIO_PORT_SET5_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET5: SETP13 Position     */\r
+#define GPIO_PORT_SET5_SETP13_Msk                             (0x01UL << GPIO_PORT_SET5_SETP13_Pos)                     /*!< GPIO_PORT SET5: SETP13 Mask         */\r
+#define GPIO_PORT_SET5_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET5: SETP14 Position     */\r
+#define GPIO_PORT_SET5_SETP14_Msk                             (0x01UL << GPIO_PORT_SET5_SETP14_Pos)                     /*!< GPIO_PORT SET5: SETP14 Mask         */\r
+#define GPIO_PORT_SET5_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET5: SETP15 Position     */\r
+#define GPIO_PORT_SET5_SETP15_Msk                             (0x01UL << GPIO_PORT_SET5_SETP15_Pos)                     /*!< GPIO_PORT SET5: SETP15 Mask         */\r
+#define GPIO_PORT_SET5_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET5: SETP16 Position     */\r
+#define GPIO_PORT_SET5_SETP16_Msk                             (0x01UL << GPIO_PORT_SET5_SETP16_Pos)                     /*!< GPIO_PORT SET5: SETP16 Mask         */\r
+#define GPIO_PORT_SET5_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET5: SETP17 Position     */\r
+#define GPIO_PORT_SET5_SETP17_Msk                             (0x01UL << GPIO_PORT_SET5_SETP17_Pos)                     /*!< GPIO_PORT SET5: SETP17 Mask         */\r
+#define GPIO_PORT_SET5_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET5: SETP18 Position     */\r
+#define GPIO_PORT_SET5_SETP18_Msk                             (0x01UL << GPIO_PORT_SET5_SETP18_Pos)                     /*!< GPIO_PORT SET5: SETP18 Mask         */\r
+#define GPIO_PORT_SET5_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET5: SETP19 Position     */\r
+#define GPIO_PORT_SET5_SETP19_Msk                             (0x01UL << GPIO_PORT_SET5_SETP19_Pos)                     /*!< GPIO_PORT SET5: SETP19 Mask         */\r
+#define GPIO_PORT_SET5_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET5: SETP20 Position     */\r
+#define GPIO_PORT_SET5_SETP20_Msk                             (0x01UL << GPIO_PORT_SET5_SETP20_Pos)                     /*!< GPIO_PORT SET5: SETP20 Mask         */\r
+#define GPIO_PORT_SET5_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET5: SETP21 Position     */\r
+#define GPIO_PORT_SET5_SETP21_Msk                             (0x01UL << GPIO_PORT_SET5_SETP21_Pos)                     /*!< GPIO_PORT SET5: SETP21 Mask         */\r
+#define GPIO_PORT_SET5_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET5: SETP22 Position     */\r
+#define GPIO_PORT_SET5_SETP22_Msk                             (0x01UL << GPIO_PORT_SET5_SETP22_Pos)                     /*!< GPIO_PORT SET5: SETP22 Mask         */\r
+#define GPIO_PORT_SET5_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET5: SETP23 Position     */\r
+#define GPIO_PORT_SET5_SETP23_Msk                             (0x01UL << GPIO_PORT_SET5_SETP23_Pos)                     /*!< GPIO_PORT SET5: SETP23 Mask         */\r
+#define GPIO_PORT_SET5_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET5: SETP24 Position     */\r
+#define GPIO_PORT_SET5_SETP24_Msk                             (0x01UL << GPIO_PORT_SET5_SETP24_Pos)                     /*!< GPIO_PORT SET5: SETP24 Mask         */\r
+#define GPIO_PORT_SET5_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET5: SETP25 Position     */\r
+#define GPIO_PORT_SET5_SETP25_Msk                             (0x01UL << GPIO_PORT_SET5_SETP25_Pos)                     /*!< GPIO_PORT SET5: SETP25 Mask         */\r
+#define GPIO_PORT_SET5_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET5: SETP26 Position     */\r
+#define GPIO_PORT_SET5_SETP26_Msk                             (0x01UL << GPIO_PORT_SET5_SETP26_Pos)                     /*!< GPIO_PORT SET5: SETP26 Mask         */\r
+#define GPIO_PORT_SET5_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET5: SETP27 Position     */\r
+#define GPIO_PORT_SET5_SETP27_Msk                             (0x01UL << GPIO_PORT_SET5_SETP27_Pos)                     /*!< GPIO_PORT SET5: SETP27 Mask         */\r
+#define GPIO_PORT_SET5_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET5: SETP28 Position     */\r
+#define GPIO_PORT_SET5_SETP28_Msk                             (0x01UL << GPIO_PORT_SET5_SETP28_Pos)                     /*!< GPIO_PORT SET5: SETP28 Mask         */\r
+#define GPIO_PORT_SET5_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET5: SETP29 Position     */\r
+#define GPIO_PORT_SET5_SETP29_Msk                             (0x01UL << GPIO_PORT_SET5_SETP29_Pos)                     /*!< GPIO_PORT SET5: SETP29 Mask         */\r
+#define GPIO_PORT_SET5_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET5: SETP30 Position     */\r
+#define GPIO_PORT_SET5_SETP30_Msk                             (0x01UL << GPIO_PORT_SET5_SETP30_Pos)                     /*!< GPIO_PORT SET5: SETP30 Mask         */\r
+#define GPIO_PORT_SET5_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET5: SETP31 Position     */\r
+#define GPIO_PORT_SET5_SETP31_Msk                             (0x01UL << GPIO_PORT_SET5_SETP31_Pos)                     /*!< GPIO_PORT SET5: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET6  -----------------------------------------\r
+#define GPIO_PORT_SET6_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET6: SETP0 Position      */\r
+#define GPIO_PORT_SET6_SETP0_Msk                              (0x01UL << GPIO_PORT_SET6_SETP0_Pos)                      /*!< GPIO_PORT SET6: SETP0 Mask          */\r
+#define GPIO_PORT_SET6_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET6: SETP1 Position      */\r
+#define GPIO_PORT_SET6_SETP1_Msk                              (0x01UL << GPIO_PORT_SET6_SETP1_Pos)                      /*!< GPIO_PORT SET6: SETP1 Mask          */\r
+#define GPIO_PORT_SET6_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET6: SETP2 Position      */\r
+#define GPIO_PORT_SET6_SETP2_Msk                              (0x01UL << GPIO_PORT_SET6_SETP2_Pos)                      /*!< GPIO_PORT SET6: SETP2 Mask          */\r
+#define GPIO_PORT_SET6_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET6: SETP3 Position      */\r
+#define GPIO_PORT_SET6_SETP3_Msk                              (0x01UL << GPIO_PORT_SET6_SETP3_Pos)                      /*!< GPIO_PORT SET6: SETP3 Mask          */\r
+#define GPIO_PORT_SET6_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET6: SETP4 Position      */\r
+#define GPIO_PORT_SET6_SETP4_Msk                              (0x01UL << GPIO_PORT_SET6_SETP4_Pos)                      /*!< GPIO_PORT SET6: SETP4 Mask          */\r
+#define GPIO_PORT_SET6_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET6: SETP5 Position      */\r
+#define GPIO_PORT_SET6_SETP5_Msk                              (0x01UL << GPIO_PORT_SET6_SETP5_Pos)                      /*!< GPIO_PORT SET6: SETP5 Mask          */\r
+#define GPIO_PORT_SET6_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET6: SETP6 Position      */\r
+#define GPIO_PORT_SET6_SETP6_Msk                              (0x01UL << GPIO_PORT_SET6_SETP6_Pos)                      /*!< GPIO_PORT SET6: SETP6 Mask          */\r
+#define GPIO_PORT_SET6_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET6: SETP7 Position      */\r
+#define GPIO_PORT_SET6_SETP7_Msk                              (0x01UL << GPIO_PORT_SET6_SETP7_Pos)                      /*!< GPIO_PORT SET6: SETP7 Mask          */\r
+#define GPIO_PORT_SET6_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET6: SETP8 Position      */\r
+#define GPIO_PORT_SET6_SETP8_Msk                              (0x01UL << GPIO_PORT_SET6_SETP8_Pos)                      /*!< GPIO_PORT SET6: SETP8 Mask          */\r
+#define GPIO_PORT_SET6_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET6: SETP9 Position      */\r
+#define GPIO_PORT_SET6_SETP9_Msk                              (0x01UL << GPIO_PORT_SET6_SETP9_Pos)                      /*!< GPIO_PORT SET6: SETP9 Mask          */\r
+#define GPIO_PORT_SET6_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET6: SETP10 Position     */\r
+#define GPIO_PORT_SET6_SETP10_Msk                             (0x01UL << GPIO_PORT_SET6_SETP10_Pos)                     /*!< GPIO_PORT SET6: SETP10 Mask         */\r
+#define GPIO_PORT_SET6_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET6: SETP11 Position     */\r
+#define GPIO_PORT_SET6_SETP11_Msk                             (0x01UL << GPIO_PORT_SET6_SETP11_Pos)                     /*!< GPIO_PORT SET6: SETP11 Mask         */\r
+#define GPIO_PORT_SET6_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET6: SETP12 Position     */\r
+#define GPIO_PORT_SET6_SETP12_Msk                             (0x01UL << GPIO_PORT_SET6_SETP12_Pos)                     /*!< GPIO_PORT SET6: SETP12 Mask         */\r
+#define GPIO_PORT_SET6_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET6: SETP13 Position     */\r
+#define GPIO_PORT_SET6_SETP13_Msk                             (0x01UL << GPIO_PORT_SET6_SETP13_Pos)                     /*!< GPIO_PORT SET6: SETP13 Mask         */\r
+#define GPIO_PORT_SET6_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET6: SETP14 Position     */\r
+#define GPIO_PORT_SET6_SETP14_Msk                             (0x01UL << GPIO_PORT_SET6_SETP14_Pos)                     /*!< GPIO_PORT SET6: SETP14 Mask         */\r
+#define GPIO_PORT_SET6_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET6: SETP15 Position     */\r
+#define GPIO_PORT_SET6_SETP15_Msk                             (0x01UL << GPIO_PORT_SET6_SETP15_Pos)                     /*!< GPIO_PORT SET6: SETP15 Mask         */\r
+#define GPIO_PORT_SET6_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET6: SETP16 Position     */\r
+#define GPIO_PORT_SET6_SETP16_Msk                             (0x01UL << GPIO_PORT_SET6_SETP16_Pos)                     /*!< GPIO_PORT SET6: SETP16 Mask         */\r
+#define GPIO_PORT_SET6_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET6: SETP17 Position     */\r
+#define GPIO_PORT_SET6_SETP17_Msk                             (0x01UL << GPIO_PORT_SET6_SETP17_Pos)                     /*!< GPIO_PORT SET6: SETP17 Mask         */\r
+#define GPIO_PORT_SET6_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET6: SETP18 Position     */\r
+#define GPIO_PORT_SET6_SETP18_Msk                             (0x01UL << GPIO_PORT_SET6_SETP18_Pos)                     /*!< GPIO_PORT SET6: SETP18 Mask         */\r
+#define GPIO_PORT_SET6_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET6: SETP19 Position     */\r
+#define GPIO_PORT_SET6_SETP19_Msk                             (0x01UL << GPIO_PORT_SET6_SETP19_Pos)                     /*!< GPIO_PORT SET6: SETP19 Mask         */\r
+#define GPIO_PORT_SET6_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET6: SETP20 Position     */\r
+#define GPIO_PORT_SET6_SETP20_Msk                             (0x01UL << GPIO_PORT_SET6_SETP20_Pos)                     /*!< GPIO_PORT SET6: SETP20 Mask         */\r
+#define GPIO_PORT_SET6_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET6: SETP21 Position     */\r
+#define GPIO_PORT_SET6_SETP21_Msk                             (0x01UL << GPIO_PORT_SET6_SETP21_Pos)                     /*!< GPIO_PORT SET6: SETP21 Mask         */\r
+#define GPIO_PORT_SET6_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET6: SETP22 Position     */\r
+#define GPIO_PORT_SET6_SETP22_Msk                             (0x01UL << GPIO_PORT_SET6_SETP22_Pos)                     /*!< GPIO_PORT SET6: SETP22 Mask         */\r
+#define GPIO_PORT_SET6_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET6: SETP23 Position     */\r
+#define GPIO_PORT_SET6_SETP23_Msk                             (0x01UL << GPIO_PORT_SET6_SETP23_Pos)                     /*!< GPIO_PORT SET6: SETP23 Mask         */\r
+#define GPIO_PORT_SET6_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET6: SETP24 Position     */\r
+#define GPIO_PORT_SET6_SETP24_Msk                             (0x01UL << GPIO_PORT_SET6_SETP24_Pos)                     /*!< GPIO_PORT SET6: SETP24 Mask         */\r
+#define GPIO_PORT_SET6_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET6: SETP25 Position     */\r
+#define GPIO_PORT_SET6_SETP25_Msk                             (0x01UL << GPIO_PORT_SET6_SETP25_Pos)                     /*!< GPIO_PORT SET6: SETP25 Mask         */\r
+#define GPIO_PORT_SET6_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET6: SETP26 Position     */\r
+#define GPIO_PORT_SET6_SETP26_Msk                             (0x01UL << GPIO_PORT_SET6_SETP26_Pos)                     /*!< GPIO_PORT SET6: SETP26 Mask         */\r
+#define GPIO_PORT_SET6_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET6: SETP27 Position     */\r
+#define GPIO_PORT_SET6_SETP27_Msk                             (0x01UL << GPIO_PORT_SET6_SETP27_Pos)                     /*!< GPIO_PORT SET6: SETP27 Mask         */\r
+#define GPIO_PORT_SET6_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET6: SETP28 Position     */\r
+#define GPIO_PORT_SET6_SETP28_Msk                             (0x01UL << GPIO_PORT_SET6_SETP28_Pos)                     /*!< GPIO_PORT SET6: SETP28 Mask         */\r
+#define GPIO_PORT_SET6_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET6: SETP29 Position     */\r
+#define GPIO_PORT_SET6_SETP29_Msk                             (0x01UL << GPIO_PORT_SET6_SETP29_Pos)                     /*!< GPIO_PORT SET6: SETP29 Mask         */\r
+#define GPIO_PORT_SET6_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET6: SETP30 Position     */\r
+#define GPIO_PORT_SET6_SETP30_Msk                             (0x01UL << GPIO_PORT_SET6_SETP30_Pos)                     /*!< GPIO_PORT SET6: SETP30 Mask         */\r
+#define GPIO_PORT_SET6_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET6: SETP31 Position     */\r
+#define GPIO_PORT_SET6_SETP31_Msk                             (0x01UL << GPIO_PORT_SET6_SETP31_Pos)                     /*!< GPIO_PORT SET6: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_SET7  -----------------------------------------\r
+#define GPIO_PORT_SET7_SETP0_Pos                              0                                                         /*!< GPIO_PORT SET7: SETP0 Position      */\r
+#define GPIO_PORT_SET7_SETP0_Msk                              (0x01UL << GPIO_PORT_SET7_SETP0_Pos)                      /*!< GPIO_PORT SET7: SETP0 Mask          */\r
+#define GPIO_PORT_SET7_SETP1_Pos                              1                                                         /*!< GPIO_PORT SET7: SETP1 Position      */\r
+#define GPIO_PORT_SET7_SETP1_Msk                              (0x01UL << GPIO_PORT_SET7_SETP1_Pos)                      /*!< GPIO_PORT SET7: SETP1 Mask          */\r
+#define GPIO_PORT_SET7_SETP2_Pos                              2                                                         /*!< GPIO_PORT SET7: SETP2 Position      */\r
+#define GPIO_PORT_SET7_SETP2_Msk                              (0x01UL << GPIO_PORT_SET7_SETP2_Pos)                      /*!< GPIO_PORT SET7: SETP2 Mask          */\r
+#define GPIO_PORT_SET7_SETP3_Pos                              3                                                         /*!< GPIO_PORT SET7: SETP3 Position      */\r
+#define GPIO_PORT_SET7_SETP3_Msk                              (0x01UL << GPIO_PORT_SET7_SETP3_Pos)                      /*!< GPIO_PORT SET7: SETP3 Mask          */\r
+#define GPIO_PORT_SET7_SETP4_Pos                              4                                                         /*!< GPIO_PORT SET7: SETP4 Position      */\r
+#define GPIO_PORT_SET7_SETP4_Msk                              (0x01UL << GPIO_PORT_SET7_SETP4_Pos)                      /*!< GPIO_PORT SET7: SETP4 Mask          */\r
+#define GPIO_PORT_SET7_SETP5_Pos                              5                                                         /*!< GPIO_PORT SET7: SETP5 Position      */\r
+#define GPIO_PORT_SET7_SETP5_Msk                              (0x01UL << GPIO_PORT_SET7_SETP5_Pos)                      /*!< GPIO_PORT SET7: SETP5 Mask          */\r
+#define GPIO_PORT_SET7_SETP6_Pos                              6                                                         /*!< GPIO_PORT SET7: SETP6 Position      */\r
+#define GPIO_PORT_SET7_SETP6_Msk                              (0x01UL << GPIO_PORT_SET7_SETP6_Pos)                      /*!< GPIO_PORT SET7: SETP6 Mask          */\r
+#define GPIO_PORT_SET7_SETP7_Pos                              7                                                         /*!< GPIO_PORT SET7: SETP7 Position      */\r
+#define GPIO_PORT_SET7_SETP7_Msk                              (0x01UL << GPIO_PORT_SET7_SETP7_Pos)                      /*!< GPIO_PORT SET7: SETP7 Mask          */\r
+#define GPIO_PORT_SET7_SETP8_Pos                              8                                                         /*!< GPIO_PORT SET7: SETP8 Position      */\r
+#define GPIO_PORT_SET7_SETP8_Msk                              (0x01UL << GPIO_PORT_SET7_SETP8_Pos)                      /*!< GPIO_PORT SET7: SETP8 Mask          */\r
+#define GPIO_PORT_SET7_SETP9_Pos                              9                                                         /*!< GPIO_PORT SET7: SETP9 Position      */\r
+#define GPIO_PORT_SET7_SETP9_Msk                              (0x01UL << GPIO_PORT_SET7_SETP9_Pos)                      /*!< GPIO_PORT SET7: SETP9 Mask          */\r
+#define GPIO_PORT_SET7_SETP10_Pos                             10                                                        /*!< GPIO_PORT SET7: SETP10 Position     */\r
+#define GPIO_PORT_SET7_SETP10_Msk                             (0x01UL << GPIO_PORT_SET7_SETP10_Pos)                     /*!< GPIO_PORT SET7: SETP10 Mask         */\r
+#define GPIO_PORT_SET7_SETP11_Pos                             11                                                        /*!< GPIO_PORT SET7: SETP11 Position     */\r
+#define GPIO_PORT_SET7_SETP11_Msk                             (0x01UL << GPIO_PORT_SET7_SETP11_Pos)                     /*!< GPIO_PORT SET7: SETP11 Mask         */\r
+#define GPIO_PORT_SET7_SETP12_Pos                             12                                                        /*!< GPIO_PORT SET7: SETP12 Position     */\r
+#define GPIO_PORT_SET7_SETP12_Msk                             (0x01UL << GPIO_PORT_SET7_SETP12_Pos)                     /*!< GPIO_PORT SET7: SETP12 Mask         */\r
+#define GPIO_PORT_SET7_SETP13_Pos                             13                                                        /*!< GPIO_PORT SET7: SETP13 Position     */\r
+#define GPIO_PORT_SET7_SETP13_Msk                             (0x01UL << GPIO_PORT_SET7_SETP13_Pos)                     /*!< GPIO_PORT SET7: SETP13 Mask         */\r
+#define GPIO_PORT_SET7_SETP14_Pos                             14                                                        /*!< GPIO_PORT SET7: SETP14 Position     */\r
+#define GPIO_PORT_SET7_SETP14_Msk                             (0x01UL << GPIO_PORT_SET7_SETP14_Pos)                     /*!< GPIO_PORT SET7: SETP14 Mask         */\r
+#define GPIO_PORT_SET7_SETP15_Pos                             15                                                        /*!< GPIO_PORT SET7: SETP15 Position     */\r
+#define GPIO_PORT_SET7_SETP15_Msk                             (0x01UL << GPIO_PORT_SET7_SETP15_Pos)                     /*!< GPIO_PORT SET7: SETP15 Mask         */\r
+#define GPIO_PORT_SET7_SETP16_Pos                             16                                                        /*!< GPIO_PORT SET7: SETP16 Position     */\r
+#define GPIO_PORT_SET7_SETP16_Msk                             (0x01UL << GPIO_PORT_SET7_SETP16_Pos)                     /*!< GPIO_PORT SET7: SETP16 Mask         */\r
+#define GPIO_PORT_SET7_SETP17_Pos                             17                                                        /*!< GPIO_PORT SET7: SETP17 Position     */\r
+#define GPIO_PORT_SET7_SETP17_Msk                             (0x01UL << GPIO_PORT_SET7_SETP17_Pos)                     /*!< GPIO_PORT SET7: SETP17 Mask         */\r
+#define GPIO_PORT_SET7_SETP18_Pos                             18                                                        /*!< GPIO_PORT SET7: SETP18 Position     */\r
+#define GPIO_PORT_SET7_SETP18_Msk                             (0x01UL << GPIO_PORT_SET7_SETP18_Pos)                     /*!< GPIO_PORT SET7: SETP18 Mask         */\r
+#define GPIO_PORT_SET7_SETP19_Pos                             19                                                        /*!< GPIO_PORT SET7: SETP19 Position     */\r
+#define GPIO_PORT_SET7_SETP19_Msk                             (0x01UL << GPIO_PORT_SET7_SETP19_Pos)                     /*!< GPIO_PORT SET7: SETP19 Mask         */\r
+#define GPIO_PORT_SET7_SETP20_Pos                             20                                                        /*!< GPIO_PORT SET7: SETP20 Position     */\r
+#define GPIO_PORT_SET7_SETP20_Msk                             (0x01UL << GPIO_PORT_SET7_SETP20_Pos)                     /*!< GPIO_PORT SET7: SETP20 Mask         */\r
+#define GPIO_PORT_SET7_SETP21_Pos                             21                                                        /*!< GPIO_PORT SET7: SETP21 Position     */\r
+#define GPIO_PORT_SET7_SETP21_Msk                             (0x01UL << GPIO_PORT_SET7_SETP21_Pos)                     /*!< GPIO_PORT SET7: SETP21 Mask         */\r
+#define GPIO_PORT_SET7_SETP22_Pos                             22                                                        /*!< GPIO_PORT SET7: SETP22 Position     */\r
+#define GPIO_PORT_SET7_SETP22_Msk                             (0x01UL << GPIO_PORT_SET7_SETP22_Pos)                     /*!< GPIO_PORT SET7: SETP22 Mask         */\r
+#define GPIO_PORT_SET7_SETP23_Pos                             23                                                        /*!< GPIO_PORT SET7: SETP23 Position     */\r
+#define GPIO_PORT_SET7_SETP23_Msk                             (0x01UL << GPIO_PORT_SET7_SETP23_Pos)                     /*!< GPIO_PORT SET7: SETP23 Mask         */\r
+#define GPIO_PORT_SET7_SETP24_Pos                             24                                                        /*!< GPIO_PORT SET7: SETP24 Position     */\r
+#define GPIO_PORT_SET7_SETP24_Msk                             (0x01UL << GPIO_PORT_SET7_SETP24_Pos)                     /*!< GPIO_PORT SET7: SETP24 Mask         */\r
+#define GPIO_PORT_SET7_SETP25_Pos                             25                                                        /*!< GPIO_PORT SET7: SETP25 Position     */\r
+#define GPIO_PORT_SET7_SETP25_Msk                             (0x01UL << GPIO_PORT_SET7_SETP25_Pos)                     /*!< GPIO_PORT SET7: SETP25 Mask         */\r
+#define GPIO_PORT_SET7_SETP26_Pos                             26                                                        /*!< GPIO_PORT SET7: SETP26 Position     */\r
+#define GPIO_PORT_SET7_SETP26_Msk                             (0x01UL << GPIO_PORT_SET7_SETP26_Pos)                     /*!< GPIO_PORT SET7: SETP26 Mask         */\r
+#define GPIO_PORT_SET7_SETP27_Pos                             27                                                        /*!< GPIO_PORT SET7: SETP27 Position     */\r
+#define GPIO_PORT_SET7_SETP27_Msk                             (0x01UL << GPIO_PORT_SET7_SETP27_Pos)                     /*!< GPIO_PORT SET7: SETP27 Mask         */\r
+#define GPIO_PORT_SET7_SETP28_Pos                             28                                                        /*!< GPIO_PORT SET7: SETP28 Position     */\r
+#define GPIO_PORT_SET7_SETP28_Msk                             (0x01UL << GPIO_PORT_SET7_SETP28_Pos)                     /*!< GPIO_PORT SET7: SETP28 Mask         */\r
+#define GPIO_PORT_SET7_SETP29_Pos                             29                                                        /*!< GPIO_PORT SET7: SETP29 Position     */\r
+#define GPIO_PORT_SET7_SETP29_Msk                             (0x01UL << GPIO_PORT_SET7_SETP29_Pos)                     /*!< GPIO_PORT SET7: SETP29 Mask         */\r
+#define GPIO_PORT_SET7_SETP30_Pos                             30                                                        /*!< GPIO_PORT SET7: SETP30 Position     */\r
+#define GPIO_PORT_SET7_SETP30_Msk                             (0x01UL << GPIO_PORT_SET7_SETP30_Pos)                     /*!< GPIO_PORT SET7: SETP30 Mask         */\r
+#define GPIO_PORT_SET7_SETP31_Pos                             31                                                        /*!< GPIO_PORT SET7: SETP31 Position     */\r
+#define GPIO_PORT_SET7_SETP31_Msk                             (0x01UL << GPIO_PORT_SET7_SETP31_Pos)                     /*!< GPIO_PORT SET7: SETP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR0  -----------------------------------------\r
+#define GPIO_PORT_CLR0_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR0: CLRP00 Position     */\r
+#define GPIO_PORT_CLR0_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP00_Pos)                     /*!< GPIO_PORT CLR0: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR0: CLRP01 Position     */\r
+#define GPIO_PORT_CLR0_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP01_Pos)                     /*!< GPIO_PORT CLR0: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR0: CLRP02 Position     */\r
+#define GPIO_PORT_CLR0_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP02_Pos)                     /*!< GPIO_PORT CLR0: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR0: CLRP03 Position     */\r
+#define GPIO_PORT_CLR0_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP03_Pos)                     /*!< GPIO_PORT CLR0: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR0: CLRP04 Position     */\r
+#define GPIO_PORT_CLR0_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP04_Pos)                     /*!< GPIO_PORT CLR0: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR0: CLRP05 Position     */\r
+#define GPIO_PORT_CLR0_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP05_Pos)                     /*!< GPIO_PORT CLR0: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR0: CLRP06 Position     */\r
+#define GPIO_PORT_CLR0_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP06_Pos)                     /*!< GPIO_PORT CLR0: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR0: CLRP07 Position     */\r
+#define GPIO_PORT_CLR0_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP07_Pos)                     /*!< GPIO_PORT CLR0: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR0: CLRP08 Position     */\r
+#define GPIO_PORT_CLR0_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP08_Pos)                     /*!< GPIO_PORT CLR0: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR0: CLRP09 Position     */\r
+#define GPIO_PORT_CLR0_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR0_CLRP09_Pos)                     /*!< GPIO_PORT CLR0: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR0_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR0: CLRP010 Position    */\r
+#define GPIO_PORT_CLR0_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP010_Pos)                    /*!< GPIO_PORT CLR0: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR0: CLRP011 Position    */\r
+#define GPIO_PORT_CLR0_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP011_Pos)                    /*!< GPIO_PORT CLR0: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR0: CLRP012 Position    */\r
+#define GPIO_PORT_CLR0_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP012_Pos)                    /*!< GPIO_PORT CLR0: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR0: CLRP013 Position    */\r
+#define GPIO_PORT_CLR0_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP013_Pos)                    /*!< GPIO_PORT CLR0: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR0: CLRP014 Position    */\r
+#define GPIO_PORT_CLR0_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP014_Pos)                    /*!< GPIO_PORT CLR0: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR0: CLRP015 Position    */\r
+#define GPIO_PORT_CLR0_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP015_Pos)                    /*!< GPIO_PORT CLR0: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR0: CLRP016 Position    */\r
+#define GPIO_PORT_CLR0_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP016_Pos)                    /*!< GPIO_PORT CLR0: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR0: CLRP017 Position    */\r
+#define GPIO_PORT_CLR0_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP017_Pos)                    /*!< GPIO_PORT CLR0: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR0: CLRP018 Position    */\r
+#define GPIO_PORT_CLR0_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP018_Pos)                    /*!< GPIO_PORT CLR0: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR0: CLRP019 Position    */\r
+#define GPIO_PORT_CLR0_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP019_Pos)                    /*!< GPIO_PORT CLR0: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR0: CLRP020 Position    */\r
+#define GPIO_PORT_CLR0_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP020_Pos)                    /*!< GPIO_PORT CLR0: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR0: CLRP021 Position    */\r
+#define GPIO_PORT_CLR0_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP021_Pos)                    /*!< GPIO_PORT CLR0: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR0: CLRP022 Position    */\r
+#define GPIO_PORT_CLR0_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP022_Pos)                    /*!< GPIO_PORT CLR0: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR0: CLRP023 Position    */\r
+#define GPIO_PORT_CLR0_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP023_Pos)                    /*!< GPIO_PORT CLR0: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR0: CLRP024 Position    */\r
+#define GPIO_PORT_CLR0_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP024_Pos)                    /*!< GPIO_PORT CLR0: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR0: CLRP025 Position    */\r
+#define GPIO_PORT_CLR0_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP025_Pos)                    /*!< GPIO_PORT CLR0: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR0: CLRP026 Position    */\r
+#define GPIO_PORT_CLR0_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP026_Pos)                    /*!< GPIO_PORT CLR0: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR0: CLRP027 Position    */\r
+#define GPIO_PORT_CLR0_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP027_Pos)                    /*!< GPIO_PORT CLR0: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR0: CLRP028 Position    */\r
+#define GPIO_PORT_CLR0_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP028_Pos)                    /*!< GPIO_PORT CLR0: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR0: CLRP029 Position    */\r
+#define GPIO_PORT_CLR0_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP029_Pos)                    /*!< GPIO_PORT CLR0: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR0: CLRP030 Position    */\r
+#define GPIO_PORT_CLR0_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP030_Pos)                    /*!< GPIO_PORT CLR0: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR0_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR0: CLRP031 Position    */\r
+#define GPIO_PORT_CLR0_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR0_CLRP031_Pos)                    /*!< GPIO_PORT CLR0: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR1  -----------------------------------------\r
+#define GPIO_PORT_CLR1_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR1: CLRP00 Position     */\r
+#define GPIO_PORT_CLR1_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP00_Pos)                     /*!< GPIO_PORT CLR1: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR1: CLRP01 Position     */\r
+#define GPIO_PORT_CLR1_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP01_Pos)                     /*!< GPIO_PORT CLR1: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR1: CLRP02 Position     */\r
+#define GPIO_PORT_CLR1_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP02_Pos)                     /*!< GPIO_PORT CLR1: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR1: CLRP03 Position     */\r
+#define GPIO_PORT_CLR1_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP03_Pos)                     /*!< GPIO_PORT CLR1: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR1: CLRP04 Position     */\r
+#define GPIO_PORT_CLR1_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP04_Pos)                     /*!< GPIO_PORT CLR1: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR1: CLRP05 Position     */\r
+#define GPIO_PORT_CLR1_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP05_Pos)                     /*!< GPIO_PORT CLR1: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR1: CLRP06 Position     */\r
+#define GPIO_PORT_CLR1_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP06_Pos)                     /*!< GPIO_PORT CLR1: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR1: CLRP07 Position     */\r
+#define GPIO_PORT_CLR1_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP07_Pos)                     /*!< GPIO_PORT CLR1: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR1: CLRP08 Position     */\r
+#define GPIO_PORT_CLR1_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP08_Pos)                     /*!< GPIO_PORT CLR1: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR1: CLRP09 Position     */\r
+#define GPIO_PORT_CLR1_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR1_CLRP09_Pos)                     /*!< GPIO_PORT CLR1: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR1_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR1: CLRP010 Position    */\r
+#define GPIO_PORT_CLR1_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP010_Pos)                    /*!< GPIO_PORT CLR1: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR1: CLRP011 Position    */\r
+#define GPIO_PORT_CLR1_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP011_Pos)                    /*!< GPIO_PORT CLR1: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR1: CLRP012 Position    */\r
+#define GPIO_PORT_CLR1_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP012_Pos)                    /*!< GPIO_PORT CLR1: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR1: CLRP013 Position    */\r
+#define GPIO_PORT_CLR1_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP013_Pos)                    /*!< GPIO_PORT CLR1: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR1: CLRP014 Position    */\r
+#define GPIO_PORT_CLR1_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP014_Pos)                    /*!< GPIO_PORT CLR1: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR1: CLRP015 Position    */\r
+#define GPIO_PORT_CLR1_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP015_Pos)                    /*!< GPIO_PORT CLR1: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR1: CLRP016 Position    */\r
+#define GPIO_PORT_CLR1_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP016_Pos)                    /*!< GPIO_PORT CLR1: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR1: CLRP017 Position    */\r
+#define GPIO_PORT_CLR1_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP017_Pos)                    /*!< GPIO_PORT CLR1: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR1: CLRP018 Position    */\r
+#define GPIO_PORT_CLR1_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP018_Pos)                    /*!< GPIO_PORT CLR1: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR1: CLRP019 Position    */\r
+#define GPIO_PORT_CLR1_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP019_Pos)                    /*!< GPIO_PORT CLR1: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR1: CLRP020 Position    */\r
+#define GPIO_PORT_CLR1_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP020_Pos)                    /*!< GPIO_PORT CLR1: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR1: CLRP021 Position    */\r
+#define GPIO_PORT_CLR1_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP021_Pos)                    /*!< GPIO_PORT CLR1: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR1: CLRP022 Position    */\r
+#define GPIO_PORT_CLR1_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP022_Pos)                    /*!< GPIO_PORT CLR1: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR1: CLRP023 Position    */\r
+#define GPIO_PORT_CLR1_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP023_Pos)                    /*!< GPIO_PORT CLR1: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR1: CLRP024 Position    */\r
+#define GPIO_PORT_CLR1_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP024_Pos)                    /*!< GPIO_PORT CLR1: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR1: CLRP025 Position    */\r
+#define GPIO_PORT_CLR1_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP025_Pos)                    /*!< GPIO_PORT CLR1: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR1: CLRP026 Position    */\r
+#define GPIO_PORT_CLR1_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP026_Pos)                    /*!< GPIO_PORT CLR1: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR1: CLRP027 Position    */\r
+#define GPIO_PORT_CLR1_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP027_Pos)                    /*!< GPIO_PORT CLR1: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR1: CLRP028 Position    */\r
+#define GPIO_PORT_CLR1_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP028_Pos)                    /*!< GPIO_PORT CLR1: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR1: CLRP029 Position    */\r
+#define GPIO_PORT_CLR1_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP029_Pos)                    /*!< GPIO_PORT CLR1: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR1: CLRP030 Position    */\r
+#define GPIO_PORT_CLR1_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP030_Pos)                    /*!< GPIO_PORT CLR1: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR1_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR1: CLRP031 Position    */\r
+#define GPIO_PORT_CLR1_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR1_CLRP031_Pos)                    /*!< GPIO_PORT CLR1: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR2  -----------------------------------------\r
+#define GPIO_PORT_CLR2_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR2: CLRP00 Position     */\r
+#define GPIO_PORT_CLR2_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP00_Pos)                     /*!< GPIO_PORT CLR2: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR2: CLRP01 Position     */\r
+#define GPIO_PORT_CLR2_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP01_Pos)                     /*!< GPIO_PORT CLR2: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR2: CLRP02 Position     */\r
+#define GPIO_PORT_CLR2_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP02_Pos)                     /*!< GPIO_PORT CLR2: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR2: CLRP03 Position     */\r
+#define GPIO_PORT_CLR2_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP03_Pos)                     /*!< GPIO_PORT CLR2: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR2: CLRP04 Position     */\r
+#define GPIO_PORT_CLR2_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP04_Pos)                     /*!< GPIO_PORT CLR2: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR2: CLRP05 Position     */\r
+#define GPIO_PORT_CLR2_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP05_Pos)                     /*!< GPIO_PORT CLR2: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR2: CLRP06 Position     */\r
+#define GPIO_PORT_CLR2_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP06_Pos)                     /*!< GPIO_PORT CLR2: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR2: CLRP07 Position     */\r
+#define GPIO_PORT_CLR2_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP07_Pos)                     /*!< GPIO_PORT CLR2: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR2: CLRP08 Position     */\r
+#define GPIO_PORT_CLR2_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP08_Pos)                     /*!< GPIO_PORT CLR2: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR2: CLRP09 Position     */\r
+#define GPIO_PORT_CLR2_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR2_CLRP09_Pos)                     /*!< GPIO_PORT CLR2: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR2_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR2: CLRP010 Position    */\r
+#define GPIO_PORT_CLR2_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP010_Pos)                    /*!< GPIO_PORT CLR2: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR2: CLRP011 Position    */\r
+#define GPIO_PORT_CLR2_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP011_Pos)                    /*!< GPIO_PORT CLR2: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR2: CLRP012 Position    */\r
+#define GPIO_PORT_CLR2_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP012_Pos)                    /*!< GPIO_PORT CLR2: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR2: CLRP013 Position    */\r
+#define GPIO_PORT_CLR2_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP013_Pos)                    /*!< GPIO_PORT CLR2: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR2: CLRP014 Position    */\r
+#define GPIO_PORT_CLR2_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP014_Pos)                    /*!< GPIO_PORT CLR2: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR2: CLRP015 Position    */\r
+#define GPIO_PORT_CLR2_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP015_Pos)                    /*!< GPIO_PORT CLR2: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR2: CLRP016 Position    */\r
+#define GPIO_PORT_CLR2_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP016_Pos)                    /*!< GPIO_PORT CLR2: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR2: CLRP017 Position    */\r
+#define GPIO_PORT_CLR2_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP017_Pos)                    /*!< GPIO_PORT CLR2: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR2: CLRP018 Position    */\r
+#define GPIO_PORT_CLR2_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP018_Pos)                    /*!< GPIO_PORT CLR2: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR2: CLRP019 Position    */\r
+#define GPIO_PORT_CLR2_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP019_Pos)                    /*!< GPIO_PORT CLR2: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR2: CLRP020 Position    */\r
+#define GPIO_PORT_CLR2_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP020_Pos)                    /*!< GPIO_PORT CLR2: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR2: CLRP021 Position    */\r
+#define GPIO_PORT_CLR2_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP021_Pos)                    /*!< GPIO_PORT CLR2: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR2: CLRP022 Position    */\r
+#define GPIO_PORT_CLR2_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP022_Pos)                    /*!< GPIO_PORT CLR2: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR2: CLRP023 Position    */\r
+#define GPIO_PORT_CLR2_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP023_Pos)                    /*!< GPIO_PORT CLR2: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR2: CLRP024 Position    */\r
+#define GPIO_PORT_CLR2_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP024_Pos)                    /*!< GPIO_PORT CLR2: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR2: CLRP025 Position    */\r
+#define GPIO_PORT_CLR2_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP025_Pos)                    /*!< GPIO_PORT CLR2: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR2: CLRP026 Position    */\r
+#define GPIO_PORT_CLR2_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP026_Pos)                    /*!< GPIO_PORT CLR2: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR2: CLRP027 Position    */\r
+#define GPIO_PORT_CLR2_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP027_Pos)                    /*!< GPIO_PORT CLR2: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR2: CLRP028 Position    */\r
+#define GPIO_PORT_CLR2_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP028_Pos)                    /*!< GPIO_PORT CLR2: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR2: CLRP029 Position    */\r
+#define GPIO_PORT_CLR2_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP029_Pos)                    /*!< GPIO_PORT CLR2: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR2: CLRP030 Position    */\r
+#define GPIO_PORT_CLR2_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP030_Pos)                    /*!< GPIO_PORT CLR2: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR2_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR2: CLRP031 Position    */\r
+#define GPIO_PORT_CLR2_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR2_CLRP031_Pos)                    /*!< GPIO_PORT CLR2: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR3  -----------------------------------------\r
+#define GPIO_PORT_CLR3_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR3: CLRP00 Position     */\r
+#define GPIO_PORT_CLR3_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP00_Pos)                     /*!< GPIO_PORT CLR3: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR3: CLRP01 Position     */\r
+#define GPIO_PORT_CLR3_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP01_Pos)                     /*!< GPIO_PORT CLR3: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR3: CLRP02 Position     */\r
+#define GPIO_PORT_CLR3_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP02_Pos)                     /*!< GPIO_PORT CLR3: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR3: CLRP03 Position     */\r
+#define GPIO_PORT_CLR3_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP03_Pos)                     /*!< GPIO_PORT CLR3: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR3: CLRP04 Position     */\r
+#define GPIO_PORT_CLR3_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP04_Pos)                     /*!< GPIO_PORT CLR3: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR3: CLRP05 Position     */\r
+#define GPIO_PORT_CLR3_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP05_Pos)                     /*!< GPIO_PORT CLR3: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR3: CLRP06 Position     */\r
+#define GPIO_PORT_CLR3_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP06_Pos)                     /*!< GPIO_PORT CLR3: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR3: CLRP07 Position     */\r
+#define GPIO_PORT_CLR3_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP07_Pos)                     /*!< GPIO_PORT CLR3: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR3: CLRP08 Position     */\r
+#define GPIO_PORT_CLR3_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP08_Pos)                     /*!< GPIO_PORT CLR3: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR3: CLRP09 Position     */\r
+#define GPIO_PORT_CLR3_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR3_CLRP09_Pos)                     /*!< GPIO_PORT CLR3: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR3_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR3: CLRP010 Position    */\r
+#define GPIO_PORT_CLR3_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP010_Pos)                    /*!< GPIO_PORT CLR3: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR3: CLRP011 Position    */\r
+#define GPIO_PORT_CLR3_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP011_Pos)                    /*!< GPIO_PORT CLR3: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR3: CLRP012 Position    */\r
+#define GPIO_PORT_CLR3_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP012_Pos)                    /*!< GPIO_PORT CLR3: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR3: CLRP013 Position    */\r
+#define GPIO_PORT_CLR3_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP013_Pos)                    /*!< GPIO_PORT CLR3: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR3: CLRP014 Position    */\r
+#define GPIO_PORT_CLR3_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP014_Pos)                    /*!< GPIO_PORT CLR3: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR3: CLRP015 Position    */\r
+#define GPIO_PORT_CLR3_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP015_Pos)                    /*!< GPIO_PORT CLR3: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR3: CLRP016 Position    */\r
+#define GPIO_PORT_CLR3_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP016_Pos)                    /*!< GPIO_PORT CLR3: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR3: CLRP017 Position    */\r
+#define GPIO_PORT_CLR3_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP017_Pos)                    /*!< GPIO_PORT CLR3: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR3: CLRP018 Position    */\r
+#define GPIO_PORT_CLR3_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP018_Pos)                    /*!< GPIO_PORT CLR3: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR3: CLRP019 Position    */\r
+#define GPIO_PORT_CLR3_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP019_Pos)                    /*!< GPIO_PORT CLR3: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR3: CLRP020 Position    */\r
+#define GPIO_PORT_CLR3_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP020_Pos)                    /*!< GPIO_PORT CLR3: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR3: CLRP021 Position    */\r
+#define GPIO_PORT_CLR3_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP021_Pos)                    /*!< GPIO_PORT CLR3: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR3: CLRP022 Position    */\r
+#define GPIO_PORT_CLR3_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP022_Pos)                    /*!< GPIO_PORT CLR3: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR3: CLRP023 Position    */\r
+#define GPIO_PORT_CLR3_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP023_Pos)                    /*!< GPIO_PORT CLR3: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR3: CLRP024 Position    */\r
+#define GPIO_PORT_CLR3_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP024_Pos)                    /*!< GPIO_PORT CLR3: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR3: CLRP025 Position    */\r
+#define GPIO_PORT_CLR3_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP025_Pos)                    /*!< GPIO_PORT CLR3: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR3: CLRP026 Position    */\r
+#define GPIO_PORT_CLR3_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP026_Pos)                    /*!< GPIO_PORT CLR3: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR3: CLRP027 Position    */\r
+#define GPIO_PORT_CLR3_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP027_Pos)                    /*!< GPIO_PORT CLR3: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR3: CLRP028 Position    */\r
+#define GPIO_PORT_CLR3_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP028_Pos)                    /*!< GPIO_PORT CLR3: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR3: CLRP029 Position    */\r
+#define GPIO_PORT_CLR3_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP029_Pos)                    /*!< GPIO_PORT CLR3: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR3: CLRP030 Position    */\r
+#define GPIO_PORT_CLR3_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP030_Pos)                    /*!< GPIO_PORT CLR3: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR3_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR3: CLRP031 Position    */\r
+#define GPIO_PORT_CLR3_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR3_CLRP031_Pos)                    /*!< GPIO_PORT CLR3: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR4  -----------------------------------------\r
+#define GPIO_PORT_CLR4_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR4: CLRP00 Position     */\r
+#define GPIO_PORT_CLR4_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP00_Pos)                     /*!< GPIO_PORT CLR4: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR4: CLRP01 Position     */\r
+#define GPIO_PORT_CLR4_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP01_Pos)                     /*!< GPIO_PORT CLR4: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR4: CLRP02 Position     */\r
+#define GPIO_PORT_CLR4_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP02_Pos)                     /*!< GPIO_PORT CLR4: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR4: CLRP03 Position     */\r
+#define GPIO_PORT_CLR4_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP03_Pos)                     /*!< GPIO_PORT CLR4: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR4: CLRP04 Position     */\r
+#define GPIO_PORT_CLR4_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP04_Pos)                     /*!< GPIO_PORT CLR4: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR4: CLRP05 Position     */\r
+#define GPIO_PORT_CLR4_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP05_Pos)                     /*!< GPIO_PORT CLR4: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR4: CLRP06 Position     */\r
+#define GPIO_PORT_CLR4_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP06_Pos)                     /*!< GPIO_PORT CLR4: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR4: CLRP07 Position     */\r
+#define GPIO_PORT_CLR4_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP07_Pos)                     /*!< GPIO_PORT CLR4: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR4: CLRP08 Position     */\r
+#define GPIO_PORT_CLR4_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP08_Pos)                     /*!< GPIO_PORT CLR4: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR4: CLRP09 Position     */\r
+#define GPIO_PORT_CLR4_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR4_CLRP09_Pos)                     /*!< GPIO_PORT CLR4: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR4_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR4: CLRP010 Position    */\r
+#define GPIO_PORT_CLR4_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP010_Pos)                    /*!< GPIO_PORT CLR4: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR4: CLRP011 Position    */\r
+#define GPIO_PORT_CLR4_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP011_Pos)                    /*!< GPIO_PORT CLR4: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR4: CLRP012 Position    */\r
+#define GPIO_PORT_CLR4_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP012_Pos)                    /*!< GPIO_PORT CLR4: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR4: CLRP013 Position    */\r
+#define GPIO_PORT_CLR4_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP013_Pos)                    /*!< GPIO_PORT CLR4: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR4: CLRP014 Position    */\r
+#define GPIO_PORT_CLR4_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP014_Pos)                    /*!< GPIO_PORT CLR4: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR4: CLRP015 Position    */\r
+#define GPIO_PORT_CLR4_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP015_Pos)                    /*!< GPIO_PORT CLR4: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR4: CLRP016 Position    */\r
+#define GPIO_PORT_CLR4_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP016_Pos)                    /*!< GPIO_PORT CLR4: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR4: CLRP017 Position    */\r
+#define GPIO_PORT_CLR4_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP017_Pos)                    /*!< GPIO_PORT CLR4: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR4: CLRP018 Position    */\r
+#define GPIO_PORT_CLR4_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP018_Pos)                    /*!< GPIO_PORT CLR4: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR4: CLRP019 Position    */\r
+#define GPIO_PORT_CLR4_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP019_Pos)                    /*!< GPIO_PORT CLR4: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR4: CLRP020 Position    */\r
+#define GPIO_PORT_CLR4_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP020_Pos)                    /*!< GPIO_PORT CLR4: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR4: CLRP021 Position    */\r
+#define GPIO_PORT_CLR4_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP021_Pos)                    /*!< GPIO_PORT CLR4: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR4: CLRP022 Position    */\r
+#define GPIO_PORT_CLR4_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP022_Pos)                    /*!< GPIO_PORT CLR4: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR4: CLRP023 Position    */\r
+#define GPIO_PORT_CLR4_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP023_Pos)                    /*!< GPIO_PORT CLR4: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR4: CLRP024 Position    */\r
+#define GPIO_PORT_CLR4_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP024_Pos)                    /*!< GPIO_PORT CLR4: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR4: CLRP025 Position    */\r
+#define GPIO_PORT_CLR4_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP025_Pos)                    /*!< GPIO_PORT CLR4: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR4: CLRP026 Position    */\r
+#define GPIO_PORT_CLR4_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP026_Pos)                    /*!< GPIO_PORT CLR4: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR4: CLRP027 Position    */\r
+#define GPIO_PORT_CLR4_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP027_Pos)                    /*!< GPIO_PORT CLR4: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR4: CLRP028 Position    */\r
+#define GPIO_PORT_CLR4_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP028_Pos)                    /*!< GPIO_PORT CLR4: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR4: CLRP029 Position    */\r
+#define GPIO_PORT_CLR4_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP029_Pos)                    /*!< GPIO_PORT CLR4: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR4: CLRP030 Position    */\r
+#define GPIO_PORT_CLR4_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP030_Pos)                    /*!< GPIO_PORT CLR4: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR4_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR4: CLRP031 Position    */\r
+#define GPIO_PORT_CLR4_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR4_CLRP031_Pos)                    /*!< GPIO_PORT CLR4: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR5  -----------------------------------------\r
+#define GPIO_PORT_CLR5_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR5: CLRP00 Position     */\r
+#define GPIO_PORT_CLR5_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP00_Pos)                     /*!< GPIO_PORT CLR5: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR5: CLRP01 Position     */\r
+#define GPIO_PORT_CLR5_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP01_Pos)                     /*!< GPIO_PORT CLR5: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR5: CLRP02 Position     */\r
+#define GPIO_PORT_CLR5_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP02_Pos)                     /*!< GPIO_PORT CLR5: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR5: CLRP03 Position     */\r
+#define GPIO_PORT_CLR5_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP03_Pos)                     /*!< GPIO_PORT CLR5: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR5: CLRP04 Position     */\r
+#define GPIO_PORT_CLR5_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP04_Pos)                     /*!< GPIO_PORT CLR5: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR5: CLRP05 Position     */\r
+#define GPIO_PORT_CLR5_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP05_Pos)                     /*!< GPIO_PORT CLR5: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR5: CLRP06 Position     */\r
+#define GPIO_PORT_CLR5_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP06_Pos)                     /*!< GPIO_PORT CLR5: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR5: CLRP07 Position     */\r
+#define GPIO_PORT_CLR5_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP07_Pos)                     /*!< GPIO_PORT CLR5: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR5: CLRP08 Position     */\r
+#define GPIO_PORT_CLR5_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP08_Pos)                     /*!< GPIO_PORT CLR5: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR5: CLRP09 Position     */\r
+#define GPIO_PORT_CLR5_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR5_CLRP09_Pos)                     /*!< GPIO_PORT CLR5: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR5_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR5: CLRP010 Position    */\r
+#define GPIO_PORT_CLR5_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP010_Pos)                    /*!< GPIO_PORT CLR5: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR5: CLRP011 Position    */\r
+#define GPIO_PORT_CLR5_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP011_Pos)                    /*!< GPIO_PORT CLR5: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR5: CLRP012 Position    */\r
+#define GPIO_PORT_CLR5_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP012_Pos)                    /*!< GPIO_PORT CLR5: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR5: CLRP013 Position    */\r
+#define GPIO_PORT_CLR5_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP013_Pos)                    /*!< GPIO_PORT CLR5: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR5: CLRP014 Position    */\r
+#define GPIO_PORT_CLR5_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP014_Pos)                    /*!< GPIO_PORT CLR5: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR5: CLRP015 Position    */\r
+#define GPIO_PORT_CLR5_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP015_Pos)                    /*!< GPIO_PORT CLR5: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR5: CLRP016 Position    */\r
+#define GPIO_PORT_CLR5_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP016_Pos)                    /*!< GPIO_PORT CLR5: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR5: CLRP017 Position    */\r
+#define GPIO_PORT_CLR5_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP017_Pos)                    /*!< GPIO_PORT CLR5: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR5: CLRP018 Position    */\r
+#define GPIO_PORT_CLR5_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP018_Pos)                    /*!< GPIO_PORT CLR5: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR5: CLRP019 Position    */\r
+#define GPIO_PORT_CLR5_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP019_Pos)                    /*!< GPIO_PORT CLR5: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR5: CLRP020 Position    */\r
+#define GPIO_PORT_CLR5_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP020_Pos)                    /*!< GPIO_PORT CLR5: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR5: CLRP021 Position    */\r
+#define GPIO_PORT_CLR5_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP021_Pos)                    /*!< GPIO_PORT CLR5: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR5: CLRP022 Position    */\r
+#define GPIO_PORT_CLR5_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP022_Pos)                    /*!< GPIO_PORT CLR5: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR5: CLRP023 Position    */\r
+#define GPIO_PORT_CLR5_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP023_Pos)                    /*!< GPIO_PORT CLR5: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR5: CLRP024 Position    */\r
+#define GPIO_PORT_CLR5_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP024_Pos)                    /*!< GPIO_PORT CLR5: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR5: CLRP025 Position    */\r
+#define GPIO_PORT_CLR5_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP025_Pos)                    /*!< GPIO_PORT CLR5: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR5: CLRP026 Position    */\r
+#define GPIO_PORT_CLR5_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP026_Pos)                    /*!< GPIO_PORT CLR5: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR5: CLRP027 Position    */\r
+#define GPIO_PORT_CLR5_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP027_Pos)                    /*!< GPIO_PORT CLR5: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR5: CLRP028 Position    */\r
+#define GPIO_PORT_CLR5_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP028_Pos)                    /*!< GPIO_PORT CLR5: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR5: CLRP029 Position    */\r
+#define GPIO_PORT_CLR5_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP029_Pos)                    /*!< GPIO_PORT CLR5: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR5: CLRP030 Position    */\r
+#define GPIO_PORT_CLR5_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP030_Pos)                    /*!< GPIO_PORT CLR5: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR5_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR5: CLRP031 Position    */\r
+#define GPIO_PORT_CLR5_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR5_CLRP031_Pos)                    /*!< GPIO_PORT CLR5: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR6  -----------------------------------------\r
+#define GPIO_PORT_CLR6_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR6: CLRP00 Position     */\r
+#define GPIO_PORT_CLR6_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP00_Pos)                     /*!< GPIO_PORT CLR6: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR6: CLRP01 Position     */\r
+#define GPIO_PORT_CLR6_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP01_Pos)                     /*!< GPIO_PORT CLR6: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR6: CLRP02 Position     */\r
+#define GPIO_PORT_CLR6_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP02_Pos)                     /*!< GPIO_PORT CLR6: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR6: CLRP03 Position     */\r
+#define GPIO_PORT_CLR6_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP03_Pos)                     /*!< GPIO_PORT CLR6: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR6: CLRP04 Position     */\r
+#define GPIO_PORT_CLR6_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP04_Pos)                     /*!< GPIO_PORT CLR6: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR6: CLRP05 Position     */\r
+#define GPIO_PORT_CLR6_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP05_Pos)                     /*!< GPIO_PORT CLR6: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR6: CLRP06 Position     */\r
+#define GPIO_PORT_CLR6_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP06_Pos)                     /*!< GPIO_PORT CLR6: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR6: CLRP07 Position     */\r
+#define GPIO_PORT_CLR6_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP07_Pos)                     /*!< GPIO_PORT CLR6: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR6: CLRP08 Position     */\r
+#define GPIO_PORT_CLR6_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP08_Pos)                     /*!< GPIO_PORT CLR6: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR6: CLRP09 Position     */\r
+#define GPIO_PORT_CLR6_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR6_CLRP09_Pos)                     /*!< GPIO_PORT CLR6: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR6_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR6: CLRP010 Position    */\r
+#define GPIO_PORT_CLR6_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP010_Pos)                    /*!< GPIO_PORT CLR6: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR6: CLRP011 Position    */\r
+#define GPIO_PORT_CLR6_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP011_Pos)                    /*!< GPIO_PORT CLR6: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR6: CLRP012 Position    */\r
+#define GPIO_PORT_CLR6_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP012_Pos)                    /*!< GPIO_PORT CLR6: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR6: CLRP013 Position    */\r
+#define GPIO_PORT_CLR6_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP013_Pos)                    /*!< GPIO_PORT CLR6: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR6: CLRP014 Position    */\r
+#define GPIO_PORT_CLR6_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP014_Pos)                    /*!< GPIO_PORT CLR6: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR6: CLRP015 Position    */\r
+#define GPIO_PORT_CLR6_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP015_Pos)                    /*!< GPIO_PORT CLR6: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR6: CLRP016 Position    */\r
+#define GPIO_PORT_CLR6_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP016_Pos)                    /*!< GPIO_PORT CLR6: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR6: CLRP017 Position    */\r
+#define GPIO_PORT_CLR6_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP017_Pos)                    /*!< GPIO_PORT CLR6: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR6: CLRP018 Position    */\r
+#define GPIO_PORT_CLR6_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP018_Pos)                    /*!< GPIO_PORT CLR6: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR6: CLRP019 Position    */\r
+#define GPIO_PORT_CLR6_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP019_Pos)                    /*!< GPIO_PORT CLR6: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR6: CLRP020 Position    */\r
+#define GPIO_PORT_CLR6_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP020_Pos)                    /*!< GPIO_PORT CLR6: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR6: CLRP021 Position    */\r
+#define GPIO_PORT_CLR6_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP021_Pos)                    /*!< GPIO_PORT CLR6: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR6: CLRP022 Position    */\r
+#define GPIO_PORT_CLR6_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP022_Pos)                    /*!< GPIO_PORT CLR6: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR6: CLRP023 Position    */\r
+#define GPIO_PORT_CLR6_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP023_Pos)                    /*!< GPIO_PORT CLR6: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR6: CLRP024 Position    */\r
+#define GPIO_PORT_CLR6_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP024_Pos)                    /*!< GPIO_PORT CLR6: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR6: CLRP025 Position    */\r
+#define GPIO_PORT_CLR6_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP025_Pos)                    /*!< GPIO_PORT CLR6: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR6: CLRP026 Position    */\r
+#define GPIO_PORT_CLR6_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP026_Pos)                    /*!< GPIO_PORT CLR6: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR6: CLRP027 Position    */\r
+#define GPIO_PORT_CLR6_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP027_Pos)                    /*!< GPIO_PORT CLR6: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR6: CLRP028 Position    */\r
+#define GPIO_PORT_CLR6_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP028_Pos)                    /*!< GPIO_PORT CLR6: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR6: CLRP029 Position    */\r
+#define GPIO_PORT_CLR6_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP029_Pos)                    /*!< GPIO_PORT CLR6: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR6: CLRP030 Position    */\r
+#define GPIO_PORT_CLR6_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP030_Pos)                    /*!< GPIO_PORT CLR6: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR6_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR6: CLRP031 Position    */\r
+#define GPIO_PORT_CLR6_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR6_CLRP031_Pos)                    /*!< GPIO_PORT CLR6: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_CLR7  -----------------------------------------\r
+#define GPIO_PORT_CLR7_CLRP00_Pos                             0                                                         /*!< GPIO_PORT CLR7: CLRP00 Position     */\r
+#define GPIO_PORT_CLR7_CLRP00_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP00_Pos)                     /*!< GPIO_PORT CLR7: CLRP00 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP01_Pos                             1                                                         /*!< GPIO_PORT CLR7: CLRP01 Position     */\r
+#define GPIO_PORT_CLR7_CLRP01_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP01_Pos)                     /*!< GPIO_PORT CLR7: CLRP01 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP02_Pos                             2                                                         /*!< GPIO_PORT CLR7: CLRP02 Position     */\r
+#define GPIO_PORT_CLR7_CLRP02_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP02_Pos)                     /*!< GPIO_PORT CLR7: CLRP02 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP03_Pos                             3                                                         /*!< GPIO_PORT CLR7: CLRP03 Position     */\r
+#define GPIO_PORT_CLR7_CLRP03_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP03_Pos)                     /*!< GPIO_PORT CLR7: CLRP03 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP04_Pos                             4                                                         /*!< GPIO_PORT CLR7: CLRP04 Position     */\r
+#define GPIO_PORT_CLR7_CLRP04_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP04_Pos)                     /*!< GPIO_PORT CLR7: CLRP04 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP05_Pos                             5                                                         /*!< GPIO_PORT CLR7: CLRP05 Position     */\r
+#define GPIO_PORT_CLR7_CLRP05_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP05_Pos)                     /*!< GPIO_PORT CLR7: CLRP05 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP06_Pos                             6                                                         /*!< GPIO_PORT CLR7: CLRP06 Position     */\r
+#define GPIO_PORT_CLR7_CLRP06_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP06_Pos)                     /*!< GPIO_PORT CLR7: CLRP06 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP07_Pos                             7                                                         /*!< GPIO_PORT CLR7: CLRP07 Position     */\r
+#define GPIO_PORT_CLR7_CLRP07_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP07_Pos)                     /*!< GPIO_PORT CLR7: CLRP07 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP08_Pos                             8                                                         /*!< GPIO_PORT CLR7: CLRP08 Position     */\r
+#define GPIO_PORT_CLR7_CLRP08_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP08_Pos)                     /*!< GPIO_PORT CLR7: CLRP08 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP09_Pos                             9                                                         /*!< GPIO_PORT CLR7: CLRP09 Position     */\r
+#define GPIO_PORT_CLR7_CLRP09_Msk                             (0x01UL << GPIO_PORT_CLR7_CLRP09_Pos)                     /*!< GPIO_PORT CLR7: CLRP09 Mask         */\r
+#define GPIO_PORT_CLR7_CLRP010_Pos                            10                                                        /*!< GPIO_PORT CLR7: CLRP010 Position    */\r
+#define GPIO_PORT_CLR7_CLRP010_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP010_Pos)                    /*!< GPIO_PORT CLR7: CLRP010 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP011_Pos                            11                                                        /*!< GPIO_PORT CLR7: CLRP011 Position    */\r
+#define GPIO_PORT_CLR7_CLRP011_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP011_Pos)                    /*!< GPIO_PORT CLR7: CLRP011 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP012_Pos                            12                                                        /*!< GPIO_PORT CLR7: CLRP012 Position    */\r
+#define GPIO_PORT_CLR7_CLRP012_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP012_Pos)                    /*!< GPIO_PORT CLR7: CLRP012 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP013_Pos                            13                                                        /*!< GPIO_PORT CLR7: CLRP013 Position    */\r
+#define GPIO_PORT_CLR7_CLRP013_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP013_Pos)                    /*!< GPIO_PORT CLR7: CLRP013 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP014_Pos                            14                                                        /*!< GPIO_PORT CLR7: CLRP014 Position    */\r
+#define GPIO_PORT_CLR7_CLRP014_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP014_Pos)                    /*!< GPIO_PORT CLR7: CLRP014 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP015_Pos                            15                                                        /*!< GPIO_PORT CLR7: CLRP015 Position    */\r
+#define GPIO_PORT_CLR7_CLRP015_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP015_Pos)                    /*!< GPIO_PORT CLR7: CLRP015 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP016_Pos                            16                                                        /*!< GPIO_PORT CLR7: CLRP016 Position    */\r
+#define GPIO_PORT_CLR7_CLRP016_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP016_Pos)                    /*!< GPIO_PORT CLR7: CLRP016 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP017_Pos                            17                                                        /*!< GPIO_PORT CLR7: CLRP017 Position    */\r
+#define GPIO_PORT_CLR7_CLRP017_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP017_Pos)                    /*!< GPIO_PORT CLR7: CLRP017 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP018_Pos                            18                                                        /*!< GPIO_PORT CLR7: CLRP018 Position    */\r
+#define GPIO_PORT_CLR7_CLRP018_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP018_Pos)                    /*!< GPIO_PORT CLR7: CLRP018 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP019_Pos                            19                                                        /*!< GPIO_PORT CLR7: CLRP019 Position    */\r
+#define GPIO_PORT_CLR7_CLRP019_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP019_Pos)                    /*!< GPIO_PORT CLR7: CLRP019 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP020_Pos                            20                                                        /*!< GPIO_PORT CLR7: CLRP020 Position    */\r
+#define GPIO_PORT_CLR7_CLRP020_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP020_Pos)                    /*!< GPIO_PORT CLR7: CLRP020 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP021_Pos                            21                                                        /*!< GPIO_PORT CLR7: CLRP021 Position    */\r
+#define GPIO_PORT_CLR7_CLRP021_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP021_Pos)                    /*!< GPIO_PORT CLR7: CLRP021 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP022_Pos                            22                                                        /*!< GPIO_PORT CLR7: CLRP022 Position    */\r
+#define GPIO_PORT_CLR7_CLRP022_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP022_Pos)                    /*!< GPIO_PORT CLR7: CLRP022 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP023_Pos                            23                                                        /*!< GPIO_PORT CLR7: CLRP023 Position    */\r
+#define GPIO_PORT_CLR7_CLRP023_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP023_Pos)                    /*!< GPIO_PORT CLR7: CLRP023 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP024_Pos                            24                                                        /*!< GPIO_PORT CLR7: CLRP024 Position    */\r
+#define GPIO_PORT_CLR7_CLRP024_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP024_Pos)                    /*!< GPIO_PORT CLR7: CLRP024 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP025_Pos                            25                                                        /*!< GPIO_PORT CLR7: CLRP025 Position    */\r
+#define GPIO_PORT_CLR7_CLRP025_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP025_Pos)                    /*!< GPIO_PORT CLR7: CLRP025 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP026_Pos                            26                                                        /*!< GPIO_PORT CLR7: CLRP026 Position    */\r
+#define GPIO_PORT_CLR7_CLRP026_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP026_Pos)                    /*!< GPIO_PORT CLR7: CLRP026 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP027_Pos                            27                                                        /*!< GPIO_PORT CLR7: CLRP027 Position    */\r
+#define GPIO_PORT_CLR7_CLRP027_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP027_Pos)                    /*!< GPIO_PORT CLR7: CLRP027 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP028_Pos                            28                                                        /*!< GPIO_PORT CLR7: CLRP028 Position    */\r
+#define GPIO_PORT_CLR7_CLRP028_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP028_Pos)                    /*!< GPIO_PORT CLR7: CLRP028 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP029_Pos                            29                                                        /*!< GPIO_PORT CLR7: CLRP029 Position    */\r
+#define GPIO_PORT_CLR7_CLRP029_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP029_Pos)                    /*!< GPIO_PORT CLR7: CLRP029 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP030_Pos                            30                                                        /*!< GPIO_PORT CLR7: CLRP030 Position    */\r
+#define GPIO_PORT_CLR7_CLRP030_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP030_Pos)                    /*!< GPIO_PORT CLR7: CLRP030 Mask        */\r
+#define GPIO_PORT_CLR7_CLRP031_Pos                            31                                                        /*!< GPIO_PORT CLR7: CLRP031 Position    */\r
+#define GPIO_PORT_CLR7_CLRP031_Msk                            (0x01UL << GPIO_PORT_CLR7_CLRP031_Pos)                    /*!< GPIO_PORT CLR7: CLRP031 Mask        */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT0  -----------------------------------------\r
+#define GPIO_PORT_NOT0_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT0: NOTP0 Position      */\r
+#define GPIO_PORT_NOT0_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP0_Pos)                      /*!< GPIO_PORT NOT0: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT0: NOTP1 Position      */\r
+#define GPIO_PORT_NOT0_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP1_Pos)                      /*!< GPIO_PORT NOT0: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT0: NOTP2 Position      */\r
+#define GPIO_PORT_NOT0_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP2_Pos)                      /*!< GPIO_PORT NOT0: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT0: NOTP3 Position      */\r
+#define GPIO_PORT_NOT0_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP3_Pos)                      /*!< GPIO_PORT NOT0: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT0: NOTP4 Position      */\r
+#define GPIO_PORT_NOT0_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP4_Pos)                      /*!< GPIO_PORT NOT0: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT0: NOTP5 Position      */\r
+#define GPIO_PORT_NOT0_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP5_Pos)                      /*!< GPIO_PORT NOT0: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT0: NOTP6 Position      */\r
+#define GPIO_PORT_NOT0_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP6_Pos)                      /*!< GPIO_PORT NOT0: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT0: NOTP7 Position      */\r
+#define GPIO_PORT_NOT0_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP7_Pos)                      /*!< GPIO_PORT NOT0: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT0: NOTP8 Position      */\r
+#define GPIO_PORT_NOT0_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP8_Pos)                      /*!< GPIO_PORT NOT0: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT0: NOTP9 Position      */\r
+#define GPIO_PORT_NOT0_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT0_NOTP9_Pos)                      /*!< GPIO_PORT NOT0: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT0_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT0: NOTP10 Position     */\r
+#define GPIO_PORT_NOT0_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP10_Pos)                     /*!< GPIO_PORT NOT0: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT0: NOTP11 Position     */\r
+#define GPIO_PORT_NOT0_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP11_Pos)                     /*!< GPIO_PORT NOT0: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT0: NOTP12 Position     */\r
+#define GPIO_PORT_NOT0_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP12_Pos)                     /*!< GPIO_PORT NOT0: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT0: NOTP13 Position     */\r
+#define GPIO_PORT_NOT0_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP13_Pos)                     /*!< GPIO_PORT NOT0: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT0: NOTP14 Position     */\r
+#define GPIO_PORT_NOT0_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP14_Pos)                     /*!< GPIO_PORT NOT0: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT0: NOTP15 Position     */\r
+#define GPIO_PORT_NOT0_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP15_Pos)                     /*!< GPIO_PORT NOT0: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT0: NOTP16 Position     */\r
+#define GPIO_PORT_NOT0_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP16_Pos)                     /*!< GPIO_PORT NOT0: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT0: NOTP17 Position     */\r
+#define GPIO_PORT_NOT0_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP17_Pos)                     /*!< GPIO_PORT NOT0: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT0: NOTP18 Position     */\r
+#define GPIO_PORT_NOT0_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP18_Pos)                     /*!< GPIO_PORT NOT0: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT0: NOTP19 Position     */\r
+#define GPIO_PORT_NOT0_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP19_Pos)                     /*!< GPIO_PORT NOT0: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT0: NOTP20 Position     */\r
+#define GPIO_PORT_NOT0_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP20_Pos)                     /*!< GPIO_PORT NOT0: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT0: NOTP21 Position     */\r
+#define GPIO_PORT_NOT0_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP21_Pos)                     /*!< GPIO_PORT NOT0: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT0: NOTP22 Position     */\r
+#define GPIO_PORT_NOT0_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP22_Pos)                     /*!< GPIO_PORT NOT0: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT0: NOTP23 Position     */\r
+#define GPIO_PORT_NOT0_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP23_Pos)                     /*!< GPIO_PORT NOT0: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT0: NOTP24 Position     */\r
+#define GPIO_PORT_NOT0_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP24_Pos)                     /*!< GPIO_PORT NOT0: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT0: NOTP25 Position     */\r
+#define GPIO_PORT_NOT0_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP25_Pos)                     /*!< GPIO_PORT NOT0: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT0: NOTP26 Position     */\r
+#define GPIO_PORT_NOT0_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP26_Pos)                     /*!< GPIO_PORT NOT0: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT0: NOTP27 Position     */\r
+#define GPIO_PORT_NOT0_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP27_Pos)                     /*!< GPIO_PORT NOT0: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT0: NOTP28 Position     */\r
+#define GPIO_PORT_NOT0_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP28_Pos)                     /*!< GPIO_PORT NOT0: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT0: NOTP29 Position     */\r
+#define GPIO_PORT_NOT0_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP29_Pos)                     /*!< GPIO_PORT NOT0: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT0: NOTP30 Position     */\r
+#define GPIO_PORT_NOT0_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP30_Pos)                     /*!< GPIO_PORT NOT0: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT0_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT0: NOTP31 Position     */\r
+#define GPIO_PORT_NOT0_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT0_NOTP31_Pos)                     /*!< GPIO_PORT NOT0: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT1  -----------------------------------------\r
+#define GPIO_PORT_NOT1_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT1: NOTP0 Position      */\r
+#define GPIO_PORT_NOT1_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP0_Pos)                      /*!< GPIO_PORT NOT1: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT1: NOTP1 Position      */\r
+#define GPIO_PORT_NOT1_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP1_Pos)                      /*!< GPIO_PORT NOT1: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT1: NOTP2 Position      */\r
+#define GPIO_PORT_NOT1_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP2_Pos)                      /*!< GPIO_PORT NOT1: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT1: NOTP3 Position      */\r
+#define GPIO_PORT_NOT1_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP3_Pos)                      /*!< GPIO_PORT NOT1: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT1: NOTP4 Position      */\r
+#define GPIO_PORT_NOT1_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP4_Pos)                      /*!< GPIO_PORT NOT1: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT1: NOTP5 Position      */\r
+#define GPIO_PORT_NOT1_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP5_Pos)                      /*!< GPIO_PORT NOT1: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT1: NOTP6 Position      */\r
+#define GPIO_PORT_NOT1_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP6_Pos)                      /*!< GPIO_PORT NOT1: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT1: NOTP7 Position      */\r
+#define GPIO_PORT_NOT1_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP7_Pos)                      /*!< GPIO_PORT NOT1: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT1: NOTP8 Position      */\r
+#define GPIO_PORT_NOT1_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP8_Pos)                      /*!< GPIO_PORT NOT1: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT1: NOTP9 Position      */\r
+#define GPIO_PORT_NOT1_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT1_NOTP9_Pos)                      /*!< GPIO_PORT NOT1: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT1_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT1: NOTP10 Position     */\r
+#define GPIO_PORT_NOT1_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP10_Pos)                     /*!< GPIO_PORT NOT1: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT1: NOTP11 Position     */\r
+#define GPIO_PORT_NOT1_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP11_Pos)                     /*!< GPIO_PORT NOT1: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT1: NOTP12 Position     */\r
+#define GPIO_PORT_NOT1_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP12_Pos)                     /*!< GPIO_PORT NOT1: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT1: NOTP13 Position     */\r
+#define GPIO_PORT_NOT1_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP13_Pos)                     /*!< GPIO_PORT NOT1: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT1: NOTP14 Position     */\r
+#define GPIO_PORT_NOT1_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP14_Pos)                     /*!< GPIO_PORT NOT1: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT1: NOTP15 Position     */\r
+#define GPIO_PORT_NOT1_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP15_Pos)                     /*!< GPIO_PORT NOT1: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT1: NOTP16 Position     */\r
+#define GPIO_PORT_NOT1_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP16_Pos)                     /*!< GPIO_PORT NOT1: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT1: NOTP17 Position     */\r
+#define GPIO_PORT_NOT1_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP17_Pos)                     /*!< GPIO_PORT NOT1: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT1: NOTP18 Position     */\r
+#define GPIO_PORT_NOT1_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP18_Pos)                     /*!< GPIO_PORT NOT1: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT1: NOTP19 Position     */\r
+#define GPIO_PORT_NOT1_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP19_Pos)                     /*!< GPIO_PORT NOT1: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT1: NOTP20 Position     */\r
+#define GPIO_PORT_NOT1_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP20_Pos)                     /*!< GPIO_PORT NOT1: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT1: NOTP21 Position     */\r
+#define GPIO_PORT_NOT1_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP21_Pos)                     /*!< GPIO_PORT NOT1: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT1: NOTP22 Position     */\r
+#define GPIO_PORT_NOT1_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP22_Pos)                     /*!< GPIO_PORT NOT1: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT1: NOTP23 Position     */\r
+#define GPIO_PORT_NOT1_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP23_Pos)                     /*!< GPIO_PORT NOT1: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT1: NOTP24 Position     */\r
+#define GPIO_PORT_NOT1_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP24_Pos)                     /*!< GPIO_PORT NOT1: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT1: NOTP25 Position     */\r
+#define GPIO_PORT_NOT1_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP25_Pos)                     /*!< GPIO_PORT NOT1: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT1: NOTP26 Position     */\r
+#define GPIO_PORT_NOT1_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP26_Pos)                     /*!< GPIO_PORT NOT1: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT1: NOTP27 Position     */\r
+#define GPIO_PORT_NOT1_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP27_Pos)                     /*!< GPIO_PORT NOT1: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT1: NOTP28 Position     */\r
+#define GPIO_PORT_NOT1_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP28_Pos)                     /*!< GPIO_PORT NOT1: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT1: NOTP29 Position     */\r
+#define GPIO_PORT_NOT1_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP29_Pos)                     /*!< GPIO_PORT NOT1: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT1: NOTP30 Position     */\r
+#define GPIO_PORT_NOT1_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP30_Pos)                     /*!< GPIO_PORT NOT1: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT1_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT1: NOTP31 Position     */\r
+#define GPIO_PORT_NOT1_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT1_NOTP31_Pos)                     /*!< GPIO_PORT NOT1: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT2  -----------------------------------------\r
+#define GPIO_PORT_NOT2_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT2: NOTP0 Position      */\r
+#define GPIO_PORT_NOT2_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP0_Pos)                      /*!< GPIO_PORT NOT2: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT2: NOTP1 Position      */\r
+#define GPIO_PORT_NOT2_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP1_Pos)                      /*!< GPIO_PORT NOT2: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT2: NOTP2 Position      */\r
+#define GPIO_PORT_NOT2_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP2_Pos)                      /*!< GPIO_PORT NOT2: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT2: NOTP3 Position      */\r
+#define GPIO_PORT_NOT2_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP3_Pos)                      /*!< GPIO_PORT NOT2: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT2: NOTP4 Position      */\r
+#define GPIO_PORT_NOT2_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP4_Pos)                      /*!< GPIO_PORT NOT2: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT2: NOTP5 Position      */\r
+#define GPIO_PORT_NOT2_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP5_Pos)                      /*!< GPIO_PORT NOT2: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT2: NOTP6 Position      */\r
+#define GPIO_PORT_NOT2_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP6_Pos)                      /*!< GPIO_PORT NOT2: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT2: NOTP7 Position      */\r
+#define GPIO_PORT_NOT2_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP7_Pos)                      /*!< GPIO_PORT NOT2: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT2: NOTP8 Position      */\r
+#define GPIO_PORT_NOT2_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP8_Pos)                      /*!< GPIO_PORT NOT2: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT2: NOTP9 Position      */\r
+#define GPIO_PORT_NOT2_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT2_NOTP9_Pos)                      /*!< GPIO_PORT NOT2: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT2_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT2: NOTP10 Position     */\r
+#define GPIO_PORT_NOT2_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP10_Pos)                     /*!< GPIO_PORT NOT2: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT2: NOTP11 Position     */\r
+#define GPIO_PORT_NOT2_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP11_Pos)                     /*!< GPIO_PORT NOT2: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT2: NOTP12 Position     */\r
+#define GPIO_PORT_NOT2_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP12_Pos)                     /*!< GPIO_PORT NOT2: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT2: NOTP13 Position     */\r
+#define GPIO_PORT_NOT2_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP13_Pos)                     /*!< GPIO_PORT NOT2: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT2: NOTP14 Position     */\r
+#define GPIO_PORT_NOT2_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP14_Pos)                     /*!< GPIO_PORT NOT2: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT2: NOTP15 Position     */\r
+#define GPIO_PORT_NOT2_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP15_Pos)                     /*!< GPIO_PORT NOT2: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT2: NOTP16 Position     */\r
+#define GPIO_PORT_NOT2_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP16_Pos)                     /*!< GPIO_PORT NOT2: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT2: NOTP17 Position     */\r
+#define GPIO_PORT_NOT2_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP17_Pos)                     /*!< GPIO_PORT NOT2: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT2: NOTP18 Position     */\r
+#define GPIO_PORT_NOT2_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP18_Pos)                     /*!< GPIO_PORT NOT2: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT2: NOTP19 Position     */\r
+#define GPIO_PORT_NOT2_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP19_Pos)                     /*!< GPIO_PORT NOT2: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT2: NOTP20 Position     */\r
+#define GPIO_PORT_NOT2_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP20_Pos)                     /*!< GPIO_PORT NOT2: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT2: NOTP21 Position     */\r
+#define GPIO_PORT_NOT2_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP21_Pos)                     /*!< GPIO_PORT NOT2: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT2: NOTP22 Position     */\r
+#define GPIO_PORT_NOT2_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP22_Pos)                     /*!< GPIO_PORT NOT2: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT2: NOTP23 Position     */\r
+#define GPIO_PORT_NOT2_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP23_Pos)                     /*!< GPIO_PORT NOT2: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT2: NOTP24 Position     */\r
+#define GPIO_PORT_NOT2_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP24_Pos)                     /*!< GPIO_PORT NOT2: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT2: NOTP25 Position     */\r
+#define GPIO_PORT_NOT2_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP25_Pos)                     /*!< GPIO_PORT NOT2: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT2: NOTP26 Position     */\r
+#define GPIO_PORT_NOT2_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP26_Pos)                     /*!< GPIO_PORT NOT2: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT2: NOTP27 Position     */\r
+#define GPIO_PORT_NOT2_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP27_Pos)                     /*!< GPIO_PORT NOT2: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT2: NOTP28 Position     */\r
+#define GPIO_PORT_NOT2_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP28_Pos)                     /*!< GPIO_PORT NOT2: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT2: NOTP29 Position     */\r
+#define GPIO_PORT_NOT2_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP29_Pos)                     /*!< GPIO_PORT NOT2: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT2: NOTP30 Position     */\r
+#define GPIO_PORT_NOT2_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP30_Pos)                     /*!< GPIO_PORT NOT2: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT2_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT2: NOTP31 Position     */\r
+#define GPIO_PORT_NOT2_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT2_NOTP31_Pos)                     /*!< GPIO_PORT NOT2: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT3  -----------------------------------------\r
+#define GPIO_PORT_NOT3_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT3: NOTP0 Position      */\r
+#define GPIO_PORT_NOT3_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP0_Pos)                      /*!< GPIO_PORT NOT3: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT3: NOTP1 Position      */\r
+#define GPIO_PORT_NOT3_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP1_Pos)                      /*!< GPIO_PORT NOT3: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT3: NOTP2 Position      */\r
+#define GPIO_PORT_NOT3_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP2_Pos)                      /*!< GPIO_PORT NOT3: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT3: NOTP3 Position      */\r
+#define GPIO_PORT_NOT3_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP3_Pos)                      /*!< GPIO_PORT NOT3: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT3: NOTP4 Position      */\r
+#define GPIO_PORT_NOT3_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP4_Pos)                      /*!< GPIO_PORT NOT3: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT3: NOTP5 Position      */\r
+#define GPIO_PORT_NOT3_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP5_Pos)                      /*!< GPIO_PORT NOT3: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT3: NOTP6 Position      */\r
+#define GPIO_PORT_NOT3_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP6_Pos)                      /*!< GPIO_PORT NOT3: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT3: NOTP7 Position      */\r
+#define GPIO_PORT_NOT3_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP7_Pos)                      /*!< GPIO_PORT NOT3: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT3: NOTP8 Position      */\r
+#define GPIO_PORT_NOT3_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP8_Pos)                      /*!< GPIO_PORT NOT3: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT3: NOTP9 Position      */\r
+#define GPIO_PORT_NOT3_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT3_NOTP9_Pos)                      /*!< GPIO_PORT NOT3: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT3_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT3: NOTP10 Position     */\r
+#define GPIO_PORT_NOT3_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP10_Pos)                     /*!< GPIO_PORT NOT3: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT3: NOTP11 Position     */\r
+#define GPIO_PORT_NOT3_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP11_Pos)                     /*!< GPIO_PORT NOT3: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT3: NOTP12 Position     */\r
+#define GPIO_PORT_NOT3_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP12_Pos)                     /*!< GPIO_PORT NOT3: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT3: NOTP13 Position     */\r
+#define GPIO_PORT_NOT3_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP13_Pos)                     /*!< GPIO_PORT NOT3: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT3: NOTP14 Position     */\r
+#define GPIO_PORT_NOT3_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP14_Pos)                     /*!< GPIO_PORT NOT3: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT3: NOTP15 Position     */\r
+#define GPIO_PORT_NOT3_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP15_Pos)                     /*!< GPIO_PORT NOT3: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT3: NOTP16 Position     */\r
+#define GPIO_PORT_NOT3_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP16_Pos)                     /*!< GPIO_PORT NOT3: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT3: NOTP17 Position     */\r
+#define GPIO_PORT_NOT3_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP17_Pos)                     /*!< GPIO_PORT NOT3: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT3: NOTP18 Position     */\r
+#define GPIO_PORT_NOT3_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP18_Pos)                     /*!< GPIO_PORT NOT3: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT3: NOTP19 Position     */\r
+#define GPIO_PORT_NOT3_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP19_Pos)                     /*!< GPIO_PORT NOT3: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT3: NOTP20 Position     */\r
+#define GPIO_PORT_NOT3_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP20_Pos)                     /*!< GPIO_PORT NOT3: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT3: NOTP21 Position     */\r
+#define GPIO_PORT_NOT3_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP21_Pos)                     /*!< GPIO_PORT NOT3: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT3: NOTP22 Position     */\r
+#define GPIO_PORT_NOT3_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP22_Pos)                     /*!< GPIO_PORT NOT3: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT3: NOTP23 Position     */\r
+#define GPIO_PORT_NOT3_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP23_Pos)                     /*!< GPIO_PORT NOT3: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT3: NOTP24 Position     */\r
+#define GPIO_PORT_NOT3_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP24_Pos)                     /*!< GPIO_PORT NOT3: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT3: NOTP25 Position     */\r
+#define GPIO_PORT_NOT3_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP25_Pos)                     /*!< GPIO_PORT NOT3: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT3: NOTP26 Position     */\r
+#define GPIO_PORT_NOT3_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP26_Pos)                     /*!< GPIO_PORT NOT3: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT3: NOTP27 Position     */\r
+#define GPIO_PORT_NOT3_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP27_Pos)                     /*!< GPIO_PORT NOT3: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT3: NOTP28 Position     */\r
+#define GPIO_PORT_NOT3_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP28_Pos)                     /*!< GPIO_PORT NOT3: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT3: NOTP29 Position     */\r
+#define GPIO_PORT_NOT3_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP29_Pos)                     /*!< GPIO_PORT NOT3: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT3: NOTP30 Position     */\r
+#define GPIO_PORT_NOT3_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP30_Pos)                     /*!< GPIO_PORT NOT3: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT3_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT3: NOTP31 Position     */\r
+#define GPIO_PORT_NOT3_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT3_NOTP31_Pos)                     /*!< GPIO_PORT NOT3: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT4  -----------------------------------------\r
+#define GPIO_PORT_NOT4_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT4: NOTP0 Position      */\r
+#define GPIO_PORT_NOT4_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP0_Pos)                      /*!< GPIO_PORT NOT4: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT4: NOTP1 Position      */\r
+#define GPIO_PORT_NOT4_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP1_Pos)                      /*!< GPIO_PORT NOT4: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT4: NOTP2 Position      */\r
+#define GPIO_PORT_NOT4_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP2_Pos)                      /*!< GPIO_PORT NOT4: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT4: NOTP3 Position      */\r
+#define GPIO_PORT_NOT4_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP3_Pos)                      /*!< GPIO_PORT NOT4: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT4: NOTP4 Position      */\r
+#define GPIO_PORT_NOT4_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP4_Pos)                      /*!< GPIO_PORT NOT4: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT4: NOTP5 Position      */\r
+#define GPIO_PORT_NOT4_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP5_Pos)                      /*!< GPIO_PORT NOT4: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT4: NOTP6 Position      */\r
+#define GPIO_PORT_NOT4_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP6_Pos)                      /*!< GPIO_PORT NOT4: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT4: NOTP7 Position      */\r
+#define GPIO_PORT_NOT4_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP7_Pos)                      /*!< GPIO_PORT NOT4: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT4: NOTP8 Position      */\r
+#define GPIO_PORT_NOT4_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP8_Pos)                      /*!< GPIO_PORT NOT4: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT4: NOTP9 Position      */\r
+#define GPIO_PORT_NOT4_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT4_NOTP9_Pos)                      /*!< GPIO_PORT NOT4: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT4_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT4: NOTP10 Position     */\r
+#define GPIO_PORT_NOT4_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP10_Pos)                     /*!< GPIO_PORT NOT4: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT4: NOTP11 Position     */\r
+#define GPIO_PORT_NOT4_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP11_Pos)                     /*!< GPIO_PORT NOT4: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT4: NOTP12 Position     */\r
+#define GPIO_PORT_NOT4_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP12_Pos)                     /*!< GPIO_PORT NOT4: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT4: NOTP13 Position     */\r
+#define GPIO_PORT_NOT4_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP13_Pos)                     /*!< GPIO_PORT NOT4: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT4: NOTP14 Position     */\r
+#define GPIO_PORT_NOT4_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP14_Pos)                     /*!< GPIO_PORT NOT4: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT4: NOTP15 Position     */\r
+#define GPIO_PORT_NOT4_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP15_Pos)                     /*!< GPIO_PORT NOT4: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT4: NOTP16 Position     */\r
+#define GPIO_PORT_NOT4_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP16_Pos)                     /*!< GPIO_PORT NOT4: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT4: NOTP17 Position     */\r
+#define GPIO_PORT_NOT4_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP17_Pos)                     /*!< GPIO_PORT NOT4: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT4: NOTP18 Position     */\r
+#define GPIO_PORT_NOT4_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP18_Pos)                     /*!< GPIO_PORT NOT4: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT4: NOTP19 Position     */\r
+#define GPIO_PORT_NOT4_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP19_Pos)                     /*!< GPIO_PORT NOT4: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT4: NOTP20 Position     */\r
+#define GPIO_PORT_NOT4_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP20_Pos)                     /*!< GPIO_PORT NOT4: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT4: NOTP21 Position     */\r
+#define GPIO_PORT_NOT4_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP21_Pos)                     /*!< GPIO_PORT NOT4: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT4: NOTP22 Position     */\r
+#define GPIO_PORT_NOT4_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP22_Pos)                     /*!< GPIO_PORT NOT4: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT4: NOTP23 Position     */\r
+#define GPIO_PORT_NOT4_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP23_Pos)                     /*!< GPIO_PORT NOT4: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT4: NOTP24 Position     */\r
+#define GPIO_PORT_NOT4_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP24_Pos)                     /*!< GPIO_PORT NOT4: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT4: NOTP25 Position     */\r
+#define GPIO_PORT_NOT4_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP25_Pos)                     /*!< GPIO_PORT NOT4: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT4: NOTP26 Position     */\r
+#define GPIO_PORT_NOT4_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP26_Pos)                     /*!< GPIO_PORT NOT4: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT4: NOTP27 Position     */\r
+#define GPIO_PORT_NOT4_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP27_Pos)                     /*!< GPIO_PORT NOT4: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT4: NOTP28 Position     */\r
+#define GPIO_PORT_NOT4_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP28_Pos)                     /*!< GPIO_PORT NOT4: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT4: NOTP29 Position     */\r
+#define GPIO_PORT_NOT4_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP29_Pos)                     /*!< GPIO_PORT NOT4: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT4: NOTP30 Position     */\r
+#define GPIO_PORT_NOT4_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP30_Pos)                     /*!< GPIO_PORT NOT4: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT4_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT4: NOTP31 Position     */\r
+#define GPIO_PORT_NOT4_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT4_NOTP31_Pos)                     /*!< GPIO_PORT NOT4: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT5  -----------------------------------------\r
+#define GPIO_PORT_NOT5_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT5: NOTP0 Position      */\r
+#define GPIO_PORT_NOT5_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP0_Pos)                      /*!< GPIO_PORT NOT5: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT5: NOTP1 Position      */\r
+#define GPIO_PORT_NOT5_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP1_Pos)                      /*!< GPIO_PORT NOT5: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT5: NOTP2 Position      */\r
+#define GPIO_PORT_NOT5_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP2_Pos)                      /*!< GPIO_PORT NOT5: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT5: NOTP3 Position      */\r
+#define GPIO_PORT_NOT5_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP3_Pos)                      /*!< GPIO_PORT NOT5: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT5: NOTP4 Position      */\r
+#define GPIO_PORT_NOT5_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP4_Pos)                      /*!< GPIO_PORT NOT5: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT5: NOTP5 Position      */\r
+#define GPIO_PORT_NOT5_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP5_Pos)                      /*!< GPIO_PORT NOT5: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT5: NOTP6 Position      */\r
+#define GPIO_PORT_NOT5_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP6_Pos)                      /*!< GPIO_PORT NOT5: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT5: NOTP7 Position      */\r
+#define GPIO_PORT_NOT5_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP7_Pos)                      /*!< GPIO_PORT NOT5: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT5: NOTP8 Position      */\r
+#define GPIO_PORT_NOT5_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP8_Pos)                      /*!< GPIO_PORT NOT5: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT5: NOTP9 Position      */\r
+#define GPIO_PORT_NOT5_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT5_NOTP9_Pos)                      /*!< GPIO_PORT NOT5: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT5_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT5: NOTP10 Position     */\r
+#define GPIO_PORT_NOT5_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP10_Pos)                     /*!< GPIO_PORT NOT5: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT5: NOTP11 Position     */\r
+#define GPIO_PORT_NOT5_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP11_Pos)                     /*!< GPIO_PORT NOT5: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT5: NOTP12 Position     */\r
+#define GPIO_PORT_NOT5_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP12_Pos)                     /*!< GPIO_PORT NOT5: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT5: NOTP13 Position     */\r
+#define GPIO_PORT_NOT5_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP13_Pos)                     /*!< GPIO_PORT NOT5: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT5: NOTP14 Position     */\r
+#define GPIO_PORT_NOT5_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP14_Pos)                     /*!< GPIO_PORT NOT5: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT5: NOTP15 Position     */\r
+#define GPIO_PORT_NOT5_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP15_Pos)                     /*!< GPIO_PORT NOT5: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT5: NOTP16 Position     */\r
+#define GPIO_PORT_NOT5_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP16_Pos)                     /*!< GPIO_PORT NOT5: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT5: NOTP17 Position     */\r
+#define GPIO_PORT_NOT5_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP17_Pos)                     /*!< GPIO_PORT NOT5: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT5: NOTP18 Position     */\r
+#define GPIO_PORT_NOT5_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP18_Pos)                     /*!< GPIO_PORT NOT5: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT5: NOTP19 Position     */\r
+#define GPIO_PORT_NOT5_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP19_Pos)                     /*!< GPIO_PORT NOT5: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT5: NOTP20 Position     */\r
+#define GPIO_PORT_NOT5_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP20_Pos)                     /*!< GPIO_PORT NOT5: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT5: NOTP21 Position     */\r
+#define GPIO_PORT_NOT5_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP21_Pos)                     /*!< GPIO_PORT NOT5: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT5: NOTP22 Position     */\r
+#define GPIO_PORT_NOT5_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP22_Pos)                     /*!< GPIO_PORT NOT5: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT5: NOTP23 Position     */\r
+#define GPIO_PORT_NOT5_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP23_Pos)                     /*!< GPIO_PORT NOT5: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT5: NOTP24 Position     */\r
+#define GPIO_PORT_NOT5_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP24_Pos)                     /*!< GPIO_PORT NOT5: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT5: NOTP25 Position     */\r
+#define GPIO_PORT_NOT5_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP25_Pos)                     /*!< GPIO_PORT NOT5: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT5: NOTP26 Position     */\r
+#define GPIO_PORT_NOT5_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP26_Pos)                     /*!< GPIO_PORT NOT5: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT5: NOTP27 Position     */\r
+#define GPIO_PORT_NOT5_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP27_Pos)                     /*!< GPIO_PORT NOT5: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT5: NOTP28 Position     */\r
+#define GPIO_PORT_NOT5_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP28_Pos)                     /*!< GPIO_PORT NOT5: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT5: NOTP29 Position     */\r
+#define GPIO_PORT_NOT5_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP29_Pos)                     /*!< GPIO_PORT NOT5: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT5: NOTP30 Position     */\r
+#define GPIO_PORT_NOT5_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP30_Pos)                     /*!< GPIO_PORT NOT5: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT5_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT5: NOTP31 Position     */\r
+#define GPIO_PORT_NOT5_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT5_NOTP31_Pos)                     /*!< GPIO_PORT NOT5: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT6  -----------------------------------------\r
+#define GPIO_PORT_NOT6_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT6: NOTP0 Position      */\r
+#define GPIO_PORT_NOT6_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP0_Pos)                      /*!< GPIO_PORT NOT6: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT6: NOTP1 Position      */\r
+#define GPIO_PORT_NOT6_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP1_Pos)                      /*!< GPIO_PORT NOT6: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT6: NOTP2 Position      */\r
+#define GPIO_PORT_NOT6_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP2_Pos)                      /*!< GPIO_PORT NOT6: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT6: NOTP3 Position      */\r
+#define GPIO_PORT_NOT6_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP3_Pos)                      /*!< GPIO_PORT NOT6: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT6: NOTP4 Position      */\r
+#define GPIO_PORT_NOT6_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP4_Pos)                      /*!< GPIO_PORT NOT6: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT6: NOTP5 Position      */\r
+#define GPIO_PORT_NOT6_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP5_Pos)                      /*!< GPIO_PORT NOT6: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT6: NOTP6 Position      */\r
+#define GPIO_PORT_NOT6_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP6_Pos)                      /*!< GPIO_PORT NOT6: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT6: NOTP7 Position      */\r
+#define GPIO_PORT_NOT6_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP7_Pos)                      /*!< GPIO_PORT NOT6: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT6: NOTP8 Position      */\r
+#define GPIO_PORT_NOT6_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP8_Pos)                      /*!< GPIO_PORT NOT6: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT6: NOTP9 Position      */\r
+#define GPIO_PORT_NOT6_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT6_NOTP9_Pos)                      /*!< GPIO_PORT NOT6: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT6_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT6: NOTP10 Position     */\r
+#define GPIO_PORT_NOT6_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP10_Pos)                     /*!< GPIO_PORT NOT6: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT6: NOTP11 Position     */\r
+#define GPIO_PORT_NOT6_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP11_Pos)                     /*!< GPIO_PORT NOT6: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT6: NOTP12 Position     */\r
+#define GPIO_PORT_NOT6_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP12_Pos)                     /*!< GPIO_PORT NOT6: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT6: NOTP13 Position     */\r
+#define GPIO_PORT_NOT6_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP13_Pos)                     /*!< GPIO_PORT NOT6: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT6: NOTP14 Position     */\r
+#define GPIO_PORT_NOT6_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP14_Pos)                     /*!< GPIO_PORT NOT6: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT6: NOTP15 Position     */\r
+#define GPIO_PORT_NOT6_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP15_Pos)                     /*!< GPIO_PORT NOT6: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT6: NOTP16 Position     */\r
+#define GPIO_PORT_NOT6_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP16_Pos)                     /*!< GPIO_PORT NOT6: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT6: NOTP17 Position     */\r
+#define GPIO_PORT_NOT6_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP17_Pos)                     /*!< GPIO_PORT NOT6: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT6: NOTP18 Position     */\r
+#define GPIO_PORT_NOT6_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP18_Pos)                     /*!< GPIO_PORT NOT6: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT6: NOTP19 Position     */\r
+#define GPIO_PORT_NOT6_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP19_Pos)                     /*!< GPIO_PORT NOT6: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT6: NOTP20 Position     */\r
+#define GPIO_PORT_NOT6_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP20_Pos)                     /*!< GPIO_PORT NOT6: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT6: NOTP21 Position     */\r
+#define GPIO_PORT_NOT6_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP21_Pos)                     /*!< GPIO_PORT NOT6: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT6: NOTP22 Position     */\r
+#define GPIO_PORT_NOT6_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP22_Pos)                     /*!< GPIO_PORT NOT6: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT6: NOTP23 Position     */\r
+#define GPIO_PORT_NOT6_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP23_Pos)                     /*!< GPIO_PORT NOT6: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT6: NOTP24 Position     */\r
+#define GPIO_PORT_NOT6_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP24_Pos)                     /*!< GPIO_PORT NOT6: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT6: NOTP25 Position     */\r
+#define GPIO_PORT_NOT6_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP25_Pos)                     /*!< GPIO_PORT NOT6: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT6: NOTP26 Position     */\r
+#define GPIO_PORT_NOT6_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP26_Pos)                     /*!< GPIO_PORT NOT6: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT6: NOTP27 Position     */\r
+#define GPIO_PORT_NOT6_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP27_Pos)                     /*!< GPIO_PORT NOT6: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT6: NOTP28 Position     */\r
+#define GPIO_PORT_NOT6_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP28_Pos)                     /*!< GPIO_PORT NOT6: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT6: NOTP29 Position     */\r
+#define GPIO_PORT_NOT6_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP29_Pos)                     /*!< GPIO_PORT NOT6: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT6: NOTP30 Position     */\r
+#define GPIO_PORT_NOT6_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP30_Pos)                     /*!< GPIO_PORT NOT6: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT6_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT6: NOTP31 Position     */\r
+#define GPIO_PORT_NOT6_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT6_NOTP31_Pos)                     /*!< GPIO_PORT NOT6: NOTP31 Mask         */\r
+\r
+// -------------------------------------  GPIO_PORT_NOT7  -----------------------------------------\r
+#define GPIO_PORT_NOT7_NOTP0_Pos                              0                                                         /*!< GPIO_PORT NOT7: NOTP0 Position      */\r
+#define GPIO_PORT_NOT7_NOTP0_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP0_Pos)                      /*!< GPIO_PORT NOT7: NOTP0 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP1_Pos                              1                                                         /*!< GPIO_PORT NOT7: NOTP1 Position      */\r
+#define GPIO_PORT_NOT7_NOTP1_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP1_Pos)                      /*!< GPIO_PORT NOT7: NOTP1 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP2_Pos                              2                                                         /*!< GPIO_PORT NOT7: NOTP2 Position      */\r
+#define GPIO_PORT_NOT7_NOTP2_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP2_Pos)                      /*!< GPIO_PORT NOT7: NOTP2 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP3_Pos                              3                                                         /*!< GPIO_PORT NOT7: NOTP3 Position      */\r
+#define GPIO_PORT_NOT7_NOTP3_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP3_Pos)                      /*!< GPIO_PORT NOT7: NOTP3 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP4_Pos                              4                                                         /*!< GPIO_PORT NOT7: NOTP4 Position      */\r
+#define GPIO_PORT_NOT7_NOTP4_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP4_Pos)                      /*!< GPIO_PORT NOT7: NOTP4 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP5_Pos                              5                                                         /*!< GPIO_PORT NOT7: NOTP5 Position      */\r
+#define GPIO_PORT_NOT7_NOTP5_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP5_Pos)                      /*!< GPIO_PORT NOT7: NOTP5 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP6_Pos                              6                                                         /*!< GPIO_PORT NOT7: NOTP6 Position      */\r
+#define GPIO_PORT_NOT7_NOTP6_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP6_Pos)                      /*!< GPIO_PORT NOT7: NOTP6 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP7_Pos                              7                                                         /*!< GPIO_PORT NOT7: NOTP7 Position      */\r
+#define GPIO_PORT_NOT7_NOTP7_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP7_Pos)                      /*!< GPIO_PORT NOT7: NOTP7 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP8_Pos                              8                                                         /*!< GPIO_PORT NOT7: NOTP8 Position      */\r
+#define GPIO_PORT_NOT7_NOTP8_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP8_Pos)                      /*!< GPIO_PORT NOT7: NOTP8 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP9_Pos                              9                                                         /*!< GPIO_PORT NOT7: NOTP9 Position      */\r
+#define GPIO_PORT_NOT7_NOTP9_Msk                              (0x01UL << GPIO_PORT_NOT7_NOTP9_Pos)                      /*!< GPIO_PORT NOT7: NOTP9 Mask          */\r
+#define GPIO_PORT_NOT7_NOTP10_Pos                             10                                                        /*!< GPIO_PORT NOT7: NOTP10 Position     */\r
+#define GPIO_PORT_NOT7_NOTP10_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP10_Pos)                     /*!< GPIO_PORT NOT7: NOTP10 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP11_Pos                             11                                                        /*!< GPIO_PORT NOT7: NOTP11 Position     */\r
+#define GPIO_PORT_NOT7_NOTP11_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP11_Pos)                     /*!< GPIO_PORT NOT7: NOTP11 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP12_Pos                             12                                                        /*!< GPIO_PORT NOT7: NOTP12 Position     */\r
+#define GPIO_PORT_NOT7_NOTP12_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP12_Pos)                     /*!< GPIO_PORT NOT7: NOTP12 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP13_Pos                             13                                                        /*!< GPIO_PORT NOT7: NOTP13 Position     */\r
+#define GPIO_PORT_NOT7_NOTP13_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP13_Pos)                     /*!< GPIO_PORT NOT7: NOTP13 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP14_Pos                             14                                                        /*!< GPIO_PORT NOT7: NOTP14 Position     */\r
+#define GPIO_PORT_NOT7_NOTP14_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP14_Pos)                     /*!< GPIO_PORT NOT7: NOTP14 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP15_Pos                             15                                                        /*!< GPIO_PORT NOT7: NOTP15 Position     */\r
+#define GPIO_PORT_NOT7_NOTP15_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP15_Pos)                     /*!< GPIO_PORT NOT7: NOTP15 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP16_Pos                             16                                                        /*!< GPIO_PORT NOT7: NOTP16 Position     */\r
+#define GPIO_PORT_NOT7_NOTP16_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP16_Pos)                     /*!< GPIO_PORT NOT7: NOTP16 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP17_Pos                             17                                                        /*!< GPIO_PORT NOT7: NOTP17 Position     */\r
+#define GPIO_PORT_NOT7_NOTP17_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP17_Pos)                     /*!< GPIO_PORT NOT7: NOTP17 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP18_Pos                             18                                                        /*!< GPIO_PORT NOT7: NOTP18 Position     */\r
+#define GPIO_PORT_NOT7_NOTP18_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP18_Pos)                     /*!< GPIO_PORT NOT7: NOTP18 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP19_Pos                             19                                                        /*!< GPIO_PORT NOT7: NOTP19 Position     */\r
+#define GPIO_PORT_NOT7_NOTP19_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP19_Pos)                     /*!< GPIO_PORT NOT7: NOTP19 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP20_Pos                             20                                                        /*!< GPIO_PORT NOT7: NOTP20 Position     */\r
+#define GPIO_PORT_NOT7_NOTP20_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP20_Pos)                     /*!< GPIO_PORT NOT7: NOTP20 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP21_Pos                             21                                                        /*!< GPIO_PORT NOT7: NOTP21 Position     */\r
+#define GPIO_PORT_NOT7_NOTP21_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP21_Pos)                     /*!< GPIO_PORT NOT7: NOTP21 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP22_Pos                             22                                                        /*!< GPIO_PORT NOT7: NOTP22 Position     */\r
+#define GPIO_PORT_NOT7_NOTP22_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP22_Pos)                     /*!< GPIO_PORT NOT7: NOTP22 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP23_Pos                             23                                                        /*!< GPIO_PORT NOT7: NOTP23 Position     */\r
+#define GPIO_PORT_NOT7_NOTP23_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP23_Pos)                     /*!< GPIO_PORT NOT7: NOTP23 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP24_Pos                             24                                                        /*!< GPIO_PORT NOT7: NOTP24 Position     */\r
+#define GPIO_PORT_NOT7_NOTP24_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP24_Pos)                     /*!< GPIO_PORT NOT7: NOTP24 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP25_Pos                             25                                                        /*!< GPIO_PORT NOT7: NOTP25 Position     */\r
+#define GPIO_PORT_NOT7_NOTP25_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP25_Pos)                     /*!< GPIO_PORT NOT7: NOTP25 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP26_Pos                             26                                                        /*!< GPIO_PORT NOT7: NOTP26 Position     */\r
+#define GPIO_PORT_NOT7_NOTP26_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP26_Pos)                     /*!< GPIO_PORT NOT7: NOTP26 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP27_Pos                             27                                                        /*!< GPIO_PORT NOT7: NOTP27 Position     */\r
+#define GPIO_PORT_NOT7_NOTP27_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP27_Pos)                     /*!< GPIO_PORT NOT7: NOTP27 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP28_Pos                             28                                                        /*!< GPIO_PORT NOT7: NOTP28 Position     */\r
+#define GPIO_PORT_NOT7_NOTP28_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP28_Pos)                     /*!< GPIO_PORT NOT7: NOTP28 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP29_Pos                             29                                                        /*!< GPIO_PORT NOT7: NOTP29 Position     */\r
+#define GPIO_PORT_NOT7_NOTP29_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP29_Pos)                     /*!< GPIO_PORT NOT7: NOTP29 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP30_Pos                             30                                                        /*!< GPIO_PORT NOT7: NOTP30 Position     */\r
+#define GPIO_PORT_NOT7_NOTP30_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP30_Pos)                     /*!< GPIO_PORT NOT7: NOTP30 Mask         */\r
+#define GPIO_PORT_NOT7_NOTP31_Pos                             31                                                        /*!< GPIO_PORT NOT7: NOTP31 Position     */\r
+#define GPIO_PORT_NOT7_NOTP31_Msk                             (0x01UL << GPIO_PORT_NOT7_NOTP31_Pos)                     /*!< GPIO_PORT NOT7: NOTP31 Mask         */\r
+\r
+#endif\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                 Peripheral memory map                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+#define LPC_SCT_BASE              0x40000000\r
+#define LPC_GPDMA_BASE            0x40002000\r
+#define LPC_SDMMC_BASE            0x40004000\r
+#define LPC_EMC_BASE              0x40005000\r
+#define LPC_USB0_BASE             0x40006000\r
+#define LPC_USB1_BASE             0x40007000\r
+#define LPC_LCD_BASE              0x40008000\r
+#define LPC_ETHERNET_BASE         0x40010000\r
+#define LPC_ATIMER_BASE           0x40040000\r
+#define LPC_REGFILE_BASE          0x40041000\r
+#define LPC_PMC_BASE              0x40042000\r
+#define LPC_CREG_BASE             0x40043000\r
+#define LPC_EVENTROUTER_BASE      0x40044000\r
+#define LPC_RTC_BASE              0x40046000\r
+#define LPC_CGU_BASE              0x40050000\r
+#define LPC_CCU1_BASE             0x40051000\r
+#define LPC_CCU2_BASE             0x40052000\r
+#define LPC_RGU_BASE              0x40053000\r
+#define LPC_WWDT_BASE             0x40080000\r
+#define LPC_USART0_BASE           0x40081000\r
+#define LPC_USART2_BASE           0x400C1000\r
+#define LPC_USART3_BASE           0x400C2000\r
+#define LPC_UART1_BASE            0x40082000\r
+#define LPC_SSP0_BASE             0x40083000\r
+#define LPC_SSP1_BASE             0x400C5000\r
+#define LPC_TIMER0_BASE           0x40084000\r
+#define LPC_TIMER1_BASE           0x40085000\r
+#define LPC_TIMER2_BASE           0x400C3000\r
+#define LPC_TIMER3_BASE           0x400C4000\r
+#define LPC_SCU_BASE              0x40086000\r
+#define LPC_GPIO_PIN_INT_BASE     0x40087000\r
+#define LPC_GPIO_GROUP_INTn_BASE  0x40088000\r
+#define LPC_GPIO_GROUP_INT1_BASE  0x40089000\r
+#define LPC_MCPWM_BASE            0x400A0000\r
+#define LPC_I2C0_BASE             0x400A1000\r
+#define LPC_I2C1_BASE             0x400E0000\r
+#define LPC_I2S0_BASE             0x400A2000\r
+#define LPC_I2S1_BASE             0x400A3000\r
+#define LPC_C_CAN1_BASE           0x400A4000\r
+#define LPC_RITIMER_BASE          0x400C0000\r
+#define LPC_QEI_BASE              0x400C6000\r
+#define LPC_GIMA_BASE             0x400C7000\r
+#define LPC_DAC_BASE              0x400E1000\r
+#define LPC_C_CAN0_BASE           0x400E2000\r
+#define LPC_ADC0_BASE             0x400E3000\r
+#define LPC_ADC1_BASE             0x400E4000\r
+#define LPC_GPIO_PORT_BASE        0x400F4000\r
+\r
+\r
+// ------------------------------------------------------------------------------------------------\r
+// -----                                Peripheral declaration                                -----\r
+// ------------------------------------------------------------------------------------------------\r
+\r
+#define LPC_SCT                   ((LPC_SCT_Type            *) LPC_SCT_BASE)\r
+#define LPC_GPDMA                 ((LPC_GPDMA_Type          *) LPC_GPDMA_BASE)\r
+#define LPC_SDMMC                 ((LPC_SDMMC_Type          *) LPC_SDMMC_BASE)\r
+#define LPC_EMC                   ((LPC_EMC_Type            *) LPC_EMC_BASE)\r
+#define LPC_USB0                  ((LPC_USB0_Type           *) LPC_USB0_BASE)\r
+#define LPC_USB1                  ((LPC_USB1_Type           *) LPC_USB1_BASE)\r
+#define LPC_LCD                   ((LPC_LCD_Type            *) LPC_LCD_BASE)\r
+#define LPC_ETHERNET              ((LPC_ETHERNET_Type       *) LPC_ETHERNET_BASE)\r
+#define LPC_ATIMER                ((LPC_ATIMER_Type         *) LPC_ATIMER_BASE)\r
+#define LPC_REGFILE               ((LPC_REGFILE_Type        *) LPC_REGFILE_BASE)\r
+#define LPC_PMC                   ((LPC_PMC_Type            *) LPC_PMC_BASE)\r
+#define LPC_CREG                  ((LPC_CREG_Type           *) LPC_CREG_BASE)\r
+#define LPC_EVENTROUTER           ((LPC_EVENTROUTER_Type    *) LPC_EVENTROUTER_BASE)\r
+#define LPC_RTC                   ((LPC_RTC_Type            *) LPC_RTC_BASE)\r
+#define LPC_CGU                   ((LPC_CGU_Type            *) LPC_CGU_BASE)\r
+#define LPC_CCU1                  ((LPC_CCU1_Type           *) LPC_CCU1_BASE)\r
+#define LPC_CCU2                  ((LPC_CCU2_Type           *) LPC_CCU2_BASE)\r
+#define LPC_RGU                   ((LPC_RGU_Type            *) LPC_RGU_BASE)\r
+#define LPC_WWDT                  ((LPC_WWDT_Type           *) LPC_WWDT_BASE)\r
+#define LPC_USART0                ((LPC_USARTn_Type         *) LPC_USART0_BASE)\r
+#define LPC_USART2                ((LPC_USARTn_Type         *) LPC_USART2_BASE)\r
+#define LPC_USART3                ((LPC_USARTn_Type         *) LPC_USART3_BASE)\r
+#define LPC_UART1                 ((LPC_UART1_Type          *) LPC_UART1_BASE)\r
+#define LPC_SSP0                  ((LPC_SSPn_Type           *) LPC_SSP0_BASE)\r
+#define LPC_SSP1                  ((LPC_SSPn_Type           *) LPC_SSP1_BASE)\r
+#define LPC_TIMER0                ((LPC_TIMERn_Type         *) LPC_TIMER0_BASE)\r
+#define LPC_TIMER1                ((LPC_TIMERn_Type         *) LPC_TIMER1_BASE)\r
+#define LPC_TIMER2                ((LPC_TIMERn_Type         *) LPC_TIMER2_BASE)\r
+#define LPC_TIMER3                ((LPC_TIMERn_Type         *) LPC_TIMER3_BASE)\r
+#define LPC_SCU                   ((LPC_SCU_Type            *) LPC_SCU_BASE)\r
+#define LPC_GPIO_PIN_INT          ((LPC_GPIO_PIN_INT_Type   *) LPC_GPIO_PIN_INT_BASE)\r
+#define LPC_GPIO_GROUP_INT0       ((LPC_GPIO_GROUP_INTn_Type*) LPC_GPIO_GROUP_INT0_BASE)\r
+#define LPC_GPIO_GROUP_INT1       ((LPC_GPIO_GROUP_INTn_Type*) LPC_GPIO_GROUP_INT1_BASE)\r
+#define LPC_MCPWM                 ((LPC_MCPWM_Type          *) LPC_MCPWM_BASE)\r
+#define LPC_I2C0                  ((LPC_I2Cn_Type           *) LPC_I2C0_BASE)\r
+#define LPC_I2C1                  ((LPC_I2Cn_Type           *) LPC_I2C1_BASE)\r
+#define LPC_I2S0                  ((LPC_I2Sn_Type           *) LPC_I2S0_BASE)\r
+#define LPC_I2S1                  ((LPC_I2Sn_Type           *) LPC_I2S1_BASE)\r
+#define LPC_C_CAN1                ((LPC_C_CANn_Type         *) LPC_C_CAN1_BASE)\r
+#define LPC_RITIMER               ((LPC_RITIMER_Type        *) LPC_RITIMER_BASE)\r
+#define LPC_QEI                   ((LPC_QEI_Type            *) LPC_QEI_BASE)\r
+#define LPC_GIMA                  ((LPC_GIMA_Type           *) LPC_GIMA_BASE)\r
+#define LPC_DAC                   ((LPC_DAC_Type            *) LPC_DAC_BASE)\r
+#define LPC_C_CAN0                ((LPC_C_CANn_Type         *) LPC_C_CAN0_BASE)\r
+#define LPC_ADC0                  ((LPC_ADCn_Type           *) LPC_ADC0_BASE)\r
+#define LPC_ADC1                  ((LPC_ADCn_Type           *) LPC_ADC1_BASE)\r
+#define LPC_GPIO_PORT             ((LPC_GPIO_PORT_Type      *) LPC_GPIO_PORT_BASE)\r
+\r
+\r
+\r
+/** @} */ /* End of group Device_Peripheral_Registers */\r
+/** @} */ /* End of group LPC18xx */\r
+/** @} */ /* End of group (null) */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif  // __LPC18XX_H__\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cm3.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cm3.h
new file mode 100644 (file)
index 0000000..c15e10a
--- /dev/null
@@ -0,0 +1,1236 @@
+/**************************************************************************//**\r
+ * @file     core_cm3.h\r
+ * @brief    CMSIS Cortex-M3 Core Peripheral Access Layer Header File\r
+ * @version  V2.10\r
+ * @date     19. July 2011\r
+ *\r
+ * @note\r
+ * Copyright (C) 2009-2011 ARM Limited. All rights reserved.\r
+ *\r
+ * @par\r
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M\r
+ * processor based microcontrollers.  This file can be freely distributed\r
+ * within development tools that are supporting such ARM based processors.\r
+ *\r
+ * @par\r
+ * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
+ *\r
+ ******************************************************************************/\r
+#if defined ( __ICCARM__ )\r
+ #pragma system_include  /* treat file as system include file for MISRA check */\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+ extern "C" {\r
+#endif\r
+\r
+#ifndef __CORE_CM3_H_GENERIC\r
+#define __CORE_CM3_H_GENERIC\r
+\r
+\r
+/** \mainpage CMSIS Cortex-M3\r
+\r
+  This documentation describes the CMSIS Cortex-M Core Peripheral Access Layer.\r
+  It consists of:\r
+\r
+     - Cortex-M Core Register Definitions\r
+     - Cortex-M functions\r
+     - Cortex-M instructions\r
+\r
+  The CMSIS Cortex-M3 Core Peripheral Access Layer contains C and assembly functions that ease\r
+  access to the Cortex-M Core\r
+ */\r
+\r
+/** \defgroup CMSIS_MISRA_Exceptions  CMSIS MISRA-C:2004 Compliance Exceptions\r
+  CMSIS violates following MISRA-C2004 Rules:\r
+  \r
+   - Violates MISRA 2004 Required Rule 8.5, object/function definition in header file.<br>\r
+     Function definitions in header files are used to allow 'inlining'. \r
+\r
+   - Violates MISRA 2004 Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>\r
+     Unions are used for effective representation of core registers.\r
+   \r
+   - Violates MISRA 2004 Advisory Rule 19.7, Function-like macro defined.<br>\r
+     Function-like macros are used to allow more efficient code. \r
+\r
+ */\r
+\r
+\r
+/*******************************************************************************\r
+ *                 CMSIS definitions\r
+ ******************************************************************************/\r
+/** \defgroup CMSIS_core_definitions CMSIS Core Definitions\r
+  This file defines all structures and symbols for CMSIS core:\r
+   - CMSIS version number\r
+   - Cortex-M core\r
+   - Cortex-M core Revision Number\r
+  @{\r
+ */\r
+\r
+/*  CMSIS CM3 definitions */\r
+#define __CM3_CMSIS_VERSION_MAIN  (0x02)                                                       /*!< [31:16] CMSIS HAL main version */\r
+#define __CM3_CMSIS_VERSION_SUB   (0x10)                                                       /*!< [15:0]  CMSIS HAL sub version  */\r
+#define __CM3_CMSIS_VERSION       ((__CM3_CMSIS_VERSION_MAIN << 16) | __CM3_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number       */\r
+\r
+#define __CORTEX_M                (0x03)                                                       /*!< Cortex core                    */\r
+\r
+\r
+#if   defined ( __CC_ARM )\r
+  #define __ASM            __asm                                      /*!< asm keyword for ARM Compiler          */\r
+  #define __INLINE         __inline                                   /*!< inline keyword for ARM Compiler       */\r
+\r
+#elif defined ( __ICCARM__ )\r
+  #define __ASM           __asm                                       /*!< asm keyword for IAR Compiler          */\r
+  #define __INLINE        inline                                      /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */\r
+\r
+#elif defined ( __GNUC__ )\r
+  #define __ASM            __asm                                      /*!< asm keyword for GNU Compiler          */\r
+  #define __INLINE         inline                                     /*!< inline keyword for GNU Compiler       */\r
+\r
+#elif defined ( __TASKING__ )\r
+  #define __ASM            __asm                                      /*!< asm keyword for TASKING Compiler      */\r
+  #define __INLINE         inline                                     /*!< inline keyword for TASKING Compiler   */\r
+\r
+#endif\r
+\r
+/*!< __FPU_USED to be checked prior to making use of FPU specific registers and functions */\r
+#define __FPU_USED       0\r
+\r
+#if defined ( __CC_ARM )\r
+  #if defined __TARGET_FPU_VFP\r
+    #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+#elif defined ( __ICCARM__ )\r
+  #if defined __ARMVFP__\r
+    #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __GNUC__ )\r
+  #if defined (__VFP_FP__) && !defined(__SOFTFP__)\r
+    #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"\r
+  #endif\r
+\r
+#elif defined ( __TASKING__ )\r
+    /* add preprocessor checks */\r
+#endif\r
+\r
+#include <stdint.h>                      /*!< standard types definitions                      */\r
+#include "core_cmInstr.h"                /*!< Core Instruction Access                         */\r
+#include "core_cmFunc.h"                 /*!< Core Function Access                            */\r
+\r
+#endif /* __CORE_CM3_H_GENERIC */\r
+\r
+#ifndef __CMSIS_GENERIC\r
+\r
+#ifndef __CORE_CM3_H_DEPENDANT\r
+#define __CORE_CM3_H_DEPENDANT\r
+\r
+/* check device defines and use defaults */\r
+#if defined __CHECK_DEVICE_DEFINES\r
+  #ifndef __CM3_REV\r
+    #define __CM3_REV               0x0200\r
+    #warning "__CM3_REV not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __MPU_PRESENT\r
+    #define __MPU_PRESENT             0\r
+    #warning "__MPU_PRESENT not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __NVIC_PRIO_BITS\r
+    #define __NVIC_PRIO_BITS          4\r
+    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"\r
+  #endif\r
+\r
+  #ifndef __Vendor_SysTickConfig\r
+    #define __Vendor_SysTickConfig    0\r
+    #warning "__Vendor_SysTickConfig not defined in device header file; using default!"\r
+  #endif\r
+#endif\r
+\r
+/* IO definitions (access restrictions to peripheral registers) */\r
+#ifdef __cplusplus\r
+  #define   __I     volatile             /*!< defines 'read only' permissions                 */\r
+#else\r
+  #define   __I     volatile const       /*!< defines 'read only' permissions                 */\r
+#endif\r
+#define     __O     volatile             /*!< defines 'write only' permissions                */\r
+#define     __IO    volatile             /*!< defines 'read / write' permissions              */\r
+\r
+/*@} end of group CMSIS_core_definitions */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                 Register Abstraction\r
+ ******************************************************************************/\r
+/** \defgroup CMSIS_core_register CMSIS Core Register\r
+  Core Register contain:\r
+  - Core Register\r
+  - Core NVIC Register\r
+  - Core SCB Register\r
+  - Core SysTick Register\r
+  - Core Debug Register\r
+  - Core MPU Register\r
+*/\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_CORE CMSIS Core\r
+  Type definitions for the Cortex-M Core Registers\r
+  @{\r
+ */\r
+\r
+/** \brief  Union type to access the Application Program Status Register (APSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+#if (__CORTEX_M != 0x04)\r
+    uint32_t _reserved0:27;              /*!< bit:  0..26  Reserved                           */\r
+#else\r
+    uint32_t _reserved0:16;              /*!< bit:  0..15  Reserved                           */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags        */\r
+    uint32_t _reserved1:7;               /*!< bit: 20..26  Reserved                           */\r
+#endif\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag          */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag       */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag          */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag           */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag       */\r
+  } b;                                   /*!< Structure used for bit  access                  */\r
+  uint32_t w;                            /*!< Type      used for word access                  */\r
+} APSR_Type;\r
+\r
+\r
+/** \brief  Union type to access the Interrupt Program Status Register (IPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number                   */\r
+    uint32_t _reserved0:23;              /*!< bit:  9..31  Reserved                           */\r
+  } b;                                   /*!< Structure used for bit  access                  */\r
+  uint32_t w;                            /*!< Type      used for word access                  */\r
+} IPSR_Type;\r
+\r
+\r
+/** \brief  Union type to access the Special-Purpose Program Status Registers (xPSR).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number                   */\r
+#if (__CORTEX_M != 0x04)\r
+    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved                           */\r
+#else\r
+    uint32_t _reserved0:7;               /*!< bit:  9..15  Reserved                           */\r
+    uint32_t GE:4;                       /*!< bit: 16..19  Greater than or Equal flags        */\r
+    uint32_t _reserved1:4;               /*!< bit: 20..23  Reserved                           */\r
+#endif\r
+    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0)          */\r
+    uint32_t IT:2;                       /*!< bit: 25..26  saved IT state   (read 0)          */\r
+    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag          */\r
+    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag       */\r
+    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag          */\r
+    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag           */\r
+    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag       */\r
+  } b;                                   /*!< Structure used for bit  access                  */\r
+  uint32_t w;                            /*!< Type      used for word access                  */\r
+} xPSR_Type;\r
+\r
+\r
+/** \brief  Union type to access the Control Registers (CONTROL).\r
+ */\r
+typedef union\r
+{\r
+  struct\r
+  {\r
+    uint32_t nPRIV:1;                    /*!< bit:      0  Execution privilege in Thread mode */\r
+    uint32_t SPSEL:1;                    /*!< bit:      1  Stack to be used                   */\r
+    uint32_t FPCA:1;                     /*!< bit:      2  FP extension active flag           */\r
+    uint32_t _reserved0:29;              /*!< bit:  3..31  Reserved                           */\r
+  } b;                                   /*!< Structure used for bit  access                  */\r
+  uint32_t w;                            /*!< Type      used for word access                  */\r
+} CONTROL_Type;\r
+\r
+/*@} end of group CMSIS_CORE */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_NVIC CMSIS NVIC\r
+  Type definitions for the Cortex-M NVIC Registers\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the Nested Vectored Interrupt Controller (NVIC).\r
+ */\r
+typedef struct\r
+{\r
+  __IO uint32_t ISER[8];                 /*!< Offset: 0x000 (R/W)  Interrupt Set Enable Register           */\r
+       uint32_t RESERVED0[24];\r
+  __IO uint32_t ICER[8];                 /*!< Offset: 0x080 (R/W)  Interrupt Clear Enable Register         */\r
+       uint32_t RSERVED1[24];\r
+  __IO uint32_t ISPR[8];                 /*!< Offset: 0x100 (R/W)  Interrupt Set Pending Register          */\r
+       uint32_t RESERVED2[24];\r
+  __IO uint32_t ICPR[8];                 /*!< Offset: 0x180 (R/W)  Interrupt Clear Pending Register        */\r
+       uint32_t RESERVED3[24];\r
+  __IO uint32_t IABR[8];                 /*!< Offset: 0x200 (R/W)  Interrupt Active bit Register           */\r
+       uint32_t RESERVED4[56];\r
+  __IO uint8_t  IP[240];                 /*!< Offset: 0x300 (R/W)  Interrupt Priority Register (8Bit wide) */\r
+       uint32_t RESERVED5[644];\r
+  __O  uint32_t STIR;                    /*!< Offset: 0xE00 ( /W)  Software Trigger Interrupt Register     */\r
+}  NVIC_Type;\r
+\r
+/* Software Triggered Interrupt Register Definitions */\r
+#define NVIC_STIR_INTID_Pos                 0                                          /*!< STIR: INTLINESNUM Position */\r
+#define NVIC_STIR_INTID_Msk                (0x1FFUL << NVIC_STIR_INTID_Pos)            /*!< STIR: INTLINESNUM Mask */\r
+\r
+/*@} end of group CMSIS_NVIC */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_SCB CMSIS SCB\r
+  Type definitions for the Cortex-M System Control Block Registers\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the System Control Block (SCB).\r
+ */\r
+typedef struct\r
+{\r
+  __I  uint32_t CPUID;                   /*!< Offset: 0x000 (R/ )  CPUID Base Register                                   */\r
+  __IO uint32_t ICSR;                    /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register                  */\r
+  __IO uint32_t VTOR;                    /*!< Offset: 0x008 (R/W)  Vector Table Offset Register                          */\r
+  __IO uint32_t AIRCR;                   /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register      */\r
+  __IO uint32_t SCR;                     /*!< Offset: 0x010 (R/W)  System Control Register                               */\r
+  __IO uint32_t CCR;                     /*!< Offset: 0x014 (R/W)  Configuration Control Register                        */\r
+  __IO uint8_t  SHP[12];                 /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */\r
+  __IO uint32_t SHCSR;                   /*!< Offset: 0x024 (R/W)  System Handler Control and State Register             */\r
+  __IO uint32_t CFSR;                    /*!< Offset: 0x028 (R/W)  Configurable Fault Status Register                    */\r
+  __IO uint32_t HFSR;                    /*!< Offset: 0x02C (R/W)  HardFault Status Register                             */\r
+  __IO uint32_t DFSR;                    /*!< Offset: 0x030 (R/W)  Debug Fault Status Register                           */\r
+  __IO uint32_t MMFAR;                   /*!< Offset: 0x034 (R/W)  MemManage Fault Address Register                      */\r
+  __IO uint32_t BFAR;                    /*!< Offset: 0x038 (R/W)  BusFault Address Register                             */\r
+  __IO uint32_t AFSR;                    /*!< Offset: 0x03C (R/W)  Auxiliary Fault Status Register                       */\r
+  __I  uint32_t PFR[2];                  /*!< Offset: 0x040 (R/ )  Processor Feature Register                            */\r
+  __I  uint32_t DFR;                     /*!< Offset: 0x048 (R/ )  Debug Feature Register                                */\r
+  __I  uint32_t ADR;                     /*!< Offset: 0x04C (R/ )  Auxiliary Feature Register                            */\r
+  __I  uint32_t MMFR[4];                 /*!< Offset: 0x050 (R/ )  Memory Model Feature Register                         */\r
+  __I  uint32_t ISAR[5];                 /*!< Offset: 0x060 (R/ )  Instruction Set Attributes Register                   */\r
+       uint32_t RESERVED0[5];\r
+  __IO uint32_t CPACR;                   /*!< Offset: 0x088 (R/W)  Coprocessor Access Control Register                   */\r
+} SCB_Type;\r
+\r
+/* SCB CPUID Register Definitions */\r
+#define SCB_CPUID_IMPLEMENTER_Pos          24                                             /*!< SCB CPUID: IMPLEMENTER Position */\r
+#define SCB_CPUID_IMPLEMENTER_Msk          (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos)          /*!< SCB CPUID: IMPLEMENTER Mask */\r
+\r
+#define SCB_CPUID_VARIANT_Pos              20                                             /*!< SCB CPUID: VARIANT Position */\r
+#define SCB_CPUID_VARIANT_Msk              (0xFUL << SCB_CPUID_VARIANT_Pos)               /*!< SCB CPUID: VARIANT Mask */\r
+\r
+#define SCB_CPUID_ARCHITECTURE_Pos         16                                             /*!< SCB CPUID: ARCHITECTURE Position */\r
+#define SCB_CPUID_ARCHITECTURE_Msk         (0xFUL << SCB_CPUID_ARCHITECTURE_Pos)          /*!< SCB CPUID: ARCHITECTURE Mask */\r
+\r
+#define SCB_CPUID_PARTNO_Pos                4                                             /*!< SCB CPUID: PARTNO Position */\r
+#define SCB_CPUID_PARTNO_Msk               (0xFFFUL << SCB_CPUID_PARTNO_Pos)              /*!< SCB CPUID: PARTNO Mask */\r
+\r
+#define SCB_CPUID_REVISION_Pos              0                                             /*!< SCB CPUID: REVISION Position */\r
+#define SCB_CPUID_REVISION_Msk             (0xFUL << SCB_CPUID_REVISION_Pos)              /*!< SCB CPUID: REVISION Mask */\r
+\r
+/* SCB Interrupt Control State Register Definitions */\r
+#define SCB_ICSR_NMIPENDSET_Pos            31                                             /*!< SCB ICSR: NMIPENDSET Position */\r
+#define SCB_ICSR_NMIPENDSET_Msk            (1UL << SCB_ICSR_NMIPENDSET_Pos)               /*!< SCB ICSR: NMIPENDSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVSET_Pos             28                                             /*!< SCB ICSR: PENDSVSET Position */\r
+#define SCB_ICSR_PENDSVSET_Msk             (1UL << SCB_ICSR_PENDSVSET_Pos)                /*!< SCB ICSR: PENDSVSET Mask */\r
+\r
+#define SCB_ICSR_PENDSVCLR_Pos             27                                             /*!< SCB ICSR: PENDSVCLR Position */\r
+#define SCB_ICSR_PENDSVCLR_Msk             (1UL << SCB_ICSR_PENDSVCLR_Pos)                /*!< SCB ICSR: PENDSVCLR Mask */\r
+\r
+#define SCB_ICSR_PENDSTSET_Pos             26                                             /*!< SCB ICSR: PENDSTSET Position */\r
+#define SCB_ICSR_PENDSTSET_Msk             (1UL << SCB_ICSR_PENDSTSET_Pos)                /*!< SCB ICSR: PENDSTSET Mask */\r
+\r
+#define SCB_ICSR_PENDSTCLR_Pos             25                                             /*!< SCB ICSR: PENDSTCLR Position */\r
+#define SCB_ICSR_PENDSTCLR_Msk             (1UL << SCB_ICSR_PENDSTCLR_Pos)                /*!< SCB ICSR: PENDSTCLR Mask */\r
+\r
+#define SCB_ICSR_ISRPREEMPT_Pos            23                                             /*!< SCB ICSR: ISRPREEMPT Position */\r
+#define SCB_ICSR_ISRPREEMPT_Msk            (1UL << SCB_ICSR_ISRPREEMPT_Pos)               /*!< SCB ICSR: ISRPREEMPT Mask */\r
+\r
+#define SCB_ICSR_ISRPENDING_Pos            22                                             /*!< SCB ICSR: ISRPENDING Position */\r
+#define SCB_ICSR_ISRPENDING_Msk            (1UL << SCB_ICSR_ISRPENDING_Pos)               /*!< SCB ICSR: ISRPENDING Mask */\r
+\r
+#define SCB_ICSR_VECTPENDING_Pos           12                                             /*!< SCB ICSR: VECTPENDING Position */\r
+#define SCB_ICSR_VECTPENDING_Msk           (0x1FFUL << SCB_ICSR_VECTPENDING_Pos)          /*!< SCB ICSR: VECTPENDING Mask */\r
+\r
+#define SCB_ICSR_RETTOBASE_Pos             11                                             /*!< SCB ICSR: RETTOBASE Position */\r
+#define SCB_ICSR_RETTOBASE_Msk             (1UL << SCB_ICSR_RETTOBASE_Pos)                /*!< SCB ICSR: RETTOBASE Mask */\r
+\r
+#define SCB_ICSR_VECTACTIVE_Pos             0                                             /*!< SCB ICSR: VECTACTIVE Position */\r
+#define SCB_ICSR_VECTACTIVE_Msk            (0x1FFUL << SCB_ICSR_VECTACTIVE_Pos)           /*!< SCB ICSR: VECTACTIVE Mask */\r
+\r
+/* SCB Vector Table Offset Register Definitions */\r
+#define SCB_VTOR_TBLOFF_Pos                 7                                             /*!< SCB VTOR: TBLOFF Position */\r
+#define SCB_VTOR_TBLOFF_Msk                (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos)           /*!< SCB VTOR: TBLOFF Mask */\r
+\r
+/* SCB Application Interrupt and Reset Control Register Definitions */\r
+#define SCB_AIRCR_VECTKEY_Pos              16                                             /*!< SCB AIRCR: VECTKEY Position */\r
+#define SCB_AIRCR_VECTKEY_Msk              (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)            /*!< SCB AIRCR: VECTKEY Mask */\r
+\r
+#define SCB_AIRCR_VECTKEYSTAT_Pos          16                                             /*!< SCB AIRCR: VECTKEYSTAT Position */\r
+#define SCB_AIRCR_VECTKEYSTAT_Msk          (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos)        /*!< SCB AIRCR: VECTKEYSTAT Mask */\r
+\r
+#define SCB_AIRCR_ENDIANESS_Pos            15                                             /*!< SCB AIRCR: ENDIANESS Position */\r
+#define SCB_AIRCR_ENDIANESS_Msk            (1UL << SCB_AIRCR_ENDIANESS_Pos)               /*!< SCB AIRCR: ENDIANESS Mask */\r
+\r
+#define SCB_AIRCR_PRIGROUP_Pos              8                                             /*!< SCB AIRCR: PRIGROUP Position */\r
+#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)                /*!< SCB AIRCR: PRIGROUP Mask */\r
+\r
+#define SCB_AIRCR_SYSRESETREQ_Pos           2                                             /*!< SCB AIRCR: SYSRESETREQ Position */\r
+#define SCB_AIRCR_SYSRESETREQ_Msk          (1UL << SCB_AIRCR_SYSRESETREQ_Pos)             /*!< SCB AIRCR: SYSRESETREQ Mask */\r
+\r
+#define SCB_AIRCR_VECTCLRACTIVE_Pos         1                                             /*!< SCB AIRCR: VECTCLRACTIVE Position */\r
+#define SCB_AIRCR_VECTCLRACTIVE_Msk        (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos)           /*!< SCB AIRCR: VECTCLRACTIVE Mask */\r
+\r
+#define SCB_AIRCR_VECTRESET_Pos             0                                             /*!< SCB AIRCR: VECTRESET Position */\r
+#define SCB_AIRCR_VECTRESET_Msk            (1UL << SCB_AIRCR_VECTRESET_Pos)               /*!< SCB AIRCR: VECTRESET Mask */\r
+\r
+/* SCB System Control Register Definitions */\r
+#define SCB_SCR_SEVONPEND_Pos               4                                             /*!< SCB SCR: SEVONPEND Position */\r
+#define SCB_SCR_SEVONPEND_Msk              (1UL << SCB_SCR_SEVONPEND_Pos)                 /*!< SCB SCR: SEVONPEND Mask */\r
+\r
+#define SCB_SCR_SLEEPDEEP_Pos               2                                             /*!< SCB SCR: SLEEPDEEP Position */\r
+#define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */\r
+\r
+#define SCB_SCR_SLEEPONEXIT_Pos             1                                             /*!< SCB SCR: SLEEPONEXIT Position */\r
+#define SCB_SCR_SLEEPONEXIT_Msk            (1UL << SCB_SCR_SLEEPONEXIT_Pos)               /*!< SCB SCR: SLEEPONEXIT Mask */\r
+\r
+/* SCB Configuration Control Register Definitions */\r
+#define SCB_CCR_STKALIGN_Pos                9                                             /*!< SCB CCR: STKALIGN Position */\r
+#define SCB_CCR_STKALIGN_Msk               (1UL << SCB_CCR_STKALIGN_Pos)                  /*!< SCB CCR: STKALIGN Mask */\r
+\r
+#define SCB_CCR_BFHFNMIGN_Pos               8                                             /*!< SCB CCR: BFHFNMIGN Position */\r
+#define SCB_CCR_BFHFNMIGN_Msk              (1UL << SCB_CCR_BFHFNMIGN_Pos)                 /*!< SCB CCR: BFHFNMIGN Mask */\r
+\r
+#define SCB_CCR_DIV_0_TRP_Pos               4                                             /*!< SCB CCR: DIV_0_TRP Position */\r
+#define SCB_CCR_DIV_0_TRP_Msk              (1UL << SCB_CCR_DIV_0_TRP_Pos)                 /*!< SCB CCR: DIV_0_TRP Mask */\r
+\r
+#define SCB_CCR_UNALIGN_TRP_Pos             3                                             /*!< SCB CCR: UNALIGN_TRP Position */\r
+#define SCB_CCR_UNALIGN_TRP_Msk            (1UL << SCB_CCR_UNALIGN_TRP_Pos)               /*!< SCB CCR: UNALIGN_TRP Mask */\r
+\r
+#define SCB_CCR_USERSETMPEND_Pos            1                                             /*!< SCB CCR: USERSETMPEND Position */\r
+#define SCB_CCR_USERSETMPEND_Msk           (1UL << SCB_CCR_USERSETMPEND_Pos)              /*!< SCB CCR: USERSETMPEND Mask */\r
+\r
+#define SCB_CCR_NONBASETHRDENA_Pos          0                                             /*!< SCB CCR: NONBASETHRDENA Position */\r
+#define SCB_CCR_NONBASETHRDENA_Msk         (1UL << SCB_CCR_NONBASETHRDENA_Pos)            /*!< SCB CCR: NONBASETHRDENA Mask */\r
+\r
+/* SCB System Handler Control and State Register Definitions */\r
+#define SCB_SHCSR_USGFAULTENA_Pos          18                                             /*!< SCB SHCSR: USGFAULTENA Position */\r
+#define SCB_SHCSR_USGFAULTENA_Msk          (1UL << SCB_SHCSR_USGFAULTENA_Pos)             /*!< SCB SHCSR: USGFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTENA_Pos          17                                             /*!< SCB SHCSR: BUSFAULTENA Position */\r
+#define SCB_SHCSR_BUSFAULTENA_Msk          (1UL << SCB_SHCSR_BUSFAULTENA_Pos)             /*!< SCB SHCSR: BUSFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTENA_Pos          16                                             /*!< SCB SHCSR: MEMFAULTENA Position */\r
+#define SCB_SHCSR_MEMFAULTENA_Msk          (1UL << SCB_SHCSR_MEMFAULTENA_Pos)             /*!< SCB SHCSR: MEMFAULTENA Mask */\r
+\r
+#define SCB_SHCSR_SVCALLPENDED_Pos         15                                             /*!< SCB SHCSR: SVCALLPENDED Position */\r
+#define SCB_SHCSR_SVCALLPENDED_Msk         (1UL << SCB_SHCSR_SVCALLPENDED_Pos)            /*!< SCB SHCSR: SVCALLPENDED Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTPENDED_Pos       14                                             /*!< SCB SHCSR: BUSFAULTPENDED Position */\r
+#define SCB_SHCSR_BUSFAULTPENDED_Msk       (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos)          /*!< SCB SHCSR: BUSFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTPENDED_Pos       13                                             /*!< SCB SHCSR: MEMFAULTPENDED Position */\r
+#define SCB_SHCSR_MEMFAULTPENDED_Msk       (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos)          /*!< SCB SHCSR: MEMFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTPENDED_Pos       12                                             /*!< SCB SHCSR: USGFAULTPENDED Position */\r
+#define SCB_SHCSR_USGFAULTPENDED_Msk       (1UL << SCB_SHCSR_USGFAULTPENDED_Pos)          /*!< SCB SHCSR: USGFAULTPENDED Mask */\r
+\r
+#define SCB_SHCSR_SYSTICKACT_Pos           11                                             /*!< SCB SHCSR: SYSTICKACT Position */\r
+#define SCB_SHCSR_SYSTICKACT_Msk           (1UL << SCB_SHCSR_SYSTICKACT_Pos)              /*!< SCB SHCSR: SYSTICKACT Mask */\r
+\r
+#define SCB_SHCSR_PENDSVACT_Pos            10                                             /*!< SCB SHCSR: PENDSVACT Position */\r
+#define SCB_SHCSR_PENDSVACT_Msk            (1UL << SCB_SHCSR_PENDSVACT_Pos)               /*!< SCB SHCSR: PENDSVACT Mask */\r
+\r
+#define SCB_SHCSR_MONITORACT_Pos            8                                             /*!< SCB SHCSR: MONITORACT Position */\r
+#define SCB_SHCSR_MONITORACT_Msk           (1UL << SCB_SHCSR_MONITORACT_Pos)              /*!< SCB SHCSR: MONITORACT Mask */\r
+\r
+#define SCB_SHCSR_SVCALLACT_Pos             7                                             /*!< SCB SHCSR: SVCALLACT Position */\r
+#define SCB_SHCSR_SVCALLACT_Msk            (1UL << SCB_SHCSR_SVCALLACT_Pos)               /*!< SCB SHCSR: SVCALLACT Mask */\r
+\r
+#define SCB_SHCSR_USGFAULTACT_Pos           3                                             /*!< SCB SHCSR: USGFAULTACT Position */\r
+#define SCB_SHCSR_USGFAULTACT_Msk          (1UL << SCB_SHCSR_USGFAULTACT_Pos)             /*!< SCB SHCSR: USGFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_BUSFAULTACT_Pos           1                                             /*!< SCB SHCSR: BUSFAULTACT Position */\r
+#define SCB_SHCSR_BUSFAULTACT_Msk          (1UL << SCB_SHCSR_BUSFAULTACT_Pos)             /*!< SCB SHCSR: BUSFAULTACT Mask */\r
+\r
+#define SCB_SHCSR_MEMFAULTACT_Pos           0                                             /*!< SCB SHCSR: MEMFAULTACT Position */\r
+#define SCB_SHCSR_MEMFAULTACT_Msk          (1UL << SCB_SHCSR_MEMFAULTACT_Pos)             /*!< SCB SHCSR: MEMFAULTACT Mask */\r
+\r
+/* SCB Configurable Fault Status Registers Definitions */\r
+#define SCB_CFSR_USGFAULTSR_Pos            16                                             /*!< SCB CFSR: Usage Fault Status Register Position */\r
+#define SCB_CFSR_USGFAULTSR_Msk            (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos)          /*!< SCB CFSR: Usage Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_BUSFAULTSR_Pos             8                                             /*!< SCB CFSR: Bus Fault Status Register Position */\r
+#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */\r
+\r
+#define SCB_CFSR_MEMFAULTSR_Pos             0                                             /*!< SCB CFSR: Memory Manage Fault Status Register Position */\r
+#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL << SCB_CFSR_MEMFAULTSR_Pos)            /*!< SCB CFSR: Memory Manage Fault Status Register Mask */\r
+\r
+/* SCB Hard Fault Status Registers Definitions */\r
+#define SCB_HFSR_DEBUGEVT_Pos              31                                             /*!< SCB HFSR: DEBUGEVT Position */\r
+#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */\r
+\r
+#define SCB_HFSR_FORCED_Pos                30                                             /*!< SCB HFSR: FORCED Position */\r
+#define SCB_HFSR_FORCED_Msk                (1UL << SCB_HFSR_FORCED_Pos)                   /*!< SCB HFSR: FORCED Mask */\r
+\r
+#define SCB_HFSR_VECTTBL_Pos                1                                             /*!< SCB HFSR: VECTTBL Position */\r
+#define SCB_HFSR_VECTTBL_Msk               (1UL << SCB_HFSR_VECTTBL_Pos)                  /*!< SCB HFSR: VECTTBL Mask */\r
+\r
+/* SCB Debug Fault Status Register Definitions */\r
+#define SCB_DFSR_EXTERNAL_Pos               4                                             /*!< SCB DFSR: EXTERNAL Position */\r
+#define SCB_DFSR_EXTERNAL_Msk              (1UL << SCB_DFSR_EXTERNAL_Pos)                 /*!< SCB DFSR: EXTERNAL Mask */\r
+\r
+#define SCB_DFSR_VCATCH_Pos                 3                                             /*!< SCB DFSR: VCATCH Position */\r
+#define SCB_DFSR_VCATCH_Msk                (1UL << SCB_DFSR_VCATCH_Pos)                   /*!< SCB DFSR: VCATCH Mask */\r
+\r
+#define SCB_DFSR_DWTTRAP_Pos                2                                             /*!< SCB DFSR: DWTTRAP Position */\r
+#define SCB_DFSR_DWTTRAP_Msk               (1UL << SCB_DFSR_DWTTRAP_Pos)                  /*!< SCB DFSR: DWTTRAP Mask */\r
+\r
+#define SCB_DFSR_BKPT_Pos                   1                                             /*!< SCB DFSR: BKPT Position */\r
+#define SCB_DFSR_BKPT_Msk                  (1UL << SCB_DFSR_BKPT_Pos)                     /*!< SCB DFSR: BKPT Mask */\r
+\r
+#define SCB_DFSR_HALTED_Pos                 0                                             /*!< SCB DFSR: HALTED Position */\r
+#define SCB_DFSR_HALTED_Msk                (1UL << SCB_DFSR_HALTED_Pos)                   /*!< SCB DFSR: HALTED Mask */\r
+\r
+/*@} end of group CMSIS_SCB */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_SCnSCB CMSIS System Control and ID Register not in the SCB\r
+  Type definitions for the Cortex-M System Control and ID Register not in the SCB\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the System Control and ID Register not in the SCB.\r
+ */\r
+typedef struct\r
+{\r
+       uint32_t RESERVED0[1];\r
+  __I  uint32_t ICTR;                    /*!< Offset: 0x004 (R/ )  Interrupt Controller Type Register      */\r
+#if ((defined __CM3_REV) && (__CM3_REV >= 0x200))\r
+  __IO uint32_t ACTLR;                   /*!< Offset: 0x008 (R/W)  Auxiliary Control Register      */\r
+#else\r
+       uint32_t RESERVED1[1];\r
+#endif\r
+} SCnSCB_Type;\r
+\r
+/* Interrupt Controller Type Register Definitions */\r
+#define SCnSCB_ICTR_INTLINESNUM_Pos         0                                          /*!< ICTR: INTLINESNUM Position */\r
+#define SCnSCB_ICTR_INTLINESNUM_Msk        (0xFUL << SCnSCB_ICTR_INTLINESNUM_Pos)      /*!< ICTR: INTLINESNUM Mask */\r
+\r
+/* Auxiliary Control Register Definitions */\r
+\r
+#define SCnSCB_ACTLR_DISFOLD_Pos            2                                          /*!< ACTLR: DISFOLD Position */\r
+#define SCnSCB_ACTLR_DISFOLD_Msk           (1UL << SCnSCB_ACTLR_DISFOLD_Pos)           /*!< ACTLR: DISFOLD Mask */\r
+\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Pos         1                                          /*!< ACTLR: DISDEFWBUF Position */\r
+#define SCnSCB_ACTLR_DISDEFWBUF_Msk        (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos)        /*!< ACTLR: DISDEFWBUF Mask */\r
+\r
+#define SCnSCB_ACTLR_DISMCYCINT_Pos         0                                          /*!< ACTLR: DISMCYCINT Position */\r
+#define SCnSCB_ACTLR_DISMCYCINT_Msk        (1UL << SCnSCB_ACTLR_DISMCYCINT_Pos)        /*!< ACTLR: DISMCYCINT Mask */\r
+\r
+/*@} end of group CMSIS_SCnotSCB */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_SysTick CMSIS SysTick\r
+  Type definitions for the Cortex-M System Timer Registers\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the System Timer (SysTick).\r
+ */\r
+typedef struct\r
+{\r
+  __IO uint32_t CTRL;                    /*!< Offset: 0x000 (R/W)  SysTick Control and Status Register */\r
+  __IO uint32_t LOAD;                    /*!< Offset: 0x004 (R/W)  SysTick Reload Value Register       */\r
+  __IO uint32_t VAL;                     /*!< Offset: 0x008 (R/W)  SysTick Current Value Register      */\r
+  __I  uint32_t CALIB;                   /*!< Offset: 0x00C (R/ )  SysTick Calibration Register        */\r
+} SysTick_Type;\r
+\r
+/* SysTick Control / Status Register Definitions */\r
+#define SysTick_CTRL_COUNTFLAG_Pos         16                                             /*!< SysTick CTRL: COUNTFLAG Position */\r
+#define SysTick_CTRL_COUNTFLAG_Msk         (1UL << SysTick_CTRL_COUNTFLAG_Pos)            /*!< SysTick CTRL: COUNTFLAG Mask */\r
+\r
+#define SysTick_CTRL_CLKSOURCE_Pos          2                                             /*!< SysTick CTRL: CLKSOURCE Position */\r
+#define SysTick_CTRL_CLKSOURCE_Msk         (1UL << SysTick_CTRL_CLKSOURCE_Pos)            /*!< SysTick CTRL: CLKSOURCE Mask */\r
+\r
+#define SysTick_CTRL_TICKINT_Pos            1                                             /*!< SysTick CTRL: TICKINT Position */\r
+#define SysTick_CTRL_TICKINT_Msk           (1UL << SysTick_CTRL_TICKINT_Pos)              /*!< SysTick CTRL: TICKINT Mask */\r
+\r
+#define SysTick_CTRL_ENABLE_Pos             0                                             /*!< SysTick CTRL: ENABLE Position */\r
+#define SysTick_CTRL_ENABLE_Msk            (1UL << SysTick_CTRL_ENABLE_Pos)               /*!< SysTick CTRL: ENABLE Mask */\r
+\r
+/* SysTick Reload Register Definitions */\r
+#define SysTick_LOAD_RELOAD_Pos             0                                             /*!< SysTick LOAD: RELOAD Position */\r
+#define SysTick_LOAD_RELOAD_Msk            (0xFFFFFFUL << SysTick_LOAD_RELOAD_Pos)        /*!< SysTick LOAD: RELOAD Mask */\r
+\r
+/* SysTick Current Register Definitions */\r
+#define SysTick_VAL_CURRENT_Pos             0                                             /*!< SysTick VAL: CURRENT Position */\r
+#define SysTick_VAL_CURRENT_Msk            (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)        /*!< SysTick VAL: CURRENT Mask */\r
+\r
+/* SysTick Calibration Register Definitions */\r
+#define SysTick_CALIB_NOREF_Pos            31                                             /*!< SysTick CALIB: NOREF Position */\r
+#define SysTick_CALIB_NOREF_Msk            (1UL << SysTick_CALIB_NOREF_Pos)               /*!< SysTick CALIB: NOREF Mask */\r
+\r
+#define SysTick_CALIB_SKEW_Pos             30                                             /*!< SysTick CALIB: SKEW Position */\r
+#define SysTick_CALIB_SKEW_Msk             (1UL << SysTick_CALIB_SKEW_Pos)                /*!< SysTick CALIB: SKEW Mask */\r
+\r
+#define SysTick_CALIB_TENMS_Pos             0                                             /*!< SysTick CALIB: TENMS Position */\r
+#define SysTick_CALIB_TENMS_Msk            (0xFFFFFFUL << SysTick_VAL_CURRENT_Pos)        /*!< SysTick CALIB: TENMS Mask */\r
+\r
+/*@} end of group CMSIS_SysTick */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_ITM CMSIS ITM\r
+  Type definitions for the Cortex-M Instrumentation Trace Macrocell (ITM)\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the Instrumentation Trace Macrocell Register (ITM).\r
+ */\r
+typedef struct\r
+{\r
+  __O  union\r
+  {\r
+    __O  uint8_t    u8;                  /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 8-bit                   */\r
+    __O  uint16_t   u16;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 16-bit                  */\r
+    __O  uint32_t   u32;                 /*!< Offset: 0x000 ( /W)  ITM Stimulus Port 32-bit                  */\r
+  }  PORT [32];                          /*!< Offset: 0x000 ( /W)  ITM Stimulus Port Registers               */\r
+       uint32_t RESERVED0[864];\r
+  __IO uint32_t TER;                     /*!< Offset: 0xE00 (R/W)  ITM Trace Enable Register                 */\r
+       uint32_t RESERVED1[15];\r
+  __IO uint32_t TPR;                     /*!< Offset: 0xE40 (R/W)  ITM Trace Privilege Register              */\r
+       uint32_t RESERVED2[15];\r
+  __IO uint32_t TCR;                     /*!< Offset: 0xE80 (R/W)  ITM Trace Control Register                */\r
+} ITM_Type;\r
+\r
+/* ITM Trace Privilege Register Definitions */\r
+#define ITM_TPR_PRIVMASK_Pos                0                                          /*!< ITM TPR: PRIVMASK Position */\r
+#define ITM_TPR_PRIVMASK_Msk               (0xFUL << ITM_TPR_PRIVMASK_Pos)             /*!< ITM TPR: PRIVMASK Mask */\r
+\r
+/* ITM Trace Control Register Definitions */\r
+#define ITM_TCR_BUSY_Pos                   23                                          /*!< ITM TCR: BUSY Position */\r
+#define ITM_TCR_BUSY_Msk                   (1UL << ITM_TCR_BUSY_Pos)                   /*!< ITM TCR: BUSY Mask */\r
+\r
+#define ITM_TCR_TraceBusID_Pos             16                                          /*!< ITM TCR: ATBID Position */\r
+#define ITM_TCR_TraceBusID_Msk             (0x7FUL << ITM_TCR_TraceBusID_Pos)          /*!< ITM TCR: ATBID Mask */\r
+\r
+#define ITM_TCR_GTSFREQ_Pos                10                                          /*!< ITM TCR: Global timestamp frequency Position */\r
+#define ITM_TCR_GTSFREQ_Msk                (3UL << ITM_TCR_GTSFREQ_Pos)                /*!< ITM TCR: Global timestamp frequency Mask */\r
+\r
+#define ITM_TCR_TSPrescale_Pos              8                                          /*!< ITM TCR: TSPrescale Position */\r
+#define ITM_TCR_TSPrescale_Msk             (3UL << ITM_TCR_TSPrescale_Pos)             /*!< ITM TCR: TSPrescale Mask */\r
+\r
+#define ITM_TCR_SWOENA_Pos                  4                                          /*!< ITM TCR: SWOENA Position */\r
+#define ITM_TCR_SWOENA_Msk                 (1UL << ITM_TCR_SWOENA_Pos)                 /*!< ITM TCR: SWOENA Mask */\r
+\r
+#define ITM_TCR_TXENA_Pos                   3                                          /*!< ITM TCR: TXENA Position */\r
+#define ITM_TCR_TXENA_Msk                  (1UL << ITM_TCR_TXENA_Pos)                  /*!< ITM TCR: TXENA Mask */\r
+\r
+#define ITM_TCR_SYNCENA_Pos                 2                                          /*!< ITM TCR: SYNCENA Position */\r
+#define ITM_TCR_SYNCENA_Msk                (1UL << ITM_TCR_SYNCENA_Pos)                /*!< ITM TCR: SYNCENA Mask */\r
+\r
+#define ITM_TCR_TSENA_Pos                   1                                          /*!< ITM TCR: TSENA Position */\r
+#define ITM_TCR_TSENA_Msk                  (1UL << ITM_TCR_TSENA_Pos)                  /*!< ITM TCR: TSENA Mask */\r
+\r
+#define ITM_TCR_ITMENA_Pos                  0                                          /*!< ITM TCR: ITM Enable bit Position */\r
+#define ITM_TCR_ITMENA_Msk                 (1UL << ITM_TCR_ITMENA_Pos)                 /*!< ITM TCR: ITM Enable bit Mask */\r
+\r
+/*@}*/ /* end of group CMSIS_ITM */\r
+\r
+\r
+#if (__MPU_PRESENT == 1)\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_MPU CMSIS MPU\r
+  Type definitions for the Cortex-M Memory Protection Unit (MPU)\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the Memory Protection Unit (MPU).\r
+ */\r
+typedef struct\r
+{\r
+  __I  uint32_t TYPE;                    /*!< Offset: 0x000 (R/ )  MPU Type Register                              */\r
+  __IO uint32_t CTRL;                    /*!< Offset: 0x004 (R/W)  MPU Control Register                           */\r
+  __IO uint32_t RNR;                     /*!< Offset: 0x008 (R/W)  MPU Region RNRber Register                     */\r
+  __IO uint32_t RBAR;                    /*!< Offset: 0x00C (R/W)  MPU Region Base Address Register               */\r
+  __IO uint32_t RASR;                    /*!< Offset: 0x010 (R/W)  MPU Region Attribute and Size Register         */\r
+  __IO uint32_t RBAR_A1;                 /*!< Offset: 0x014 (R/W)  MPU Alias 1 Region Base Address Register       */\r
+  __IO uint32_t RASR_A1;                 /*!< Offset: 0x018 (R/W)  MPU Alias 1 Region Attribute and Size Register */\r
+  __IO uint32_t RBAR_A2;                 /*!< Offset: 0x01C (R/W)  MPU Alias 2 Region Base Address Register       */\r
+  __IO uint32_t RASR_A2;                 /*!< Offset: 0x020 (R/W)  MPU Alias 2 Region Attribute and Size Register */\r
+  __IO uint32_t RBAR_A3;                 /*!< Offset: 0x024 (R/W)  MPU Alias 3 Region Base Address Register       */\r
+  __IO uint32_t RASR_A3;                 /*!< Offset: 0x028 (R/W)  MPU Alias 3 Region Attribute and Size Register */\r
+} MPU_Type;\r
+\r
+/* MPU Type Register */\r
+#define MPU_TYPE_IREGION_Pos               16                                             /*!< MPU TYPE: IREGION Position */\r
+#define MPU_TYPE_IREGION_Msk               (0xFFUL << MPU_TYPE_IREGION_Pos)               /*!< MPU TYPE: IREGION Mask */\r
+\r
+#define MPU_TYPE_DREGION_Pos                8                                             /*!< MPU TYPE: DREGION Position */\r
+#define MPU_TYPE_DREGION_Msk               (0xFFUL << MPU_TYPE_DREGION_Pos)               /*!< MPU TYPE: DREGION Mask */\r
+\r
+#define MPU_TYPE_SEPARATE_Pos               0                                             /*!< MPU TYPE: SEPARATE Position */\r
+#define MPU_TYPE_SEPARATE_Msk              (1UL << MPU_TYPE_SEPARATE_Pos)                 /*!< MPU TYPE: SEPARATE Mask */\r
+\r
+/* MPU Control Register */\r
+#define MPU_CTRL_PRIVDEFENA_Pos             2                                             /*!< MPU CTRL: PRIVDEFENA Position */\r
+#define MPU_CTRL_PRIVDEFENA_Msk            (1UL << MPU_CTRL_PRIVDEFENA_Pos)               /*!< MPU CTRL: PRIVDEFENA Mask */\r
+\r
+#define MPU_CTRL_HFNMIENA_Pos               1                                             /*!< MPU CTRL: HFNMIENA Position */\r
+#define MPU_CTRL_HFNMIENA_Msk              (1UL << MPU_CTRL_HFNMIENA_Pos)                 /*!< MPU CTRL: HFNMIENA Mask */\r
+\r
+#define MPU_CTRL_ENABLE_Pos                 0                                             /*!< MPU CTRL: ENABLE Position */\r
+#define MPU_CTRL_ENABLE_Msk                (1UL << MPU_CTRL_ENABLE_Pos)                   /*!< MPU CTRL: ENABLE Mask */\r
+\r
+/* MPU Region Number Register */\r
+#define MPU_RNR_REGION_Pos                  0                                             /*!< MPU RNR: REGION Position */\r
+#define MPU_RNR_REGION_Msk                 (0xFFUL << MPU_RNR_REGION_Pos)                 /*!< MPU RNR: REGION Mask */\r
+\r
+/* MPU Region Base Address Register */\r
+#define MPU_RBAR_ADDR_Pos                   5                                             /*!< MPU RBAR: ADDR Position */\r
+#define MPU_RBAR_ADDR_Msk                  (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos)             /*!< MPU RBAR: ADDR Mask */\r
+\r
+#define MPU_RBAR_VALID_Pos                  4                                             /*!< MPU RBAR: VALID Position */\r
+#define MPU_RBAR_VALID_Msk                 (1UL << MPU_RBAR_VALID_Pos)                    /*!< MPU RBAR: VALID Mask */\r
+\r
+#define MPU_RBAR_REGION_Pos                 0                                             /*!< MPU RBAR: REGION Position */\r
+#define MPU_RBAR_REGION_Msk                (0xFUL << MPU_RBAR_REGION_Pos)                 /*!< MPU RBAR: REGION Mask */\r
+\r
+/* MPU Region Attribute and Size Register */\r
+#define MPU_RASR_ATTRS_Pos                 16                                             /*!< MPU RASR: MPU Region Attribute field Position */\r
+#define MPU_RASR_ATTRS_Msk                 (0xFFFFUL << MPU_RASR_ATTRS_Pos)               /*!< MPU RASR: MPU Region Attribute field Mask */\r
+\r
+#define MPU_RASR_SRD_Pos                    8                                             /*!< MPU RASR: Sub-Region Disable Position */\r
+#define MPU_RASR_SRD_Msk                   (0xFFUL << MPU_RASR_SRD_Pos)                   /*!< MPU RASR: Sub-Region Disable Mask */\r
+\r
+#define MPU_RASR_SIZE_Pos                   1                                             /*!< MPU RASR: Region Size Field Position */\r
+#define MPU_RASR_SIZE_Msk                  (0x1FUL << MPU_RASR_SIZE_Pos)                  /*!< MPU RASR: Region Size Field Mask */\r
+\r
+#define MPU_RASR_ENABLE_Pos                 0                                             /*!< MPU RASR: Region enable bit Position */\r
+#define MPU_RASR_ENABLE_Msk                (1UL << MPU_RASR_ENABLE_Pos)                   /*!< MPU RASR: Region enable bit Disable Mask */\r
+\r
+/*@} end of group CMSIS_MPU */\r
+#endif\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+    \defgroup CMSIS_CoreDebug CMSIS Core Debug\r
+  Type definitions for the Cortex-M Core Debug Registers\r
+  @{\r
+ */\r
+\r
+/** \brief  Structure type to access the Core Debug Register (CoreDebug).\r
+ */\r
+typedef struct\r
+{\r
+  __IO uint32_t DHCSR;                   /*!< Offset: 0x000 (R/W)  Debug Halting Control and Status Register    */\r
+  __O  uint32_t DCRSR;                   /*!< Offset: 0x004 ( /W)  Debug Core Register Selector Register        */\r
+  __IO uint32_t DCRDR;                   /*!< Offset: 0x008 (R/W)  Debug Core Register Data Register            */\r
+  __IO uint32_t DEMCR;                   /*!< Offset: 0x00C (R/W)  Debug Exception and Monitor Control Register */\r
+} CoreDebug_Type;\r
+\r
+/* Debug Halting Control and Status Register */\r
+#define CoreDebug_DHCSR_DBGKEY_Pos         16                                             /*!< CoreDebug DHCSR: DBGKEY Position */\r
+#define CoreDebug_DHCSR_DBGKEY_Msk         (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos)       /*!< CoreDebug DHCSR: DBGKEY Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RESET_ST_Pos     25                                             /*!< CoreDebug DHCSR: S_RESET_ST Position */\r
+#define CoreDebug_DHCSR_S_RESET_ST_Msk     (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos)        /*!< CoreDebug DHCSR: S_RESET_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos    24                                             /*!< CoreDebug DHCSR: S_RETIRE_ST Position */\r
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk    (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos)       /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */\r
+\r
+#define CoreDebug_DHCSR_S_LOCKUP_Pos       19                                             /*!< CoreDebug DHCSR: S_LOCKUP Position */\r
+#define CoreDebug_DHCSR_S_LOCKUP_Msk       (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos)          /*!< CoreDebug DHCSR: S_LOCKUP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_SLEEP_Pos        18                                             /*!< CoreDebug DHCSR: S_SLEEP Position */\r
+#define CoreDebug_DHCSR_S_SLEEP_Msk        (1UL << CoreDebug_DHCSR_S_SLEEP_Pos)           /*!< CoreDebug DHCSR: S_SLEEP Mask */\r
+\r
+#define CoreDebug_DHCSR_S_HALT_Pos         17                                             /*!< CoreDebug DHCSR: S_HALT Position */\r
+#define CoreDebug_DHCSR_S_HALT_Msk         (1UL << CoreDebug_DHCSR_S_HALT_Pos)            /*!< CoreDebug DHCSR: S_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_S_REGRDY_Pos       16                                             /*!< CoreDebug DHCSR: S_REGRDY Position */\r
+#define CoreDebug_DHCSR_S_REGRDY_Msk       (1UL << CoreDebug_DHCSR_S_REGRDY_Pos)          /*!< CoreDebug DHCSR: S_REGRDY Mask */\r
+\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos     5                                             /*!< CoreDebug DHCSR: C_SNAPSTALL Position */\r
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk    (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos)       /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */\r
+\r
+#define CoreDebug_DHCSR_C_MASKINTS_Pos      3                                             /*!< CoreDebug DHCSR: C_MASKINTS Position */\r
+#define CoreDebug_DHCSR_C_MASKINTS_Msk     (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos)        /*!< CoreDebug DHCSR: C_MASKINTS Mask */\r
+\r
+#define CoreDebug_DHCSR_C_STEP_Pos          2                                             /*!< CoreDebug DHCSR: C_STEP Position */\r
+#define CoreDebug_DHCSR_C_STEP_Msk         (1UL << CoreDebug_DHCSR_C_STEP_Pos)            /*!< CoreDebug DHCSR: C_STEP Mask */\r
+\r
+#define CoreDebug_DHCSR_C_HALT_Pos          1                                             /*!< CoreDebug DHCSR: C_HALT Position */\r
+#define CoreDebug_DHCSR_C_HALT_Msk         (1UL << CoreDebug_DHCSR_C_HALT_Pos)            /*!< CoreDebug DHCSR: C_HALT Mask */\r
+\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos       0                                             /*!< CoreDebug DHCSR: C_DEBUGEN Position */\r
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk      (1UL << CoreDebug_DHCSR_C_DEBUGEN_Pos)         /*!< CoreDebug DHCSR: C_DEBUGEN Mask */\r
+\r
+/* Debug Core Register Selector Register */\r
+#define CoreDebug_DCRSR_REGWnR_Pos         16                                             /*!< CoreDebug DCRSR: REGWnR Position */\r
+#define CoreDebug_DCRSR_REGWnR_Msk         (1UL << CoreDebug_DCRSR_REGWnR_Pos)            /*!< CoreDebug DCRSR: REGWnR Mask */\r
+\r
+#define CoreDebug_DCRSR_REGSEL_Pos          0                                             /*!< CoreDebug DCRSR: REGSEL Position */\r
+#define CoreDebug_DCRSR_REGSEL_Msk         (0x1FUL << CoreDebug_DCRSR_REGSEL_Pos)         /*!< CoreDebug DCRSR: REGSEL Mask */\r
+\r
+/* Debug Exception and Monitor Control Register */\r
+#define CoreDebug_DEMCR_TRCENA_Pos         24                                             /*!< CoreDebug DEMCR: TRCENA Position */\r
+#define CoreDebug_DEMCR_TRCENA_Msk         (1UL << CoreDebug_DEMCR_TRCENA_Pos)            /*!< CoreDebug DEMCR: TRCENA Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_REQ_Pos        19                                             /*!< CoreDebug DEMCR: MON_REQ Position */\r
+#define CoreDebug_DEMCR_MON_REQ_Msk        (1UL << CoreDebug_DEMCR_MON_REQ_Pos)           /*!< CoreDebug DEMCR: MON_REQ Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_STEP_Pos       18                                             /*!< CoreDebug DEMCR: MON_STEP Position */\r
+#define CoreDebug_DEMCR_MON_STEP_Msk       (1UL << CoreDebug_DEMCR_MON_STEP_Pos)          /*!< CoreDebug DEMCR: MON_STEP Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_PEND_Pos       17                                             /*!< CoreDebug DEMCR: MON_PEND Position */\r
+#define CoreDebug_DEMCR_MON_PEND_Msk       (1UL << CoreDebug_DEMCR_MON_PEND_Pos)          /*!< CoreDebug DEMCR: MON_PEND Mask */\r
+\r
+#define CoreDebug_DEMCR_MON_EN_Pos         16                                             /*!< CoreDebug DEMCR: MON_EN Position */\r
+#define CoreDebug_DEMCR_MON_EN_Msk         (1UL << CoreDebug_DEMCR_MON_EN_Pos)            /*!< CoreDebug DEMCR: MON_EN Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_HARDERR_Pos     10                                             /*!< CoreDebug DEMCR: VC_HARDERR Position */\r
+#define CoreDebug_DEMCR_VC_HARDERR_Msk     (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos)        /*!< CoreDebug DEMCR: VC_HARDERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_INTERR_Pos       9                                             /*!< CoreDebug DEMCR: VC_INTERR Position */\r
+#define CoreDebug_DEMCR_VC_INTERR_Msk      (1UL << CoreDebug_DEMCR_VC_INTERR_Pos)         /*!< CoreDebug DEMCR: VC_INTERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_BUSERR_Pos       8                                             /*!< CoreDebug DEMCR: VC_BUSERR Position */\r
+#define CoreDebug_DEMCR_VC_BUSERR_Msk      (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos)         /*!< CoreDebug DEMCR: VC_BUSERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_STATERR_Pos      7                                             /*!< CoreDebug DEMCR: VC_STATERR Position */\r
+#define CoreDebug_DEMCR_VC_STATERR_Msk     (1UL << CoreDebug_DEMCR_VC_STATERR_Pos)        /*!< CoreDebug DEMCR: VC_STATERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CHKERR_Pos       6                                             /*!< CoreDebug DEMCR: VC_CHKERR Position */\r
+#define CoreDebug_DEMCR_VC_CHKERR_Msk      (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos)         /*!< CoreDebug DEMCR: VC_CHKERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos      5                                             /*!< CoreDebug DEMCR: VC_NOCPERR Position */\r
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk     (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos)        /*!< CoreDebug DEMCR: VC_NOCPERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_MMERR_Pos        4                                             /*!< CoreDebug DEMCR: VC_MMERR Position */\r
+#define CoreDebug_DEMCR_VC_MMERR_Msk       (1UL << CoreDebug_DEMCR_VC_MMERR_Pos)          /*!< CoreDebug DEMCR: VC_MMERR Mask */\r
+\r
+#define CoreDebug_DEMCR_VC_CORERESET_Pos    0                                             /*!< CoreDebug DEMCR: VC_CORERESET Position */\r
+#define CoreDebug_DEMCR_VC_CORERESET_Msk   (1UL << CoreDebug_DEMCR_VC_CORERESET_Pos)      /*!< CoreDebug DEMCR: VC_CORERESET Mask */\r
+\r
+/*@} end of group CMSIS_CoreDebug */\r
+\r
+\r
+/** \ingroup  CMSIS_core_register\r
+  @{\r
+ */\r
+\r
+/* Memory mapping of Cortex-M3 Hardware */\r
+#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address  */\r
+#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address                   */\r
+#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address            */\r
+#define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address               */\r
+#define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address                  */\r
+#define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address  */\r
+\r
+#define SCnSCB              ((SCnSCB_Type    *)     SCS_BASE      )   /*!< System control Register not in SCB */\r
+#define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct           */\r
+#define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct       */\r
+#define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct          */\r
+#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct           */\r
+#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct    */\r
+\r
+#if (__MPU_PRESENT == 1)\r
+  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit             */\r
+  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit             */\r
+#endif\r
+\r
+/*@} */\r
+\r
+\r
+\r
+/*******************************************************************************\r
+ *                Hardware Abstraction Layer\r
+ ******************************************************************************/\r
+/** \defgroup CMSIS_Core_FunctionInterface CMSIS Core Function Interface\r
+  Core Function Interface contains:\r
+  - Core NVIC Functions\r
+  - Core SysTick Functions\r
+  - Core Debug Functions\r
+  - Core Register Access Functions\r
+*/\r
+\r
+\r
+\r
+/* ##########################   NVIC functions  #################################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_Core_NVICFunctions CMSIS Core NVIC Functions\r
+  @{\r
+ */\r
+\r
+/** \brief  Set Priority Grouping\r
+\r
+  This function sets the priority grouping field using the required unlock sequence.\r
+  The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.\r
+  Only values from 0..7 are used.\r
+  In case of a conflict between priority grouping and available\r
+  priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.\r
+\r
+    \param [in]      PriorityGroup  Priority grouping field\r
+ */\r
+static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)\r
+{\r
+  uint32_t reg_value;\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07);               /* only values 0..7 are used          */\r
+\r
+  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */\r
+  reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk);             /* clear bits to change               */\r
+  reg_value  =  (reg_value                                 |\r
+                ((uint32_t)0x5FA << SCB_AIRCR_VECTKEY_Pos) |\r
+                (PriorityGroupTmp << 8));                                     /* Insert write key and priorty group */\r
+  SCB->AIRCR =  reg_value;\r
+}\r
+\r
+\r
+/** \brief  Get Priority Grouping\r
+\r
+  This function gets the priority grouping from NVIC Interrupt Controller.\r
+  Priority grouping is SCB->AIRCR [10:8] PRIGROUP field.\r
+\r
+    \return                Priority grouping field\r
+ */\r
+static __INLINE uint32_t NVIC_GetPriorityGrouping(void)\r
+{\r
+  return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos);   /* read priority grouping field */\r
+}\r
+\r
+\r
+/** \brief  Enable External Interrupt\r
+\r
+    This function enables a device specific interrupt in the NVIC interrupt controller.\r
+    The interrupt number cannot be a negative value.\r
+\r
+    \param [in]      IRQn  Number of the external interrupt to enable\r
+ */\r
+static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)\r
+{\r
+  NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */\r
+}\r
+\r
+\r
+/** \brief  Disable External Interrupt\r
+\r
+    This function disables a device specific interrupt in the NVIC interrupt controller.\r
+    The interrupt number cannot be a negative value.\r
+\r
+    \param [in]      IRQn  Number of the external interrupt to disable\r
+ */\r
+static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)\r
+{\r
+  NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */\r
+}\r
+\r
+\r
+/** \brief  Get Pending Interrupt\r
+\r
+    This function reads the pending register in the NVIC and returns the pending bit\r
+    for the specified interrupt.\r
+\r
+    \param [in]      IRQn  Number of the interrupt for get pending\r
+    \return             0  Interrupt status is not pending\r
+    \return             1  Interrupt status is pending\r
+ */\r
+static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */\r
+}\r
+\r
+\r
+/** \brief  Set Pending Interrupt\r
+\r
+    This function sets the pending bit for the specified interrupt.\r
+    The interrupt number cannot be a negative value.\r
+\r
+    \param [in]      IRQn  Number of the interrupt for set pending\r
+ */\r
+static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */\r
+}\r
+\r
+\r
+/** \brief  Clear Pending Interrupt\r
+\r
+    This function clears the pending bit for the specified interrupt.\r
+    The interrupt number cannot be a negative value.\r
+\r
+    \param [in]      IRQn  Number of the interrupt for clear pending\r
+ */\r
+static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)\r
+{\r
+  NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */\r
+}\r
+\r
+\r
+/** \brief  Get Active Interrupt\r
+\r
+    This function reads the active register in NVIC and returns the active bit.\r
+    \param [in]      IRQn  Number of the interrupt for get active\r
+    \return             0  Interrupt status is not active\r
+    \return             1  Interrupt status is active\r
+ */\r
+static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)\r
+{\r
+  return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */\r
+}\r
+\r
+\r
+/** \brief  Set Interrupt Priority\r
+\r
+    This function sets the priority for the specified interrupt. The interrupt\r
+    number can be positive to specify an external (device specific)\r
+    interrupt, or negative to specify an internal (core) interrupt.\r
+\r
+    Note: The priority cannot be set for every core interrupt.\r
+\r
+    \param [in]      IRQn  Number of the interrupt for set priority\r
+    \param [in]  priority  Priority to set\r
+ */\r
+static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)\r
+{\r
+  if(IRQn < 0) {\r
+    SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M  System Interrupts */\r
+  else {\r
+    NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff);    }        /* set Priority for device specific Interrupts  */\r
+}\r
+\r
+\r
+/** \brief  Get Interrupt Priority\r
+\r
+    This function reads the priority for the specified interrupt. The interrupt\r
+    number can be positive to specify an external (device specific)\r
+    interrupt, or negative to specify an internal (core) interrupt.\r
+\r
+    The returned priority value is automatically aligned to the implemented\r
+    priority bits of the microcontroller.\r
+\r
+    \param [in]   IRQn  Number of the interrupt for get priority\r
+    \return             Interrupt Priority\r
+ */\r
+static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)\r
+{\r
+\r
+  if(IRQn < 0) {\r
+    return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS)));  } /* get priority for Cortex-M  system interrupts */\r
+  else {\r
+    return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)]           >> (8 - __NVIC_PRIO_BITS)));  } /* get priority for device specific interrupts  */\r
+}\r
+\r
+\r
+/** \brief  Encode Priority\r
+\r
+    This function encodes the priority for an interrupt with the given priority group,\r
+    preemptive priority value and sub priority value.\r
+    In case of a conflict between priority grouping and available\r
+    priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.\r
+\r
+    The returned priority value can be used for NVIC_SetPriority(...) function\r
+\r
+    \param [in]     PriorityGroup  Used priority group\r
+    \param [in]   PreemptPriority  Preemptive priority value (starting from 0)\r
+    \param [in]       SubPriority  Sub priority value (starting from 0)\r
+    \return                        Encoded priority for the interrupt\r
+ */\r
+static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);          /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;\r
+  SubPriorityBits     = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;\r
+\r
+  return (\r
+           ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |\r
+           ((SubPriority     & ((1 << (SubPriorityBits    )) - 1)))\r
+         );\r
+}\r
+\r
+\r
+/** \brief  Decode Priority\r
+\r
+    This function decodes an interrupt priority value with the given priority group to\r
+    preemptive priority value and sub priority value.\r
+    In case of a conflict between priority grouping and available\r
+    priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.\r
+\r
+    The priority value can be retrieved with NVIC_GetPriority(...) function\r
+\r
+    \param [in]         Priority   Priority value\r
+    \param [in]     PriorityGroup  Used priority group\r
+    \param [out] pPreemptPriority  Preemptive priority value (starting from 0)\r
+    \param [out]     pSubPriority  Sub priority value (starting from 0)\r
+ */\r
+static __INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)\r
+{\r
+  uint32_t PriorityGroupTmp = (PriorityGroup & 0x07);          /* only values 0..7 are used          */\r
+  uint32_t PreemptPriorityBits;\r
+  uint32_t SubPriorityBits;\r
+\r
+  PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;\r
+  SubPriorityBits     = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;\r
+\r
+  *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);\r
+  *pSubPriority     = (Priority                   ) & ((1 << (SubPriorityBits    )) - 1);\r
+}\r
+\r
+\r
+/** \brief  System Reset\r
+\r
+    This function initiate a system reset request to reset the MCU.\r
+ */\r
+static __INLINE void NVIC_SystemReset(void)\r
+{\r
+  __DSB();                                                     /* Ensure all outstanding memory accesses included\r
+                                                                  buffered write are completed before reset */\r
+  SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos)      |\r
+                 (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |\r
+                 SCB_AIRCR_SYSRESETREQ_Msk);                   /* Keep priority group unchanged */\r
+  __DSB();                                                     /* Ensure completion of memory access */\r
+  while(1);                                                    /* wait until reset */\r
+}\r
+\r
+/*@} end of CMSIS_Core_NVICFunctions */\r
+\r
+\r
+\r
+/* ##################################    SysTick function  ############################################ */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_Core_SysTickFunctions CMSIS Core SysTick Functions\r
+  @{\r
+ */\r
+\r
+#if (__Vendor_SysTickConfig == 0)\r
+\r
+/** \brief  System Tick Configuration\r
+\r
+    This function initialises the system tick timer and its interrupt and start the system tick timer.\r
+    Counter is in free running mode to generate periodical interrupts.\r
+\r
+    \param [in]  ticks  Number of ticks between two interrupts\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+static __INLINE uint32_t SysTick_Config(uint32_t ticks)\r
+{\r
+  if (ticks > SysTick_LOAD_RELOAD_Msk)  return (1);            /* Reload value impossible */\r
+\r
+  SysTick->LOAD  = (ticks & SysTick_LOAD_RELOAD_Msk) - 1;      /* set reload register */\r
+  NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1);  /* set Priority for Cortex-M0 System Interrupts */\r
+  SysTick->VAL   = 0;                                          /* Load the SysTick Counter Value */\r
+  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |\r
+                   SysTick_CTRL_TICKINT_Msk   |\r
+                   SysTick_CTRL_ENABLE_Msk;                    /* Enable SysTick IRQ and SysTick Timer */\r
+  return (0);                                                  /* Function successful */\r
+}\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_SysTickFunctions */\r
+\r
+\r
+\r
+/* ##################################### Debug In/Output function ########################################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface\r
+    \defgroup CMSIS_core_DebugFunctions CMSIS Core Debug Functions\r
+  @{\r
+ */\r
+\r
+extern volatile int32_t ITM_RxBuffer;                    /*!< external variable to receive characters                    */\r
+#define                 ITM_RXBUFFER_EMPTY    0x5AA55AA5 /*!< value identifying ITM_RxBuffer is ready for next character */\r
+\r
+\r
+/** \brief  ITM Send Character\r
+\r
+    This function transmits a character via the ITM channel 0.\r
+    It just returns when no debugger is connected that has booked the output.\r
+    It is blocking when a debugger is connected, but the previous character send is not transmitted.\r
+\r
+    \param [in]     ch  Character to transmit\r
+    \return             Character to transmit\r
+ */\r
+static __INLINE uint32_t ITM_SendChar (uint32_t ch)\r
+{\r
+  if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk)  &&      /* Trace enabled */\r
+      (ITM->TCR & ITM_TCR_ITMENA_Msk)                  &&      /* ITM enabled */\r
+      (ITM->TER & (1UL << 0)        )                    )     /* ITM Port #0 enabled */\r
+  {\r
+    while (ITM->PORT[0].u32 == 0);\r
+    ITM->PORT[0].u8 = (uint8_t) ch;\r
+  }\r
+  return (ch);\r
+}\r
+\r
+\r
+/** \brief  ITM Receive Character\r
+\r
+    This function inputs a character via external variable ITM_RxBuffer.\r
+    It just returns when no debugger is connected that has booked the output.\r
+    It is blocking when a debugger is connected, but the previous character send is not transmitted.\r
+\r
+    \return             Received character\r
+    \return         -1  No character received\r
+ */\r
+static __INLINE int32_t ITM_ReceiveChar (void) {\r
+  int32_t ch = -1;                           /* no character available */\r
+\r
+  if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {\r
+    ch = ITM_RxBuffer;\r
+    ITM_RxBuffer = ITM_RXBUFFER_EMPTY;       /* ready for next character */\r
+  }\r
+\r
+  return (ch);\r
+}\r
+\r
+\r
+/** \brief  ITM Check Character\r
+\r
+    This function checks external variable ITM_RxBuffer whether a character is available or not.\r
+    It returns '1' if a character is available and '0' if no character is available.\r
+\r
+    \return          0  No character available\r
+    \return          1  Character available\r
+ */\r
+static __INLINE int32_t ITM_CheckChar (void) {\r
+\r
+  if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {\r
+    return (0);                                 /* no character available */\r
+  } else {\r
+    return (1);                                 /*    character available */\r
+  }\r
+}\r
+\r
+/*@} end of CMSIS_core_DebugFunctions */\r
+\r
+#endif /* __CORE_CM3_H_DEPENDANT */\r
+\r
+#endif /* __CMSIS_GENERIC */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmFunc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmFunc.h
new file mode 100644 (file)
index 0000000..c999b1c
--- /dev/null
@@ -0,0 +1,609 @@
+/**************************************************************************//**\r
+ * @file     core_cmFunc.h\r
+ * @brief    CMSIS Cortex-M Core Function Access Header File\r
+ * @version  V2.10\r
+ * @date     26. July 2011\r
+ *\r
+ * @note\r
+ * Copyright (C) 2009-2011 ARM Limited. All rights reserved.\r
+ *\r
+ * @par\r
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M \r
+ * processor based microcontrollers.  This file can be freely distributed \r
+ * within development tools that are supporting such ARM based processors. \r
+ *\r
+ * @par\r
+ * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#ifndef __CORE_CMFUNC_H\r
+#define __CORE_CMFUNC_H\r
+\r
+\r
+/* ###########################  Core Function Access  ########################### */\r
+/** \ingroup  CMSIS_Core_FunctionInterface   \r
+    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions\r
+  @{\r
+ */\r
+\r
+#if   defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/\r
+/* ARM armcc specific functions */\r
+\r
+#if (__ARMCC_VERSION < 400677)\r
+  #error "Please use ARM Compiler Toolchain V4.0.677 or later!"\r
+#endif\r
+\r
+/* intrinsic void __enable_irq();     */\r
+/* intrinsic void __disable_irq();    */\r
+\r
+/** \brief  Get Control Register\r
+\r
+    This function returns the content of the Control Register.\r
+\r
+    \return               Control Register value\r
+ */\r
+static __INLINE uint32_t __get_CONTROL(void)\r
+{\r
+  register uint32_t __regControl         __ASM("control");\r
+  return(__regControl);\r
+}\r
+\r
+\r
+/** \brief  Set Control Register\r
+\r
+    This function writes the given value to the Control Register.\r
+\r
+    \param [in]    control  Control Register value to set\r
+ */\r
+static __INLINE void __set_CONTROL(uint32_t control)\r
+{\r
+  register uint32_t __regControl         __ASM("control");\r
+  __regControl = control;\r
+}\r
+\r
+\r
+/** \brief  Get ISPR Register\r
+\r
+    This function returns the content of the ISPR Register.\r
+\r
+    \return               ISPR Register value\r
+ */\r
+static __INLINE uint32_t __get_IPSR(void)\r
+{\r
+  register uint32_t __regIPSR          __ASM("ipsr");\r
+  return(__regIPSR);\r
+}\r
+\r
+\r
+/** \brief  Get APSR Register\r
+\r
+    This function returns the content of the APSR Register.\r
+\r
+    \return               APSR Register value\r
+ */\r
+static __INLINE uint32_t __get_APSR(void)\r
+{\r
+  register uint32_t __regAPSR          __ASM("apsr");\r
+  return(__regAPSR);\r
+}\r
+\r
+\r
+/** \brief  Get xPSR Register\r
+\r
+    This function returns the content of the xPSR Register.\r
+\r
+    \return               xPSR Register value\r
+ */\r
+static __INLINE uint32_t __get_xPSR(void)\r
+{\r
+  register uint32_t __regXPSR          __ASM("xpsr");\r
+  return(__regXPSR);\r
+}\r
+\r
+\r
+/** \brief  Get Process Stack Pointer\r
+\r
+    This function returns the current value of the Process Stack Pointer (PSP).\r
+\r
+    \return               PSP Register value\r
+ */\r
+static __INLINE uint32_t __get_PSP(void)\r
+{\r
+  register uint32_t __regProcessStackPointer  __ASM("psp");\r
+  return(__regProcessStackPointer);\r
+}\r
+\r
+\r
+/** \brief  Set Process Stack Pointer\r
+\r
+    This function assigns the given value to the Process Stack Pointer (PSP).\r
+\r
+    \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+static __INLINE void __set_PSP(uint32_t topOfProcStack)\r
+{\r
+  register uint32_t __regProcessStackPointer  __ASM("psp");\r
+  __regProcessStackPointer = topOfProcStack;\r
+}\r
+\r
+\r
+/** \brief  Get Main Stack Pointer\r
+\r
+    This function returns the current value of the Main Stack Pointer (MSP).\r
+\r
+    \return               MSP Register value\r
+ */\r
+static __INLINE uint32_t __get_MSP(void)\r
+{\r
+  register uint32_t __regMainStackPointer     __ASM("msp");\r
+  return(__regMainStackPointer);\r
+}\r
+\r
+\r
+/** \brief  Set Main Stack Pointer\r
+\r
+    This function assigns the given value to the Main Stack Pointer (MSP).\r
+\r
+    \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+static __INLINE void __set_MSP(uint32_t topOfMainStack)\r
+{\r
+  register uint32_t __regMainStackPointer     __ASM("msp");\r
+  __regMainStackPointer = topOfMainStack;\r
+}\r
+\r
+\r
+/** \brief  Get Priority Mask\r
+\r
+    This function returns the current state of the priority mask bit from the Priority Mask Register.\r
+\r
+    \return               Priority Mask value\r
+ */\r
+static __INLINE uint32_t __get_PRIMASK(void)\r
+{\r
+  register uint32_t __regPriMask         __ASM("primask");\r
+  return(__regPriMask);\r
+}\r
+\r
+\r
+/** \brief  Set Priority Mask\r
+\r
+    This function assigns the given value to the Priority Mask Register.\r
+\r
+    \param [in]    priMask  Priority Mask\r
+ */\r
+static __INLINE void __set_PRIMASK(uint32_t priMask)\r
+{\r
+  register uint32_t __regPriMask         __ASM("primask");\r
+  __regPriMask = (priMask);\r
+}\r
\r
+\r
+#if       (__CORTEX_M >= 0x03)\r
+\r
+/** \brief  Enable FIQ\r
+\r
+    This function enables FIQ interrupts by clearing the F-bit in the CPSR.\r
+    Can only be executed in Privileged modes.\r
+ */\r
+#define __enable_fault_irq                __enable_fiq\r
+\r
+\r
+/** \brief  Disable FIQ\r
+\r
+    This function disables FIQ interrupts by setting the F-bit in the CPSR.\r
+    Can only be executed in Privileged modes.\r
+ */\r
+#define __disable_fault_irq               __disable_fiq\r
+\r
+\r
+/** \brief  Get Base Priority\r
+\r
+    This function returns the current value of the Base Priority register.\r
+\r
+    \return               Base Priority register value\r
+ */\r
+static __INLINE uint32_t  __get_BASEPRI(void)\r
+{\r
+  register uint32_t __regBasePri         __ASM("basepri");\r
+  return(__regBasePri);\r
+}\r
+\r
+\r
+/** \brief  Set Base Priority\r
+\r
+    This function assigns the given value to the Base Priority register.\r
+\r
+    \param [in]    basePri  Base Priority value to set\r
+ */\r
+static __INLINE void __set_BASEPRI(uint32_t basePri)\r
+{\r
+  register uint32_t __regBasePri         __ASM("basepri");\r
+  __regBasePri = (basePri & 0xff);\r
+}\r
\r
+\r
+/** \brief  Get Fault Mask\r
+\r
+    This function returns the current value of the Fault Mask register.\r
+\r
+    \return               Fault Mask register value\r
+ */\r
+static __INLINE uint32_t __get_FAULTMASK(void)\r
+{\r
+  register uint32_t __regFaultMask       __ASM("faultmask");\r
+  return(__regFaultMask);\r
+}\r
+\r
+\r
+/** \brief  Set Fault Mask\r
+\r
+    This function assigns the given value to the Fault Mask register.\r
+\r
+    \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+static __INLINE void __set_FAULTMASK(uint32_t faultMask)\r
+{\r
+  register uint32_t __regFaultMask       __ASM("faultmask");\r
+  __regFaultMask = (faultMask & (uint32_t)1);\r
+}\r
+\r
+#endif /* (__CORTEX_M >= 0x03) */\r
+\r
+\r
+#if       (__CORTEX_M == 0x04)\r
+\r
+/** \brief  Get FPSCR\r
+\r
+    This function returns the current value of the Floating Point Status/Control register.\r
+\r
+    \return               Floating Point Status/Control register value\r
+ */\r
+static __INLINE uint32_t __get_FPSCR(void)\r
+{\r
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)\r
+  register uint32_t __regfpscr         __ASM("fpscr");\r
+  return(__regfpscr);\r
+#else\r
+   return(0);\r
+#endif\r
+}\r
+\r
+\r
+/** \brief  Set FPSCR\r
+\r
+    This function assigns the given value to the Floating Point Status/Control register.\r
+\r
+    \param [in]    fpscr  Floating Point Status/Control value to set\r
+ */\r
+static __INLINE void __set_FPSCR(uint32_t fpscr)\r
+{\r
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)\r
+  register uint32_t __regfpscr         __ASM("fpscr");\r
+  __regfpscr = (fpscr);\r
+#endif\r
+}\r
+\r
+#endif /* (__CORTEX_M == 0x04) */\r
+\r
+\r
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/\r
+/* IAR iccarm specific functions */\r
+\r
+#include <cmsis_iar.h>\r
+\r
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/\r
+/* GNU gcc specific functions */\r
+\r
+/** \brief  Enable IRQ Interrupts\r
+\r
+  This function enables IRQ interrupts by clearing the I-bit in the CPSR.\r
+  Can only be executed in Privileged modes.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __enable_irq(void)\r
+{\r
+  __ASM volatile ("cpsie i");\r
+}\r
+\r
+\r
+/** \brief  Disable IRQ Interrupts\r
+\r
+  This function disables IRQ interrupts by setting the I-bit in the CPSR.\r
+  Can only be executed in Privileged modes.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __disable_irq(void)\r
+{\r
+  __ASM volatile ("cpsid i");\r
+}\r
+\r
+\r
+/** \brief  Get Control Register\r
+\r
+    This function returns the content of the Control Register.\r
+\r
+    \return               Control Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_CONTROL(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, control" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Set Control Register\r
+\r
+    This function writes the given value to the Control Register.\r
+\r
+    \param [in]    control  Control Register value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_CONTROL(uint32_t control)\r
+{\r
+  __ASM volatile ("MSR control, %0" : : "r" (control) );\r
+}\r
+\r
+\r
+/** \brief  Get ISPR Register\r
+\r
+    This function returns the content of the ISPR Register.\r
+\r
+    \return               ISPR Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_IPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, ipsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Get APSR Register\r
+\r
+    This function returns the content of the APSR Register.\r
+\r
+    \return               APSR Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_APSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, apsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Get xPSR Register\r
+\r
+    This function returns the content of the xPSR Register.\r
+\r
+    \return               xPSR Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_xPSR(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, xpsr" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Get Process Stack Pointer\r
+\r
+    This function returns the current value of the Process Stack Pointer (PSP).\r
+\r
+    \return               PSP Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PSP(void)\r
+{\r
+  register uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, psp\n"  : "=r" (result) );\r
+  return(result);\r
+}\r
\r
+\r
+/** \brief  Set Process Stack Pointer\r
+\r
+    This function assigns the given value to the Process Stack Pointer (PSP).\r
+\r
+    \param [in]    topOfProcStack  Process Stack Pointer value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_PSP(uint32_t topOfProcStack)\r
+{\r
+  __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) );\r
+}\r
+\r
+\r
+/** \brief  Get Main Stack Pointer\r
+\r
+    This function returns the current value of the Main Stack Pointer (MSP).\r
+\r
+    \return               MSP Register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_MSP(void)\r
+{\r
+  register uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, msp\n" : "=r" (result) );\r
+  return(result);\r
+}\r
\r
+\r
+/** \brief  Set Main Stack Pointer\r
+\r
+    This function assigns the given value to the Main Stack Pointer (MSP).\r
+\r
+    \param [in]    topOfMainStack  Main Stack Pointer value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_MSP(uint32_t topOfMainStack)\r
+{\r
+  __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) );\r
+}\r
+\r
+\r
+/** \brief  Get Priority Mask\r
+\r
+    This function returns the current state of the priority mask bit from the Priority Mask Register.\r
+\r
+    \return               Priority Mask value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_PRIMASK(void)\r
+{\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("MRS %0, primask" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Set Priority Mask\r
+\r
+    This function assigns the given value to the Priority Mask Register.\r
+\r
+    \param [in]    priMask  Priority Mask\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_PRIMASK(uint32_t priMask)\r
+{\r
+  __ASM volatile ("MSR primask, %0" : : "r" (priMask) );\r
+}\r
\r
+\r
+#if       (__CORTEX_M >= 0x03)\r
+\r
+/** \brief  Enable FIQ\r
+\r
+    This function enables FIQ interrupts by clearing the F-bit in the CPSR.\r
+    Can only be executed in Privileged modes.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __enable_fault_irq(void)\r
+{\r
+  __ASM volatile ("cpsie f");\r
+}\r
+\r
+\r
+/** \brief  Disable FIQ\r
+\r
+    This function disables FIQ interrupts by setting the F-bit in the CPSR.\r
+    Can only be executed in Privileged modes.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __disable_fault_irq(void)\r
+{\r
+  __ASM volatile ("cpsid f");\r
+}\r
+\r
+\r
+/** \brief  Get Base Priority\r
+\r
+    This function returns the current value of the Base Priority register.\r
+\r
+    \return               Base Priority register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_BASEPRI(void)\r
+{\r
+  uint32_t result;\r
+  \r
+  __ASM volatile ("MRS %0, basepri_max" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Set Base Priority\r
+\r
+    This function assigns the given value to the Base Priority register.\r
+\r
+    \param [in]    basePri  Base Priority value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_BASEPRI(uint32_t value)\r
+{\r
+  __ASM volatile ("MSR basepri, %0" : : "r" (value) );\r
+}\r
+\r
+\r
+/** \brief  Get Fault Mask\r
+\r
+    This function returns the current value of the Fault Mask register.\r
+\r
+    \return               Fault Mask register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FAULTMASK(void)\r
+{\r
+  uint32_t result;\r
+  \r
+  __ASM volatile ("MRS %0, faultmask" : "=r" (result) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Set Fault Mask\r
+\r
+    This function assigns the given value to the Fault Mask register.\r
+\r
+    \param [in]    faultMask  Fault Mask value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_FAULTMASK(uint32_t faultMask)\r
+{\r
+  __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) );\r
+}\r
+\r
+#endif /* (__CORTEX_M >= 0x03) */\r
+\r
+\r
+#if       (__CORTEX_M == 0x04)\r
+\r
+/** \brief  Get FPSCR\r
+\r
+    This function returns the current value of the Floating Point Status/Control register.\r
+\r
+    \return               Floating Point Status/Control register value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __get_FPSCR(void)\r
+{\r
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)\r
+  uint32_t result;\r
+\r
+  __ASM volatile ("VMRS %0, fpscr" : "=r" (result) );\r
+  return(result);\r
+#else\r
+   return(0);\r
+#endif\r
+}\r
+\r
+\r
+/** \brief  Set FPSCR\r
+\r
+    This function assigns the given value to the Floating Point Status/Control register.\r
+\r
+    \param [in]    fpscr  Floating Point Status/Control value to set\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __set_FPSCR(uint32_t fpscr)\r
+{\r
+#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)\r
+  __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) );\r
+#endif\r
+}\r
+\r
+#endif /* (__CORTEX_M == 0x04) */\r
+\r
+\r
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/\r
+/* TASKING carm specific functions */\r
+\r
+/*\r
+ * The CMSIS functions have been implemented as intrinsics in the compiler.\r
+ * Please use "carm -?i" to get an up to date list of all instrinsics,\r
+ * Including the CMSIS ones.\r
+ */\r
+\r
+#endif\r
+\r
+/*@} end of CMSIS_Core_RegAccFunctions */\r
+\r
+\r
+#endif /* __CORE_CMFUNC_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmInstr.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/core_cmInstr.h
new file mode 100644 (file)
index 0000000..ceb4f87
--- /dev/null
@@ -0,0 +1,585 @@
+/**************************************************************************//**\r
+ * @file     core_cmInstr.h\r
+ * @brief    CMSIS Cortex-M Core Instruction Access Header File\r
+ * @version  V2.10\r
+ * @date     19. July 2011\r
+ *\r
+ * @note\r
+ * Copyright (C) 2009-2011 ARM Limited. All rights reserved.\r
+ *\r
+ * @par\r
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M \r
+ * processor based microcontrollers.  This file can be freely distributed \r
+ * within development tools that are supporting such ARM based processors. \r
+ *\r
+ * @par\r
+ * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#ifndef __CORE_CMINSTR_H\r
+#define __CORE_CMINSTR_H\r
+\r
+\r
+/* ##########################  Core Instruction Access  ######################### */\r
+/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface\r
+  Access to dedicated instructions\r
+  @{\r
+*/\r
+\r
+#if   defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/\r
+/* ARM armcc specific functions */\r
+\r
+#if (__ARMCC_VERSION < 400677)\r
+  #error "Please use ARM Compiler Toolchain V4.0.677 or later!"\r
+#endif\r
+\r
+\r
+/** \brief  No Operation\r
+\r
+    No Operation does nothing. This instruction can be used for code alignment purposes.\r
+ */\r
+#define __NOP                             __nop\r
+\r
+\r
+/** \brief  Wait For Interrupt\r
+\r
+    Wait For Interrupt is a hint instruction that suspends execution\r
+    until one of a number of events occurs.\r
+ */\r
+#define __WFI                             __wfi\r
+\r
+\r
+/** \brief  Wait For Event\r
+\r
+    Wait For Event is a hint instruction that permits the processor to enter\r
+    a low-power state until one of a number of events occurs.\r
+ */\r
+#define __WFE                             __wfe\r
+\r
+\r
+/** \brief  Send Event\r
+\r
+    Send Event is a hint instruction. It causes an event to be signaled to the CPU.\r
+ */\r
+#define __SEV                             __sev\r
+\r
+\r
+/** \brief  Instruction Synchronization Barrier\r
+\r
+    Instruction Synchronization Barrier flushes the pipeline in the processor, \r
+    so that all instructions following the ISB are fetched from cache or \r
+    memory, after the instruction has been completed.\r
+ */\r
+#define __ISB()                           __isb(0xF)\r
+\r
+\r
+/** \brief  Data Synchronization Barrier\r
+\r
+    This function acts as a special kind of Data Memory Barrier. \r
+    It completes when all explicit memory accesses before this instruction complete.\r
+ */\r
+#define __DSB()                           __dsb(0xF)\r
+\r
+\r
+/** \brief  Data Memory Barrier\r
+\r
+    This function ensures the apparent order of the explicit memory operations before \r
+    and after the instruction, without ensuring their completion.\r
+ */\r
+#define __DMB()                           __dmb(0xF)\r
+\r
+\r
+/** \brief  Reverse byte order (32 bit)\r
+\r
+    This function reverses the byte order in integer value.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+#define __REV                             __rev\r
+\r
+\r
+/** \brief  Reverse byte order (16 bit)\r
+\r
+    This function reverses the byte order in two unsigned short values.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+static __INLINE __ASM uint32_t __REV16(uint32_t value)\r
+{\r
+  rev16 r0, r0\r
+  bx lr\r
+}\r
+\r
+\r
+/** \brief  Reverse byte order in signed short value\r
+\r
+    This function reverses the byte order in a signed short value with sign extension to integer.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+static __INLINE __ASM int32_t __REVSH(int32_t value)\r
+{\r
+  revsh r0, r0\r
+  bx lr\r
+}\r
+\r
+\r
+#if       (__CORTEX_M >= 0x03)\r
+\r
+/** \brief  Reverse bit order of value\r
+\r
+    This function reverses the bit order of the given value.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+#define __RBIT                            __rbit\r
+\r
+\r
+/** \brief  LDR Exclusive (8 bit)\r
+\r
+    This function performs a exclusive LDR command for 8 bit value.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return             value of type uint8_t at (*ptr)\r
+ */\r
+#define __LDREXB(ptr)                     ((uint8_t ) __ldrex(ptr))\r
+\r
+\r
+/** \brief  LDR Exclusive (16 bit)\r
+\r
+    This function performs a exclusive LDR command for 16 bit values.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return        value of type uint16_t at (*ptr)\r
+ */\r
+#define __LDREXH(ptr)                     ((uint16_t) __ldrex(ptr))\r
+\r
+\r
+/** \brief  LDR Exclusive (32 bit)\r
+\r
+    This function performs a exclusive LDR command for 32 bit values.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return        value of type uint32_t at (*ptr)\r
+ */\r
+#define __LDREXW(ptr)                     ((uint32_t ) __ldrex(ptr))\r
+\r
+\r
+/** \brief  STR Exclusive (8 bit)\r
+\r
+    This function performs a exclusive STR command for 8 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+#define __STREXB(value, ptr)              __strex(value, ptr)\r
+\r
+\r
+/** \brief  STR Exclusive (16 bit)\r
+\r
+    This function performs a exclusive STR command for 16 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+#define __STREXH(value, ptr)              __strex(value, ptr)\r
+\r
+\r
+/** \brief  STR Exclusive (32 bit)\r
+\r
+    This function performs a exclusive STR command for 32 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+#define __STREXW(value, ptr)              __strex(value, ptr)\r
+\r
+\r
+/** \brief  Remove the exclusive lock\r
+\r
+    This function removes the exclusive lock which is created by LDREX.\r
+\r
+ */\r
+#define __CLREX                           __clrex\r
+\r
+\r
+/** \brief  Signed Saturate\r
+\r
+    This function saturates a signed value.\r
+\r
+    \param [in]  value  Value to be saturated\r
+    \param [in]    sat  Bit position to saturate to (1..32)\r
+    \return             Saturated value\r
+ */\r
+#define __SSAT                            __ssat\r
+\r
+\r
+/** \brief  Unsigned Saturate\r
+\r
+    This function saturates an unsigned value.\r
+\r
+    \param [in]  value  Value to be saturated\r
+    \param [in]    sat  Bit position to saturate to (0..31)\r
+    \return             Saturated value\r
+ */\r
+#define __USAT                            __usat\r
+\r
+\r
+/** \brief  Count leading zeros\r
+\r
+    This function counts the number of leading zeros of a data value.\r
+\r
+    \param [in]  value  Value to count the leading zeros\r
+    \return             number of leading zeros in value\r
+ */\r
+#define __CLZ                             __clz \r
+\r
+#endif /* (__CORTEX_M >= 0x03) */\r
+\r
+\r
+\r
+#elif defined ( __ICCARM__ ) /*------------------ ICC Compiler -------------------*/\r
+/* IAR iccarm specific functions */\r
+\r
+#include <cmsis_iar.h>\r
+\r
+\r
+#elif defined ( __GNUC__ ) /*------------------ GNU Compiler ---------------------*/\r
+/* GNU gcc specific functions */\r
+\r
+/** \brief  No Operation\r
+\r
+    No Operation does nothing. This instruction can be used for code alignment purposes.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __NOP(void)\r
+{\r
+  __ASM volatile ("nop");\r
+}\r
+\r
+\r
+/** \brief  Wait For Interrupt\r
+\r
+    Wait For Interrupt is a hint instruction that suspends execution\r
+    until one of a number of events occurs.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __WFI(void)\r
+{\r
+  __ASM volatile ("wfi");\r
+}\r
+\r
+\r
+/** \brief  Wait For Event\r
+\r
+    Wait For Event is a hint instruction that permits the processor to enter\r
+    a low-power state until one of a number of events occurs.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __WFE(void)\r
+{\r
+  __ASM volatile ("wfe");\r
+}\r
+\r
+\r
+/** \brief  Send Event\r
+\r
+    Send Event is a hint instruction. It causes an event to be signaled to the CPU.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __SEV(void)\r
+{\r
+  __ASM volatile ("sev");\r
+}\r
+\r
+\r
+/** \brief  Instruction Synchronization Barrier\r
+\r
+    Instruction Synchronization Barrier flushes the pipeline in the processor, \r
+    so that all instructions following the ISB are fetched from cache or \r
+    memory, after the instruction has been completed.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __ISB(void)\r
+{\r
+  __ASM volatile ("isb");\r
+}\r
+\r
+\r
+/** \brief  Data Synchronization Barrier\r
+\r
+    This function acts as a special kind of Data Memory Barrier. \r
+    It completes when all explicit memory accesses before this instruction complete.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __DSB(void)\r
+{\r
+  __ASM volatile ("dsb");\r
+}\r
+\r
+\r
+/** \brief  Data Memory Barrier\r
+\r
+    This function ensures the apparent order of the explicit memory operations before \r
+    and after the instruction, without ensuring their completion.\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __DMB(void)\r
+{\r
+  __ASM volatile ("dmb");\r
+}\r
+\r
+\r
+/** \brief  Reverse byte order (32 bit)\r
+\r
+    This function reverses the byte order in integer value.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __REV(uint32_t value)\r
+{\r
+  uint32_t result;\r
+  \r
+  __ASM volatile ("rev %0, %1" : "=r" (result) : "r" (value) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Reverse byte order (16 bit)\r
+\r
+    This function reverses the byte order in two unsigned short values.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __REV16(uint32_t value)\r
+{\r
+  uint32_t result;\r
+  \r
+  __ASM volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) );\r
+  return(result);\r
+}\r
+\r
+\r
+/** \brief  Reverse byte order in signed short value\r
+\r
+    This function reverses the byte order in a signed short value with sign extension to integer.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE int32_t __REVSH(int32_t value)\r
+{\r
+  uint32_t result;\r
+  \r
+  __ASM volatile ("revsh %0, %1" : "=r" (result) : "r" (value) );\r
+  return(result);\r
+}\r
+\r
+\r
+#if       (__CORTEX_M >= 0x03)\r
+\r
+/** \brief  Reverse bit order of value\r
+\r
+    This function reverses the bit order of the given value.\r
+\r
+    \param [in]    value  Value to reverse\r
+    \return               Reversed value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __RBIT(uint32_t value)\r
+{\r
+  uint32_t result;\r
+  \r
+   __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  LDR Exclusive (8 bit)\r
+\r
+    This function performs a exclusive LDR command for 8 bit value.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return             value of type uint8_t at (*ptr)\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint8_t __LDREXB(volatile uint8_t *addr)\r
+{\r
+    uint8_t result;\r
+  \r
+   __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  LDR Exclusive (16 bit)\r
+\r
+    This function performs a exclusive LDR command for 16 bit values.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return        value of type uint16_t at (*ptr)\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint16_t __LDREXH(volatile uint16_t *addr)\r
+{\r
+    uint16_t result;\r
+  \r
+   __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  LDR Exclusive (32 bit)\r
+\r
+    This function performs a exclusive LDR command for 32 bit values.\r
+\r
+    \param [in]    ptr  Pointer to data\r
+    \return        value of type uint32_t at (*ptr)\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __LDREXW(volatile uint32_t *addr)\r
+{\r
+    uint32_t result;\r
+  \r
+   __ASM volatile ("ldrex %0, [%1]" : "=r" (result) : "r" (addr) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  STR Exclusive (8 bit)\r
+\r
+    This function performs a exclusive STR command for 8 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)\r
+{\r
+   uint32_t result;\r
+  \r
+   __ASM volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  STR Exclusive (16 bit)\r
+\r
+    This function performs a exclusive STR command for 16 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)\r
+{\r
+   uint32_t result;\r
+  \r
+   __ASM volatile ("strexh %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  STR Exclusive (32 bit)\r
+\r
+    This function performs a exclusive STR command for 32 bit values.\r
+\r
+    \param [in]  value  Value to store\r
+    \param [in]    ptr  Pointer to location\r
+    \return          0  Function succeeded\r
+    \return          1  Function failed\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)\r
+{\r
+   uint32_t result;\r
+  \r
+   __ASM volatile ("strex %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );\r
+   return(result);\r
+}\r
+\r
+\r
+/** \brief  Remove the exclusive lock\r
+\r
+    This function removes the exclusive lock which is created by LDREX.\r
+\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE void __CLREX(void)\r
+{\r
+  __ASM volatile ("clrex");\r
+}\r
+\r
+\r
+/** \brief  Signed Saturate\r
+\r
+    This function saturates a signed value.\r
+\r
+    \param [in]  value  Value to be saturated\r
+    \param [in]    sat  Bit position to saturate to (1..32)\r
+    \return             Saturated value\r
+ */\r
+#define __SSAT(ARG1,ARG2) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("ssat %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+\r
+/** \brief  Unsigned Saturate\r
+\r
+    This function saturates an unsigned value.\r
+\r
+    \param [in]  value  Value to be saturated\r
+    \param [in]    sat  Bit position to saturate to (0..31)\r
+    \return             Saturated value\r
+ */\r
+#define __USAT(ARG1,ARG2) \\r
+({                          \\r
+  uint32_t __RES, __ARG1 = (ARG1); \\r
+  __ASM ("usat %0, %1, %2" : "=r" (__RES) :  "I" (ARG2), "r" (__ARG1) ); \\r
+  __RES; \\r
+ })\r
+\r
+\r
+/** \brief  Count leading zeros\r
+\r
+    This function counts the number of leading zeros of a data value.\r
+\r
+    \param [in]  value  Value to count the leading zeros\r
+    \return             number of leading zeros in value\r
+ */\r
+__attribute__( ( always_inline ) ) static __INLINE uint8_t __CLZ(uint32_t value)\r
+{\r
+  uint8_t result;\r
+  \r
+  __ASM volatile ("clz %0, %1" : "=r" (result) : "r" (value) );\r
+  return(result);\r
+}\r
+\r
+#endif /* (__CORTEX_M >= 0x03) */\r
+\r
+\r
+\r
+\r
+#elif defined ( __TASKING__ ) /*------------------ TASKING Compiler --------------*/\r
+/* TASKING carm specific functions */\r
+\r
+/*\r
+ * The CMSIS functions have been implemented as intrinsics in the compiler.\r
+ * Please use "carm -?i" to get an up to date list of all intrinsics,\r
+ * Including the CMSIS ones.\r
+ */\r
+\r
+#endif\r
+\r
+/*@}*/ /* end of group CMSIS_Core_InstructionInterface */\r
+\r
+#endif /* __CORE_CMINSTR_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/debug_frmwrk.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/debug_frmwrk.h
new file mode 100644 (file)
index 0000000..ac4618c
--- /dev/null
@@ -0,0 +1,90 @@
+/**********************************************************************\r
+* $Id$         debug_frmwrk.h                  2011-06-02\r
+*//**\r
+* @file                debug_frmwrk.h\r
+* @brief       Contains some utilities that used for debugging through UART\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup DEBUG_FRMWRK DEBUG FRAMEWORK\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef DEBUG_FRMWRK_H_\r
+#define DEBUG_FRMWRK_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_uart.h"\r
+\r
+#define VCOM_DEBUG_MESSEGES\r
+//#define UART_DEBUG_MESSEGES\r
+\r
+#define USED_UART_DEBUG_PORT   1\r
+\r
+#if (USED_UART_DEBUG_PORT==0)\r
+#define DEBUG_UART_PORT        LPC_UART0\r
+#elif (USED_UART_DEBUG_PORT==1)\r
+#define DEBUG_UART_PORT        LPC_UART1\r
+#endif\r
+\r
+#define _DBG(x)                _db_msg((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBG_(x)       _db_msg_((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBC(x)                _db_char((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBD(x)                _db_dec((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBD16(x)       _db_dec_16((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBD32(x)       _db_dec_32((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBH(x)                _db_hex((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBH16(x)       _db_hex_16((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DBH32(x)       _db_hex_32((LPC_USARTn_Type*)DEBUG_UART_PORT, x)\r
+#define _DG                    _db_get_char((LPC_USARTn_Type*)DEBUG_UART_PORT)\r
+void  lpc_printf (const  char *format, ...);\r
+\r
+extern void (*_db_msg)(LPC_USARTn_Type *UARTx, const void *s);\r
+extern void (*_db_msg_)(LPC_USARTn_Type *UARTx, const void *s);\r
+extern void (*_db_char)(LPC_USARTn_Type *UARTx, uint8_t ch);\r
+extern void (*_db_dec)(LPC_USARTn_Type *UARTx, uint8_t decn);\r
+extern void (*_db_dec_16)(LPC_USARTn_Type *UARTx, uint16_t decn);\r
+extern void (*_db_dec_32)(LPC_USARTn_Type *UARTx, uint32_t decn);\r
+extern void (*_db_hex)(LPC_USARTn_Type *UARTx, uint8_t hexn);\r
+extern void (*_db_hex_16)(LPC_USARTn_Type *UARTx, uint16_t hexn);\r
+extern void (*_db_hex_32)(LPC_USARTn_Type *UARTx, uint32_t hexn);\r
+extern uint8_t (*_db_get_char)(LPC_USARTn_Type *UARTx);\r
+\r
+void UARTPutChar (LPC_USARTn_Type *UARTx, uint8_t ch);\r
+void UARTPuts(LPC_USARTn_Type *UARTx, const void *str);\r
+void UARTPuts_(LPC_USARTn_Type *UARTx, const void *str);\r
+void UARTPutDec(LPC_USARTn_Type *UARTx, uint8_t decnum);\r
+void UARTPutDec16(LPC_USARTn_Type *UARTx, uint16_t decnum);\r
+void UARTPutDec32(LPC_USARTn_Type *UARTx, uint32_t decnum);\r
+void UARTPutHex (LPC_USARTn_Type *UARTx, uint8_t hexnum);\r
+void UARTPutHex16 (LPC_USARTn_Type *UARTx, uint16_t hexnum);\r
+void UARTPutHex32 (LPC_USARTn_Type *UARTx, uint32_t hexnum);\r
+uint8_t UARTGetChar (LPC_USARTn_Type *UARTx);\r
+void debug_frmwrk_init(void);\r
+\r
+#endif /* DEBUG_FRMWRK_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_adc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_adc.h
new file mode 100644 (file)
index 0000000..55d5c86
--- /dev/null
@@ -0,0 +1,295 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_adc.h                   2011-06-02\r
+*//**\r
+* @file                lpc18xx_adc.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for ADC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup ADC ADC (Analog to Digital Converter)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_ADC_H_\r
+#define LPC18XX_ADC_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private macros ------------------------------------------------------------- */\r
+/** @defgroup ADC_Private_Macros ADC Private Macros\r
+ * @{\r
+ */\r
+\r
+/* -------------------------- BIT DEFINITIONS ----------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for ADC  control register\r
+ **********************************************************************/\r
+/**  Selects which of the AD0.0:7 pins is (are) to be sampled and converted */\r
+#define ADC_CR_CH_SEL(n)       ((1UL << n))\r
+/**  The APB clock (PCLK) is divided by (this value plus one)\r
+* to produce the clock for the A/D */\r
+#define ADC_CR_CLKDIV(n)       ((n<<8))\r
+/**  Repeated conversions A/D enable bit */\r
+#define ADC_CR_BURST           ((1UL<<16))\r
+/**  number of accuracy bits */\r
+#define ADC_CR_BITACC(n)       (((n)<<17))\r
+/**  ADC convert in power down mode */\r
+#define ADC_CR_PDN                     ((1UL<<21))\r
+/**  Start mask bits */\r
+#define ADC_CR_START_MASK      ((7UL<<24))\r
+/**  Select Start Mode */\r
+#define ADC_CR_START_MODE_SEL(SEL)     ((SEL<<24))\r
+/**  Start conversion now */\r
+#define ADC_CR_START_NOW               ((1UL<<24))\r
+/**  Start conversion when the edge selected by bit 27 occurs on CTOUT_15 */\r
+#define ADC_CR_START_CTOUT15   ((2UL<<24))\r
+/** Start conversion when the edge selected by bit 27 occurs on CTOUT_8 */\r
+#define ADC_CR_START_CTOUT8            ((3UL<<24))\r
+/**  Start conversion when the edge selected by bit 27 occurs on ADCTRIG0 */\r
+#define ADC_CR_START_ADCTRIG0  ((4UL<<24))\r
+/**  Start conversion when the edge selected by bit 27 occurs on ADCTRIG1 */\r
+#define ADC_CR_START_ADCTRIG1  ((5UL<<24))\r
+/**  Start conversion when the edge selected by bit 27 occurs on Motocon PWM output MCOA2 */\r
+#define ADC_CR_START_MCOA2             ((6UL<<24))\r
+/**  Start conversion on a falling edge on the selected CAP/MAT signal */\r
+#define ADC_CR_EDGE                    ((1UL<<27))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for ADC Global Data register\r
+ **********************************************************************/\r
+/** When DONE is 1, this field contains result value of ADC conversion */\r
+#define ADC_GDR_RESULT(n)              (((n>>4)&0xFFF))\r
+/** These bits contain the channel from which the LS bits were converted */\r
+#define ADC_GDR_CH(n)                  (((n>>24)&0x7))\r
+/** This bit is 1 in burst mode if the results of one or\r
+ * more conversions was (were) lost */\r
+#define ADC_GDR_OVERRUN_FLAG   ((1UL<<30))\r
+/** This bit is set to 1 when an A/D conversion completes */\r
+#define ADC_GDR_DONE_FLAG              ((1UL<<31))\r
+\r
+/** This bits is used to mask for Channel */\r
+#define ADC_GDR_CH_MASK                ((7UL<<24))\r
+/*********************************************************************//**\r
+ * Macro defines for ADC Interrupt register\r
+ **********************************************************************/\r
+/** These bits allow control over which A/D channels generate\r
+ * interrupts for conversion completion */\r
+#define ADC_INTEN_CH(n)                        ((1UL<<n))\r
+/** When 1, enables the global DONE flag in ADDR to generate an interrupt */\r
+#define ADC_INTEN_GLOBAL               ((1UL<<8))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for ADC Data register\r
+ **********************************************************************/\r
+/** When DONE is 1, this field contains result value of ADC conversion */\r
+#define ADC_DR_RESULT(n)               (((n>>6)&0x3FF))\r
+/** These bits mirror the OVERRRUN status flags that appear in the\r
+ * result register for each A/D channel */\r
+#define ADC_DR_OVERRUN_FLAG            ((1UL<<30))\r
+/** This bit is set to 1 when an A/D conversion completes. It is cleared\r
+ * when this register is read */\r
+#define ADC_DR_DONE_FLAG               ((1UL<<31))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for ADC Status register\r
+**********************************************************************/\r
+/** These bits mirror the DONE status flags that appear in the result\r
+ * register for each A/D channel */\r
+#define ADC_STAT_CH_DONE_FLAG(n)               ((n&0xFF))\r
+/** These bits mirror the OVERRRUN status flags that appear in the\r
+ * result register for each A/D channel */\r
+#define ADC_STAT_CH_OVERRUN_FLAG(n)            (((n>>8)&0xFF))\r
+/** This bit is the A/D interrupt flag */\r
+#define ADC_STAT_INT_FLAG                              ((1UL<<16))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for ADC Trim register\r
+**********************************************************************/\r
+/** Offset trim bits for ADC operation */\r
+#define ADC_ADCOFFS(n)         (((n&0xF)<<4))\r
+/** Written to boot code*/\r
+#define ADC_TRIM(n)                (((n&0xF)<<8))\r
+\r
+/* ------------------- CHECK PARAM DEFINITIONS ------------------------- */\r
+/** Check ADC parameter */\r
+#define PARAM_ADCx(n)    (((uint32_t *)n)==((uint32_t *)LPC_ADC0) || ((uint32_t *)n)==((uint32_t *)LPC_ADC1))\r
+\r
+/** Check ADC state parameter */\r
+#define PARAM_ADC_START_ON_EDGE_OPT(OPT)    ((OPT == ADC_START_ON_RISING)||(OPT == ADC_START_ON_FALLING))\r
+\r
+/** Check ADC state parameter */\r
+#define PARAM_ADC_DATA_STATUS(OPT)    ((OPT== ADC_DATA_BURST)||(OPT== ADC_DATA_DONE))\r
+\r
+/** Check ADC rate parameter */\r
+#define PARAM_ADC_RATE(rate)   ((rate>0)&&(rate<=200000))\r
+\r
+/** Check ADC bits accuracy parameter */\r
+#define PARAM_ADC_BITSACC(x)   ((x>=3)&&(x<=10))\r
+\r
+/** Check ADC channel selection parameter */\r
+#define PARAM_ADC_CHANNEL_SELECTION(SEL)       ((SEL == ADC_CHANNEL_0)||(ADC_CHANNEL_1)\\r
+||(SEL == ADC_CHANNEL_2)|(ADC_CHANNEL_3)\\r
+||(SEL == ADC_CHANNEL_4)||(ADC_CHANNEL_5)\\r
+||(SEL == ADC_CHANNEL_6)||(ADC_CHANNEL_7))\r
+\r
+/** Check ADC start option parameter */\r
+#define PARAM_ADC_START_OPT(OPT)    ((OPT == ADC_START_CONTINUOUS)||(OPT == ADC_START_NOW)\\r
+||(OPT == ADC_START_ON_CTOUT15)||(OPT == ADC_START_ON_CTOUT8)\\r
+||(OPT == ADC_START_ON_ADCTRIG0)||(OPT == ADC_START_ON_ADCTRIG1)\\r
+||(OPT == ADC_START_ON_MCOA2))\r
+\r
+/** Check ADC interrupt type parameter */\r
+#define PARAM_ADC_TYPE_INT_OPT(OPT)    ((OPT == ADC_ADINTEN0)||(OPT == ADC_ADINTEN1)\\r
+||(OPT == ADC_ADINTEN2)||(OPT == ADC_ADINTEN3)\\r
+||(OPT == ADC_ADINTEN4)||(OPT == ADC_ADINTEN5)\\r
+||(OPT == ADC_ADINTEN6)||(OPT == ADC_ADINTEN7)\\r
+||(OPT == ADC_ADGINTEN))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup ADC_Public_Types ADC Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief ADC enumeration\r
+ **********************************************************************/\r
+/** @brief Channel Selection */\r
+typedef enum\r
+{\r
+       ADC_CHANNEL_0  = 0, /*!<  Channel 0 */\r
+       ADC_CHANNEL_1,          /*!<  Channel 1 */\r
+       ADC_CHANNEL_2,          /*!<  Channel 2 */\r
+       ADC_CHANNEL_3,          /*!<  Channel 3 */\r
+       ADC_CHANNEL_4,          /*!<  Channel 4 */\r
+       ADC_CHANNEL_5,          /*!<  Channel 5 */\r
+       ADC_CHANNEL_6,          /*!<  Channel 6 */\r
+       ADC_CHANNEL_7           /*!<  Channel 7 */\r
+}ADC_CHANNEL_SELECTION;\r
+\r
+/** @brief Type of start option */\r
+typedef enum\r
+{\r
+       ADC_START_CONTINUOUS =0,        /*!< Continuous mode */\r
+       ADC_START_NOW,                          /*!< Start conversion now */\r
+       ADC_START_ON_CTOUT15,                   /*!< Start conversion when the edge selected\r
+                                                                * by bit 27 occurs on CTOUT_15 */\r
+       ADC_START_ON_CTOUT8,                    /*!< Start conversion when the edge selected\r
+                                                                * by bit 27 occurs on CTOUT_8 */\r
+       ADC_START_ON_ADCTRIG0,                  /*!< Start conversion when the edge selected\r
+                                                                * by bit 27 occurs on ADCTRIG0 */\r
+       ADC_START_ON_ADCTRIG1,                  /*!< Start conversion when the edge selected\r
+                                                                * by bit 27 occurs on ADCTRIG1 */\r
+       ADC_START_ON_MCOA2                      /*!< Start conversion when the edge selected\r
+                                                                 * by bit 27 occurs on Motocon PWM output MCOA2 */\r
+} ADC_START_OPT;\r
+\r
+\r
+/** @brief Type of edge when start conversion on the selected CAP/MAT signal */\r
+typedef enum\r
+{\r
+       ADC_START_ON_RISING = 0,        /*!< Start conversion on a rising edge\r
+                                                               *on the selected CAP/MAT signal */\r
+       ADC_START_ON_FALLING            /*!< Start conversion on a falling edge\r
+                                                               *on the selected CAP/MAT signal */\r
+} ADC_START_ON_EDGE_OPT;\r
+\r
+/** @brief* ADC type interrupt enum */\r
+typedef enum\r
+{\r
+       ADC_ADINTEN0 = 0,               /*!< Interrupt channel 0 */\r
+       ADC_ADINTEN1,                   /*!< Interrupt channel 1 */\r
+       ADC_ADINTEN2,                   /*!< Interrupt channel 2 */\r
+       ADC_ADINTEN3,                   /*!< Interrupt channel 3 */\r
+       ADC_ADINTEN4,                   /*!< Interrupt channel 4 */\r
+       ADC_ADINTEN5,                   /*!< Interrupt channel 5 */\r
+       ADC_ADINTEN6,                   /*!< Interrupt channel 6 */\r
+       ADC_ADINTEN7,                   /*!< Interrupt channel 7 */\r
+       ADC_ADGINTEN                    /*!< Individual channel/global flag done generate an interrupt */\r
+}ADC_TYPE_INT_OPT;\r
+\r
+/** @brief ADC Data  status */\r
+typedef enum\r
+{\r
+       ADC_DATA_BURST = 0,             /*Burst bit*/\r
+       ADC_DATA_DONE            /*Done bit*/\r
+}ADC_DATA_STATUS;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup ADC_Public_Functions ADC Public Functions\r
+ * @{\r
+ */\r
+/* Init/DeInit ADC peripheral ----------------*/\r
+void ADC_Init(LPC_ADCn_Type *ADCx, uint32_t rate, uint8_t bits_accuracy);\r
+void ADC_DeInit(LPC_ADCn_Type *ADCx);\r
+\r
+/* Enable/Disable ADC functions --------------*/\r
+void ADC_BurstCmd(LPC_ADCn_Type *ADCx, FunctionalState NewState);\r
+void ADC_PowerdownCmd(LPC_ADCn_Type *ADCx, FunctionalState NewState);\r
+void ADC_StartCmd(LPC_ADCn_Type *ADCx, uint8_t start_mode);\r
+void ADC_ChannelCmd (LPC_ADCn_Type *ADCx, uint8_t Channel, FunctionalState NewState);\r
+\r
+/* Configure ADC functions -------------------*/\r
+void ADC_EdgeStartConfig(LPC_ADCn_Type *ADCx, uint8_t EdgeOption);\r
+void ADC_IntConfig (LPC_ADCn_Type *ADCx, ADC_TYPE_INT_OPT IntType, FunctionalState NewState);\r
+\r
+/* Get ADC information functions -------------------*/\r
+uint16_t ADC_ChannelGetData(LPC_ADCn_Type *ADCx, uint8_t channel);\r
+FlagStatus ADC_ChannelGetStatus(LPC_ADCn_Type *ADCx, uint8_t channel, uint32_t StatusType);\r
+uint32_t ADC_GlobalGetData(LPC_ADCn_Type *ADCx);\r
+FlagStatus     ADC_GlobalGetStatus(LPC_ADCn_Type *ADCx, uint32_t StatusType);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* LPC18XX_ADC_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_atimer.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_atimer.h
new file mode 100644 (file)
index 0000000..68f0e97
--- /dev/null
@@ -0,0 +1,93 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_atimer.h                        2011-06-02\r
+*//**\r
+* @file                lpc18xx_atimer.h\r
+* @brief       Contains all functions support for Alarm Timer firmware\r
+*                      library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup ATIMER ATIMER (Alarm Timer)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __LPC18XX_ATIMER_H_\r
+#define __LPC18XX_ATIMER_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup ATIMER_Private_Macros ALARM Timer Private Macros\r
+ * @{\r
+ */\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid ALARM TIMER peripheral */\r
+#define PARAM_ATIMERx(n)       (((uint32_t *)n)==((uint32_t *)LPC_ATIMER))\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup ATIMER_Public_Functions ATIMER Public Functions\r
+ * @{\r
+ */\r
+\r
+\r
+/* Init/DeInit ATIMER functions -----------*/\r
+void ATIMER_Init(LPC_ATIMER_Type *ATIMERx, uint32_t PresetValue);\r
+void ATIMER_DeInit(LPC_ATIMER_Type *ATIMERx);\r
+\r
+/* ATIMER interrupt functions -------------*/\r
+void ATIMER_IntEnable(LPC_ATIMER_Type *ATIMERx);\r
+void ATIMER_IntDisable(LPC_ATIMER_Type *ATIMERx);\r
+void ATIMER_ClearIntStatus(LPC_ATIMER_Type *ATIMERx);\r
+void ATIMER_SetIntStatus(LPC_ATIMER_Type *ATIMERx);\r
+\r
+/* ATIMER configuration functions --------*/\r
+void ATIMER_UpdatePresetValue(LPC_ATIMER_Type *ATIMERx,uint32_t PresetValue);\r
+uint32_t ATIMER_GetPresetValue(LPC_ATIMER_Type *ATIMERx);\r
+\r
+/**\r
+ * @}\r
+ */\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __LPC18XX_ATIMER_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_can.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_can.h
new file mode 100644 (file)
index 0000000..e1d7f48
--- /dev/null
@@ -0,0 +1,241 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_can.h                   2011-06-02\r
+*//**\r
+* @file                lpc18xx_can.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for CAN firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup C_CAN C_CAN (Controller Area Network)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __LPC18XX_CAN_H\r
+#define __LPC18XX_CAN_H\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup C_CAN_Public_Macros  C_CAN Public Macros\r
+ * @{\r
+ */\r
+\r
+/** In BASIC_MODE IF1 registers are used directly as TX buffer, IF2 registers are used as RX buffer.\r
+ * If not BASIC_MODE use message objects and IF registers to communicate with message buffers\r
+ */\r
+#define BASIC_MODE             0\r
+\r
+/** In Silent Mode, the CAN controller is able to receive valid data frames and valid remote\r
+ * frames, but it sends only recessive bits on the CAN bus, and it cannot start a transmission\r
+ */\r
+#define SILENT_MODE            0\r
+\r
+/** In Loop-back Mode, the CAN Core treats its own transmitted messages as received messages\r
+ * and stores them (if they pass acceptance filtering) into a Receive Buffer.\r
+ */\r
+#define LOOPBACK_MODE  0\r
+\r
+/** Enables receiving remote frame requests */\r
+#define REMOTE_ENABLE  1\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Private Macros -------------------------------------------------------------- */\r
+/** @defgroup C_CAN_Private_Macros  C_CAN Private Macros\r
+ * @{\r
+ */\r
+\r
+/** MAX CAN message obj */\r
+#define CAN_MSG_OBJ_MAX                        0x0020\r
+/** MAX data length */\r
+#define CAN_DLC_MAX                            8\r
+\r
+/********************************************************************//**\r
+ *  BRP+1 = Fpclk/(CANBitRate * QUANTAValue)\r
+ * QUANTAValue = 1 + (Tseg1+1) + (Tseg2+1)\r
+ * QUANTA value varies based on the Fpclk and sample point\r
+ * e.g. (1) sample point is 87.5%, Fpclk is 48Mhz\r
+ * the QUANTA should be 16\r
+ *             (2) sample point is 90%, Fpclk is 12.5Mhz\r
+ * the QUANTA should be 10\r
+ *              Fpclk = Fclk /APBDIV\r
+ * or\r
+ *  BitRate = Fcclk/(APBDIV * (BRP+1) * ((Tseg1+1)+(Tseg2+1)+1))\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief CAN Bit Timing Values definitions at 8Mhz\r
+ **********************************************************************/\r
+/** Bitrate: 100K */\r
+#define CAN_BITRATE100K12MHZ           0x00004509\r
+/** Bitrate: 125K */\r
+#define CAN_BITRATE125K12MHZ           0x00004507\r
+/** Bitrate: 250K */\r
+#define CAN_BITRATE250K12MHZ           0x00004503\r
+/** Bitrate: 500K */\r
+#define CAN_BITRATE500K12MHZ            0x00004501\r
+/** Bitrate: 1000K */\r
+#define CAN_BITRATE1000K12MHZ          0x00004500\r
+\r
+/*********************************************************************//**\r
+ * @brief CAN Bit Timing Values definitions at 16Mhz\r
+ **********************************************************************/\r
+/** Bitrate: 100K */\r
+#define CAN_BITRATE100K16MHZ          0x00005809\r
+/** Bitrate: 125K */\r
+#define CAN_BITRATE125K16MHZ          0x00005807\r
+/** Bitrate: 250K */\r
+#define CAN_BITRATE250K16MHZ          0x00005803\r
+/** Bitrate: 500K */\r
+#define CAN_BITRATE500K16MHZ          0x00005801\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief CAN Bit Timing Values definitions at 24Mhz\r
+ **********************************************************************/\r
+/** Bitrate: 100K */\r
+#define CAN_BITRATE100K24MHZ          0x00007E09\r
+/** Bitrate: 125K */\r
+#define CAN_BITRATE125K24MHZ          0x0000450F\r
+/** Bitrate: 250K */\r
+#define CAN_BITRATE250K24MHZ          0x00004507\r
+/** Bitrate: 500K */\r
+#define CAN_BITRATE500K24MHZ          0x00004503\r
+/** Bitrate: 1000K */\r
+#define CAN_BITRATE1000K24MHZ         0x00004501\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup CAN_Public_Types CAN Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief CAN enumeration\r
+ **********************************************************************/\r
+\r
+/**\r
+ * @brief CAN interface register type definition\r
+ */\r
+typedef enum CCAN_IFREG\r
+{\r
+       CMDREQ = 0,                             /**< Command request */\r
+       CMDMSK = 1,                             /**< Command mask */\r
+       MSK1 = 2,                               /**< Mask 1 */\r
+       MSK2 = 3,                               /**< Mask 2 */\r
+       ARB1 = 4,                               /**< Arbitration 1 */\r
+       ARB2 = 5,                               /**< Arbitration 2 */\r
+       MCTRL = 6,                              /**< Message control */\r
+       DA1 = 7,                                /**< Data A1 */\r
+       DA2 = 8,                                /**< Data A2 */\r
+       DB1 = 9,                                /**< Data B1 */\r
+       DB2 = 10                                /**< Data B2 */\r
+}CCAN_IFREG_Type;\r
+\r
+/**\r
+ * @brief CAN Clock division rate type definition\r
+ */\r
+typedef enum CCAN_CLKDIV\r
+{\r
+       CLKDIV1         = 0,\r
+       CLKDIV2         = 1,\r
+       CLKDIV3         = 2,\r
+       CLKDIV5         = 3,\r
+       CLKDIV9         = 4,\r
+       CLKDIV17        = 5,\r
+       CLKDIV33        = 6,\r
+       CLKDIV65        = 7\r
+}CCAN_CLKDIV_Type;\r
+\r
+\r
+/********************************************************************//**\r
+* @brief Data structure definition for a CAN message\r
+**********************************************************************/\r
+/**\r
+ * @brief CAN message object structure\r
+ */\r
+typedef struct\r
+{\r
+    uint32_t   id;             /**< ID of message, if bit 30 is set then this is extended frame */\r
+    uint32_t   dlc;    /**< Message data length */\r
+    uint8_t    data[8];        /**< Message data */\r
+} message_object;\r
+\r
+/**\r
+ * @brief CAN call-back function\r
+ */\r
+typedef void (*MSG_CB)(uint32_t msg_no);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup CAN_Public_Functions CAN Public Functions\r
+ * @{\r
+ */\r
+\r
+void CAN_IRQHandler (void);\r
+void CAN_Init( uint32_t BitClk, CCAN_CLKDIV_Type ClkDiv , MSG_CB Tx_cb, MSG_CB Rx_cb);\r
+\r
+void CAN_ConfigureRxMessageObjects( void );\r
+void CAN_RxInt_MessageProcess( uint8_t MsgObjNo );\r
+void CAN_TxInt_MessageProcess( uint8_t MsgObjNo );\r
+\r
+void CAN_Send(uint8_t msg_no, uint32_t *msg_ptr );\r
+void CAN_Recv(uint8_t msg_no, uint32_t *msg_ptr, Bool RemoteEnable);\r
+void CAN_ReadMsg(uint32_t msg_no, message_object* buff);\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* __LPC18XX_CAN_H */\r
+\r
+/**\r
+ * @}\r
+ */\r
+/*****************************************************************************\r
+**                            End Of File\r
+******************************************************************************/\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_cgu.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_cgu.h
new file mode 100644 (file)
index 0000000..93fc161
--- /dev/null
@@ -0,0 +1,271 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_cgu.h                   2011-06-02\r
+*//**\r
+* @file                llpc18xx_cgu.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for Clock Generation and Clock Control firmware\r
+*                      library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup CGU CGU (Clock Generation Unit)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_CGU_H_\r
+#define LPC18XX_CGU_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private Macros -------------------------------------------------------------- */\r
+/** @defgroup CGU_Private_Macros CGU Private Macros\r
+ * @{\r
+ */\r
+\r
+/** Branch clocks from CGU_BASE_SAFE */\r
+#define CGU_ENTITY_NONE                                CGU_ENTITY_NUM\r
+\r
+/** Check bit at specific position is clear or not */\r
+#define ISBITCLR(x,bit)                        ((x&(1<<bit))^(1<<bit))\r
+/** Check bit at specific position is set or not */\r
+#define ISBITSET(x,bit)                        (x&(1<<bit))\r
+/** Set mask */\r
+#define ISMASKSET(x,mask)                      (x&mask)\r
+\r
+/** CGU number of clock source */\r
+#define CGU_CLKSRC_NUM (CGU_CLKSRC_IDIVE+1)\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for CGU control mask bit definitions\r
+ **********************************************************************/\r
+/** CGU control enable mask bit */\r
+#define CGU_CTRL_EN_MASK                       1\r
+/** CGU control clock-source mask bit */\r
+#define CGU_CTRL_SRC_MASK                      (0xF<<24)\r
+/** CGU control auto block mask bit */\r
+#define CGU_CTRL_AUTOBLOCK_MASK                (1<<11)\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for CGU PLL1 mask bit definitions\r
+ **********************************************************************/\r
+/** CGU PLL1 feedback select mask bit */\r
+#define CGU_PLL1_FBSEL_MASK                    (1<<6)\r
+/** CGU PLL1 Input clock bypass control mask bit */\r
+#define CGU_PLL1_BYPASS_MASK           (1<<1)\r
+/** CGU PLL1 direct CCO output mask bit */\r
+#define CGU_PLL1_DIRECT_MASK           (1<<7)\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup CGU_Public_Types CGU Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief CGU enumeration\r
+ **********************************************************************/\r
+/*\r
+ * @brief      CGU clock source enumerate definition
+ */\r
+typedef enum {\r
+       /* Clock Source */\r
+       CGU_CLKSRC_32KHZ_OSC = 0,                                       /**< 32KHz oscillator clock source      */\r
+       CGU_CLKSRC_IRC,                                                         /**< IRC 12 Mhz clock source            */\r
+       CGU_CLKSRC_ENET_RX_CLK,                                         /**< Ethernet receive clock source      */\r
+       CGU_CLKSRC_ENET_TX_CLK,                                         /**< Ethernet transmit clock source */\r
+       CGU_CLKSRC_GP_CLKIN,                                            /**< General purpose clock source       */\r
+       CGU_CLKSRC_TCK,                                                         /**< TCK clock source                           */\r
+       CGU_CLKSRC_XTAL_OSC,                                            /**< Crystal oscillator clock source*/\r
+       CGU_CLKSRC_PLL0,                                                        /**< PLL0 (USB0) clock source           */\r
+       CGU_CLKSRC_PLL0_AUDIO,\r
+       CGU_CLKSRC_PLL1,                                                        /**< PLL1 clock source                          */\r
+       CGU_CLKSRC_IDIVA = CGU_CLKSRC_PLL1 + 3,         /**< IDIVA clock source                         */\r
+       CGU_CLKSRC_IDIVB,                                                       /**< IDIVB clock source                         */\r
+       CGU_CLKSRC_IDIVC,                                                       /**< IDIVC clock source                         */\r
+       CGU_CLKSRC_IDIVD,                                                       /**< IDIVD clock source                         */\r
+       CGU_CLKSRC_IDIVE,                                                       /**< IDIVE clock source                         */\r
+\r
+       /* Base */\r
+       CGU_BASE_SAFE,                                                          /**< Base save clock (always on) for WDT */\r
+       CGU_BASE_USB0,                                                          /**< USB0 base clock                            */\r
+       CGU_BASE_USB1 = CGU_BASE_USB0 + 2,                      /**< USB1 base clock                            */\r
+       CGU_BASE_M3,                                                            /**< ARM Cortex-M3 Core base clock      */\r
+       CGU_BASE_SPIFI,                                                         /**< SPIFI base clock                           */\r
+       //CGU_BASE_SPI,\r
+       CGU_BASE_PHY_RX = CGU_BASE_SPIFI + 2,           /**< Ethernet PHY Rx base clock         */\r
+       CGU_BASE_PHY_TX,                                                        /**< Ethernet PHY Tx base clock         */\r
+       CGU_BASE_APB1,                                                          /**< APB peripheral block #1 base clock */\r
+       CGU_BASE_APB3,                                                          /**< APB peripheral block #3 base clock */\r
+       CGU_BASE_LCD,                                                           /**< LCD base clock                                     */\r
+       CGU_BASE_ENET_CSR,\r
+       CGU_BASE_SDIO,                                                          /**< SDIO base clock                            */\r
+       CGU_BASE_SSP0,                                                          /**< SSP0 base clock                            */\r
+       CGU_BASE_SSP1,                                                          /**< SSP1 base clock                            */\r
+       CGU_BASE_UART0,                                                         /**< UART0 base clock                           */\r
+       CGU_BASE_UART1,                                                         /**< UART1 base clock                           */\r
+       CGU_BASE_UART2,                                                         /**< UART2 base clock                           */\r
+       CGU_BASE_UART3,                                                         /**< UART3 base clock                           */\r
+       CGU_BASE_CLKOUT,                                                        /**< CLKOUT base clock                          */\r
+       CGU_BASE_APLL = CGU_BASE_CLKOUT + 5,\r
+       CGU_BASE_OUT0,\r
+       CGU_BASE_OUT1,\r
+       CGU_ENTITY_NUM                                                          /**< Number or clock source entity      */\r
+} CGU_ENTITY_T;\r
+\r
+/*\r
+ * @brief      CGU PPL0 mode enumerate definition\r
+ */\r
+typedef enum {\r
+       CGU_PLL0_MODE_1d = 0,\r
+       CGU_PLL0_MODE_1c,\r
+       CGU_PLL0_MODE_1b,\r
+       CGU_PLL0_MODE_1a\r
+}CGU_PLL0_MODE;\r
+\r
+/*\r
+ * @brief      CGU peripheral enumerate definition\r
+ */\r
+typedef enum {\r
+       CGU_PERIPHERAL_ADC0 = 0,                                        /**< ADC0               */\r
+       CGU_PERIPHERAL_ADC1,                                            /**< ADC1               */\r
+       CGU_PERIPHERAL_AES,                                                     /**< AES                */\r
+//     CGU_PERIPHERAL_ALARMTIMER_CGU_RGU_RTC_WIC,\r
+       CGU_PERIPHERAL_APB1_BUS,                                        /**< APB1 bus                   */\r
+       CGU_PERIPHERAL_APB3_BUS,                                        /**< APB3 bus                   */\r
+       CGU_PERIPHERAL_CAN,                                                     /**< CAN                                */\r
+       CGU_PERIPHERAL_CREG,                                            /**< CREG                               */\r
+       CGU_PERIPHERAL_DAC,                                                     /**< DAC                                */\r
+       CGU_PERIPHERAL_DMA,                                                     /**< DMA                                */\r
+       CGU_PERIPHERAL_EMC,                                                     /**< EMC                                */\r
+       CGU_PERIPHERAL_ETHERNET,                                        /**< Ethernet                   */\r
+       CGU_PERIPHERAL_ETHERNET_TX, //HIDE                      /**< Ethernet transmit  */\r
+       CGU_PERIPHERAL_GPIO,                                            /**< GPIO                               */\r
+       CGU_PERIPHERAL_I2C0,                                            /**< I2C0                               */\r
+       CGU_PERIPHERAL_I2C1,                                            /**< I2C1                               */\r
+       CGU_PERIPHERAL_I2S,                                                     /**< I2S                                */\r
+       CGU_PERIPHERAL_LCD,                                                     /**< LCD                                */\r
+       CGU_PERIPHERAL_M3CORE,                                          /**< ARM Cortex-M3 Core */\r
+       CGU_PERIPHERAL_M3_BUS,                                          /**< ARM Cortex-M3 Bus  */\r
+       CGU_PERIPHERAL_MOTOCON,                                         /**< Motor Control              */\r
+       CGU_PERIPHERAL_QEI,                                                     /**< QEI                                */\r
+       CGU_PERIPHERAL_RITIMER,                                         /**< RIT Timer                  */\r
+       CGU_PERIPHERAL_SCT,                                                     /**< SCT                                */\r
+       CGU_PERIPHERAL_SCU,                                                     /**< SCU                                */\r
+       CGU_PERIPHERAL_SDIO,                                            /**< SDIO                               */\r
+       CGU_PERIPHERAL_SPIFI,                                           /**< SPIFI                              */\r
+       CGU_PERIPHERAL_SSP0,                                            /**< SSP0                               */\r
+       CGU_PERIPHERAL_SSP1,                                            /**< SSP1                               */\r
+       CGU_PERIPHERAL_TIMER0,                                          /**< TIMER 0                    */\r
+       CGU_PERIPHERAL_TIMER1,                                          /**< TIMER 1                    */\r
+       CGU_PERIPHERAL_TIMER2,                                          /**< TIMER 2                    */\r
+       CGU_PERIPHERAL_TIMER3,                                          /**< TIMER 3                    */\r
+       CGU_PERIPHERAL_UART0,                                           /**< UART0                              */\r
+       CGU_PERIPHERAL_UART1,                                           /**< UART1                              */\r
+       CGU_PERIPHERAL_UART2,                                           /**< UART2                              */\r
+       CGU_PERIPHERAL_UART3,                                           /**< UART3                              */\r
+       CGU_PERIPHERAL_USB0,                                            /**< USB0                               */\r
+       CGU_PERIPHERAL_USB1,                                            /**< USB1                               */\r
+       CGU_PERIPHERAL_WWDT,                                            /**< WWDT                               */\r
+       CGU_PERIPHERAL_NUM\r
+} CGU_PERIPHERAL_T;\r
+\r
+/**\r
+ *  @brief     CGU error status enumerate definition\r
+ */\r
+typedef enum {\r
+       CGU_ERROR_SUCCESS = 0,\r
+       CGU_ERROR_CONNECT_TOGETHER,\r
+       CGU_ERROR_INVALID_ENTITY,\r
+       CGU_ERROR_INVALID_CLOCK_SOURCE,\r
+       CGU_ERROR_INVALID_PARAM,\r
+       CGU_ERROR_FREQ_OUTOF_RANGE\r
+} CGU_ERROR;\r
+\r
+/********************************************************************//**\r
+* @brief CGU structure definitions\r
+**********************************************************************/\r
+/*\r
+ * @brief      CGU peripheral clock structure
+ */\r
+typedef struct {\r
+       uint8_t RegBaseEntity;                                          /**< Base register address              */\r
+       uint16_t RegBranchOffset;                                       /**< Branch register offset             */\r
+       uint8_t PerBaseEntity;                                          /**< Base peripheral address    */\r
+       uint16_t PerBranchOffset;                                       /**< Base peripheral offset             */\r
+       uint8_t next;                                                           /**< Pointer to next structure  */\r
+} CGU_PERIPHERAL_S;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup CGU_Public_Functions CGU Public Functions\r
+ * @{\r
+ */\r
+\r
+/** Clock generate initialize/de-initialize */\r
+uint32_t       CGU_Init(void);\r
+uint32_t       CGU_DeInit(void);\r
+\r
+/** Clock Generator and Clock Control */\r
+uint32_t       CGU_ConfigPWR (CGU_PERIPHERAL_T PPType, FunctionalState en);\r
+uint32_t       CGU_GetPCLKFrequency (CGU_PERIPHERAL_T Clock);\r
+\r
+/** Clock Source and Base Clock operation */\r
+uint32_t       CGU_SetXTALOSC(uint32_t ClockFrequency);\r
+uint32_t       CGU_SetDIV(CGU_ENTITY_T SelectDivider, uint32_t divisor);\r
+uint32_t       CGU_SetPLL0(void);\r
+uint32_t       CGU_SetPLL1(uint32_t mult);\r
+uint32_t       CGU_EnableEntity(CGU_ENTITY_T ClockEntity, uint32_t en);\r
+uint32_t       CGU_EntityConnect(CGU_ENTITY_T ClockSource, CGU_ENTITY_T ClockEntity);\r
+uint32_t       CGU_GetBaseStatus(CGU_ENTITY_T Base);\r
+void           CGU_UpdateClock(void);\r
+uint32_t       CGU_RealFrequencyCompare(CGU_ENTITY_T Clock, CGU_ENTITY_T CompareToClock, uint32_t *m, uint32_t *d);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_CGU_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_clkpwr.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_clkpwr.h
new file mode 100644 (file)
index 0000000..251cf7c
--- /dev/null
@@ -0,0 +1,219 @@
+/***********************************************************************//**\r
+ * @file               lpc18xx_clkpwr.h\r
+ * @brief              Contains all macro definitions and function prototypes\r
+ *                             support for Clock and Power Control firmware library on LPC18xx\r
+ * @version            1.0\r
+ * @date               14. Dec. 2010\r
+ * @author             NXP MCU SW Application Team\r
+ **************************************************************************\r
+ * Software that is described herein is for illustrative purposes only\r
+ * which provides customers with programming information regarding the\r
+ * products. This software is supplied "AS IS" without any warranties.\r
+ * NXP Semiconductors assumes no responsibility or liability for the\r
+ * use of the software, conveys no license or title under any patent,\r
+ * copyright, or mask work right to the product. NXP Semiconductors\r
+ * reserves the right to make changes in the software without\r
+ * notification. NXP Semiconductors also make no representation or\r
+ * warranty that such application will be suitable for the specified\r
+ * use without further testing or modification.\r
+ **************************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup CLKPWR CLKPWR\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_CLKPWR_H_\r
+#define LPC18XX_CLKPWR_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup CLKPWR_Public_Macros CLKPWR Public Macros\r
+ * @{\r
+ */\r
+\r
+typedef enum {\r
+       /* Clock Source */\r
+       CLKPWR_CLKSRC_32KHZ_OSC = 0,\r
+       CLKPWR_CLKSRC_IRC,\r
+       CLKPWR_CLKSRC_ENET_RX_CLK,\r
+       CLKPWR_CLKSRC_ENET_TX_CLK,\r
+       CLKPWR_CLKSRC_GP_CLKIN,\r
+       CLKPWR_CLKSRC_TCK,\r
+       CLKPWR_CLKSRC_XTAL_OSC,\r
+       CLKPWR_CLKSRC_PLL0,\r
+       CLKPWR_CLKSRC_PLL1,\r
+       CLKPWR_CLKSRC_IDIVA = CLKPWR_CLKSRC_PLL1 + 3,\r
+       CLKPWR_CLKSRC_IDIVB,\r
+       CLKPWR_CLKSRC_IDIVC,\r
+       CLKPWR_CLKSRC_IDIVD,\r
+       CLKPWR_CLKSRC_IDIVE,\r
+\r
+       /* Base */\r
+       CLKPWR_BASE_SAFE,\r
+       CLKPWR_BASE_USB0,\r
+       CLKPWR_BASE_USB1 = CLKPWR_BASE_USB0 + 2,\r
+       CLKPWR_BASE_M3,\r
+       CLKPWR_BASE_SPIFI,\r
+       //CLKPWR_BASE_SPI,\r
+       CLKPWR_BASE_PHY_RX = CLKPWR_BASE_SPIFI + 2,\r
+       CLKPWR_BASE_PHY_TX,\r
+       CLKPWR_BASE_APB1,\r
+       CLKPWR_BASE_APB3,\r
+       CLKPWR_BASE_LCD,\r
+       CLKPWR_BASE_SDIO = CLKPWR_BASE_LCD + 2,\r
+       CLKPWR_BASE_SSP0,\r
+       CLKPWR_BASE_SSP1,\r
+       CLKPWR_BASE_UART0,\r
+       CLKPWR_BASE_UART1,\r
+       CLKPWR_BASE_UART2,\r
+       CLKPWR_BASE_UART3,\r
+       CLKPWR_BASE_CLKOUT,\r
+       CLKPWR_ENTITY_NUM\r
+} CLKPWR_ENTITY_T;\r
+\r
+#define CLKPWR_CLKSRC_NUM (CLKPWR_CLKSRC_IDIVE+1)\r
+\r
+typedef enum {\r
+       CLKPWR_PLL0_MODE_1d = 0,\r
+       CLKPWR_PLL0_MODE_1c,\r
+       CLKPWR_PLL0_MODE_1b,\r
+       CLKPWR_PLL0_MODE_1a,\r
+}CLKPWR_PLL0_MODE;\r
+\r
+typedef enum {\r
+       CLKPWR_PERIPHERAL_ADC0 = 0,\r
+       CLKPWR_PERIPHERAL_ADC1,\r
+       CLKPWR_PERIPHERAL_AES,\r
+//     CLKPWR_PERIPHERAL_ALARMTIMER_CGU_RGU_RTC_WIC,\r
+       CLKPWR_PERIPHERAL_APB1_BUS,\r
+       CLKPWR_PERIPHERAL_APB3_BUS,\r
+       CLKPWR_PERIPHERAL_CAN,\r
+       CLKPWR_PERIPHERAL_CREG,\r
+       CLKPWR_PERIPHERAL_DAC,\r
+       CLKPWR_PERIPHERAL_DMA,\r
+       CLKPWR_PERIPHERAL_EMC,\r
+       CLKPWR_PERIPHERAL_ETHERNET,\r
+       CLKPWR_PERIPHERAL_ETHERNET_TX, //HIDE\r
+       CLKPWR_PERIPHERAL_GPIO,\r
+       CLKPWR_PERIPHERAL_I2C0,\r
+       CLKPWR_PERIPHERAL_I2C1,\r
+       CLKPWR_PERIPHERAL_I2S,\r
+       CLKPWR_PERIPHERAL_LCD,\r
+       CLKPWR_PERIPHERAL_M3CORE,\r
+       CLKPWR_PERIPHERAL_M3_BUS,\r
+       CLKPWR_PERIPHERAL_MOTOCON,\r
+       CLKPWR_PERIPHERAL_QEI,\r
+       CLKPWR_PERIPHERAL_RITIMER,\r
+       CLKPWR_PERIPHERAL_SCT,\r
+       CLKPWR_PERIPHERAL_SCU,\r
+       CLKPWR_PERIPHERAL_SDIO,\r
+       CLKPWR_PERIPHERAL_SPIFI,\r
+       CLKPWR_PERIPHERAL_SSP0,\r
+       CLKPWR_PERIPHERAL_SSP1,\r
+       CLKPWR_PERIPHERAL_TIMER0,\r
+       CLKPWR_PERIPHERAL_TIMER1,\r
+       CLKPWR_PERIPHERAL_TIMER2,\r
+       CLKPWR_PERIPHERAL_TIMER3,\r
+       CLKPWR_PERIPHERAL_UART0,\r
+       CLKPWR_PERIPHERAL_UART1,\r
+       CLKPWR_PERIPHERAL_UART2,\r
+       CLKPWR_PERIPHERAL_UART3,\r
+       CLKPWR_PERIPHERAL_USB0,\r
+       CLKPWR_PERIPHERAL_USB1,\r
+       CLKPWR_PERIPHERAL_WWDT,\r
+       CLKPWR_PERIPHERAL_NUM\r
+} CLKPWR_PERIPHERAL_T;\r
+//typedef CLKPWR_CLK_T CLKPWR_BASE_T;\r
+\r
+typedef struct {\r
+       uint8_t RegBaseEntity;\r
+       uint16_t RegBranchOffset;\r
+       uint8_t PerBaseEntity;\r
+       uint16_t PerBranchOffset;\r
+       uint8_t next;\r
+} CLKPWR_PERIPHERAL_S;\r
+\r
+typedef enum {\r
+       CLKPWR_ERROR_SUCCESS = 0,\r
+       CLKPWR_ERROR_CONNECT_TOGETHER,\r
+       CLKPWR_ERROR_INVALID_ENTITY,\r
+       CLKPWR_ERROR_INVALID_CLOCK_SOURCE,\r
+       CLKPWR_ERROR_INVALID_PARAM,\r
+       CLKPWR_ERROR_FREQ_OUTOF_RANGE\r
+} CLKPWR_ERROR;\r
+\r
+/* Branch clocks from CLKPWR_BASE_SAFE */\r
+\r
+#define CLKPWR_ENTITY_NONE     CLKPWR_ENTITY_NUM\r
+\r
+#define ISBITCLR(x,bit) ((x&(1<<bit))^(1<<bit))\r
+#define ISBITSET(x,bit) (x&(1<<bit))\r
+#define ISMASKSET(x,mask) (x&mask)\r
+\r
+#define CLKPWR_CTRL_EN_MASK            1\r
+#define CLKPWR_CTRL_SRC_MASK   (0xF<<24)\r
+#define CLKPWR_CTRL_AUTOBLOCK_MASK     (1<<11)\r
+#define CLKPWR_PLL1_FBSEL_MASK (1<<6)\r
+#define CLKPWR_PLL1_BYPASS_MASK        (1<<1)\r
+#define CLKPWR_PLL1_DIRECT_MASK        (1<<7)\r
+\r
+#define CLKPWR_SLEEP_MODE_DEEP_SLEEP   0x3F00AA\r
+#define CLKPWR_SLEEP_MODE_POWER_DOWN   0x3FFCBA\r
+#define CLKPWR_SLEEP_MODE_DEEP_POWER_DOWN      0x3FFF7F\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup CLKPWR_Public_Functions CLKPWR Public Functions\r
+ * @{\r
+ */\r
+/* Clock Generator */\r
+\r
+uint32_t       CLKPWR_ConfigPWR (CLKPWR_PERIPHERAL_T PPType, FunctionalState en);\r
+\r
+uint32_t       CLKPWR_GetPCLKFrequency (CLKPWR_PERIPHERAL_T Clock);\r
+\r
+/* Clock Source and Base Clock operation */\r
+uint32_t       CLKPWR_SetXTALOSC(uint32_t ClockFrequency);\r
+uint32_t       CLKPWR_SetDIV(CLKPWR_ENTITY_T SelectDivider, uint32_t divisor);\r
+uint32_t       CLKPWR_SetPLL0(void);\r
+uint32_t       CLKPWR_SetPLL1(uint32_t mult);\r
+uint32_t       CLKPWR_EnableEntity(CLKPWR_ENTITY_T ClockEntity, uint32_t en);\r
+uint32_t       CLKPWR_EntityConnect(CLKPWR_ENTITY_T ClockSource, CLKPWR_ENTITY_T ClockEntity);\r
+uint32_t       CLKPWR_GetBaseStatus(CLKPWR_ENTITY_T Base);\r
+\r
+void           CLKPWR_UpdateClock(void);\r
+uint32_t       CLKPWR_RealFrequencyCompare(CLKPWR_ENTITY_T Clock, CLKPWR_ENTITY_T CompareToClock, uint32_t *m, uint32_t *d);\r
+\r
+uint32_t       CLKPWR_Init(void);\r
+uint32_t       CLKPWR_DeInit(void);\r
+\r
+void CLKPWR_Sleep(void);\r
+void CLKPWR_DeepSleep(void);\r
+void CLKPWR_PowerDown(void);\r
+void CLKPWR_DeepPowerDown(void);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_CLKPWR_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_dac.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_dac.h
new file mode 100644 (file)
index 0000000..df47bdf
--- /dev/null
@@ -0,0 +1,149 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_dac.h                   2011-06-02\r
+*//**\r
+* @file                lpc18xx_dac.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for DAC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup DAC DAC (Digital to Analog Converter)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_DAC_H_\r
+#define LPC18XX_DAC_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup DAC_Private_Macros DAC Private Macros\r
+ * @{\r
+ */\r
+\r
+/** After the selected settling time after this field is written with a\r
+new VALUE, the voltage on the AOUT pin (with respect to VSSA)\r
+is VALUE/1024 Ã— VREF */\r
+#define DAC_VALUE(n)           ((uint32_t)((n&0x3FF)<<6))\r
+/** If this bit = 0: The settling time of the DAC is 1 microsecond max,\r
+ * and the maximum current is 700 microAmpere\r
+ * If this bit = 1: The settling time of the DAC is 2.5 microsecond\r
+ * and the maximum current is 350 microAmpere */\r
+#define DAC_BIAS_EN                    ((uint32_t)(1<<16))\r
+/** Value to reload interrupt DMA counter */\r
+#define DAC_CCNT_VALUE(n)  ((uint32_t)(n&0xffff))\r
+\r
+/** DCAR double buffering */\r
+#define DAC_DBLBUF_ENA         ((uint32_t)(1<<1))\r
+/** DCAR Time out count enable */\r
+#define DAC_CNT_ENA                    ((uint32_t)(1<<2))\r
+/** DCAR DMA access */\r
+#define DAC_DMA_ENA                    ((uint32_t)(1<<3))\r
+/** DCAR DACCTRL mask bit */\r
+#define DAC_DACCTRL_MASK       ((uint32_t)(0x0F))\r
+\r
+/** Macro to determine if it is valid DAC peripheral */\r
+#define PARAM_DACx(n)  (((uint32_t *)n)==((uint32_t *)LPC_DAC))\r
+\r
+/** Macro to check DAC current optional parameter */\r
+#define        PARAM_DAC_CURRENT_OPT(OPTION) ((OPTION == DAC_MAX_CURRENT_700uA)\\r
+||(OPTION == DAC_MAX_CURRENT_350uA))\r
+\r
+/**\r
+ * @}\r
+ */\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup DAC_Public_Types DAC Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief Current option in DAC configuration option */\r
+typedef enum\r
+{\r
+       DAC_MAX_CURRENT_700uA = 0,      /*!< The settling time of the DAC is 1 us max,\r
+                                                               and the maximum current is 700 uA */\r
+       DAC_MAX_CURRENT_350uA           /*!< The settling time of the DAC is 2.5 us\r
+                                                               and the maximum current is 350 uA */\r
+} DAC_CURRENT_OPT;\r
+\r
+/**\r
+ * @brief Configuration for DAC converter control register */\r
+typedef struct\r
+{\r
+\r
+       uint8_t  DBLBUF_ENA;            /**<\r
+                                               -0: Disable DACR double buffering\r
+                                               -1: when bit CNT_ENA, enable DACR double buffering feature\r
+                                                               */\r
+       uint8_t  CNT_ENA;                       /*!<\r
+                                               -0: Time out counter is disable\r
+                                               -1: Time out conter is enable\r
+                                                               */\r
+       uint8_t  DMA_ENA;                       /*!<\r
+                                               -0: DMA access is disable\r
+                                               -1: DMA burst request\r
+                                                               */\r
+       uint8_t RESERVED;\r
+\r
+} DAC_CONVERTER_CFG_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup DAC_Public_Functions DAC Public Functions\r
+ * @{\r
+ */\r
+\r
+void   DAC_Init(LPC_DAC_Type *DACx);\r
+void    DAC_UpdateValue (LPC_DAC_Type *DACx, uint32_t dac_value);\r
+void    DAC_SetBias (LPC_DAC_Type *DACx,uint32_t bias);\r
+void    DAC_ConfigDAConverterControl (LPC_DAC_Type *DACx,DAC_CONVERTER_CFG_Type *DAC_ConverterConfigStruct);\r
+void   DAC_SetDMATimeOut(LPC_DAC_Type *DACx,uint32_t time_out);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* LPC18XX_DAC_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_emc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_emc.h
new file mode 100644 (file)
index 0000000..4a2f138
--- /dev/null
@@ -0,0 +1,79 @@
+/**********************************************************************
+* $Id: lpc43xx_emc.h 8765 2011-12-08 00:51:21Z nxp21346 $              lpc43xx_emc.h           2011-12-07
+*//**
+* @file                lpc43xx_emc.h
+* @brief       Contains all functions support for Clock Generation and Control
+*                      firmware library on lpc43xx
+* @version     1.0
+* @date                07. December. 2011
+* @author      NXP MCU SW Application Team
+*
+* Copyright(C) 2011, NXP Semiconductor
+* All rights reserved.
+*
+***********************************************************************
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+
+#define __CRYSTAL        (12000000UL)    /* Crystal Oscillator frequency          */
+#define __PLLMULT               (15)
+#define __PLLOUTHZ              (__CRYSTAL * __PLLMULT)
+#define __EMCDIV                (2)
+#define __EMCHZ                         (__PLLOUTHZ / __EMCDIV)
+
+void MemoryPinInit(void);
+void EMCFlashInit(void);
+
+/* SDRAM Address Base for DYCS0*/
+#define SDRAM_BASE_ADDR 0x28000000
+#define FLASH_BASE_ADDR 0x1C000000
+
+#define EMC_SDRAM_WIDTH_8_BITS         0
+#define EMC_SDRAM_WIDTH_16_BITS                1
+#define EMC_SDRAM_WIDTH_32_BITS                2
+
+#define EMC_SDRAM_SIZE_16_MBITS                0
+#define EMC_SDRAM_SIZE_64_MBITS                1
+#define EMC_SDRAM_SIZE_128_MBITS       2
+#define EMC_SDRAM_SIZE_256_MBITS       3
+#define EMC_SDRAM_SIZE_512_MBITS       4
+
+#define EMC_SDRAM_DATA_BUS_16_BITS     0
+#define EMC_SDRAM_DATA_BUS_32_BITS     1
+
+#define EMC_B_ENABLE                                   (1 << 19)
+#define EMC_ENABLE                                             (1 << 0)
+#define EMC_CE_ENABLE                                  (1 << 0)
+#define EMC_CS_ENABLE                                  (1 << 1)
+#define EMC_CLOCK_DELAYED_STRATEGY             (0 << 0)
+#define EMC_COMMAND_DELAYED_STRATEGY   (1 << 0)
+#define EMC_COMMAND_DELAYED_STRATEGY2  (2 << 0)
+#define EMC_COMMAND_DELAYED_STRATEGY3  (3 << 0)
+#define EMC_INIT(i)                                    ((i) << 7)
+#define EMC_NORMAL                                             (0)
+#define EMC_MODE                                               (1)
+#define EMC_PRECHARGE_ALL                              (2)
+#define EMC_NOP                                                (3)
+
+/* The Hitex LPC18xx Evaluation board contains a 64Mb SDRAM with a 16-bit data bus */
+#define SDRAM_SIZE_BYTES               (1024UL * 1024UL * 8UL)
+#define SDRAM_WIDTH                            EMC_SDRAM_WIDTH_16_BITS
+#define SDRAM_SIZE_MBITS               EMC_SDRAM_SIZE_64_MBITS
+#define SDRAM_DATA_BUS_BITS            EMC_SDRAM_DATA_BUS_16_BITS                      
+#define SDRAM_COL_ADDR_BITS            8               
+#define CLK0_DELAY     0
+
+void vEMC_InitSRDRAM(uint32_t u32BaseAddr, uint32_t u32Width, uint32_t u32Size, uint32_t u32DataBus, uint32_t u32ColAddrBits);
+void emc_WaitUS(volatile uint32_t us);
+void emc_WaitMS(uint32_t ms);
+
+
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_evrt.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_evrt.h
new file mode 100644 (file)
index 0000000..b2ac2c2
--- /dev/null
@@ -0,0 +1,146 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_evrt.h                  2011-06-02\r
+*//**\r
+* @file                lpc18xx_evrt.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for Event Router firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup EVRT EVRT (Event Router)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_EVRT_H_\r
+#define LPC18XX_EVRT_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup EVRT_Private_Macros EVRT Private Macros\r
+ * @{\r
+ */\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid EVRT peripheral */\r
+#define PARAM_EVRTx(x) (((uint32_t *)x)==((uint32_t *)LPC_EVENTROUTER))\r
+\r
+/* Macro check EVRT source */\r
+#define PARAM_EVRT_SOURCE(n)   ((n==EVRT_SRC_WAKEUP0) || (n==EVRT_SRC_WAKEUP1) \\r
+|| (n==EVRT_SRC_WAKEUP2) || (n==EVRT_SRC_WAKEUP3) \\r
+|| (n==EVRT_SRC_ATIMER) || (n==EVRT_SRC_RTC) \\r
+|| (n==EVRT_SRC_BOD1) || (n==EVRT_SRC_WWDT) \\r
+|| (n==EVRT_SRC_ETHERNET) || (n==EVRT_SRC_USB0) \\r
+|| (n==EVRT_SRC_USB1) || (n==EVRT_SRC_CCAN) || (n==EVRT_SRC_SDIO) \\r
+|| (n==EVRT_SRC_COMBINE_TIMER2) || (n==EVRT_SRC_COMBINE_TIMER6) \\r
+|| (n==EVRT_SRC_QEI) || (n==EVRT_SRC_COMBINE_TIMER14) \\r
+|| (n==EVRT_SRC_RESET)) \\r
+\r
+/* Macro check EVRT source active type*/\r
+#define PARAM_EVRT_SOURCE_ACTIVE_TYPE(n) ((n==EVRT_SRC_ACTIVE_LOW_LEVEL) || (n==EVRT_SRC_ACTIVE_HIGH_LEVEL) \\r
+                || (n==EVRT_SRC_ACTIVE_FALLING_EDGE) || (n==EVRT_SRC_ACTIVE_RISING_EDGE))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup EVRT_Public_Types EVRT Public Types\r
+ * @{\r
+ */\r
+\r
+/** @brief EVRT input sources */\r
+typedef enum {\r
+       EVRT_SRC_WAKEUP0,                               /**< WAKEUP0 event router source                */\r
+       EVRT_SRC_WAKEUP1,                               /**< WAKEUP1 event router source                */\r
+       EVRT_SRC_WAKEUP2,                               /**< WAKEUP2 event router source                */\r
+       EVRT_SRC_WAKEUP3,                               /**< WAKEUP3 event router source                */\r
+       EVRT_SRC_ATIMER,                                /**< Alarm timer event router source    */\r
+       EVRT_SRC_RTC,                                   /**< RTC event router source                    */\r
+       EVRT_SRC_BOD1,                                  /**< BOD event router source                    */\r
+       EVRT_SRC_WWDT,                                  /**< WWDT event router source                   */\r
+       EVRT_SRC_ETHERNET,                              /**< Ethernet event router source               */\r
+       EVRT_SRC_USB0,                                  /**< USB0 event router source                   */\r
+       EVRT_SRC_USB1,                                  /**< USB1 event router source                   */\r
+       EVRT_SRC_SDIO,                                  /**< Reserved                                                   */\r
+       EVRT_SRC_CCAN,                                  /**< C_CAN event router source                  */\r
+       EVRT_SRC_COMBINE_TIMER2,                /**< Combined timer 2 event router source       */\r
+       EVRT_SRC_COMBINE_TIMER6,                /**< Combined timer 6 event router source       */\r
+       EVRT_SRC_QEI,                                   /**< QEI event router source                    */\r
+       EVRT_SRC_COMBINE_TIMER14,               /**< Combined timer 14 event router source      */\r
+       EVRT_SRC_RESERVED1,                             /**< Reserved                                                   */\r
+       EVRT_SRC_RESERVED2,                             /**< Reserved                                                   */\r
+       EVRT_SRC_RESET                                  /**< Reset event router source                  */\r
+} EVRT_SRC_ENUM;\r
+\r
+\r
+/** @brief EVRT input sources detecting type */\r
+typedef enum {\r
+       EVRT_SRC_ACTIVE_LOW_LEVEL,              /**< Active low level           */\r
+       EVRT_SRC_ACTIVE_HIGH_LEVEL,             /**< Active high level          */\r
+       EVRT_SRC_ACTIVE_FALLING_EDGE,   /**< Active falling edge        */\r
+       EVRT_SRC_ACTIVE_RISING_EDGE     /**< Active rising edge         */\r
+}EVRT_SRC_ACTIVE_TYPE;\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup EVRT_Public_Functions EVRT Public Functions\r
+ * @{\r
+ */\r
+\r
+void EVRT_Init (LPC_EVENTROUTER_Type *EVRTx);\r
+void EVRT_DeInit(LPC_EVENTROUTER_Type *EVRTx);\r
+\r
+void EVRT_ConfigIntSrcActiveType(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, EVRT_SRC_ACTIVE_TYPE type);\r
+void EVRT_SetUpIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, FunctionalState state);\r
+Bool EVRT_IsSourceInterrupting(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src);\r
+void EVRT_ClrPendIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_EVRT_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpdma.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpdma.h
new file mode 100644 (file)
index 0000000..41ce486
--- /dev/null
@@ -0,0 +1,468 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_gpdma.h         2011-06-02\r
+*//**\r
+* @file                lpc18xx_gpdma.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for GPDMA firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup GPDMA GPDMA (General Purpose DMA)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_GPDMA_H_\r
+#define LPC18XX_GPDMA_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup GPDMA_Public_Macros GPDMA Public Macros\r
+ * @{\r
+ */\r
+\r
+/** DMA Connection number definitions */\r
+#define GPDMA_CONN_SPIFI                       ((0UL))                 /**< SPIFI                              */\r
+#define GPDMA_CONN_MAT0_0                      ((1UL))                 /**< MAT0.0                     */\r
+#define GPDMA_CONN_UART0_Tx                    ((2UL))                 /**< UART0 Tx                   */\r
+#define GPDMA_CONN_MAT0_1                      ((3UL))                 /**< MAT0.1                     */\r
+#define GPDMA_CONN_UART0_Rx                    ((4UL))                 /**< UART0 Rx                   */\r
+#define GPDMA_CONN_MAT1_0                      ((5UL))                 /**< MAT1.0                     */\r
+#define GPDMA_CONN_UART1_Tx                    ((6UL))                 /**< UART1 Tx                   */\r
+#define GPDMA_CONN_MAT1_1              ((7UL))                 /**< MAT1.1                     */\r
+#define GPDMA_CONN_UART1_Rx                    ((8UL))                 /**< UART1 Rx                   */\r
+#define GPDMA_CONN_MAT2_0              ((9UL))                 /**< MAT2.0                     */\r
+#define GPDMA_CONN_UART2_Tx                    ((10UL))                /**< UART2 Tx                   */\r
+#define GPDMA_CONN_MAT2_1              ((11UL))                /**< MAT2.1                     */\r
+#define GPDMA_CONN_UART2_Rx                    ((12UL))                /**< UART2 Rx                   */\r
+#define GPDMA_CONN_MAT3_0                      ((13UL))                /**< MAT3.0                     */\r
+#define GPDMA_CONN_UART3_Tx                    ((14UL))                /**< UART3 Tx                   */\r
+#define GPDMA_CONN_SCT_0                       ((15UL))                /**< SCT timer channel 0*/\r
+#define GPDMA_CONN_MAT3_1              ((16UL))                /**< MAT3.1                     */\r
+#define GPDMA_CONN_UART3_Rx                    ((17UL))                /**< UART3 Rx                   */\r
+#define GPDMA_CONN_SCT_1                       ((18UL))                /**< SCT timer channel 1*/\r
+#define GPDMA_CONN_SSP0_Rx                     ((19UL))                /**< SSP0 Rx                    */\r
+#define GPDMA_CONN_I2S_Channel_0       ((20UL))                /**< I2S channel 0              */\r
+#define GPDMA_CONN_SSP0_Tx                     ((21UL))                /**< SSP0 Tx                    */\r
+#define GPDMA_CONN_I2S_Channel_1       ((22UL))                /**< I2S channel 1              */\r
+#define GPDMA_CONN_SSP1_Rx                     ((23UL))                /**< SSP1 Rx                    */\r
+#define GPDMA_CONN_SSP1_Tx                     ((24UL))                /**< SSP1 Tx                    */\r
+#define GPDMA_CONN_ADC_0                       ((25UL))                /**< ADC 0                              */\r
+#define GPDMA_CONN_ADC_1                       ((26UL))                /**< ADC 1                              */\r
+#define GPDMA_CONN_DAC                                 ((27UL))                /**< DAC                                */\r
+\r
+/** GPDMA Transfer type definitions */\r
+#define GPDMA_TRANSFERTYPE_M2M_CONTROLLER_DMA                          ((0UL))         /**< Memory to memory - DMA control */\r
+#define GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA                          ((1UL))         /**< Memory to peripheral - DMA control */\r
+#define GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA                          ((2UL))         /**< Peripheral to memory - DMA control */\r
+#define GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DMA                          ((3UL))         /**< Source peripheral to destination peripheral - DMA control */\r
+#define GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DestPERIPHERAL       ((4UL))         /**< Source peripheral to destination peripheral - destination peripheral control */\r
+#define GPDMA_TRANSFERTYPE_M2P_CONTROLLER_PERIPHERAL           ((5UL))         /**< Memory to peripheral - peripheral control */\r
+#define GPDMA_TRANSFERTYPE_P2M_CONTROLLER_PERIPHERAL           ((6UL))         /**< Peripheral to memory - peripheral control */\r
+#define GPDMA_TRANSFERTYPE_P2P_CONTROLLER_SrcPERIPHERAL                ((7UL))         /**< Source peripheral to destination peripheral - source peripheral control */\r
+\r
+/** Burst size in Source and Destination definitions */\r
+#define GPDMA_BSIZE_1  ((0UL)) /**< Burst size = 1 */\r
+#define GPDMA_BSIZE_4  ((1UL)) /**< Burst size = 4 */\r
+#define GPDMA_BSIZE_8  ((2UL)) /**< Burst size = 8 */\r
+#define GPDMA_BSIZE_16         ((3UL)) /**< Burst size = 16 */\r
+#define GPDMA_BSIZE_32         ((4UL)) /**< Burst size = 32 */\r
+#define GPDMA_BSIZE_64         ((5UL)) /**< Burst size = 64 */\r
+#define GPDMA_BSIZE_128 ((6UL)) /**< Burst size = 128 */\r
+#define GPDMA_BSIZE_256 ((7UL)) /**< Burst size = 256 */\r
+\r
+/** Width in Source transfer width and Destination transfer width definitions */\r
+#define GPDMA_WIDTH_BYTE               ((0UL)) /**< Width = 1 byte */\r
+#define GPDMA_WIDTH_HALFWORD   ((1UL)) /**< Width = 2 bytes */\r
+#define GPDMA_WIDTH_WORD               ((2UL)) /**< Width = 4 bytes */\r
+\r
+/** LPC_GPDMA base addresses   */\r
+#define LPC_GPDMACH0_BASE      0x40002100\r
+#define LPC_GPDMACH1_BASE      0x40002120\r
+#define LPC_GPDMACH2_BASE      0x40002140\r
+#define LPC_GPDMACH3_BASE      0x40002160\r
+#define LPC_GPDMACH4_BASE      0x40002180\r
+#define LPC_GPDMACH5_BASE      0x400021A0\r
+#define LPC_GPDMACH6_BASE      0x400021C0\r
+#define LPC_GPDMACH7_BASE      0x400021E0\r
+\r
+/* LPC_GPDMA channels definitions      */\r
+#define LPC_GPDMACH0          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH0_BASE )\r
+#define LPC_GPDMACH1          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH1_BASE )\r
+#define LPC_GPDMACH2          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH2_BASE )\r
+#define LPC_GPDMACH3          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH3_BASE )\r
+#define LPC_GPDMACH4          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH4_BASE )\r
+#define LPC_GPDMACH5          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH5_BASE )\r
+#define LPC_GPDMACH6          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH6_BASE )\r
+#define LPC_GPDMACH7          ((LPC_GPDMACH_TypeDef   *) LPC_GPDMACH7_BASE )\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup GPDMA_Private_Macros GPDMA Private Macros\r
+ * @{\r
+ */\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Interrupt Status register\r
+ **********************************************************************/\r
+#define GPDMA_DMACIntStat_Ch(n)                        (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACIntStat_BITMASK              ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Interrupt Terminal Count Request Status register\r
+ **********************************************************************/\r
+#define GPDMA_DMACIntTCStat_Ch(n)              (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACIntTCStat_BITMASK            ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Interrupt Terminal Count Request Clear register\r
+ **********************************************************************/\r
+#define GPDMA_DMACIntTCClear_Ch(n)             (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACIntTCClear_BITMASK   ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Interrupt Error Status register\r
+ **********************************************************************/\r
+#define GPDMA_DMACIntErrStat_Ch(n)             (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACIntErrStat_BITMASK   ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Interrupt Error Clear register\r
+ **********************************************************************/\r
+#define GPDMA_DMACIntErrClr_Ch(n)              (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACIntErrClr_BITMASK            ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Raw Interrupt Terminal Count Status register\r
+ **********************************************************************/\r
+#define GPDMA_DMACRawIntTCStat_Ch(n)   (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACRawIntTCStat_BITMASK ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Raw Error Interrupt Status register\r
+ **********************************************************************/\r
+#define GPDMA_DMACRawIntErrStat_Ch(n)  (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACRawIntErrStat_BITMASK        ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Enabled Channel register\r
+ **********************************************************************/\r
+#define GPDMA_DMACEnbldChns_Ch(n)              (((1UL<<n)&0xFF))\r
+#define GPDMA_DMACEnbldChns_BITMASK            ((0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Software Burst Request register\r
+ **********************************************************************/\r
+#define        GPDMA_DMACSoftBReq_Src(n)               (((1UL<<n)&0xFFFF))\r
+#define GPDMA_DMACSoftBReq_BITMASK             ((0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Software Single Request register\r
+ **********************************************************************/\r
+#define GPDMA_DMACSoftSReq_Src(n)              (((1UL<<n)&0xFFFF))\r
+#define GPDMA_DMACSoftSReq_BITMASK             ((0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Software Last Burst Request register\r
+ **********************************************************************/\r
+#define GPDMA_DMACSoftLBReq_Src(n)             (((1UL<<n)&0xFFFF))\r
+#define GPDMA_DMACSoftLBReq_BITMASK            ((0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Software Last Single Request register\r
+ **********************************************************************/\r
+#define GPDMA_DMACSoftLSReq_Src(n)             (((1UL<<n)&0xFFFF))\r
+#define GPDMA_DMACSoftLSReq_BITMASK            ((0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Configuration register\r
+ **********************************************************************/\r
+#define GPDMA_DMACConfig_E                             ((0x01))         /**< DMA Controller enable*/\r
+#define GPDMA_DMACConfig_M0                            ((0x02))         /**< AHB Master 0 endianness configuration*/\r
+#define GPDMA_DMACConfig_M1                            ((0x04))         /**< AHB Master 1 endianness configuration*/\r
+#define GPDMA_DMACConfig_BITMASK               ((0x07))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Synchronization register\r
+ **********************************************************************/\r
+#define GPDMA_DMACSync_Src(n)                  (((1UL<<n)&0xFFFF))\r
+#define GPDMA_DMACSync_BITMASK                 ((0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Channel Linked List Item registers\r
+ **********************************************************************/\r
+/** DMA Channel Linked List Item registers bit mask*/\r
+#define GPDMA_DMACCxLLI_BITMASK                ((0xFFFFFFFC))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA channel control registers\r
+ **********************************************************************/\r
+#define GPDMA_DMACCxControl_TransferSize(n) (((n&0xFFF)<<0))   /**< Transfer size*/\r
+#define GPDMA_DMACCxControl_SBSize(n)          (((n&0x07)<<12))        /**< Source burst size*/\r
+#define GPDMA_DMACCxControl_DBSize(n)          (((n&0x07)<<15))        /**< Destination burst size*/\r
+#define GPDMA_DMACCxControl_SWidth(n)          (((n&0x07)<<18))        /**< Source transfer width*/\r
+#define GPDMA_DMACCxControl_DWidth(n)          (((n&0x07)<<21))        /**< Destination transfer width*/\r
+#define GPDMA_DMACCxControl_SrcTransUseAHBMaster1      ((1UL<<24)) /**< Source AHB master select*/\r
+#define GPDMA_DMACCxControl_DestTransUseAHBMaster1     ((1UL<<25)) /**< Destination AHB master select*/\r
+#define GPDMA_DMACCxControl_SI                         ((1UL<<26))             /**< Source increment*/\r
+#define GPDMA_DMACCxControl_DI                         ((1UL<<27))             /**< Destination increment*/\r
+#define GPDMA_DMACCxControl_Prot1                      ((1UL<<28))             /**< Indicates that the access is in user mode or privileged mode*/\r
+#define GPDMA_DMACCxControl_Prot2                      ((1UL<<29))             /**< Indicates that the access is bufferable or not bufferable*/\r
+#define GPDMA_DMACCxControl_Prot3                      ((1UL<<30))             /**< Indicates that the access is cacheable or not cacheable*/\r
+#define GPDMA_DMACCxControl_I                          ((1UL<<31))             /**< Terminal count interrupt enable bit */\r
+/** DMA channel control registers bit mask */\r
+#define GPDMA_DMACCxControl_BITMASK                    ((0xFCFFFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA Channel Configuration registers\r
+ **********************************************************************/\r
+#define GPDMA_DMACCxConfig_E                                   ((1UL<<0))                      /**< DMA control enable*/\r
+#define GPDMA_DMACCxConfig_SrcPeripheral(n)    (((n&0x1F)<<1))         /**< Source peripheral*/\r
+#define GPDMA_DMACCxConfig_DestPeripheral(n)   (((n&0x1F)<<6))         /**< Destination peripheral*/\r
+#define GPDMA_DMACCxConfig_TransferType(n)             (((n&0x7)<<11))         /**< This value indicates the type of transfer*/\r
+#define GPDMA_DMACCxConfig_IE                                  ((1UL<<14))                     /**< Interrupt error mask*/\r
+#define GPDMA_DMACCxConfig_ITC                                         ((1UL<<15))             /**< Terminal count interrupt mask*/\r
+#define GPDMA_DMACCxConfig_L                                   ((1UL<<16))             /**< Lock*/\r
+#define GPDMA_DMACCxConfig_A                                   ((1UL<<17))             /**< Active*/\r
+#define GPDMA_DMACCxConfig_H                                   ((1UL<<18))             /**< Halt*/\r
+/** DMA Channel Configuration registers bit mask */\r
+#define GPDMA_DMACCxConfig_BITMASK                             ((0x7FFFF))\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/* Macros check GPDMA channel */\r
+#define PARAM_GPDMA_CHANNEL(n) (n<=7)\r
+\r
+/* Macros check GPDMA connection type */\r
+#define PARAM_GPDMA_CONN(n)            ((n==GPDMA_CONN_SPIFI) || (n==GPDMA_CONN_DAC) \\r
+|| (n==GPDMA_CONN_SSP0_Tx) || (n==GPDMA_CONN_SSP0_Rx) \\r
+|| (n==GPDMA_CONN_SSP1_Tx) || (n==GPDMA_CONN_SSP1_Rx) \\r
+|| (n==GPDMA_CONN_ADC_0)   || (n==GPDMA_CONN_ADC_1) \\r
+|| (n==GPDMA_CONN_I2S_Channel_0) || (n==GPDMA_CONN_I2S_Channel_1) \\r
+|| (n==GPDMA_CONN_SCT_0)   || (n==GPDMA_CONN_SCT_1) \\r
+|| (n==GPDMA_CONN_UART0_Tx) || (n==GPDMA_CONN_UART0_Rx) \\r
+|| (n==GPDMA_CONN_UART1_Tx) || (n==GPDMA_CONN_UART1_Rx) \\r
+|| (n==GPDMA_CONN_UART2_Tx) || (n==GPDMA_CONN_UART2_Rx) \\r
+|| (n==GPDMA_CONN_UART3_Tx) || (n==GPDMA_CONN_UART3_Rx) \\r
+|| (n==GPDMA_CONN_MAT0_0) || (n==GPDMA_CONN_MAT0_1) \\r
+|| (n==GPDMA_CONN_MAT1_0) || (n==GPDMA_CONN_MAT1_1) \\r
+|| (n==GPDMA_CONN_MAT2_0) || (n==GPDMA_CONN_MAT2_1) \\r
+|| (n==GPDMA_CONN_MAT3_0) || (n==GPDMA_CONN_MAT3_1))\r
+\r
+/* Macros check GPDMA burst size type */\r
+#define PARAM_GPDMA_BSIZE(n)   ((n==GPDMA_BSIZE_1) || (n==GPDMA_BSIZE_4) \\r
+|| (n==GPDMA_BSIZE_8) || (n==GPDMA_BSIZE_16) \\r
+|| (n==GPDMA_BSIZE_32) || (n==GPDMA_BSIZE_64) \\r
+|| (n==GPDMA_BSIZE_128) || (n==GPDMA_BSIZE_256))\r
+\r
+/* Macros check GPDMA width type */\r
+#define PARAM_GPDMA_WIDTH(n) ((n==GPDMA_WIDTH_BYTE) || (n==GPDMA_WIDTH_HALFWORD) \\r
+|| (n==GPDMA_WIDTH_WORD))\r
+\r
+/* Macros check GPDMA status type */\r
+#define PARAM_GPDMA_STAT(n)    ((n==GPDMA_STAT_INT) || (n==GPDMA_STAT_INTTC) \\r
+|| (n==GPDMA_STAT_INTERR) || (n==GPDMA_STAT_RAWINTTC) \\r
+|| (n==GPDMA_STAT_RAWINTERR) || (n==GPDMA_STAT_ENABLED_CH))\r
+\r
+/* Macros check GPDMA transfer type */\r
+#define PARAM_GPDMA_TRANSFERTYPE(n) ((n==GPDMA_TRANSFERTYPE_M2M_CONTROLLER_DMA)||(n==GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA) \\r
+||(n==GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA)||(n==GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DMA)\\r
+||(n==GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DestPERIPHERAL)||(n==GPDMA_TRANSFERTYPE_M2P_CONTROLLER_PERIPHERAL)\\r
+||(n==GPDMA_TRANSFERTYPE_P2M_CONTROLLER_PERIPHERAL)||(n==GPDMA_TRANSFERTYPE_P2P_CONTROLLER_SrcPERIPHERAL))\r
+\r
+/* Macros check GPDMA state clear type */\r
+#define PARAM_GPDMA_STATCLR(n) ((n==GPDMA_STATCLR_INTTC) || (n==GPDMA_STATCLR_INTERR))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup GPDMA_Public_Types GPDMA Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief GPDMA Channel Registers\r
+ */\r
+typedef struct\r
+{\r
+  __IO uint32_t CSrcAddr;\r
+  __IO uint32_t CDestAddr;\r
+  __IO uint32_t CLLI;\r
+  __IO uint32_t CControl;\r
+  __IO uint32_t CConfig;\r
+} LPC_GPDMACH_TypeDef;\r
+\r
+/**\r
+ * @brief GPDMA Status enumeration\r
+ */\r
+typedef enum {\r
+       GPDMA_STAT_INT,                 /**< GPDMA Interrupt Status */\r
+       GPDMA_STAT_INTTC,               /**< GPDMA Interrupt Terminal Count Request Status */\r
+       GPDMA_STAT_INTERR,              /**< GPDMA Interrupt Error Status */\r
+       GPDMA_STAT_RAWINTTC,    /**< GPDMA Raw Interrupt Terminal Count Status */\r
+       GPDMA_STAT_RAWINTERR,   /**< GPDMA Raw Error Interrupt Status */\r
+       GPDMA_STAT_ENABLED_CH   /**< GPDMA Enabled Channel Status */\r
+} GPDMA_Status_Type;\r
+\r
+/**\r
+ * @brief GPDMA Interrupt clear status enumeration\r
+ */\r
+typedef enum{\r
+       GPDMA_STATCLR_INTTC,    /**< GPDMA Interrupt Terminal Count Request Clear */\r
+       GPDMA_STATCLR_INTERR    /**< GPDMA Interrupt Error Clear */\r
+}GPDMA_StateClear_Type;\r
+\r
+/**\r
+ * @brief GPDMA Channel configuration structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t ChannelNum;    /**< DMA channel number, should be in\r
+                                                               range from 0 to 7.\r
+                                                               Note: DMA channel 0 has the highest priority\r
+                                                               and DMA channel 7 the lowest priority.\r
+                                                               */\r
+       uint32_t TransferSize;  /**< Length/Size of transfer */\r
+       uint32_t TransferWidth; /**< Transfer width - used for TransferType is GPDMA_TRANSFERTYPE_M2M only */\r
+       uint32_t SrcMemAddr;    /**< Physical Source Address, used in case TransferType is chosen as\r
+                                                                GPDMA_TRANSFERTYPE_M2M or GPDMA_TRANSFERTYPE_M2P */\r
+       uint32_t DstMemAddr;    /**< Physical Destination Address, used in case TransferType is chosen as\r
+                                                                GPDMA_TRANSFERTYPE_M2M or GPDMA_TRANSFERTYPE_P2M */\r
+       uint32_t TransferType;  /**< Transfer Type, should be one of the following:\r
+                                                       - GPDMA_TRANSFERTYPE_M2M_CONTROLLER_DMA: Memory to memory - DMA control\r
+                                                       - GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA: Memory to peripheral - DMA control\r
+                                                       - GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA: Peripheral to memory - DMA control\r
+                                                       - GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DMA: Source peripheral to destination peripheral - DMA control\r
+                                                       - GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DestPERIPHERAL: Source peripheral to destination peripheral - destination peripheral control\r
+                                                       - GPDMA_TRANSFERTYPE_M2P_CONTROLLER_PERIPHERAL: Memory to peripheral - peripheral control\r
+                                                       - GPDMA_TRANSFERTYPE_P2M_CONTROLLER_PERIPHERAL: Peripheral to memory - peripheral control\r
+                                                       - GPDMA_TRANSFERTYPE_P2P_CONTROLLER_SrcPERIPHERAL:      Source peripheral to destination peripheral - source peripheral control\r
+                                                       */\r
+       uint32_t SrcConn;               /**< Peripheral Source Connection type, used in case TransferType is chosen as\r
+                                                       GPDMA_TRANSFERTYPE_P2M or GPDMA_TRANSFERTYPE_P2P, should be one of\r
+                                                       following:\r
+                                                        - GPDMA_CONN_SSP0_Tx: SSP0, Tx\r
+                                                        - GPDMA_CONN_SSP0_Rx: SSP0, Rx\r
+                                                        - GPDMA_CONN_SSP1_Tx: SSP1, Tx\r
+                                                        - GPDMA_CONN_SSP1_Rx: SSP1, Rx\r
+                                                        - GPDMA_CONN_ADC_0: ADC0\r
+                                                        - GPDMA_CONN_ADC_1: ADC1\r
+                                                        - GPDMA_CONN_SCT_0: SCT0\r
+                                                        - GPDMA_CONN_SCT_1: SCT1\r
+                                                        - GPDMA_CONN_I2S_Channel_0: I2S Channel 0\r
+                                                        - GPDMA_CONN_I2S_Channel_1: I2S Channel 1\r
+                                                        - GPDMA_CONN_DAC: DAC\r
+                                                        - GPDMA_CONN_SPIFI: SPIFI\r
+                                                        - GPDMA_CONN_UART0_Tx_MAT0_0: UART0 Tx / MAT0.0\r
+                                                        - GPDMA_CONN_UART0_Rx_MAT0_1: UART0 Rx / MAT0.1\r
+                                                        - GPDMA_CONN_UART1_Tx_MAT1_0: UART1 Tx / MAT1.0\r
+                                                        - GPDMA_CONN_UART1_Rx_MAT1_1: UART1 Rx / MAT1.1\r
+                                                        - GPDMA_CONN_UART2_Tx_MAT2_0: UART2 Tx / MAT2.0\r
+                                                        - GPDMA_CONN_UART2_Rx_MAT2_1: UART2 Rx / MAT2.1\r
+                                                        - GPDMA_CONN_UART3_Tx_MAT3_0: UART3 Tx / MAT3.0\r
+                                                        - GPDMA_CONN_UART3_Rx_MAT3_1: UART3 Rx / MAT3.1\r
+                                                        */\r
+       uint32_t DstConn;               /**< Peripheral Destination Connection type, used in case TransferType is chosen as\r
+                                                       GPDMA_TRANSFERTYPE_M2P or GPDMA_TRANSFERTYPE_P2P, should be one of\r
+                                                       following:\r
+                                                        - GPDMA_CONN_SSP0_Tx: SSP0, Tx\r
+                                                        - GPDMA_CONN_SSP0_Rx: SSP0, Rx\r
+                                                        - GPDMA_CONN_SSP1_Tx: SSP1, Tx\r
+                                                        - GPDMA_CONN_SSP1_Rx: SSP1, Rx\r
+                                                        - GPDMA_CONN_ADC_0: ADC0\r
+                                                        - GPDMA_CONN_ADC_1: ADC1\r
+                                                        - GPDMA_CONN_SCT_0: SCT0\r
+                                                        - GPDMA_CONN_SCT_1: SCT1\r
+                                                        - GPDMA_CONN_I2S_Channel_0: I2S Channel 0\r
+                                                        - GPDMA_CONN_I2S_Channel_1: I2S Channel 1\r
+                                                        - GPDMA_CONN_DAC: DAC\r
+                                                        - GPDMA_CONN_SPIFI: SPIFI\r
+                                                        - GPDMA_CONN_UART0_Tx_MAT0_0: UART0 Tx / MAT0.0\r
+                                                        - GPDMA_CONN_UART0_Rx_MAT0_1: UART0 Rx / MAT0.1\r
+                                                        - GPDMA_CONN_UART1_Tx_MAT1_0: UART1 Tx / MAT1.0\r
+                                                        - GPDMA_CONN_UART1_Rx_MAT1_1: UART1 Rx / MAT1.1\r
+                                                        - GPDMA_CONN_UART2_Tx_MAT2_0: UART2 Tx / MAT2.0\r
+                                                        - GPDMA_CONN_UART2_Rx_MAT2_1: UART2 Rx / MAT2.1\r
+                                                        - GPDMA_CONN_UART3_Tx_MAT3_0: UART3 Tx / MAT3.0\r
+                                                        - GPDMA_CONN_UART3_Rx_MAT3_1: UART3 Rx / MAT3.1\r
+                                                        */\r
+       uint32_t DMALLI;                /**< Linker List Item structure data address\r
+                                                       if there's no Linker List, set as '0'\r
+                                                       */\r
+} GPDMA_Channel_CFG_Type;\r
+\r
+/**\r
+ * @brief GPDMA Linker List Item structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t SrcAddr;       /**< Source Address */\r
+       uint32_t DstAddr;       /**< Destination address */\r
+       uint32_t NextLLI;       /**< Next LLI address, otherwise set to '0' */\r
+       uint32_t Control;       /**< GPDMA Control of this LLI */\r
+} GPDMA_LLI_Type;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup GPDMA_Public_Functions GPDMA Public Functions\r
+ * @{\r
+ */\r
+\r
+void GPDMA_Init(void);\r
+\r
+Status GPDMA_Setup(GPDMA_Channel_CFG_Type *GPDMAChannelConfig);\r
+IntStatus GPDMA_IntGetStatus(GPDMA_Status_Type type, uint8_t channel);\r
+void GPDMA_ClearIntPending(GPDMA_StateClear_Type type, uint8_t channel);\r
+void GPDMA_ChannelCmd(uint8_t channelNum, FunctionalState NewState);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_GPDMA_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpio.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_gpio.h
new file mode 100644 (file)
index 0000000..26b8880
--- /dev/null
@@ -0,0 +1,186 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_gpio.h          2011-06-02\r
+*//**\r
+* @file                lpc18xx_gpio.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for GPIO firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup GPIO     GPIO (General Purpose I/O)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_GPIO_H_\r
+#define LPC18XX_GPIO_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup GPIO_Public_Macros GPIO Public Macros\r
+ * @{\r
+ */\r
+#if 0\r
+/** General LPC GPIO Base */\r
+#define LPC_GPIO_BASE  LPC_GPIO0_BASE\r
+/** Fast GPIO port 0 byte accessible definition */\r
+#define GPIO0_Byte     ((GPIO_Byte_TypeDef *)(LPC_GPIO_BASE+0x00))\r
+/** Fast GPIO port 1 byte accessible definition */\r
+#define GPIO1_Byte     ((GPIO_Byte_TypeDef *)(LPC_GPIO_BASE+0x20))\r
+/** Fast GPIO port 2 byte accessible definition */\r
+#define GPIO2_Byte     ((GPIO_Byte_TypeDef *)(LPC_GPIO_BASE+0x40))\r
+/** Fast GPIO port 3 byte accessible definition */\r
+#define GPIO3_Byte     ((GPIO_Byte_TypeDef *)(LPC_GPIO_BASE+0x60))\r
+/** Fast GPIO port 4 byte accessible definition */\r
+#define GPIO4_Byte     ((GPIO_Byte_TypeDef *)(LPC_GPIO_BASE+0x80))\r
+\r
+\r
+/** Fast GPIO port 0 half-word accessible definition */\r
+#define GPIO0_HalfWord ((GPIO_HalfWord_TypeDef *)(LPC_GPIO_BASE+0x00))\r
+/** Fast GPIO port 1 half-word accessible definition */\r
+#define GPIO1_HalfWord ((GPIO_HalfWord_TypeDef *)(LPC_GPIO_BASE+0x20))\r
+/** Fast GPIO port 2 half-word accessible definition */\r
+#define GPIO2_HalfWord ((GPIO_HalfWord_TypeDef *)(LPC_GPIO_BASE+0x40))\r
+/** Fast GPIO port 3 half-word accessible definition */\r
+#define GPIO3_HalfWord ((GPIO_HalfWord_TypeDef *)(LPC_GPIO_BASE+0x60))\r
+/** Fast GPIO port 4 half-word accessible definition */\r
+#define GPIO4_HalfWord ((GPIO_HalfWord_TypeDef *)(LPC_GPIO_BASE+0x80))\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup GPIO_Public_Types GPIO Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief Fast GPIO port byte type definition\r
+ */\r
+ #if 0\r
+typedef struct {\r
+       __IO uint8_t FIODIR[4];         /**< FIO direction register in byte-align */\r
+          uint32_t RESERVED0[3];       /**< Reserved */\r
+       __IO uint8_t FIOMASK[4];        /**< FIO mask register in byte-align */\r
+       __IO uint8_t FIOPIN[4];         /**< FIO pin register in byte align */\r
+       __IO uint8_t FIOSET[4];         /**< FIO set register in byte-align */\r
+       __O  uint8_t FIOCLR[4];         /**< FIO clear register in byte-align */\r
+} GPIO_Byte_TypeDef;\r
+#endif\r
+\r
+/**\r
+ * @brief Fast GPIO port half-word type definition\r
+ */\r
+ #if 0\r
+typedef struct {\r
+       __IO uint16_t FIODIRL;          /**< FIO direction register lower halfword part */\r
+       __IO uint16_t FIODIRU;          /**< FIO direction register upper halfword part */\r
+          uint32_t RESERVED0[3];       /**< Reserved */\r
+       __IO uint16_t FIOMASKL;         /**< FIO mask register lower halfword part */\r
+       __IO uint16_t FIOMASKU;         /**< FIO mask register upper halfword part */\r
+       __IO uint16_t FIOPINL;          /**< FIO pin register lower halfword part */\r
+       __IO uint16_t FIOPINU;          /**< FIO pin register upper halfword part */\r
+       __IO uint16_t FIOSETL;          /**< FIO set register lower halfword part */\r
+       __IO uint16_t FIOSETU;          /**< FIO set register upper halfword part */\r
+       __O  uint16_t FIOCLRL;          /**< FIO clear register lower halfword part */\r
+       __O  uint16_t FIOCLRU;          /**< FIO clear register upper halfword part */\r
+} GPIO_HalfWord_TypeDef;\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup GPIO_Public_Functions GPIO Public Functions\r
+ * @{\r
+ */\r
+\r
+/* GPIO style ------------------------------- */\r
+void GPIO_SetDir(uint8_t portNum, uint32_t bitValue, uint8_t dir);\r
+void GPIO_SetValue(uint8_t portNum, uint32_t bitValue);\r
+void GPIO_ClearValue(uint8_t portNum, uint32_t bitValue);\r
+uint32_t GPIO_ReadValue(uint8_t portNum);\r
+\r
+#ifdef GPIO_INT\r
+void GPIO_IntCmd(uint8_t portNum, uint32_t bitValue, uint8_t edgeState);\r
+FunctionalState GPIO_GetIntStatus(uint8_t portNum, uint32_t pinNum, uint8_t edgeState);\r
+void GPIO_ClearInt(uint8_t portNum, uint32_t bitValue);\r
+#endif\r
+\r
+\r
+/* FIO (word-accessible) style ------------------------------- */\r
+void FIO_SetDir(uint8_t portNum, uint32_t bitValue, uint8_t dir);\r
+void FIO_SetValue(uint8_t portNum, uint32_t bitValue);\r
+void FIO_ClearValue(uint8_t portNum, uint32_t bitValue);\r
+uint32_t FIO_ReadValue(uint8_t portNum);\r
+void FIO_SetMask(uint8_t portNum, uint32_t bitValue, uint8_t maskValue);\r
+\r
+#ifdef GPIO_INT\r
+void FIO_IntCmd(uint8_t portNum, uint32_t bitValue, uint8_t edgeState);\r
+FunctionalState FIO_GetIntStatus(uint8_t portNum, uint32_t pinNum, uint8_t edgeState);\r
+void FIO_ClearInt(uint8_t portNum, uint32_t pinNum);\r
+#endif\r
+\r
+#if 0\r
+/* FIO (halfword-accessible) style ------------------------------- */\r
+void FIO_HalfWordSetDir(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue, uint8_t dir);\r
+void FIO_HalfWordSetMask(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue, uint8_t maskValue);\r
+void FIO_HalfWordSetValue(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue);\r
+void FIO_HalfWordClearValue(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue);\r
+uint16_t FIO_HalfWordReadValue(uint8_t portNum, uint8_t halfwordNum);\r
+\r
+\r
+/* FIO (byte-accessible) style ------------------------------- */\r
+void FIO_ByteSetDir(uint8_t portNum, uint8_t byteNum, uint8_t bitValue, uint8_t dir);\r
+void FIO_ByteSetMask(uint8_t portNum, uint8_t byteNum, uint8_t bitValue, uint8_t maskValue);\r
+void FIO_ByteSetValue(uint8_t portNum, uint8_t byteNum, uint8_t bitValue);\r
+void FIO_ByteClearValue(uint8_t portNum, uint8_t byteNum, uint8_t bitValue);\r
+uint8_t FIO_ByteReadValue(uint8_t portNum, uint8_t byteNum);\r
+#endif\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_GPIO_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2c.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2c.h
new file mode 100644 (file)
index 0000000..04204e6
--- /dev/null
@@ -0,0 +1,383 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_i2c.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_i2c.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for I2C firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup I2C I2C (Inter-Integrated Circuit)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_I2C_H_\r
+#define LPC18XX_I2C_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup I2C_Private_Macros I2C Private Macros\r
+ * @{\r
+ */\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/*******************************************************************//**\r
+ * I2C Control Set register description\r
+ *********************************************************************/\r
+#define I2C_I2CONSET_AA                                ((0x04)) /*!< Assert acknowledge flag */\r
+#define I2C_I2CONSET_SI                                ((0x08)) /*!< I2C interrupt flag */\r
+#define I2C_I2CONSET_STO                       ((0x10)) /*!< STOP flag */\r
+#define I2C_I2CONSET_STA                       ((0x20)) /*!< START flag */\r
+#define I2C_I2CONSET_I2EN                      ((0x40)) /*!< I2C interface enable */\r
+\r
+/*******************************************************************//**\r
+ * I2C Control Clear register description\r
+ *********************************************************************/\r
+/** Assert acknowledge Clear bit */\r
+#define I2C_I2CONCLR_AAC                       ((1<<2))\r
+/** I2C interrupt Clear bit */\r
+#define I2C_I2CONCLR_SIC                       ((1<<3))\r
+/** START flag Clear bit */\r
+#define I2C_I2CONCLR_STAC                      ((1<<5))\r
+/** I2C interface Disable bit */\r
+#define I2C_I2CONCLR_I2ENC                     ((1<<6))\r
+\r
+/********************************************************************//**\r
+ * I2C Status Code definition (I2C Status register)\r
+ *********************************************************************/\r
+/* Return Code in I2C status register */\r
+#define I2C_STAT_CODE_BITMASK          ((0xF8))\r
+\r
+/* I2C return status code definitions ----------------------------- */\r
+\r
+/** No relevant information */\r
+#define I2C_I2STAT_NO_INF                                              ((0xF8))\r
+\r
+/* Master transmit mode -------------------------------------------- */\r
+/** A start condition has been transmitted */\r
+#define I2C_I2STAT_M_TX_START                                  ((0x08))\r
+/** A repeat start condition has been transmitted */\r
+#define I2C_I2STAT_M_TX_RESTART                                        ((0x10))\r
+/** SLA+W has been transmitted, ACK has been received */\r
+#define I2C_I2STAT_M_TX_SLAW_ACK                               ((0x18))\r
+/** SLA+W has been transmitted, NACK has been received */\r
+#define I2C_I2STAT_M_TX_SLAW_NACK                              ((0x20))\r
+/** Data has been transmitted, ACK has been received */\r
+#define I2C_I2STAT_M_TX_DAT_ACK                                        ((0x28))\r
+/** Data has been transmitted, NACK has been received */\r
+#define I2C_I2STAT_M_TX_DAT_NACK                               ((0x30))\r
+/** Arbitration lost in SLA+R/W or Data bytes */\r
+#define I2C_I2STAT_M_TX_ARB_LOST                               ((0x38))\r
+\r
+/* Master receive mode -------------------------------------------- */\r
+/** A start condition has been transmitted */\r
+#define I2C_I2STAT_M_RX_START                                  ((0x08))\r
+/** A repeat start condition has been transmitted */\r
+#define I2C_I2STAT_M_RX_RESTART                                        ((0x10))\r
+/** Arbitration lost */\r
+#define I2C_I2STAT_M_RX_ARB_LOST                               ((0x38))\r
+/** SLA+R has been transmitted, ACK has been received */\r
+#define I2C_I2STAT_M_RX_SLAR_ACK                               ((0x40))\r
+/** SLA+R has been transmitted, NACK has been received */\r
+#define I2C_I2STAT_M_RX_SLAR_NACK                              ((0x48))\r
+/** Data has been received, ACK has been returned */\r
+#define I2C_I2STAT_M_RX_DAT_ACK                                        ((0x50))\r
+/** Data has been received, NACK has been return */\r
+#define I2C_I2STAT_M_RX_DAT_NACK                               ((0x58))\r
+\r
+/* Slave receive mode -------------------------------------------- */\r
+/** Own slave address has been received, ACK has been returned */\r
+#define I2C_I2STAT_S_RX_SLAW_ACK                               ((0x60))\r
+\r
+/** Arbitration lost in SLA+R/W as master */\r
+#define I2C_I2STAT_S_RX_ARB_LOST_M_SLA                 ((0x68))\r
+/** Own SLA+W has been received, ACK returned */\r
+//#define I2C_I2STAT_S_RX_SLAW_ACK                             ((0x68))\r
+\r
+/** General call address has been received, ACK has been returned */\r
+#define I2C_I2STAT_S_RX_GENCALL_ACK                            ((0x70))\r
+\r
+/** Arbitration lost in SLA+R/W (GENERAL CALL) as master */\r
+#define I2C_I2STAT_S_RX_ARB_LOST_M_GENCALL             ((0x78))\r
+/** General call address has been received, ACK has been returned */\r
+//#define I2C_I2STAT_S_RX_GENCALL_ACK                          ((0x78))\r
+\r
+/** Previously addressed with own SLV address;\r
+ * Data has been received, ACK has been return */\r
+#define I2C_I2STAT_S_RX_PRE_SLA_DAT_ACK                        ((0x80))\r
+/** Previously addressed with own SLA;\r
+ * Data has been received and NOT ACK has been return */\r
+#define I2C_I2STAT_S_RX_PRE_SLA_DAT_NACK               ((0x88))\r
+/** Previously addressed with General Call;\r
+ * Data has been received and ACK has been return */\r
+#define I2C_I2STAT_S_RX_PRE_GENCALL_DAT_ACK            ((0x90))\r
+/** Previously addressed with General Call;\r
+ * Data has been received and NOT ACK has been return */\r
+#define I2C_I2STAT_S_RX_PRE_GENCALL_DAT_NACK   ((0x98))\r
+/** A STOP condition or repeated START condition has\r
+ * been received while still addressed as SLV/REC\r
+ * (Slave Receive) or SLV/TRX (Slave Transmit) */\r
+#define I2C_I2STAT_S_RX_STA_STO_SLVREC_SLVTRX  ((0xA0))\r
+\r
+/** Slave transmit mode */\r
+/** Own SLA+R has been received, ACK has been returned */\r
+#define I2C_I2STAT_S_TX_SLAR_ACK                               ((0xA8))\r
+\r
+/** Arbitration lost in SLA+R/W as master */\r
+#define I2C_I2STAT_S_TX_ARB_LOST_M_SLA                 ((0xB0))\r
+/** Own SLA+R has been received, ACK has been returned */\r
+//#define I2C_I2STAT_S_TX_SLAR_ACK                             ((0xB0))\r
+\r
+/** Data has been transmitted, ACK has been received */\r
+#define I2C_I2STAT_S_TX_DAT_ACK                                        ((0xB8))\r
+/** Data has been transmitted, NACK has been received */\r
+#define I2C_I2STAT_S_TX_DAT_NACK                               ((0xC0))\r
+/** Last data byte in I2DAT has been transmitted (AA = 0);\r
+ ACK has been received */\r
+#define I2C_I2STAT_S_TX_LAST_DAT_ACK                   ((0xC8))\r
+\r
+/** Time out in case of using I2C slave mode */\r
+#define I2C_SLAVE_TIME_OUT                                             0x10000UL\r
+\r
+/********************************************************************//**\r
+ * I2C Data register definition\r
+ *********************************************************************/\r
+/** Mask for I2DAT register*/\r
+#define I2C_I2DAT_BITMASK                      ((0xFF))\r
+\r
+/** Idle data value will be send out in slave mode in case of the actual\r
+ * expecting data requested from the master is greater than its sending data\r
+ * length that can be supported */\r
+#define I2C_I2DAT_IDLE_CHAR                    (0xFF)\r
+\r
+/********************************************************************//**\r
+ * I2C Monitor mode control register description\r
+ *********************************************************************/\r
+#define I2C_I2MMCTRL_MM_ENA                    ((1<<0))                /**< Monitor mode enable */\r
+#define I2C_I2MMCTRL_ENA_SCL           ((1<<1))                /**< SCL output enable */\r
+#define I2C_I2MMCTRL_MATCH_ALL         ((1<<2))                /**< Select interrupt register match */\r
+#define I2C_I2MMCTRL_BITMASK           ((0x07))                /**< Mask for I2MMCTRL register */\r
+\r
+/********************************************************************//**\r
+ * I2C Data buffer register description\r
+ *********************************************************************/\r
+/** I2C Data buffer register bit mask */\r
+#define I2DATA_BUFFER_BITMASK          ((0xFF))\r
+\r
+/********************************************************************//**\r
+ * I2C Slave Address registers definition\r
+ *********************************************************************/\r
+/** General Call enable bit */\r
+#define I2C_I2ADR_GC                           ((1<<0))\r
+/** I2C Slave Address registers bit mask */\r
+#define I2C_I2ADR_BITMASK                      ((0xFF))\r
+\r
+/********************************************************************//**\r
+ * I2C Mask Register definition\r
+ *********************************************************************/\r
+/** I2C Mask Register mask field */\r
+#define I2C_I2MASK_MASK(n)                     ((n&0xFE))\r
+\r
+/********************************************************************//**\r
+ * I2C SCL HIGH duty cycle Register definition\r
+ *********************************************************************/\r
+/** I2C SCL HIGH duty cycle Register bit mask */\r
+#define I2C_I2SCLH_BITMASK                     ((0xFFFF))\r
+\r
+/********************************************************************//**\r
+ * I2C SCL LOW duty cycle Register definition\r
+ *********************************************************************/\r
+/** I2C SCL LOW duty cycle Register bit mask */\r
+#define I2C_I2SCLL_BITMASK                     ((0xFFFF))\r
+\r
+/* I2C status values */\r
+#define I2C_SETUP_STATUS_ARBF   (1<<8) /**< Arbitration false */\r
+#define I2C_SETUP_STATUS_NOACKF (1<<9) /**< No ACK returned */\r
+#define I2C_SETUP_STATUS_DONE   (1<<10)        /**< Status DONE */\r
+\r
+/*********************************************************************//**\r
+ * I2C monitor control configuration defines\r
+ **********************************************************************/\r
+#define I2C_MONITOR_CFG_SCL_OUTPUT     I2C_I2MMCTRL_ENA_SCL            /**< SCL output enable */\r
+#define I2C_MONITOR_CFG_MATCHALL       I2C_I2MMCTRL_MATCH_ALL          /**< Select interrupt register match */\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/* Macros check I2C slave address */\r
+#define PARAM_I2C_SLAVEADDR_CH(n)      (n<=3)\r
+\r
+/** Macro to determine if it is valid SSP port number */\r
+#define PARAM_I2Cx(n)  ((((uint32_t *)n)==((uint32_t *)LPC_I2C0)) \\r
+|| (((uint32_t *)n)==((uint32_t *)LPC_I2C1)))\r
+\r
+/* Macros check I2C monitor configuration type */\r
+#define PARAM_I2C_MONITOR_CFG(n) ((n==I2C_MONITOR_CFG_SCL_OUTPUT) || (I2C_MONITOR_CFG_MATCHALL))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup I2C_Public_Types I2C Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief I2C Own slave address setting structure
+ */\r
+typedef struct {\r
+       uint8_t SlaveAddrChannel;       /**< Slave Address channel in I2C control,\r
+                                                               should be in range from 0..3\r
+                                                               */\r
+       uint8_t SlaveAddr_7bit;         /**< Value of 7-bit slave address */\r
+       uint8_t GeneralCallState;       /**< Enable/Disable General Call Functionality\r
+                                                               when I2C control being in Slave mode, should be:\r
+                                                               - ENABLE: Enable General Call function.\r
+                                                               - DISABLE: Disable General Call function.\r
+                                                               */\r
+       uint8_t SlaveAddrMaskValue;     /**< Any bit in this 8-bit value (bit 7:1)\r
+                                                               which is set to '1' will cause an automatic compare on\r
+                                                               the corresponding bit of the received address when it\r
+                                                               is compared to the SlaveAddr_7bit value associated with this\r
+                                                               mask register. In other words, bits in SlaveAddr_7bit value\r
+                                                               which are masked are not taken into account in determining\r
+                                                               an address match\r
+                                                               */\r
+} I2C_OWNSLAVEADDR_CFG_Type;\r
+\r
+\r
+/**\r
+ * @brief Master transfer setup data structure definitions\r
+ */\r
+typedef struct\r
+{\r
+  uint32_t          sl_addr7bit;                               /**< Slave address in 7bit mode */\r
+  uint8_t*          tx_data;                                   /**< Pointer to Transmit data - NULL if data transmit\r
+                                                                                                         is not used */\r
+  uint32_t          tx_length;                                 /**< Transmit data length - 0 if data transmit\r
+                                                                                                         is not used*/\r
+  uint32_t          tx_count;                                  /**< Current Transmit data counter */\r
+  uint8_t*          rx_data;                                   /**< Pointer to Receive data - NULL if data receive\r
+                                                                                                         is not used */\r
+  uint32_t          rx_length;                                 /**< Receive data length - 0 if data receive is\r
+                                                                                                          not used */\r
+  uint32_t          rx_count;                                  /**< Current Receive data counter */\r
+  uint32_t          retransmissions_max;               /**< Max Re-Transmission value */\r
+  uint32_t          retransmissions_count;             /**< Current Re-Transmission counter */\r
+  uint32_t          status;                                            /**< Current status of I2C activity */\r
+  void                                 (*callback)(void);                      /**< Pointer to Call back function when transmission complete\r
+                                                                                                       used in interrupt transfer mode */\r
+} I2C_M_SETUP_Type;\r
+\r
+\r
+/**\r
+ * @brief Slave transfer setup data structure definitions\r
+ */\r
+typedef struct\r
+{\r
+  uint8_t*          tx_data;                                   /**< Pointer to transmit data - NULL if data transmit is not used */\r
+  uint32_t          tx_length;                                 /**< Transmit data length - 0 if data transmit is not used */\r
+  uint32_t          tx_count;                                  /**< Current transmit data counter      */\r
+  uint8_t*          rx_data;                                   /**< Pointer to receive data - NULL if data received is not used */\r
+  uint32_t          rx_length;                                 /**< Receive data length - 0 if data receive is not used */\r
+  uint32_t          rx_count;                                  /**< Current receive data counter */\r
+  uint32_t          status;                                            /**< Current status of I2C activity */\r
+  void                                 (*callback)(void);                      /**< Pointer to call-back function when transmission complete\r
+                                                                                                       used by interrupt transfer mode */\r
+} I2C_S_SETUP_Type;\r
+\r
+/**\r
+ * @brief Transfer option type definitions\r
+ */\r
+typedef enum {\r
+       I2C_TRANSFER_POLLING = 0,               /**< Transfer in polling mode */\r
+       I2C_TRANSFER_INTERRUPT                  /**< Transfer in interrupt mode */\r
+} I2C_TRANSFER_OPT_Type;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup I2C_Public_Functions I2C Public Functions\r
+ * @{\r
+ */\r
+\r
+/* I2C Init/DeInit functions ---------- */\r
+void I2C_Init(LPC_I2Cn_Type *I2Cx, uint32_t clockrate);\r
+void I2C_DeInit(LPC_I2Cn_Type* I2Cx);\r
+//void I2C_SetClock (LPC_I2Cn_Type *I2Cx, uint32_t target_clock);\r
+void I2C_Cmd(LPC_I2Cn_Type* I2Cx, FunctionalState NewState);\r
+\r
+/* I2C transfer data functions -------- */\r
+Status I2C_MasterTransferData(LPC_I2Cn_Type *I2Cx, \\r
+               I2C_M_SETUP_Type *TransferCfg, I2C_TRANSFER_OPT_Type Opt);\r
+Status I2C_SlaveTransferData(LPC_I2Cn_Type *I2Cx, \\r
+               I2C_S_SETUP_Type *TransferCfg, I2C_TRANSFER_OPT_Type Opt);\r
+uint32_t I2C_MasterTransferComplete(LPC_I2Cn_Type *I2Cx);\r
+uint32_t I2C_SlaveTransferComplete(LPC_I2Cn_Type *I2Cx);\r
+\r
+\r
+void I2C_SetOwnSlaveAddr(LPC_I2Cn_Type *I2Cx, I2C_OWNSLAVEADDR_CFG_Type *OwnSlaveAddrConfigStruct);\r
+uint8_t I2C_GetLastStatusCode(LPC_I2Cn_Type* I2Cx);\r
+\r
+/* I2C Monitor functions ---------------*/\r
+void I2C_MonitorModeConfig(LPC_I2Cn_Type *I2Cx, uint32_t MonitorCfgType, FunctionalState NewState);\r
+void I2C_MonitorModeCmd(LPC_I2Cn_Type *I2Cx, FunctionalState NewState);\r
+uint8_t I2C_MonitorGetDatabuffer(LPC_I2Cn_Type *I2Cx);\r
+BOOL_8 I2C_MonitorHandler(LPC_I2Cn_Type *I2Cx, uint8_t *buffer, uint32_t size);\r
+\r
+/* I2C Interrupt handler functions ------*/\r
+void I2C_IntCmd (LPC_I2Cn_Type *I2Cx, Bool NewState);\r
+void I2C_MasterHandler (LPC_I2Cn_Type *I2Cx);\r
+void I2C_SlaveHandler (LPC_I2Cn_Type *I2Cx);\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_I2C_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2s.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_i2s.h
new file mode 100644 (file)
index 0000000..a86558a
--- /dev/null
@@ -0,0 +1,369 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_i2s.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_i2s.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for I2S firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup I2S I2S (Inter-IC Sound)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_I2S_H_\r
+#define LPC18XX_I2S_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup I2S_Private_Macros I2S Private Macros\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * I2S configuration parameter defines\r
+ **********************************************************************/\r
+/** I2S Wordwidth bit */\r
+#define I2S_WORDWIDTH_8                ((uint32_t)(0))\r
+#define I2S_WORDWIDTH_16       ((uint32_t)(1))\r
+#define I2S_WORDWIDTH_32       ((uint32_t)(3))\r
+/** I2S Channel bit */\r
+#define I2S_STEREO                     ((uint32_t)(0))\r
+#define I2S_MONO                       ((uint32_t)(1))\r
+/** I2S Master/Slave mode bit */\r
+#define I2S_MASTER_MODE                ((uint8_t)(0))\r
+#define I2S_SLAVE_MODE         ((uint8_t)(1))\r
+/** I2S Stop bit */\r
+#define I2S_STOP_ENABLE                ((uint8_t)(1))\r
+#define I2S_STOP_DISABLE       ((uint8_t)(0))\r
+/** I2S Reset bit */\r
+#define I2S_RESET_ENABLE       ((uint8_t)(1))\r
+#define I2S_RESET_DISABLE      ((uint8_t)(0))\r
+/** I2S Mute bit */\r
+#define I2S_MUTE_ENABLE                ((uint8_t)(1))\r
+#define I2S_MUTE_DISABLE       ((uint8_t)(0))\r
+/** I2S Transmit/Receive bit */\r
+#define I2S_TX_MODE                    ((uint8_t)(0))\r
+#define I2S_RX_MODE                    ((uint8_t)(1))\r
+/** I2S Clock Select bit */\r
+#define I2S_CLKSEL_FRDCLK      ((uint8_t)(0))\r
+#define I2S_CLKSEL_MCLK                ((uint8_t)(2))\r
+/** I2S 4-pin Mode bit */\r
+#define I2S_4PIN_ENABLE        ((uint8_t)(1))\r
+#define I2S_4PIN_DISABLE       ((uint8_t)(0))\r
+/** I2S MCLK Enable bit */\r
+#define I2S_MCLK_ENABLE                ((uint8_t)(1))\r
+#define I2S_MCLK_DISABLE       ((uint8_t)(0))\r
+/** I2S select DMA bit */\r
+#define I2S_DMA_1                      ((uint8_t)(0))\r
+#define I2S_DMA_2                      ((uint8_t)(1))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DAO-Digital Audio Output register\r
+ **********************************************************************/\r
+/** I2S wordwide - the number of bytes in data*/\r
+#define I2S_DAO_WORDWIDTH_8            ((uint32_t)(0))         /** 8 bit       */\r
+#define I2S_DAO_WORDWIDTH_16   ((uint32_t)(1))         /** 16 bit      */\r
+#define I2S_DAO_WORDWIDTH_32   ((uint32_t)(3))         /** 32 bit      */\r
+/** I2S control mono or stereo format */\r
+#define I2S_DAO_MONO                   ((uint32_t)(1<<2))\r
+/** I2S control stop mode */\r
+#define I2S_DAO_STOP                   ((uint32_t)(1<<3))\r
+/** I2S control reset mode */\r
+#define I2S_DAO_RESET                  ((uint32_t)(1<<4))\r
+/** I2S control master/slave mode */\r
+#define I2S_DAO_SLAVE                  ((uint32_t)(1<<5))\r
+/** I2S word select half period minus one */\r
+#define I2S_DAO_WS_HALFPERIOD(n)       ((uint32_t)(n<<6))\r
+/** I2S control mute mode */\r
+#define I2S_DAO_MUTE                   ((uint32_t)(1<<15))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DAI-Digital Audio Input register\r
+**********************************************************************/\r
+/** I2S wordwide - the number of bytes in data*/\r
+#define I2S_DAI_WORDWIDTH_8            ((uint32_t)(0))         /** 8 bit       */\r
+#define I2S_DAI_WORDWIDTH_16   ((uint32_t)(1))         /** 16 bit      */\r
+#define I2S_DAI_WORDWIDTH_32   ((uint32_t)(3))         /** 32 bit      */\r
+/** I2S control mono or stereo format */\r
+#define I2S_DAI_MONO                   ((uint32_t)(1<<2))\r
+/** I2S control stop mode */\r
+#define I2S_DAI_STOP                   ((uint32_t)(1<<3))\r
+/** I2S control reset mode */\r
+#define I2S_DAI_RESET                  ((uint32_t)(1<<4))\r
+/** I2S control master/slave mode */\r
+#define I2S_DAI_SLAVE                  ((uint32_t)(1<<5))\r
+/** I2S word select half period minus one (9 bits)*/\r
+#define I2S_DAI_WS_HALFPERIOD(n)       ((uint32_t)((n&0x1FF)<<6))\r
+/** I2S control mute mode */\r
+#define I2S_DAI_MUTE                   ((uint32_t)(1<<15))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for STAT register (Status Feedback register)\r
+**********************************************************************/\r
+/** I2S Status Receive or Transmit Interrupt */\r
+#define I2S_STATE_IRQ          ((uint32_t)(1))\r
+/** I2S Status Receive or Transmit DMA1 */\r
+#define I2S_STATE_DMA1         ((uint32_t)(1<<1))\r
+/** I2S Status Receive or Transmit DMA2 */\r
+#define I2S_STATE_DMA2         ((uint32_t)(1<<2))\r
+/** I2S Status Current level of the Receive FIFO (5 bits)*/\r
+#define I2S_STATE_RX_LEVEL(n)  ((uint32_t)((n&1F)<<8))\r
+/** I2S Status Current level of the Transmit FIFO (5 bits)*/\r
+#define I2S_STATE_TX_LEVEL(n)  ((uint32_t)((n&1F)<<16))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA1 register (DMA1 Configuration register)\r
+**********************************************************************/\r
+/** I2S control DMA1 for I2S receive */\r
+#define I2S_DMA1_RX_ENABLE             ((uint32_t)(1))\r
+/** I2S control DMA1 for I2S transmit */\r
+#define I2S_DMA1_TX_ENABLE             ((uint32_t)(1<<1))\r
+/** I2S set FIFO level that trigger a receive DMA request on DMA1 */\r
+#define I2S_DMA1_RX_DEPTH(n)   ((uint32_t)((n&0x1F)<<8))\r
+/** I2S set FIFO level that trigger a transmit DMA request on DMA1 */\r
+#define I2S_DMA1_TX_DEPTH(n)   ((uint32_t)((n&0x1F)<<16))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMA2 register (DMA2 Configuration register)\r
+**********************************************************************/\r
+/** I2S control DMA2 for I2S receive */\r
+#define I2S_DMA2_RX_ENABLE             ((uint32_t)(1))\r
+/** I2S control DMA1 for I2S transmit */\r
+#define I2S_DMA2_TX_ENABLE             ((uint32_t)(1<<1))\r
+/** I2S set FIFO level that trigger a receive DMA request on DMA1 */\r
+#define I2S_DMA2_RX_DEPTH(n)   ((uint32_t)((n&0x1F)<<8))\r
+/** I2S set FIFO level that trigger a transmit DMA request on DMA1 */\r
+#define I2S_DMA2_TX_DEPTH(n)   ((uint32_t)((n&0x1F)<<16))\r
+\r
+/*********************************************************************//**\r
+* Macro defines for IRQ register (Interrupt Request Control register)\r
+**********************************************************************/\r
+/** I2S control I2S receive interrupt */\r
+#define I2S_IRQ_RX_ENABLE              ((uint32_t)(1))\r
+/** I2S control I2S transmit interrupt */\r
+#define I2S_IRQ_TX_ENABLE              ((uint32_t)(1<<1))\r
+/** I2S set the FIFO level on which to create an irq request */\r
+#define I2S_IRQ_RX_DEPTH(n)            ((uint32_t)((n&0x1F)<<8))\r
+/** I2S set the FIFO level on which to create an irq request */\r
+#define I2S_IRQ_TX_DEPTH(n)            ((uint32_t)((n&0x1F)<<16))\r
+\r
+/********************************************************************************//**\r
+ * Macro defines for TXRATE/RXRATE register (Transmit/Receive Clock Rate register)\r
+*********************************************************************************/\r
+/** I2S Transmit MCLK rate denominator */\r
+#define I2S_TXRATE_Y_DIVIDER(n)        ((uint32_t)(n&0xFF))\r
+/** I2S Transmit MCLK rate denominator */\r
+#define I2S_TXRATE_X_DIVIDER(n)        ((uint32_t)((n&0xFF)<<8))\r
+/** I2S Receive MCLK rate denominator */\r
+#define I2S_RXRATE_Y_DIVIDER(n)        ((uint32_t)(n&0xFF))\r
+/** I2S Receive MCLK rate denominator */\r
+#define I2S_RXRATE_X_DIVIDER(n)        ((uint32_t)((n&0xFF)<<8))\r
+\r
+/*************************************************************************************//**\r
+ * Macro defines for TXBITRATE & RXBITRATE register (Transmit/Receive Bit Rate register)\r
+**************************************************************************************/\r
+#define I2S_TXBITRATE(n)       ((uint32_t)(n&0x3F))\r
+#define I2S_RXBITRATE(n)       ((uint32_t)(n&0x3F))\r
+\r
+/**********************************************************************************//**\r
+ * Macro defines for TXMODE/RXMODE register (Transmit/Receive Mode Control register)\r
+************************************************************************************/\r
+/** I2S Transmit select clock source (2 bits)*/\r
+#define I2S_TXMODE_CLKSEL(n)   ((uint32_t)(n&0x03))\r
+/** I2S Transmit control 4-pin mode */\r
+#define I2S_TXMODE_4PIN_ENABLE ((uint32_t)(1<<2))\r
+/** I2S Transmit control the TX_MCLK output */\r
+#define I2S_TXMODE_MCENA               ((uint32_t)(1<<3))\r
+/** I2S Receive select clock source */\r
+#define I2S_RXMODE_CLKSEL(n)   ((uint32_t)(n&0x03))\r
+/** I2S Receive control 4-pin mode */\r
+#define I2S_RXMODE_4PIN_ENABLE ((uint32_t)(1<<2))\r
+/** I2S Receive control the TX_MCLK output */\r
+#define I2S_RXMODE_MCENA               ((uint32_t)(1<<3))\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid I2S peripheral */\r
+#define PARAM_I2Sx(n)  ((((uint32_t *)n)==((uint32_t *)LPC_I2S0)) || (((uint32_t *)n)==((uint32_t *)LPC_I2S1)))\r
+/** Macro to check Data to send valid */\r
+#define PRAM_I2S_FREQ(freq)            ((freq>=8000)&&(freq <= 96000))\r
+/* Macro check I2S word width type */\r
+#define PARAM_I2S_WORDWIDTH(n) ((n==I2S_WORDWIDTH_8)||(n==I2S_WORDWIDTH_16)\\r
+||(n==I2S_WORDWIDTH_32))\r
+/* Macro check I2S channel type */\r
+#define PARAM_I2S_CHANNEL(n)   ((n==I2S_STEREO)||(n==I2S_MONO))\r
+/* Macro check I2S master/slave mode */\r
+#define PARAM_I2S_WS_SEL(n)            ((n==I2S_MASTER_MODE)||(n==I2S_SLAVE_MODE))\r
+/* Macro check I2S stop mode */\r
+#define PARAM_I2S_STOP(n)      ((n==I2S_STOP_ENABLE)||(n==I2S_STOP_DISABLE))\r
+/* Macro check I2S reset mode */\r
+#define PARAM_I2S_RESET(n)     ((n==I2S_RESET_ENABLE)||(n==I2S_RESET_DISABLE))\r
+/* Macro check I2S reset mode */\r
+#define PARAM_I2S_MUTE(n)      ((n==I2S_MUTE_ENABLE)||(n==I2S_MUTE_DISABLE))\r
+/* Macro check I2S transmit/receive mode */\r
+#define PARAM_I2S_TRX(n)               ((n==I2S_TX_MODE)||(n==I2S_RX_MODE))\r
+/* Macro check I2S clock select mode */\r
+#define PARAM_I2S_CLKSEL(n)            ((n==I2S_CLKSEL_FRDCLK)||(n==I2S_CLKSEL_MCLK))\r
+/* Macro check I2S 4-pin mode */\r
+#define PARAM_I2S_4PIN(n)      ((n==I2S_4PIN_ENABLE)||(n==I2S_4PIN_DISABLE))\r
+/* Macro check I2S MCLK mode */\r
+#define PARAM_I2S_MCLK(n)      ((n==I2S_MCLK_ENABLE)||(n==I2S_MCLK_DISABLE))\r
+/* Macro check I2S DMA mode */\r
+#define PARAM_I2S_DMA(n)               ((n==I2S_DMA_1)||(n==I2S_DMA_2))\r
+/* Macro check I2S DMA depth value */\r
+#define PARAM_I2S_DMA_DEPTH(n) ((n<=31))\r
+/* Macro check I2S irq level value */\r
+#define PARAM_I2S_IRQ_LEVEL(n) ((n<=31))\r
+/* Macro check I2S half-period value */\r
+#define PARAM_I2S_HALFPERIOD(n)        ((n>0)&&(n<512))\r
+/* Macro check I2S bit-rate value */\r
+#define PARAM_I2S_BITRATE(n)   ((n<=63))\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup I2S_Public_Types I2S Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief I2S configuration structure definition\r
+ */\r
+typedef struct {\r
+       uint8_t wordwidth;              /** the number of bytes in data as follow:\r
+                                                               -I2S_WORDWIDTH_8: 8 bit data\r
+                                                               -I2S_WORDWIDTH_16: 16 bit data\r
+                                                               -I2S_WORDWIDTH_32: 32 bit data */\r
+       uint8_t mono;                   /** Set mono/stereo mode, should be:\r
+                                                               - I2S_STEREO: stereo mode\r
+                                                               - I2S_MONO: mono mode */\r
+       uint8_t stop;                   /** Disables accesses on FIFOs, should be:\r
+                                                               - I2S_STOP_ENABLE: enable stop mode\r
+                                                               - I2S_STOP_DISABLE: disable stop mode */\r
+       uint8_t reset;                  /** Asynchronously reset tje transmit channel and FIFO, should be:\r
+                                                               - I2S_RESET_ENABLE: enable reset mode\r
+                                                               - I2S_RESET_DISABLE: disable reset mode */\r
+       uint8_t ws_sel;                 /** Set Master/Slave mode, should be:\r
+                                                               - I2S_MASTER_MODE: I2S master mode\r
+                                                               - I2S_SLAVE_MODE: I2S slave mode */\r
+       uint8_t mute;                   /** MUTE mode: when true, the transmit channel sends only zeroes, shoule be:\r
+                                                               - I2S_MUTE_ENABLE: enable mute mode\r
+                                                               - I2S_MUTE_DISABLE: disable mute mode */\r
+       uint8_t Reserved0[2];\r
+} I2S_CFG_Type;\r
+\r
+/**\r
+ * @brief I2S DMA configuration structure definition\r
+ */\r
+typedef struct {\r
+       uint8_t DMAIndex;               /** Select DMA1 or DMA2, should be:\r
+                                                               - I2S_DMA_1: DMA1\r
+                                                               - I2S_DMA_2: DMA2 */\r
+       uint8_t depth;                  /** FIFO level that triggers a DMA request */\r
+       uint8_t Reserved0[2];\r
+}I2S_DMAConf_Type;\r
+\r
+/**\r
+ * @brief I2S mode configuration structure definition\r
+ */\r
+typedef struct{\r
+       uint8_t clksel;                 /** Clock source selection, should be:\r
+                                                               - I2S_CLKSEL_FRDCLK: Select the fractional rate divider clock output\r
+                                                               - I2S_CLKSEL_MCLK: Select the MCLK signal as the clock source */\r
+       uint8_t fpin;                   /** Select four pin mode, should be:\r
+                                                               - I2S_4PIN_ENABLE: 4-pin enable\r
+                                                               - I2S_4PIN_DISABLE: 4-pin disable */\r
+       uint8_t mcena;                  /** Select MCLK mode, should be:\r
+                                                               - I2S_MCLK_ENABLE: MCLK enable for output\r
+                                                               - I2S_MCLK_DISABLE: MCLK disable for output */\r
+       uint8_t Reserved;\r
+}I2S_MODEConf_Type;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup I2S_Public_Functions I2S Public Functions\r
+ * @{\r
+ */\r
+/* I2S Init/DeInit functions ---------*/\r
+void I2S_Init(LPC_I2Sn_Type *I2Sx);\r
+void I2S_DeInit(LPC_I2Sn_Type *I2Sx);\r
+\r
+/* I2S configuration functions --------*/\r
+void I2S_Config(LPC_I2Sn_Type *I2Sx, uint8_t TRMode, I2S_CFG_Type* ConfigStruct);\r
+Status I2S_FreqConfig(LPC_I2Sn_Type *I2Sx, uint32_t Freq, uint8_t TRMode);\r
+void I2S_SetBitRate(LPC_I2Sn_Type *I2Sx, uint8_t bitrate, uint8_t TRMode);\r
+void I2S_ModeConfig(LPC_I2Sn_Type *I2Sx, I2S_MODEConf_Type* ModeConfig, uint8_t TRMode);\r
+uint8_t I2S_GetLevel(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+\r
+/* I2S operate functions -------------*/\r
+void I2S_Send(LPC_I2Sn_Type *I2Sx, uint32_t BufferData);\r
+uint32_t I2S_Receive(LPC_I2Sn_Type* I2Sx);\r
+void I2S_Start(LPC_I2Sn_Type *I2Sx);\r
+void I2S_Pause(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+void I2S_Mute(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+void I2S_Stop(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+\r
+/* I2S DMA functions ----------------*/\r
+void I2S_DMAConfig(LPC_I2Sn_Type *I2Sx, I2S_DMAConf_Type* DMAConfig, uint8_t TRMode);\r
+void I2S_DMACmd(LPC_I2Sn_Type *I2Sx, uint8_t DMAIndex,uint8_t TRMode, FunctionalState NewState);\r
+\r
+/* I2S IRQ functions ----------------*/\r
+void I2S_IRQCmd(LPC_I2Sn_Type *I2Sx,uint8_t TRMode, FunctionalState NewState);\r
+void I2S_IRQConfig(LPC_I2Sn_Type *I2Sx, uint8_t TRMode, uint8_t level);\r
+FunctionalState I2S_GetIRQStatus(LPC_I2Sn_Type *I2Sx,uint8_t TRMode);\r
+uint8_t I2S_GetIRQDepth(LPC_I2Sn_Type *I2Sx,uint8_t TRMode);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* LPC18XX_I2S_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_lcd.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_lcd.h
new file mode 100644 (file)
index 0000000..f57015f
--- /dev/null
@@ -0,0 +1,224 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_lcd.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_lcd.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for LCD Driver\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup LCD LCD\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __LPC18XX_LCD_H_\r
+#define __LPC18XX_LCD_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup LCD_Private_Macros LCD Private Macros\r
+ * @{\r
+ */\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/* LCD control enable bit */\r
+#define CLCDC_LCDCTRL_ENABLE    _BIT(0)\r
+/* LCD control power enable bit */\r
+#define CLCDC_LCDCTRL_PWR       _BIT(11)\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup LCD_Public_Types LCD Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief LCD enumeration\r
+ **********************************************************************/\r
+\r
+/** @brief LCD Interrupt Source */\r
+typedef enum{\r
+       LCD_INT_FUF = _BIT(1),          /* FIFO underflow bit */\r
+       LCD_INT_LNBU = _BIT(2),         /* LCD next base address update bit */\r
+       LCD_INT_VCOMP = _BIT(3),        /* vertical compare bit */\r
+       LCD_INT_BER = _BIT(4)           /* AHB master error interrupt bit */\r
+} LCD_INT_SRC;\r
+\r
+/** @brief LCD signal polarity */\r
+typedef enum {\r
+       LCD_SIGNAL_ACTIVE_HIGH = 0,\r
+       LCD_SIGNAL_ACTIVE_LOW = 1\r
+} LCD_SIGNAL_POLARITY_OPT;\r
+\r
+/** @brief LCD clock edge polarity */\r
+typedef enum {\r
+       LCD_CLK_RISING = 0,\r
+       LCD_CLK_FALLING= 1\r
+} LCD_CLK_EDGE_OPT;\r
+\r
+/** @brief LCD bits per pixel and pixel format */\r
+typedef enum {\r
+       LCD_BPP1 = 0,\r
+       LCD_BPP2,\r
+       LCD_BPP4,\r
+       LCD_BPP8,\r
+       LCD_BPP16,\r
+       LCD_BPP24,\r
+       LCD_BPP16_565,\r
+       LCD_BPP12_444\r
+}LCD_PIXEL_FORMAT_OPT;\r
+\r
+/** @brief LCD color format */\r
+typedef enum {\r
+       LCD_COLOR_FORMAT_RGB = 0,\r
+       LCD_COLOR_FORMAT_BGR\r
+}LCD_COLOR_FORMAT_OPT;\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief LCD structure definitions\r
+ **********************************************************************/\r
+/** @brief LCD Palette entry format */\r
+typedef struct\r
+{\r
+       uint32_t Rl:5;\r
+       uint32_t Gl:5;\r
+       uint32_t Bl:5;\r
+       uint32_t Il:1;\r
+       uint32_t Ru:5;\r
+       uint32_t Gu:5;\r
+       uint32_t Bu:5;\r
+       uint32_t Iu:1;\r
+} LCD_PALETTE_ENTRY_Type;\r
+\r
+/** @brief LCD cursor format in 1 byte LBBP */\r
+typedef struct\r
+{\r
+       uint8_t Pixel3:2;\r
+       uint8_t Pixel2:2;\r
+       uint8_t Pixel1:2;\r
+       uint8_t Pixel0:2;\r
+} LCD_CURSOR_PIXEL_Type;\r
+\r
+/** @brief LCD cursor size */\r
+typedef enum\r
+{\r
+       LCD_CURSOR_32x32 = 0,\r
+       LCD_CURSOR_64x64\r
+} LCD_CURSOR_SIZE_OPT;\r
+\r
+/** @brief LCD panel type */\r
+typedef enum\r
+{\r
+       LCD_TFT = 0x02,         /* standard TFT */\r
+       LCD_MONO_4 = 0x01,  /* 4-bit STN mono */\r
+       LCD_MONO_8 = 0x05,  /* 8-bit STN mono */\r
+       LCD_CSTN = 0x00     /* color STN */\r
+} LCD_PANEL_OPT;\r
+\r
+/** @brief LCD porch configuration structure */\r
+typedef struct {\r
+       uint16_t front;         /* front porch setting in clocks */\r
+       uint16_t back;          /* back porch setting in clocks */\r
+}LCD_PORCHCFG_Type;\r
+\r
+/** @brief LCD configuration structure */\r
+typedef struct {\r
+       uint16_t                                screen_width;                   /* Pixels per line */\r
+       uint16_t                                screen_height;                  /* Lines per panel */\r
+       LCD_PORCHCFG_Type               horizontal_porch;               /* porch setting for horizontal */\r
+       LCD_PORCHCFG_Type               vertical_porch;                 /* porch setting for vertical */\r
+       uint16_t                                HSync_pulse_width;              /* HSYNC pulse width in clocks */\r
+       uint16_t                                VSync_pulse_width;              /* VSYNC pulse width in clocks */\r
+       uint8_t                         ac_bias_frequency;      /* AC bias frequency in clocks */\r
+       LCD_SIGNAL_POLARITY_OPT HSync_pol;                              /* HSYNC polarity */\r
+       LCD_SIGNAL_POLARITY_OPT VSync_pol;                              /* VSYNC polarity */\r
+       LCD_CLK_EDGE_OPT                panel_clk_edge;                 /* Panel Clock Edge Polarity */\r
+       LCD_SIGNAL_POLARITY_OPT OE_pol;                                 /* Output Enable polarity */\r
+       uint32_t                                line_end_delay;                 /* 0 if not use */\r
+       LCD_PIXEL_FORMAT_OPT    bits_per_pixel;         /* Maximum bits per pixel the display supports */\r
+       LCD_PANEL_OPT                   lcd_panel_type;         /* LCD panel type */\r
+       LCD_COLOR_FORMAT_OPT    color_format;                   /* BGR or RGB */\r
+       Bool                            dual_panel;             /* Dual panel, TRUE = dual panel display */\r
+       uint16_t                                pcd;\r
+} LCD_CFG_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup LCD_Public_Functions LCD Public Functions\r
+ * @{\r
+ */\r
+\r
+void LCD_Init(LPC_LCD_Type *LCDx, LCD_CFG_Type *LCD_ConfigStruct);\r
+void LCD_DeInit(LPC_LCD_Type *LCDx);\r
+\r
+void LCD_Power(LPC_LCD_Type *LCDx, FunctionalState OnOff);\r
+void LCD_Enable(LPC_LCD_Type *LCDx, FunctionalState EnDis);\r
+void LCD_SetFrameBuffer(LPC_LCD_Type *LCDx, void* buffer);\r
+void LCD_SetLPFrameBuffer(LPC_LCD_Type *LCDx, void* buffer);\r
+void LCD_LoadPalette(LPC_LCD_Type *LCDx, void* palette);\r
+void LCD_SetInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int);\r
+void LCD_ClrInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int);\r
+LCD_INT_SRC LCD_GetInterrupt(LPC_LCD_Type *LCDx);\r
+\r
+void LCD_Cursor_Config(LPC_LCD_Type *LCDx, LCD_CURSOR_SIZE_OPT cursor_size, Bool sync);\r
+void LCD_Cursor_WriteImage(LPC_LCD_Type *LCDx, uint8_t cursor_num, void* Image);\r
+void* LCD_Cursor_GetImageBufferAddress(LPC_LCD_Type *LCDx, uint8_t cursor_num);\r
+void LCD_Cursor_Enable(LPC_LCD_Type *LCDx, uint8_t cursor_num, FunctionalState OnOff);\r
+void LCD_Cursor_LoadPalette0(LPC_LCD_Type *LCDx, uint32_t palette_color);\r
+void LCD_Cursor_LoadPalette1(LPC_LCD_Type *LCDx, uint32_t palette_color);\r
+void LCD_Cursor_SetInterrupt(LPC_LCD_Type *LCDx);\r
+void LCD_Cursor_ClrInterrupt(LPC_LCD_Type *LCDx);\r
+void LCD_Cursor_SetPos(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y);\r
+void LCD_Cursor_SetClipPos(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __LPC18XX_LCD_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_libcfg_default.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_libcfg_default.h
new file mode 100644 (file)
index 0000000..a3411a0
--- /dev/null
@@ -0,0 +1,192 @@
+/*\r
+ * Modified for Code Red tools to prevent redefinition of DEBUG macro\r
+ * 2011/12/29\r
+ */\r
+/**********************************************************************\r
+* $Id$         lpc18xx_libcfg_default.h                2011-06-02\r
+*//**\r
+* @file                lpc18xx_libcfg_default.h\r
+* @brief       Default Library configuration header file\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Library Configuration group ----------------------------------------------------------- */\r
+/** @defgroup LIBCFG_DEFAULT LIBCFG_DEFAULT\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_LIBCFG_DEFAULT_H_\r
+#define LPC18XX_LIBCFG_DEFAULT_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc_types.h"\r
+\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup LIBCFG_DEFAULT_Public_Macros LIBCFG_DEFAULT Public Macros\r
+ * @{\r
+ */\r
+\r
+/************************** DEBUG MODE DEFINITIONS *********************************/\r
+/* Un-comment the line below to compile the library in DEBUG mode, this will expanse\r
+   the "CHECK_PARAM" macro in the FW library code */\r
+\r
+#ifndef __CODE_RED\r
+#define DEBUG\r
+#endif\r
+\r
+\r
+/******************* PERIPHERAL FW LIBRARY CONFIGURATION DEFINITIONS ***********************/\r
+\r
+/* Comment the line below to disable the specific peripheral inclusion */\r
+\r
+/* GPIO ------------------------------- */\r
+#define _GPIO\r
+\r
+/* EXTI ------------------------------- */\r
+#define _EXTI\r
+\r
+/* UART ------------------------------- */\r
+#define _UART\r
+#define _UART0\r
+#define _UART1\r
+#define _UART2\r
+#define _UART3\r
+\r
+/* SPI ------------------------------- */\r
+#define _SPI\r
+\r
+/* SYSTICK --------------------------- */\r
+#define _SYSTICK\r
+\r
+/* SSP ------------------------------- */\r
+#define _SSP\r
+#define _SSP0\r
+#define _SSP1\r
+\r
+\r
+/* I2C ------------------------------- */\r
+#define _I2C\r
+#define _I2C0\r
+#define _I2C1\r
+#define _I2C2\r
+\r
+/* TIMER ------------------------------- */\r
+#define _TIM\r
+\r
+/* WWDT ------------------------------- */\r
+#define _WWDT\r
+\r
+\r
+/* GPDMA ------------------------------- */\r
+#define _GPDMA\r
+\r
+\r
+/* DAC ------------------------------- */\r
+#define _DAC\r
+\r
+/* DAC ------------------------------- */\r
+#define _ADC\r
+\r
+\r
+/* PWM ------------------------------- */\r
+#define _PWM\r
+#define _PWM1\r
+\r
+/* RTC ------------------------------- */\r
+#define _RTC\r
+\r
+/* I2S ------------------------------- */\r
+#define _I2S\r
+\r
+/* USB device ------------------------------- */\r
+#define _USBDEV\r
+#define _USB_DMA\r
+\r
+/* QEI ------------------------------- */\r
+#define _QEI\r
+\r
+/* MCPWM ------------------------------- */\r
+#define _MCPWM\r
+\r
+/* CAN--------------------------------*/\r
+#define _C_CAN\r
+\r
+/* RIT ------------------------------- */\r
+#define _RIT\r
+\r
+/* EMAC ------------------------------ */\r
+#define _EMAC\r
+\r
+/* SCT ------------------------------ */\r
+#define _SCT\r
+\r
+/* LCD ------------------------------ */\r
+#define _LCD\r
+\r
+/* ATIMER ------------------------------ */\r
+#define _ATIMER\r
+\r
+/* RGU ------------------------------ */\r
+#define _RGU\r
+\r
+/************************** GLOBAL/PUBLIC MACRO DEFINITIONS *********************************/\r
+\r
+#ifdef  DEBUG\r
+/*******************************************************************************\r
+* @brief               The CHECK_PARAM macro is used for function's parameters check.\r
+*                              It is used only if the library is compiled in DEBUG mode.\r
+* @param[in]   expr - If expr is false, it calls check_failed() function\r
+*                      which reports the name of the source file and the source\r
+*                      line number of the call that failed.\r
+*                    - If expr is true, it returns no value.\r
+* @return              None\r
+*******************************************************************************/\r
+#define CHECK_PARAM(expr) ((expr) ? (void)0 : check_failed((uint8_t *)__FILE__, __LINE__))\r
+#else\r
+#define CHECK_PARAM(expr)\r
+#endif /* DEBUG */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup LIBCFG_DEFAULT_Public_Functions LIBCFG_DEFAULT Public Functions\r
+ * @{\r
+ */\r
+\r
+#ifdef  DEBUG\r
+void check_failed(uint8_t *file, uint32_t line);\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* LPC18XX_LIBCFG_DEFAULT_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_mcpwm.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_mcpwm.h
new file mode 100644 (file)
index 0000000..7a8c68b
--- /dev/null
@@ -0,0 +1,338 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_mcpwm.h         2011-06-02\r
+*//**\r
+* @file                lpc18xx_mcpwm.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for Motor Control PWM firmware library on LPC18XX\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup MCPWM MCPWM (Motor Control PWM)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_MCPWM_H_\r
+#define LPC18XX_MCPWM_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup MCPWM_Private_Macros MCPWM Private Macros\r
+ * @{\r
+ */\r
+/** Edge aligned mode for channel in MCPWM */\r
+#define MCPWM_CHANNEL_EDGE_MODE                        ((uint32_t)(0))\r
+/** Center aligned mode for channel in MCPWM */\r
+#define MCPWM_CHANNEL_CENTER_MODE              ((uint32_t)(1))\r
+\r
+/** Polarity of the MCOA and MCOB pins: Passive state is LOW, active state is HIGH */\r
+#define MCPWM_CHANNEL_PASSIVE_LO               ((uint32_t)(0))\r
+/** Polarity of the MCOA and MCOB pins: Passive state is HIGH, active state is LOW */\r
+#define MCPWM_CHANNEL_PASSIVE_HI               ((uint32_t)(1))\r
+\r
+/* Output Patent in 3-phase DC mode, the internal MCOA0 signal is routed to any or all of\r
+ * the six output pins under the control of the bits in this register */\r
+#define MCPWM_PATENT_A0                ((uint32_t)(1<<0))      /**< MCOA0 tracks internal MCOA0 */\r
+#define MCPWM_PATENT_B0                ((uint32_t)(1<<1))      /**< MCOB0 tracks internal MCOA0 */\r
+#define MCPWM_PATENT_A1                ((uint32_t)(1<<2))      /**< MCOA1 tracks internal MCOA0 */\r
+#define MCPWM_PATENT_B1                ((uint32_t)(1<<3))      /**< MCOB1 tracks internal MCOA0 */\r
+#define MCPWM_PATENT_A2                ((uint32_t)(1<<4))      /**< MCOA2 tracks internal MCOA0 */\r
+#define MCPWM_PATENT_B2                ((uint32_t)(1<<5))      /**< MCOB2 tracks internal MCOA0 */\r
+\r
+/* Interrupt type in MCPWM */\r
+/** Limit interrupt for channel (0) */\r
+#define MCPWM_INTFLAG_LIM0     MCPWM_INT_ILIM(0)\r
+/** Match interrupt for channel (0) */\r
+#define MCPWM_INTFLAG_MAT0     MCPWM_INT_IMAT(0)\r
+/** Capture interrupt for channel (0) */\r
+#define MCPWM_INTFLAG_CAP0     MCPWM_INT_ICAP(0)\r
+\r
+/** Limit interrupt for channel (1) */\r
+#define MCPWM_INTFLAG_LIM1     MCPWM_INT_ILIM(1)\r
+/** Match interrupt for channel (1) */\r
+#define MCPWM_INTFLAG_MAT1     MCPWM_INT_IMAT(1)\r
+/** Capture interrupt for channel (1) */\r
+#define MCPWM_INTFLAG_CAP1     MCPWM_INT_ICAP(1)\r
+\r
+/** Limit interrupt for channel (2) */\r
+#define MCPWM_INTFLAG_LIM2     MCPWM_INT_ILIM(2)\r
+/** Match interrupt for channel (2) */\r
+#define MCPWM_INTFLAG_MAT2     MCPWM_INT_IMAT(2)\r
+/** Capture interrupt for channel (2) */\r
+#define MCPWM_INTFLAG_CAP2     MCPWM_INT_ICAP(2)\r
+\r
+/** Fast abort interrupt */\r
+#define MCPWM_INTFLAG_ABORT    MCPWM_INT_ABORT\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Control register\r
+ **********************************************************************/\r
+/* MCPWM Control register, these macro definitions below can be applied for these\r
+ * register type:\r
+ * - MCPWM Control read address\r
+ * - MCPWM Control set address\r
+ * - MCPWM Control clear address\r
+ */\r
+/**< Stops/starts timer channel n */\r
+#define MCPWM_CON_RUN(n)               (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*8)+0))) : (0))\r
+/**< Edge/center aligned operation for channel n */\r
+#define MCPWM_CON_CENTER(n)            (((n<=2)) ? ((uint32_t)(1<<((n*8)+1))) : (0))\r
+/**< Select polarity of the MCOAn and MCOBn pin */\r
+#define MCPWM_CON_POLAR(n)             (((n<=2)) ? ((uint32_t)(1<<((n*8)+2))) : (0))\r
+/**< Control the dead-time feature for channel n */\r
+#define MCPWM_CON_DTE(n)               (((n<=2)) ? ((uint32_t)(1<<((n*8)+3))) : (0))\r
+/**< Enable/Disable update of functional register for channel n */\r
+#define MCPWM_CON_DISUP(n)             (((n<=2)) ? ((uint32_t)(1<<((n*8)+4))) : (0))\r
+/**< Control the polarity for all 3 channels */\r
+#define MCPWM_CON_INVBDC               ((uint32_t)(1<<29))\r
+/**< 3-phase AC mode select */\r
+#define MCPWM_CON_ACMODE               ((uint32_t)(1<<30))\r
+/**< 3-phase DC mode select */\r
+#define MCPWM_CON_DCMODE               (((uint32_t)1<<31))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Capture Control register\r
+ **********************************************************************/\r
+/* Capture Control register, these macro definitions below can be applied for these\r
+ * register type:\r
+ * - MCPWM Capture Control read address\r
+ * - MCPWM Capture Control set address\r
+ * - MCPWM Capture control clear address\r
+ */\r
+/** Enables/Disable channel (cap) capture event on a rising edge on MCI(mci) */\r
+#define MCPWM_CAPCON_CAPMCI_RE(cap,mci)        (((cap<=2)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+0))) : (0))\r
+/** Enables/Disable channel (cap) capture event on a falling edge on MCI(mci) */\r
+#define MCPWM_CAPCON_CAPMCI_FE(cap,mci)        (((cap<=2)&&(mci<=2)) ? ((uint32_t)(1<<((cap*6)+(mci*2)+1))) : (0))\r
+/** TC(n) is reset by channel (n) capture event */\r
+#define MCPWM_CAPCON_RT(n)                             (((n<=2)) ? ((uint32_t)(1<<(18+(n)))) : (0))\r
+/** Hardware noise filter: channel (n) capture events are delayed */\r
+#define MCPWM_CAPCON_HNFCAP(n)                 (((n<=2)) ? ((uint32_t)(1<<(21+(n)))) : (0))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Interrupt register\r
+ **********************************************************************/\r
+/* Interrupt registers, these macro definitions below can be applied for these\r
+ * register type:\r
+ * - MCPWM Interrupt Enable read address\r
+ * - MCPWM Interrupt Enable set address\r
+ * - MCPWM Interrupt Enable clear address\r
+ * - MCPWM Interrupt Flags read address\r
+ * - MCPWM Interrupt Flags set address\r
+ * - MCPWM Interrupt Flags clear address\r
+ */\r
+/** Limit interrupt for channel (n) */\r
+#define MCPWM_INT_ILIM(n)      (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+0))) : (0))\r
+/** Match interrupt for channel (n) */\r
+#define MCPWM_INT_IMAT(n)      (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+1))) : (0))\r
+/** Capture interrupt for channel (n) */\r
+#define MCPWM_INT_ICAP(n)      (((n>=0)&&(n<=2)) ? ((uint32_t)(1<<((n*4)+2))) : (0))\r
+/** Fast abort interrupt */\r
+#define MCPWM_INT_ABORT                ((uint32_t)(1<<15))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Count Control register\r
+ **********************************************************************/\r
+/* MCPWM Count Control register, these macro definitions below can be applied for these\r
+ * register type:\r
+ * - MCPWM Count Control read address\r
+ * - MCPWM Count Control set address\r
+ * - MCPWM Count Control clear address\r
+ */\r
+/** Counter(tc) advances on a rising edge on MCI(mci) pin */\r
+#define MCPWM_CNTCON_TCMCI_RE(tc,mci)  (((tc<=2)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+0))) : (0))\r
+/** Counter(cnt) advances on a falling edge on MCI(mci) pin */\r
+#define MCPWM_CNTCON_TCMCI_FE(tc,mci)  (((tc<=2)&&(mci<=2)) ? ((uint32_t)(1<<((6*tc)+(2*mci)+1))) : (0))\r
+/** Channel (n) is in counter mode */\r
+#define MCPWM_CNTCON_CNTR(n)                   (((n<=2)) ? ((uint32_t)(1<<(29+n))) : (0))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Dead-time register\r
+ **********************************************************************/\r
+/** Dead time value x for channel n */\r
+#define MCPWM_DT(n,x)          (((n<=2)) ? ((uint32_t)((x&0x3FF)<<(n*10))) : (0))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Communication Pattern register\r
+ **********************************************************************/\r
+#define MCPWM_CP_A0            ((uint32_t)(1<<0))      /**< MCOA0 tracks internal MCOA0 */\r
+#define MCPWM_CP_B0            ((uint32_t)(1<<1))      /**< MCOB0 tracks internal MCOA0 */\r
+#define MCPWM_CP_A1            ((uint32_t)(1<<2))      /**< MCOA1 tracks internal MCOA0 */\r
+#define MCPWM_CP_B1            ((uint32_t)(1<<3))      /**< MCOB1 tracks internal MCOA0 */\r
+#define MCPWM_CP_A2            ((uint32_t)(1<<4))      /**< MCOA2 tracks internal MCOA0 */\r
+#define MCPWM_CP_B2            ((uint32_t)(1<<5))      /**< MCOB2 tracks internal MCOA0 */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for MCPWM Capture clear address register\r
+ **********************************************************************/\r
+/** Clear the MCCAP (n) register */\r
+#define MCPWM_CAPCLR_CAP(n)            (((n<=2)) ? ((uint32_t)(1<<n)) : (0))\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup MCPWM_Public_Types MCPWM Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief MCPWM enumeration\r
+ **********************************************************************/\r
+/**\r
+ * @brief      MCPWM channel identifier definition\r
+ */\r
+typedef enum\r
+{\r
+       MCPWM_CHANNEL_0 = 0,            /**< MCPWM channel 0 */\r
+       MCPWM_CHANNEL_1,                        /**< MCPWM channel 1 */\r
+       MCPWM_CHANNEL_2                         /**< MCPWM channel 2 */\r
+} en_MCPWM_Channel_Id;\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief MCPWM structure definitions\r
+ **********************************************************************/\r
+/**\r
+ * @brief Motor Control PWM Channel Configuration structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t channelType;                                   /**< Edge/center aligned mode for this channel,\r
+                                                                                               should be:\r
+                                                                                               - MCPWM_CHANNEL_EDGE_MODE: Channel is in Edge mode\r
+                                                                                               - MCPWM_CHANNEL_CENTER_MODE: Channel is in Center mode\r
+                                                                                               */\r
+       uint32_t channelPolarity;                               /**< Polarity of the MCOA and MCOB pins, should be:\r
+                                                                                               - MCPWM_CHANNEL_PASSIVE_LO: Passive state is LOW, active state is HIGH\r
+                                                                                               - MCPWM_CHANNEL_PASSIVE_HI: Passive state is HIGH, active state is LOW\r
+                                                                                               */\r
+       uint32_t channelDeadtimeEnable;                 /**< Enable/Disable DeadTime function for channel, should be:\r
+                                                                                               - ENABLE.\r
+                                                                                               - DISABLE.\r
+                                                                                               */\r
+       uint32_t channelDeadtimeValue;                  /**< DeadTime value, should be less than 0x3FF */\r
+       uint32_t channelUpdateEnable;                   /**< Enable/Disable updates of functional registers,\r
+                                                                                                should be:\r
+                                                                                               - ENABLE.\r
+                                                                                               - DISABLE.\r
+                                                                                               */\r
+       uint32_t channelTimercounterValue;              /**< MCPWM Timer Counter value */\r
+       uint32_t channelPeriodValue;                    /**< MCPWM Period value */\r
+       uint32_t channelPulsewidthValue;                /**< MCPWM Pulse Width value */\r
+} MCPWM_CHANNEL_CFG_Type;\r
+\r
+/**\r
+ * @brief MCPWM Capture Configuration type definition\r
+ */\r
+typedef struct {\r
+       uint32_t captureChannel;                /**< Capture Channel Number, should be in range from 0 to 2 */\r
+       uint32_t captureRising;                 /**< Enable/Disable Capture on Rising Edge event, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+       uint32_t captureFalling;                /**< Enable/Disable Capture on Falling Edge event, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+       uint32_t timerReset;                    /**< Enable/Disable Timer reset function an capture, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+       uint32_t hnfEnable;                             /**< Enable/Disable Hardware noise filter function, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+} MCPWM_CAPTURE_CFG_Type;\r
+\r
+\r
+/**\r
+ * @brief MCPWM Count Control Configuration type definition\r
+ */\r
+typedef struct {\r
+       uint32_t counterChannel;                /**< Counter Channel Number, should be in range from 0 to 2 */\r
+       uint32_t countRising;                   /**< Enable/Disable Capture on Rising Edge event, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+       uint32_t countFalling;          /**< Enable/Disable Capture on Falling Edge event, should be:\r
+                                                                               - ENABLE.\r
+                                                                               - DISABLE.\r
+                                                                               */\r
+} MCPWM_COUNT_CFG_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup MCPWM_Public_Functions MCPWM Public Functions\r
+ * @{\r
+ */\r
+\r
+void MCPWM_Init(LPC_MCPWM_Type *MCPWMx);\r
+void MCPWM_ConfigChannel(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                               MCPWM_CHANNEL_CFG_Type * channelSetup);\r
+void MCPWM_WriteToShadow(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                               MCPWM_CHANNEL_CFG_Type *channelSetup);\r
+void MCPWM_ConfigCapture(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                               MCPWM_CAPTURE_CFG_Type *captureConfig);\r
+void MCPWM_ClearCapture(LPC_MCPWM_Type *MCPWMx, uint32_t captureChannel);\r
+uint32_t MCPWM_GetCapture(LPC_MCPWM_Type *MCPWMx, uint32_t captureChannel);\r
+void MCPWM_CountConfig(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                       uint32_t countMode, MCPWM_COUNT_CFG_Type *countConfig);\r
+void MCPWM_Start(LPC_MCPWM_Type *MCPWMx,uint32_t channel0, uint32_t channel1, uint32_t channel2);\r
+void MCPWM_Stop(LPC_MCPWM_Type *MCPWMx,uint32_t channel0, uint32_t channel1, uint32_t channel2);\r
+void MCPWM_ACMode(LPC_MCPWM_Type *MCPWMx,uint32_t acMode);\r
+void MCPWM_DCMode(LPC_MCPWM_Type *MCPWMx, uint32_t dcMode,\r
+                                       uint32_t outputInvered, uint32_t outputPattern);\r
+void MCPWM_IntConfig(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType, FunctionalState NewState);\r
+void MCPWM_IntSet(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType);\r
+void MCPWM_IntClear(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType);\r
+FlagStatus MCPWM_GetIntStatus(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_MCPWM_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_nvic.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_nvic.h
new file mode 100644 (file)
index 0000000..9ce74ed
--- /dev/null
@@ -0,0 +1,68 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_nvic.h          2011-06-02\r
+*//**\r
+* @file                lpc18xx_nvic.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for Nesting Vectored Interrupt firmware library\r
+*                      on LPC18XX\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup NVIC NVIC (Nested Vector Interrupt Controller)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_NVIC_H_\r
+#define LPC18XX_NVIC_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup NVIC_Public_Functions NVIC Public Functions\r
+ * @{\r
+ */\r
+\r
+void NVIC_SetVTOR(uint32_t offset);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_NVIC_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_pwr.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_pwr.h
new file mode 100644 (file)
index 0000000..0bbab1f
--- /dev/null
@@ -0,0 +1,83 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_pwr.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_pwr.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for Power Control firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup PWR PWR (Power Control)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_PWR_H_\r
+#define LPC18XX_PWR_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup PWR_Private_Macros PWR Private Macros\r
+ * @{\r
+ */\r
+#define PWR_SLEEP_MODE_DEEP_SLEEP      0x3F00AA\r
+#define PWR_SLEEP_MODE_POWER_DOWN      0x30FCBA\r
+#define PWR_SLEEP_MODE_DEEP_POWER_DOWN 0x3FFF7F\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup PWR_Public_Functions PWR Public Functions\r
+ * @{\r
+ */\r
+/* Clock Generator */\r
+void PWR_Sleep(void);\r
+void PWR_DeepSleep(void);\r
+void PWR_PowerDown(void);\r
+void PWR_DeepPowerDown(void);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_PWR_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_qei.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_qei.h
new file mode 100644 (file)
index 0000000..4fb60f5
--- /dev/null
@@ -0,0 +1,426 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_qei.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_qei.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for QEI firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup QEI QEI (Quadrature Encoder Interface)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_QEI_H_\r
+#define LPC18XX_QEI_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup QEI_Private_Macros QEI Private Macros\r
+ * @{\r
+ */\r
+\r
+/** QEI peripheral numver definition */\r
+#define QEI_0                                  (0)                                     /** Always 0 - because we just have only one QEI peripheral */\r
+\r
+/** QEI Reset types */\r
+#define QEI_RESET_POS                  QEI_CON_RESP            /**< Reset position counter */\r
+#define QEI_RESET_POSOnIDX             QEI_CON_RESPI           /**< Reset Posistion Counter on Index */\r
+#define QEI_RESET_VEL                  QEI_CON_RESV            /**< Reset Velocity */\r
+#define QEI_RESET_IDX                  QEI_CON_RESI            /**< Reset Index Counter */\r
+\r
+/** QEI Direction Invert Type Option */\r
+#define QEI_DIRINV_NONE                ((uint32_t)(0))                 /**< Direction is not inverted */\r
+#define QEI_DIRINV_CMPL                ((uint32_t)(1))                 /**< Direction is complemented */\r
+\r
+/** QEI Signal Mode Option */\r
+#define QEI_SIGNALMODE_QUAD            ((uint32_t)(0))         /**< Signal operation: Quadrature phase mode */\r
+#define QEI_SIGNALMODE_CLKDIR  ((uint32_t)(1))         /**< Signal operation: Clock/Direction mode */\r
+\r
+/** QEI Capture Mode Option */\r
+#define QEI_CAPMODE_2X                 ((uint32_t)(0))         /**< Capture mode: Only Phase-A edges are counted (2X) */\r
+#define QEI_CAPMODE_4X                 ((uint32_t)(1))         /**< Capture mode: BOTH PhA and PhB edges are counted (4X)*/\r
+\r
+/** QEI Invert Index Signal Option */\r
+#define QEI_INVINX_NONE                        ((uint32_t)(0))         /**< Invert Index signal option: None */\r
+#define QEI_INVINX_EN                  ((uint32_t)(1))         /**< Invert Index signal option: Enable */\r
+\r
+/** QEI timer reload option */\r
+#define QEI_TIMERRELOAD_TICKVAL        ((uint8_t)(0))          /**< Reload value in absolute value */\r
+#define QEI_TIMERRELOAD_USVAL  ((uint8_t)(1))          /**< Reload value in microsecond value */\r
+\r
+/** QEI Flag Status type */\r
+#define QEI_STATUS_DIR                 ((uint32_t)(1<<0))      /**< Direction status */\r
+\r
+/** QEI Compare Position channel option */\r
+#define QEI_COMPPOS_CH_0                       ((uint8_t)(0))          /**< QEI compare position channel 0 */\r
+#define QEI_COMPPOS_CH_1                       ((uint8_t)(1))          /**< QEI compare position channel 1 */\r
+#define QEI_COMPPOS_CH_2                       ((uint8_t)(2))          /**< QEI compare position channel 2 */\r
+\r
+/** QEI interrupt flag type */\r
+#define QEI_INTFLAG_INX_Int                    ((uint32_t)(1<<0))      /**< index pulse was detected interrupt */\r
+#define QEI_INTFLAG_TIM_Int                    ((uint32_t)(1<<1))      /**< Velocity timer over flow interrupt */\r
+#define QEI_INTFLAG_VELC_Int           ((uint32_t)(1<<2))      /**< Capture velocity is less than compare interrupt */\r
+#define QEI_INTFLAG_DIR_Int                    ((uint32_t)(1<<3))      /**< Change of direction interrupt */\r
+#define QEI_INTFLAG_ERR_Int                    ((uint32_t)(1<<4))      /**< An encoder phase error interrupt */\r
+#define QEI_INTFLAG_ENCLK_Int          ((uint32_t)(1<<5))      /**< An encoder clock pulse was detected interrupt */\r
+#define QEI_INTFLAG_POS0_Int           ((uint32_t)(1<<6))      /**< position 0 compare value is equal to the\r
+                                                                                                               current position interrupt */\r
+#define QEI_INTFLAG_POS1_Int           ((uint32_t)(1<<7))      /**< position 1 compare value is equal to the\r
+                                                                                                               current position interrupt */\r
+#define QEI_INTFLAG_POS2_Int           ((uint32_t)(1<<8))      /**< position 2 compare value is equal to the\r
+                                                                                                               current position interrupt */\r
+#define QEI_INTFLAG_REV_Int                    ((uint32_t)(1<<9))      /**< Index compare value is equal to the current\r
+                                                                                                               index count interrupt */\r
+#define QEI_INTFLAG_POS0REV_Int                ((uint32_t)(1<<10))     /**< Combined position 0 and revolution count interrupt */\r
+#define QEI_INTFLAG_POS1REV_Int                ((uint32_t)(1<<11))     /**< Combined position 1 and revolution count interrupt */\r
+#define QEI_INTFLAG_POS2REV_Int                ((uint32_t)(1<<12))     /**< Combined position 2 and revolution count interrupt */\r
+\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/* Quadrature Encoder Interface Control Register Definition --------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Control register\r
+ **********************************************************************/\r
+#define QEI_CON_RESP           ((uint32_t)(1<<0))              /**< Reset position counter */\r
+#define QEI_CON_RESPI          ((uint32_t)(1<<1))              /**< Reset Posistion Counter on Index */\r
+#define QEI_CON_RESV           ((uint32_t)(1<<2))              /**< Reset Velocity */\r
+#define QEI_CON_RESI           ((uint32_t)(1<<3))              /**< Reset Index Counter */\r
+#define QEI_CON_BITMASK                ((uint32_t)(0x0F))              /**< QEI Control register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Configuration register\r
+ **********************************************************************/\r
+#define QEI_CONF_DIRINV                ((uint32_t)(1<<0))              /**< Direction Invert */\r
+#define QEI_CONF_SIGMODE       ((uint32_t)(1<<1))              /**< Signal mode */\r
+#define QEI_CONF_CAPMODE       ((uint32_t)(1<<2))              /**< Capture mode */\r
+#define QEI_CONF_INVINX                ((uint32_t)(1<<3))              /**< Invert index */\r
+#define QEI_CONF_BITMASK       ((uint32_t)(0x0F))              /**< QEI Configuration register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Status register\r
+ **********************************************************************/\r
+#define QEI_STAT_DIR           ((uint32_t)(1<<0))              /**< Direction bit */\r
+#define QEI_STAT_BITMASK       ((uint32_t)(1<<0))              /**< QEI status register bit-mask */\r
+\r
+/* Quadrature Encoder Interface Interrupt registers definitions --------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Status register\r
+ **********************************************************************/\r
+#define QEI_INTSTAT_INX_Int                    ((uint32_t)(1<<0))      /**< Indicates that an index pulse was detected */\r
+#define QEI_INTSTAT_TIM_Int                    ((uint32_t)(1<<1))      /**< Indicates that a velocity timer overflow occurred */\r
+#define QEI_INTSTAT_VELC_Int           ((uint32_t)(1<<2))      /**< Indicates that capture velocity is less than compare velocity */\r
+#define QEI_INTSTAT_DIR_Int                    ((uint32_t)(1<<3))      /**< Indicates that a change of direction was detected */\r
+#define QEI_INTSTAT_ERR_Int                    ((uint32_t)(1<<4))      /**< Indicates that an encoder phase error was detected */\r
+#define QEI_INTSTAT_ENCLK_Int          ((uint32_t)(1<<5))      /**< Indicates that and encoder clock pulse was detected */\r
+#define QEI_INTSTAT_POS0_Int           ((uint32_t)(1<<6))      /**< Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSTAT_POS1_Int           ((uint32_t)(1<<7))      /**< Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSTAT_POS2_Int           ((uint32_t)(1<<8))      /**< Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSTAT_REV_Int                    ((uint32_t)(1<<9))      /**< Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_INTSTAT_POS0REV_Int                ((uint32_t)(1<<10))     /**< Combined position 0 and revolution count interrupt. Set when\r
+                                                                                                               both the POS0_Int bit is set and the REV_Int is set */\r
+#define QEI_INTSTAT_POS1REV_Int                ((uint32_t)(1<<11))     /**< Combined position 1 and revolution count interrupt. Set when\r
+                                                                                                               both the POS1_Int bit is set and the REV_Int is set */\r
+#define QEI_INTSTAT_POS2REV_Int                ((uint32_t)(1<<12))     /**< Combined position 2 and revolution count interrupt. Set when\r
+                                                                                                               both the POS2_Int bit is set and the REV_Int is set */\r
+#define QEI_INTSTAT_BITMASK                    ((uint32_t)(0x1FFF))    /**< QEI Interrupt Status register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Set register\r
+ **********************************************************************/\r
+#define QEI_INTSET_INX_Int                     ((uint32_t)(1<<0))      /**< Set Bit Indicates that an index pulse was detected */\r
+#define QEI_INTSET_TIM_Int                     ((uint32_t)(1<<1))      /**< Set Bit Indicates that a velocity timer overflow occurred */\r
+#define QEI_INTSET_VELC_Int                    ((uint32_t)(1<<2))      /**< Set Bit Indicates that capture velocity is less than compare velocity */\r
+#define QEI_INTSET_DIR_Int                     ((uint32_t)(1<<3))      /**< Set Bit Indicates that a change of direction was detected */\r
+#define QEI_INTSET_ERR_Int                     ((uint32_t)(1<<4))      /**< Set Bit Indicates that an encoder phase error was detected */\r
+#define QEI_INTSET_ENCLK_Int           ((uint32_t)(1<<5))      /**< Set Bit Indicates that and encoder clock pulse was detected */\r
+#define QEI_INTSET_POS0_Int                    ((uint32_t)(1<<6))      /**< Set Bit Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSET_POS1_Int                    ((uint32_t)(1<<7))      /**< Set Bit Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSET_POS2_Int                    ((uint32_t)(1<<8))      /**< Set Bit Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTSET_REV_Int                     ((uint32_t)(1<<9))      /**< Set Bit Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_INTSET_POS0REV_Int         ((uint32_t)(1<<10))     /**< Set Bit that combined position 0 and revolution count interrupt */\r
+#define QEI_INTSET_POS1REV_Int         ((uint32_t)(1<<11))     /**< Set Bit that Combined position 1 and revolution count interrupt */\r
+#define QEI_INTSET_POS2REV_Int         ((uint32_t)(1<<12))     /**< Set Bit that Combined position 2 and revolution count interrupt */\r
+#define QEI_INTSET_BITMASK                     ((uint32_t)(0x1FFF))    /**< QEI Interrupt Set register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Clear register\r
+ **********************************************************************/\r
+#define QEI_INTCLR_INX_Int                     ((uint32_t)(1<<0))      /**< Clear Bit Indicates that an index pulse was detected */\r
+#define QEI_INTCLR_TIM_Int                     ((uint32_t)(1<<1))      /**< Clear Bit Indicates that a velocity timer overflow occurred */\r
+#define QEI_INTCLR_VELC_Int                    ((uint32_t)(1<<2))      /**< Clear Bit Indicates that capture velocity is less than compare velocity */\r
+#define QEI_INTCLR_DIR_Int                     ((uint32_t)(1<<3))      /**< Clear Bit Indicates that a change of direction was detected */\r
+#define QEI_INTCLR_ERR_Int                     ((uint32_t)(1<<4))      /**< Clear Bit Indicates that an encoder phase error was detected */\r
+#define QEI_INTCLR_ENCLK_Int           ((uint32_t)(1<<5))      /**< Clear Bit Indicates that and encoder clock pulse was detected */\r
+#define QEI_INTCLR_POS0_Int                    ((uint32_t)(1<<6))      /**< Clear Bit Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTCLR_POS1_Int                    ((uint32_t)(1<<7))      /**< Clear Bit Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTCLR_POS2_Int                    ((uint32_t)(1<<8))      /**< Clear Bit Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTCLR_REV_Int                     ((uint32_t)(1<<9))      /**< Clear Bit Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_INTCLR_POS0REV_Int         ((uint32_t)(1<<10))     /**< Clear Bit that combined position 0 and revolution count interrupt */\r
+#define QEI_INTCLR_POS1REV_Int         ((uint32_t)(1<<11))     /**< Clear Bit that Combined position 1 and revolution count interrupt */\r
+#define QEI_INTCLR_POS2REV_Int         ((uint32_t)(1<<12))     /**< Clear Bit that Combined position 2 and revolution count interrupt */\r
+#define QEI_INTCLR_BITMASK                     ((uint32_t)(0xFFFF))    /**< QEI Interrupt Clear register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Enable register\r
+ **********************************************************************/\r
+#define QEI_INTEN_INX_Int                      ((uint32_t)(1<<0))      /**< Enabled Interrupt Bit Indicates that an index pulse was detected */\r
+#define QEI_INTEN_TIM_Int                      ((uint32_t)(1<<1))      /**< Enabled Interrupt Bit Indicates that a velocity timer overflow occurred */\r
+#define QEI_INTEN_VELC_Int                     ((uint32_t)(1<<2))      /**< Enabled Interrupt Bit Indicates that capture velocity is less than compare velocity */\r
+#define QEI_INTEN_DIR_Int                      ((uint32_t)(1<<3))      /**< Enabled Interrupt Bit Indicates that a change of direction was detected */\r
+#define QEI_INTEN_ERR_Int                      ((uint32_t)(1<<4))      /**< Enabled Interrupt Bit Indicates that an encoder phase error was detected */\r
+#define QEI_INTEN_ENCLK_Int                    ((uint32_t)(1<<5))      /**< Enabled Interrupt Bit Indicates that and encoder clock pulse was detected */\r
+#define QEI_INTEN_POS0_Int                     ((uint32_t)(1<<6))      /**< Enabled Interrupt Bit Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTEN_POS1_Int                     ((uint32_t)(1<<7))      /**< Enabled Interrupt Bit Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTEN_POS2_Int                     ((uint32_t)(1<<8))      /**< Enabled Interrupt Bit Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_INTEN_REV_Int                      ((uint32_t)(1<<9))      /**< Enabled Interrupt Bit Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_INTEN_POS0REV_Int          ((uint32_t)(1<<10))     /**< Enabled Interrupt Bit that combined position 0 and revolution count interrupt */\r
+#define QEI_INTEN_POS1REV_Int          ((uint32_t)(1<<11))     /**< Enabled Interrupt Bit that Combined position 1 and revolution count interrupt */\r
+#define QEI_INTEN_POS2REV_Int          ((uint32_t)(1<<12))     /**< Enabled Interrupt Bit that Combined position 2 and revolution count interrupt */\r
+#define QEI_INTEN_BITMASK                      ((uint32_t)(0x1FFF))    /**< QEI Interrupt Enable register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Enable Set register\r
+ **********************************************************************/\r
+#define QEI_IESET_INX_Int                      ((uint32_t)(1<<0))      /**< Set Enable Interrupt Bit Indicates that an index pulse was detected */\r
+#define QEI_IESET_TIM_Int                      ((uint32_t)(1<<1))      /**< Set Enable Interrupt Bit Indicates that a velocity timer overflow occurred */\r
+#define QEI_IESET_VELC_Int                     ((uint32_t)(1<<2))      /**< Set Enable Interrupt Bit Indicates that capture velocity is less than compare velocity */\r
+#define QEI_IESET_DIR_Int                      ((uint32_t)(1<<3))      /**< Set Enable Interrupt Bit Indicates that a change of direction was detected */\r
+#define QEI_IESET_ERR_Int                      ((uint32_t)(1<<4))      /**< Set Enable Interrupt Bit Indicates that an encoder phase error was detected */\r
+#define QEI_IESET_ENCLK_Int                    ((uint32_t)(1<<5))      /**< Set Enable Interrupt Bit Indicates that and encoder clock pulse was detected */\r
+#define QEI_IESET_POS0_Int                     ((uint32_t)(1<<6))      /**< Set Enable Interrupt Bit Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IESET_POS1_Int                     ((uint32_t)(1<<7))      /**< Set Enable Interrupt Bit Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IESET_POS2_Int                     ((uint32_t)(1<<8))      /**< Set Enable Interrupt Bit Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IESET_REV_Int                      ((uint32_t)(1<<9))      /**< Set Enable Interrupt Bit Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_IESET_POS0REV_Int          ((uint32_t)(1<<10))     /**< Set Enable Interrupt Bit that combined position 0 and revolution count interrupt */\r
+#define QEI_IESET_POS1REV_Int          ((uint32_t)(1<<11))     /**< Set Enable Interrupt Bit that Combined position 1 and revolution count interrupt */\r
+#define QEI_IESET_POS2REV_Int          ((uint32_t)(1<<12))     /**< Set Enable Interrupt Bit that Combined position 2 and revolution count interrupt */\r
+#define QEI_IESET_BITMASK                      ((uint32_t)(0x1FFF))    /**< QEI Interrupt Enable Set register bit-mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for QEI Interrupt Enable Clear register\r
+ **********************************************************************/\r
+#define QEI_IECLR_INX_Int                      ((uint32_t)(1<<0))      /**< Clear Enabled Interrupt Bit Indicates that an index pulse was detected */\r
+#define QEI_IECLR_TIM_Int                      ((uint32_t)(1<<1))      /**< Clear Enabled Interrupt Bit Indicates that a velocity timer overflow occurred */\r
+#define QEI_IECLR_VELC_Int                     ((uint32_t)(1<<2))      /**< Clear Enabled Interrupt Bit Indicates that capture velocity is less than compare velocity */\r
+#define QEI_IECLR_DIR_Int                      ((uint32_t)(1<<3))      /**< Clear Enabled Interrupt Bit Indicates that a change of direction was detected */\r
+#define QEI_IECLR_ERR_Int                      ((uint32_t)(1<<4))      /**< Clear Enabled Interrupt Bit Indicates that an encoder phase error was detected */\r
+#define QEI_IECLR_ENCLK_Int                    ((uint32_t)(1<<5))      /**< Clear Enabled Interrupt Bit Indicates that and encoder clock pulse was detected */\r
+#define QEI_IECLR_POS0_Int                     ((uint32_t)(1<<6))      /**< Clear Enabled Interrupt Bit Indicates that the position 0 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IECLR_POS1_Int                     ((uint32_t)(1<<7))      /**< Clear Enabled Interrupt Bit Indicates that the position 1compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IECLR_POS2_Int                     ((uint32_t)(1<<8))      /**< Clear Enabled Interrupt Bit Indicates that the position 2 compare value is equal to the\r
+                                                                                                               current position */\r
+#define QEI_IECLR_REV_Int                      ((uint32_t)(1<<9))      /**< Clear Enabled Interrupt Bit Indicates that the index compare value is equal to the current\r
+                                                                                                               index count */\r
+#define QEI_IECLR_POS0REV_Int          ((uint32_t)(1<<10))     /**< Clear Enabled Interrupt Bit that combined position 0 and revolution count interrupt */\r
+#define QEI_IECLR_POS1REV_Int          ((uint32_t)(1<<11))     /**< Clear Enabled Interrupt Bit that Combined position 1 and revolution count interrupt */\r
+#define QEI_IECLR_POS2REV_Int          ((uint32_t)(1<<12))     /**< Clear Enabled Interrupt Bit that Combined position 2 and revolution count interrupt */\r
+#define QEI_IECLR_BITMASK                      ((uint32_t)(0xFFFF))    /**< QEI Interrupt Enable Clear register bit-mask */\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/* Macro check QEI peripheral */\r
+#define PARAM_QEIx(n)  ((n==LPC_QEI))\r
+\r
+/* Macro check QEI reset type */\r
+#define PARAM_QEI_RESET(n)     ((n==QEI_CON_RESP) \\r
+|| (n==QEI_RESET_POSOnIDX) \\r
+|| (n==QEI_RESET_VEL) \\r
+|| (n==QEI_RESET_IDX))\r
+\r
+/* Macro check QEI Direction invert mode */\r
+#define PARAM_QEI_DIRINV(n)    ((n==QEI_DIRINV_NONE) || (n==QEI_DIRINV_CMPL))\r
+\r
+/* Macro check QEI signal mode */\r
+#define PARAM_QEI_SIGNALMODE(n)        ((n==QEI_SIGNALMODE_QUAD) || (n==QEI_SIGNALMODE_CLKDIR))\r
+\r
+/* Macro check QEI Capture mode */\r
+#define PARAM_QEI_CAPMODE(n)   ((n==QEI_CAPMODE_2X) || (n==QEI_CAPMODE_4X))\r
+\r
+/* Macro check QEI Invert index mode */\r
+#define PARAM_QEI_INVINX(n)            ((n==QEI_INVINX_NONE) || (n==QEI_INVINX_EN))\r
+\r
+/* Macro check QEI Direction invert mode */\r
+#define PARAM_QEI_TIMERRELOAD(n)       ((n==QEI_TIMERRELOAD_TICKVAL) || (n==QEI_TIMERRELOAD_USVAL))\r
+\r
+/* Macro check QEI status type */\r
+#define PARAM_QEI_STATUS(n)            ((n==QEI_STATUS_DIR))\r
+\r
+/* Macro check QEI combine position type */\r
+#define PARAM_QEI_COMPPOS_CH(n)                ((n==QEI_COMPPOS_CH_0) || (n==QEI_COMPPOS_CH_1) || (n==QEI_COMPPOS_CH_2))\r
+\r
+/* Macro check QEI interrupt flag type */\r
+#define PARAM_QEI_INTFLAG(n)   ((n==QEI_INTFLAG_INX_Int) \\r
+|| (n==QEI_INTFLAG_TIM_Int) \\r
+|| (n==QEI_INTFLAG_VELC_Int) \\r
+|| (n==QEI_INTFLAG_DIR_Int) \\r
+|| (n==QEI_INTFLAG_ERR_Int) \\r
+|| (n==QEI_INTFLAG_ENCLK_Int) \\r
+|| (n==QEI_INTFLAG_POS0_Int) \\r
+|| (n==QEI_INTFLAG_POS1_Int) \\r
+|| (n==QEI_INTFLAG_POS2_Int) \\r
+|| (n==QEI_INTFLAG_REV_Int) \\r
+|| (n==QEI_INTFLAG_POS0REV_Int) \\r
+|| (n==QEI_INTFLAG_POS1REV_Int) \\r
+|| (n==QEI_INTFLAG_POS2REV_Int))\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup QEI_Public_Types QEI Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief QEI structure definitions\r
+ **********************************************************************/\r
+/**\r
+ * @brief QEI Configuration structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t DirectionInvert        :1;     /**< Direction invert option:\r
+                                                                               - QEI_DIRINV_NONE: QEI Direction is normal\r
+                                                                               - QEI_DIRINV_CMPL: QEI Direction is complemented\r
+                                                                               */\r
+       uint32_t SignalMode                     :1;     /**< Signal mode Option:\r
+                                                                               - QEI_SIGNALMODE_QUAD: Signal is in Quadrature phase mode\r
+                                                                               - QEI_SIGNALMODE_CLKDIR: Signal is in Clock/Direction mode\r
+                                                                               */\r
+       uint32_t CaptureMode            :1;             /**< Capture Mode Option:\r
+                                                                               - QEI_CAPMODE_2X: Only Phase-A edges are counted (2X)\r
+                                                                               - QEI_CAPMODE_4X: BOTH Phase-A and Phase-B edges are counted (4X)\r
+                                                                               */\r
+       uint32_t InvertIndex            :1;     /**< Invert Index Option:\r
+                                                                               - QEI_INVINX_NONE: the sense of the index input is normal\r
+                                                                               - QEI_INVINX_EN: inverts the sense of the index input\r
+                                                                               */\r
+} QEI_CFG_Type;\r
+\r
+/**\r
+ * @brief Timer Reload Configuration structure type definition\r
+ */\r
+typedef struct {\r
+\r
+       uint8_t ReloadOption;           /**< Velocity Timer Reload Option, should be:\r
+                                                               - QEI_TIMERRELOAD_TICKVAL: Reload value in absolute value\r
+                                                               - QEI_TIMERRELOAD_USVAL: Reload value in microsecond value\r
+                                                               */\r
+       uint8_t Reserved[3];\r
+       uint32_t ReloadValue;           /**< Velocity Timer Reload Value, 32-bit long, should be matched\r
+                                                               with Velocity Timer Reload Option\r
+                                                               */\r
+} QEI_RELOADCFG_Type;\r
+\r
+typedef struct\r
+{\r
+       uint32_t PHA_FilterVal;         /**< FILTERPHA register input */\r
+       uint32_t PHB_FilterVal;         /**< FILTERPHB register input */\r
+       uint32_t INX_FilterVal;         /**< FILTERINX register input */\r
+} st_Qei_FilterCfg;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup QEI_Public_Functions QEI Public Functions\r
+ * @{\r
+ */\r
+\r
+void QEI_Init(uint8_t qeiId, QEI_CFG_Type *QEI_ConfigStruct);\r
+void QEI_DeInit(uint8_t qeiId);\r
+\r
+void QEI_Reset(uint8_t qeiId, uint32_t ulResetType);\r
+void QEI_GetCfgDefault(QEI_CFG_Type *QIE_InitStruct);\r
+FlagStatus QEI_GetStatus(uint8_t qeiId, uint32_t ulFlagType);\r
+uint32_t QEI_GetPosition(uint8_t qeiId);\r
+void QEI_SetMaxPosition(uint8_t qeiId, uint32_t ulMaxPos);\r
+void QEI_SetPositionComp(uint8_t qeiId, uint8_t bPosCompCh, uint32_t ulPosComp);\r
+uint32_t QEI_GetIndex(uint8_t qeiId);\r
+void QEI_SetIndexComp(uint8_t qeiId, uint32_t ulIndexComp);\r
+void QEI_SetTimerReload(uint8_t qeiId, QEI_RELOADCFG_Type *QEIReloadStruct);\r
+uint32_t QEI_GetTimer(uint8_t qeiId);\r
+uint32_t QEI_GetVelocity(uint8_t qeiId);\r
+uint32_t QEI_GetVelocityCap(uint8_t qeiId);\r
+void QEI_SetVelocityComp(uint8_t qeiId, uint32_t ulVelComp);\r
+void QEI_SetDigiFilter(uint8_t qeiId, st_Qei_FilterCfg FilterVal);\r
+uint32_t QEI_CalculateRPM(uint8_t qeiId, uint32_t ulVelCapValue, uint32_t ulPPR);\r
+\r
+FlagStatus QEI_GetIntStatus(uint8_t qeiId, uint32_t ulIntType);\r
+void QEI_IntCmd(uint8_t qeiId, uint32_t ulIntType, FunctionalState NewState);\r
+void QEI_IntSet(uint8_t qeiId, uint32_t ulIntType);\r
+void QEI_IntClear(uint8_t qeiId, uint32_t ulIntType);\r
+\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_QEI_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rgu.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rgu.h
new file mode 100644 (file)
index 0000000..43ae6ad
--- /dev/null
@@ -0,0 +1,139 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rgu.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rgu.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for RGU firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup RGU RGU (Reset Generation Unit)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_RGU_H_\r
+#define LPC18XX_RGU_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup RGU_Public_Types RGU Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief RGU enumeration\r
+ **********************************************************************/\r
+/** @brief Out Reset Signal Generated by RGU */\r
+typedef enum\r
+{\r
+       RGU_SIG_CORE  = 0,                                      /**< Core reset signal                  */\r
+       RGU_SIG_PERIPH,                                         /**< Peripheral reset signal    */\r
+       RGU_SIG_MASTER,                                         /**< Master reset signal                */\r
+       RGU_SIG_WWDT = 4,                                       /**< WWDT reset signal                  */\r
+       RGU_SIG_CREG,                                           /**< CREG reset signal                  */\r
+       RGU_SIG_BUS = 8,                                        /**< Bus reset signal                   */\r
+       RGU_SIG_SCU,                                            /**< SCU reset signal                   */\r
+       RGU_SIG_PINMUX,                                         /**< Pin mux reset signal               */\r
+       RGU_SIG_M3 = 13,                                        /**< Cortex-M3 reset signal             */\r
+       RGU_SIG_LCD = 16,                                       /**< LCD reset signal                   */\r
+       RGU_SIG_USB0,                                           /**< USB0 reset signal                  */\r
+       RGU_SIG_USB1,                                           /**< USB1 reset signal                  */\r
+       RGU_SIG_DMA,                                            /**< DMA reset signal                   */\r
+       RGU_SIG_SDIO,                                           /**< SDIO reset signal                  */\r
+       RGU_SIG_EMC,                                            /**< EMC reset signal                   */\r
+       RGU_SIG_ETHERNET,                                       /**< Ethernet reset signal              */\r
+       RGU_SIG_AES,                                            /**< AES reset signal                   */\r
+       RGU_SIG_GPIO = 28,                                      /**< GPIO reset signal                  */\r
+       RGU_SIG_TIMER0 = 32,                            /**< TIMER 0 reset signal               */\r
+       RGU_SIG_TIMER1,                                         /**< TIMER 1 reset signal               */\r
+       RGU_SIG_TIMER2,                                         /**< TIMER 2 reset signal               */\r
+       RGU_SIG_TIMER3,                                         /**< TIMER 3 reset signal               */\r
+       RGU_SIG_RITIMER,                                        /**< RIT timer reset signal             */\r
+       RGU_SIG_SCT,                                            /**< SCT reset signal                   */\r
+       RGU_SIG_MOTOCONPWM,                                     /**< Motor control reset signal */\r
+       RGU_SIG_QEI,                                            /**< QEI reset signal                   */\r
+       RGU_SIG_ADC0,                                           /**< ADC0 reset signal                  */\r
+       RGU_SIG_ADC1,                                           /**< ADC1 reset signal                  */\r
+       RGU_SIG_DAC,                                            /**< DAC reset signal                   */\r
+       RGU_SIG_UART0 = 44,                                     /**< UART0 reset signal                 */\r
+       RGU_SIG_UART1,                                          /**< UART1 reset signal                 */\r
+       RGU_SIG_UART2,                                          /**< UART2 reset signal                 */\r
+       RGU_SIG_UART3,                                          /**< UART3 reset signal                 */\r
+       RGU_SIG_I2C0,                                           /**< I2C0 reset signal                  */\r
+       RGU_SIG_I2C1,                                           /**< I2C1 reset signal                  */\r
+       RGU_SIG_SSP0,                                           /**< SSP0 reset signal                  */\r
+       RGU_SIG_SSP1,                                           /**< SSP1 reset signal                  */\r
+       RGU_SIG_I2S,                                            /**< I2S reset signal                   */\r
+       RGU_SIG_SPIFI,                                          /**< SPIFI reset signal                 */\r
+       RGU_SIG_CAN = 55                                        /**< CAN reset signal                   */\r
+}RGU_SIG;\r
+\r
+/** @brief Reset Cause Source */\r
+typedef enum {\r
+       RGU_SRC_NONE,                                           /**< No source                          */\r
+       RGU_SRC_SOFT,                                           /**< Software reset source      */\r
+       RGU_SRC_EXT,                                            /**< External reset source      */\r
+       RGU_SRC_CORE,                                           /**< Core reset source          */\r
+       RGU_SRC_PERIPH,                                         /**< Peripheral reset source*/\r
+       RGU_SRC_MASTER,                                         /**< Master reset source        */\r
+       RGU_SRC_BOD,                                            /**< BOD reset source           */\r
+       RGU_SRC_WWDT                                            /**< WWDT reset source          */\r
+}RGU_SRC;\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup RGU_Public_Functions RGU Public Functions\r
+ * @{\r
+ */\r
+/* RGU peripheral control function ----------------*/\r
+void RGU_SoftReset(RGU_SIG ResetSignal);\r
+RGU_SRC RGU_GetSource(RGU_SIG ResetSignal);\r
+Bool RGU_GetSignalStatus(RGU_SIG ResetSignal);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* LPC18XX_RGU_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rit.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rit.h
new file mode 100644 (file)
index 0000000..d85c053
--- /dev/null
@@ -0,0 +1,106 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rit.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rit.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for RIT firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup RIT RIT (Repetitive Interrupt Timer)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_RIT_H_\r
+#define LPC18XX_RIT_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup RIT_Private_Macros RIT Private Macros\r
+ * @{\r
+ */\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for RIT control register\r
+ **********************************************************************/\r
+/**    Set interrupt flag when the counter value equals the masked compare value */\r
+#define RIT_CTRL_INTEN ((uint32_t) (1))\r
+/** Set timer enable clear to 0 when the counter value equals the masked compare value  */\r
+#define RIT_CTRL_ENCLR         ((uint32_t) _BIT(1))\r
+/** Set timer enable on debug */\r
+#define RIT_CTRL_ENBR  ((uint32_t) _BIT(2))\r
+/** Set timer enable */\r
+#define RIT_CTRL_TEN   ((uint32_t) _BIT(3))\r
+\r
+/** Macro to determine if it is valid RIT peripheral */\r
+#define PARAM_RITx(n)  (((uint32_t *)n)==((uint32_t *)LPC_RITIMER))\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup RIT_Public_Functions RIT Public Functions\r
+ * @{\r
+ */\r
+/* RIT Init/DeInit functions */\r
+void RIT_Init(LPC_RITIMER_Type *RITx);\r
+void RIT_DeInit(LPC_RITIMER_Type *RITx);\r
+\r
+/* RIT config timer functions */\r
+void RIT_TimerConfig(LPC_RITIMER_Type *RITx, uint32_t time_interval);\r
+\r
+/* Enable/Disable RIT functions */\r
+void RIT_TimerClearCmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);\r
+void RIT_Cmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);\r
+void RIT_TimerDebugCmd(LPC_RITIMER_Type *RITx, FunctionalState NewState);\r
+\r
+/* RIT Interrupt functions */\r
+IntStatus RIT_GetIntStatus(LPC_RITIMER_Type *RITx);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_RIT_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rtc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_rtc.h
new file mode 100644 (file)
index 0000000..3e913d7
--- /dev/null
@@ -0,0 +1,322 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rtc.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rtc.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for RTC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup RTC RTC (Real-Time Clock)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_RTC_H_\r
+#define LPC18XX_RTC_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup RTC_Private_Macros RTC Private Macros\r
+ * @{\r
+ */\r
+\r
+/* ----------------------- BIT DEFINITIONS ----------------------------------- */\r
+/* Miscellaneous register group --------------------------------------------- */\r
+/**********************************************************************\r
+* ILR register definitions\r
+**********************************************************************/\r
+/** ILR register mask */\r
+#define RTC_ILR_BITMASK                        ((0x00000003))\r
+/** Bit inform the source interrupt is counter increment*/\r
+#define RTC_IRL_RTCCIF                 ((1<<0))\r
+/** Bit inform the source interrupt is alarm match*/\r
+#define RTC_IRL_RTCALF                 ((1<<1))\r
+\r
+/**********************************************************************\r
+* CCR register definitions\r
+**********************************************************************/\r
+/** CCR register mask */\r
+#define RTC_CCR_BITMASK                        ((0x00000013))\r
+/** Clock enable */\r
+#define RTC_CCR_CLKEN                  ((1<<0))\r
+/** Clock reset */\r
+#define RTC_CCR_CTCRST                 ((1<<1))\r
+/** Calibration counter enable */\r
+#define RTC_CCR_CCALEN                 ((1<<4))\r
+\r
+/**********************************************************************\r
+* CIIR register definitions\r
+**********************************************************************/\r
+/** Counter Increment Interrupt bit for second */\r
+#define RTC_CIIR_IMSEC                 ((1<<0))\r
+/** Counter Increment Interrupt bit for minute */\r
+#define RTC_CIIR_IMMIN                 ((1<<1))\r
+/** Counter Increment Interrupt bit for hour */\r
+#define RTC_CIIR_IMHOUR                        ((1<<2))\r
+/** Counter Increment Interrupt bit for day of month */\r
+#define RTC_CIIR_IMDOM                 ((1<<3))\r
+/** Counter Increment Interrupt bit for day of week */\r
+#define RTC_CIIR_IMDOW                 ((1<<4))\r
+/** Counter Increment Interrupt bit for day of year */\r
+#define RTC_CIIR_IMDOY                 ((1<<5))\r
+/** Counter Increment Interrupt bit for month */\r
+#define RTC_CIIR_IMMON                 ((1<<6))\r
+/** Counter Increment Interrupt bit for year */\r
+#define RTC_CIIR_IMYEAR                        ((1<<7))\r
+/** CIIR bit mask */\r
+#define RTC_CIIR_BITMASK               ((0xFF))\r
+\r
+/**********************************************************************\r
+* AMR register definitions\r
+**********************************************************************/\r
+/** Counter Increment Select Mask bit for second */\r
+#define RTC_AMR_AMRSEC                 ((1<<0))\r
+/** Counter Increment Select Mask bit for minute */\r
+#define RTC_AMR_AMRMIN                 ((1<<1))\r
+/** Counter Increment Select Mask bit for hour */\r
+#define RTC_AMR_AMRHOUR                        ((1<<2))\r
+/** Counter Increment Select Mask bit for day of month */\r
+#define RTC_AMR_AMRDOM                 ((1<<3))\r
+/** Counter Increment Select Mask bit for day of week */\r
+#define RTC_AMR_AMRDOW                 ((1<<4))\r
+/** Counter Increment Select Mask bit for day of year */\r
+#define RTC_AMR_AMRDOY                 ((1<<5))\r
+/** Counter Increment Select Mask bit for month */\r
+#define RTC_AMR_AMRMON                 ((1<<6))\r
+/** Counter Increment Select Mask bit for year */\r
+#define RTC_AMR_AMRYEAR                        ((1<<7))\r
+/** AMR bit mask */\r
+#define RTC_AMR_BITMASK                        ((0xFF))\r
+\r
+/**********************************************************************\r
+* RTC_AUX register definitions\r
+**********************************************************************/\r
+/** RTC Oscillator Fail detect flag */\r
+#define RTC_AUX_RTC_OSCF               ((1<<4))\r
+\r
+/**********************************************************************\r
+* RTC_AUXEN register definitions\r
+**********************************************************************/\r
+/** Oscillator Fail Detect interrupt enable*/\r
+#define RTC_AUXEN_RTC_OSCFEN   ((1<<4))\r
+\r
+/* Consolidated time register group ----------------------------------- */\r
+/**********************************************************************\r
+* Consolidated Time Register 0 definitions\r
+**********************************************************************/\r
+#define RTC_CTIME0_SECONDS_MASK                ((0x3F))\r
+#define RTC_CTIME0_MINUTES_MASK                ((0x3F00))\r
+#define RTC_CTIME0_HOURS_MASK          ((0x1F0000))\r
+#define RTC_CTIME0_DOW_MASK                    ((0x7000000))\r
+\r
+/**********************************************************************\r
+* Consolidated Time Register 1 definitions\r
+**********************************************************************/\r
+#define RTC_CTIME1_DOM_MASK                    ((0x1F))\r
+#define RTC_CTIME1_MONTH_MASK          ((0xF00))\r
+#define RTC_CTIME1_YEAR_MASK           ((0xFFF0000))\r
+\r
+/**********************************************************************\r
+* Consolidated Time Register 2 definitions\r
+**********************************************************************/\r
+#define RTC_CTIME2_DOY_MASK                    ((0xFFF))\r
+\r
+/**********************************************************************\r
+* Time Counter Group and Alarm register group\r
+**********************************************************************/\r
+/** SEC register mask */\r
+#define RTC_SEC_MASK                   (0x0000003F)\r
+/** MIN register mask */\r
+#define RTC_MIN_MASK                   (0x0000003F)\r
+/** HOUR register mask */\r
+#define RTC_HOUR_MASK                  (0x0000001F)\r
+/** DOM register mask */\r
+#define RTC_DOM_MASK                   (0x0000001F)\r
+/** DOW register mask */\r
+#define RTC_DOW_MASK                   (0x00000007)\r
+/** DOY register mask */\r
+#define RTC_DOY_MASK                   (0x000001FF)\r
+/** MONTH register mask */\r
+#define RTC_MONTH_MASK                 (0x0000000F)\r
+/** YEAR register mask */\r
+#define RTC_YEAR_MASK                  (0x00000FFF)\r
+\r
+#define RTC_SECOND_MAX         59 /*!< Maximum value of second */\r
+#define RTC_MINUTE_MAX         59 /*!< Maximum value of minute*/\r
+#define RTC_HOUR_MAX           23 /*!< Maximum value of hour*/\r
+#define RTC_MONTH_MIN          1 /*!< Minimum value of month*/\r
+#define RTC_MONTH_MAX          12 /*!< Maximum value of month*/\r
+#define RTC_DAYOFMONTH_MIN     1 /*!< Minimum value of day of month*/\r
+#define RTC_DAYOFMONTH_MAX     31 /*!< Maximum value of day of month*/\r
+#define RTC_DAYOFWEEK_MAX      6 /*!< Maximum value of day of week*/\r
+#define RTC_DAYOFYEAR_MIN      1 /*!< Minimum value of day of year*/\r
+#define RTC_DAYOFYEAR_MAX      366 /*!< Maximum value of day of year*/\r
+#define RTC_YEAR_MAX           4095 /*!< Maximum value of year*/\r
+\r
+/**********************************************************************\r
+* Calibration register\r
+**********************************************************************/\r
+/* Calibration register */\r
+/** Calibration value */\r
+#define RTC_CALIBRATION_CALVAL_MASK            ((0x1FFFF))\r
+/** Calibration direction */\r
+#define RTC_CALIBRATION_LIBDIR                 ((1<<17))\r
+/** Calibration max value */\r
+#define RTC_CALIBRATION_MAX                            ((0x20000))\r
+/** Calibration definitions */\r
+#define RTC_CALIB_DIR_FORWARD                  ((uint8_t)(0))\r
+#define RTC_CALIB_DIR_BACKWARD                 ((uint8_t)(1))\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid RTC peripheral */\r
+#define PARAM_RTCx(x)  (((uint32_t *)x)==((uint32_t *)LPC_RTC))\r
+\r
+/* Macro check RTC interrupt type */\r
+#define PARAM_RTC_INT(n)       ((n==RTC_INT_COUNTER_INCREASE) || (n==RTC_INT_ALARM))\r
+\r
+/* Macro check RTC time type */\r
+#define PARAM_RTC_TIMETYPE(n)  ((n==RTC_TIMETYPE_SECOND) || (n==RTC_TIMETYPE_MINUTE) \\r
+|| (n==RTC_TIMETYPE_HOUR) || (n==RTC_TIMETYPE_DAYOFWEEK) \\r
+|| (n==RTC_TIMETYPE_DAYOFMONTH) || (n==RTC_TIMETYPE_DAYOFYEAR) \\r
+|| (n==RTC_TIMETYPE_MONTH) || (n==RTC_TIMETYPE_YEAR))\r
+\r
+/* Macro check RTC calibration type */\r
+#define PARAM_RTC_CALIB_DIR(n) ((n==RTC_CALIB_DIR_FORWARD) || (n==RTC_CALIB_DIR_BACKWARD))\r
+\r
+/* Macro check RTC GPREG type */\r
+#define PARAM_RTC_GPREG_CH(n)  ((n<=63))\r
+\r
+/* RTC GPREG base address*/\r
+#define RTC_GPREG_BASE         0x40041000\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup RTC_Public_Types RTC Public Types\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief RTC enumeration\r
+ **********************************************************************/\r
+/** @brief RTC interrupt source */\r
+typedef enum {\r
+       RTC_INT_COUNTER_INCREASE = RTC_IRL_RTCCIF,      /*!<  Counter Increment Interrupt */\r
+       RTC_INT_ALARM = RTC_IRL_RTCALF                          /*!< The alarm interrupt */\r
+} RTC_INT_OPT;\r
+\r
+\r
+/** @brief RTC time type option */\r
+typedef enum {\r
+       RTC_TIMETYPE_SECOND = 0,                /*!< Second */\r
+       RTC_TIMETYPE_MINUTE = 1,                /*!< Month */\r
+       RTC_TIMETYPE_HOUR = 2,                  /*!< Hour */\r
+       RTC_TIMETYPE_DAYOFWEEK = 3,     /*!< Day of week */\r
+       RTC_TIMETYPE_DAYOFMONTH = 4,    /*!< Day of month */\r
+       RTC_TIMETYPE_DAYOFYEAR = 5,     /*!< Day of year */\r
+       RTC_TIMETYPE_MONTH = 6,                 /*!< Month */\r
+       RTC_TIMETYPE_YEAR = 7                   /*!< Year */\r
+} RTC_TIMETYPE_Num;\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief RTC structure definitions\r
+ **********************************************************************/\r
+/** @brief Time structure definitions for easy manipulate the data */\r
+typedef struct {\r
+       uint32_t SEC;           /*!< Seconds Register */\r
+       uint32_t MIN;           /*!< Minutes Register */\r
+       uint32_t HOUR;          /*!< Hours Register */\r
+       uint32_t DOM;           /*!< Day of Month Register */\r
+       uint32_t DOW;           /*!< Day of Week Register */\r
+       uint32_t DOY;           /*!< Day of Year Register */\r
+       uint32_t MONTH;         /*!< Months Register */\r
+       uint32_t YEAR;          /*!< Years Register */\r
+} RTC_TIME_Type;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup RTC_Public_Functions RTC Public Functions\r
+ * @{\r
+ */\r
+\r
+void RTC_Init (LPC_RTC_Type *RTCx);\r
+void RTC_DeInit(LPC_RTC_Type *RTCx);\r
+\r
+void RTC_ResetClockTickCounter(LPC_RTC_Type *RTCx);\r
+void RTC_Cmd (LPC_RTC_Type *RTCx, FunctionalState NewState);\r
+\r
+void RTC_SetTime (LPC_RTC_Type *RTCx, uint32_t Timetype, uint32_t TimeValue);\r
+uint32_t RTC_GetTime(LPC_RTC_Type *RTCx, uint32_t Timetype);\r
+\r
+void RTC_SetFullTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime);\r
+void RTC_GetFullTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime);\r
+\r
+void RTC_AlarmIntConfig (LPC_RTC_Type *RTCx, uint32_t AlarmTimeType, FunctionalState NewState);\r
+void RTC_SetAlarmTime (LPC_RTC_Type *RTCx, uint32_t Timetype, uint32_t ALValue);\r
+uint32_t RTC_GetAlarmTime (LPC_RTC_Type *RTCx, uint32_t Timetype);\r
+void RTC_SetFullAlarmTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime);\r
+void RTC_GetFullAlarmTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime);\r
+\r
+void RTC_CntIncrIntConfig (LPC_RTC_Type *RTCx, uint32_t CntIncrIntType, FunctionalState NewState);\r
+IntStatus RTC_GetIntPending (LPC_RTC_Type *RTCx, uint32_t IntType);\r
+void RTC_ClearIntPending (LPC_RTC_Type *RTCx, uint32_t IntType);\r
+\r
+void RTC_CalibCounterCmd(LPC_RTC_Type *RTCx, FunctionalState NewState);\r
+void RTC_CalibConfig(LPC_RTC_Type *RTCx, uint32_t CalibValue, uint8_t CalibDir);\r
+\r
+void RTC_WriteGPREG (LPC_RTC_Type *RTCx, uint8_t Channel, uint32_t Value);\r
+uint32_t RTC_ReadGPREG (LPC_RTC_Type *RTCx, uint8_t Channel);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_RTC_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_sct.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_sct.h
new file mode 100644 (file)
index 0000000..f0fdbe6
--- /dev/null
@@ -0,0 +1,142 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_sct.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_sct.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for SCT firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup SCT SCT (State Configurable Timer)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_SCT_H_\r
+#define LPC18XX_SCT_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private macros ------------------------------------------------------------- */\r
+/** @defgroup SCT_Private_Macros SCT Private Macros\r
+ * @{\r
+ */\r
+\r
+/* -------------------------- BIT DEFINITIONS ----------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for SCT  configuration register\r
+ **********************************************************************/\r
+/**  Selects 16/32 bit counter */\r
+#define SCT_CONFIG_16BIT_COUNTER               0x00000000\r
+#define SCT_CONFIG_32BIT_COUNTER               0x00000001\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for SCT control register\r
+ **********************************************************************/\r
+/**  Stop low counter */\r
+#define SCT_CTRL_STOP_L                                        (1<<1)\r
+/**  Halt low counter */\r
+#define SCT_CTRL_HALT_L                                        (1<<2)\r
+/**  Clear low or unified counter */\r
+#define SCT_CTRL_CLRCTR_L                              (1<<3)\r
+/**  Direction for low or unified counter */\r
+#define COUNTUP_TO_LIMIT_THEN_CLEAR_TO_ZERO            0\r
+#define COUNTUP_TO LIMIT_THEN_COUNTDOWN_TO_ZERO        1\r
+#define SCT_CTRL_BIDIR_L(x)                            (((x)&0x01)<<4)\r
+/**  Prescale clock for low or unified counter */\r
+#define SCT_CTRL_PRE_L(x)                              (((x)&0xFF)<<5)\r
+\r
+/**  Stop high counter */\r
+#define SCT_CTRL_STOP_H                                        (1<<17)\r
+/**  Halt high counter */\r
+#define SCT_CTRL_HALT_H                                        (1<<18)\r
+/**  Clear high counter */\r
+#define SCT_CTRL_CLRCTR_H                              (1<<19)\r
+/**  Direction for high counter */\r
+#define COUNTUP_TO_LIMIT_THEN_CLEAR_TO_ZERO            0\r
+#define COUNTUP_TO LIMIT_THEN_COUNTDOWN_TO_ZERO        1\r
+#define SCT_CTRL_BIDIR_H(x)                            (((x)&0x01)<<20)\r
+/**  Prescale clock for high counter */\r
+#define SCT_CTRL_PRE_H(x)                              (((x)&0xFF)<<21)\r
+/*********************************************************************//**\r
+ * Macro defines for SCT Conflict resolution register\r
+**********************************************************************/\r
+/**  Define conflict solution */\r
+#define SCT_RES_NOCHANGE                               (0)\r
+#define SCT_RES_SET_OUTPUT                             (1)\r
+#define SCT_RES_CLEAR_OUTPUT                   (2)\r
+#define SCT_RES_TOGGLE_OUTPUT                  (3)\r
+\r
+/* ------------------- CHECK PARAM DEFINITIONS ------------------------- */\r
+/** Check SCT output number */\r
+#define PARAM_SCT_OUTPUT_NUM(n)    ((n)<= CONFIG_SCT_nOU )\r
+\r
+/** Check SCT counter type */\r
+#define PARAM_SCT_CONFIG_COUNTER_TYPE(n)    ((n==SCT_CONFIG_16BIT_COUNTER)||(n==SCT_CONFIG_32BIT_COUNTER))\r
+\r
+/** Check SCT conflict solution */\r
+#define PARAM_SCT_RES(n)    ((n==SCT_RES_NOCHANGE)||(n==SCT_RES_SET_OUTPUT)\\r
+                                                               ||(n==SCT_RES_CLEAR_OUTPUT)||(n==SCT_RES_TOGGLE_OUTPUT))\r
+\r
+/** Check SCT event number */\r
+#define PARAM_SCT_EVENT(n)     ((n) <= 15)\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup SCT_Public_Functions SCT Public Functions\r
+ * @{\r
+ */\r
+\r
+void SCT_Config(uint32_t value);\r
+void SCT_ControlSet(uint32_t value, FunctionalState ena);\r
+void SCT_ConflictResolutionSet(uint8_t outnum, uint8_t value);\r
+void SCT_EventFlagClear(uint8_t even_num);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* LPC18XX_SCT_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_scu.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_scu.h
new file mode 100644 (file)
index 0000000..45c548a
--- /dev/null
@@ -0,0 +1,101 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_scu.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_scu.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for SCU firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup SCU      SCU (System Control Unit)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __SCU_H\r
+#define __SCU_H\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private macros ------------------------------------------------------------- */\r
+/** @defgroup SCT_Private_Macros SCT Private Macros\r
+ * @{\r
+ */\r
+\r
+/** Port offset definition */\r
+#define PORT_OFFSET    0x80\r
+/** Pin offset definition */\r
+#define PIN_OFFSET     0x04\r
+\r
+/* Pin modes */\r
+#define MD_PUP  (0x0<<3)\r
+#define MD_BUK  (0x1<<3)\r
+#define MD_PLN  (0x2<<3)\r
+#define MD_PDN  (0x3<<3)\r
+#define MD_EHS  (0x1<<5)\r
+#define MD_EZI  (0x1<<6)\r
+#define MD_ZI   (0x1<<7)\r
+#define MD_EHD0 (0x1<<8)\r
+#define MD_EHD1 (0x1<<8)\r
+#define MD_PLN_FAST (MD_PLN | MD_EZI | MD_ZI | MD_EHS)\r
+// 0xF0\r
+\r
+/* Pin function */\r
+#define FUNC0                  0x0                             /** Function 0  */\r
+#define FUNC1                  0x1                             /** Function 1  */\r
+#define FUNC2                  0x2                             /** Function 2  */\r
+#define FUNC3                  0x3                             /** Function 3  */\r
+#define FUNC4                  0x4\r
+#define FUNC5                  0x5\r
+#define FUNC6                  0x6\r
+#define FUNC7                  0x7\r
+/**\r
+ * @}\r
+ */\r
+\r
+#define LPC_SCU_PIN(po, pi)   (*(volatile int         *) (LPC_SCU_BASE + ((po) * 0x80) + ((pi) * 0x4))    )\r
+#define LPC_SCU_CLK(c)        (*(volatile int         *) (LPC_SCU_BASE + 0xC00 + ((c) * 0x4))    )\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup SCU_Public_Functions SCU Public Functions\r
+ * @{\r
+ */\r
+\r
+void scu_pinmux(uint8_t port, uint8_t pin, uint8_t mode, uint8_t func);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* end __SCU_H */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_ssp.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_ssp.h
new file mode 100644 (file)
index 0000000..61d0c3f
--- /dev/null
@@ -0,0 +1,446 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_ssp.h           2011-06-02\r
+*//**\r
+* @file                lpc18xx_ssp.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for SSP firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup SSP SSP (Synchronous Serial Port)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_SSP_H_\r
+#define LPC18XX_SSP_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup SSP_Private_Macros SSP Private Macros\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * SSP configuration parameter defines\r
+ **********************************************************************/\r
+/** Clock phase control bit */\r
+#define SSP_CPHA_FIRST                 ((uint32_t)(0))\r
+#define SSP_CPHA_SECOND                        SSP_CR0_CPHA_SECOND\r
+\r
+\r
+/** Clock polarity control bit */\r
+/* There's no bug here!!!\r
+ * - If bit[6] in SSPnCR0 is 0: SSP controller maintains the bus clock low between frames.\r
+ * That means the active clock is in HI state.\r
+ * - If bit[6] in SSPnCR0 is 1 (SSP_CR0_CPOL_HI): SSP controller maintains the bus clock\r
+ * high between frames. That means the active clock is in LO state.\r
+ */\r
+#define SSP_CPOL_HI                            ((uint32_t)(0))\r
+#define SSP_CPOL_LO                            SSP_CR0_CPOL_HI\r
+\r
+/** SSP master mode enable */\r
+#define SSP_SLAVE_MODE                 SSP_CR1_SLAVE_EN\r
+#define SSP_MASTER_MODE                        ((uint32_t)(0))\r
+\r
+/** SSP data bit number defines */\r
+#define SSP_DATABIT_4          SSP_CR0_DSS(4)                  /*!< Databit number = 4 */\r
+#define SSP_DATABIT_5          SSP_CR0_DSS(5)                  /*!< Databit number = 5 */\r
+#define SSP_DATABIT_6          SSP_CR0_DSS(6)                  /*!< Databit number = 6 */\r
+#define SSP_DATABIT_7          SSP_CR0_DSS(7)                  /*!< Databit number = 7 */\r
+#define SSP_DATABIT_8          SSP_CR0_DSS(8)                  /*!< Databit number = 8 */\r
+#define SSP_DATABIT_9          SSP_CR0_DSS(9)                  /*!< Databit number = 9 */\r
+#define SSP_DATABIT_10         SSP_CR0_DSS(10)                 /*!< Databit number = 10 */\r
+#define SSP_DATABIT_11         SSP_CR0_DSS(11)                 /*!< Databit number = 11 */\r
+#define SSP_DATABIT_12         SSP_CR0_DSS(12)                 /*!< Databit number = 12 */\r
+#define SSP_DATABIT_13         SSP_CR0_DSS(13)                 /*!< Databit number = 13 */\r
+#define SSP_DATABIT_14         SSP_CR0_DSS(14)                 /*!< Databit number = 14 */\r
+#define SSP_DATABIT_15         SSP_CR0_DSS(15)                 /*!< Databit number = 15 */\r
+#define SSP_DATABIT_16         SSP_CR0_DSS(16)                 /*!< Databit number = 16 */\r
+\r
+/** SSP Frame Format definition */\r
+/** Motorola SPI mode */\r
+#define SSP_FRAME_SPI          SSP_CR0_FRF_SPI\r
+/** TI synchronous serial mode */\r
+#define SSP_FRAME_TI           SSP_CR0_FRF_TI\r
+/** National Micro-wire mode */\r
+#define SSP_FRAME_MICROWIRE    SSP_CR0_FRF_MICROWIRE\r
+\r
+/*********************************************************************//**\r
+ * SSP Status defines\r
+ **********************************************************************/\r
+/** SSP status TX FIFO Empty bit */\r
+#define SSP_STAT_TXFIFO_EMPTY          SSP_SR_TFE\r
+/** SSP status TX FIFO not full bit */\r
+#define SSP_STAT_TXFIFO_NOTFULL                SSP_SR_TNF\r
+/** SSP status RX FIFO not empty bit */\r
+#define SSP_STAT_RXFIFO_NOTEMPTY       SSP_SR_RNE\r
+/** SSP status RX FIFO full bit */\r
+#define SSP_STAT_RXFIFO_FULL           SSP_SR_RFF\r
+/** SSP status SSP Busy bit */\r
+#define SSP_STAT_BUSY                          SSP_SR_BSY\r
+\r
+/*********************************************************************//**\r
+ * SSP Interrupt Configuration defines\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_INTCFG_ROR         SSP_IMSC_ROR\r
+/** Receive TimeOut */\r
+#define SSP_INTCFG_RT          SSP_IMSC_RT\r
+/** Rx FIFO is at least half full */\r
+#define SSP_INTCFG_RX          SSP_IMSC_RX\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_INTCFG_TX          SSP_IMSC_TX\r
+\r
+/*********************************************************************//**\r
+ * SSP Configured Interrupt Status defines\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_INTSTAT_ROR                SSP_MIS_ROR\r
+/** Receive TimeOut */\r
+#define SSP_INTSTAT_RT         SSP_MIS_RT\r
+/** Rx FIFO is at least half full */\r
+#define SSP_INTSTAT_RX         SSP_MIS_RX\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_INTSTAT_TX         SSP_MIS_TX\r
+\r
+/*********************************************************************//**\r
+ * SSP Raw Interrupt Status defines\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_INTSTAT_RAW_ROR            SSP_RIS_ROR\r
+/** Receive TimeOut */\r
+#define SSP_INTSTAT_RAW_RT             SSP_RIS_RT\r
+/** Rx FIFO is at least half full */\r
+#define SSP_INTSTAT_RAW_RX             SSP_RIS_RX\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_INTSTAT_RAW_TX             SSP_RIS_TX\r
+\r
+/*********************************************************************//**\r
+ * SSP Interrupt Clear defines\r
+ **********************************************************************/\r
+/** Writing a 1 to this bit clears the "frame was received when\r
+ * RxFIFO was full" interrupt */\r
+#define SSP_INTCLR_ROR         SSP_ICR_ROR\r
+/** Writing a 1 to this bit clears the "Rx FIFO was not empty and\r
+ * has not been read for a timeout period" interrupt */\r
+#define SSP_INTCLR_RT          SSP_ICR_RT\r
+\r
+/*********************************************************************//**\r
+ * SSP DMA defines\r
+ **********************************************************************/\r
+/** SSP bit for enabling RX DMA */\r
+#define SSP_DMA_TX             SSP_DMA_RXDMA_EN\r
+/** SSP bit for enabling TX DMA */\r
+#define SSP_DMA_RX             SSP_DMA_TXDMA_EN\r
+\r
+/* SSP Status Implementation definitions */\r
+#define SSP_STAT_DONE          (1UL<<8)                /**< Done */\r
+#define SSP_STAT_ERROR         (1UL<<9)                /**< Error */\r
+\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for CR0 register\r
+ **********************************************************************/\r
+/** SSP data size select, must be 4 bits to 16 bits */\r
+#define SSP_CR0_DSS(n)                 ((uint32_t)((n-1)&0xF))\r
+/** SSP control 0 Motorola SPI mode */\r
+#define SSP_CR0_FRF_SPI                ((uint32_t)(0<<4))\r
+/** SSP control 0 TI synchronous serial mode */\r
+#define SSP_CR0_FRF_TI                 ((uint32_t)(1<<4))\r
+/** SSP control 0 National Micro-wire mode */\r
+#define SSP_CR0_FRF_MICROWIRE          ((uint32_t)(2<<4))\r
+/** SPI clock polarity bit (used in SPI mode only), (1) = maintains the\r
+   bus clock high between frames, (0) = low */\r
+#define SSP_CR0_CPOL_HI                ((uint32_t)(1<<6))\r
+/** SPI clock out phase bit (used in SPI mode only), (1) = captures data\r
+   on the second clock transition of the frame, (0) = first */\r
+#define SSP_CR0_CPHA_SECOND    ((uint32_t)(1<<7))\r
+/** SSP serial clock rate value load macro, divider rate is\r
+   PERIPH_CLK / (cpsr * (SCR + 1)) */\r
+#define SSP_CR0_SCR(n)         ((uint32_t)((n&0xFF)<<8))\r
+/** SSP CR0 bit mask */\r
+#define SSP_CR0_BITMASK                ((uint32_t)(0xFFFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for CR1 register\r
+ **********************************************************************/\r
+/** SSP control 1 loopback mode enable bit */\r
+#define SSP_CR1_LBM_EN         ((uint32_t)(1<<0))\r
+/** SSP control 1 enable bit */\r
+#define SSP_CR1_SSP_EN         ((uint32_t)(1<<1))\r
+/** SSP control 1 slave enable */\r
+#define SSP_CR1_SLAVE_EN       ((uint32_t)(1<<2))\r
+/** SSP control 1 slave out disable bit, disables transmit line in slave\r
+   mode */\r
+#define SSP_CR1_SO_DISABLE     ((uint32_t)(1<<3))\r
+/** SSP CR1 bit mask */\r
+#define SSP_CR1_BITMASK                ((uint32_t)(0x0F))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DR register\r
+ **********************************************************************/\r
+/** SSP data bit mask */\r
+#define SSP_DR_BITMASK(n)   ((n)&0xFFFF)\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for SR register\r
+ **********************************************************************/\r
+/** SSP status TX FIFO Empty bit */\r
+#define SSP_SR_TFE      ((uint32_t)(1<<0))\r
+/** SSP status TX FIFO not full bit */\r
+#define SSP_SR_TNF      ((uint32_t)(1<<1))\r
+/** SSP status RX FIFO not empty bit */\r
+#define SSP_SR_RNE      ((uint32_t)(1<<2))\r
+/** SSP status RX FIFO full bit */\r
+#define SSP_SR_RFF      ((uint32_t)(1<<3))\r
+/** SSP status SSP Busy bit */\r
+#define SSP_SR_BSY      ((uint32_t)(1<<4))\r
+/** SSP SR bit mask */\r
+#define SSP_SR_BITMASK ((uint32_t)(0x1F))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for CPSR register\r
+ **********************************************************************/\r
+/** SSP clock prescaler */\r
+#define SSP_CPSR_CPDVSR(n)     ((uint32_t)(n&0xFF))\r
+/** SSP CPSR bit mask */\r
+#define SSP_CPSR_BITMASK       ((uint32_t)(0xFF))\r
+\r
+/*********************************************************************//**\r
+ * Macro define for (IMSC) Interrupt Mask Set/Clear registers\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_IMSC_ROR   ((uint32_t)(1<<0))\r
+/** Receive TimeOut */\r
+#define SSP_IMSC_RT            ((uint32_t)(1<<1))\r
+/** Rx FIFO is at least half full */\r
+#define SSP_IMSC_RX            ((uint32_t)(1<<2))\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_IMSC_TX            ((uint32_t)(1<<3))\r
+/** IMSC bit mask */\r
+#define SSP_IMSC_BITMASK       ((uint32_t)(0x0F))\r
+\r
+/*********************************************************************//**\r
+ * Macro define for (RIS) Raw Interrupt Status registers\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_RIS_ROR            ((uint32_t)(1<<0))\r
+/** Receive TimeOut */\r
+#define SSP_RIS_RT             ((uint32_t)(1<<1))\r
+/** Rx FIFO is at least half full */\r
+#define SSP_RIS_RX             ((uint32_t)(1<<2))\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_RIS_TX             ((uint32_t)(1<<3))\r
+/** RIS bit mask */\r
+#define SSP_RIS_BITMASK        ((uint32_t)(0x0F))\r
+\r
+/*********************************************************************//**\r
+ * Macro define for (MIS) Masked Interrupt Status registers\r
+ **********************************************************************/\r
+/** Receive Overrun */\r
+#define SSP_MIS_ROR            ((uint32_t)(1<<0))\r
+/** Receive TimeOut */\r
+#define SSP_MIS_RT             ((uint32_t)(1<<1))\r
+/** Rx FIFO is at least half full */\r
+#define SSP_MIS_RX             ((uint32_t)(1<<2))\r
+/** Tx FIFO is at least half empty */\r
+#define SSP_MIS_TX             ((uint32_t)(1<<3))\r
+/** MIS bit mask */\r
+#define SSP_MIS_BITMASK        ((uint32_t)(0x0F))\r
+\r
+/*********************************************************************//**\r
+ * Macro define for (ICR) Interrupt Clear registers\r
+ **********************************************************************/\r
+/** Writing a 1 to this bit clears the "frame was received when\r
+ * RxFIFO was full" interrupt */\r
+#define SSP_ICR_ROR            ((uint32_t)(1<<0))\r
+/** Writing a 1 to this bit clears the "Rx FIFO was not empty and\r
+ * has not been read for a timeout period" interrupt */\r
+#define SSP_ICR_RT             ((uint32_t)(1<<1))\r
+/** ICR bit mask */\r
+#define SSP_ICR_BITMASK        ((uint32_t)(0x03))\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for DMACR register\r
+ **********************************************************************/\r
+/** SSP bit for enabling RX DMA */\r
+#define SSP_DMA_RXDMA_EN       ((uint32_t)(1<<0))\r
+/** SSP bit for enabling TX DMA */\r
+#define SSP_DMA_TXDMA_EN       ((uint32_t)(1<<1))\r
+/** DMACR      bit mask */\r
+#define SSP_DMA_BITMASK                ((uint32_t)(0x03))\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid SSP port number */\r
+#define PARAM_SSPx(n)  ((((uint32_t *)n)==((uint32_t *)LPC_SSP0)) \\r
+|| (((uint32_t *)n)==((uint32_t *)LPC_SSP1)))\r
+\r
+/** Macro check clock phase control mode */\r
+#define PARAM_SSP_CPHA(n)              ((n==SSP_CPHA_FIRST) || (n==SSP_CPHA_SECOND))\r
+\r
+/** Macro check clock polarity mode */\r
+#define PARAM_SSP_CPOL(n)              ((n==SSP_CPOL_HI) || (n==SSP_CPOL_LO))\r
+\r
+/* Macro check master/slave mode */\r
+#define PARAM_SSP_MODE(n)              ((n==SSP_SLAVE_MODE) || (n==SSP_MASTER_MODE))\r
+\r
+/* Macro check databit value */\r
+#define PARAM_SSP_DATABIT(n)   ((n==SSP_DATABIT_4) || (n==SSP_DATABIT_5) \\r
+|| (n==SSP_DATABIT_6) || (n==SSP_DATABIT_16) \\r
+|| (n==SSP_DATABIT_7) || (n==SSP_DATABIT_8) \\r
+|| (n==SSP_DATABIT_9) || (n==SSP_DATABIT_10) \\r
+|| (n==SSP_DATABIT_11) || (n==SSP_DATABIT_12) \\r
+|| (n==SSP_DATABIT_13) || (n==SSP_DATABIT_14) \\r
+|| (n==SSP_DATABIT_15))\r
+\r
+/* Macro check frame type */\r
+#define PARAM_SSP_FRAME(n) ((n==SSP_FRAME_SPI) || (n==SSP_FRAME_TI)\\r
+|| (n==SSP_FRAME_MICROWIRE))\r
+\r
+/* Macro check SSP status */\r
+#define PARAM_SSP_STAT(n) ((n==SSP_STAT_TXFIFO_EMPTY) || (n==SSP_STAT_TXFIFO_NOTFULL) \\r
+|| (n==SSP_STAT_RXFIFO_NOTEMPTY) || (n==SSP_STAT_RXFIFO_FULL) \\r
+|| (n==SSP_STAT_BUSY))\r
+\r
+/* Macro check interrupt configuration */\r
+#define PARAM_SSP_INTCFG(n)    ((n==SSP_INTCFG_ROR) || (n==SSP_INTCFG_RT) \\r
+|| (n==SSP_INTCFG_RX) || (n==SSP_INTCFG_TX))\r
+\r
+/* Macro check interrupt status value */\r
+#define PARAM_SSP_INTSTAT(n) ((n==SSP_INTSTAT_ROR) || (n==SSP_INTSTAT_RT) \\r
+|| (n==SSP_INTSTAT_RX) || (n==SSP_INTSTAT_TX))\r
+\r
+/* Macro check interrupt status raw value */\r
+#define PARAM_SSP_INTSTAT_RAW(n)       ((n==SSP_INTSTAT_RAW_ROR) || (n==SSP_INTSTAT_RAW_RT) \\r
+|| (n==SSP_INTSTAT_RAW_RX) || (n==SSP_INTSTAT_RAW_TX))\r
+\r
+/* Macro check interrupt clear mode */\r
+#define PARAM_SSP_INTCLR(n)    ((n==SSP_INTCLR_ROR) || (n==SSP_INTCLR_RT))\r
+\r
+/* Macro check DMA mode */\r
+#define PARAM_SSP_DMA(n)       ((n==SSP_DMA_TX) || (n==SSP_DMA_RX))\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup SSP_Public_Types SSP Public Types\r
+ * @{\r
+ */\r
+\r
+/** @brief SSP configuration structure */\r
+typedef struct {\r
+       uint32_t Databit;               /** Databit number, should be SSP_DATABIT_x,\r
+                                                       where x is in range from 4 - 16 */\r
+       uint32_t CPHA;                  /** Clock phase, should be:\r
+                                                               - SSP_CPHA_FIRST: first clock edge\r
+                                                               - SSP_CPHA_SECOND: second clock edge */\r
+       uint32_t CPOL;                  /** Clock polarity, should be:\r
+                                                               - SSP_CPOL_HI: high level\r
+                                                               - SSP_CPOL_LO: low level */\r
+       uint32_t Mode;                  /** SSP mode, should be:\r
+                                                               - SSP_MASTER_MODE: Master mode\r
+                                                               - SSP_SLAVE_MODE: Slave mode */\r
+       uint32_t FrameFormat;   /** Frame Format:\r
+                                                               - SSP_FRAME_SPI: Motorola SPI frame format\r
+                                                               - SSP_FRAME_TI: TI frame format\r
+                                                               - SSP_FRAME_MICROWIRE: National Microwire frame format */\r
+       uint32_t ClockRate;             /** Clock rate,in Hz */\r
+} SSP_CFG_Type;\r
+\r
+/**\r
+ * @brief SSP Transfer Type definitions\r
+ */\r
+typedef enum {\r
+       SSP_TRANSFER_POLLING = 0,       /**< Polling transfer */\r
+       SSP_TRANSFER_INTERRUPT          /**< Interrupt transfer */\r
+} SSP_TRANSFER_Type;\r
+\r
+/**\r
+ * @brief SPI Data configuration structure definitions\r
+ */\r
+typedef struct {\r
+       void *tx_data;                          /**< Pointer to transmit data */\r
+       uint32_t tx_cnt;                        /**< Transmit counter */\r
+       void *rx_data;                          /**< Pointer to transmit data */\r
+       uint32_t rx_cnt;                        /**< Receive counter */\r
+       uint32_t length;                        /**< Length of transfer data */\r
+       uint32_t status;                        /**< Current status of SSP activity */\r
+} SSP_DATA_SETUP_Type;\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup SSP_Public_Functions SSP Public Functions\r
+ * @{\r
+ */\r
+\r
+void SSP_Init(LPC_SSPn_Type *SSPx, SSP_CFG_Type *SSP_ConfigStruct);\r
+void SSP_DeInit(LPC_SSPn_Type* SSPx);\r
+\r
+void SSP_ConfigStructInit(SSP_CFG_Type *SSP_InitStruct);\r
+void SSP_Cmd(LPC_SSPn_Type* SSPx, FunctionalState NewState);\r
+void SSP_LoopBackCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState);\r
+void SSP_SlaveOutputCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState);\r
+void SSP_SendData(LPC_SSPn_Type* SSPx, uint16_t Data);\r
+uint16_t SSP_ReceiveData(LPC_SSPn_Type* SSPx);\r
+int32_t SSP_ReadWrite (LPC_SSPn_Type *SSPx, SSP_DATA_SETUP_Type *dataCfg, \\r
+                                               SSP_TRANSFER_Type xfType);\r
+FlagStatus SSP_GetStatus(LPC_SSPn_Type* SSPx, uint32_t FlagType);\r
+uint8_t SSP_GetDataSize(LPC_SSPn_Type* SSPx);\r
+void SSP_IntConfig(LPC_SSPn_Type *SSPx, uint32_t IntType, FunctionalState NewState);\r
+IntStatus SSP_GetRawIntStatus(LPC_SSPn_Type *SSPx, uint32_t RawIntType);\r
+IntStatus SSP_GetIntStatus (LPC_SSPn_Type *SSPx, uint32_t IntType);\r
+void SSP_ClearIntPending(LPC_SSPn_Type *SSPx, uint32_t IntType);\r
+void SSP_DMACmd(LPC_SSPn_Type *SSPx, uint32_t DMAMode, FunctionalState NewState);\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_SSP_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_timer.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_timer.h
new file mode 100644 (file)
index 0000000..1233a5c
--- /dev/null
@@ -0,0 +1,352 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_timer.h         2011-06-02\r
+*//**\r
+* @file                lpc18xx_timer.h\r
+* @brief       Contains all functions support for Timer firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup TIMER TIMER\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __LPC18XX_TIMER_H_\r
+#define __LPC18XX_TIMER_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup TIMER_Private_Macros TIMER Private Macros\r
+ * @{\r
+ */\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/**********************************************************************\r
+** Interrupt information\r
+**********************************************************************/\r
+/** Macro to clean interrupt pending */\r
+#define TIM_IR_CLR(n) _BIT(n)\r
+\r
+/**********************************************************************\r
+** Timer interrupt register definitions\r
+**********************************************************************/\r
+/** Macro for getting a timer match interrupt bit */\r
+#define TIM_MATCH_INT(n)               (_BIT(n & 0x0F))\r
+/** Macro for getting a capture event interrupt bit */\r
+#define TIM_CAP_INT(n)     (_BIT(((n & 0x0F) + 4)))\r
+\r
+/**********************************************************************\r
+* Timer control register definitions\r
+**********************************************************************/\r
+/** Timer/counter enable bit */\r
+#define TIM_ENABLE                     ((uint32_t)(1<<0))\r
+/** Timer/counter reset bit */\r
+#define TIM_RESET                      ((uint32_t)(1<<1))\r
+/** Timer control bit mask */\r
+#define TIM_TCR_MASKBIT                ((uint32_t)(3))\r
+\r
+/**********************************************************************\r
+* Timer match control register definitions\r
+**********************************************************************/\r
+/** Bit location for interrupt on MRx match, n = 0 to 3 */\r
+#define TIM_INT_ON_MATCH(n)            (_BIT((n * 3)))\r
+/** Bit location for reset on MRx match, n = 0 to 3 */\r
+#define TIM_RESET_ON_MATCH(n)          (_BIT(((n * 3) + 1)))\r
+/** Bit location for stop on MRx match, n = 0 to 3 */\r
+#define TIM_STOP_ON_MATCH(n)           (_BIT(((n * 3) + 2)))\r
+/** Timer Match control bit mask */\r
+#define TIM_MCR_MASKBIT                           ((uint32_t)(0x0FFF))\r
+/** Timer Match control bit mask for specific channel*/\r
+#define        TIM_MCR_CHANNEL_MASKBIT(n)              ((uint32_t)(7<<(n*3)))\r
+\r
+/**********************************************************************\r
+* Timer capture control register definitions\r
+**********************************************************************/\r
+/** Bit location for CAP.n on CRx rising edge, n = 0 to 3 */\r
+#define TIM_CAP_RISING(n)      (_BIT((n * 3)))\r
+/** Bit location for CAP.n on CRx falling edge, n = 0 to 3 */\r
+#define TIM_CAP_FALLING(n)     (_BIT(((n * 3) + 1)))\r
+/** Bit location for CAP.n on CRx interrupt enable, n = 0 to 3 */\r
+#define TIM_INT_ON_CAP(n)      (_BIT(((n * 3) + 2)))\r
+/** Mask bit for rising and falling edge bit */\r
+#define TIM_EDGE_MASK(n)               (_SBF((n * 3), 0x03))\r
+/** Timer capture control bit mask */\r
+#define TIM_CCR_MASKBIT                        ((uint32_t)(0x3F))\r
+/** Timer Capture control bit mask for specific channel*/\r
+#define        TIM_CCR_CHANNEL_MASKBIT(n)              ((uint32_t)(7<<(n*3)))\r
+\r
+/**********************************************************************\r
+* Timer external match register definitions\r
+**********************************************************************/\r
+/** Bit location for output state change of MAT.n when external match\r
+   happens, n = 0 to 3 */\r
+#define TIM_EM(n)                      _BIT(n)\r
+/** Output state change of MAT.n when external match happens: no change */\r
+#define TIM_EM_NOTHING         ((uint8_t)(0x0))\r
+/** Output state change of MAT.n when external match happens: low */\r
+#define TIM_EM_LOW             ((uint8_t)(0x1))\r
+/** Output state change of MAT.n when external match happens: high */\r
+#define TIM_EM_HIGH            ((uint8_t)(0x2))\r
+/** Output state change of MAT.n when external match happens: toggle */\r
+#define TIM_EM_TOGGLE          ((uint8_t)(0x3))\r
+/** Macro for setting for the MAT.n change state bits */\r
+#define TIM_EM_SET(n,s)        (_SBF(((n << 1) + 4), (s & 0x03)))\r
+/** Mask for the MAT.n change state bits */\r
+#define TIM_EM_MASK(n)                 (_SBF(((n << 1) + 4), 0x03))\r
+/** Timer external match bit mask */\r
+#define TIM_EMR_MASKBIT        0x0FFF\r
+\r
+/**********************************************************************\r
+* Timer Count Control Register definitions\r
+**********************************************************************/\r
+/** Mask to get the Counter/timer mode bits */\r
+#define TIM_CTCR_MODE_MASK  0x3\r
+/** Mask to get the count input select bits */\r
+#define TIM_CTCR_INPUT_MASK 0xC\r
+/** Timer Count control bit mask */\r
+#define TIM_CTCR_MASKBIT       0xF\r
+#define TIM_COUNTER_MODE ((uint8_t)(1))\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+/** Macro to determine if it is valid TIMER peripheral */\r
+#define PARAM_TIMx(n)  ((((uint32_t *)n)==((uint32_t *)LPC_TIMER0)) || (((uint32_t *)n)==((uint32_t *)LPC_TIMER1)) \\r
+|| (((uint32_t *)n)==((uint32_t *)LPC_TIMER2)) || (((uint32_t *)n)==((uint32_t *)LPC_TIMER3)))\r
+\r
+/* Macro check interrupt type */\r
+#define PARAM_TIM_INT_TYPE(TYPE)       ((TYPE ==TIM_MR0_INT)||(TYPE ==TIM_MR1_INT)\\r
+||(TYPE ==TIM_MR2_INT)||(TYPE ==TIM_MR3_INT)\\r
+||(TYPE ==TIM_CR0_INT)||(TYPE ==TIM_CR1_INT)\\r
+||(TYPE ==TIM_CR2_INT)||(TYPE ==TIM_CR3_INT))\r
+\r
+/* Macro check TIMER mode */\r
+#define PARAM_TIM_MODE_OPT(MODE)       ((MODE == TIM_TIMER_MODE)||(MODE == TIM_COUNTER_RISING_MODE)\\r
+|| (MODE == TIM_COUNTER_RISING_MODE)||(MODE == TIM_COUNTER_RISING_MODE))\r
+\r
+/* Macro check TIMER prescale value */\r
+#define PARAM_TIM_PRESCALE_OPT(OPT)    ((OPT == TIM_PRESCALE_TICKVAL)||(OPT == TIM_PRESCALE_USVAL))\r
+\r
+/* Macro check TIMER counter intput mode */\r
+#define PARAM_TIM_COUNTER_INPUT_OPT(OPT)       ((OPT == TIM_COUNTER_INCAP0)||(OPT == TIM_COUNTER_INCAP1)\\r
+                                                                                       ||(OPT == TIM_COUNTER_INCAP2)||(OPT == TIM_COUNTER_INCAP3))\r
+\r
+/* Macro check TIMER external match mode */\r
+#define PARAM_TIM_EXTMATCH_OPT(OPT)    ((OPT == TIM_EXTMATCH_NOTHING)||(OPT == TIM_EXTMATCH_LOW)\\r
+||(OPT == TIM_EXTMATCH_HIGH)||(OPT == TIM_EXTMATCH_TOGGLE))\r
+\r
+/* Macro check TIMER external match mode */\r
+#define PARAM_TIM_CAP_MODE_OPT(OPT)    ((OPT == TIM_CAPTURE_NONE)||(OPT == TIM_CAPTURE_RISING) \\r
+||(OPT == TIM_CAPTURE_FALLING)||(OPT == TIM_CAPTURE_ANY))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup TIMER_Public_Types TIMER Public Types\r
+ * @{\r
+ */\r
+\r
+/***********************************************************************\r
+ * @brief Timer device enumeration\r
+**********************************************************************/\r
+/** @brief interrupt type */\r
+typedef enum\r
+{\r
+       TIM_MR0_INT =0, /*!< interrupt for Match channel 0*/\r
+       TIM_MR1_INT =1, /*!< interrupt for Match channel 1*/\r
+       TIM_MR2_INT =2, /*!< interrupt for Match channel 2*/\r
+       TIM_MR3_INT =3, /*!< interrupt for Match channel 3*/\r
+       TIM_CR0_INT =4, /*!< interrupt for Capture channel 0*/\r
+       TIM_CR1_INT =5, /*!< interrupt for Capture channel 1*/\r
+       TIM_CR2_INT =6, /*!< interrupt for Capture channel 1*/\r
+       TIM_CR3_INT =7 /*!< interrupt for Capture channel 1*/\r
+}TIM_INT_TYPE;\r
+\r
+/** @brief Timer/counter operating mode */\r
+typedef enum\r
+{\r
+       TIM_TIMER_MODE = 0,                             /*!< Timer mode */\r
+       TIM_COUNTER_RISING_MODE,                /*!< Counter rising mode */\r
+       TIM_COUNTER_FALLING_MODE,               /*!< Counter falling mode */\r
+       TIM_COUNTER_ANY_MODE                    /*!< Counter on both edges */\r
+} TIM_MODE_OPT;\r
+\r
+/** @brief Timer/Counter prescale option */\r
+typedef enum\r
+{\r
+       TIM_PRESCALE_TICKVAL = 0,               /*!< Prescale in absolute value */\r
+       TIM_PRESCALE_USVAL                              /*!< Prescale in microsecond value */\r
+} TIM_PRESCALE_OPT;\r
+\r
+/** @brief Counter input option */\r
+typedef enum\r
+{\r
+       TIM_COUNTER_INCAP0 = 0,                 /*!< CAPn.0 input pin for TIMERn */\r
+       TIM_COUNTER_INCAP1,                             /*!< CAPn.1 input pin for TIMERn */\r
+       TIM_COUNTER_INCAP2,                             /*!< CAPn.2 input pin for TIMERn */\r
+       TIM_COUNTER_INCAP3                              /*!< CAPn.3 input pin for TIMERn */\r
+} TIM_COUNTER_INPUT_OPT;\r
+\r
+/** @brief Timer/Counter external match option */\r
+typedef enum\r
+{\r
+       TIM_EXTMATCH_NOTHING = 0,               /*!< Do nothing for external output pin if match */\r
+       TIM_EXTMATCH_LOW,                               /*!< Force external output pin to low if match */\r
+       TIM_EXTMATCH_HIGH,                              /*!< Force external output pin to high if match */\r
+       TIM_EXTMATCH_TOGGLE                             /*!< Toggle external output pin if match */\r
+}TIM_EXTMATCH_OPT;\r
+\r
+/** @brief Timer/counter capture mode options */\r
+typedef enum {\r
+       TIM_CAPTURE_NONE = 0,   /*!< No Capture */\r
+       TIM_CAPTURE_RISING,             /*!< Rising capture mode */\r
+       TIM_CAPTURE_FALLING,    /*!< Falling capture mode */\r
+       TIM_CAPTURE_ANY                 /*!< On both edges */\r
+} TIM_CAP_MODE_OPT;\r
+\r
+/***********************************************************************\r
+ * @brief Timer structure definitions\r
+**********************************************************************/\r
+/** @brief Configuration structure in TIMER mode */\r
+typedef struct\r
+{\r
+\r
+       uint8_t PrescaleOption;         /**< Timer Prescale option, should be:\r
+                                                                       - TIM_PRESCALE_TICKVAL: Prescale in absolute value\r
+                                                                       - TIM_PRESCALE_USVAL: Prescale in microsecond value\r
+                                                                       */\r
+       uint8_t Reserved[3];            /**< Reserved */\r
+       uint32_t PrescaleValue;         /**< Prescale value */\r
+} TIM_TIMERCFG_Type;\r
+\r
+/** @brief Configuration structure in COUNTER mode */\r
+typedef struct {\r
+\r
+       uint8_t CounterOption;          /**< Counter Option, should be:\r
+                                                                       - TIM_COUNTER_INCAP0: CAPn.0 input pin for TIMERn\r
+                                                                       - TIM_COUNTER_INCAP1: CAPn.1 input pin for TIMERn\r
+                                                               */\r
+       uint8_t CountInputSelect;\r
+       uint8_t Reserved[2];\r
+} TIM_COUNTERCFG_Type;\r
+\r
+/** @brief Match channel configuration structure */\r
+typedef struct {\r
+       uint8_t MatchChannel;   /**< Match channel, should be in range\r
+                                                       from 0..3 */\r
+       uint8_t IntOnMatch;             /**< Interrupt On match, should be:\r
+                                                               - ENABLE: Enable this function.\r
+                                                               - DISABLE: Disable this function.\r
+                                                       */\r
+       uint8_t StopOnMatch;    /**< Stop On match, should be:\r
+                                                               - ENABLE: Enable this function.\r
+                                                               - DISABLE: Disable this function.\r
+                                                       */\r
+       uint8_t ResetOnMatch;   /**< Reset On match, should be:\r
+                                                               - ENABLE: Enable this function.\r
+                                                               - DISABLE: Disable this function.\r
+                                                       */\r
+\r
+       uint8_t ExtMatchOutputType;     /**< External Match Output type, should be:\r
+                                                               -        TIM_EXTMATCH_NOTHING:  Do nothing for external output pin if match\r
+                                                               -   TIM_EXTMATCH_LOW:   Force external output pin to low if match\r
+                                                               -        TIM_EXTMATCH_HIGH: Force external output pin to high if match\r
+                                                               -   TIM_EXTMATCH_TOGGLE: Toggle external output pin if match.\r
+                                                       */\r
+       uint8_t Reserved[3];    /** Reserved */\r
+       uint32_t MatchValue;    /** Match value */\r
+} TIM_MATCHCFG_Type;\r
+\r
+/** @brief Capture Input configuration structure */\r
+typedef struct {\r
+       uint8_t CaptureChannel; /**< Capture channel, should be in range\r
+                                                       from 0..1 */\r
+       uint8_t RisingEdge;             /**< caption rising edge, should be:\r
+                                                               - ENABLE: Enable rising edge.\r
+                                                               - DISABLE: Disable this function.\r
+                                                       */\r
+       uint8_t FallingEdge;    /**< caption falling edge, should be:\r
+                                                               - ENABLE: Enable falling edge.\r
+                                                               - DISABLE: Disable this function.\r
+                                                               */\r
+       uint8_t IntOnCaption;   /**< Interrupt On caption, should be:\r
+                                                               - ENABLE: Enable interrupt function.\r
+                                                               - DISABLE: Disable this function.\r
+                                                       */\r
+\r
+} TIM_CAPTURECFG_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup TIMER_Public_Functions TIMER Public Functions\r
+ * @{\r
+ */\r
+/* Init/DeInit TIM functions -----------*/\r
+void TIM_Init(LPC_TIMERn_Type *TIMx, TIM_MODE_OPT TimerCounterMode, void *TIM_ConfigStruct);\r
+void TIM_DeInit(LPC_TIMERn_Type *TIMx);\r
+\r
+/* TIM interrupt functions -------------*/\r
+void TIM_ClearIntPending(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag);\r
+void TIM_ClearIntCapturePending(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag);\r
+FlagStatus TIM_GetIntStatus(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag);\r
+FlagStatus TIM_GetIntCaptureStatus(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag);\r
+\r
+/* TIM configuration functions --------*/\r
+void TIM_ConfigStructInit(TIM_MODE_OPT TimerCounterMode, void *TIM_ConfigStruct);\r
+void TIM_ConfigMatch(LPC_TIMERn_Type *TIMx, TIM_MATCHCFG_Type *TIM_MatchConfigStruct);\r
+void TIM_UpdateMatchValue(LPC_TIMERn_Type *TIMx,uint8_t MatchChannel, uint32_t MatchValue);\r
+void TIM_SetMatchExt(LPC_TIMERn_Type *TIMx,TIM_EXTMATCH_OPT ext_match );\r
+void TIM_ConfigCapture(LPC_TIMERn_Type *TIMx, TIM_CAPTURECFG_Type *TIM_CaptureConfigStruct);\r
+void TIM_Cmd(LPC_TIMERn_Type *TIMx, FunctionalState NewState);\r
+\r
+uint32_t TIM_GetCaptureValue(LPC_TIMERn_Type *TIMx, TIM_COUNTER_INPUT_OPT CaptureChannel);\r
+void TIM_ResetCounter(LPC_TIMERn_Type *TIMx);\r
+void TIM_Waitus(uint32_t time);\r
+void TIM_Waitms(uint32_t time);\r
+/**\r
+ * @}\r
+ */\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __LPC18XX_TIMER_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_uart.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_uart.h
new file mode 100644 (file)
index 0000000..541fc29
--- /dev/null
@@ -0,0 +1,677 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_uart.h          2011-06-02\r
+*//**\r
+* @file                lpc18xx_uart.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for UART firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup UART UART\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef __LPC18XX_UART_H\r
+#define __LPC18XX_UART_H\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup UART_Public_Macros  UART Public Macros\r
+ * @{\r
+ */\r
+\r
+/** UART time-out definitions in case of using Read() and Write function\r
+ * with Blocking Flag mode\r
+ */\r
+#define UART_BLOCKING_TIMEOUT                  (0xFFFFFFFFUL)\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup UART_Private_Macros UART Private Macros\r
+ * @{\r
+ */\r
+\r
+/* Accepted Error baud rate value (in percent unit) */\r
+#define UART_ACCEPTED_BAUDRATE_ERROR   (3)                     /*!< Acceptable UART baudrate error */\r
+\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UARTn Receiver Buffer Register\r
+ **********************************************************************/\r
+#define UART_RBR_MASKBIT       ((uint8_t)0xFF)                 /*!< UART Received Buffer mask bit (8 bits) */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UARTn Transmit Holding Register\r
+ **********************************************************************/\r
+#define UART_THR_MASKBIT       ((uint8_t)0xFF)                 /*!< UART Transmit Holding mask bit (8 bits) */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UARTn Divisor Latch LSB register\r
+ **********************************************************************/\r
+#define UART_LOAD_DLL(div)     ((div) & 0xFF)  /**< Macro for loading least significant halfs of divisors */\r
+#define UART_DLL_MASKBIT       ((uint8_t)0xFF) /*!< Divisor latch LSB bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UARTn Divisor Latch MSB register\r
+ **********************************************************************/\r
+#define UART_DLM_MASKBIT       ((uint8_t)0xFF)                 /*!< Divisor latch MSB bit mask */\r
+#define UART_LOAD_DLM(div)  (((div) >> 8) & 0xFF)      /**< Macro for loading most significant halfs of divisors */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART interrupt enable register\r
+ **********************************************************************/\r
+#define UART_IER_RBRINT_EN             ((uint32_t)(1<<0))      /*!< RBR Interrupt enable*/\r
+#define UART_IER_THREINT_EN            ((uint32_t)(1<<1))      /*!< THR Interrupt enable*/\r
+#define UART_IER_RLSINT_EN             ((uint32_t)(1<<2))      /*!< RX line status interrupt enable*/\r
+#define UART1_IER_MSINT_EN             ((uint32_t)(1<<3))      /*!< Modem status interrupt enable */\r
+#define UART1_IER_CTSINT_EN            ((uint32_t)(1<<7))      /*!< CTS1 signal transition interrupt enable */\r
+#define UART_IER_ABEOINT_EN            ((uint32_t)(1<<8))      /*!< Enables the end of auto-baud interrupt */\r
+#define UART_IER_ABTOINT_EN            ((uint32_t)(1<<9))      /*!< Enables the auto-baud time-out interrupt */\r
+#define UART_IER_BITMASK               ((uint32_t)(0x307)) /*!< UART interrupt enable register bit mask */\r
+#define UART1_IER_BITMASK              ((uint32_t)(0x38F)) /*!< UART1 interrupt enable register bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART interrupt identification register\r
+ **********************************************************************/\r
+#define UART_IIR_INTSTAT_PEND  ((uint32_t)(1<<0))      /*!<Interrupt Status - Active low */\r
+#define UART_IIR_INTID_RLS             ((uint32_t)(3<<1))      /*!<Interrupt identification: Receive line status*/\r
+#define UART_IIR_INTID_RDA             ((uint32_t)(2<<1))      /*!<Interrupt identification: Receive data available*/\r
+#define UART_IIR_INTID_CTI             ((uint32_t)(6<<1))      /*!<Interrupt identification: Character time-out indicator*/\r
+#define UART_IIR_INTID_THRE            ((uint32_t)(1<<1))      /*!<Interrupt identification: THRE interrupt*/\r
+#define UART1_IIR_INTID_MODEM  ((uint32_t)(0<<1))      /*!<Interrupt identification: Modem interrupt*/\r
+#define UART_IIR_INTID_MASK            ((uint32_t)(7<<1))      /*!<Interrupt identification: Interrupt ID mask */\r
+#define UART_IIR_FIFO_EN               ((uint32_t)(3<<6))      /*!<These bits are equivalent to UnFCR[0] */\r
+#define UART_IIR_ABEO_INT              ((uint32_t)(1<<8))      /*!< End of auto-baud interrupt */\r
+#define UART_IIR_ABTO_INT              ((uint32_t)(1<<9))      /*!< Auto-baud time-out interrupt */\r
+#define UART_IIR_BITMASK               ((uint32_t)(0x3CF))     /*!< UART interrupt identification register bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART FIFO control register\r
+ **********************************************************************/\r
+#define UART_FCR_FIFO_EN               ((uint8_t)(1<<0))       /*!< UART FIFO enable */\r
+#define UART_FCR_RX_RS                 ((uint8_t)(1<<1))       /*!< UART FIFO RX reset */\r
+#define UART_FCR_TX_RS                 ((uint8_t)(1<<2))       /*!< UART FIFO TX reset */\r
+#define UART_FCR_DMAMODE_SEL   ((uint8_t)(1<<3))       /*!< UART DMA mode selection */\r
+#define UART_FCR_TRG_LEV0              ((uint8_t)(0))          /*!< UART FIFO trigger level 0: 1 character */\r
+#define UART_FCR_TRG_LEV1              ((uint8_t)(1<<6))       /*!< UART FIFO trigger level 1: 4 character */\r
+#define UART_FCR_TRG_LEV2              ((uint8_t)(2<<6))       /*!< UART FIFO trigger level 2: 8 character */\r
+#define UART_FCR_TRG_LEV3              ((uint8_t)(3<<6))       /*!< UART FIFO trigger level 3: 14 character */\r
+#define UART_FCR_BITMASK               ((uint8_t)(0xCF))       /*!< UART FIFO control bit mask */\r
+#define UART_TX_FIFO_SIZE              (16)\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART line control register\r
+ **********************************************************************/\r
+#define UART_LCR_WLEN5                 ((uint8_t)(0))                  /*!< UART 5 bit data mode */\r
+#define UART_LCR_WLEN6                 ((uint8_t)(1<<0))       /*!< UART 6 bit data mode */\r
+#define UART_LCR_WLEN7                 ((uint8_t)(2<<0))       /*!< UART 7 bit data mode */\r
+#define UART_LCR_WLEN8                 ((uint8_t)(3<<0))       /*!< UART 8 bit data mode */\r
+#define UART_LCR_STOPBIT_SEL   ((uint8_t)(1<<2))       /*!< UART Two Stop Bits Select */\r
+#define UART_LCR_PARITY_EN             ((uint8_t)(1<<3))               /*!< UART Parity Enable */\r
+#define UART_LCR_PARITY_ODD            ((uint8_t)(0))          /*!< UART Odd Parity Select */\r
+#define UART_LCR_PARITY_EVEN   ((uint8_t)(1<<4))               /*!< UART Even Parity Select */\r
+#define UART_LCR_PARITY_F_1            ((uint8_t)(2<<4))               /*!< UART force 1 stick parity */\r
+#define UART_LCR_PARITY_F_0            ((uint8_t)(3<<4))               /*!< UART force 0 stick parity */\r
+#define UART_LCR_BREAK_EN              ((uint8_t)(1<<6))               /*!< UART Transmission Break enable */\r
+#define UART_LCR_DLAB_EN               ((uint8_t)(1<<7))       /*!< UART Divisor Latches Access bit enable */\r
+#define UART_LCR_BITMASK               ((uint8_t)(0xFF))               /*!< UART line control bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART1 Modem Control Register\r
+ **********************************************************************/\r
+#define UART1_MCR_DTR_CTRL             ((uint8_t)(1<<0))               /*!< Source for modem output pin DTR */\r
+#define UART1_MCR_RTS_CTRL             ((uint8_t)(1<<1))               /*!< Source for modem output pin RTS */\r
+#define UART1_MCR_LOOPB_EN             ((uint8_t)(1<<4))               /*!< Loop back mode select */\r
+#define UART1_MCR_AUTO_RTS_EN  ((uint8_t)(1<<6))               /*!< Enable Auto RTS flow-control */\r
+#define UART1_MCR_AUTO_CTS_EN  ((uint8_t)(1<<7))               /*!< Enable Auto CTS flow-control */\r
+#define UART1_MCR_BITMASK              ((uint8_t)(0x0F3))              /*!< UART1 bit mask value */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART line status register\r
+ **********************************************************************/\r
+#define UART_LSR_RDR           ((uint8_t)(1<<0))       /*!<Line status register: Receive data ready*/\r
+#define UART_LSR_OE                    ((uint8_t)(1<<1))       /*!<Line status register: Overrun error*/\r
+#define UART_LSR_PE                    ((uint8_t)(1<<2))       /*!<Line status register: Parity error*/\r
+#define UART_LSR_FE                    ((uint8_t)(1<<3))       /*!<Line status register: Framing error*/\r
+#define UART_LSR_BI                    ((uint8_t)(1<<4))       /*!<Line status register: Break interrupt*/\r
+#define UART_LSR_THRE          ((uint8_t)(1<<5))       /*!<Line status register: Transmit holding register empty*/\r
+#define UART_LSR_TEMT          ((uint8_t)(1<<6))       /*!<Line status register: Transmitter empty*/\r
+#define UART_LSR_RXFE          ((uint8_t)(1<<7))       /*!<Error in RX FIFO*/\r
+#define UART_LSR_BITMASK       ((uint8_t)(0xFF))       /*!<UART Line status bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART Modem (UART1 only) status register\r
+ **********************************************************************/\r
+#define UART1_MSR_DELTA_CTS            ((uint8_t)(1<<0))       /*!< Set upon state change of input CTS */\r
+#define UART1_MSR_DELTA_DSR            ((uint8_t)(1<<1))       /*!< Set upon state change of input DSR */\r
+#define UART1_MSR_LO2HI_RI             ((uint8_t)(1<<2))       /*!< Set upon low to high transition of input RI */\r
+#define UART1_MSR_DELTA_DCD            ((uint8_t)(1<<3))       /*!< Set upon state change of input DCD */\r
+#define UART1_MSR_CTS                  ((uint8_t)(1<<4))       /*!< Clear To Send State */\r
+#define UART1_MSR_DSR                  ((uint8_t)(1<<5))       /*!< Data Set Ready State */\r
+#define UART1_MSR_RI                   ((uint8_t)(1<<6))       /*!< Ring Indicator State */\r
+#define UART1_MSR_DCD                  ((uint8_t)(1<<7))       /*!< Data Carrier Detect State */\r
+#define UART1_MSR_BITMASK              ((uint8_t)(0xFF))       /*!< MSR register bit-mask value */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART Scratch Pad Register\r
+ **********************************************************************/\r
+#define UART_SCR_BIMASK                ((uint8_t)(0xFF))       /*!< UART Scratch Pad bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART Auto baudrate control register\r
+ **********************************************************************/\r
+#define UART_ACR_START                         ((uint32_t)(1<<0))      /**< UART Auto-baud start */\r
+#define UART_ACR_MODE                          ((uint32_t)(1<<1))      /**< UART Auto baudrate Mode 1 */\r
+#define UART_ACR_AUTO_RESTART          ((uint32_t)(1<<2))      /**< UART Auto baudrate restart */\r
+#define UART_ACR_ABEOINT_CLR           ((uint32_t)(1<<8))      /**< UART End of auto-baud interrupt clear */\r
+#define UART_ACR_ABTOINT_CLR           ((uint32_t)(1<<9))      /**< UART Auto-baud time-out interrupt clear */\r
+#define UART_ACR_BITMASK                       ((uint32_t)(0x307))     /**< UART Auto Baudrate register bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART IrDA control register\r
+ **********************************************************************/\r
+#define UART_ICR_IRDAEN                        ((uint32_t)(1<<0))                      /**< IrDA mode enable */\r
+#define UART_ICR_IRDAINV               ((uint32_t)(1<<1))                      /**< IrDA serial input inverted */\r
+#define UART_ICR_FIXPULSE_EN   ((uint32_t)(1<<2))                      /**< IrDA fixed pulse width mode */\r
+#define UART_ICR_PULSEDIV(n)   ((uint32_t)((n&0x07)<<3))       /**< PulseDiv - Configures the pulse when FixPulseEn = 1 */\r
+#define UART_ICR_BITMASK               ((uint32_t)(0x3F))                      /*!< UART IRDA bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART half duplex register\r
+ **********************************************************************/\r
+#define UART_HDEN_HDEN                 ((uint32_t)(1<<0))                      /**< enable half-duplex mode*/\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART smart card interface control register\r
+ **********************************************************************/\r
+#define UART_SCICTRL_SCIEN             ((uint32_t)(1<<0))                      /**< enable asynchronous half-duplex smart card interface*/\r
+#define UART_SCICTRL_NACKDIS   ((uint32_t)(1<<1))                      /**< NACK response is inhibited*/\r
+#define UART_SCICTRL_PROTSEL_T1        ((uint32_t)(1<<2))                      /**< ISO7816-3 protocol T1 is selected*/\r
+#define UART_SCICTRL_TXRETRY(n)        ((uint32_t)((n&0x07)<<5))       /**< number of retransmission*/\r
+#define UART_SCICTRL_GUARDTIME(n)      ((uint32_t)((n&0xFF)<<8))       /**< Extra guard time*/\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART synchronous control register\r
+ **********************************************************************/\r
+#define UART_SYNCCTRL_SYNC             ((uint32_t)(1<<0))                      /**< enable synchronous mode*/\r
+#define UART_SYNCCTRL_CSRC_MASTER      ((uint32_t)(1<<1))              /**< synchronous master mode*/\r
+#define UART_SYNCCTRL_FES              ((uint32_t)(1<<2))                      /**< sample on falling edge*/\r
+#define UART_SYNCCTRL_TSBYPASS ((uint32_t)(1<<3))                      /**< to be defined*/\r
+#define UART_SYNCCTRL_CSCEN            ((uint32_t)(1<<4))                      /**< continuous running clock enable (master mode only)*/\r
+#define UART_SYNCCTRL_STARTSTOPDISABLE ((uint32_t)(1<<5))      /**< do not send start/stop bit*/\r
+#define UART_SYNCCTRL_CCCLR            ((uint32_t)(1<<6))                      /**< stop continuous clock*/\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART Fractional divider register\r
+ **********************************************************************/\r
+#define UART_FDR_DIVADDVAL(n)  ((uint32_t)(n&0x0F))            /**< Baud-rate generation pre-scaler divisor */\r
+#define UART_FDR_MULVAL(n)             ((uint32_t)((n<<4)&0xF0))       /**< Baud-rate pre-scaler multiplier value */\r
+#define UART_FDR_BITMASK               ((uint32_t)(0xFF))                      /**< UART Fractional Divider register bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART Tx Enable register\r
+ **********************************************************************/\r
+#define UART1_TER_TXEN                 ((uint8_t)(1<<7))               /*!< Transmit enable bit */\r
+#define UART1_TER_BITMASK              ((uint8_t)(0x80))               /**< UART Transmit Enable Register bit mask */\r
+#define UART0_2_3_TER_TXEN             ((uint8_t)(1<<0))               /*!< Transmit enable bit */\r
+#define UART0_2_3_TER_BITMASK  ((uint8_t)(0x01))               /**< UART Transmit Enable Register bit mask */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART1 RS485 Control register\r
+ **********************************************************************/\r
+#define UART_RS485CTRL_NMM_EN          ((uint32_t)(1<<0))      /*!< RS-485/EIA-485 Normal Multi-drop Mode (NMM)\r
+                                                                                                               is disabled */\r
+#define UART_RS485CTRL_RX_DIS          ((uint32_t)(1<<1))      /*!< The receiver is disabled */\r
+#define UART_RS485CTRL_AADEN           ((uint32_t)(1<<2))      /*!< Auto Address Detect (AAD) is enabled */\r
+#define UART_RS485CTRL_SEL_DTR         ((uint32_t)(1<<3))      /*!< If direction control is enabled\r
+                                                                                                               (bit DCTRL = 1), pin DTR is used for direction control */\r
+#define UART_RS485CTRL_DCTRL_EN        ((uint32_t)(1<<4))      /*!< Enable Auto Direction Control */\r
+#define UART_RS485CTRL_OINV_1          ((uint32_t)(1<<5))      /*!< This bit reverses the polarity of the direction\r
+                                                                                                               control signal on the RTS (or DTR) pin. The direction control pin\r
+                                                                                                               will be driven to logic "1" when the transmitter has data to be sent */\r
+#define UART_RS485CTRL_BITMASK         ((uint32_t)(0x3F))      /**< RS485 control bit-mask value */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART1 RS-485 Address Match register\r
+ **********************************************************************/\r
+#define UART_RS485ADRMATCH_BITMASK ((uint8_t)(0xFF))   /**< Bit mask value */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART1 RS-485 Delay value register\r
+ **********************************************************************/\r
+/* Macro defines for UART1 RS-485 Delay value register */\r
+#define UART_RS485DLY_BITMASK          ((uint8_t)(0xFF))       /** Bit mask value */\r
+\r
+/*********************************************************************//**\r
+ * Macro defines for Macro defines for UART FIFO Level register\r
+ **********************************************************************/\r
+#define UART_FIFOLVL_RXFIFOLVL(n)      ((uint32_t)(n&0x0F))            /**< Reflects the current level of the UART receiver FIFO */\r
+#define UART_FIFOLVL_TXFIFOLVL(n)      ((uint32_t)((n>>8)&0x0F))       /**< Reflects the current level of the UART transmitter FIFO */\r
+#define UART_FIFOLVL_BITMASK           ((uint32_t)(0x0F0F))            /**< UART FIFO Level Register bit mask */\r
+\r
+\r
+/* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
+\r
+/** Macro to check the input UART_DATABIT parameters */\r
+#define PARAM_UART_DATABIT(databit)    ((databit==UART_DATABIT_5) || (databit==UART_DATABIT_6)\\r
+|| (databit==UART_DATABIT_7) || (databit==UART_DATABIT_8))\r
+\r
+/** Macro to check the input UART_STOPBIT parameters */\r
+#define PARAM_UART_STOPBIT(stopbit)    ((stopbit==UART_STOPBIT_1) || (stopbit==UART_STOPBIT_2))\r
+\r
+/** Macro to check the input UART_PARITY parameters */\r
+#define PARAM_UART_PARITY(parity)      ((parity==UART_PARITY_NONE) || (parity==UART_PARITY_ODD) \\r
+|| (parity==UART_PARITY_EVEN) || (parity==UART_PARITY_SP_1) \\r
+|| (parity==UART_PARITY_SP_0))\r
+\r
+/** Macro to check the input UART_FIFO parameters */\r
+#define PARAM_UART_FIFO_LEVEL(fifo)    ((fifo==UART_FIFO_TRGLEV0) \\r
+|| (fifo==UART_FIFO_TRGLEV1) || (fifo==UART_FIFO_TRGLEV2) \\r
+|| (fifo==UART_FIFO_TRGLEV3))\r
+\r
+/** Macro to check the input UART_INTCFG parameters */\r
+#define PARAM_UART_INTCFG(IntCfg)      ((IntCfg==UART_INTCFG_RBR) || (IntCfg==UART_INTCFG_THRE) \\r
+|| (IntCfg==UART_INTCFG_RLS) || (IntCfg==UART_INTCFG_ABEO) \\r
+|| (IntCfg==UART_INTCFG_ABTO))\r
+\r
+/** Macro to check the input UART1_INTCFG parameters - expansion input parameter for UART1 */\r
+#define PARAM_UART1_INTCFG(IntCfg)     ((IntCfg==UART1_INTCFG_MS) || (IntCfg==UART1_INTCFG_CTS))\r
+\r
+/** Macro to check the input UART_AUTOBAUD_MODE parameters */\r
+#define PARAM_UART_AUTOBAUD_MODE(ABmode)       ((ABmode==UART_AUTOBAUD_MODE0) || (ABmode==UART_AUTOBAUD_MODE1))\r
+\r
+/** Macro to check the input UART_AUTOBAUD_INTSTAT parameters */\r
+#define PARAM_UART_AUTOBAUD_INTSTAT(ABIntStat) ((ABIntStat==UART_AUTOBAUD_INTSTAT_ABEO) || \\r
+               (ABIntStat==UART_AUTOBAUD_INTSTAT_ABTO))\r
+\r
+/** Macro to check the input UART_IrDA_PULSEDIV parameters */\r
+#define PARAM_UART_IrDA_PULSEDIV(PulseDiv)     ((PulseDiv==UART_IrDA_PULSEDIV2) || (PulseDiv==UART_IrDA_PULSEDIV4) \\r
+|| (PulseDiv==UART_IrDA_PULSEDIV8) || (PulseDiv==UART_IrDA_PULSEDIV16) \\r
+|| (PulseDiv==UART_IrDA_PULSEDIV32) || (PulseDiv==UART_IrDA_PULSEDIV64) \\r
+|| (PulseDiv==UART_IrDA_PULSEDIV128) || (PulseDiv==UART_IrDA_PULSEDIV256))\r
+\r
+/* Macro to check the input UART1_SignalState parameters */\r
+#define PARAM_UART1_SIGNALSTATE(x) ((x==INACTIVE) || (x==ACTIVE))\r
+\r
+/** Macro to check the input PARAM_UART1_MODEM_PIN parameters */\r
+#define PARAM_UART1_MODEM_PIN(x) ((x==UART1_MODEM_PIN_DTR) || (x==UART1_MODEM_PIN_RTS))\r
+\r
+/** Macro to check the input PARAM_UART1_MODEM_MODE parameters */\r
+#define PARAM_UART1_MODEM_MODE(x) ((x==UART1_MODEM_MODE_LOOPBACK) || (x==UART1_MODEM_MODE_AUTO_RTS) \\r
+|| (x==UART1_MODEM_MODE_AUTO_CTS))\r
+\r
+/** Macro to check the direction control pin type */\r
+#define PARAM_UART_RS485_DIRCTRL_PIN(x)        ((x==UART_RS485_DIRCTRL_RTS) || (x==UART_RS485_DIRCTRL_DTR)|| (x==UART_RS485_DIRCTRL_DIR))\r
+\r
+/* Macro to determine if it is valid UART port number */\r
+#define PARAM_UARTx(x) ((((uint32_t *)x)==((uint32_t *)LPC_USART0)) \\r
+|| (((uint32_t *)x)==((uint32_t *)LPC_UART1)) \\r
+|| (((uint32_t *)x)==((uint32_t *)LPC_USART2)) \\r
+|| (((uint32_t *)x)==((uint32_t *)LPC_USART3)))\r
+#define PARAM_UART_IrDA(x) (((uint32_t *)x)==((uint32_t *)LPC_USART3))\r
+#define PARAM_UART1_MODEM(x) (((uint32_t *)x)==((uint32_t *)LPC_UART1))\r
+\r
+/** Macro to check the input value for UART_RS485_CFG_MATCHADDRVALUE parameter */\r
+#define PARAM_UART_RS485_CFG_MATCHADDRVALUE(x) ((x<0xFF))\r
+\r
+/** Macro to check the input value for UART_RS485_CFG_DELAYVALUE parameter */\r
+#define PARAM_UART_RS485_CFG_DELAYVALUE(x) ((x<0xFF))\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup UART_Public_Types UART Public Types\r
+ * @{\r
+ */\r
+\r
+/***********************************************************************\r
+ * @brief UART enumeration\r
+**********************************************************************/\r
+/**\r
+ * @brief UART Databit type definitions\r
+ */\r
+typedef enum {\r
+       UART_DATABIT_5          = 0,                    /*!< UART 5 bit data mode */\r
+       UART_DATABIT_6,                                 /*!< UART 6 bit data mode */\r
+       UART_DATABIT_7,                                 /*!< UART 7 bit data mode */\r
+       UART_DATABIT_8                                  /*!< UART 8 bit data mode */\r
+} UART_DATABIT_Type;\r
+\r
+/**\r
+ * @brief UART Stop bit type definitions\r
+ */\r
+typedef enum {\r
+       UART_STOPBIT_1          = (0),                                          /*!< UART 1 Stop Bits Select */\r
+       UART_STOPBIT_2                                                                  /*!< UART Two Stop Bits Select */\r
+} UART_STOPBIT_Type;\r
+\r
+/**\r
+ * @brief UART Parity type definitions\r
+ */\r
+typedef enum {\r
+       UART_PARITY_NONE        = 0,                                    /*!< No parity */\r
+       UART_PARITY_ODD,                                                        /*!< Odd parity */\r
+       UART_PARITY_EVEN,                                                       /*!< Even parity */\r
+       UART_PARITY_SP_1,                                                       /*!< Forced "1" stick parity */\r
+       UART_PARITY_SP_0                                                        /*!< Forced "0" stick parity */\r
+} UART_PARITY_Type;\r
+\r
+/**\r
+ * @brief FIFO Level type definitions\r
+ */\r
+typedef enum {\r
+       UART_FIFO_TRGLEV0 = 0,  /*!< UART FIFO trigger level 0: 1 character */\r
+       UART_FIFO_TRGLEV1,              /*!< UART FIFO trigger level 1: 4 character */\r
+       UART_FIFO_TRGLEV2,              /*!< UART FIFO trigger level 2: 8 character */\r
+       UART_FIFO_TRGLEV3               /*!< UART FIFO trigger level 3: 14 character */\r
+} UART_FITO_LEVEL_Type;\r
+\r
+\r
+/********************************************************************//**\r
+* @brief UART Interrupt Type definitions\r
+**********************************************************************/\r
+typedef enum {\r
+       UART_INTCFG_RBR = 0,    /*!< RBR Interrupt enable*/\r
+       UART_INTCFG_THRE,               /*!< THR Interrupt enable*/\r
+       UART_INTCFG_RLS,                /*!< RX line status interrupt enable*/\r
+       UART1_INTCFG_MS,                /*!< Modem status interrupt enable (UART1 only) */\r
+       UART1_INTCFG_CTS,               /*!< CTS1 signal transition interrupt enable (UART1 only) */\r
+       UART_INTCFG_ABEO,               /*!< Enables the end of auto-baud interrupt */\r
+       UART_INTCFG_ABTO                /*!< Enables the auto-baud time-out interrupt */\r
+} UART_INT_Type;\r
+\r
+/**\r
+ * @brief UART Line Status Type definition\r
+ */\r
+typedef enum {\r
+       UART_LINESTAT_RDR       = UART_LSR_RDR,                 /*!<Line status register: Receive data ready*/\r
+       UART_LINESTAT_OE        = UART_LSR_OE,                  /*!<Line status register: Overrun error*/\r
+       UART_LINESTAT_PE        = UART_LSR_PE,                  /*!<Line status register: Parity error*/\r
+       UART_LINESTAT_FE        = UART_LSR_FE,                  /*!<Line status register: Framing error*/\r
+       UART_LINESTAT_BI        = UART_LSR_BI,                  /*!<Line status register: Break interrupt*/\r
+       UART_LINESTAT_THRE      = UART_LSR_THRE,                /*!<Line status register: Transmit holding register empty*/\r
+       UART_LINESTAT_TEMT      = UART_LSR_TEMT,                /*!<Line status register: Transmitter empty*/\r
+       UART_LINESTAT_RXFE      = UART_LSR_RXFE                 /*!<Error in RX FIFO*/\r
+} UART_LS_Type;\r
+\r
+/**\r
+ * @brief UART Auto-baudrate mode type definition\r
+ */\r
+typedef enum {\r
+       UART_AUTOBAUD_MODE0                             = 0,                    /**< UART Auto baudrate Mode 0 */\r
+       UART_AUTOBAUD_MODE1                                                     /**< UART Auto baudrate Mode 1 */\r
+} UART_AB_MODE_Type;\r
+\r
+/**\r
+ * @brief Auto Baudrate mode configuration type definition\r
+ */\r
+typedef struct {\r
+       UART_AB_MODE_Type       ABMode;                 /**< Autobaudrate mode */\r
+       FunctionalState         AutoRestart;    /**< Auto Restart state */\r
+} UART_AB_CFG_Type;\r
+\r
+/**\r
+ * @brief UART End of Auto-baudrate type definition\r
+ */\r
+typedef enum {\r
+       UART_AUTOBAUD_INTSTAT_ABEO              = UART_IIR_ABEO_INT,            /**< UART End of auto-baud interrupt  */\r
+       UART_AUTOBAUD_INTSTAT_ABTO              = UART_IIR_ABTO_INT                     /**< UART Auto-baud time-out interrupt  */\r
+}UART_ABEO_Type;\r
+\r
+/**\r
+ * UART IrDA Control type Definition\r
+ */\r
+typedef enum {\r
+       UART_IrDA_PULSEDIV2             = 0,            /**< Pulse width = 2 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV4,                            /**< Pulse width = 4 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV8,                            /**< Pulse width = 8 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV16,                           /**< Pulse width = 16 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV32,                           /**< Pulse width = 32 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV64,                           /**< Pulse width = 64 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV128,                          /**< Pulse width = 128 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+       UART_IrDA_PULSEDIV256                           /**< Pulse width = 256 * Tpclk\r
+                                                                               - Configures the pulse when FixPulseEn = 1 */\r
+} UART_IrDA_PULSE_Type;\r
+\r
+/********************************************************************//**\r
+* @brief UART1 Full modem -  Signal states definition\r
+**********************************************************************/\r
+typedef enum {\r
+       INACTIVE = 0,                   /* In-active state */\r
+       ACTIVE = !INACTIVE              /* Active state */\r
+}UART1_SignalState;\r
+\r
+/**\r
+ * @brief UART modem status type definition\r
+ */\r
+typedef enum {\r
+       UART1_MODEM_STAT_DELTA_CTS      = UART1_MSR_DELTA_CTS,          /*!< Set upon state change of input CTS */\r
+       UART1_MODEM_STAT_DELTA_DSR      = UART1_MSR_DELTA_DSR,          /*!< Set upon state change of input DSR */\r
+       UART1_MODEM_STAT_LO2HI_RI       = UART1_MSR_LO2HI_RI,           /*!< Set upon low to high transition of input RI */\r
+       UART1_MODEM_STAT_DELTA_DCD      = UART1_MSR_DELTA_DCD,          /*!< Set upon state change of input DCD */\r
+       UART1_MODEM_STAT_CTS            = UART1_MSR_CTS,                        /*!< Clear To Send State */\r
+       UART1_MODEM_STAT_DSR            = UART1_MSR_DSR,                        /*!< Data Set Ready State */\r
+       UART1_MODEM_STAT_RI                     = UART1_MSR_RI,                         /*!< Ring Indicator State */\r
+       UART1_MODEM_STAT_DCD            = UART1_MSR_DCD                         /*!< Data Carrier Detect State */\r
+} UART_MODEM_STAT_type;\r
+\r
+/**\r
+ * @brief Modem output pin type definition\r
+ */\r
+typedef enum {\r
+       UART1_MODEM_PIN_DTR                     = 0,            /*!< Source for modem output pin DTR */\r
+       UART1_MODEM_PIN_RTS                                             /*!< Source for modem output pin RTS */\r
+} UART_MODEM_PIN_Type;\r
+\r
+/**\r
+ * @brief UART Modem mode type definition\r
+ */\r
+typedef enum {\r
+       UART1_MODEM_MODE_LOOPBACK       = 0,            /*!< Loop back mode select */\r
+       UART1_MODEM_MODE_AUTO_RTS,                              /*!< Enable Auto RTS flow-control */\r
+       UART1_MODEM_MODE_AUTO_CTS                               /*!< Enable Auto CTS flow-control */\r
+} UART_MODEM_MODE_Type;\r
+\r
+/**\r
+ * @brief UART Direction Control Pin type definition\r
+ */\r
+typedef enum {\r
+       UART_RS485_DIRCTRL_RTS = 0,     /**< Pin RTS is used for direction control */\r
+       UART_RS485_DIRCTRL_DTR,         /**< Pin DTR is used for direction control */\r
+       UART_RS485_DIRCTRL_DIR          /**< Pin DIR is used for direction control */\r
+} UART_RS485_DIRCTRL_PIN_Type;\r
+\r
+\r
+/********************************************************************//**\r
+* @brief UART Configuration Structure definition\r
+**********************************************************************/\r
+typedef struct {\r
+  uint32_t Baud_rate;                  /**< UART baud rate */\r
+  UART_PARITY_Type Parity;     /**< Parity selection, should be:\r
+                                                          - UART_PARITY_NONE: No parity\r
+                                                          - UART_PARITY_ODD: Odd parity\r
+                                                          - UART_PARITY_EVEN: Even parity\r
+                                                          - UART_PARITY_SP_1: Forced "1" stick parity\r
+                                                          - UART_PARITY_SP_0: Forced "0" stick parity\r
+                                                          */\r
+  UART_DATABIT_Type Databits;   /**< Number of data bits, should be:\r
+                                                          - UART_DATABIT_5: UART 5 bit data mode\r
+                                                          - UART_DATABIT_6: UART 6 bit data mode\r
+                                                          - UART_DATABIT_7: UART 7 bit data mode\r
+                                                          - UART_DATABIT_8: UART 8 bit data mode\r
+                                                          */\r
+  UART_STOPBIT_Type Stopbits;   /**< Number of stop bits, should be:\r
+                                                          - UART_STOPBIT_1: UART 1 Stop Bits Select\r
+                                                          - UART_STOPBIT_2: UART 2 Stop Bits Select\r
+                                                          */\r
+} UART_CFG_Type;\r
+\r
+/********************************************************************//**\r
+* @brief UART FIFO Configuration Structure definition\r
+**********************************************************************/\r
+\r
+typedef struct {\r
+       FunctionalState FIFO_ResetRxBuf;        /**< Reset Rx FIFO command state , should be:\r
+                                                                                - ENABLE: Reset Rx FIFO in UART\r
+                                                                                - DISABLE: Do not reset Rx FIFO  in UART\r
+                                                                                */\r
+       FunctionalState FIFO_ResetTxBuf;        /**< Reset Tx FIFO command state , should be:\r
+                                                                                - ENABLE: Reset Tx FIFO in UART\r
+                                                                                - DISABLE: Do not reset Tx FIFO  in UART\r
+                                                                                */\r
+       FunctionalState FIFO_DMAMode;           /**< DMA mode, should be:\r
+                                                                                - ENABLE: Enable DMA mode in UART\r
+                                                                                - DISABLE: Disable DMA mode in UART\r
+                                                                                */\r
+       UART_FITO_LEVEL_Type FIFO_Level;        /**< Rx FIFO trigger level, should be:\r
+                                                                               - UART_FIFO_TRGLEV0: UART FIFO trigger level 0: 1 character\r
+                                                                               - UART_FIFO_TRGLEV1: UART FIFO trigger level 1: 4 character\r
+                                                                               - UART_FIFO_TRGLEV2: UART FIFO trigger level 2: 8 character\r
+                                                                               - UART_FIFO_TRGLEV3: UART FIFO trigger level 3: 14 character\r
+                                                                               */\r
+} UART_FIFO_CFG_Type;\r
+\r
+/********************************************************************//**\r
+* @brief UART1 Full modem -  RS485 Control configuration type\r
+**********************************************************************/\r
+typedef struct {\r
+       FunctionalState NormalMultiDropMode_State; /*!< Normal MultiDrop mode State:\r
+                                                                                                       - ENABLE: Enable this function.\r
+                                                                                                       - DISABLE: Disable this function. */\r
+       FunctionalState Rx_State;                                       /*!< Receiver State:\r
+                                                                                                       - ENABLE: Enable Receiver.\r
+                                                                                                       - DISABLE: Disable Receiver. */\r
+       FunctionalState AutoAddrDetect_State;           /*!< Auto Address Detect mode state:\r
+                                                                                               - ENABLE: ENABLE this function.\r
+                                                                                               - DISABLE: Disable this function. */\r
+       FunctionalState AutoDirCtrl_State;                      /*!< Auto Direction Control State:\r
+                                                                                               - ENABLE: Enable this function.\r
+                                                                                               - DISABLE: Disable this function. */\r
+       UART_RS485_DIRCTRL_PIN_Type DirCtrlPin;         /*!< If direction control is enabled, state:\r
+                                                                                               - UART1_RS485_DIRCTRL_RTS:\r
+                                                                                               pin RTS is used for direction control.\r
+                                                                                               - UART1_RS485_DIRCTRL_DTR:\r
+                                                                                               pin DTR is used for direction control. */\r
+        SetState DirCtrlPol_Level;                                     /*!< Polarity of the direction control signal on\r
+                                                                                               the RTS (or DTR) pin:\r
+                                                                                               - RESET: The direction control pin will be driven\r
+                                                                                               to logic "0" when the transmitter has data to be sent.\r
+                                                                                               - SET: The direction control pin will be driven\r
+                                                                                               to logic "1" when the transmitter has data to be sent. */\r
+       uint8_t MatchAddrValue;                                 /*!< address match value for RS-485/EIA-485 mode, 8-bit long */\r
+       uint8_t DelayValue;                                             /*!< delay time is in periods of the baud clock, 8-bit long */\r
+} UART_RS485_CTRLCFG_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup UART_Public_Functions UART Public Functions\r
+ * @{\r
+ */\r
+/* UART Init/DeInit functions --------------------------------------------------*/\r
+void UART_Init(LPC_USARTn_Type *UARTx, UART_CFG_Type *UART_ConfigStruct);\r
+void UART_DeInit(LPC_USARTn_Type* UARTx);\r
+void UART_ConfigStructInit(UART_CFG_Type *UART_InitStruct);\r
+\r
+/* UART Send/Receive functions -------------------------------------------------*/\r
+void UART_SendByte(LPC_USARTn_Type* UARTx, uint8_t Data);\r
+uint8_t UART_ReceiveByte(LPC_USARTn_Type* UARTx);\r
+uint32_t UART_Send(LPC_USARTn_Type *UARTx, uint8_t *txbuf,\r
+               uint32_t buflen, TRANSFER_BLOCK_Type flag);\r
+uint32_t UART_Receive(LPC_USARTn_Type *UARTx, uint8_t *rxbuf, \\r
+               uint32_t buflen, TRANSFER_BLOCK_Type flag);\r
+\r
+/* UART FIFO functions ----------------------------------------------------------*/\r
+void UART_FIFOConfig(LPC_USARTn_Type *UARTx, UART_FIFO_CFG_Type *FIFOCfg);\r
+void UART_FIFOConfigStructInit(UART_FIFO_CFG_Type *UART_FIFOInitStruct);\r
+\r
+/* UART operate functions -------------------------------------------------------*/\r
+void UART_IntConfig(LPC_USARTn_Type *UARTx, UART_INT_Type UARTIntCfg, \\r
+                               FunctionalState NewState);\r
+void UART_ABCmd(LPC_USARTn_Type *UARTx, UART_AB_CFG_Type *ABConfigStruct, \\r
+                               FunctionalState NewState);\r
+void UART_TxCmd(LPC_USARTn_Type *UARTx, FunctionalState NewState);\r
+uint8_t UART_GetLineStatus(LPC_USARTn_Type* UARTx);\r
+FlagStatus UART_CheckBusy(LPC_USARTn_Type *UARTx);\r
+void UART_ForceBreak(LPC_USARTn_Type* UARTx);\r
+\r
+/* UART1 FullModem functions ----------------------------------------------------*/\r
+void UART_FullModemForcePinState(LPC_UART1_Type *UARTx, UART_MODEM_PIN_Type Pin, \\r
+                                                       UART1_SignalState NewState);\r
+void UART_FullModemConfigMode(LPC_UART1_Type *UARTx, UART_MODEM_MODE_Type Mode, \\r
+                                                       FunctionalState NewState);\r
+uint8_t UART_FullModemGetStatus(LPC_UART1_Type *UARTx);\r
+\r
+/* UART RS485 functions ----------------------------------------------------------*/\r
+void UART_RS485Config(LPC_USARTn_Type *UARTx, \\r
+               UART_RS485_CTRLCFG_Type *RS485ConfigStruct);\r
+void UART_RS485ReceiverCmd(LPC_USARTn_Type *UARTx, FunctionalState NewState);\r
+void UART_RS485SendSlvAddr(LPC_USARTn_Type *UARTx, uint8_t SlvAddr);\r
+uint32_t UART_RS485SendData(LPC_USARTn_Type *UARTx, uint8_t *pData, uint32_t size);\r
+\r
+/* UART IrDA functions-------------------------------------------------------------*/\r
+void UART_IrDAInvtInputCmd(LPC_USARTn_Type* UARTx, FunctionalState NewState);\r
+void UART_IrDACmd(LPC_USARTn_Type* UARTx, FunctionalState NewState);\r
+void UART_IrDAPulseDivConfig(LPC_USARTn_Type *UARTx, UART_IrDA_PULSE_Type PulseDiv);\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* __LPC18XX_UART_H */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_utils.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_utils.h
new file mode 100644 (file)
index 0000000..fd049c5
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _LPC18XX_UTILS_H\r
+#define _LPC18XX_UTILS_H\r
+\r
+#include "lpc_types.h"\r
+extern uint32_t msec;\r
+extern volatile uint32_t u32Milliseconds;\r
+void SysTick_Handler (void);\r
+int timer_delay_us( int cnt);\r
+int timer_delay_ms( int cnt);\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_wwdt.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_wwdt.h
new file mode 100644 (file)
index 0000000..3d7331b
--- /dev/null
@@ -0,0 +1,177 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_wwdt.h          2011-06-02\r
+*//**\r
+* @file                lpc18xx_wwdt.h\r
+* @brief       Contains all macro definitions and function prototypes\r
+*                      support for WWDT firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup WWDT     WWDT (Windowed WatchDog Timer)\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+\r
+#ifndef LPC18XX_WWDT_H_\r
+#define LPC18XX_WWDT_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc_types.h"\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup WWDT_Public_Macros  WWDT Public Macros\r
+ * @{\r
+ */\r
+/** WDT oscillator frequency value */\r
+#define WDT_OSC                (12000000UL)            /* WWDT uses IRC clock */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @defgroup WWDT_Private_Macros WWDT Private Macros\r
+ * @{\r
+ */\r
+// time is calculated by usec\r
+#define WDT_GET_FROM_USEC(time)                ((time*10)/((WWDT_US_INDEX *10 * 4)/WDT_OSC))\r
+#define WDT_GET_USEC(counter)          ((counter * ((WWDT_US_INDEX *10 * 4)/WDT_OSC))/10)\r
+\r
+\r
+/* --------------------- BIT DEFINITIONS -------------------------------------- */\r
+/** WWDT interrupt enable bit */\r
+#define WWDT_WDMOD_WDEN                            ((uint32_t)(1<<0))\r
+/** WWDT interrupt enable bit */\r
+#define WWDT_WDMOD_WDRESET                     ((uint32_t)(1<<1))\r
+/** WWDT time out flag bit */\r
+#define WWDT_WDMOD_WDTOF                       ((uint32_t)(1<<2))\r
+/** WDT Time Out flag bit */\r
+#define WWDT_WDMOD_WDINT                       ((uint32_t)(1<<3))\r
+/** WWDT Protect flag bit */\r
+#define WWDT_WDMOD_WDPROTECT           ((uint32_t)(1<<4))\r
+\r
+/** Define divider index for microsecond ( us ) */\r
+#define WWDT_US_INDEX          ((uint32_t)(1000000))\r
+\r
+/** WWDT Time out minimum value */\r
+#define WWDT_TIMEOUT_MIN       ((uint32_t)(0xFF))\r
+/** WWDT Time out maximum value */\r
+#define WWDT_TIMEOUT_MAX       ((uint32_t)(0x00FFFFFF))\r
+\r
+/** WWDT Warning minimum value */\r
+#define WWDT_WARNINT_MIN       ((uint32_t)(0xFF))\r
+/** WWDT Warning maximum value */\r
+#define WWDT_WARNINT_MAX       ((uint32_t)(0x000003FF))\r
+\r
+/** WWDT Windowed minimum value */\r
+#define WWDT_WINDOW_MIN                ((uint32_t)(0xFF))\r
+/** WWDT Windowed minimum value */\r
+#define WWDT_WINDOW_MAX                ((uint32_t)(0x00FFFFFF))\r
+\r
+/** WWDT timer constant register mask */\r
+#define WWDT_WDTC_MASK                 ((uint32_t)(0x00FFFFFF))\r
+/** WWDT warning value register mask */\r
+#define WWDT_WDWARNINT_MASK            ((uint32_t)(0x000003FF))\r
+/** WWDT feed sequence register mask */\r
+#define WWDT_WDFEED_MASK               ((uint32_t)(0x000000FF))\r
+\r
+/** WWDT flag */\r
+#define WWDT_WARNINT_FLAG              ((uint8_t)(0))\r
+#define WWDT_TIMEOUT_FLAG              ((uint8_t)(1))\r
+\r
+/** WWDT mode definitions */\r
+#define WWDT_PROTECT_MODE              ((uint8_t)(0))\r
+#define WWDT_RESET_MODE                        ((uint8_t)(1))\r
+\r
+\r
+/* WWDT Timer value definition (us) */\r
+#define WWDT_TIMEOUT_USEC_MIN                  ((uint32_t)(WDT_GET_USEC(WWDT_TIMEOUT_MIN)))//microseconds\r
+#define WWDT_TIMEOUT_USEC_MAX                  ((uint32_t)(WDT_GET_USEC(WWDT_TIMEOUT_MAX)))\r
+\r
+#define WWDT_TIMEWARN_USEC_MIN                 ((uint32_t)(WDT_GET_USEC(WWDT_WARNINT_MIN)))\r
+#define WWDT_TIMEWARN_USEC_MAX                 ((uint32_t)(WDT_GET_USEC(WWDT_WARNINT_MAX)))\r
+\r
+#define WWDT_TIMEWINDOWED_USEC_MIN             ((uint32_t)(WDT_GET_USEC(WWDT_WINDOW_MIN)))\r
+#define WWDT_TIMEWINDOWED_USEC_MAX             ((uint32_t)(WDT_GET_USEC(WWDT_WINDOW_MAX)))\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup WWDT_Public_Types WWDT Public Types\r
+ * @{\r
+ */\r
+/********************************************************************//**\r
+ * @brief WWDT structure definitions\r
+ **********************************************************************/\r
+typedef struct Wdt_Config\r
+{\r
+       uint8_t wdtReset;                       /**< if ENABLE -> the Reset bit is enabled                              */\r
+       uint8_t wdtProtect;                     /**< if ENABLE -> the Protect bit is enabled                    */\r
+       uint32_t wdtTmrConst;           /**< Set the constant value to timeout the WDT (us)             */\r
+       uint32_t wdtWarningVal;         /**< Set the value to warn the WDT with interrupt (us)  */\r
+       uint32_t wdtWindowVal;          /**< Set a window vaule for WDT (us)                                    */\r
+}st_Wdt_Config;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @defgroup WWDT_Public_Functions WWDT Public Functions\r
+ * @{\r
+ */\r
+\r
+void WWDT_Init(void);\r
+void WWDT_UpdateTimeOut(uint32_t TimeOut);\r
+void WWDT_Feed (void);\r
+void WWDT_SetWarning(uint32_t WarnTime);\r
+void WWDT_SetWindow(uint32_t WindowedTime);\r
+void WWDT_Configure(st_Wdt_Config wdtCfg);\r
+void WWDT_Start(void);\r
+FlagStatus WWDT_GetStatus (uint8_t Status);\r
+void WWDT_ClearStatusFlag (uint8_t flag);\r
+uint32_t WWDT_GetCurrentCount(void);\r
+/**\r
+ * @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_WWDT_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc_types.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc_types.h
new file mode 100644 (file)
index 0000000..bbe56e2
--- /dev/null
@@ -0,0 +1,211 @@
+/**********************************************************************\r
+* $Id$         lpc_types.h                     2011-06-02\r
+*//**\r
+* @file                lpc_types.h\r
+* @brief       Contains the NXP ABL typedefs for C standard types.\r
+*              It is intended to be used in ISO C conforming development\r
+*              environments and checks for this insofar as it is possible\r
+*              to do so.\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Type group ----------------------------------------------------------- */\r
+/** @defgroup LPC_Types LPC_Types\r
+ * @ingroup LPC1800CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC_TYPES_H\r
+#define LPC_TYPES_H\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include <stdint.h>\r
+\r
+\r
+/* Public Types --------------------------------------------------------------- */\r
+/** @defgroup LPC_Types_Public_Types LPC_Types Public Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief Boolean Type definition\r
+ */\r
+typedef enum {FALSE = 0, TRUE = !FALSE} Bool;\r
+\r
+/**\r
+ * @brief Flag Status and Interrupt Flag Status type definition\r
+ */\r
+typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;\r
+#define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))\r
+\r
+/**\r
+ * @brief Functional State Definition\r
+ */\r
+typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;\r
+#define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))\r
+\r
+/**\r
+ * @ Status type definition\r
+ */\r
+typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;\r
+\r
+\r
+/**\r
+ * Read/Write transfer type mode (Block or non-block)\r
+ */\r
+typedef enum\r
+{\r
+       NONE_BLOCKING = 0,              /**< None Blocking type */\r
+       BLOCKING,                               /**< Blocking type */\r
+} TRANSFER_BLOCK_Type;\r
+\r
+\r
+/** Pointer to Function returning Void (any number of parameters) */\r
+typedef void (*PFV)();\r
+\r
+/** Pointer to Function returning int32_t (any number of parameters) */\r
+typedef int32_t(*PFI)();\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Macros -------------------------------------------------------------- */\r
+/** @defgroup LPC_Types_Public_Macros  LPC_Types Public Macros\r
+ * @{\r
+ */\r
+\r
+/* _BIT(n) sets the bit at position "n"\r
+ * _BIT(n) is intended to be used in "OR" and "AND" expressions:\r
+ * e.g., "(_BIT(3) | _BIT(7))".\r
+ */\r
+#undef _BIT\r
+/* Set bit macro */\r
+#define _BIT(n)        (1<<(n))\r
+\r
+/* _SBF(f,v) sets the bit field starting at position "f" to value "v".\r
+ * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:\r
+ * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"\r
+ */\r
+#undef _SBF\r
+/* Set bit field macro */\r
+#define _SBF(f,v) ((v)<<(f))\r
+\r
+/* _BITMASK constructs a symbol with 'field_width' least significant\r
+ * bits set.\r
+ * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF\r
+ * The symbol is intended to be used to limit the bit field width\r
+ * thusly:\r
+ * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.\r
+ * If "any_expression" results in a value that is larger than can be\r
+ * contained in 'x' bits, the bits above 'x - 1' are masked off.  When\r
+ * used with the _SBF example above, the example would be written:\r
+ * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))\r
+ * This ensures that the value written to a_reg is no wider than\r
+ * 16 bits, and makes the code easier to read and understand.\r
+ */\r
+#undef _BITMASK\r
+/* Bitmask creation macro */\r
+#define _BITMASK(field_width) ( _BIT(field_width) - 1)\r
+\r
+/* NULL pointer */\r
+#ifndef NULL\r
+#define NULL ((void*) 0)\r
+#endif\r
+\r
+/* Number of elements in an array */\r
+#define NELEMENTS(array)  (sizeof (array) / sizeof (array[0]))\r
+\r
+/* Static data/function define */\r
+#define STATIC static\r
+/* External data/function define */\r
+#define EXTERN extern\r
+\r
+#if !defined(MAX)\r
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))\r
+#endif\r
+#if !defined(MIN)\r
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Old Type Definition compatibility ------------------------------------------ */\r
+/** @addtogroup LPC_Types_Public_Types LPC_Types Public Types\r
+ * @{\r
+ */\r
+\r
+/** SMA type for character type */\r
+typedef char CHAR;\r
+\r
+/** SMA type for 8 bit unsigned value */\r
+typedef uint8_t UNS_8;\r
+\r
+/** SMA type for 8 bit signed value */\r
+typedef int8_t INT_8;\r
+\r
+/** SMA type for 16 bit unsigned value */\r
+typedef        uint16_t UNS_16;\r
+\r
+/** SMA type for 16 bit signed value */\r
+typedef        int16_t INT_16;\r
+\r
+/** SMA type for 32 bit unsigned value */\r
+typedef        uint32_t UNS_32;\r
+\r
+/** SMA type for 32 bit signed value */\r
+typedef        int32_t INT_32;\r
+\r
+/** SMA type for 64 bit signed value */\r
+typedef int64_t INT_64;\r
+\r
+/** SMA type for 64 bit unsigned value */\r
+typedef uint64_t UNS_64;\r
+\r
+/** 32 bit boolean type */\r
+typedef Bool BOOL_32;\r
+\r
+/** 16 bit boolean type */\r
+typedef Bool BOOL_16;\r
+\r
+/** 8 bit boolean type */\r
+typedef Bool BOOL_8;\r
+\r
+#ifdef __CC_ARM\r
+#define INLINE  __inline\r
+#else\r
+#define INLINE inline\r
+#endif\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+#endif /* LPC_TYPES_H */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/spifi_rom_api.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/spifi_rom_api.h
new file mode 100644 (file)
index 0000000..041fd63
--- /dev/null
@@ -0,0 +1,248 @@
+/***********************************************************************
+*   Copyright(C) 2011, NXP Semiconductor
+*   All rights reserved.
+*
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+
+#ifndef SPIFI_ROM_API_H
+#define SPIFI_ROM_API_H
+
+#include <stdint.h>
+/* define the symbol TESTING in the environment        if test output desired */
+
+/* maintain LONGEST_PROT >= the length (in bytes) of the largest
+       protection block of any serial flash that this driver handles */
+#define LONGEST_PROT 68
+
+typedef uint8_t uc;
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+/* protection/sector descriptors */
+typedef struct {
+       uint32_t base;
+       uc flags;
+       int8_t log2;
+       uint16_t rept;
+} protEnt;
+/* bits in the flags byte */
+enum {RWPROT=1};
+
+/* overall data structure includes # sectors, length of protection reg, 
+   array of descriptors 
+typedef struct {
+       uint16_t sectors;
+       uint16_t protBytes;
+       protEnt *entries;
+} protDesc;    */
+
+typedef union {
+       uint16_t hw;
+       uc byte[2];
+}stat_t;
+/* the object that init returns, and other routines use as an operand */
+typedef struct {
+       uint32_t base, regbase, devSize, memSize;
+       uc mfger, devType, devID, busy;
+       stat_t stat;
+       uint16_t reserved;
+       uint16_t set_prot, write_prot;
+       uint32_t mem_cmd, prog_cmd;
+       uint16_t sectors, protBytes;
+       uint32_t opts, errCheck;
+       uc erase_shifts[4], erase_ops[4];
+       protEnt *protEnts;
+       char prot[LONGEST_PROT];
+} SPIFIobj;
+
+/* operands of program and erase */
+typedef struct {
+       char *dest;
+       uint32_t length;
+    char *scratch;
+       int32_t protect;
+       uint32_t options;
+} SPIFIopers;
+
+/* instruction classes for wait_busy */
+typedef enum {stat_inst, block_erase, prog_inst, chip_erase} inst_type;
+
+/* bits in options operands (MODE3, RCVCLK, and FULLCLK 
+       have the same relationship as in the Control register) */
+#define S_MODE3 1
+#define S_MODE0 0
+#define S_MINIMAL 2
+#define S_MAXIMAL 0
+#define S_FORCE_ERASE 4
+#define S_ERASE_NOT_REQD 8
+#define S_CALLER_ERASE 8
+#define S_ERASE_AS_REQD 0
+#define S_VERIFY_PROG 0x10
+#define S_VERIFY_ERASE 0x20
+#define S_NO_VERIFY 0
+#define S_RCVCLK 0x80
+#define S_INTCLK 0
+#define S_FULLCLK 0x40
+#define S_HALFCLK 0
+#define S_DUAL 0x100
+#define S_CALLER_PROT 0x200
+#define S_DRIVER_PROT 0
+
+/* the following values in the first post-address memory command byte work
+   for all known quad devices that support "no opcode" operation */
+#define NO_OPCODE_FOLLOWS 0xA5
+#define    OPCODE_FOLLOWS 0xFF
+
+/* basic SPI commands for serial flash */
+#define BASE_READ_CMD        (CMD_RD<<OPCODE_SHIFT|4<<FRAMEFORM_SHIFT|UNL_DATA)
+#define FAST_READ_CMD (CMD_READ_FAST<<OPCODE_SHIFT|4<<FRAMEFORM_SHIFT|1<<INTLEN_SHIFT|UNL_DATA)
+#define BASE_PROG_CMD      (CMD_PROG<<OPCODE_SHIFT|4<<FRAMEFORM_SHIFT|DOUT)
+
+/* the length of a standard    program command is 256 on all devices */
+#define PROG_SIZE 256
+
+/* options in obj->opts (mostly for setMulti) */
+/* used by Winbond: send 0xA3 command so hardware can read faster */
+#define OPT_SEND_A3        1
+/* used by SST: send 0x38 command to enable quad and allow full command set */
+#define OPT_SEND_38        2
+/* used by Winbond and others: read status reg 2, check it, 
+       if necessary write it back with Quad Enable set */
+#define OPT_35_OR02_01     4
+/* used by Atmel: read Configuration register, if necessary set Quad Enable */
+#define OPT_3F_OR80_3E     8
+/* used by Numonyx to set all-quad mode: only for parts that include RSTQIO */
+#define OPT_65_CLR_C0_61   0x10
+/* used by Numonyx: send 0x81 command to write Volatile Configuration Register
+   to set # dummy bytes and allow XIP mode */
+#define OPT_81          0x20
+/* set for devices without full device erase command (Numonyx type 0x40) */
+#define OPT_NO_DEV_ERASE 0x40
+/* used by Macronix: status reg 2 includes selection between write-protect 
+       in status reg and command-based */
+#define OPT_WPSEL       0x80
+/* set when protection data has been read into the SPIFI object */
+#define OPT_PROT_READ  0x100
+/* set if device needs 4-byte address (and maybe 0x4B command = use 4-byte address) */
+#define OPT_4BAD       0x200
+/* set if setMulti should set the Dual bit in Control reg */
+#define OPT_DUAL          0x400
+/* send "# dummy bits" in C0 command to Winbond */
+#define OPT_C0         0x800
+/* set QE for Chingis */
+#define OPT_05_OR40_01 0x1000
+/* write status does not go busy */
+#define OPT_01_NO_BUSY 0x2000
+/* protection mode bits moved from protMode byte to opts  Fri May 13 2011 */
+#define OPT_PROT_STAT 0x4000
+#define OPT_PROT_REG  0x8000
+#define OPT_PROT_CMD3 0x10000
+#define OPT_PROT_CMDE 0x20000
+#define OPT_PROT_MASK 0x3C000
+
+#define OPT_ALL_QUAD  0x40000
+
+#ifndef OMIT_ROM_TABLE
+/* interface to ROM API */
+typedef struct {
+  int32_t (*spifi_init)      (SPIFIobj *obj, uint32_t csHigh, uint32_t options, 
+                          uint32_t mhz);
+  int32_t (*spifi_program)   (SPIFIobj *obj, char *source, SPIFIopers *opers);
+  int32_t (*spifi_erase)     (SPIFIobj *obj, SPIFIopers *opers);
+  /* mode switching */
+  void (*cancel_mem_mode)(SPIFIobj *obj);
+  void (*set_mem_mode)   (SPIFIobj *obj);
+
+  /* mid level functions */
+  int32_t (*checkAd)         (SPIFIobj *obj, SPIFIopers *opers);
+  int32_t (*setProt)         (SPIFIobj *obj, SPIFIopers *opers, char *change, 
+                          char *saveProt);
+  int32_t (*check_block)     (SPIFIobj *obj, char *source, SPIFIopers *opers, 
+                          uint32_t check_program);
+  int32_t (*send_erase_cmd)  (SPIFIobj *obj, uint8_t op, uint32_t addr);
+  uint32_t (*ck_erase)   (SPIFIobj *obj, uint32_t *addr, uint32_t length);
+  int32_t (*prog_block)      (SPIFIobj *obj, char *source, SPIFIopers *opers, 
+                          uint32_t *left_in_page);
+  uint32_t (*ck_prog)    (SPIFIobj *obj, char *source, char *dest, uint32_t length);
+
+  /* low level functions */
+  void(*setSize)         (SPIFIobj *obj, int32_t value);
+  int32_t (*setDev)          (SPIFIobj *obj, uint32_t opts, uint32_t mem_cmd, 
+                          uint32_t prog_cmd);
+  uint32_t (*cmd)        (uc op, uc addrLen, uc intLen, uint16_t len);
+  uint32_t (*readAd)     (SPIFIobj *obj, uint32_t cmd, uint32_t addr);
+  void (*send04)         (SPIFIobj *obj, uc op, uc len, uint32_t value);
+  void (*wren_sendAd)    (SPIFIobj *obj, uint32_t cmd, uint32_t addr, uint32_t value);
+  int32_t (*write_stat)      (SPIFIobj *obj, uc len, uint16_t value);
+  int32_t (*wait_busy)       (SPIFIobj *obj, uc prog_or_erase);
+} SPIFI_RTNS;
+
+#define define_spifi_romPtr(name) const SPIFI_RTNS *name=*((SPIFI_RTNS **)SPIFI_ROM_PTR)
+#endif /* OMIT_ROM_TABLE */
+
+#ifdef USE_SPIFI_LIB
+extern SPIFI_RTNS spifi_table;
+#endif /* USE_SPIFI_LIB */
+/* example of using this interface:
+#include "spifi_rom_api.h"
+#define CSHIGH 4
+#define SPIFI_MHZ 80
+#define source_data_ad (char *)1234
+
+       int32_t rc;
+       SPIFIopers opers;
+
+       define_spifi_romPtr(spifi);
+       SPIFIobj *obj = malloc(sizeof(SPIFIobj));
+       if (!obj) { can't allocate memory }
+
+       rc = spifi->spifi_init (obj, CSHIGH, S_FULLCLK+S_RCVCLK, SPIFI_MHZ);
+       if (rc) { investigate init error rc }
+       printf ("the serial flash contains %d bytes\n", obj->devSize);
+
+       opers.dest = where_to_program;
+       opers.length = how_many_bytes;
+       opers.scratch = NULL;                   // unprogrammed data is not saved/restored
+       opers.protect = -1;                             // save & restore protection
+       opers.options = S_VERIFY_PROG;
+
+       rc = spifi->spifi_program (obj, source_data_ad, &opers);
+       if (rc) { investigate program error rc }
+*/
+
+/* these are for normal users, including boot code */
+int32_t spifi_init (SPIFIobj *obj, uint32_t csHigh, uint32_t options, uint32_t mhz);
+int32_t spifi_program (SPIFIobj *obj, char *source, SPIFIopers *opers);
+int32_t spifi_erase (SPIFIobj *obj, SPIFIopers *opers);
+
+/* these are used by the manufacturer-specific init functions */
+void setSize (SPIFIobj *obj, int32_t value);
+int32_t setDev (SPIFIobj *obj, uint32_t opts, uint32_t mem_cmd, uint32_t prog_cmd);
+uint32_t read04(SPIFIobj *obj, uc op, uc len);
+int32_t write_stat (SPIFIobj *obj, uc len, uint16_t value);
+void setProtEnts(SPIFIobj *obj, const protEnt *p, uint32_t protTabLen);
+
+/* needs to be defined for each platform */
+void pullMISO(int high);
+
+#ifdef TESTING
+/* used by testing code */
+unsigned short getProtBytes (SPIFIobj *obj, unsigned short *sectors);
+/* predeclare a debug routine */
+void wait_sample (volatile unsigned *addr, unsigned mask, unsigned value);
+#endif
+
+#endif /* SPIFI_ROM_API_H */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/system_LPC18xx.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/system_LPC18xx.h
new file mode 100644 (file)
index 0000000..80c3c73
--- /dev/null
@@ -0,0 +1,50 @@
+/**********************************************************************\r
+* $Id$         system_LPC18xx.h                        2011-06-02\r
+*//**\r
+* @file                system_LPC18xx.h\r
+* @brief       Cortex-M3 Device System Header File for NXP LPC18xx Series.\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+#ifndef __SYSTEM_LPC18xx_H\r
+#define __SYSTEM_LPC18xx_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+#include <stdint.h>\r
+extern uint32_t SystemCoreClock;     /*!< System Clock Frequency (Core Clock)  */\r
+\r
+/**\r
+ * Initialize the system\r
+ *\r
+ * @param  none\r
+ * @return none\r
+ *\r
+ * @brief  Setup the microcontroller system.\r
+ *         Initialize the System and update the SystemCoreClock variable.\r
+ */\r
+extern void SystemInit (void);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* __SYSTEM_LPC18xx_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/debug_frmwrk.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/debug_frmwrk.c
new file mode 100644 (file)
index 0000000..a50358e
--- /dev/null
@@ -0,0 +1,326 @@
+/**********************************************************************\r
+* $Id$         debug_frmwrk.c          2011-06-02\r
+*//**\r
+* @file                debug_frmwrk.c\r
+* @brief       Contains some utilities that used for debugging through UART\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup DEBUG_FRMWRK\r
+ * @{\r
+ */\r
+\r
+#ifndef _DEBUG_FRMWRK_\r
+#define _DEBUG_FRMWRK_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "debug_frmwrk.h"\r
+#include "lpc18xx_scu.h"\r
+#include <stdarg.h>\r
+#include <stdio.h>\r
+\r
+#ifdef CDC_DEBUG_MESSEGES\r
+#include "usbhw.h"\r
+#include "cdcuser.h"\r
+#include "CDCdemo.h"\r
+#include "lpc18xx_utils.h"\r
+#include <string.h>\r
+#endif\r
+\r
+/* Debug framework */\r
+\r
+void (*_db_msg)(LPC_USARTn_Type *UARTx, const void *s);\r
+void (*_db_msg_)(LPC_USARTn_Type *UARTx, const void *s);\r
+void (*_db_char)(LPC_USARTn_Type *UARTx, uint8_t ch);\r
+void (*_db_dec)(LPC_USARTn_Type *UARTx, uint8_t decn);\r
+void (*_db_dec_16)(LPC_USARTn_Type *UARTx, uint16_t decn);\r
+void (*_db_dec_32)(LPC_USARTn_Type *UARTx, uint32_t decn);\r
+void (*_db_hex)(LPC_USARTn_Type *UARTx, uint8_t hexn);\r
+void (*_db_hex_16)(LPC_USARTn_Type *UARTx, uint16_t hexn);\r
+void (*_db_hex_32)(LPC_USARTn_Type *UARTx, uint32_t hexn);\r
+uint8_t (*_db_get_char)(LPC_USARTn_Type *UARTx);\r
+\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a character to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  ch              Character to put\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutChar (LPC_USARTn_Type *UARTx, uint8_t ch)\r
+{\r
+       UART_Send(UARTx, &ch, 1, BLOCKING);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get a character to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @return             character value that returned\r
+ **********************************************************************/\r
+uint8_t UARTGetChar (LPC_USARTn_Type *UARTx)\r
+{\r
+       uint8_t tmp = 0;\r
+       UART_Receive(UARTx, &tmp, 1, BLOCKING);\r
+       return(tmp);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a string to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  str     string to put\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPuts(LPC_USARTn_Type *UARTx, const void *str)\r
+{\r
+#ifdef CDC_DEBUG_MESSEGES\r
+       int num_of_bytes=0;\r
+       num_of_bytes = strlen(str);\r
+       timer_delay_us(num_of_bytes);\r
+               \r
+       USB_WriteEP (CDC_DEP_IN, (unsigned char *)str, num_of_bytes);\r
+#else\r
+       uint8_t *s = (uint8_t *) str;\r
+\r
+       while (*s)\r
+       {\r
+               UARTPutChar(UARTx, *s++);\r
+       }\r
+#endif \r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a string to UART port and print new line\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  str             String to put\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPuts_(LPC_USARTn_Type *UARTx, const void *str)\r
+{\r
+       UARTPuts (UARTx, str);\r
+       UARTPuts (UARTx, "\n\r");\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a decimal number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  decnum  Decimal number (8-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutDec(LPC_USARTn_Type *UARTx, uint8_t decnum)\r
+{\r
+       uint8_t c1=decnum%10;\r
+       uint8_t c2=(decnum/10)%10;\r
+       uint8_t c3=(decnum/100)%10;\r
+       UARTPutChar(UARTx, '0'+c3);\r
+       UARTPutChar(UARTx, '0'+c2);\r
+       UARTPutChar(UARTx, '0'+c1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a decimal number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  decnum  Decimal number (8-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutDec16(LPC_USARTn_Type *UARTx, uint16_t decnum)\r
+{\r
+       uint8_t c1=decnum%10;\r
+       uint8_t c2=(decnum/10)%10;\r
+       uint8_t c3=(decnum/100)%10;\r
+       uint8_t c4=(decnum/1000)%10;\r
+       uint8_t c5=(decnum/10000)%10;\r
+       UARTPutChar(UARTx, '0'+c5);\r
+       UARTPutChar(UARTx, '0'+c4);\r
+       UARTPutChar(UARTx, '0'+c3);\r
+       UARTPutChar(UARTx, '0'+c2);\r
+       UARTPutChar(UARTx, '0'+c1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a decimal number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  decnum  Decimal number (8-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutDec32(LPC_USARTn_Type *UARTx, uint32_t decnum)\r
+{\r
+       uint8_t c1=decnum%10;\r
+       uint8_t c2=(decnum/10)%10;\r
+       uint8_t c3=(decnum/100)%10;\r
+       uint8_t c4=(decnum/1000)%10;\r
+       uint8_t c5=(decnum/10000)%10;\r
+       uint8_t c6=(decnum/100000)%10;\r
+       uint8_t c7=(decnum/1000000)%10;\r
+       uint8_t c8=(decnum/10000000)%10;\r
+       uint8_t c9=(decnum/100000000)%10;\r
+       uint8_t c10=(decnum/1000000000)%10;\r
+       UARTPutChar(UARTx, '0'+c10);\r
+       UARTPutChar(UARTx, '0'+c9);\r
+       UARTPutChar(UARTx, '0'+c8);\r
+       UARTPutChar(UARTx, '0'+c7);\r
+       UARTPutChar(UARTx, '0'+c6);\r
+       UARTPutChar(UARTx, '0'+c5);\r
+       UARTPutChar(UARTx, '0'+c4);\r
+       UARTPutChar(UARTx, '0'+c3);\r
+       UARTPutChar(UARTx, '0'+c2);\r
+       UARTPutChar(UARTx, '0'+c1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a hex number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  hexnum  Hex number (8-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutHex (LPC_USARTn_Type *UARTx, uint8_t hexnum)\r
+{\r
+       uint8_t nibble, i;\r
+\r
+       UARTPuts(UARTx, "0x");\r
+       i = 1;\r
+       do {\r
+               nibble = (hexnum >> (4*i)) & 0x0F;\r
+               UARTPutChar(UARTx, (nibble > 9) ? ('A' + nibble - 10) : ('0' + nibble));\r
+       } while (i--);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a hex number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  hexnum  Hex number (16-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutHex16 (LPC_USARTn_Type *UARTx, uint16_t hexnum)\r
+{\r
+       uint8_t nibble, i;\r
+\r
+       UARTPuts(UARTx, "0x");\r
+       i = 3;\r
+       do {\r
+               nibble = (hexnum >> (4*i)) & 0x0F;\r
+               UARTPutChar(UARTx, (nibble > 9) ? ('A' + nibble - 10) : ('0' + nibble));\r
+       } while (i--);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Puts a hex number to UART port\r
+ * @param[in]  UARTx   Pointer to UART peripheral\r
+ * @param[in]  hexnum  Hex number (32-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UARTPutHex32 (LPC_USARTn_Type *UARTx, uint32_t hexnum)\r
+{\r
+       uint8_t nibble, i;\r
+\r
+       UARTPuts(UARTx, "0x");\r
+       i = 7;\r
+       do {\r
+               nibble = (hexnum >> (4*i)) & 0x0F;\r
+               UARTPutChar(UARTx, (nibble > 9) ? ('A' + nibble - 10) : ('0' + nibble));\r
+       } while (i--);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              print function that supports format as same as printf()\r
+ *                             function of <stdio.h> library\r
+ * @param[in]  format formated string to be print\r
+ * @return             None\r
+ **********************************************************************/\r
+void  lpc_printf (const  char *format, ...)\r
+{\r
+    char  buffer[512 + 1];\r
+    va_list vArgs;\r
+    va_start(vArgs, format);\r
+    vsprintf((char *)buffer, (char const *)format, vArgs);\r
+    va_end(vArgs);\r
+\r
+    _DBG(buffer);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initialize Debug frame work through initializing UART port\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void debug_frmwrk_init(void)\r
+{\r
+#ifdef UART_DEBUG_MESSEGES\r
+\r
+       UART_CFG_Type UARTConfigStruct;\r
+\r
+#if (USED_UART_DEBUG_PORT==0)\r
+       /*\r
+        * Initialize UART0 pin connect NGX board\r
+        */\r
+       scu_pinmux(0xF ,10 , MD_PDN|MD_EZI, FUNC1);                     // P6.4 UART0_TXD\r
+       scu_pinmux(0xF ,11 , MD_PDN|MD_EZI, FUNC1);                     // P6.5 UART0_RXD\r
+#elif (USED_UART_DEBUG_PORT==1)\r
+       /*\r
+        * Initialize UART1 pin connect\r
+        */\r
+       scu_pinmux(0x1 ,13 , MD_PDN, FUNC1);                            // PC.13 : UART1_TXD\r
+       scu_pinmux(0x1 ,14 , MD_PLN|MD_EZI|MD_ZI, FUNC1);       // PC.14 : UART1_RXD\r
+#endif\r
+\r
+       /* Initialize UART Configuration parameter structure to default state:\r
+        * Baudrate = 9600bps\r
+        * 8 data bit\r
+        * 1 Stop bit\r
+        * None parity\r
+        */\r
+       UART_ConfigStructInit(&UARTConfigStruct);\r
+\r
+       // Initialize DEBUG_UART_PORT peripheral with given to corresponding parameter\r
+       UART_Init((LPC_USARTn_Type*)DEBUG_UART_PORT, &UARTConfigStruct);\r
+\r
+       // Enable UART Transmit\r
+       UART_TxCmd((LPC_USARTn_Type*)DEBUG_UART_PORT, ENABLE);\r
+#endif\r
+#ifdef CDC_DEBUG_MESSEGES\r
+       CDC_init();             //wait for usb enumeration\r
+\r
+#endif\r
+\r
+       _db_msg = UARTPuts;\r
+       _db_msg_ = UARTPuts_;\r
+       _db_char = UARTPutChar;\r
+       _db_hex = UARTPutHex;\r
+       _db_hex_16 = UARTPutHex16;\r
+       _db_hex_32 = UARTPutHex32;\r
+       _db_dec = UARTPutDec;\r
+       _db_dec_16 = UARTPutDec16;\r
+       _db_dec_32 = UARTPutDec32;\r
+       _db_get_char = UARTGetChar;\r
+}\r
+\r
+#endif /* _DEBUG_FRMWRK_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_adc.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_adc.c
new file mode 100644 (file)
index 0000000..ded86e7
--- /dev/null
@@ -0,0 +1,353 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_adc.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_adc.c\r
+* @brief       Contains all functions support for ADC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup ADC\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_adc.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _ADC\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup ADC_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initial for ADC\r
+ *                                     + Set bit PCADC\r
+ *                                     + Set clock for ADC\r
+ *                                     + Set Clock Frequency\r
+ * @param[in]  ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+ * @param[in]  rate ADC conversion rate, should be <=200KHz\r
+ * @param[in]  bits_accuracy number of bits accuracy, should be <=10 bits and >=3bits\r
+ * @return             None\r
+ **********************************************************************/\r
+void ADC_Init(LPC_ADCn_Type *ADCx, uint32_t rate, uint8_t bits_accuracy)\r
+{\r
+       uint32_t temp, tmpreg, ADCbitrate;\r
+\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_RATE(rate));\r
+\r
+       // Turn on power and clock\r
+       //CGU_ConfigPPWR (CGU_PCONP_PCAD, ENABLE);\r
+\r
+       ADCx->CR = 0;\r
+\r
+       //Enable PDN bit\r
+       tmpreg = ADC_CR_PDN;\r
+       // Set clock frequency\r
+       if(ADCx == LPC_ADC0)\r
+               temp = CGU_GetPCLKFrequency(CGU_PERIPHERAL_ADC0);\r
+       else if(ADCx == LPC_ADC1)\r
+               temp = CGU_GetPCLKFrequency(CGU_PERIPHERAL_ADC1);\r
+       /* The APB clock (PCLK_ADC0) is divided by (CLKDIV+1) to produce the clock for\r
+        * A/D converter, which should be less than or equal to 13MHz.\r
+        * A fully conversion requires (bits_accuracy+1) of these clocks.\r
+        * ADC clock = PCLK_ADC0 / (CLKDIV + 1);\r
+        * ADC rate = ADC clock / (bits_accuracy+1);
+        */\r
+        ADCbitrate = (rate * (bits_accuracy+1));\r
+       temp = ((temp*2 + ADCbitrate) / (ADCbitrate*2)) - 1;//get the round value by fomular: (2*A + B)/(2*B)\r
+       tmpreg |=  ADC_CR_CLKDIV(temp) | ADC_CR_BITACC(10 - bits_accuracy);\r
+\r
+       ADCx->CR = tmpreg;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+* @brief               Close ADC\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_DeInit(LPC_ADCn_Type *ADCx)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+\r
+       // Clear PDN bit\r
+       ADCx->CR &= ~ADC_CR_PDN;\r
+       // Turn on power and clock\r
+       //CGU_ConfigPPWR (CGU_PCONP_PCAD, DISABLE);\r
+}\r
+\r
+\r
+///*********************************************************************//**\r
+//* @brief             Get Result conversion from A/D data register\r
+//* @param[in] channel number which want to read back the result\r
+//* @return            Result of conversion\r
+//*********************************************************************/\r
+//uint32_t ADC_GetData(uint32_t channel)\r
+//{\r
+//     uint32_t adc_value;\r
+//\r
+//     CHECK_PARAM(PARAM_ADC_CHANNEL_SELECTION(channel));\r
+//\r
+//     adc_value = *(uint32_t *)((&LPC_ADC->DR0) + channel);\r
+//     return ADC_GDR_RESULT(adc_value);\r
+//}\r
+\r
+/*********************************************************************//**\r
+* @brief               Set start mode for ADC\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   start_mode Start mode choose one of modes in\r
+*                              'ADC_START_OPT' enumeration type definition, should be:\r
+*                                      - ADC_START_CONTINUOUS\r
+*                                      - ADC_START_NOW\r
+*                                      - ADC_START_ON_EINT0\r
+*                                      - ADC_START_ON_CAP01\r
+*                                      - ADC_START_ON_MAT01\r
+*                                      - ADC_START_ON_MAT03\r
+*                                      - ADC_START_ON_MAT10\r
+*                                      - ADC_START_ON_MAT11\r
+* @return              None\r
+*********************************************************************/\r
+void ADC_StartCmd(LPC_ADCn_Type *ADCx, uint8_t start_mode)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_START_OPT(start_mode));\r
+\r
+       ADCx->CR &= ~ADC_CR_START_MASK;\r
+       ADCx->CR |=ADC_CR_START_MODE_SEL((uint32_t)start_mode);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+* @brief               ADC Burst mode setting\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   NewState\r
+*                                      - 1: Set Burst mode\r
+*                                      - 0: reset Burst mode\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_BurstCmd(LPC_ADCn_Type *ADCx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+\r
+       ADCx->CR &= ~ADC_CR_BURST;\r
+       if (NewState){\r
+               ADCx->CR |= ADC_CR_BURST;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Set AD conversion in power mode\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   NewState\r
+*                                      - 1: AD converter is optional\r
+*                                      - 0: AD Converter is in power down mode\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_PowerdownCmd(LPC_ADCn_Type *ADCx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+\r
+       ADCx->CR &= ~ADC_CR_PDN;\r
+       if (NewState){\r
+               ADCx->CR |= ADC_CR_PDN;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Set Edge start configuration\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   EdgeOption is ADC_START_ON_RISING and ADC_START_ON_FALLING\r
+*                                      - 0: ADC_START_ON_RISING\r
+*                                      - 1: ADC_START_ON_FALLING\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_EdgeStartConfig(LPC_ADCn_Type *ADCx, uint8_t EdgeOption)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_START_ON_EDGE_OPT(EdgeOption));\r
+\r
+       ADCx->CR &= ~ADC_CR_EDGE;\r
+       if (EdgeOption){\r
+               ADCx->CR |= ADC_CR_EDGE;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               ADC interrupt configuration\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   IntType: type of interrupt, should be:\r
+*                                      - ADC_ADINTEN0: Interrupt channel 0\r
+*                                      - ADC_ADINTEN1: Interrupt channel 1\r
+*                                      ...\r
+*                                      - ADC_ADINTEN7: Interrupt channel 7\r
+*                                      - ADC_ADGINTEN: Individual channel/global flag done generate an interrupt\r
+* @param[in]   NewState:\r
+*                                      - SET : enable ADC interrupt\r
+*                                      - RESET: disable ADC interrupt\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_IntConfig (LPC_ADCn_Type *ADCx, ADC_TYPE_INT_OPT IntType, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_TYPE_INT_OPT(IntType));\r
+\r
+       ADCx->INTEN &= ~ADC_INTEN_CH(IntType);\r
+       if (NewState){\r
+               ADCx->INTEN |= ADC_INTEN_CH(IntType);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Enable/Disable ADC channel number\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   Channel channel number\r
+* @param[in]   NewState        New state, should be:\r
+*                                      - ENABLE\r
+*                                      - DISABLE\r
+* @return              None\r
+**********************************************************************/\r
+void ADC_ChannelCmd (LPC_ADCn_Type *ADCx, uint8_t Channel, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_CHANNEL_SELECTION(Channel));\r
+\r
+       if (NewState == ENABLE) {\r
+               ADCx->CR |= ADC_CR_CH_SEL(Channel);\r
+       } else {\r
+               ADCx->CR &= ~ADC_CR_CH_SEL(Channel);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Get ADC result\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   channel channel number, should be 0...7\r
+* @return              Converted data\r
+**********************************************************************/\r
+uint16_t ADC_ChannelGetData(LPC_ADCn_Type *ADCx, uint8_t channel)\r
+{\r
+       uint32_t adc_value;\r
+\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_CHANNEL_SELECTION(channel));\r
+\r
+       adc_value = *(uint32_t *) ((&(ADCx->DR[0])) + channel);\r
+       return ADC_DR_RESULT(adc_value);\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Get ADC Channel status from ADC data register\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   channel: channel number, should be 0..7\r
+* @param[in]   StatusType\r
+*                              - 0: Burst status\r
+*                      - 1: Done status\r
+* @return              Channel status, could be:\r
+*                                      - SET\r
+*                                      - RESET\r
+**********************************************************************/\r
+FlagStatus ADC_ChannelGetStatus(LPC_ADCn_Type *ADCx, uint8_t channel, uint32_t StatusType)\r
+{\r
+       uint32_t temp;\r
+\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_CHANNEL_SELECTION(channel));\r
+       CHECK_PARAM(PARAM_ADC_DATA_STATUS(StatusType));\r
+\r
+       temp =  *(uint32_t *) ((&ADCx->DR[0]) + channel);\r
+       if (StatusType) {\r
+               temp &= ADC_DR_DONE_FLAG;\r
+       }else{\r
+               temp &= ADC_DR_OVERRUN_FLAG;\r
+       }\r
+       if (temp) {\r
+               return SET;\r
+       } else {\r
+               return RESET;\r
+       }\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Get ADC Data from AD Global register\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @return              Result of conversion\r
+**********************************************************************/\r
+uint32_t ADC_GlobalGetData(LPC_ADCn_Type *ADCx)\r
+{\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+\r
+       return ((uint32_t)(ADCx->GDR));\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Get ADC Chanel status from AD global data register\r
+* @param[in]   ADCx pointer to LPC_ADCn_Type, should be: LPC_ADC\r
+* @param[in]   StatusType\r
+*                              - 0: Burst status\r
+*                      - 1: Done status\r
+* @return              SET / RESET\r
+**********************************************************************/\r
+FlagStatus     ADC_GlobalGetStatus(LPC_ADCn_Type *ADCx, uint32_t StatusType)\r
+{\r
+       uint32_t temp;\r
+\r
+       CHECK_PARAM(PARAM_ADCx(ADCx));\r
+       CHECK_PARAM(PARAM_ADC_DATA_STATUS(StatusType));\r
+\r
+       temp =  ADCx->GDR;\r
+       if (StatusType){\r
+               temp &= ADC_DR_DONE_FLAG;\r
+       }else{\r
+               temp &= ADC_DR_OVERRUN_FLAG;\r
+       }\r
+       if (temp){\r
+               return SET;\r
+       }else{\r
+               return RESET;\r
+       }\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _ADC */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_atimer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_atimer.c
new file mode 100644 (file)
index 0000000..d6123de
--- /dev/null
@@ -0,0 +1,170 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_atimer.c                2011-06-02\r
+*//**\r
+* @file                lpc18xx_atimer.c\r
+* @brief       Contains all functions support for Alarm Timer firmware\r
+*                      library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup ATIMER\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_atimer.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _ATIMER\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initial Alarm Timer device\r
+ * @param[in]  ATIMERx  Timer selection, should be: LPC_ATIMER\r
+ * @param[in]  PresetValue Count of 1/1024s for Alarm\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_Init(LPC_ATIMER_Type *ATIMERx, uint32_t PresetValue)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+\r
+       //set power\r
+       if (ATIMERx== LPC_ATIMER)\r
+       {\r
+               /*Set Clock Here */\r
+               CGU_EnableEntity(CGU_CLKSRC_32KHZ_OSC, ENABLE);\r
+       }\r
+\r
+       ATIMER_UpdatePresetValue(ATIMERx, PresetValue);\r
+       // Clear interrupt pending\r
+       ATIMER_ClearIntStatus(ATIMERx);\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Close ATIMER device\r
+ * @param[in]  ATIMERx  Pointer to timer device, should be: LPC_ATIMER\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_DeInit (LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       // Disable atimer\r
+       ATIMER_ClearIntStatus(ATIMERx);\r
+       ATIMER_IntDisable(ATIMERx);\r
+\r
+       // Disable power\r
+//     if (ATIMERx== LPC_ATIMER0)\r
+//             CGU_ConfigPPWR (CGU_PCONP_PCATIMER0, DISABLE);\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear ATIMER Interrupt Status\r
+ * @param[in]  ATIMERx Pointer to timer device, should be: LPC_ATIMER\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_ClearIntStatus(LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       ATIMERx->CLR_STAT = 1;\r
+       while((ATIMERx->STATUS & 1) == 1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set ATIMER Interrupt Status\r
+ * @param[in]  ATIMERx Pointer to timer device, should be: LPC_ATIMER\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_SetIntStatus(LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       ATIMERx->SET_STAT = 1;\r
+       while((ATIMERx->STATUS & 1) == 0);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable ATIMER Interrupt\r
+ * @param[in]  ATIMERx Pointer to timer device, should be: LPC_ATIMER\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_IntEnable(LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       ATIMERx->SET_EN = 1;\r
+       while((ATIMERx->ENABLE & 1) == 0);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Disable ATIMER Interrupt\r
+ * @param[in]  ATIMERx Pointer to timer device, should be: LPC_ATIMER\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_IntDisable(LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       ATIMERx->CLR_EN = 1;\r
+       while((ATIMERx->ENABLE & 1) == 1);\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Update Preset value\r
+ * @param[in]  ATIMERx Pointer to timer device, should be: LPC_ATIMER\r
+ * @param[in]  PresetValue     updated preset value\r
+ * @return             None\r
+ **********************************************************************/\r
+void ATIMER_UpdatePresetValue(LPC_ATIMER_Type *ATIMERx,uint32_t PresetValue)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       ATIMERx->PRESET = PresetValue;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read value of preset register\r
+ * @param[in]  ATIMERx Pointer to timer/counter device, should be: LPC_ATIMER\r
+ * @return             Value of capture register\r
+ **********************************************************************/\r
+uint32_t ATIMER_GetPresetValue(LPC_ATIMER_Type *ATIMERx)\r
+{\r
+       CHECK_PARAM(PARAM_ATIMERx(ATIMERx));\r
+       return ATIMERx->PRESET;\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _ATIMER */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_can.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_can.c
new file mode 100644 (file)
index 0000000..4aa5865
--- /dev/null
@@ -0,0 +1,561 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_can.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_can.c\r
+* @brief       Contains all functions support for C CAN firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup C_CAN\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc18xx_can.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _C_CAN\r
+\r
+/* Private Macros ---------------------------------------------------------- */\r
+#ifndef __GNUC__\r
+/* Macro for reading and writing to CCAN IF registers */\r
+#define CAN_IF_Read(reg, IFsel) (LPC_C_CAN0->##IFsel##_##reg)\r
+#define CAN_IF_Write(reg, IFsel, val) (LPC_C_CAN0->##IFsel##_##reg=val)\r
+\r
+/* Macro for writing IF to specific RAM message object */\r
+#define CAN_IF_readBuf(IFsel,msg) \\r
+  LPC_C_CAN0->##IFsel##_##CMDMSK_W=RD|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB; \\r
+  LPC_C_CAN0->##IFsel##_##CMDREQ=msg; \\r
+  while (LPC_C_CAN0->##IFsel##_##CMDREQ & IFCREQ_BUSY );\r
+\r
+/* Macro for reading specific RAM message object to IF */\r
+#define CAN_IF_writeBuf(IFsel,msg) \\r
+  LPC_C_CAN0->##IFsel##_##CMDMSK_W=WR|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB; \\r
+  LPC_C_CAN0->##IFsel##_##CMDREQ=msg; \\r
+  while (LPC_C_CAN0->##IFsel##_##CMDREQ & IFCREQ_BUSY );\r
+#else\r
+#define CAN_IF_Read(reg, IFsel) (LPC_C_CAN0->IFsel##_##reg)\r
+#define CAN_IF_Write(reg, IFsel, val) (LPC_C_CAN0->IFsel ## _ ## reg = val)\r
+\r
+/* Macro for writing IF to specific RAM message object */\r
+#define CAN_IF_readBuf(IFsel,msg) \\r
+  LPC_C_CAN0->IFsel##_##CMDMSK_W=RD|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB; \\r
+  LPC_C_CAN0->IFsel##_##CMDREQ=msg; \\r
+  while (LPC_C_CAN0->IFsel##_##CMDREQ & IFCREQ_BUSY );\r
+\r
+/* Macro for reading specific RAM message object to IF */\r
+#define CAN_IF_writeBuf(IFsel,msg) \\r
+  LPC_C_CAN0->IFsel##_##CMDMSK_W=WR|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB; \\r
+  LPC_C_CAN0->IFsel##_##CMDREQ=msg; \\r
+  while (LPC_C_CAN0->IFsel##_##CMDREQ & IFCREQ_BUSY );\r
+#endif\r
+\r
+#define IF1    0\r
+#define IF2    1\r
+\r
+#define CAN_STATUS_INTERRUPT      0x8000    /* 0x0001-0x0020 are the # of the message\r
+                                                                                   object */\r
+                                            /* 0x8000 is the status interrupt */\r
+\r
+/* CAN Message interface register definitions */\r
+/* bit field of IF command request n register */\r
+#define IFCREQ_BUSY               0x8000    /* 1 is writing is progress, cleared when\r
+                                            RD/WR done */\r
+/* CAN CTRL register */\r
+#define CTRL_INIT              (1 << 0)\r
+#define CTRL_IE                        (1 << 1)\r
+#define CTRL_SIE               (1 << 2)\r
+#define CTRL_EIE               (1 << 3)\r
+#define CTRL_DAR               (1 << 5)\r
+#define CTRL_CCE               (1 << 6)\r
+#define CTRL_TEST              (1 << 7)\r
+\r
+/* CAN Test register */\r
+#define TEST_BASIC             (1 << 2)\r
+#define TEST_SILENT            (1 << 3)\r
+#define TEST_LBACK             (1 << 4)\r
+\r
+/* CAN Status register */\r
+#define STAT_LEC               (0x7 << 0)\r
+#define STAT_TXOK              (1 << 3)\r
+#define STAT_RXOK              (1 << 4)\r
+#define STAT_EPASS             (1 << 5)\r
+#define STAT_EWARN             (1 << 6)\r
+#define STAT_BOFF              (1 << 7)\r
+\r
+#define NO_ERR         0       // No Error\r
+#define STUFF_ERR      1       // Stuff Error : More than 5 equal bits in a sequence have occurred in a part\r
+                                               // of a received message where this is not allowed.\r
+#define FORM_ERR       2       // Form Error : A fixed format part of a received frame has the wrong format.\r
+#define ACK_ERR                3       // AckError : The message this CAN Core transmitted was not acknowledged\r
+                                               // by another node.\r
+#define BIT1_ERR       4       // Bit1Error : During the transmission of a message (with the exception of\r
+                                               // the arbitration field), the device wanted to send a recessive level (bit of\r
+                                               // logical value ï¿½1�), but the monitored bus value was dominant.\r
+#define BIT0_ERR       5       // Bit0Error : During the transmission of a message (or acknowledge bit,\r
+                                               // or active error flag, or overload flag), the device wanted to send a\r
+                                               // LOW/dominant level (data or identifier bit logical value ï¿½0�), but the\r
+                                               // monitored Bus value was HIGH/recessive. During busoff recovery this\r
+                                               // status is set each time a\r
+                                               // sequence of 11 HIGH/recessive bits has been monitored. This enables\r
+                                               // the CPU to monitor the proceeding of the busoff recovery sequence\r
+                                               // (indicating the bus is not stuck at LOW/dominant or continuously\r
+                                               // disturbed).\r
+#define CRC_ERR                6       // CRCError: The CRC checksum was incorrect in the message received.\r
+\r
+\r
+/* bit field of IF command mask register */\r
+#define        DATAB           (1 << 0)   /* 1 is transfer data byte 4-7 to message object, 0 is not */\r
+#define        DATAA           (1 << 1)   /* 1 is transfer data byte 0-3 to message object, 0 is not */\r
+#define        NEWDAT          (1 << 2)   /* Clear NEWDAT bit in the message object */\r
+#define        CLRINTPND       (1 << 3)\r
+#define        CTRL            (1 << 4)   /* 1 is transfer the CTRL bit to the message object, 0 is not */\r
+#define        ARB                     (1 << 5)   /* 1 is transfer the ARB bits to the message object, 0 is not */\r
+#define        MASK            (1 << 6)   /* 1 is transfer the MASK bit to the message object, 0 is not */\r
+#define        WR                      (1 << 7)   /* 0 is READ, 1 is WRITE */\r
+#define RD             0x0000\r
+\r
+/* bit field of IF mask 2 register */\r
+#define        MASK_MXTD       (1 << 15)     /* 1 extended identifier bit is used in the RX filter unit, 0 is not */\r
+#define        MASK_MDIR       (1 << 14)     /* 1 direction bit is used in the RX filter unit, 0 is not */\r
+\r
+/* bit field of IF identifier 2 register */\r
+#define        ID_MVAL         (1 << 15)     /* Message valid bit, 1 is valid in the MO handler, 0 is ignored */\r
+#define        ID_MTD          (1 << 14)     /* 1 extended identifier bit is used in the RX filter unit, 0 is not */\r
+#define        ID_DIR          (1 << 13)     /* 1 direction bit is used in the RX filter unit, 0 is not */\r
+\r
+/* bit field of IF message control register */\r
+#define        NEWD            (1 << 15)     /* 1 indicates new data is in the message buffer.  */\r
+#define        MLST            (1 << 14)     /* 1 indicates a message loss. */\r
+#define        INTP            (1 << 13)     /* 1 indicates message object is an interrupt source */\r
+#define UMSK           (1 << 12)     /* 1 is to use the mask for the receive filter mask. */\r
+#define        TXIE            (1 << 11)     /* 1 is TX interrupt enabled */\r
+#define        RXIE            (1 << 10)     /* 1 is RX interrupt enabled */\r
+\r
+#if REMOTE_ENABLE\r
+       #define RMTEN           (1 << 9)  /* 1 is remote frame enabled */\r
+#else\r
+       #define RMTEN           0\r
+#endif\r
+\r
+#define TXRQ           (1 << 8)      /* 1 is TxRqst enabled */\r
+#define        EOB                     (1 << 7)      /* End of buffer, always write to 1 */\r
+#define        DLC                     0x000F        /* bit mask for DLC */\r
+\r
+#define ID_STD_MASK            0x07FF\r
+#define ID_EXT_MASK            0x1FFFFFFF\r
+#define DLC_MASK               0x0F\r
+\r
+/* Private Variables ---------------------------------------------------------- */\r
+/* Statistics of all the interrupts */\r
+/* Buss off status counter */\r
+volatile uint32_t BOffCnt = 0;\r
+/* Warning status counter.     At least one of the error counters\r
+ in the EML has reached the error warning limit of 96 */\r
+volatile uint32_t EWarnCnt = 0;\r
+/* More than 5 equal bits in a sequence in received message */\r
+volatile uint32_t StuffErrCnt = 0;\r
+/* Wrong format of fixed format part of a received frame */\r
+volatile uint32_t FormErrCnt = 0;\r
+/* Transmitted message not acknowledged. */\r
+volatile uint32_t AckErrCnt = 0;\r
+/* Send a HIGH/recessive level, but monitored LOW/dominant */\r
+volatile uint32_t Bit1ErrCnt = 0;\r
+/* Send a LOW/dominant level, but monitored HIGH/recessive */\r
+volatile uint32_t Bit0ErrCnt = 0;\r
+/* The CRC checksum was incorrect in the message received */\r
+volatile uint32_t CRCErrCnt = 0;\r
+/* Message object new data error counter */\r
+volatile uint32_t ND1ErrCnt = 0;\r
+\r
+MSG_CB TX_cb, RX_cb;\r
+\r
+message_object can_buff[CAN_MSG_OBJ_MAX];\r
+message_object recv_buff;\r
+\r
+#if CAN_DEBUG\r
+uint32_t CANStatusLog[100];\r
+uint32_t CANStatusLogCount = 0;\r
+#endif\r
+\r
+//#ifdef __GNUC__\r
+//uint32_t CAN_IF_Read(uint32_t reg,uint32_t IFsel){\r
+//     if(IFsel == IF1){\r
+//             return (LPC_C_CAN0->IF1_reg);\r
+//     }else{\r
+//             return (LPC_C_CAN0->IF2_reg);\r
+//     }\r
+//}\r
+//void CAN_IF_Write(uint32_t reg, uint32_t IFsel,uint32_t val){\r
+//     if(IFsel == IF1){\r
+//     (LPC_C_CAN0->IF1_reg=val);\r
+//     }else{\r
+//             (LPC_C_CAN0->IF2_reg=val);\r
+//     }\r
+//}\r
+//\r
+///* Macro for writing IF to specific RAM message object */\r
+//void CAN_IF_readBuf(uint32_t IFsel,uint32_t msg){\r
+//     if(IFsel == IF1){\r
+//     LPC_C_CAN0->IF1_CMDMSK_W=RD|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB;\r
+//     LPC_C_CAN0->IF1_CMDREQ=msg;\r
+//     while (LPC_C_CAN0->IF1_CMDREQ & IFCREQ_BUSY );\r
+//     }else{\r
+//       LPC_C_CAN0->IF2_CMDMSK_W=RD|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB;\r
+//       LPC_C_CAN0->IF2_CMDREQ=msg;\r
+//       while (LPC_C_CAN0->IF2_CMDREQ & IFCREQ_BUSY );\r
+//  }\r
+//\r
+//}\r
+//\r
+///* Macro for reading specific RAM message object to IF */\r
+//void CAN_IF_writeBuf(uint32_t IFsel,uint32_t msg){\r
+//     if(IFsel == IF1){\r
+//  LPC_C_CAN0->IF1_CMDMSK_W=WR|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB;\r
+//  LPC_C_CAN0->IF1_CMDREQ=msg;\r
+//  while (LPC_C_CAN0->IF1_CMDREQ & IFCREQ_BUSY );\r
+//     }else{\r
+//               LPC_C_CAN0->IF2_CMDMSK_W=WR|MASK|ARB|CTRL|CLRINTPND|DATAA|DATAB;\r
+//               LPC_C_CAN0->IF2_CMDREQ=msg;\r
+//               while (LPC_C_CAN0->IF2_CMDREQ & IFCREQ_BUSY );\r
+//     }\r
+//}\r
+//#endif\r
+\r
+/*********************************************************************//**\r
+ * @brief              Handle valid received message\r
+ * @param[in]  msg_no Message Object number\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_RxInt_MessageProcess( uint8_t msg_no )\r
+{\r
+       uint32_t msg_id;\r
+       uint32_t *p_add;\r
+       uint32_t reg1, reg2;\r
+\r
+       /* Import message object to IF2 */\r
+       CAN_IF_readBuf(IF2, msg_no);                                    /* Read the message into the IF registers */\r
+\r
+       p_add = (uint32_t *)&recv_buff;\r
+\r
+       if( CAN_IF_Read(ARB2, IF2) & ID_MTD )                   /* bit 28-0 is 29 bit extended frame */\r
+       {\r
+               /* mask off MsgVal and Dir */\r
+               reg1 = CAN_IF_Read(ARB1, IF2);\r
+               reg2 = CAN_IF_Read(ARB2, IF2);\r
+               msg_id = (reg1|(reg2<<16));\r
+       }\r
+       else\r
+       {\r
+               /* bit 28-18 is 11-bit standard frame */\r
+               msg_id = (CAN_IF_Read(ARB2, IF2) &0x1FFF) >> 2;\r
+       }\r
+\r
+       p_add[0] = msg_id;\r
+       p_add[1] = CAN_IF_Read(MCTRL, IF2) & 0x000F;    /* Get Msg Obj Data length */\r
+       p_add[2] = (CAN_IF_Read(DA2, IF2)<<16) | CAN_IF_Read(DA1, IF2);\r
+       p_add[3] = (CAN_IF_Read(DB2, IF2)<<16) | CAN_IF_Read(DB1, IF2);\r
+\r
+       /* Clear interrupt pending bit */\r
+       CAN_IF_Write(MCTRL, IF2, UMSK|RXIE|EOB|CAN_DLC_MAX);\r
+       /* Save changes to message RAM */\r
+       CAN_IF_writeBuf(IF2, msg_no);\r
+\r
+       return;\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Handle valid transmit message\r
+ * @param[in]  msg_no Message Object number\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_TxInt_MessageProcess( uint8_t msg_no )\r
+{\r
+       /* Clear interrupt pending bit */\r
+       CAN_IF_Write(MCTRL, IF2, UMSK|RXIE|EOB|CAN_DLC_MAX);\r
+       /* Save changes to message RAM */\r
+       CAN_IF_writeBuf(IF2,msg_no);\r
+       return;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              CAN interrupt handler\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+volatile uint32_t nd_tmp;\r
+void CAN_IRQHandler(void)\r
+{\r
+       uint32_t canstat = 0;\r
+       uint32_t can_int, msg_no;\r
+\r
+       while ( (can_int = LPC_C_CAN0->INT) != 0 )      /* While interrupt is pending */\r
+       {\r
+               canstat = LPC_C_CAN0->STAT;                             /* Read CAN status register */\r
+\r
+               if ( can_int & CAN_STATUS_INTERRUPT )\r
+               {\r
+                       /* Passive state monitored frequently in main. */\r
+\r
+                       if ( canstat & STAT_EWARN )\r
+                       {\r
+                               EWarnCnt++;\r
+                               return;\r
+                       }\r
+                       if ( canstat & STAT_BOFF )\r
+                       {\r
+                               BOffCnt++;\r
+                               return;\r
+                       }\r
+\r
+                       switch (canstat&STAT_LEC)       /* LEC Last Error Code (Type of the last error to occur on the CAN bus) */\r
+                       {\r
+                               case NO_ERR:\r
+                                       break;\r
+                               case STUFF_ERR:\r
+                                       StuffErrCnt++;\r
+                                       break;\r
+                               case FORM_ERR:\r
+                                       FormErrCnt++;\r
+                                       break;\r
+                               case ACK_ERR:\r
+                                       AckErrCnt++;\r
+                                       break;\r
+                               case BIT1_ERR:\r
+                                       Bit1ErrCnt++;\r
+                                       break;\r
+                               case BIT0_ERR:\r
+                                       Bit0ErrCnt++;\r
+                                       break;\r
+                               case CRC_ERR:\r
+                                       CRCErrCnt++;\r
+                                       break;\r
+                               default:\r
+                                       break;\r
+                       }\r
+\r
+                       /* Clear all warning/error states except RXOK/TXOK */\r
+                       LPC_C_CAN0->STAT &= STAT_RXOK|STAT_TXOK;\r
+               }\r
+               else\r
+               {\r
+                       if ( (canstat & STAT_LEC) == 0 )        /* NO ERROR */\r
+                       {\r
+                               msg_no = can_int & 0x7FFF;\r
+                               if((msg_no >= 1 ) && (msg_no <= 16))\r
+                               {\r
+                                       LPC_C_CAN0->STAT &= ~STAT_RXOK;\r
+                                       /* Check if message number is correct by reading NEWDAT registers.\r
+                                        By reading out the NEWDAT bits, the CPU can check for which Message\r
+                                        Object the data portion was updated\r
+                                        Only first 16 message object used for receive : only use ND1 */\r
+                                       if((1<<(msg_no-1)) != LPC_C_CAN0->ND1)\r
+                                       {\r
+                                               /* message object does not contain new data! */\r
+                                               ND1ErrCnt++;\r
+                                               break;\r
+                                       }\r
+                                       CAN_RxInt_MessageProcess(msg_no);\r
+                                       RX_cb(msg_no);\r
+                               }\r
+                               else\r
+                               {\r
+                                       LPC_C_CAN0->STAT &= ~STAT_TXOK;\r
+                                       CAN_TxInt_MessageProcess(msg_no);\r
+                                       TX_cb(msg_no);\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       return;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initialize CAN peripheral\r
+ * @param[in]  BitClk CAN bit clock setting\r
+ * @param[in]  ClkDiv CAN bit clock setting\r
+ * @param[in]  Tx_cb point to call-back function when transmitted\r
+ * @param[in]  Rx_cb point to call-back function when received\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_Init( uint32_t BitClk, CCAN_CLKDIV_Type ClkDiv , MSG_CB Tx_cb, MSG_CB Rx_cb)\r
+{\r
+\r
+       RX_cb = Rx_cb;\r
+       TX_cb = Tx_cb;\r
+       if ( !(LPC_C_CAN0->CNTL & CTRL_INIT) )\r
+       {\r
+               /* If it's in normal operation already, stop it, reconfigure\r
+                everything first, then restart.  */\r
+               LPC_C_CAN0->CNTL |= CTRL_INIT;  /* Default state */\r
+       }\r
+\r
+       LPC_C_CAN0->CLKDIV = ClkDiv;                    /* Divider for CAN VPB3 clock */\r
+       LPC_C_CAN0->CNTL |= CTRL_CCE;           /* Start configuring bit timing */\r
+       LPC_C_CAN0->BT = BitClk;\r
+       LPC_C_CAN0->BRPE = 0x0000;\r
+       LPC_C_CAN0->CNTL &= ~CTRL_CCE;          /* Stop configuring bit timing */\r
+\r
+       LPC_C_CAN0->CNTL &= ~CTRL_INIT;         /* Initialization finished, normal operation now. */\r
+       while ( LPC_C_CAN0->CNTL & CTRL_INIT );\r
+\r
+       /* By default, auto TX is enabled, enable all related interrupts */\r
+       LPC_C_CAN0->CNTL |= (CTRL_IE|CTRL_SIE|CTRL_EIE);\r
+       return;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Send a message to the CAN port\r
+ * @param[in]  msg_no message object number\r
+ * @param[in]  msg_ptr msg buffer pointer\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_Send(uint8_t msg_no, uint32_t *msg_ptr )\r
+{\r
+       uint32_t tx_id, Length;\r
+\r
+       if(msg_ptr == NULL) return;\r
+\r
+       /* first is the ID, second is length, the next four are data */\r
+       tx_id = *msg_ptr++;\r
+       Length = *msg_ptr++;\r
+\r
+       if(Length>CAN_DLC_MAX)Length = CAN_DLC_MAX;\r
+       CAN_IF_Write(MCTRL, IF1, UMSK|TXIE|TXRQ|EOB|RMTEN|(Length & DLC_MASK));\r
+       CAN_IF_Write(DA1, IF1, *msg_ptr);                       /* Lower two bytes of message pointer */\r
+       CAN_IF_Write(DA2, IF1, (*msg_ptr++)>>16);       /* Upper two bytes of message pointer */\r
+       CAN_IF_Write(DB1, IF1, *msg_ptr);                       /* Lower two bytes of message pointer */\r
+       CAN_IF_Write(DB2, IF1, (*msg_ptr)>>16);         /* Upper two bytes of message pointer */\r
+\r
+       /* Configure arbitration */\r
+       if(!(tx_id & (0x1<<30)))                                        /* bit 30 is 0, standard frame */\r
+       {\r
+               /* Mxtd: 0, Mdir: 1, Mask is 0x7FF */\r
+               CAN_IF_Write(MSK2, IF1, MASK_MDIR | (ID_STD_MASK << 2));\r
+               CAN_IF_Write(MSK1, IF1, 0x0000);\r
+\r
+               /* MsgVal: 1, Mtd: 0, Dir: 1, ID = 0x200 */\r
+               CAN_IF_Write(ARB1, IF1, 0x0000);\r
+               CAN_IF_Write(ARB2, IF1, ID_MVAL| ID_DIR | (tx_id << 2));\r
+       }\r
+       else                                                                            /* Extended frame */\r
+       {\r
+               /* Mxtd: 1, Mdir: 1, Mask is 0x7FF */\r
+               CAN_IF_Write(MSK2, IF1, MASK_MXTD | MASK_MDIR | (ID_EXT_MASK >> 16));\r
+               CAN_IF_Write(MSK1, IF1, ID_EXT_MASK & 0x0000FFFF);\r
+\r
+               /* MsgVal: 1, Mtd: 1, Dir: 1, ID = 0x200000 */\r
+               CAN_IF_Write(ARB1, IF1, tx_id & 0x0000FFFF);\r
+               CAN_IF_Write(ARB2, IF1, ID_MVAL|ID_MTD | ID_DIR | (tx_id >> 16));\r
+       }\r
+\r
+       /* Write changes to message RAM */\r
+       CAN_IF_writeBuf(IF1, msg_no);\r
+\r
+       return;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Listen for a message on CAN bus\r
+ * @param[in]  msg_no message object number\r
+ * @param[in]  msg_ptr msg buffer pointer\r
+ * @param[in]  RemoteEnable Enable/disable remote frame support, should be:\r
+ *                                     - TRUE:  enable\r
+ *                                     - FALSE: disable\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_Recv(uint8_t msg_no, uint32_t *msg_ptr, Bool RemoteEnable)\r
+{\r
+       uint32_t rx_id = *msg_ptr;\r
+       uint32_t rmten = 0;\r
+       if(RemoteEnable){\r
+               rmten = 1<<8;\r
+       }\r
+       if(!(rx_id & (0x1<<30))){ /* standard frame */\r
+\r
+               /* Mxtd: 0, Mdir: 0, Mask is 0x7FF */\r
+               CAN_IF_Write(MSK1, IF1, 0x0000);\r
+               CAN_IF_Write(MSK2, IF1, ID_STD_MASK << 2);\r
+               /* MsgVal: 1, Mtd: 0, Dir: 0 */\r
+               CAN_IF_Write(ARB1, IF1, 0x0000);\r
+               CAN_IF_Write(MCTRL, IF1, rmten|UMSK|RXIE|EOB|CAN_DLC_MAX);\r
+               CAN_IF_Write(DA1, IF1, 0x0000);\r
+               CAN_IF_Write(DA2, IF1, 0x0000);\r
+               CAN_IF_Write(DB1, IF1, 0x0000);\r
+               CAN_IF_Write(DB2, IF1, 0x0000);\r
+               CAN_IF_Write(ARB2, IF1, ID_MVAL | ((rx_id) << 2));\r
+               /* Transfer data to message RAM */\r
+               CAN_IF_writeBuf(IF1, msg_no);\r
+       }\r
+\r
+       else{\r
+               rx_id &= (0x1<<30)-1 ; /* Mask ID bit */\r
+               /* Mxtd: 1, Mdir: 0, Mask is 0x1FFFFFFF */\r
+               CAN_IF_Write(MSK1, IF1, ID_EXT_MASK & 0xFFFF);\r
+               CAN_IF_Write(MSK2, IF1, MASK_MXTD | (ID_EXT_MASK >> 16));\r
+               /* MsgVal: 1, Mtd: 1, Dir: 0 */\r
+               CAN_IF_Write(ARB1, IF1, (rx_id) & 0xFFFF);\r
+               CAN_IF_Write(MCTRL, IF1, rmten|UMSK|RXIE|EOB|CAN_DLC_MAX);\r
+               CAN_IF_Write(DA1, IF1, 0x0000);\r
+               CAN_IF_Write(DA2, IF1, 0x0000);\r
+               CAN_IF_Write(DB1, IF1, 0x0000);\r
+               CAN_IF_Write(DB2, IF1, 0x0000);\r
+               CAN_IF_Write(ARB2, IF1, ID_MVAL | ID_MTD | ((rx_id) >> 16));\r
+               /* Transfer data to message RAM */\r
+               CAN_IF_writeBuf(IF1, msg_no);\r
+       }\r
+       return;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read a message from Message RAM to buffer\r
+ * @param[in]  msg_no message object number\r
+ * @param[in]  buff msg buffer pointer\r
+ * @return             None\r
+ **********************************************************************/\r
+void CAN_ReadMsg(uint32_t msg_no, message_object* buff){\r
+       int i;\r
+       buff->id = recv_buff.id;\r
+       buff->dlc = recv_buff.dlc;\r
+       if(recv_buff.dlc>CAN_DLC_MAX) recv_buff.dlc = CAN_DLC_MAX;\r
+       for(i=0;i<recv_buff.dlc;i++)\r
+               buff->data[i] = recv_buff.data[i];\r
+}\r
+\r
+#endif /* _C_CAN*/\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_cgu.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_cgu.c
new file mode 100644 (file)
index 0000000..a207647
--- /dev/null
@@ -0,0 +1,916 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_cgu.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_cgu.c\r
+* @brief       Contains all functions support for Clock Generation and Control\r
+*                      firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup CGU\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc_types.h"\r
+#include "lpc18xx_scu.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/** This define used to fix mistake when run with IAR compiler */\r
+#ifdef __ICCARM__\r
+#define CGU_BRANCH_STATUS_ENABLE_MASK  0x80000001\r
+#else\r
+#define CGU_BRANCH_STATUS_ENABLE_MASK  0x01\r
+#endif\r
+\r
+/*TODO List:\r
+ * SET PLL0\r
+ * UPDATE Clock from PLL0\r
+ * SetDIV uncheck value\r
+ * GetBaseStatus BASE_SAFE\r
+ * */\r
+/* Local definition */\r
+#define CGU_ADDRESS32(x,y) (*(uint32_t*)((uint32_t)x+y))\r
+\r
+/* Local Variable */\r
+const int16_t CGU_Entity_ControlReg_Offset[CGU_ENTITY_NUM] = {\r
+               -1,             //CGU_CLKSRC_32KHZ_OSC,\r
+               -1,             //CGU_CLKSRC_IRC,\r
+               -1,             //CGU_CLKSRC_ENET_RX_CLK,\r
+               -1,             //CGU_CLKSRC_ENET_TX_CLK,\r
+               -1,             //CGU_CLKSRC_GP_CLKIN,\r
+               -1,             //CGU_CLKSRC_TCK,\r
+               0x18,   //CGU_CLKSRC_XTAL_OSC,\r
+               0x20,   //CGU_CLKSRC_PLL0,\r
+               0x30,   //CGU_CLKSRC_PLL0_AUDIO **REV A**\r
+               0x44,   //CGU_CLKSRC_PLL1,\r
+               -1,             //CGU_CLKSRC_RESERVE,\r
+               -1,             //CGU_CLKSRC_RESERVE,\r
+               0x48,   //CGU_CLKSRC_IDIVA,,\r
+               0x4C,   //CGU_CLKSRC_IDIVB,\r
+               0x50,   //CGU_CLKSRC_IDIVC,\r
+               0x54,   //CGU_CLKSRC_IDIVD,\r
+               0x58,   //CGU_CLKSRC_IDIVE,\r
+\r
+               0x5C,   //CGU_BASE_SAFE,\r
+               0x60,   //CGU_BASE_USB0,\r
+               -1,             //CGU_BASE_RESERVE,\r
+               0x68,   //CGU_BASE_USB1,\r
+               0x6C,   //CGU_BASE_M3,\r
+               0x70,   //CGU_BASE_SPIFI,\r
+               -1,             //CGU_BASE_RESERVE,\r
+               0x78,   //CGU_BASE_PHY_RX,\r
+               0x7C,   //CGU_BASE_PHY_TX,\r
+               0x80,   //CGU_BASE_APB1,\r
+               0x84,   //CGU_BASE_APB3,\r
+               0x88,   //CGU_BASE_LCD,\r
+               0X8C,   //CGU_BASE_ENET_CSR, **REV A**\r
+               0x90,   //CGU_BASE_SDIO,\r
+               0x94,   //CGU_BASE_SSP0,\r
+               0x98,   //CGU_BASE_SSP1,\r
+               0x9C,   //CGU_BASE_UART0,\r
+               0xA0,   //CGU_BASE_UART1,\r
+               0xA4,   //CGU_BASE_UART2,\r
+               0xA8,   //CGU_BASE_UART3,\r
+               0xAC,   //CGU_BASE_CLKOUT\r
+               -1,\r
+               -1,\r
+               -1,\r
+               -1,\r
+               0xC0,   //CGU_BASE_APLL\r
+               0xC4,   //CGU_BASE_OUT0\r
+               0xC8    //CGU_BASE_OUT1\r
+};\r
+\r
+const uint8_t CGU_ConnectAlloc_Tbl[CGU_CLKSRC_NUM][CGU_ENTITY_NUM] = {\r
+//       3 I E E G T X P P P x x D D D D D S U x U M S x P P A A L E S S S U U U U C x x x x A O O\r
+//       2 R R T P C T L L L     I I I I I A S   S 3 P   H H P P C N D S S R R R R O         P U U\r
+//         C X X I K A 0 A 1     A B C D E F B   B   F   RxTx1 3 D T I 0 1 0 1 2 3           L T T\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_32KHZ_OSC = 0,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_IRC,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_ENET_RX_CLK,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_ENET_TX_CLK,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_GP_CLKIN,*/\r
+               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},/*CGU_CLKSRC_TCK,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_XTAL_OSC,*/\r
+               {0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1},/*CGU_CLKSRC_PLL0,*/\r
+               {0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_PLL0_AUDIO,*/\r
+               {0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_PLL1,*/\r
+               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\r
+               {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_IDIVA = CGU_CLKSRC_PLL1 + 3,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_IDIVB,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_IDIVC,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1},/*CGU_CLKSRC_IDIVD,*/\r
+               {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1}/*CGU_CLKSRC_IDIVE,*/\r
+};\r
+\r
+const CGU_PERIPHERAL_S CGU_PERIPHERAL_Info[CGU_PERIPHERAL_NUM] = {\r
+       /*      Register Clock                  |       Peripheral Clock\r
+                |      BASE    |               BRANCH  |       BASE            |       BRANCH          */\r
+               {CGU_BASE_APB3, 0x1118, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_ADC0,\r
+               {CGU_BASE_APB3, 0x1120, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_ADC1,\r
+               {CGU_BASE_M3,   0x1460, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_AES,\r
+               ////    CGU_PERIPHERAL_ALARMTIMER_CGU_RGU_RTC_WIC,\r
+               {CGU_BASE_APB1, 0x1200, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_APB1_BUS,\r
+               {CGU_BASE_APB3, 0x1100, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_APB3_BUS,\r
+               {CGU_BASE_APB3, 0x1128, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_CAN0,\r
+               {CGU_BASE_M3,   0x1538, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_CREG,\r
+               {CGU_BASE_APB3, 0x1110, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_DAC,\r
+               {CGU_BASE_M3,   0x1440, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_DMA,\r
+               {CGU_BASE_M3,   0x1430, CGU_BASE_M3,            0x1478, 0},//CGU_PERIPHERAL_EMC,\r
+               {CGU_BASE_M3,   0x1420, CGU_BASE_PHY_RX,        0x0000, CGU_PERIPHERAL_ETHERNET_TX},//CGU_PERIPHERAL_ETHERNET,\r
+               {CGU_ENTITY_NONE,0x0000, CGU_BASE_PHY_TX,       0x0000, 0},//CGU_PERIPHERAL_ETHERNET_TX\r
+               {CGU_BASE_M3,   0x1410, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_GPIO,\r
+               {CGU_BASE_APB1, 0x1210, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_I2C0,\r
+               {CGU_BASE_APB3, 0x1108, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_I2C1,\r
+               {CGU_BASE_APB1, 0x1218, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_I2S,\r
+               {CGU_BASE_M3,   0x1418, CGU_BASE_LCD,   0x0000, 0},//CGU_PERIPHERAL_LCD,\r
+               {CGU_BASE_M3,   0x1448, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_M3CORE,\r
+               {CGU_BASE_M3,   0x1400, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_M3_BUS,\r
+               {CGU_BASE_APB1, 0x1208, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_MOTOCON,\r
+               {CGU_BASE_M3,   0x1630, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_QEI,\r
+               {CGU_BASE_M3,   0x1600, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_RITIMER,\r
+               {CGU_BASE_M3,   0x1468, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_SCT,\r
+               {CGU_BASE_M3,   0x1530, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_SCU,\r
+               {CGU_BASE_M3,   0x1438, CGU_BASE_SDIO,  0x2800, 0},//CGU_PERIPHERAL_SDIO,\r
+               {CGU_BASE_M3,   0x1408, CGU_BASE_SPIFI, 0x1300, 0},//CGU_PERIPHERAL_SPIFI,\r
+               {CGU_BASE_M3,   0x1518, CGU_BASE_SSP0,  0x2700, 0},//CGU_PERIPHERAL_SSP0,\r
+               {CGU_BASE_M3,   0x1628, CGU_BASE_SSP1,  0x2600, 0},//CGU_PERIPHERAL_SSP1,\r
+               {CGU_BASE_M3,   0x1520, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_TIMER0,\r
+               {CGU_BASE_M3,   0x1528, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_TIMER1,\r
+               {CGU_BASE_M3,   0x1618, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_TIMER2,\r
+               {CGU_BASE_M3,   0x1620, CGU_ENTITY_NONE,        0x0000, 0},//CGU_PERIPHERAL_TIMER3,\r
+               {CGU_BASE_M3,   0x1508, CGU_BASE_UART0, 0x2500, 0},//CGU_PERIPHERAL_UART0,\r
+               {CGU_BASE_M3,   0x1510, CGU_BASE_UART1, 0x2400, 0},//CGU_PERIPHERAL_UART1,\r
+               {CGU_BASE_M3,   0x1608, CGU_BASE_UART2, 0x2300, 0},//CGU_PERIPHERAL_UART2,\r
+               {CGU_BASE_M3,   0x1610, CGU_BASE_UART3, 0x2200, 0},//CGU_PERIPHERAL_UART3,\r
+               {CGU_BASE_M3,   0x1428, CGU_BASE_USB0,  0x1800, 0},//CGU_PERIPHERAL_USB0,\r
+               {CGU_BASE_M3,   0x1470, CGU_BASE_USB1,  0x1900, 0},//CGU_PERIPHERAL_USB1,\r
+               {CGU_BASE_M3,   0x1500, CGU_BASE_SAFE,  0x0000, 0},//CGU_PERIPHERAL_WWDT,\r
+};\r
+\r
+uint32_t CGU_ClockSourceFrequency[CGU_CLKSRC_NUM] = {0,12000000,0,0,0,0, 0, 480000000,0,0,0,0,0,0,0,0,0};\r
+\r
+#define CGU_CGU_ADDR   ((uint32_t)LPC_CGU)\r
+#define CGU_REG_BASE_CTRL(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_Entity_ControlReg_Offset[CGU_PERIPHERAL_Info[x].RegBaseEntity]))\r
+#define CGU_REG_BRANCH_CTRL(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].RegBranchOffset))\r
+#define CGU_REG_BRANCH_STATUS(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].RegBranchOffset+4))\r
+\r
+#define CGU_PER_BASE_CTRL(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_Entity_ControlReg_Offset[CGU_PERIPHERAL_Info[x].PerBaseEntity]))\r
+#define CGU_PER_BRANCH_CTRL(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].PerBranchOffset))\r
+#define CGU_PER_BRANCH_STATUS(x) (*(uint32_t*)(CGU_CGU_ADDR+CGU_PERIPHERAL_Info[x].PerBranchOffset+4))\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initialize default clock for LPC1800 Eval board\r
+ * @param[in]  None\r
+ * @return             Initialize status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - Other: error\r
+ **********************************************************************/\r
+uint32_t       CGU_Init(void){\r
+       CGU_SetXTALOSC(12000000);\r
+       CGU_EnableEntity(CGU_CLKSRC_XTAL_OSC, ENABLE);\r
+       CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_CLKSRC_PLL1);\r
+       // Disable PLL1 CPU hang???\r
+       //CGU_EnableEntity(CGU_CLKSRC_PLL1, DISABLE);\r
+       CGU_SetPLL1(10);\r
+       CGU_EnableEntity(CGU_CLKSRC_PLL1, ENABLE);\r
+       CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_M3);\r
+       CGU_UpdateClock();\r
+       return 0;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure power for individual peripheral\r
+ * @param[in]  PPType  peripheral type, should be:\r
+ *                                     - CGU_PERIPHERAL_ADC0           :ADC0\r
+ *                                     - CGU_PERIPHERAL_ADC1           :ADC1\r
+ *                                     - CGU_PERIPHERAL_AES            :AES\r
+ *                                     - CGU_PERIPHERAL_APB1_BUS       :APB1 bus\r
+ *                                     - CGU_PERIPHERAL_APB3_BUS       :APB3 bus\r
+ *                                     - CGU_PERIPHERAL_CAN            :CAN\r
+ *                                     - CGU_PERIPHERAL_CREG           :CREG\r
+ *                                     - CGU_PERIPHERAL_DAC            :DAC\r
+ *                                     - CGU_PERIPHERAL_DMA            :DMA\r
+ *                                     - CGU_PERIPHERAL_EMC            :EMC\r
+ *                                     - CGU_PERIPHERAL_ETHERNET       :ETHERNET\r
+ *                                     - CGU_PERIPHERAL_GPIO           :GPIO\r
+ *                                     - CGU_PERIPHERAL_I2C0           :I2C0\r
+ *                                     - CGU_PERIPHERAL_I2C1           :I2C1\r
+ *                                     - CGU_PERIPHERAL_I2S            :I2S\r
+ *                                     - CGU_PERIPHERAL_LCD            :LCD\r
+ *                                     - CGU_PERIPHERAL_M3CORE         :M3 core\r
+ *                                     - CGU_PERIPHERAL_M3_BUS         :M3 bus\r
+ *                                     - CGU_PERIPHERAL_MOTOCON        :Motor control\r
+ *                                     - CGU_PERIPHERAL_QEI            :QEI\r
+ *                                     - CGU_PERIPHERAL_RITIMER        :RIT timer\r
+ *                                     - CGU_PERIPHERAL_SCT            :SCT\r
+ *                                     - CGU_PERIPHERAL_SCU            :SCU\r
+ *                                     - CGU_PERIPHERAL_SDIO           :SDIO\r
+ *                                     - CGU_PERIPHERAL_SPIFI          :SPIFI\r
+ *                                     - CGU_PERIPHERAL_SSP0           :SSP0\r
+ *                                     - CGU_PERIPHERAL_SSP1           :SSP1\r
+ *                                     - CGU_PERIPHERAL_TIMER0         :TIMER0\r
+ *                                     - CGU_PERIPHERAL_TIMER1         :TIMER1\r
+ *                                     - CGU_PERIPHERAL_TIMER2         :TIMER2\r
+ *                                     - CGU_PERIPHERAL_TIMER3         :TIMER3\r
+ *                                     - CGU_PERIPHERAL_UART0          :UART0\r
+ *                                     - CGU_PERIPHERAL_UART1          :UART1\r
+ *                                     - CGU_PERIPHERAL_UART2          :UART2\r
+ *                                     - CGU_PERIPHERAL_UART3          :UART3\r
+ *                                     - CGU_PERIPHERAL_USB0           :USB0\r
+ *                                     - CGU_PERIPHERAL_USB1           :USB1\r
+ *                                     - CGU_PERIPHERAL_WWDT           :WWDT\r
+ * @param[in]  en status, should be:\r
+ *                                     - ENABLE: Enable power\r
+ *                                     - DISABLE: Disable power\r
+ * @return             Configure status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - Other: error\r
+ **********************************************************************/\r
+uint32_t CGU_ConfigPWR (CGU_PERIPHERAL_T PPType,  FunctionalState en){\r
+       if(PPType >= CGU_PERIPHERAL_WWDT && PPType <= CGU_PERIPHERAL_ADC0)\r
+               return CGU_ERROR_INVALID_PARAM;\r
+       if(en == DISABLE){/* Going to disable clock */\r
+               /*Get Reg branch status */\r
+               if(CGU_PERIPHERAL_Info[PPType].RegBranchOffset!= 0 &&\r
+                               CGU_REG_BRANCH_STATUS(PPType) & 1){\r
+                       CGU_REG_BRANCH_CTRL(PPType) &= ~1; /* Disable branch clock */\r
+                       while(CGU_REG_BRANCH_STATUS(PPType) & 1);\r
+               }\r
+               /* GetBase Status*/\r
+               if((CGU_PERIPHERAL_Info[PPType].RegBaseEntity!=CGU_ENTITY_NONE) &&\r
+                       CGU_GetBaseStatus((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].RegBaseEntity) == 0){\r
+                       /* Disable Base */\r
+                       CGU_EnableEntity((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].RegBaseEntity,0);\r
+               }\r
+\r
+               /* Same for Peripheral */\r
+               if((CGU_PERIPHERAL_Info[PPType].PerBranchOffset!= 0) && (CGU_PER_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK)){\r
+                       CGU_PER_BRANCH_CTRL(PPType) &= ~1; /* Disable branch clock */\r
+                       while(CGU_PER_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK);\r
+               }\r
+               /* GetBase Status*/\r
+               if((CGU_PERIPHERAL_Info[PPType].PerBaseEntity!=CGU_ENTITY_NONE) &&\r
+                       CGU_GetBaseStatus((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].PerBaseEntity) == 0){\r
+                       /* Disable Base */\r
+                       CGU_EnableEntity((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].PerBaseEntity,0);\r
+               }\r
+       }else{\r
+               /* enable */\r
+               /* GetBase Status*/\r
+               if((CGU_PERIPHERAL_Info[PPType].RegBaseEntity!=CGU_ENTITY_NONE) && CGU_REG_BASE_CTRL(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK){\r
+                       /* Enable Base */\r
+                       CGU_EnableEntity((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].RegBaseEntity, 1);\r
+               }\r
+               /*Get Reg branch status */\r
+               if((CGU_PERIPHERAL_Info[PPType].RegBranchOffset!= 0) && !(CGU_REG_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK)){\r
+                       CGU_REG_BRANCH_CTRL(PPType) |= 1; /* Enable branch clock */\r
+                       while(!(CGU_REG_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK));\r
+               }\r
+\r
+               /* Same for Peripheral */\r
+               /* GetBase Status*/\r
+               if((CGU_PERIPHERAL_Info[PPType].PerBaseEntity != CGU_ENTITY_NONE) &&\r
+                               (CGU_PER_BASE_CTRL(PPType) & 1)){\r
+                       /* Enable Base */\r
+                       CGU_EnableEntity((CGU_ENTITY_T)CGU_PERIPHERAL_Info[PPType].PerBaseEntity, 1);\r
+               }\r
+               /*Get Reg branch status */\r
+               if((CGU_PERIPHERAL_Info[PPType].PerBranchOffset!= 0) && !(CGU_PER_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK)){\r
+                       CGU_PER_BRANCH_CTRL(PPType) |= 1; /* Enable branch clock */\r
+                       while(!(CGU_PER_BRANCH_STATUS(PPType) & CGU_BRANCH_STATUS_ENABLE_MASK));\r
+               }\r
+\r
+       }\r
+\r
+       if(CGU_PERIPHERAL_Info[PPType].next){\r
+               return CGU_ConfigPWR((CGU_PERIPHERAL_T)CGU_PERIPHERAL_Info[PPType].next, en);\r
+       }\r
+       return CGU_ERROR_SUCCESS;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get peripheral clock frequency\r
+ * @param[in]  Clock   Peripheral type, should be:\r
+ *                                     - CGU_PERIPHERAL_ADC0           :ADC0\r
+ *                                     - CGU_PERIPHERAL_ADC1           :ADC1\r
+ *                                     - CGU_PERIPHERAL_AES            :AES\r
+ *                                     - CGU_PERIPHERAL_APB1_BUS       :APB1 bus\r
+ *                                     - CGU_PERIPHERAL_APB3_BUS       :APB3 bus\r
+ *                                     - CGU_PERIPHERAL_CAN            :CAN\r
+ *                                     - CGU_PERIPHERAL_CREG           :CREG\r
+ *                                     - CGU_PERIPHERAL_DAC            :DAC\r
+ *                                     - CGU_PERIPHERAL_DMA            :DMA\r
+ *                                     - CGU_PERIPHERAL_EMC            :EMC\r
+ *                                     - CGU_PERIPHERAL_ETHERNET       :ETHERNET\r
+ *                                     - CGU_PERIPHERAL_GPIO           :GPIO\r
+ *                                     - CGU_PERIPHERAL_I2C0           :I2C0\r
+ *                                     - CGU_PERIPHERAL_I2C1           :I2C1\r
+ *                                     - CGU_PERIPHERAL_I2S            :I2S\r
+ *                                     - CGU_PERIPHERAL_LCD            :LCD\r
+ *                                     - CGU_PERIPHERAL_M3CORE         :M3 core\r
+ *                                     - CGU_PERIPHERAL_M3_BUS         :M3 bus\r
+ *                                     - CGU_PERIPHERAL_MOTOCON        :Motor control\r
+ *                                     - CGU_PERIPHERAL_QEI            :QEI\r
+ *                                     - CGU_PERIPHERAL_RITIMER        :RIT timer\r
+ *                                     - CGU_PERIPHERAL_SCT            :SCT\r
+ *                                     - CGU_PERIPHERAL_SCU            :SCU\r
+ *                                     - CGU_PERIPHERAL_SDIO           :SDIO\r
+ *                                     - CGU_PERIPHERAL_SPIFI          :SPIFI\r
+ *                                     - CGU_PERIPHERAL_SSP0           :SSP0\r
+ *                                     - CGU_PERIPHERAL_SSP1           :SSP1\r
+ *                                     - CGU_PERIPHERAL_TIMER0         :TIMER0\r
+ *                                     - CGU_PERIPHERAL_TIMER1         :TIMER1\r
+ *                                     - CGU_PERIPHERAL_TIMER2         :TIMER2\r
+ *                                     - CGU_PERIPHERAL_TIMER3         :TIMER3\r
+ *                                     - CGU_PERIPHERAL_UART0          :UART0\r
+ *                                     - CGU_PERIPHERAL_UART1          :UART1\r
+ *                                     - CGU_PERIPHERAL_UART2          :UART2\r
+ *                                     - CGU_PERIPHERAL_UART3          :UART3\r
+ *                                     - CGU_PERIPHERAL_USB0           :USB0\r
+ *                                     - CGU_PERIPHERAL_USB1           :USB1\r
+ *                                     - CGU_PERIPHERAL_WWDT           :WWDT\r
+ * @return             Return frequently value\r
+ **********************************************************************/\r
+uint32_t CGU_GetPCLKFrequency (CGU_PERIPHERAL_T Clock){\r
+       uint32_t ClkSrc;\r
+       if(Clock >= CGU_PERIPHERAL_WWDT && Clock <= CGU_PERIPHERAL_ADC0)\r
+               return CGU_ERROR_INVALID_PARAM;\r
+\r
+       if(CGU_PERIPHERAL_Info[Clock].PerBaseEntity != CGU_ENTITY_NONE){\r
+               /* Get Base Clock Source */\r
+               ClkSrc = (CGU_PER_BASE_CTRL(Clock) & CGU_CTRL_SRC_MASK) >> 24;\r
+               /* GetBase Status*/\r
+               if(CGU_PER_BASE_CTRL(Clock) & 1)\r
+                       return 0;\r
+               /* check Branch if it is enabled */\r
+               if((CGU_PERIPHERAL_Info[Clock].PerBranchOffset!= 0) && !(CGU_PER_BRANCH_STATUS(Clock) & CGU_BRANCH_STATUS_ENABLE_MASK)) return 0;\r
+       }else{\r
+               if(CGU_REG_BASE_CTRL(Clock) & 1)        return 0;\r
+               ClkSrc = (CGU_REG_BASE_CTRL(Clock) & CGU_CTRL_SRC_MASK) >> 24;\r
+               /* check Branch if it is enabled */\r
+               if((CGU_PERIPHERAL_Info[Clock].RegBranchOffset!= 0) && !(CGU_REG_BRANCH_STATUS(Clock) & CGU_BRANCH_STATUS_ENABLE_MASK)) return 0;\r
+       }\r
+       return CGU_ClockSourceFrequency[ClkSrc];\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Update clock\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void CGU_UpdateClock(void){\r
+       uint32_t ClkSrc;\r
+       uint32_t div;\r
+       uint32_t divisor;\r
+       int32_t RegOffset;\r
+       /* 32OSC */\r
+       if(ISBITSET(LPC_CREG->CREG0,1) && ISBITCLR(LPC_CREG->CREG0,3))\r
+               CGU_ClockSourceFrequency[CGU_CLKSRC_32KHZ_OSC] = 32768;\r
+       else\r
+               CGU_ClockSourceFrequency[CGU_CLKSRC_32KHZ_OSC] = 0;\r
+       /*PLL0*/\r
+       /* PLL1 */\r
+       if(ISBITCLR(LPC_CGU->PLL1_CTRL,1) /* Enabled */\r
+                       && (LPC_CGU->PLL1_STAT&1)){ /* Locked? */\r
+               ClkSrc = (LPC_CGU->PLL1_CTRL & CGU_CTRL_SRC_MASK)>>24;\r
+               CGU_ClockSourceFrequency[CGU_CLKSRC_PLL1] = CGU_ClockSourceFrequency[ClkSrc] *\r
+                                                                                                                       (((LPC_CGU->PLL1_CTRL>>16)&0xFF)+1);\r
+       }else\r
+               CGU_ClockSourceFrequency[CGU_CLKSRC_PLL1] = 0;\r
+\r
+       /* DIV */\r
+       for(div = CGU_CLKSRC_IDIVA; div <= CGU_CLKSRC_IDIVE; div++){\r
+               RegOffset = CGU_Entity_ControlReg_Offset[div];\r
+               if(ISBITCLR(CGU_ADDRESS32(LPC_CGU,RegOffset),1)){\r
+                       ClkSrc = (CGU_ADDRESS32(LPC_CGU,RegOffset) & CGU_CTRL_SRC_MASK) >> 24;\r
+                       divisor = (CGU_ADDRESS32(LPC_CGU,RegOffset)>>2) & 0xFF;\r
+                       divisor ++;\r
+                       CGU_ClockSourceFrequency[div] = CGU_ClockSourceFrequency[ClkSrc] / divisor;\r
+               }else\r
+                       CGU_ClockSourceFrequency[div] = 0;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set XTAL oscillator value\r
+ * @param[in]  ClockFrequency  XTAL Frequency value\r
+ * @return             Setting status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - CGU_ERROR_FREQ_OUTOF_RANGE: XTAL value set is out of range\r
+ **********************************************************************/\r
+uint32_t       CGU_SetXTALOSC(uint32_t ClockFrequency){\r
+       if(ClockFrequency < 15000000){\r
+               LPC_CGU->XTAL_OSC_CTRL &= ~(1<<2);\r
+       }else if(ClockFrequency < 25000000){\r
+               LPC_CGU->XTAL_OSC_CTRL |= (1<<2);\r
+       }else\r
+               return CGU_ERROR_FREQ_OUTOF_RANGE;\r
+\r
+       CGU_ClockSourceFrequency[CGU_CLKSRC_XTAL_OSC] = ClockFrequency;\r
+       return CGU_ERROR_SUCCESS;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set clock divider\r
+ * @param[in]  SelectDivider   Clock source, should be:\r
+ *                                     - CGU_CLKSRC_IDIVA      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE      :Integer divider register E\r
+ * @param[in]  divisor Divisor value, should be: 0..255\r
+ * @return             Setting status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - CGU_ERROR_INVALID_ENTITY: Invalid entity\r
+ **********************************************************************/\r
+/* divisor number must >=1*/\r
+uint32_t       CGU_SetDIV(CGU_ENTITY_T SelectDivider, uint32_t divisor){\r
+       int32_t RegOffset;\r
+       uint32_t tempReg;\r
+       if(SelectDivider>=CGU_CLKSRC_IDIVA && SelectDivider<=CGU_CLKSRC_IDIVE){\r
+               RegOffset = CGU_Entity_ControlReg_Offset[SelectDivider];\r
+               if(RegOffset == -1) return CGU_ERROR_INVALID_ENTITY;\r
+               tempReg = CGU_ADDRESS32(LPC_CGU,RegOffset);\r
+               tempReg &= ~(0xFF<<2);\r
+               tempReg |= ((divisor-1)&0xFF)<<2;\r
+               CGU_ADDRESS32(LPC_CGU,RegOffset) = tempReg;\r
+               return CGU_ERROR_SUCCESS;\r
+       }\r
+       return CGU_ERROR_INVALID_ENTITY;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable clock entity\r
+ * @param[in]  ClockEntity     Clock entity, should be:\r
+ *                                     - CGU_CLKSRC_32KHZ_OSC          :32Khz oscillator\r
+ *                                     - CGU_CLKSRC_IRC                        :IRC clock\r
+ *                                     - CGU_CLKSRC_ENET_RX_CLK        :Ethernet receive clock\r
+ *                                     - CGU_CLKSRC_ENET_TX_CLK        :Ethernet transmit clock\r
+ *                                     - CGU_CLKSRC_GP_CLKIN           :General purpose input clock\r
+ *                                     - CGU_CLKSRC_XTAL_OSC           :Crystal oscillator\r
+ *                                     - CGU_CLKSRC_PLL0                       :PLL0 clock\r
+ *                                     - CGU_CLKSRC_PLL1                       :PLL1 clock\r
+ *                                     - CGU_CLKSRC_IDIVA                      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB                      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC                      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD                      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE                      :Integer divider register E\r
+ *                                     - CGU_BASE_SAFE                         :Base safe clock (always on)for WDT\r
+ *                                     - CGU_BASE_USB0                         :Base clock for USB0\r
+ *                                     - CGU_BASE_USB1                         :Base clock for USB1\r
+ *                                     - CGU_BASE_M3                           :System base clock for ARM Cortex-M3 core\r
+ *                                                                                              and APB peripheral blocks #0 and #2\r
+ *                                     - CGU_BASE_SPIFI                        :Base clock for SPIFI\r
+ *                                     - CGU_BASE_PHY_RX                       :Base clock for Ethernet PHY Rx\r
+ *                                     - CGU_BASE_PHY_TX                       :Base clock for Ethernet PHY Tx\r
+ *                                     - CGU_BASE_APB1                         :Base clock for APB peripheral block #1\r
+ *                                     - CGU_BASE_APB3                         :Base clock for APB peripheral block #3\r
+ *                                     - CGU_BASE_LCD                          :Base clock for LCD\r
+ *                                     - CGU_BASE_SDIO                         :Base clock for SDIO card reader\r
+ *                                     - CGU_BASE_SSP0                         :Base clock for SSP0\r
+ *                                     - CGU_BASE_SSP1                         :Base clock for SSP1\r
+ *                                     - CGU_BASE_UART0                        :Base clock for UART0\r
+ *                                     - CGU_BASE_UART1                        :Base clock for UART1\r
+ *                                     - CGU_BASE_UART2                        :Base clock for UART2\r
+ *                                     - CGU_BASE_UART3                        :Base clock for UART3\r
+ *                                     - CGU_BASE_CLKOUT                       :Base clock for CLKOUT pin\r
+ * @param[in]  en status, should be:\r
+ *                                     - ENABLE: Enable power\r
+ *                                     - DISABLE: Disable power\r
+ * @return             Setting status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - CGU_ERROR_INVALID_ENTITY: Invalid entity\r
+ **********************************************************************/\r
+uint32_t CGU_EnableEntity(CGU_ENTITY_T ClockEntity, uint32_t en){\r
+       int32_t RegOffset;\r
+       int32_t i;\r
+       if(ClockEntity == CGU_CLKSRC_32KHZ_OSC){\r
+               if(en){\r
+                       LPC_CREG->CREG0 &= ~((1<<3)|(1<<2));\r
+                       LPC_CREG->CREG0 |= (1<<1)|(1<<0);\r
+               }else{\r
+                       LPC_CREG->CREG0 &= ~((1<<1)|(1<<0));\r
+                       LPC_CREG->CREG0 |= (1<<3);\r
+               }\r
+               for(i = 0;i<1000000;i++);\r
+\r
+       }else if(ClockEntity == CGU_CLKSRC_ENET_RX_CLK){\r
+               scu_pinmux(0xC ,0 , MD_PLN, FUNC3);\r
+\r
+       }else if(ClockEntity == CGU_CLKSRC_ENET_TX_CLK){\r
+               scu_pinmux(0x1 ,19 , MD_PLN, FUNC0);\r
+\r
+       }else if(ClockEntity == CGU_CLKSRC_GP_CLKIN){\r
+\r
+       }else if(ClockEntity == CGU_CLKSRC_TCK){\r
+\r
+       }else if(ClockEntity == CGU_CLKSRC_XTAL_OSC){\r
+               if(!en)\r
+                       LPC_CGU->XTAL_OSC_CTRL |= CGU_CTRL_EN_MASK;\r
+               else\r
+                       LPC_CGU->XTAL_OSC_CTRL &= ~CGU_CTRL_EN_MASK;\r
+               /*Delay for stable clock*/\r
+               for(i = 0;i<1000000;i++);\r
+\r
+       }else{\r
+               RegOffset = CGU_Entity_ControlReg_Offset[ClockEntity];\r
+               if(RegOffset == -1) return CGU_ERROR_INVALID_ENTITY;\r
+               if(!en){\r
+                       CGU_ADDRESS32(CGU_CGU_ADDR,RegOffset) |= CGU_CTRL_EN_MASK;\r
+               }else{\r
+                       CGU_ADDRESS32(CGU_CGU_ADDR,RegOffset) &= ~CGU_CTRL_EN_MASK;\r
+                       /*if PLL is selected check if it is locked */\r
+                       if(ClockEntity == CGU_CLKSRC_PLL0){\r
+                               while((LPC_CGU->PLL0USB_STAT&1) == 0x0);\r
+                       }\r
+                       if(ClockEntity == CGU_CLKSRC_PLL1){\r
+                               while((LPC_CGU->PLL1_STAT&1) == 0x0);\r
+                               /*post check lock status */\r
+                               if(!(LPC_CGU->PLL1_STAT&1))\r
+                                       while(1);\r
+                       }\r
+               }\r
+       }\r
+       return CGU_ERROR_SUCCESS;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Connect entity clock source\r
+ * @param[in]  ClockSource     Clock source, should be:\r
+ *                                     - CGU_CLKSRC_32KHZ_OSC          :32Khz oscillator\r
+ *                                     - CGU_CLKSRC_IRC                        :IRC clock\r
+ *                                     - CGU_CLKSRC_ENET_RX_CLK        :Ethernet receive clock\r
+ *                                     - CGU_CLKSRC_ENET_TX_CLK        :Ethernet transmit clock\r
+ *                                     - CGU_CLKSRC_GP_CLKIN           :General purpose input clock\r
+ *                                     - CGU_CLKSRC_XTAL_OSC           :Crystal oscillator\r
+ *                                     - CGU_CLKSRC_PLL0                       :PLL0 clock\r
+ *                                     - CGU_CLKSRC_PLL1                       :PLL1 clock\r
+ *                                     - CGU_CLKSRC_IDIVA                      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB                      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC                      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD                      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE                      :Integer divider register E\r
+ * @param[in]  ClockEntity     Clock entity, should be:\r
+ *                                     - CGU_CLKSRC_PLL0                       :PLL0 clock\r
+ *                                     - CGU_CLKSRC_PLL1                       :PLL1 clock\r
+ *                                     - CGU_CLKSRC_IDIVA                      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB                      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC                      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD                      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE                      :Integer divider register E\r
+ *                                     - CGU_BASE_SAFE                         :Base safe clock (always on)for WDT\r
+ *                                     - CGU_BASE_USB0                         :Base clock for USB0\r
+ *                                     - CGU_BASE_USB1                         :Base clock for USB1\r
+ *                                     - CGU_BASE_M3                           :System base clock for ARM Cortex-M3 core\r
+ *                                                                                              and APB peripheral blocks #0 and #2\r
+ *                                     - CGU_BASE_SPIFI                        :Base clock for SPIFI\r
+ *                                     - CGU_BASE_PHY_RX                       :Base clock for Ethernet PHY Rx\r
+ *                                     - CGU_BASE_PHY_TX                       :Base clock for Ethernet PHY Tx\r
+ *                                     - CGU_BASE_APB1                         :Base clock for APB peripheral block #1\r
+ *                                     - CGU_BASE_APB3                         :Base clock for APB peripheral block #3\r
+ *                                     - CGU_BASE_LCD                          :Base clock for LCD\r
+ *                                     - CGU_BASE_SDIO                         :Base clock for SDIO card reader\r
+ *                                     - CGU_BASE_SSP0                         :Base clock for SSP0\r
+ *                                     - CGU_BASE_SSP1                         :Base clock for SSP1\r
+ *                                     - CGU_BASE_UART0                        :Base clock for UART0\r
+ *                                     - CGU_BASE_UART1                        :Base clock for UART1\r
+ *                                     - CGU_BASE_UART2                        :Base clock for UART2\r
+ *                                     - CGU_BASE_UART3                        :Base clock for UART3\r
+ *                                     - CGU_BASE_CLKOUT                       :Base clock for CLKOUT pin\r
+ * @return             Setting status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - CGU_ERROR_CONNECT_TOGETHER: Error when 2 clock source connect together\r
+ *                                     - CGU_ERROR_INVALID_CLOCK_SOURCE: Invalid clock source error\r
+ *                                     - CGU_ERROR_INVALID_ENTITY: Invalid entity error\r
+ **********************************************************************/\r
+/* Connect one entity into clock source */\r
+uint32_t CGU_EntityConnect(CGU_ENTITY_T ClockSource, CGU_ENTITY_T ClockEntity){\r
+       int32_t RegOffset;\r
+       uint32_t tempReg;\r
+\r
+       if(ClockSource > CGU_CLKSRC_IDIVE)\r
+               return CGU_ERROR_INVALID_CLOCK_SOURCE;\r
+\r
+       if(ClockEntity >= CGU_CLKSRC_PLL0 && ClockEntity <= CGU_BASE_CLKOUT){\r
+               if(CGU_ConnectAlloc_Tbl[ClockSource][ClockEntity]){\r
+                       RegOffset = CGU_Entity_ControlReg_Offset[ClockSource];\r
+                       if(RegOffset != -1){\r
+                               if(ClockEntity<=CGU_CLKSRC_IDIVE &&\r
+                                       ClockEntity>=CGU_CLKSRC_PLL0)\r
+                               {\r
+                                       //RegOffset = (CGU_ADDRESS32(LPC_CGU,RegOffset)>>24)&0xF;\r
+                                       if(((CGU_ADDRESS32(LPC_CGU,RegOffset)>>24)& 0xF) == ClockEntity)\r
+                                               return CGU_ERROR_CONNECT_TOGETHER;\r
+                               }\r
+                       }\r
+                       RegOffset = CGU_Entity_ControlReg_Offset[ClockEntity];\r
+                       if(RegOffset == -1) return CGU_ERROR_INVALID_ENTITY;\r
+                       tempReg = CGU_ADDRESS32(LPC_CGU,RegOffset);\r
+                       tempReg &= ~CGU_CTRL_SRC_MASK;\r
+                       tempReg |= ClockSource<<24 | CGU_CTRL_AUTOBLOCK_MASK;\r
+                       CGU_ADDRESS32(LPC_CGU,RegOffset) = tempReg;\r
+                       return CGU_ERROR_SUCCESS;\r
+               }else\r
+                       return CGU_ERROR_INVALID_CLOCK_SOURCE;\r
+       }else\r
+               return CGU_ERROR_INVALID_ENTITY;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current USB PLL clock from XTAL\r
+ * @param[in]  None\r
+ * @return             Returned clock value\r
+ **********************************************************************/\r
+uint32_t CGU_SetPLL0(void){\r
+       // Setup PLL550 to generate 480MHz from 12 MHz crystal\r
+       LPC_CGU->PLL0USB_CTRL |= 1;     // Power down PLL\r
+                                               //      P                       N\r
+       LPC_CGU->PLL0USB_NP_DIV = (98<<0) | (514<<12);\r
+                                               //      SELP    SELI    SELR    MDEC\r
+       LPC_CGU->PLL0USB_MDIV = (0xB<<17)|(0x10<<22)|(0<<28)|(0x7FFA<<0);\r
+       LPC_CGU->PLL0USB_CTRL =(CGU_CLKSRC_XTAL_OSC<<24) | (0x3<<2) | (1<<4);\r
+       return CGU_ERROR_SUCCESS;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Setting PLL1\r
+ * @param[in]  mult    Multiple value\r
+ * @return             Setting status, could be:\r
+ *                                     - CGU_ERROR_SUCCESS: successful\r
+ *                                     - CGU_ERROR_INVALID_PARAM: Invalid parameter error\r
+ **********************************************************************/\r
+uint32_t       CGU_SetPLL1(uint32_t mult){\r
+       uint32_t msel=0, nsel=0, psel=0, pval=1;\r
+       uint32_t freq;\r
+       uint32_t ClkSrc = (LPC_CGU->PLL1_CTRL & CGU_CTRL_SRC_MASK)>>24;\r
+       freq = CGU_ClockSourceFrequency[ClkSrc];\r
+       freq *= mult;\r
+       msel = mult-1;\r
+\r
+       LPC_CGU->PLL1_CTRL &= ~(CGU_PLL1_FBSEL_MASK |\r
+                                                                       CGU_PLL1_BYPASS_MASK |\r
+                                                                       CGU_PLL1_DIRECT_MASK |\r
+                                                                       (0x03<<8) | (0xFF<<16) | (0x03<<12));\r
+\r
+       if(freq<156000000){\r
+               //psel is encoded such that 0=1, 1=2, 2=4, 3=8\r
+               while(2*(pval)*freq < 156000000) {\r
+                       psel++;\r
+                       pval*=2;\r
+               }\r
+//             if(2*(pval)*freq > 320000000) {\r
+//                     //THIS IS OUT OF RANGE!!!\r
+//                     //HOW DO WE ASSERT IN SAMPLE CODE?\r
+//                     //__breakpoint(0);\r
+//                     return CGU_ERROR_INVALID_PARAM;\r
+//             }\r
+               LPC_CGU->PLL1_CTRL |= (msel<<16) | (nsel<<12) | (psel<<8) | CGU_PLL1_FBSEL_MASK;\r
+       }else if(freq<320000000){\r
+               LPC_CGU->PLL1_CTRL |= (msel<<16) | (nsel<<12) | (psel<<8) |CGU_PLL1_DIRECT_MASK | CGU_PLL1_FBSEL_MASK;\r
+       }else\r
+               return CGU_ERROR_INVALID_PARAM;\r
+\r
+       return CGU_ERROR_SUCCESS;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current base status\r
+ * @param[in]  Base    Base type, should be:\r
+ *                                     - CGU_BASE_USB0                         :Base clock for USB0\r
+ *                                     - CGU_BASE_USB1                         :Base clock for USB1\r
+ *                                     - CGU_BASE_M3                           :System base clock for ARM Cortex-M3 core\r
+ *                                                                                              and APB peripheral blocks #0 and #2\r
+ *                                     - CGU_BASE_SPIFI                        :Base clock for SPIFI\r
+ *                                     - CGU_BASE_APB1                         :Base clock for APB peripheral block #1\r
+ *                                     - CGU_BASE_APB3                         :Base clock for APB peripheral block #3\r
+ *                                     - CGU_BASE_SDIO                         :Base clock for SDIO card reader\r
+ *                                     - CGU_BASE_SSP0                         :Base clock for SSP0\r
+ *                                     - CGU_BASE_SSP1                         :Base clock for SSP1\r
+ *                                     - CGU_BASE_UART0                        :Base clock for UART0\r
+ *                                     - CGU_BASE_UART1                        :Base clock for UART1\r
+ *                                     - CGU_BASE_UART2                        :Base clock for UART2\r
+ *                                     - CGU_BASE_UART3                        :Base clock for UART3\r
+ * @return             Always return 0\r
+ **********************************************************************/\r
+uint32_t       CGU_GetBaseStatus(CGU_ENTITY_T Base){\r
+       switch(Base){\r
+       /*CCU1*/\r
+       case CGU_BASE_APB3:\r
+               return LPC_CCU1->BASE_STAT & 1;\r
+\r
+       case CGU_BASE_APB1:\r
+               return (LPC_CCU1->BASE_STAT>>1) & 1;\r
+\r
+       case CGU_BASE_SPIFI:\r
+               return (LPC_CCU1->BASE_STAT>>2) & 1;\r
+\r
+       case CGU_BASE_M3:\r
+               return (LPC_CCU1->BASE_STAT>>3) & 1;\r
+\r
+       case CGU_BASE_USB0:\r
+               return (LPC_CCU1->BASE_STAT>>7) & 1;\r
+\r
+       case CGU_BASE_USB1:\r
+               return (LPC_CCU1->BASE_STAT>>8) & 1;\r
+\r
+       /*CCU2*/\r
+       case CGU_BASE_UART3:\r
+               return (LPC_CCU2->BASE_STAT>>1) & 1;\r
+\r
+       case CGU_BASE_UART2:\r
+               return (LPC_CCU2->BASE_STAT>>2) & 1;\r
+\r
+       case CGU_BASE_UART1:\r
+               return (LPC_CCU2->BASE_STAT>>3) & 1;\r
+\r
+       case CGU_BASE_UART0:\r
+               return (LPC_CCU2->BASE_STAT>>4) & 1;\r
+\r
+       case CGU_BASE_SSP1:\r
+               return (LPC_CCU2->BASE_STAT>>5) & 1;\r
+\r
+       case CGU_BASE_SSP0:\r
+               return (LPC_CCU2->BASE_STAT>>6) & 1;\r
+\r
+       case CGU_BASE_SDIO:\r
+               return (LPC_CCU2->BASE_STAT>>7) & 1;\r
+\r
+       /*BASE SAFE is used by WWDT and RGU*/\r
+       case CGU_BASE_SAFE:\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       return 0;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Compare one source clock to IRC clock\r
+ * @param[in]  Clock   Clock entity that will be compared to IRC, should be:\r
+ *                                     - CGU_CLKSRC_32KHZ_OSC          :32Khz crystal oscillator\r
+ *                                     - CGU_CLKSRC_ENET_RX_CLK        :Ethernet receive clock\r
+ *                                     - CGU_CLKSRC_ENET_TX_CLK        :Ethernet transmit clock\r
+ *                                     - CGU_CLKSRC_GP_CLKIN           :General purpose input clock\r
+ *                                     - CGU_CLKSRC_XTAL_OSC           :Crystal oscillator\r
+ *                                     - CGU_CLKSRC_PLL0                       :PLL0 clock\r
+ *                                     - CGU_CLKSRC_PLL1                       :PLL1 clock\r
+ *                                     - CGU_CLKSRC_IDIVA                      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB                      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC                      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD                      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE                      :Integer divider register E\r
+ *                                     - CGU_BASE_SAFE                         :Base safe clock (always on)for WDT\r
+ *                                     - CGU_BASE_USB0                         :Base clock for USB0\r
+ *                                     - CGU_BASE_USB1                         :Base clock for USB1\r
+ *                                     - CGU_BASE_M3                           :System base clock for ARM Cortex-M3 core\r
+ *                                                                                              and APB peripheral blocks #0 and #2\r
+ *                                     - CGU_BASE_SPIFI                        :Base clock for SPIFI\r
+ *                                     - CGU_BASE_PHY_RX                       :Base clock for Ethernet PHY Rx\r
+ *                                     - CGU_BASE_PHY_TX                       :Base clock for Ethernet PHY Tx\r
+ *                                     - CGU_BASE_APB1                         :Base clock for APB peripheral block #1\r
+ *                                     - CGU_BASE_APB3                         :Base clock for APB peripheral block #3\r
+ *                                     - CGU_BASE_LCD                          :Base clock for LCD\r
+ *                                     - CGU_BASE_SDIO                         :Base clock for SDIO card reader\r
+ *                                     - CGU_BASE_SSP0                         :Base clock for SSP0\r
+ *                                     - CGU_BASE_SSP1                         :Base clock for SSP1\r
+ *                                     - CGU_BASE_UART0                        :Base clock for UART0\r
+ *                                     - CGU_BASE_UART1                        :Base clock for UART1\r
+ *                                     - CGU_BASE_UART2                        :Base clock for UART2\r
+ *                                     - CGU_BASE_UART3                        :Base clock for UART3\r
+ *                                     - CGU_BASE_CLKOUT                       :Base clock for CLKOUT pin\r
+ * @param[in]  m       Multiple value pointer\r
+ * @param[in]  d       Divider value pointer\r
+ * @return             Compare status, could be:\r
+ *                                     - (-1): fail\r
+ *                                     - 0: successful\r
+ * @note               Formula used to compare:\r
+ *                             FClock = F_IRC* m / d\r
+ **********************************************************************/\r
+int CGU_FrequencyMonitor(CGU_ENTITY_T Clock, uint32_t *m, uint32_t *d){\r
+       uint32_t n,c,temp;\r
+       int i;\r
+\r
+       /* Maximum allow RCOUNT number */\r
+       c= 511;\r
+       /* Check Source Clock Freq is larger or smaller */\r
+       LPC_CGU->FREQ_MON = (Clock<<24) | 1<<23 | c;\r
+       while(LPC_CGU->FREQ_MON & (1 <<23));\r
+       for(i=0;i<10000;i++);\r
+       temp = (LPC_CGU->FREQ_MON >>9) & 0x3FFF;\r
+\r
+       if(temp == 0) /* too low F < 12000000/511*/\r
+               return -1;\r
+       if(temp > 511){ /* larger */\r
+\r
+               c = 511 - (LPC_CGU->FREQ_MON&0x1FF);\r
+       }else{\r
+               do{\r
+                       c--;\r
+                       LPC_CGU->FREQ_MON = (Clock<<24) | 1<<23 | c;\r
+                       while(LPC_CGU->FREQ_MON & (1 <<23));\r
+                       for(i=0;i<10000;i++);\r
+                       n = (LPC_CGU->FREQ_MON >>9) & 0x3FFF;\r
+               }while(n==temp);\r
+               c++;\r
+       }\r
+       *m = temp;\r
+       *d = c;\r
+       return 0;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Compare one source clock to another source clock\r
+ * @param[in]  Clock   Clock entity that will be compared to second source, should be:\r
+ *                                     - CGU_CLKSRC_32KHZ_OSC          :32Khz crystal oscillator\r
+ *                                     - CGU_CLKSRC_ENET_RX_CLK        :Ethernet receive clock\r
+ *                                     - CGU_CLKSRC_ENET_TX_CLK        :Ethernet transmit clock\r
+ *                                     - CGU_CLKSRC_GP_CLKIN           :General purpose input clock\r
+ *                                     - CGU_CLKSRC_XTAL_OSC           :Crystal oscillator\r
+ *                                     - CGU_CLKSRC_PLL0                       :PLL0 clock\r
+ *                                     - CGU_CLKSRC_PLL1                       :PLL1 clock\r
+ *                                     - CGU_CLKSRC_IDIVA                      :Integer divider register A\r
+ *                                     - CGU_CLKSRC_IDIVB                      :Integer divider register B\r
+ *                                     - CGU_CLKSRC_IDIVC                      :Integer divider register C\r
+ *                                     - CGU_CLKSRC_IDIVD                      :Integer divider register D\r
+ *                                     - CGU_CLKSRC_IDIVE                      :Integer divider register E\r
+ *                                     - CGU_BASE_SAFE                         :Base safe clock (always on)for WDT\r
+ *                                     - CGU_BASE_USB0                         :Base clock for USB0\r
+ *                                     - CGU_BASE_USB1                         :Base clock for USB1\r
+ *                                     - CGU_BASE_M3                           :System base clock for ARM Cortex-M3 core\r
+ *                                                                                              and APB peripheral blocks #0 and #2\r
+ *                                     - CGU_BASE_SPIFI                        :Base clock for SPIFI\r
+ *                                     - CGU_BASE_PHY_RX                       :Base clock for Ethernet PHY Rx\r
+ *                                     - CGU_BASE_PHY_TX                       :Base clock for Ethernet PHY Tx\r
+ *                                     - CGU_BASE_APB1                         :Base clock for APB peripheral block #1\r
+ *                                     - CGU_BASE_APB3                         :Base clock for APB peripheral block #3\r
+ *                                     - CGU_BASE_LCD                          :Base clock for LCD\r
+ *                                     - CGU_BASE_SDIO                         :Base clock for SDIO card reader\r
+ *                                     - CGU_BASE_SSP0                         :Base clock for SSP0\r
+ *                                     - CGU_BASE_SSP1                         :Base clock for SSP1\r
+ *                                     - CGU_BASE_UART0                        :Base clock for UART0\r
+ *                                     - CGU_BASE_UART1                        :Base clock for UART1\r
+ *                                     - CGU_BASE_UART2                        :Base clock for UART2\r
+ *                                     - CGU_BASE_UART3                        :Base clock for UART3\r
+ *                                     - CGU_BASE_CLKOUT                       :Base clock for CLKOUT pin\r
+ * @param[in]  CompareToClock  Clock source that to be compared to first source, should be different\r
+ *                             to first source.\r
+ * @param[in]  m       Multiple value pointer\r
+ * @param[in]  d       Divider value pointer\r
+ * @return             Compare status, could be:\r
+ *                                     - (-1): fail\r
+ *                                     - 0: successful\r
+ * @note               Formula used to compare:\r
+ *                             FClock = m*FCompareToClock/d\r
+ **********************************************************************/\r
+uint32_t CGU_RealFrequencyCompare(CGU_ENTITY_T Clock, CGU_ENTITY_T CompareToClock, uint32_t *m, uint32_t *d){\r
+       uint32_t m1,m2,d1,d2;\r
+       /* Check Parameter */\r
+       if((Clock>CGU_CLKSRC_IDIVE) || (CompareToClock>CGU_CLKSRC_IDIVE))\r
+               return CGU_ERROR_INVALID_PARAM;\r
+       /* Check for Clock Enable - Not yet implement\r
+        * The Comparator will hang if Clock has not been set*/\r
+       CGU_FrequencyMonitor(Clock, &m1, &d1);\r
+       CGU_FrequencyMonitor(CompareToClock, &m2, &d2);\r
+       *m= m1*d2;\r
+       *d= d1*m2;\r
+       return 0;\r
+\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_dac.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_dac.c
new file mode 100644 (file)
index 0000000..11e86d9
--- /dev/null
@@ -0,0 +1,147 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_dac.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_dac.c\r
+* @brief       Contains all functions support for DAC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup DAC\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_dac.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _DAC\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup DAC_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initial ADC configuration\r
+ *                                     - Maximum       current is 700 uA\r
+ *                                     - Value to AOUT is 0\r
+ * @param[in]  DACx pointer to LPC_DAC_Type, should be: LPC_DAC\r
+ * @return             None\r
+ ***********************************************************************/\r
+void DAC_Init(LPC_DAC_Type *DACx)\r
+{\r
+       CHECK_PARAM(PARAM_DACx(DACx));\r
+       /* Set default clock divider for DAC */\r
+       //LPC_CGU->BASE_VPB3_CLK = (SRC_PL160M_0<<24) | (1<<11);        // ABP3 base clock use PLL1 and auto block\r
+       CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_APB3);\r
+       //Set maximum current output\r
+       DAC_SetBias(LPC_DAC,DAC_MAX_CURRENT_700uA);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Update value to DAC\r
+ * @param[in]  DACx pointer to LPC_DAC_Type, should be: LPC_DAC\r
+ * @param[in]  dac_value  value 10 bit to be converted to output\r
+ * @return             None\r
+ ***********************************************************************/\r
+void DAC_UpdateValue (LPC_DAC_Type *DACx,uint32_t dac_value)\r
+{\r
+       uint32_t tmp;\r
+       CHECK_PARAM(PARAM_DACx(DACx));\r
+       tmp = DACx->CR & DAC_BIAS_EN;\r
+       tmp |= DAC_VALUE(dac_value);\r
+       // Update value\r
+       DACx->CR = tmp;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Maximum current for DAC\r
+ * @param[in]  DACx pointer to LPC_DAC_Type, should be: LPC_DAC\r
+ * @param[in]  bias    Using Bias value, should be:\r
+ *                             - 0 is 700 uA\r
+ *                             - 1 is 350 uA\r
+ * @return             None\r
+ ***********************************************************************/\r
+void DAC_SetBias (LPC_DAC_Type *DACx,uint32_t bias)\r
+{\r
+       CHECK_PARAM(PARAM_DAC_CURRENT_OPT(bias));\r
+       DACx->CR &=~DAC_BIAS_EN;\r
+       if (bias  == DAC_MAX_CURRENT_350uA)\r
+       {\r
+               DACx->CR |= DAC_BIAS_EN;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              To enable the DMA operation and control DMA timer\r
+ * @param[in]  DACx pointer to LPC_DAC_Type, should be: LPC_DAC\r
+ * @param[in]  DAC_ConverterConfigStruct pointer to DAC_CONVERTER_CFG_Type\r
+ *                                     - DBLBUF_ENA :enable/disable DACR double buffering feature\r
+ *                                     - CNT_ENA    :enable/disable timer out counter\r
+ *                                     - DMA_ENA    :enable/disable DMA access\r
+ * @return             None\r
+ ***********************************************************************/\r
+void DAC_ConfigDAConverterControl (LPC_DAC_Type *DACx,DAC_CONVERTER_CFG_Type *DAC_ConverterConfigStruct)\r
+{\r
+       CHECK_PARAM(PARAM_DACx(DACx));\r
+       DACx->CTRL &= ~DAC_DACCTRL_MASK;\r
+       if (DAC_ConverterConfigStruct->DBLBUF_ENA)\r
+               DACx->CTRL      |= DAC_DBLBUF_ENA;\r
+       if (DAC_ConverterConfigStruct->CNT_ENA)\r
+               DACx->CTRL      |= DAC_CNT_ENA;\r
+       if (DAC_ConverterConfigStruct->DMA_ENA)\r
+               DACx->CTRL      |= DAC_DMA_ENA;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set reload value for interrupt/DMA counter\r
+ * @param[in]  DACx pointer to LPC_DAC_Type, should be: LPC_DAC\r
+ * @param[in]  time_out time out to reload for interrupt/DMA counter\r
+ * @return             None\r
+ ***********************************************************************/\r
+void DAC_SetDMATimeOut(LPC_DAC_Type *DACx, uint32_t time_out)\r
+{\r
+       CHECK_PARAM(PARAM_DACx(DACx));\r
+       DACx->CNTVAL = DAC_CCNT_VALUE(time_out);\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _DAC */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_emc.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_emc.c
new file mode 100644 (file)
index 0000000..88dadbf
--- /dev/null
@@ -0,0 +1,233 @@
+/**********************************************************************
+* $Id: lpc18xx_emc.c 8765 2011-12-08 00:51:21Z nxp21346 $              lpc18xx_emc.c           2011-12-07
+*//**
+* @file                lpc18xx_emc.c
+* @brief       Contains all functions support for Clock Generation and Control
+*                      firmware library on lpc18xx
+* @version     1.0
+* @date                07. December. 2011
+* @author      NXP MCU SW Application Team
+*
+* Copyright(C) 2011, NXP Semiconductor
+* All rights reserved.
+*
+***********************************************************************
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+
+#include "LPC18xx.h"
+#include "lpc18xx_emc.h"
+#include "lpc18xx_scu.h"
+
+#define M32(x) *((uint32_t *)x)
+#define DELAYCYCLES(ns) (ns / ((1.0 / __EMCHZ) * 1E9))
+
+void emc_WaitUS(volatile uint32_t us)
+{
+       us *= (SystemCoreClock / 1000000) / 3;
+       while(us--);
+}
+
+void emc_WaitMS(uint32_t ms)
+{
+       emc_WaitUS(ms * 1000);
+}
+
+void MemoryPinInit(void)
+{
+  /* select correct functions on the GPIOs */
+
+#if 1
+  /* DATA LINES 0..31 > D0..D31 */
+       /* P1_7 - EXTBUS_D0 \97 External memory data line 0 */
+    scu_pinmux(0x1,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_7: D0 (function 0) errata */
+    scu_pinmux(0x1,  8,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_8: D1 (function 0) errata */
+    scu_pinmux(0x1,  9,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_9: D2 (function 0) errata */
+    scu_pinmux(0x1,  10, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_10: D3 (function 0) errata */
+    scu_pinmux(0x1,  11, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_11: D4 (function 0) errata */
+    scu_pinmux(0x1,  12, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_12: D5 (function 0) errata */
+    scu_pinmux(0x1,  13, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_13: D6 (function 0) errata */
+    scu_pinmux(0x1,  14, (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_14: D7 (function 0) errata */
+    scu_pinmux(0x5,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_4: D8 (function 0) errata */
+    scu_pinmux(0x5,  5,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_5: D9 (function 0) errata */
+    scu_pinmux(0x5,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_6: D10 (function 0) errata */
+    scu_pinmux(0x5,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_7: D11 (function 0) errata */
+    scu_pinmux(0x5,  0,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_0: D12 (function 0) errata */
+    scu_pinmux(0x5,  1,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_1: D13 (function 0) errata */
+    scu_pinmux(0x5,  2,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_2: D14 (function 0) errata */
+    scu_pinmux(0x5,  3,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* P5_3: D15 (function 0) errata */
+#if 0
+    scu_pinmux(0xD,  2,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_2: D16 (function 0) errata */
+    scu_pinmux(0xD,  3,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_3: D17 (function 0) errata */
+    scu_pinmux(0xD,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_4: D18 (function 0) errata */
+    scu_pinmux(0xD,  5,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_5: D19 (function 0) errata */
+    scu_pinmux(0xD,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_6: D20 (function 0) errata */
+    scu_pinmux(0xD,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_7: D21 (function 0) errata */
+    scu_pinmux(0xD,  8,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_8: D22 (function 0) errata */
+    scu_pinmux(0xD,  9,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_9: D23 (function 0) errata */
+    scu_pinmux(0xE,  5,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_5: D24 (function 0) errata */
+    scu_pinmux(0xE,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_6: D25 (function 0) errata */
+    scu_pinmux(0xE,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_7: D26 (function 0) errata */
+    scu_pinmux(0xE,  8,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_8: D27 (function 0) errata */
+    scu_pinmux(0xE,  9,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_9: D28 (function 0) errata */
+    scu_pinmux(0xE, 10,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_10: D29 (function 0) errata */
+    scu_pinmux(0xE, 11,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_11: D30 (function 0) errata */
+    scu_pinmux(0xE, 12,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_12: D31 (function 0) errata */
+#endif
+  
+  /* ADDRESS LINES A0..A11 > A0..A11 */
+       scu_pinmux(0x2,  9,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_9 - EXTBUS_A0 \97 External memory address line 0 */
+       scu_pinmux(0x2, 10,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_10 - EXTBUS_A1 \97 External memory address line 1 */        
+       scu_pinmux(0x2, 11,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_11 - EXTBUS_A2 \97 External memory address line 2 */        
+       scu_pinmux(0x2, 12,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_12 - EXTBUS_A3 \97 External memory address line 3 */
+       scu_pinmux(0x2, 13,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_13 - EXTBUS_A4 \97 External memory address line 4 */        
+       scu_pinmux(0x1,  0,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P1_0 - EXTBUS_A5 \97 External memory address line 5 */
+       scu_pinmux(0x1,  1,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P1_1 - EXTBUS_A6 \97 External memory address line 6 */ 
+       scu_pinmux(0x1,  2,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P1_2 - EXTBUS_A7 \97 External memory address line 7 */ 
+       scu_pinmux(0x2,  8,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_8 - EXTBUS_A8 \97 External memory address line 8 */
+       scu_pinmux(0x2,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P2_7 - EXTBUS_A9 \97 External memory address line 9 */ 
+       scu_pinmux(0x2,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P2_6 - EXTBUS_A10 \97 External memory address line 10 */
+       scu_pinmux(0x2,  2,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P2_2 - EXTBUS_A11 \97 External memory address line 11 */
+       scu_pinmux(0x2,  1,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P2_1 - EXTBUS_A12 \97 External memory address line 12 */
+       scu_pinmux(0x2,  0,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* P2_0 - EXTBUS_A13 \97 External memory address line 13 */       
+       scu_pinmux(0x6,  8,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);        /* P6_8 - EXTBUS_A14 \97 External memory address line 14 */
+       scu_pinmux(0x6,  7,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);        /* P6_7 - EXTBUS_A15 \97 External memory address line 15 */       
+       scu_pinmux(0xD, 16,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* PD_16 - EXTBUS_A16 \97 External memory address line 16 */
+       scu_pinmux(0xD, 15,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* PD_15 - EXTBUS_A17 \97 External memory address line 17 */      
+       scu_pinmux(0xE,  0,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PE_0 - EXTBUS_A18 \97 External memory address line 18 */
+       scu_pinmux(0xE,  1,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PE_1 - EXTBUS_A19 \97 External memory address line 19 */
+       scu_pinmux(0xE,  2,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PE_2 - EXTBUS_A20 \97 External memory address line 20 */
+       scu_pinmux(0xE,  3,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PE_3 - EXTBUS_A21 \97 External memory address line 21 */
+       scu_pinmux(0xE,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PE_4 - EXTBUS_A22 \97 External memory address line 22 */       
+       scu_pinmux(0xA,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* PA_4 - EXTBUS_A23 \97 External memory address line 23 */
+
+  /* BYTE ENABLES */
+       scu_pinmux(0x1,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);        /* P1_4 - EXTBUS_BLS0 \97 LOW active Byte Lane select signal 0 */
+       scu_pinmux(0x6,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC1);        /* P6_6 - EXTBUS_BLS1 \97 LOW active Byte Lane select signal 1 */ 
+       scu_pinmux(0xD, 13,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* PD_13 - EXTBUS_BLS2 \97 LOW active Byte Lane select signal 2 */
+       scu_pinmux(0xD, 10,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);        /* PD_10 - EXTBUS_BLS3 \97 LOW active Byte Lane select signal 3 */                
+    
+    scu_pinmux(0x6,  9,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_9: EXTBUS_DYCS0  (function 0) > CS# errata */
+    scu_pinmux(0x1,  6,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P1_6: WE (function 0) errata */
+    scu_pinmux(0x6,  4,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_4: CAS  (function 0) > CAS# errata */
+    scu_pinmux(0x6,  5,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_5: RAS  (function 0) > RAS# errata */
+
+       LPC_SCU_CLK(0) = 0 + (MD_PLN | MD_EZI | MD_ZI | MD_EHS); /* SFSCLK0: EXTBUS_CLK0  (function 0, from datasheet) > CLK ds */
+    LPC_SCU_CLK(1) = 0 + (MD_PLN | MD_EZI | MD_ZI | MD_EHS); /* SFSCLK1: EXTBUS_CLK1  (function 2, from datasheet) */
+    LPC_SCU_CLK(2) = 0 + (MD_PLN | MD_EZI | MD_ZI | MD_EHS); /* SFSCLK2: EXTBUS_CLK2  (function 2, from datasheet) */
+    LPC_SCU_CLK(3) = 0 + (MD_PLN | MD_EZI | MD_ZI | MD_EHS); /* SFSCLK3: EXTBUS_CLK3  (function 2, from datasheet) */
+
+    scu_pinmux(0x6, 11,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_11: CKEOUT0  (function 0) > CKE errata */
+    scu_pinmux(0x6, 12,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_12: DQMOUT0  (function 0) > DQM0 errata */
+    scu_pinmux(0x6, 10,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* P6_10: DQMOUT1  (function 0) > DQM1 errata */
+    scu_pinmux(0xD,  0,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC2);  /* PD_0: DQMOUT2  (function 2, from datasheet) > DQM2 errata */
+    scu_pinmux(0xE, 13,  (MD_PLN | MD_EZI | MD_ZI | MD_EHS), FUNC3);  /* PE_13: DQMOUT3  (function 3, from datasheet) > DQM3 errata */
+
+       scu_pinmux(     1       ,       3       ,       MD_PLN_FAST     ,       3       );      //OE
+       scu_pinmux(     1       ,       4       ,       MD_PLN_FAST     ,       3       );      //BLS0
+       scu_pinmux(     1       ,       5       ,       MD_PLN_FAST     ,       3       );      //CS0
+       scu_pinmux(     1       ,       6       ,       MD_PLN_FAST     ,       3       );      //WE
+
+#endif
+}
+
+void EMCFlashInit(void)
+{
+       // Hitex board SST39VF3201B Flash
+       // Read Cycle Time 70 nS minimum
+       // Chip Enable Access Time 70 ns maximum
+       // Address Access Time 70 ns max
+       // Toe 35 ns max
+       // CE/OE high to inactive output 16 ns
+
+       /* Set up EMC Controller */
+       LPC_EMC->STATICWAITRD0 = DELAYCYCLES(70)+1;
+
+       LPC_EMC->STATICWAITPAG0 = DELAYCYCLES(70)+1;
+
+
+       LPC_EMC->CONTROL = 0x01;
+       LPC_EMC->STATICCONFIG0 = (1UL<<7) | (1UL);
+       LPC_EMC->STATICWAITOEN0 = DELAYCYCLES(35)+1;
+
+    /*Enable Buffer for External Flash*/
+    LPC_EMC->STATICCONFIG0 |= 1<<19;
+}
+
+/* SDRAM refresh time to 16 clock num */
+#define EMC_SDRAM_REFRESH(freq,time)  \
+  (((uint64_t)((uint64_t)time * freq)/16000000000ull)+1)
+
+void vEMC_InitSRDRAM(uint32_t u32BaseAddr, uint32_t u32Width, uint32_t u32Size, uint32_t u32DataBus, uint32_t u32ColAddrBits)
+{
+   // adjust the CCU delaye for EMI (default to zero)
+    //LPC_SCU->EMCCLKDELAY = (CLK0_DELAY | (CLKE0_DELAY << 16));
+       // Move all clock delays together
+       LPC_SCU->EMCDELAYCLK = ((CLK0_DELAY) 
+                                                |  (CLK0_DELAY << 4)
+                                                |  (CLK0_DELAY << 8)
+                                                |  (CLK0_DELAY << 12));
+
+   /* Initialize EMC to interface with SDRAM */
+       LPC_EMC->CONTROL                        = 0x00000001;   /* Enable the external memory controller */     
+       LPC_EMC->CONFIG                         = 0;
+
+       LPC_EMC->DYNAMICCONFIG0         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14));
+       LPC_EMC->DYNAMICCONFIG2         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14));
+
+    LPC_EMC->DYNAMICRASCAS0    = (3 << 0) | (3 << 8);      // aem
+    LPC_EMC->DYNAMICRASCAS2    = (3 << 0) | (3 << 8);  // aem
+       
+       LPC_EMC->DYNAMICREADCONFIG      = EMC_COMMAND_DELAYED_STRATEGY;
+       
+       LPC_EMC->DYNAMICRP                      = 1;    // calculated from xls sheet
+       LPC_EMC->DYNAMICRAS             = 3;
+       LPC_EMC->DYNAMICSREX            = 5;   
+       LPC_EMC->DYNAMICAPR             = 0;
+       LPC_EMC->DYNAMICDAL             = 4;
+       LPC_EMC->DYNAMICWR                      = 1;
+       LPC_EMC->DYNAMICRC                      = 5;   
+       LPC_EMC->DYNAMICRFC             = 5;   
+       LPC_EMC->DYNAMICXSR             = 5;   
+       LPC_EMC->DYNAMICRRD             = 1;
+       LPC_EMC->DYNAMICMRD             = 1;
+       
+       LPC_EMC->DYNAMICCONTROL         = EMC_CE_ENABLE | EMC_CS_ENABLE | EMC_INIT(EMC_NOP);
+       emc_WaitUS(100);
+       
+       LPC_EMC->DYNAMICCONTROL         = EMC_CE_ENABLE | EMC_CS_ENABLE | EMC_INIT(EMC_PRECHARGE_ALL);
+
+       LPC_EMC->DYNAMICREFRESH         = 2;
+       emc_WaitUS(100);
+       
+    LPC_EMC->DYNAMICREFRESH    = 50;
+       
+       LPC_EMC->DYNAMICCONTROL         = EMC_CE_ENABLE | EMC_CS_ENABLE | EMC_INIT(EMC_MODE);
+
+       if(u32DataBus == 0) 
+       {
+               /* burst size 8 */
+        *((volatile uint32_t *)(u32BaseAddr | ((3 | (3 << 4)) << (u32ColAddrBits + 1))));
+       }
+       else 
+       {
+               /* burst size 4 */
+               *((volatile uint32_t *)(u32BaseAddr | ((2UL | (2UL << 4)) << (u32ColAddrBits + 2))));
+       }
+
+       LPC_EMC->DYNAMICCONTROL         = 0; // EMC_CE_ENABLE | EMC_CS_ENABLE;
+       LPC_EMC->DYNAMICCONFIG0         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14)) | EMC_B_ENABLE;
+       LPC_EMC->DYNAMICCONFIG1         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14)) | EMC_B_ENABLE;
+       LPC_EMC->DYNAMICCONFIG2         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14)) | EMC_B_ENABLE;
+       LPC_EMC->DYNAMICCONFIG3         = ((u32Width << 7) | (u32Size << 9) | (1UL << 12) | (u32DataBus << 14)) | EMC_B_ENABLE;
+}
+
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_evrt.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_evrt.c
new file mode 100644 (file)
index 0000000..56ba72b
--- /dev/null
@@ -0,0 +1,258 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_evrt.c          2011-06-02\r
+*//**\r
+* @file                lpc18xx_evrt.c\r
+* @brief       Contains all functions support for Event Router firmware\r
+*                      library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup EVRT\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_evrt.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup EVRT_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initializes the EVRT peripheral.\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be: LPC_EVRT\r
+ * @return             None\r
+ *********************************************************************/\r
+void EVRT_Init (LPC_EVENTROUTER_Type *EVRTx)\r
+{\r
+       uint8_t i=0;\r
+\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+\r
+       // Clear all register to be default\r
+       EVRTx->HILO             = 0x0000;\r
+       EVRTx->EDGE             = 0x0000;\r
+       EVRTx->CLR_EN   = 0xFFFF;\r
+       do\r
+       {\r
+               i++;\r
+               EVRTx->CLR_STAT         = 0xFFFFF;\r
+       }while((EVRTx->STATUS != 0)&&(i<10));\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-initializes the EVRT peripheral registers to their\r
+*                  default reset values.\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be: LPC_EVRT\r
+ * @return             None\r
+ **********************************************************************/\r
+void EVRT_DeInit(LPC_EVENTROUTER_Type *EVRTx)\r
+{\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+\r
+       EVRTx->CLR_EN   = 0xFFFF;\r
+       EVRTx->CLR_STAT         = 0xFFFF;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Setting up the type of interrupt sources to EVRT\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be: LPC_EVRT\r
+ * @param[in]  EVRT_Src        EVRT source, should be:\r
+ *                                     - EVRT_SRC_WAKEUP0                      :WAKEUP0 event\r
+ *                                     - EVRT_SRC_WAKEUP1                      :WAKEUP1 event\r
+ *                                     - EVRT_SRC_WAKEUP2                      :WAKEUP2 event\r
+ *                                     - EVRT_SRC_WAKEUP3                      :WAKEUP3 event\r
+ *                                     - EVRT_SRC_ATIMER                       :Alarm timer eveny\r
+ *                                     - EVRT_SRC_RTC                          :RTC event\r
+ *                                     - EVRT_SRC_BOD                          :BOD event\r
+ *                                     - EVRT_SRC_WWDT                         :WWDT event\r
+ *                                     - EVRT_SRC_ETHERNET                     :ETHERNET event\r
+ *                                     - EVRT_SRC_USB0                         :USB0 event\r
+ *                                     - EVRT_SRC_USB1                         :USB1 event\r
+ *                                     - EVRT_SRC_CCAN                         :CCAN event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER2       :Combined timer output 2 event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER6       :Combined timer output 6 event\r
+ *                                     - EVRT_SRC_QEI                          :QEI event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER14      :Combined timer output 14 event\r
+ *                                     - EVRT_SRC_RESET                        :RESET event\r
+ *                             type    Active type, should be:\r
+ *                                     - EVRT_SRC_ACTIVE_LOW_LEVEL             :Active low level\r
+ *                                     - EVRT_SRC_ACTIVE_HIGH_LEVEL    :Active high level\r
+ *                                     - EVRT_SRC_ACTIVE_FALLING_EDGE  :Active falling edge\r
+ *                                     - EVRT_SRC_ACTIVE_RISING_EDGE   :Active rising edge\r
+ * @param[in]  type    EVRT source active type, should be:\r
+ *                                     -       EVRT_SRC_ACTIVE_LOW_LEVEL               :Active low level\r
+ *                                     -       EVRT_SRC_ACTIVE_HIGH_LEVEL              :Active high level\r
+ *                                     -       EVRT_SRC_ACTIVE_FALLING_EDGE    :Active falling edge\r
+ *                                     -       EVRT_SRC_ACTIVE_RISING_EDGE             :Active rising edge\r
+ * @return             None\r
+ **********************************************************************/\r
+void EVRT_ConfigIntSrcActiveType(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, EVRT_SRC_ACTIVE_TYPE type)\r
+{\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+       CHECK_PARAM(PARAM_EVRT_SOURCE(EVRT_Src));\r
+       CHECK_PARAM(PARAM_EVRT_SOURCE_ACTIVE_TYPE(type));\r
+\r
+       switch (type)\r
+       {\r
+               case EVRT_SRC_ACTIVE_LOW_LEVEL:\r
+                       EVRTx->HILO &= ~(1<<(uint8_t)EVRT_Src);\r
+                       EVRTx->EDGE &= ~(1<<(uint8_t)EVRT_Src);\r
+                       break;\r
+               case EVRT_SRC_ACTIVE_HIGH_LEVEL:\r
+                       EVRTx->HILO |= (1<<(uint8_t)EVRT_Src);\r
+                       EVRTx->EDGE &= ~(1<<(uint8_t)EVRT_Src);\r
+                       break;\r
+               case EVRT_SRC_ACTIVE_FALLING_EDGE:\r
+                       EVRTx->HILO &= ~(1<<(uint8_t)EVRT_Src);\r
+                       EVRTx->EDGE |= (1<<(uint8_t)EVRT_Src);\r
+                       break;\r
+               case EVRT_SRC_ACTIVE_RISING_EDGE:\r
+                       EVRTx->HILO |= (1<<(uint8_t)EVRT_Src);\r
+                       EVRTx->EDGE |= (1<<(uint8_t)EVRT_Src);\r
+                       break;\r
+               default:\r
+                       break;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable interrupt sources to EVRT\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be LPC_EVRT\r
+ * @param[in]  EVRT_Src EVRT source, should be:\r
+ *                                     - EVRT_SRC_WAKEUP0                      :WAKEUP0 event\r
+ *                                     - EVRT_SRC_WAKEUP1                      :WAKEUP1 event\r
+ *                                     - EVRT_SRC_WAKEUP2                      :WAKEUP2 event\r
+ *                                     - EVRT_SRC_WAKEUP3                      :WAKEUP3 event\r
+ *                                     - EVRT_SRC_ATIMER                       :Alarm timer eveny\r
+ *                                     - EVRT_SRC_RTC                          :RTC event\r
+ *                                     - EVRT_SRC_BOD                          :BOD event\r
+ *                                     - EVRT_SRC_WWDT                         :WWDT event\r
+ *                                     - EVRT_SRC_ETHERNET                     :ETHERNET event\r
+ *                                     - EVRT_SRC_USB0                         :USB0 event\r
+ *                                     - EVRT_SRC_USB1                         :USB1 event\r
+ *                                     - EVRT_SRC_CCAN                         :CCAN event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER2       :Combined timer output 2 event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER6       :Combined timer output 6 event\r
+ *                                     - EVRT_SRC_QEI                          :QEI event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER14      :Combined timer output 14 event\r
+ *                                     - EVRT_SRC_RESET                        :RESET event\r
+ * @param[in]  state   ENABLE or DISABLE\r
+ * @return             None\r
+ **********************************************************************/\r
+void EVRT_SetUpIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, FunctionalState state)\r
+{\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+       CHECK_PARAM(PARAM_EVRT_SOURCE(EVRT_Src));\r
+\r
+       if(state == ENABLE)\r
+               EVRTx->SET_EN = (1<<(uint8_t)EVRT_Src);\r
+       else\r
+               EVRTx->CLR_EN = (1<<(uint8_t)EVRT_Src);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check if a source is sending interrupt to EVRT\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be LPC_EVRT\r
+ * @param[in]  EVRT_Src        EVRT source, should be:\r
+ *                                     - EVRT_SRC_WAKEUP0                      :WAKEUP0 event\r
+ *                                     - EVRT_SRC_WAKEUP1                      :WAKEUP1 event\r
+ *                                     - EVRT_SRC_WAKEUP2                      :WAKEUP2 event\r
+ *                                     - EVRT_SRC_WAKEUP3                      :WAKEUP3 event\r
+ *                                     - EVRT_SRC_ATIMER                       :Alarm timer eveny\r
+ *                                     - EVRT_SRC_RTC                          :RTC event\r
+ *                                     - EVRT_SRC_BOD                          :BOD event\r
+ *                                     - EVRT_SRC_WWDT                         :WWDT event\r
+ *                                     - EVRT_SRC_ETHERNET                     :ETHERNET event\r
+ *                                     - EVRT_SRC_USB0                         :USB0 event\r
+ *                                     - EVRT_SRC_USB1                         :USB1 event\r
+ *                                     - EVRT_SRC_CCAN                         :CCAN event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER2       :Combined timer output 2 event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER6       :Combined timer output 6 event\r
+ *                                     - EVRT_SRC_QEI                          :QEI event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER14      :Combined timer output 14 event\r
+ *                                     - EVRT_SRC_RESET                        :RESET event\r
+ * @return             TRUE or FALSE\r
+ **********************************************************************/\r
+Bool EVRT_IsSourceInterrupting(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src)\r
+{\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+       CHECK_PARAM(PARAM_EVRT_SOURCE(EVRT_Src));\r
+\r
+       if(EVRTx->STATUS & (1<<(uint8_t)EVRT_Src))\r
+               return TRUE;\r
+       else return FALSE;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear pending interrupt EVRT source\r
+ * @param[in]  EVRTx   EVRT peripheral selected, should be LPC_EVRT\r
+ * @param[in]  EVRT_Src        EVRT source, should be:\r
+ *                                     - EVRT_SRC_WAKEUP0                      :WAKEUP0 event\r
+ *                                     - EVRT_SRC_WAKEUP1                      :WAKEUP1 event\r
+ *                                     - EVRT_SRC_WAKEUP2                      :WAKEUP2 event\r
+ *                                     - EVRT_SRC_WAKEUP3                      :WAKEUP3 event\r
+ *                                     - EVRT_SRC_ATIMER                       :Alarm timer eveny\r
+ *                                     - EVRT_SRC_RTC                          :RTC event\r
+ *                                     - EVRT_SRC_BOD                          :BOD event\r
+ *                                     - EVRT_SRC_WWDT                         :WWDT event\r
+ *                                     - EVRT_SRC_ETHERNET                     :ETHERNET event\r
+ *                                     - EVRT_SRC_USB0                         :USB0 event\r
+ *                                     - EVRT_SRC_USB1                         :USB1 event\r
+ *                                     - EVRT_SRC_CCAN                         :CCAN event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER2       :Combined timer output 2 event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER6       :Combined timer output 6 event\r
+ *                                     - EVRT_SRC_QEI                          :QEI event\r
+ *                                     - EVRT_SRC_COMBINE_TIMER14      :Combined timer output 14 event\r
+ *                                     - EVRT_SRC_RESET                        :RESET event\r
+ * @return             none\r
+ **********************************************************************/\r
+void EVRT_ClrPendIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src)\r
+{\r
+       CHECK_PARAM(PARAM_EVRTx(EVRTx));\r
+       CHECK_PARAM(PARAM_EVRT_SOURCE(EVRT_Src));\r
+\r
+       EVRTx->CLR_STAT = (1<<(uint8_t)EVRT_Src);\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpdma.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpdma.c
new file mode 100644 (file)
index 0000000..82fbf71
--- /dev/null
@@ -0,0 +1,567 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_gpdma.c         2011-06-02\r
+*//**\r
+* @file                lpc18xx_gpdma.c\r
+* @brief       Contains all functions support for GPDMA firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup GPDMA\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_gpdma.h"\r
+//#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _GPDMA\r
+\r
+/** GPDMA Mux definitions */\r
+#define DMAMUX_ADDRESS         0x4004311C\r
+\r
+/* Private Functions ----------------------------------------------------------- */\r
+/** @\r
+ * @{\r
+ */\r
+uint8_t DMAMUX_Config(uint32_t gpdma_peripheral_connection_number);\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Private Variables ---------------------------------------------------------- */\r
+/** @defgroup GPDMA_Private_Variables GPDMA Private Variables\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief Lookup Table of Connection Type matched with\r
+ * Peripheral Data (FIFO) register base address\r
+ */\r
+#ifdef __ICCARM__\r
+volatile const void *GPDMA_LUTPerAddr[] = {\r
+               (&LPC_SPIFI->DAT),                      // SPIFI\r
+               (&LPC_TIMER0->MR),                              // MAT0.0\r
+               (&LPC_USART0->/*RBTHDLR.*/THR), // UART0 Tx\r
+               ((uint32_t*)&LPC_TIMER0->MR + 1),                               // MAT0.1\r
+               (&LPC_USART0->/*RBTHDLR.*/RBR), // UART0 Rx\r
+               (&LPC_TIMER1->MR),                              // MAT1.0\r
+               (&LPC_UART1->/*RBTHDLR.*/THR),  // UART1 Tx\r
+               ((uint32_t*)&LPC_TIMER1->MR + 1),                               // MAT1.1\r
+               (&LPC_UART1->/*RBTHDLR.*/RBR),  // UART1 Rx\r
+               (&LPC_TIMER2->MR),                              // MAT2.0\r
+               (&LPC_USART2->/*RBTHDLR.*/THR), // UART2 Tx\r
+               ((uint32_t*)&LPC_TIMER2->MR + 1),                               // MAT2.1\r
+               (&LPC_USART2->/*RBTHDLR.*/RBR), // UART2 Rx\r
+               (&LPC_TIMER3->MR),                              // MAT3.0\r
+               (&LPC_USART3->/*RBTHDLR.*/THR), // UART3 Tx\r
+               0,      // to be defined: SCT DMA request 0\r
+               ((uint32_t*)&LPC_TIMER3->MR + 1),                               // MAT3.1\r
+               (&LPC_USART3->/*RBTHDLR.*/RBR), // UART3 Rx\r
+               0,      // to be defined: SCT DMA request 1\r
+               (&LPC_SSP0->DR),                                // SSP0 Rx\r
+               (&LPC_I2S0->TXFIFO),                    // I2S channel 0\r
+               (&LPC_SSP0->DR),                                // SSP0 Tx\r
+               (&LPC_I2S0->RXFIFO),                    // I2S channel 1\r
+               (&LPC_SSP1->DR),                                // SSP1 Rx\r
+               (&LPC_SSP1->DR),                                // SSP1 Tx\r
+               (&LPC_ADC0->GDR),                               // ADC 0\r
+               (&LPC_ADC1->GDR),                               // ADC 1\r
+               (&LPC_DAC->CR)                          // DAC\r
+};\r
+#else\r
+const uint32_t GPDMA_LUTPerAddr[] = {\r
+//             ((uint32_t)&LPC_SPIFI->DAT),                    // SPIFI\r
+               ((uint32_t)0),                  // SPIFI\r
+               ((uint32_t)&LPC_TIMER0->MR[0]),                         // MAT0.0\r
+               ((uint32_t)&LPC_USART0->/*RBTHDLR.*/THR),       // UART0 Tx\r
+               ((uint32_t)&LPC_TIMER0->MR[1]),                         // MAT0.1\r
+               ((uint32_t)&LPC_USART0->/*RBTHDLR.*/RBR),       // UART0 Rx\r
+               ((uint32_t)&LPC_TIMER1->MR[0]),                         // MAT1.0\r
+               ((uint32_t)&LPC_UART1->/*RBTHDLR.*/THR),        // UART1 Tx\r
+               ((uint32_t)&LPC_TIMER1->MR[1]),                         // MAT1.1\r
+               ((uint32_t)&LPC_UART1->/*RBTHDLR.*/RBR),        // UART1 Rx\r
+               ((uint32_t)&LPC_TIMER2->MR[0]),                         // MAT2.0\r
+               ((uint32_t)&LPC_USART2->/*RBTHDLR.*/THR),       // UART2 Tx\r
+               ((uint32_t)&LPC_TIMER2->MR[1]),                         // MAT2.1\r
+               ((uint32_t)&LPC_USART2->/*RBTHDLR.*/RBR),       // UART2 Rx\r
+               ((uint32_t)&LPC_TIMER3->MR[0]),                         // MAT3.0\r
+               ((uint32_t)&LPC_USART3->/*RBTHDLR.*/THR),       // UART3 Tx\r
+               0,      // to be defined: SCT DMA request 0\r
+               ((uint32_t)&LPC_TIMER3->MR[1]),                         // MAT3.1\r
+               ((uint32_t)&LPC_USART3->/*RBTHDLR.*/RBR),       // UART3 Rx\r
+               0,      // to be defined: SCT DMA request 1\r
+               ((uint32_t)&LPC_SSP0->DR),                              // SSP0 Rx\r
+               ((uint32_t)&LPC_I2S0->TXFIFO),                  // I2S channel 0\r
+               ((uint32_t)&LPC_SSP0->DR),                              // SSP0 Tx\r
+               ((uint32_t)&LPC_I2S0->RXFIFO),                  // I2S channel 1\r
+               ((uint32_t)&LPC_SSP1->DR),                              // SSP1 Rx\r
+               ((uint32_t)&LPC_SSP1->DR),                              // SSP1 Tx\r
+               ((uint32_t)&LPC_ADC0->GDR),                             // ADC 0\r
+               ((uint32_t)&LPC_ADC1->GDR),                             // ADC 1\r
+               ((uint32_t)&LPC_DAC->CR)                                // DAC\r
+};\r
+#endif\r
+/**\r
+ * @brief Lookup Table of GPDMA Channel Number matched with\r
+ * GPDMA channel pointer\r
+ */\r
+const LPC_GPDMACH_TypeDef *pGPDMACh[8] = {\r
+               LPC_GPDMACH0,   // GPDMA Channel 0\r
+               LPC_GPDMACH1,   // GPDMA Channel 1\r
+               LPC_GPDMACH2,   // GPDMA Channel 2\r
+               LPC_GPDMACH3,   // GPDMA Channel 3\r
+               LPC_GPDMACH4,   // GPDMA Channel 4\r
+               LPC_GPDMACH5,   // GPDMA Channel 5\r
+               LPC_GPDMACH6,   // GPDMA Channel 6\r
+               LPC_GPDMACH7,   // GPDMA Channel 7\r
+};\r
+/**\r
+ * @brief Optimized Peripheral Source and Destination burst size\r
+ */\r
+const uint8_t GPDMA_LUTPerBurst[] = {\r
+               GPDMA_BSIZE_4,                          // SPIFI\r
+               GPDMA_BSIZE_1,                          // MAT0.0\r
+               GPDMA_BSIZE_1,                          // UART0 Tx\r
+               GPDMA_BSIZE_1,                          // MAT0.1\r
+               GPDMA_BSIZE_1,                          // UART0 Rx\r
+               GPDMA_BSIZE_1,                          // MAT1.0\r
+               GPDMA_BSIZE_1,                          // UART1 Tx\r
+               GPDMA_BSIZE_1,                          // MAT1.1\r
+               GPDMA_BSIZE_1,                          // UART1 Rx\r
+               GPDMA_BSIZE_1,                          // MAT2.0\r
+               GPDMA_BSIZE_1,                          // UART2 Tx\r
+               GPDMA_BSIZE_1,                          // MAT2.1\r
+               GPDMA_BSIZE_1,                          // UART2 Rx\r
+               GPDMA_BSIZE_1,                          // MAT3.0\r
+               GPDMA_BSIZE_1,                          // UART3 Tx\r
+               0,      // to be defined: SCT DMA request 0\r
+               GPDMA_BSIZE_1,                          // MAT3.1\r
+               GPDMA_BSIZE_1,                          // UART3 Rx\r
+               0,      // to be defined: SCT DMA request 1\r
+               GPDMA_BSIZE_4,                          // SSP0 Rx\r
+               GPDMA_BSIZE_32,                         // I2S channel 0\r
+               GPDMA_BSIZE_4,                          // SSP0 Tx\r
+               GPDMA_BSIZE_32,                         // I2S channel 1\r
+               GPDMA_BSIZE_4,                          // SSP1 Rx\r
+               GPDMA_BSIZE_4,                          // SSP1 Tx\r
+               GPDMA_BSIZE_4,                          // ADC 0\r
+               GPDMA_BSIZE_4,                          // ADC 1\r
+               GPDMA_BSIZE_1,                          // DAC\r
+};\r
+/**\r
+ * @brief Optimized Peripheral Source and Destination transfer width\r
+ */\r
+const uint8_t GPDMA_LUTPerWid[] = {\r
+               GPDMA_WIDTH_WORD,                               // SPIFI\r
+               GPDMA_WIDTH_WORD,                               // MAT0.0\r
+               GPDMA_WIDTH_BYTE,                               // UART0 Tx\r
+               GPDMA_WIDTH_WORD,                               // MAT0.1\r
+               GPDMA_WIDTH_BYTE,                               // UART0 Rx\r
+               GPDMA_WIDTH_WORD,                               // MAT1.0\r
+               GPDMA_WIDTH_BYTE,                               // UART1 Tx\r
+               GPDMA_WIDTH_WORD,                               // MAT1.1\r
+               GPDMA_WIDTH_BYTE,                               // UART1 Rx\r
+               GPDMA_WIDTH_WORD,                               // MAT2.0\r
+               GPDMA_WIDTH_BYTE,                               // UART2 Tx\r
+               GPDMA_WIDTH_WORD,                               // MAT2.1\r
+               GPDMA_WIDTH_BYTE,                               // UART2 Rx\r
+               GPDMA_WIDTH_WORD,                               // MAT3.0\r
+               GPDMA_WIDTH_BYTE,                               // UART3 Tx\r
+               0,      // to be defined: SCT DMA request 0\r
+               GPDMA_WIDTH_WORD,                               // MAT3.1\r
+               GPDMA_WIDTH_BYTE,                               // UART3 Rx\r
+               0,      // to be defined: SCT DMA request 1\r
+               GPDMA_WIDTH_BYTE,                               // SSP0 Rx\r
+               GPDMA_WIDTH_WORD,                               // I2S channel 0\r
+               GPDMA_WIDTH_BYTE,                               // SSP0 Tx\r
+               GPDMA_WIDTH_WORD,                               // I2S channel 1\r
+               GPDMA_WIDTH_BYTE,                               // SSP1 Rx\r
+               GPDMA_WIDTH_BYTE,                               // SSP1 Tx\r
+               GPDMA_WIDTH_WORD,                               // ADC 0\r
+               GPDMA_WIDTH_WORD,                               // ADC 1\r
+               GPDMA_WIDTH_WORD,                               // DAC\r
+};\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Private Functions ----------------------------------------------------------- */\r
+/** @\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Control which set of peripherals is connected to the\r
+ *                             DMA controller\r
+ * @param[in]  gpdma_peripheral_connection_number      GPDMA peripheral\r
+ *                             connection number, should be:\r
+ *                                     - GPDMA_CONN_SPIFI                      :SPIFI\r
+ *                                     - GPDMA_CONN_MAT0_0                     :Timer 0, match channel 0\r
+ *                                     - GPDMA_CONN_MAT0_1                     :Timer 0, match channel 1\r
+ *                                     - GPDMA_CONN_MAT1_0                     :Timer 1, match channel 0\r
+ *                                     - GPDMA_CONN_MAT1_1                     :Timer 1, match channel 1\r
+ *                                     - GPDMA_CONN_MAT2_0                     :Timer 2, match channel 0\r
+ *                                     - GPDMA_CONN_MAT2_1                     :Timer 2, match channel 1\r
+ *                                     - GPDMA_CONN_MAT3_0                     :Timer 3, match channel 0\r
+ *                                     - GPDMA_CONN_MAT3_1                     :Timer 3, match channel 1\r
+ *                                     - GPDMA_CONN_UART0_Tx           :USART 0 transmit\r
+ *                                     - GPDMA_CONN_UART0_Rx           :USART 0 receive\r
+ *                                     - GPDMA_CONN_UART1_Tx           :USART 1 transmit\r
+ *                                     - GPDMA_CONN_UART1_Rx           :USART 1 receive\r
+ *                                     - GPDMA_CONN_UART2_Tx           :USART 2 transmit\r
+ *                                     - GPDMA_CONN_UART2_Rx           :USART 2 receive\r
+ *                                     - GPDMA_CONN_UART3_Tx           :USART 3 transmit\r
+ *                                     - GPDMA_CONN_UART3_Rx           :USART 3 receive\r
+ *                                     - GPDMA_CONN_SCT_0                      :SCT output 0\r
+ *                                     - GPDMA_CONN_SCT_1                      :SCT output 1\r
+ *                                     - GPDMA_CONN_I2S_Channel_0      :I2S channel 0\r
+ *                                     - GPDMA_CONN_I2S_Channel_1      :I2S channel 1\r
+ *                                     - GPDMA_CONN_SSP0_Tx            :SSP0 transmit\r
+ *                                     - GPDMA_CONN_SSP0_Rx            :SSP0 receive\r
+ *                                     - GPDMA_CONN_SSP1_Tx            :SSP1 transmit\r
+ *                                     - GPDMA_CONN_SSP1_Rx            :SSP1 receive\r
+ *                                     - GPDMA_CONN_ADC_0                      :ADC0\r
+ *                                     - GPDMA_CONN_ADC_1                      :ADC1\r
+ *                                     - GPDMA_CONN_DAC                        :DAC\r
+ * @return     channel number, could be in range: 0..16\r
+ *********************************************************************/\r
+uint8_t DMAMUX_Config(uint32_t gpdma_peripheral_connection_number)\r
+{\r
+       uint32_t *dmamux_reg = (uint32_t*)DMAMUX_ADDRESS;\r
+       uint8_t function, channel;\r
+\r
+       switch(gpdma_peripheral_connection_number)\r
+       {\r
+               case GPDMA_CONN_SPIFI:          function = 0; channel = 0; break;\r
+               case GPDMA_CONN_MAT0_0:         function = 0; channel = 1; break;\r
+               case GPDMA_CONN_UART0_Tx:       function = 1; channel = 1; break;\r
+               case GPDMA_CONN_MAT0_1:         function = 0; channel = 2; break;\r
+               case GPDMA_CONN_UART0_Rx:       function = 1; channel = 2; break;\r
+               case GPDMA_CONN_MAT1_0:         function = 0; channel = 3; break;\r
+               case GPDMA_CONN_UART1_Tx:       function = 1; channel = 3; break;\r
+               case GPDMA_CONN_MAT1_1:         function = 0; channel = 4; break;\r
+               case GPDMA_CONN_UART1_Rx:       function = 1; channel = 4; break;\r
+               case GPDMA_CONN_MAT2_0:         function = 0; channel = 5; break;\r
+               case GPDMA_CONN_UART2_Tx:       function = 1; channel = 5; break;\r
+               case GPDMA_CONN_MAT2_1:         function = 0; channel = 6; break;\r
+               case GPDMA_CONN_UART2_Rx:       function = 1; channel = 6; break;\r
+               case GPDMA_CONN_MAT3_0:         function = 0; channel = 7; break;\r
+               case GPDMA_CONN_UART3_Tx:       function = 1; channel = 7; break;\r
+               case GPDMA_CONN_SCT_0:          function = 2; channel = 7; break;\r
+               case GPDMA_CONN_MAT3_1:         function = 0; channel = 8; break;\r
+               case GPDMA_CONN_UART3_Rx:       function = 1; channel = 8; break;\r
+               case GPDMA_CONN_SCT_1:          function = 2; channel = 8; break;\r
+               case GPDMA_CONN_SSP0_Rx:        function = 0; channel = 9; break;\r
+               case GPDMA_CONN_I2S_Channel_0:function = 1; channel = 9; break;\r
+               case GPDMA_CONN_SSP0_Tx:        function = 0; channel = 10; break;\r
+               case GPDMA_CONN_I2S_Channel_1:function = 1; channel = 10; break;\r
+               case GPDMA_CONN_SSP1_Rx:        function = 0; channel = 11; break;\r
+               case GPDMA_CONN_SSP1_Tx:        function = 0; channel = 12; break;\r
+               case GPDMA_CONN_ADC_0:          function = 0; channel = 13; break;\r
+               case GPDMA_CONN_ADC_1:          function = 0; channel = 14; break;\r
+               case GPDMA_CONN_DAC:            function = 0; channel = 15; break;\r
+               default:                                        function = 3; channel = 15; break;\r
+       }\r
+       //Set select function to dmamux register\r
+       *dmamux_reg &= ~(0x03<<(2*channel));\r
+       *dmamux_reg |= (function<<(2*channel));\r
+\r
+       return channel;\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup GPDMA_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initialize GPDMA controller\r
+ * @param[in]  None\r
+ * @return             None\r
+ *********************************************************************/\r
+void GPDMA_Init(void)\r
+{\r
+       /* to be defined Enable GPDMA clock */\r
+       // enabled default on reset\r
+\r
+       // Reset all channel configuration register\r
+       LPC_GPDMACH0->CConfig = 0;\r
+       LPC_GPDMACH1->CConfig = 0;\r
+       LPC_GPDMACH2->CConfig = 0;\r
+       LPC_GPDMACH3->CConfig = 0;\r
+       LPC_GPDMACH4->CConfig = 0;\r
+       LPC_GPDMACH5->CConfig = 0;\r
+       LPC_GPDMACH6->CConfig = 0;\r
+       LPC_GPDMACH7->CConfig = 0;\r
+\r
+       /* Clear all DMA interrupt and error flag */\r
+       LPC_GPDMA->INTTCCLEAR = 0xFF;\r
+       LPC_GPDMA->INTERRCLR = 0xFF;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Setup GPDMA channel peripheral according to the specified\r
+ *              parameters in the GPDMAChannelConfig.\r
+ * @param[in]  GPDMAChannelConfig Pointer to a GPDMA_CH_CFG_Type structure\r
+ *                             that contains the configuration information for the specified\r
+ *                             GPDMA channel peripheral.\r
+ * @return             Setup status, could be:\r
+ *                                     - ERROR         :if selected channel is enabled before\r
+ *                                     - SUCCESS       :if channel is configured successfully\r
+ *********************************************************************/\r
+Status GPDMA_Setup(GPDMA_Channel_CFG_Type *GPDMAChannelConfig)\r
+{\r
+       LPC_GPDMACH_TypeDef *pDMAch;\r
+       uint8_t SrcPeripheral=0, DestPeripheral=0;\r
+\r
+       if (LPC_GPDMA->ENBLDCHNS & (GPDMA_DMACEnbldChns_Ch(GPDMAChannelConfig->ChannelNum))) {\r
+               // This channel is enabled, return ERROR, need to release this channel first\r
+               return ERROR;\r
+       }\r
+\r
+       // Get Channel pointer\r
+       pDMAch = (LPC_GPDMACH_TypeDef *) pGPDMACh[GPDMAChannelConfig->ChannelNum];\r
+\r
+       // Reset the Interrupt status\r
+       LPC_GPDMA->INTTCCLEAR = GPDMA_DMACIntTCClear_Ch(GPDMAChannelConfig->ChannelNum);\r
+       LPC_GPDMA->INTERRCLR = GPDMA_DMACIntErrClr_Ch(GPDMAChannelConfig->ChannelNum);\r
+\r
+       // Clear DMA configure\r
+       pDMAch->CControl = 0x00;\r
+       pDMAch->CConfig = 0x00;\r
+\r
+       /* Assign Linker List Item value */\r
+       pDMAch->CLLI = GPDMAChannelConfig->DMALLI;\r
+\r
+       /* Set value to Channel Control Registers */\r
+       switch (GPDMAChannelConfig->TransferType)\r
+       {\r
+       // Memory to memory\r
+       case GPDMA_TRANSFERTYPE_M2M_CONTROLLER_DMA:\r
+               // Assign physical source and destination address\r
+               pDMAch->CSrcAddr = GPDMAChannelConfig->SrcMemAddr;\r
+               pDMAch->CDestAddr = GPDMAChannelConfig->DstMemAddr;\r
+               pDMAch->CControl\r
+                               = GPDMA_DMACCxControl_TransferSize(GPDMAChannelConfig->TransferSize) \\r
+                                               | GPDMA_DMACCxControl_SBSize(GPDMA_BSIZE_32) \\r
+                                               | GPDMA_DMACCxControl_DBSize(GPDMA_BSIZE_32) \\r
+                                               | GPDMA_DMACCxControl_SWidth(GPDMAChannelConfig->TransferWidth) \\r
+                                               | GPDMA_DMACCxControl_DWidth(GPDMAChannelConfig->TransferWidth) \\r
+                                               | GPDMA_DMACCxControl_SI \\r
+                                               | GPDMA_DMACCxControl_DI \\r
+                                               | GPDMA_DMACCxControl_I;\r
+               break;\r
+       // Memory to peripheral\r
+       case GPDMA_TRANSFERTYPE_M2P_CONTROLLER_DMA:\r
+               // Assign physical source\r
+               pDMAch->CSrcAddr = GPDMAChannelConfig->SrcMemAddr;\r
+               // Assign peripheral destination address\r
+               pDMAch->CDestAddr = (uint32_t)GPDMA_LUTPerAddr[GPDMAChannelConfig->DstConn];\r
+               pDMAch->CControl\r
+                               = GPDMA_DMACCxControl_TransferSize((uint32_t)GPDMAChannelConfig->TransferSize) \\r
+                                               | GPDMA_DMACCxControl_SBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_DBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_SWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_DWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_DestTransUseAHBMaster1 \\r
+                                               | GPDMA_DMACCxControl_SI \\r
+                                               | GPDMA_DMACCxControl_I;\r
+               DestPeripheral = DMAMUX_Config(GPDMAChannelConfig->DstConn);\r
+               break;\r
+       // Peripheral to memory\r
+       case GPDMA_TRANSFERTYPE_P2M_CONTROLLER_DMA:\r
+               // Assign peripheral source address\r
+               pDMAch->CSrcAddr = (uint32_t)GPDMA_LUTPerAddr[GPDMAChannelConfig->SrcConn];\r
+               // Assign memory destination address\r
+               pDMAch->CDestAddr = GPDMAChannelConfig->DstMemAddr;\r
+               pDMAch->CControl\r
+                               = GPDMA_DMACCxControl_TransferSize((uint32_t)GPDMAChannelConfig->TransferSize) \\r
+                                               | GPDMA_DMACCxControl_SBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_DBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_SWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_DWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_SrcTransUseAHBMaster1 \\r
+                                               | GPDMA_DMACCxControl_DI \\r
+                                               | GPDMA_DMACCxControl_I;\r
+               SrcPeripheral = DMAMUX_Config(GPDMAChannelConfig->SrcConn);\r
+               break;\r
+       // Peripheral to peripheral\r
+       case GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DMA:\r
+               // Assign peripheral source address\r
+               pDMAch->CSrcAddr = (uint32_t)GPDMA_LUTPerAddr[GPDMAChannelConfig->SrcConn];\r
+               // Assign peripheral destination address\r
+               pDMAch->CDestAddr = (uint32_t)GPDMA_LUTPerAddr[GPDMAChannelConfig->DstConn];\r
+               pDMAch->CControl\r
+                               = GPDMA_DMACCxControl_TransferSize((uint32_t)GPDMAChannelConfig->TransferSize) \\r
+                                               | GPDMA_DMACCxControl_SBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_DBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_SWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->SrcConn]) \\r
+                                               | GPDMA_DMACCxControl_DWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \\r
+                                               | GPDMA_DMACCxControl_SrcTransUseAHBMaster1 \\r
+                                               | GPDMA_DMACCxControl_DestTransUseAHBMaster1 \\r
+                                               | GPDMA_DMACCxControl_I;\r
+               SrcPeripheral = DMAMUX_Config(GPDMAChannelConfig->SrcConn);\r
+               DestPeripheral = DMAMUX_Config(GPDMAChannelConfig->DstConn);\r
+               break;\r
+\r
+       case GPDMA_TRANSFERTYPE_P2P_CONTROLLER_DestPERIPHERAL:\r
+       case GPDMA_TRANSFERTYPE_M2P_CONTROLLER_PERIPHERAL:\r
+       case GPDMA_TRANSFERTYPE_P2M_CONTROLLER_PERIPHERAL:\r
+       case GPDMA_TRANSFERTYPE_P2P_CONTROLLER_SrcPERIPHERAL:\r
+               //to be defined\r
+       // Do not support any more transfer type, return ERROR\r
+       default:\r
+               return ERROR;\r
+       }\r
+\r
+       /* Enable DMA channels, little endian */\r
+       LPC_GPDMA->CONFIG = GPDMA_DMACConfig_E;\r
+       while (!(LPC_GPDMA->CONFIG & GPDMA_DMACConfig_E));\r
+\r
+       // Configure DMA Channel, enable Error Counter and Terminate counter\r
+       pDMAch->CConfig = GPDMA_DMACCxConfig_IE | GPDMA_DMACCxConfig_ITC /*| GPDMA_DMACCxConfig_E*/ \\r
+               | GPDMA_DMACCxConfig_TransferType((uint32_t)GPDMAChannelConfig->TransferType) \\r
+               | GPDMA_DMACCxConfig_SrcPeripheral(SrcPeripheral) \\r
+               | GPDMA_DMACCxConfig_DestPeripheral(DestPeripheral);\r
+\r
+       return SUCCESS;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable DMA channel\r
+ * @param[in]  channelNum      GPDMA channel, should be in range from 0 to 15\r
+ * @param[in]  NewState        New State of this command, should be:\r
+ *                                     - ENABLE.\r
+ *                                     - DISABLE.\r
+ * @return             None\r
+ **********************************************************************/\r
+void GPDMA_ChannelCmd(uint8_t channelNum, FunctionalState NewState)\r
+{\r
+       LPC_GPDMACH_TypeDef *pDMAch;\r
+\r
+       // Get Channel pointer\r
+       pDMAch = (LPC_GPDMACH_TypeDef *) pGPDMACh[channelNum];\r
+\r
+       if (NewState == ENABLE) {\r
+               pDMAch->CConfig |= GPDMA_DMACCxConfig_E;\r
+       } else {\r
+               pDMAch->CConfig &= ~GPDMA_DMACCxConfig_E;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check if corresponding channel does have an active interrupt\r
+ *                             request or not\r
+ * @param[in]  type            type of status, should be:\r
+ *                                     - GPDMA_STAT_INT                :GPDMA Interrupt Status\r
+ *                                     - GPDMA_STAT_INTTC              :GPDMA Interrupt Terminal Count Request Status\r
+ *                                     - GPDMA_STAT_INTERR             :GPDMA Interrupt Error Status\r
+ *                                     - GPDMA_STAT_RAWINTTC   :GPDMA Raw Interrupt Terminal Count Status\r
+ *                                     - GPDMA_STAT_RAWINTERR  :GPDMA Raw Error Interrupt Status\r
+ *                                     - GPDMA_STAT_ENABLED_CH :GPDMA Enabled Channel Status\r
+ * @param[in]  channel         GPDMA channel, should be in range from 0 to 7\r
+ * @return             IntStatus       status of DMA channel interrupt after masking\r
+ *                             Should be:\r
+ *                                     - SET   :the corresponding channel has no active interrupt request\r
+ *                                     - RESET :the corresponding channel does have an active interrupt request\r
+ **********************************************************************/\r
+IntStatus GPDMA_IntGetStatus(GPDMA_Status_Type type, uint8_t channel)\r
+{\r
+       CHECK_PARAM(PARAM_GPDMA_STAT(type));\r
+       CHECK_PARAM(PARAM_GPDMA_CHANNEL(channel));\r
+\r
+       switch (type)\r
+       {\r
+       case GPDMA_STAT_INT: //check status of DMA channel interrupts\r
+               if (LPC_GPDMA->INTSTAT & (GPDMA_DMACIntStat_Ch(channel)))\r
+                       return SET;\r
+               return RESET;\r
+       case GPDMA_STAT_INTTC: // check terminal count interrupt request status for DMA\r
+               if (LPC_GPDMA->INTTCSTAT & GPDMA_DMACIntTCStat_Ch(channel))\r
+                       return SET;\r
+               return RESET;\r
+       case GPDMA_STAT_INTERR: //check interrupt status for DMA channels\r
+               if (LPC_GPDMA->INTERRSTAT & GPDMA_DMACIntTCClear_Ch(channel))\r
+                       return SET;\r
+               return RESET;\r
+       case GPDMA_STAT_RAWINTTC: //check status of the terminal count interrupt for DMA channels\r
+               if (LPC_GPDMA->RAWINTERRSTAT & GPDMA_DMACRawIntTCStat_Ch(channel))\r
+                       return SET;\r
+               return RESET;\r
+       case GPDMA_STAT_RAWINTERR: //check status of the error interrupt for DMA channels\r
+               if (LPC_GPDMA->RAWINTTCSTAT & GPDMA_DMACRawIntErrStat_Ch(channel))\r
+                       return SET;\r
+               return RESET;\r
+       default: //check enable status for DMA channels\r
+               if (LPC_GPDMA->ENBLDCHNS & GPDMA_DMACEnbldChns_Ch(channel))\r
+                       return SET;\r
+               return RESET;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear one or more interrupt requests on DMA channels\r
+ * @param[in]  type            type of interrupt request, should be:\r
+ *                                     - GPDMA_STATCLR_INTTC   :GPDMA Interrupt Terminal Count Request Clear\r
+ *                                     - GPDMA_STATCLR_INTERR  :GPDMA Interrupt Error Clear\r
+ * @param[in]  channel         GPDMA channel, should be in range from 0 to 15\r
+ * @return             None\r
+ **********************************************************************/\r
+void GPDMA_ClearIntPending(GPDMA_StateClear_Type type, uint8_t channel)\r
+{\r
+       CHECK_PARAM(PARAM_GPDMA_STATCLR(type));\r
+       CHECK_PARAM(PARAM_GPDMA_CHANNEL(channel));\r
+\r
+       if (type == GPDMA_STATCLR_INTTC) // clears the terminal count interrupt request on DMA channel\r
+               LPC_GPDMA->INTTCCLEAR = GPDMA_DMACIntTCClear_Ch(channel);\r
+       else // clear the error interrupt request\r
+               LPC_GPDMA->INTERRCLR = GPDMA_DMACIntErrClr_Ch(channel);\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _GPDMA */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpio.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_gpio.c
new file mode 100644 (file)
index 0000000..1477c07
--- /dev/null
@@ -0,0 +1,816 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_gpio.c          2011-06-02\r
+*//**\r
+* @file                lpc18xx_gpio.c\r
+* @brief       Contains all functions support for GPIO firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup GPIO\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_gpio.h"\r
+#include "lpc_types.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _GPIO\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+//static LPC_GPIOn_Type *GPIO_GetPointer(uint8_t portNum);\r
+//static GPIO_HalfWord_TypeDef *FIO_HalfWordGetPointer(uint8_t portNum);\r
+//static GPIO_Byte_TypeDef *FIO_ByteGetPointer(uint8_t portNum);\r
+\r
+#if 0\r
+/*********************************************************************//**\r
+ * @brief              Get pointer to GPIO peripheral due to GPIO port\r
+ * @param[in]  portNum         Port Number value, should be in range from 0 to 4.\r
+ * @return             Pointer to GPIO peripheral\r
+ **********************************************************************/\r
+static LPC_GPIOn_Type *GPIO_GetPointer(uint8_t portNum)\r
+{\r
+       LPC_GPIOn_Type *pGPIO = NULL;\r
+\r
+       switch (portNum)\r
+       {\r
+               case 0:\r
+                       pGPIO = LPC_GPIO0;\r
+                       break;\r
+\r
+               case 1:\r
+                       pGPIO = LPC_GPIO1;\r
+                       break;\r
+\r
+               case 2:\r
+                       pGPIO = LPC_GPIO2;\r
+                       break;\r
+\r
+               case 3:\r
+                       pGPIO = LPC_GPIO3;\r
+                       break;\r
+\r
+               case 4:\r
+                       pGPIO = LPC_GPIO4;\r
+                       break;\r
+\r
+               default:\r
+                       break;\r
+       }\r
+\r
+       return pGPIO;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get pointer to FIO peripheral in halfword accessible style\r
+ *                             due to FIO port\r
+ * @param[in]  portNum         Port Number value, should be in range from 0 to 4.\r
+ * @return             Pointer to FIO peripheral\r
+ **********************************************************************/\r
+static GPIO_HalfWord_TypeDef *FIO_HalfWordGetPointer(uint8_t portNum)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = NULL;\r
+\r
+       switch (portNum)\r
+       {\r
+               case 0:\r
+                       pFIO = GPIO0_HalfWord;\r
+                       break;\r
+\r
+               case 1:\r
+                       pFIO = GPIO1_HalfWord;\r
+                       break;\r
+\r
+               case 2:\r
+                       pFIO = GPIO2_HalfWord;\r
+                       break;\r
+\r
+               case 3:\r
+                       pFIO = GPIO3_HalfWord;\r
+                       break;\r
+\r
+               case 4:\r
+                       pFIO = GPIO4_HalfWord;\r
+                       break;\r
+               default:\r
+                       break;\r
+       }\r
+\r
+       return pFIO;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get pointer to FIO peripheral in byte accessible style\r
+ *                             due to FIO port\r
+ * @param[in]  portNum         Port Number value, should be in range from 0 to 4.\r
+ * @return             Pointer to FIO peripheral\r
+ **********************************************************************/\r
+static GPIO_Byte_TypeDef *FIO_ByteGetPointer(uint8_t portNum)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = NULL;\r
+\r
+       switch (portNum)\r
+       {\r
+               case 0:\r
+                       pFIO = GPIO0_Byte;\r
+                       break;\r
+\r
+               case 1:\r
+                       pFIO = GPIO1_Byte;\r
+                       break;\r
+\r
+               case 2:\r
+                       pFIO = GPIO2_Byte;\r
+                       break;\r
+\r
+               case 3:\r
+                       pFIO = GPIO3_Byte;\r
+                       break;\r
+\r
+               case 4:\r
+                       pFIO = GPIO4_Byte;\r
+                       break;\r
+\r
+               default:\r
+                       break;\r
+       }\r
+\r
+       return pFIO;\r
+}\r
+#endif\r
+\r
+/* End of Private Functions --------------------------------------------------- */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup GPIO_Public_Functions\r
+ * @{\r
+ */\r
+\r
+\r
+/* GPIO ------------------------------------------------------------------------------ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Direction for GPIO port.\r
+ * @param[in]  portNum Port Number value, should be in range from 0 to 4\r
+ * @param[in]  bitValue        Value that contains all bits to set direction,\r
+ *                             in range from 0 to 0xFFFFFFFF.\r
+ *                             example: value 0x5 to set direction for bit 0 and bit 1.\r
+ * @param[in]  dir     Direction value, should be:\r
+ *                                     - 0: Input.\r
+ *                                     - 1: Output.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void GPIO_SetDir(uint8_t portNum, uint32_t bitValue, uint8_t dir)\r
+{\r
+               if (dir)\r
+               {\r
+               LPC_GPIO_PORT->DIR[portNum] |= bitValue;\r
+       } else\r
+               {\r
+               LPC_GPIO_PORT->DIR[portNum] &= ~bitValue;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Value for bits that have output direction on GPIO port.\r
+ * @param[in]  portNum Port number value, should be in range from 0 to 4\r
+ * @param[in]  bitValue Value that contains all bits on GPIO to set, should\r
+ *                             be in range from 0 to 0xFFFFFFFF.\r
+ *                             example: value 0x5 to set bit 0 and bit 1.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void GPIO_SetValue(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       LPC_GPIO_PORT->SET[portNum] = bitValue;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear Value for bits that have output direction on GPIO port.\r
+ * @param[in]  portNum Port number value, should be in range from 0 to 4\r
+ * @param[in]  bitValue Value that contains all bits on GPIO to clear, should\r
+ *                             be in range from 0 to 0xFFFFFFFF.\r
+ *                             example: value 0x5 to clear bit 0 and bit 1.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void GPIO_ClearValue(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       LPC_GPIO_PORT->CLR[portNum] = bitValue;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read Current state on port pin that have input direction of GPIO\r
+ * @param[in]  portNum Port number to read value, in range from 0 to 4\r
+ * @return             Current value of GPIO port.\r
+ *\r
+ * Note: Return value contain state of each port pin (bit) on that GPIO regardless\r
+ * its direction is input or output.\r
+ **********************************************************************/\r
+uint32_t GPIO_ReadValue(uint8_t portNum)\r
+{\r
+       return LPC_GPIO_PORT->PIN[portNum];\r
+}\r
+\r
+\r
+#ifdef GPIO_INT\r
+/*********************************************************************//**\r
+ * @brief              Enable GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13)\r
+ * @param[in]  portNum         Port number to read value, should be: 0 or 2\r
+ * @param[in]  bitValue        Value that contains all bits on GPIO to enable,\r
+ *                             should be in range from 0 to 0xFFFFFFFF.\r
+ * @param[in]  edgeState       state of edge, should be:\r
+ *                                     - 0: Rising edge\r
+ *                                     - 1: Falling edge\r
+ * @return             None\r
+ **********************************************************************/\r
+void GPIO_IntCmd(uint8_t portNum, uint32_t bitValue, uint8_t edgeState)\r
+{\r
+       if((portNum == 0)&&(edgeState == 0))\r
+               LPC_GPIOINT->IO0IntEnR = bitValue;\r
+       else if ((portNum == 2)&&(edgeState == 0))\r
+               LPC_GPIOINT->IO2IntEnR = bitValue;\r
+       else if ((portNum == 0)&&(edgeState == 1))\r
+               LPC_GPIOINT->IO0IntEnF = bitValue;\r
+       else if ((portNum == 2)&&(edgeState == 1))\r
+               LPC_GPIOINT->IO2IntEnF = bitValue;\r
+       else\r
+               //Error\r
+               while(1);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get GPIO Interrupt Status (just used for P0.0-P0.30, P2.0-P2.13)\r
+ * @param[in]  portNum Port number to read value, should be: 0 or 2\r
+ * @param[in]  pinNum  Pin number, should be: 0..30(with port 0) and 0..13\r
+ *                             (with port 2)\r
+ * @param[in]  edgeState       state of edge, should be:\r
+ *                                     - 0     :Rising edge\r
+ *                                     - 1     :Falling edge\r
+ * @return             Function status,        could be:\r
+ *                                     - ENABLE        :Interrupt has been generated due to a rising edge on P0.0\r
+ *                                     - DISABLE       :A rising edge has not been detected on P0.0\r
+ **********************************************************************/\r
+FunctionalState GPIO_GetIntStatus(uint8_t portNum, uint32_t pinNum, uint8_t edgeState)\r
+{\r
+       if((portNum == 0) && (edgeState == 0))//Rising Edge\r
+               return (((LPC_GPIOINT->IO0IntStatR)>>pinNum)& 0x1);\r
+       else if ((portNum == 2) && (edgeState == 0))\r
+               return (((LPC_GPIOINT->IO2IntStatR)>>pinNum)& 0x1);\r
+       else if ((portNum == 0) && (edgeState == 1))//Falling Edge\r
+               return (((LPC_GPIOINT->IO0IntStatF)>>pinNum)& 0x1);\r
+       else if ((portNum == 2) && (edgeState == 1))\r
+               return (((LPC_GPIOINT->IO2IntStatF)>>pinNum)& 0x1);\r
+       else\r
+               //Error\r
+               while(1);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13)\r
+ * @param[in]  portNum Port number to read value, should be: 0 or 2\r
+ * @param[in]  bitValue Value that contains all bits on GPIO to enable,\r
+ *                             should be in range from 0 to 0xFFFFFFFF.\r
+ * @return             None\r
+ **********************************************************************/\r
+void GPIO_ClearInt(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       if(portNum == 0)\r
+               LPC_GPIOINT->IO0IntClr = bitValue;\r
+       else if (portNum == 2)\r
+               LPC_GPIOINT->IO2IntClr = bitValue;\r
+       else\r
+               //Invalid portNum\r
+               while(1);\r
+}\r
+#endif\r
+\r
+\r
+/* FIO word accessible ----------------------------------------------------------------- */\r
+/* Stub function for FIO (word-accessible) style */\r
+\r
+/**\r
+ * @brief The same with GPIO_SetDir()\r
+ */\r
+void FIO_SetDir(uint8_t portNum, uint32_t bitValue, uint8_t dir)\r
+{\r
+       GPIO_SetDir(portNum, bitValue, dir);\r
+}\r
+\r
+/**\r
+ * @brief The same with GPIO_SetValue()\r
+ */\r
+void FIO_SetValue(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       GPIO_SetValue(portNum, bitValue);\r
+}\r
+\r
+/**\r
+ * @brief The same with GPIO_ClearValue()\r
+ */\r
+void FIO_ClearValue(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       GPIO_ClearValue(portNum, bitValue);\r
+}\r
+\r
+/**\r
+ * @brief The same with GPIO_ReadValue()\r
+ */\r
+uint32_t FIO_ReadValue(uint8_t portNum)\r
+{\r
+       return (GPIO_ReadValue(portNum));\r
+}\r
+\r
+\r
+#ifdef GPIO_INT\r
+/**\r
+ * @brief The same with GPIO_IntCmd()\r
+ */\r
+void FIO_IntCmd(uint8_t portNum, uint32_t bitValue, uint8_t edgeState)\r
+{\r
+       GPIO_IntCmd(portNum, bitValue, edgeState);\r
+}\r
+\r
+/**\r
+ * @brief The same with GPIO_GetIntStatus()\r
+ */\r
+FunctionalState FIO_GetIntStatus(uint8_t portNum, uint32_t pinNum, uint8_t edgeState)\r
+{\r
+       return (GPIO_GetIntStatus(portNum, pinNum, edgeState));\r
+}\r
+\r
+/**\r
+ * @brief The same with GPIO_ClearInt()\r
+ */\r
+void FIO_ClearInt(uint8_t portNum, uint32_t bitValue)\r
+{\r
+       GPIO_ClearInt(portNum, bitValue);\r
+}\r
+#endif\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set mask value for bits in FIO port\r
+ * @param[in]  portNum Port number, in range from 0 to 4\r
+ * @param[in]  bitValue Value that contains all bits in to set, should be\r
+ *                             in range from 0 to 0xFFFFFFFF.\r
+ * @param[in]  maskValue       Mask value contains state value for each bit:\r
+ *                                     - 0     :not mask.\r
+ *                                     - 1     :mask.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ * - After executing this function, in mask register, value '0' on each bit\r
+ * enables an access to the corresponding physical pin via a read or write access,\r
+ * while value '1' on bit (masked) that corresponding pin will not be changed\r
+ * with write access and if read, will not be reflected in the updated pin.\r
+ **********************************************************************/\r
+void FIO_SetMask(uint8_t portNum, uint32_t bitValue, uint8_t maskValue)\r
+{\r
+               if (maskValue)\r
+               {\r
+               LPC_GPIO_PORT->MASK[portNum] |= bitValue;\r
+       } else\r
+               {\r
+               LPC_GPIO_PORT->MASK[portNum] &= ~bitValue;\r
+       }\r
+}\r
+\r
+\r
+/* FIO halfword accessible ------------------------------------------------------------- */\r
+#if 0\r
+/*********************************************************************//**\r
+ * @brief              Set direction for FIO port in halfword accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  halfwordNum     HalfWord part number, should be 0 (lower) or 1(upper)\r
+ * @param[in]  bitValue        Value that contains all bits in to set direction,\r
+ *                                                     in range from 0 to 0xFFFF.\r
+ * @param[in]  dir     Direction value, should be:\r
+ *                                     - 0     :Input.\r
+ *                                     - 1     :Output.\r
+ * @return             None\r
+ *\r
+ * Note: All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_HalfWordSetDir(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue, uint8_t dir)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = FIO_HalfWordGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Output direction\r
+               if (dir)\r
+               {\r
+                       // Upper\r
+                       if(halfwordNum)\r
+                       {\r
+                               pFIO->FIODIRU |= bitValue;\r
+                       }\r
+                       // lower\r
+                       else\r
+                       {\r
+                               pFIO->FIODIRL |= bitValue;\r
+                       }\r
+               }\r
+               // Input direction\r
+               else\r
+               {\r
+                       // Upper\r
+                       if(halfwordNum)\r
+                       {\r
+                               pFIO->FIODIRU &= ~bitValue;\r
+                       }\r
+                       // lower\r
+                       else\r
+                       {\r
+                               pFIO->FIODIRL &= ~bitValue;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set mask value for bits in FIO port in halfword accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  halfwordNum     HalfWord part number, should be 0 (lower) or 1(upper)\r
+ * @param[in]  bitValue        Value that contains all bits in to set,\r
+ *                                                     in range from 0 to 0xFFFF.\r
+ * @param[in]  maskValue       Mask value contains state value for each bit:\r
+ *                                     - 0: not mask.\r
+ *                                     - 1: mask.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ * - After executing this function, in mask register, value '0' on each bit\r
+ * enables an access to the corresponding physical pin via a read or write access,\r
+ * while value '1' on bit (masked) that corresponding pin will not be changed\r
+ * with write access and if read, will not be reflected in the updated pin.\r
+ **********************************************************************/\r
+void FIO_HalfWordSetMask(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue, uint8_t maskValue)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = FIO_HalfWordGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Mask\r
+               if (maskValue)\r
+               {\r
+                       // Upper\r
+                       if(halfwordNum)\r
+                       {\r
+                               pFIO->FIOMASKU |= bitValue;\r
+                       }\r
+                       // lower\r
+                       else\r
+                       {\r
+                               pFIO->FIOMASKL |= bitValue;\r
+                       }\r
+               }\r
+               // Un-mask\r
+               else\r
+               {\r
+                       // Upper\r
+                       if(halfwordNum)\r
+                       {\r
+                               pFIO->FIOMASKU &= ~bitValue;\r
+                       }\r
+                       // lower\r
+                       else\r
+                       {\r
+                               pFIO->FIOMASKL &= ~bitValue;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set bits for FIO port in halfword accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  halfwordNum     HalfWord part number, should be 0 (lower) or 1(upper)\r
+ * @param[in]  bitValue        Value that contains all bits in to set, should be\r
+ *                             in range from 0 to 0xFFFF.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_HalfWordSetValue(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = FIO_HalfWordGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Upper\r
+               if(halfwordNum)\r
+               {\r
+                       pFIO->FIOSETU = bitValue;\r
+               }\r
+               // lower\r
+               else\r
+               {\r
+                       pFIO->FIOSETL = bitValue;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear bits for FIO port in halfword accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  halfwordNum     HalfWord part number, should be 0 (lower) or 1(upper)\r
+ * @param[in]  bitValue        Value that contains all bits in to clear, should be\r
+ *                             in range from 0 to 0xFFFF.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_HalfWordClearValue(uint8_t portNum, uint8_t halfwordNum, uint16_t bitValue)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = FIO_HalfWordGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Upper\r
+               if(halfwordNum)\r
+               {\r
+                       pFIO->FIOCLRU = bitValue;\r
+               }\r
+               // lower\r
+               else\r
+               {\r
+                       pFIO->FIOCLRL = bitValue;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read Current state on port pin that have input direction of GPIO\r
+ *                             in halfword accessible style.\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  halfwordNum     HalfWord part number, should be 0 (lower) or 1(upper)\r
+ * @return             Current value of FIO port pin of specified halfword.\r
+ * Note: Return value contain state of each port pin (bit) on that FIO regardless\r
+ * its direction is input or output.\r
+ **********************************************************************/\r
+uint16_t FIO_HalfWordReadValue(uint8_t portNum, uint8_t halfwordNum)\r
+{\r
+       GPIO_HalfWord_TypeDef *pFIO = FIO_HalfWordGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Upper\r
+               if(halfwordNum)\r
+               {\r
+                       return (pFIO->FIOPINU);\r
+               }\r
+               // lower\r
+               else\r
+               {\r
+                       return (pFIO->FIOPINL);\r
+               }\r
+       }\r
+\r
+       return (0);\r
+}\r
+\r
+\r
+/* FIO Byte accessible ------------------------------------------------------------ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set direction for FIO port in byte accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  byteNum         Byte part number, should be in range from 0 to 3\r
+ * @param[in]  bitValue        Value that contains all bits in to set direction,\r
+ *                             in range from 0 to 0xFF.\r
+ * @param[in]  dir     Direction value, should be:\r
+ *                                     - 0: Input.\r
+ *                                     - 1: Output.\r
+ * @return             None\r
+ *\r
+ * Note: All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_ByteSetDir(uint8_t portNum, uint8_t byteNum, uint8_t bitValue, uint8_t dir)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = FIO_ByteGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Output direction\r
+               if (dir)\r
+               {\r
+                       if (byteNum <= 3)\r
+                       {\r
+                               pFIO->FIODIR[byteNum] |= bitValue;\r
+                       }\r
+               }\r
+               // Input direction\r
+               else\r
+               {\r
+                       if (byteNum <= 3)\r
+                       {\r
+                               pFIO->FIODIR[byteNum] &= ~bitValue;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set mask value for bits in FIO port in byte accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  byteNum         Byte part number, should be in range from 0 to 3\r
+ * @param[in]  bitValue        Value that contains all bits in to set mask, should\r
+ *                             be in range from 0 to 0xFF.\r
+ * @param[in]  maskValue       Mask value contains state value for each bit:\r
+ *                                     - 0: not mask.\r
+ *                                     - 1: mask.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - All remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ * - After executing this function, in mask register, value '0' on each bit\r
+ * enables an access to the corresponding physical pin via a read or write access,\r
+ * while value '1' on bit (masked) that corresponding pin will not be changed\r
+ * with write access and if read, will not be reflected in the updated pin.\r
+ **********************************************************************/\r
+void FIO_ByteSetMask(uint8_t portNum, uint8_t byteNum, uint8_t bitValue, uint8_t maskValue)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = FIO_ByteGetPointer(portNum);\r
+\r
+       if(pFIO != NULL)\r
+       {\r
+               // Mask\r
+               if (maskValue)\r
+               {\r
+                       if (byteNum <= 3)\r
+                       {\r
+                               pFIO->FIOMASK[byteNum] |= bitValue;\r
+                       }\r
+               }\r
+               // Un-mask\r
+               else {\r
+                       if (byteNum <= 3)\r
+                       {\r
+                               pFIO->FIOMASK[byteNum] &= ~bitValue;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set bits for FIO port in byte accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  byteNum         Byte part number, should be in range from 0 to 3\r
+ * @param[in]  bitValue        Value that contains all bits in to set, should\r
+ *                             be in range from 0 to 0xFF.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_ByteSetValue(uint8_t portNum, uint8_t byteNum, uint8_t bitValue)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = FIO_ByteGetPointer(portNum);\r
+\r
+       if (pFIO != NULL) {\r
+               if (byteNum <= 3)\r
+               {\r
+                       pFIO->FIOSET[byteNum] = bitValue;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear bits for FIO port in byte accessible style\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  byteNum         Byte part number, should be in range from 0 to 3\r
+ * @param[in]  bitValue        Value that contains all bits in to clear, should\r
+ *                             be in range from 0 to 0xFF.\r
+ * @return             None\r
+ *\r
+ * Note:\r
+ * - For all bits that has been set as input direction, this function will\r
+ * not effect.\r
+ * - For all remaining bits that are not activated in bitValue (value '0')\r
+ * will not be effected by this function.\r
+ **********************************************************************/\r
+void FIO_ByteClearValue(uint8_t portNum, uint8_t byteNum, uint8_t bitValue)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = FIO_ByteGetPointer(portNum);\r
+\r
+       if (pFIO != NULL)\r
+       {\r
+               if (byteNum <= 3)\r
+               {\r
+                       pFIO->FIOCLR[byteNum] = bitValue;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read Current state on port pin that have input direction of GPIO\r
+ *                             in byte accessible style.\r
+ * @param[in]  portNum         Port number, in range from 0 to 4\r
+ * @param[in]  byteNum         Byte part number, should be in range from 0 to 3\r
+ * @return             Current value of FIO port pin of specified byte part.\r
+ * Note: Return value contain state of each port pin (bit) on that FIO regardless\r
+ * its direction is input or output.\r
+ **********************************************************************/\r
+uint8_t FIO_ByteReadValue(uint8_t portNum, uint8_t byteNum)\r
+{\r
+       GPIO_Byte_TypeDef *pFIO = FIO_ByteGetPointer(portNum);\r
+\r
+       if (pFIO != NULL)\r
+       {\r
+               if (byteNum <= 3)\r
+               {\r
+                       return (pFIO->FIOPIN[byteNum]);\r
+               }\r
+       }\r
+       return (0);\r
+}\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _GPIO */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2c.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2c.c
new file mode 100644 (file)
index 0000000..d309b1e
--- /dev/null
@@ -0,0 +1,1329 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_i2c.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_i2c.c\r
+* @brief       Contains all functions support for I2C firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup I2C\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_i2c.h"\r
+#include "lpc18xx_cgu.h"\r
+#include "lpc18xx_scu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _I2C\r
+\r
+\r
+/* Private Types -------------------------------------------------------------- */\r
+/** @defgroup I2C_Private_Types I2C Private Types\r
+ * @{\r
+ */\r
+#define SFSP2_3_CONFIGURE_I2C1_SDA                                     (0x00000001 | MD_ZI | MD_EZI)\r
+#define SFSP2_4_CONFIGURE_I2C1_SCL                                     (0x00000001 | MD_ZI | MD_EZI)\r
+#define SFSI2C0_CONFIGURE_STANDARD_FAST_MODE           (1<<3 | 1<<11)\r
+#define SFSI2C0_CONFIGURE_FASTPLUS_HIGHSPEED_MODE      (2<<1 | 1<<3 | 1<<7 | 1<<10 | 1<<11)\r
+\r
+/**\r
+ * @brief I2C device configuration structure type\r
+ */\r
+typedef struct\r
+{\r
+  uint32_t      txrx_setup;                                            /* Transmission setup */\r
+  int32_t              dir;                                                            /* Current direction phase, 0 - write, 1 - read */\r
+} I2C_CFG_T;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Private Variables ---------------------------------------------------------- */\r
+/**\r
+ * @brief II2C driver data for I2C0, I2C1\r
+ */\r
+static I2C_CFG_T i2cdat[3];\r
+\r
+static uint32_t I2C_MasterComplete[3];\r
+static uint32_t I2C_SlaveComplete[3];\r
+\r
+static uint32_t I2C_MonitorBufferIndex;\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+/* Get I2C number */\r
+static int32_t I2C_getNum(LPC_I2Cn_Type *I2Cx);\r
+\r
+/* Generate a start condition on I2C bus (in master mode only) */\r
+static uint32_t I2C_Start (LPC_I2Cn_Type *I2Cx);\r
+\r
+/* Generate a stop condition on I2C bus (in master mode only) */\r
+static void I2C_Stop (LPC_I2Cn_Type *I2Cx);\r
+\r
+/* I2C send byte subroutine */\r
+static uint32_t I2C_SendByte (LPC_I2Cn_Type *I2Cx, uint8_t databyte);\r
+\r
+/* I2C get byte subroutine */\r
+static uint32_t I2C_GetByte (LPC_I2Cn_Type *I2Cx, uint8_t *retdat, Bool ack);\r
+\r
+/*--------------------------------------------------------------------------------*/\r
+/********************************************************************//**\r
+ * @brief              Convert from I2C peripheral to number\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             I2C number or error code, could be:\r
+ *                                     - 0             :I2C0\r
+ *                                     - 1             :I2C1\r
+ *                                     - (-1)  :Error\r
+ *********************************************************************/\r
+static int32_t I2C_getNum(LPC_I2Cn_Type *I2Cx){\r
+       if (I2Cx == LPC_I2C0) {\r
+               return (0);\r
+       } else if (I2Cx == LPC_I2C1) {\r
+               return (1);\r
+       }\r
+       return (-1);\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Generate a start condition on I2C bus (in master mode only)\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             value of I2C status register after generate a start condition\r
+ *********************************************************************/\r
+static uint32_t I2C_Start (LPC_I2Cn_Type *I2Cx)\r
+{\r
+       I2Cx->CONSET = I2C_I2CONSET_STA;\r
+       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+\r
+       // Wait for complete\r
+       while (!(I2Cx->CONSET & I2C_I2CONSET_SI));\r
+       I2Cx->CONCLR = I2C_I2CONCLR_STAC;\r
+       return (I2Cx->STAT & I2C_STAT_CODE_BITMASK);\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Generate a stop condition on I2C bus (in master mode only)\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ *********************************************************************/\r
+static void I2C_Stop (LPC_I2Cn_Type *I2Cx)\r
+{\r
+\r
+       /* Make sure start bit is not active */\r
+       if (I2Cx->CONSET & I2C_I2CONSET_STA)\r
+       {\r
+               I2Cx->CONCLR = I2C_I2CONCLR_STAC;\r
+       }\r
+       I2Cx->CONSET = I2C_I2CONSET_STO;\r
+       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Send a byte\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  databyte        sent data\r
+ * @return             value of I2C status register after sending\r
+ *********************************************************************/\r
+static uint32_t I2C_SendByte (LPC_I2Cn_Type *I2Cx, uint8_t databyte)\r
+{\r
+       /* Make sure start bit is not active */\r
+       if (I2Cx->CONSET & I2C_I2CONSET_STA)\r
+       {\r
+               I2Cx->CONCLR = I2C_I2CONCLR_STAC;\r
+       }\r
+       I2Cx->DAT = databyte & I2C_I2DAT_BITMASK;\r
+       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+\r
+       while (!(I2Cx->CONSET & I2C_I2CONSET_SI));\r
+       return (I2Cx->STAT & I2C_STAT_CODE_BITMASK);\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Get a byte\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[out] retdat  pointer to return data\r
+ * @param[in]  ack             assert acknowledge or not, should be: TRUE/FALSE\r
+ * @return             value of I2C status register after sending\r
+ *********************************************************************/\r
+static uint32_t I2C_GetByte (LPC_I2Cn_Type *I2Cx, uint8_t *retdat, Bool ack)\r
+{\r
+       if (ack == TRUE)\r
+       {\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+       }\r
+       else\r
+       {\r
+               I2Cx->CONCLR = I2C_I2CONCLR_AAC;\r
+       }\r
+       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+\r
+       while (!(I2Cx->CONSET & I2C_I2CONSET_SI));\r
+       *retdat = (uint8_t) (I2Cx->DAT & I2C_I2DAT_BITMASK);\r
+       return (I2Cx->STAT & I2C_STAT_CODE_BITMASK);\r
+}\r
+\r
+/* End of Private Functions --------------------------------------------------- */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup I2C_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initializes the I2Cx peripheral with specified parameter.\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  clockrate Target clock rate value to initialized I2C\r
+ *                             peripheral (Hz)\r
+ * @return             None\r
+ *********************************************************************/\r
+void I2C_Init(LPC_I2Cn_Type *I2Cx, uint32_t clockrate)\r
+{\r
+       uint32_t tem;\r
+\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+\r
+       if (I2Cx==LPC_I2C0)\r
+       {\r
+               /* Set up clock for I2C0 module */\r
+               //LPC_CGU->BASE_VPB1_CLK = (SRC_PL160M_0<<24) | (1<<11);\r
+               CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_APB1);\r
+               /* Select weather standard, fast, fast plus mode*/\r
+               if(clockrate>=1000000)// Fast mode plus: 1MHz, high speed 3.4MHz\r
+                       LPC_SCU->SFSI2C0 = SFSI2C0_CONFIGURE_FASTPLUS_HIGHSPEED_MODE;\r
+               else                              // standard 100KHz, fast 400KHz\r
+                       LPC_SCU->SFSI2C0 = SFSI2C0_CONFIGURE_STANDARD_FAST_MODE;\r
+       }\r
+       else if (I2Cx==LPC_I2C1)\r
+       {\r
+               /* Set up clock for I2C1 module */\r
+               //LPC_CGU->BASE_VPB3_CLK = (SRC_PL160M_0<<24) | (1<<11);\r
+               CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_APB3);\r
+               /* Configure pin function for I2C1*/\r
+               LPC_SCU->SFSP2_3 = SFSP2_3_CONFIGURE_I2C1_SDA;                  /* SDA */\r
+               LPC_SCU->SFSP2_4 = SFSP2_4_CONFIGURE_I2C1_SCL;                  /* SCL */\r
+               /* Check if I2C1 run fast mode*/\r
+               if(clockrate != 400000)\r
+                       return;\r
+       }\r
+       else {\r
+               // Up-Support this device\r
+               return;\r
+       }\r
+\r
+    /* Set clock rate */\r
+       if(clockrate<1000)      //make sure SCLH,SCLL not exceed its 16bit value\r
+               return;\r
+       tem = CGU_GetPCLKFrequency(CGU_PERIPHERAL_M3CORE) / clockrate;\r
+       I2Cx->SCLH = (uint32_t)(tem / 2);\r
+       I2Cx->SCLL = (uint32_t)(tem - I2Cx->SCLH);\r
+    /* Set I2C operation to default */\r
+    I2Cx->CONCLR = (I2C_I2CONCLR_AAC |I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC | I2C_I2CONCLR_I2ENC);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-initializes the I2C peripheral registers to their\r
+ *                  default reset values.\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_DeInit(LPC_I2Cn_Type* I2Cx)\r
+{\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+\r
+       /* Disable I2C control */\r
+       I2Cx->CONCLR = I2C_I2CONCLR_I2ENC;\r
+\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable I2C peripheral's operation\r
+ * @param[in]  I2Cx I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  NewState New State of I2Cx peripheral's operation, should be:\r
+ *                                     - ENABLE        :enable I2C operation\r
+ *                                     - DISABLE       :disable I2C operation\r
+ * @return             none\r
+ **********************************************************************/\r
+void I2C_Cmd(LPC_I2Cn_Type* I2Cx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               I2Cx->CONSET = I2C_I2CONSET_I2EN;\r
+       }\r
+       else\r
+       {\r
+               I2Cx->CONCLR = I2C_I2CONCLR_I2ENC;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable interrupt for I2C peripheral\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  NewState        New State of I2C peripheral interrupt in NVIC core\r
+ *                             should be:\r
+ *                                     - ENABLE: enable interrupt for this I2C peripheral\r
+ *                                     - DISABLE: disable interrupt for this I2C peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_IntCmd (LPC_I2Cn_Type *I2Cx, Bool NewState)\r
+{\r
+       if (NewState)\r
+       {\r
+               if(I2Cx == LPC_I2C0)\r
+               {\r
+                       NVIC_EnableIRQ(I2C0_IRQn);\r
+               }\r
+               else if (I2Cx == LPC_I2C1)\r
+               {\r
+                       NVIC_EnableIRQ(I2C1_IRQn);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if(I2Cx == LPC_I2C0)\r
+               {\r
+                       NVIC_DisableIRQ(I2C0_IRQn);\r
+               }\r
+               else if (I2Cx == LPC_I2C1)\r
+               {\r
+                       NVIC_DisableIRQ(I2C1_IRQn);\r
+               }\r
+       }\r
+    return;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              General Master Interrupt handler for I2C peripheral\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_MasterHandler (LPC_I2Cn_Type  *I2Cx)\r
+{\r
+       int32_t tmp;\r
+       uint8_t returnCode;\r
+       I2C_M_SETUP_Type *txrx_setup;\r
+\r
+       tmp = I2C_getNum(I2Cx);\r
+       txrx_setup = (I2C_M_SETUP_Type *) i2cdat[tmp].txrx_setup;\r
+\r
+       returnCode = (I2Cx->STAT & I2C_STAT_CODE_BITMASK);\r
+       // Save current status\r
+       txrx_setup->status = returnCode;\r
+       // there's no relevant information\r
+       if (returnCode == I2C_I2STAT_NO_INF){\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               return;\r
+       }\r
+\r
+       /* ----------------------------- TRANSMIT PHASE --------------------------*/\r
+       if (i2cdat[tmp].dir == 0){\r
+               switch (returnCode)\r
+               {\r
+               /* A start/repeat start condition has been transmitted -------------------*/\r
+               case I2C_I2STAT_M_TX_START:\r
+               case I2C_I2STAT_M_TX_RESTART:\r
+                       I2Cx->CONCLR = I2C_I2CONCLR_STAC;\r
+                       /*\r
+                        * If there's any transmit data, then start to\r
+                        * send SLA+W right now, otherwise check whether if there's\r
+                        * any receive data for next state.\r
+                        */\r
+                       if ((txrx_setup->tx_data != NULL) && (txrx_setup->tx_length != 0)){\r
+                               I2Cx->DAT = (txrx_setup->sl_addr7bit << 1);\r
+                               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                       } else {\r
+                               goto next_stage;\r
+                       }\r
+                       break;\r
+\r
+               /* SLA+W has been transmitted, ACK has been received ----------------------*/\r
+               case I2C_I2STAT_M_TX_SLAW_ACK:\r
+               /* Data has been transmitted, ACK has been received */\r
+               case I2C_I2STAT_M_TX_DAT_ACK:\r
+                       /* Send more data */\r
+                       if ((txrx_setup->tx_count < txrx_setup->tx_length) \\r
+                                       && (txrx_setup->tx_data != NULL)){\r
+                               I2Cx->DAT =  *(uint8_t *)(txrx_setup->tx_data + txrx_setup->tx_count);\r
+                               txrx_setup->tx_count++;\r
+                               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                       }\r
+                       // no more data, switch to next stage\r
+                       else {\r
+next_stage:\r
+                               // change direction\r
+                               i2cdat[tmp].dir = 1;\r
+                               // Check if any data to receive\r
+                               if ((txrx_setup->rx_length != 0) && (txrx_setup->rx_data != NULL)){\r
+                                               // check whether if we need to issue an repeat start\r
+                                               if ((txrx_setup->tx_length != 0) && (txrx_setup->tx_data != NULL)){\r
+                                                       // Send out an repeat start command\r
+                                                       I2Cx->CONSET = I2C_I2CONSET_STA;\r
+                                                       I2Cx->CONCLR = I2C_I2CONCLR_AAC | I2C_I2CONCLR_SIC;\r
+                                               }\r
+                                               // Don't need issue an repeat start, just goto send SLA+R\r
+                                               else {\r
+                                                       goto send_slar;\r
+                                               }\r
+                               }\r
+                               // no more data send, the go to end stage now\r
+                               else {\r
+                                       // success, goto end stage\r
+                                       txrx_setup->status |= I2C_SETUP_STATUS_DONE;\r
+                                       goto end_stage;\r
+                               }\r
+                       }\r
+                       break;\r
+\r
+               /* SLA+W has been transmitted, NACK has been received ----------------------*/\r
+               case I2C_I2STAT_M_TX_SLAW_NACK:\r
+               /* Data has been transmitted, NACK has been received -----------------------*/\r
+               case I2C_I2STAT_M_TX_DAT_NACK:\r
+                       // update status\r
+                       txrx_setup->status |= I2C_SETUP_STATUS_NOACKF;\r
+                       goto retry;\r
+               /* Arbitration lost in SLA+R/W or Data bytes -------------------------------*/\r
+               case I2C_I2STAT_M_TX_ARB_LOST:\r
+                       // update status\r
+                       txrx_setup->status |= I2C_SETUP_STATUS_ARBF;\r
+               default:\r
+                       goto retry;\r
+               }\r
+       }\r
+\r
+       /* ----------------------------- RECEIVE PHASE --------------------------*/\r
+       else if (i2cdat[tmp].dir == 1){\r
+               switch (returnCode){\r
+                       /* A start/repeat start condition has been transmitted ---------------------*/\r
+               case I2C_I2STAT_M_RX_START:\r
+               case I2C_I2STAT_M_RX_RESTART:\r
+                       I2Cx->CONCLR = I2C_I2CONCLR_STAC;\r
+                       /*\r
+                        * If there's any receive data, then start to\r
+                        * send SLA+R right now, otherwise check whether if there's\r
+                        * any receive data for end of state.\r
+                        */\r
+                       if ((txrx_setup->rx_data != NULL) && (txrx_setup->rx_length != 0)){\r
+send_slar:\r
+                               I2Cx->DAT = (txrx_setup->sl_addr7bit << 1) | 0x01;\r
+                               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                       } else {\r
+                               // Success, goto end stage\r
+                               txrx_setup->status |= I2C_SETUP_STATUS_DONE;\r
+                               goto end_stage;\r
+                       }\r
+                       break;\r
+\r
+               /* SLA+R has been transmitted, ACK has been received -----------------*/\r
+               case I2C_I2STAT_M_RX_SLAR_ACK:\r
+                       if (txrx_setup->rx_count < (txrx_setup->rx_length - 1)) {\r
+                               /*Data will be received,  ACK will be return*/\r
+                               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                       }\r
+                       else {\r
+                               /*Last data will be received,  NACK will be return*/\r
+                               I2Cx->CONCLR = I2C_I2CONSET_AA;\r
+                       }\r
+                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                       break;\r
+\r
+               /* Data has been received, ACK has been returned ----------------------*/\r
+               case I2C_I2STAT_M_RX_DAT_ACK:\r
+                       // Note save data and increase counter first, then check later\r
+                       /* Save data  */\r
+                       if ((txrx_setup->rx_data != NULL) && (txrx_setup->rx_count < txrx_setup->rx_length)){\r
+                               *(uint8_t *)(txrx_setup->rx_data + txrx_setup->rx_count) = (I2Cx->DAT & I2C_I2DAT_BITMASK);\r
+                               txrx_setup->rx_count++;\r
+                       }\r
+                       if (txrx_setup->rx_count < (txrx_setup->rx_length - 1)) {\r
+                               /*Data will be received,  ACK will be return*/\r
+                               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                       }\r
+                       else {\r
+                               /*Last data will be received,  NACK will be return*/\r
+                               I2Cx->CONCLR = I2C_I2CONSET_AA;\r
+                       }\r
+\r
+                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                       break;\r
+\r
+               /* Data has been received, NACK has been return -------------------------*/\r
+               case I2C_I2STAT_M_RX_DAT_NACK:\r
+                       /* Save the last data */\r
+                       if ((txrx_setup->rx_data != NULL) && (txrx_setup->rx_count < txrx_setup->rx_length)){\r
+                               *(uint8_t *)(txrx_setup->rx_data + txrx_setup->rx_count) = (I2Cx->DAT & I2C_I2DAT_BITMASK);\r
+                               txrx_setup->rx_count++;\r
+                       }\r
+                       // success, go to end stage\r
+                       txrx_setup->status |= I2C_SETUP_STATUS_DONE;\r
+                       goto end_stage;\r
+\r
+               /* SLA+R has been transmitted, NACK has been received ------------------*/\r
+               case I2C_I2STAT_M_RX_SLAR_NACK:\r
+                       // update status\r
+                       txrx_setup->status |= I2C_SETUP_STATUS_NOACKF;\r
+                       goto retry;\r
+\r
+               /* Arbitration lost ----------------------------------------------------*/\r
+               case I2C_I2STAT_M_RX_ARB_LOST:\r
+                       // update status\r
+                       txrx_setup->status |= I2C_SETUP_STATUS_ARBF;\r
+               default:\r
+retry:\r
+                       // check if retransmission is available\r
+                       if (txrx_setup->retransmissions_count < txrx_setup->retransmissions_max){\r
+                               // Clear tx count\r
+                               txrx_setup->tx_count = 0;\r
+                               I2Cx->CONSET = I2C_I2CONSET_STA;\r
+                               I2Cx->CONCLR = I2C_I2CONCLR_AAC | I2C_I2CONCLR_SIC;\r
+                               txrx_setup->retransmissions_count++;\r
+                       }\r
+                       // End of stage\r
+                       else {\r
+end_stage:\r
+                               // Disable interrupt\r
+                               I2C_IntCmd(I2Cx, FALSE);\r
+                               // Send stop\r
+                               I2C_Stop(I2Cx);\r
+\r
+                               I2C_MasterComplete[tmp] = TRUE;\r
+                       }\r
+                       break;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              General Slave Interrupt handler for I2C peripheral\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_SlaveHandler (LPC_I2Cn_Type  *I2Cx)\r
+{\r
+       int32_t tmp;\r
+       uint8_t returnCode;\r
+       I2C_S_SETUP_Type *txrx_setup;\r
+       uint32_t timeout;\r
+\r
+       tmp = I2C_getNum(I2Cx);\r
+       txrx_setup = (I2C_S_SETUP_Type *) i2cdat[tmp].txrx_setup;\r
+\r
+       returnCode = (I2Cx->STAT & I2C_STAT_CODE_BITMASK);\r
+       // Save current status\r
+       txrx_setup->status = returnCode;\r
+       // there's no relevant information\r
+       if (returnCode == I2C_I2STAT_NO_INF){\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               return;\r
+       }\r
+\r
+\r
+       switch (returnCode)\r
+       {\r
+\r
+       /* No status information */\r
+       case I2C_I2STAT_NO_INF:\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               break;\r
+\r
+       /* Reading phase -------------------------------------------------------- */\r
+       /* Own SLA+R has been received, ACK has been returned */\r
+       case I2C_I2STAT_S_RX_SLAW_ACK:\r
+       /* General call address has been received, ACK has been returned */\r
+       case I2C_I2STAT_S_RX_GENCALL_ACK:\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               break;\r
+\r
+       /* Previously addressed with own SLA;\r
+        * DATA byte has been received;\r
+        * ACK has been returned */\r
+       case I2C_I2STAT_S_RX_PRE_SLA_DAT_ACK:\r
+       /* DATA has been received, ACK hasn been return */\r
+       case I2C_I2STAT_S_RX_PRE_GENCALL_DAT_ACK:\r
+               /*\r
+                * All data bytes that over-flow the specified receive\r
+                * data length, just ignore them.\r
+                */\r
+               if ((txrx_setup->rx_count < txrx_setup->rx_length) \\r
+                               && (txrx_setup->rx_data != NULL)){\r
+                       *(uint8_t *)(txrx_setup->rx_data + txrx_setup->rx_count) = (uint8_t)I2Cx->DAT;\r
+                       txrx_setup->rx_count++;\r
+               }\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               break;\r
+\r
+       /* Previously addressed with own SLA;\r
+        * DATA byte has been received;\r
+        * NOT ACK has been returned */\r
+       case I2C_I2STAT_S_RX_PRE_SLA_DAT_NACK:\r
+       /* DATA has been received, NOT ACK has been returned */\r
+       case I2C_I2STAT_S_RX_PRE_GENCALL_DAT_NACK:\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               break;\r
+\r
+       /*\r
+        * Note that: Return code only let us know a stop condition mixed\r
+        * with a repeat start condition in the same code value.\r
+        * So we should provide a time-out. In case this is really a stop\r
+        * condition, this will return back after time out condition. Otherwise,\r
+        * next session that is slave receive data will be completed.\r
+        */\r
+\r
+       /* A Stop or a repeat start condition */\r
+       case I2C_I2STAT_S_RX_STA_STO_SLVREC_SLVTRX:\r
+               // Temporally lock the interrupt for timeout condition\r
+               I2C_IntCmd(I2Cx, FALSE);\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               // enable time out\r
+               timeout = I2C_SLAVE_TIME_OUT;\r
+               while(1){\r
+                       if (I2Cx->CONSET & I2C_I2CONSET_SI){\r
+                               // re-Enable interrupt\r
+                               I2C_IntCmd(I2Cx, TRUE);\r
+                               break;\r
+                       } else {\r
+                               timeout--;\r
+                               if (timeout == 0){\r
+                                       // timeout occur, it's really a stop condition\r
+                                       txrx_setup->status |= I2C_SETUP_STATUS_DONE;\r
+                                       goto s_int_end;\r
+                               }\r
+                       }\r
+               }\r
+               break;\r
+\r
+       /* Writing phase -------------------------------------------------------- */\r
+       /* Own SLA+R has been received, ACK has been returned */\r
+       case I2C_I2STAT_S_TX_SLAR_ACK:\r
+       /* Data has been transmitted, ACK has been received */\r
+       case I2C_I2STAT_S_TX_DAT_ACK:\r
+               /*\r
+                * All data bytes that over-flow the specified receive\r
+                * data length, just ignore them.\r
+                */\r
+               if ((txrx_setup->tx_count < txrx_setup->tx_length) \\r
+                               && (txrx_setup->tx_data != NULL)){\r
+                       I2Cx->DAT = *(uint8_t *) (txrx_setup->tx_data + txrx_setup->tx_count);\r
+                       txrx_setup->tx_count++;\r
+               }\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               break;\r
+\r
+       /* Data has been transmitted, NACK has been received,\r
+        * that means there's no more data to send, exit now */\r
+       /*\r
+        * Note: Don't wait for stop event since in slave transmit mode,\r
+        * since there no proof lets us know when a stop signal has been received\r
+        * on slave side.\r
+        */\r
+       case I2C_I2STAT_S_TX_DAT_NACK:\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               txrx_setup->status |= I2C_SETUP_STATUS_DONE;\r
+               goto s_int_end;\r
+\r
+       // Other status must be captured\r
+       default:\r
+s_int_end:\r
+               // Disable interrupt\r
+               I2C_IntCmd(I2Cx, FALSE);\r
+               I2Cx->CONCLR = I2C_I2CONCLR_AAC | I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC;\r
+               I2C_SlaveComplete[tmp] = TRUE;\r
+               break;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Transmit and Receive data in master mode\r
+ * @param[in]  I2Cx I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  TransferCfg     Pointer to a I2C_M_SETUP_Type structure that\r
+ *                             contains specified information about the configuration\r
+ *                             for master transfer.\r
+ * @param[in]  Opt     a I2C_TRANSFER_OPT_Type type that selected for interrupt\r
+ *                             or polling mode.\r
+ * @return             Transmit/receive status, should be:\r
+ *                                     - SUCCESS\r
+ *                                     - ERROR\r
+ *\r
+ * Note:\r
+ * - In case of using I2C to transmit data only, either transmit length set to 0\r
+ * or transmit data pointer set to NULL.\r
+ * - In case of using I2C to receive data only, either receive length set to 0\r
+ * or receive data pointer set to NULL.\r
+ * - In case of using I2C to transmit followed by receive data, transmit length,\r
+ * transmit data pointer, receive length and receive data pointer should be set\r
+ * corresponding.\r
+ **********************************************************************/\r
+Status I2C_MasterTransferData(LPC_I2Cn_Type *I2Cx, I2C_M_SETUP_Type *TransferCfg, \\r
+                                                               I2C_TRANSFER_OPT_Type Opt)\r
+{\r
+       uint8_t *txdat;\r
+       uint8_t *rxdat;\r
+       uint32_t CodeStatus;\r
+       uint8_t tmp;\r
+\r
+       // reset all default state\r
+       txdat = (uint8_t *) TransferCfg->tx_data;\r
+       rxdat = (uint8_t *) TransferCfg->rx_data;\r
+       // Reset I2C setup value to default state\r
+       TransferCfg->tx_count = 0;\r
+       TransferCfg->rx_count = 0;\r
+       TransferCfg->status = 0;\r
+\r
+       if (Opt == I2C_TRANSFER_POLLING){\r
+\r
+               /* First Start condition -------------------------------------------------------------- */\r
+               TransferCfg->retransmissions_count = 0;\r
+retry:\r
+               // reset all default state\r
+               txdat = (uint8_t *) TransferCfg->tx_data;\r
+               rxdat = (uint8_t *) TransferCfg->rx_data;\r
+               // Reset I2C setup value to default state\r
+               TransferCfg->tx_count = 0;\r
+               TransferCfg->rx_count = 0;\r
+               CodeStatus = 0;\r
+\r
+               // Start command\r
+               CodeStatus = I2C_Start(I2Cx);\r
+               if ((CodeStatus != I2C_I2STAT_M_TX_START) \\r
+                               && (CodeStatus != I2C_I2STAT_M_TX_RESTART)){\r
+                       TransferCfg->retransmissions_count++;\r
+                       if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                               // save status\r
+                               TransferCfg->status = CodeStatus;\r
+                               goto error;\r
+                       } else {\r
+                               goto retry;\r
+                       }\r
+               }\r
+\r
+               /* In case of sending data first --------------------------------------------------- */\r
+               if ((TransferCfg->tx_length != 0) && (TransferCfg->tx_data != NULL)){\r
+\r
+                       /* Send slave address + WR direction bit = 0 ----------------------------------- */\r
+                       CodeStatus = I2C_SendByte(I2Cx, (TransferCfg->sl_addr7bit << 1));\r
+                       if (CodeStatus != I2C_I2STAT_M_TX_SLAW_ACK){\r
+                               TransferCfg->retransmissions_count++;\r
+                               if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                       // save status\r
+                                       TransferCfg->status = CodeStatus | I2C_SETUP_STATUS_NOACKF;\r
+                                       goto error;\r
+                               } else {\r
+                                       goto retry;\r
+                               }\r
+                       }\r
+\r
+                       /* Send a number of data bytes ---------------------------------------- */\r
+                       while (TransferCfg->tx_count < TransferCfg->tx_length)\r
+                       {\r
+                               CodeStatus = I2C_SendByte(I2Cx, *txdat);\r
+                               if (CodeStatus != I2C_I2STAT_M_TX_DAT_ACK){\r
+                                       TransferCfg->retransmissions_count++;\r
+                                       if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                               // save status\r
+                                               TransferCfg->status = CodeStatus | I2C_SETUP_STATUS_NOACKF;\r
+                                               goto error;\r
+                                       } else {\r
+                                               goto retry;\r
+                                       }\r
+                               }\r
+\r
+                               txdat++;\r
+                               TransferCfg->tx_count++;\r
+                       }\r
+               }\r
+\r
+               /* Second Start condition (Repeat Start) ------------------------------------------- */\r
+               if ((TransferCfg->tx_length != 0) && (TransferCfg->tx_data != NULL) \\r
+                               && (TransferCfg->rx_length != 0) && (TransferCfg->rx_data != NULL)){\r
+\r
+                       CodeStatus = I2C_Start(I2Cx);\r
+                       if ((CodeStatus != I2C_I2STAT_M_RX_START) \\r
+                                       && (CodeStatus != I2C_I2STAT_M_RX_RESTART)){\r
+                               TransferCfg->retransmissions_count++;\r
+                               if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                       // Update status\r
+                                       TransferCfg->status = CodeStatus;\r
+                                       goto error;\r
+                               } else {\r
+                                       goto retry;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               /* Then, start reading after sending data -------------------------------------- */\r
+               if ((TransferCfg->rx_length != 0) && (TransferCfg->rx_data != NULL)){\r
+                       /* Send slave address + RD direction bit = 1 ----------------------------------- */\r
+\r
+                       CodeStatus = I2C_SendByte(I2Cx, ((TransferCfg->sl_addr7bit << 1) | 0x01));\r
+                       if (CodeStatus != I2C_I2STAT_M_RX_SLAR_ACK){\r
+                               TransferCfg->retransmissions_count++;\r
+                               if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                       // update status\r
+                                       TransferCfg->status = CodeStatus | I2C_SETUP_STATUS_NOACKF;\r
+                                       goto error;\r
+                               } else {\r
+                                       goto retry;\r
+                               }\r
+                       }\r
+\r
+                       /* Receive a number of data bytes ------------------------------------------------- */\r
+                       while (TransferCfg->rx_count < TransferCfg->rx_length){\r
+\r
+                               /*\r
+                                * Note that: if data length is only one, the master should not\r
+                                * issue an ACK signal on bus after reading to avoid of next data frame\r
+                                * on slave side\r
+                                */\r
+                               if (TransferCfg->rx_count < (TransferCfg->rx_length - 1)){\r
+                                       // Issue an ACK signal for next data frame\r
+                                       CodeStatus = I2C_GetByte(I2Cx, &tmp, TRUE);\r
+                                       if (CodeStatus != I2C_I2STAT_M_RX_DAT_ACK){\r
+                                               TransferCfg->retransmissions_count++;\r
+                                               if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                                       // update status\r
+                                                       TransferCfg->status = CodeStatus;\r
+                                                       goto error;\r
+                                               } else {\r
+                                                       goto retry;\r
+                                               }\r
+                                       }\r
+                               } else {\r
+                                       // Do not issue an ACK signal\r
+                                       CodeStatus = I2C_GetByte(I2Cx, &tmp, FALSE);\r
+                                       if (CodeStatus != I2C_I2STAT_M_RX_DAT_NACK){\r
+                                               TransferCfg->retransmissions_count++;\r
+                                               if (TransferCfg->retransmissions_count > TransferCfg->retransmissions_max){\r
+                                                       // update status\r
+                                                       TransferCfg->status = CodeStatus;\r
+                                                       goto error;\r
+                                               } else {\r
+                                                       goto retry;\r
+                                               }\r
+                                       }\r
+                               }\r
+                               *rxdat++ = tmp;\r
+                               TransferCfg->rx_count++;\r
+                       }\r
+               }\r
+\r
+               /* Send STOP condition ------------------------------------------------- */\r
+               I2C_Stop(I2Cx);\r
+               return SUCCESS;\r
+\r
+error:\r
+               // Send stop condition\r
+               I2C_Stop(I2Cx);\r
+               return ERROR;\r
+       }\r
+\r
+       else if (Opt == I2C_TRANSFER_INTERRUPT){\r
+               // Setup tx_rx data, callback and interrupt handler\r
+               tmp = I2C_getNum(I2Cx);\r
+               i2cdat[tmp].txrx_setup = (uint32_t) TransferCfg;\r
+               // Set direction phase, write first\r
+               i2cdat[tmp].dir = 0;\r
+\r
+               /* First Start condition -------------------------------------------------------------- */\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+               I2Cx->CONSET = I2C_I2CONSET_STA;\r
+               I2C_IntCmd(I2Cx, TRUE);\r
+\r
+               return (SUCCESS);\r
+       }\r
+\r
+       return ERROR;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Receive and Transmit data in slave mode\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  TransferCfg             Pointer to a I2C_S_SETUP_Type structure that\r
+ *                             contains specified information about the configuration for\r
+ *                             master transfer.\r
+ * @param[in]  Opt     I2C_TRANSFER_OPT_Type type that selected for interrupt\r
+ *                             or polling mode.\r
+ * @return             Transmit/receive status, could be:\r
+ *                                     - SUCCESS\r
+ *                                     - ERRRO\r
+ *\r
+ * Note:\r
+ * The mode of slave's operation depends on the command sent from master on\r
+ * the I2C bus. If the master send a SLA+W command, this sub-routine will\r
+ * use receive data length and receive data pointer. If the master send a SLA+R\r
+ * command, this sub-routine will use transmit data length and transmit data\r
+ * pointer.\r
+ * If the master issue an repeat start command or a stop command, the slave will\r
+ * enable an time out condition, during time out condition, if there's no activity\r
+ * on I2C bus, the slave will exit, otherwise (i.e. the master send a SLA+R/W),\r
+ * the slave then switch to relevant operation mode. The time out should be used\r
+ * because the return status code can not show difference from stop and repeat\r
+ * start command in slave operation.\r
+ * In case of the expected data length from master is greater than data length\r
+ * that slave can support:\r
+ * - In case of reading operation (from master): slave will return I2C_I2DAT_IDLE_CHAR\r
+ * value.\r
+ * - In case of writing operation (from master): slave will ignore remain data from master.\r
+ **********************************************************************/\r
+Status I2C_SlaveTransferData(LPC_I2Cn_Type *I2Cx, I2C_S_SETUP_Type *TransferCfg, \\r
+                                                               I2C_TRANSFER_OPT_Type Opt)\r
+{\r
+       uint8_t *txdat;\r
+       uint8_t *rxdat;\r
+       uint32_t CodeStatus;\r
+       uint32_t timeout;\r
+       int32_t time_en;\r
+       int32_t tmp;\r
+\r
+       // reset all default state\r
+       txdat = (uint8_t *) TransferCfg->tx_data;\r
+       rxdat = (uint8_t *) TransferCfg->rx_data;\r
+       // Reset I2C setup value to default state\r
+       TransferCfg->tx_count = 0;\r
+       TransferCfg->rx_count = 0;\r
+       TransferCfg->status = 0;\r
+\r
+\r
+       // Polling option\r
+       if (Opt == I2C_TRANSFER_POLLING){\r
+\r
+               /* Set AA bit to ACK command on I2C bus */\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               /* Clear SI bit to be ready ... */\r
+               I2Cx->CONCLR = (I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC);\r
+\r
+               time_en = 0;\r
+               timeout = 0;\r
+\r
+               while (1)\r
+               {\r
+                       /* Check SI flag ready */\r
+                       if (I2Cx->CONSET & I2C_I2CONSET_SI)\r
+                       {\r
+                               time_en = 0;\r
+\r
+                               switch (CodeStatus = (I2Cx->STAT & I2C_STAT_CODE_BITMASK))\r
+                               {\r
+\r
+                               /* No status information */\r
+                               case I2C_I2STAT_NO_INF:\r
+                                       I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       break;\r
+\r
+                               /* Reading phase -------------------------------------------------------- */\r
+                               /* Own SLA+R has been received, ACK has been returned */\r
+                               case I2C_I2STAT_S_RX_SLAW_ACK:\r
+                               /* General call address has been received, ACK has been returned */\r
+                               case I2C_I2STAT_S_RX_GENCALL_ACK:\r
+                                       I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       break;\r
+\r
+                               /* Previously addressed with own SLA;\r
+                                * DATA byte has been received;\r
+                                * ACK has been returned */\r
+                               case I2C_I2STAT_S_RX_PRE_SLA_DAT_ACK:\r
+                               /* DATA has been received, ACK hasn been return */\r
+                               case I2C_I2STAT_S_RX_PRE_GENCALL_DAT_ACK:\r
+                                       /*\r
+                                        * All data bytes that over-flow the specified receive\r
+                                        * data length, just ignore them.\r
+                                        */\r
+                                       if ((TransferCfg->rx_count < TransferCfg->rx_length) \\r
+                                                       && (TransferCfg->rx_data != NULL)){\r
+                                               *rxdat++ = (uint8_t)I2Cx->DAT;\r
+                                               TransferCfg->rx_count++;\r
+                                       }\r
+                                       I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       break;\r
+\r
+                               /* Previously addressed with own SLA;\r
+                                * DATA byte has been received;\r
+                                * NOT ACK has been returned */\r
+                               case I2C_I2STAT_S_RX_PRE_SLA_DAT_NACK:\r
+                               /* DATA has been received, NOT ACK has been returned */\r
+                               case I2C_I2STAT_S_RX_PRE_GENCALL_DAT_NACK:\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       break;\r
+\r
+                               /*\r
+                                * Note that: Return code only let us know a stop condition mixed\r
+                                * with a repeat start condition in the same code value.\r
+                                * So we should provide a time-out. In case this is really a stop\r
+                                * condition, this will return back after time out condition. Otherwise,\r
+                                * next session that is slave receive data will be completed.\r
+                                */\r
+\r
+                               /* A Stop or a repeat start condition */\r
+                               case I2C_I2STAT_S_RX_STA_STO_SLVREC_SLVTRX:\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       // enable time out\r
+                                       time_en = 1;\r
+                                       timeout = 0;\r
+                                       break;\r
+\r
+                               /* Writing phase -------------------------------------------------------- */\r
+                               /* Own SLA+R has been received, ACK has been returned */\r
+                               case I2C_I2STAT_S_TX_SLAR_ACK:\r
+                               /* Data has been transmitted, ACK has been received */\r
+                               case I2C_I2STAT_S_TX_DAT_ACK:\r
+                                       /*\r
+                                        * All data bytes that over-flow the specified receive\r
+                                        * data length, just ignore them.\r
+                                        */\r
+                                       if ((TransferCfg->tx_count < TransferCfg->tx_length) \\r
+                                                       && (TransferCfg->tx_data != NULL)){\r
+                                               I2Cx->DAT = *txdat++;\r
+                                               TransferCfg->tx_count++;\r
+                                       }\r
+                                       I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       break;\r
+\r
+                               /* Data has been transmitted, NACK has been received,\r
+                                * that means there's no more data to send, exit now */\r
+                               /*\r
+                                * Note: Don't wait for stop event since in slave transmit mode,\r
+                                * since there no proof lets us know when a stop signal has been received\r
+                                * on slave side.\r
+                                */\r
+                               case I2C_I2STAT_S_TX_DAT_NACK:\r
+                                       I2Cx->CONSET = I2C_I2CONSET_AA;\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       // enable time out\r
+                                       time_en = 1;\r
+                                       timeout = 0;\r
+                                       break;\r
+\r
+                               // Other status must be captured\r
+                               default:\r
+                                       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+                                       goto s_error;\r
+                               }\r
+                       } else if (time_en){\r
+                               if (timeout++ > I2C_SLAVE_TIME_OUT){\r
+                                       // it's really a stop condition, goto end stage\r
+                                       goto s_end_stage;\r
+                               }\r
+                       }\r
+               }\r
+\r
+s_end_stage:\r
+               /* Clear AA bit to disable ACK on I2C bus */\r
+               I2Cx->CONCLR = I2C_I2CONCLR_AAC;\r
+               // Check if there's no error during operation\r
+               // Update status\r
+               TransferCfg->status = CodeStatus | I2C_SETUP_STATUS_DONE;\r
+               return SUCCESS;\r
+\r
+s_error:\r
+               /* Clear AA bit to disable ACK on I2C bus */\r
+               I2Cx->CONCLR = I2C_I2CONCLR_AAC;\r
+               // Update status\r
+               TransferCfg->status = CodeStatus;\r
+               return ERROR;\r
+       }\r
+\r
+       else if (Opt == I2C_TRANSFER_INTERRUPT){\r
+               // Setup tx_rx data, callback and interrupt handler\r
+               tmp = I2C_getNum(I2Cx);\r
+               i2cdat[tmp].txrx_setup = (uint32_t) TransferCfg;\r
+               // Set direction phase, read first\r
+               i2cdat[tmp].dir = 1;\r
+\r
+               // Enable AA\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC;\r
+               I2C_IntCmd(I2Cx, TRUE);\r
+\r
+               return (SUCCESS);\r
+       }\r
+\r
+       return ERROR;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Own slave address in I2C peripheral corresponding to\r
+ *                             parameter specified in OwnSlaveAddrConfigStruct.\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  OwnSlaveAddrConfigStruct        Pointer to a I2C_OWNSLAVEADDR_CFG_Type\r
+ *                             structure that contains the configuration information for the\r
+ *              specified I2C slave address.\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_SetOwnSlaveAddr(LPC_I2Cn_Type *I2Cx, I2C_OWNSLAVEADDR_CFG_Type *OwnSlaveAddrConfigStruct)\r
+{\r
+       uint32_t tmp;\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+       CHECK_PARAM(PARAM_I2C_SLAVEADDR_CH(OwnSlaveAddrConfigStruct->SlaveAddrChannel));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(OwnSlaveAddrConfigStruct->GeneralCallState));\r
+\r
+       tmp = (((uint32_t)(OwnSlaveAddrConfigStruct->SlaveAddr_7bit << 1)) \\r
+                       | ((OwnSlaveAddrConfigStruct->GeneralCallState == ENABLE) ? 0x01 : 0x00))& I2C_I2ADR_BITMASK;\r
+       switch (OwnSlaveAddrConfigStruct->SlaveAddrChannel)\r
+       {\r
+       case 0:\r
+               I2Cx->ADR0 = tmp;\r
+               I2Cx->MASK[0] = I2C_I2MASK_MASK((uint32_t) \\r
+                               (OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));\r
+               break;\r
+       case 1:\r
+               I2Cx->ADR1 = tmp;\r
+               I2Cx->MASK[1] = I2C_I2MASK_MASK((uint32_t) \\r
+                               (OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));\r
+               break;\r
+       case 2:\r
+               I2Cx->ADR2 = tmp;\r
+               I2Cx->MASK[2] = I2C_I2MASK_MASK((uint32_t) \\r
+                               (OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));\r
+               break;\r
+       case 3:\r
+               I2Cx->ADR3 = tmp;\r
+               I2Cx->MASK[3] = I2C_I2MASK_MASK((uint32_t) \\r
+                               (OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));\r
+               break;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures functionality in I2C monitor mode\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  MonitorCfgType Monitor Configuration type, should be:\r
+ *                                     - I2C_MONITOR_CFG_SCL_OUTPUT    :I2C module can 'stretch'\r
+ *                             the clock line (hold it low) until it has had time to respond\r
+ *                             to an I2C interrupt.\r
+ *                                     - I2C_MONITOR_CFG_MATCHALL              :When this bit is set to '1'\r
+ *                             and the I2C is in monitor mode, an interrupt will be generated\r
+ *                             on ANY address received.\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE        :Enable this function.\r
+ *                                     - DISABLE       :Disable this function.\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_MonitorModeConfig(LPC_I2Cn_Type *I2Cx, uint32_t MonitorCfgType, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+       CHECK_PARAM(PARAM_I2C_MONITOR_CFG(MonitorCfgType));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               I2Cx->MMCTRL |= MonitorCfgType;\r
+       }\r
+       else\r
+       {\r
+               I2Cx->MMCTRL &= (~MonitorCfgType) & I2C_I2MMCTRL_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable I2C monitor mode\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE        :Enable monitor mode.\r
+ *                                     - DISABLE       :Disable monitor mode.\r
+ * @return             None\r
+ **********************************************************************/\r
+void I2C_MonitorModeCmd(LPC_I2Cn_Type *I2Cx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               I2Cx->MMCTRL |= I2C_I2MMCTRL_MM_ENA;\r
+               I2Cx->CONSET = I2C_I2CONSET_AA;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC;\r
+       }\r
+       else\r
+       {\r
+               I2Cx->MMCTRL &= (~I2C_I2MMCTRL_MM_ENA) & I2C_I2MMCTRL_BITMASK;\r
+               I2Cx->CONCLR = I2C_I2CONCLR_SIC | I2C_I2CONCLR_STAC | I2C_I2CONCLR_AAC;\r
+       }\r
+       I2C_MonitorBufferIndex = 0;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get data from I2C data buffer in monitor mode.\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ * Note:       In monitor mode, the I2C module may lose the ability to stretch\r
+ * the clock (stall the bus) if the ENA_SCL bit is not set. This means that\r
+ * the processor will have a limited amount of time to read the contents of\r
+ * the data received on the bus. If the processor reads the I2DAT shift\r
+ * register, as it ordinarily would, it could have only one bit-time to\r
+ * respond to the interrupt before the received data is overwritten by\r
+ * new data.\r
+ **********************************************************************/\r
+uint8_t I2C_MonitorGetDatabuffer(LPC_I2Cn_Type *I2Cx)\r
+{\r
+       CHECK_PARAM(PARAM_I2Cx(I2Cx));\r
+       return ((uint8_t)(I2Cx->DATA_BUFFER));\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get data from I2C data buffer in monitor mode.\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             None\r
+ * Note:       In monitor mode, the I2C module may lose the ability to stretch\r
+ * the clock (stall the bus) if the ENA_SCL bit is not set. This means that\r
+ * the processor will have a limited amount of time to read the contents of\r
+ * the data received on the bus. If the processor reads the I2DAT shift\r
+ * register, as it ordinarily would, it could have only one bit-time to\r
+ * respond to the interrupt before the received data is overwritten by\r
+ * new data.\r
+ **********************************************************************/\r
+BOOL_8 I2C_MonitorHandler(LPC_I2Cn_Type *I2Cx, uint8_t *buffer, uint32_t size)\r
+{\r
+       BOOL_8 ret=FALSE;\r
+\r
+       I2Cx->CONCLR = I2C_I2CONCLR_SIC;\r
+\r
+       buffer[I2C_MonitorBufferIndex] = (uint8_t)(I2Cx->DATA_BUFFER);\r
+       I2C_MonitorBufferIndex++;\r
+       if(I2C_MonitorBufferIndex >= size)\r
+       {\r
+               ret = TRUE;\r
+       }\r
+       return ret;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get status of Master Transfer\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             Master transfer status, could be:\r
+ *                                     - TRUE          :master transfer completed\r
+ *                                     - FALSE         :master transfer have not completed yet\r
+ **********************************************************************/\r
+uint32_t I2C_MasterTransferComplete(LPC_I2Cn_Type *I2Cx)\r
+{\r
+       uint32_t retval, tmp;\r
+       tmp = I2C_getNum(I2Cx);\r
+       retval = I2C_MasterComplete[tmp];\r
+       I2C_MasterComplete[tmp] = FALSE;\r
+       return retval;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get status of Slave Transfer\r
+ * @param[in]  I2Cx    I2C peripheral selected, should be:\r
+ *                                     - LPC_I2C0      :I2C0 peripheral\r
+ *                                     - LPC_I2C1      :I2C1 peripheral\r
+ * @return             Complete status, could be: TRUE/FALSE\r
+ **********************************************************************/\r
+uint32_t I2C_SlaveTransferComplete(LPC_I2Cn_Type *I2Cx)\r
+{\r
+       uint32_t retval, tmp;\r
+       tmp = I2C_getNum(I2Cx);\r
+       retval = I2C_SlaveComplete[tmp];\r
+       I2C_SlaveComplete[tmp] = FALSE;\r
+       return retval;\r
+}\r
+\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _I2C */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2s.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_i2s.c
new file mode 100644 (file)
index 0000000..3bb7a54
--- /dev/null
@@ -0,0 +1,663 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_i2s.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_i2s.c\r
+* @brief       Contains all functions support for I2S firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup I2S\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_i2s.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _I2S\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+static uint8_t i2s_GetWordWidth(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+static uint8_t i2s_GetChannel(LPC_I2Sn_Type *I2Sx, uint8_t TRMode);\r
+\r
+/********************************************************************//**\r
+ * @brief              Get I2S wordwidth value\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is the I2S mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             The wordwidth value, should be: 8,16 or 32\r
+ *********************************************************************/\r
+static uint8_t i2s_GetWordWidth(LPC_I2Sn_Type *I2Sx, uint8_t TRMode) {\r
+       uint8_t value;\r
+\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) {\r
+               value = (I2Sx->DAO) & 0x03; /* get wordwidth bit */\r
+       } else {\r
+               value = (I2Sx->DAI) & 0x03; /* get wordwidth bit */\r
+       }\r
+       switch (value) {\r
+       case I2S_WORDWIDTH_8:\r
+               return 8;\r
+       case I2S_WORDWIDTH_16:\r
+               return 16;\r
+       default:\r
+               return 32;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Get I2S channel value\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is the I2S mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             The channel value, should be: 1(mono) or 2(stereo)\r
+ *********************************************************************/\r
+static uint8_t i2s_GetChannel(LPC_I2Sn_Type *I2Sx, uint8_t TRMode) {\r
+       uint8_t value;\r
+\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) {\r
+               value = (I2Sx->DAO) & 0x04; /* get bit[2] */\r
+       } else {\r
+               value = (I2Sx->DAI) & 0x04; /* get bit[2] */\r
+       }\r
+       value >>= 2;\r
+    if(value == I2S_MONO) return 1;\r
+      return 2;\r
+}\r
+\r
+/* End of Private Functions --------------------------------------------------- */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup I2S_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initialize I2S\r
+ *                                     - Turn on power and clock\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Init(LPC_I2Sn_Type *I2Sx) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+\r
+       // Turn on power and clock\r
+       //CGU_ConfigPPWR(CGU_PCONP_PCI2S, ENABLE);\r
+       I2Sx->DAI = I2Sx->DAO = 0x00;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Configuration I2S, setting:\r
+ *                                     - master/slave mode\r
+ *                                     - wordwidth value\r
+ *                                     - channel mode\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @param[in]  ConfigStruct pointer to I2S_CFG_Type structure\r
+ *              which will be initialized.\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Config(LPC_I2Sn_Type *I2Sx, uint8_t TRMode, I2S_CFG_Type* ConfigStruct)\r
+{\r
+       uint32_t bps, config;\r
+\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+\r
+       CHECK_PARAM(PARAM_I2S_WORDWIDTH(ConfigStruct->wordwidth));\r
+       CHECK_PARAM(PARAM_I2S_CHANNEL(ConfigStruct->mono));\r
+       CHECK_PARAM(PARAM_I2S_STOP(ConfigStruct->stop));\r
+       CHECK_PARAM(PARAM_I2S_RESET(ConfigStruct->reset));\r
+       CHECK_PARAM(PARAM_I2S_WS_SEL(ConfigStruct->ws_sel));\r
+       CHECK_PARAM(PARAM_I2S_MUTE(ConfigStruct->mute));\r
+\r
+       /* Setup clock */\r
+       bps = (ConfigStruct->wordwidth +1)*8;\r
+\r
+       /* Calculate audio config */\r
+       config = (bps - 1)<<6 | (ConfigStruct->ws_sel)<<5 | (ConfigStruct->reset)<<4 |\r
+               (ConfigStruct->stop)<<3 | (ConfigStruct->mono)<<2 | (ConfigStruct->wordwidth);\r
+\r
+       if(TRMode == I2S_RX_MODE){\r
+               I2Sx->DAI = config;\r
+       }else{\r
+               I2Sx->DAO = config;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              DeInitial both I2S transmit or receive\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_DeInit(LPC_I2Sn_Type *I2Sx) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+\r
+       // Turn off power and clock\r
+       //CGU_ConfigPPWR(CGU_PCONP_PCI2S, DISABLE);\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Get I2S Buffer Level\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode Transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             current level of Transmit/Receive Buffer\r
+ *********************************************************************/\r
+uint8_t I2S_GetLevel(LPC_I2Sn_Type *I2Sx, uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if(TRMode == I2S_TX_MODE)\r
+       {\r
+               return ((I2Sx->STATE >> 16) & 0xFF);\r
+       }\r
+       else\r
+       {\r
+               return ((I2Sx->STATE >> 8) & 0xFF);\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Start: clear all STOP,RESET and MUTE bit, ready to operate\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Start(LPC_I2Sn_Type *I2Sx)\r
+{\r
+       //Clear STOP,RESET and MUTE bit\r
+       I2Sx->DAO &= ~I2S_DAI_RESET;\r
+       I2Sx->DAI &= ~I2S_DAI_RESET;\r
+       I2Sx->DAO &= ~I2S_DAI_STOP;\r
+       I2Sx->DAI &= ~I2S_DAI_STOP;\r
+       I2Sx->DAO &= ~I2S_DAI_MUTE;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Send data\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  BufferData pointer to uint32_t is the data will be send\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Send(LPC_I2Sn_Type *I2Sx, uint32_t BufferData) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+\r
+       I2Sx->TXFIFO = BufferData;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Receive Data\r
+ * @param[in]  I2Sx pointer to LPC_I2Sn_Type, should be: LPC_I2S\r
+ * @return             received value\r
+ *********************************************************************/\r
+uint32_t I2S_Receive(LPC_I2Sn_Type* I2Sx) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+\r
+       return (I2Sx->RXFIFO);\r
+\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Pause\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Pause(LPC_I2Sn_Type *I2Sx, uint8_t TRMode) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) //Transmit mode\r
+       {\r
+               I2Sx->DAO |= I2S_DAO_STOP;\r
+       } else //Receive mode\r
+       {\r
+               I2Sx->DAI |= I2S_DAI_STOP;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Mute\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Mute(LPC_I2Sn_Type *I2Sx, uint8_t TRMode) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) //Transmit mode\r
+       {\r
+               I2Sx->DAO |= I2S_DAO_MUTE;\r
+       } else //Receive mode\r
+       {\r
+               I2Sx->DAI |= I2S_DAI_MUTE;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S Stop\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_Stop(LPC_I2Sn_Type *I2Sx, uint8_t TRMode) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) //Transmit mode\r
+       {\r
+               I2Sx->DAO &= ~I2S_DAO_MUTE;\r
+               I2Sx->DAO |= I2S_DAO_STOP;\r
+               I2Sx->DAO |= I2S_DAO_RESET;\r
+       } else //Receive mode\r
+       {\r
+               I2Sx->DAI |= I2S_DAI_STOP;\r
+               I2Sx->DAI |= I2S_DAI_RESET;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Set frequency for I2S\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  Freq is the frequency for I2S will be set. It can range\r
+ *                             from 16-96 kHz(16, 22.05, 32, 44.1, 48, 96kHz)\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             Status: ERROR or SUCCESS\r
+ *********************************************************************/\r
+Status I2S_FreqConfig(LPC_I2Sn_Type *I2Sx, uint32_t Freq, uint8_t TRMode) {\r
+\r
+       /* Calculate bit rate\r
+        * The formula is:\r
+        *      bit_rate = channel*wordwidth - 1\r
+        * 48kHz sample rate for 16 bit stereo date requires\r
+        * a bit rate of 48000*16*2=1536MHz (MCLK)\r
+        */\r
+       uint32_t i2sPclk;\r
+       uint64_t divider;\r
+       uint8_t bitrate, channel, wordwidth;\r
+       uint32_t x, y;\r
+       uint16_t dif;\r
+       uint16_t error;\r
+       uint16_t x_divide, y_divide;\r
+       uint16_t ErrorOptimal = 0xFFFF;\r
+       uint32_t N;\r
+\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PRAM_I2S_FREQ(Freq));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       //LPC_CGU->BASE_VPB1_CLK = 0x08<<24 | AUTO_BLOCK;\r
+       CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_APB1);\r
+       i2sPclk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_I2S);\r
+       if(TRMode == I2S_TX_MODE)\r
+       {\r
+               channel = i2s_GetChannel(I2Sx,I2S_TX_MODE);\r
+               wordwidth = i2s_GetWordWidth(I2Sx,I2S_TX_MODE);\r
+       }\r
+       else\r
+       {\r
+               channel = i2s_GetChannel(I2Sx,I2S_RX_MODE);\r
+               wordwidth = i2s_GetWordWidth(I2Sx,I2S_RX_MODE);\r
+       }\r
+       bitrate = 2 * wordwidth - 1;\r
+\r
+       /* Calculate X and Y divider\r
+        * The MCLK rate for the I2S transmitter is determined by the value\r
+        * in the I2STXRATE/I2SRXRATE register. The required I2STXRATE/I2SRXRATE\r
+        * setting depends on the desired audio sample rate desired, the format\r
+        * (stereo/mono) used, and the data size.\r
+        * The formula is:\r
+        *              I2S_MCLK = PCLK * (X/Y) / 2\r
+        * We have:\r
+        *              I2S_MCLK = Freq * bit_rate * I2Sx->TXBITRATE;\r
+        * So: (X/Y) = (Freq * bit_rate * I2Sx->TXBITRATE)/PCLK*2\r
+        * We use a loop function to chose the most suitable X,Y value\r
+        */\r
+\r
+       /* divider is a fixed point number with 16 fractional bits */\r
+       divider = ((uint64_t)(Freq *( bitrate+1) * 2)<<16) / i2sPclk;\r
+\r
+       /* find N that make x/y <= 1 -> divider <= 2^16 */\r
+       for(N=64;N>=0;N--){\r
+               if((divider*N) < (1<<16)) break;\r
+       }\r
+\r
+       if(N == 0) return ERROR;\r
+\r
+       divider *= N;\r
+\r
+       for (y = 255; y > 0; y--) {\r
+               x = y * divider;\r
+               if(x & (0xFF000000)) continue;\r
+               dif = x & 0xFFFF;\r
+               if(dif>0x8000) error = 0x10000-dif;\r
+               else error = dif;\r
+               if (error == 0)\r
+               {\r
+                       y_divide = y;\r
+                       break;\r
+               }\r
+               else if (error < ErrorOptimal)\r
+               {\r
+                       ErrorOptimal = error;\r
+                       y_divide = y;\r
+               }\r
+       }\r
+       x_divide = ((uint64_t)y_divide * Freq *( bitrate+1)* N * 2)/i2sPclk;\r
+       if(x_divide >= 256) x_divide = 0xFF;\r
+       if(x_divide == 0) x_divide = 1;\r
+       if (TRMode == I2S_TX_MODE)// Transmitter\r
+       {\r
+               I2Sx->TXBITRATE = N;\r
+               I2Sx->TXRATE = y_divide | (x_divide << 8);\r
+       } else //Receiver\r
+       {\r
+               I2Sx->RXBITRATE = N;\r
+               I2Sx->RXRATE = y_divide | (x_divide << 8);\r
+       }\r
+       return SUCCESS;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              I2S set bitrate\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  bitrate value will be set, it can be calculate as follows:\r
+ *                                     bitrate = channel * wordwidth - 1\r
+ *                             bitrate value should be in range: 0 .. 63\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_SetBitRate(LPC_I2Sn_Type *I2Sx, uint8_t bitrate, uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_BITRATE(bitrate));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if(TRMode == I2S_TX_MODE)\r
+       {\r
+               I2Sx->TXBITRATE = bitrate;\r
+       }\r
+       else\r
+       {\r
+               I2Sx->RXBITRATE = bitrate;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Configuration operating mode for I2S\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  ModeConfig pointer to I2S_MODEConf_Type will be used to\r
+ *                             configure\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_ModeConfig(LPC_I2Sn_Type *I2Sx, I2S_MODEConf_Type* ModeConfig,\r
+               uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_CLKSEL(ModeConfig->clksel));\r
+       CHECK_PARAM(PARAM_I2S_4PIN(ModeConfig->fpin));\r
+       CHECK_PARAM(PARAM_I2S_MCLK(ModeConfig->mcena));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_TX_MODE) {\r
+               I2Sx->TXMODE &= ~0x0F; //clear bit 3:0 in I2STXMODE register\r
+               if (ModeConfig->clksel == I2S_CLKSEL_MCLK) {\r
+                       I2Sx->TXMODE |= 0x02;\r
+               }\r
+               if (ModeConfig->fpin == I2S_4PIN_ENABLE) {\r
+                       I2Sx->TXMODE |= (1 << 2);\r
+               }\r
+               if (ModeConfig->mcena == I2S_MCLK_ENABLE) {\r
+                       I2Sx->TXMODE |= (1 << 3);\r
+               }\r
+       } else {\r
+               I2Sx->RXMODE &= ~0x0F; //clear bit 3:0 in I2STXMODE register\r
+               if (ModeConfig->clksel == I2S_CLKSEL_MCLK) {\r
+                       I2Sx->RXMODE |= 0x02;\r
+               }\r
+               if (ModeConfig->fpin == I2S_4PIN_ENABLE) {\r
+                       I2Sx->RXMODE |= (1 << 2);\r
+               }\r
+               if (ModeConfig->mcena == I2S_MCLK_ENABLE) {\r
+                       I2Sx->RXMODE |= (1 << 3);\r
+               }\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Configure DMA operation for I2S\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  DMAConfig pointer to I2S_DMAConf_Type will be used to configure\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_DMAConfig(LPC_I2Sn_Type *I2Sx, I2S_DMAConf_Type* DMAConfig,\r
+               uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_DMA(DMAConfig->DMAIndex));\r
+       CHECK_PARAM(PARAM_I2S_DMA_DEPTH(DMAConfig->depth));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_RX_MODE) {\r
+               if (DMAConfig->DMAIndex == I2S_DMA_1) {\r
+                       I2Sx->DMA1 = (DMAConfig->depth) << 8;\r
+               } else {\r
+                       I2Sx->DMA2 = (DMAConfig->depth) << 8;\r
+               }\r
+       } else {\r
+               if (DMAConfig->DMAIndex == I2S_DMA_1) {\r
+                       I2Sx->DMA1 = (DMAConfig->depth) << 16;\r
+               } else {\r
+                       I2Sx->DMA2 = (DMAConfig->depth) << 16;\r
+               }\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Enable/Disable DMA operation for I2S\r
+ * @param[in]  I2Sx: I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  DMAIndex chose what DMA is used, should be:\r
+ *                                     - I2S_DMA_1 = 0         :DMA1\r
+ *                                     - I2S_DMA_2 = 1         :DMA2\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @param[in]  NewState is new state of DMA operation, should be:\r
+ *                             - ENABLE\r
+ *                             - DISABLE\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_DMACmd(LPC_I2Sn_Type *I2Sx, uint8_t DMAIndex, uint8_t TRMode,\r
+               FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+       CHECK_PARAM(PARAM_I2S_DMA(DMAIndex));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+\r
+       if (TRMode == I2S_RX_MODE) {\r
+               if (DMAIndex == I2S_DMA_1) {\r
+                       if (NewState == ENABLE)\r
+                               I2Sx->DMA1 |= 0x01;\r
+                       else\r
+                               I2Sx->DMA1 &= ~0x01;\r
+               } else {\r
+                       if (NewState == ENABLE)\r
+                               I2Sx->DMA2 |= 0x01;\r
+                       else\r
+                               I2Sx->DMA2 &= ~0x01;\r
+               }\r
+       } else {\r
+               if (DMAIndex == I2S_DMA_1) {\r
+                       if (NewState == ENABLE)\r
+                               I2Sx->DMA1 |= 0x02;\r
+                       else\r
+                               I2Sx->DMA1 &= ~0x02;\r
+               } else {\r
+                       if (NewState == ENABLE)\r
+                               I2Sx->DMA2 |= 0x02;\r
+                       else\r
+                               I2Sx->DMA2 &= ~0x02;\r
+               }\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Configure IRQ for I2S\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @param[in]  level is the FIFO level that triggers IRQ request\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_IRQConfig(LPC_I2Sn_Type *I2Sx, uint8_t TRMode, uint8_t level) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_I2S_TRX(TRMode));\r
+       CHECK_PARAM(PARAM_I2S_IRQ_LEVEL(level));\r
+\r
+       if (TRMode == I2S_RX_MODE) {\r
+               I2Sx->IRQ |= (level << 8);\r
+       } else {\r
+               I2Sx->IRQ |= (level << 16);\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Enable/Disable IRQ for I2S\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @param[in]  NewState is new state of DMA operation, should be:\r
+ *                                     - ENABLE\r
+ *                                     - DISABLE\r
+ * @return             none\r
+ *********************************************************************/\r
+void I2S_IRQCmd(LPC_I2Sn_Type *I2Sx, uint8_t TRMode, FunctionalState NewState) {\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (TRMode == I2S_RX_MODE) {\r
+               if (NewState == ENABLE)\r
+                       I2Sx->IRQ |= 0x01;\r
+               else\r
+                       I2Sx->IRQ &= ~0x01;\r
+               //Enable DMA\r
+\r
+       } else {\r
+               if (NewState == ENABLE)\r
+                       I2Sx->IRQ |= 0x02;\r
+               else\r
+                       I2Sx->IRQ &= ~0x02;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Get I2S interrupt status\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             FunctionState   should be:\r
+ *                                     - ENABLE        :interrupt is enable\r
+ *                                     - DISABLE       :interrupt is disable\r
+ *********************************************************************/\r
+FunctionalState I2S_GetIRQStatus(LPC_I2Sn_Type *I2Sx,uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       if(TRMode == I2S_TX_MODE)\r
+               return (FunctionalState)((I2Sx->IRQ >> 1)&0x01);\r
+       else\r
+               return (FunctionalState)((I2Sx->IRQ)&0x01);\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Get I2S interrupt depth\r
+ * @param[in]  I2Sx I2S peripheral selected, should be: LPC_I2S\r
+ * @param[in]  TRMode is transmit/receive mode, should be:\r
+ *                                     - I2S_TX_MODE = 0       :transmit mode\r
+ *                                     - I2S_RX_MODE = 1       :receive mode\r
+ * @return             depth of FIFO level on which to create an irq request\r
+ *********************************************************************/\r
+uint8_t I2S_GetIRQDepth(LPC_I2Sn_Type *I2Sx,uint8_t TRMode)\r
+{\r
+       CHECK_PARAM(PARAM_I2Sx(I2Sx));\r
+       if(TRMode == I2S_TX_MODE)\r
+               return (((I2Sx->IRQ)>>16)&0xFF);\r
+       else\r
+               return (((I2Sx->IRQ)>>8)&0xFF);\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _I2S */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_lcd.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_lcd.c
new file mode 100644 (file)
index 0000000..878af9b
--- /dev/null
@@ -0,0 +1,467 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_lcd.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_lcd.c\r
+* @brief       Contains all function support for LCD Driver\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup LCD\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+#include "lpc18xx_lcd.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _LCD\r
+\r
+LCD_CURSOR_SIZE_OPT LCD_Cursor_Size = LCD_CURSOR_64x64;\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Init the LPC18xx LCD Controller\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  LCD_ConfigStruct point to LCD_CFG_Type that describe the LCD Panel\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Init(LPC_LCD_Type *LCDx, LCD_CFG_Type *LCD_ConfigStruct){\r
+       uint32_t i, regValue, *pPal;\r
+       uint32_t pcd;\r
+       /* disable the display */\r
+       LCDx->CTRL &= ~CLCDC_LCDCTRL_ENABLE;\r
+\r
+       /* Setting LCD_TIMH register */\r
+       regValue= ( ((((LCD_ConfigStruct->screen_width/16)-1)&0x3F) << 2)\r
+       |         (( (LCD_ConfigStruct->HSync_pulse_width-1)    &0xFF) << 8)\r
+       |         (( (LCD_ConfigStruct->horizontal_porch.front-1)    &0xFF) << 16)\r
+       |         (( (LCD_ConfigStruct->horizontal_porch.back-1)    &0xFF) << 24) );\r
+\r
+       LCDx->TIMH = regValue;\r
+\r
+       /* Setting LCD_TIMV register */\r
+       regValue =((((LCD_ConfigStruct->screen_height-1) &0x3FF) << 0)\r
+       |        (((LCD_ConfigStruct->VSync_pulse_width-1) &0x03F) << 10)\r
+       |        (((LCD_ConfigStruct->vertical_porch.front-1) &0x0FF) << 16)\r
+       |        (((LCD_ConfigStruct->vertical_porch.back-1) &0x0FF) << 24) );\r
+\r
+       LCDx->TIMV = regValue;\r
+\r
+       /* Generate the clock and signal polarity control word */\r
+       regValue = 0;\r
+       regValue = (((LCD_ConfigStruct->ac_bias_frequency-1) & 0x1F) << 6);\r
+\r
+       regValue |= (LCD_ConfigStruct->OE_pol & 1)<< 14;\r
+\r
+       regValue |= (LCD_ConfigStruct->panel_clk_edge & 1)<< 13;\r
+\r
+       regValue |= (LCD_ConfigStruct->HSync_pol & 1)<< 12;\r
+\r
+       regValue |= (LCD_ConfigStruct->VSync_pol & 1)<< 11;\r
+\r
+       /* Compute clocks per line based on panel type */\r
+\r
+       switch(LCD_ConfigStruct->lcd_panel_type)\r
+       {\r
+         case LCD_MONO_4:\r
+               regValue |= ((((LCD_ConfigStruct->screen_width / 4)-1) & 0x3FF) << 16);\r
+               break;\r
+         case LCD_MONO_8:\r
+               regValue |= ((((LCD_ConfigStruct->screen_width / 8)-1) & 0x3FF) << 16);\r
+               break;\r
+         case LCD_CSTN:\r
+               regValue |= (((((LCD_ConfigStruct->screen_width * 3)/8)-1) & 0x3FF) << 16);\r
+               break;\r
+         case LCD_TFT:\r
+         default:\r
+               regValue |= 1<<26 | (((LCD_ConfigStruct->screen_width-1) & 0x3FF) << 16);\r
+       }\r
+\r
+       /* panel clock divisor */\r
+       pcd = LCD_ConfigStruct->pcd;   // TODO: should be calculated from LCDDCLK\r
+       pcd &= 0x3FF;\r
+       regValue |=  ((pcd>>5)<<27) | ((pcd)&0x1F);\r
+\r
+       LCDx->POL = regValue;\r
+\r
+       /* configure line end control */\r
+       CHECK_PARAM(LCD_ConfigStruct->line_end_delay<=(1<<7));\r
+       if(LCD_ConfigStruct->line_end_delay)\r
+               LCDx->LE  = (LCD_ConfigStruct->line_end_delay-1) | 1<<16;\r
+       else\r
+               LCDx->LE = 0;\r
+\r
+       /* disable interrupts */\r
+       LCDx->INTMSK = 0;\r
+\r
+       /* set bits per pixel */\r
+       regValue = LCD_ConfigStruct->bits_per_pixel << 1;\r
+\r
+       /* set color format BGR or RGB */\r
+       regValue |= LCD_ConfigStruct->color_format << 8;\r
+\r
+       regValue |= LCD_ConfigStruct->lcd_panel_type << 4;\r
+\r
+       if(LCD_ConfigStruct->dual_panel == 1)\r
+       {\r
+               regValue |= 1 << 7;\r
+       }\r
+       LCDx->CTRL = regValue;\r
+       /* clear palette */\r
+       pPal = (uint32_t*) (&(LCDx->PAL));\r
+\r
+       for(i = 0; i < 128; i++)\r
+       {\r
+               *pPal = 0;\r
+               pPal++;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Deinit LCD controller\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_DeInit(LPC_LCD_Type *LCDx);\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Power the LCD Panel\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  OnOff   Turn on/off LCD\r
+ *                                     - TRUE  :Turn on\r
+ *                                     - FALSE :Turn off\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Power(LPC_LCD_Type *LCDx, FunctionalState OnOff){\r
+int i;\r
+       if(OnOff){\r
+               LPC_LCD->CTRL |= CLCDC_LCDCTRL_PWR;\r
+               for(i=0;i<100000;i++);\r
+               LPC_LCD->CTRL |= CLCDC_LCDCTRL_ENABLE;\r
+       }else{\r
+               LPC_LCD->CTRL &= ~CLCDC_LCDCTRL_PWR;\r
+               for(i=0;i<100000;i++);\r
+               LPC_LCD->CTRL &= ~CLCDC_LCDCTRL_ENABLE;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable the LCD Controller\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  EnDis   Enable/disable status\r
+ *                                     - TRUE  :Enable\r
+ *                                     - FALSE :Disable\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Enable(LPC_LCD_Type *LCDx, FunctionalState EnDis){\r
+       if (EnDis)\r
+       {\r
+         LCDx->CTRL |= CLCDC_LCDCTRL_ENABLE;\r
+       }\r
+       else\r
+       {\r
+         LCDx->CTRL &= ~CLCDC_LCDCTRL_ENABLE;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set LCD Frame Buffer for Single Panel or Upper Panel Frame\r
+ *                             Buffer for Dual Panel\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  buffer address of buffer\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_SetFrameBuffer(LPC_LCD_Type *LCDx, void* buffer){\r
+       LCDx->UPBASE = (uint32_t)buffer;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set LCD Lower Panel Frame Buffer for Dual Panel\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  buffer address of buffer\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_SetLPFrameBuffer(LPC_LCD_Type *LCDx, void* buffer){\r
+       LCDx->LPBASE = (uint32_t)buffer;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure Cursor\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  cursor_size specify size of cursor\r
+ *                                     - LCD_CURSOR_32x32      :cursor size is 32x32 pixels\r
+ *                                     - LCD_CURSOR_64x64      :cursor size is 64x64 pixels\r
+ * @param[in]  sync cursor sync mode\r
+ *                                     - TRUE  :cursor sync to the frame sync pulse\r
+ *                                     - FALSE :cursor async mode\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_Config(LPC_LCD_Type *LCDx, LCD_CURSOR_SIZE_OPT cursor_size, Bool sync){\r
+       LCD_Cursor_Size = cursor_size;\r
+       LCDx->CRSR_CFG = ((sync?1:0)<<1) | cursor_size;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Write Cursor Image into Internal Cursor Image Buffer\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  cursor_num specify number of cursor is going to be written\r
+ *                             this param must < 4\r
+ * @param[in]  Image point to Cursor Image Buffer\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_WriteImage(LPC_LCD_Type *LCDx, uint8_t cursor_num, void* Image){\r
+       int i,j;\r
+       uint8_t *fifoptr, *crsr_ptr = (uint8_t *)Image;\r
+\r
+       CHECK_PARAM(cursor_num<4);\r
+       /* Check if Cursor Size was configured as 32x32 or 64x64*/\r
+       if(LCD_Cursor_Size == LCD_CURSOR_32x32){\r
+               i = cursor_num * 256;\r
+               j = i + 256;\r
+       }else{\r
+               i = 0;\r
+               j = 1024;\r
+       }\r
+       fifoptr = (uint8_t*)&(LCDx->CRSR_IMG[0]);\r
+       /* Copy Cursor Image content to FIFO */\r
+       for(; i < j; i++)\r
+       {\r
+         fifoptr[i] = *(uint8_t *)crsr_ptr;\r
+         crsr_ptr++;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get Internal Cursor Image Buffer Address\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  cursor_num specify number of cursor is going to be written\r
+ *                             this param must < 4\r
+ * @return             Cursor Image Buffer Address\r
+ **********************************************************************/\r
+void* LCD_Cursor_GetImageBufferAddress(LPC_LCD_Type *LCDx, uint8_t cursor_num){\r
+       CHECK_PARAM(cursor_num<4);\r
+       return (void*)&(LCDx->CRSR_IMG[cursor_num*64]);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable Cursor\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  cursor_num specify number of cursor is going to be written\r
+ *                             this param must < 4\r
+ * @param[in]  OnOff Turn on/off LCD\r
+ *                                     - TRUE  :Enable\r
+ *                                     - FALSE :Disable\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_Enable(LPC_LCD_Type *LCDx, uint8_t cursor_num, FunctionalState OnOff){\r
+       CHECK_PARAM(cursor_num<4);\r
+       if (OnOff)\r
+       {\r
+         LCDx->CRSR_CTRL = (cursor_num<<4) | 1;\r
+       }\r
+       else\r
+       {\r
+         LCDx->CRSR_CTRL = (cursor_num<<4);\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Load LCD Palette\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  palette point to palette address\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_LoadPalette(LPC_LCD_Type *LCDx, void* palette){\r
+       LCD_PALETTE_ENTRY_Type pal_entry, *ptr_pal_entry;\r
+       uint8_t i, *pal_ptr;\r
+       /* This function supports loading of the color palette from\r
+       the C file generated by the bmp2c utility. It expects the\r
+       palette to be passed as an array of 32-bit BGR entries having\r
+       the following format:\r
+       2:0 - Not used\r
+       7:3 - Blue\r
+       10:8 - Not used\r
+       15:11 - Green\r
+       18:16 - Not used\r
+       23:19 - Red\r
+       31:24 - Not used\r
+       arg = pointer to input palette table address */\r
+       ptr_pal_entry = &pal_entry;\r
+       pal_ptr = (uint8_t *) palette;\r
+\r
+       /* 256 entry in the palette table */\r
+       for(i = 0; i < 256/2; i++)\r
+       {\r
+       pal_entry.Bl = (*pal_ptr++) >> 3;  /* blue first */\r
+       pal_entry.Gl = (*pal_ptr++) >> 3;  /* get green */\r
+       pal_entry.Rl = (*pal_ptr++) >> 3;  /* get red */\r
+       pal_ptr++;      /* skip over the unused byte */\r
+       /* do the most significant halfword of the palette */\r
+       pal_entry.Bu = (*pal_ptr++) >> 3;  /* blue first */\r
+       pal_entry.Gu = (*pal_ptr++) >> 3;  /* get green */\r
+       pal_entry.Ru = (*pal_ptr++) >> 3;  /* get red */\r
+       pal_ptr++;      /* skip over the unused byte */\r
+\r
+       LCDx->PAL[i] = *(uint32_t *)ptr_pal_entry;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Load Cursor Palette\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  palette_color cursor palette 0 value\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_LoadPalette0(LPC_LCD_Type *LCDx, uint32_t palette_color){\r
+       /* 7:0 - Red\r
+       15:8 - Green\r
+       23:16 - Blue\r
+       31:24 - Not used*/\r
+       LCDx->CRSR_PAL0 = (uint32_t)palette_color;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Load Cursor Palette\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  palette_color cursor palette 1 value\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_LoadPalette1(LPC_LCD_Type *LCDx, uint32_t palette_color){\r
+       /* 7:0 - Red\r
+       15:8 - Green\r
+       23:16 - Blue\r
+       31:24 - Not used*/\r
+       LCDx->CRSR_PAL1 = (uint32_t)palette_color;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Interrupt\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  Int LCD Interrupt Source, should be:\r
+ *                                     - LCD_INT_FUF   :FIFO underflow\r
+ *                                     - LCD_INT_LNBU  :LCD next base address update bit\r
+ *                                     - LCD_INT_VCOMP :Vertical compare bit\r
+ *                                     - LCD_INT_BER   :AHB master error interrupt bit\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_SetInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int){\r
+       LCDx->INTMSK |= Int;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear Interrupt\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  Int LCD Interrupt Source, should be:\r
+ *                                     - LCD_INT_FUF   :FIFO underflow\r
+ *                                     - LCD_INT_LNBU  :LCD next base address update bit\r
+ *                                     - LCD_INT_VCOMP :Vertical compare bit\r
+ *                                     - LCD_INT_BER   :AHB master error interrupt bit\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_ClrInterrupt(LPC_LCD_Type *LCDx, LCD_INT_SRC Int){\r
+       LCDx->INTCLR |= Int;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get LCD Interrupt Status\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @return             None\r
+ **********************************************************************/\r
+LCD_INT_SRC LCD_GetInterrupt(LPC_LCD_Type *LCDx){\r
+       return (LCD_INT_SRC)LCDx->INTRAW;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable Cursor Interrupt\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_SetInterrupt(LPC_LCD_Type *LCDx){\r
+       LCDx->CRSR_INTMSK |= 1;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear Cursor Interrupt\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_ClrInterrupt(LPC_LCD_Type *LCDx){\r
+       LCDx->CRSR_INTCLR |= 1;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Cursor Position\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  x horizontal position\r
+ * @param[in]  y vertical position\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_SetPos(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y){\r
+       LCDx->CRSR_XY = (x & 0x3FF) | ((y & 0x3FF) << 16);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Cursor Clipping Position\r
+ * @param[in]  LCDx pointer to LCD Controller Reg Struct, should be: LPC_LCD\r
+ * @param[in]  x horizontal position, should be in range: 0..63\r
+ * @param[in]  y vertical position, should be in range: 0..63\r
+ * @return             None\r
+ **********************************************************************/\r
+void LCD_Cursor_SetClip(LPC_LCD_Type *LCDx, uint16_t x, uint16_t y){\r
+       LCDx->CRSR_CLIP = (x & 0x3F) | ((y & 0x3F) << 8);\r
+}\r
+#endif /* _LCD */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_libcfg_default.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_libcfg_default.c
new file mode 100644 (file)
index 0000000..6955587
--- /dev/null
@@ -0,0 +1,64 @@
+/***********************************************************************//**\r
+ * @file               lpc18xx_libcfg_default.c\r
+ * @brief              Library configuration source file (default),\r
+ *                             used to build library without examples.\r
+ * @version            2.0\r
+ * @date               21. May. 2010\r
+ * @author             NXP MCU SW Application Team\r
+ **************************************************************************\r
+ * Software that is described herein is for illustrative purposes only\r
+ * which provides customers with programming information regarding the\r
+ * products. This software is supplied "AS IS" without any warranties.\r
+ * NXP Semiconductors assumes no responsibility or liability for the\r
+ * use of the software, conveys no license or title under any patent,\r
+ * copyright, or mask work right to the product. NXP Semiconductors\r
+ * reserves the right to make changes in the software without\r
+ * notification. NXP Semiconductors also make no representation or\r
+ * warranty that such application will be suitable for the specified\r
+ * use without further testing or modification.\r
+ **************************************************************************/\r
+\r
+/* Library group ----------------------------------------------------------- */\r
+/** @addtogroup LIBCFG_DEFAULT\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_libcfg_default.h"\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup LIBCFG_DEFAULT_Public_Functions\r
+ * @{\r
+ */\r
+\r
+#ifndef __BUILD_WITH_EXAMPLE__\r
+\r
+#ifdef  DEBUG\r
+/*******************************************************************************\r
+* @brief               Reports the name of the source file and the source line number\r
+*                              where the CHECK_PARAM error has occurred.\r
+* @param[in]   file Pointer to the source file name\r
+* @param[in]    line assert_param error line source number\r
+* @return              None\r
+*******************************************************************************/\r
+void check_failed(uint8_t *file, uint32_t line)\r
+{\r
+       /* User can add his own implementation to report the file name and line number,\r
+        ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */\r
+\r
+       /* Infinite loop */\r
+       while(1);\r
+}\r
+#endif /* DEBUG */\r
+\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_mcpwm.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_mcpwm.c
new file mode 100644 (file)
index 0000000..f24fae4
--- /dev/null
@@ -0,0 +1,555 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_mcpwm.c         2011-06-02\r
+*//**\r
+* @file                lpc18xx_mcpwm.c\r
+* @brief       Contains all functions support for Motor Control PWM firmware\r
+*                      library on LPC18XX\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup MCPWM\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_mcpwm.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _MCPWM\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup MCPWM_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initializes the MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_Init(LPC_MCPWM_Type *MCPWMx)\r
+{\r
+       /* Turn On MCPWM PCLK */\r
+       //LPC_CGU->BASE_VPB1_CLK = (SRC_PL160M_0<<24) | (1<<11);\r
+       CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_APB1);\r
+\r
+       MCPWMx->CAP_CLR = MCPWM_CAPCLR_CAP(0) | MCPWM_CAPCLR_CAP(1) | MCPWM_CAPCLR_CAP(2);\r
+\r
+       MCPWMx->INTF_CLR = MCPWM_INT_ILIM(0) | MCPWM_INT_ILIM(1) | MCPWM_INT_ILIM(2) \\r
+                                                               | MCPWM_INT_IMAT(0) | MCPWM_INT_IMAT(1) | MCPWM_INT_IMAT(2) \\r
+                                                               | MCPWM_INT_ICAP(0) | MCPWM_INT_ICAP(1) | MCPWM_INT_ICAP(2);\r
+\r
+       MCPWMx->INTEN_CLR = MCPWM_INT_ILIM(0) | MCPWM_INT_ILIM(1) | MCPWM_INT_ILIM(2) \\r
+                                                               | MCPWM_INT_IMAT(0) | MCPWM_INT_IMAT(1) | MCPWM_INT_IMAT(2) \\r
+                                                               | MCPWM_INT_ICAP(0) | MCPWM_INT_ICAP(1) | MCPWM_INT_ICAP(2);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures each channel in MCPWM peripheral according to the\r
+ *                             specified parameters in the MCPWM_CHANNEL_CFG_Type.\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channelNum      Channel number, should be: 0..2.\r
+ * @param[in]  channelSetup Pointer to a MCPWM_CHANNEL_CFG_Type structure\r
+ *                             that contains the configuration information for the specified\r
+ *                             MCPWM channel.\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_ConfigChannel(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                               MCPWM_CHANNEL_CFG_Type * channelSetup)\r
+{\r
+       if (channelNum <= 2)\r
+       {\r
+               if (channelNum == MCPWM_CHANNEL_0)\r
+               {\r
+                       MCPWMx->TC[0] = channelSetup->channelTimercounterValue;\r
+                       MCPWMx->LIM[0] = channelSetup->channelPeriodValue;\r
+                       MCPWMx->MAT[0] = channelSetup->channelPulsewidthValue;\r
+               }\r
+               else if (channelNum == MCPWM_CHANNEL_1)\r
+               {\r
+                       MCPWMx->TC[1] = channelSetup->channelTimercounterValue;\r
+                       MCPWMx->LIM[1] = channelSetup->channelPeriodValue;\r
+                       MCPWMx->MAT[1] = channelSetup->channelPulsewidthValue;\r
+               }\r
+               else if (channelNum == MCPWM_CHANNEL_2)\r
+               {\r
+                       MCPWMx->TC[2] = channelSetup->channelTimercounterValue;\r
+                       MCPWMx->LIM[2] = channelSetup->channelPeriodValue;\r
+                       MCPWMx->MAT[2] = channelSetup->channelPulsewidthValue;\r
+               }\r
+               else\r
+               {\r
+                       return;\r
+               }\r
+\r
+               if (channelSetup->channelType == MCPWM_CHANNEL_CENTER_MODE)\r
+               {\r
+                       MCPWMx->CON_SET = MCPWM_CON_CENTER(channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CON_CLR = MCPWM_CON_CENTER(channelNum);\r
+               }\r
+\r
+               if (channelSetup->channelPolarity == MCPWM_CHANNEL_PASSIVE_HI)\r
+               {\r
+                       MCPWMx->CON_SET = MCPWM_CON_POLAR(channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CON_CLR = MCPWM_CON_POLAR(channelNum);\r
+               }\r
+\r
+               if (channelSetup->channelDeadtimeEnable == ENABLE)\r
+               {\r
+                       MCPWMx->CON_SET = MCPWM_CON_DTE(channelNum);\r
+\r
+                       MCPWMx->DT &= ~(MCPWM_DT(channelNum, 0x3FF));\r
+\r
+                       MCPWMx->DT |= MCPWM_DT(channelNum, channelSetup->channelDeadtimeValue);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CON_CLR = MCPWM_CON_DTE(channelNum);\r
+               }\r
+\r
+               if (channelSetup->channelUpdateEnable == ENABLE)\r
+               {\r
+                       MCPWMx->CON_CLR = MCPWM_CON_DISUP(channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CON_SET = MCPWM_CON_DISUP(channelNum);\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Write to MCPWM shadow registers - Update the value for period\r
+ *                             and pulse width in MCPWM peripheral.\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channelNum      Channel Number, should be: 0..2.\r
+ * @param[in]  channelSetup Pointer to a MCPWM_CHANNEL_CFG_Type structure\r
+ *                             that contains the configuration information for the specified\r
+ *                             MCPWM channel.\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_WriteToShadow(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                                                                                       MCPWM_CHANNEL_CFG_Type *channelSetup)\r
+{\r
+       if (channelNum == MCPWM_CHANNEL_0)\r
+       {\r
+               MCPWMx->LIM[0] = channelSetup->channelPeriodValue;\r
+               MCPWMx->MAT[0] = channelSetup->channelPulsewidthValue;\r
+       }\r
+       else if (channelNum == MCPWM_CHANNEL_1)\r
+       {\r
+               MCPWMx->LIM[1] = channelSetup->channelPeriodValue;\r
+               MCPWMx->MAT[1] = channelSetup->channelPulsewidthValue;\r
+       }\r
+       else if (channelNum == MCPWM_CHANNEL_2)\r
+       {\r
+               MCPWMx->LIM[2] = channelSetup->channelPeriodValue;\r
+               MCPWMx->MAT[2] = channelSetup->channelPulsewidthValue;\r
+       }\r
+}\r
+\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures capture function in MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channelNum      MCI (Motor Control Input pin) number, should be: 0..2\r
+ * @param[in]  captureConfig   Pointer to a MCPWM_CAPTURE_CFG_Type structure\r
+ *                             that contains the configuration information for the\r
+ *                             specified MCPWM capture.\r
+ * @return\r
+ **********************************************************************/\r
+void MCPWM_ConfigCapture(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                                                                               MCPWM_CAPTURE_CFG_Type *captureConfig)\r
+{\r
+       if ((channelNum <= MCPWM_CHANNEL_2))\r
+       {\r
+\r
+               if (captureConfig->captureFalling == ENABLE)\r
+               {\r
+                       MCPWMx->CAPCON_SET = MCPWM_CAPCON_CAPMCI_FE(captureConfig->captureChannel, channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CAPCON_CLR = MCPWM_CAPCON_CAPMCI_FE(captureConfig->captureChannel, channelNum);\r
+               }\r
+\r
+               if (captureConfig->captureRising == ENABLE)\r
+               {\r
+                       MCPWMx->CAPCON_SET = MCPWM_CAPCON_CAPMCI_RE(captureConfig->captureChannel, channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CAPCON_CLR = MCPWM_CAPCON_CAPMCI_RE(captureConfig->captureChannel, channelNum);\r
+               }\r
+\r
+               if (captureConfig->timerReset == ENABLE)\r
+               {\r
+                       MCPWMx->CAPCON_SET = MCPWM_CAPCON_RT(captureConfig->captureChannel);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CAPCON_CLR = MCPWM_CAPCON_RT(captureConfig->captureChannel);\r
+               }\r
+\r
+               if (captureConfig->hnfEnable == ENABLE)\r
+               {\r
+                       MCPWMx->CAPCON_SET = MCPWM_CAPCON_HNFCAP(channelNum);\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CAPCON_CLR = MCPWM_CAPCON_HNFCAP(channelNum);\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clears current captured value in specified capture channel\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  captureChannel  Capture channel number, should be: 0..2\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_ClearCapture(LPC_MCPWM_Type *MCPWMx, uint32_t captureChannel)\r
+{\r
+       MCPWMx->CAP_CLR = MCPWM_CAPCLR_CAP(captureChannel);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current captured value in specified capture channel\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  captureChannel  Capture channel number, should be: 0..2\r
+ * @return             None\r
+ **********************************************************************/\r
+uint32_t MCPWM_GetCapture(LPC_MCPWM_Type *MCPWMx, uint32_t captureChannel)\r
+{\r
+       if (captureChannel == MCPWM_CHANNEL_0)\r
+       {\r
+               return (MCPWMx->CAP[0]);\r
+       }\r
+       else if (captureChannel == MCPWM_CHANNEL_1)\r
+       {\r
+               return (MCPWMx->CAP[1]);\r
+       }\r
+       else if (captureChannel == MCPWM_CHANNEL_2)\r
+       {\r
+               return (MCPWMx->CAP[2]);\r
+       }\r
+       return (0);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures Count control in MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channelNum      Channel number, should be: 0..2\r
+ * @param[in]  countMode       Count mode, should be:\r
+ *                                     - ENABLE: Enables count mode.\r
+ *                                     - DISABLE: Disable count mode, the channel is in timer mode.\r
+ * @param[in]  countConfig     Pointer to a MCPWM_COUNT_CFG_Type structure\r
+ *                             that contains the configuration information for the\r
+ *                             specified MCPWM count control.\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_CountConfig(LPC_MCPWM_Type *MCPWMx, uint32_t channelNum,\r
+                                                                       uint32_t countMode, MCPWM_COUNT_CFG_Type *countConfig)\r
+{\r
+       if ((channelNum <= 2))\r
+       {\r
+               if (countMode == ENABLE)\r
+               {\r
+                       MCPWMx->CNTCON_SET = MCPWM_CNTCON_CNTR(channelNum);\r
+\r
+                       if (countConfig->countFalling == ENABLE)\r
+                       {\r
+                               MCPWMx->CNTCON_SET = MCPWM_CNTCON_TCMCI_FE(countConfig->counterChannel,channelNum);\r
+                       }\r
+                       else\r
+                       {\r
+                               MCPWMx->CNTCON_CLR = MCPWM_CNTCON_TCMCI_FE(countConfig->counterChannel,channelNum);\r
+                       }\r
+\r
+                       if (countConfig->countRising == ENABLE)\r
+                       {\r
+                               MCPWMx->CNTCON_SET = MCPWM_CNTCON_TCMCI_RE(countConfig->counterChannel,channelNum);\r
+                       }\r
+                       else\r
+                       {\r
+                               MCPWMx->CNTCON_CLR = MCPWM_CNTCON_TCMCI_RE(countConfig->counterChannel,channelNum);\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       MCPWMx->CNTCON_CLR = MCPWM_CNTCON_CNTR(channelNum);\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Start MCPWM activity for each MCPWM channel\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channel0 State of this command on channel 0:\r
+ *                                     - ENABLE: 'Start' command will effect on channel 0\r
+ *                                     - DISABLE: 'Start' command will not effect on channel 0\r
+ * @param[in]  channel1 State of this command on channel 1:\r
+ *                                     - ENABLE: 'Start' command will effect on channel 1\r
+ *                                     - DISABLE: 'Start' command will not effect on channel 1\r
+ * @param[in]  channel2 State of this command on channel 2:\r
+ *                                     - ENABLE: 'Start' command will effect on channel 2\r
+ *                                     - DISABLE: 'Start' command will not effect on channel 2\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_Start(LPC_MCPWM_Type *MCPWMx, uint32_t channel0,\r
+                                                                       uint32_t channel1, uint32_t channel2)\r
+{\r
+       uint32_t regVal = 0;\r
+\r
+       regVal = (channel0 ? MCPWM_CON_RUN(0) : 0) | (channel1 ? MCPWM_CON_RUN(1) : 0) \\r
+                               | (channel2 ? MCPWM_CON_RUN(2) : 0);\r
+\r
+       MCPWMx->CON_SET = regVal;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Stop MCPWM activity for each MCPWM channel\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  channel0 State of this command on channel 0:\r
+ *                                     - ENABLE: 'Stop' command will effect on channel 0\r
+ *                                     - DISABLE: 'Stop' command will not effect on channel 0\r
+ * @param[in]  channel1 State of this command on channel 1:\r
+ *                                     - ENABLE: 'Stop' command will effect on channel 1\r
+ *                                     - DISABLE: 'Stop' command will not effect on channel 1\r
+ * @param[in]  channel2 State of this command on channel 2:\r
+ *                                     - ENABLE: 'Stop' command will effect on channel 2\r
+ *                                     - DISABLE: 'Stop' command will not effect on channel 2\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_Stop(LPC_MCPWM_Type *MCPWMx, uint32_t channel0,\r
+               uint32_t channel1, uint32_t channel2)\r
+{\r
+       uint32_t regVal = 0;\r
+\r
+       regVal = (channel0 ? MCPWM_CON_RUN(0) : 0) | (channel1 ? MCPWM_CON_RUN(1) : 0) \\r
+                               | (channel2 ? MCPWM_CON_RUN(2) : 0);\r
+\r
+       MCPWMx->CON_CLR = regVal;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enables/Disables 3-phase AC motor mode on MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  acMode  State of this command, should be:\r
+ *                                     - ENABLE.\r
+ *                                     - DISABLE.\r
+ * @return             None\r
+ **********************************************************************/\r
+void MCPWM_ACMode(LPC_MCPWM_Type *MCPWMx, uint32_t acMode)\r
+{\r
+       if (acMode)\r
+       {\r
+               MCPWMx->CON_SET = MCPWM_CON_ACMODE;\r
+       }\r
+       else\r
+       {\r
+               MCPWMx->CON_CLR = MCPWM_CON_ACMODE;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enables/Disables 3-phase DC motor mode on MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  dcMode  State of this command, should be:\r
+ *                                     - ENABLE.\r
+ *                                     - DISABLE.\r
+ * @param[in]  outputInvered   Polarity of the MCOB outputs for all 3 channels,\r
+ *                             should be:\r
+ *                                     - ENABLE        :The MCOB outputs have opposite polarity from the MCOA outputs.\r
+ *                                     - DISABLE       :The MCOB outputs have the same basic polarity as the MCOA outputs.\r
+ * @param[in]  outputPattern   A value contains bits that enables/disables the specified\r
+ *                             output pins route to the internal MCOA0 signal, should be:\r
+ *                                     - MCPWM_PATENT_A0       :MCOA0 tracks internal MCOA0\r
+ *                                     - MCPWM_PATENT_B0       :MCOB0 tracks internal MCOA0\r
+ *                                     - MCPWM_PATENT_A1       :MCOA1 tracks internal MCOA0\r
+ *                                     - MCPWM_PATENT_B1       :MCOB1 tracks internal MCOA0\r
+ *                                     - MCPWM_PATENT_A2       :MCOA2 tracks internal MCOA0\r
+ *                                     - MCPWM_PATENT_B2       :MCOB2 tracks internal MCOA0\r
+ * @return             None\r
+ *\r
+ * Note: all these outputPatent values above can be ORed together for using as input parameter.\r
+ **********************************************************************/\r
+void MCPWM_DCMode(LPC_MCPWM_Type *MCPWMx, uint32_t dcMode,\r
+                                       uint32_t outputInvered, uint32_t outputPattern)\r
+{\r
+       if (dcMode)\r
+       {\r
+               MCPWMx->CON_SET = MCPWM_CON_DCMODE;\r
+       }\r
+       else\r
+       {\r
+               MCPWMx->CON_CLR = MCPWM_CON_DCMODE;\r
+       }\r
+\r
+       if (outputInvered)\r
+       {\r
+               MCPWMx->CON_SET = MCPWM_CON_INVBDC;\r
+       }\r
+       else\r
+       {\r
+               MCPWMx->CON_CLR = MCPWM_CON_INVBDC;\r
+       }\r
+\r
+       MCPWMx->CCP = outputPattern;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures the specified interrupt in MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  ulIntType       Interrupt type, should be:\r
+ *                                     - MCPWM_INTFLAG_LIM0    :Limit interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_MAT0    :Match interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_CAP0    :Capture interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_LIM1    :Limit interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_MAT1    :Match interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_CAP1    :Capture interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_LIM2    :Limit interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_MAT2    :Match interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_CAP2    :Capture interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_ABORT   :Fast abort interrupt\r
+ * @param[in]  NewState        New State of this command, should be:\r
+ *                                     - ENABLE.\r
+ *                                     - DISABLE.\r
+ * @return             None\r
+ *\r
+ * Note: all these ulIntType values above can be ORed together for using as input parameter.\r
+ **********************************************************************/\r
+void MCPWM_IntConfig(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType, FunctionalState NewState)\r
+{\r
+       if (NewState)\r
+       {\r
+               MCPWMx->INTEN_SET = ulIntType;\r
+       }\r
+       else\r
+       {\r
+               MCPWMx->INTEN_CLR = ulIntType;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Sets/Forces the specified interrupt for MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  ulIntType       Interrupt type, should be:\r
+ *                                     - MCPWM_INTFLAG_LIM0    :Limit interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_MAT0    :Match interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_CAP0    :Capture interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_LIM1    :Limit interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_MAT1    :Match interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_CAP1    :Capture interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_LIM2    :Limit interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_MAT2    :Match interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_CAP2    :Capture interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_ABORT   :Fast abort interrupt\r
+ * @return             None\r
+ * Note: all these ulIntType values above can be ORed together for using as input parameter.\r
+ **********************************************************************/\r
+void MCPWM_IntSet(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType)\r
+{\r
+       MCPWMx->INTF_SET = ulIntType;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear the specified interrupt pending for MCPWM peripheral\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  ulIntType       Interrupt type, should be:\r
+ *                                     - MCPWM_INTFLAG_LIM0    :Limit interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_MAT0    :Match interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_CAP0    :Capture interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_LIM1    :Limit interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_MAT1    :Match interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_CAP1    :Capture interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_LIM2    :Limit interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_MAT2    :Match interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_CAP2    :Capture interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_ABORT   :Fast abort interrupt\r
+ * @return             None\r
+ * Note: all these ulIntType values above can be ORed together for using as input parameter.\r
+ **********************************************************************/\r
+void MCPWM_IntClear(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType)\r
+{\r
+       MCPWMx->INTF_CLR = ulIntType;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if the specified interrupt in MCPWM is set or not\r
+ * @param[in]  MCPWMx  Motor Control PWM peripheral selected, should be: LPC_MCPWM\r
+ * @param[in]  ulIntType       Interrupt type, should be:\r
+ *                                     - MCPWM_INTFLAG_LIM0    :Limit interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_MAT0    :Match interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_CAP0    :Capture interrupt for channel (0)\r
+ *                                     - MCPWM_INTFLAG_LIM1    :Limit interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_MAT1    :Match interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_CAP1    :Capture interrupt for channel (1)\r
+ *                                     - MCPWM_INTFLAG_LIM2    :Limit interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_MAT2    :Match interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_CAP2    :Capture interrupt for channel (2)\r
+ *                                     - MCPWM_INTFLAG_ABORT   :Fast abort interrupt\r
+ * @return             None\r
+ **********************************************************************/\r
+FlagStatus MCPWM_GetIntStatus(LPC_MCPWM_Type *MCPWMx, uint32_t ulIntType)\r
+{\r
+       return ((MCPWMx->INTF & ulIntType) ? SET : RESET);\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _MCPWM */\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_nvic.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_nvic.c
new file mode 100644 (file)
index 0000000..6e24ce3
--- /dev/null
@@ -0,0 +1,74 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_nvic.c          2011-06-02\r
+*//**\r
+* @file                lpc18xx_nvic.c\r
+* @brief       Contains all expansion functions support for NVIC firmware\r
+*                      library on LPC18XX. The main NVIC functions are defined in\r
+*                      core_cm3.h\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup NVIC\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_nvic.h"\r
+\r
+\r
+/* Private Macros ------------------------------------------------------------- */\r
+/** @addtogroup NVIC_Private_Macros\r
+ * @{\r
+ */\r
+\r
+/* Vector table offset bit mask */\r
+#define NVIC_VTOR_MASK              0x3FFFFF80\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup NVIC_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*****************************************************************************//**\r
+ * @brief              Set Vector Table Offset value\r
+ * @param              offset Offset value\r
+ * @return      None\r
+ *******************************************************************************/\r
+void NVIC_SetVTOR(uint32_t offset)\r
+{\r
+//     SCB->VTOR  = (offset & NVIC_VTOR_MASK);\r
+       SCB->VTOR  = offset;\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_pwr.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_pwr.c
new file mode 100644 (file)
index 0000000..fd84a58
--- /dev/null
@@ -0,0 +1,102 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_pwr.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_pwr.c\r
+* @brief       Contains all functions support for Power Control\r
+*                      firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup PWR\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc_types.h"\r
+#include "lpc18xx_scu.h"\r
+#include "lpc18xx_pwr.h"\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enter Sleep mode with co-operated instruction by the Cortex-M3.\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void PWR_Sleep(void)\r
+{\r
+       //LPC_PMC->SLEEP0_MODE = 0x00;\r
+       /* Sleep Mode*/\r
+       __WFI();\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enter Deep Sleep mode with co-operated instruction by the Cortex-M3.\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void PWR_DeepSleep(void)\r
+{\r
+    /* Deep-Sleep Mode, set SLEEPDEEP bit */\r
+       SCB->SCR = 0x4;\r
+       LPC_PMC->PD0_SLEEP0_MODE = PWR_SLEEP_MODE_DEEP_SLEEP;\r
+       /* Deep Sleep Mode*/\r
+       __WFI();\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enter Power Down mode with co-operated instruction by the Cortex-M3.\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void PWR_PowerDown(void)\r
+{\r
+    /* Deep-Sleep Mode, set SLEEPDEEP bit */\r
+       SCB->SCR = 0x4;\r
+       LPC_PMC->PD0_SLEEP0_MODE = PWR_SLEEP_MODE_POWER_DOWN;\r
+       /* Power Down Mode*/\r
+       __WFI();\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enter Deep Power Down mode with co-operated instruction by the Cortex-M3.\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void PWR_DeepPowerDown(void)\r
+{\r
+    /* Deep-Sleep Mode, set SLEEPDEEP bit */\r
+       SCB->SCR = 0x4;\r
+       LPC_PMC->PD0_SLEEP0_MODE = PWR_SLEEP_MODE_DEEP_POWER_DOWN;\r
+       /* Deep Power Down Mode*/\r
+       __WFI();\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_qei.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_qei.c
new file mode 100644 (file)
index 0000000..fd7f670
--- /dev/null
@@ -0,0 +1,540 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_qei.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_pwr.c\r
+* @brief       Contains all functions support for QEI firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup QEI\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_qei.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _QEI\r
+\r
+/* Private Types -------------------------------------------------------------- */\r
+/** @defgroup QEI_Private_Types QEI Private Types\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @brief QEI configuration union type definition\r
+ */\r
+typedef union {\r
+       QEI_CFG_Type bmQEIConfig;\r
+       uint32_t ulQEIConfig;\r
+} QEI_CFGOPT_Type;\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+LPC_QEI_Type* QEI_GetPointer(uint8_t qeiId);\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup QEI_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get the point to typedef of QEI component\r
+ * @param[in]  qeiId   The Id of the expected QEI component, should be: 0\r
+ * @return             None\r
+ **********************************************************************/\r
+LPC_QEI_Type* QEI_GetPointer(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = NULL;\r
+\r
+       if(qeiId == 0)\r
+       {\r
+               pQei = LPC_QEI;\r
+       }\r
+\r
+       return pQei;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Resets value for each type of QEI value, such as velocity,\r
+ *                             counter, position, etc..\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulResetType     QEI Reset Type, should be one of the following:\r
+ *                                     - QEI_RESET_POS                 :Reset Position Counter\r
+ *                                     - QEI_RESET_POSOnIDX    :Reset Position Counter on Index signal\r
+ *                                     - QEI_RESET_VEL                 :Reset Velocity\r
+ *                                     - QEI_RESET_IDX                 :Reset Index Counter\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_Reset(uint8_t qeiId, uint32_t ulResetType)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->CON = ulResetType;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initializes the QEI peripheral according to the specified\r
+*               parameters in the QEI_ConfigStruct.\r
+* @param[in]   qeiId The Id of the expected QEI component, should be: 0\r
+* @param[in]   QEI_ConfigStruct        Pointer to a QEI_CFG_Type structure\r
+*               that contains the configuration information for the\r
+*               specified QEI peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_Init(uint8_t qeiId, QEI_CFG_Type *QEI_ConfigStruct)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       /* Set up clock and power for QEI module */\r
+       // Already enabled by BASE_M3_CLK\r
+\r
+       // Reset all remaining value in QEI peripheral\r
+\r
+       pQei->MAXPOS = 0x00;\r
+       pQei->CMPOS0 = 0x00;\r
+       pQei->CMPOS1 = 0x00;\r
+       pQei->CMPOS2 = 0x00;\r
+       pQei->INXCMP0 = 0x00;\r
+       pQei->VELCOMP = 0x00;\r
+\r
+       pQei->LOAD = 0x00;\r
+       pQei->CON = QEI_CON_RESP | QEI_CON_RESV | QEI_CON_RESI;\r
+\r
+       pQei->FILTERPHA = 0x00;\r
+       pQei->FILTERPHB = 0x00;\r
+       pQei->FILTERINX = 0x00;\r
+\r
+       // Disable all Interrupt\r
+       pQei->IEC = QEI_IECLR_BITMASK;\r
+\r
+       // Clear all Interrupt pending\r
+       pQei->CLR = QEI_INTCLR_BITMASK;\r
+\r
+       // Set QEI configuration value corresponding to its setting up value\r
+       pQei->CONF = ((QEI_CFGOPT_Type *)QEI_ConfigStruct)->ulQEIConfig;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-Initalize QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_DeInit(uint8_t qeiId)\r
+{\r
+       /* Turn off clock and power for QEI module */\r
+\r
+}\r
+\r
+\r
+/*****************************************************************************//**\r
+* @brief               Fills each QIE_InitStruct member with its default value:\r
+*                                      - DirectionInvert = QEI_DIRINV_NONE\r
+*                                      - SignalMode = QEI_SIGNALMODE_QUAD\r
+*                                      - CaptureMode = QEI_CAPMODE_4X\r
+*                                      - InvertIndex = QEI_INVINX_NONE\r
+* @param[in]   QIE_InitStruct Pointer to a QEI_CFG_Type structure which will be\r
+*                              initialized.\r
+* @return              None\r
+*******************************************************************************/\r
+void QEI_GetCfgDefault(QEI_CFG_Type *QIE_InitStruct)\r
+{\r
+       QIE_InitStruct->CaptureMode = QEI_CAPMODE_4X;\r
+       QIE_InitStruct->DirectionInvert = QEI_DIRINV_NONE;\r
+       QIE_InitStruct->InvertIndex = QEI_INVINX_NONE;\r
+       QIE_InitStruct->SignalMode = QEI_SIGNALMODE_QUAD;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if specified flag status is set or not\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulFlagType      Status Flag Type, should be one of the following:\r
+ *                                     - QEI_STATUS_DIR: Direction Status\r
+ * @return             New Status of this status flag (SET or RESET)\r
+ **********************************************************************/\r
+FlagStatus QEI_GetStatus(uint8_t qeiId, uint32_t ulFlagType)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return ((pQei->STAT & ulFlagType) ? SET : RESET);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current position value in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             Current position value of QEI peripheral\r
+ **********************************************************************/\r
+uint32_t QEI_GetPosition(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return (pQei->POS);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set max position value for QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulMaxPos        Max position value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetMaxPosition(uint8_t qeiId, uint32_t ulMaxPos)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->MAXPOS = ulMaxPos;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set position compare value for QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  bPosCompCh      Compare Position channel, should be:\r
+ *                                     - QEI_COMPPOS_CH_0      :QEI compare position channel 0\r
+ *                                     - QEI_COMPPOS_CH_1      :QEI compare position channel 1\r
+ *                                     - QEI_COMPPOS_CH_2      :QEI compare position channel 2\r
+ * @param[in]  ulPosComp       Compare Position value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetPositionComp(uint8_t qeiId, uint8_t bPosCompCh, uint32_t ulPosComp)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+       uint32_t *tmp;\r
+\r
+       tmp = (uint32_t *) (&(pQei->CMPOS0) + bPosCompCh * 4);\r
+       *tmp = ulPosComp;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current index counter of QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             Current value of QEI index counter\r
+ **********************************************************************/\r
+uint32_t QEI_GetIndex(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return (pQei->INXCNT);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set value for index compare in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulIndexComp             Compare Index Value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetIndexComp(uint8_t qeiId, uint32_t ulIndexComp)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->INXCMP0 = ulIndexComp;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set timer reload value for QEI peripheral. When the velocity timer is\r
+ *                             over-flow, the value that set for Timer Reload register will be loaded\r
+ *                             into the velocity timer for next period. The calculated velocity in RPM\r
+ *                             therefore will be affect by this value.\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  QEIReloadStruct QEI reload structure\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetTimerReload(uint8_t qeiId, QEI_RELOADCFG_Type *QEIReloadStruct)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+       uint64_t pclk;\r
+\r
+       if (QEIReloadStruct->ReloadOption == QEI_TIMERRELOAD_TICKVAL)\r
+       {\r
+               pQei->LOAD = QEIReloadStruct->ReloadValue - 1;\r
+       }\r
+       else\r
+       {\r
+#if 1\r
+               pclk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_M3CORE);\r
+\r
+               pclk = (pclk /(1000000/QEIReloadStruct->ReloadValue)) - 1;\r
+\r
+               pQei->LOAD = (uint32_t)pclk;\r
+#else\r
+               ld = M3Frequency;\r
+\r
+               if (ld/1000000 > 0)\r
+               {\r
+                       ld /= 1000000;\r
+                       ld *= QEIReloadStruct->ReloadValue;\r
+                       ld -= 1;\r
+               }\r
+               else\r
+               {\r
+                       ld *= QEIReloadStruct->ReloadValue;\r
+                       ld /= 1000000;\r
+                       ld -= 1;\r
+               }\r
+\r
+               pQei->LOAD = ld;\r
+#endif\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current timer counter in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             Current timer counter in QEI peripheral\r
+ **********************************************************************/\r
+uint32_t QEI_GetTimer(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return (pQei->TIME);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current velocity pulse counter in current time period\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             Current velocity pulse counter value\r
+ **********************************************************************/\r
+uint32_t QEI_GetVelocity(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return (pQei->VEL);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get the most recently measured velocity of the QEI. When\r
+ *                             the Velocity timer in QEI is over-flow, the current velocity\r
+ *                             value will be loaded into Velocity Capture register.\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @return             The most recently measured velocity value\r
+ **********************************************************************/\r
+uint32_t QEI_GetVelocityCap(uint8_t qeiId)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return (pQei->CAP);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Velocity Compare value for QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulVelComp               Compare Velocity value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetVelocityComp(uint8_t qeiId, uint32_t ulVelComp)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->VELCOMP = ulVelComp;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set value of sampling count for the digital filter in\r
+ *                             QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulSamplingPulse Value of sampling count to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_SetDigiFilter(uint8_t qeiId, st_Qei_FilterCfg FilterVal)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->FILTERPHA = FilterVal.PHA_FilterVal;\r
+       pQei->FILTERPHB = FilterVal.PHB_FilterVal;\r
+       pQei->FILTERINX = FilterVal.INX_FilterVal;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if specified interrupt flag status in QEI\r
+ *                             peripheral is set or not\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulIntType Interrupt Flag Status type, should be:\r
+ *                                     - QEI_INTFLAG_INX_Int           : index pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_TIM_Int           : Velocity timer over flow interrupt\r
+ *                                     - QEI_INTFLAG_VELC_Int          : Capture velocity is less than compare interrupt\r
+ *                                     - QEI_INTFLAG_DIR_Int           : Change of direction interrupt\r
+ *                                     - QEI_INTFLAG_ERR_Int           : An encoder phase error interrupt\r
+ *                                     - QEI_INTFLAG_ENCLK_Int         : An encoder clock pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_POS0_Int          : position 0 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS1_Int          : position 1 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS2_Int          : position 2 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_REV_Int           : Index compare value is equal to the current index count interrupt\r
+ *                                     - QEI_INTFLAG_POS0REV_Int       : Combined position 0 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS1REV_Int       : Combined position 1 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS2REV_Int       : Combined position 2 and revolution count interrupt\r
+ * @return             New State of specified interrupt flag status (SET or RESET)\r
+ **********************************************************************/\r
+FlagStatus QEI_GetIntStatus(uint8_t qeiId, uint32_t ulIntType)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       return((pQei->INTSTAT & ulIntType) ? SET : RESET);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable specified interrupt in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulIntType               Interrupt Flag Status type, should be:\r
+ *                                     - QEI_INTFLAG_INX_Int           : index pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_TIM_Int           : Velocity timer over flow interrupt\r
+ *                                     - QEI_INTFLAG_VELC_Int          : Capture velocity is less than compare interrupt\r
+ *                                     - QEI_INTFLAG_DIR_Int           : Change of direction interrupt\r
+ *                                     - QEI_INTFLAG_ERR_Int           : An encoder phase error interrupt\r
+ *                                     - QEI_INTFLAG_ENCLK_Int         : An encoder clock pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_POS0_Int          : position 0 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS1_Int          : position 1 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS2_Int          : position 2 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_REV_Int           : Index compare value is equal to the current index count interrupt\r
+ *                                     - QEI_INTFLAG_POS0REV_Int       : Combined position 0 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS1REV_Int       : Combined position 1 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS2REV_Int       : Combined position 2 and revolution count interrupt\r
+ * @param[in]  NewState        New function state, should be:\r
+ *                                     - DISABLE\r
+ *                                     - ENABLE\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_IntCmd(uint8_t qeiId, uint32_t ulIntType, FunctionalState NewState)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               pQei->IES = ulIntType;\r
+       }\r
+       else\r
+       {\r
+               pQei->IEC = ulIntType;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Sets (forces) specified interrupt in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulIntType               Interrupt Flag Status type, should be:\r
+ *                                     - QEI_INTFLAG_INX_Int           : index pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_TIM_Int           : Velocity timer over flow interrupt\r
+ *                                     - QEI_INTFLAG_VELC_Int          : Capture velocity is less than compare interrupt\r
+ *                                     - QEI_INTFLAG_DIR_Int           : Change of direction interrupt\r
+ *                                     - QEI_INTFLAG_ERR_Int           : An encoder phase error interrupt\r
+ *                                     - QEI_INTFLAG_ENCLK_Int         : An encoder clock pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_POS0_Int          : position 0 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS1_Int          : position 1 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS2_Int          : position 2 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_REV_Int           : Index compare value is equal to the current index count interrupt\r
+ *                                     - QEI_INTFLAG_POS0REV_Int       : Combined position 0 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS1REV_Int       : Combined position 1 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS2REV_Int       : Combined position 2 and revolution count interrupt\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_IntSet(uint8_t qeiId, uint32_t ulIntType)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->SET = ulIntType;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear (force) specified interrupt (pending) in QEI peripheral\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulIntType               Interrupt Flag Status type, should be:\r
+ *                                     - QEI_INTFLAG_INX_Int           : index pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_TIM_Int           : Velocity timer over flow interrupt\r
+ *                                     - QEI_INTFLAG_VELC_Int          : Capture velocity is less than compare interrupt\r
+ *                                     - QEI_INTFLAG_DIR_Int           : Change of direction interrupt\r
+ *                                     - QEI_INTFLAG_ERR_Int           : An encoder phase error interrupt\r
+ *                                     - QEI_INTFLAG_ENCLK_Int         : An encoder clock pulse was detected interrupt\r
+ *                                     - QEI_INTFLAG_POS0_Int          : position 0 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS1_Int          : position 1 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_POS2_Int          : position 2 compare value is equal to the current position interrupt\r
+ *                                     - QEI_INTFLAG_REV_Int           : Index compare value is equal to the current index count interrupt\r
+ *                                     - QEI_INTFLAG_POS0REV_Int       : Combined position 0 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS1REV_Int       : Combined position 1 and revolution count interrupt\r
+ *                                     - QEI_INTFLAG_POS2REV_Int       : Combined position 2 and revolution count interrupt\r
+ * @return             None\r
+ **********************************************************************/\r
+void QEI_IntClear(uint8_t qeiId, uint32_t ulIntType)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       pQei->CLR = ulIntType;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Calculates the actual velocity in RPM passed via velocity\r
+ *                             capture value and Pulse Per Round (of the encoder) value\r
+ *                             parameter input.\r
+ * @param[in]  qeiId The Id of the expected QEI component, should be: 0\r
+ * @param[in]  ulVelCapValue   Velocity capture input value that can be\r
+ *                             got from QEI_GetVelocityCap() function\r
+ * @param[in]  ulPPR   Pulse per round of encoder\r
+ * @return             The actual value of velocity in RPM (Round per minute)\r
+ **********************************************************************/\r
+uint32_t QEI_CalculateRPM(uint8_t qeiId, uint32_t ulVelCapValue, uint32_t ulPPR)\r
+{\r
+       LPC_QEI_Type* pQei = QEI_GetPointer(qeiId);\r
+\r
+       uint64_t rpm, clock, Load, edges;\r
+\r
+       // Get current Clock rate for timer input\r
+       clock = CGU_GetPCLKFrequency(CGU_PERIPHERAL_M3CORE);\r
+\r
+       // Get Timer load value (velocity capture period)\r
+       Load  = (uint64_t)(pQei->LOAD + 1);\r
+\r
+       // Get Edge\r
+       edges = (uint64_t)((pQei->CONF & QEI_CONF_CAPMODE) ? 4 : 2);\r
+\r
+       // Calculate RPM\r
+       rpm = ((clock * ulVelCapValue * 60) / (Load * ulPPR * edges));\r
+\r
+       return (uint32_t)(rpm);\r
+}\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _QEI */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rgu.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rgu.c
new file mode 100644 (file)
index 0000000..5847053
--- /dev/null
@@ -0,0 +1,253 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rgu.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rgu.c\r
+* @brief       Contains all functions support for RGU firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup RGU\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_rgu.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _RGU\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup RGU_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Soft Reset a Signal\r
+ * @param[in]  ResetSignal indicates which signal will be reset, should be:\r
+ *                                     - RGU_SIG_CORE          :Core\r
+ *                                     - RGU_SIG_PERIPH        :Peripheral\r
+ *                                     - RGU_SIG_MASTER        :Master\r
+ *                                     - RGU_SIG_WWDT          :WWDT\r
+ *                                     - RGU_SIG_CREG          :Configuration register block\r
+ *                                     - RGU_SIG_BUS           :Buses\r
+ *                                     - RGU_SIG_SCU           :System control unit\r
+ *                                     - RGU_SIG_PINMUX        :Pin mux\r
+ *                                     - RGU_SIG_M3            :Cortex-M3 system\r
+ *                                     - RGU_SIG_LCD           :LCD controller\r
+ *                                     - RGU_SIG_USB0          :USB0\r
+ *                                     - RGU_SIG_USB1          :USB1\r
+ *                                     - RGU_SIG_DMA           :DMA\r
+ *                                     - RGU_SIG_SDIO          :SDIO\r
+ *                                     - RGU_SIG_EMC           :External memory controller\r
+ *                                     - RGU_SIG_ETHERNET      :Ethernet\r
+ *                                     - RGU_SIG_AES           :AES\r
+ *                                     - RGU_SIG_GPIO          :GPIO\r
+ *                                     - RGU_SIG_TIMER0        :Timer 0\r
+ *                                     - RGU_SIG_TIMER1        :Timer 1\r
+ *                                     - RGU_SIG_TIMER2        :Timer 2\r
+ *                                     - RGU_SIG_TIMER3        :Timer 3\r
+ *                                     - RGU_SIG_RITIMER       :Repetitive Interrupt Timer\r
+ *                                     - RGU_SIG_SCT           :State Configurable Timer\r
+ *                                     - RGU_SIG_MOTOCONPWM:Motor Control PWM\r
+ *                                     - RGU_SIG_QEI           :QEI\r
+ *                                     - RGU_SIG_ADC0          :ADC0\r
+ *                                     - RGU_SIG_ADC1          :ADC1\r
+ *                                     - RGU_SIG_DAC           :DAC\r
+ *                                     - RGU_SIG_UART0         :UART0\r
+ *                                     - RGU_SIG_UART1         :UART1\r
+ *                                     - RGU_SIG_UART2         :UART2\r
+ *                                     - RGU_SIG_UART3         :UART3\r
+ *                                     - RGU_SIG_I2C0          :I2C0\r
+ *                                     - RGU_SIG_I2C1          :I2C1\r
+ *                                     - RGU_SIG_SSP0          :SSP0\r
+ *                                     - RGU_SIG_SSP1          :SSP1\r
+ *                                     - RGU_SIG_I2S           :I2S\r
+ *                                     - RGU_SIG_SPIFI         :SPIFI\r
+ *                                     - RGU_SIG_CAN           :CAN\r
+ * @return             None\r
+ **********************************************************************/\r
+void RGU_SoftReset(RGU_SIG ResetSignal)\r
+{\r
+       if(ResetSignal < 32){\r
+               LPC_RGU->RESET_CTRL0 = 1 << ResetSignal;\r
+               LPC_RGU->RESET_CTRL0 = 0;\r
+       }else{\r
+               LPC_RGU->RESET_CTRL1 = 1 << (ResetSignal - 32);\r
+               LPC_RGU->RESET_CTRL1 = 0;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get source cause of a signal\r
+ * @param[in]  ResetSignal reset signal, should be:\r
+ *                                     - RGU_SIG_CORE          :Core\r
+ *                                     - RGU_SIG_PERIPH        :Peripheral\r
+ *                                     - RGU_SIG_MASTER        :Master\r
+ *                                     - RGU_SIG_WWDT          :WWDT\r
+ *                                     - RGU_SIG_CREG          :Configuration register block\r
+ *                                     - RGU_SIG_BUS           :Buses\r
+ *                                     - RGU_SIG_SCU           :System control unit\r
+ *                                     - RGU_SIG_PINMUX        :Pin mux\r
+ *                                     - RGU_SIG_M3            :Cortex-M3 system\r
+ *                                     - RGU_SIG_LCD           :LCD controller\r
+ *                                     - RGU_SIG_USB0          :USB0\r
+ *                                     - RGU_SIG_USB1          :USB1\r
+ *                                     - RGU_SIG_DMA           :DMA\r
+ *                                     - RGU_SIG_SDIO          :SDIO\r
+ *                                     - RGU_SIG_EMC           :External memory controller\r
+ *                                     - RGU_SIG_ETHERNET      :Ethernet\r
+ *                                     - RGU_SIG_AES           :AES\r
+ *                                     - RGU_SIG_GPIO          :GPIO\r
+ *                                     - RGU_SIG_TIMER0        :Timer 0\r
+ *                                     - RGU_SIG_TIMER1        :Timer 1\r
+ *                                     - RGU_SIG_TIMER2        :Timer 2\r
+ *                                     - RGU_SIG_TIMER3        :Timer 3\r
+ *                                     - RGU_SIG_RITIMER       :Repetitive Interrupt Timer\r
+ *                                     - RGU_SIG_SCT           :State Configurable Timer\r
+ *                                     - RGU_SIG_MOTOCONPWM:Motor Control PWM\r
+ *                                     - RGU_SIG_QEI           :QEI\r
+ *                                     - RGU_SIG_ADC0          :ADC0\r
+ *                                     - RGU_SIG_ADC1          :ADC1\r
+ *                                     - RGU_SIG_DAC           :DAC\r
+ *                                     - RGU_SIG_UART0         :UART0\r
+ *                                     - RGU_SIG_UART1         :UART1\r
+ *                                     - RGU_SIG_UART2         :UART2\r
+ *                                     - RGU_SIG_UART3         :UART3\r
+ *                                     - RGU_SIG_I2C0          :I2C0\r
+ *                                     - RGU_SIG_I2C1          :I2C1\r
+ *                                     - RGU_SIG_SSP0          :SSP0\r
+ *                                     - RGU_SIG_SSP1          :SSP1\r
+ *                                     - RGU_SIG_I2S           :I2S\r
+ *                                     - RGU_SIG_SPIFI         :SPIFI\r
+ *                                     - RGU_SIG_CAN           :CAN\r
+ * @return             Source cause of reset, could be:\r
+ *                                     - RGU_SRC_NONE          :No source\r
+ *                                     - RGU_SRC_SOFT          :Software reset source\r
+ *                                     - RGU_SRC_EXT           :External reset source\r
+ *                                     - RGU_SRC_CORE          :Core reset source\r
+ *                                     - RGU_SRC_PERIPH        :Peripheral reset source\r
+ *                                     - RGU_SRC_MASTER        :Master reset source\r
+ *                                     - RGU_SRC_BOD           :BOD reset source\r
+ *                                     - RGU_SRC_WWDT          :WWDT reset source\r
+ **********************************************************************/\r
+RGU_SRC RGU_GetSource(RGU_SIG ResetSignal)\r
+{\r
+       uint32_t i, temp, registercache;\r
+       if(ResetSignal < 16)\r
+               temp = 3 & (LPC_RGU->RESET_STATUS0 >> ResetSignal);\r
+       else if(ResetSignal < 32)\r
+               temp = 3 & (LPC_RGU->RESET_STATUS1 >> (ResetSignal - 16));\r
+       else if(ResetSignal < 48)\r
+               temp = 3 & (LPC_RGU->RESET_STATUS2 >> (ResetSignal - 32));\r
+       else\r
+               temp = 3 & (LPC_RGU->RESET_STATUS3 >> (ResetSignal - 48));\r
+\r
+       if(temp == 0) return RGU_SRC_NONE;\r
+       else if(temp == 3) return RGU_SRC_SOFT;\r
+       else if(temp == 1){\r
+               registercache = (((uint32_t*)&LPC_RGU->RESET_EXT_STAT0)[ResetSignal]);\r
+               for(i = 0; i < 6; i++){\r
+                       if(registercache & (1<<i)){\r
+                               return (RGU_SRC)(RGU_SRC_EXT + i);\r
+                       }\r
+               }\r
+       }\r
+       return RGU_SRC_NONE;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get Current Status of Signal\r
+ * @param[in]  ResetSignal Reset Signal, should be:\r
+ *                                     - RGU_SIG_CORE          :Core\r
+ *                                     - RGU_SIG_PERIPH        :Peripheral\r
+ *                                     - RGU_SIG_MASTER        :Master\r
+ *                                     - RGU_SIG_WWDT          :WWDT\r
+ *                                     - RGU_SIG_CREG          :Configuration register block\r
+ *                                     - RGU_SIG_BUS           :Buses\r
+ *                                     - RGU_SIG_SCU           :System control unit\r
+ *                                     - RGU_SIG_PINMUX        :Pin mux\r
+ *                                     - RGU_SIG_M3            :Cortex-M3 system\r
+ *                                     - RGU_SIG_LCD           :LCD controller\r
+ *                                     - RGU_SIG_USB0          :USB0\r
+ *                                     - RGU_SIG_USB1          :USB1\r
+ *                                     - RGU_SIG_DMA           :DMA\r
+ *                                     - RGU_SIG_SDIO          :SDIO\r
+ *                                     - RGU_SIG_EMC           :External memory controller\r
+ *                                     - RGU_SIG_ETHERNET      :Ethernet\r
+ *                                     - RGU_SIG_AES           :AES\r
+ *                                     - RGU_SIG_GPIO          :GPIO\r
+ *                                     - RGU_SIG_TIMER0        :Timer 0\r
+ *                                     - RGU_SIG_TIMER1        :Timer 1\r
+ *                                     - RGU_SIG_TIMER2        :Timer 2\r
+ *                                     - RGU_SIG_TIMER3        :Timer 3\r
+ *                                     - RGU_SIG_RITIMER       :Repetitive Interrupt Timer\r
+ *                                     - RGU_SIG_SCT           :State Configurable Timer\r
+ *                                     - RGU_SIG_MOTOCONPWM:Motor Control PWM\r
+ *                                     - RGU_SIG_QEI           :QEI\r
+ *                                     - RGU_SIG_ADC0          :ADC0\r
+ *                                     - RGU_SIG_ADC1          :ADC1\r
+ *                                     - RGU_SIG_DAC           :DAC\r
+ *                                     - RGU_SIG_UART0         :UART0\r
+ *                                     - RGU_SIG_UART1         :UART1\r
+ *                                     - RGU_SIG_UART2         :UART2\r
+ *                                     - RGU_SIG_UART3         :UART3\r
+ *                                     - RGU_SIG_I2C0          :I2C0\r
+ *                                     - RGU_SIG_I2C1          :I2C1\r
+ *                                     - RGU_SIG_SSP0          :SSP0\r
+ *                                     - RGU_SIG_SSP1          :SSP1\r
+ *                                     - RGU_SIG_I2S           :I2S\r
+ *                                     - RGU_SIG_SPIFI         :SPIFI\r
+ *                                     - RGU_SIG_CAN           :CAN\r
+ * @return             Signal status, could be:\r
+ *                                     - TRUE  :reset is active\r
+ *                                     - FALSE :reset is inactive\r
+ **********************************************************************/\r
+Bool RGU_GetSignalStatus(RGU_SIG ResetSignal)\r
+{\r
+       if(ResetSignal < 32)\r
+               return (Bool)!(LPC_RGU->RESET_ACTIVE_STATUS0 | (1 << ResetSignal));\r
+       else\r
+               return (Bool)!(LPC_RGU->RESET_ACTIVE_STATUS1 | (1 << (ResetSignal - 32)));\r
+}\r
+\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _RGU */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rit.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rit.c
new file mode 100644 (file)
index 0000000..f203f95
--- /dev/null
@@ -0,0 +1,196 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rit.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rit.c\r
+* @brief       Contains all functions support for RIT firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup RIT\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_rit.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _RIT\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup RIT_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/******************************************************************************//*\r
+ * @brief              Initial for RIT\r
+ *                                     - Turn on power and clock\r
+ *                                     - Setup default register values\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @return             None\r
+ *******************************************************************************/\r
+void RIT_Init(LPC_RITIMER_Type *RITx)\r
+{\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+       //CGU_ConfigPPWR (CGU_PCONP_PCRIT, ENABLE);\r
+       //Set up default register values\r
+       RITx->COMPVAL = 0xFFFFFFFF;\r
+       RITx->MASK      = 0x00000000;\r
+       RITx->CTRL      = 0x0C;\r
+       RITx->COUNTER   = 0x00000000;\r
+       // Turn on power and clock\r
+\r
+}\r
+/******************************************************************************//*\r
+ * @brief              DeInitial for RIT\r
+ *                                     - Turn off power and clock\r
+ *                                     - ReSetup default register values\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @return             None\r
+ *******************************************************************************/\r
+void RIT_DeInit(LPC_RITIMER_Type *RITx)\r
+{\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+\r
+       // Turn off power and clock\r
+       //CGU_ConfigPPWR (CGU_PCONP_PCRIT, DISABLE);\r
+       //ReSetup default register values\r
+       RITx->COMPVAL = 0xFFFFFFFF;\r
+       RITx->MASK      = 0x00000000;\r
+       RITx->CTRL      = 0x0C;\r
+       RITx->COUNTER   = 0x00000000;\r
+}\r
+\r
+/******************************************************************************//*\r
+ * @brief              Set compare value, mask value and time counter value\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @param[in]  time_interval timer interval value (ms)\r
+ * @return             None\r
+ *******************************************************************************/\r
+\r
+void RIT_TimerConfig(LPC_RITIMER_Type *RITx, uint32_t time_interval)\r
+{\r
+       uint32_t clock_rate, cmp_value;\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+\r
+       // Get PCLK value of RIT\r
+       clock_rate = /*CGU_GetPCLK(CGU_PCLKSEL_RIT)*/ CGU_GetPCLKFrequency(CGU_PERIPHERAL_M3CORE);\r
+\r
+       /* calculate compare value for RIT to generate interrupt at\r
+        * specified time interval\r
+        * COMPVAL = (RIT_PCLK * time_interval)/1000\r
+        * (with time_interval unit is millisecond)
+        */\r
+       cmp_value = (clock_rate /1000) * time_interval;\r
+       RITx->COMPVAL = cmp_value;\r
+\r
+       /* Set timer enable clear bit to clear timer to 0 whenever\r
+        * counter value equals the contents of RICOMPVAL
+        */\r
+       RITx->CTRL |= (1<<1);\r
+}\r
+\r
+\r
+/******************************************************************************//*\r
+ * @brief              Enable/Disable Timer\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @param[in]  NewState        New State of this function\r
+ *                                     -ENABLE         :Enable Timer\r
+ *                                     -DISABLE        :Disable Timer\r
+ * @return             None\r
+ *******************************************************************************/\r
+void RIT_Cmd(LPC_RITIMER_Type *RITx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       //Enable or Disable Timer\r
+       if(NewState==ENABLE)\r
+       {\r
+               RITx->CTRL |= RIT_CTRL_TEN;\r
+       }\r
+       else\r
+       {\r
+               RITx->CTRL &= ~RIT_CTRL_TEN;\r
+       }\r
+}\r
+\r
+/******************************************************************************//*\r
+ * @brief              Timer Enable/Disable on debug\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @param[in]  NewState        New State of this function\r
+ *                                     -ENABLE         :The timer is halted whenever a hardware break condition occurs\r
+ *                                     -DISABLE        :Hardware break has no effect on the timer operation\r
+ * @return             None\r
+ *******************************************************************************/\r
+void RIT_TimerDebugCmd(LPC_RITIMER_Type *RITx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       //Timer Enable/Disable on break\r
+       if(NewState==ENABLE)\r
+       {\r
+               RITx->CTRL |= RIT_CTRL_ENBR;\r
+       }\r
+       else\r
+       {\r
+               RITx->CTRL &= ~RIT_CTRL_ENBR;\r
+       }\r
+}\r
+/******************************************************************************//*\r
+ * @brief              Check whether interrupt flag is set or not\r
+ * @param[in]  RITx is RIT peripheral selected, should be: LPC_RIT\r
+ * @return             Current interrupt status, could be\r
+ *                                     - SET\r
+ *                                     - RESET\r
+ *******************************************************************************/\r
+IntStatus RIT_GetIntStatus(LPC_RITIMER_Type *RITx)\r
+{\r
+       uint8_t result;\r
+       CHECK_PARAM(PARAM_RITx(RITx));\r
+       if((RITx->CTRL&RIT_CTRL_INTEN)==1)      result= SET;\r
+       else return RESET;\r
+       //clear interrupt flag\r
+       RITx->CTRL |= RIT_CTRL_INTEN;\r
+       return (IntStatus)result;\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _RIT */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rtc.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_rtc.c
new file mode 100644 (file)
index 0000000..aabd600
--- /dev/null
@@ -0,0 +1,760 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_rtc.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_rtc.c\r
+* @brief       Contains all functions support for RTC firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup RTC\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_rtc.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _RTC\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup RTC_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initializes the RTC peripheral.\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @return             None\r
+ *********************************************************************/\r
+void RTC_Init (LPC_RTC_Type *RTCx)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       // Configure clock to RTC\r
+       LPC_CREG->CREG0 &= ~((1<<3)|(1<<2));                                    // Reset 32Khz oscillator\r
+       LPC_CREG->CREG0 |= (1<<1)|(1<<0);                                               // Enable 32 kHz & 1 kHz on osc32k and release reset\r
+       LPC_SCU->SFSCLK_0 = 1 | (0x3<<2);                                               // function 1; CGU clk out, pull down\r
+       LPC_CGU->BASE_OUT_CLK = (CGU_CLKSRC_32KHZ_OSC<<24) |(1<<11);            // base clock out use 32KHz crystal and auto block\r
+       do\r
+       {\r
+               /* Reset RTC clock*/\r
+               RTCx->CCR = RTC_CCR_CTCRST | RTC_CCR_CCALEN;\r
+       }\r
+       while(RTCx->CCR!=(RTC_CCR_CTCRST | RTC_CCR_CCALEN));\r
+       do\r
+       {\r
+               /* Finish resetting RTC clock*/\r
+               RTCx->CCR = RTC_CCR_CCALEN;\r
+       }\r
+       while(RTCx->CCR != RTC_CCR_CCALEN);\r
+       /* Clear counter increment and alarm interrupt */\r
+       RTCx->ILR = RTC_IRL_RTCCIF | RTC_IRL_RTCALF;\r
+       while(RTCx->ILR!=0);\r
+       // Clear all register to be default\r
+       RTCx->CIIR = 0x00;\r
+       RTCx->AMR = 0xFF;\r
+       RTCx->CALIBRATION = 0x00;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-initializes the RTC peripheral registers to their\r
+*                  default reset values.\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_DeInit(LPC_RTC_Type *RTCx)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       RTCx->CCR = 0x00;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Reset clock tick counter in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_ResetClockTickCounter(LPC_RTC_Type *RTCx)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       RTCx->CCR |= RTC_CCR_CTCRST;\r
+       RTCx->CCR &= (~RTC_CCR_CTCRST) & RTC_CCR_BITMASK;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Start/Stop RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE        :The time counters are enabled\r
+ *                                     - DISABLE       :The time counters are disabled\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_Cmd (LPC_RTC_Type *RTCx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               do\r
+               {\r
+               RTCx->CCR |= RTC_CCR_CLKEN;\r
+               }\r
+               while((RTCx->CCR&RTC_CCR_CLKEN)==0);\r
+       }\r
+       else\r
+       {\r
+               RTCx->CCR &= (~RTC_CCR_CLKEN) & RTC_CCR_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable Counter increment interrupt for each time type\r
+ *                             in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  CntIncrIntType: Counter Increment Interrupt type,\r
+ *                             an increment of this type value below will generates\r
+ *                             an interrupt, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE: Counter Increment interrupt for this time type are enabled\r
+ *                                     - DISABLE: Counter Increment interrupt for this time type are disabled\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_CntIncrIntConfig (LPC_RTC_Type *RTCx, uint32_t CntIncrIntType, \\r
+                                                               FunctionalState NewState)\r
+{\r
+       uint32_t tem;\r
+\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+       CHECK_PARAM(PARAM_RTC_TIMETYPE(CntIncrIntType));\r
+\r
+       switch (CntIncrIntType)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               tem = RTC_CIIR_IMSEC;\r
+               break;\r
+       case RTC_TIMETYPE_MINUTE:\r
+               tem = RTC_CIIR_IMMIN;\r
+               break;\r
+       case RTC_TIMETYPE_HOUR:\r
+               tem = RTC_CIIR_IMHOUR;\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               tem = RTC_CIIR_IMDOW;\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               tem = RTC_CIIR_IMDOM;\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               tem = RTC_CIIR_IMDOY;\r
+               break;\r
+       case RTC_TIMETYPE_MONTH:\r
+               tem = RTC_CIIR_IMMON;\r
+               break;\r
+       case RTC_TIMETYPE_YEAR:\r
+               tem = RTC_CIIR_IMYEAR;\r
+               break;\r
+       }\r
+       if (NewState ==  ENABLE)\r
+       {\r
+               //do\r
+               {\r
+                       RTCx->CIIR |= tem;\r
+               }\r
+               //while((RTCx->CIIR & tem)== 0);\r
+       }\r
+       else\r
+       {\r
+               //do\r
+               {\r
+                       RTCx->CIIR &= (~tem) & RTC_CIIR_BITMASK;\r
+               }\r
+               //while(RTCx->CIIR & tem);\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable Alarm interrupt for each time type\r
+ *                             in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  AlarmTimeType: Alarm Time Interrupt type,\r
+ *                             an matching of this type value below with current time\r
+ *                             in RTC will generates an interrupt, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE: Alarm interrupt for this time type are enabled\r
+ *                                     - DISABLE: Alarm interrupt for this time type are disabled\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_AlarmIntConfig (LPC_RTC_Type *RTCx, uint32_t AlarmTimeType, \\r
+                                                               FunctionalState NewState)\r
+{\r
+       uint32_t tem;\r
+\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+       CHECK_PARAM(PARAM_RTC_TIMETYPE(AlarmTimeType));\r
+\r
+       switch (AlarmTimeType)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               tem = (RTC_AMR_AMRSEC);\r
+               break;\r
+       case RTC_TIMETYPE_MINUTE:\r
+               tem = (RTC_AMR_AMRMIN);\r
+               break;\r
+       case RTC_TIMETYPE_HOUR:\r
+               tem = (RTC_AMR_AMRHOUR);\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               tem = (RTC_AMR_AMRDOW);\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               tem = (RTC_AMR_AMRDOM);\r
+               break;\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               tem = (RTC_AMR_AMRDOY);\r
+               break;\r
+       case RTC_TIMETYPE_MONTH:\r
+               tem = (RTC_AMR_AMRMON);\r
+               break;\r
+       case RTC_TIMETYPE_YEAR:\r
+               tem = (RTC_AMR_AMRYEAR);\r
+               break;\r
+       }\r
+       if (NewState == ENABLE)\r
+       {\r
+               //do\r
+               {\r
+                       RTCx->AMR &= (~tem) & RTC_AMR_BITMASK;\r
+               }\r
+               //while(RTCx->AMR & tem);\r
+       }\r
+       else\r
+       {\r
+               //do\r
+               {\r
+                       RTCx->AMR |= (tem);\r
+               }\r
+               //while((RTCx->AMR & tem)== 0);\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set current time value for each time type in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Timetype Time Type, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+ * @param[in]  TimeValue Time value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_SetTime (LPC_RTC_Type *RTCx, uint32_t Timetype, uint32_t TimeValue)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_TIMETYPE(Timetype));\r
+\r
+       switch ( Timetype)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               CHECK_PARAM(TimeValue <= RTC_SECOND_MAX);\r
+\r
+               RTCx->SEC = TimeValue & RTC_SEC_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_MINUTE:\r
+               CHECK_PARAM(TimeValue <= RTC_MINUTE_MAX);\r
+\r
+               RTCx->MIN = TimeValue & RTC_MIN_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_HOUR:\r
+               CHECK_PARAM(TimeValue <= RTC_HOUR_MAX);\r
+\r
+               RTCx->HRS = TimeValue & RTC_HOUR_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               CHECK_PARAM(TimeValue <= RTC_DAYOFWEEK_MAX);\r
+\r
+               RTCx->DOW = TimeValue & RTC_DOW_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               CHECK_PARAM((TimeValue <= RTC_DAYOFMONTH_MAX) \\r
+                               && (TimeValue >= RTC_DAYOFMONTH_MIN));\r
+\r
+               RTCx->DOM = TimeValue & RTC_DOM_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               CHECK_PARAM((TimeValue >= RTC_DAYOFYEAR_MIN) \\r
+                               && (TimeValue <= RTC_DAYOFYEAR_MAX));\r
+\r
+               RTCx->DOY = TimeValue & RTC_DOY_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_MONTH:\r
+               CHECK_PARAM((TimeValue >= RTC_MONTH_MIN) \\r
+                               && (TimeValue <= RTC_MONTH_MAX));\r
+\r
+               RTCx->MONTH = TimeValue & RTC_MONTH_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_YEAR:\r
+               CHECK_PARAM(TimeValue <= RTC_YEAR_MAX);\r
+\r
+               RTCx->YEAR = TimeValue & RTC_YEAR_MASK;\r
+               break;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current time value for each type time type\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Timetype Time Type, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+ * @return             Value of time according to specified time type\r
+ **********************************************************************/\r
+uint32_t RTC_GetTime(LPC_RTC_Type *RTCx, uint32_t Timetype)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_TIMETYPE(Timetype));\r
+\r
+       switch (Timetype)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               return (RTCx->SEC & RTC_SEC_MASK);\r
+       case RTC_TIMETYPE_MINUTE:\r
+               return (RTCx->MIN & RTC_MIN_MASK);\r
+       case RTC_TIMETYPE_HOUR:\r
+               return (RTCx->HRS & RTC_HOUR_MASK);\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               return (RTCx->DOW & RTC_DOW_MASK);\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               return (RTCx->DOM & RTC_DOM_MASK);\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               return (RTCx->DOY & RTC_DOY_MASK);\r
+       case RTC_TIMETYPE_MONTH:\r
+               return (RTCx->MONTH & RTC_MONTH_MASK);\r
+       case RTC_TIMETYPE_YEAR:\r
+               return (RTCx->YEAR & RTC_YEAR_MASK);\r
+       default:\r
+               return (0);\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set full of time in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  pFullTime Pointer to a RTC_TIME_Type structure that\r
+ *                             contains time value in full.\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_SetFullTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       RTCx->DOM = pFullTime->DOM & RTC_DOM_MASK;\r
+       RTCx->DOW = pFullTime->DOW & RTC_DOW_MASK;\r
+       RTCx->DOY = pFullTime->DOY & RTC_DOY_MASK;\r
+       RTCx->HRS = pFullTime->HOUR & RTC_HOUR_MASK;\r
+       RTCx->MIN = pFullTime->MIN & RTC_MIN_MASK;\r
+       RTCx->SEC = pFullTime->SEC & RTC_SEC_MASK;\r
+       RTCx->MONTH = pFullTime->MONTH & RTC_MONTH_MASK;\r
+       RTCx->YEAR = pFullTime->YEAR & RTC_YEAR_MASK;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get full of time in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  pFullTime Pointer to a RTC_TIME_Type structure that\r
+ *                             will be stored time in full.\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_GetFullTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       pFullTime->DOM = RTCx->DOM & RTC_DOM_MASK;\r
+       pFullTime->DOW = RTCx->DOW & RTC_DOW_MASK;\r
+       pFullTime->DOY = RTCx->DOY & RTC_DOY_MASK;\r
+       pFullTime->HOUR = RTCx->HRS & RTC_HOUR_MASK;\r
+       pFullTime->MIN = RTCx->MIN & RTC_MIN_MASK;\r
+       pFullTime->SEC = RTCx->SEC & RTC_SEC_MASK;\r
+       pFullTime->MONTH = RTCx->MONTH & RTC_MONTH_MASK;\r
+       pFullTime->YEAR = RTCx->YEAR & RTC_YEAR_MASK;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set alarm time value for each time type\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Timetype Time Type, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+ * @param[in]  ALValue Alarm time value to set\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_SetAlarmTime (LPC_RTC_Type *RTCx, uint32_t Timetype, uint32_t ALValue)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       switch (Timetype)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               CHECK_PARAM(ALValue <= RTC_SECOND_MAX);\r
+\r
+               RTCx->ASEC = ALValue & RTC_SEC_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_MINUTE:\r
+               CHECK_PARAM(ALValue <= RTC_MINUTE_MAX);\r
+\r
+               RTCx->AMIN = ALValue & RTC_MIN_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_HOUR:\r
+               CHECK_PARAM(ALValue <= RTC_HOUR_MAX);\r
+\r
+               RTCx->AHRS = ALValue & RTC_HOUR_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               CHECK_PARAM(ALValue <= RTC_DAYOFWEEK_MAX);\r
+\r
+               RTCx->ADOW = ALValue & RTC_DOW_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               CHECK_PARAM((ALValue <= RTC_DAYOFMONTH_MAX) \\r
+                               && (ALValue >= RTC_DAYOFMONTH_MIN));\r
+\r
+               RTCx->ADOM = ALValue & RTC_DOM_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               CHECK_PARAM((ALValue >= RTC_DAYOFYEAR_MIN) \\r
+                               && (ALValue <= RTC_DAYOFYEAR_MAX));\r
+\r
+               RTCx->ADOY = ALValue & RTC_DOY_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_MONTH:\r
+               CHECK_PARAM((ALValue >= RTC_MONTH_MIN) \\r
+                               && (ALValue <= RTC_MONTH_MAX));\r
+\r
+               RTCx->AMON = ALValue & RTC_MONTH_MASK;\r
+               break;\r
+\r
+       case RTC_TIMETYPE_YEAR:\r
+               CHECK_PARAM(ALValue <= RTC_YEAR_MAX);\r
+\r
+               RTCx->AYRS = ALValue & RTC_YEAR_MASK;\r
+               break;\r
+       }\r
+}\r
+\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get alarm time value for each time type\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Timetype Time Type, should be:\r
+ *                                     - RTC_TIMETYPE_SECOND\r
+ *                                     - RTC_TIMETYPE_MINUTE\r
+ *                                     - RTC_TIMETYPE_HOUR\r
+ *                                     - RTC_TIMETYPE_DAYOFWEEK\r
+ *                                     - RTC_TIMETYPE_DAYOFMONTH\r
+ *                                     - RTC_TIMETYPE_DAYOFYEAR\r
+ *                                     - RTC_TIMETYPE_MONTH\r
+ *                                     - RTC_TIMETYPE_YEAR\r
+  * @return    Value of Alarm time according to specified time type\r
+ **********************************************************************/\r
+uint32_t RTC_GetAlarmTime (LPC_RTC_Type *RTCx, uint32_t Timetype)\r
+{\r
+       switch (Timetype)\r
+       {\r
+       case RTC_TIMETYPE_SECOND:\r
+               return (RTCx->ASEC & RTC_SEC_MASK);\r
+       case RTC_TIMETYPE_MINUTE:\r
+               return (RTCx->AMIN & RTC_MIN_MASK);\r
+       case RTC_TIMETYPE_HOUR:\r
+               return (RTCx->AHRS & RTC_HOUR_MASK);\r
+       case RTC_TIMETYPE_DAYOFWEEK:\r
+               return (RTCx->ADOW & RTC_DOW_MASK);\r
+       case RTC_TIMETYPE_DAYOFMONTH:\r
+               return (RTCx->ADOM & RTC_DOM_MASK);\r
+       case RTC_TIMETYPE_DAYOFYEAR:\r
+               return (RTCx->ADOY & RTC_DOY_MASK);\r
+       case RTC_TIMETYPE_MONTH:\r
+               return (RTCx->AMON & RTC_MONTH_MASK);\r
+       case RTC_TIMETYPE_YEAR:\r
+               return (RTCx->AYRS & RTC_YEAR_MASK);\r
+       default:\r
+               return (0);\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set full of alarm time in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  pFullTime Pointer to a RTC_TIME_Type structure that\r
+ *                             contains alarm time value in full.\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_SetFullAlarmTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       RTCx->ADOM = pFullTime->DOM & RTC_DOM_MASK;\r
+       RTCx->ADOW = pFullTime->DOW & RTC_DOW_MASK;\r
+       RTCx->ADOY = pFullTime->DOY & RTC_DOY_MASK;\r
+       RTCx->AHRS = pFullTime->HOUR & RTC_HOUR_MASK;\r
+       RTCx->AMIN = pFullTime->MIN & RTC_MIN_MASK;\r
+       RTCx->ASEC = pFullTime->SEC & RTC_SEC_MASK;\r
+       RTCx->AMON = pFullTime->MONTH & RTC_MONTH_MASK;\r
+       RTCx->AYRS = pFullTime->YEAR & RTC_YEAR_MASK;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get full of alarm time in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  pFullTime Pointer to a RTC_TIME_Type structure that\r
+ *                             will be stored alarm time in full.\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_GetFullAlarmTime (LPC_RTC_Type *RTCx, RTC_TIME_Type *pFullTime)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+\r
+       pFullTime->DOM = RTCx->ADOM & RTC_DOM_MASK;\r
+       pFullTime->DOW = RTCx->ADOW & RTC_DOW_MASK;\r
+       pFullTime->DOY = RTCx->ADOY & RTC_DOY_MASK;\r
+       pFullTime->HOUR = RTCx->AHRS & RTC_HOUR_MASK;\r
+       pFullTime->MIN = RTCx->AMIN & RTC_MIN_MASK;\r
+       pFullTime->SEC = RTCx->ASEC & RTC_SEC_MASK;\r
+       pFullTime->MONTH = RTCx->AMON & RTC_MONTH_MASK;\r
+       pFullTime->YEAR = RTCx->AYRS & RTC_YEAR_MASK;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if specified Location interrupt in\r
+ *                             RTC peripheral is set or not\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  IntType Interrupt location type, should be:\r
+ *                                     - RTC_INT_COUNTER_INCREASE: Counter Increment Interrupt block generated an interrupt.\r
+ *                                     - RTC_INT_ALARM: Alarm generated an interrupt.\r
+ * @return             New state of specified Location interrupt in RTC peripheral\r
+ *                                     - SET\r
+ *                                     - RESET\r
+ **********************************************************************/\r
+IntStatus RTC_GetIntPending (LPC_RTC_Type *RTCx, uint32_t IntType)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_INT(IntType));\r
+\r
+       return ((RTCx->ILR & IntType) ? SET : RESET);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear specified Location interrupt pending in\r
+ *                             RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  IntType Interrupt location type, should be:\r
+ *                                     - RTC_INT_COUNTER_INCREASE      :Clear Counter Increment Interrupt pending.\r
+ *                                     - RTC_INT_ALARM                         :Clear alarm interrupt pending\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_ClearIntPending (LPC_RTC_Type *RTCx, uint32_t IntType)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_INT(IntType));\r
+\r
+       RTCx->ILR = IntType;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable calibration counter in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  NewState New State of this function, should be:\r
+ *                                     - ENABLE        :The calibration counter is enabled and counting\r
+ *                                     - DISABLE       :The calibration counter is disabled and reset to zero\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_CalibCounterCmd(LPC_RTC_Type *RTCx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               do\r
+               {\r
+               RTCx->CCR &= (~RTC_CCR_CCALEN) & RTC_CCR_BITMASK;\r
+               }while(RTCx->CCR&RTC_CCR_CCALEN);\r
+       }\r
+       else\r
+       {\r
+               RTCx->CCR |= RTC_CCR_CCALEN;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configures Calibration in RTC peripheral\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  CalibValue Calibration value, should be in range from\r
+ *                                     0 to 131,072\r
+ * @param[in]  CalibDir Calibration Direction, should be:\r
+ *                                     - RTC_CALIB_DIR_FORWARD         :Forward calibration\r
+ *                                     - RTC_CALIB_DIR_BACKWARD        :Backward calibration\r
+ * @return             None\r
+ **********************************************************************/\r
+void RTC_CalibConfig(LPC_RTC_Type *RTCx, uint32_t CalibValue, uint8_t CalibDir)\r
+{\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_CALIB_DIR(CalibDir));\r
+       CHECK_PARAM(CalibValue < RTC_CALIBRATION_MAX);\r
+\r
+       RTCx->CALIBRATION = ((CalibValue - 1) & RTC_CALIBRATION_CALVAL_MASK) \\r
+                       | ((CalibDir == RTC_CALIB_DIR_BACKWARD) ? RTC_CALIBRATION_LIBDIR : 0);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Write value to General purpose registers\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Channel General purpose registers Channel number,\r
+ *                             should be in range from 0 to 63.\r
+ * @param[in]  Value Value to write\r
+ * @return             None\r
+ * Note: These General purpose registers can be used to store important\r
+ * information when the main power supply is off. The value in these\r
+ * registers is not affected by chip reset.\r
+ **********************************************************************/\r
+void RTC_WriteGPREG (LPC_RTC_Type *RTCx, uint8_t Channel, uint32_t Value)\r
+{\r
+       uint32_t *preg;\r
+\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_GPREG_CH(Channel));\r
+\r
+       preg = (uint32_t *)RTC_GPREG_BASE;\r
+       preg += Channel;\r
+       *preg = Value;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read value from General purpose registers\r
+ * @param[in]  RTCx    RTC peripheral selected, should be LPC_RTC\r
+ * @param[in]  Channel General purpose registers Channel number,\r
+ *                             should be in range from 0 to 4.\r
+ * @return             Read Value\r
+ * Note: These General purpose registers can be used to store important\r
+ * information when the main power supply is off. The value in these\r
+ * registers is not affected by chip reset.\r
+ **********************************************************************/\r
+uint32_t RTC_ReadGPREG (LPC_RTC_Type *RTCx, uint8_t Channel)\r
+{\r
+       uint32_t *preg;\r
+       uint32_t value;\r
+\r
+       CHECK_PARAM(PARAM_RTCx(RTCx));\r
+       CHECK_PARAM(PARAM_RTC_GPREG_CH(Channel));\r
+\r
+       preg = (uint32_t *)RTC_GPREG_BASE;\r
+       preg += Channel;\r
+       value = *preg;\r
+       return (value);\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _RTC */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_sct.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_sct.c
new file mode 100644 (file)
index 0000000..be01f67
--- /dev/null
@@ -0,0 +1,140 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_sct.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_sct.c\r
+* @brief       Contains all functions support for SCT firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup SCT\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_sct.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _SCT\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup SCT_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Select 16/32 bit SCT counter\r
+ * @param[in]  value   configuration value for SCT\r
+ *                                     - SCT_CONFIG_16BIT_COUNTER      :16-bit counter\r
+ *                                     - SCT_CONFIG_32BIT_COUNTER      :32-bit counter\r
+ * @return             None\r
+ **********************************************************************/\r
+void SCT_Config(uint32_t value)\r
+{\r
+       CHECK_PARAM(PARAM_SCT_CONFIG_COUNTER_TYPE(value));\r
+\r
+       LPC_SCT->CONFIG = value;\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Setting SCT control\r
+* @param[in]   value   setting value\r
+* @param[in]   ena     Enable/disable status\r
+*                                      - ENABLE\r
+*                                      - DISABLE\r
+* @return              None\r
+**********************************************************************/\r
+void SCT_ControlSet(uint32_t value, FunctionalState ena)\r
+{\r
+       uint32_t tem;\r
+\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(ena));\r
+\r
+       tem = LPC_SCT->CTRL_U;\r
+\r
+       if(ena == ENABLE)\r
+       {\r
+               tem |= value;\r
+       }\r
+       else\r
+       {\r
+               tem &= (~value);\r
+       }\r
+\r
+       LPC_SCT->CTRL_U = tem;\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Set start mode for ADC\r
+* @param[in]   outnum  number of SCT output, should be: 0..15\r
+* @param[in]   value   solution value, should be\r
+*                                      - SCT_RES_NOCHANGE                      :No change\r
+*                                      - SCT_RES_SET_OUTPUT            :Set output\r
+*                                      - SCT_RES_CLEAR_OUTPUT          :Clear output\r
+*                                      - SCT_RES_TOGGLE_OUTPUT         :Toggle output\r
+* @return              None\r
+*********************************************************************/\r
+void SCT_ConflictResolutionSet(uint8_t outnum, uint8_t value)\r
+{\r
+       uint32_t tem;\r
+\r
+       CHECK_PARAM(PARAM_SCT_OUTPUT_NUM(outnum));\r
+       CHECK_PARAM(PARAM_SCT_RES(value));\r
+\r
+       tem = LPC_SCT->RES;\r
+       tem &= ~(0x03 << (2*outnum));\r
+       tem |= (value << (2*outnum));\r
+       LPC_SCT->RES = tem;\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Clear SCT event generating interrupt request\r
+* @param[in]   even_num        SCT event number, should be: 0..15\r
+* @return              None\r
+*********************************************************************/\r
+void SCT_EventFlagClear(uint8_t even_num)\r
+{\r
+       CHECK_PARAM(PARAM_SCT_EVENT(even_num));\r
+\r
+       LPC_SCT->EVFLAG = (1 << (even_num));\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _SCT */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_scu.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_scu.c
new file mode 100644 (file)
index 0000000..a6da21d
--- /dev/null
@@ -0,0 +1,62 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_scu.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_scu.c\r
+* @brief       Contains all functions support for SCU firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup SCU\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"                    /* LPC18xx definitions                */\r
+#include "lpc_types.h"\r
+#include "lpc18xx_scu.h"\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure pin function\r
+ * @param[in]  port    Port number, should be: 0..15\r
+ * @param[in]  pin             Pin number, should be: 0..31\r
+ * @param[in]  mode    Pin mode, should be:\r
+ *                                     - MD_PUP        :Pull-up enabled\r
+ *                                     - MD_BUK        :Plain input\r
+ *                                     - MD_PLN        :Repeater mode\r
+ *                                     - MD_PDN        :Pull-down enabled\r
+ * @param[in]  func    Function mode, should be:\r
+ *                                     - FUNC0         :Function 0\r
+ *                                     - FUNC1         :Function 1\r
+ *                                     - FUNC2         :Function 2\r
+ *                                     - FUNC3         :Function 3\r
+ * @return             None\r
+ **********************************************************************/\r
+void scu_pinmux(uint8_t port, uint8_t pin, uint8_t mode, uint8_t func)\r
+{\r
+  uint32_t * scu_base=(uint32_t*)(LPC_SCU_BASE);\r
+  scu_base[(PORT_OFFSET*port+PIN_OFFSET*pin)/4]=mode+func;\r
+} /* scu_pinmux */\r
+\r
+/**\r
+ * @}\r
+ */\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_ssp.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_ssp.c
new file mode 100644 (file)
index 0000000..2c278fc
--- /dev/null
@@ -0,0 +1,644 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_ssp.c           2011-06-02\r
+*//**\r
+* @file                lpc18xx_ssp.c\r
+* @brief       Contains all functions support for SSP firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup SSP\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_ssp.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _SSP\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup SSP_Private_Functions\r
+ * @{\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup SSP_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/********************************************************************//**\r
+ * @brief              Initializes the SSPx peripheral according to the specified\r
+ *              parameters in the SSP_ConfigStruct.\r
+ * @param[in]  SSPx SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  SSP_ConfigStruct Pointer to a SSP_CFG_Type structure that\r
+ *                             contains the configuration information for the specified\r
+ *                             SSP peripheral.\r
+ * @return             None\r
+ *********************************************************************/\r
+void SSP_Init(LPC_SSPn_Type *SSPx, SSP_CFG_Type *SSP_ConfigStruct)\r
+{\r
+       uint32_t tmp;\r
+       uint32_t prescale, cr0_div, cmp_clk, ssp_clk;\r
+\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+\r
+       if(SSPx == LPC_SSP0) {\r
+               /* Set up clock and power for SSP0 module */\r
+               //LPC_CGU->BASE_SSP0_CLK = (SRC_PL160M_0<<24) | (1<<11);\r
+               CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_SSP0);\r
+       } else if(SSPx == LPC_SSP1) {\r
+               /* Set up clock and power for SSP1 module */\r
+               //LPC_CGU->BASE_SSP1_CLK = (SRC_PL160M_0<<24) | (1<<11);\r
+               CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_SSP1);\r
+       } else {\r
+               return;\r
+       }\r
+\r
+       /* Configure SSP, interrupt is disable, LoopBack mode is disable,\r
+        * SSP is disable, Slave output is disable as default\r
+        */\r
+       tmp = ((SSP_ConfigStruct->CPHA) | (SSP_ConfigStruct->CPOL) \\r
+               | (SSP_ConfigStruct->FrameFormat) | (SSP_ConfigStruct->Databit))\r
+               & SSP_CR0_BITMASK;\r
+       // write back to SSP control register\r
+       SSPx->CR0 = tmp;\r
+\r
+       tmp = SSP_ConfigStruct->Mode & SSP_CR1_BITMASK;\r
+       // Write back to CR1\r
+       SSPx->CR1 = tmp;\r
+\r
+       // Set clock rate for SSP peripheral\r
+       if(SSPx == LPC_SSP0)\r
+               ssp_clk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_SSP0);\r
+       else\r
+               ssp_clk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_SSP1);\r
+       cr0_div = 0;\r
+       cmp_clk = 0xFFFFFFFF;\r
+       prescale = 2;\r
+       while (cmp_clk > SSP_ConfigStruct->ClockRate)\r
+       {\r
+               cmp_clk = ssp_clk / ((cr0_div + 1) * prescale);\r
+               if (cmp_clk > SSP_ConfigStruct->ClockRate)\r
+               {\r
+                       cr0_div++;\r
+                       if (cr0_div > 0xFF)\r
+                       {\r
+                               cr0_div = 0;\r
+                               prescale += 2;\r
+                       }\r
+               }\r
+       }\r
+\r
+    /* Write computed prescaler and divider back to register */\r
+    SSPx->CR0 &= (~SSP_CR0_SCR(0xFF)) & SSP_CR0_BITMASK;\r
+    SSPx->CR0 |= (SSP_CR0_SCR(cr0_div)) & SSP_CR0_BITMASK;\r
+    SSPx->CPSR = prescale & SSP_CPSR_BITMASK;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-initializes the SSPx peripheral registers to their\r
+ *              default reset values.\r
+ * @param[in]  SSPx SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_DeInit(LPC_SSPn_Type* SSPx)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+\r
+       /* Disable SSP operation*/\r
+       SSPx->CR1 &= (~SSP_CR1_SSP_EN) & SSP_CR1_BITMASK;\r
+}\r
+\r
+/*****************************************************************************//**\r
+ * @brief              Get data size bit selected\r
+ * @param[in]  SSPx pointer to LPC_SSPn_Type structure, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @return             Data size, could be:\r
+ *                                     - SSP_DATABIT_4         :4 bit transfer\r
+ *                                     - SSP_DATABIT_5         :5 bit transfer\r
+ *                                     ...\r
+ *                                     - SSP_DATABIT_16        :16 bit transfer\r
+*******************************************************************************/\r
+uint8_t SSP_GetDataSize(LPC_SSPn_Type* SSPx)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       return (SSPx->CR0 & (0xF));\r
+}\r
+\r
+/*****************************************************************************//**\r
+ * @brief              Fills each SSP_InitStruct member with its default value:\r
+ *                                     - CPHA = SSP_CPHA_FIRST\r
+ *                                     - CPOL = SSP_CPOL_HI\r
+ *                                     - ClockRate = 1000000\r
+ *                                     - Databit = SSP_DATABIT_8\r
+ *                                     - Mode = SSP_MASTER_MODE\r
+ *                                     - FrameFormat = SSP_FRAME_SSP\r
+ * @param[in]  SSP_InitStruct Pointer to a SSP_CFG_Type structure which will be\r
+ *                             initialized.\r
+ * @return             None\r
+ *******************************************************************************/\r
+void SSP_ConfigStructInit(SSP_CFG_Type *SSP_InitStruct)\r
+{\r
+       SSP_InitStruct->CPHA = SSP_CPHA_FIRST;\r
+       SSP_InitStruct->CPOL = SSP_CPOL_HI;\r
+       SSP_InitStruct->ClockRate = 100000;\r
+       SSP_InitStruct->Databit = SSP_DATABIT_8;\r
+       SSP_InitStruct->Mode = SSP_MASTER_MODE;\r
+       SSP_InitStruct->FrameFormat = SSP_FRAME_SPI;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable SSP peripheral's operation\r
+ * @param[in]  SSPx    SSP peripheral, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  NewState New State of SSPx peripheral's operation, should be:\r
+ *                                     - ENABLE\r
+ *                                     - DISABLE\r
+ * @return             none\r
+ **********************************************************************/\r
+void SSP_Cmd(LPC_SSPn_Type* SSPx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               SSPx->CR1 |= SSP_CR1_SSP_EN;\r
+       }\r
+       else\r
+       {\r
+               SSPx->CR1 &= (~SSP_CR1_SSP_EN) & SSP_CR1_BITMASK;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable Loop Back mode function in SSP peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  NewState        New State of Loop Back mode, should be:\r
+ *                                     - ENABLE\r
+ *                                     - DISABLE\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_LoopBackCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               SSPx->CR1 |= SSP_CR1_LBM_EN;\r
+       }\r
+       else\r
+       {\r
+               SSPx->CR1 &= (~SSP_CR1_LBM_EN) & SSP_CR1_BITMASK;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable Slave Output function in SSP peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  NewState        New State of Slave Output function, should be:\r
+ *                                     - ENABLE        :Slave Output in normal operation\r
+ *                                     - DISABLE       :Slave Output is disabled. This blocks\r
+ *                                     SSP controller from driving the transmit data line (MISO)\r
+ * Note:               This function is available when SSP peripheral in Slave mode\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_SlaveOutputCmd(LPC_SSPn_Type* SSPx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               SSPx->CR1 &= (~SSP_CR1_SO_DISABLE) & SSP_CR1_BITMASK;\r
+       }\r
+       else\r
+       {\r
+               SSPx->CR1 |= SSP_CR1_SO_DISABLE;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Transmit a single data through SSPx peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  Data    Data to transmit (must be 16 or 8-bit long, this\r
+ *                             depend on SSP data bit number configured)\r
+ * @return             none\r
+ **********************************************************************/\r
+void SSP_SendData(LPC_SSPn_Type* SSPx, uint16_t Data)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+\r
+       SSPx->DR = SSP_DR_BITMASK(Data);\r
+}\r
+\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Receive a single data from SSPx peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @return             Data received (16-bit long)\r
+ **********************************************************************/\r
+uint16_t SSP_ReceiveData(LPC_SSPn_Type* SSPx)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+\r
+       return ((uint16_t) (SSP_DR_BITMASK(SSPx->DR)));\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              SSP Read write data function\r
+ * @param[in]  SSPx    Pointer to SSP peripheral, should be\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  dataCfg Pointer to a SSP_DATA_SETUP_Type structure that\r
+ *                             contains specified information about transmit data\r
+ *                             configuration.\r
+ * @param[in]  xfType  Transfer type, should be:\r
+ *                                     - SSP_TRANSFER_POLLING          :Polling mode\r
+ *                                     - SSP_TRANSFER_INTERRUPT        :Interrupt mode\r
+ * @return             Actual Data length has been transferred in polling mode.\r
+ *                             In interrupt mode, always return (0)\r
+ *                             Return (-1) if error.\r
+ * Note: This function can be used in both master and slave mode.\r
+ ***********************************************************************/\r
+int32_t SSP_ReadWrite (LPC_SSPn_Type *SSPx, SSP_DATA_SETUP_Type *dataCfg, \\r
+                                               SSP_TRANSFER_Type xfType)\r
+{\r
+       uint8_t *rdata8;\r
+    uint8_t *wdata8;\r
+       uint16_t *rdata16;\r
+    uint16_t *wdata16;\r
+    uint32_t stat;\r
+    uint32_t tmp;\r
+    int32_t dataword;\r
+\r
+    dataCfg->rx_cnt = 0;\r
+    dataCfg->tx_cnt = 0;\r
+    dataCfg->status = 0;\r
+\r
+\r
+       /* Clear all remaining data in RX FIFO */\r
+       while (SSPx->SR & SSP_SR_RNE){\r
+               tmp = (uint32_t) SSP_ReceiveData(SSPx);\r
+       }\r
+\r
+       // Clear status\r
+       SSPx->ICR = SSP_ICR_BITMASK;\r
+       if(SSP_GetDataSize(SSPx)>8)\r
+               dataword = 1;\r
+       else dataword = 0;\r
+\r
+       // Polling mode ----------------------------------------------------------------------\r
+       if (xfType == SSP_TRANSFER_POLLING){\r
+               if (dataword == 0){\r
+                       rdata8 = (uint8_t *)dataCfg->rx_data;\r
+                       wdata8 = (uint8_t *)dataCfg->tx_data;\r
+               } else {\r
+                       rdata16 = (uint16_t *)dataCfg->rx_data;\r
+                       wdata16 = (uint16_t *)dataCfg->tx_data;\r
+               }\r
+               while ((dataCfg->tx_cnt < dataCfg->length) || (dataCfg->rx_cnt < dataCfg->length)){\r
+                       if ((SSPx->SR & SSP_SR_TNF) && (dataCfg->tx_cnt != dataCfg->length)){\r
+                               // Write data to buffer\r
+                               if(dataCfg->tx_data == NULL){\r
+                                       if (dataword == 0){\r
+                                               SSP_SendData(SSPx, 0xFF);\r
+                                               dataCfg->tx_cnt++;\r
+                                       } else {\r
+                                               SSP_SendData(SSPx, 0xFFFF);\r
+                                               dataCfg->tx_cnt += 2;\r
+                                       }\r
+                               } else {\r
+                                       if (dataword == 0){\r
+                                               SSP_SendData(SSPx, *wdata8);\r
+                                               wdata8++;\r
+                                               dataCfg->tx_cnt++;\r
+                                       } else {\r
+                                               SSP_SendData(SSPx, *wdata16);\r
+                                               wdata16++;\r
+                                               dataCfg->tx_cnt += 2;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       // Check overrun error\r
+                       if ((stat = SSPx->RIS) & SSP_RIS_ROR){\r
+                               // save status and return\r
+                               dataCfg->status = stat | SSP_STAT_ERROR;\r
+                               return (-1);\r
+                       }\r
+\r
+                       // Check for any data available in RX FIFO\r
+                       while ((SSPx->SR & SSP_SR_RNE) && (dataCfg->rx_cnt < dataCfg->length)){\r
+                               // Read data from SSP data\r
+                               tmp = SSP_ReceiveData(SSPx);\r
+\r
+                               // Store data to destination\r
+                               if (dataCfg->rx_data != NULL)\r
+                               {\r
+                                       if (dataword == 0){\r
+                                               *(rdata8) = (uint8_t) tmp;\r
+                                               rdata8++;\r
+                                       } else {\r
+                                               *(rdata16) = (uint16_t) tmp;\r
+                                               rdata16++;\r
+                                       }\r
+                               }\r
+                               // Increase counter\r
+                               if (dataword == 0){\r
+                                       dataCfg->rx_cnt++;\r
+                               } else {\r
+                                       dataCfg->rx_cnt += 2;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               // save status\r
+               dataCfg->status = SSP_STAT_DONE;\r
+\r
+               if (dataCfg->tx_data != NULL){\r
+                       return dataCfg->tx_cnt;\r
+               } else if (dataCfg->rx_data != NULL){\r
+                       return dataCfg->rx_cnt;\r
+               } else {\r
+                       return (0);\r
+               }\r
+       }\r
+\r
+       // Interrupt mode ----------------------------------------------------------------------\r
+       else if (xfType == SSP_TRANSFER_INTERRUPT){\r
+\r
+               while ((SSPx->SR & SSP_SR_TNF) && (dataCfg->tx_cnt < dataCfg->length)){\r
+                       // Write data to buffer\r
+                       if(dataCfg->tx_data == NULL){\r
+                               if (dataword == 0){\r
+                                       SSP_SendData(SSPx, 0xFF);\r
+                                       dataCfg->tx_cnt++;\r
+                               } else {\r
+                                       SSP_SendData(SSPx, 0xFFFF);\r
+                                       dataCfg->tx_cnt += 2;\r
+                               }\r
+                       } else {\r
+                               if (dataword == 0){\r
+                                       SSP_SendData(SSPx, (*(uint8_t *)((uint32_t)dataCfg->tx_data + dataCfg->tx_cnt)));\r
+                                       dataCfg->tx_cnt++;\r
+                               } else {\r
+                                       SSP_SendData(SSPx, (*(uint16_t *)((uint32_t)dataCfg->tx_data + dataCfg->tx_cnt)));\r
+                                       dataCfg->tx_cnt += 2;\r
+                               }\r
+                       }\r
+\r
+                       // Check error\r
+                       if ((stat = SSPx->RIS) & SSP_RIS_ROR){\r
+                               // save status and return\r
+                               dataCfg->status = stat | SSP_STAT_ERROR;\r
+                               return (-1);\r
+                       }\r
+\r
+                       // Check for any data available in RX FIFO\r
+                       while ((SSPx->SR & SSP_SR_RNE) && (dataCfg->rx_cnt < dataCfg->length)){\r
+                               // Read data from SSP data\r
+                               tmp = SSP_ReceiveData(SSPx);\r
+\r
+                               // Store data to destination\r
+                               if (dataCfg->rx_data != NULL)\r
+                               {\r
+                                       if (dataword == 0){\r
+                                               *(uint8_t *)((uint32_t)dataCfg->rx_data + dataCfg->rx_cnt) = (uint8_t) tmp;\r
+                                       } else {\r
+                                               *(uint16_t *)((uint32_t)dataCfg->rx_data + dataCfg->rx_cnt) = (uint16_t) tmp;\r
+                                       }\r
+                               }\r
+                               // Increase counter\r
+                               if (dataword == 0){\r
+                                       dataCfg->rx_cnt++;\r
+                               } else {\r
+                                       dataCfg->rx_cnt += 2;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               // If there more data to sent or receive\r
+               if ((dataCfg->rx_cnt != dataCfg->length) || (dataCfg->tx_cnt < dataCfg->length)){\r
+                       // Enable all interrupt\r
+                       SSPx->IMSC = SSP_IMSC_BITMASK;\r
+               } else {\r
+                       // Save status\r
+                       dataCfg->status = SSP_STAT_DONE;\r
+               }\r
+               return (0);\r
+       }\r
+\r
+       return (-1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Checks whether the specified SSP status flag is set or not\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  FlagType        Type of flag to check status, should be:\r
+ *                                     - SSP_STAT_TXFIFO_EMPTY         :TX FIFO is empty\r
+ *                                     - SSP_STAT_TXFIFO_NOTFULL       :TX FIFO is not full\r
+ *                                     - SSP_STAT_RXFIFO_NOTEMPTY      :RX FIFO is not empty\r
+ *                                     - SSP_STAT_RXFIFO_FULL          :RX FIFO is full\r
+ *                                     - SSP_STAT_BUSY                         :SSP peripheral is busy\r
+ * @return             New State of specified SSP status flag\r
+ **********************************************************************/\r
+FlagStatus SSP_GetStatus(LPC_SSPn_Type* SSPx, uint32_t FlagType)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_STAT(FlagType));\r
+\r
+       return ((SSPx->SR & FlagType) ? SET : RESET);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable specified interrupt type in SSP peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  IntType Interrupt type in SSP peripheral, should be:\r
+ *                                     - SSP_INTCFG_ROR        :Receive Overrun interrupt\r
+ *                                     - SSP_INTCFG_RT         :Receive Time out interrupt\r
+ *                                     - SSP_INTCFG_RX         :RX FIFO is at least half full interrupt\r
+ *                                     - SSP_INTCFG_TX         :TX FIFO is at least half empty interrupt\r
+ * @param[in]  NewState New State of specified interrupt type, should be:\r
+ *                                     - ENABLE        :Enable this interrupt type\r
+ *                                     - DISABLE       :Disable this interrupt type\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_IntConfig(LPC_SSPn_Type *SSPx, uint32_t IntType, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_INTCFG(IntType));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               SSPx->IMSC |= IntType;\r
+       }\r
+       else\r
+       {\r
+               SSPx->IMSC &= (~IntType) & SSP_IMSC_BITMASK;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief      Check whether the specified Raw interrupt status flag is\r
+ *                     set or not\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  RawIntType      Raw Interrupt Type, should be:\r
+ *                                     - SSP_INTSTAT_RAW_ROR   :Receive Overrun interrupt\r
+ *                                     - SSP_INTSTAT_RAW_RT    :Receive Time out interrupt\r
+ *                                     - SSP_INTSTAT_RAW_RX    :RX FIFO is at least half full interrupt\r
+ *                                     - SSP_INTSTAT_RAW_TX    :TX FIFO is at least half empty interrupt\r
+ * @return     New State of specified Raw interrupt status flag in SSP peripheral\r
+ * Note: Enabling/Disabling specified interrupt in SSP peripheral does not\r
+ *             effect to Raw Interrupt Status flag.\r
+ **********************************************************************/\r
+IntStatus SSP_GetRawIntStatus(LPC_SSPn_Type *SSPx, uint32_t RawIntType)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_INTSTAT_RAW(RawIntType));\r
+\r
+       return ((SSPx->RIS & RawIntType) ? SET : RESET);\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether the specified interrupt status flag is\r
+ *                             set or not\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  IntType Raw Interrupt Type, should be:\r
+ *                                     - SSP_INTSTAT_ROR       :Receive Overrun interrupt\r
+ *                                     - SSP_INTSTAT_RT        :Receive Time out interrupt\r
+ *                                     - SSP_INTSTAT_RX        :RX FIFO is at least half full interrupt\r
+ *                                     - SSP_INTSTAT_TX        :TX FIFO is at least half empty interrupt\r
+ * @return     New State of specified interrupt status flag in SSP peripheral\r
+ * Note: Enabling/Disabling specified interrupt in SSP peripheral effects\r
+ *                     to Interrupt Status flag.\r
+ **********************************************************************/\r
+IntStatus SSP_GetIntStatus (LPC_SSPn_Type *SSPx, uint32_t IntType)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_INTSTAT(IntType));\r
+\r
+       return ((SSPx->MIS & IntType) ? SET :RESET);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear specified interrupt pending in SSP peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  IntType Interrupt pending to clear, should be:\r
+ *                                     - SSP_INTCLR_ROR        :clears the "frame was received when\r
+ *                                     RxFIFO was full" interrupt.\r
+ *                                     - SSP_INTCLR_RT         :clears the "Rx FIFO was not empty and\r
+ *                                     has not been read for a timeout period" interrupt.\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_ClearIntPending(LPC_SSPn_Type *SSPx, uint32_t IntType)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_INTCLR(IntType));\r
+\r
+       SSPx->ICR = IntType;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable DMA function for SSP peripheral\r
+ * @param[in]  SSPx    SSP peripheral selected, should be:\r
+ *                                     - LPC_SSP0      :SSP0 peripheral\r
+ *                                     - LPC_SSP1      :SSP1 peripheral\r
+ * @param[in]  DMAMode Type of DMA, should be:\r
+ *                                     - SSP_DMA_TX    :DMA for the transmit FIFO\r
+ *                                     - SSP_DMA_RX    :DMA for the Receive FIFO\r
+ * @param[in]  NewState        New State of DMA function on SSP peripheral,\r
+ *                                             should be:\r
+ *                                     - ENALBE        :Enable this function\r
+ *                                     - DISABLE       :Disable this function\r
+ * @return             None\r
+ **********************************************************************/\r
+void SSP_DMACmd(LPC_SSPn_Type *SSPx, uint32_t DMAMode, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_SSPx(SSPx));\r
+       CHECK_PARAM(PARAM_SSP_DMA(DMAMode));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               SSPx->DMACR |= DMAMode;\r
+       }\r
+       else\r
+       {\r
+               SSPx->DMACR &= (~DMAMode) & SSP_DMA_BITMASK;\r
+       }\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _SSP */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_timer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_timer.c
new file mode 100644 (file)
index 0000000..1cf4ff2
--- /dev/null
@@ -0,0 +1,611 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_timer.c         2011-06-02\r
+*//**\r
+* @file                lpc18xx_timer.c\r
+* @brief       Contains all functions support for Timer firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup TIMER\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_timer.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+#ifdef _TIM\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+static uint32_t getPClock (uint32_t timernum);\r
+static uint32_t converUSecToVal (uint32_t timernum, uint32_t usec);\r
+static uint32_t converPtrToTimeNum (LPC_TIMERn_Type *TIMx);\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get peripheral clock of each timer controller\r
+ * @param[in]  timernum Timer number, should be: 0..3\r
+ * @return             Peripheral clock of timer\r
+ **********************************************************************/\r
+extern uint32_t M3Frequency;\r
+static uint32_t getPClock (uint32_t timernum)\r
+{\r
+       uint32_t clkdlycnt;\r
+       switch (timernum)\r
+       {\r
+       case 0:\r
+               clkdlycnt = /*CGU_GetPCLK (CGU_PCLKSEL_TIMER0)*/ CGU_GetPCLKFrequency(CGU_PERIPHERAL_TIMER0);\r
+               break;\r
+\r
+       case 1:\r
+               clkdlycnt = /*CGU_GetPCLK (CGU_PCLKSEL_TIMER1)*/ CGU_GetPCLKFrequency(CGU_PERIPHERAL_TIMER1);\r
+               break;\r
+\r
+       case 2:\r
+               clkdlycnt = /*CGU_GetPCLK (CGU_PCLKSEL_TIMER2)*/ CGU_GetPCLKFrequency(CGU_PERIPHERAL_TIMER2);\r
+               break;\r
+\r
+       case 3:\r
+               clkdlycnt = /*CGU_GetPCLK (CGU_PCLKSEL_TIMER3)*/ CGU_GetPCLKFrequency(CGU_PERIPHERAL_TIMER3);\r
+               break;\r
+       }\r
+       return clkdlycnt;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Convert a time to a timer count value\r
+ * @param[in]  timernum Timer number, should be: 0..3\r
+ * @param[in]  usec Time in microseconds\r
+ * @return             The number of required clock ticks to give the time delay\r
+ **********************************************************************/\r
+uint32_t converUSecToVal (uint32_t timernum, uint32_t usec)\r
+{\r
+       uint64_t clkdlycnt;\r
+\r
+       // Get Pclock of timer\r
+       clkdlycnt = (uint64_t) getPClock(timernum);\r
+\r
+       clkdlycnt = (clkdlycnt * usec) / 1000000;\r
+       return (uint32_t) clkdlycnt;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Convert a timer register pointer to a timer number\r
+ * @param[in]  TIMx Pointer to LPC_TIMERn_Type, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @return             The timer number (0 to 3) or -1 if register pointer is bad\r
+ **********************************************************************/\r
+uint32_t converPtrToTimeNum (LPC_TIMERn_Type *TIMx)\r
+{\r
+       uint32_t tnum = 0xFFFFFFFF;\r
+\r
+       if (TIMx == LPC_TIMER0)\r
+       {\r
+               tnum = 0;\r
+       }\r
+       else if (TIMx == LPC_TIMER1)\r
+       {\r
+               tnum = 1;\r
+       }\r
+       else if (TIMx == LPC_TIMER2)\r
+       {\r
+               tnum = 2;\r
+       }\r
+       else if (TIMx == LPC_TIMER3)\r
+       {\r
+               tnum = 3;\r
+       }\r
+\r
+       return tnum;\r
+}\r
+\r
+/* End of Private Functions ---------------------------------------------------- */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup TIM_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get Interrupt Status\r
+ * @param[in]  TIMx Timer selection, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  IntFlag: interrupt type, should be:\r
+ *                                     - TIM_MR0_INT   :Interrupt for Match channel 0\r
+ *                                     - TIM_MR1_INT   :Interrupt for Match channel 1\r
+ *                                     - TIM_MR2_INT   :Interrupt for Match channel 2\r
+ *                                     - TIM_MR3_INT   :Interrupt for Match channel 3\r
+ *                                     - TIM_CR0_INT   :Interrupt for Capture channel 0\r
+ *                                     - TIM_CR1_INT   :Interrupt for Capture channel 1\r
+ * @return             FlagStatus\r
+ *                                     - SET   :interrupt\r
+ *                                     - RESET :no interrupt\r
+ **********************************************************************/\r
+FlagStatus TIM_GetIntStatus(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag)\r
+{\r
+       uint8_t temp;\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_INT_TYPE(IntFlag));\r
+       temp = (TIMx->IR)& TIM_IR_CLR(IntFlag);\r
+       if (temp)\r
+               return SET;\r
+\r
+       return RESET;\r
+\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Get Capture Interrupt Status\r
+ * @param[in]  TIMx Timer selection, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  IntFlag: interrupt type, should be:\r
+ *                                     - TIM_MR0_INT   :Interrupt for Match channel 0\r
+ *                                     - TIM_MR1_INT   :Interrupt for Match channel 1\r
+ *                                     - TIM_MR2_INT   :Interrupt for Match channel 2\r
+ *                                     - TIM_MR3_INT   :Interrupt for Match channel 3\r
+ *                                     - TIM_CR0_INT   :Interrupt for Capture channel 0\r
+ *                                     - TIM_CR1_INT   :Interrupt for Capture channel 1\r
+ * @return             FlagStatus\r
+ *                                     - SET   :interrupt\r
+ *                                     - RESET :no interrupt\r
+ **********************************************************************/\r
+FlagStatus TIM_GetIntCaptureStatus(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag)\r
+{\r
+       uint8_t temp;\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_INT_TYPE(IntFlag));\r
+       temp = (TIMx->IR) & (1<<(4+IntFlag));\r
+       if(temp)\r
+               return SET;\r
+       return RESET;\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Clear Interrupt pending\r
+ * @param[in]  TIMx Timer selection, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  IntFlag: interrupt type, should be:\r
+ *                                     - TIM_MR0_INT   :Interrupt for Match channel 0\r
+ *                                     - TIM_MR1_INT   :Interrupt for Match channel 1\r
+ *                                     - TIM_MR2_INT   :Interrupt for Match channel 2\r
+ *                                     - TIM_MR3_INT   :Interrupt for Match channel 3\r
+ *                                     - TIM_CR0_INT   :Interrupt for Capture channel 0\r
+ *                                     - TIM_CR1_INT   :Interrupt for Capture channel 1\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ClearIntPending(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_INT_TYPE(IntFlag));\r
+       TIMx->IR = TIM_IR_CLR(IntFlag);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Clear Capture Interrupt pending\r
+ * @param[in]  TIMx Timer selection, should be\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  IntFlag interrupt type, should be:\r
+ *                                     - TIM_MR0_INT   :Interrupt for Match channel 0\r
+ *                                     - TIM_MR1_INT   :Interrupt for Match channel 1\r
+ *                                     - TIM_MR2_INT   :Interrupt for Match channel 2\r
+ *                                     - TIM_MR3_INT   :Interrupt for Match channel 3\r
+ *                                     - TIM_CR0_INT   :Interrupt for Capture channel 0\r
+ *                                     - TIM_CR1_INT   :Interrupt for Capture channel 1\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ClearIntCapturePending(LPC_TIMERn_Type *TIMx, TIM_INT_TYPE IntFlag)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_INT_TYPE(IntFlag));\r
+       TIMx->IR = (1<<(4+IntFlag));\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configuration for Timer at initial time\r
+ * @param[in]  TimerCounterMode timer counter mode, should be:\r
+ *                                     - TIM_TIMER_MODE                        :Timer mode\r
+ *                                     - TIM_COUNTER_RISING_MODE       :Counter rising mode\r
+ *                                     - TIM_COUNTER_FALLING_MODE      :Counter falling mode\r
+ *                                     - TIM_COUNTER_ANY_MODE          :Counter on both edges\r
+ * @param[in]  TIM_ConfigStruct pointer to TIM_TIMERCFG_Type or\r
+ *                             TIM_COUNTERCFG_Type\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ConfigStructInit(TIM_MODE_OPT TimerCounterMode, void *TIM_ConfigStruct)\r
+{\r
+       if (TimerCounterMode == TIM_TIMER_MODE )\r
+       {\r
+               TIM_TIMERCFG_Type * pTimeCfg = (TIM_TIMERCFG_Type *)TIM_ConfigStruct;\r
+               pTimeCfg->PrescaleOption = TIM_PRESCALE_USVAL;\r
+               pTimeCfg->PrescaleValue = 1;\r
+       }\r
+       else\r
+       {\r
+               TIM_COUNTERCFG_Type * pCounterCfg = (TIM_COUNTERCFG_Type *)TIM_ConfigStruct;\r
+               pCounterCfg->CountInputSelect = TIM_COUNTER_INCAP0;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initial Timer/Counter device\r
+ *                                     Set Clock frequency for Timer\r
+ *                                     Set initial configuration for Timer\r
+ * @param[in]  TIMx  Timer selection, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  TimerCounterMode Timer counter mode, should be:\r
+ *                                     - TIM_TIMER_MODE                        :Timer mode\r
+ *                                     - TIM_COUNTER_RISING_MODE       :Counter rising mode\r
+ *                                     - TIM_COUNTER_FALLING_MODE      :Counter falling mode\r
+ *                                     - TIM_COUNTER_ANY_MODE          :Counter on both edges\r
+ * @param[in]  TIM_ConfigStruct pointer to TIM_TIMERCFG_Type\r
+ *                             that contains the configuration information for the\r
+ *                    specified Timer peripheral.\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_Init(LPC_TIMERn_Type *TIMx, TIM_MODE_OPT TimerCounterMode, void *TIM_ConfigStruct)\r
+{\r
+       TIM_TIMERCFG_Type *pTimeCfg;\r
+       TIM_COUNTERCFG_Type *pCounterCfg;\r
+\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_MODE_OPT(TimerCounterMode));\r
+\r
+       //set power\r
+       if (TIMx== LPC_TIMER0)\r
+       {\r
+\r
+       }\r
+       else if (TIMx== LPC_TIMER1)\r
+       {\r
+\r
+       }\r
+\r
+       else if (TIMx== LPC_TIMER2)\r
+       {\r
+\r
+       }\r
+       else if (TIMx== LPC_TIMER3)\r
+       {\r
+\r
+       }\r
+\r
+       TIMx->CCR &= ~TIM_CTCR_MODE_MASK;\r
+       TIMx->CCR |= TIM_TIMER_MODE;\r
+\r
+       TIMx->TC =0;\r
+       TIMx->PC =0;\r
+       TIMx->PR =0;\r
+       TIMx->TCR |= (1<<1); //Reset Counter\r
+       TIMx->TCR &= ~(1<<1); //release reset\r
+       if (TimerCounterMode == TIM_TIMER_MODE )\r
+       {\r
+               pTimeCfg = (TIM_TIMERCFG_Type *)TIM_ConfigStruct;\r
+               if (pTimeCfg->PrescaleOption  == TIM_PRESCALE_TICKVAL)\r
+               {\r
+                       TIMx->PR   = pTimeCfg->PrescaleValue -1  ;\r
+               }\r
+               else\r
+               {\r
+                       TIMx->PR   = converUSecToVal (converPtrToTimeNum(TIMx),pTimeCfg->PrescaleValue)-1;\r
+               }\r
+       }\r
+       else\r
+       {\r
+\r
+               pCounterCfg = (TIM_COUNTERCFG_Type *)TIM_ConfigStruct;\r
+               TIMx->CCR  &= ~TIM_CTCR_INPUT_MASK;\r
+               if (pCounterCfg->CountInputSelect == TIM_COUNTER_INCAP1)\r
+                       TIMx->CCR |= _BIT(2);\r
+       }\r
+\r
+       // Clear interrupt pending\r
+       TIMx->IR = 0xFFFFFFFF;\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Close Timer/Counter device\r
+ * @param[in]  TIMx  Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_DeInit (LPC_TIMERn_Type *TIMx)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       // Disable timer/counter\r
+       TIMx->TCR = 0x00;\r
+\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Start/Stop Timer/Counter device\r
+ * @param[in]  TIMx Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  NewState\r
+ *                                     - ENABLE        :Set timer enable\r
+ *                                     - DISABLE       :Disable timer\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_Cmd(LPC_TIMERn_Type *TIMx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       if (NewState == ENABLE)\r
+       {\r
+               TIMx->TCR       |=  TIM_ENABLE;\r
+       }\r
+       else\r
+       {\r
+               TIMx->TCR &= ~TIM_ENABLE;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Reset Timer/Counter device,\r
+ *                                     Make TC and PC are synchronously reset on the next\r
+ *                                     positive edge of PCLK\r
+ * @param[in]  TIMx Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ResetCounter(LPC_TIMERn_Type *TIMx)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       TIMx->TCR |= TIM_RESET;\r
+       TIMx->TCR &= ~TIM_RESET;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configuration for Match register\r
+ * @param[in]  TIMx Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]   TIM_MatchConfigStruct Pointer to TIM_MATCHCFG_Type\r
+ *                                     - MatchChannel  : choose channel 0 or 1\r
+ *                                     - IntOnMatch    : if SET, interrupt will be generated when MRxx match\r
+ *                                                                     the value in TC\r
+ *                                     - StopOnMatch   : if SET, TC and PC will be stopped whenM Rxx match\r
+ *                                                                     the value in TC\r
+ *                                     - ResetOnMatch  : if SET, Reset on MR0 when MRxx match\r
+ *                                                                     the value in TC\r
+ *                                     -ExtMatchOutputType: Select output for external match\r
+ *                                              +       0:     Do nothing for external output pin if match\r
+ *                                              +   1: Force external output pin to low if match\r
+ *                                              +       2: Force external output pin to high if match\r
+ *                                              +       3: Toggle external output pin if match\r
+ *                                     MatchValue: Set the value to be compared with TC value\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ConfigMatch(LPC_TIMERn_Type *TIMx, TIM_MATCHCFG_Type *TIM_MatchConfigStruct)\r
+{\r
+\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_EXTMATCH_OPT(TIM_MatchConfigStruct->ExtMatchOutputType));\r
+\r
+       switch(TIM_MatchConfigStruct->MatchChannel)\r
+       {\r
+       case 0:\r
+               TIMx->MR[0] = TIM_MatchConfigStruct->MatchValue;\r
+               break;\r
+       case 1:\r
+               TIMx->MR[1] = TIM_MatchConfigStruct->MatchValue;\r
+               break;\r
+       case 2:\r
+               TIMx->MR[2] = TIM_MatchConfigStruct->MatchValue;\r
+               break;\r
+       case 3:\r
+               TIMx->MR[3] = TIM_MatchConfigStruct->MatchValue;\r
+               break;\r
+       default:\r
+               //Error match value\r
+               //Error loop\r
+               while(1);\r
+       }\r
+       //interrupt on MRn\r
+       TIMx->MCR &=~TIM_MCR_CHANNEL_MASKBIT(TIM_MatchConfigStruct->MatchChannel);\r
+\r
+       if (TIM_MatchConfigStruct->IntOnMatch)\r
+               TIMx->MCR |= TIM_INT_ON_MATCH(TIM_MatchConfigStruct->MatchChannel);\r
+\r
+       //reset on MRn\r
+       if (TIM_MatchConfigStruct->ResetOnMatch)\r
+               TIMx->MCR |= TIM_RESET_ON_MATCH(TIM_MatchConfigStruct->MatchChannel);\r
+\r
+       //stop on MRn\r
+       if (TIM_MatchConfigStruct->StopOnMatch)\r
+               TIMx->MCR |= TIM_STOP_ON_MATCH(TIM_MatchConfigStruct->MatchChannel);\r
+\r
+       // match output type\r
+\r
+       TIMx->EMR       &= ~TIM_EM_MASK(TIM_MatchConfigStruct->MatchChannel);\r
+       TIMx->EMR   |= TIM_EM_SET(TIM_MatchConfigStruct->MatchChannel,TIM_MatchConfigStruct->ExtMatchOutputType);\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Update Match value\r
+ * @param[in]  TIMx Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  MatchChannel    Match channel, should be: 0..3\r
+ * @param[in]  MatchValue              updated match value\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_UpdateMatchValue(LPC_TIMERn_Type *TIMx,uint8_t MatchChannel, uint32_t MatchValue)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       switch(MatchChannel)\r
+       {\r
+       case 0:\r
+               TIMx->MR[0] = MatchValue;\r
+               break;\r
+       case 1:\r
+               TIMx->MR[1] = MatchValue;\r
+               break;\r
+       case 2:\r
+               TIMx->MR[2] = MatchValue;\r
+               break;\r
+       case 3:\r
+               TIMx->MR[3] = MatchValue;\r
+               break;\r
+       default:\r
+               //Error Loop\r
+               while(1);\r
+       }\r
+\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Configuration for Capture register\r
+ * @param[in]  TIMx Pointer to timer device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]   TIM_CaptureConfigStruct        Pointer to TIM_CAPTURECFG_Type\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_ConfigCapture(LPC_TIMERn_Type *TIMx, TIM_CAPTURECFG_Type *TIM_CaptureConfigStruct)\r
+{\r
+\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       TIMx->CCR &= ~TIM_CCR_CHANNEL_MASKBIT(TIM_CaptureConfigStruct->CaptureChannel);\r
+\r
+       if (TIM_CaptureConfigStruct->RisingEdge)\r
+               TIMx->CCR |= TIM_CAP_RISING(TIM_CaptureConfigStruct->CaptureChannel);\r
+\r
+       if (TIM_CaptureConfigStruct->FallingEdge)\r
+               TIMx->CCR |= TIM_CAP_FALLING(TIM_CaptureConfigStruct->CaptureChannel);\r
+\r
+       if (TIM_CaptureConfigStruct->IntOnCaption)\r
+               TIMx->CCR |= TIM_INT_ON_CAP(TIM_CaptureConfigStruct->CaptureChannel);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read value of capture register in timer/counter device\r
+ * @param[in]  TIMx Pointer to timer/counter device, should be:\r
+ *                                     - LPC_TIM0      :TIMER0 peripheral\r
+ *                                     - LPC_TIM1      :TIMER1 peripheral\r
+ *                                     - LPC_TIM2      :TIMER2 peripheral\r
+ *                                     - LPC_TIM3      :TIMER3 peripheral\r
+ * @param[in]  CaptureChannel: capture channel number, should be:\r
+ *                             - TIM_COUNTER_INCAP0: CAPn.0 input pin for TIMERn\r
+ *                             - TIM_COUNTER_INCAP1: CAPn.1 input pin for TIMERn\r
+ *                             - TIM_COUNTER_INCAP1: CAPn.2 input pin for TIMERn\r
+ *                             - TIM_COUNTER_INCAP1: CAPn.3 input pin for TIMERn\r
+ * @return             Value of capture register\r
+ **********************************************************************/\r
+uint32_t TIM_GetCaptureValue(LPC_TIMERn_Type *TIMx, TIM_COUNTER_INPUT_OPT CaptureChannel)\r
+{\r
+       CHECK_PARAM(PARAM_TIMx(TIMx));\r
+       CHECK_PARAM(PARAM_TIM_COUNTER_INPUT_OPT(CaptureChannel));\r
+\r
+       switch(CaptureChannel){\r
+               case 0: return TIMx->CR[0];\r
+               case 1: return TIMx->CR[1];\r
+               case 2: return TIMx->CR[2];\r
+               case 3: return TIMx->CR[3];\r
+       }\r
+       return 0;\r
+}\r
+/*---------------Advanced TIMER functions -----------------------------------------*/\r
+/*********************************************************************//**\r
+ * @brief              Timer wait (microseconds)\r
+ * @param[in]  time    number of microseconds waiting\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_Waitus(uint32_t time)\r
+{\r
+       TIM_MATCHCFG_Type MatchConfigStruct;\r
+       LPC_TIMER0->IR = 0xFFFFFFFF;\r
+\r
+       MatchConfigStruct.MatchChannel = 0;\r
+       MatchConfigStruct.IntOnMatch = ENABLE;\r
+       MatchConfigStruct.ResetOnMatch = ENABLE;\r
+       MatchConfigStruct.StopOnMatch = ENABLE;\r
+       MatchConfigStruct.ExtMatchOutputType = 0;\r
+       MatchConfigStruct.MatchValue = time;\r
+\r
+       TIM_ConfigMatch(LPC_TIMER0, &MatchConfigStruct);\r
+       TIM_Cmd(LPC_TIMER0,ENABLE);\r
+       //wait until interrupt flag occur\r
+       while(!(LPC_TIMER0->IR & 0x01));\r
+       TIM_ResetCounter(LPC_TIMER0);\r
+}\r
+/*********************************************************************//**\r
+ * @brief              Timer wait (milliseconds)\r
+ * @param[in]  time    number of millisecond waiting\r
+ * @return             None\r
+ **********************************************************************/\r
+void TIM_Waitms(uint32_t time)\r
+{\r
+       TIM_Waitus(time * 1000);\r
+}\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _TIMER */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_uart.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_uart.c
new file mode 100644 (file)
index 0000000..1e518e8
--- /dev/null
@@ -0,0 +1,1438 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_uart.c          2011-06-02\r
+*//**\r
+* @file                lpc18xx_uart.c\r
+* @brief       Contains all functions support for UART firmware library on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup UART\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_uart.h"\r
+#include "lpc18xx_cgu.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _UART\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+\r
+static Status uart_set_divisors(LPC_USARTn_Type *UARTx, uint32_t baudrate);\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Determines best dividers to get a target clock rate\r
+ * @param[in]  UARTx   Pointer to selected UART peripheral, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  baudrate Desired UART baud rate.\r
+ * @return             Error status, could be:\r
+ *                                     - SUCCESS\r
+ *                                     - ERROR\r
+ **********************************************************************/\r
+static Status uart_set_divisors(LPC_USARTn_Type *UARTx, uint32_t baudrate)\r
+{\r
+       Status errorStatus = ERROR;\r
+\r
+       uint32_t uClk;\r
+       uint32_t d, m, bestd, bestm, tmp;\r
+       uint64_t best_divisor, divisor;\r
+       uint32_t current_error, best_error;\r
+       uint32_t recalcbaud;\r
+\r
+       /* get UART block clock */\r
+       //to be defined uClk = CGU_GetCLK(CGU_CLKTYPE_PER);\r
+#ifdef _UART0\r
+       if(UARTx == LPC_USART0)\r
+       {\r
+               uClk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_UART0);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART1\r
+       if(((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               uClk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_UART1);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART2\r
+       if(UARTx == LPC_USART2)\r
+       {\r
+               uClk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_UART2);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART3\r
+       if(UARTx == LPC_USART3)\r
+       {\r
+               uClk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_UART3);\r
+       }\r
+#endif\r
+\r
+       /* In the Uart IP block, baud rate is calculated using FDR and DLL-DLM registers\r
+       * The formula is :\r
+       * BaudRate= uClk * (mulFracDiv/(mulFracDiv+dividerAddFracDiv) / (16 * (DLL)\r
+       * It involves floating point calculations. That's the reason the formulae are adjusted with\r
+       * Multiply and divide method.*/\r
+       /* The value of mulFracDiv and dividerAddFracDiv should comply to the following expressions:\r
+       * 0 < mulFracDiv <= 15, 0 <= dividerAddFracDiv <= 15 */\r
+       best_error = 0xFFFFFFFF; /* Worst case */\r
+       bestd = 0;\r
+       bestm = 0;\r
+       best_divisor = 0;\r
+       for (m = 1 ; m <= 15 ;m++)\r
+       {\r
+               for (d = 0 ; d < m ; d++)\r
+               {\r
+                 divisor = ((uint64_t)uClk<<28)*m/(baudrate*(m+d));\r
+                 current_error = divisor & 0xFFFFFFFF;\r
+\r
+                 tmp = divisor>>32;\r
+\r
+                 /* Adjust error */\r
+                 if(current_error > ((uint32_t)1<<31)){\r
+                       current_error = -current_error;\r
+                       tmp++;\r
+                       }\r
+\r
+                 if(tmp<1 || tmp>65536) /* Out of range */\r
+                 continue;\r
+\r
+                 if( current_error < best_error){\r
+                       best_error = current_error;\r
+                       best_divisor = tmp;\r
+                       bestd = d;\r
+                       bestm = m;\r
+                       if(best_error == 0) break;\r
+                       }\r
+               } /* end of inner for loop */\r
+\r
+               if (best_error == 0)\r
+                 break;\r
+       } /* end of outer for loop  */\r
+\r
+       if(best_divisor == 0) return ERROR; /* can not find best match */\r
+\r
+       recalcbaud = (uClk>>4) * bestm/(best_divisor * (bestm + bestd));\r
+\r
+       /* reuse best_error to evaluate baud error*/\r
+       if(baudrate>recalcbaud) best_error = baudrate - recalcbaud;\r
+       else best_error = recalcbaud -baudrate;\r
+\r
+       best_error = best_error * 100 / baudrate;\r
+\r
+       if (best_error < UART_ACCEPTED_BAUDRATE_ERROR)\r
+       {\r
+               if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->LCR |= UART_LCR_DLAB_EN;\r
+                       ((LPC_UART1_Type *)UARTx)->/*DLIER.*/DLM = UART_LOAD_DLM(best_divisor);\r
+                       ((LPC_UART1_Type *)UARTx)->/*RBTHDLR.*/DLL = UART_LOAD_DLL(best_divisor);\r
+                       /* Then reset DLAB bit */\r
+                       ((LPC_UART1_Type *)UARTx)->LCR &= (~UART_LCR_DLAB_EN) & UART_LCR_BITMASK;\r
+                       ((LPC_UART1_Type *)UARTx)->FDR = (UART_FDR_MULVAL(bestm) \\r
+                                       | UART_FDR_DIVADDVAL(bestd)) & UART_FDR_BITMASK;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->LCR |= UART_LCR_DLAB_EN;\r
+                       UARTx->/*DLIER.*/DLM = UART_LOAD_DLM(best_divisor);\r
+                       UARTx->/*RBTHDLR.*/DLL = UART_LOAD_DLL(best_divisor);\r
+                       /* Then reset DLAB bit */\r
+                       UARTx->LCR &= (~UART_LCR_DLAB_EN) & UART_LCR_BITMASK;\r
+                       UARTx->FDR = (UART_FDR_MULVAL(bestm) \\r
+                                       | UART_FDR_DIVADDVAL(bestd)) & UART_FDR_BITMASK;\r
+               }\r
+               errorStatus = SUCCESS;\r
+       }\r
+\r
+       return errorStatus;\r
+}\r
+\r
+/* End of Private Functions ---------------------------------------------------- */\r
+\r
+\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup UART_Public_Functions\r
+ * @{\r
+ */\r
+/* UART Init/DeInit functions -------------------------------------------------*/\r
+/********************************************************************//**\r
+ * @brief              Initializes the UARTx peripheral according to the specified\r
+ *               parameters in the UART_ConfigStruct.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  UART_ConfigStruct Pointer to a UART_CFG_Type structure\r
+ *              that contains the configuration information for the\r
+ *              specified UART peripheral.\r
+ * @return             None\r
+ *********************************************************************/\r
+void UART_Init(LPC_USARTn_Type *UARTx, UART_CFG_Type *UART_ConfigStruct)\r
+{\r
+       uint32_t tmp;\r
+\r
+       // For debug mode\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+       CHECK_PARAM(PARAM_UART_DATABIT(UART_ConfigStruct->Databits));\r
+       CHECK_PARAM(PARAM_UART_STOPBIT(UART_ConfigStruct->Stopbits));\r
+       CHECK_PARAM(PARAM_UART_PARITY(UART_ConfigStruct->Parity));\r
+\r
+#ifdef _UART0\r
+       if(UARTx == LPC_USART0)\r
+       {\r
+               /* Set up peripheral clock for UART0 module */\r
+               //LPC_CGU->BASE_UART0_CLK = (SRC_PL160M_0<<24) | (1<<11);       // Use PLL1 and auto block\r
+               CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_BASE_UART0);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART1\r
+       if(((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               /* Set up peripheral clock for UART1 module */\r
+               //LPC_CGU->BASE_UART1_CLK = (SRC_PL160M_0<<24) | (1<<11);       // Use PLL1 and auto block\r
+               CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_UART1);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART2\r
+       if(UARTx == LPC_USART2)\r
+       {\r
+               /* Set up peripheral clock for UART2 module */\r
+               //LPC_CGU->BASE_UART2_CLK = (SRC_PL160M_0<<24) | (1<<11);       // Use PLL1 and auto block\r
+               CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_BASE_UART2);\r
+       }\r
+#endif\r
+\r
+#ifdef _UART3\r
+       if(UARTx == LPC_USART3)\r
+       {\r
+               /* Set up peripheral clock for UART3 module */\r
+               //LPC_CGU->BASE_UART3_CLK = (SRC_PL160M_0<<24) | (1<<11);       // Use PLL1 and auto block\r
+               CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_BASE_UART3);\r
+       }\r
+#endif\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               /* FIFOs are empty */\r
+               ((LPC_UART1_Type *)UARTx)->/*IIFCR.*/FCR = ( UART_FCR_FIFO_EN \\r
+                               | UART_FCR_RX_RS | UART_FCR_TX_RS);\r
+               // Disable FIFO\r
+               ((LPC_UART1_Type *)UARTx)->/*IIFCR.*/FCR = 0;\r
+\r
+               // Dummy reading\r
+               while (((LPC_UART1_Type *)UARTx)->LSR & UART_LSR_RDR)\r
+               {\r
+                       tmp = ((LPC_UART1_Type *)UARTx)->/*RBTHDLR.*/RBR;\r
+               }\r
+\r
+               ((LPC_UART1_Type *)UARTx)->TER = UART1_TER_TXEN;\r
+               // Wait for current transmit complete\r
+               while (!(((LPC_UART1_Type *)UARTx)->LSR & UART_LSR_THRE));\r
+               // Disable Tx\r
+               ((LPC_UART1_Type *)UARTx)->TER = 0;\r
+\r
+               // Disable interrupt\r
+               ((LPC_UART1_Type *)UARTx)->/*DLIER.*/IER = 0;\r
+               // Set LCR to default state\r
+               ((LPC_UART1_Type *)UARTx)->LCR = 0;\r
+               // Set ACR to default state\r
+               ((LPC_UART1_Type *)UARTx)->ACR = 0;\r
+               // Set Modem Control to default state\r
+               ((LPC_UART1_Type *)UARTx)->MCR = 0;\r
+               // Set RS485 control to default state\r
+               ((LPC_UART1_Type *)UARTx)->RS485CTRL = 0;\r
+               // Set RS485 delay timer to default state\r
+               ((LPC_UART1_Type *)UARTx)->RS485DLY = 0;\r
+               // Set RS485 addr match to default state\r
+               ((LPC_UART1_Type *)UARTx)->RS485ADRMATCH = 0;\r
+               //Dummy Reading to Clear Status\r
+               tmp = ((LPC_UART1_Type *)UARTx)->MSR;\r
+               tmp = ((LPC_UART1_Type *)UARTx)->LSR;\r
+       }\r
+       else\r
+       {\r
+               /* FIFOs are empty */\r
+               UARTx->/*IIFCR.*/FCR = ( UART_FCR_FIFO_EN | UART_FCR_RX_RS | UART_FCR_TX_RS);\r
+               // Disable FIFO\r
+               UARTx->/*IIFCR.*/FCR = 0;\r
+\r
+               // Dummy reading\r
+               while (UARTx->LSR & UART_LSR_RDR)\r
+               {\r
+                       tmp = UARTx->/*RBTHDLR.*/RBR;\r
+               }\r
+\r
+               UARTx->TER = UART0_2_3_TER_TXEN;\r
+               // Wait for current transmit complete\r
+               while (!(UARTx->LSR & UART_LSR_THRE));\r
+               // Disable Tx\r
+               UARTx->TER = 0;\r
+\r
+               // Disable interrupt\r
+               UARTx->/*DLIER.*/IER = 0;\r
+               // Set LCR to default state\r
+               UARTx->LCR = 0;\r
+               // Set ACR to default state\r
+               UARTx->ACR = 0;\r
+               // set HDEN to default state\r
+               UARTx->HDEN = 0;\r
+               // set SCICTRL to default state\r
+               UARTx->SCICTRL = 0;\r
+               // set SYNCCTRL to default state\r
+               UARTx->SYNCCTRL =0;\r
+               // Set RS485 control to default state\r
+               UARTx->RS485CTRL = 0;\r
+               // Set RS485 delay timer to default state\r
+               UARTx->RS485DLY = 0;\r
+               // Set RS485 addr match to default state\r
+               UARTx->RS485ADRMATCH = 0;\r
+               // Dummy reading\r
+               tmp = UARTx->LSR;\r
+       }\r
+\r
+       if (UARTx == LPC_USART3)\r
+       {\r
+               // Set IrDA to default state\r
+               UARTx->ICR = 0;\r
+       }\r
+\r
+       // Set Line Control register ----------------------------\r
+\r
+       uart_set_divisors(UARTx, (UART_ConfigStruct->Baud_rate));\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               tmp = (((LPC_UART1_Type *)UARTx)->LCR & (UART_LCR_DLAB_EN | UART_LCR_BREAK_EN)) \\r
+                               & UART_LCR_BITMASK;\r
+       }\r
+       else\r
+       {\r
+               tmp = (UARTx->LCR & (UART_LCR_DLAB_EN | UART_LCR_BREAK_EN)) & UART_LCR_BITMASK;\r
+       }\r
+\r
+       switch (UART_ConfigStruct->Databits){\r
+       case UART_DATABIT_5:\r
+               tmp |= UART_LCR_WLEN5;\r
+               break;\r
+       case UART_DATABIT_6:\r
+               tmp |= UART_LCR_WLEN6;\r
+               break;\r
+       case UART_DATABIT_7:\r
+               tmp |= UART_LCR_WLEN7;\r
+               break;\r
+       case UART_DATABIT_8:\r
+       default:\r
+               tmp |= UART_LCR_WLEN8;\r
+               break;\r
+       }\r
+\r
+       if (UART_ConfigStruct->Parity == UART_PARITY_NONE)\r
+       {\r
+               // Do nothing...\r
+       }\r
+       else\r
+       {\r
+               tmp |= UART_LCR_PARITY_EN;\r
+               switch (UART_ConfigStruct->Parity)\r
+               {\r
+               case UART_PARITY_ODD:\r
+                       tmp |= UART_LCR_PARITY_ODD;\r
+                       break;\r
+\r
+               case UART_PARITY_EVEN:\r
+                       tmp |= UART_LCR_PARITY_EVEN;\r
+                       break;\r
+\r
+               case UART_PARITY_SP_1:\r
+                       tmp |= UART_LCR_PARITY_F_1;\r
+                       break;\r
+\r
+               case UART_PARITY_SP_0:\r
+                       tmp |= UART_LCR_PARITY_F_0;\r
+                       break;\r
+               default:\r
+                       break;\r
+               }\r
+       }\r
+\r
+       switch (UART_ConfigStruct->Stopbits){\r
+       case UART_STOPBIT_2:\r
+               tmp |= UART_LCR_STOPBIT_SEL;\r
+               break;\r
+       case UART_STOPBIT_1:\r
+       default:\r
+               // Do no thing\r
+               break;\r
+       }\r
+\r
+\r
+       // Write back to LCR, configure FIFO and Disable Tx\r
+       if (((LPC_UART1_Type *)UARTx) ==  LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->LCR = (uint8_t)(tmp & UART_LCR_BITMASK);\r
+       }\r
+       else\r
+       {\r
+               UARTx->LCR = (uint8_t)(tmp & UART_LCR_BITMASK);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              De-initializes the UARTx peripheral registers to their\r
+ *              default reset values.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_DeInit(LPC_USARTn_Type* UARTx)\r
+{\r
+       // For debug mode\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+\r
+       UART_TxCmd(UARTx, DISABLE);\r
+\r
+#ifdef _UART0\r
+       if (UARTx == LPC_USART0)\r
+       {\r
+               /* Set up peripheral clock for UART0 module */\r
+               //LPC_CGU->BASE_UART0_CLK = (SRC_PL160M_1<<24) | (1<<11);       // base SRC_PL160M_1 is not configured, so no clk out\r
+       }\r
+#endif\r
+\r
+#ifdef _UART1\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               /* Set up peripheral clock for UART1 module */\r
+               //LPC_CGU->BASE_UART1_CLK = (SRC_PL160M_1<<24) | (1<<11);       // base SRC_PL160M_1 is not configured, so no clk out\r
+       }\r
+#endif\r
+\r
+#ifdef _UART2\r
+       if (UARTx == LPC_USART2)\r
+       {\r
+               /* Set up peripheral clock for UART2 module */\r
+               //LPC_CGU->BASE_UART2_CLK = (SRC_PL160M_1<<24) | (1<<11);       // base SRC_PL160M_1 is not configured, so no clk out\r
+       }\r
+#endif\r
+\r
+#ifdef _UART3\r
+       if (UARTx == LPC_USART3)\r
+       {\r
+               /* Set up peripheral clock for UART3 module */\r
+               //LPC_CGU->BASE_UART3_CLK = (SRC_PL160M_1<<24) | (1<<11);       // base SRC_PL160M_1 is not configured, so no clk out\r
+       }\r
+#endif\r
+}\r
+\r
+/*****************************************************************************//**\r
+ * @brief              Fills each UART_InitStruct member with its default value:\r
+ *                                     - 9600 bps\r
+ *                                     - 8-bit data\r
+ *                                     - 1 Stopbit\r
+ *                                     - None Parity\r
+ * @param[in]  UART_InitStruct Pointer to a UART_CFG_Type structure which will\r
+ *                             be initialized.\r
+ * @return             None\r
+ *******************************************************************************/\r
+void UART_ConfigStructInit(UART_CFG_Type *UART_InitStruct)\r
+{\r
+       UART_InitStruct->Baud_rate = 9600;\r
+       UART_InitStruct->Databits = UART_DATABIT_8;\r
+       UART_InitStruct->Parity = UART_PARITY_NONE;\r
+       UART_InitStruct->Stopbits = UART_STOPBIT_1;\r
+}\r
+\r
+/* UART Send/Recieve functions -------------------------------------------------*/\r
+/*********************************************************************//**\r
+ * @brief              Transmit a single data through UART peripheral\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  Data    Data to transmit (must be 8-bit long)\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_SendByte(LPC_USARTn_Type* UARTx, uint8_t Data)\r
+{\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->/*RBTHDLR.*/THR = Data & UART_THR_MASKBIT;\r
+       }\r
+       else\r
+       {\r
+               UARTx->/*RBTHDLR.*/THR = Data & UART_THR_MASKBIT;\r
+       }\r
+\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Receive a single data from UART peripheral\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @return             Data received\r
+ **********************************************************************/\r
+uint8_t UART_ReceiveByte(LPC_USARTn_Type* UARTx)\r
+{\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               return (((LPC_UART1_Type *)UARTx)->/*RBTHDLR.*/RBR & UART_RBR_MASKBIT);\r
+       }\r
+       else\r
+       {\r
+               return (UARTx->/*RBTHDLR.*/RBR & UART_RBR_MASKBIT);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Send a block of data via UART peripheral\r
+ * @param[in]  UARTx   Selected UART peripheral used to send data, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  txbuf   Pointer to Transmit buffer\r
+ * @param[in]  buflen  Length of Transmit buffer\r
+ * @param[in]  flag    Flag used in  UART transfer, should be\r
+ *                                     - NONE_BLOCKING\r
+ *                                     - BLOCKING\r
+ * @return             Number of bytes sent.\r
+ *\r
+ * Note: when using UART in BLOCKING mode, a time-out condition is used\r
+ * via defined symbol UART_BLOCKING_TIMEOUT.\r
+ **********************************************************************/\r
+uint32_t UART_Send(LPC_USARTn_Type *UARTx, uint8_t *txbuf,\r
+               uint32_t buflen, TRANSFER_BLOCK_Type flag)\r
+{\r
+       uint32_t bToSend, bSent, timeOut, fifo_cnt;\r
+       uint8_t *pChar = txbuf;\r
+\r
+       bToSend = buflen;\r
+\r
+       // blocking mode\r
+       if (flag == BLOCKING) {\r
+               bSent = 0;\r
+               while (bToSend){\r
+                       timeOut = UART_BLOCKING_TIMEOUT;\r
+                       // Wait for THR empty with timeout\r
+                       while (!(UARTx->LSR & UART_LSR_THRE)) {\r
+                               if (timeOut == 0) break;\r
+                               timeOut--;\r
+                       }\r
+                       // Time out!\r
+                       if(timeOut == 0) break;\r
+                       fifo_cnt = UART_TX_FIFO_SIZE;\r
+                       while (fifo_cnt && bToSend){\r
+                               UART_SendByte(UARTx, (*pChar++));\r
+                               fifo_cnt--;\r
+                               bToSend--;\r
+                               bSent++;\r
+                       }\r
+               }\r
+       }\r
+       // None blocking mode\r
+       else {\r
+               bSent = 0;\r
+               while (bToSend) {\r
+                       if (!(UARTx->LSR & UART_LSR_THRE)){\r
+                               break;\r
+                       }\r
+                       fifo_cnt = UART_TX_FIFO_SIZE;\r
+                       while (fifo_cnt && bToSend) {\r
+                               UART_SendByte(UARTx, (*pChar++));\r
+                               bToSend--;\r
+                               fifo_cnt--;\r
+                               bSent++;\r
+                       }\r
+               }\r
+       }\r
+       return bSent;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Receive a block of data via UART peripheral\r
+ * @param[in]  UARTx   Selected UART peripheral used to send data,\r
+ *                             should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[out] rxbuf   Pointer to Received buffer\r
+ * @param[in]  buflen  Length of Received buffer\r
+ * @param[in]  flag    Flag mode, should be:\r
+ *                                     - NONE_BLOCKING\r
+ *                                     - BLOCKING\r
+ * @return             Number of bytes received\r
+ *\r
+ * Note: when using UART in BLOCKING mode, a time-out condition is used\r
+ * via defined symbol UART_BLOCKING_TIMEOUT.\r
+ **********************************************************************/\r
+uint32_t UART_Receive(LPC_USARTn_Type *UARTx, uint8_t *rxbuf, \\r
+               uint32_t buflen, TRANSFER_BLOCK_Type flag)\r
+{\r
+       uint32_t bToRecv, bRecv, timeOut;\r
+       uint8_t *pChar = rxbuf;\r
+\r
+       bToRecv = buflen;\r
+\r
+       // Blocking mode\r
+       if (flag == BLOCKING) {\r
+               bRecv = 0;\r
+               while (bToRecv){\r
+                       timeOut = UART_BLOCKING_TIMEOUT;\r
+                       while (!(UARTx->LSR & UART_LSR_RDR)){\r
+                               if (timeOut == 0) break;\r
+                               timeOut--;\r
+                       }\r
+                       // Time out!\r
+                       if(timeOut == 0) break;\r
+                       // Get data from the buffer\r
+                       (*pChar++) = UART_ReceiveByte(UARTx);\r
+                       bToRecv--;\r
+                       bRecv++;\r
+               }\r
+       }\r
+       // None blocking mode\r
+       else {\r
+               bRecv = 0;\r
+               while (bToRecv) {\r
+                       if (!(UARTx->LSR & UART_LSR_RDR)) {\r
+                               break;\r
+                       } else {\r
+                               (*pChar++) = UART_ReceiveByte(UARTx);\r
+                               bRecv++;\r
+                               bToRecv--;\r
+                       }\r
+               }\r
+       }\r
+       return bRecv;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Force BREAK character on UART line, output pin UARTx TXD is\r
+                               forced to logic 0.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_ForceBreak(LPC_USARTn_Type* UARTx)\r
+{\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->LCR |= UART_LCR_BREAK_EN;\r
+       }\r
+       else\r
+       {\r
+               UARTx->LCR |= UART_LCR_BREAK_EN;\r
+       }\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Enable or disable specified UART interrupt.\r
+ * @param[in]  UARTx   UART peripheral selected, should be\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  UARTIntCfg      Specifies the interrupt flag,\r
+ *                             should be one of the following:\r
+ *                                     - UART_INTCFG_RBR       :RBR Interrupt enable\r
+ *                                     - UART_INTCFG_THRE      :THR Interrupt enable\r
+ *                                     - UART_INTCFG_RLS       :RX line status interrupt enable\r
+ *                                     - UART1_INTCFG_MS       :Modem status interrupt enable (UART1 only)\r
+ *                                     - UART1_INTCFG_CTS      :CTS1 signal transition interrupt enable (UART1 only)\r
+ *                                     - UART_INTCFG_ABEO      :Enables the end of auto-baud interrupt\r
+ *                                     - UART_INTCFG_ABTO      :Enables the auto-baud time-out interrupt\r
+ * @param[in]  NewState New state of specified UART interrupt type,\r
+ *                             should be:\r
+ *                                     - ENALBE        :Enable this UART interrupt type.\r
+ *                                     - DISALBE       :Disable this UART interrupt type.\r
+ * @return             None\r
+ *********************************************************************/\r
+void UART_IntConfig(LPC_USARTn_Type *UARTx, UART_INT_Type UARTIntCfg, FunctionalState NewState)\r
+{\r
+       uint32_t tmp;\r
+\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       switch(UARTIntCfg){\r
+               case UART_INTCFG_RBR:\r
+                       tmp = UART_IER_RBRINT_EN;\r
+                       break;\r
+               case UART_INTCFG_THRE:\r
+                       tmp = UART_IER_THREINT_EN;\r
+                       break;\r
+               case UART_INTCFG_RLS:\r
+                       tmp = UART_IER_RLSINT_EN;\r
+                       break;\r
+               case UART1_INTCFG_MS:\r
+                       tmp = UART1_IER_MSINT_EN;\r
+                       break;\r
+               case UART1_INTCFG_CTS:\r
+                       tmp = UART1_IER_CTSINT_EN;\r
+                       break;\r
+               case UART_INTCFG_ABEO:\r
+                       tmp = UART_IER_ABEOINT_EN;\r
+                       break;\r
+               case UART_INTCFG_ABTO:\r
+                       tmp = UART_IER_ABTOINT_EN;\r
+                       break;\r
+       }\r
+\r
+       if ((LPC_UART1_Type *) UARTx == LPC_UART1)\r
+       {\r
+               CHECK_PARAM((PARAM_UART_INTCFG(UARTIntCfg)) || (PARAM_UART1_INTCFG(UARTIntCfg)));\r
+       }\r
+       else\r
+       {\r
+               CHECK_PARAM(PARAM_UART_INTCFG(UARTIntCfg));\r
+       }\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               if ((LPC_UART1_Type *) UARTx == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->/*DLIER.*/IER |= tmp;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->/*DLIER.*/IER |= tmp;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if ((LPC_UART1_Type *) UARTx == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->/*DLIER.*/IER &= (~tmp) & UART1_IER_BITMASK;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->/*DLIER.*/IER &= (~tmp) & UART_IER_BITMASK;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/********************************************************************//**\r
+ * @brief              Get current value of Line Status register in UART peripheral.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @return             Current value of Line Status register in UART peripheral.\r
+ * Note:       The return value of this function must be ANDed with each member in\r
+ *                     UART_LS_Type enumeration to determine current flag status\r
+ *                     corresponding to each Line status type. Because some flags in\r
+ *                     Line Status register will be cleared after reading, the next reading\r
+ *                     Line Status register could not be correct. So this function used to\r
+ *                     read Line status register in one time only, then the return value\r
+ *                     used to check all flags.\r
+ *********************************************************************/\r
+uint8_t UART_GetLineStatus(LPC_USARTn_Type* UARTx)\r
+{\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               return ((((LPC_UART1_Type *)LPC_UART1)->LSR) & UART_LSR_BITMASK);\r
+       }\r
+       else\r
+       {\r
+               return ((UARTx->LSR) & UART_LSR_BITMASK);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if UART is busy or not\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @return             RESET if UART is not busy, otherwise return SET.\r
+ **********************************************************************/\r
+FlagStatus UART_CheckBusy(LPC_USARTn_Type *UARTx)\r
+{\r
+       if (UARTx->LSR & UART_LSR_TEMT){\r
+               return RESET;\r
+       } else {\r
+               return SET;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure FIFO function on selected UART peripheral\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  FIFOCfg Pointer to a UART_FIFO_CFG_Type Structure that\r
+ *                                             contains specified information about FIFO configuration\r
+ * @return             none\r
+ **********************************************************************/\r
+void UART_FIFOConfig(LPC_USARTn_Type *UARTx, UART_FIFO_CFG_Type *FIFOCfg)\r
+{\r
+       uint8_t tmp = 0;\r
+\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+       CHECK_PARAM(PARAM_UART_FIFO_LEVEL(FIFOCfg->FIFO_Level));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_DMAMode));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_ResetRxBuf));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(FIFOCfg->FIFO_ResetTxBuf));\r
+\r
+       tmp |= UART_FCR_FIFO_EN;\r
+       switch (FIFOCfg->FIFO_Level){\r
+       case UART_FIFO_TRGLEV0:\r
+               tmp |= UART_FCR_TRG_LEV0;\r
+               break;\r
+       case UART_FIFO_TRGLEV1:\r
+               tmp |= UART_FCR_TRG_LEV1;\r
+               break;\r
+       case UART_FIFO_TRGLEV2:\r
+               tmp |= UART_FCR_TRG_LEV2;\r
+               break;\r
+       case UART_FIFO_TRGLEV3:\r
+       default:\r
+               tmp |= UART_FCR_TRG_LEV3;\r
+               break;\r
+       }\r
+\r
+       if (FIFOCfg->FIFO_ResetTxBuf == ENABLE)\r
+       {\r
+               tmp |= UART_FCR_TX_RS;\r
+       }\r
+       if (FIFOCfg->FIFO_ResetRxBuf == ENABLE)\r
+       {\r
+               tmp |= UART_FCR_RX_RS;\r
+       }\r
+       if (FIFOCfg->FIFO_DMAMode == ENABLE)\r
+       {\r
+               tmp |= UART_FCR_DMAMODE_SEL;\r
+       }\r
+\r
+\r
+       //write to FIFO control register\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->/*IIFCR.*/FCR = tmp & UART_FCR_BITMASK;\r
+       }\r
+       else\r
+       {\r
+               UARTx->/*IIFCR.*/FCR = tmp & UART_FCR_BITMASK;\r
+       }\r
+}\r
+\r
+/*****************************************************************************//**\r
+ * @brief              Fills each UART_FIFOInitStruct member with its default value:\r
+ *                                     - FIFO_DMAMode = DISABLE\r
+ *                                     - FIFO_Level = UART_FIFO_TRGLEV0\r
+ *                                     - FIFO_ResetRxBuf = ENABLE\r
+ *                                     - FIFO_ResetTxBuf = ENABLE\r
+ *                                     - FIFO_State = ENABLE\r
+ *\r
+ * @param[in]  UART_FIFOInitStruct Pointer to a UART_FIFO_CFG_Type structure\r
+ *                    which will be initialized.\r
+ * @return             None\r
+ *******************************************************************************/\r
+void UART_FIFOConfigStructInit(UART_FIFO_CFG_Type *UART_FIFOInitStruct)\r
+{\r
+       UART_FIFOInitStruct->FIFO_DMAMode = DISABLE;\r
+       UART_FIFOInitStruct->FIFO_Level = UART_FIFO_TRGLEV0;\r
+       UART_FIFOInitStruct->FIFO_ResetRxBuf = ENABLE;\r
+       UART_FIFOInitStruct->FIFO_ResetTxBuf = ENABLE;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Start/Stop Auto Baudrate activity\r
+ * @param[in]  UARTx   UART peripheral selected, should be\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  ABConfigStruct  A pointer to UART_AB_CFG_Type structure that\r
+ *                             contains specified information about UART auto baudrate configuration\r
+ * @param[in]  NewState New State of Auto baudrate activity, should be:\r
+ *                                     - ENABLE        :Start this activity\r
+ *                                     - DISABLE       :Stop this activity\r
+ * Note:               Auto-baudrate mode enable bit will be cleared once this mode\r
+ *                             completed.\r
+ * @return             none\r
+ **********************************************************************/\r
+void UART_ABCmd(LPC_USARTn_Type *UARTx, UART_AB_CFG_Type *ABConfigStruct, \\r
+                               FunctionalState NewState)\r
+{\r
+       uint32_t tmp;\r
+\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       tmp = 0;\r
+       if (NewState == ENABLE) {\r
+               if (ABConfigStruct->ABMode == UART_AUTOBAUD_MODE1){\r
+                       tmp |= UART_ACR_MODE;\r
+               }\r
+               if (ABConfigStruct->AutoRestart == ENABLE){\r
+                       tmp |= UART_ACR_AUTO_RESTART;\r
+               }\r
+       }\r
+\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               if (NewState == ENABLE)\r
+               {\r
+                       // Clear DLL and DLM value\r
+                       ((LPC_UART1_Type *)UARTx)->LCR |= UART_LCR_DLAB_EN;\r
+                       ((LPC_UART1_Type *)UARTx)->DLL = 0;\r
+                       ((LPC_UART1_Type *)UARTx)->DLM = 0;\r
+                       ((LPC_UART1_Type *)UARTx)->LCR &= ~UART_LCR_DLAB_EN;\r
+                       // FDR value must be reset to default value\r
+                       ((LPC_UART1_Type *)UARTx)->FDR = 0x10;\r
+                       ((LPC_UART1_Type *)UARTx)->ACR = UART_ACR_START | tmp;\r
+               }\r
+               else\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->ACR = 0;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if (NewState == ENABLE)\r
+               {\r
+                       // Clear DLL and DLM value\r
+                       UARTx->LCR |= UART_LCR_DLAB_EN;\r
+                       UARTx->DLL = 0;\r
+                       UARTx->DLM = 0;\r
+                       UARTx->LCR &= ~UART_LCR_DLAB_EN;\r
+                       // FDR value must be reset to default value\r
+                       UARTx->FDR = 0x10;\r
+                       UARTx->ACR = UART_ACR_START | tmp;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->ACR = 0;\r
+               }\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable transmission on UART TxD pin\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  NewState New State of Tx transmission function, should be:\r
+ *                                     - ENABLE        :Enable this function\r
+                                       - DISABLE       :Disable this function\r
+ * @return none\r
+ **********************************************************************/\r
+void UART_TxCmd(LPC_USARTn_Type *UARTx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_UARTx(UARTx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->TER |= UART1_TER_TXEN;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->TER |= UART0_2_3_TER_TXEN;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->TER &= (~UART1_TER_TXEN) & UART1_TER_BITMASK;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->TER &= (~UART0_2_3_TER_TXEN) & UART0_2_3_TER_BITMASK;\r
+               }\r
+       }\r
+}\r
+\r
+/* UART IrDA functions ---------------------------------------------------*/\r
+\r
+#ifdef _UART3\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable inverting serial input function of IrDA\r
+ *                             on UART peripheral.\r
+ * @param[in]  UARTx UART peripheral selected, should be LPC_UART3 (only)\r
+ * @param[in]  NewState New state of inverting serial input, should be:\r
+ *                                     - ENABLE        :Enable this function.\r
+ *                                     - DISABLE       :Disable this function.\r
+ * @return none\r
+ **********************************************************************/\r
+void UART_IrDAInvtInputCmd(LPC_USARTn_Type* UARTx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_UART_IrDA(UARTx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               UARTx->ICR |= UART_ICR_IRDAINV;\r
+       }\r
+       else if (NewState == DISABLE)\r
+       {\r
+               UARTx->ICR &= (~UART_ICR_IRDAINV) & UART_ICR_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable or disable IrDA function on UART peripheral.\r
+ * @param[in]  UARTx UART peripheral selected, should be LPC_UART3 (only)\r
+ * @param[in]  NewState New state of IrDA function, should be:\r
+ *                                     - ENABLE        :Enable this function.\r
+ *                                     - DISABLE       :Disable this function.\r
+ * @return none\r
+ **********************************************************************/\r
+void UART_IrDACmd(LPC_USARTn_Type* UARTx, FunctionalState NewState)\r
+{\r
+       CHECK_PARAM(PARAM_UART_IrDA(UARTx));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               UARTx->ICR |= UART_ICR_IRDAEN;\r
+       }\r
+       else\r
+       {\r
+               UARTx->ICR &= (~UART_ICR_IRDAEN) & UART_ICR_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure Pulse divider for IrDA function on UART peripheral.\r
+ * @param[in]  UARTx UART peripheral selected, should be LPC_UART3 (only)\r
+ * @param[in]  PulseDiv Pulse Divider value from Peripheral clock,\r
+ *                             should be one of the following:\r
+ *                                     - UART_IrDA_PULSEDIV2   :Pulse width = 2 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV4   :Pulse width = 4 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV8   :Pulse width = 8 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV16  :Pulse width = 16 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV32  :Pulse width = 32 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV64  :Pulse width = 64 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV128 :Pulse width = 128 * Tpclk\r
+ *                                     - UART_IrDA_PULSEDIV256 :Pulse width = 256 * Tpclk\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_IrDAPulseDivConfig(LPC_USARTn_Type *UARTx, UART_IrDA_PULSE_Type PulseDiv)\r
+{\r
+       uint32_t tmp, tmp1;\r
+       CHECK_PARAM(PARAM_UART_IrDA(UARTx));\r
+       CHECK_PARAM(PARAM_UART_IrDA_PULSEDIV(PulseDiv));\r
+\r
+       tmp1 = UART_ICR_PULSEDIV(PulseDiv);\r
+       tmp = UARTx->ICR & (~UART_ICR_PULSEDIV(7));\r
+       tmp |= tmp1 | UART_ICR_FIXPULSE_EN;\r
+       UARTx->ICR = tmp & UART_ICR_BITMASK;\r
+}\r
+\r
+#endif\r
+\r
+\r
+/* UART1 FullModem function ---------------------------------------------*/\r
+\r
+#ifdef _UART1\r
+\r
+/*********************************************************************//**\r
+ * @brief              Force pin DTR/RTS corresponding to given state (Full modem mode)\r
+ * @param[in]  UARTx   LPC_UART1 (only)\r
+ * @param[in]  Pin     Pin that NewState will be applied to, should be:\r
+ *                                     - UART1_MODEM_PIN_DTR   :DTR pin.\r
+ *                                     - UART1_MODEM_PIN_RTS   :RTS pin.\r
+ * @param[in]  NewState New State of DTR/RTS pin, should be:\r
+ *                                     - INACTIVE      :Force the pin to inactive signal.\r
+                                       - ACTIVE        :Force the pin to active signal.\r
+ * @return none\r
+ **********************************************************************/\r
+void UART_FullModemForcePinState(LPC_UART1_Type *UARTx, UART_MODEM_PIN_Type Pin, \\r
+                                                       UART1_SignalState NewState)\r
+{\r
+       uint8_t tmp = 0;\r
+\r
+       CHECK_PARAM(PARAM_UART1_MODEM(UARTx));\r
+       CHECK_PARAM(PARAM_UART1_MODEM_PIN(Pin));\r
+       CHECK_PARAM(PARAM_UART1_SIGNALSTATE(NewState));\r
+\r
+       switch (Pin){\r
+       case UART1_MODEM_PIN_DTR:\r
+               tmp = UART1_MCR_DTR_CTRL;\r
+               break;\r
+       case UART1_MODEM_PIN_RTS:\r
+               tmp = UART1_MCR_RTS_CTRL;\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+\r
+       if (NewState == ACTIVE){\r
+               UARTx->MCR |= tmp;\r
+       } else {\r
+               UARTx->MCR &= (~tmp) & UART1_MCR_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Configure Full Modem mode for UART peripheral\r
+ * @param[in]  UARTx   LPC_UART1 (only)\r
+ * @param[in]  Mode Full Modem mode, should be:\r
+ *                                     - UART1_MODEM_MODE_LOOPBACK     :Loop back mode.\r
+ *                                     - UART1_MODEM_MODE_AUTO_RTS     :Auto-RTS mode.\r
+ *                                     - UART1_MODEM_MODE_AUTO_CTS     :Auto-CTS mode.\r
+ * @param[in]  NewState New State of this mode, should be:\r
+ *                                     - ENABLE        :Enable this mode.\r
+                                       - DISABLE       :Disable this mode.\r
+ * @return none\r
+ **********************************************************************/\r
+void UART_FullModemConfigMode(LPC_UART1_Type *UARTx, UART_MODEM_MODE_Type Mode, \\r
+                                                       FunctionalState NewState)\r
+{\r
+       uint8_t tmp;\r
+\r
+       CHECK_PARAM(PARAM_UART1_MODEM(UARTx));\r
+       CHECK_PARAM(PARAM_UART1_MODEM_MODE(Mode));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(NewState));\r
+\r
+       switch(Mode){\r
+       case UART1_MODEM_MODE_LOOPBACK:\r
+               tmp = UART1_MCR_LOOPB_EN;\r
+               break;\r
+       case UART1_MODEM_MODE_AUTO_RTS:\r
+               tmp = UART1_MCR_AUTO_RTS_EN;\r
+               break;\r
+       case UART1_MODEM_MODE_AUTO_CTS:\r
+               tmp = UART1_MCR_AUTO_CTS_EN;\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+\r
+       if (NewState == ENABLE)\r
+       {\r
+               UARTx->MCR |= tmp;\r
+       }\r
+       else\r
+       {\r
+               UARTx->MCR &= (~tmp) & UART1_MCR_BITMASK;\r
+       }\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get current status of modem status register\r
+ * @param[in]  UARTx   LPC_UART1 (only)\r
+ * @return             Current value of modem status register\r
+ * Note:       The return value of this function must be ANDed with each member\r
+ *                     UART_MODEM_STAT_type enumeration to determine current flag status\r
+ *                     corresponding to each modem flag status. Because some flags in\r
+ *                     modem status register will be cleared after reading, the next reading\r
+ *                     modem register could not be correct. So this function used to\r
+ *                     read modem status register in one time only, then the return value\r
+ *                     used to check all flags.\r
+ **********************************************************************/\r
+uint8_t UART_FullModemGetStatus(LPC_UART1_Type *UARTx)\r
+{\r
+       CHECK_PARAM(PARAM_UART1_MODEM(UARTx));\r
+       return ((UARTx->MSR) & UART1_MSR_BITMASK);\r
+}\r
+\r
+#endif /* _UART1 */\r
+/* UART RS485 functions --------------------------------------------------------------*/\r
+\r
+/*********************************************************************//**\r
+* @brief               Configure UART peripheral in RS485 mode according to the specified\r
+ *               parameters in the RS485ConfigStruct.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  RS485ConfigStruct Pointer to a UART_RS485_CTRLCFG_Type structure\r
+ *              that contains the configuration information for specified UART\r
+ *              in RS485 mode.\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_RS485Config(LPC_USARTn_Type *UARTx, UART_RS485_CTRLCFG_Type *RS485ConfigStruct)\r
+{\r
+       uint32_t tmp;\r
+\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(RS485ConfigStruct->AutoAddrDetect_State));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(RS485ConfigStruct->AutoDirCtrl_State));\r
+       CHECK_PARAM(PARAM_UART_RS485_CFG_DELAYVALUE(RS485ConfigStruct->DelayValue));\r
+       CHECK_PARAM(PARAM_SETSTATE(RS485ConfigStruct->DirCtrlPol_Level));\r
+       CHECK_PARAM(PARAM_UART_RS485_DIRCTRL_PIN(RS485ConfigStruct->DirCtrlPin));\r
+       CHECK_PARAM(PARAM_UART_RS485_CFG_MATCHADDRVALUE(RS485ConfigStruct->MatchAddrValue));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(RS485ConfigStruct->NormalMultiDropMode_State));\r
+       CHECK_PARAM(PARAM_FUNCTIONALSTATE(RS485ConfigStruct->Rx_State));\r
+\r
+       tmp = 0;\r
+       // If Auto Direction Control is enabled -  This function is used in Master mode\r
+       if (RS485ConfigStruct->AutoDirCtrl_State == ENABLE)\r
+       {\r
+               tmp |= UART_RS485CTRL_DCTRL_EN;\r
+\r
+               // Set polar\r
+               if (RS485ConfigStruct->DirCtrlPol_Level == SET)\r
+               {\r
+                       tmp |= UART_RS485CTRL_OINV_1;\r
+               }\r
+\r
+               // Set pin according to\r
+               if (RS485ConfigStruct->DirCtrlPin == UART_RS485_DIRCTRL_DTR)\r
+               {\r
+                       tmp |= UART_RS485CTRL_SEL_DTR;\r
+               }\r
+\r
+               // Fill delay time\r
+               if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->RS485DLY = RS485ConfigStruct->DelayValue & UART_RS485DLY_BITMASK;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->RS485DLY = RS485ConfigStruct->DelayValue & UART_RS485DLY_BITMASK;\r
+               }\r
+       }\r
+\r
+       // MultiDrop mode is enable\r
+       if (RS485ConfigStruct->NormalMultiDropMode_State == ENABLE)\r
+       {\r
+               tmp |= UART_RS485CTRL_NMM_EN;\r
+       }\r
+\r
+       // Auto Address Detect function\r
+       if (RS485ConfigStruct->AutoAddrDetect_State == ENABLE)\r
+       {\r
+               tmp |= UART_RS485CTRL_AADEN;\r
+               // Fill Match Address\r
+               if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+               {\r
+                       ((LPC_UART1_Type *)UARTx)->RS485ADRMATCH = RS485ConfigStruct->MatchAddrValue & UART_RS485ADRMATCH_BITMASK;\r
+               }\r
+               else\r
+               {\r
+                       UARTx->RS485ADRMATCH = RS485ConfigStruct->MatchAddrValue & UART_RS485ADRMATCH_BITMASK;\r
+               }\r
+       }\r
+\r
+\r
+       // Receiver is disable\r
+       if (RS485ConfigStruct->Rx_State == DISABLE)\r
+       {\r
+               tmp |= UART_RS485CTRL_RX_DIS;\r
+       }\r
+\r
+       // write back to RS485 control register\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->RS485CTRL = tmp & UART_RS485CTRL_BITMASK;\r
+       }\r
+       else\r
+       {\r
+               UARTx->RS485CTRL = tmp & UART_RS485CTRL_BITMASK;\r
+       }\r
+\r
+       // Enable Parity function and leave parity in stick '0' parity as default\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               ((LPC_UART1_Type *)UARTx)->LCR |= (UART_LCR_PARITY_F_0 | UART_LCR_PARITY_EN);\r
+       }\r
+       else\r
+       {\r
+               UARTx->LCR |= (UART_LCR_PARITY_F_0 | UART_LCR_PARITY_EN);\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Enable/Disable receiver in RS485 module in UART\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  NewState        New State of command, should be:\r
+ *                                     - ENABLE        :Enable this function.\r
+ *                                     - DISABLE       :Disable this function.\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_RS485ReceiverCmd(LPC_USARTn_Type *UARTx, FunctionalState NewState)\r
+{\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               if (NewState == ENABLE){\r
+                       ((LPC_UART1_Type *)UARTx)->RS485CTRL &= ~UART_RS485CTRL_RX_DIS;\r
+               } else {\r
+                       ((LPC_UART1_Type *)UARTx)->RS485CTRL |= UART_RS485CTRL_RX_DIS;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if (NewState == ENABLE){\r
+                       UARTx->RS485CTRL &= ~UART_RS485CTRL_RX_DIS;\r
+               } else {\r
+                       UARTx->RS485CTRL |= UART_RS485CTRL_RX_DIS;\r
+               }\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Send data on RS485 bus with specified parity stick value (9-bit mode).\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  pDatFrm         Pointer to data frame.\r
+ * @param[in]  size            Size of data.\r
+ * @param[in]  ParityStick     Parity Stick value, should be 0 or 1.\r
+ * @return             None\r
+ **********************************************************************/\r
+uint32_t UART_RS485Send(LPC_USARTn_Type *UARTx, uint8_t *pDatFrm, \\r
+                                       uint32_t size, uint8_t ParityStick)\r
+{\r
+       uint8_t tmp, save;\r
+       uint32_t cnt;\r
+       if (((LPC_UART1_Type *)UARTx) == LPC_UART1)\r
+       {\r
+               if (ParityStick){\r
+                       save = tmp = ((LPC_UART1_Type *)UARTx)->LCR & UART_LCR_BITMASK;\r
+                       tmp &= ~(UART_LCR_PARITY_EVEN);\r
+                       ((LPC_UART1_Type *)UARTx)->LCR = tmp;\r
+                       cnt = UART_Send((LPC_USARTn_Type *)UARTx, pDatFrm, size, BLOCKING);\r
+                       while (!(((LPC_UART1_Type *)UARTx)->LSR & UART_LSR_TEMT));\r
+                       ((LPC_UART1_Type *)UARTx)->LCR = save;\r
+               } else {\r
+                       cnt = UART_Send((LPC_USARTn_Type *)UARTx, pDatFrm, size, BLOCKING);\r
+                       while (!(((LPC_UART1_Type *)UARTx)->LSR & UART_LSR_TEMT));\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if (ParityStick){\r
+                       save = tmp = UARTx->LCR & UART_LCR_BITMASK;\r
+                       tmp &= ~(UART_LCR_PARITY_EVEN);\r
+                       UARTx->LCR = tmp;\r
+                       cnt = UART_Send((LPC_USARTn_Type *)UARTx, pDatFrm, size, BLOCKING);\r
+                       while (!(UARTx->LSR & UART_LSR_TEMT));\r
+                       UARTx->LCR = save;\r
+               } else {\r
+                       cnt = UART_Send((LPC_USARTn_Type *)UARTx, pDatFrm, size, BLOCKING);\r
+                       while (!(UARTx->LSR & UART_LSR_TEMT));\r
+               }\r
+       }\r
+       return cnt;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Send Slave address frames on RS485 bus.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  SlvAddr Slave Address.\r
+ * @return             None\r
+ **********************************************************************/\r
+void UART_RS485SendSlvAddr(LPC_USARTn_Type *UARTx, uint8_t SlvAddr)\r
+{\r
+       UART_RS485Send(UARTx, &SlvAddr, 1, 1);\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Send Data frames on RS485 bus.\r
+ * @param[in]  UARTx   UART peripheral selected, should be:\r
+ *                                     - LPC_UART0     :UART0 peripheral\r
+ *                                     - LPC_UART1     :UART1 peripheral\r
+ *                                     - LPC_UART2     :UART2 peripheral\r
+ *                                     - LPC_UART3     :UART3 peripheral\r
+ * @param[in]  pData Pointer to data to be sent.\r
+ * @param[in]  size Size of data frame to be sent.\r
+ * @return             None\r
+ **********************************************************************/\r
+uint32_t UART_RS485SendData(LPC_USARTn_Type *UARTx, uint8_t *pData, uint32_t size)\r
+{\r
+       return (UART_RS485Send(UARTx, pData, size, 0));\r
+}\r
+\r
+\r
+#endif /* _UART */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+/* --------------------------------- End Of File ------------------------------ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_utils.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_utils.c
new file mode 100644 (file)
index 0000000..bb9414b
--- /dev/null
@@ -0,0 +1,79 @@
+#include "lpc18xx_utils.h"\r
+#include "lpc18xx_timer.h"\r
+\r
+//timer init\r
+TIM_TIMERCFG_Type TIM_ConfigStruct;\r
+TIM_MATCHCFG_Type TIM_MatchConfigStruct;\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Main TIMER program body\r
+ * @param[in]  None\r
+ * @return             int\r
+ **********************************************************************/\r
+int timer_delay_us( int cnt)\r
+{\r
+\r
+       // Initialize timer 0, prescale count time of 1uS\r
+       TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_USVAL;\r
+       TIM_ConfigStruct.PrescaleValue  = 20;\r
+\r
+       // use channel 0, MR0\r
+       TIM_MatchConfigStruct.MatchChannel = 0;\r
+       // Disable interrupt when MR0 matches the value in TC register\r
+       TIM_MatchConfigStruct.IntOnMatch   = TRUE;\r
+       //Enable reset on MR0: TIMER will reset if MR0 matches it\r
+       TIM_MatchConfigStruct.ResetOnMatch = TRUE;\r
+       //Stop on MR0 if MR0 matches it\r
+       TIM_MatchConfigStruct.StopOnMatch  = TRUE;\r
+\r
+       TIM_MatchConfigStruct.ExtMatchOutputType =TIM_EXTMATCH_NOTHING;\r
+       \r
+       TIM_MatchConfigStruct.MatchValue   = cnt;\r
+\r
+       // Set configuration for Tim_config and Tim_MatchConfig\r
+       TIM_Init(LPC_TIMER0, TIM_TIMER_MODE,&TIM_ConfigStruct);\r
+       TIM_ConfigMatch(LPC_TIMER0,&TIM_MatchConfigStruct);\r
+       TIM_Cmd(LPC_TIMER0,ENABLE);\r
+\r
+       while ( !(TIM_GetIntStatus(LPC_TIMER0,TIM_MR0_INT)));\r
+       TIM_ClearIntPending(LPC_TIMER0,(TIM_INT_TYPE)0);\r
+\r
+  return 0;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Main TIMER program body\r
+ * @param[in]  None\r
+ * @return             int\r
+ **********************************************************************/\r
+int timer_delay_ms( int cnt)\r
+{\r
+\r
+       // Initialize timer 0, prescale count time of 1uS\r
+       TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_USVAL;\r
+       TIM_ConfigStruct.PrescaleValue  = 1000;\r
+\r
+       // use channel 0, MR0\r
+       TIM_MatchConfigStruct.MatchChannel = 1;\r
+       // Disable interrupt when MR0 matches the value in TC register\r
+       TIM_MatchConfigStruct.IntOnMatch   = TRUE;\r
+       //Enable reset on MR0: TIMER will reset if MR0 matches it\r
+       TIM_MatchConfigStruct.ResetOnMatch = TRUE;\r
+       //Stop on MR0 if MR0 matches it\r
+       TIM_MatchConfigStruct.StopOnMatch  = TRUE;\r
+\r
+       TIM_MatchConfigStruct.ExtMatchOutputType =TIM_EXTMATCH_NOTHING;\r
+       \r
+       TIM_MatchConfigStruct.MatchValue   = cnt;\r
+\r
+       // Set configuration for Tim_config and Tim_MatchConfig\r
+       TIM_Init(LPC_TIMER1, TIM_TIMER_MODE,&TIM_ConfigStruct);\r
+       TIM_ConfigMatch(LPC_TIMER1,&TIM_MatchConfigStruct);\r
+       TIM_Cmd(LPC_TIMER1,ENABLE);\r
+\r
+       while ( !(TIM_GetIntStatus(LPC_TIMER1,TIM_MR1_INT)));\r
+       TIM_ClearIntPending(LPC_TIMER1,(TIM_INT_TYPE)1);\r
+\r
+  return 0;\r
+}\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_wwdt.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/lpc18xx_wwdt.c
new file mode 100644 (file)
index 0000000..737cf22
--- /dev/null
@@ -0,0 +1,268 @@
+/**********************************************************************\r
+* $Id$         lpc18xx_wwdt.c          2011-06-02\r
+*//**\r
+* @file                lpc18xx_wwdt.c\r
+* @brief       Contains all functions support for WDT firmware library\r
+*                      on LPC18xx\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @addtogroup WWDT\r
+ * @{\r
+ */\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "lpc18xx_wwdt.h"\r
+\r
+/* If this source file built with example, the LPC18xx FW library configuration\r
+ * file in each example directory ("lpc18xx_libcfg.h") must be included,\r
+ * otherwise the default FW library configuration file must be included instead\r
+ */\r
+#ifdef __BUILD_WITH_EXAMPLE__\r
+#include "lpc18xx_libcfg.h"\r
+#else\r
+#include "lpc18xx_libcfg_default.h"\r
+#endif /* __BUILD_WITH_EXAMPLE__ */\r
+\r
+\r
+#ifdef _WWDT\r
+\r
+void WWDT_SetTimeOut(uint32_t timeout);\r
+\r
+/*********************************************************************//**\r
+ * @brief              Update WDT timeout value and feed\r
+ * @param[in]  timeout WDT timeout (us)\r
+ * @return             none\r
+ **********************************************************************/\r
+void WWDT_SetTimeOut(uint32_t timeout)\r
+{\r
+       uint32_t timeoutVal;\r
+\r
+       timeoutVal = WDT_GET_FROM_USEC(timeout);\r
+\r
+       if(timeoutVal < WWDT_TIMEOUT_MIN)\r
+       {\r
+               timeoutVal = WWDT_TIMEOUT_MIN;\r
+       }\r
+       else if (timeoutVal > WWDT_TIMEOUT_MAX)\r
+       {\r
+               timeoutVal = WWDT_TIMEOUT_MAX;\r
+       }\r
+\r
+       LPC_WWDT->TC = timeoutVal;\r
+}\r
+/* Public Functions ----------------------------------------------------------- */\r
+/** @addtogroup WDT_Public_Functions\r
+ * @{\r
+ */\r
+\r
+/*********************************************************************//**\r
+* @brief               Initial for Watchdog function\r
+* @param[in]   none\r
+* @return              None\r
+ **********************************************************************/\r
+void WWDT_Init(void)\r
+{\r
+       LPC_WWDT->MOD   = 0;                                    // Clear time out and interrupt flags\r
+       LPC_WWDT->TC    = WWDT_TIMEOUT_MIN;     // Reset time out\r
+       LPC_WWDT->WARNINT= 0;                                   // Reset warning value\r
+       LPC_WWDT->WINDOW = WWDT_WINDOW_MAX;             // Reset window value\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Update WDT timeout value and feed\r
+ * @param[in]  TimeOut TimeOut value to be updated, should be in range:\r
+ *                             2048 .. 134217728\r
+ * @return             None\r
+ *********************************************************************/\r
+void WDT_UpdateTimeOut(uint32_t TimeOut)\r
+{\r
+       /* check WDPROTECT,\r
+        * if it is enable, wait until the counter is below the value of\r
+        * WDWARNINT and WDWINDOW\r
+        */\r
+       if(LPC_WWDT->MOD & (1<<4))\r
+       {\r
+               while((LPC_WWDT->TV <(LPC_WWDT->WARNINT & WWDT_WDWARNINT_MASK))\\r
+                                               &&(LPC_WWDT->TV <(LPC_WWDT->WINDOW & WWDT_WDTC_MASK)));\r
+       }\r
+\r
+       WWDT_SetTimeOut(TimeOut);\r
+}\r
+/********************************************************************//**\r
+ * @brief              After set WDTEN, call this function to start Watchdog\r
+ *                             or reload the Watchdog timer\r
+ * @param[in]  None\r
+ * @return             None\r
+ *********************************************************************/\r
+void WWDT_Feed (void)\r
+{\r
+       LPC_WWDT->FEED = 0xAA;\r
+\r
+       LPC_WWDT->FEED = 0x55;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Update WDT timeout value and feed\r
+ * @param[in]  WarnTime        time to generate watchdog warning interrupt(us)\r
+ *                             should be in range: 2048 .. 8192\r
+ * @return             None\r
+ *********************************************************************/\r
+void WWDT_SetWarning(uint32_t WarnTime)\r
+{\r
+       uint32_t warnVal;\r
+\r
+       warnVal = WDT_GET_FROM_USEC(WarnTime);\r
+\r
+       if(warnVal <= WWDT_WARNINT_MIN)\r
+       {\r
+               warnVal = WWDT_WARNINT_MIN;\r
+       }\r
+       else if (warnVal >= WWDT_WARNINT_MAX)\r
+       {\r
+               warnVal = WWDT_WARNINT_MAX;\r
+       }\r
+\r
+       LPC_WWDT->WARNINT = warnVal;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Update WDT timeout value and feed\r
+ * @param[in]  WindowedTime    expected time to set watchdog window event(us)\r
+ * @return             none\r
+ *********************************************************************/\r
+void WWDT_SetWindow(uint32_t WindowedTime)\r
+{\r
+       uint32_t wndVal;\r
+\r
+       wndVal = WDT_GET_FROM_USEC(WindowedTime);\r
+\r
+       if(wndVal <= WWDT_WINDOW_MIN)\r
+       {\r
+               wndVal = WWDT_WINDOW_MIN;\r
+       }\r
+       else if (wndVal >= WWDT_WINDOW_MAX)\r
+       {\r
+               wndVal = WWDT_WINDOW_MAX;\r
+       }\r
+\r
+       LPC_WWDT->WINDOW = wndVal;\r
+}\r
+/*********************************************************************//**\r
+* @brief               Enable/Disable WWDT activity\r
+* @param[in]   None\r
+* @return              None\r
+ **********************************************************************/\r
+void WWDT_Configure(st_Wdt_Config wdtCfg)\r
+{\r
+       WWDT_SetTimeOut(wdtCfg.wdtTmrConst);\r
+\r
+       if(wdtCfg.wdtReset)\r
+       {\r
+               LPC_WWDT->MOD |= WWDT_WDMOD_WDRESET;\r
+       }\r
+       else\r
+       {\r
+               LPC_WWDT->MOD &= ~WWDT_WDMOD_WDRESET;\r
+       }\r
+\r
+       if(wdtCfg.wdtProtect)\r
+       {\r
+               LPC_WWDT->MOD |= WWDT_WDMOD_WDPROTECT;\r
+       }\r
+       else\r
+       {\r
+               LPC_WWDT->MOD &= ~WWDT_WDMOD_WDPROTECT;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+* @brief               Enable WWDT activity\r
+* @param[in]   None\r
+* @return              None\r
+ **********************************************************************/\r
+void WWDT_Start(void)\r
+{\r
+       LPC_WWDT->MOD |= WWDT_WDMOD_WDEN;\r
+       WWDT_Feed();\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Read WWDT status flag\r
+ * @param[in]  Status kind of status flag that you want to get, should be:\r
+ *                             - WWDT_WARNINT_FLAG: watchdog interrupt flag\r
+ *                             - WWDT_TIMEOUT_FLAG: watchdog time-out flag\r
+ * @return             Time out flag status of WDT\r
+ *********************************************************************/\r
+FlagStatus WWDT_GetStatus (uint8_t Status)\r
+{\r
+       if(Status == WWDT_WARNINT_FLAG)\r
+       {\r
+               return ((FlagStatus)(LPC_WWDT->MOD & (1<<3)));\r
+       }\r
+       else if (Status == WWDT_TIMEOUT_FLAG)\r
+       {\r
+               return ((FlagStatus)(LPC_WWDT->MOD & (1<<2)));\r
+       }\r
+       return (FlagStatus)RESET;\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Read WWDT status flag\r
+ * @param[in]  Status kind of status flag that you want to get, should be:\r
+ *                             - WWDT_WARNINT_FLAG: watchdog interrupt flag\r
+ *                             - WWDT_TIMEOUT_FLAG: watchdog time-out flag\r
+ * @return             Time out flag status of WDT\r
+ *********************************************************************/\r
+void WWDT_ClearStatusFlag (uint8_t flag)\r
+{\r
+       if(flag == WWDT_WARNINT_FLAG)\r
+       {\r
+               // Write 1 to this bit to clear itself\r
+               LPC_WWDT->MOD |= WWDT_WDMOD_WDINT;\r
+       }\r
+       else if(flag == WWDT_TIMEOUT_FLAG)\r
+       {\r
+               // Write 0 to this bit to clear itself\r
+               LPC_WWDT->MOD &= ~ WWDT_WDMOD_WDTOF;\r
+       }\r
+}\r
+\r
+/********************************************************************//**\r
+ * @brief              Get the current value of WDT\r
+ * @param[in]  None\r
+ * @return             current value of WDT\r
+ *********************************************************************/\r
+uint32_t WWDT_GetCurrentCount(void)\r
+{\r
+       return LPC_WWDT->TV;\r
+}\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+#endif /* _WWDT */\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/system_LPC18xx.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/src/system_LPC18xx.c
new file mode 100644 (file)
index 0000000..65d8574
--- /dev/null
@@ -0,0 +1,76 @@
+/*\r
+ * Modifications for use with Code Red's toolchain - 2011/11/24\r
+ */\r
+/**********************************************************************\r
+* $Id$         system_LPC18xx.c                        2011-06-02\r
+*//**\r
+* @file                system_LPC18xx.c\r
+* @brief       Cortex-M3 Device System Source File for NXP LPC18xx Series.\r
+* @version     1.0\r
+* @date                02. June. 2011\r
+* @author      NXP MCU SW Application Team\r
+*\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+*\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+#include "LPC18xx.h"\r
+#include "lpc18xx_cgu.h"\r
+/*----------------------------------------------------------------------------\r
+  Define clocks\r
+ *----------------------------------------------------------------------------*/\r
+#define __IRC            (12000000UL)    /* IRC Oscillator frequency          */\r
+\r
+/*----------------------------------------------------------------------------\r
+  Clock Variable definitions\r
+ *----------------------------------------------------------------------------*/\r
+uint32_t SystemCoreClock = __IRC * 10UL;               /*!< System Clock Frequency (Core Clock)*/\r
+\r
+#ifndef __CODE_RED\r
+extern uint32_t getPC(void);\r
+#endif\r
+\r
+/**\r
+ * Initialize the system\r
+ *\r
+ * @param  none\r
+ * @return none\r
+ *\r
+ * @brief  Setup the microcontroller system.\r
+ *         Initialize the System.\r
+ */\r
+void SystemInit (void)\r
+{\r
+#ifdef __CODE_RED\r
+    // CodeRed startup code will modify VTOR register to match\r
+    // when code has been linked to run from.\r
+\r
+    // Check whether we are running from external flash\r
+    if (SCB->VTOR == 0x1C000000)\r
+        /*Enable Buffer for External Flash*/\r
+        LPC_EMC->STATICCONFIG0 |= 1<<19;\r
+\r
+    // Call clock initialisation code\r
+    CGU_Init();\r
+\r
+#else\r
+       // Enable VTOR register to point to vector table\r
+       SCB->VTOR = getPC() & 0xFFF00000;\r
+    /*Enable Buffer for External Flash*/\r
+    LPC_EMC->STATICCONFIG0 |= 1<<19;\r
+\r
+#endif\r
+\r
+}\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/Readme Config.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/Readme Config.txt
new file mode 100644 (file)
index 0000000..8883a59
--- /dev/null
@@ -0,0 +1,22 @@
+FreeRTOS+Trace v2.3.0\r
+---------------------\r
+\r
+This directory contains the recorder files that the typical FreeRTOS+Trace user needs to be aware of.\r
+\r
+- trcPort.h - contains the hardware ports and the setting of what port to use.\r
+- trcConfig.h - contains the recorder configuration.\r
+\r
+The files in this directory are however not referenced by any of the demo projects. \r
+Copies of these files are instead found in each Demo project directory.\r
+\r
+These copies are included here to make the TraceRecorderSrc directory complete.\r
+\r
+If you use this template, you will need to update the following macro definitions in trcPort.h:\r
+- SELECTED_PORT\r
+- IRQ_PRIORITY_ORDER\r
+- vTraceConsoleMessage (optional, if console prints are desired)\r
+\r
+Always remember to check the settings used in trcConfig.h.\r
+\r
+Percepio AB\r
+www.percepio.com\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcConfig.h
new file mode 100644 (file)
index 0000000..1ffa3ef
--- /dev/null
@@ -0,0 +1,465 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcConfig.h\r
+ *\r
+ * Configuration parameters for the trace recorder library. Before using the \r
+ * trace recorder library, please check that the default settings are \r
+ * appropriate for your system, and if necessary adjust these. Most likely, you \r
+ * will need to adjust the NTask, NISR, NQueue, NMutex and NSemaphore values to \r
+ * reflect the number of such objects in your system. These may be \r
+ * overapproximated, although larger values values implies more RAM usage.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCCONFIG_H\r
+#define TRCCONFIG_H\r
+\r
+/*******************************************************************************\r
+ * CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the event buffer, i.e., the number of records\r
+ * it may store. Each registered event typically use one record (4 byte), but\r
+ * vTracePrintF may use multiple records depending on the number of data args.\r
+ ******************************************************************************/\r
+\r
+#define EVENT_BUFFER_SIZE 1000 /* Adjust wrt. to available RAM */\r
+\r
+\r
+/*******************************************************************************\r
+ * USE_LINKER_PRAGMA\r
+ *\r
+ * Macro which should be defined as an integer value, default is 0.\r
+ *\r
+ * If this is 1, the header file "recorderdata_linker_pragma.h" is included just\r
+ * before the declaration of RecorderData (in trcBase.c), i.e., the trace data \r
+ * structure. This allows the user to specify a pragma with linker options. \r
+ *\r
+ * Example (for IAR Embedded Workbench and NXP LPC17xx):\r
+ * #pragma location="AHB_RAM_MEMORY"\r
+ * \r
+ * This example instructs the IAR linker to place RecorderData in another RAM \r
+ * bank, the AHB RAM. This can also be used for other compilers with a similar\r
+ * pragmas for linker options.\r
+ * \r
+ * Note that this only applies if using static allocation, see below.\r
+ ******************************************************************************/\r
+\r
+#define USE_LINKER_PRAGMA 0\r
+\r
+\r
+/*******************************************************************************\r
+ * SYMBOL_TABLE_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the symbol table, in bytes. This symbol table \r
+ * stores User Events labels and names of deleted tasks, queues, or other kernel\r
+ * objects. Note that the names of active objects not stored here but in the \r
+ * Object Table. Thus, if you don't use User Events or delete any kernel \r
+ * objects you set this to zero (0) to minimize RAM usage.\r
+ ******************************************************************************/\r
+#define SYMBOL_TABLE_SIZE 1000\r
+\r
+/*******************************************************************************\r
+ * NTask, NISR, NQueue, NSemaphore, NMutex\r
+ *\r
+ * A group of Macros which should be defined as an integer value of zero (0) \r
+ * or larger.\r
+ *\r
+ * This defines the capacity of the Object Property Table - the maximum number\r
+ * of objects active at any given point within each object class.\r
+ * \r
+ * NOTE: In case objects are deleted and created during runtime, this setting\r
+ * does not limit the total amount of objects, only the number of concurrently\r
+ * active objects. \r
+ *\r
+ * Using too small values will give an error message through the vTraceError\r
+ * routine, which makes the error message appear when opening the trace data\r
+ * in FreeRTOS+Trace. If you are using the recorder status monitor task,\r
+ * any error messages are displayed in console prints, assuming that the\r
+ * print macro has been defined properly (vConsolePrintMessage). \r
+ *\r
+ * It can be wise to start with very large values for these constants, \r
+ * unless you are very confident on these numbers. Then do a recording and\r
+ * check the actual usage in FreeRTOS+Trace. This is shown by selecting\r
+ * View -> Trace Details -> Resource Usage -> Object Table\r
+ * \r
+ * NOTE 2: Remember to account for all tasks created by FreeRTOS, such as the \r
+ * IDLE task, the FreeRTOS timer task, and any tasks created by other 3rd party \r
+ * software components, such as communication stacks. The recorder also has an \r
+ * optional monitor task to account for, if this is used.\r
+ * Moreover, one task slot is used to indicate "(startup)", i.e., a fictive \r
+ * task that represent the time before the FreeRTOS scheduler starts. \r
+ * NTask should thus be at least 2-3 slots larger than your application task count.\r
+ *\r
+ * NOTE 3: The FreeRTOS timer task creates a Queue, that should be accounted \r
+ * for in NQueue.\r
+ ******************************************************************************/\r
+#define NTask             15\r
+#define NISR              4\r
+#define NQueue            3\r
+#define NSemaphore        4\r
+#define NMutex            2\r
+\r
+/* Maximum object name length for each class (includes zero termination) */\r
+#define NameLenTask       configMAX_TASK_NAME_LEN\r
+#define NameLenISR        10\r
+#define NameLenQueue      15\r
+#define NameLenSemaphore  15\r
+#define NameLenMutex      15\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION\r
+ *\r
+ * Macro which should be defined as a string.\r
+ *\r
+ * This string is stored in the trace and displayed in FreeRTOS+Trace. Can be\r
+ * used to store, e.g., system version or build date. This is also used to store\r
+ * internal error messages from the recorder, which if occurs overwrites the\r
+ * value defined here. This may be maximum 256 chars.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION "FreeRTOS+Trace Demo"\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION_MAX_LENGTH\r
+ *\r
+ * The maximum length (including zero termination) for the TRACE_DESCRIPTION\r
+ * string. Since this string also is used for internal error messages from the \r
+ * recorder do not make it too short, as this may truncate the error messages.\r
+ * Default is 80. \r
+ * Maximum allowed length is 256 - the trace will fail to load if longer.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION_MAX_LENGTH 80\r
+\r
+\r
+/******************************************************************************\r
+ * TRACE_DATA_ALLOCATION\r
+ *\r
+ * This defines how to allocate the recorder data structure, i.e., using a \r
+ * static declaration or using a dynamic allocation in runtime (malloc).\r
+ *\r
+ * Should be one of these two options:\r
+ * - TRACE_DATA_ALLOCATION_STATIC (default)\r
+ * - TRACE_DATA_ALLOCATION_DYNAMIC\r
+ *\r
+ * Using static allocation has the benefits of compile-time errors if the buffer \r
+ * is too large (too large constants in trcConfig.h) and no need to call the \r
+ * initialization routine (xTraceInitTraceData).\r
+ *\r
+ * Using dynamic allocation may give more flexibility in some cases.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_DATA_ALLOCATION TRACE_DATA_ALLOCATION_STATIC\r
+\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION REGARDING WHAT CODE/FEATURES TO INCLUDE\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * INCLUDE_FLOAT_SUPPORT\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), all references to floating point values are removed,\r
+ * in case floating point values are not supported by the platform used.\r
+ * Floating point values are only used in vTracePrintF and its subroutines, to \r
+ * store float (%f) or double (%lf) argments. \r
+ *\r
+ * Note: vTracePrintF can still be used with integer and string arguments in\r
+ * either case.\r
+ *****************************************************************************/\r
+#define INCLUDE_FLOAT_SUPPORT 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_USER_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0) the code for creating User Events is excluded to\r
+ * reduce code size. User Events are application-generated events, like \r
+ * "printf" but for the trace log instead of console output. User Events are \r
+ * much faster than a printf and can therefore be used in timing critical code.\r
+ * See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
+ * \r
+ * Note that FreeRTOS+Trace Standard Edition or Professional Edition is required\r
+ * for User Events, they are not displayed in FreeRTOS+Trace Free Edition.\r
+ *****************************************************************************/\r
+#define INCLUDE_USER_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_READY_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Ready events is \r
+ * excluded. Note, this will make it impossible to calculate the correct\r
+ * response times.\r
+ *****************************************************************************/\r
+#define INCLUDE_READY_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_ISR_TRACING\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Interrupt Service Routines is \r
+ * excluded to reduce code size. Note, recording ISRs require that you insert\r
+ * calls to vTraceStoreISRBegin and vTraceStoreISREnd in your interrupt handlers.\r
+ * There is no automatic recording of ISRs like for task scheduling, since \r
+ * FreeRTOS does not have a central interrupt dispatcher.\r
+ *****************************************************************************/\r
+#define INCLUDE_ISR_TRACING 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_OBJECT_DELETE\r
+ * \r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * This must be enabled (1) if tasks, queues or other \r
+ * traced kernel objects are deleted at runtime, e.g., using vTaskDelete or \r
+ * vQueueDelete. If no deletes are made, this can be set to 0 in order to\r
+ * exclude the delete-handling code. \r
+ *****************************************************************************/\r
+#define INCLUDE_OBJECT_DELETE 1\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION RELATED TO BEHAVIOR\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * RECORDER_STORE_MODE\r
+ *\r
+ * Macro which should be defined as one of:\r
+ * - STORE_MODE_RING_BUFFER\r
+ * - STORE_MODE_STOP_WHEN_FULL\r
+ * Default is STORE_MODE_RING_BUFFER.\r
+ *\r
+ * With RECORDER_STORE_MODE set to STORE_MODE_RING_BUFFER, the events are stored\r
+ * in a ring buffer, i.e., where the oldest events are overwritten when the\r
+ * buffer becomes full. This allows you to get the last events leading up to an\r
+ * interesting state, e.g., an error, without having a large trace buffer for\r
+ * string the whole run since startup. In this mode, the recorder can run\r
+ * "forever" as the buffer never gets full, i.e., in the sense that it always\r
+ * has room for more events.\r
+ *\r
+ * To fetch the trace in mode STORE_MODE_RING_BUFFER, you need to first halt the\r
+ * system using your debugger and then do a RAM dump, or to explicitly stop the\r
+ * recorder using vTraceStop() and then store/upload the trace data using a\r
+ * FreeRTOS task that you need to provide yourself. The trace data is found in\r
+ * the struct RecorderData, initialized in trcBase.c.\r
+ *\r
+ * Note that, if you upload the trace using a RAM dump, i.e., when the system is \r
+ * halted on a breakpoint or by a debugger command, there is no need to stop the \r
+ * recorder first.\r
+ *\r
+ * When RECORDER_STORE_MODE is STORE_MODE_STOP_WHEN_FULL, the recording is\r
+ * stopped when the buffer becomes full. When the recorder stops itself this way\r
+ * vTracePortEnd() is called which allows for custom actions, such as triggering\r
+ * a task that stores the trace buffer, i.e., in case taking a RAM dump\r
+ * using an on-chip debugger is not possible. In the Windows port, vTracePortEnd\r
+ * saves the trace to file directly, but this is not recommended in a real-time\r
+ * system since the scheduler is blocked during the processing of vTracePortEnd.\r
+ *****************************************************************************/\r
+#ifndef WIN32\r
+#define RECORDER_STORE_MODE STORE_MODE_RING_BUFFER\r
+#else\r
+/* Default in the Win32 demo */\r
+#define RECORDER_STORE_MODE STORE_MODE_STOP_WHEN_FULL\r
+#endif\r
+\r
+/******************************************************************************\r
+ * STOP_AFTER_N_EVENTS\r
+ *\r
+ * Macro which should be defined as an integer value, or not defined.\r
+ * Default is -1\r
+ *\r
+ * STOP_AFTER_N_EVENTS is intended for tests of the ring buffer mode (when\r
+ * RECORDER_STORE_MODE is STORE_MODE_RING_BUFFER). It stops the recording when\r
+ * the specified number of events has been observed. This value can be larger\r
+ * than the buffer size, to allow for test of the "wrapping around" that occurs\r
+ * in ring buffer mode . A negative value (or no definition of this macro)\r
+ * disables this feature.\r
+ *****************************************************************************/\r
+#define STOP_AFTER_N_EVENTS -1\r
+\r
+/******************************************************************************\r
+ * USE_IMPLICIT_IFE_RULES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * ### Instance Finish Events (IFE) ###\r
+ *\r
+ * For tasks with "infinite" main loops (non-terminating tasks), the concept\r
+ * of a task instance has no clear definition, it is an application-specific\r
+ * thing. FreeRTOS+Trace allows you to define Instance Finish Events (IFEs),\r
+ * which marks the point in a cyclic task when the "task instance" ends.\r
+ * The IFE is a blocking kernel call, typically in the main loop of a task\r
+ * which typically reads a message queue, waits for a semaphore or performs\r
+ * an explicit delay.\r
+ *\r
+ * If USE_IMPLICIT_IFE_RULES is one (1), the following FreeRTOS kernel calls\r
+ * are considered by default to be IFEs (Implicit IFEs):\r
+ *  - vTaskDelay\r
+ *  - vTaskDelayUntil\r
+ *  - vTaskSuspend\r
+ *  - xQueueReceive (blocking cases only)\r
+ *  - xSemaphoreTake (blocking cases only)\r
+ *\r
+ * However, Implicit IFEs only applies to blocking kernel calls. If an\r
+ * xQueueReceive reads a message without blocking, it does not create a new\r
+ * instance since no blocking occurred.\r
+ *\r
+ * Moreover, the actual IFE might sometimes be another blocking call such as\r
+ * xQueueSend or xSemaphoreGive. We therefore allow for user-defined\r
+ * Explicit IFEs by calling\r
+ *\r
+ *     vTraceTaskInstanceIsFinished()\r
+ *\r
+ * right before the kernel call considered as IFE. This does not create an\r
+ * additional event but instead stores the service code and object handle\r
+ * of the IFE call as properties of the task.\r
+ *\r
+ * If using Explicit IFEs and the task also calls an Implicit IFE like\r
+ * vTaskDelay, this may result in additional incorrect task instances.\r
+ * This is solved by disabling the Implicit IFEs for the task, by adding\r
+ * a call to\r
+ * \r
+ *     vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+ * \r
+ * in the very beginning of that task. This allows you to combine Explicit IFEs\r
+ * for some tasks with Implicit IFEs for the rest of the tasks, if\r
+ * USE_IMPLICIT_IFE_RULES is 1.\r
+ *\r
+ * By setting USE_IMPLICIT_IFE_RULES to zero (0), the implicit IFEs are disabled\r
+ * for all tasks. Tasks will then be considered to have a single instance only, \r
+ * covering all execution fragments, unless you define an explicit IFE in each\r
+ * task by calling vTraceTaskInstanceIsFinished before the blocking call.\r
+ *****************************************************************************/\r
+#define USE_IMPLICIT_IFE_RULES 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_SAVE_TO_FILE\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If enabled (1), the recorder will include code for saving the trace\r
+ * to a local file system.\r
+ ******************************************************************************/\r
+#ifdef WIN32\r
+    #define INCLUDE_SAVE_TO_FILE 1\r
+#else\r
+    #define INCLUDE_SAVE_TO_FILE 0\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PRIORITY\r
+ *\r
+ * Macro which sets the priority of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is tskIDLE_PRIORITY + 1\r
+ * Note that if your system constantly has a high CPU load from high-priority \r
+ * tasks, this might not be get a chance to execute.\r
+ * \r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_PRIORITY (tskIDLE_PRIORITY + 1)\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_STACKSIZE\r
+ *\r
+ * Macro which sets the stack size of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is intentionally \r
+ * excluded from the demo trace.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_STACKSIZE 500\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PERIOD\r
+ *\r
+ * Macro which sets the period of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is 1000 FreeRTOS ticks (typically 1 second). On the Windows port, a \r
+ * lower value is suggested since the Windows port runs very slowly, often 20-40\r
+ * times slower than the simulated FreeRTOS time.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#ifdef WIN32\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 100\r
+#else\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TEAM_LICENSE_CODE\r
+ *\r
+ * Macro which defines a string - the team license code.\r
+ * If no team license is available, this should be an empty string "".\r
+ * This should be maximum 32 chars, including zero-termination.\r
+ *****************************************************************************/\r
+#define TEAM_LICENSE_CODE ""\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcPort.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Configuration - template/trcPort.h
new file mode 100644 (file)
index 0000000..a2d4bf1
--- /dev/null
@@ -0,0 +1,490 @@
+/******************************************************************************* \r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.h\r
+ *\r
+ * Contains together with trcPort.c all portability issues of the trace recorder \r
+ * library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCPORT_H\r
+#define TRCPORT_H\r
+\r
+/* If FreeRTOS Win32 port */\r
+#ifdef WIN32\r
+\r
+   #undef _WIN32_WINNT\r
+   #define _WIN32_WINNT 0x0600\r
+\r
+   /* Standard includes. */\r
+   #include <stdio.h>\r
+   #include <windows.h>\r
+   #include <direct.h>\r
+\r
+/*******************************************************************************\r
+ * The Win32 port by default saves the trace to file and then kills the\r
+ * program when the recorder is stopped, to facilitate quick, simple tests\r
+ * of the recorder.\r
+ ******************************************************************************/\r
+   #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
+   #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
+\r
+#endif\r
+\r
+#define DIRECTION_INCREMENTING 1\r
+#define DIRECTION_DECREMENTING 2\r
+\r
+/******************************************************************************\r
+ * Supported ports\r
+ * \r
+ * PORT_HWIndependent\r
+ * A hardware independent fallback option for event timestamping. Provides low \r
+ * resolution timestamps based on the OS tick.\r
+ * This may be used on the Win32 port, but may also be used on embedded hardware \r
+ * platforms. Note that this gives suboptimal display in FreeRTOS+Trace. All \r
+ * time durations will be truncated to the OS tick frequency, typically 1 KHz. \r
+ * This means that a task or ISR that executes in less than 1 ms get an exection \r
+ * time of zero. They are however still visible in FreeRTOS+Trace. \r
+ *\r
+ * PORT_Win32\r
+ * "Accurate" timestamping based on the Windows permance counter. Note that\r
+ * this gives the host machine time, not the simulated FreeRTOS time (tick \r
+ * count). The timing of the Win32 FreeRTOS build is not real-time, since it \r
+ * depends on the scheduling and tick rate of Windows, which is very slow.\r
+ *\r
+ * Officially supported hardware timer ports:\r
+ * - PORT_Atmel_AT91SAM7\r
+ * - PORT_Atmel_UC3A0\r
+ * - PORT_ARM_CortexM \r
+ * - PORT_Renesas_RX600\r
+ * - PORT_Microchip_dsPIC_AND_PIC24\r
+ *\r
+ * We also provide several "unofficial" hardware-specific ports. There have \r
+ * been developed by external contributors, and have not yet been verified \r
+ * by Percepio AB. Let us know if you have problems getting these to work.\r
+ * \r
+ * Unoffical hardware specific ports provided are:\r
+ * - PORT_TEXAS_INSTRUMENTS_TMS570\r
+ * - PORT_TEXAS_INSTRUMENTS_MSP430\r
+ * - PORT_MICROCHIP_PIC32\r
+ * - PORT_XILINX_PPC405\r
+ * - PORT_XILINX_PPC440\r
+ * - PORT_XILINX_MICROBLAZE\r
+ * - PORT_NXP_LPC210X\r
+ *\r
+ *****************************************************************************/\r
+\r
+#define PORT_NOT_SET                          -1\r
+\r
+/*** Officially supported hardware timer ports *******************************/\r
+#define PORT_HWIndependent                     0\r
+#define PORT_Win32                             1\r
+#define PORT_Atmel_AT91SAM7                    2\r
+#define PORT_Atmel_UC3A0                       3\r
+#define PORT_ARM_CortexM                       4\r
+#define PORT_Renesas_RX600                     5\r
+#define PORT_Microchip_dsPIC_AND_PIC24         6\r
+\r
+/*** Unofficial ports, provided by external developers, not yet verified *****/\r
+#define PORT_TEXAS_INSTRUMENTS_TMS570          7\r
+#define PORT_TEXAS_INSTRUMENTS_MSP430          8\r
+#define PORT_MICROCHIP_PIC32                   9\r
+#define PORT_XILINX_PPC405                    10\r
+#define PORT_XILINX_PPC440                    11\r
+#define PORT_XILINX_MICROBLAZE                12\r
+#define PORT_NXP_LPC210X                      13\r
+\r
+/*** Select your port here! **************************************************/\r
+#define SELECTED_PORT PORT_NOT_SET\r
+/*****************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET) \r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * IRQ_PRIORITY_ORDER\r
+ *\r
+ * Macro which should be defined as an integer of 0 or 1.\r
+ *\r
+ * This should be 0 if lower irq priority values implies higher priority \r
+ * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+ * if higher irq priority values means higher priority, this should be 1.\r
+ *\r
+ * This setting is not critical. It is used only to sort and colorize the \r
+ * interrupts in priority order, in case you record interrupts using\r
+ * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
+ *\r
+ * We provide this setting for some hardware architectures below:\r
+ * - ARM Cortex M:       0 (lower irq priority values are more significant)\r
+ * - Atmel AT91SAM7x:    1 (higher irq priority values are more significant)\r
+ * - Atmel AVR32:        1 (higher irq priority values are more significant)\r
+ * - Renesas RX600:      1 (higher irq priority values are more significant)\r
+ * - Microchip PIC24:    0 (lower irq priority values are more significant)\r
+ * - Microchip dsPIC:    0 (lower irq priority values are more significant)\r
+ * - TI TMS570:          0 (lower irq priority values are more significant)\r
+ * - Freescale HCS08:    0 (lower irq priority values are more significant)\r
+ * - Freescale HCS12:    0 (lower irq priority values are more significant)\r
+ * - PowerPC 405:        0 (lower irq priority values are more significant)\r
+ * - PowerPC 440:        0 (lower irq priority values are more significant)\r
+ * - Freescale ColdFire: 1 (higher irq priority values are more significant)\r
+ * - NXP LPC210x:        0 (lower irq priority values are more significant)\r
+ * - MicroBlaze:        0  (lower irq priority values are more significant)\r
+ *\r
+ * If your chip is not on the above list, and you perhaps know this detail by \r
+ * heart, please inform us by e-mail to support@percepio.com.\r
+ *\r
+ ******************************************************************************\r
+ *\r
+ * HWTC Macros \r
+ *\r
+ * These four HWTC macros provides a hardware isolation layer representing a \r
+ * generic hardware timer/counter used for driving the operating system tick, \r
+ * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
+ * AT91SAM7X.\r
+ *\r
+ * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
+ * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
+ * already wrapped.\r
+ *\r
+ * HWTC_COUNT_DIRECTION: Should be one of:\r
+ * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
+ *   such as the PIT on Atmel AT91SAM7X.\r
+ *   When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
+ *   interrupt is signaled.\r
+ * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
+ *   such as the SysTick on ARM Cortex M3/M4 chips.\r
+ *   When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
+ *   interrupt is signaled.\r
+ *\r
+ * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
+ * two tick interrupts. This should preferably be mapped to the reload\r
+ * register of the hardware timer, to make it more portable between chips in the \r
+ * same family. The macro should in most cases be (reload register + 1).\r
+ *\r
+ * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
+ * (where the SysTick runs at the core clock frequency), the "differential \r
+ * timestamping" used in the recorder will more frequently insert extra XTS \r
+ * events to store the timestamps, which increases the event buffer usage. \r
+ * In such cases, to reduce the number of XTS events and thereby get longer \r
+ * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
+ * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
+ * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
+ * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
+ * faster chip require a higher HWTC_DIVISOR value. \r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * FREE LICENSE OFFER FROM PERCEPIO\r
+ *\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students,\r
+ * hobbyists or early-phase startups) we have the following offer: \r
+ * Provide a hardware port for our FreeRTOS recorder and get a FREE single-user\r
+ * license for FreeRTOS+Trace Professional Edition. Read more about this offer\r
+ * at www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_Win32)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
+    #define HWTC_PERIOD 0\r
+    #define HWTC_DIVISOR 1\r
+    \r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_HWIndependent)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT 0\r
+    #define HWTC_PERIOD 1\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+\r
+    /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
+    A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
+    #define HWTC_PERIOD 2995 \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
+  \r
+    /* For Atmel AVR32 (AT32UC3A) */\r
+  \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+    /* For all chips using ARM Cortex M cores */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
+    #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
+    #define HWTC_DIVISOR 2\r
+    \r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Renesas_RX600)    \r
+\r
+    #include "iodefine.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (CMT0.CMCNT)\r
+    #define HWTC_PERIOD ((((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/8))\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_dsPIC_AND_PIC24) \r
+\r
+    /* For Microchip PIC24 and dsPIC (16 bit) */\r
+\r
+    /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
+       than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 Âµs. \r
+       In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
+       becomes a problem on PIC24, use the filters to exclude less interresting tasks \r
+       or system calls. */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TMR1)\r
+    #define HWTC_PERIOD (PR1+1)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+    \r
+    /* Tested with LPC2106, but should work with most LPC21XX chips.\r
+       Assumption: prescaler is 1:1 (this setting is hardcoded in \r
+       FreeRTOS port for LPC21XX) */\r
+      \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT  *((uint32_t *)0xE0004008 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) \r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
+    #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
+    #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
+    #define HWTC_PERIOD (RTIUDCP0)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TA0R)\r
+    #define HWTC_PERIOD configCPU_CLOCKS_PER_TICK      \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ReadTimer1())     /* Should be available in BSP */\r
+    #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x3db)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most PowerPC chips */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x016 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+    \r
+#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most Microblaze configurations\r
+     * This port is based on the official FreeRTOS Microlaze port and example application.\r
+     * It uses the AXI Timer 0 - the tick interrupt source.\r
+     * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
+     */\r
+    #include "xtmrctr_l.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 16\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT != PORT_NOT_SET)\r
+\r
+    #error "SELECTED_PORT had unsupported value!"\r
+    #define SELECTED_PORT PORT_NOT_SET\r
+\r
+#endif\r
+\r
+#if (SELECTED_PORT != PORT_NOT_SET)\r
+    \r
+    #ifndef HWTC_COUNT_DIRECTION\r
+    #error "HWTC_COUNT_DIRECTION is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_COUNT\r
+    #error "HWTC_COUNT is not set!"    \r
+    #endif \r
+    \r
+    #ifndef HWTC_PERIOD\r
+    #error "HWTC_PERIOD is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_DIVISOR\r
+    #error "HWTC_DIVISOR is not set!"    \r
+    #endif \r
+    \r
+    #ifndef IRQ_PRIORITY_ORDER\r
+    #error "IRQ_PRIORITY_ORDER is not set!"\r
+    #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
+    #error "IRQ_PRIORITY_ORDER has bad value!"\r
+    #endif \r
+    \r
+    #if (HWTC_DIVISOR < 1)\r
+    #error "HWTC_DIVISOR must be a non-zero positive value!"\r
+    #endif \r
+\r
+#endif\r
+/*******************************************************************************\r
+ * vTraceConsoleMessage\r
+ *\r
+ * A wrapper for your system-specific console "printf" console output function.\r
+ * This needs to be correctly defined to see status reports from the trace \r
+ * status monitor task (this is defined in trcUser.c).\r
+ ******************************************************************************/         \r
+#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+/* Port specific includes */\r
+#include "console.h"\r
+#endif\r
+\r
+#define vTraceConsoleMessage(x)\r
+\r
+/*******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, \r
+ * students, hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called when the recorder is stopped due to full buffer.\r
+ * Mainly intended to show a message in the console.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetFileName.\r
+ ******************************************************************************/\r
+void vTracePortEnd(void);\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path);\r
+\r
+/******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a target-side file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port may call\r
+ * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
+ ******************************************************************************/\r
+void vTracePortSave(void);\r
+\r
+#endif\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcBase.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcBase.h
new file mode 100644 (file)
index 0000000..4ffd55c
--- /dev/null
@@ -0,0 +1,524 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcBase.h\r
+ *\r
+ * Core functionallity of the FreeRTOS+Trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ * \r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCBASE_H\r
+#define TRCBASE_H\r
+\r
+#include <stdio.h>\r
+#include <string.h>\r
+\r
+#include "FreeRTOS.h"\r
+#include "trcConfig.h"\r
+#include "trcTypes.h"\r
+#include "trcPort.h"\r
+\r
+extern volatile int recorder_busy;\r
+\r
+#define trcCRITICAL_SECTION_BEGIN() {taskENTER_CRITICAL(); recorder_busy++;}\r
+#define trcCRITICAL_SECTION_END() {recorder_busy--; taskEXIT_CRITICAL();}\r
+\r
+#define NCLASSES 5\r
+#define VERSION 0x1AA1\r
+#define MINOR_VERSION 1\r
+#define STORE_MODE_STOP_WHEN_FULL 1\r
+#define STORE_MODE_RING_BUFFER 2\r
+#define TRACE_DATA_ALLOCATION_STATIC 1\r
+#define TRACE_DATA_ALLOCATION_DYNAMIC 2\r
+\r
+/******************************************************************************\r
+ * Object Property Table\r
+ * The Object Table contains name and other properties of the objects (tasks,\r
+ * queues, mutexes, etc). The below data structures defines the properties of\r
+ * each object class and are used to cast the byte buffer into a cleaner format.\r
+ *\r
+ * The values in the object table are continously overwritten and always \r
+ * represent the current state. If a property is changed during runtime, the OLD \r
+ * value should be stored in the trace buffer, not the new value (since the new \r
+ * value is found in the Object Property Table).\r
+ * For close events this mechanism is the old names are stored in the symbol\r
+ * table), for "priority set" (the old priority is stored in the event data)\r
+ * and for "isActive", where the value decides is the taskswitch event type\r
+ * should be "new" or "resume".\r
+ ******************************************************************************/\r
+\r
+/* The size of the Object Property Table entries, in bytes, per object */\r
+\r
+/* Queue properties (except name):     current number of message in queue */\r
+#define PropertyTableSizeQueue         (NameLenQueue + 1)      \r
+\r
+/* Semaphore properties (except name): state (signaled = 1, cleared = 0) */\r
+#define PropertyTableSizeSemaphore     (NameLenSemaphore + 1) \r
+\r
+/* Mutex properties (except name):     owner (task handle, 0 = free) */\r
+#define PropertyTableSizeMutex         (NameLenMutex + 1)         \r
+\r
+/* Task properties (except name):      Byte 0: Current priority\r
+                                       Byte 1: state (if already active) \r
+                                       Byte 2: InstanceFinishEvent_ServiceCode\r
+                                       Byte 3: InstanceFinishEvent_ObjHandle */\r
+#define PropertyTableSizeTask         (NameLenTask + 4)\r
+\r
+/* ISR properties:                     Byte 0: priority\r
+                                       Byte 1: state (if already active) */\r
+#define PropertyTableSizeISR          (NameLenISR + 2)\r
+\r
+/* The layout of the byte array representing the Object Property Table */\r
+#define StartIndexQueue            0\r
+#define StartIndexSemaphore        StartIndexQueue     + NQueue * PropertyTableSizeQueue\r
+#define StartIndexMutex            StartIndexSemaphore + NSemaphore * PropertyTableSizeSemaphore\r
+#define StartIndexTask             StartIndexMutex     + NMutex * PropertyTableSizeMutex\r
+#define StartIndexISR              StartIndexTask      + NTask * PropertyTableSizeTask\r
+#define DynObjTableSize            StartIndexISR       + NISR * PropertyTableSizeISR\r
+\r
+typedef struct\r
+{\r
+    /* = NCLASSES */\r
+    uint32_t NumberOfObjectClasses;\r
+    \r
+    uint32_t ObjectPropertyTableSizeInBytes;\r
+        \r
+    /* This is used to calculate the index in the dynamic object table \r
+    (handle - 1 - nofStaticObjects = index)*/\r
+    uint8_t NumberOfObjectsPerClass[ 4*((NCLASSES+3)/4)];      \r
+\r
+    /* Allocation size rounded up to the closest multiple of 4 */    \r
+    uint8_t NameLengthPerClass[ 4*((NCLASSES+3)/4) ];\r
+    \r
+    uint8_t TotalPropertyBytesPerClass[ 4*((NCLASSES+3)/4) ];\r
+    \r
+    /* Allocation size rounded up to the closest multiple of 2 */\r
+    uint16_t StartIndexOfClass[ 2*((NCLASSES+1)/2) ];\r
+\r
+    /* The actual handles issued, should be Initiated to all zeros */     \r
+    uint8_t objbytes[ 4*((DynObjTableSize+3)/4) ];\r
+} ObjectPropertyTableType;\r
+\r
+/* Symbol table data structure */\r
+typedef struct\r
+{\r
+    /* = SYMBOL_HISTORY_TABLE_SIZE_IN_BYTES */\r
+    uint32_t symTableSize;                       \r
+        \r
+    /* Entry 0 is reserved. Any reference to entry 0 implies NULL*/\r
+    uint32_t nextFreeSymbolIndex;         \r
+        \r
+    /* Size rounded up to closest multiple of 4, to avoid alignment issues*/\r
+    uint8_t symbytes[4*((SYMBOL_TABLE_SIZE+3)/4)];           \r
+        \r
+    /* Used for lookups - Up to 64 linked lists within the symbol table \r
+    connecting all entries with the same 6 bit checksum. \r
+    This field holds the current list heads. Should be initiated to zeros */\r
+    uint16_t latestEntryOfChecksum[64];              \r
+} symbolTableType;\r
+\r
+\r
+/*******************************************************************************\r
+ * The data structures of the different events, all 4 bytes long \r
+ ******************************************************************************/\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;                \r
+    objectHandleType objHandle;\r
+    uint16_t dts;    /* differential timestamp - time since last event */            \r
+} TSEvent, TREvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t objHandle;\r
+    uint16_t dts;\r
+} KernelCall;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    objectHandleType objHandle;\r
+    uint8_t param;\r
+    uint8_t dts;                \r
+} KernelCallWithParamAndHandle;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t dts;                \r
+    uint16_t param;\r
+} KernelCallWithParam16;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    objectHandleType objHandle;    /* the handle of the closed object */\r
+    uint16_t symbolIndex;          /* the name of the closed object */\r
+} ObjCloseNameEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t arg1;            \r
+    uint8_t arg2;        \r
+    uint8_t arg3;        \r
+} ObjClosePropEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t dts;                \r
+    uint16_t payload;         /* the name of the user event */\r
+} UserEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;            \r
+    \r
+    /* 8 bits extra for storing DTS, if it does not fit in ordinary event \r
+    (this one is always MSB if used) */\r
+    uint8_t xts_8;            \r
+    \r
+    /* 16 bits extra for storing DTS, if it does not fit in ordinary event. */\r
+    uint16_t xts_16;          \r
+} XTSEvent;\r
+\r
+\r
+/*******************************************************************************\r
+ * The main datastructure, read by FreeRTOS+Trace from the RAM dump\r
+ ******************************************************************************/\r
+\r
+typedef struct\r
+{    \r
+    uint8_t startmarker0;\r
+    uint8_t startmarker1;\r
+    uint8_t startmarker2;\r
+    uint8_t startmarker3;\r
+    uint8_t startmarker4;\r
+    uint8_t startmarker5;\r
+    uint8_t startmarker6;\r
+    uint8_t startmarker7;\r
+    uint8_t startmarker8;\r
+    uint8_t startmarker9;\r
+    uint8_t startmarker10;\r
+    uint8_t startmarker11;\r
+\r
+    /* For FreeRTOS: 0x1AA1 */\r
+    uint16_t version;     \r
+    \r
+    /* Currently 1 for v2.2.2 (0 earlier)*/\r
+    uint8_t minor_version;\r
+    \r
+    /* This should be 0 if lower irq priority values implies higher priority \r
+    levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+    if higher irq priority values means higher priority, this should be 1. */ \r
+    uint8_t irq_priority_order;\r
+            \r
+    /* sizeof(RecorderDataType) - just for control */\r
+    uint32_t filesize;\r
+            \r
+    /* Current number of events recorded */\r
+    uint32_t numEvents;\r
+\r
+    /* The buffer size, in number of event records */\r
+    uint32_t maxEvents;\r
+        \r
+    /* The event buffer index, where to write the next event */\r
+    uint32_t nextFreeIndex;\r
+        \r
+    /* 1 if the buffer is full, 0 otherwise */\r
+    uint32_t bufferIsFull;\r
+\r
+    /* The frequency of the clock/timer/counter used as time base */\r
+    uint32_t frequency;\r
+\r
+    /* The absolute timestamp of the last stored event, in the native \r
+    timebase, modulo frequency! */\r
+    uint32_t absTimeLastEvent;    \r
+    \r
+    /* The number of seconds in total - lasts for 136 years */\r
+    uint32_t absTimeLastEventSecond;    \r
+    \r
+    /* 1 if the recorder has been started, 0 if not yet started or stopped.\r
+    This is a 32 bit variable due to alignment issues. */\r
+    uint32_t recorderActive;      \r
+\r
+    /* For storing a Team License key */\r
+    uint8_t teamLicenceKey[32];\r
+\r
+    /* 0xF0F0F0F0 - for control only */\r
+    int32_t debugMarker0;                    \r
+\r
+    /* The Object Property Table holds information about currently active\r
+    tasks, queues, and other recorded objects. This is updated on each\r
+    create call and includes object name and other properties. */\r
+    ObjectPropertyTableType ObjectPropertyTable;\r
+\r
+    /* 0xF1F1F1F1 - for control only */ \r
+    int32_t debugMarker1;                    \r
+\r
+    /* The Symbol Table stores strings for User Events and is also used to \r
+    store names of deleted objects, which still may be in the trace but no \r
+    longer are available. */        \r
+    symbolTableType SymbolTable;\r
+\r
+    /* For includsion of float support, and for endian detection of floats. \r
+    The value should be (float)1 or (uint32_t)0 */    \r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    float exampleFloatEncoding;              \r
+#else\r
+    uint32_t exampleFloatEncoding;              \r
+#endif\r
+    /* This is non-zero if an internal error occured in the recorder, e.g., if\r
+    one of the Nxxx constants was too small. The systemInfo string will then \r
+    contain an error message that is displayed when attempting to view the \r
+    trace file. */\r
+    uint32_t internalErrorOccured;\r
+    \r
+    /* 0xF2F2F2F2 - for control only */ \r
+    int32_t debugMarker2;                    \r
+      \r
+    /* Generic system information string, presented in the tool. Note that this \r
+    is also used for storing any internal error messages from the recorder, so\r
+    do not make TRACE_DESCRIPTION_MAX_LENGTH too small. 80 is recommended. */\r
+    char systemInfo[TRACE_DESCRIPTION_MAX_LENGTH];                   \r
+\r
+    /* 0xF3F3F3F3 - for control only */\r
+    int32_t debugMarker3;                    \r
+\r
+    /* The event data, in 4-byte records */\r
+    uint8_t eventData[ EVENT_BUFFER_SIZE * 4 ];\r
+\r
+    uint8_t endmarker0;\r
+    uint8_t endmarker1;\r
+    uint8_t endmarker2;\r
+    uint8_t endmarker3;\r
+    uint8_t endmarker4;\r
+    uint8_t endmarker5;\r
+    uint8_t endmarker6;\r
+    uint8_t endmarker7;\r
+    uint8_t endmarker8;\r
+    uint8_t endmarker9;\r
+    uint8_t endmarker10;\r
+    uint8_t endmarker11;\r
+\r
+} RecorderDataType;\r
+\r
+extern RecorderDataType* RecorderDataPtr;\r
+\r
+/******************************************************************************\r
+ * ObjectHandleStack\r
+ * This data-structure is used to provide a mechanism for 1-byte trace object\r
+ * handles. This way, only 1 byte is necessary instead of 4 bytes (a pointer)\r
+ * when storing a reference to an object. This allows for up to 255 objects of\r
+ * each object class - Task, ISR, Semaphore, CountingSemaphore, Mutex and Queue,\r
+ * active at any given moment. There can be more "historic" objects, that have\r
+ * been deleted - that number is only limited by the size of the symbol table.\r
+ * Note that handle zero (0) is not used, it is a code for an invalid handle.\r
+ *\r
+ * This data structure keeps track of the FREE handles, not the handles in use.\r
+ * This datastructure contains one stack per object class. When a handle is\r
+ * allocated to an object, the next free handle is popped from the stack. When\r
+ * a handle is released (on object delete), it is pushed back on the stack.\r
+ * Note that there is no initialization code that pushed the free handles\r
+ * initially, that is not necessary due to the following optimization:\r
+ *\r
+ * The stack of handles (objectHandles) is initially all zeros. Since zero\r
+ * is not a valid handle, that is a signal of additional handles needed.\r
+ * If a zero is received when popping a new handle, it is replaced by the\r
+ * index of the popped handle instead.\r
+ *\r
+ *****************************************************************************/\r
+typedef struct\r
+{\r
+    /* For each object class, the index of the next handle to allocate */\r
+    int16_t indexOfNextAvailableHandle[ NCLASSES ];              \r
+\r
+    /* The lowest index of this class (constant) */        \r
+    int16_t lowestIndexOfClass[ NCLASSES ];                    \r
+        \r
+    /* The highest index of this class (constant) */\r
+    int16_t highestIndexOfClass[ NCLASSES ];    \r
+        \r
+    /* The highest use count for this class (for statistics) */\r
+    int16_t handleCountWaterMarksOfClass[ NCLASSES ];                \r
+        \r
+    /* The free object handles - a set of stacks within this array */\r
+    objectHandleType objectHandles[ NTask+NISR+NSemaphore+NMutex+NQueue ];\r
+\r
+} objectHandleStackType;\r
+\r
+/* Internal data */\r
+\r
+extern objectHandleStackType objectHandleStacks;\r
+\r
+/* Structures to handle the exclude flags for all objects, tasks and event codes */\r
+#define NEventCodes 0x100\r
+extern uint8_t excludedFlags[(NEventCodes+NQueue+NSemaphore+NMutex+NTask) / 8 + 1];\r
+extern uint8_t ifeFlags[NTask / 8 + 1];\r
+\r
+/* Internal functions */\r
+\r
+uint16_t prvTraceGetDTS(uint16_t param_maxDTS);\r
+\r
+void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength);\r
+\r
+traceLabel prvTraceCreateSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel channel);\r
+\r
+traceLabel prvTraceLookupSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel channel);\r
+\r
+traceLabel prvTraceOpenSymbol(const char* name, traceLabel userEventChannel);\r
+\r
+void prvTraceUpdateCounters(void);\r
+\r
+void prvCheckDataToBeOverwrittenForMultiEntryUserEvents(uint8_t nEntries);\r
+\r
+objectHandleType xTraceGetObjectHandle(traceObjectClass objectclass);\r
+\r
+void vTraceFreeObjectHandle(traceObjectClass objectclass, \r
+                            objectHandleType handle);\r
+\r
+void vTraceSetObjectName(traceObjectClass objectclass, \r
+                         objectHandleType handle, \r
+                         const char* name);\r
+\r
+void* xTraceNextFreeEventBufferSlot(void);\r
+\r
+uint16_t uiIndexOfObject(objectHandleType objecthandle, \r
+    uint8_t objectclass);\r
+\r
+\r
+/*******************************************************************************\r
+ * vTraceError\r
+ *\r
+ * Called by various parts in the recorder. Stops the recorder and stores a \r
+ * pointer to an error message, which is printed by the monitor task.\r
+ ******************************************************************************/\r
+void vTraceError(const char* msg);\r
+\r
+/*******************************************************************************\r
+ * xTraceGetLastError\r
+ *\r
+ * Gives the last error message, if any. NULL if no error message is stored.\r
+ * The message is cleared on read.\r
+ ******************************************************************************/\r
+char* xTraceGetLastError(void);\r
+\r
+/*******************************************************************************\r
+ * xTraceInitTraceData\r
+ *\r
+ * Allocates and initializes the recorder datastructure, based on the constants\r
+ * in trcConfig.h. This allows for allocating the data on the heap, instead of\r
+ * using a static declaration.\r
+ ******************************************************************************/\r
+RecorderDataType* xTraceInitTraceData(void);\r
+\r
+/* Internal macros */\r
+\r
+#define PROPERTY_NAME_GET(objectclass, objecthandle) \\r
+(const char*)(& RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(objecthandle, objectclass)])\r
+\r
+#define PROPERTY_OBJECT_STATE(objectclass, handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes[uiIndexOfObject(handle, objectclass) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[objectclass]]\r
+\r
+#define PROPERTY_ACTOR_PRIORITY(objectclass, handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes[uiIndexOfObject(handle, objectclass) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[objectclass] + 1]\r
+\r
+#define PROPERTY_TASK_IFE_SERVICECODE(handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(handle, TRACE_CLASS_TASK) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[TRACE_CLASS_TASK]+2]\r
+\r
+#define PROPERTY_TASK_IFE_OBJHANDLE(handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(handle, TRACE_CLASS_TASK) \\r
++  RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[TRACE_CLASS_TASK]+3]\r
+\r
+#define SET_FLAG_ISEXCLUDED(bitIndex) excludedFlags[(bitIndex) >> 3] |= (1 << ((bitIndex) & 7))\r
+#define CLEAR_FLAG_ISEXCLUDED(bitIndex) excludedFlags[(bitIndex) >> 3] &= ~(1 << ((bitIndex) & 7))\r
+#define GET_FLAG_ISEXCLUDED(bitIndex) (excludedFlags[(bitIndex) >> 3] & (1 << ((bitIndex) & 7)))\r
+\r
+#define SET_FLAG_MARKIFE(bitIndex) ifeFlags[(bitIndex) >> 3] |= (1 << ((bitIndex) & 7))\r
+#define CLEAR_FLAG_MARKIFE(bitIndex) ifeFlags[(bitIndex) >> 3] &= ~(1 << ((bitIndex) & 7))\r
+#define GET_FLAG_MARKIFE(bitIndex) (ifeFlags[(bitIndex) >> 3] & (1 << ((bitIndex) & 7)))\r
+\r
+#define SET_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) SET_FLAG_ISEXCLUDED(eventCode)\r
+#define CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) CLEAR_FLAG_ISEXCLUDED(eventCode)\r
+#define GET_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) GET_FLAG_ISEXCLUDED(eventCode)\r
+\r
+#define SET_QUEUE_FLAG_ISEXCLUDED(queueHandle) SET_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+#define CLEAR_QUEUE_FLAG_ISEXCLUDED(queueHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+#define GET_QUEUE_FLAG_ISEXCLUDED(queueHandle) GET_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+\r
+#define SET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+#define CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+#define GET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+\r
+#define SET_MUTEX_FLAG_ISEXCLUDED(mutexHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+#define CLEAR_MUTEX_FLAG_ISEXCLUDED(mutexHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+#define GET_MUTEX_FLAG_ISEXCLUDED(mutexHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+\r
+#define SET_TASK_FLAG_ISEXCLUDED(taskHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+#define CLEAR_TASK_FLAG_ISEXCLUDED(taskHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+#define GET_TASK_FLAG_ISEXCLUDED(taskHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+\r
+#define SET_TASK_FLAG_MARKIFE(bitIndex) SET_FLAG_MARKIFE(bitIndex-1)\r
+#define CLEAR_TASK_FLAG_MARKIFE(bitIndex) CLEAR_FLAG_MARKIFE(bitIndex-1)\r
+#define GET_TASK_FLAG_MARKIFE(bitIndex) GET_FLAG_MARKIFE(bitIndex-1)\r
+\r
+/* For debug printouts - the names of the object classes */\r
+extern char OBJECTCLASSNAME[NCLASSES][10];\r
+/*=\r
+{\r
+        "QUEUE"\r
+        "SEMAPHORE",\r
+        "MUTEX",\r
+        "TASK",\r
+        "ISR"\r
+};*/\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcHooks.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcHooks.h
new file mode 100644 (file)
index 0000000..7876dff
--- /dev/null
@@ -0,0 +1,308 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcHooks.h\r
+ *\r
+ * The kernel integration hooks for FreeRTOS (v7.1.0 or later). This file should\r
+ * be included in the end of FreeRTOSConfig.h, together with:\r
+ *\r
+ * #define configUSE_TRACE_FACILITY 1\r
+ *\r
+ * NOTE: \r
+ * For IAR Embedded Workbench for ARM, you need to have a preprocessor condition\r
+ * on the include, to except it from the assembler step which otherwise give\r
+ * compile-time errors.\r
+ *\r
+ * #ifdef __ICCARM__\r
+ *       #include "percepio/Include/trcHooks.h"\r
+ * #endif\r
+ * \r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCHOOKS_H\r
+#define TRCHOOKS_H\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+    #include "trcUser.h"\r
+       \r
+    #undef INCLUDE_xTaskGetSchedulerState\r
+    #define INCLUDE_xTaskGetSchedulerState 1\r
+       \r
+    #undef INCLUDE_xTaskGetCurrentTaskHandle\r
+    #define INCLUDE_xTaskGetCurrentTaskHandle 1\r
+       \r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+    /* Called for each task that becomes ready */\r
+    #undef traceMOVED_TASK_TO_READY_STATE\r
+    #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \\r
+    vTraceStoreTaskReady((unsigned char)pxTCB->uxTaskNumber);\r
+#endif\r
+       \r
+    /* Called on each OS tick. Will call uiPortGetTimestamp to make sure it is called at least once every OS tick. */\r
+    #undef traceTASK_INCREMENT_TICK\r
+    #define traceTASK_INCREMENT_TICK( xTickCount ) \\r
+      if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdTRUE || uxMissedTicks == 0) {extern uint32_t uiTraceTickCount; uiTraceTickCount++; uiTracePortGetTimeStamp(0);}\r
+\r
+    /* Called on each task-switch */\r
+    #undef traceTASK_SWITCHED_IN\r
+    #define traceTASK_SWITCHED_IN() \\r
+      vTraceStoreTaskswitch();\r
+\r
+    /* Called on vTaskSuspend */\r
+    #undef traceTASK_SUSPEND\r
+    #define traceTASK_SUSPEND( pxTaskToSuspend ) \\r
+      vTraceStoreKernelCall(TASK_SUSPEND, TRACE_CLASS_TASK, pxTaskToSuspend->uxTaskNumber); \\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxTaskToSuspend->uxTaskNumber);\r
+\r
+    /* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */\r
+    #undef traceTASK_DELAY\r
+    #define traceTASK_DELAY() \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCallWithNumericParamOnly(TASK_DELAY, (uint16_t)xTicksToDelay);\\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxCurrentTCB->uxTaskNumber);\\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */\r
+    #undef traceTASK_DELAY_UNTIL\r
+    #define traceTASK_DELAY_UNTIL() \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCallWithNumericParamOnly(TASK_DELAY_UNTIL, (uint16_t)xTimeToWake); \\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxCurrentTCB->uxTaskNumber); \\r
+      portEXIT_CRITICAL();\r
+\r
+#ifndef INCLUDE_OBJECT_DELETE\r
+#define INCLUDE_OBJECT_DELETE 0\r
+#endif\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+    /* Called on vTaskDelete */\r
+    #undef traceTASK_DELETE\r
+    #define traceTASK_DELETE( pxTaskToDelete ) \\r
+      trcCRITICAL_SECTION_BEGIN(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_DELETE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, pxTaskToDelete->uxTaskNumber); \\r
+      vTraceStoreObjectNameOnCloseEvent((objectHandleType)pxTaskToDelete->uxTaskNumber, TRACE_CLASS_TASK); \\r
+      vTraceStoreObjectPropertiesOnCloseEvent((objectHandleType)pxTaskToDelete->uxTaskNumber, TRACE_CLASS_TASK); \\r
+      vTraceSetPriorityProperty(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber, (uint8_t)pxTaskToDelete->uxPriority); \\r
+      vTraceSetObjectState(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber, TASK_STATE_INSTANCE_NOT_ACTIVE); \\r
+      vTraceFreeObjectHandle(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber); \\r
+      trcCRITICAL_SECTION_END();\r
+#endif\r
+\r
+    /* Called on vTaskCreate */\r
+    #undef traceTASK_CREATE\r
+    #define traceTASK_CREATE( pxNewTCB ) \\r
+      if (pxNewTCB != NULL){ \\r
+          pxNewTCB->uxTaskNumber = xTraceGetObjectHandle(TRACE_CLASS_TASK); \\r
+          vTraceSetObjectName(TRACE_CLASS_TASK, (objectHandleType)pxNewTCB->uxTaskNumber, (char*)pxNewTCB->pcTaskName); \\r
+          vTraceSetPriorityProperty(TRACE_CLASS_TASK, (objectHandleType)pxNewTCB->uxTaskNumber, (uint8_t)pxNewTCB->uxPriority); \\r
+          vTraceStoreKernelCall(EVENTGROUP_CREATE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, pxNewTCB->uxTaskNumber);\\r
+      }\r
+\r
+    /* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */\r
+    #undef traceTASK_CREATE_FAILED\r
+    #define traceTASK_CREATE_FAILED() \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, 0); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreate, and thereby for all other object based on queues, such as semaphores. */\r
+    #undef traceQUEUE_CREATE\r
+    #define traceQUEUE_CREATE( pxNewQueue )\\r
+        portENTER_CRITICAL(); \\r
+        pxNewQueue->ucQueueNumber = xTraceGetObjectHandle(TraceObjectClassTable[pxNewQueue->ucQueueType]);\\r
+        vTraceStoreKernelCall(EVENTGROUP_CREATE + TraceObjectClassTable[pxNewQueue->ucQueueType], TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber); \\r
+        vTraceSetObjectState(TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber, 0); \\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreate, if the queue creation fails */\r
+    #undef traceQUEUE_CREATE_FAILED\r
+    #define traceQUEUE_CREATE_FAILED( queueType ) \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall((uint8_t)(EVENTGROUP_FAILED_CREATE + TraceObjectClassTable[queueType]), TraceObjectClassTable[queueType], 0); \\r
+        portEXIT_CRITICAL();\r
+    \r
+    /* Called in xQueueCreateMutex, and thereby also from xSemaphoreCreateMutex and xSemaphoreCreateRecursiveMutex */\r
+    #undef traceCREATE_MUTEX\r
+    #define traceCREATE_MUTEX( pxNewQueue ) \\r
+      portENTER_CRITICAL();\\r
+      pxNewQueue->ucQueueNumber = xTraceGetObjectHandle(TRACE_CLASS_MUTEX); \\r
+      vTraceStoreKernelCall(EVENTGROUP_CREATE + TraceObjectClassTable[pxNewQueue->ucQueueType], TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber, 0); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */\r
+    #undef traceCREATE_MUTEX_FAILED\r
+    #define traceCREATE_MUTEX_FAILED() \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX, TRACE_CLASS_MUTEX, 0);\\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called when the Mutex can not be given, since not holder */\r
+    #undef traceGIVE_MUTEX_RECURSIVE_FAILED\r
+    #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX, TRACE_CLASS_MUTEX, pxMutex->ucQueueNumber); \\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called when a message is sent to a queue */\r
+    #undef traceQUEUE_SEND\r
+    #define traceQUEUE_SEND( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (uint8_t)pxQueue->ucQueueNumber, (uint8_t)0); \\r
+      }else{\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (uint8_t)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting + 1)); \\r
+      }\r
+\r
+    /* Called when a message failed to be sent to a queue (timeout) */\r
+    #undef traceQUEUE_SEND_FAILED\r
+    #define traceQUEUE_SEND_FAILED( pxQueue ) \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called when the task is blocked due to a send operation on a full queue */\r
+    #undef traceBLOCKING_ON_QUEUE_SEND\r
+    #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_BLOCK_ON_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+                \r
+    /* Called when a message is received from a queue */\r
+    #undef traceQUEUE_RECEIVE\r
+    #define traceQUEUE_RECEIVE( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){\\r
+          extern volatile void * volatile pxCurrentTCB; \\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxCurrentTCB)); /*For mutex, store the new owner rather than queue length */ \\r
+      }else{\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting - 1)); \\r
+      }\r
+        \r
+    /* Called when the task is blocked due to a receive operation on an empty queue */\r
+    #undef traceBLOCKING_ON_QUEUE_RECEIVE\r
+    #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_BLOCK_ON_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] != TRACE_CLASS_MUTEX){\\r
+          extern volatile void * volatile pxCurrentTCB; \\r
+          vTraceSetTaskInstanceFinished((objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxCurrentTCB)); \\r
+      }\\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called on xQueuePeek */\r
+    #undef traceQUEUE_PEEK\r
+    #define traceQUEUE_PEEK( pxQueue ) \\r
+        vTraceStoreKernelCall(EVENTGROUP_PEEK + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+    /* Called when a receive operation on a queue fails (timeout) */\r
+    #undef traceQUEUE_RECEIVE_FAILED\r
+    #define traceQUEUE_RECEIVE_FAILED( pxQueue ) \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType],  TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+        \r
+    /* Called when a message is sent from interrupt context, e.g., using xQueueSendFromISR */\r
+    #undef traceQUEUE_SEND_FROM_ISR\r
+    #define traceQUEUE_SEND_FROM_ISR( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_SEND_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting + 1));\r
+\r
+    /* Called when a message send from interrupt context fails (since the queue was full) */\r
+    #undef traceQUEUE_SEND_FROM_ISR_FAILED\r
+    #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+    /* Called when a message is received in interrupt context, e.g., using xQueueReceiveFromISR */\r
+    #undef traceQUEUE_RECEIVE_FROM_ISR\r
+    #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_RECEIVE_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting - 1));\r
+    \r
+    /* Called when a message receive from interrupt context fails (since the queue was empty) */\r
+    #undef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
+    #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+    /* Called on vQueueDelete */\r
+    #undef traceQUEUE_DELETE\r
+    #define traceQUEUE_DELETE( pxQueue ) \\r
+    { \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_DELETE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+        vTraceStoreObjectNameOnCloseEvent((objectHandleType)pxQueue->ucQueueNumber, TraceObjectClassTable[pxQueue->ucQueueType]); \\r
+        vTraceStoreObjectPropertiesOnCloseEvent((objectHandleType)pxQueue->ucQueueNumber, TraceObjectClassTable[pxQueue->ucQueueType]); \\r
+        if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){ \\r
+            vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxQueue->pxMutexHolder)); \\r
+        }else{ \\r
+            vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)uxQueueMessagesWaiting(pxQueue)); \\r
+        } \\r
+        vTraceFreeObjectHandle(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber); \\r
+        portEXIT_CRITICAL();\\r
+    }\r
+#endif\r
+    \r
+    /* Called in vTaskPrioritySet */\r
+    #undef traceTASK_PRIORITY_SET\r
+    #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_SET, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority);\r
+\r
+    /* Called in vTaskPriorityInherit, which is called by Mutex operations */\r
+    #undef traceTASK_PRIORITY_INHERIT\r
+    #define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_INHERIT, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority );\r
+\r
+    /* Called in vTaskPriorityDisinherit, which is called by Mutex operations */\r
+    #undef traceTASK_PRIORITY_DISINHERIT\r
+    #define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_DISINHERIT, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority );\r
+\r
+    /* Called in vTaskResume */\r
+    #undef traceTASK_RESUME\r
+    #define traceTASK_RESUME( pxTaskToResume ) \\r
+      vTraceStoreKernelCall(TASK_RESUME, TRACE_CLASS_TASK, pxTaskToResume->uxTaskNumber);\r
+\r
+    /* Called in vTaskResumeFromISR */\r
+    #undef traceTASK_RESUME_FROM_ISR\r
+    #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\\r
+      vTraceStoreKernelCall(TASK_RESUME_FROM_ISR, TRACE_CLASS_TASK, pxTaskToResume->uxTaskNumber);\r
+\r
+#endif\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcKernel.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcKernel.h
new file mode 100644 (file)
index 0000000..c81db92
--- /dev/null
@@ -0,0 +1,274 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcKernel.h\r
+ *\r
+ * Functions used by trcHooks.h, for the FreeRTOS kernel integration.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCKERNEL_H\r
+#define TRCKERNEL_H\r
+\r
+#include "trcBase.h"\r
+\r
+/* Internal functions */\r
+\r
+\r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+void vTraceStoreTaskReady(objectHandleType handle);\r
+#endif\r
+\r
+void vTraceStoreTaskswitch(void);\r
+\r
+void vTraceStoreKernelCall(uint32_t eventcode, traceObjectClass objectClass, uint32_t byteParam); \r
+\r
+void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, \r
+                                               uint16_t param);\r
+\r
+void vTraceStoreKernelCallWithParam(uint32_t evtcode, traceObjectClass objectClass, \r
+                                    uint32_t objectNumber, uint8_t param);\r
+\r
+void vTraceSetTaskInstanceFinished(objectHandleType handle);\r
+\r
+void vTraceSetPriorityProperty(uint8_t objectclass, uint8_t id, uint8_t value);\r
+\r
+uint8_t uiTraceGetPriorityProperty(uint8_t objectclass, uint8_t id);\r
+\r
+void vTraceSetObjectState(uint8_t objectclass, uint8_t id, uint8_t value);\r
+\r
+uint8_t uiTraceGetObjectState(uint8_t objectclass, uint8_t id);\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)    \r
+\r
+void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle, \r
+                                       traceObjectClass objectclass);\r
+\r
+void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle, \r
+                                             traceObjectClass objectclass);\r
+#endif\r
+\r
+/* Internal constants for task state */\r
+#define TASK_STATE_INSTANCE_NOT_ACTIVE 0\r
+#define TASK_STATE_INSTANCE_ACTIVE 1\r
+#define TASK_STATE_INSTANCE_MARKED_FINISHED 2\r
+\r
+extern objectHandleType handle_of_running_task;\r
+\r
+/* This defines the mapping between FreeRTOS queue types and our internal \r
+class IDs */\r
+extern traceObjectClass TraceObjectClassTable[5];\r
+\r
+/*******************************************************************************\r
+ * The event codes - should match the offline config file.\r
+ * \r
+ * Some sections below are encoded to allow for constructions like:\r
+ *\r
+ *  vTraceStoreKernelCall(EVENTGROUP_CREATE + objectclass, ...\r
+ *\r
+ * The object class ID is given by the three LSB bits, in such cases. Since each \r
+ * object class has a separate object property table, the class ID is needed to \r
+ * know what section in the object table to use for getting an object name from\r
+ * an object handle. \r
+ ******************************************************************************/\r
+\r
+#define NULL_EVENT                   (0x00)  /* Ignored in the analysis*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_RE\r
+ *\r
+ * Events that indicate that something is ready to execute.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_RE                (NULL_EVENT + 2)                   /*0x02*/\r
+#define TR_TASK_READY                (EVENTGROUP_RE + 0)                /*0x02*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_TS\r
+ *\r
+ * Events for storing task-switches and interrupts. The RESUME events are \r
+ * generated if the task/interrupt is already marked active.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_TS                (EVENTGROUP_RE + 2)                /*0x04*/\r
+#define TS_ISR_BEGIN                 (EVENTGROUP_TS + 0)                /*0x04*/\r
+#define TS_ISR_RESUME                (EVENTGROUP_TS + 1)                /*0x05*/\r
+#define TS_TASK_BEGIN                (EVENTGROUP_TS + 2)                /*0x06*/\r
+#define TS_TASK_RESUME               (EVENTGROUP_TS + 3)                /*0x07*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_OBJCLOSE_NAME\r
+ * \r
+ * About Close Events\r
+ * When an object is evicted from the object property table (object close), two \r
+ * internal events are stored (EVENTGROUP_OBJCLOSE_NAME and \r
+ * EVENTGROUP_OBJCLOSE_PROP), containg the handle-name mapping and object \r
+ * properties valid up to this point.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_OBJCLOSE_NAME     (EVENTGROUP_TS + 4)                /*0x08*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_OBJCLOSE_PROP\r
+ * \r
+ * The internal event carrying properties of deleted objects\r
+ * The handle and object class of the closed object is not stored in this event, \r
+ * but is assumed to be the same as in the preceeding CLOSE event. Thus, these \r
+ * two events must be generated from within a critical section. \r
+ * When queues are closed, arg1 is the "state" property (i.e., number of \r
+ * buffered messages/signals).\r
+ * When actors are closed, arg1 is priority, arg2 is handle of the "instance \r
+ * finish" event, and arg3 is event code of the "instance finish" event. \r
+ * In this case, the lower three bits is the object class of the instance finish \r
+ * handle. The lower three bits are not used (always zero) when queues are \r
+ * closed since the queue type is given in the previous OBJCLOSE_NAME event.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_OBJCLOSE_PROP     (EVENTGROUP_OBJCLOSE_NAME + 8)     /*0x10*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_CREATE\r
+ * \r
+ * The events in this group are used to log Kernel object creations.\r
+ * The lower three bits in the event code gives the object class, i.e., type of\r
+ * create operation (task, queue, semaphore, etc).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_CREATE    (EVENTGROUP_OBJCLOSE_PROP + 8)             /*0x18*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_SEND\r
+ * \r
+ * The events in this group are used to log Send/Give events on queues, \r
+ * semaphores and mutexeds The lower three bits in the event code gives the \r
+ * object class, i.e., what type of object that is operated on (queue, semaphore \r
+ * or mutex).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_SEND      (EVENTGROUP_CREATE + 8)                    /*0x20*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_RECEIVE\r
+ * \r
+ * The events in this group are used to log Receive/Take events on queues, \r
+ * semaphores and mutexes. The lower three bits in the event code gives the \r
+ * object class, i.e., what type of object that is operated on (queue, semaphore\r
+ * or mutex).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_RECEIVE                       (EVENTGROUP_SEND + 8)  /*0x28*/\r
+\r
+/* Send/Give operations, from ISR */\r
+#define EVENTGROUP_SEND_FROM_ISR              (EVENTGROUP_RECEIVE + 8)  /*0x30*/\r
+\r
+/* Receive/Take operations, from ISR */\r
+#define EVENTGROUP_RECEIVE_FROM_ISR     (EVENTGROUP_SEND_FROM_ISR + 8)  /*0x38*/\r
+\r
+/* "Failed" event type versions of above (timeout, failed allocation, etc) */\r
+#define EVENTGROUP_FAILED_KSE         (EVENTGROUP_RECEIVE_FROM_ISR + 8) /*0x40*/\r
+\r
+/* Failed create calls - memory allocation failed */\r
+#define EVENTGROUP_FAILED_CREATE                (EVENTGROUP_FAILED_KSE) /*0x40*/\r
+\r
+/* Failed send/give - timeout! */\r
+#define EVENTGROUP_FAILED_SEND           (EVENTGROUP_FAILED_CREATE + 8) /*0x48*/\r
+\r
+/* Failed receive/take - timeout! */\r
+#define EVENTGROUP_FAILED_RECEIVE          (EVENTGROUP_FAILED_SEND + 8) /*0x50*/\r
+\r
+/* Failed non-blocking send/give - queue full */\r
+#define EVENTGROUP_FAILED_SEND_FROM_ISR (EVENTGROUP_FAILED_RECEIVE + 8) /*0x58*/\r
+\r
+/* Failed non-blocking receive/take - queue empty */\r
+#define EVENTGROUP_FAILED_RECEIVE_FROM_ISR \\r
+                                  (EVENTGROUP_FAILED_SEND_FROM_ISR + 8) /*0x60*/\r
+\r
+/* Events when blocking on receive/take */\r
+#define EVENTGROUP_BLOCK_ON_RECEIVE \\r
+                               (EVENTGROUP_FAILED_RECEIVE_FROM_ISR + 8) /*0x68*/\r
+\r
+/* Events when blocking on send/give */\r
+#define EVENTGROUP_BLOCK_ON_SEND     (EVENTGROUP_BLOCK_ON_RECEIVE + 8)  /*0x70*/\r
+\r
+/* Events on queue peek (receive) */\r
+#define EVENTGROUP_PEEK              (EVENTGROUP_BLOCK_ON_SEND + 8)     /*0x78*/\r
+\r
+/* Events on object delete (vTaskDelete or vQueueDelete) */\r
+#define EVENTGROUP_DELETE            (EVENTGROUP_PEEK + 8)              /*0x80*/\r
+\r
+/* Other events - object class is implied: TASK */\r
+#define EVENTGROUP_OTHERS            (EVENTGROUP_DELETE + 8)            /*0x88*/\r
+#define TASK_DELAY_UNTIL             (EVENTGROUP_OTHERS + 0)            /*0x88*/\r
+#define TASK_DELAY                   (EVENTGROUP_OTHERS + 1)            /*0x89*/\r
+#define TASK_SUSPEND                 (EVENTGROUP_OTHERS + 2)            /*0x8A*/\r
+#define TASK_RESUME                  (EVENTGROUP_OTHERS + 3)            /*0x8B*/\r
+#define TASK_RESUME_FROM_ISR         (EVENTGROUP_OTHERS + 4)            /*0x8C*/\r
+#define TASK_PRIORITY_SET            (EVENTGROUP_OTHERS + 5)            /*0x8D*/\r
+#define TASK_PRIORITY_INHERIT        (EVENTGROUP_OTHERS + 6)            /*0x8E*/\r
+#define TASK_PRIORITY_DISINHERIT     (EVENTGROUP_OTHERS + 7)            /*0x8F*/\r
+\r
+/* Not yet used */\r
+#define EVENTGROUP_FTRACE_PLACEHOLDER    (EVENTGROUP_OTHERS + 8)        /*0x90*/\r
+\r
+/* User events */\r
+#define EVENTGROUP_USEREVENT (EVENTGROUP_FTRACE_PLACEHOLDER + 8)        /*0x98*/\r
+#define USER_EVENT (EVENTGROUP_USEREVENT + 0)\r
+\r
+/* Allow for 0-15 arguments (the number of args is added to event code) */\r
+#define USER_EVENT_LAST (EVENTGROUP_USEREVENT + 15)                     /*0xA7*/\r
+\r
+/*******************************************************************************\r
+ * XTS Event - eXtended TimeStamp events\r
+ * The timestamps used in the recorder are "differential timestamps" (DTS), i.e.\r
+ * the time since the last stored event. The DTS fields are either 1 or 2 bytes \r
+ * in the other events, depending on the bytes available in the event struct. \r
+ * If the time since the last event (the DTS) is larger than allowed for by \r
+ * the DTS field of the current event, an XTS event is inserted immidiatly \r
+ * before the original event. The XTS event contains up to 3 additional bytes \r
+ * of the DTS value - the higher bytes of the true DTS value. The lower 1-2 \r
+ * bytes are stored in the normal DTS field. \r
+ * There are two types of XTS events, XTS8 and XTS16. An XTS8 event is stored \r
+ * when there is only room for 1 byte (8 bit) DTS data in the original event, \r
+ * which means a limit of 0xFF (255). The XTS16 is used when the original event \r
+ * has a 16 bit DTS field and thereby can handle values up to 0xFFFF (65535).\r
+ * \r
+ * Using a very high frequency time base can result in many XTS events. \r
+ * Preferably, the time between two OS ticks should fit in 16 bits, i.e.,\r
+ * at most 65535. If your time base has a higher frequency, you can define\r
+ * the TRACE\r
+ ******************************************************************************/\r
+\r
+#define EVENTGROUP_SYS (EVENTGROUP_USEREVENT + 16)                      /*0xA8*/\r
+#define XTS8 (EVENTGROUP_SYS + 0)                                       /*0xA8*/\r
+#define XTS16 (EVENTGROUP_SYS + 1)                                      /*0xA9*/\r
+\r
+#define EVENT_BEING_WRITTEN (EVENTGROUP_SYS + 2)                        /*0xAA*/\r
+\r
+#define RESERVED_DUMMY_CODE (EVENTGROUP_SYS + 3)                        /*0xAB*/\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcPort.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcPort.h
new file mode 100644 (file)
index 0000000..368187a
--- /dev/null
@@ -0,0 +1,492 @@
+/******************************************************************************* \r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.h\r
+ *\r
+ * Contains together with trcPort.c all portability issues of the trace recorder \r
+ * library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCPORT_H\r
+#define TRCPORT_H\r
+\r
+/* If FreeRTOS Win32 port */\r
+#ifdef WIN32\r
+\r
+   #undef _WIN32_WINNT\r
+   #define _WIN32_WINNT 0x0600\r
+\r
+   /* Standard includes. */\r
+   #include <stdio.h>\r
+   #include <windows.h>\r
+   #include <direct.h>\r
+\r
+/*******************************************************************************\r
+ * The Win32 port by default saves the trace to file and then kills the\r
+ * program when the recorder is stopped, to facilitate quick, simple tests\r
+ * of the recorder.\r
+ ******************************************************************************/\r
+   #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
+   #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
+#else\r
+       #define WIN32_PORT_SAVE_WHEN_STOPPED 0\r
+       #define WIN32_PORT_EXIT_WHEN_STOPPED 0\r
+#endif\r
+\r
+#define DIRECTION_INCREMENTING 1\r
+#define DIRECTION_DECREMENTING 2\r
+\r
+/******************************************************************************\r
+ * Supported ports\r
+ * \r
+ * PORT_HWIndependent\r
+ * A hardware independent fallback option for event timestamping. Provides low \r
+ * resolution timestamps based on the OS tick.\r
+ * This may be used on the Win32 port, but may also be used on embedded hardware \r
+ * platforms. Note that this gives suboptimal display in FreeRTOS+Trace. All \r
+ * time durations will be truncated to the OS tick frequency, typically 1 KHz. \r
+ * This means that a task or ISR that executes in less than 1 ms get an exection \r
+ * time of zero. They are however still visible in FreeRTOS+Trace. \r
+ *\r
+ * PORT_Win32\r
+ * "Accurate" timestamping based on the Windows permance counter. Note that\r
+ * this gives the host machine time, not the simulated FreeRTOS time (tick \r
+ * count). The timing of the Win32 FreeRTOS build is not real-time, since it \r
+ * depends on the scheduling and tick rate of Windows, which is very slow.\r
+ *\r
+ * Officially supported hardware timer ports:\r
+ * - PORT_Atmel_AT91SAM7\r
+ * - PORT_Atmel_UC3A0\r
+ * - PORT_ARM_CortexM \r
+ * - PORT_Renesas_RX600\r
+ * - PORT_Microchip_dsPIC_AND_PIC24\r
+ *\r
+ * We also provide several "unofficial" hardware-specific ports. There have \r
+ * been developed by external contributors, and have not yet been verified \r
+ * by Percepio AB. Let us know if you have problems getting these to work.\r
+ * \r
+ * Unoffical hardware specific ports provided are:\r
+ * - PORT_TEXAS_INSTRUMENTS_TMS570\r
+ * - PORT_TEXAS_INSTRUMENTS_MSP430\r
+ * - PORT_MICROCHIP_PIC32\r
+ * - PORT_XILINX_PPC405\r
+ * - PORT_XILINX_PPC440\r
+ * - PORT_XILINX_MICROBLAZE\r
+ * - PORT_NXP_LPC210X\r
+ *\r
+ *****************************************************************************/\r
+\r
+#define PORT_NOT_SET                          -1\r
+\r
+/*** Officially supported hardware timer ports *******************************/\r
+#define PORT_HWIndependent                     0\r
+#define PORT_Win32                             1\r
+#define PORT_Atmel_AT91SAM7                    2\r
+#define PORT_Atmel_UC3A0                       3\r
+#define PORT_ARM_CortexM                       4\r
+#define PORT_Renesas_RX600                     5\r
+#define PORT_Microchip_dsPIC_AND_PIC24         6\r
+\r
+/*** Unofficial ports, provided by external developers, not yet verified *****/\r
+#define PORT_TEXAS_INSTRUMENTS_TMS570          7\r
+#define PORT_TEXAS_INSTRUMENTS_MSP430          8\r
+#define PORT_MICROCHIP_PIC32                   9\r
+#define PORT_XILINX_PPC405                    10\r
+#define PORT_XILINX_PPC440                    11\r
+#define PORT_XILINX_MICROBLAZE                12\r
+#define PORT_NXP_LPC210X                      13\r
+\r
+/*** Select your port here! **************************************************/\r
+#define SELECTED_PORT PORT_ARM_CortexM\r
+/*****************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET) \r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * IRQ_PRIORITY_ORDER\r
+ *\r
+ * Macro which should be defined as an integer of 0 or 1.\r
+ *\r
+ * This should be 0 if lower irq priority values implies higher priority \r
+ * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+ * if higher irq priority values means higher priority, this should be 1.\r
+ *\r
+ * This setting is not critical. It is used only to sort and colorize the \r
+ * interrupts in priority order, in case you record interrupts using\r
+ * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
+ *\r
+ * We provide this setting for some hardware architectures below:\r
+ * - ARM Cortex M:       0 (lower irq priority values are more significant)\r
+ * - Atmel AT91SAM7x:    1 (higher irq priority values are more significant)\r
+ * - Atmel AVR32:        1 (higher irq priority values are more significant)\r
+ * - Renesas RX600:      1 (higher irq priority values are more significant)\r
+ * - Microchip PIC24:    0 (lower irq priority values are more significant)\r
+ * - Microchip dsPIC:    0 (lower irq priority values are more significant)\r
+ * - TI TMS570:          0 (lower irq priority values are more significant)\r
+ * - Freescale HCS08:    0 (lower irq priority values are more significant)\r
+ * - Freescale HCS12:    0 (lower irq priority values are more significant)\r
+ * - PowerPC 405:        0 (lower irq priority values are more significant)\r
+ * - PowerPC 440:        0 (lower irq priority values are more significant)\r
+ * - Freescale ColdFire: 1 (higher irq priority values are more significant)\r
+ * - NXP LPC210x:        0 (lower irq priority values are more significant)\r
+ * - MicroBlaze:        0  (lower irq priority values are more significant)\r
+ *\r
+ * If your chip is not on the above list, and you perhaps know this detail by \r
+ * heart, please inform us by e-mail to support@percepio.com.\r
+ *\r
+ ******************************************************************************\r
+ *\r
+ * HWTC Macros \r
+ *\r
+ * These four HWTC macros provides a hardware isolation layer representing a \r
+ * generic hardware timer/counter used for driving the operating system tick, \r
+ * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
+ * AT91SAM7X.\r
+ *\r
+ * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
+ * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
+ * already wrapped.\r
+ *\r
+ * HWTC_COUNT_DIRECTION: Should be one of:\r
+ * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
+ *   such as the PIT on Atmel AT91SAM7X.\r
+ *   When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
+ *   interrupt is signaled.\r
+ * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
+ *   such as the SysTick on ARM Cortex M3/M4 chips.\r
+ *   When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
+ *   interrupt is signaled.\r
+ *\r
+ * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
+ * two tick interrupts. This should preferably be mapped to the reload\r
+ * register of the hardware timer, to make it more portable between chips in the \r
+ * same family. The macro should in most cases be (reload register + 1).\r
+ *\r
+ * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
+ * (where the SysTick runs at the core clock frequency), the "differential \r
+ * timestamping" used in the recorder will more frequently insert extra XTS \r
+ * events to store the timestamps, which increases the event buffer usage. \r
+ * In such cases, to reduce the number of XTS events and thereby get longer \r
+ * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
+ * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
+ * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
+ * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
+ * faster chip require a higher HWTC_DIVISOR value. \r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * FREE LICENSE OFFER FROM PERCEPIO\r
+ *\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students,\r
+ * hobbyists or early-phase startups) we have the following offer: \r
+ * Provide a hardware port for our FreeRTOS recorder and get a FREE single-user\r
+ * license for FreeRTOS+Trace Professional Edition. Read more about this offer\r
+ * at www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_Win32)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
+    #define HWTC_PERIOD 0\r
+    #define HWTC_DIVISOR 1\r
+    \r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_HWIndependent)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT 0\r
+    #define HWTC_PERIOD 1\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+\r
+    /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
+    A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
+    #define HWTC_PERIOD 2995 \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
+  \r
+    /* For Atmel AVR32 (AT32UC3A) */\r
+  \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+    /* For all chips using ARM Cortex M cores */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
+    #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
+    #define HWTC_DIVISOR 2\r
+    \r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Renesas_RX600)    \r
+\r
+    #include "iodefine.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (CMT0.CMCNT)\r
+    #define HWTC_PERIOD ((((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/8))\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Microchip_dsPIC_AND_PIC24) \r
+\r
+    /* For Microchip PIC24 and dsPIC (16 bit) */\r
+\r
+    /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
+       than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 Âµs. \r
+       In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
+       becomes a problem on PIC24, use the filters to exclude less interresting tasks \r
+       or system calls. */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TMR1)\r
+    #define HWTC_PERIOD (PR1+1)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+    \r
+    /* Tested with LPC2106, but should work with most LPC21XX chips.\r
+       Assumption: prescaler is 1:1 (this setting is hardcoded in \r
+       FreeRTOS port for LPC21XX) */\r
+      \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT  *((uint32_t *)0xE0004008 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) \r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
+    #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
+    #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
+    #define HWTC_PERIOD (RTIUDCP0)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TA0R)\r
+    #define HWTC_PERIOD configCPU_CLOCKS_PER_TICK      \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ReadTimer1())     /* Should be available in BSP */\r
+    #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x3db)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most PowerPC chips */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x016 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+    \r
+#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most Microblaze configurations\r
+     * This port is based on the official FreeRTOS Microlaze port and example application.\r
+     * It uses the AXI Timer 0 - the tick interrupt source.\r
+     * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
+     */\r
+    #include "xtmrctr_l.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 16\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT != PORT_NOT_SET)\r
+\r
+    #error "SELECTED_PORT had unsupported value!"\r
+    #define SELECTED_PORT PORT_NOT_SET\r
+\r
+#endif\r
+\r
+#if (SELECTED_PORT != PORT_NOT_SET)\r
+    \r
+    #ifndef HWTC_COUNT_DIRECTION\r
+    #error "HWTC_COUNT_DIRECTION is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_COUNT\r
+    #error "HWTC_COUNT is not set!"    \r
+    #endif \r
+    \r
+    #ifndef HWTC_PERIOD\r
+    #error "HWTC_PERIOD is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_DIVISOR\r
+    #error "HWTC_DIVISOR is not set!"    \r
+    #endif \r
+    \r
+    #ifndef IRQ_PRIORITY_ORDER\r
+    #error "IRQ_PRIORITY_ORDER is not set!"\r
+    #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
+    #error "IRQ_PRIORITY_ORDER has bad value!"\r
+    #endif \r
+    \r
+    #if (HWTC_DIVISOR < 1)\r
+    #error "HWTC_DIVISOR must be a non-zero positive value!"\r
+    #endif \r
+\r
+#endif\r
+/*******************************************************************************\r
+ * vTraceConsoleMessage\r
+ *\r
+ * A wrapper for your system-specific console "printf" console output function.\r
+ * This needs to be correctly defined to see status reports from the trace \r
+ * status monitor task (this is defined in trcUser.c).\r
+ ******************************************************************************/         \r
+#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+/* Port specific includes */\r
+#include "console.h"\r
+#endif\r
+\r
+#define vTraceConsoleMessage(x)\r
+\r
+/*******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, \r
+ * students, hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called when the recorder is stopped due to full buffer.\r
+ * Mainly intended to show a message in the console.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetFileName.\r
+ ******************************************************************************/\r
+void vTracePortEnd(void);\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path);\r
+\r
+/******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a target-side file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port may call\r
+ * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
+ ******************************************************************************/\r
+void vTracePortSave(void);\r
+\r
+#endif\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcTypes.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcTypes.h
new file mode 100644 (file)
index 0000000..7bf438c
--- /dev/null
@@ -0,0 +1,81 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcTypes.h\r
+ *\r
+ * Data types used by the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCTYPES_H\r
+#define TRCTYPES_H\r
+\r
+#include <stdint.h>\r
+\r
+typedef uint16_t traceLabel;\r
+\r
+typedef uint8_t objectHandleType;\r
+\r
+typedef uint8_t traceObjectClass;\r
+\r
+#define TRACE_CLASS_QUEUE ((traceObjectClass)0)\r
+#define TRACE_CLASS_SEMAPHORE ((traceObjectClass)1) \r
+#define TRACE_CLASS_MUTEX ((traceObjectClass)2)\r
+#define TRACE_CLASS_TASK ((traceObjectClass)3)\r
+#define TRACE_CLASS_ISR ((traceObjectClass)4)\r
+\r
+typedef uint8_t traceKernelService;\r
+\r
+#define TRACE_KERNEL_SERVICE_TASK_CREATE ((traceKernelService)0)\r
+#define TRACE_KERNEL_SERVICE_TASK_DELETE ((traceKernelService)1)\r
+#define TRACE_KERNEL_SERVICE_TASK_DELAY ((traceKernelService)2)\r
+#define TRACE_KERNEL_SERVICE_PRIORITY_SET ((traceKernelService)3)\r
+#define TRACE_KERNEL_SERVICE_TASK_SUSPEND ((traceKernelService)4)\r
+#define TRACE_KERNEL_SERVICE_TASK_RESUME ((traceKernelService)5)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_CREATE ((traceKernelService)6)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_DELETE ((traceKernelService)7)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_SEND ((traceKernelService)8)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_RECEIVE ((traceKernelService)9)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_PEEK ((traceKernelService)10)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_CREATE ((traceKernelService)11)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_DELETE ((traceKernelService)12)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_GIVE ((traceKernelService)13)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_TAKE ((traceKernelService)14)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_CREATE ((traceKernelService)15)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_DELETE ((traceKernelService)16)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_GIVE ((traceKernelService)17)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_TAKE ((traceKernelService)18)\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcUser.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/Include/trcUser.h
new file mode 100644 (file)
index 0000000..3e80162
--- /dev/null
@@ -0,0 +1,444 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcUser.h\r
+ * The public API of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCUSER_H\r
+#define TRCUSER_H\r
+\r
+#include "FreeRTOS.h"\r
+\r
+#include "trcKernel.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * uiTraceStart\r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * Returns 1 if the recorder was started successfully.\r
+ * Returns 0 if the recorder start was prevented due to a previous internal \r
+ * error. In that case, check vTraceGetLastError to get the error message.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+uint32_t uiTraceStart(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStart \r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * This function is obsolete, but has been saved for backwards compatibility. \r
+ * We recommend using uiTraceStart instead.\r
+ ******************************************************************************/\r
+void vTraceStart(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStartStatusMonitor\r
+ *\r
+ * This starts a task to monitor the status of the recorder module. \r
+ * This task periodically prints a line to the console window, which shows the \r
+ * recorder status, the number of events recorded and the latest timestamp. \r
+ * This task calls vTracePortEnd (trcPort.c) when it detects that the recorder \r
+ * has been stopped. This allows for adding custom actions, e.g., to store the\r
+ * trace to a file in case a file system is available on the device.\r
+ ******************************************************************************/\r
+void vTraceStartStatusMonitor(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStop\r
+ *\r
+ * Stops the recorder. The recording can be resumed by calling vTraceStart.\r
+ * This does not reset the recorder. Use vTraceClear is that is desired.\r
+ ******************************************************************************/\r
+void vTraceStop(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceClear\r
+ *\r
+ * Resets the recorder. Only necessary if a restart is desired - this is not \r
+ * needed in the startup initialization.\r
+ ******************************************************************************/\r
+void vTraceClear(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceSetQueueName\r
+ *\r
+ * Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This function should\r
+ * be called right after creation of the queue/mutex/semaphore. If not using \r
+ * this function, the queues/mutexes/semaphores will be presented by their\r
+ * numeric handle only.\r
+ *\r
+ * Example:\r
+ *     actuatorQ = xQueueCreate(3, sizeof(QueueMessage));\r
+ *     vTraceSetQueueName(actuatorQ, "ActuatorQueue");\r
+ ******************************************************************************/\r
+void vTraceSetQueueName(void* queue, const char* name);\r
+\r
+#if (INCLUDE_ISR_TRACING == 1)\r
+\r
+/*******************************************************************************\r
+ * vTraceSetISRProperties\r
+ * \r
+ * Registers an Interrupt Service Routine in the recorder library, This must be\r
+ * called before using vTraceStoreISRBegin to store ISR events. This is \r
+ * typically called in the startup of the system, before the scheduler is \r
+ * started.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceSetISRProperties(objectHandleType handle, const char* name, char priority);\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISRBegin\r
+ * \r
+ * Registers the beginning of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceStoreISRBegin(objectHandleType id);\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISREnd\r
+ * \r
+ * Registers the end of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceStoreISREnd(void);\r
+\r
+#else\r
+   /* If not including the ISR recording */\r
+\r
+void vTraceIncreaseISRActive(void);\r
+\r
+void vTraceDecreaseISRActive(void);\r
+\r
+#define vTraceSetISRProperties(handle, name, priority)\r
+#define vTraceStoreISRBegin(id) vTraceIncreaseISRActive()\r
+#define vTraceStoreISREnd() vTraceDecreaseISRActive()\r
+\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vvTraceTaskSkipDefaultInstanceFinishedEvents\r
+ *\r
+ * This is useful if there are implicit Instance Finish Events, such as \r
+ * vTaskDelayUntil or xQueueReceive, in a task where an explicit Instance Finish \r
+ * Event has been defined. This function tells the recorder that only the \r
+ * explicitly defined functions (using vTraceTaskInstanceIsFinished) should be\r
+ * treated as Instance Finish Events for this task. The implicit Instance Finish \r
+ * Events are thus disregarded for this task.\r
+ ******************************************************************************/\r
+void vTraceTaskSkipDefaultInstanceFinishedEvents(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceTaskInstanceIsFinished\r
+ * \r
+ * This defines an explicit Instance Finish Event for the current task. It tells \r
+ * the recorder that the current instance of this task is finished at the next \r
+ * kernel call of the task, e.g., a taskDelay or a queue receive. This function \r
+ * should be called right before the api function call considered to be the end \r
+ * of the task instamce, i.e., the Instance Finish Event.\r
+ ******************************************************************************/\r
+void vTraceTaskInstanceIsFinished(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceGetTraceBuffer\r
+ * \r
+ * Returns a pointer to the recorder data structure. Use this together with \r
+ * uiTraceGetTraceBufferSize if you wish to implement an own store/upload \r
+ * solution, e.g., in case a debugger connection is not available for uploading \r
+ * the data.\r
+ ******************************************************************************/\r
+void* vTraceGetTraceBuffer(void);\r
+\r
+/*******************************************************************************\r
+ * uiTraceGetTraceBufferSize\r
+ * \r
+ * Gets the size of the recorder data structure. For use together with \r
+ * vTraceGetTraceBuffer if you wish to implement an own store/upload solution, \r
+ * e.g., in case a debugger connection is not available for uploading the data.\r
+ ******************************************************************************/\r
+uint32_t uiTraceGetTraceBufferSize(void);\r
+\r
+#if (INCLUDE_USER_EVENTS == 1)\r
+\r
+/*******************************************************************************\r
+ * xTraceOpenLabel\r
+ * \r
+ * Creates user event labels for user event channels or for individual events.\r
+ * User events can be used to log application events and data for display in\r
+ * the visualization tool. A user event is identified by a label, i.e., a string,\r
+ * which is stored in the recorder's symbol table.\r
+ * When logging a user event, a numeric handle (reference) to this string is\r
+ * used to identify the event. This is obtained by calling \r
+ * \r
+ *     xTraceOpenLabel()\r
+ *\r
+ * whihc adds the string to the symbol table (if not already present)\r
+ * and returns the corresponding handle.\r
+ *\r
+ * This can be used in two ways:\r
+ *\r
+ * 1. The handle is looked up every time, when storing the user event.\r
+ *\r
+ * Example:\r
+ *     vTraceUserEvent(xTraceOpenLabel("MyUserEvent"));\r
+ *\r
+ * 2. The label is registered just once, with the handle stored in an\r
+ *  application variable - much like using a file handle.\r
+ *\r
+ * Example:\r
+ *     myEventHandle = xTraceOpenLabel("MyUserEvent");\r
+ *     ...\r
+ *     vTraceUserEvent(myEventHandle);\r
+ *\r
+ * The second option is faster since no lookup is required on each event, and \r
+ * therefore recommended for user events that are frequently\r
+ * executed and/or located in time-critical code. The lookup operation is\r
+ * however fairly fast due to the design of the symbol table.\r
+ ******************************************************************************/\r
+traceLabel xTraceOpenLabel(const char* label);\r
+\r
+ /******************************************************************************\r
+ * vTraceUserEvent\r
+ *\r
+ * Basic user event (Standard and Professional Edition only)\r
+ * \r
+ * Generates a User Event with a text label. The label is created/looked up\r
+ * in the symbol table using xTraceOpenLabel.\r
+ ******************************************************************************/\r
+void vTraceUserEvent(traceLabel eventLabel);\r
+\r
+ /******************************************************************************\r
+ * vTracePrintF \r
+ * \r
+ * Advanced user events (Professional Edition only)\r
+ *\r
+ * Generates User Event with formatted text and data, similar to a "printf".\r
+ * It is very fast compared to a normal "printf" since this function only \r
+ * stores the arguments. The actual formatting is done\r
+ * on the host PC when the trace is displayed in the viewer tool. \r
+ *\r
+ * User Event labels are created using xTraceOpenLabel.\r
+ * Example:\r
+ *\r
+ *     traceLabel adc_uechannel = xTraceOpenLabel("ADC User Events");\r
+ *     ...\r
+ *     vTracePrint(adc_uechannel, \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * This can be combined into one line, if desired, but this is slower:\r
+ *\r
+ *     vTracePrint(xTraceOpenLabel("ADC User Events"), \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * Calling xTraceOpenLabel multiple times will not create duplicate entries, but\r
+ * it is of course faster to just do it once, and then keep the handle for later \r
+ * use. If you don´t have any data arguments, only a text label/string, it is \r
+ * better to use vTraceUserEvent - it is faster.\r
+ *\r
+ * Format specifiers supported:\r
+ *  %d - 32 bit signed integer\r
+ *  %u - 32 bit unsigned integer\r
+ *  %f - 32 bit float\r
+ *  %s - string (is copied to the recorder symbol table)\r
+ *  %hd - 16 bit signed integer\r
+ *  %hu - 16 bit unsigned integer\r
+ *  %bd - 8 bit signed integer\r
+ *  %bu - 8 bit unsigned integer\r
+ *  %lf - double-precision float (Note! See below...)\r
+ * \r
+ * Up to 15 data arguments are allowed, with a total size of maximum 32 byte.\r
+ * In case this is exceeded, the user event is changed into an error message.\r
+ * \r
+ * The data is stored in trace buffer, and is packed to allow storing multiple \r
+ * smaller data entries in the same 4-byte record, e.g., four 8-bit values.\r
+ * A string requires two bytes, as the symbol table is limited to 64K. Storing \r
+ * a double (%lf) uses two records, so this is quite costly. Use float (%f) \r
+ * unless the higher precision is really necessary.\r
+ * \r
+ * Note that the double-precision float (%lf) assumes a 64 bit double \r
+ * representation. This does not seem to be the case on e.g. PIC24F. \r
+ * Before using a %lf argument on a 16-bit MCU, please verify that \r
+ * "sizeof(double)" actually gives 8 as expected. If not, use %f instead.\r
+ ******************************************************************************/ \r
+void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...);\r
+\r
+#else\r
+\r
+#define vTracePrintF(eventLabel, formatStr, ...);\r
+#define xTraceOpenLabel(label) 0\r
+#define vTraceUserEvent(eventLabel) \r
+\r
+#endif\r
+\r
+/******************************************************************************\r
+ * vTraceExclude______FromTrace\r
+ *\r
+ * Excludes a task or object from the trace.\r
+ * This can be useful if some irrelevant task is very frequent and is "eating\r
+ * up the buffer". This should be called after the task has been created, but \r
+ * before starting the FreeRTOS scheduler.\r
+ *****************************************************************************/\r
+void vTraceExcludeQueueFromTrace(void* handle);\r
+void vTraceExcludeSemaphoreFromTrace(void* handle);\r
+void vTraceExcludeMutexFromTrace(void* handle);\r
+void vTraceExcludeTaskFromTrace(void* handle);\r
+void vTraceExcludeKernelServiceFromTrace(traceKernelService kernelService);\r
+\r
+/******************************************************************************\r
+ * vTraceInclude______InTrace\r
+ *\r
+ * Includes a task, object or kernel service in the trace. This is only\r
+ * necessary if the task or object has been previously exluded.\r
+ *****************************************************************************/\r
+void vTraceIncludeQueueInTrace(void* handle);\r
+void vTraceIncludeSemaphoreInTrace(void* handle);\r
+void vTraceIncludeMutexInTrace(void* handle);\r
+void vTraceIncludeTaskInTrace(void* handle);\r
+void vTraceIncludeKernelServiceInTrace(traceKernelService kernelService);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#else\r
+\r
+#include "trcPort.h"\r
+\r
+#define vTraceInit()\r
+#define uiTraceStart() (1)\r
+#define vTraceStart()\r
+#define vTraceStop()\r
+#define vTraceClear()\r
+#define vTraceStartStatusMonitor()\r
+#define vTracePortSetOutFile(f)\r
+#define vTraceGetTraceBuffer() ((void*)0)\r
+#define uiTraceGetTraceBufferSize() 0\r
+#define xTraceOpenLabel(label) 0\r
+#define vTraceUserEvent(eventLabel)\r
+#define vTracePrintF(eventLabel,formatStr,...)\r
+#define vTraceExcludeTaskFromSchedulingTrace(name)\r
+#define vTraceSetQueueName(queue, name)\r
+\r
+#define vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+#define vTraceSetISRProperties(handle, name, priority)\r
+#define vTraceStoreISRBegin(id)\r
+#define vTraceStoreISREnd()\r
+#endif\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/debugger trace upload.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/debugger trace upload.txt
new file mode 100644 (file)
index 0000000..417a54b
--- /dev/null
@@ -0,0 +1,126 @@
+\r
+FreeRTOS+Trace - Uploading the trace data\r
+-----------------------------------------\r
+Percepio AB, Nov. 8, 2012\r
+\r
+This document decribes how to upload the trace data from the target system to\r
+FreeRTOS+Trace. For information on how to integrate and enable the recorder \r
+library in your FreeRTOS project, see the FreeRTOS+Trace User Manual.\r
+\r
+FreeRTOS+Trace uses your existing debugger to upload the trace data from the \r
+chip RAM. This is a plain RAM dump, that is done whenever you want to look at \r
+the trace buffer contents. This means it works with essentially with any debug \r
+probe on the market.\r
+\r
+Note that hardware-generated trace is not required (or used by) FreeRTOS+Trace. \r
+We however plan to add support for that in future versions of FreeRTOS+Trace \r
+and other Tracealyzer products.\r
+\r
+Built-in support for Segger J-Link/J-Trace and Atmel SAM-ICE\r
+------------------------------------------------------------\r
+FreeRTOS+Trace v2.3 supports Segger J-Link and J-Link compatible debuggers \r
+directly, without any debugger IDE involved. Using other debug probes is \r
+also possible, but requires some extra steps, described below.\r
+\r
+If you have a Segger J-Link/J-Trace debug probe or another J-Link compatible \r
+debug probe, just select \r
+\r
+    "File" menu -> "Upload from <debug probe name>". \r
+\r
+This opens a dialog where you get to enter the memory region where\r
+the recorder data structure is located. Normally you select the entire \r
+internal RAM according to the datasheet of your MCU, but the exact address\r
+can be found can by inspecting the "RecorderData" struct or the \r
+"RecorderDataPtr" pointer with your debugger.\r
+\r
+Typical values are 0x0, 0x10000000 or 0x20000000 as start address\r
+and 0x10000 or 0x20000 as size (64 KB or 128 KB).\r
+\r
+This makes FreeRTOS+Trace reads the chip RAM and locate the trace data. \r
+Note that this option is only available if a compatible debug probe is found.\r
+\r
+J-Link compatible debug probes also include Atmel SAM-ICE and many built-in \r
+debug interfaces on demonstration/evaluation boards (where there is a USB \r
+connection directly to the board). Look for a Segger J-Link label on the board.\r
+\r
+MemoryLogger extension in Atmel Studio 6\r
+----------------------------------------\r
+Atmel's new MemoryLogger extension provides a superb integration with\r
+FreeRTOS+Trace. Look for "MemoryLogger" in Atmel Gallery, available in \r
+Atmel Studio and at the Atmel website.\r
+\r
+This extension automatically detects the path to FreeRTOS+Trace, if \r
+installed, and gives you a single-click upload/refresh. You can use it \r
+while debugging and optionally get an automatic refresh eash time the \r
+MCU is halted, e.g., on each breakpoint.\r
+\r
+Using other development environments and debug probes\r
+-----------------------------------------------------\r
+Most debuggers are able to save the RAM contents to a file. FreeRTOS+Trace \r
+supports the following common formats:\r
+- Binary (.bin), supporting gdb, J-Link and Renesas HEW.\r
+- Intel Hex (.hex), supporting IAR Embedded Workbench and Atmel Studio (atprogram.exe)\r
+- MCH (.mch), supporting Microchip MPLAB.\r
+\r
+When you store the RAM dump, you must also make sure to select the right region, \r
+i.e., start address and size. The recorder data is stored in a single data \r
+block, identified by the pointer RecorderDataPtr. \r
+It is not necessary to match the begin and end of the recorder data, as long as \r
+it is fully included by the dumped memory region. FreeRTOS+Trace automatically \r
+finds the trace data in the RAM dump, thanks to special signatures. For chips \r
+with on-chip RAM only, we therefore recommend to dump the entire RAM. This is \r
+usually very fast.\r
+For chips with larger amounts of (external) RAM, it is typically possible to \r
+dump a limited region where the data is typically found.\r
+\r
+Using IAR Embedded Workbench for ARM, version 6.3\r
+-------------------------------------------------\r
+In the debugger view, when stopped on a breakpoint:\r
+- Select "Debug" menu, "Memory" submenu, "Save..." (keyboard shortcut: ALT,d,y,s)\r
+- In the Save dialog\r
+       - Zone: Memory\r
+       - Start Adress: 10000000 (for NXP LPC1766 in the demo project)\r
+       - End Adress: 1000FFFF (for NXP LPC1766 in the demo project)\r
+       - File format: Intel Extended\r
+       - Filename: <name>.hex\r
+       - Press "Save" button\r
+You can now open <name>.hex in FreeRTOS+Trace.\r
+\r
+To find the right Start and End addresses, check the address of the symbol \r
+"RecorderData". The addresses does not need to match this symbol exactly, as \r
+long as the whole data is included.\r
+\r
+Using Renesas High-performance Embedded Workshop v4.09\r
+------------------------------------------------------\r
+In the debugger view, when stopped on a breakpoint:\r
+- Select "Debug" menu, "Save Memory..." (keyboard shortcut: ALT,d,a)\r
+- In the Save dialog\r
+       - Format: Binary\r
+       - Filename: <name>.bin\r
+       - Start Address: 00000000 (For RX62N in the demo project)\r
+       - End Address: 0000FFFF (For RX62N in the demo project)\r
+       - Access size: 1\r
+       - Press "Save" button and open <name>.bin in FreeRTOS+Trace.\r
+       \r
+Using Microchip MPLAB v8.86\r
+------------------------------------------------------\r
+- Select "View" -> "File Registers". This shows you the memory contents.\r
+- Make sure "Hex" is selected in the bottom left (instead of "Symbolic"). Hex mode seems to be default.\r
+- Right click in the view and select "Export Table...".\r
+- In the dialog ("Export As"), make sure "Single Column Output" is selected (seems to be default).\r
+- Select start address 0x0000 and make sure the end address is beyond the RecorderData structure. \r
+  The default values seems to be the whole RAM, so you probably don't need to change this.\r
+- Save as a .mch file and open this file in FreeRTOS+Trace v2.2.4 or later (support for the .mch format was added in v2.2.4).\r
+\r
+Using STM32 ST-Link\r
+------------------------------------------------------\r
+- Start "ST-Link Utility"\r
+- Connect to the device and view the device memory.\r
+- Set the view to display the entire RAM, or at least the section containing the RecorderData structure.\r
+- Select "Save as" and choose binary (.bin) or Intel Hex (.hex) format.\r
+- Open the resulting file in FreeRTOS+Trace.\r
+\r
+In case you have any question, contact support@percepio.com\r
+\r
+Percepio AB\r
+www.percepio.com\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/readme.txt b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/readme.txt
new file mode 100644 (file)
index 0000000..0553c8b
--- /dev/null
@@ -0,0 +1,53 @@
+\r
+FreeRTOS+Trace Trace Recorder Library\r
+-------------------------------------\r
+Percepio AB\r
+www.percepio.com\r
+\r
+This directory contains the core trace recorder library used by FreeRTOS+Trace v2.3. \r
+\r
+Ready-to-run demonstrations projects are found at www.percepio.com.\r
+\r
+For information on how to integrate the recorder library in your FreeRTOS build, see\r
+the FreeRTOS+Trace User Manual, section 2.\r
+\r
+For information on how to upload the trace data from your target system RAM to \r
+FreeRTOS+Trace, see "debugger trace upload.txt"\r
+\r
+NOTE: This trace recorder library requires FreeRTOS v7.3.0 or later.\r
+\r
+Files included\r
+--------------\r
+- trcConfig.h               - The recorder's configuration file, check this!\r
+- trcUser.c / trcUser.h     - The main API towards the application (trcUser.h in the only include necessary).\r
+- trcKernel.c / trcKernel.h - Internal routines for storing kernel events.\r
+- trcBase.c / trcBase.h     - Internal routines for manipulating the data structures and calculating timestamps.\r
+- trcPort.c / trcPort.h     - The port layer, abstracting the hardware (mainly the timer used for timestamping).\r
+- trcHooks.h                           - The interface between FreeRTOS and the recorder, containing trace macro defintions.\r
+- trcTypes.h                           - Type definitions used.\r
+\r
+Hardware Timer Ports\r
+--------------------\r
+This release contains hardware timer ports for the following hardware architectures:\r
+\r
+- ARM Cortex M3/M4 (all brands, such as Atmel SAM3/SAM4, NXP 17xx, 18xx, 43xx, STM32, Freescale Kinetis, ...)\r
+- Atmel AT91SAM7x\r
+- Atmel AT32UC3 (AVR32)\r
+- Renesas RX600 (e.g., RX62N)\r
+- Microchip dsPIC/PIC24\r
+\r
+These are defined in trcPort.h. This also contains several "unofficial" ports, provided by external contributors.\r
+By unofficial, it means that they are not yet verified by Percepio AB. Please refer to trcPort.h for detailed information. \r
+If you use an unofficial port and beleive it is incorrect, please let us know!\r
+\r
+In case your MCU is not yet supported directly, developing a new port is quite easy, just a matter of defining a few macros\r
+according to your specific MCU. See trcPort.h for further information.\r
+\r
+In case you have any questions, do not hesitate to contact support@percepio.com\r
+\r
+Percepio AB\r
+Köpmangatan 1A\r
+72215 VästerÃ¥s\r
+Sweden\r
+\r
+www.percepio.com
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcBase.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcBase.c
new file mode 100644 (file)
index 0000000..c80915c
--- /dev/null
@@ -0,0 +1,992 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcBase.c\r
+ *\r
+ * Core functionality of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+/*******************************************************************************\r
+ * Static data initializations\r
+ ******************************************************************************/\r
+\r
+\r
+/*******************************************************************************\r
+ * RecorderData\r
+ *\r
+ * The main data structure. This is the data read by FreeRTOS+Trace, typically\r
+ * through a debugger RAM dump. The recorder access this through the pointer\r
+ * RecorderDataPtr, to allow for dynamic memory allocation as well.\r
+ *\r
+ * On the NXP LPC17xx you may use the secondary RAM bank (AHB RAM) for this\r
+ * purpose. For instance, the LPC1766 has 32 KB AHB RAM which allows for \r
+ * allocating a buffer size of at least 7500 events without affecting the main\r
+ * RAM. To place RecorderData in this RAM bank, use the below declaration.\r
+ * \r
+ *     #pragma location="AHB_RAM_MEMORY"\r
+ *     RecorderDataType RecorderData = ...\r
+ * \r
+ * This of course works for other hardware architectures with additional RAM \r
+ * banks as well, just replace "AHB_RAM_MEMORY" with the name of the right \r
+ * address section from the linker file.\r
+ *\r
+ * However, to keep trcBase.c portable and still have a preconfigured IAR demo\r
+ * using AHB RAM, we don't add the pragma directly in trcBase.c but in a header \r
+ * included where the pragma should go. This is used depending on the setting\r
+ * USE_LINKER_PRAGMA, defined in trcConfig.h.\r
+ * \r
+ * If using GCC, this is instead done by adding a "section" attribute:\r
+ *\r
+ *     RecorderDataType RecorderData __attribute__ ((section ("name"))) = ...\r
+ *\r
+ * Remember to replace "name" with the correct section name.\r
+ ******************************************************************************/\r
+\r
+#if (TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_STATIC)\r
+#if (USE_LINKER_PRAGMA == 1)\r
+#include "recorderdata_linker_pragma.h"\r
+#endif\r
+RecorderDataType RecorderData =\r
+{\r
+    /* start marker, 12 chars */\r
+    0x01, 0x02, 0x03, 0x04,\r
+    0x71, 0x72, 0x73, 0x74,\r
+    0xF1, 0xF2, 0xF3, 0xF4,\r
+\r
+    /* version code - also used to determine endianness */\r
+    VERSION,\r
+\r
+    /* minor file format version */\r
+    MINOR_VERSION,\r
+    \r
+    /* irq priority order */\r
+    IRQ_PRIORITY_ORDER,\r
+\r
+    /* file size (for control) */\r
+    sizeof(RecorderDataType),\r
+\r
+    /* number of events stored so far */\r
+    0,\r
+\r
+    /* size of events buffer (in event records, each 4 bytes) */\r
+    EVENT_BUFFER_SIZE,\r
+\r
+    /* next free event index (event index, not byte address) */\r
+    0,\r
+\r
+    /* buffer is full */ \r
+    0,\r
+\r
+    /* frequency of clock user for timestamps, in Hz - should be 0 here\r
+    as this is used to indicate "not yet initialized" - this is instead\r
+    initialized on the first taskswitch event. */\r
+    0,\r
+\r
+    /* the absolute timestamp of the last stored event, modulo frequency */\r
+    0,\r
+\r
+    /* the number of seconds so far */\r
+    0,\r
+\r
+    /* is recorder active (yes = 1) - note that "close" events are always \r
+        stored to keep the name-handle mapping updated!*/\r
+    0,\r
+\r
+    /* Generated by FreeRTOS+Trace in Team Admin mode. Otherwise this should be "". */\r
+    TEAM_LICENSE_CODE,\r
+\r
+    /* debug marker 0 */\r
+    0xF0F0F0F0,\r
+\r
+    /* The Object Property Table - holds info of all active objects */ \r
+    {\r
+        /* Number of object classes, also those not used */\r
+        NCLASSES,\r
+\r
+        /* The size in bytes of the object table byte pool */\r
+        DynObjTableSize,\r
+\r
+        /* The number of slots/handles available for each class */\r
+        {\r
+            NQueue,\r
+            NSemaphore,\r
+            NMutex,\r
+            NTask,\r
+            NISR\r
+        },\r
+\r
+        /* The maximum name length for each object class */\r
+        {\r
+            NameLenQueue,\r
+            NameLenSemaphore,\r
+            NameLenMutex,\r
+            NameLenTask,\r
+            NameLenISR\r
+        },\r
+\r
+        /* The total length a property table entry of the class */\r
+        {\r
+            PropertyTableSizeQueue,\r
+            PropertyTableSizeSemaphore,\r
+            PropertyTableSizeMutex,\r
+            PropertyTableSizeTask,\r
+            PropertyTableSizeISR\r
+        },\r
+\r
+        /* The start index of each class in the object property table */\r
+        {\r
+            StartIndexQueue,\r
+            StartIndexSemaphore,\r
+            StartIndexMutex,\r
+            StartIndexTask,\r
+            StartIndexISR\r
+        },\r
+\r
+        /* the object property table - encoded in a byte array using above \r
+        definitions */\r
+        {0}\r
+    },\r
+\r
+    /* debug marker 1 */\r
+    0xF1F1F1F1,\r
+\r
+    /* The Symbol Table - holds all object names used since system \r
+       startup. Every string is unique, so objects with same name will share \r
+       an entry. Each name entry has four extra bytes: byte 0-1 is a link \r
+       reference in an internal linked list, used for fast lookups, byte 2-3 \r
+       holds a reference to a channel label used for vTracePrintF format \r
+       strings, and byte 4.. holds the object name, followed by a \r
+       zero-termination.*/\r
+    {\r
+        SYMBOL_TABLE_SIZE,\r
+\r
+        /* next free index (0 is reserved to mean NULL) */\r
+        1,\r
+\r
+        /* the symbol table byte pool */\r
+        {0},\r
+\r
+        /* this is a 64 entry array holding 16-bit references (indexes) \r
+           to the most recent entry of each checksum - i.e., list heads.*/\r
+        {0},\r
+\r
+    },\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    /* example float, for float endian detection */\r
+    (float)1.0,\r
+#else\r
+    /* This code signals that no float support is included */\r
+    (uint32_t)0, \r
+#endif\r
+\r
+    /* internalErrorOccured */\r
+    0,\r
+    \r
+    /* debug marker 2 */\r
+    0xF2F2F2F2,\r
+    \r
+    /* The trace description string, can hold any information about the system, \r
+        e.g., version, configuration. Error messages from the recorder are\r
+        copied to this buffer. Also used for internal error messages.*/\r
+    TRACE_DESCRIPTION,\r
+        \r
+    /* debug marker 3 */\r
+    0xF3F3F3F3,\r
+\r
+    /* the event data buffer, size EVENT_BUFFER_SIZE*4 */\r
+    {0},\r
+\r
+    /* end markers, used to extract the trace from a RAM dump image */\r
+    0x0A, 0x0B, 0x0C, 0x0D,\r
+    0x71, 0x72, 0x73, 0x74,\r
+    0xF1, 0xF2, 0xF3, 0xF4\r
+};\r
+\r
+RecorderDataType* RecorderDataPtr = &RecorderData;\r
+\r
+/* This version of the function does nothing as the trace data is statically allocated */\r
+RecorderDataType* xTraceInitTraceData(void)\r
+{\r
+    return 0;\r
+}\r
+\r
+#elif (TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_DYNAMIC)\r
+\r
+RecorderDataType* RecorderDataPtr = NULL;\r
+\r
+/* This version of the function dynamically allocates the trace data */\r
+RecorderDataType* xTraceInitTraceData(void)\r
+{\r
+    RecorderDataType* tmp = (RecorderDataType*)pvPortMalloc(sizeof(RecorderDataType));\r
+\r
+    if (! tmp)\r
+    {\r
+        vTraceError("Malloc failed in xTraceInitTraceData! Reduce size constants in trcConfig.h");\r
+        return NULL;\r
+    }\r
+    \r
+    (void)memset(tmp, 0, sizeof(RecorderDataType));\r
+\r
+    tmp->startmarker0 = 0x01;\r
+    tmp->startmarker1 = 0x02;\r
+    tmp->startmarker2 = 0x03;\r
+    tmp->startmarker3 = 0x04;\r
+    tmp->startmarker4 = 0x71;\r
+    tmp->startmarker5 = 0x72;\r
+    tmp->startmarker6 = 0x73;\r
+    tmp->startmarker7 = 0x74;\r
+    tmp->startmarker8 = 0xF1;\r
+    tmp->startmarker9 = 0xF2;\r
+    tmp->startmarker10 = 0xF3;\r
+    tmp->startmarker11 = 0xF4;\r
+    tmp->version = VERSION;\r
+    tmp->minor_version = MINOR_VERSION;\r
+    tmp->irq_priority_order = IRQ_PRIORITY_ORDER;\r
+    tmp->filesize = sizeof(RecorderDataType);\r
+    \r
+    tmp->maxEvents = EVENT_BUFFER_SIZE;\r
+    \r
+    tmp->debugMarker0 = 0xF0F0F0F0;\r
+    tmp->ObjectPropertyTable.NumberOfObjectClasses = NCLASSES;\r
+    tmp->ObjectPropertyTable.ObjectPropertyTableSizeInBytes = DynObjTableSize;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[0] = NQueue;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[1] = NSemaphore;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[2] = NMutex;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[3] = NTask;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[4] = NISR;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[0] = NameLenQueue;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[1] = NameLenSemaphore;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[2] = NameLenMutex;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[3] = NameLenTask;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[4] = NameLenISR;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[0] = PropertyTableSizeQueue;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[1] = PropertyTableSizeSemaphore;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[2] = PropertyTableSizeMutex;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[3] = PropertyTableSizeTask;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[4] = PropertyTableSizeISR;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[0] = StartIndexQueue;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[1] = StartIndexSemaphore;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[2] = StartIndexMutex;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[3] = StartIndexTask;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[4] = StartIndexISR;    \r
+    tmp->debugMarker1 = 0xF1F1F1F1;\r
+    tmp->SymbolTable.symTableSize = SYMBOL_TABLE_SIZE;\r
+    tmp->SymbolTable.nextFreeSymbolIndex = 1;\r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    tmp->exampleFloatEncoding = (float)1.0; /* otherwize already zero */\r
+#endif\r
+    tmp->debugMarker2 = 0xF2F2F2F2;    \r
+    (void)strncpy(tmp->systemInfo, TRACE_DESCRIPTION, TRACE_DESCRIPTION_MAX_LENGTH);\r
+    tmp->debugMarker3 = 0xF3F3F3F3;\r
+    tmp->endmarker0 = 0x0A;\r
+    tmp->endmarker1 = 0x0B;\r
+    tmp->endmarker2 = 0x0C;\r
+    tmp->endmarker3 = 0x0D;\r
+    tmp->endmarker4 = 0x71;\r
+    tmp->endmarker5 = 0x72;\r
+    tmp->endmarker6 = 0x73;\r
+    tmp->endmarker7 = 0x74;\r
+    tmp->endmarker8 = 0xF1;\r
+    tmp->endmarker9 = 0xF2;\r
+    tmp->endmarker10 = 0xF3;\r
+    tmp->endmarker11 = 0xF4;\r
+    \r
+    RecorderDataPtr = tmp;\r
+\r
+    return (RecorderDataType*)RecorderDataPtr;\r
+}\r
+\r
+#endif\r
+\r
+volatile int recorder_busy = 0;\r
+\r
+char sprintfBuffer[150];\r
+\r
+/* For debug printouts - the names of the object classes */\r
+char OBJECTCLASSNAME[NCLASSES][10] =\r
+{\r
+        "QUEUE",\r
+        "SEMAPHORE",\r
+        "MUTEX",\r
+        "TASK",\r
+        "ISR"\r
+};\r
+\r
+/* Initialization of the handle mechanism, see e.g, xTraceGetObjectHandle */\r
+objectHandleStackType objectHandleStacks =\r
+{\r
+        /* indexOfNextAvailableHandle */\r
+        {\r
+                0,\r
+                NQueue,\r
+                NQueue + NSemaphore,\r
+                NQueue + NSemaphore + NMutex,\r
+                NQueue + NSemaphore + NMutex + NTask\r
+        },\r
+\r
+        /* lowestIndexOfClass */\r
+        {\r
+                0,\r
+                NQueue,\r
+                NQueue + NSemaphore,\r
+                NQueue + NSemaphore + NMutex,\r
+                NQueue + NSemaphore + NMutex + NTask\r
+        },\r
+\r
+        /* highestIndexOfClass */\r
+        {\r
+                NQueue - 1,\r
+                NQueue + NSemaphore - 1,\r
+                NQueue + NSemaphore + NMutex - 1,\r
+                NQueue + NSemaphore + NMutex + NTask - 1,\r
+                NQueue + NSemaphore + NMutex + NTask + NISR - 1\r
+        },\r
+        {0},\r
+        {0}\r
+};\r
+\r
+\r
+/* Used for internal state flags of objects */\r
+uint8_t excludedFlags[(NEventCodes+NQueue+NSemaphore+NMutex+NTask) / 8 + 1];\r
+uint8_t ifeFlags[NTask / 8 + 1];\r
+\r
+/* Gives the last error message of the recorder. NULL if no error message. */\r
+char* traceErrorMessage = NULL;\r
+\r
+void* xTraceNextFreeEventBufferSlot(void)\r
+{\r
+    if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+    {\r
+        vTraceError("Attempt to index outside event buffer!");\r
+        return NULL;\r
+    }\r
+    return (void*)(&RecorderDataPtr->\r
+                   eventData[RecorderDataPtr->nextFreeIndex*4]);\r
+}\r
+\r
+uint16_t uiIndexOfObject(objectHandleType objecthandle, uint8_t objectclass)\r
+{\r
+    if ((objectclass < NCLASSES) && (objecthandle > 0) && (objecthandle <= \r
+    RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))\r
+    {\r
+        return (uint16_t)(RecorderDataPtr->\r
+            ObjectPropertyTable.StartIndexOfClass[objectclass] + \r
+            (RecorderDataPtr->\r
+            ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * \r
+            (objecthandle-1)));\r
+    }\r
+    \r
+    vTraceError("Object table lookup with invalid object handle or object class!");    \r
+    return 0;\r
+}\r
+\r
+/*******************************************************************************\r
+ * Object handle system \r
+ * This provides a mechanism to assign each kernel object (tasks, queues, etc)\r
+ * with a 1-byte handle, that is used to identify the object in the trace.\r
+ * This way, only one byte instead of four is necessary to identify the object.\r
+ * This allows for maximum 255 objects, of each object class, active at any\r
+ * moment.\r
+ * Note that zero is reserved as an error code and is not a valid handle.\r
+ * \r
+ * In order to allow for fast dynamic allocation and release of object handles, \r
+ * the handles of each object class (e.g., TASK) are stored in a stack. When a \r
+ * handle is needed, e.g., on task creation, the next free handle is popped from \r
+ * the stack. When an object (e.g., task) is deleted, its handle is pushed back \r
+ * on the stack and can thereby be reused for other objects.\r
+ * \r
+ * Since this allows for reuse of object handles, a specific handle (e.g, "8") \r
+ * may refer to TASK_X at one point, and later mean "TASK_Y". To resolve this, \r
+ * the recorder uses "Close events", which are stored in the main event buffer \r
+ * when objects are deleted and their handles are released. The close event \r
+ * contains the mapping between object handle and object name which was valid up\r
+ * to this point in time. The object name is stored as a symbol table entry. \r
+ ******************************************************************************/\r
+\r
+objectHandleType xTraceGetObjectHandle(traceObjectClass objectclass)\r
+{\r
+    static objectHandleType handle;\r
+    static int indexOfHandle;\r
+\r
+    indexOfHandle = objectHandleStacks.indexOfNextAvailableHandle[objectclass];\r
+    if (objectHandleStacks.objectHandles[indexOfHandle] == 0)\r
+    {\r
+        /* Zero is used to indicate a never before used handle, i.e.,\r
+           new slots in the handle stack. The handle slot needs to \r
+           be initialized here (starts at 1). */\r
+        objectHandleStacks.objectHandles[indexOfHandle] = \r
+            (objectHandleType)(1 + indexOfHandle - \r
+            objectHandleStacks.lowestIndexOfClass[objectclass]);\r
+    }\r
+\r
+    handle = objectHandleStacks.objectHandles[indexOfHandle];\r
+    \r
+    if ( objectHandleStacks.indexOfNextAvailableHandle[objectclass] \r
+        > objectHandleStacks.highestIndexOfClass[objectclass] )\r
+    {\r
+        /* ERROR */\r
+        switch(objectclass)\r
+        {\r
+        case TRACE_CLASS_TASK:\r
+            vTraceError("Not enough TASK handles - increase NTask in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_ISR:\r
+            vTraceError("Not enough ISR handles - increase NISR in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_SEMAPHORE:\r
+            vTraceError("Not enough SEMAPHORE handles - increase NSemaphore in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_MUTEX:\r
+            vTraceError("Not enough MUTEX handles - increase NMutex in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_QUEUE:\r
+            vTraceError("Not enough QUEUE handles - increase NQueue in trcConfig.h");         \r
+            break;\r
+        default:\r
+            vTraceError("Invalid object class.");\r
+            break;\r
+        }\r
+        \r
+        handle = 0; /* an invalid/anonymous handle - but the recorder is stopped now... */\r
+    }\r
+    else\r
+    {\r
+        int hndCount;\r
+        objectHandleStacks.indexOfNextAvailableHandle[objectclass]++;\r
+        \r
+        hndCount = objectHandleStacks.indexOfNextAvailableHandle[objectclass] - \r
+            objectHandleStacks.lowestIndexOfClass[objectclass];\r
+        \r
+        if (hndCount > \r
+            objectHandleStacks.handleCountWaterMarksOfClass[objectclass])\r
+        {\r
+            objectHandleStacks.handleCountWaterMarksOfClass[objectclass] = \r
+                (objectHandleType)hndCount;\r
+        }\r
+    }\r
+\r
+    return handle;\r
+}\r
+\r
+void vTraceFreeObjectHandle(traceObjectClass objectclass, objectHandleType handle)\r
+{\r
+    int indexOfHandle;\r
+\r
+    /* Check that there is room to push the handle on the stack */\r
+    if ( (objectHandleStacks.indexOfNextAvailableHandle[objectclass] - 1) < \r
+        objectHandleStacks.lowestIndexOfClass[objectclass] )\r
+    {\r
+        /* Error */\r
+        vTraceError("Attempt to free more handles than allocated! (duplicate xTaskDelete or xQueueDelete?)");\r
+    }\r
+    else\r
+    {\r
+        objectHandleStacks.indexOfNextAvailableHandle[objectclass]--;\r
+        indexOfHandle = objectHandleStacks.indexOfNextAvailableHandle[objectclass];\r
+        objectHandleStacks.objectHandles[indexOfHandle] = handle;\r
+    }\r
+\r
+}\r
+\r
+/*******************************************************************************\r
+ * Objects Property Table \r
+ *\r
+ * This holds the names and properties of the currently active objects, such as\r
+ * tasks and queues. This is developed to support "dynamic" objects which might\r
+ * be deleted during runtime. Their handles are only valid during their\r
+ * lifetime, i.e., from create to delete, as they might be reused on later\r
+ * create operations. When an object is deleted from the OPT, its data is moved\r
+ * to the trace buffer and/or the symbol table.\r
+ * When an object (task, queue, etc.) is created, it receives a handle, which\r
+ * together with the object class specifies its location in the OPT. Thus,\r
+ * objects of different types may share the same name and/or handle, but still\r
+ * be independent objects.\r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * vTraceSetObjectName\r
+ *\r
+ * Registers the names of queues, semaphores and other kernel objects in the\r
+ * recorder's Object Property Table, at the given handle and object class.\r
+ ******************************************************************************/\r
+void vTraceSetObjectName(traceObjectClass objectclass, \r
+                         objectHandleType handle, \r
+                         const char* name)\r
+{\r
+    static uint16_t idx;\r
+\r
+    if (handle == 0)\r
+    {\r
+        vTraceError("Illegal handle (0) in vTraceSetObjectName.");   \r
+        return;\r
+    }\r
+    \r
+    switch(objectclass)\r
+    {\r
+        case TRACE_CLASS_TASK:\r
+        case TRACE_CLASS_ISR:\r
+        case TRACE_CLASS_SEMAPHORE:\r
+        case TRACE_CLASS_MUTEX:\r
+        case TRACE_CLASS_QUEUE:\r
+        break;\r
+    default:\r
+        vTraceError("Illegal object class in vTraceSetObjectName");   \r
+        break;            \r
+    }\r
+\r
+    if (handle > \r
+        RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass])\r
+    {\r
+        switch(objectclass)\r
+        {\r
+            case TRACE_CLASS_TASK:\r
+            vTraceError("Not enough TASK handles - increase NTask in trcConfig.h");         \r
+            break;\r
+            case TRACE_CLASS_ISR:\r
+            vTraceError("Not enough ISR handles - increase NISR in trcConfig.h");       \r
+            break;\r
+            case TRACE_CLASS_SEMAPHORE:\r
+            vTraceError("Not enough SEMAPHORE handles - increase NSemaphore in trcConfig.h");\r
+            break;\r
+            case TRACE_CLASS_MUTEX:\r
+            vTraceError("Not enough MUTEX handles - increase NMutex in trcConfig.h");\r
+            break;\r
+            case TRACE_CLASS_QUEUE:\r
+            vTraceError("Not enough QUEUE handles - increase NQueue in trcConfig.h");\r
+            break;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        idx = uiIndexOfObject(handle, objectclass);\r
+\r
+        if (traceErrorMessage == NULL)\r
+        {\r
+            (void)strncpy((char*)&(RecorderDataPtr->ObjectPropertyTable.objbytes[idx]),\r
+                    name,\r
+                    RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[ objectclass ] );\r
+#ifdef WIN32\r
+            printf("vTraceSetObjectName(%d, %d, %s)\n", objectclass, handle, name);\r
+#endif\r
+        }\r
+    }\r
+}\r
+\r
+traceLabel prvTraceOpenSymbol(const char* name, traceLabel userEventChannel)\r
+{\r
+    static uint16_t result;\r
+    static uint8_t len;\r
+    static uint8_t crc;\r
+    len = 0;\r
+    crc = 0;\r
+    prvTraceGetChecksum(name, &crc, &len);\r
+\r
+    trcCRITICAL_SECTION_BEGIN();\r
+    result = prvTraceLookupSymbolTableEntry(name, crc, len, userEventChannel);\r
+    if (!result)\r
+    {\r
+        result = prvTraceCreateSymbolTableEntry(name, crc, len, userEventChannel);\r
+    }\r
+    trcCRITICAL_SECTION_END();\r
+\r
+    return result;\r
+}\r
+\r
+/*******************************************************************************\r
+ * Supporting functions\r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * vTraceError\r
+ *\r
+ * Called by various parts in the recorder. Stops the recorder and stores a \r
+ * pointer to an error message, which is printed by the monitor task.\r
+ * If you are not using the monitor task, you may use xTraceGetLastError() \r
+ * from your application to check if the recorder is OK.\r
+ *\r
+ * Note: If a recorder error is registered before vTraceStart is called, the \r
+ * trace start will be aborted. This can occur if any of the Nxxxx constants \r
+ * (e.g., NTask) in trcConfig.h is too small.\r
+ ******************************************************************************/\r
+void vTraceError(const char* msg)\r
+{\r
+    vTraceStop();\r
+    if (traceErrorMessage == NULL)\r
+    {\r
+      traceErrorMessage = (char*)msg;\r
+      (void)strncpy(RecorderDataPtr->systemInfo, \r
+          traceErrorMessage, \r
+          TRACE_DESCRIPTION_MAX_LENGTH);\r
+      RecorderDataPtr->internalErrorOccured = 1;\r
+    }\r
+}\r
+\r
+/******************************************************************************\r
+ * prvCheckDataToBeOverwrittenForMultiEntryUserEvents\r
+ *\r
+ * This checks if the next event to be overwritten is a multi-entry user event, \r
+ * i.e., a USER_EVENT followed by data entries.\r
+ * Such data entries do not have an event code at byte 0, as other events.\r
+ * All 4 bytes are user data, so the first byte of such data events must \r
+ * not be interpreted as type field. The number of data entries following\r
+ * a USER_EVENT is given in the event code of the USER_EVENT.\r
+ * Therefore, when overwriting a USER_EVENT (when using in ringbuffer mode)\r
+ * any data entries following must be replaced with NULL events (code 0).\r
+ *\r
+ * This is assumed to execute within a critical section...\r
+ *****************************************************************************/\r
+\r
+void prvCheckDataToBeOverwrittenForMultiEntryUserEvents(\r
+    uint8_t nofEntriesToCheck)\r
+{\r
+    /* Generic "int" type is desired - should be 16 bit variable on 16 bit HW */\r
+    unsigned int i = 0; \r
+    unsigned int e = 0;\r
+    while (i < nofEntriesToCheck)\r
+    {        \r
+        e = RecorderDataPtr->nextFreeIndex + i;\r
+        if ((RecorderDataPtr->eventData[e*4] > USER_EVENT) && \r
+            (RecorderDataPtr->eventData[e*4] < USER_EVENT + 16))\r
+        {\r
+            uint8_t nDataEvents = (uint8_t)(RecorderDataPtr->eventData[e*4] - USER_EVENT);\r
+            if ((e + nDataEvents) < RecorderDataPtr->maxEvents)\r
+            {\r
+                (void)memset(& RecorderDataPtr->eventData[e*4], 0, 4 + 4 * nDataEvents);\r
+            }\r
+        }\r
+        i++;\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceUpdateCounters\r
+ *\r
+ * Updates the index of the event buffer.\r
+ ******************************************************************************/\r
+void prvTraceUpdateCounters(void)\r
+{\r
+    if (RecorderDataPtr->recorderActive == 0)\r
+    {\r
+        return;\r
+    }\r
+    \r
+    RecorderDataPtr->numEvents++;\r
+\r
+    RecorderDataPtr->nextFreeIndex++;\r
+    \r
+    if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+    {   \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)       \r
+        RecorderDataPtr->bufferIsFull = 1;\r
+        RecorderDataPtr->nextFreeIndex = 0;\r
+#else\r
+        vTraceStop();\r
+#endif\r
+    }\r
+\r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+    prvCheckDataToBeOverwrittenForMultiEntryUserEvents(1);\r
+#endif\r
+    \r
+#ifdef STOP_AFTER_N_EVENTS\r
+#if (STOP_AFTER_N_EVENTS > -1)\r
+    if (RecorderDataPtr->numEvents >= STOP_AFTER_N_EVENTS)\r
+    {\r
+        vTraceStop();\r
+    }\r
+#endif\r
+#endif\r
+}\r
+    \r
+/******************************************************************************\r
+ * prvTraceGetDTS\r
+ *\r
+ * Returns a differential timestamp (DTS), i.e., the time since\r
+ * last event, and creates an XTS event if the DTS does not fit in the\r
+ * number of bits given. The XTS event holds the MSB bytes of the DTS.\r
+ *\r
+ * The parameter param_maxDTS should be 0xFF for 8-bit dts or 0xFFFF for\r
+ * events with 16-bit dts fields.\r
+ *****************************************************************************/\r
+uint16_t prvTraceGetDTS(uint16_t param_maxDTS)\r
+{\r
+    static uint32_t old_timestamp = 0;\r
+    XTSEvent* xts = 0;\r
+    uint32_t dts = 0;\r
+    uint32_t timestamp = 0;\r
+\r
+    if (RecorderDataPtr->frequency == 0)\r
+    {\r
+        /* If HWTC_PERIOD is mapped to the timer reload register,\r
+        such as in the Cortex M port, it is not initialized before\r
+        FreeRTOS has been started. We therefore store the frequency\r
+        of the timer at the first timestamped event after the \r
+        scheduler has started. (Note that this function is called\r
+        also by vTraceStart and uiTraceStart, which might be\r
+        called before the scheduler has been started.) */\r
+\r
+#if (SELECTED_PORT == PORT_Win32)    \r
+        RecorderDataPtr->frequency = 100000;\r
+#elif (SELECTED_PORT == PORT_HWIndependent)    \r
+        RecorderDataPtr->frequency = configTICK_RATE_HZ;\r
+#else        \r
+        if (xTaskGetSchedulerState() != 0) /* Has the scheduler started? */\r
+        {            \r
+            RecorderDataPtr->frequency = \r
+                 (uint32_t)HWTC_PERIOD * (uint32_t)configTICK_RATE_HZ / (uint32_t)HWTC_DIVISOR; \r
+        }\r
+#endif\r
+    }\r
+\r
+    /**************************************************************************\r
+    * The below statements read the timestamp from the timer port module.\r
+    * If necessary, whole seconds are extracted using division while the rest\r
+    * comes from the modulo operation.\r
+    **************************************************************************/\r
+    \r
+    uiTracePortGetTimeStamp(&timestamp);\r
+\r
+    /***************************************************************************\r
+    * This condition is only for the Win32 port, since it does not use the tick\r
+    * count but instead only HWTC_COUNT (from the performance counter).\r
+    * Without this condition, you sometimes get a negative dts value (converted\r
+    * into a very large unsiged value) when the performance counter wraps \r
+    * around. In other "normal" ports also using the FreeRTOS tick counter, this \r
+    * condition can not occur and therefore has no impact.\r
+    ***************************************************************************/\r
+    if (timestamp < old_timestamp)\r
+    {\r
+        timestamp += RecorderDataPtr->frequency;\r
+    }\r
+\r
+\r
+       dts = timestamp - old_timestamp;\r
+    old_timestamp = timestamp;\r
+    \r
+    if (RecorderDataPtr->frequency > 0)\r
+    {\r
+        /* Check if dts > 1 second */\r
+        if (dts > RecorderDataPtr->frequency)\r
+        {\r
+            /* More than 1 second has passed */\r
+            RecorderDataPtr->absTimeLastEventSecond += dts / RecorderDataPtr->frequency;\r
+            /* The part that is not an entire second is added to absTimeLastEvent */\r
+            RecorderDataPtr->absTimeLastEvent += dts % RecorderDataPtr->frequency;\r
+        }\r
+        else\r
+            RecorderDataPtr->absTimeLastEvent += dts;\r
+        \r
+        /* Check if absTimeLastEvent >= 1 second */\r
+        if (RecorderDataPtr->absTimeLastEvent >= RecorderDataPtr->frequency)\r
+        {\r
+            /* RecorderDataPtr->absTimeLastEvent is more than or equal to 1 second, but always less than 2 seconds */\r
+            RecorderDataPtr->absTimeLastEventSecond++;\r
+            RecorderDataPtr->absTimeLastEvent -= RecorderDataPtr->frequency;\r
+            /* RecorderDataPtr->absTimeLastEvent is now less than 1 second */\r
+        }\r
+    }\r
+    else\r
+    {\r
+        /* Special case if the recorder has not yet started (frequency may be uninitialized, i.e., zero) */\r
+        RecorderDataPtr->absTimeLastEvent = timestamp;\r
+    }\r
+\r
+    /* If the dts (time since last event) does not fit in event->dts (only 8 or 16 bits) */\r
+    if (dts > param_maxDTS)\r
+    {\r
+        /* Create an XTS event (eXtended TimeStamp) containing the higher dts bits*/\r
+        xts = (XTSEvent*) xTraceNextFreeEventBufferSlot();\r
+\r
+        if (xts != NULL)\r
+        {\r
+            if (param_maxDTS == 0xFFFF)\r
+            {\r
+                xts->type = XTS16;\r
+                xts->xts_16 = (uint16_t)((dts / 0x10000) & 0xFFFF);\r
+                xts->xts_8 = 0;\r
+            }\r
+            else if (param_maxDTS == 0xFF)\r
+            {\r
+                xts->type = XTS8;\r
+                xts->xts_16 = (uint16_t)((dts / 0x100) & 0xFFFF);\r
+                xts->xts_8 = (uint8_t)((dts / 0x1000000) & 0xFF);\r
+            }\r
+            else\r
+            {\r
+                vTraceError("Bad param_maxDTS in prvTraceGetDTS");\r
+            }\r
+            prvTraceUpdateCounters();\r
+        }\r
+    }\r
+\r
+    return (uint16_t)(dts % (param_maxDTS + 1));\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceLookupSymbolTableEntry\r
+ *\r
+ * Find an entry in the symbol table, return 0 if not present.\r
+ *\r
+ * The strings are stored in a byte pool, with four bytes of "meta-data" for\r
+ * every string.\r
+ * byte 0-1: index of next entry with same checksum (for fast lookup).\r
+ * byte 2-3: reference to a symbol table entry, a label for vTracePrintF\r
+ * format strings only (the handle of the destination channel).\r
+ * byte 4..(4 + length): the string (object name or user event label), with\r
+ * zero-termination\r
+ ******************************************************************************/\r
+traceLabel prvTraceLookupSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel chn)\r
+{\r
+    uint16_t i = RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ];\r
+\r
+    while (i != 0)\r
+    {\r
+        if (RecorderDataPtr->SymbolTable.symbytes[i + 2] == (chn & 0x00FF))\r
+        {\r
+            if (RecorderDataPtr->SymbolTable.symbytes[i + 3] == (chn / 0x100))\r
+            {\r
+                if (RecorderDataPtr->SymbolTable.symbytes[i + 4 + len] == '\0')\r
+                {\r
+                    if (strncmp((char*)(& RecorderDataPtr->SymbolTable.symbytes[i + 4]), name, len) == 0)\r
+                    {\r
+                        break; /* found */\r
+                    }\r
+                }\r
+            }\r
+        }\r
+        i = (uint16_t)(RecorderDataPtr->SymbolTable.symbytes[i] + (RecorderDataPtr->SymbolTable.symbytes[i + 1] * 0x100));\r
+    }\r
+    return i;\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceCreateSymbolTableEntry\r
+ *\r
+ * Creates an entry in the symbol table, independent if it exists already.\r
+ *\r
+ * The strings are stored in a byte pool, with four bytes of "meta-data" for\r
+ * every string.\r
+ * byte 0-1: index of next entry with same checksum (for fast lookup).\r
+ * byte 2-3: reference to a symbol table entry, a label for vTracePrintF\r
+ * format strings only (the handle of the destination channel).\r
+ * byte 4..(4 + length): the string (object name or user event label), with\r
+ * zero-termination\r
+ ******************************************************************************/\r
+uint16_t prvTraceCreateSymbolTableEntry(const char* name, \r
+                                        uint8_t crc6, \r
+                                        uint8_t len, \r
+                                        traceLabel channel)\r
+{\r
+    uint16_t ret = 0;\r
+    if (RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + len + 4 >= SYMBOL_TABLE_SIZE)\r
+    {\r
+        vTraceError("Symbol table full. Increase SYMBOL_TABLE_SIZE in trcConfig.h");\r
+        ret = 0;        \r
+    }\r
+    else\r
+    {\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex] = \r
+            (uint8_t)(RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ] & 0x00FF);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 1] = \r
+            (uint8_t)(RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ] / 0x100);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 2] = \r
+            (uint8_t)(channel & 0x00FF);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 3] = \r
+            (uint8_t)(channel / 0x100);\r
+\r
+        /* set name (bytes 4...4+len-1) */\r
+        (void)strncpy((char*)&( RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 4] ), name, len);\r
+\r
+        /* Set zero termination (at offest 4+len) */\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 4 + len] = '\0';\r
+\r
+        /* store index of entry (for return value, and as head of LL[crc6]) */\r
+        RecorderDataPtr->SymbolTable.latestEntryOfChecksum\r
+            [ crc6 ] = (uint16_t)RecorderDataPtr->SymbolTable.nextFreeSymbolIndex;\r
+        \r
+        RecorderDataPtr->SymbolTable.nextFreeSymbolIndex += (len + 5);\r
+        \r
+        ret = (uint16_t)(RecorderDataPtr->SymbolTable.nextFreeSymbolIndex - \r
+            (len + 5));\r
+    }\r
+    \r
+    return ret;\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+ * prvTraceGetChecksum\r
+ *\r
+ * Calculates a simple 6-bit checksum from a string, used to index the string \r
+ * for fast symbol table lookup.\r
+ ******************************************************************************/\r
+void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength)\r
+{\r
+   unsigned char c;\r
+   int length = 0;\r
+   int crc = 0;\r
+   if ( pname != (const char *) 0 )\r
+   {\r
+      for ( ; (c = *pname++) != '\0'; )\r
+      {\r
+         crc += c;\r
+         length++;\r
+      }\r
+   }\r
+   *pcrc = (uint8_t)(crc % 64);\r
+   *plength = (uint8_t)length;\r
+}\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcKernel.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcKernel.c
new file mode 100644 (file)
index 0000000..98b84a8
--- /dev/null
@@ -0,0 +1,491 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcKernel.c\r
+ *\r
+ * Functions for integration of the trace recorder library in the FreeRTOS \r
+ * kernel (requires FreeRTOS v7.1.0 or later).\r
+ * \r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+\r
+\r
+/******************************************************************************\r
+ * TraceObjectClassTable\r
+ * Translates a FreeRTOS QueueType into trace objects classes (TRACE_CLASS_).\r
+ * This was added since we want to map both types of Mutex and both types of \r
+ * Semaphores on common classes for all Mutexes and all Semaphores respectively. \r
+ * \r
+ * FreeRTOS Queue types\r
+ * #define queueQUEUE_TYPE_BASE                  ( 0U ) => TRACE_CLASS_QUEUE\r
+ * #define queueQUEUE_TYPE_MUTEX                 ( 1U ) => TRACE_CLASS_MUTEX\r
+ * #define queueQUEUE_TYPE_COUNTING_SEMAPHORE    ( 2U ) => TRACE_CLASS_SEMAPHORE\r
+ * #define queueQUEUE_TYPE_BINARY_SEMAPHORE      ( 3U ) => TRACE_CLASS_SEMAPHORE\r
+ * #define queueQUEUE_TYPE_RECURSIVE_MUTEX       ( 4U ) => TRACE_CLASS_MUTEX \r
+ ******************************************************************************/\r
+traceObjectClass TraceObjectClassTable[5]        =  {TRACE_CLASS_QUEUE,     \r
+                                                     TRACE_CLASS_MUTEX,      \r
+                                                     TRACE_CLASS_SEMAPHORE,  \r
+                                                     TRACE_CLASS_SEMAPHORE,\r
+                                                     TRACE_CLASS_MUTEX };\r
+\r
+/* This is defined in FreeRTOS! */\r
+extern volatile void * volatile pxCurrentTCB; \r
+\r
+/* Internal variables */\r
+uint8_t nISRactive = 0;\r
+objectHandleType handle_of_last_logged_task = 0;\r
+uint8_t inExcludedTask = 0;\r
+\r
+static uint8_t prvTraceIsObjectExcluded(traceObjectClass, uint32_t);\r
+\r
+/*******************************************************************************\r
+ * prvTraceIsObjectExcluded\r
+ *\r
+ * Private function that accepts an object class and an object number and uses\r
+ * that to determine if the object has been flagged as excluded.\r
+ ******************************************************************************/\r
+static uint8_t prvTraceIsObjectExcluded(traceObjectClass objectClass, uint32_t objectNumber)\r
+{\r
+    switch(objectClass)\r
+    {\r
+    case TRACE_CLASS_QUEUE:\r
+        return GET_QUEUE_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_SEMAPHORE:\r
+        return GET_SEMAPHORE_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_MUTEX:\r
+        return GET_MUTEX_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_TASK:\r
+        return GET_TASK_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    }\r
+    return 0;\r
+}\r
+\r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+/*******************************************************************************\r
+ * vTraceStoreTaskReady\r
+ *\r
+ * This function stores a ready state for the task handle sent in as parameter.\r
+ ******************************************************************************/\r
+void vTraceStoreTaskReady(objectHandleType handle)\r
+{\r
+    uint16_t dts3;\r
+    TREvent* tr;\r
+\r
+    if (!GET_TASK_FLAG_ISEXCLUDED(handle))\r
+    {\r
+        dts3 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+        {\r
+            tr = (TREvent*)xTraceNextFreeEventBufferSlot();\r
+\r
+            if (tr != NULL)\r
+            {\r
+                tr->type = TR_TASK_READY;\r
+                tr->dts = dts3;\r
+                tr->objHandle = handle;\r
+\r
+                prvTraceUpdateCounters();    \r
+            }\r
+        }\r
+    }\r
+}\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCall\r
+ *\r
+ * This is the main integration point for storing FreeRTOS kernel calls, and\r
+ * is called by the hooks in FreeRTOS.h (see trcKernel.h for event codes).\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCall(uint32_t ecode, traceObjectClass objectClass, uint32_t objectNumber)\r
+{\r
+    KernelCall * kse;\r
+    uint16_t dts1;\r
+\r
+    if (handle_of_last_logged_task == 0)\r
+    {\r
+        return;\r
+    }\r
+    \r
+    if (RecorderDataPtr->recorderActive)\r
+    {\r
+        \r
+        /* If it is an ISR or NOT an excluded task, this kernel call will be stored in the trace */\r
+        if (nISRactive || !inExcludedTask)\r
+        {\r
+            /* Make sure ISRs never change the IFE flags of tasks */\r
+            if (!nISRactive)\r
+            {\r
+                /* This checks if this is the first kernel call after a call to\r
+                vTraceTaskInstanceIsFinished. In that case, calls to this kernel service \r
+                with this specific kernel object become the "instance finish event"\r
+                (IFE) of the calling task.*/\r
+                if (GET_TASK_FLAG_MARKIFE(handle_of_last_logged_task))\r
+                {\r
+                    /* Reset the flag - this has been handled now */\r
+                    CLEAR_TASK_FLAG_MARKIFE(handle_of_last_logged_task);\r
+\r
+                    /* Store the kernel service tagged as instance finished event */\r
+                    PROPERTY_TASK_IFE_SERVICECODE(handle_of_last_logged_task) = \r
+                      (uint8_t)ecode;                \r
+\r
+                    /* Store the handle of the specific kernel object */\r
+                    PROPERTY_TASK_IFE_OBJHANDLE(handle_of_last_logged_task) =\r
+                      (objectHandleType)objectNumber;    \r
+                }\r
+            }\r
+            \r
+            /* Check if the referenced object or the event code is excluded */\r
+            if (!prvTraceIsObjectExcluded(objectClass, objectNumber) && !GET_EVENT_CODE_FLAG_ISEXCLUDED(ecode))\r
+            {\r
+                trcCRITICAL_SECTION_BEGIN();\r
+                dts1 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+                if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+                {           \r
+                    kse = (KernelCall*) xTraceNextFreeEventBufferSlot();\r
+                    if (kse != NULL)\r
+                    {\r
+                        kse->dts = dts1;\r
+                        kse->type = (uint8_t)ecode;\r
+                        kse->objHandle = (uint8_t)objectNumber;\r
+                        prvTraceUpdateCounters();\r
+                    }\r
+                }\r
+                trcCRITICAL_SECTION_END();\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCallWithParam\r
+ *\r
+ * Used for storing kernel calls with a handle and a numeric parameter. This is\r
+ * only used for traceTASK_PRIORITY_SET at the moment.\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCallWithParam(uint32_t evtcode,\r
+                                    traceObjectClass objectClass,\r
+                                    uint32_t objectNumber,\r
+                                    uint8_t param)\r
+{\r
+    KernelCallWithParamAndHandle * kse;\r
+    uint8_t dts2;\r
+\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task && \r
+        (! inExcludedTask || nISRactive))\r
+    {\r
+        /* Check if the referenced object or the event code is excluded */\r
+        if (!prvTraceIsObjectExcluded(objectClass, objectNumber) && !GET_EVENT_CODE_FLAG_ISEXCLUDED(evtcode))\r
+        {\r
+            trcCRITICAL_SECTION_BEGIN();\r
+            dts2 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+            if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+            {                \r
+                kse = (KernelCallWithParamAndHandle*) xTraceNextFreeEventBufferSlot();\r
+                if (kse != NULL)\r
+                {\r
+                    kse->dts = dts2;\r
+                    kse->type = (uint8_t)evtcode;\r
+                    kse->objHandle = (uint8_t)objectNumber;\r
+                    kse->param = param;\r
+                    prvTraceUpdateCounters();    \r
+                }\r
+            }\r
+            trcCRITICAL_SECTION_END();\r
+        }\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCallWithNumericParamOnly\r
+ *\r
+ * Used for storing kernel calls with numeric parameters only. This is\r
+ * only used for traceTASK_DELAY and traceDELAY_UNTIL at the moment.\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, uint16_t param)\r
+{\r
+    KernelCallWithParam16 * kse;\r
+    uint8_t dts6;\r
+\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task \r
+        && (! inExcludedTask || nISRactive))\r
+    {\r
+        /* Check if the event code is excluded */\r
+        if (!GET_EVENT_CODE_FLAG_ISEXCLUDED(evtcode))\r
+        {\r
+            trcCRITICAL_SECTION_BEGIN();\r
+            dts6 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+            if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+            {                \r
+                kse = (KernelCallWithParam16*) xTraceNextFreeEventBufferSlot();\r
+                if (kse != NULL)\r
+                {\r
+                    kse->dts = dts6;\r
+                    kse->type = (uint8_t)evtcode;\r
+                    kse->param = param;\r
+                    prvTraceUpdateCounters();    \r
+                }\r
+            }\r
+            trcCRITICAL_SECTION_END();\r
+        }\r
+    }\r
+}\r
+\r
+objectHandleType handle_of_running_task = 0;\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreTaskswitch\r
+ * Called by the scheduler from the SWITCHED_OUT hook, and by uiTraceStart.\r
+ * At this point interrupts are assumed to be disabled!\r
+ ******************************************************************************/\r
+void vTraceStoreTaskswitch(void)\r
+{\r
+    uint16_t dts3;\r
+    TSEvent* ts;        \r
+    int8_t skipEvent = 0;\r
+    uint32_t schedulerState = 0;\r
+    \r
+    /*************************************************************************** \r
+    This is used to detect if a high-priority ISRs is illegally using the \r
+    recorder ISR trace functions (vTraceStoreISRBegin and ...End) while the \r
+    recorder is busy with a task-level event or lower priority ISR event.\r
+    \r
+    If this is detected, it triggers a call to vTraceError with the error \r
+    "Illegal call to vTraceStoreISRBegin/End". If you get this error, it means\r
+    that the macro taskENTER_CRITICAL does not disable this ISR, as required.\r
+    You can solve this by adjusting the value of the FreeRTOS constant\r
+    configMAX_SYSCALL_INTERRUPT_PRIORITY, which is defined in FreeRTOSConfig.h\r
+\r
+    Note: Setting recorder_busy is normally handled in our macros\r
+    trcCRITICAL_SECTION_BEGIN and _END, but is needed explicitly in this \r
+    function since critical sections should not be used in the context switch \r
+    event...)    \r
+    ***************************************************************************/\r
+    recorder_busy++; \r
+    \r
+    schedulerState = xTaskGetSchedulerState();\r
+\r
+    if (schedulerState == 0)\r
+    {\r
+        /* This occurs on the very first taskswitch event, generated by \r
+        vTraceStart and uiTraceStart if the scheduler is not yet started.\r
+        This creates a dummy "(startup)" task entry internally in the\r
+        recorder */\r
+        if (handle_of_running_task == 0)\r
+        {\r
+            handle_of_running_task = xTraceGetObjectHandle(TRACE_CLASS_TASK);\r
+\r
+            vTraceSetObjectName(TRACE_CLASS_TASK, \r
+                handle_of_running_task,\r
+                "(startup)");\r
+\r
+            vTraceSetPriorityProperty(TRACE_CLASS_TASK,\r
+                handle_of_running_task,\r
+                0);\r
+        }        \r
+    }\r
+    else\r
+    {    \r
+        handle_of_running_task = \r
+        (objectHandleType)uxTaskGetTaskNumber(xTaskGetCurrentTaskHandle());\r
+    }\r
+    \r
+    /* Skip the event if the task has been excluded, using vTraceExcludeTask */\r
+    if (GET_TASK_FLAG_ISEXCLUDED(handle_of_running_task))\r
+    {    \r
+        skipEvent = 1;\r
+        inExcludedTask = 1;            \r
+    }\r
+    else\r
+        inExcludedTask = 0;\r
+        \r
+\r
+    /* Skip the event if the same task is scheduled */\r
+    if (handle_of_running_task == handle_of_last_logged_task)\r
+    {\r
+        skipEvent = 1;\r
+    }\r
+  \r
+    if (! RecorderDataPtr->recorderActive)\r
+    {\r
+        skipEvent = 1;\r
+    }\r
+\r
+    /* If this event should be logged, log it! */\r
+    if (skipEvent == 0)    \r
+    {    \r
+        dts3 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+        \r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+        {\r
+            handle_of_last_logged_task = handle_of_running_task;            \r
+            ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+\r
+            if (ts != NULL)\r
+            {\r
+                if (uiTraceGetObjectState(TRACE_CLASS_TASK,\r
+                    handle_of_last_logged_task) == TASK_STATE_INSTANCE_ACTIVE)\r
+                {\r
+                    ts->type = TS_TASK_RESUME;\r
+                }\r
+                else\r
+                {\r
+                    ts->type = TS_TASK_BEGIN;\r
+                }\r
+\r
+                ts->dts = dts3;\r
+                ts->objHandle = handle_of_last_logged_task;\r
+\r
+                vTraceSetObjectState(TRACE_CLASS_TASK, \r
+                                     handle_of_last_logged_task, \r
+                                     TASK_STATE_INSTANCE_ACTIVE);\r
+\r
+                prvTraceUpdateCounters();    \r
+            }\r
+        }\r
+    }    \r
+\r
+    /* See comment on recorder_busy++ above. */\r
+    recorder_busy--; \r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreNameCloseEvent\r
+ *\r
+ * Updates the symbol table with the name of this object from the dynamic\r
+ * objects table and stores a "close" event, holding the mapping between handle\r
+ * and name (a symbol table handle). The stored name-handle mapping is thus the\r
+ * "old" one, valid up until this point.\r
+ ******************************************************************************/\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle, \r
+                                       traceObjectClass objectclass)\r
+{    \r
+    ObjCloseNameEvent * ce;\r
+    const char * name;\r
+    traceLabel idx;\r
+\r
+    name = PROPERTY_NAME_GET(objectclass, handle);\r
+\r
+    idx = prvTraceOpenSymbol(name, 0);\r
+    \r
+    // Interrupt disable not necessary, already done in trcHooks.h macro\r
+    ce = (ObjCloseNameEvent*) xTraceNextFreeEventBufferSlot(); \r
+    if (ce != NULL)\r
+    {\r
+        ce->type = EVENTGROUP_OBJCLOSE_NAME + objectclass;\r
+        ce->objHandle = handle;\r
+        ce->symbolIndex = idx;\r
+        prvTraceUpdateCounters();\r
+    }\r
+    \r
+}\r
+\r
+void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle, \r
+                                             traceObjectClass objectclass)\r
+{\r
+    ObjClosePropEvent * pe;\r
+\r
+    if (objectclass == TRACE_CLASS_ISR)\r
+    {        \r
+        /* ISR handles should not be closed - never called for ISR */\r
+        return;\r
+    }\r
+\r
+    // Interrupt disable not necessary, already done in trcHooks.h macro\r
+    pe = (ObjClosePropEvent*) xTraceNextFreeEventBufferSlot();\r
+    if (pe != NULL)\r
+    {\r
+        if (objectclass == TRACE_CLASS_TASK)\r
+        {\r
+            pe->arg1 = PROPERTY_ACTOR_PRIORITY(objectclass, handle);\r
+            pe->arg2 = PROPERTY_TASK_IFE_SERVICECODE(handle);\r
+            pe->arg3 = PROPERTY_TASK_IFE_OBJHANDLE(handle);\r
+            PROPERTY_TASK_IFE_SERVICECODE(handle) = 0;\r
+            PROPERTY_TASK_IFE_OBJHANDLE(handle) = 0;\r
+        }else{\r
+            pe->arg1 = PROPERTY_OBJECT_STATE(objectclass, handle);\r
+        }\r
+        pe->type = EVENTGROUP_OBJCLOSE_PROP + objectclass;    \r
+        prvTraceUpdateCounters();\r
+    }\r
+}\r
+#endif\r
+\r
+void vTraceSetPriorityProperty(uint8_t objectclass, uint8_t id, uint8_t value)\r
+{\r
+    PROPERTY_ACTOR_PRIORITY(objectclass, id) = value;\r
+}\r
+\r
+uint8_t uiTraceGetPriorityProperty(uint8_t objectclass, uint8_t id)\r
+{\r
+    return PROPERTY_ACTOR_PRIORITY(objectclass, id);\r
+}\r
+\r
+void vTraceSetObjectState(uint8_t objectclass, uint8_t id, uint8_t value)\r
+{\r
+    PROPERTY_OBJECT_STATE(objectclass, id) = value;\r
+}\r
+\r
+void vTraceSetTaskInstanceFinished(objectHandleType handle)\r
+{\r
+#if (USE_IMPLICIT_IFE_RULES == 1)\r
+    if (PROPERTY_TASK_IFE_SERVICECODE(handle) == 0)\r
+    {\r
+        PROPERTY_OBJECT_STATE(TRACE_CLASS_TASK, handle) = 0;\r
+    }\r
+#endif\r
+}\r
+\r
+uint8_t uiTraceGetObjectState(uint8_t objectclass, uint8_t id)\r
+{\r
+    return PROPERTY_OBJECT_STATE(objectclass, id);\r
+}\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcPort.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcPort.c
new file mode 100644 (file)
index 0000000..e98dd57
--- /dev/null
@@ -0,0 +1,208 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.c\r
+ *\r
+ * Contains all portability issues of the trace recorder library. \r
+ * See also trcPort.h, where port-specific macros are defined.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students\r
+ * , hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+static char* prvFileName = NULL;\r
+#endif\r
+\r
+\r
+/*******************************************************************************\r
+ * uiTraceTickCount\r
+ *\r
+ * This variable is updated by the traceTASK_INCREMENT_TICK macro in the \r
+ * FreeRTOS tick handler. This does not need to be modified when developing a \r
+ * new timer port. It is prefered to keep any timer port changes in the HWTC \r
+ * macro definitions, which typically give sufficient flexibility.\r
+ ******************************************************************************/\r
+uint32_t uiTraceTickCount = 0;\r
+\r
+/******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students\r
+ * , hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user license for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *pTimestamp)\r
+{\r
+    static uint32_t last_traceTickCount = 0;\r
+    static uint32_t last_hwtc_count = 0;\r
+    uint32_t traceTickCount = 0;\r
+    uint32_t hwtc_count = 0;\r
+    \r
+    /* Retrieve HWTC_COUNT only once since the same value should be used all throughout this function. */\r
+#if (HWTC_COUNT_DIRECTION == DIRECTION_INCREMENTING)\r
+    hwtc_count = HWTC_COUNT;\r
+#elif (HWTC_COUNT_DIRECTION == DIRECTION_DECREMENTING)\r
+    hwtc_count = HWTC_PERIOD - HWTC_COUNT;\r
+#else\r
+    Junk text to cause compiler error - HWTC_COUNT_DIRECTION is not set correctly!\r
+    Should be DIRECTION_INCREMENTING or DIRECTION_DECREMENTING\r
+#endif\r
+    \r
+    if (last_traceTickCount - uiTraceTickCount - 1 < 0x80000000)\r
+    {\r
+        /* This means last_traceTickCount is higher than uiTraceTickCount,\r
+        so we have previously compensated for a missed tick.\r
+        Therefore we use the last stored value because that is more accurate. */\r
+        traceTickCount = last_traceTickCount;\r
+    }\r
+    else\r
+    {\r
+        /* Business as usual */\r
+        traceTickCount = uiTraceTickCount;\r
+    }\r
+\r
+    /* Check for overflow. May occur if the update of uiTraceTickCount has been \r
+    delayed due to disabled interrupts. */\r
+    if (traceTickCount == last_traceTickCount && hwtc_count < last_hwtc_count)\r
+    {\r
+        /* A trace tick has occurred but not been executed by the kernel, so we compensate manually. */\r
+        traceTickCount++;\r
+    }\r
+    \r
+    /* Check if the return address is OK, then we perform the calculation. */\r
+    if (pTimestamp)\r
+    {\r
+        /* Get timestamp from trace ticks. Scale down the period to avoid unwanted overflows. */\r
+        *pTimestamp = traceTickCount * (HWTC_PERIOD / HWTC_DIVISOR);\r
+        /* Increase timestamp by (hwtc_count + "lost hardware ticks from scaling down period") / HWTC_DIVISOR. */\r
+        *pTimestamp += (hwtc_count + traceTickCount * (HWTC_PERIOD % HWTC_DIVISOR)) / HWTC_DIVISOR;\r
+    }\r
+    \r
+    /* Store the previous values. */\r
+    last_traceTickCount = traceTickCount;\r
+    last_hwtc_count = hwtc_count;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called by the monitor when a recorder stop is detected.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetOutFile.\r
+ ******************************************************************************/\r
+void vTracePortEnd()\r
+{\r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Running vTracePortEnd.\n\r");\r
+\r
+    #if (WIN32_PORT_SAVE_WHEN_STOPPED == 1)\r
+    vTracePortSave();\r
+    #endif\r
+\r
+    #if (WIN32_PORT_EXIT_WHEN_STOPPED == 1)\r
+    /* In the FreeRTOS/Win32 demo, this allows for killing the application \r
+    when the recorder is stopped (e.g., when the buffer is full) */\r
+    system("pause");\r
+    exit(0);\r
+    #endif\r
+}\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path)\r
+{\r
+    prvFileName = path;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a local file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port calls \r
+ * vTracePortSave in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSave()\r
+{\r
+    char buf[180];\r
+    FILE* f;\r
+\r
+    if (prvFileName == NULL)\r
+    {\r
+        prvFileName = "FreeRTOSPlusTrace.dump";\r
+        sprintf(buf, "No filename specified, using default \"%s\".", prvFileName);\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+\r
+    fopen_s(&f, prvFileName, "wb");\r
+    if (f)\r
+    {\r
+        fwrite(RecorderDataPtr, sizeof(RecorderDataType), 1, f);\r
+        fclose(f);\r
+        sprintf(buf, "\n\r[FreeRTOS+Trace] Saved in: %s\n\r", prvFileName);\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+    else\r
+    {\r
+        sprintf(buf, "\n\r[FreeRTOS+Trace] Failed to write to output file!\n\r");\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+}\r
+#endif\r
+#endif
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcUser.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/TraceRecorderSrc/trcUser.c
new file mode 100644 (file)
index 0000000..2e4bc1a
--- /dev/null
@@ -0,0 +1,1421 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcUser.c\r
+ *\r
+ * The public API of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include <string.h>\r
+#include <stdarg.h>\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+extern uint8_t inExcludedTask;\r
+extern uint8_t nISRactive;\r
+extern uint8_t handle_of_last_logged_task;\r
+extern uint32_t dts_min;\r
+extern uint32_t hwtc_count_max_after_tick;\r
+extern uint32_t hwtc_count_sum_after_tick;\r
+extern uint32_t hwtc_count_sum_after_tick_counter;\r
+extern unsigned char ucQueueGetQueueType(void*);\r
+extern unsigned char ucQueueGetQueueNumber(void*);\r
+extern char* traceErrorMessage;\r
+static void vTraceMonitorTask(void);\r
+static void prvTraceExcludeOrIncludeKernelServiceFromTrace(traceKernelService, uint8_t);\r
+    \r
+/*******************************************************************************\r
+ * vTraceMonitorTask\r
+ *\r
+ * A task which periodically reports the recorder status to the console.\r
+ * This is included depending on USE_TRACE_PROGRESS_MONITOR_TASK.\r
+ ******************************************************************************/\r
+static void vTraceMonitorTask(void)\r
+{    \r
+    portTickType xNextWakeTime;\r
+    char localsprintbuffer[90];\r
+    char* err = NULL;    \r
+    char* lastErr = NULL;      \r
+    #define STATE_INIT 0\r
+    #define STATE_STARTED 1\r
+    #define STATE_STOPPED 2    \r
+    int state = STATE_INIT;\r
+    \r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Monitor task started...\n\r");\r
+\r
+    /* Initialise xNextWakeTime - this only needs to be done once. */\r
+    xNextWakeTime = xTaskGetTickCount();\r
+\r
+    for (;;)\r
+    {\r
+        lastErr = err;        \r
+        err = xTraceGetLastError();\r
+        if (err != lastErr)\r
+        {\r
+            sprintf(localsprintbuffer, "\n\r[FreeRTOS+Trace] Error: %s\n\r", err);\r
+            vTraceConsoleMessage(localsprintbuffer); \r
+        }\r
+        \r
+        if (state == STATE_STOPPED || state == STATE_INIT) \r
+        {\r
+            if (RecorderDataPtr->recorderActive == 1)\r
+            {\r
+                state = STATE_STARTED;\r
+                vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder started.\n\r");                                       \r
+            }\r
+            else\r
+            {\r
+                if (state == STATE_INIT)\r
+                {\r
+                    \r
+                    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder not started.\n\r");\r
+                    state = STATE_STOPPED;\r
+                }\r
+            }\r
+        }\r
+        \r
+        if (state == STATE_STARTED)\r
+        {\r
+            if (RecorderDataPtr->frequency > 0)\r
+            {\r
+                sprintf(localsprintbuffer, \r
+                    "\n\r[FreeRTOS+Trace] Event count: %d, Duration: %d ms. [%d ticks]\n\r", \r
+                    (int)RecorderDataPtr->numEvents, \r
+                    (int)(RecorderDataPtr->absTimeLastEventSecond*1000 + (RecorderDataPtr->absTimeLastEvent*1000)/ RecorderDataPtr->frequency), (int)xTaskGetTickCount());\r
+                vTraceConsoleMessage(localsprintbuffer);\r
+            }\r
+\r
+            if (RecorderDataPtr->recorderActive == 0)\r
+            {\r
+                state = STATE_STOPPED;\r
+                vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder stopped.\n\r");                                       \r
+                vTracePortEnd();\r
+            }\r
+                \r
+\r
+        }\r
+\r
+    /* Place this task in the blocked state until it is time to run again. */\r
+        vTaskDelayUntil( &xNextWakeTime, TRACE_PROGRESS_MONITOR_TASK_PERIOD);\r
+        \r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceClear\r
+ *\r
+ * Resets the recorder. Only necessary if a restart is desired - this is not \r
+ * needed in the startup initialization.\r
+ ******************************************************************************/\r
+void vTraceClear(void)\r
+{\r
+    trcCRITICAL_SECTION_BEGIN();\r
+    \r
+    RecorderDataPtr->absTimeLastEvent = 0;\r
+    RecorderDataPtr->nextFreeIndex = 0;\r
+    RecorderDataPtr->numEvents = 0;\r
+    RecorderDataPtr->bufferIsFull = 0;\r
+\r
+    trcCRITICAL_SECTION_END();\r
+    \r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStartStatusMonitor\r
+ *\r
+ * This starts a task to monitor the state of½ the recorder. \r
+ * This task periodically prints a line to the console window, which shows the \r
+ * number of events recorded and the latest timestamp. This task\r
+ * calls vTracePortEnd when the recorder has been stopped, where custom\r
+ * actions can be added, e.g., to store the trace to a file\r
+ * if a file system is available on the device.\r
+ ******************************************************************************/\r
+void vTraceStartStatusMonitor(void)\r
+{    \r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Starting Trace Status Monitor...\n\r");\r
+    (void)xTaskCreate( (pdTASK_CODE)vTraceMonitorTask, (const signed char*)"TraceMon", TRACE_PROGRESS_MONITOR_TASK_STACKSIZE, NULL, TRACE_PROGRESS_MONITOR_TASK_PRIORITY, NULL );\r
+}\r
+\r
+/*******************************************************************************\r
+ * uiTraceStart\r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * Returns 1 if the recorder was started successfully.\r
+ * Returns 0 if the recorder start was prevented due to a previous internal \r
+ * error. In that case, check vTraceGetLastError to get the error message.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+\r
+uint32_t uiTraceStart(void)\r
+{        \r
+    if (traceErrorMessage == NULL)\r
+    {\r
+        trcCRITICAL_SECTION_BEGIN();\r
+        RecorderDataPtr->recorderActive = 1;\r
+        vTraceStoreTaskswitch(); /* Register the currently running task */\r
+        trcCRITICAL_SECTION_END();\r
+    }\r
+\r
+    return RecorderDataPtr->recorderActive;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStart \r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * This function is obsolete, but has been saved for backwards compatibility. \r
+ * We recommend using uiTraceStart instead.\r
+ ******************************************************************************/\r
+void vTraceStart(void)\r
+{        \r
+    (void)uiTraceStart();\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStop\r
+ *\r
+ * Stops the recorder. The recording can be resumed by calling vTraceStart.\r
+ * This does not reset the recorder. Use vTraceClear is that is desired.\r
+ ******************************************************************************/\r
+void vTraceStop(void)\r
+{\r
+    RecorderDataPtr->recorderActive = 0;\r
+}\r
+\r
+/*******************************************************************************\r
+ * xTraceGetLastError\r
+ *\r
+ * Gives the last error message, if any. NULL if no error message is stored.\r
+ * The message is cleared on read.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+char* xTraceGetLastError(void)\r
+{   \r
+    return traceErrorMessage;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceGetTraceBuffer\r
+ * \r
+ * Returns a pointer to the recorder data structure. Use this together with \r
+ * uiTraceGetTraceBufferSize if you wish to implement an own store/upload \r
+ * solution, e.g., in case a debugger connection is not available for uploading \r
+ * the data.\r
+ ******************************************************************************/\r
+void* vTraceGetTraceBuffer(void)\r
+{\r
+    return RecorderDataPtr;\r
+}\r
+\r
+/*******************************************************************************\r
+ * uiTraceGetTraceBufferSize\r
+ * \r
+ * Gets the size of the recorder data structure. For use together with \r
+ * vTraceGetTraceBuffer if you wish to implement an own store/upload solution, \r
+ * e.g., in case a debugger connection is not available for uploading the data.\r
+ ******************************************************************************/\r
+uint32_t uiTraceGetTraceBufferSize(void)\r
+{\r
+    return sizeof(RecorderDataType);\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceExcludeOrIncludeKernelServiceFromTrace\r
+ * \r
+ * Includes or excludes all events that is related to the kernel service.\r
+ ******************************************************************************/\r
+static void prvTraceExcludeOrIncludeKernelServiceFromTrace(traceKernelService kernelService, uint8_t flag)\r
+{\r
+    switch(kernelService)\r
+    {\r
+    case TRACE_KERNEL_SERVICE_TASK_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_TASK);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_TASK);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_TASK);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_TASK);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_DELAY:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_PRIORITY_SET:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_PRIORITY_SET);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_PRIORITY_SET);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_SUSPEND:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_SUSPEND);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_SUSPEND);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_RESUME:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME_FROM_ISR);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME_FROM_ISR);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_SEND:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            \r
+            \r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_RECEIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_PEEK:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_GIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_TAKE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_GIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_TAKE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    }\r
+}\r
+\r
+/******************************************************************************\r
+ * vTraceExclude______FromTrace\r
+ *\r
+ * Excludes a task or object from the trace.\r
+ * This can be useful if some irrelevant task is very frequent and is "eating\r
+ * up the buffer". This should be called after the task has been created, but \r
+ * before starting the FreeRTOS scheduler.\r
+ *****************************************************************************/\r
+void vTraceExcludeQueueFromTrace(void* handle)\r
+{\r
+    SET_QUEUE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeSemaphoreFromTrace(void* handle)\r
+{\r
+    SET_SEMAPHORE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeMutexFromTrace(void* handle)\r
+{\r
+    SET_MUTEX_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeTaskFromTrace(void* handle)\r
+{\r
+    SET_TASK_FLAG_ISEXCLUDED(uxTaskGetTaskNumber(handle));\r
+}\r
+\r
+void vTraceExcludeKernelServiceFromTrace(traceKernelService kernelService)\r
+{\r
+    prvTraceExcludeOrIncludeKernelServiceFromTrace(kernelService, 1);\r
+}\r
+\r
+/******************************************************************************\r
+ * vTraceInclude______InTrace\r
+ *\r
+ * Includes a task, object or kernel service in the trace. This is only\r
+ * necessary if the task or object has been previously exluded.\r
+ *****************************************************************************/\r
+void vTraceIncludeQueueInTrace(void* handle)\r
+{\r
+    CLEAR_QUEUE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeSemaphoreInTrace(void* handle)\r
+{\r
+    CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeMutexInTrace(void* handle)\r
+{\r
+    CLEAR_MUTEX_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeTaskInTrace(void* handle)\r
+{\r
+    CLEAR_TASK_FLAG_ISEXCLUDED(uxTaskGetTaskNumber(handle));\r
+}\r
+\r
+void vTraceIncludeKernelServiceInTrace(traceKernelService kernelService)\r
+{\r
+    prvTraceExcludeOrIncludeKernelServiceFromTrace(kernelService, 0);\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceSetQueueName\r
+ *\r
+ * Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This function should\r
+ * be called right after creation of the queue/mutex/semaphore. If not using \r
+ * this function, the queues/mutexes/semaphores will be presented by their\r
+ * numeric handle only.\r
+ *\r
+ * Example:\r
+ *     actuatorQ = xQueueCreate(3, sizeof(QueueMessage));\r
+ *     vTraceSetQueueName(actuatorQ, "ActuatorQueue");\r
+ ******************************************************************************/\r
+void vTraceSetQueueName(void* queue, const char* name)\r
+{\r
+    int t = ucQueueGetQueueType(queue);    \r
+    vTraceSetObjectName(TraceObjectClassTable[t], \r
+                        (objectHandleType)ucQueueGetQueueNumber(queue), name);\r
+}\r
+\r
+\r
+/******************************************************************************\r
+ * vTraceTaskInstanceIsFinished\r
+ * \r
+ * This defines an explicit Instance Finish Event for the current task. It tells \r
+ * the recorder that the current instance of this task is finished at the next \r
+ * kernel call of the task, e.g., a taskDelay or a queue receive. This function \r
+ * should be called right before the api function call considered to be the end \r
+ * of the current task instance, i.e., the Instance Finish Event.\r
+ *****************************************************************************/\r
+void vTraceTaskInstanceIsFinished()\r
+{\r
+    if (handle_of_last_logged_task)\r
+    {\r
+        SET_TASK_FLAG_MARKIFE(handle_of_last_logged_task);    \r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vvTraceTaskSkipDefaultInstanceFinishedEvents\r
+ *\r
+ * This is useful if there are implicit Instance Finish Events, such as \r
+ * vTaskDelayUntil or xQueueReceive, in a task where an explicit Instance Finish \r
+ * Event has been defined. This function tells the recorder that only the \r
+ * explicitly defined functions, using vTraceTaskInstanceIsFinished, should be\r
+ * treated as Instance Finish Events for this task. The implicit Instance Finish \r
+ * Events are thus disregarded for the calling task.\r
+ ******************************************************************************/\r
+void vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+{    \r
+    if (handle_of_last_logged_task)\r
+    {\r
+        PROPERTY_TASK_IFE_SERVICECODE(handle_of_last_logged_task) = \r
+          RESERVED_DUMMY_CODE;\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * Interrupt recording functions \r
+ ******************************************************************************/\r
+\r
+#if (INCLUDE_ISR_TRACING == 1)\r
+\r
+#define MAX_ISR_NESTING 16\r
+static uint8_t isrstack[MAX_ISR_NESTING];\r
+\r
+/*******************************************************************************\r
+ * vTraceSetISRProperties\r
+ * \r
+ * Registers an Interrupt Service Routine in the recorder library, This must be\r
+ * called before using vTraceStoreISRBegin to store ISR events. This is \r
+ * typically called in the startup of the system, before the scheduler is \r
+ * started.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: To safely record ISRs, you need to make sure that all traced \r
+ * interrupts actually are disabled by trcCRITICAL_SECTION_BEGIN(), which \r
+ * typically is mapped to portENTER_CRITICAL(), which uses the macro \r
+ * portDISABLE_INTERRUPTS. However, in some ports of FreeRTOS and depending on \r
+ * FreeRTOS configuration, this does not disable high priority interrupts!\r
+ * If an ISR calls vTraceStoreISRBegin while the recorder is busy, it will\r
+ * stop the recording and give an error message.\r
+ ******************************************************************************/\r
+void vTraceSetISRProperties(objectHandleType handle, const char* name, char priority)\r
+{\r
+    vTraceSetObjectName(TRACE_CLASS_ISR, handle, name);\r
+    vTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority);\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISRBegin\r
+ * \r
+ * Registers the beginning of an Interrupt Service Routine.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: You need to make sure that any traced interrupts actually are \r
+ * disabled by trcCRITICAL_SECTION_BEGIN(), i.e., taskENTER_CRITICAL() which\r
+ * uses portDISABLE_INTERRUPTS(). \r
+ * In some ports of FreeRTOS, this does not disable high-priority interrupts,\r
+ * i.e., with priorities above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
+ * If an invalid call to vTraceStoreISRBegin is detected (i.e., that preempted\r
+ * a critical section of the recorder) this will generate a recorder error \r
+ * using vTraceError.\r
+ ******************************************************************************/\r
+void vTraceStoreISRBegin(objectHandleType handle)\r
+{\r
+    uint16_t dts4;\r
+    TSEvent* ts = NULL;\r
+\r
+    if (recorder_busy)\r
+    {\r
+      vTraceError("Illegal call to vTraceStoreISRBegin/End");\r
+      return;\r
+    }\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+    {    \r
+        trcCRITICAL_SECTION_BEGIN();\r
+        dts4 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {    \r
+\r
+            if (nISRactive < MAX_ISR_NESTING)\r
+            {    \r
+                isrstack[nISRactive] = handle;\r
+                nISRactive++;            \r
+                ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+                if (ts != NULL)\r
+                {\r
+                    ts->type = TS_ISR_BEGIN;\r
+                    ts->dts = dts4;\r
+                    ts->objHandle = handle;\r
+                    prvTraceUpdateCounters();                \r
+                }\r
+            }\r
+            else\r
+            {            \r
+                /* This should not occur unless something is very wrong */            \r
+                vTraceError("Too many nested interrupts!");\r
+            }        \r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+\r
+#if (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+int tailchain_irq_pending(void);\r
+\r
+/*******************************************************************************\r
+ * tailchain_irq_pending\r
+ *\r
+ * For Cortex-M chips only. Returns 1 if an interrupt is pending, by checking \r
+ * the 8 NVIC IRQ pend registers at 0xE000E200 to 0xE000E21C. Returns 0 if no \r
+ * interrupt is pending. This is used to predict tailchaining of ISRs.\r
+ ******************************************************************************/\r
+int tailchain_irq_pending(void)\r
+{\r
+  uint32_t* pend_reg = ((uint32_t*)0xE000E200);\r
+  int i;\r
+\r
+  for (i=0; i<8; i++)\r
+  {\r
+    if (pend_reg[i] != 0)\r
+    {\r
+      return 1;\r
+    }\r
+  }\r
+  return 0;  \r
+}\r
+\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISREnd\r
+ * \r
+ * Registers the end of an Interrupt Service Routine. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: You need to make sure that any traced interrupts actually are \r
+ * disabled by trcCRITICAL_SECTION_BEGIN(), i.e., taskENTER_CRITICAL() which\r
+ * uses portDISABLE_INTERRUPTS(). \r
+ * In some ports of FreeRTOS, this does not disable high-priority interrupts,\r
+ * i.e., with priorities above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
+ * If an invalid call to vTraceStoreISREnd is detected (i.e., that preempted\r
+ * a critical section of the recorder) this will generate a recorder error \r
+ * using vTraceError.\r
+ ******************************************************************************/\r
+void vTraceStoreISREnd(void)\r
+{\r
+    TSEvent* ts;\r
+    uint16_t dts5;\r
+\r
+    if (recorder_busy)\r
+    {\r
+      vTraceError("Illegal call to vTraceStoreISRBegin/End");\r
+      return;\r
+    }\r
+    \r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+    {\r
+        #if (SELECTED_PORT == PORT_ARM_CortexM)\r
+        if (tailchain_irq_pending() > 0)\r
+        {\r
+            nISRactive--; /* If an IRQ strikes exactly here, the resulting \r
+            ISR tailchaining is not detected. The trace instead shows a very \r
+            short fragment of the earlier preempted task/ISR, and then the new\r
+            ISR begins. */\r
+            return;\r
+        }\r
+        #endif\r
+      \r
+        trcCRITICAL_SECTION_BEGIN();\r
+        dts5 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {    \r
+            ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+            if (ts != NULL)\r
+            {\r
+                if (nISRactive > 1)\r
+                {\r
+                    /* return to another isr */\r
+                    ts->type = TS_ISR_RESUME;\r
+                    ts->objHandle = isrstack[nISRactive];\r
+                }\r
+                else\r
+                {\r
+                    /* return to task */\r
+                    ts->type = TS_TASK_RESUME;\r
+                    ts->objHandle = handle_of_last_logged_task;\r
+                }\r
+                ts->dts = dts5;\r
+                nISRactive--;\r
+                prvTraceUpdateCounters();\r
+            }\r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+#else\r
+\r
+/* ISR tracing is turned off */\r
+void vTraceIncreaseISRActive(void)\r
+{\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+        nISRactive++;\r
+}\r
+\r
+void vTraceDecreaseISRActive(objectHandleType handle)\r
+{\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+        nISRactive--;\r
+}\r
+#endif\r
+\r
+\r
+/*******************************************************************************\r
+ * User Event functions\r
+ ******************************************************************************/\r
+\r
+#if (INCLUDE_USER_EVENTS == 1)\r
+\r
+ /******************************************************************************\r
+ * vTraceUserEvent\r
+ *\r
+ * Basic user event (Standard and Professional Edition only)\r
+ * \r
+ * Generates a User Event with a text label. The label is created/looked up\r
+ * in the symbol table using xTraceOpenLabel.\r
+ ******************************************************************************/\r
+void vTraceUserEvent(traceLabel eventLabel)\r
+{\r
+    UserEvent* ue;\r
+    uint8_t dts1;\r
+\r
+    if (RecorderDataPtr->recorderActive && (! inExcludedTask || nISRactive ) && handle_of_last_logged_task)\r
+    {\r
+        trcCRITICAL_SECTION_BEGIN();\r
+\r
+        dts1 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {       \r
+            ue = (UserEvent*) xTraceNextFreeEventBufferSlot();\r
+            if (ue != NULL)\r
+            {\r
+                ue->dts = dts1;\r
+                ue->type = USER_EVENT;\r
+                ue->payload = eventLabel;\r
+                prvTraceUpdateCounters();\r
+            }\r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+\r
+/* one word (32 bit) is required for the USER_EVENT entry, 8 words \r
+(8*32 bit = 32 byte) available for argument data */\r
+#define MAX_ARG_SIZE (4+32)    \r
+\r
+static uint8_t writeInt8(void * buffer, uint8_t i, uint8_t value);\r
+static uint8_t writeInt16(void * buffer, uint8_t i, uint16_t value);\r
+static uint8_t writeInt32(void * buffer, uint8_t i, uint32_t value);\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+static uint8_t writeFloat(void * buffer, uint8_t i, float value);\r
+static uint8_t writeDouble(void * buffer, uint8_t i, double value);\r
+#endif\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt8(void * buffer, uint8_t i, uint8_t value)\r
+{    \r
+    \r
+    if (i >= MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }\r
+\r
+    ((uint8_t*)buffer)[i] = value;\r
+\r
+       if (i + 1 > MAX_ARG_SIZE)\r
+       {\r
+               return 255;\r
+       }\r
+\r
+    return i + 1;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt16(void * buffer, uint8_t i, uint16_t value)\r
+{      \r
+    /* Align to multiple of 2 */\r
+    while ((i % 2) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+                       \r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;        \r
+    }\r
+    \r
+    if (i + 2 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }\r
+\r
+    ((uint16_t*)buffer)[i/2] = value;\r
+\r
+    return i + 2;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt32(void * buffer, uint8_t i, uint32_t value)\r
+{\r
+    \r
+    /* A 32 bit value should begin at an even 4-byte address */\r
+    while ((i % 4) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+               \r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;\r
+    }\r
+    \r
+    if (i + 4 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }        \r
+\r
+    ((uint32_t*)buffer)[i/4] = value;\r
+\r
+    return i + 4;\r
+}\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeFloat(void * buffer, uint8_t i, float value)\r
+{\r
+    /* A 32 bit value should begin at an even 4-byte address */\r
+    while ((i % 4) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+\r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;\r
+    }\r
+\r
+    if (i + 4 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }        \r
+\r
+    ((float*)buffer)[i/4] = value;\r
+    \r
+    return i + 4;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeDouble(void * buffer, uint8_t i, double value)\r
+{\r
+    uint32_t * dest = buffer;\r
+    uint32_t * src = (void*)&value;\r
+    /* The double is written as two 32 bit values, and should begin at an even \r
+    4-byte address (to avoid having to align with 8 byte) */\r
+    while (i % 4 != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+\r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;        \r
+    }\r
+    \r
+    if (i + 8 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }       \r
+    \r
+    dest[i/4+0] = src[0];\r
+    dest[i/4+1] = src[1];\r
+    \r
+    return i + 8;\r
+}\r
+\r
+#endif\r
+\r
+ /******************************************************************************\r
+ * vTracePrintF \r
+ * \r
+ * Advanced user events (Professional Edition only)\r
+ *\r
+ * Generates User Event with formatted text and data, similar to a "printf".\r
+ * It is very fast compared to a normal "printf" since this function only \r
+ * stores the arguments. The actual formatting is done\r
+ * on the host PC when the trace is displayed in the viewer tool. \r
+ *\r
+ * User Event labels are created using xTraceOpenLabel.\r
+ * Example:\r
+ *\r
+ *     traceLabel adc_uechannel = xTraceOpenLabel("ADC User Events");\r
+ *     ...\r
+ *     vTracePrint(adc_uechannel, \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * This can be combined into one line, if desired, but this is slower:\r
+ *\r
+ *     vTracePrint(xTraceOpenLabel("ADC User Events"), \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * Calling xTraceOpenLabel multiple times will not create duplicate entries, but\r
+ * it is of course faster to just do it once, and then keep the handle for later \r
+ * use. If you don´t have any data arguments, only a text label/string, it is \r
+ * better to use vTraceUserEvent - it is faster.\r
+ *\r
+ * Format specifiers supported:\r
+ *  %d - 32 bit signed integer\r
+ *  %u - 32 bit unsigned integer\r
+ *  %f - 32 bit float\r
+ *  %s - string (is copied to the recorder symbol table)\r
+ *  %hd - 16 bit signed integer\r
+ *  %hu - 16 bit unsigned integer\r
+ *  %bd - 8 bit signed integer\r
+ *  %bu - 8 bit unsigned integer\r
+ *  %lf - double-precision float\r
+ * \r
+ * Up to 15 data arguments are allowed, with a total size of maximum 32 byte.\r
+ * In case this is exceeded, the user event is changed into an error message.\r
+ * \r
+ * The data is stored in trace buffer, and is packed to allow storing multiple \r
+ * smaller data entries in the same 4-byte record, e.g., four 8-bit values.\r
+ * A string requires two bytes, as the symbol table is limited to 64K. Storing a \r
+ * double (%lf) uses two records, so this is quite costly. Use float (%f) unless\r
+ * the higher precision is really necessary.\r
+ ******************************************************************************/\r
+void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...)\r
+{\r
+    UserEvent* ue1;\r
+    va_list vl;\r
+    uint8_t argCounter = 0;\r
+    uint8_t i = 0;\r
+    uint8_t nofEventEntries = 0;\r
+    uint16_t formatStrIndex = 0;    \r
+\r
+    /**************************************************************************\r
+    * The array tempDataBuffer is a local buffer used in a two-phase commit of \r
+    * the event data, since a vTracePrintF may span over multiple slots in the \r
+    * buffer.\r
+    * This buffer can be made larger, of course, but remember the risk for \r
+    * stack overflow. Note: This should be a LOCAL buffer, must not be made \r
+    * global. That would cause data corruption when two calls to vTracePrintF\r
+    * from different tasks overlaps (interrupts are only disabled in a small \r
+    * part of this function, otherwise enabled)\r
+    ***************************************************************************/\r
+               \r
+    uint32_t tempDataBuffer[(3 + MAX_ARG_SIZE) / 4];   \r
+       \r
+       \r
+    if ((inExcludedTask == 0) &&\r
+        (nISRactive == 0) &&\r
+        (RecorderDataPtr->recorderActive == 1) &&\r
+        (handle_of_last_logged_task > 0))\r
+    {        \r
+        /* First, write the "primary" user event entry in the local buffer, but \r
+        let the event type be "EVENT_BEING_WRITTEN" for now...*/\r
+\r
+        ue1 = (UserEvent*)(&tempDataBuffer[0]);         \r
+        ue1->type = EVENT_BEING_WRITTEN;      /* Update this as the last step */\r
+        \r
+        i = 4;\r
+        formatStrIndex = 0;\r
+        va_start(vl, formatStr);          /* Begin reading the arguments list */\r
+\r
+        while (formatStr[formatStrIndex] != '\0')\r
+        {\r
+            if (formatStr[formatStrIndex] == '%')\r
+            {\r
+                argCounter++;\r
+\r
+                if (argCounter > 15)\r
+                {\r
+                    vTraceError("vTracePrintF - Too many arguments, max 15 allowed!");\r
+                    va_end(vl);                    \r
+                    formatStr = "[vTracePrintF error] Too many arguments, max 15 allowed!";\r
+                    i = 4;\r
+                    break;            \r
+                }\r
+\r
+/*******************************************************************************\r
+ * These below code writes raw data (primitive datatypes) in the event buffer, \r
+ * instead of the normal event structs (where byte 0 is event type).\r
+ * These data entries must never be interpreted as real event data, as the type\r
+ * field would be misleading since used for payload data. \r
+ * \r
+ * The correctness of this encoding depends on two mechanisms:\r
+ * \r
+ * 1. An initial USER_EVENT, which type code tells the number of 32-bit data \r
+ * entires that follows. (code - USER_EVENT = number of data entries). \r
+ * Note that a data entry corresponds to the slots that normally corresponds to \r
+ * one (1) event, i.e., 32 bits. vTracePrintF may encode several pieces of data \r
+ * in one data entry, e.g., two 16-bit values or four 8-bit values, one 16-bit\r
+ * value followes by two 8-bit values, etc.\r
+ *\r
+ * 2. A two-phase commit procedure, where the USER_EVENT and data entries are \r
+ * written to a local buffer at first, and when all checks are OK then copied to\r
+ * the main event buffer using a fast memcpy. The event code is finalized as the\r
+ * very last step. Before that that step, the event code indicates an unfinished\r
+ * event, which causes it to be ignored and stop the loading of the file (since \r
+ * an unfinished event is the last event in the trace).\r
+*******************************************************************************/\r
+                formatStrIndex++;\r
+                switch (formatStr[formatStrIndex])\r
+                {\r
+                case 'd':    i = writeInt32((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, uint32_t)); \r
+                             break;\r
+                case 'u':    i = writeInt32((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, uint32_t)); \r
+                             break;\r
+                case 's':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint16_t)xTraceOpenLabel((char*)va_arg(vl, char*))); \r
+                             break;\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+                             /* Yes, "double" as type also in the float \r
+                             case. This since "float" is promoted into "double" \r
+                             by the va_arg stuff. */\r
+                case 'f':    i = writeFloat((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (float)va_arg(vl, double)); \r
+                             break;    \r
+#else\r
+/* No support for floats, but attempt to store a float user event\r
+avoid a possible crash due to float reference. Instead store the \r
+data on uint_32 format (will not be displayed anyway). This is just\r
+to keep va_arg and i consistent. */\r
+\r
+                case 'f':    i = writeInt32((uint8_t*)tempDataBuffer,\r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, double)); \r
+#endif\r
+                case 'l':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+                    case 'f':     i = writeDouble((uint8_t*)tempDataBuffer, \r
+                                                      i, \r
+                                                      (double)va_arg(vl, double)); \r
+                                  break;\r
+#else\r
+/* No support for floats, but attempt to store a float user event\r
+avoid a possible crash due to float reference. Instead store the \r
+data on uint_32 format (will not be displayed anyway). This is just\r
+to keep va_arg and i consistent. */\r
+                    case 'f':    i = writeInt32((uint8_t*)tempDataBuffer, /* In this case, the value will not be shown anyway */\r
+                                                    i, \r
+                                                    (uint32_t)va_arg(vl, double)); \r
+                                 i = writeInt32((uint8_t*)tempDataBuffer, /* Do it twice, to write in total 8 bytes */\r
+                                                    i, \r
+                                                    (uint32_t)va_arg(vl, double)); \r
+#endif\r
+\r
+                    }\r
+                    break;\r
+                case 'h':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+                    case 'd':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                    i, \r
+                                                    (uint16_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    case 'u':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                    i, \r
+                                                    (uint16_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    }\r
+                    break;\r
+                case 'b':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+                    case 'd':    i = writeInt8((uint8_t*)tempDataBuffer, \r
+                                                   i, \r
+                                                   (uint8_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    case 'u':    i = writeInt8((uint8_t*)tempDataBuffer, \r
+                                                   i, \r
+                                                   (uint8_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    }\r
+                    break;\r
+                }\r
+            }                                    \r
+            formatStrIndex++;    \r
+            if (i == 255)\r
+            {\r
+                va_end(vl);\r
+                //vTraceError("vTracePrintF - Too large arguments, max 32 byte allowed!");\r
+                formatStr = "[vTracePrintF error] Too large arguments, max 32 byte allowed!";\r
+                i = 4;\r
+                break;\r
+            }\r
+        }\r
+\r
+        va_end(vl);\r
+               \r
+        /* Store the format string, with a reference to the channel symbol */\r
+        ue1->payload = prvTraceOpenSymbol(formatStr, eventLabel);     \r
+\r
+        trcCRITICAL_SECTION_BEGIN();  \r
+\r
+        ue1->dts = (uint8_t)prvTraceGetDTS(0xFF);\r
+        if (! RecorderDataPtr->recorderActive)\r
+        {\r
+\r
+            /* Abort, since an XTS event (created by prvTraceGetDTS) filled the \r
+            buffer, and the recorder stopped since not circular buffer. */\r
+            trcCRITICAL_SECTION_END();\r
+        \r
+            return;\r
+        }\r
+            \r
+        nofEventEntries = (i+3)/4;\r
+\r
+        /* If the data does not fit in the remaining main buffer, wrap around to \r
+        0 if allowed, otherwise stop the recorder and quit). */\r
+        if (RecorderDataPtr->nextFreeIndex + nofEventEntries > RecorderDataPtr->maxEvents)\r
+        {\r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+            (void)memset(& RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4], \r
+                   0, \r
+                   (RecorderDataPtr->maxEvents - RecorderDataPtr->nextFreeIndex)*4);\r
+            RecorderDataPtr->nextFreeIndex = 0;\r
+            RecorderDataPtr->bufferIsFull = 1;\r
+#else\r
+            /* Abort and stop recorder, since the event data will not fit in the\r
+            buffer and not circular buffer in this case... */\r
+            trcCRITICAL_SECTION_END();\r
+            vTraceStop();\r
+\r
+            \r
+            return;\r
+#endif\r
+        }\r
+    \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+        /* Check that the buffer to be overwritten does not contain any user \r
+        events that would be partially overwritten. If so, they must be "killed"\r
+        by replacing the user event and following data with NULL events (i.e., \r
+        using a memset to zero).*/\r
+        prvCheckDataToBeOverwrittenForMultiEntryUserEvents(nofEventEntries);\r
+#endif\r
+        /* Copy the local buffer to the main buffer */\r
+        (void)memcpy(& RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4], \r
+               tempDataBuffer, \r
+               i);\r
+\r
+        /* Update the event type, i.e., number of data entries following the \r
+        main USER_EVENT entry (Note: important that this is after the memcpy, \r
+        but within the critical section!)*/\r
+        RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4] = \r
+          (uint8_t) USER_EVENT + nofEventEntries - 1;    \r
+        \r
+        /* Update the main buffer event index (already checked that it fits in \r
+        the buffer, so no need to check for wrapping)*/\r
+        \r
+        RecorderDataPtr->nextFreeIndex += nofEventEntries;\r
+        RecorderDataPtr->numEvents += nofEventEntries;\r
+        \r
+        if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+        {\r
+        \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+            RecorderDataPtr->nextFreeIndex = 0;\r
+            RecorderDataPtr->bufferIsFull = 1;\r
+#else\r
+            vTraceStop();\r
+#endif\r
+        }\r
+\r
+        trcCRITICAL_SECTION_END();\r
+    }    \r
+}\r
+    \r
+/*******************************************************************************\r
+ * xTraceOpenLabel\r
+ * \r
+ * Creates user event labels for user event channels or for individual events.\r
+ * User events can be used to log application events and data for display in\r
+ * the visualization tool. A user event is identified by a label, i.e., a string,\r
+ * which is stored in the recorder's symbol table.\r
+ * When logging a user event, a numeric handle (reference) to this string is\r
+ * used to identify the event. This is obtained by calling \r
+ * \r
+ *     xTraceOpenLabel()\r
+ *\r
+ * which adds the string to the symbol table (if not already present)\r
+ * and returns the corresponding handle.\r
+ *\r
+ * This can be used in two ways:\r
+ *\r
+ * 1. The handle is looked up every time, when storing the user event.\r
+ *\r
+ * Example:\r
+ *     vTraceUserEvent(xTraceOpenLabel("MyUserEvent"));\r
+ *\r
+ * 2. The label is registered just once, with the handle stored in an\r
+ *  application variable - much like using a file handle.\r
+ *\r
+ * Example:\r
+ *     myEventHandle = xTraceOpenLabel("MyUserEvent");\r
+ *     ...\r
+ *     vTraceUserEvent(myEventHandle);\r
+ *\r
+ * The second option is faster since no lookup is required on each event, and \r
+ * therefore recommended for user events that are frequently\r
+ * executed and/or located in time-critical code. The lookup operation is\r
+ * however fairly fast due to the design of the symbol table.\r
+ ******************************************************************************/\r
+traceLabel xTraceOpenLabel(const char* label)\r
+{\r
+    return prvTraceOpenSymbol(label, 0);\r
+}\r
+#endif\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/cdcuser.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/cdcuser.c
new file mode 100644 (file)
index 0000000..b30c362
--- /dev/null
@@ -0,0 +1,264 @@
+/*----------------------------------------------------------------------------\r
+ *      U S B  -  K e r n e l\r
+ *----------------------------------------------------------------------------\r
+ *      Name:    cdcuser.c\r
+ *      Purpose: USB Communication Device Class User module\r
+ *      Version: V1.10\r
+ *----------------------------------------------------------------------------\r
+*      This software is supplied "AS IS" without any warranties, express,\r
+ *      implied or statutory, including but not limited to the implied\r
+ *      warranties of fitness for purpose, satisfactory quality and\r
+ *      noninfringement. Keil extends you a royalty-free right to reproduce\r
+ *      and distribute executable files created using this software for use\r
+ *      on NXP Semiconductors LPC microcontroller devices only. Nothing else\r
+ *      gives you the right to use this software.\r
+ *\r
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.\r
+ *---------------------------------------------------------------------------*/\r
+\r
+#include "lpc_types.h"\r
+\r
+#include "usb.h"\r
+#include "usbhw.h"\r
+#include "usbcfg.h"\r
+#include "usbcore.h"\r
+#include "cdc.h"\r
+#include "cdcuser.h"\r
+\r
+#ifdef __ICCARM__\r
+#pragma data_alignment=4\r
+#define __align(x)\r
+#elif defined   (  __GNUC__  )\r
+#define __align(x) __attribute__((aligned(x)))\r
+#endif\r
+\r
+unsigned char __align(4) BulkBufOut [USB_CDC_BUFSIZE];            // Buffer to store USB OUT packet\r
+\r
+#ifdef __ICCARM__\r
+#undef __align(x)\r
+#endif\r
+\r
+/*----------------------------------------------------------------------------\r
+  We need a buffer for incomming data on USB port because USB receives\r
+  much faster than  UART transmits\r
+ *---------------------------------------------------------------------------*/\r
+/* Buffer masks */\r
+#define CDC_BUF_SIZE               (64)               // Output buffer in bytes (power 2)\r
+                                                       // large enough for file transfer\r
+#define CDC_BUF_MASK               (CDC_BUF_SIZE-1ul)\r
+\r
+/* Buffer read / write macros */\r
+#define CDC_BUF_RESET(cdcBuf)      (cdcBuf.rdIdx = cdcBuf.wrIdx = 0)\r
+#define CDC_BUF_WR(cdcBuf, dataIn) (cdcBuf.data[CDC_BUF_MASK & cdcBuf.wrIdx++] = (dataIn))\r
+#define CDC_BUF_RD(cdcBuf)         (cdcBuf.data[CDC_BUF_MASK & cdcBuf.rdIdx++])\r
+#define CDC_BUF_EMPTY(cdcBuf)      (cdcBuf.rdIdx == cdcBuf.wrIdx)\r
+#define CDC_BUF_FULL(cdcBuf)       (cdcBuf.rdIdx == cdcBuf.wrIdx+1)\r
+#define CDC_BUF_COUNT(cdcBuf)      (CDC_BUF_MASK & (cdcBuf.wrIdx - cdcBuf.rdIdx))\r
+\r
+\r
+// CDC output buffer\r
+typedef struct __CDC_BUF_T {\r
+  unsigned char data[CDC_BUF_SIZE];\r
+  unsigned int wrIdx;\r
+  unsigned int rdIdx;\r
+} CDC_BUF_T;\r
+\r
+CDC_BUF_T  CDC_OutBuf;                                 // buffer for all CDC Out data\r
+\r
+/*----------------------------------------------------------------------------\r
+  read data from CDC_OutBuf\r
+ *---------------------------------------------------------------------------*/\r
+int CDC_RdOutBuf (char *buffer, const int *length) {\r
+  int bytesToRead, bytesRead;\r
+\r
+  /* Read *length bytes, block if *bytes are not avaialable    */\r
+  bytesToRead = *length;\r
+  bytesToRead = (bytesToRead < (*length)) ? bytesToRead : (*length);\r
+  bytesRead = bytesToRead;\r
+\r
+  // ... add code to check for underrun\r
+\r
+  while (bytesToRead--) {\r
+    *buffer++ = CDC_BUF_RD(CDC_OutBuf);\r
+  }\r
+  return (bytesRead);\r
+}\r
+\r
+/*----------------------------------------------------------------------------\r
+  write data to CDC_OutBuf\r
+ *---------------------------------------------------------------------------*/\r
+int CDC_WrOutBuf (const char *buffer, int length) {\r
+  int bytesWritten;\r
+\r
+  // ... add code to check for overwrite\r
+\r
+  for( bytesWritten = 0; bytesWritten < length; bytesWritten++ ) {\r
+      CDC_BUF_WR(CDC_OutBuf, *buffer++);           // Copy Data to buffer\r
+  }\r
+\r
+  return (bytesWritten);\r
+}\r
+\r
+/*----------------------------------------------------------------------------\r
+  check if character(s) are available at CDC_OutBuf\r
+ *---------------------------------------------------------------------------*/\r
+int CDC_OutBufAvailChar (int *availChar) {\r
+\r
+  *availChar = CDC_BUF_COUNT(CDC_OutBuf);\r
+\r
+  return (0);\r
+}\r
+/* end Buffer handling */\r
+\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC SendEncapsulatedCommand Request Callback\r
+  Called automatically on CDC SEND_ENCAPSULATED_COMMAND Request\r
+  Parameters:   None                          (global SetupPacket and EP0Buf)\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_SendEncapsulatedCommand (void) {\r
+\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC GetEncapsulatedResponse Request Callback\r
+  Called automatically on CDC Get_ENCAPSULATED_RESPONSE Request\r
+  Parameters:   None                          (global SetupPacket and EP0Buf)\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_GetEncapsulatedResponse (void) {\r
+\r
+  /* ... add code to handle request */\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC SetCommFeature Request Callback\r
+  Called automatically on CDC Set_COMM_FATURE Request\r
+  Parameters:   FeatureSelector\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_SetCommFeature (unsigned short wFeatureSelector) {\r
+\r
+  /* ... add code to handle request */\r
+  ( void ) wFeatureSelector;\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC GetCommFeature Request Callback\r
+  Called automatically on CDC Get_COMM_FATURE Request\r
+  Parameters:   FeatureSelector\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_GetCommFeature (unsigned short wFeatureSelector) {\r
+\r
+  /* ... add code to handle request */\r
+  ( void ) wFeatureSelector;\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC ClearCommFeature Request Callback\r
+  Called automatically on CDC CLEAR_COMM_FATURE Request\r
+  Parameters:   FeatureSelector\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_ClearCommFeature (unsigned short wFeatureSelector) {\r
+\r
+  /* ... add code to handle request */\r
+  ( void ) wFeatureSelector;\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC SetLineCoding Request Callback\r
+  Called automatically on CDC SET_LINE_CODING Request\r
+  Parameters:   none                    (global SetupPacket and EP0Buf)\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_SetLineCoding (void) {\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC GetLineCoding Request Callback\r
+  Called automatically on CDC GET_LINE_CODING Request\r
+  Parameters:   None                         (global SetupPacket and EP0Buf)\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_GetLineCoding (void) {\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC SetControlLineState Request Callback\r
+  Called automatically on CDC SET_CONTROL_LINE_STATE Request\r
+  Parameters:   ControlSignalBitmap\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_SetControlLineState (unsigned short wControlSignalBitmap) {\r
+\r
+  /* ... add code to handle request */\r
+  ( void ) wControlSignalBitmap;\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC SendBreak Request Callback\r
+  Called automatically on CDC Set_COMM_FATURE Request\r
+  Parameters:   0xFFFF  start of Break\r
+                0x0000  stop  of Break\r
+                0x####  Duration of Break\r
+  Return Value: TRUE - Success, FALSE - Error\r
+ *---------------------------------------------------------------------------*/\r
+uint32_t CDC_SendBreak (unsigned short wDurationOfBreak) {\r
+\r
+  /* ... add code to handle request */\r
+  ( void ) wDurationOfBreak;\r
+  return (TRUE);\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC_BulkIn call on DataIn Request\r
+  Parameters:   none\r
+  Return Value: none\r
+ *---------------------------------------------------------------------------*/\r
+void CDC_BulkIn(void) {\r
+}\r
+\r
+\r
+/*----------------------------------------------------------------------------\r
+  CDC_BulkOut call on DataOut Request\r
+  Parameters:   none\r
+  Return Value: none\r
+ *---------------------------------------------------------------------------*/\r
+void CDC_BulkOut(void) {\r
+  int numBytesRead;\r
+\r
+  // get data from USB into intermediate buffer\r
+  numBytesRead = USB_ReadEP(CDC_DEP_OUT, &BulkBufOut[0]);\r
+\r
+  // ... add code to check for overwrite\r
+\r
+  // store data in a buffer to transmit it over serial interface\r
+  CDC_WrOutBuf ((char *)&BulkBufOut[0], numBytesRead);\r
+  vCDCNewDataNotify();\r
+}\r
+\r
+void CDC_BulkOutNak(void){\r
+\r
+    USB_ReadReqEP(CDC_DEP_OUT, &BulkBufOut[0], 64);\r
+}\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdc.h
new file mode 100644 (file)
index 0000000..7bb2abf
--- /dev/null
@@ -0,0 +1,283 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ *      Name:    CDC.h
+ *      Purpose: USB Communication Device Class Definitions
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+#ifndef __CDC_H
+#define __CDC_H
+#include "lpc_types.h"
+
+#if defined   (  __GNUC__  )
+#define __packed __attribute__((__packed__))
+#endif
+/*----------------------------------------------------------------------------
+ *      Definitions  based on usbcdc11.pdf (www.usb.org)
+ *---------------------------------------------------------------------------*/
+// Communication device class specification version 1.10
+#define CDC_V1_10                               0x0110
+
+// Communication interface class code
+// (usbcdc11.pdf, 4.2, Table 15)
+#define CDC_COMMUNICATION_INTERFACE_CLASS       0x02
+
+// Communication interface class subclass codes
+// (usbcdc11.pdf, 4.3, Table 16)
+#define CDC_DIRECT_LINE_CONTROL_MODEL           0x01
+#define CDC_ABSTRACT_CONTROL_MODEL              0x02
+#define CDC_TELEPHONE_CONTROL_MODEL             0x03
+#define CDC_MULTI_CHANNEL_CONTROL_MODEL         0x04
+#define CDC_CAPI_CONTROL_MODEL                  0x05
+#define CDC_ETHERNET_NETWORKING_CONTROL_MODEL   0x06
+#define CDC_ATM_NETWORKING_CONTROL_MODEL        0x07
+
+// Communication interface class control protocol codes
+// (usbcdc11.pdf, 4.4, Table 17)
+#define CDC_PROTOCOL_COMMON_AT_COMMANDS         0x01
+
+// Data interface class code
+// (usbcdc11.pdf, 4.5, Table 18)
+#define CDC_DATA_INTERFACE_CLASS                0x0A
+
+// Data interface class protocol codes
+// (usbcdc11.pdf, 4.7, Table 19)
+#define CDC_PROTOCOL_ISDN_BRI                   0x30
+#define CDC_PROTOCOL_HDLC                       0x31
+#define CDC_PROTOCOL_TRANSPARENT                0x32
+#define CDC_PROTOCOL_Q921_MANAGEMENT            0x50
+#define CDC_PROTOCOL_Q921_DATA_LINK             0x51
+#define CDC_PROTOCOL_Q921_MULTIPLEXOR           0x52
+#define CDC_PROTOCOL_V42                        0x90
+#define CDC_PROTOCOL_EURO_ISDN                  0x91
+#define CDC_PROTOCOL_V24_RATE_ADAPTATION        0x92
+#define CDC_PROTOCOL_CAPI                       0x93
+#define CDC_PROTOCOL_HOST_BASED_DRIVER          0xFD
+#define CDC_PROTOCOL_DESCRIBED_IN_PUFD          0xFE
+
+// Type values for bDescriptorType field of functional descriptors
+// (usbcdc11.pdf, 5.2.3, Table 24)
+#define CDC_CS_INTERFACE                        0x24
+#define CDC_CS_ENDPOINT                         0x25
+
+// Type values for bDescriptorSubtype field of functional descriptors
+// (usbcdc11.pdf, 5.2.3, Table 25)
+#define CDC_HEADER                              0x00
+#define CDC_CALL_MANAGEMENT                     0x01
+#define CDC_ABSTRACT_CONTROL_MANAGEMENT         0x02
+#define CDC_DIRECT_LINE_MANAGEMENT              0x03
+#define CDC_TELEPHONE_RINGER                    0x04
+#define CDC_REPORTING_CAPABILITIES              0x05
+#define CDC_UNION                               0x06
+#define CDC_COUNTRY_SELECTION                   0x07
+#define CDC_TELEPHONE_OPERATIONAL_MODES         0x08
+#define CDC_USB_TERMINAL                        0x09
+#define CDC_NETWORK_CHANNEL                     0x0A
+#define CDC_PROTOCOL_UNIT                       0x0B
+#define CDC_EXTENSION_UNIT                      0x0C
+#define CDC_MULTI_CHANNEL_MANAGEMENT            0x0D
+#define CDC_CAPI_CONTROL_MANAGEMENT             0x0E
+#define CDC_ETHERNET_NETWORKING                 0x0F
+#define CDC_ATM_NETWORKING                      0x10
+
+// CDC class-specific request codes
+// (usbcdc11.pdf, 6.2, Table 46)
+// see Table 45 for info about the specific requests.
+#define CDC_SEND_ENCAPSULATED_COMMAND           0x00
+#define CDC_GET_ENCAPSULATED_RESPONSE           0x01
+#define CDC_SET_COMM_FEATURE                    0x02
+#define CDC_GET_COMM_FEATURE                    0x03
+#define CDC_CLEAR_COMM_FEATURE                  0x04
+#define CDC_SET_AUX_LINE_STATE                  0x10
+#define CDC_SET_HOOK_STATE                      0x11
+#define CDC_PULSE_SETUP                         0x12
+#define CDC_SEND_PULSE                          0x13
+#define CDC_SET_PULSE_TIME                      0x14
+#define CDC_RING_AUX_JACK                       0x15
+#define CDC_SET_LINE_CODING                     0x20
+#define CDC_GET_LINE_CODING                     0x21
+#define CDC_SET_CONTROL_LINE_STATE              0x22
+#define CDC_SEND_BREAK                          0x23
+#define CDC_SET_RINGER_PARMS                    0x30
+#define CDC_GET_RINGER_PARMS                    0x31
+#define CDC_SET_OPERATION_PARMS                 0x32
+#define CDC_GET_OPERATION_PARMS                 0x33
+#define CDC_SET_LINE_PARMS                      0x34
+#define CDC_GET_LINE_PARMS                      0x35
+#define CDC_DIAL_DIGITS                         0x36
+#define CDC_SET_UNIT_PARAMETER                  0x37
+#define CDC_GET_UNIT_PARAMETER                  0x38
+#define CDC_CLEAR_UNIT_PARAMETER                0x39
+#define CDC_GET_PROFILE                         0x3A
+#define CDC_SET_ETHERNET_MULTICAST_FILTERS      0x40
+#define CDC_SET_ETHERNET_PMP_FILTER             0x41
+#define CDC_GET_ETHERNET_PMP_FILTER             0x42
+#define CDC_SET_ETHERNET_PACKET_FILTER          0x43
+#define CDC_GET_ETHERNET_STATISTIC              0x44
+#define CDC_SET_ATM_DATA_FORMAT                 0x50
+#define CDC_GET_ATM_DEVICE_STATISTICS           0x51
+#define CDC_SET_ATM_DEFAULT_VC                  0x52
+#define CDC_GET_ATM_VC_STATISTICS               0x53
+
+// Communication feature selector codes
+// (usbcdc11.pdf, 6.2.2..6.2.4, Table 47)
+#define CDC_ABSTRACT_STATE                      0x01
+#define CDC_COUNTRY_SETTING                     0x02
+
+// Feature Status returned for ABSTRACT_STATE Selector
+// (usbcdc11.pdf, 6.2.3, Table 48)
+#define CDC_IDLE_SETTING                        (1 << 0)
+#define CDC_DATA_MULTPLEXED_STATE               (1 << 1)
+
+
+// Control signal bitmap values for the SetControlLineState request
+// (usbcdc11.pdf, 6.2.14, Table 51)
+#define CDC_DTE_PRESENT                         (1 << 0)
+#define CDC_ACTIVATE_CARRIER                    (1 << 1)
+
+// CDC class-specific notification codes
+// (usbcdc11.pdf, 6.3, Table 68)
+// see Table 67 for Info about class-specific notifications
+#define CDC_NOTIFICATION_NETWORK_CONNECTION     0x00
+#define CDC_RESPONSE_AVAILABLE                  0x01
+#define CDC_AUX_JACK_HOOK_STATE                 0x08
+#define CDC_RING_DETECT                         0x09
+#define CDC_NOTIFICATION_SERIAL_STATE           0x20
+#define CDC_CALL_STATE_CHANGE                   0x28
+#define CDC_LINE_STATE_CHANGE                   0x29
+#define CDC_CONNECTION_SPEED_CHANGE             0x2A
+
+// UART state bitmap values (Serial state notification).
+// (usbcdc11.pdf, 6.3.5, Table 69)
+#define CDC_SERIAL_STATE_OVERRUN                (1 << 6)  // receive data overrun error has occurred
+#define CDC_SERIAL_STATE_PARITY                 (1 << 5)  // parity error has occurred
+#define CDC_SERIAL_STATE_FRAMING                (1 << 4)  // framing error has occurred
+#define CDC_SERIAL_STATE_RING                   (1 << 3)  // state of ring signal detection
+#define CDC_SERIAL_STATE_BREAK                  (1 << 2)  // state of break detection
+#define CDC_SERIAL_STATE_TX_CARRIER             (1 << 1)  // state of transmission carrier
+#define CDC_SERIAL_STATE_RX_CARRIER             (1 << 0)  // state of receiver carrier
+
+
+/*----------------------------------------------------------------------------
+ *      Structures  based on usbcdc11.pdf (www.usb.org)
+ *---------------------------------------------------------------------------*/
+
+// Header functional descriptor
+// (usbcdc11.pdf, 5.2.3.1)
+// This header must precede any list of class-specific descriptors.
+
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_HEADER_DESCRIPTOR{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_HEADER_DESCRIPTOR{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_HEADER_DESCRIPTOR {
+#endif
+  uint8_t bFunctionLength;                     // size of this descriptor in bytes
+  uint8_t bDescriptorType;                     // CS_INTERFACE descriptor type
+  uint8_t bDescriptorSubtype;                  // Header functional descriptor subtype
+  uint16_t bcdCDC;                              // USB CDC specification release version
+} CDC_HEADER_DESCRIPTOR;
+
+//Call management functional descriptor
+// (usbcdc11.pdf, 5.2.3.2)
+// Describes the processing of calls for the communication class interface.
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_CALL_MANAGEMENT_DESCRIPTOR{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_CALL_MANAGEMENT_DESCRIPTOR{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_CALL_MANAGEMENT_DESCRIPTOR {
+#endif
+  uint8_t bFunctionLength;                     // size of this descriptor in bytes
+  uint8_t bDescriptorType;                     // CS_INTERFACE descriptor type
+  uint8_t bDescriptorSubtype;                  // call management functional descriptor subtype
+  uint8_t bmCapabilities;                      // capabilities that this configuration supports
+  uint8_t bDataInterface;                      // interface number of the data class interface used for call management (optional)
+} CDC_CALL_MANAGEMENT_DESCRIPTOR;
+
+// Abstract control management functional descriptor
+// (usbcdc11.pdf, 5.2.3.3)
+// Describes the command supported by the communication interface class with the Abstract Control Model subclass code.
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR {
+#endif
+  uint8_t bFunctionLength;                     // size of this descriptor in bytes
+  uint8_t bDescriptorType;                     // CS_INTERFACE descriptor type
+  uint8_t bDescriptorSubtype;                  // abstract control management functional descriptor subtype
+  uint8_t bmCapabilities;                      // capabilities supported by this configuration
+} CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR;
+
+// Union functional descriptors
+// (usbcdc11.pdf, 5.2.3.8)
+// Describes the relationship between a group of interfaces that can be considered to form a functional unit.
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_UNION_DESCRIPTOR{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_UNION_DESCRIPTOR{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_UNION_DESCRIPTOR {
+#endif
+  uint8_t bFunctionLength;                     // size of this descriptor in bytes
+  uint8_t bDescriptorType;                     // CS_INTERFACE descriptor type
+  uint8_t bDescriptorSubtype;                  // union functional descriptor subtype
+  uint8_t bMasterInterface;                    // interface number designated as master
+} CDC_UNION_DESCRIPTOR;
+
+// Union functional descriptors with one slave interface
+// (usbcdc11.pdf, 5.2.3.8)
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_UNION_1SLAVE_DESCRIPTOR{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_UNION_1SLAVE_DESCRIPTOR{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_UNION_1SLAVE_DESCRIPTOR {
+#endif
+  CDC_UNION_DESCRIPTOR sUnion;              // Union functional descriptor
+  uint8_t                 bSlaveInterfaces[1]; // Slave interface 0
+} CDC_UNION_1SLAVE_DESCRIPTOR;
+
+//  Line coding structure
+//  Format of the data returned when a GetLineCoding request is received
+// (usbcdc11.pdf, 6.2.13)
+#if defined     (  __CC_ARM  )
+typedef __packed struct _CDC_LINE_CODING{
+#elif defined (  __GNUC__  )
+typedef struct __packed  _CDC_LINE_CODING{
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _CDC_LINE_CODING {
+#endif
+  uint32_t dwDTERate;                          // Data terminal rate in bits per second
+  uint8_t  bCharFormat;                        // Number of stop bits
+  uint8_t  bParityType;                        // Parity bit type
+  uint8_t  bDataBits;                          // Number of data bits
+} CDC_LINE_CODING;
+
+// Notification header
+// Data sent on the notification endpoint must follow this header.
+// see  USB_SETUP_PACKET in file usb.h
+typedef USB_SETUP_PACKET CDC_NOTIFICATION_HEADER;
+
+#endif /* __CDC_H */
+
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdcuser.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/cdcuser.h
new file mode 100644 (file)
index 0000000..f624e7b
--- /dev/null
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------\r
+ *      U S B  -  K e r n e l\r
+ *----------------------------------------------------------------------------\r
+ *      Name:    cdcuser.h\r
+ *      Purpose: USB Communication Device Class User module Definitions\r
+ *      Version: V1.10\r
+ *----------------------------------------------------------------------------\r
+ *      This software is supplied "AS IS" without any warranties, express,\r
+ *      implied or statutory, including but not limited to the implied\r
+ *      warranties of fitness for purpose, satisfactory quality and\r
+ *      noninfringement. Keil extends you a royalty-free right to reproduce\r
+ *      and distribute executable files created using this software for use\r
+ *      on NXP Semiconductors LPC microcontroller devices only. Nothing else\r
+ *      gives you the right to use this software.\r
+ *\r
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.\r
+ *---------------------------------------------------------------------------*/\r
+\r
+#ifndef __CDCUSER_H__\r
+#define __CDCUSER_H__\r
+\r
+/* CDC buffer handling */\r
+extern int CDC_RdOutBuf        (char *buffer, const int *length);\r
+extern int CDC_WrOutBuf        (const char *buffer, int length);\r
+extern int CDC_OutBufAvailChar (int *availChar);\r
+extern void CDC_WaitNewData    ( void );\r
+\r
+\r
+/* CDC Data In/Out Endpoint Address */\r
+#define CDC_DEP_IN       0x82\r
+#define CDC_DEP_OUT      0x02\r
+\r
+/* CDC Communication In Endpoint Address */\r
+#define CDC_CEP_IN       0x81\r
+\r
+/* CDC Requests Callback Functions */\r
+extern uint32_t CDC_SendEncapsulatedCommand  (void);\r
+extern uint32_t CDC_GetEncapsulatedResponse  (void);\r
+extern uint32_t CDC_SetCommFeature           (unsigned short wFeatureSelector);\r
+extern uint32_t CDC_GetCommFeature           (unsigned short wFeatureSelector);\r
+extern uint32_t CDC_ClearCommFeature         (unsigned short wFeatureSelector);\r
+extern uint32_t CDC_GetLineCoding            (void);\r
+extern uint32_t CDC_SetLineCoding            (void);\r
+extern uint32_t CDC_SetControlLineState      (unsigned short wControlSignalBitmap);\r
+extern uint32_t CDC_SendBreak                (unsigned short wDurationOfBreak);\r
+\r
+/* CDC Bulk Callback Functions */\r
+extern void CDC_BulkIn                   (void);\r
+extern void CDC_BulkOut                  (void);\r
+extern void CDC_BulkOutNak                              (void);\r
+\r
+/* CDC Notification Callback Function */\r
+extern void CDC_NotificationIn           (void);\r
+\r
+/* CDC Initializtion Function */\r
+extern void CDC_Init (char portNum);\r
+\r
+/* CDC prepare the SERAIAL_STATE */\r
+extern unsigned short CDC_GetSerialState (void);\r
+\r
+/* CDC New data Notification Function */\r
+extern void vCDCNewDataNotify();\r
+\r
+/* flow control */\r
+extern unsigned short CDC_DepInEmpty;         // DataEndPoint IN empty\r
+\r
+#endif  /* __CDCUSER_H__ */\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/lpc43xx_libcfg.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/lpc43xx_libcfg.h
new file mode 100644 (file)
index 0000000..cbfc0a2
--- /dev/null
@@ -0,0 +1,146 @@
+/**********************************************************************
+* $Id$         lpc43xx_libcfg.h                2011-06-02
+*//**
+* @file                lpc43xx_libcfg.h
+* @brief       Library configuration file
+* @version     1.0
+* @date                02. June. 2011
+* @author      NXP MCU SW Application Team
+*
+* Copyright(C) 2011, NXP Semiconductor
+* All rights reserved.
+*
+***********************************************************************
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+
+#ifndef lpc43xx_LIBCFG_H_
+#define lpc43xx_LIBCFG_H_
+
+#include "lpc_types.h"
+
+
+/************************** DEBUG MODE DEFINITIONS *********************************/
+/* Un-comment the line below to compile the library in DEBUG mode, this will expanse
+   the "CHECK_PARAM" macro in the FW library code */
+
+#define DEBUG
+
+
+/******************* PERIPHERAL FW LIBRARY CONFIGURATION DEFINITIONS ***********************/
+
+/* Comment the line below to disable the specific peripheral inclusion */
+
+/* GPIO ------------------------------- */
+#define _GPIO
+
+/* EXTI ------------------------------- */
+//#define _EXTI
+
+/* UART ------------------------------- */
+#define _UART
+#define _UART0
+#define _UART1
+#define _UART2
+#define _UART3
+
+/* SPI ------------------------------- */
+//#define _SPI
+
+/* SSP ------------------------------- */
+//#define _SSP
+//#define _SSP0
+//#define _SSP1
+
+/* SYSTICK --------------------------- */
+//#define _SYSTICK
+
+/* I2C ------------------------------- */
+//#define _I2C
+//#define _I2C0
+//#define _I2C1
+//#define _I2C2
+
+/* TIMER ------------------------------- */
+//#define _TIM
+
+/* WDT ------------------------------- */
+//#define _WDT
+
+
+/* GPDMA ------------------------------- */
+//#define _GPDMA
+
+
+/* DAC ------------------------------- */
+//#define _DAC
+
+/* DAC ------------------------------- */
+//#define _ADC
+
+
+/* PWM ------------------------------- */
+//#define _PWM
+//#define _PWM1
+
+/* RTC ------------------------------- */
+//#define _RTC
+
+/* I2S ------------------------------- */
+//#define _I2S
+
+/* USB device ------------------------------- */
+#define _USBDEV
+//#define _USB_DMA
+
+/* QEI ------------------------------- */
+//#define _QEI
+
+/* MCPWM ------------------------------- */
+//#define _MCPWM
+
+/* CAN--------------------------------*/
+//#define _CAN
+
+/* RIT ------------------------------- */
+//#define _RIT
+
+/* EMAC ------------------------------ */
+//#define _EMAC
+
+/************************** GLOBAL/PUBLIC MACRO DEFINITIONS *********************************/
+
+#ifdef  DEBUG
+/*******************************************************************************
+* @brief               The CHECK_PARAM macro is used for function's parameters check.
+*                              It is used only if the library is compiled in DEBUG mode.
+* @param[in]   expr - If expr is false, it calls check_failed() function
+*                      which reports the name of the source file and the source
+*                      line number of the call that failed.
+*                    - If expr is true, it returns no value.
+* @return              None
+*******************************************************************************/
+#define CHECK_PARAM(expr) ((expr) ? (void)0 : check_failed((uint8_t *)__FILE__, __LINE__))
+#else
+#define CHECK_PARAM(expr)
+#endif /* DEBUG */
+
+
+
+/************************** GLOBAL/PUBLIC FUNCTION DECLARATION *********************************/
+
+#ifdef  DEBUG
+void check_failed(uint8_t *file, uint32_t line);
+#endif
+
+
+#endif /* lpc43xx_LIBCFG_H_ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usb.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usb.h
new file mode 100644 (file)
index 0000000..629a7a0
--- /dev/null
@@ -0,0 +1,422 @@
+/**********************************************************************
+* $Id$         usb.h           2011-06-02
+*//**
+* @file                usb.h
+* @brief       USB Definitions
+* @version     1.0
+* @date                02. June. 2011
+* @author      NXP MCU SW Application Team
+*
+* Copyright(C) 2011, NXP Semiconductor
+* All rights reserved.
+*
+***********************************************************************
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+
+#ifndef __USB_H__
+#define __USB_H__
+
+#include "usbcfg.h"
+
+#ifdef USE_USB0
+#define LPC_USB LPC_USB0       // Use USB0
+#else
+#define LPC_USB LPC_USB1       // Use USB1
+#endif
+#if defined   (  __GNUC__  )
+#define __packed __attribute__((__packed__))
+#endif
+
+#if defined     (  __CC_ARM  )
+typedef __packed union {
+#elif defined   (  __GNUC__  )
+typedef union __packed {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef union {
+#endif
+  uint16_t W;
+#if defined     (  __CC_ARM  )
+  __packed struct {
+#elif defined   (  __GNUC__  )
+  struct __packed {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+  struct {
+#endif
+    uint8_t L;
+    uint8_t H;
+  } WB;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+} WORD_BYTE;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+
+/* bmRequestType.Dir */
+#define REQUEST_HOST_TO_DEVICE     0
+#define REQUEST_DEVICE_TO_HOST     1
+
+/* bmRequestType.Type */
+#define REQUEST_STANDARD           0
+#define REQUEST_CLASS              1
+#define REQUEST_VENDOR             2
+#define REQUEST_RESERVED           3
+
+/* bmRequestType.Recipient */
+#define REQUEST_TO_DEVICE          0
+#define REQUEST_TO_INTERFACE       1
+#define REQUEST_TO_ENDPOINT        2
+#define REQUEST_TO_OTHER           3
+
+/* bmRequestType Definition */
+#if defined     (  __CC_ARM  )
+typedef __packed union _REQUEST_TYPE {
+#elif defined   (  __GNUC__  )
+typedef union __packed _REQUEST_TYPE {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef union _REQUEST_TYPE {
+#endif
+#if defined     (  __CC_ARM  )
+       __packed struct _BM {
+#elif defined   (  __GNUC__  )
+       struct __packed _BM {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+       struct _BM {
+#endif
+    uint8_t Recipient : 5;
+    uint8_t Type      : 2;
+    uint8_t Dir       : 1;
+  } BM;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+  uint8_t B;
+} REQUEST_TYPE;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB Standard Request Codes */
+#define USB_REQUEST_GET_STATUS                 0
+#define USB_REQUEST_CLEAR_FEATURE              1
+#define USB_REQUEST_SET_FEATURE                3
+#define USB_REQUEST_SET_ADDRESS                5
+#define USB_REQUEST_GET_DESCRIPTOR             6
+#define USB_REQUEST_SET_DESCRIPTOR             7
+#define USB_REQUEST_GET_CONFIGURATION          8
+#define USB_REQUEST_SET_CONFIGURATION          9
+#define USB_REQUEST_GET_INTERFACE              10
+#define USB_REQUEST_SET_INTERFACE              11
+#define USB_REQUEST_SYNC_FRAME                 12
+
+/* USB GET_STATUS Bit Values */
+#define USB_GETSTATUS_SELF_POWERED             0x01
+#define USB_GETSTATUS_REMOTE_WAKEUP            0x02
+#define USB_GETSTATUS_ENDPOINT_STALL           0x01
+
+/* USB Standard Feature selectors */
+#define USB_FEATURE_ENDPOINT_STALL             0
+#define USB_FEATURE_REMOTE_WAKEUP              1
+#define USB_FEATURE_TEST_MODE                  2
+
+/* USB Default Control Pipe Setup Packet */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_SETUP_PACKET {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_SETUP_PACKET {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_SETUP_PACKET {
+#endif
+  REQUEST_TYPE bmRequestType;
+  uint8_t         bRequest;
+  WORD_BYTE    wValue;
+  WORD_BYTE    wIndex;
+  uint16_t         wLength;
+} USB_SETUP_PACKET;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+
+/* USB Descriptor Types */
+#define USB_DEVICE_DESCRIPTOR_TYPE                  1
+#define USB_CONFIGURATION_DESCRIPTOR_TYPE           2
+#define USB_STRING_DESCRIPTOR_TYPE                  3
+#define USB_INTERFACE_DESCRIPTOR_TYPE               4
+#define USB_ENDPOINT_DESCRIPTOR_TYPE                5
+#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE        6
+#define USB_OTHER_SPEED_CONFIG_DESCRIPTOR_TYPE      7
+#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE         8
+#define USB_OTG_DESCRIPTOR_TYPE                     9
+#define USB_DEBUG_DESCRIPTOR_TYPE                  10
+#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE  11
+
+/* USB Device Classes */
+#define USB_DEVICE_CLASS_RESERVED              0x00
+#define USB_DEVICE_CLASS_AUDIO                 0x01
+#define USB_DEVICE_CLASS_COMMUNICATIONS        0x02
+#define USB_DEVICE_CLASS_HUMAN_INTERFACE       0x03
+#define USB_DEVICE_CLASS_MONITOR               0x04
+#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE    0x05
+#define USB_DEVICE_CLASS_POWER                 0x06
+#define USB_DEVICE_CLASS_PRINTER               0x07
+#define USB_DEVICE_CLASS_STORAGE               0x08
+#define USB_DEVICE_CLASS_HUB                   0x09
+#define USB_DEVICE_CLASS_MISCELLANEOUS         0xEF
+#define USB_DEVICE_CLASS_VENDOR_SPECIFIC       0xFF
+
+/* bmAttributes in Configuration Descriptor */
+#define USB_CONFIG_POWERED_MASK                0x40
+#define USB_CONFIG_BUS_POWERED                 0x80
+#define USB_CONFIG_SELF_POWERED                0xC0
+#define USB_CONFIG_REMOTE_WAKEUP               0x20
+
+/* bMaxPower in Configuration Descriptor */
+#define USB_CONFIG_POWER_MA(mA)                ((mA)/2)
+
+/* bEndpointAddress in Endpoint Descriptor */
+#define USB_ENDPOINT_DIRECTION_MASK            0x80
+#define USB_ENDPOINT_OUT(addr)                 ((addr) | 0x00)
+#define USB_ENDPOINT_IN(addr)                  ((addr) | 0x80)
+
+/* bmAttributes in Endpoint Descriptor */
+#define USB_ENDPOINT_TYPE_MASK                 0x03
+#define USB_ENDPOINT_TYPE_CONTROL              0x00
+#define USB_ENDPOINT_TYPE_ISOCHRONOUS          0x01
+#define USB_ENDPOINT_TYPE_BULK                 0x02
+#define USB_ENDPOINT_TYPE_INTERRUPT            0x03
+#define USB_ENDPOINT_SYNC_MASK                 0x0C
+#define USB_ENDPOINT_SYNC_NO_SYNCHRONIZATION   0x00
+#define USB_ENDPOINT_SYNC_ASYNCHRONOUS         0x04
+#define USB_ENDPOINT_SYNC_ADAPTIVE             0x08
+#define USB_ENDPOINT_SYNC_SYNCHRONOUS          0x0C
+#define USB_ENDPOINT_USAGE_MASK                0x30
+#define USB_ENDPOINT_USAGE_DATA                0x00
+#define USB_ENDPOINT_USAGE_FEEDBACK            0x10
+#define USB_ENDPOINT_USAGE_IMPLICIT_FEEDBACK   0x20
+#define USB_ENDPOINT_USAGE_RESERVED            0x30
+
+/* USB Standard Device Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_DEVICE_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_DEVICE_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_DEVICE_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint16_t  bcdUSB;
+  uint8_t  bDeviceClass;
+  uint8_t  bDeviceSubClass;
+  uint8_t  bDeviceProtocol;
+  uint8_t  bMaxPacketSize0;
+  uint16_t  idVendor;
+  uint16_t  idProduct;
+  uint16_t  bcdDevice;
+  uint8_t  iManufacturer;
+  uint8_t  iProduct;
+  uint8_t  iSerialNumber;
+  uint8_t  bNumConfigurations;
+} USB_DEVICE_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB 2.0 Device Qualifier Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_DEVICE_QUALIFIER_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint16_t  bcdUSB;
+  uint8_t  bDeviceClass;
+  uint8_t  bDeviceSubClass;
+  uint8_t  bDeviceProtocol;
+  uint8_t  bMaxPacketSize0;
+  uint8_t  bNumConfigurations;
+  uint8_t  bReserved;
+} USB_DEVICE_QUALIFIER_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB Standard Configuration Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_CONFIGURATION_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_CONFIGURATION_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_CONFIGURATION_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint16_t  wTotalLength;
+  uint8_t  bNumInterfaces;
+  uint8_t  bConfigurationValue;
+  uint8_t  iConfiguration;
+  uint8_t  bmAttributes;
+  uint8_t  bMaxPower;
+} USB_CONFIGURATION_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB Standard Interface Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_INTERFACE_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_INTERFACE_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_INTERFACE_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint8_t  bInterfaceNumber;
+  uint8_t  bAlternateSetting;
+  uint8_t  bNumEndpoints;
+  uint8_t  bInterfaceClass;
+  uint8_t  bInterfaceSubClass;
+  uint8_t  bInterfaceProtocol;
+  uint8_t  iInterface;
+} USB_INTERFACE_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB Standard Endpoint Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_ENDPOINT_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_ENDPOINT_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_ENDPOINT_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint8_t  bEndpointAddress;
+  uint8_t  bmAttributes;
+  uint16_t  wMaxPacketSize;
+  uint8_t  bInterval;
+} USB_ENDPOINT_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB String Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_STRING_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_STRING_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_STRING_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint16_t  bString/*[]*/;
+} USB_STRING_DESCRIPTOR;
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+/* USB Common Descriptor */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_COMMON_DESCRIPTOR {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_COMMON_DESCRIPTOR {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_COMMON_DESCRIPTOR {
+#endif
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+} USB_COMMON_DESCRIPTOR;
+
+/* USB Other Speed Configuration */
+#if defined     (  __CC_ARM  )
+typedef __packed struct _USB_OTHER_SPEED_CONFIGURATION {
+#elif defined   (  __GNUC__  )
+typedef struct __packed _USB_OTHER_SPEED_CONFIGURATION {
+#elif defined   (  __IAR_SYSTEMS_ICC__  )
+#pragma pack(1)
+typedef struct _USB_OTHER_SPEED_CONFIGURATION {
+#endif
+
+  uint8_t  bLength;
+  uint8_t  bDescriptorType;
+  uint16_t wTotalLength;
+  uint8_t  bNumInterfaces;
+  uint8_t  bConfigurationValue;
+  uint8_t  IConfiguration;
+  uint8_t  bmAttributes;
+  uint8_t  bMaxPower;
+} USB_OTHER_SPEED_CONFIGURATION;
+
+
+/* USB Endpoint Callback Events */
+#define USB_EVT_SETUP       1   /* Setup Packet */
+#define USB_EVT_OUT         2   /* OUT Packet */
+#define USB_EVT_IN          3   /*  IN Packet */
+#define USB_EVT_OUT_NAK     4   /* OUT Packet - Not Acknowledged */
+#define USB_EVT_IN_NAK      5   /*  IN Packet - Not Acknowledged */
+#define USB_EVT_OUT_STALL   6   /* OUT Packet - Stalled */
+#define USB_EVT_IN_STALL    7   /*  IN Packet - Stalled */
+#define USB_EVT_OUT_DMA_EOT 8   /* DMA OUT EP - End of Transfer */
+#define USB_EVT_IN_DMA_EOT  9   /* DMA  IN EP - End of Transfer */
+#define USB_EVT_OUT_DMA_NDR 10  /* DMA OUT EP - New Descriptor Request */
+#define USB_EVT_IN_DMA_NDR  11  /* DMA  IN EP - New Descriptor Request */
+#define USB_EVT_OUT_DMA_ERR 12  /* DMA OUT EP - Error */
+#define USB_EVT_IN_DMA_ERR  13  /* DMA  IN EP - Error */
+
+/* call back structure */
+typedef struct _USB_INIT_
+{
+  uint32_t ep0_maxp;
+  /* USB Device Events Callback Functions */
+  void (* USB_Power_Event)(uint32_t  power);
+  void (* USB_Reset_Event)(void);
+  void (* USB_Suspend_Event)(void);
+  void (* USB_Resume_Event)(void);
+  void (* USB_WakeUp_Event)(void);
+  void (* USB_SOF_Event)(void);
+  void (* USB_Error_Event)(uint32_t error);
+  /* USB Core Events Callback Functions */
+  void (* USB_Configure_Event)(void);
+  void (* USB_Interface_Event)(void);
+  void (* USB_Feature_Event)(void);
+  /* USB Endpoint Events Callback Pointers */
+  void (* USB_P_EP[4])(uint32_t event);
+} LPC_USBDRV_INIT_T;
+
+#ifdef __IAR_SYSTEMS_ICC__
+#pragma pack()
+#endif
+
+#endif  /* __USB_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcfg.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcfg.h
new file mode 100644 (file)
index 0000000..a47472e
--- /dev/null
@@ -0,0 +1,135 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbcfg.h
+ * Purpose: USB Custom Configuration
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing 
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *----------------------------------------------------------------------------
+ * History:
+ *          V1.20 Added vendor specific support
+ *          V1.00 Initial Version
+ *----------------------------------------------------------------------------*/
+
+#ifndef __USBCFG_H__
+#define __USBCFG_H__
+
+
+//*** <<< Use Configuration Wizard in Context Menu >>> ***
+
+
+/*
+// <h> USB Configuration
+//   <o0> USB Power
+//        <i> Default Power Setting
+//        <0=> Bus-powered
+//        <1=> Self-powered
+//   <o1> Max Number of Interfaces <1-256>
+//   <o2> Max Number of Endpoints  <1-32>
+//   <o3> Max Endpoint 0 Packet Size
+//        <8=> 8 Bytes <16=> 16 Bytes <32=> 32 Bytes <64=> 64 Bytes
+// </h>
+*/
+
+#define USB_POWER           1
+#define USB_IF_NUM          1
+#define USB_EP_NUM          4
+#define USB_MAX_PACKET0     64
+
+
+/*
+// <h> USB Event Handlers
+//   <h> Device Events
+//     <o0.0> Power Event
+//     <o1.0> Reset Event
+//     <o2.0> Suspend Event
+//     <o3.0> Resume Event
+//     <o4.0> Remote Wakeup Event
+//     <o5.0> Start of Frame Event
+//     <o6.0> Error Event
+//   </h>
+//   <h> Endpoint Events
+//     <o7.0>  Endpoint 0 Event
+//     <o7.1>  Endpoint 1 Event
+//     <o7.2>  Endpoint 2 Event
+//     <o7.3>  Endpoint 3 Event
+//     <o7.4>  Endpoint 4 Event
+//   </h>
+//   <h> USB Core Events
+//     <o8.0>  Set Configuration Event
+//     <o9.0>  Set Interface Event
+//     <o10.0> Set/Clear Feature Event
+//   </h>
+// </h>
+*/
+
+#define USB_POWER_EVENT     0
+#define USB_RESET_EVENT     1
+#define USB_SUSPEND_EVENT   1
+#define USB_RESUME_EVENT    1
+#define USB_WAKEUP_EVENT    0
+#define USB_SOF_EVENT       0
+#define USB_ERROR_EVENT     0
+#define USB_EP_EVENT        0x0007
+#define USB_CONFIGURE_EVENT 1
+#define USB_INTERFACE_EVENT 0
+#define USB_FEATURE_EVENT   0
+
+
+/*
+// <e0> USB Class Support
+//   <i> enables USB Class specific Requests
+//   <e1> Human Interface Device (HID)
+//     <o2> Interface Number <0-255>
+//   </e>
+//   <e3> Mass Storage
+//     <o4> Interface Number <0-255>
+//   </e>
+//   <e5> Audio Device
+//     <o6> Control Interface Number <0-255>
+//     <o7> Streaming Interface 1 Number <0-255>
+//     <o8> Streaming Interface 2 Number <0-255>
+//   </e>
+//   <e9> Communication Device
+//     <o10> Control Interface Number <0-255>
+//     <o11> Bulk Interface Number <0-255>
+//     <o12> Max Communication Device Buffer Size
+//        <8=> 8 Bytes <16=> 16 Bytes <32=> 32 Bytes <64=> 64 Bytes 
+//   </e>
+// </e>
+*/
+
+#define USB_CLASS           1
+#define USB_HID             0
+#define USB_HID_IF_NUM      0
+#define USB_MSC             0
+#define USB_MSC_IF_NUM      0
+#define USB_AUDIO           0
+#define USB_ADC_CIF_NUM     0
+#define USB_ADC_SIF1_NUM    1
+#define USB_ADC_SIF2_NUM    2
+#define USB_CDC                        1
+#define USB_CDC_CIF_NUM     0
+#define USB_CDC_DIF_NUM     1
+#define USB_CDC_BUFSIZE     64
+
+/*
+// <e0> USB Vendor Support
+//   <i> enables USB Vendor specific Requests
+// </e>
+*/
+#define USB_VENDOR          0
+
+#define USE_USB0
+
+
+#endif  /* __USBCFG_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcore.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbcore.h
new file mode 100644 (file)
index 0000000..b9d0a91
--- /dev/null
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbcore.h
+ * Purpose: USB Core Definitions
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC microcontroller devices only. Nothing else 
+ *      gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+#ifndef __USBCORE_H__
+#define __USBCORE_H__
+
+
+/* USB Endpoint Data Structure */
+typedef struct _USB_EP_DATA {
+  uint8_t  *pData;
+  uint16_t Count;
+} USB_EP_DATA;
+
+/* USB Core Global Variables */
+extern uint16_t USB_DeviceStatus;
+extern uint8_t  USB_DeviceAddress;
+extern uint8_t  USB_Configuration;
+extern uint32_t USB_EndPointMask;
+extern uint32_t USB_EndPointHalt;
+extern uint32_t USB_EndPointStall;
+extern uint8_t  USB_AltSetting[USB_IF_NUM];
+
+/* USB Endpoint 0 Buffer */
+extern uint8_t  EP0Buf[USB_MAX_PACKET0];
+
+/* USB Endpoint 0 Data Info */
+extern USB_EP_DATA EP0Data;
+
+/* USB Setup Packet */
+extern USB_SETUP_PACKET SetupPacket;
+
+/* USB Core Functions */
+extern void USB_ResetCore (void);
+
+
+#endif  /* __USBCORE_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbdesc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbdesc.h
new file mode 100644 (file)
index 0000000..6f00e0f
--- /dev/null
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbdesc.h
+ * Purpose: USB Descriptors Definitions
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC microcontroller devices only. Nothing else 
+ *      gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+#ifndef __USBDESC_H__
+#define __USBDESC_H__
+
+
+#define WBVAL(x) (x & 0xFF),((x >> 8) & 0xFF)
+
+#define USB_DEVICE_DESC_SIZE        (sizeof(USB_DEVICE_DESCRIPTOR))
+#define USB_CONFIGUARTION_DESC_SIZE (sizeof(USB_CONFIGURATION_DESCRIPTOR))
+#define USB_INTERFACE_DESC_SIZE     (sizeof(USB_INTERFACE_DESCRIPTOR))
+#define USB_ENDPOINT_DESC_SIZE      (sizeof(USB_ENDPOINT_DESCRIPTOR))
+#define USB_DEVICE_QUALI_SIZE       (sizeof(USB_DEVICE_QUALIFIER_DESCRIPTOR))
+#define USB_OTHER_SPEED_CONF_SIZE   (sizeof(USB_OTHER_SPEED_CONFIGURATION))
+
+extern const uint8_t USB_DeviceDescriptor[];
+extern const uint8_t USB_FSConfigDescriptor[];
+extern const uint8_t USB_HSConfigDescriptor[];
+extern const uint8_t USB_StringDescriptor[];
+extern const uint8_t USB_DeviceQualifier[];
+extern const uint8_t USB_FSOtherSpeedConfiguration[];
+extern const uint8_t USB_HSOtherSpeedConfiguration[];
+
+
+#endif  /* __USBDESC_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbhw.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbhw.h
new file mode 100644 (file)
index 0000000..e946a4a
--- /dev/null
@@ -0,0 +1,156 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbhw.h
+ * Purpose: USB Hardware Layer Definitions
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing 
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *----------------------------------------------------------------------------
+ * History:
+ *          V1.20 Added USB_ClearEPBuf 
+ *          V1.00 Initial Version
+ *----------------------------------------------------------------------------*/
+
+#ifndef __USBHW_H__
+#define __USBHW_H__
+#include "usb.h"
+/* dTD Transfer Description */
+typedef volatile struct
+{
+  volatile uint32_t next_dTD;
+  volatile uint32_t total_bytes ;
+  volatile uint32_t buffer0;
+  volatile uint32_t buffer1;
+  volatile uint32_t buffer2;
+  volatile uint32_t buffer3;
+  volatile uint32_t buffer4;
+  volatile uint32_t reserved;
+}  DTD_T;
+
+/* dQH  Queue Head */
+typedef volatile struct
+{
+  volatile uint32_t cap;
+  volatile uint32_t curr_dTD;
+  volatile uint32_t next_dTD;
+  volatile uint32_t total_bytes;
+  volatile uint32_t buffer0;
+  volatile uint32_t buffer1;
+  volatile uint32_t buffer2;
+  volatile uint32_t buffer3;
+  volatile uint32_t buffer4;
+  volatile uint32_t reserved;
+  volatile uint32_t setup[2];
+  volatile uint32_t gap[4];
+}  DQH_T;
+
+/* bit defines for USBCMD register */
+#define USBCMD_RS          (1<<0)
+#define USBCMD_RST         (1<<1)
+#define USBCMD_ATDTW   (1<<12)
+#define USBCMD_SUTW        (1<<13)
+
+/* bit defines for USBSTS register */
+#define USBSTS_UI          (1<<0)
+#define USBSTS_UEI         (1<<1)
+#define USBSTS_PCI         (1<<2)
+#define USBSTS_URI         (1<<6)
+#define USBSTS_SRI         (1<<7)
+#define USBSTS_SLI         (1<<8)
+#define USBSTS_NAKI        (1<<16)
+
+/* bit defines for DEVICEADDR register */
+#define USBDEV_ADDR_AD (1<<24)
+#define USBDEV_ADDR(n) (((n) & 0x7F)<<25)
+
+/* bit defines for PRTSC1 register */
+#define USBPRTS_CCS     (1<<0)
+#define USBPRTS_PE      (1<<2)
+#define USBPRTS_FPR     (1<<6)
+#define USBPRTS_SUSP    (1<<7)
+#define USBPRTS_PR      (1<<8)
+#define USBPRTS_HSP     (1<<9)
+#define USBPRTS_PLPSCD  (1<<23)
+#define USBPRTS_PFSC    (1<<24)
+
+/* bit defines for USBMODE register */
+#define USBMODE_CM_IDLE        (0x0<<0)
+#define USBMODE_CM_DEV (0x2<<0)
+#define USBMODE_CM_HOST        (0x3<<0)
+#define USBMODE_SLOM    (1<<3)
+#define USBMODE_SDIS    (1<<4)
+
+/* bit defines for EP registers*/
+#define USB_EP_BITPOS(n) (((n) & 0x80)? (0x10 | ((n) & 0x7)) : ((n) & 0x7))
+
+/* bit defines EPcontrol registers*/
+#define EPCTRL_RXS           (1<<0)
+#define EPCTRL_RX_TYPE(n) (((n) & 0x3)<<2)
+#define EPCTRL_RX_CTL    (0<<2)
+#define EPCTRL_RX_ISO    (1<<2)
+#define EPCTRL_RX_BLK    (2<<2)
+#define EPCTRL_RXI           (1<<5)
+#define EPCTRL_RXR           (1<<6)
+#define EPCTRL_RXE           (1<<7)
+#define EPCTRL_TXS           (1<<16)
+#define EPCTRL_TX_TYPE(n) (((n) & 0x3)<<18)
+#define EPCTRL_TX_CTL    (0<<18)
+#define EPCTRL_TX_ISO    (1<<18)
+#define EPCTRL_TX_BLK    (2<<18)
+#define EPCTRL_TX_INT    (3<<18)
+#define EPCTRL_TXI           (1<<21)
+#define EPCTRL_TXR           (1<<22)
+#define EPCTRL_TXE           (1<<23)
+
+/* dQH field and bit defines */
+/* Temp fixed on max, should be taken out of table */
+#define QH_MAX_CTRL_PAYLOAD       0x03ff
+#define QH_MAX_PKT_LEN_POS            16
+#define QH_MAXP(n)                (((n) & 0x3FF)<<16)
+#define QH_IOS                    (1<<15)
+#define QH_ZLT                    (1<<29)
+
+/* dTD field and bit defines */
+#define TD_NEXT_TERMINATE         (1<<0)
+#define TD_IOC                    (1<<15)
+
+/* Total physical enpoints*/
+#define EP_NUM_MAX     8
+
+
+/* USB Hardware Functions */
+extern void  USB_Init       (LPC_USBDRV_INIT_T* cbs);
+extern void  USB_Connect    (uint32_t  con);
+extern void  USB_Reset      (void);
+extern void  USB_Suspend    (void);
+extern void  USB_Resume     (void);
+extern void  USB_WakeUp     (void);
+extern void  USB_WakeUpCfg  (uint32_t  cfg);
+extern void  USB_SetAddress (uint32_t adr);
+extern void  USB_Configure  (uint32_t  cfg);
+extern void  USB_ConfigEP   (USB_ENDPOINT_DESCRIPTOR *pEPD);
+extern void  USB_DirCtrlEP  (uint32_t dir);
+extern void  USB_EnableEP   (uint32_t EPNum);
+extern void  USB_DisableEP  (uint32_t EPNum);
+extern void  USB_ResetEP    (uint32_t EPNum);
+extern void  USB_SetStallEP (uint32_t EPNum);
+extern void  USB_ClrStallEP (uint32_t EPNum);
+extern void  USB_ClearEPBuf  (uint32_t  EPNum);
+extern uint32_t USB_SetTestMode(uint8_t mode);
+extern uint32_t USB_ReadEP     (uint32_t EPNum, uint8_t *pData);
+extern uint32_t USB_ReadReqEP(uint32_t EPNum, uint8_t *pData, uint32_t len);
+extern uint32_t USB_ReadSetupPkt(uint32_t, uint32_t *);
+extern uint32_t USB_WriteEP    (uint32_t EPNum, uint8_t *pData, uint32_t cnt);
+extern uint32_t USB_GetFrame   (void);
+//extern void  USB_ISR(void) __irq;
+
+#endif  /* __USBHW_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbuser.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/include/usbuser.h
new file mode 100644 (file)
index 0000000..5f14799
--- /dev/null
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbuser.h
+ * Purpose: USB Custom User Definitions
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing 
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+#ifndef __USBUSER_H__
+#define __USBUSER_H__
+
+
+/* USB Device Events Callback Functions */
+extern void USB_Power_Event     (uint32_t power);
+extern void USB_Reset_Event     (void);
+extern void USB_Suspend_Event   (void);
+extern void USB_Resume_Event    (void);
+extern void USB_WakeUp_Event    (void);
+extern void USB_SOF_Event       (void);
+extern void USB_Error_Event     (uint32_t error);
+
+/* USB Endpoint Events Callback Pointers */
+extern void (* const USB_P_EP[USB_EP_NUM])(uint32_t event);
+
+/* USB Endpoint Events Callback Functions */
+extern void USB_EndPoint0  (uint32_t event);
+extern void USB_EndPoint1  (uint32_t event);
+extern void USB_EndPoint2  (uint32_t event);
+extern void USB_EndPoint3  (uint32_t event);
+extern void USB_EndPoint4  (uint32_t event);
+extern void USB_EndPoint5  (uint32_t event);
+
+/* USB Core Events Callback Functions */
+extern void USB_Configure_Event (void);
+extern void USB_Interface_Event (void);
+extern void USB_Feature_Event   (void);
+
+
+#endif  /* __USBUSER_H__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom-win7.inf b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom-win7.inf
new file mode 100644 (file)
index 0000000..5778adb
--- /dev/null
@@ -0,0 +1,60 @@
+; \r
+; Keil - An ARM Company  Comunication Device Class driver installation file\r
+; (C)2007 Copyright \r
+;\r
+\r
+[Version] \r
+Signature="$Windows NT$" \r
+Class=Ports\r
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} \r
+Provider=%Keil% \r
+LayoutFile=layout.inf\r
+DriverVer=01/06/07\r
+\r
+[Manufacturer] \r
+%Keil%=DeviceList,NT,NTamd64\r
+\r
+[DestinationDirs]\r
+DefaultDestDir=12\r
+\r
+[SourceDisksFiles]\r
+\r
+[SourceDisksNames]\r
+\r
+[DeviceList.NT] \r
+%DESCRIPTION%=LPC18xxUSB, USB\VID_1FC9&PID_2002 \r
+[DeviceList.NTamd64]\r
+%DESCRIPTION%=LPC18xxUSB, USB\VID_1FC9&PID_2002\r
+\r
+;------------------------------------------------------------------------------\r
+;  Windows Sections\r
+;------------------------------------------------------------------------------\r
+\r
+[LPC18xxUSB.NT] \r
+Include=mdmcpq.inf\r
+CopyFiles=FakeModemCopyFileSection\r
+AddReg=LPC18xxUSB.NT.AddReg\r
+\r
+[LPC18xxUSB.NT.AddReg] \r
+HKR,,DevLoader,,*ntkern \r
+HKR,,NTMPDriver,,usbser.sys \r
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" \r
+\r
+[LPC18xxUSB.NT.Services] \r
+AddService=usbser, 0x00000002, DriverService.NT\r
+\r
+[DriverService.NT] \r
+DisplayName=%DESCRIPTION% \r
+ServiceType=1\r
+StartType=3\r
+ErrorControl=1\r
+ServiceBinary=%12%\usbser.sys \r
+LoadOrderGroup = Base\r
+\r
+;------------------------------------------------------------------------------\r
+;  String Definitions\r
+;------------------------------------------------------------------------------\r
+\r
+[Strings] \r
+NXP="NXP - Founded by Philips"\r
+DESCRIPTION="LPC18xx USB VCom Port" \r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom.inf b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/inf/lpc18xx-vcom.inf
new file mode 100644 (file)
index 0000000..715179f
--- /dev/null
@@ -0,0 +1,65 @@
+; 
+; Keil - An ARM Company  Comunication Device Class driver installation file
+; (C)2007 Copyright 
+;
+
+[Version] 
+Signature="$Windows NT$" 
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 
+Provider=%Keil% 
+;LayoutFile=layout.inf
+DriverVer=01/06/07
+
+[Manufacturer] 
+%Keil%=DeviceList
+
+[DestinationDirs] 
+DefaultDestDir=12 
+
+[SourceDisksFiles]
+
+[SourceDisksNames]
+
+[DeviceList] 
+%DESCRIPTION%=LPC18xxUSB, USB\VID_1FC9&PID_2002 
+
+;------------------------------------------------------------------------------
+;  Windows 2000/XP Sections
+;------------------------------------------------------------------------------
+
+[LPC18xxUSB.nt] 
+include=mdmcpq.inf
+CopyFiles=DriverCopyFiles
+AddReg=LPC18xxUSB.nt.AddReg 
+
+[DriverCopyFiles]
+usbser.sys,,,0x20
+
+[LPC18xxUSB.nt.AddReg] 
+HKR,,DevLoader,,*ntkern 
+HKR,,NTMPDriver,,usbser.sys 
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 
+
+[LPC18xxUSB.nt.Services] 
+include=mdmcpq.inf
+AddService=usbser, 0x00000002, DriverService
+
+
+[LPC18xxUSB.nt.HW]
+include=mdmcpq.inf
+
+[DriverService] 
+DisplayName=%DESCRIPTION% 
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys 
+
+;------------------------------------------------------------------------------
+;  String Definitions
+;------------------------------------------------------------------------------
+
+[Strings] 
+NXP="NXP - Founded by Philips"
+DESCRIPTION="LPC18xx USB VCom Port" 
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbcore.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbcore.c
new file mode 100644 (file)
index 0000000..554390a
--- /dev/null
@@ -0,0 +1,1130 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbcore.c
+ * Purpose: USB Core Module
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing 
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *----------------------------------------------------------------------------
+ * History:
+ *          V1.20 Added vendor specific requests
+ *                Changed string descriptor handling
+ *                Reworked Endpoint0
+ *          V1.00 Initial Version
+ *----------------------------------------------------------------------------*/
+#include "lpc18xx.H"
+#include "lpc_types.h"
+
+#include "usb.h"
+#include "usbcfg.h"
+#include "usbhw.h"
+#include "usbcore.h"
+#include "usbdesc.h"
+#include "usbuser.h"
+
+#if (USB_CLASS)
+
+#if (USB_AUDIO)
+#include "audio.h"
+#include "adcuser.h"
+#endif
+
+#if (USB_HID)
+#include "hid.h"
+#include "hiduser.h"
+#endif
+
+#if (USB_MSC)
+#include "msc.h"
+#include "mscuser.h"
+extern MSC_CSW CSW;
+#endif
+
+#if (USB_CDC)
+#include "cdc.h"
+#include "cdcuser.h"
+#endif
+
+#endif
+
+#if (USB_VENDOR)
+#include "vendor.h"
+#endif
+
+#ifdef __CC_ARM
+#pragma diag_suppress 111,177,1441
+#endif
+
+#if defined   (  __GNUC__  )
+#define __packed __attribute__((__packed__))
+#endif
+
+uint16_t  USB_DeviceStatus;
+uint8_t  USB_DeviceAddress;
+uint8_t  USB_Configuration;
+uint32_t USB_EndPointMask;
+uint32_t USB_EndPointHalt;
+uint32_t USB_EndPointStall;                         /* EP must stay stalled */
+uint8_t  USB_NumInterfaces;
+uint8_t  USB_AltSetting[USB_IF_NUM];
+
+USB_EP_DATA EP0Data;
+
+#pragma pack(4)
+uint8_t  EP0Buf[USB_MAX_PACKET0];
+USB_SETUP_PACKET SetupPacket;
+
+extern volatile uint32_t DevStatusFS2HS;
+
+/*
+ *  Reset USB Core
+ *    Parameters:      None
+ *    Return Value:    None
+ */
+
+void USB_ResetCore (void) {
+
+  USB_DeviceStatus  = USB_POWER;
+  USB_DeviceAddress = 0;
+  USB_Configuration = 0;
+  USB_EndPointMask  = 0x00010001;
+  USB_EndPointHalt  = 0x00000000;
+  USB_EndPointStall = 0x00000000;
+}
+
+
+/*
+ *  USB Request - Setup Stage
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    None
+ */
+
+void USB_SetupStage (void) {
+  USB_ReadSetupPkt(0x00, (uint32_t *)&SetupPacket);
+}
+
+
+/*
+ *  USB Request - Data In Stage
+ *    Parameters:      None (global EP0Data)
+ *    Return Value:    None
+ */
+
+void USB_DataInStage (void) {
+  uint32_t cnt;
+
+  if (EP0Data.Count > USB_MAX_PACKET0) {
+    cnt = USB_MAX_PACKET0;
+  } else {
+    cnt = EP0Data.Count;
+  }
+  cnt = USB_WriteEP(0x80, EP0Data.pData, cnt);
+  EP0Data.pData += cnt;
+  EP0Data.Count -= cnt;
+}
+
+
+/*
+ *  USB Request - Data Out Stage
+ *    Parameters:      None (global EP0Data)
+ *    Return Value:    None
+ */
+
+void USB_DataOutStage (void) {
+  uint32_t cnt;
+
+  cnt = USB_ReadEP(0x00, EP0Data.pData);
+  EP0Data.pData += cnt;
+  EP0Data.Count -= cnt;
+}
+
+
+/*
+ *  USB Request - Status In Stage
+ *    Parameters:      None
+ *    Return Value:    None
+ */
+
+void USB_StatusInStage (void) {
+  USB_WriteEP(0x80, NULL, 0);
+}
+
+
+/*
+ *  USB Request - Status Out Stage
+ *    Parameters:      None
+ *    Return Value:    None
+ */
+
+void USB_StatusOutStage (void) {
+  USB_ReadEP(0x00, EP0Buf);
+}
+
+
+/*
+ *  Get Status USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqGetStatus (void) {
+  uint32_t n, m;
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+      EP0Data.pData = (uint8_t *)&USB_DeviceStatus;
+      break;
+    case REQUEST_TO_INTERFACE:
+      if ((USB_Configuration != 0) && (SetupPacket.wIndex.WB.L < USB_NumInterfaces)) {
+        *((__packed uint16_t *)EP0Buf) = 0;
+        EP0Data.pData = EP0Buf;
+      } else {
+        return (FALSE);
+      }
+      break;
+    case REQUEST_TO_ENDPOINT:
+      n = SetupPacket.wIndex.WB.L & 0x8F;
+      m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
+      if (((USB_Configuration != 0) || ((n & 0x0F) == 0)) && (USB_EndPointMask & m)) {
+        *((__packed uint16_t *)EP0Buf) = (USB_EndPointHalt & m) ? 1 : 0;
+        EP0Data.pData = EP0Buf;
+      } else {
+        return (FALSE);
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Set/Clear Feature USB Request
+ *    Parameters:      sc:    0 - Clear, 1 - Set
+ *                            (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqSetClrFeature (uint32_t sc) {
+  uint32_t n, m;
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+      if (SetupPacket.wValue.W == USB_FEATURE_REMOTE_WAKEUP) {
+        if (sc) {
+          USB_WakeUpCfg(TRUE);
+          USB_DeviceStatus |=  USB_GETSTATUS_REMOTE_WAKEUP;
+        } else {
+          USB_WakeUpCfg(FALSE);
+          USB_DeviceStatus &= ~USB_GETSTATUS_REMOTE_WAKEUP;
+        }
+      } else if (SetupPacket.wValue.W == USB_FEATURE_TEST_MODE) {
+          return USB_SetTestMode(SetupPacket.wIndex.WB.H);
+      } else {
+        return (FALSE);
+      }
+      break;
+    case REQUEST_TO_INTERFACE:
+      return (FALSE);
+    case REQUEST_TO_ENDPOINT:
+      n = SetupPacket.wIndex.WB.L & 0x8F;
+      m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
+      if ((USB_Configuration != 0) && ((n & 0x0F) != 0) && (USB_EndPointMask & m)) {
+        if (SetupPacket.wValue.W == USB_FEATURE_ENDPOINT_STALL) {
+          if (sc) {
+            USB_SetStallEP(n);
+            USB_EndPointHalt |=  m;
+          } else {
+            if ((USB_EndPointStall & m) != 0) {
+              return (TRUE);
+            }
+            USB_ClrStallEP(n);
+#if (USB_MSC)
+            if ((n == MSC_EP_IN) && ((USB_EndPointHalt & m) != 0)) {
+              /* Compliance Test: rewrite CSW after unstall */
+              if (CSW.dSignature == MSC_CSW_Signature) {
+                USB_WriteEP(MSC_EP_IN, (uint8_t *)&CSW, sizeof(CSW));
+              }
+            }
+#endif
+            USB_EndPointHalt &= ~m;
+          }
+        } else {
+          return (FALSE);
+        }
+      } else {
+        return (FALSE);
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Set Address USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqSetAddress (void) {
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+      USB_DeviceAddress = 0x80 | SetupPacket.wValue.WB.L;
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Get Descriptor USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqGetDescriptor (void) {
+  uint8_t  *pD;
+  uint32_t len, n;
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+      switch (SetupPacket.wValue.WB.H) {
+        case USB_DEVICE_DESCRIPTOR_TYPE:
+          EP0Data.pData = (uint8_t *)USB_DeviceDescriptor;
+          len = USB_DEVICE_DESC_SIZE;
+          break;
+        case USB_CONFIGURATION_DESCRIPTOR_TYPE:
+          if ( DevStatusFS2HS == FALSE ) { 
+            pD = (uint8_t *)USB_FSConfigDescriptor;
+          } else {
+            pD = (uint8_t *)USB_HSConfigDescriptor;
+                     }
+          for (n = 0; n != SetupPacket.wValue.WB.L; n++) {
+            if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bLength != 0) {
+              pD += ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
+            }
+          }
+          if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bLength == 0) {
+            return (FALSE);
+          }
+          EP0Data.pData = pD;
+          len = ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
+          break;
+        case USB_STRING_DESCRIPTOR_TYPE:
+          pD = (uint8_t *)USB_StringDescriptor;
+          for (n = 0; n != SetupPacket.wValue.WB.L; n++) {
+            if (((USB_STRING_DESCRIPTOR *)pD)->bLength != 0) {
+              pD += ((USB_STRING_DESCRIPTOR *)pD)->bLength;
+            }
+          }
+          if (((USB_STRING_DESCRIPTOR *)pD)->bLength == 0) {
+            return (FALSE);
+          }
+          EP0Data.pData = pD;
+          len = ((USB_STRING_DESCRIPTOR *)pD)->bLength;
+          break;
+        case USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE:
+          /* USB Chapter 9. page 9.6.2 */
+          if ( DevStatusFS2HS == FALSE ) {
+                 return (FALSE);
+          }
+          else
+          {
+            EP0Data.pData = (uint8_t *)USB_DeviceQualifier;
+                  len = USB_DEVICE_QUALI_SIZE;
+          }
+          break;
+        case USB_OTHER_SPEED_CONFIG_DESCRIPTOR_TYPE:
+                     if ( DevStatusFS2HS == TRUE ) { 
+                pD = (uint8_t *)USB_FSOtherSpeedConfiguration;
+              } else {
+                pD = (uint8_t *)USB_HSOtherSpeedConfiguration;
+                     }
+          
+          for (n = 0; n != SetupPacket.wValue.WB.L; n++) {
+            if (((USB_OTHER_SPEED_CONFIGURATION *)pD)->bLength != 0) {
+              pD += ((USB_OTHER_SPEED_CONFIGURATION *)pD)->wTotalLength;
+            }
+          }
+          if (((USB_OTHER_SPEED_CONFIGURATION *)pD)->bLength == 0) {
+            return (FALSE);
+          }
+          EP0Data.pData = pD;
+          len = ((USB_OTHER_SPEED_CONFIGURATION *)pD)->wTotalLength;
+          break;
+        default:
+          return (FALSE);
+      }
+      break;
+    case REQUEST_TO_INTERFACE:
+      switch (SetupPacket.wValue.WB.H) {
+#if USB_HID
+        case HID_HID_DESCRIPTOR_TYPE:
+          if (SetupPacket.wIndex.WB.L != USB_HID_IF_NUM) {
+            return (FALSE);    /* Only Single HID Interface is supported */
+          }
+                 if ( DevStatusFS2HS == FALSE ) { 
+            EP0Data.pData = (uint8_t *)USB_FSConfigDescriptor + HID_DESC_OFFSET;
+          } else {
+                   EP0Data.pData = (uint8_t *)USB_HSConfigDescriptor + HID_DESC_OFFSET;
+                 }
+          len = HID_DESC_SIZE;
+          break;
+        case HID_REPORT_DESCRIPTOR_TYPE:
+          if (SetupPacket.wIndex.WB.L != USB_HID_IF_NUM) {
+            return (FALSE);    /* Only Single HID Interface is supported */
+          }
+          EP0Data.pData = (uint8_t *)HID_ReportDescriptor;
+          len = HID_ReportDescSize;
+          break;
+        case HID_PHYSICAL_DESCRIPTOR_TYPE:
+          return (FALSE);      /* HID Physical Descriptor is not supported */
+#endif
+        default:
+          return (FALSE);
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+
+  if (EP0Data.Count > len) {
+    EP0Data.Count = len;
+  }
+
+  return (TRUE);
+}
+
+
+/*
+ *  Get Configuration USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqGetConfiguration (void) {
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+      EP0Data.pData = &USB_Configuration;
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Set Configuration USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqSetConfiguration (void) {
+  USB_COMMON_DESCRIPTOR *pD;
+  uint32_t alt = 0;
+  uint32_t n, m;
+  uint32_t new_addr;
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_DEVICE:
+
+      if (SetupPacket.wValue.WB.L) {
+        if ( DevStatusFS2HS == FALSE ) { 
+          pD = (USB_COMMON_DESCRIPTOR *)USB_FSConfigDescriptor;
+           } else {
+             pD = (USB_COMMON_DESCRIPTOR *)USB_HSConfigDescriptor;
+           }
+        while (pD->bLength) {
+          switch (pD->bDescriptorType) {
+            case USB_CONFIGURATION_DESCRIPTOR_TYPE:
+              if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bConfigurationValue == SetupPacket.wValue.WB.L) {
+                USB_Configuration = SetupPacket.wValue.WB.L;
+                USB_NumInterfaces = ((USB_CONFIGURATION_DESCRIPTOR *)pD)->bNumInterfaces;
+                for (n = 0; n < USB_IF_NUM; n++) {
+                  USB_AltSetting[n] = 0;
+                }
+              for (n = 1; n < USB_EP_NUM; n++) {
+                  if (USB_EndPointMask & (1 << n)) {
+                    USB_DisableEP(n);
+                  }
+                  if (USB_EndPointMask & ((1 << 16) << n)) {
+                    USB_DisableEP(n | 0x80);
+                  }
+                }
+                USB_EndPointMask = 0x00010001;
+                USB_EndPointHalt = 0x00000000;
+                USB_EndPointStall= 0x00000000;
+                USB_Configure(TRUE);
+                if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bmAttributes & USB_CONFIG_POWERED_MASK) {
+                  USB_DeviceStatus |=  USB_GETSTATUS_SELF_POWERED;
+                } else {
+                  USB_DeviceStatus &= ~USB_GETSTATUS_SELF_POWERED;
+                }
+              } else {
+              new_addr = (uint32_t)pD + ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
+              pD = (USB_COMMON_DESCRIPTOR*)new_addr;
+                continue;
+              }
+              break;
+            case USB_INTERFACE_DESCRIPTOR_TYPE:
+              alt = ((USB_INTERFACE_DESCRIPTOR *)pD)->bAlternateSetting;
+              break;
+            case USB_ENDPOINT_DESCRIPTOR_TYPE:
+              if (alt == 0) {
+                n = ((USB_ENDPOINT_DESCRIPTOR *)pD)->bEndpointAddress & 0x8F;
+                m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
+                USB_EndPointMask |= m;
+                USB_ConfigEP((USB_ENDPOINT_DESCRIPTOR *)pD);
+                USB_EnableEP(n);
+                USB_ResetEP(n);
+              }
+              break;
+          }
+        new_addr = (uint32_t)pD + pD->bLength;
+        pD = (USB_COMMON_DESCRIPTOR*)new_addr;
+        }
+      }
+      else {
+        USB_Configuration = 0;
+      for (n = 1; n < USB_EP_NUM; n++) {
+          if (USB_EndPointMask & (1 << n)) {
+            USB_DisableEP(n);
+          }
+          if (USB_EndPointMask & ((1 << 16) << n)) {
+            USB_DisableEP(n | 0x80);
+          }
+        }
+        USB_EndPointMask  = 0x00010001;
+        USB_EndPointHalt  = 0x00000000;
+        USB_EndPointStall = 0x00000000;
+        USB_Configure(FALSE);
+      }
+
+      if (USB_Configuration != SetupPacket.wValue.WB.L) {
+        return (FALSE);
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Get Interface USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqGetInterface (void) {
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_INTERFACE:
+      if ((USB_Configuration != 0) && (SetupPacket.wIndex.WB.L < USB_NumInterfaces)) {
+        EP0Data.pData = USB_AltSetting + SetupPacket.wIndex.WB.L;
+      } else {
+        return (FALSE);
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+  return (TRUE);
+}
+
+
+/*
+ *  Set Interface USB Request
+ *    Parameters:      None (global SetupPacket)
+ *    Return Value:    TRUE - Success, FALSE - Error
+ */
+
+INLINE uint32_t USB_ReqSetInterface (void) {
+  USB_COMMON_DESCRIPTOR *pD;
+  uint32_t ifn = 0, alt = 0, old = 0, msk = 0;
+  uint32_t n, m;
+  uint32_t set, new_addr;
+
+  switch (SetupPacket.bmRequestType.BM.Recipient) {
+    case REQUEST_TO_INTERFACE:
+      if (USB_Configuration == 0) return (FALSE);
+      set = FALSE;
+      if ( DevStatusFS2HS == FALSE ) { 
+        pD  = (USB_COMMON_DESCRIPTOR *)USB_FSConfigDescriptor;
+      } else {
+        pD  = (USB_COMMON_DESCRIPTOR *)USB_HSConfigDescriptor;
+      }
+      while (pD->bLength) {
+        switch (pD->bDescriptorType) {
+          case USB_CONFIGURATION_DESCRIPTOR_TYPE:
+            if (((USB_CONFIGURATION_DESCRIPTOR *)pD)->bConfigurationValue != USB_Configuration) {
+              new_addr = (uint32_t)pD + ((USB_CONFIGURATION_DESCRIPTOR *)pD)->wTotalLength;
+              pD = (USB_COMMON_DESCRIPTOR*)new_addr;
+              continue;
+            }
+            break;
+          case USB_INTERFACE_DESCRIPTOR_TYPE:
+            ifn = ((USB_INTERFACE_DESCRIPTOR *)pD)->bInterfaceNumber;
+            alt = ((USB_INTERFACE_DESCRIPTOR *)pD)->bAlternateSetting;
+            msk = 0;
+            if ((ifn == SetupPacket.wIndex.WB.L) && (alt == SetupPacket.wValue.WB.L)) {
+              set = TRUE;
+              old = USB_AltSetting[ifn];
+              USB_AltSetting[ifn] = (uint8_t)alt;
+            }
+            break;
+          case USB_ENDPOINT_DESCRIPTOR_TYPE:
+            if (ifn == SetupPacket.wIndex.WB.L) {
+              n = ((USB_ENDPOINT_DESCRIPTOR *)pD)->bEndpointAddress & 0x8F;
+              m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
+              if (alt == SetupPacket.wValue.WB.L) {
+                USB_EndPointMask |=  m;
+                USB_EndPointHalt &= ~m;
+                USB_ConfigEP((USB_ENDPOINT_DESCRIPTOR *)pD);
+                USB_EnableEP(n);
+                USB_ResetEP(n);
+                msk |= m;
+              }
+              else if ((alt == old) && ((msk & m) == 0)) {
+                USB_EndPointMask &= ~m;
+                USB_EndPointHalt &= ~m;
+                USB_DisableEP(n);
+              }
+            }
+           break;
+        }
+        new_addr = (uint32_t)pD + pD->bLength;
+        pD = (USB_COMMON_DESCRIPTOR*)new_addr;
+      }
+      break;
+    default:
+      return (FALSE);
+  }
+
+  return (set);
+}
+
+
+/*
+ *  USB Endpoint 0 Event Callback
+ *    Parameters:      event
+ *    Return Value:    none
+ */
+void USB_EndPoint0 (uint32_t event) {
+
+  switch (event) {
+    case USB_EVT_SETUP:
+      USB_SetupStage();
+      USB_DirCtrlEP(SetupPacket.bmRequestType.BM.Dir);
+      EP0Data.Count = SetupPacket.wLength;     /* Number of bytes to transfer */
+      switch (SetupPacket.bmRequestType.BM.Type) {
+
+        case REQUEST_STANDARD:
+          switch (SetupPacket.bRequest) {
+            case USB_REQUEST_GET_STATUS:
+              if (!USB_ReqGetStatus()) {
+                goto stall_i;
+              }
+              USB_DataInStage();
+              break;
+
+            case USB_REQUEST_CLEAR_FEATURE:
+              if (!USB_ReqSetClrFeature(0)) {
+                goto stall_i;
+              }
+              USB_StatusInStage();
+#if USB_FEATURE_EVENT
+              USB_Feature_Event();
+#endif
+              break;
+
+            case USB_REQUEST_SET_FEATURE:
+              if (!USB_ReqSetClrFeature(1)) {
+                goto stall_i;
+              }
+              USB_StatusInStage();
+#if USB_FEATURE_EVENT
+              USB_Feature_Event();
+#endif
+              break;
+
+            case USB_REQUEST_SET_ADDRESS:
+              if (!USB_ReqSetAddress()) {
+                goto stall_i;
+              }
+              USB_StatusInStage();
+              break;
+
+            case USB_REQUEST_GET_DESCRIPTOR:
+              if (!USB_ReqGetDescriptor()) {
+                goto stall_i;
+              }
+              USB_DataInStage();
+              break;
+
+            case USB_REQUEST_SET_DESCRIPTOR:
+/*stall_o:*/  USB_SetStallEP(0x00);            /* not supported */
+              EP0Data.Count = 0;
+              break;
+
+            case USB_REQUEST_GET_CONFIGURATION:
+              if (!USB_ReqGetConfiguration()) {
+                goto stall_i;
+              }
+              USB_DataInStage();
+              break;
+
+            case USB_REQUEST_SET_CONFIGURATION:
+              if (!USB_ReqSetConfiguration()) {
+                goto stall_i;
+              }
+              USB_StatusInStage();
+#if USB_CONFIGURE_EVENT
+              USB_Configure_Event();
+#endif
+              break;
+
+            case USB_REQUEST_GET_INTERFACE:
+              if (!USB_ReqGetInterface()) {
+                goto stall_i;
+              }
+              USB_DataInStage();
+              break;
+
+            case USB_REQUEST_SET_INTERFACE:
+              if (!USB_ReqSetInterface()) {
+                goto stall_i;
+              }
+              USB_StatusInStage();
+#if USB_INTERFACE_EVENT
+              USB_Interface_Event();
+#endif
+              break;
+
+            default:
+              goto stall_i;
+          }
+          break;  /* end case REQUEST_STANDARD */
+
+#if USB_CLASS
+        case REQUEST_CLASS:
+          switch (SetupPacket.bmRequestType.BM.Recipient) {
+
+            case REQUEST_TO_DEVICE:
+              goto stall_i;                                              /* not supported */
+
+            case REQUEST_TO_INTERFACE:
+#if USB_HID
+              if (SetupPacket.wIndex.WB.L == USB_HID_IF_NUM) {           /* IF number correct? */
+                switch (SetupPacket.bRequest) {
+                  case HID_REQUEST_GET_REPORT:
+                    if (HID_GetReport()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case HID_REQUEST_SET_REPORT:
+                    EP0Data.pData = EP0Buf;                              /* data to be received */ 
+                    goto setup_class_ok;
+                  case HID_REQUEST_GET_IDLE:
+                    if (HID_GetIdle()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case HID_REQUEST_SET_IDLE:
+                    if (HID_SetIdle()) {
+                      USB_StatusInStage();                               /* send Acknowledge */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case HID_REQUEST_GET_PROTOCOL:
+                    if (HID_GetProtocol()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case HID_REQUEST_SET_PROTOCOL:
+                    if (HID_SetProtocol()) {
+                      USB_StatusInStage();                               /* send Acknowledge */
+                      goto setup_class_ok;
+                    }
+                    break;
+                }
+              }
+#endif  /* USB_HID */
+#if USB_MSC
+              if (SetupPacket.wIndex.WB.L == USB_MSC_IF_NUM) {           /* IF number correct? */
+                switch (SetupPacket.bRequest) {
+                  case MSC_REQUEST_RESET:
+                    if ((SetupPacket.wValue.W == 0) &&                  /* RESET with invalid parameters -> STALL */
+                        (SetupPacket.wLength  == 0)) {
+                      if (MSC_Reset()) {
+                        USB_StatusInStage();
+                        goto setup_class_ok;
+                      }
+                    }
+                    break;
+                  case MSC_REQUEST_GET_MAX_LUN:
+                    if ((SetupPacket.wValue.W == 0) &&                  /* GET_MAX_LUN with invalid parameters -> STALL */
+                        (SetupPacket.wLength  == 1)) { 
+                      if (MSC_GetMaxLUN()) {
+                        EP0Data.pData = EP0Buf;
+                        USB_DataInStage();
+                        goto setup_class_ok;
+                      }
+                    }
+                    break;
+                }
+              }
+#endif  /* USB_MSC */
+#if USB_AUDIO
+              if ((SetupPacket.wIndex.WB.L == USB_ADC_CIF_NUM)  ||       /* IF number correct? */
+                  (SetupPacket.wIndex.WB.L == USB_ADC_SIF1_NUM) ||
+                  (SetupPacket.wIndex.WB.L == USB_ADC_SIF2_NUM)) {
+                switch (SetupPacket.bRequest) {
+                  case AUDIO_REQUEST_GET_CUR:
+                  case AUDIO_REQUEST_GET_MIN:
+                  case AUDIO_REQUEST_GET_MAX:
+                  case AUDIO_REQUEST_GET_RES:
+                    if (ADC_IF_GetRequest()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case AUDIO_REQUEST_SET_CUR:
+//                case AUDIO_REQUEST_SET_MIN:
+//                case AUDIO_REQUEST_SET_MAX:
+//                case AUDIO_REQUEST_SET_RES:
+                    EP0Data.pData = EP0Buf;                              /* data to be received */ 
+                    goto setup_class_ok;
+                }
+              }
+#endif  /* USB_AUDIO */
+#if USB_CDC
+              if ((SetupPacket.wIndex.WB.L == USB_CDC_CIF_NUM)  ||       /* IF number correct? */
+                  (SetupPacket.wIndex.WB.L == USB_CDC_DIF_NUM)) {
+                switch (SetupPacket.bRequest) {
+                  case CDC_SEND_ENCAPSULATED_COMMAND:
+                    EP0Data.pData = EP0Buf;                              /* data to be received, see USB_EVT_OUT */
+                    goto setup_class_ok;
+                  case CDC_GET_ENCAPSULATED_RESPONSE:
+                    if (CDC_GetEncapsulatedResponse()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case CDC_SET_COMM_FEATURE:
+                    EP0Data.pData = EP0Buf;                              /* data to be received, see USB_EVT_OUT */
+                    goto setup_class_ok;
+                  case CDC_GET_COMM_FEATURE:
+                    if (CDC_GetCommFeature(SetupPacket.wValue.W)) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case CDC_CLEAR_COMM_FEATURE:
+                    if (CDC_ClearCommFeature(SetupPacket.wValue.W)) {
+                      USB_StatusInStage();                               /* send Acknowledge */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case CDC_SET_LINE_CODING:
+                    EP0Data.pData = EP0Buf;                              /* data to be received, see USB_EVT_OUT */
+                    goto setup_class_ok;
+                  case CDC_GET_LINE_CODING:
+                    if (CDC_GetLineCoding()) {
+                      EP0Data.pData = EP0Buf;                            /* point to data to be sent */
+                      USB_DataInStage();                                 /* send requested data */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case CDC_SET_CONTROL_LINE_STATE:
+                    if (CDC_SetControlLineState(SetupPacket.wValue.W)) {
+                      USB_StatusInStage();                               /* send Acknowledge */
+                      goto setup_class_ok;
+                    }
+                    break;
+                  case CDC_SEND_BREAK:
+                    if (CDC_SendBreak(SetupPacket.wValue.W)) {
+                      USB_StatusInStage();                               /* send Acknowledge */
+                      goto setup_class_ok;
+                    }
+                    break;
+                }
+              }
+#endif  /* USB_CDC */
+              goto stall_i;                                              /* not supported */
+              /* end case REQUEST_TO_INTERFACE */
+
+            case REQUEST_TO_ENDPOINT:
+#if USB_AUDIO
+              switch (SetupPacket.bRequest) {
+                case AUDIO_REQUEST_GET_CUR:
+                case AUDIO_REQUEST_GET_MIN:
+                case AUDIO_REQUEST_GET_MAX:
+                case AUDIO_REQUEST_GET_RES:
+                  if (ADC_EP_GetRequest()) {
+                    EP0Data.pData = EP0Buf;                              /* point to data to be sent */
+                    USB_DataInStage();                                   /* send requested data */
+                    goto setup_class_ok;
+                  }
+                  break;
+                case AUDIO_REQUEST_SET_CUR:
+//              case AUDIO_REQUEST_SET_MIN:
+//              case AUDIO_REQUEST_SET_MAX:
+//              case AUDIO_REQUEST_SET_RES:
+                  EP0Data.pData = EP0Buf;                                /* data to be received */ 
+                  goto setup_class_ok;
+              }
+#endif  /* USB_AUDIO */
+              goto stall_i;
+              /* end case REQUEST_TO_ENDPOINT */
+
+            default:
+              goto stall_i;
+          }
+setup_class_ok:                                                          /* request finished successfully */
+          break;  /* end case REQUEST_CLASS */
+#endif  /* USB_CLASS */
+
+#if USB_VENDOR
+        case REQUEST_VENDOR:
+          switch (SetupPacket.bmRequestType.BM.Recipient) {
+
+            case REQUEST_TO_DEVICE:
+              if (!USB_ReqVendorDev(TRUE)) {
+                goto stall_i;                                            /* not supported */               
+              }
+              break;
+
+            case REQUEST_TO_INTERFACE:
+              if (!USB_ReqVendorIF(TRUE)) {
+                goto stall_i;                                            /* not supported */               
+              }
+              break;
+
+            case REQUEST_TO_ENDPOINT:
+              if (!USB_ReqVendorEP(TRUE)) {
+                goto stall_i;                                            /* not supported */               
+              }
+              break;
+
+            default:
+              goto stall_i;
+          }
+
+          if (SetupPacket.wLength) {
+            if (SetupPacket.bmRequestType.BM.Dir == REQUEST_DEVICE_TO_HOST) {
+              USB_DataInStage();
+            }
+          } else {
+            USB_StatusInStage();
+          }
+
+          break;  /* end case REQUEST_VENDOR */ 
+#endif  /* USB_VENDOR */
+
+        default:
+stall_i:  USB_SetStallEP(0x80);
+          EP0Data.Count = 0;
+          break;
+      }
+      break;  /* end case USB_EVT_SETUP */
+
+    case USB_EVT_OUT_NAK:
+      if (SetupPacket.bmRequestType.BM.Dir == 0)
+      {
+        USB_ReadReqEP(0x00, EP0Data.pData, EP0Data.Count);
+      }
+      else
+      {
+        /* might be zero length pkt */
+        USB_ReadReqEP(0x00, EP0Data.pData, 0);
+      }
+      break;
+    case USB_EVT_OUT:
+      if (SetupPacket.bmRequestType.BM.Dir == REQUEST_HOST_TO_DEVICE) {
+        if (EP0Data.Count) {                                             /* still data to receive ? */
+          USB_DataOutStage();                                            /* receive data */
+          if (EP0Data.Count == 0) {                                      /* data complete ? */
+            switch (SetupPacket.bmRequestType.BM.Type) {
+
+              case REQUEST_STANDARD:
+                goto stall_i;                                            /* not supported */
+
+#if (USB_CLASS) 
+              case REQUEST_CLASS:
+                switch (SetupPacket.bmRequestType.BM.Recipient) {
+                  case REQUEST_TO_DEVICE:
+                    goto stall_i;                                        /* not supported */
+
+                  case REQUEST_TO_INTERFACE:
+#if USB_HID
+                    if (SetupPacket.wIndex.WB.L == USB_HID_IF_NUM) {     /* IF number correct? */
+                      switch (SetupPacket.bRequest) {
+                        case HID_REQUEST_SET_REPORT:
+                          if (HID_SetReport()) {
+                            USB_StatusInStage();                         /* send Acknowledge */
+                            goto out_class_ok;
+                          }
+                          break;
+                      }
+                    }
+#endif  /* USB_HID */  
+#if USB_AUDIO
+                    if ((SetupPacket.wIndex.WB.L == USB_ADC_CIF_NUM)  || /* IF number correct? */
+                        (SetupPacket.wIndex.WB.L == USB_ADC_SIF1_NUM) ||
+                        (SetupPacket.wIndex.WB.L == USB_ADC_SIF2_NUM)) {
+                      switch (SetupPacket.bRequest) {
+                        case AUDIO_REQUEST_SET_CUR:
+//                      case AUDIO_REQUEST_SET_MIN:
+//                      case AUDIO_REQUEST_SET_MAX:
+//                      case AUDIO_REQUEST_SET_RES:
+                          if (ADC_IF_SetRequest()) {
+                            USB_StatusInStage();                         /* send Acknowledge */
+                            goto out_class_ok;
+                          }
+                          break;
+                      }
+                    }
+#endif  /* USB_AUDIO */
+#if USB_CDC
+                    if ((SetupPacket.wIndex.WB.L == USB_CDC_CIF_NUM)  || /* IF number correct? */
+                        (SetupPacket.wIndex.WB.L == USB_CDC_DIF_NUM)) {
+                      switch (SetupPacket.bRequest) {
+                        case CDC_SEND_ENCAPSULATED_COMMAND:
+                          if (CDC_SendEncapsulatedCommand()) {
+                            USB_StatusInStage();                         /* send Acknowledge */
+                            goto out_class_ok;
+                          }
+                          break;
+                        case CDC_SET_COMM_FEATURE:
+                          if (CDC_SetCommFeature(SetupPacket.wValue.W)) {
+                            USB_StatusInStage();                         /* send Acknowledge */
+                            goto out_class_ok;
+                          }
+                          break;
+                        case CDC_SET_LINE_CODING:
+                          if (CDC_SetLineCoding()) {
+                            USB_StatusInStage();                         /* send Acknowledge */
+                            goto out_class_ok;
+                          }
+                          break;
+                      }
+                    } 
+#endif  /* USB_CDC */
+                    goto stall_i;
+                    /* end case REQUEST_TO_INTERFACE */
+
+                  case REQUEST_TO_ENDPOINT:
+#if USB_AUDIO
+                    switch (SetupPacket.bRequest) {
+                      case AUDIO_REQUEST_SET_CUR:
+//                    case AUDIO_REQUEST_SET_MIN:
+//                    case AUDIO_REQUEST_SET_MAX:
+//                    case AUDIO_REQUEST_SET_RES:
+                        if (ADC_EP_SetRequest()) {
+                          USB_StatusInStage();                           /* send Acknowledge */
+                          goto out_class_ok;
+                        }
+                        break;
+                    }
+#endif  /* USB_AUDIO */
+                    goto stall_i;
+                    /* end case REQUEST_TO_ENDPOINT */
+
+                  default:
+                    goto stall_i;
+                }
+out_class_ok:                                                            /* request finished successfully */
+                break; /* end case REQUEST_CLASS */
+#endif  /* USB_CLASS */
+
+#if USB_VENDOR
+              case REQUEST_VENDOR:
+                switch (SetupPacket.bmRequestType.BM.Recipient) {
+      
+                  case REQUEST_TO_DEVICE:
+                    if (!USB_ReqVendorDev(FALSE)) {
+                      goto stall_i;                                      /* not supported */               
+                    }
+                    break;
+      
+                  case REQUEST_TO_INTERFACE:
+                    if (!USB_ReqVendorIF(FALSE)) {
+                      goto stall_i;                                      /* not supported */               
+                    }
+                    break;
+      
+                  case REQUEST_TO_ENDPOINT:
+                    if (!USB_ReqVendorEP(FALSE)) {
+                      goto stall_i;                                      /* not supported */               
+                    }
+                    break;
+      
+                  default:
+                    goto stall_i;
+                }
+      
+                USB_StatusInStage();
+      
+                break;  /* end case REQUEST_VENDOR */ 
+#endif  /* USB_VENDOR */
+
+              default:
+                goto stall_i;
+            }
+          }
+        }
+      } else {
+        USB_StatusOutStage();                                            /* receive Acknowledge */
+      }
+      break;  /* end case USB_EVT_OUT */
+
+    case USB_EVT_IN :
+      if (SetupPacket.bmRequestType.BM.Dir == REQUEST_DEVICE_TO_HOST) {
+        USB_DataInStage();                                               /* send data */
+      } else {
+        if (USB_DeviceAddress & 0x80) {
+          USB_DeviceAddress &= 0x7F;
+          USB_SetAddress(USB_DeviceAddress);
+        }
+      }
+      break;  /* end case USB_EVT_IN */
+
+    case USB_EVT_OUT_STALL:
+      USB_ClrStallEP(0x00);
+      break;
+
+    case USB_EVT_IN_STALL:
+      USB_ClrStallEP(0x80);
+      break;
+
+  }
+}
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbdesc.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbdesc.c
new file mode 100644 (file)
index 0000000..270b838
--- /dev/null
@@ -0,0 +1,479 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbdesc.c
+ * Purpose: USB Descriptors
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC microcontroller devices only. Nothing else 
+ *      gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *----------------------------------------------------------------------------
+ * History:
+ *          V1.20 Changed string descriptor handling
+ *          V1.00 Initial Version
+ *----------------------------------------------------------------------------*/
+#include "lpc18xx.H"
+#include "lpc_types.h"
+
+#include "usb.h"
+#include "cdc.h"
+#include "usbcfg.h"
+#include "usbdesc.h"
+
+
+/* USB Standard Device Descriptor */
+const uint8_t USB_DeviceDescriptor[] = {
+  USB_DEVICE_DESC_SIZE,              /* bLength */
+  USB_DEVICE_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  WBVAL(0x0200), /* 2.0 */           /* bcdUSB */
+  USB_DEVICE_CLASS_COMMUNICATIONS,   /* bDeviceClass CDC*/
+  0x00,                              /* bDeviceSubClass */
+  0x00,                              /* bDeviceProtocol */
+  USB_MAX_PACKET0,                   /* bMaxPacketSize0 */
+  WBVAL(0x1FC9),                     /* idVendor */
+  WBVAL(0x2002),                     /* idProduct */
+  WBVAL(0x0100), /* 1.00 */          /* bcdDevice */
+  0x01,                              /* iManufacturer */
+  0x02,                              /* iProduct */
+  0x03,                              /* iSerialNumber */
+  0x01                               /* bNumConfigurations: one possible configuration*/
+};
+
+/* USB FSConfiguration Descriptor */
+/*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
+const uint8_t USB_FSConfigDescriptor[] = {
+/* Configuration 1 */
+  USB_CONFIGUARTION_DESC_SIZE,       /* bLength */
+  USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
+  WBVAL((                             /* wTotalLength */
+    1*USB_CONFIGUARTION_DESC_SIZE +
+    1*USB_INTERFACE_DESC_SIZE     +  /* communication interface */
+    0x0013                        +  /* CDC functions */
+    1*USB_ENDPOINT_DESC_SIZE      +  /* interrupt endpoint */
+    1*USB_INTERFACE_DESC_SIZE     +  /* data interface */
+    2*USB_ENDPOINT_DESC_SIZE         /* bulk endpoints */
+      )),
+  0x02,                              /* bNumInterfaces */
+  0x01,                              /* bConfigurationValue: 0x01 is used to select this configuration */
+  0x00,                              /* iConfiguration: no string to describe this configuration */
+  USB_CONFIG_BUS_POWERED /*|*/       /* bmAttributes */
+/*USB_CONFIG_REMOTE_WAKEUP*/,
+  USB_CONFIG_POWER_MA(100),          /* bMaxPower, device power consumption is 100 mA */
+/* Interface 0, Alternate Setting 0, Communication class interface descriptor */
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_CIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: Alternate setting */
+  0x01,                              /* bNumEndpoints: One endpoint used */
+  CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */
+  CDC_ABSTRACT_CONTROL_MODEL,        /* bInterfaceSubClass: Abstract Control Model */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/*Header Functional Descriptor*/
+  0x05,                              /* bLength: Endpoint Descriptor size */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_HEADER,                        /* bDescriptorSubtype: Header Func Desc */
+  WBVAL(CDC_V1_10), /* 1.10 */       /* bcdCDC */
+/*Call Management Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_CALL_MANAGEMENT,               /* bDescriptorSubtype: Call Management Func Desc */
+  0x01,                              /* bmCapabilities: device handles call management */
+  0x01,                              /* bDataInterface: CDC data IF ID */
+/*Abstract Control Management Functional Descriptor*/
+  0x04,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_ABSTRACT_CONTROL_MANAGEMENT,   /* bDescriptorSubtype: Abstract Control Management desc */
+  0x02,                              /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
+/*Union Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_UNION,                         /* bDescriptorSubtype: Union func desc */
+  USB_CDC_CIF_NUM,                   /* bMasterInterface: Communication class interface is master */
+  USB_CDC_DIF_NUM,                   /* bSlaveInterface0: Data class interface is slave 0 */
+/*Endpoint 1 Descriptor*/            /* event notification (optional) */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(1),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
+  WBVAL(0x0010),                     /* wMaxPacketSize */
+  0x02,          /* 2ms */           /* bInterval */
+/* Interface 1, Alternate Setting 0, Data class interface descriptor*/
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_DIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: no alternate setting */
+  0x02,                              /* bNumEndpoints: two endpoints used */
+  CDC_DATA_INTERFACE_CLASS,          /* bInterfaceClass: Data Interface Class */
+  0x00,                              /* bInterfaceSubClass: no subclass available */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/* Endpoint, EP2 Bulk Out */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_OUT(2),               /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Endpoint, EP2 Bulk In */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(2),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Terminator */
+  0                                  /* bLength */
+                           /* bLength */
+};
+
+/* USB HSConfiguration Descriptor */
+/*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
+const uint8_t USB_HSConfigDescriptor[] = {
+/* Configuration 1 */
+  USB_CONFIGUARTION_DESC_SIZE,       /* bLength */
+  USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
+  WBVAL((                             /* wTotalLength */
+    1*USB_CONFIGUARTION_DESC_SIZE +
+    1*USB_INTERFACE_DESC_SIZE     +  /* communication interface */
+    0x0013                        +  /* CDC functions */
+    1*USB_ENDPOINT_DESC_SIZE      +  /* interrupt endpoint */
+    1*USB_INTERFACE_DESC_SIZE     +  /* data interface */
+    2*USB_ENDPOINT_DESC_SIZE         /* bulk endpoints */
+      )),
+  0x02,                              /* bNumInterfaces */
+  0x01,                              /* bConfigurationValue: 0x01 is used to select this configuration */
+  0x00,                              /* iConfiguration: no string to describe this configuration */
+  USB_CONFIG_BUS_POWERED /*|*/       /* bmAttributes */
+/*USB_CONFIG_REMOTE_WAKEUP*/,
+  USB_CONFIG_POWER_MA(100),          /* bMaxPower, device power consumption is 100 mA */
+/* Interface 0, Alternate Setting 0, Communication class interface descriptor */
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_CIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: Alternate setting */
+  0x01,                              /* bNumEndpoints: One endpoint used */
+  CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */
+  CDC_ABSTRACT_CONTROL_MODEL,        /* bInterfaceSubClass: Abstract Control Model */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/*Header Functional Descriptor*/
+  0x05,                              /* bLength: Endpoint Descriptor size */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_HEADER,                        /* bDescriptorSubtype: Header Func Desc */
+  WBVAL(CDC_V1_10), /* 1.10 */       /* bcdCDC */
+/*Call Management Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_CALL_MANAGEMENT,               /* bDescriptorSubtype: Call Management Func Desc */
+  0x01,                              /* bmCapabilities: device handles call management */
+  0x01,                              /* bDataInterface: CDC data IF ID */
+/*Abstract Control Management Functional Descriptor*/
+  0x04,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_ABSTRACT_CONTROL_MANAGEMENT,   /* bDescriptorSubtype: Abstract Control Management desc */
+  0x02,                              /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
+/*Union Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_UNION,                         /* bDescriptorSubtype: Union func desc */
+  USB_CDC_CIF_NUM,                   /* bMasterInterface: Communication class interface is master */
+  USB_CDC_DIF_NUM,                   /* bSlaveInterface0: Data class interface is slave 0 */
+/*Endpoint 1 Descriptor*/            /* event notification (optional) */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(1),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
+  WBVAL(0x0010),                     /* wMaxPacketSize */
+  0x02,          /* 2ms */           /* bInterval */
+/* Interface 1, Alternate Setting 0, Data class interface descriptor*/
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_DIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: no alternate setting */
+  0x02,                              /* bNumEndpoints: two endpoints used */
+  CDC_DATA_INTERFACE_CLASS,          /* bInterfaceClass: Data Interface Class */
+  0x00,                              /* bInterfaceSubClass: no subclass available */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/* Endpoint, EP2 Bulk Out */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_OUT(2),               /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Endpoint, EP2 Bulk In */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(2),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Terminator */
+  0                                  /* bLength */
+                              /* bLength */
+};
+
+/* USB String Descriptor (optional) */
+const uint8_t USB_StringDescriptor[] = {
+/* Index 0x00: LANGID Codes */
+  0x04,                              /* bLength */
+  USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  WBVAL(0x0409), /* US English */    /* wLANGID */
+/* Index 0x01: Manufacturer */
+  (16*2 + 2),                        /* bLength (13 Char + Type + lenght) */
+  USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  'N',0,
+  'G',0,
+  'X',0,
+  ' ',0,
+  'T',0,
+  'E',0,
+  'C',0,
+  'H',0,
+  'N',0,
+  'O',0,
+  'L',0,
+  'O',0,
+  'G',0,\r
+       'I',0,\r
+       'E',0,\r
+       'S',0,
+/* Index 0x02: Product */
+  (17*2 + 2),                        /* bLength ( 17 Char + Type + lenght) */
+  USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  'N',0,
+  'G',0,
+  'X',0,
+  ' ',0,
+  'L',0,
+  'P',0,
+  'C',0,
+  '1',0,
+  '8',0,
+  'x',0,
+  'x',0,
+  ' ',0,
+  'V',0,
+  'C',0,
+  'O',0,
+  'M',0,
+  ' ',0,
+/* Index 0x03: Serial Number */
+  (12*2 + 2),                        /* bLength (12 Char + Type + lenght) */
+  USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  'D',0,
+  'E',0,
+  'M',0,
+  'O',0,
+  '0',0,
+  '0',0,
+  '0',0,
+  '0',0,
+  '0',0,
+  '0',0,
+  '0',0,
+  '0',0,
+/* Index 0x04: Interface 0, Alternate Setting 0 */
+  ( 4*2 + 2),                        /* bLength (4 Char + Type + lenght) */
+  USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  'V',0,
+  'C',0,
+  'O',0,
+  'M',0,
+};
+
+/* USB Device Qualifier */
+const uint8_t USB_DeviceQualifier[] = {
+  USB_DEVICE_QUALI_SIZE,               /* bLength */
+  USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE,        /* bDescriptorType */
+  WBVAL(0x0200), /* 2.00 */          /* bcdUSB */
+  0x00,                              /* bDeviceClass */
+  0x00,                              /* bDeviceSubClass */
+  0x00,                              /* bDeviceProtocol */
+  USB_MAX_PACKET0,                   /* bMaxPacketSize0 */
+  0x01,                              /* bNumOtherSpeedConfigurations */
+  0x00                               /* bReserved */
+};
+
+/* USB Configuration Descriptor */
+/*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
+const uint8_t USB_FSOtherSpeedConfiguration[] = {
+/* Configuration 1 */
+  USB_CONFIGUARTION_DESC_SIZE,       /* bLength */
+  USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
+  WBVAL((                             /* wTotalLength */
+    1*USB_CONFIGUARTION_DESC_SIZE +
+    1*USB_INTERFACE_DESC_SIZE     +  /* communication interface */
+    0x0013                        +  /* CDC functions */
+    1*USB_ENDPOINT_DESC_SIZE      +  /* interrupt endpoint */
+    1*USB_INTERFACE_DESC_SIZE     +  /* data interface */
+    2*USB_ENDPOINT_DESC_SIZE         /* bulk endpoints */
+      )),
+  0x02,                              /* bNumInterfaces */
+  0x01,                              /* bConfigurationValue: 0x01 is used to select this configuration */
+  0x00,                              /* iConfiguration: no string to describe this configuration */
+  USB_CONFIG_BUS_POWERED /*|*/       /* bmAttributes */
+/*USB_CONFIG_REMOTE_WAKEUP*/,
+  USB_CONFIG_POWER_MA(100),          /* bMaxPower, device power consumption is 100 mA */
+/* Interface 0, Alternate Setting 0, Communication class interface descriptor */
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_CIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: Alternate setting */
+  0x01,                              /* bNumEndpoints: One endpoint used */
+  CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */
+  CDC_ABSTRACT_CONTROL_MODEL,        /* bInterfaceSubClass: Abstract Control Model */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/*Header Functional Descriptor*/
+  0x05,                              /* bLength: Endpoint Descriptor size */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_HEADER,                        /* bDescriptorSubtype: Header Func Desc */
+  WBVAL(CDC_V1_10), /* 1.10 */       /* bcdCDC */
+/*Call Management Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_CALL_MANAGEMENT,               /* bDescriptorSubtype: Call Management Func Desc */
+  0x01,                              /* bmCapabilities: device handles call management */
+  0x01,                              /* bDataInterface: CDC data IF ID */
+/*Abstract Control Management Functional Descriptor*/
+  0x04,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_ABSTRACT_CONTROL_MANAGEMENT,   /* bDescriptorSubtype: Abstract Control Management desc */
+  0x02,                              /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
+/*Union Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_UNION,                         /* bDescriptorSubtype: Union func desc */
+  USB_CDC_CIF_NUM,                   /* bMasterInterface: Communication class interface is master */
+  USB_CDC_DIF_NUM,                   /* bSlaveInterface0: Data class interface is slave 0 */
+/*Endpoint 1 Descriptor*/            /* event notification (optional) */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(1),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
+  WBVAL(0x0010),                     /* wMaxPacketSize */
+  0x02,          /* 2ms */           /* bInterval */
+/* Interface 1, Alternate Setting 0, Data class interface descriptor*/
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_DIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: no alternate setting */
+  0x02,                              /* bNumEndpoints: two endpoints used */
+  CDC_DATA_INTERFACE_CLASS,          /* bInterfaceClass: Data Interface Class */
+  0x00,                              /* bInterfaceSubClass: no subclass available */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/* Endpoint, EP2 Bulk Out */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_OUT(2),               /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Endpoint, EP2 Bulk In */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(2),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Terminator */
+  0                                  /* bLength */
+};
+
+/* USB Configuration Descriptor */
+/*   All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
+const uint8_t USB_HSOtherSpeedConfiguration[] = {
+/* Configuration 1 */
+  USB_CONFIGUARTION_DESC_SIZE,       /* bLength */
+  USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
+  WBVAL((                             /* wTotalLength */
+    1*USB_CONFIGUARTION_DESC_SIZE +
+    1*USB_INTERFACE_DESC_SIZE     +  /* communication interface */
+    0x0013                        +  /* CDC functions */
+    1*USB_ENDPOINT_DESC_SIZE      +  /* interrupt endpoint */
+    1*USB_INTERFACE_DESC_SIZE     +  /* data interface */
+    2*USB_ENDPOINT_DESC_SIZE         /* bulk endpoints */
+      )),
+  0x02,                              /* bNumInterfaces */
+  0x01,                              /* bConfigurationValue: 0x01 is used to select this configuration */
+  0x00,                              /* iConfiguration: no string to describe this configuration */
+  USB_CONFIG_BUS_POWERED /*|*/       /* bmAttributes */
+/*USB_CONFIG_REMOTE_WAKEUP*/,
+  USB_CONFIG_POWER_MA(100),          /* bMaxPower, device power consumption is 100 mA */
+/* Interface 0, Alternate Setting 0, Communication class interface descriptor */
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_CIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: Alternate setting */
+  0x01,                              /* bNumEndpoints: One endpoint used */
+  CDC_COMMUNICATION_INTERFACE_CLASS, /* bInterfaceClass: Communication Interface Class */
+  CDC_ABSTRACT_CONTROL_MODEL,        /* bInterfaceSubClass: Abstract Control Model */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/*Header Functional Descriptor*/
+  0x05,                              /* bLength: Endpoint Descriptor size */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_HEADER,                        /* bDescriptorSubtype: Header Func Desc */
+  WBVAL(CDC_V1_10), /* 1.10 */       /* bcdCDC */
+/*Call Management Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_CALL_MANAGEMENT,               /* bDescriptorSubtype: Call Management Func Desc */
+  0x01,                              /* bmCapabilities: device handles call management */
+  0x01,                              /* bDataInterface: CDC data IF ID */
+/*Abstract Control Management Functional Descriptor*/
+  0x04,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_ABSTRACT_CONTROL_MANAGEMENT,   /* bDescriptorSubtype: Abstract Control Management desc */
+  0x02,                              /* bmCapabilities: SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported */
+/*Union Functional Descriptor*/
+  0x05,                              /* bFunctionLength */
+  CDC_CS_INTERFACE,                  /* bDescriptorType: CS_INTERFACE */
+  CDC_UNION,                         /* bDescriptorSubtype: Union func desc */
+  USB_CDC_CIF_NUM,                   /* bMasterInterface: Communication class interface is master */
+  USB_CDC_DIF_NUM,                   /* bSlaveInterface0: Data class interface is slave 0 */
+/*Endpoint 1 Descriptor*/            /* event notification (optional) */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(1),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_INTERRUPT,       /* bmAttributes */
+  WBVAL(0x0010),                     /* wMaxPacketSize */
+  0x02,          /* 2ms */           /* bInterval */
+/* Interface 1, Alternate Setting 0, Data class interface descriptor*/
+  USB_INTERFACE_DESC_SIZE,           /* bLength */
+  USB_INTERFACE_DESCRIPTOR_TYPE,     /* bDescriptorType */
+  USB_CDC_DIF_NUM,                   /* bInterfaceNumber: Number of Interface */
+  0x00,                              /* bAlternateSetting: no alternate setting */
+  0x02,                              /* bNumEndpoints: two endpoints used */
+  CDC_DATA_INTERFACE_CLASS,          /* bInterfaceClass: Data Interface Class */
+  0x00,                              /* bInterfaceSubClass: no subclass available */
+  0x00,                              /* bInterfaceProtocol: no protocol used */
+  0x5E,                              /* iInterface: */
+/* Endpoint, EP2 Bulk Out */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_OUT(2),               /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Endpoint, EP2 Bulk In */
+  USB_ENDPOINT_DESC_SIZE,            /* bLength */
+  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType */
+  USB_ENDPOINT_IN(2),                /* bEndpointAddress */
+  USB_ENDPOINT_TYPE_BULK,            /* bmAttributes */
+  WBVAL(USB_CDC_BUFSIZE),            /* wMaxPacketSize */
+  0x00,                              /* bInterval: ignore for Bulk transfer */
+/* Terminator */
+  0                                  /* bLength */
+};
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbhw.c
new file mode 100644 (file)
index 0000000..a49596f
--- /dev/null
@@ -0,0 +1,803 @@
+/**********************************************************************
+* $Id$         usbhw.c                                 2011-06-02
+*//**
+* @file                usbhw.c
+* @brief        USB Hardware Layer Module for NXP's lpc43xx MCU
+* @version     1.0
+* @date                02. June. 2011
+* @author      NXP MCU SW Application Team
+*
+* Copyright(C) 2011, NXP Semiconductor
+* All rights reserved.
+*
+***********************************************************************
+* Software that is described herein is for illustrative purposes only
+* which provides customers with programming information regarding the
+* products. This software is supplied "AS IS" without any warranties.
+* NXP Semiconductors assumes no responsibility or liability for the
+* use of the software, conveys no license or title under any patent,
+* copyright, or mask work right to the product. NXP Semiconductors
+* reserves the right to make changes in the software without
+* notification. NXP Semiconductors also make no representation or
+* warranty that such application will be suitable for the specified
+* use without further testing or modification.
+**********************************************************************/
+#include <string.h>
+#include "lpc18xx.H"                        /* lpc43xx definitions */
+#include "lpc_types.h"
+#include "usb.h"
+#include "usbhw.h"
+#include "usbcfg.h"
+#include "usbcore.h"
+#include "lpc18xx_scu.h"
+#include "lpc18xx_cgu.h"
+#include "FreeRTOS.h"
+#ifdef __CC_ARM
+#pragma diag_suppress 1441
+#endif
+
+#ifdef __ICCARM__
+#pragma data_alignment=2048
+DQH_T ep_QH[EP_NUM_MAX];
+#pragma data_alignment=32
+DTD_T ep_TD[EP_NUM_MAX];
+#pragma data_alignment=4
+#elif defined   (  __GNUC__  )
+#define __align(x) __attribute__((aligned(x)))
+DQH_T ep_QH[EP_NUM_MAX] __attribute__((aligned(2048)));
+DTD_T ep_TD[EP_NUM_MAX] __attribute__((aligned(32)));
+#else
+DQH_T __align(2048) ep_QH[EP_NUM_MAX];
+DTD_T __align(32) ep_TD[EP_NUM_MAX];
+#endif
+
+
+static uint32_t ep_read_len[4];
+volatile uint32_t DevStatusFS2HS = FALSE;
+LPC_USBDRV_INIT_T g_drv;
+
+/*
+ *  Get Endpoint Physical Address
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    Endpoint Physical Address
+ */
+
+uint32_t EPAdr (uint32_t EPNum) {
+  uint32_t val;
+
+  val = (EPNum & 0x0F) << 1;
+  if (EPNum & 0x80) {
+    val += 1;
+  }
+  return (val);
+}
+
+/*
+ *  USB Initialize Function
+ *   Called by the User to initialize USB
+ *    Return Value:    None
+ */
+
+void USB_Init (LPC_USBDRV_INIT_T* cbs)
+{
+  memcpy(&g_drv, cbs, sizeof(LPC_USBDRV_INIT_T));
+  /*maxp for EP0 should be atleast 8 */
+  if( g_drv.ep0_maxp == 0)
+    g_drv.ep0_maxp = 64;
+
+#ifdef USE_USB0
+       scu_pinmux(0x8,1,MD_PLN_FAST,FUNC1);    //  0: motocon pcap0_1          1: usb0 usb0_ind1           2:  nc                      3: gpio4 gpio4_1
+       scu_pinmux(0x8,2,MD_PLN_FAST,FUNC1);    //  0: motocon pcap0_0          1: usb0 usb0_ind0           2:  nc                      3: gpio4 gpio4_2
+#endif
+#ifdef USE_USB0
+       CGU_SetPLL0();
+       CGU_EnableEntity(CGU_CLKSRC_PLL0, ENABLE);
+       CGU_EntityConnect(CGU_CLKSRC_PLL0, CGU_BASE_USB0);
+#else
+       CGU_SetPLL1(5);
+       CGU_EnableEntity(CGU_CLKSRC_PLL1, ENABLE);
+       CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_USB1);\r
+       /* enable USB phy */
+    LPC_CREG->CREG0 &= ~(1 << 5);
+    /* enable USB1_DP and USB1_DN on chip FS phy */
+    LPC_SCU->SFSUSB = 0x12;
+    /* enable USB1_VBUS */
+    scu_pinmux(0x2, 5, MD_PLN | MD_EZI | MD_ZI, FUNC2);
+
+#endif
+       /* Turn on the phy */
+#ifdef USE_USB0
+       LPC_CREG->CREG0 &= ~(1<<5);
+#endif
+       /* reset the controller */
+       LPC_USB->USBCMD_D = USBCMD_RST;
+       /* wait for reset to complete */
+       while (LPC_USB->USBCMD_D & USBCMD_RST);
+
+       /* Program the controller to be the USB device controller */
+       LPC_USB->USBMODE_D =   USBMODE_CM_DEV
+                         | USBMODE_SDIS
+                         | USBMODE_SLOM ;
+
+       /* set OTG transcever in proper state, device is present
+       on the port(CCS=1), port enable/disable status change(PES=1). */
+#ifdef USE_USB0        
+       LPC_USB->OTGSC = (1<<3) | (1<<0) /*| (1<<16)| (1<<24)| (1<<25)| (1<<26)| (1<<27)| (1<<28)| (1<<29)| (1<<30)*/;
+#else
+       /* force full speed */
+       LPC_USB->PORTSC1_D |= (1<<24);
+#endif
+
+#ifdef USE_USB0
+       NVIC_EnableIRQ(USB0_IRQn); //  enable USB0 interrrupts
+       NVIC_SetPriority(USB0_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY );
+#else
+       NVIC_EnableIRQ(USB1_IRQn); //  enable USB1 interrrupts
+       NVIC_SetPriority(USB0_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY );
+#endif
+
+       USB_Reset();
+       USB_SetAddress(0);
+       return;
+}
+
+/*
+ *  USB Connect Function
+ *   Called by the User to Connect/Disconnect USB
+ *    Parameters:      con:   Connect/Disconnect
+ *    Return Value:    None
+ */
+void USB_Connect (uint32_t con) {
+  if (con)
+    LPC_USB->USBCMD_D |= USBCMD_RS;
+  else
+    LPC_USB->USBCMD_D &= ~USBCMD_RS;
+}
+
+
+/*
+ *  USB Reset Function
+ *   Called automatically on USB Reset
+ *    Return Value:    None
+ */
+
+void USB_Reset (void)
+{
+  uint32_t i;
+
+  DevStatusFS2HS = FALSE;
+  /* disable all EPs */
+  LPC_USB->ENDPTCTRL0 &= ~(EPCTRL_RXE | EPCTRL_TXE);
+  LPC_USB->ENDPTCTRL2 &= ~(EPCTRL_RXE | EPCTRL_TXE);
+  LPC_USB->ENDPTCTRL3 &= ~(EPCTRL_RXE | EPCTRL_TXE);
+
+  /* Clear all pending interrupts */
+  LPC_USB->ENDPTNAK   = 0xFFFFFFFF;
+  LPC_USB->ENDPTNAKEN = 0;
+  LPC_USB->USBSTS_D     = 0xFFFFFFFF;
+  LPC_USB->ENDPTSETUPSTAT = LPC_USB->ENDPTSETUPSTAT;
+  LPC_USB->ENDPTCOMPLETE  = LPC_USB->ENDPTCOMPLETE;
+  while (LPC_USB->ENDPTPRIME)                  /* Wait until all bits are 0 */
+  {
+  }
+  LPC_USB->ENDPTFLUSH = 0xFFFFFFFF;
+  while (LPC_USB->ENDPTFLUSH); /* Wait until all bits are 0 */
+
+
+  /* Set the interrupt Threshold control interval to 0 */
+  LPC_USB->USBCMD_D &= ~0x00FF0000;
+
+  /* Zero out the Endpoint queue heads */
+  memset((void*)ep_QH, 0, EP_NUM_MAX * sizeof(DQH_T));
+  /* Zero out the device transfer descriptors */
+  memset((void*)ep_TD, 0, EP_NUM_MAX * sizeof(DTD_T));
+  memset((void*)ep_read_len, 0, sizeof(ep_read_len));
+  /* Configure the Endpoint List Address */
+  /* make sure it in on 64 byte boundary !!! */
+  /* init list address */
+  LPC_USB->ENDPOINTLISTADDR = (uint32_t)ep_QH;
+  /* Initialize device queue heads for non ISO endpoint only */
+  for (i = 0; i < EP_NUM_MAX; i++)
+  {
+    ep_QH[i].next_dTD = (uint32_t)&ep_TD[i];
+  }
+  /* Enable interrupts */
+  LPC_USB->USBINTR_D =  USBSTS_UI
+                     | USBSTS_UEI
+                     | USBSTS_PCI
+                     | USBSTS_URI
+                     | USBSTS_SLI
+                     | USBSTS_NAKI;
+//  LPC_USB->usbintr |= (0x1<<7);              /* Test SOF */
+  /* enable ep0 IN and ep0 OUT */
+  ep_QH[0].cap  = QH_MAXP(g_drv.ep0_maxp)
+                  | QH_IOS
+                  | QH_ZLT;
+  ep_QH[1].cap  = QH_MAXP(g_drv.ep0_maxp)
+                  | QH_IOS
+                  | QH_ZLT;
+  /* enable EP0 */
+  LPC_USB->ENDPTCTRL0 = EPCTRL_RXE | EPCTRL_RXR | EPCTRL_TXE | EPCTRL_TXR;
+  return;
+
+}
+
+
+/*
+ *  USB Suspend Function
+ *   Called automatically on USB Suspend
+ *    Return Value:    None
+ */
+
+void USB_Suspend (void) {
+  /* Performed by Hardware */
+}
+
+
+/*
+ *  USB Resume Function
+ *   Called automatically on USB Resume
+ *    Return Value:    None
+ */
+
+void USB_Resume (void) {
+  /* Performed by Hardware */
+}
+
+
+/*
+ *  USB Remote Wakeup Function
+ *   Called automatically on USB Remote Wakeup
+ *    Return Value:    None
+ */
+
+void USB_WakeUp (void) {
+
+  //if (USB_DeviceStatus & USB_GETSTATUS_REMOTE_WAKEUP)
+  {
+    /* Set FPR bit in PORTSCX reg p63 */
+    LPC_USB->PORTSC1_D |= USBPRTS_FPR ;
+  }
+}
+
+
+/*
+ *  USB Remote Wakeup Configuration Function
+ *    Parameters:      cfg:   Enable/Disable
+ *    Return Value:    None
+ */
+
+void USB_WakeUpCfg (uint32_t cfg) {
+  ( void ) cfg;
+  /* Not needed */
+}
+
+
+/*
+ *  USB Set Address Function
+ *    Parameters:      adr:   USB Address
+ *    Return Value:    None
+ */
+
+void USB_SetAddress (uint32_t adr) {
+  LPC_USB->DEVICEADDR = USBDEV_ADDR(adr);
+  LPC_USB->DEVICEADDR |= USBDEV_ADDR_AD;
+}
+
+/*
+*  USB set test mode Function
+*    Parameters:      mode:   test mode
+*    Return Value:    TRUE if supported else FALSE
+*/
+
+uint32_t USB_SetTestMode(uint8_t mode)
+{
+  uint32_t portsc;
+
+  if ((mode > 0) && (mode < 8))
+  {
+    portsc = LPC_USB->PORTSC1_D & ~(0xF << 16);
+
+    LPC_USB->PORTSC1_D = portsc | (mode << 16);
+    return TRUE;
+  }
+  return (FALSE);
+}
+
+/*
+ *  USB Configure Function
+ *    Parameters:      cfg:   Configure/Deconfigure
+ *    Return Value:    None
+ */
+
+void USB_Configure (uint32_t cfg) {
+       ( void ) cfg;
+}
+
+
+/*
+ *  Configure USB Endpoint according to Descriptor
+ *    Parameters:      pEPD:  Pointer to Endpoint Descriptor
+ *    Return Value:    None
+ */
+
+void USB_ConfigEP (USB_ENDPOINT_DESCRIPTOR *pEPD) {
+  uint32_t num, lep;
+  uint32_t ep_cfg;
+  uint8_t  bmAttributes;
+
+  lep = pEPD->bEndpointAddress & 0x7F;
+  num = EPAdr(pEPD->bEndpointAddress);
+
+  ep_cfg = ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep];
+  /* mask the attributes we are not-intersetd in */
+  bmAttributes = pEPD->bmAttributes & USB_ENDPOINT_TYPE_MASK;
+  /* set EP type */
+  if (bmAttributes != USB_ENDPOINT_TYPE_ISOCHRONOUS)
+  {
+    /* init EP capabilities */
+    ep_QH[num].cap  = QH_MAXP(pEPD->wMaxPacketSize)
+                      | QH_IOS | QH_ZLT ;
+    /* The next DTD pointer is INVALID */
+    ep_TD[num].next_dTD = 0x01 ;
+  }
+  else
+  {
+    /* init EP capabilities */
+    ep_QH[num].cap  = QH_MAXP(0x400) | QH_ZLT;
+  }
+  /* setup EP control register */
+  if (pEPD->bEndpointAddress & 0x80)
+  {
+    ep_cfg &= ~0xFFFF0000;
+    ep_cfg |= EPCTRL_TX_TYPE(bmAttributes)
+              | EPCTRL_TXR;
+  }
+  else
+  {
+    ep_cfg &= ~0xFFFF;
+    ep_cfg |= EPCTRL_RX_TYPE(bmAttributes)
+              | EPCTRL_RXR;
+  }
+  ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] = ep_cfg;
+  return;
+}
+
+/*
+ *  Set Direction for USB Control Endpoint
+ *    Parameters:      dir:   Out (dir == 0), In (dir <> 0)
+ *    Return Value:    None
+ */
+
+void USB_DirCtrlEP (uint32_t dir) {
+  /* Not needed */
+  ( void ) dir;
+}
+
+
+/*
+ *  Enable USB Endpoint
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    None
+ */
+
+void USB_EnableEP (uint32_t EPNum) {
+  uint32_t lep, bitpos;
+
+  lep = EPNum & 0x0F;
+
+  if (EPNum & 0x80)
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_TXE;
+  }
+  else
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_RXE;
+    /* enable NAK interrupt */
+    bitpos = USB_EP_BITPOS(EPNum);
+    LPC_USB->ENDPTNAKEN |= (1<<bitpos);
+  }
+}
+
+/*
+ *  Disable USB Endpoint
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    None
+ */
+
+void USB_DisableEP (uint32_t EPNum) {
+  uint32_t lep, bitpos;
+
+  lep = EPNum & 0x0F;
+  if (EPNum & 0x80)
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] &= ~EPCTRL_TXE;
+  }
+  else
+  {
+    /* disable NAK interrupt */
+    bitpos = USB_EP_BITPOS(EPNum);
+    LPC_USB->ENDPTNAKEN &= ~(1<<bitpos);
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] &= ~EPCTRL_RXE;
+  }
+}
+
+/*
+ *  Reset USB Endpoint
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    None
+ */
+
+void USB_ResetEP (uint32_t EPNum) {
+  uint32_t bit_pos = USB_EP_BITPOS(EPNum);
+  uint32_t lep = EPNum & 0x0F;
+
+  /* flush EP buffers */
+  LPC_USB->ENDPTFLUSH = (1<<bit_pos);
+  while (LPC_USB->ENDPTFLUSH & (1<<bit_pos));
+  /* reset data toggles */
+  if (EPNum & 0x80)
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_TXR;
+  }
+  else
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_RXR;
+  }
+}
+
+/*
+ *  Set Stall for USB Endpoint
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    None
+ */
+
+void USB_SetStallEP (uint32_t EPNum) {
+  uint32_t lep;
+
+  lep = EPNum & 0x0F;
+  if (EPNum & 0x80)
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_TXS;
+  }
+  else
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_RXS;
+  }
+}
+
+/*
+ *  Clear Stall for USB Endpoint
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *    Return Value:    None
+ */
+
+void USB_ClrStallEP (uint32_t EPNum) {
+  uint32_t lep;
+
+  lep = EPNum & 0x0F;
+  if (EPNum & 0x80)
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] &= ~EPCTRL_TXS;
+    /* reset data toggle */
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_TXR;
+  }
+  else
+  {
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] &= ~EPCTRL_RXS;
+    /* reset data toggle */
+    ((uint32_t*)&(LPC_USB->ENDPTCTRL0))[lep] |= EPCTRL_RXR;
+  }
+}
+
+/*
+ *  Process DTD
+ *    Parameters:      EPNum: Endpoint Number
+ *                       EPNum.0..3: Address
+ *                       EPNum.7:    Dir
+ *                     Buffer pointer
+ *                     Transfer buffer size
+ *    Return Value:    None
+ */
+void USB_ProgDTD(uint32_t Edpt, uint32_t ptrBuff, uint32_t TsfSize)
+{
+  DTD_T*  pDTD;
+
+  pDTD = (DTD_T*)&ep_TD[ Edpt ];
+
+  /* Zero out the device transfer descriptors */
+  memset((void*)pDTD, 0, sizeof(DTD_T));
+  /* The next DTD pointer is INVALID */
+  pDTD->next_dTD = 0x01 ;
+
+  /* Length */
+  pDTD->total_bytes = ((TsfSize & 0x7fff) << 16);
+  pDTD->total_bytes |= TD_IOC ;
+  pDTD->total_bytes |= 0x80 ;
+
+  pDTD->buffer0 = ptrBuff;
+  pDTD->buffer1 = (ptrBuff + 0x1000) & 0xfffff000;
+  pDTD->buffer2 = (ptrBuff + 0x2000) & 0xfffff000;
+  pDTD->buffer3 = (ptrBuff + 0x3000) & 0xfffff000;
+  pDTD->buffer4 = (ptrBuff + 0x4000) & 0xfffff000;
+
+  ep_QH[Edpt].next_dTD = (uint32_t)(&ep_TD[ Edpt ]);
+  ep_QH[Edpt].total_bytes &= (~0xC0) ;
+}
+
+/*
+*  Read USB Endpoint Data
+*    Parameters:      EPNum: Endpoint Number
+*                       EPNum.0..3: Address
+*                       EPNum.7:    Dir
+*                     pData: Pointer to Data Buffer
+*    Return Value:    Number of bytes read
+*/
+uint32_t USB_ReadSetupPkt(uint32_t EPNum, uint32_t *pData)
+{
+  uint32_t setup_int, cnt = 0;
+  uint32_t num = EPAdr(EPNum);
+
+  setup_int = LPC_USB->ENDPTSETUPSTAT ;
+  /* Clear the setup interrupt */
+  LPC_USB->ENDPTSETUPSTAT = setup_int;
+
+  /* ********************************** */
+  /*  Check if we have received a setup */
+  /* ********************************** */
+  if (setup_int & (1<<0))                    /* Check only for bit 0 */
+    /* No setup are admitted on other endpoints than 0 */
+  {
+    do
+    {
+      /* Setup in a setup - must considere only the second setup */
+      /*- Set the tripwire */
+      LPC_USB->USBCMD_D |= USBCMD_SUTW ;
+
+      /* Transfer Set-up data to the gtmudsCore_Request buffer */
+      pData[0] = ep_QH[num].setup[0];
+      pData[1] = ep_QH[num].setup[1];
+      cnt = 8;
+
+    }
+    while (!(LPC_USB->USBCMD_D & USBCMD_SUTW)) ;
+
+    /* setup in a setup - Clear the tripwire */
+    LPC_USB->USBCMD_D &= (~USBCMD_SUTW);
+  }
+  while ((setup_int = LPC_USB->ENDPTSETUPSTAT) != 0)
+  {
+    /* Clear the setup interrupt */
+    LPC_USB->ENDPTSETUPSTAT = setup_int;
+  }
+  return cnt;
+}
+
+/*
+*  Enque read request
+*    Parameters:      EPNum: Endpoint Number
+*                       EPNum.0..3: Address
+*                       EPNum.7:    Dir
+*                     pData: Pointer to Data Buffer
+*    Return Value:    Number of bytes read
+*/
+
+uint32_t USB_ReadReqEP(uint32_t EPNum, uint8_t *pData, uint32_t len)
+{
+  uint32_t num = EPAdr(EPNum);
+  uint32_t n = USB_EP_BITPOS(EPNum);
+
+  USB_ProgDTD(num, (uint32_t)pData, len);
+  ep_read_len[EPNum & 0x0F] = len;
+  /* prime the endpoint for read */
+  LPC_USB->ENDPTPRIME |= (1<<n);
+  return len;
+}
+/*
+*  Read USB Endpoint Data
+*    Parameters:      EPNum: Endpoint Number
+*                       EPNum.0..3: Address
+*                       EPNum.7:    Dir
+*                     pData: Pointer to Data Buffer
+*    Return Value:    Number of bytes read
+*/
+
+uint32_t USB_ReadEP(uint32_t EPNum, uint8_t *pData)
+{
+  uint32_t cnt, n;
+  DTD_T*  pDTD ;
+
+  ( void ) pData;
+
+  n = EPAdr(EPNum);
+  pDTD = (DTD_T*)&ep_TD[n];
+
+  /* return the total bytes read */
+  cnt  = (pDTD->total_bytes >> 16) & 0x7FFF;
+  cnt = ep_read_len[EPNum & 0x0F] - cnt;
+  return (cnt);
+}
+
+/*
+*  Write USB Endpoint Data
+*    Parameters:      EPNum: Endpoint Number
+*                       EPNum.0..3: Address
+*                       EPNum.7:    Dir
+*                     pData: Pointer to Data Buffer
+*                     cnt:   Number of bytes to write
+*    Return Value:    Number of bytes written
+*/
+uint32_t USB_WriteEP(uint32_t EPNum, uint8_t *pData, uint32_t cnt)
+{
+  uint32_t x = 0, n = USB_EP_BITPOS(EPNum);
+
+  USB_ProgDTD(EPAdr(EPNum), (uint32_t)pData, cnt);
+  /* prime the endpoint for transmit */
+  LPC_USB->ENDPTPRIME |= (1<<n);
+   /* check if priming succeeded */
+  while ((LPC_USB->ENDPTPRIME & (1<<n))&&(++x<0xffff));/*_RB_ Fix for hang here. */
+  return (cnt);
+}
+
+/*
+ *  USB Interrupt Service Routine
+ */
+#ifdef USE_USB0
+void USB0_IRQHandler (void)
+#else
+void USB1_IRQHandler (void)
+#endif
+{
+  uint32_t disr, val, n;
+
+  disr = LPC_USB->USBSTS_D;                      /* Device Interrupt Status */
+  LPC_USB->USBSTS_D = disr;
+
+//  printf("USB interrupt: 0x%08x\n",disr);
+
+//     LPC_UART1->THR = 'U';
+//     LPC_UART1->THR = 'S';
+//     LPC_UART1->THR = 'B';
+//     LPC_UART1->THR = '\n';
+
+
+  /* Device Status Interrupt (Reset, Connect change, Suspend/Resume) */
+  if (disr & USBSTS_URI)                      /* Reset */
+  {
+//                                                                                                     LPC_UART1->THR = 'R';
+//                                                                                                     LPC_UART1->THR = '\n';
+    USB_Reset();
+    if (g_drv.USB_Reset_Event)
+      g_drv.USB_Reset_Event();
+    return;
+       //goto isr_end;
+  }
+
+  if (disr & USBSTS_SLI)                   /* Suspend */
+  {
+//                                                                                               LPC_UART1->THR = 'U';
+//                                                                                                     LPC_UART1->THR = '\n';
+    if (g_drv.USB_Suspend_Event)
+      g_drv.USB_Suspend_Event();
+  }
+
+  if (disr & USBSTS_PCI)                  /* Resume */
+  {
+//                                                                                                     LPC_UART1->THR = 'P';
+//                                                                                                     LPC_UART1->THR = '\n';
+    /* check if device isoperating in HS mode or full speed */
+    if (LPC_USB->PORTSC1_D & (1<<9))
+      DevStatusFS2HS = TRUE;
+
+    if (g_drv.USB_Resume_Event)
+      g_drv.USB_Resume_Event();
+  }
+
+  /* handle setup status interrupts */
+  val = LPC_USB->ENDPTSETUPSTAT;
+  /* Only EP0 will have setup packets so call EP0 handler */
+  if (val)
+  {
+//                                                                                                 LPC_UART1->THR = 'S';
+//                                                                                                     LPC_UART1->THR = '\n';
+    /* Clear the endpoint complete CTRL OUT & IN when */
+    /* a Setup is received */
+    LPC_USB->ENDPTCOMPLETE = 0x00010001;
+    /* enable NAK inetrrupts */
+    LPC_USB->ENDPTNAKEN |= 0x00010001;
+    if (g_drv.USB_P_EP[0]){
+//                                                                                                             LPC_UART1->THR = 's';
+//                                                                                                             LPC_UART1->THR = '\n';
+        g_drv.USB_P_EP[0](USB_EVT_SETUP);
+       }
+  }
+
+  /* handle completion interrupts */
+  val = LPC_USB->ENDPTCOMPLETE;
+  if (val)
+  {
+//                                                                                                             LPC_UART1->THR = 'C';
+//                                                                                                             LPC_UART1->THR = '\n';
+
+    LPC_USB->ENDPTNAK = val;
+    for (n = 0; n < EP_NUM_MAX / 2; n++)
+    {
+      if (val & (1<<n))
+      {
+        if (g_drv.USB_P_EP[n])
+          g_drv.USB_P_EP[n](USB_EVT_OUT);
+
+        LPC_USB->ENDPTCOMPLETE = (1<<n);
+      }
+      if (val & (1<<(n + 16)))
+      {
+        ep_TD [(n << 1) + 1 ].total_bytes &= 0xC0;
+        if (g_drv.USB_P_EP[n])
+          g_drv.USB_P_EP[n](USB_EVT_IN);
+        LPC_USB->ENDPTCOMPLETE = (1<<(n + 16));
+      }
+    }
+  }
+
+  if (disr & USBSTS_NAKI)
+  {
+//                                                                                                     LPC_UART1->THR = 'N';
+//                                                                                                     LPC_UART1->THR = '\n';
+    val = LPC_USB->ENDPTNAK;
+    val &= LPC_USB->ENDPTNAKEN;
+    /* handle NAK interrupts */
+    if (val)
+    {
+      for (n = 0; n < EP_NUM_MAX / 2; n++)
+      {
+        if (val & (1<<n))
+        {
+          if (g_drv.USB_P_EP[n])
+            g_drv.USB_P_EP[n](USB_EVT_OUT_NAK);
+        }
+        if (val & (1<<(n + 16)))
+        {
+          if (g_drv.USB_P_EP[n])
+            g_drv.USB_P_EP[n](USB_EVT_IN_NAK);
+        }
+      }
+      LPC_USB->ENDPTNAK = val;
+    }
+  }
+
+  /* Start of Frame Interrupt */
+  if (disr & USBSTS_SRI)
+  {
+//                                                                                                     LPC_UART1->THR = 'F';
+//                                                                                                     LPC_UART1->THR = '\n';
+    if (g_drv.USB_SOF_Event)
+      g_drv.USB_SOF_Event();
+  }
+
+  /* Error Interrupt */
+  if (disr & USBSTS_UEI)
+  {
+//                                                                                                       LPC_UART1->THR = 'E';
+//                                                                                                             LPC_UART1->THR = '\n';
+    if (g_drv.USB_Error_Event)
+      g_drv.USB_Error_Event(disr);
+  }
+
+//    LPC_UART1->THR = 'r';
+//     LPC_UART1->THR = '\n';
+//isr_end:
+//  LPC_VIC->VectAddr = 0;                   /* Acknowledge Interrupt */
+  return;
+}
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbuser.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/USB_CDC/usbuser.c
new file mode 100644 (file)
index 0000000..b0226ac
--- /dev/null
@@ -0,0 +1,221 @@
+/*----------------------------------------------------------------------------
+ *      U S B  -  K e r n e l
+ *----------------------------------------------------------------------------
+ * Name:    usbuser.c
+ * Purpose: USB Custom User Module
+ * Version: V1.20
+ *----------------------------------------------------------------------------
+ *      This software is supplied "AS IS" without any warranties, express,
+ *      implied or statutory, including but not limited to the implied
+ *      warranties of fitness for purpose, satisfactory quality and
+ *      noninfringement. Keil extends you a royalty-free right to reproduce
+ *      and distribute executable files created using this software for use
+ *      on NXP Semiconductors LPC family microcontroller devices only. Nothing
+ *      else gives you the right to use this software.
+ *
+ * Copyright (c) 2009 Keil - An ARM Company. All rights reserved.
+ *---------------------------------------------------------------------------*/
+
+#include "lpc18xx.H"
+#include "lpc_types.h"
+
+#include "usb.h"
+#include "usbcfg.h"
+#include "usbhw.h"
+#include "usbcore.h"
+#include "usbuser.h"
+#include "cdcuser.h"
+
+
+
+/*
+ *  USB Power Event Callback
+ *   Called automatically on USB Power Event
+ *    Parameter:       power: On(TRUE)/Off(FALSE)
+ */
+
+#if USB_POWER_EVENT
+void USB_Power_Event (uint32_t  power) {
+}
+#endif
+
+
+/*
+ *  USB Reset Event Callback
+ *   Called automatically on USB Reset Event
+ */
+
+#if USB_RESET_EVENT
+void USB_Reset_Event (void) {
+  USB_ResetCore();
+}
+#endif
+
+
+/*
+ *  USB Suspend Event Callback
+ *   Called automatically on USB Suspend Event
+ */
+
+#if USB_SUSPEND_EVENT
+void USB_Suspend_Event (void) {
+}
+#endif
+
+
+/*
+ *  USB Resume Event Callback
+ *   Called automatically on USB Resume Event
+ */
+
+#if USB_RESUME_EVENT
+void USB_Resume_Event (void) {
+}
+#endif
+
+
+/*
+ *  USB Remote Wakeup Event Callback
+ *   Called automatically on USB Remote Wakeup Event
+ */
+
+#if USB_WAKEUP_EVENT
+void USB_WakeUp_Event (void) {
+}
+#endif
+
+
+/*
+ *  USB Start of Frame Event Callback
+ *   Called automatically on USB Start of Frame Event
+ */
+
+#if USB_SOF_EVENT
+void USB_SOF_Event (void) {
+}
+#endif
+
+
+/*
+ *  USB Error Event Callback
+ *   Called automatically on USB Error Event
+ *    Parameter:       error: Error Code
+ */
+
+#if USB_ERROR_EVENT
+void USB_Error_Event (uint32_t error) {
+}
+#endif
+
+
+/*
+ *  USB Set Configuration Event Callback
+ *   Called automatically on USB Set Configuration Request
+ */
+
+#if USB_CONFIGURE_EVENT
+void USB_Configure_Event (void) {
+
+  if (USB_Configuration) {                  /* Check if USB is configured */
+    /* add your code here */
+  }
+}
+#endif
+
+
+/*
+ *  USB Set Interface Event Callback
+ *   Called automatically on USB Set Interface Request
+ */
+
+#if USB_INTERFACE_EVENT
+void USB_Interface_Event (void) {
+}
+#endif
+
+
+/*
+ *  USB Set/Clear Feature Event Callback
+ *   Called automatically on USB Set/Clear Feature Request
+ */
+
+#if USB_FEATURE_EVENT
+void USB_Feature_Event (void) {
+}
+#endif
+
+
+#define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
+
+/* USB Endpoint Events Callback Pointers */
+void (* const USB_P_EP[USB_EP_NUM]) (uint32_t event) = {
+  P_EP(0),
+  P_EP(1),
+  P_EP(2),
+  P_EP(3),
+};
+
+
+/*
+ *  USB Endpoint 1 Event Callback
+ *   Called automatically on USB Endpoint 1 Event
+ *    Parameter:       event
+ */
+
+void USB_EndPoint1 (uint32_t event) {
+       ( void ) event;
+}
+
+
+/*
+ *  USB Endpoint 2 Event Callback
+ *   Called automatically on USB Endpoint 2 Event
+ *    Parameter:       event
+ */
+
+void USB_EndPoint2 (uint32_t event) {
+  switch (event) {
+  case USB_EVT_OUT_NAK:
+      CDC_BulkOutNak();
+      break;
+    case USB_EVT_OUT:
+      CDC_BulkOut ();                /* data received from Host */
+      break;
+    case USB_EVT_IN:
+      CDC_BulkIn ();                 /* data expected from Host */
+      break;
+  }
+}
+
+
+/*
+ *  USB Endpoint 3 Event Callback
+ *   Called automatically on USB Endpoint 3 Event
+ *    Parameter:       event
+ */
+
+void USB_EndPoint3 (uint32_t event) {
+       ( void ) event;
+}
+
+
+/*
+ *  USB Endpoint 4 Event Callback
+ *   Called automatically on USB Endpoint 4 Event
+ *    Parameter:       event
+ */
+
+void USB_EndPoint4 (uint32_t event) {
+       ( void ) event;
+}
+
+
+/*
+ *  USB Endpoint 5 Event Callback
+ *   Called automatically on USB Endpoint 5 Event
+ *    Parameter:       event
+ */
+
+void USB_EndPoint5 (uint32_t event) {
+  ( void ) event;
+}
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/cr_startup_lpc18xx.c
new file mode 100644 (file)
index 0000000..9c1d4f7
--- /dev/null
@@ -0,0 +1,529 @@
+//*****************************************************************************\r
+//   +--+\r
+//   | ++----+\r
+//   +-++    |\r
+//     |     |\r
+//   +-+--+  |\r
+//   | +--+--+\r
+//   +----+    Copyright (c) 2011-12 Code Red Technologies Ltd.\r
+//\r
+// Microcontroller Startup code for use with Red Suite\r
+//\r
+// Version : 120126\r
+//\r
+// Software License Agreement\r
+//\r
+// The software is owned by Code Red Technologies and/or its suppliers, and is\r
+// protected under applicable copyright laws.  All rights are reserved.  Any\r
+// use in violation of the foregoing restrictions may subject the user to criminal\r
+// sanctions under applicable laws, as well as to civil liability for the breach\r
+// of the terms and conditions of this license.\r
+//\r
+// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
+// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
+// USE OF THIS SOFTWARE FOR COMMERCIAL DEVELOPMENT AND/OR EDUCATION IS SUBJECT\r
+// TO A CURRENT END USER LICENSE AGREEMENT (COMMERCIAL OR EDUCATIONAL) WITH\r
+// CODE RED TECHNOLOGIES LTD.\r
+//\r
+//*****************************************************************************\r
+#if defined (__cplusplus)\r
+#ifdef __REDLIB__\r
+#error Redlib does not support C++\r
+#else\r
+//*****************************************************************************\r
+//\r
+// The entry point for the C++ library startup\r
+//\r
+//*****************************************************************************\r
+extern "C" {\r
+       extern void __libc_init_array(void);\r
+}\r
+#endif\r
+#endif\r
+\r
+#define WEAK __attribute__ ((weak))\r
+#define ALIAS(f) __attribute__ ((weak, alias (#f)))\r
+\r
+// Code Red - if CMSIS is being used, then SystemInit() routine\r
+// will be called by startup code rather than in application's main()\r
+#if defined (__USE_CMSIS)\r
+#include "LPC18xx.h"\r
+#endif\r
+\r
+//*****************************************************************************\r
+#if defined (__cplusplus)\r
+extern "C" {\r
+#endif\r
+\r
+#include <stdint.h>\r
+\r
+//*****************************************************************************\r
+//\r
+// Forward declaration of the default handlers. These are aliased.\r
+// When the application defines a handler (with the same name), this will\r
+// automatically take precedence over these weak definitions\r
+//\r
+//*****************************************************************************\r
+     void ResetISR(void);\r
+WEAK void NMI_Handler(void);\r
+WEAK void HardFault_Handler(void);// __attribute__((naked));\r
+WEAK void MemManage_Handler(void);\r
+WEAK void BusFault_Handler(void);\r
+WEAK void UsageFault_Handler(void);\r
+WEAK void SVCall_Handler(void);\r
+WEAK void DebugMon_Handler(void);\r
+WEAK void PendSV_Handler(void);\r
+WEAK void SysTick_Handler(void);\r
+WEAK void IntDefaultHandler(void);\r
+\r
+//*****************************************************************************\r
+//\r
+// Forward declaration of the specific IRQ handlers. These are aliased\r
+// to the IntDefaultHandler, which is a 'forever' loop. When the application\r
+// defines a handler (with the same name), this will automatically take\r
+// precedence over these weak definitions\r
+//\r
+//*****************************************************************************\r
+void DAC_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void DMA_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void ETH_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SDIO_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void LCD_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void USB0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void USB1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SCT_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void RIT_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void TIMER0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void TIMER1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void TIMER2_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void TIMER3_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void MCPWM_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void ADC0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void I2C0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void I2C1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void ADC1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SSP0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SSP1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void UART0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void UART1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void UART2_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void UART3_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void I2S0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void I2S1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SPIFI_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void SGPIO_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO2_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO3_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO4_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO5_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO6_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GPIO7_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GINT0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void GINT1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void EVRT_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void CAN1_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void ATIMER_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void RTC_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void WDT_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void CAN0_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+void QEI_IRQHandler(void) ALIAS(IntDefaultHandler);\r
+\r
+//*****************************************************************************\r
+//\r
+// The entry point for the application.\r
+// __main() is the entry point for Redlib based applications\r
+// main() is the entry point for Newlib based applications\r
+//\r
+//*****************************************************************************\r
+#if defined (__REDLIB__)\r
+extern void __main(void);\r
+#endif\r
+extern int main(void);\r
+//*****************************************************************************\r
+//\r
+// External declaration for the pointer to the stack top from the Linker Script\r
+//\r
+//*****************************************************************************\r
+extern void _vStackTop(void);\r
+\r
+//*****************************************************************************\r
+#if defined (__cplusplus)\r
+} // extern "C"\r
+#endif\r
+//*****************************************************************************\r
+//\r
+// The vector table.\r
+// This relies on the linker script to place at correct location in memory.\r
+//\r
+//*****************************************************************************\r
+extern void (* const g_pfnVectors[])(void);\r
+__attribute__ ((section(".isr_vector")))\r
+void (* const g_pfnVectors[])(void) = {\r
+       // Core Level - CM3\r
+       &_vStackTop, // The initial stack pointer\r
+       ResetISR,                                                               // The reset handler\r
+       NMI_Handler,                                                    // The NMI handler\r
+       HardFault_Handler,                                              // The hard fault handler\r
+       MemManage_Handler,                                              // The MPU fault handler\r
+       BusFault_Handler,                                               // The bus fault handler\r
+       UsageFault_Handler,                                             // The usage fault handler\r
+       0,                                                                              // Reserved\r
+       0,                                                                              // Reserved\r
+       0,                                                                              // Reserved\r
+       0,                                                                              // Reserved\r
+       SVCall_Handler,                                                 // SVCall handler\r
+       DebugMon_Handler,                                               // Debug monitor handler\r
+       0,                                                                              // Reserved\r
+       PendSV_Handler,                                                 // The PendSV handler\r
+       SysTick_Handler,                                                // The SysTick handler\r
+\r
+       // Chip Level - LPC18\r
+       DAC_IRQHandler,                         // 16\r
+       0,                                                      // 17\r
+       DMA_IRQHandler,                         // 18\r
+       0,                                                      // 19\r
+       0,                                                      // 20\r
+       ETH_IRQHandler,                         // 21\r
+       SDIO_IRQHandler,                        // 22\r
+       LCD_IRQHandler,                         // 23\r
+       USB0_IRQHandler,                        // 24\r
+       USB1_IRQHandler,                        // 25\r
+       SCT_IRQHandler,                         // 26\r
+       RIT_IRQHandler,                         // 27\r
+       TIMER0_IRQHandler,                      // 28\r
+       TIMER1_IRQHandler,                      // 29\r
+       TIMER2_IRQHandler,                      // 30\r
+       TIMER3_IRQHandler,                      // 31\r
+       MCPWM_IRQHandler,                       // 32\r
+       ADC0_IRQHandler,                        // 33\r
+       I2C0_IRQHandler,                        // 34\r
+       I2C1_IRQHandler,                        // 35\r
+       0,                                                      // 36\r
+       ADC1_IRQHandler,                        // 37\r
+       SSP0_IRQHandler,                        // 38\r
+       SSP1_IRQHandler,                        // 39\r
+       UART0_IRQHandler,                       // 40\r
+       UART1_IRQHandler,                       // 41\r
+       UART2_IRQHandler,                       // 42\r
+       UART3_IRQHandler,                       // 43\r
+       I2S0_IRQHandler,                        // 44\r
+       I2S1_IRQHandler,                        // 45\r
+       SPIFI_IRQHandler,                       // 46\r
+       SGPIO_IRQHandler,                       // 47\r
+       GPIO0_IRQHandler,                       // 48\r
+       GPIO1_IRQHandler,                       // 49\r
+       GPIO2_IRQHandler,                       // 50\r
+       GPIO3_IRQHandler,                       // 51\r
+       GPIO4_IRQHandler,                       // 52\r
+       GPIO5_IRQHandler,                       // 53\r
+       GPIO6_IRQHandler,                       // 54\r
+       GPIO7_IRQHandler,                       // 55\r
+       GINT0_IRQHandler,                       // 56\r
+       GINT1_IRQHandler,                       // 57\r
+       EVRT_IRQHandler,                        // 58\r
+       CAN1_IRQHandler,                        // 59\r
+       0,                                                      // 60\r
+       0,                                                      // 61\r
+       ATIMER_IRQHandler,                      // 62\r
+       RTC_IRQHandler,                         // 63\r
+       0,                                                      // 64\r
+       WDT_IRQHandler,                 // 65\r
+       0,                                                      // 66\r
+       CAN0_IRQHandler,                        // 67\r
+       QEI_IRQHandler,                         // 68\r
+};\r
+\r
+//*****************************************************************************\r
+// Functions to carry out the initialization of RW and BSS data sections. These\r
+// are written as separate functions rather than being inlined within the\r
+// ResetISR() function in order to cope with MCUs with multiple banks of\r
+// memory.\r
+//*****************************************************************************\r
+__attribute__ ((section(".after_vectors")))\r
+void data_init(unsigned int romstart, unsigned int start, unsigned int len) {\r
+       unsigned int *pulDest = (unsigned int*) start;\r
+       unsigned int *pulSrc = (unsigned int*) romstart;\r
+       unsigned int loop;\r
+       for (loop = 0; loop < len; loop = loop + 4)\r
+               *pulDest++ = *pulSrc++;\r
+}\r
+\r
+__attribute__ ((section(".after_vectors")))\r
+void bss_init(unsigned int start, unsigned int len) {\r
+       unsigned int *pulDest = (unsigned int*) start;\r
+       unsigned int loop;\r
+       for (loop = 0; loop < len; loop = loop + 4)\r
+               *pulDest++ = 0;\r
+}\r
+\r
+//*****************************************************************************\r
+// The following symbols are constructs generated by the linker, indicating\r
+// the location of various points in the "Global Section Table". This table is\r
+// created by the linker via the Code Red managed linker script mechanism. It\r
+// contains the load address, execution address and length of each RW data\r
+// section and the execution and length of each BSS (zero initialized) section.\r
+//*****************************************************************************\r
+extern unsigned int __data_section_table;\r
+extern unsigned int __data_section_table_end;\r
+extern unsigned int __bss_section_table;\r
+extern unsigned int __bss_section_table_end;\r
+\r
+//*****************************************************************************\r
+// Reset entry point for your code.\r
+// Sets up a simple runtime environment and initializes the C/C++\r
+// library.\r
+//\r
+//*****************************************************************************\r
+void\r
+ResetISR(void) {\r
+\r
+// *************************************************************\r
+// The following conditional block of code manually resets as\r
+// much of the peripheral set of the LPC18 as possible. This is\r
+// done because the LPC18 does not provide a means of triggering\r
+// a full system reset under debugger control, which can cause\r
+// problems in certain circumstances when debugging.\r
+//\r
+// You can prevent this code block being included if you require\r
+// (for example when creating a final executable which you will\r
+// not debug) by setting the define 'DONT_RESET_ON_RESTART'.\r
+//\r
+#ifndef DONT_RESET_ON_RESTART\r
+\r
+       // Disable interrupts\r
+       __asm volatile ("cpsid i");\r
+       // equivalent to CMSIS '__disable_irq()' function\r
+\r
+       unsigned int *RESET_CONTROL = (unsigned int *) 0x40053100;\r
+       // LPC_RGU->RESET_CTRL0 @ 0x40053100\r
+       // LPC_RGU->RESET_CTRL1 @ 0x40053104\r
+       // Note that we do not use the CMSIS register access mechanism,\r
+       // as there is no guarantee that the project has been configured\r
+       // to use CMSIS.\r
+\r
+       // Write to LPC_RGU->RESET_CTRL0\r
+       *(RESET_CONTROL+0) = 0x10DF0000;\r
+       // GPIO_RST|AES_RST|ETHERNET_RST|SDIO_RST|DMA_RST|\r
+       // USB1_RST|USB0_RST|LCD_RST\r
+\r
+       // Write to LPC_RGU->RESET_CTRL1\r
+       *(RESET_CONTROL+1) = 0x00DFF7FF;\r
+       // CAN0_RST|CAN1_RST|I2S_RST|SSP1_RST|SSP0_RST|\r
+       // I2C1_RST|I2C0_RST|UART3_RST|UART1_RST|UART1_RST|UART0_RST|\r
+       // DAC_RST|ADC1_RST|ADC0_RST|QEI_RST|MOTOCONPWM_RST|SCT_RST|\r
+       // RITIMER_RST|TIMER3_RST|TIMER2_RST|TIMER1_RST|TIMER0_RST\r
+\r
+       // Clear all pending interrupts in the NVIC\r
+       volatile unsigned int *NVIC_ICPR = (unsigned int *) 0xE000E280;\r
+       unsigned int irqpendloop;\r
+       for (irqpendloop = 0; irqpendloop < 8; irqpendloop++) {\r
+               *(NVIC_ICPR+irqpendloop)= 0xFFFFFFFF;\r
+       }\r
+\r
+       // Reenable interrupts\r
+       __asm volatile ("cpsie i");\r
+       // equivalent to CMSIS '__enable_irq()' function\r
+\r
+#endif  // ifndef DONT_RESET_ON_RESTART\r
+// *************************************************************\r
+\r
+\r
+    //\r
+    // Copy the data sections from flash to SRAM.\r
+    //\r
+       unsigned int LoadAddr, ExeAddr, SectionLen;\r
+       unsigned int *SectionTableAddr;\r
+\r
+       // Load base address of Global Section Table\r
+       SectionTableAddr = &__data_section_table;\r
+\r
+    // Copy the data sections from flash to SRAM.\r
+       while (SectionTableAddr < &__data_section_table_end) {\r
+               LoadAddr = *SectionTableAddr++;\r
+               ExeAddr = *SectionTableAddr++;\r
+               SectionLen = *SectionTableAddr++;\r
+               data_init(LoadAddr, ExeAddr, SectionLen);\r
+       }\r
+       // At this point, SectionTableAddr = &__bss_section_table;\r
+       // Zero fill the bss segment\r
+       while (SectionTableAddr < &__bss_section_table_end) {\r
+               ExeAddr = *SectionTableAddr++;\r
+               SectionLen = *SectionTableAddr++;\r
+               bss_init(ExeAddr, SectionLen);\r
+       }\r
+\r
+       // ******************************\r
+       // Check to see if we are running the code from a non-zero\r
+        // address (eg RAM, external flash), in which case we need\r
+        // to modify the VTOR register to tell the CPU that the\r
+        // vector table is located at a non-0x0 address.\r
+\r
+       // Note that we do not use the CMSIS register access mechanism,\r
+       // as there is no guarantee that the project has been configured\r
+       // to use CMSIS.\r
+       unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;\r
+       if ((unsigned int *)g_pfnVectors!=(unsigned int *) 0x00000000) {\r
+               // CMSIS : SCB->VTOR = <address of vector table>\r
+               *pSCB_VTOR = (unsigned int)g_pfnVectors;\r
+       }\r
+\r
+#ifdef __USE_CMSIS\r
+       SystemInit();\r
+#endif\r
+\r
+#if defined (__cplusplus)\r
+       //\r
+       // Call C++ library initialisation\r
+       //\r
+       __libc_init_array();\r
+#endif\r
+\r
+#if defined (__REDLIB__)\r
+       // Call the Redlib library, which in turn calls main()\r
+       __main() ;\r
+#else\r
+       main();\r
+#endif\r
+\r
+       //\r
+       // main() shouldn't return, but if it does, we'll just enter an infinite loop\r
+       //\r
+       while (1) {\r
+               ;\r
+       }\r
+}\r
+\r
+//*****************************************************************************\r
+// Default exception handlers. Override the ones here by defining your own\r
+// handler routines in your application code.\r
+//*****************************************************************************\r
+__attribute__ ((section(".after_vectors")))\r
+void NMI_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void HardFault_Handler(void)\r
+{\r
+return;\r
+    __asm volatile\r
+    (\r
+        " tst lr, #4                                                \n"\r
+        " ite eq                                                    \n"\r
+        " mrseq r0, msp                                             \n"\r
+        " mrsne r0, psp                                             \n"\r
+        " ldr r1, [r0, #24]                                         \n"\r
+        " ldr r2, handler2_address_const                            \n"\r
+        " bx r2                                                     \n"\r
+        " handler2_address_const: .word prvGetRegistersFromStack    \n"\r
+    );\r
+}\r
+\r
+__attribute__ ((section(".after_vectors")))\r
+void MemManage_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void BusFault_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void UsageFault_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void SVCall_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void DebugMon_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void PendSV_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+__attribute__ ((section(".after_vectors")))\r
+void SysTick_Handler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+\r
+//*****************************************************************************\r
+//\r
+// Processor ends up here if an unexpected interrupt occurs or a specific\r
+// handler is not present in the application code.\r
+//\r
+//*****************************************************************************\r
+__attribute__ ((section(".after_vectors")))\r
+void IntDefaultHandler(void)\r
+{\r
+    while(1)\r
+    {\r
+    }\r
+}\r
+\r
+/* Debug functions. */\r
+void prvGetRegistersFromStack( uint32_t *pulFaultStackAddress )\r
+{\r
+/* These are volatile to try and prevent the compiler/linker optimising them\r
+away as the variables never actually get used.  If the debugger won't show the\r
+values of the variables, make them global my moving their declaration outside\r
+of this function. */\r
+volatile uint32_t r0;\r
+volatile uint32_t r1;\r
+volatile uint32_t r2;\r
+volatile uint32_t r3;\r
+volatile uint32_t r12;\r
+volatile uint32_t lr; /* Link register. */\r
+volatile uint32_t pc; /* Program counter. */\r
+volatile uint32_t psr;/* Program status register. */\r
+\r
+    r0 = pulFaultStackAddress[ 0 ];\r
+    r1 = pulFaultStackAddress[ 1 ];\r
+    r2 = pulFaultStackAddress[ 2 ];\r
+    r3 = pulFaultStackAddress[ 3 ];\r
+\r
+    r12 = pulFaultStackAddress[ 4 ];\r
+    lr = pulFaultStackAddress[ 5 ];\r
+    pc = pulFaultStackAddress[ 6 ];\r
+    psr = pulFaultStackAddress[ 7 ];\r
+\r
+    /* When the following line is hit, the variables contain the register values. */\r
+    for( ;; )\r
+    {\r
+       ( void ) r0;\r
+       ( void ) r1;\r
+       ( void ) r2;\r
+       ( void ) r3;\r
+       ( void ) r12;\r
+       ( void ) lr;\r
+       ( void ) pc;\r
+       ( void ) psr;\r
+    };\r
+}\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/main.c
new file mode 100644 (file)
index 0000000..c9aa0fd
--- /dev/null
@@ -0,0 +1,264 @@
+/*\r
+    FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+    and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+\r
+/* Standard includes. */\r
+#include <string.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "timers.h"\r
+#include "queue.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+/* Example includes. */\r
+#include "TwoEchoClients.h"\r
+#include "CDCCommandConsole.h"\r
+\r
+/* Library includes. */\r
+#include "LPC18xx.h"\r
+\r
+/* The size of the stack and the priority used by the two echo client tasks. */\r
+#define mainECHO_CLIENT_TASK_STACK_SIZE        ( configMINIMAL_STACK_SIZE * 2 )\r
+#define mainECHO_CLIENT_TASK_PRIORITY          ( tskIDLE_PRIORITY + 1 )\r
+\r
+/* The size of the stack and the priority used by the USB CDC command console\r
+task. */\r
+#define mainCDC_COMMAND_CONSOLE_STACK_SIZE             ( configMINIMAL_STACK_SIZE * 2 )\r
+#define mainCDC_COMMAND_CONSOLE_TASK_PRIORITY  ( 4U )\r
+\r
+/*\r
+* Register commands that can be used with FreeRTOS+CLI.  The commands are\r
+* defined in CLI-commands.c.\r
+*/\r
+extern void vRegisterCLICommands( void );\r
+\r
+/*\r
+ * Initialise the LED ports, and create a timer that periodically toggles an LED\r
+ * just to provide a visual indication that the program is running.\r
+ */\r
+extern void vLEDsInitialise( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The default IP and MAC address used by the demo.  The address configuration\r
+defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is\r
+1 but a DHCP server could not be contacted.  See the online documentation for\r
+more information. */\r
+static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };\r
+static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };\r
+static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };\r
+static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };\r
+\r
+/* The MAC address used by the demo.  In production units the MAC address would\r
+probably be read from flash memory or an EEPROM.  Here it is just hard coded. */\r
+const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+/******************************************************************************\r
+ *\r
+ * See the following web page for information on using this demo.\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/RTOS_UDP_and_CLI_LPC1830_NGX.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+int main( void )\r
+{\r
+       /* The examples assume that all priority bits are assigned as preemption\r
+       priority bits. */\r
+       NVIC_SetPriorityGrouping( 0UL );\r
+\r
+       /* Start the timer that just toggles an LED to show the demo is running. */\r
+       vLEDsInitialise();\r
+\r
+       /* Start the tasks that implements the command console on the UART, as\r
+       described above. */\r
+       vCDCCommandConsoleStart( mainCDC_COMMAND_CONSOLE_STACK_SIZE, mainCDC_COMMAND_CONSOLE_TASK_PRIORITY );\r
+\r
+       /* Register CLI commands. */\r
+       vRegisterCLICommands();\r
+\r
+       /* Initialise the network interface.  Tasks that use the network are\r
+       created in the network event hook when the network is connected and ready\r
+       for use.  The address values passed in here are used if ipconfigUSE_DHCP is\r
+       set to 0, or if ipconfigUSE_DHCP is set to 1 but a DHCP server cannot be\r
+       contacted. */\r
+       FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );\r
+\r
+       /* If the trace recorder code is included... */\r
+       #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
+       {\r
+               extern xQueueHandle xNetworkEventQueue;\r
+\r
+               /* Name the queue for viewing in FreeRTOS+Trace. */\r
+               vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );\r
+       }\r
+       #endif /*  configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1 */\r
+\r
+       /* Start the FreeRTOS scheduler. */\r
+       vTaskStartScheduler();\r
+\r
+       /* The following line should never execute.  If it does, it means there was\r
+       insufficient FreeRTOS heap memory available to create the Idle and/or timer\r
+       tasks.  See the memory management section on the http://www.FreeRTOS.org web\r
+       site for more information. */\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
+{\r
+       ( void ) pcTaskName;\r
+       ( void ) pxTask;\r
+\r
+       /* Run time stack overflow checking is performed if\r
+       configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook\r
+       function is called if a stack overflow is detected. */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationMallocFailedHook( void )\r
+{\r
+       /* vApplicationMallocFailedHook() will only be called if\r
+       configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
+       function that will get called if a call to pvPortMalloc() fails.\r
+       pvPortMalloc() is called internally by the kernel whenever a task, queue,\r
+       timer or semaphore is created.  It is also called by various parts of the\r
+       demo application.  If heap_1.c, heap_2.c or heap_4.c are used, then the \r
+       size of the heap available to pvPortMalloc() is defined by \r
+       configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() \r
+       API function can be used to query the size of free heap space that remains \r
+       (although it does not provide information on how the remaining heap might \r
+       be fragmented). */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called by FreeRTOS+UDP when the network connects. */\r
+void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )\r
+{\r
+static portBASE_TYPE xTaskAlreadyCreated = pdFALSE;\r
+\r
+       if( eNetworkEvent == eNetworkUp )\r
+       {\r
+               /* Create the tasks that transmit to and receive from a standard\r
+               echo server (see the web documentation for this port) in both\r
+               standard and zero copy mode. */\r
+               if( xTaskAlreadyCreated == pdFALSE )\r
+               {\r
+                       vStartEchoClientTasks( mainECHO_CLIENT_TASK_STACK_SIZE, mainECHO_CLIENT_TASK_PRIORITY );\r
+                       xTaskAlreadyCreated = pdTRUE;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called by FreeRTOS+UDP when a reply is received to an outgoing ping request. */\r
+void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier )\r
+{\r
+static const uint8_t *pucSuccess = ( uint8_t * ) "\r\n\r\nPing reply received - ";\r
+static const uint8_t *pucInvalidChecksum = ( uint8_t * ) "\r\n\r\nPing reply received with invalid checksum - ";\r
+static const uint8_t *pucInvalidData = ( uint8_t * ) "\r\n\r\nPing reply received with invalid data - ";\r
+static uint8_t ucMessage[ 50 ];\r
+void vOutputString( const uint8_t * const pucMessage );\r
+\r
+       switch( eStatus )\r
+       {\r
+               case eSuccess   :\r
+                       vOutputString( pucSuccess );\r
+                       break;\r
+\r
+               case eInvalidChecksum :\r
+                       vOutputString( pucInvalidChecksum );\r
+                       break;\r
+\r
+               case eInvalidData :\r
+                       vOutputString( pucInvalidData );\r
+                       break;\r
+\r
+               default :\r
+                       /* It is not possible to get here as all enums have their own\r
+                       case. */\r
+                       break;\r
+       }\r
+\r
+       sprintf( ( char * ) ucMessage, "identifier %d\r\n\r\n", ( int ) usIdentifier );\r
+       vOutputString( ucMessage );\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/printf-stdarg.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/printf-stdarg.c
new file mode 100644 (file)
index 0000000..9bfc45a
--- /dev/null
@@ -0,0 +1,292 @@
+/*\r
+       Copyright 2001, 2002 Georges Menie (www.menie.org)\r
+       stdarg version contributed by Christian Ettinger\r
+\r
+    This program is free software; you can redistribute it and/or modify\r
+    it under the terms of the GNU Lesser General Public License as published by\r
+    the Free Software Foundation; either version 2 of the License, or\r
+    (at your option) any later version.\r
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    GNU Lesser General Public License for more details.\r
+\r
+    You should have received a copy of the GNU Lesser General Public License\r
+    along with this program; if not, write to the Free Software\r
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+*/\r
+\r
+/*\r
+       putchar is the only external dependency for this file,\r
+       if you have a working putchar, leave it commented out.\r
+       If not, uncomment the define below and\r
+       replace outbyte(c) by your own function call.\r
+\r
+*/\r
+\r
+#define putchar(c) c\r
+\r
+#include <stdarg.h>\r
+\r
+static void printchar(char **str, int c)\r
+{\r
+       //extern int putchar(int c);\r
+       \r
+       if (str) {\r
+               **str = (char)c;\r
+               ++(*str);\r
+       }\r
+       else\r
+       { \r
+               (void)putchar(c);\r
+       }\r
+}\r
+\r
+#define PAD_RIGHT 1\r
+#define PAD_ZERO 2\r
+\r
+static int prints(char **out, const char *string, int width, int pad)\r
+{\r
+       register int pc = 0, padchar = ' ';\r
+\r
+       if (width > 0) {\r
+               register int len = 0;\r
+               register const char *ptr;\r
+               for (ptr = string; *ptr; ++ptr) ++len;\r
+               if (len >= width) width = 0;\r
+               else width -= len;\r
+               if (pad & PAD_ZERO) padchar = '0';\r
+       }\r
+       if (!(pad & PAD_RIGHT)) {\r
+               for ( ; width > 0; --width) {\r
+                       printchar (out, padchar);\r
+                       ++pc;\r
+               }\r
+       }\r
+       for ( ; *string ; ++string) {\r
+               printchar (out, *string);\r
+               ++pc;\r
+       }\r
+       for ( ; width > 0; --width) {\r
+               printchar (out, padchar);\r
+               ++pc;\r
+       }\r
+\r
+       return pc;\r
+}\r
+\r
+/* the following should be enough for 32 bit int */\r
+#define PRINT_BUF_LEN 12\r
+\r
+static int printi(char **out, int i, int b, int sg, int width, int pad, int letbase)\r
+{\r
+       char print_buf[PRINT_BUF_LEN];\r
+       register char *s;\r
+       register int t, neg = 0, pc = 0;\r
+       register unsigned int u = (unsigned int)i;\r
+\r
+       if (i == 0) {\r
+               print_buf[0] = '0';\r
+               print_buf[1] = '\0';\r
+               return prints (out, print_buf, width, pad);\r
+       }\r
+\r
+       if (sg && b == 10 && i < 0) {\r
+               neg = 1;\r
+               u = (unsigned int)-i;\r
+       }\r
+\r
+       s = print_buf + PRINT_BUF_LEN-1;\r
+       *s = '\0';\r
+\r
+       while (u) {\r
+               t = (unsigned int)u % b;\r
+               if( t >= 10 )\r
+                       t += letbase - '0' - 10;\r
+               *--s = (char)(t + '0');\r
+               u /= b;\r
+       }\r
+\r
+       if (neg) {\r
+               if( width && (pad & PAD_ZERO) ) {\r
+                       printchar (out, '-');\r
+                       ++pc;\r
+                       --width;\r
+               }\r
+               else {\r
+                       *--s = '-';\r
+               }\r
+       }\r
+\r
+       return pc + prints (out, s, width, pad);\r
+}\r
+\r
+static int print( char **out, const char *format, va_list args )\r
+{\r
+       register int width, pad;\r
+       register int pc = 0;\r
+       char scr[2];\r
+\r
+       for (; *format != 0; ++format) {\r
+               if (*format == '%') {\r
+                       ++format;\r
+                       width = pad = 0;\r
+                       if (*format == '\0') break;\r
+                       if (*format == '%') goto out;\r
+                       if (*format == '-') {\r
+                               ++format;\r
+                               pad = PAD_RIGHT;\r
+                       }\r
+                       while (*format == '0') {\r
+                               ++format;\r
+                               pad |= PAD_ZERO;\r
+                       }\r
+                       for ( ; *format >= '0' && *format <= '9'; ++format) {\r
+                               width *= 10;\r
+                               width += *format - '0';\r
+                       }\r
+                       if( *format == 's' ) {\r
+                               register char *s = (char *)va_arg( args, int );\r
+                               pc += prints (out, s?s:"(null)", width, pad);\r
+                               continue;\r
+                       }\r
+                       if( *format == 'd' || *format == 'i' ) {\r
+                               pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');\r
+                               continue;\r
+                       }\r
+                       if( *format == 'x' ) {\r
+                               pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');\r
+                               continue;\r
+                       }\r
+                       if( *format == 'X' ) {\r
+                               pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');\r
+                               continue;\r
+                       }\r
+                       if( *format == 'u' ) {\r
+                               pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');\r
+                               continue;\r
+                       }\r
+                       if( *format == 'c' ) {\r
+                               /* char are converted to int then pushed on the stack */\r
+                               scr[0] = (char)va_arg( args, int );\r
+                               scr[1] = '\0';\r
+                               pc += prints (out, scr, width, pad);\r
+                               continue;\r
+                       }\r
+               }\r
+               else {\r
+               out:\r
+                       printchar (out, *format);\r
+                       ++pc;\r
+               }\r
+       }\r
+       if (out) **out = '\0';\r
+       va_end( args );\r
+       return pc;\r
+}\r
+\r
+int printf(const char *format, ...)\r
+{\r
+       va_list args;\r
+\r
+       va_start( args, format );\r
+       return print( 0, format, args );\r
+}\r
+\r
+int sprintf(char *out, const char *format, ...)\r
+{\r
+       va_list args;\r
+\r
+       va_start( args, format );\r
+       return print( &out, format, args );\r
+}\r
+\r
+\r
+int snprintf( char *buf, unsigned int count, const char *format, ... )\r
+{\r
+       va_list args;\r
+\r
+       ( void ) count;\r
+\r
+       va_start( args, format );\r
+       return print( &buf, format, args );\r
+}\r
+\r
+#ifdef TEST_PRINTF\r
+int main(void)\r
+{\r
+       char *ptr = "Hello world!";\r
+       char *np = 0;\r
+       int i = 5;\r
+       unsigned int bs = sizeof(int)*8;\r
+       int mi;\r
+       char buf[80];\r
+\r
+       mi = (1 << (bs-1)) + 1;\r
+       printf("%s\n", ptr);\r
+       printf("printf test\n");\r
+       printf("%s is null pointer\n", np);\r
+       printf("%d = 5\n", i);\r
+       printf("%d = - max int\n", mi);\r
+       printf("char %c = 'a'\n", 'a');\r
+       printf("hex %x = ff\n", 0xff);\r
+       printf("hex %02x = 00\n", 0);\r
+       printf("signed %d = unsigned %u = hex %x\n", -3, -3, -3);\r
+       printf("%d %s(s)%", 0, "message");\r
+       printf("\n");\r
+       printf("%d %s(s) with %%\n", 0, "message");\r
+       sprintf(buf, "justif: \"%-10s\"\n", "left"); printf("%s", buf);\r
+       sprintf(buf, "justif: \"%10s\"\n", "right"); printf("%s", buf);\r
+       sprintf(buf, " 3: %04d zero padded\n", 3); printf("%s", buf);\r
+       sprintf(buf, " 3: %-4d left justif.\n", 3); printf("%s", buf);\r
+       sprintf(buf, " 3: %4d right justif.\n", 3); printf("%s", buf);\r
+       sprintf(buf, "-3: %04d zero padded\n", -3); printf("%s", buf);\r
+       sprintf(buf, "-3: %-4d left justif.\n", -3); printf("%s", buf);\r
+       sprintf(buf, "-3: %4d right justif.\n", -3); printf("%s", buf);\r
+\r
+       return 0;\r
+}\r
+\r
+/*\r
+ * if you compile this file with\r
+ *   gcc -Wall $(YOUR_C_OPTIONS) -DTEST_PRINTF -c printf.c\r
+ * you will get a normal warning:\r
+ *   printf.c:214: warning: spurious trailing `%' in format\r
+ * this line is testing an invalid % at the end of the format string.\r
+ *\r
+ * this should display (on 32bit int machine) :\r
+ *\r
+ * Hello world!\r
+ * printf test\r
+ * (null) is null pointer\r
+ * 5 = 5\r
+ * -2147483647 = - max int\r
+ * char a = 'a'\r
+ * hex ff = ff\r
+ * hex 00 = 00\r
+ * signed -3 = unsigned 4294967293 = hex fffffffd\r
+ * 0 message(s)\r
+ * 0 message(s) with %\r
+ * justif: "left      "\r
+ * justif: "     right"\r
+ *  3: 0003 zero padded\r
+ *  3: 3    left justif.\r
+ *  3:    3 right justif.\r
+ * -3: -003 zero padded\r
+ * -3: -3   left justif.\r
+ * -3:   -3 right justif.\r
+ */\r
+\r
+#endif\r
+\r
+\r
+/* To keep linker happy. */\r
+int    write( int i, char* c, int n)\r
+{\r
+       (void)i;\r
+       (void)n;\r
+       (void)c;\r
+       return 0;\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/trcConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/trcConfig.h
new file mode 100644 (file)
index 0000000..d5b1f9b
--- /dev/null
@@ -0,0 +1,446 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcConfig.h\r
+ *\r
+ * Configuration parameters for the trace recorder library. Before using the \r
+ * trace recorder library, please check that the default settings are \r
+ * appropriate for your system, and if necessary adjust these. Most likely, you \r
+ * will need to adjust the NTask, NISR, NQueue, NMutex and NSemaphore values to \r
+ * reflect the number of such objects in your system. These may be \r
+ * overapproximated, although larger values values implies more RAM usage.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCCONFIG_H\r
+#define TRCCONFIG_H\r
+\r
+/*******************************************************************************\r
+ * CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the event buffer, i.e., the number of records\r
+ * it may store. Each registered event typically use one record (4 byte), but\r
+ * vTracePrintF may use multiple records depending on the number of data args.\r
+ ******************************************************************************/\r
+\r
+    #define EVENT_BUFFER_SIZE 10000 /* Adjust wrt. to available RAM */\r
+\r
+/*******************************************************************************\r
+ * SYMBOL_TABLE_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the symbol table, in bytes. This symbol table \r
+ * stores User Events labels and names of deleted tasks, queues, or other kernel\r
+ * objects. Note that the names of active objects not stored here but in the \r
+ * Object Table. Thus, if you don't use User Events or delete any kernel \r
+ * objects you set this to zero (0) to minimize RAM usage.\r
+ ******************************************************************************/\r
+#define SYMBOL_TABLE_SIZE 1000\r
+\r
+/*******************************************************************************\r
+ * NTask, NISR, NQueue, NSemaphore, NMutex\r
+ *\r
+ * A group of Macros which should be defined as an integer value of zero (0) \r
+ * or larger.\r
+ *\r
+ * This defines the capacity of the Object Property Table - the maximum number\r
+ * of objects active at any given point within each object class.\r
+ * \r
+ * NOTE: In case objects are deleted and created during runtime, this setting\r
+ * does not limit the total amount of objects, only the number of concurrently\r
+ * active objects. \r
+ *\r
+ * Using too small values will give an error message through the vTraceError\r
+ * routine, which makes the error message appear when opening the trace data\r
+ * in FreeRTOS+Trace. If you are using the recorder status monitor task,\r
+ * any error messages are displayed in console prints, assuming that the\r
+ * print macro has been defined properly (vConsolePrintMessage). \r
+ *\r
+ * It can be wise to start with very large values for these constants, \r
+ * unless you are very confident on these numbers. Then do a recording and\r
+ * check the actual usage in FreeRTOS+Trace. This is shown by selecting\r
+ * View -> Trace Details -> Resource Usage -> Object Table\r
+ * \r
+ * NOTE 2: Remember to account for all tasks created by FreeRTOS, such as the \r
+ * IDLE task, the FreeRTOS timer task, and any tasks created by other 3rd party \r
+ * software components, such as communication stacks. The recorder also has an \r
+ * optional monitor task to account for, if this is used.\r
+ * Moreover, one task slot is used to indicate "(startup)", i.e., a fictive \r
+ * task that represent the time before the FreeRTOS scheduler starts. \r
+ * NTask should thus be at least 2-3 slots larger than your application task count.\r
+ *\r
+ * NOTE 3: The FreeRTOS timer task creates a Queue, that should be accounted \r
+ * for in NQueue.\r
+ ******************************************************************************/\r
+#define NTask             15\r
+#define NISR              4\r
+#define NQueue            10\r
+#define NSemaphore        10\r
+#define NMutex            5\r
+\r
+/* Maximum object name length for each class (includes zero termination) */\r
+#define NameLenTask       configMAX_TASK_NAME_LEN\r
+#define NameLenISR        10\r
+#define NameLenQueue      15\r
+#define NameLenSemaphore  15\r
+#define NameLenMutex      15\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION\r
+ *\r
+ * Macro which should be defined as a string.\r
+ *\r
+ * This string is stored in the trace and displayed in FreeRTOS+Trace. Can be\r
+ * used to store, e.g., system version or build date. This is also used to store\r
+ * internal error messages from the recorder, which if occurs overwrites the\r
+ * value defined here. This may be maximum 256 chars.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION "FreeRTOS+Trace Demo"\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION_MAX_LENGTH\r
+ *\r
+ * The maximum length (including zero termination) for the TRACE_DESCRIPTION\r
+ * string. Since this string also is used for internal error messages from the \r
+ * recorder do not make it too short, as this may truncate the error messages.\r
+ * Default is 80. \r
+ * Maximum allowed length is 256 - the trace will fail to load if longer.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION_MAX_LENGTH 80\r
+\r
+\r
+/******************************************************************************\r
+ * TRACE_DATA_ALLOCATION\r
+ *\r
+ * This defines how to allocate the recorder data structure, i.e., using a \r
+ * static declaration or using a dynamic allocation in runtime (malloc).\r
+ *\r
+ * Should be one of these two options:\r
+ * - TRACE_DATA_ALLOCATION_STATIC (default)\r
+ * - TRACE_DATA_ALLOCATION_DYNAMIC\r
+ *\r
+ * Using static allocation has the benefits of compile-time errors if the buffer \r
+ * is too large (too large constants in trcConfig.h) and no need to call the \r
+ * initialization routine (xTraceInitTraceData).\r
+ *\r
+ * Using dynamic allocation may give more flexibility in some cases.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_DATA_ALLOCATION TRACE_DATA_ALLOCATION_STATIC\r
+\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION REGARDING WHAT CODE/FEATURES TO INCLUDE\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * INCLUDE_FLOAT_SUPPORT\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), all references to floating point values are removed,\r
+ * in case floating point values are not supported by the platform used.\r
+ * Floating point values are only used in vTracePrintF and its subroutines, to \r
+ * store float (%f) or double (%lf) argments. \r
+ *\r
+ * Note: vTracePrintF can still be used with integer and string arguments in\r
+ * either case.\r
+ *****************************************************************************/\r
+#define INCLUDE_FLOAT_SUPPORT 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_USER_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0) the code for creating User Events is excluded to\r
+ * reduce code size. User Events are application-generated events, like \r
+ * "printf" but for the trace log instead of console output. User Events are \r
+ * much faster than a printf and can therefore be used in timing critical code.\r
+ * See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
+ * \r
+ * Note that FreeRTOS+Trace Standard Edition or Professional Edition is required\r
+ * for User Events, they are not displayed in FreeRTOS+Trace Free Edition.\r
+ *****************************************************************************/\r
+#define INCLUDE_USER_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_READY_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Ready events is \r
+ * excluded. Note, this will make it impossible to calculate the correct\r
+ * response times.\r
+ *****************************************************************************/\r
+#define INCLUDE_READY_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_ISR_TRACING\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Interrupt Service Routines is \r
+ * excluded to reduce code size. Note, recording ISRs require that you insert\r
+ * calls to vTraceStoreISRBegin and vTraceStoreISREnd in your interrupt handlers.\r
+ * There is no automatic recording of ISRs like for task scheduling, since \r
+ * FreeRTOS does not have a central interrupt dispatcher.\r
+ *****************************************************************************/\r
+#define INCLUDE_ISR_TRACING 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_OBJECT_DELETE\r
+ * \r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * This must be enabled (1) if tasks, queues or other \r
+ * traced kernel objects are deleted at runtime, e.g., using vTaskDelete or \r
+ * vQueueDelete. If no deletes are made, this can be set to 0 in order to\r
+ * exclude the delete-handling code. \r
+ *****************************************************************************/\r
+#ifdef INCLUDE_OBJECT_DELETE\r
+#undef INCLUDE_OBJECT_DELETE\r
+#endif\r
+\r
+#define INCLUDE_OBJECT_DELETE 1\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION RELATED TO BEHAVIOR\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * RECORDER_STORE_MODE\r
+ *\r
+ * Macro which should be defined as one of:\r
+ * - STORE_MODE_RING_BUFFER\r
+ * - STORE_MODE_STOP_WHEN_FULL\r
+ * Default is STORE_MODE_RING_BUFFER.\r
+ *\r
+ * With RECORDER_STORE_MODE set to STORE_MODE_RING_BUFFER, the events are stored\r
+ * in a ring buffer, i.e., where the oldest events are overwritten when the\r
+ * buffer becomes full. This allows you to get the last events leading up to an\r
+ * interesting state, e.g., an error, without having a large trace buffer for\r
+ * string the whole run since startup. In this mode, the recorder can run\r
+ * "forever" as the buffer never gets full, i.e., in the sense that it always\r
+ * has room for more events.\r
+ *\r
+ * To fetch the trace in mode STORE_MODE_RING_BUFFER, you need to first halt the\r
+ * system using your debugger and then do a RAM dump, or to explicitly stop the\r
+ * recorder using vTraceStop() and then store/upload the trace data using a\r
+ * FreeRTOS task that you need to provide yourself. The trace data is found in\r
+ * the struct RecorderData, initialized in trcBase.c.\r
+ *\r
+ * Note that, if you upload the trace using a RAM dump, i.e., when the system is \r
+ * halted on a breakpoint or by a debugger command, there is no need to stop the \r
+ * recorder first.\r
+ *\r
+ * When RECORDER_STORE_MODE is STORE_MODE_STOP_WHEN_FULL, the recording is\r
+ * stopped when the buffer becomes full. When the recorder stops itself this way\r
+ * vTracePortEnd() is called which allows for custom actions, such as triggering\r
+ * a task that stores the trace buffer, i.e., in case taking a RAM dump\r
+ * using an on-chip debugger is not possible. In the Windows port, vTracePortEnd\r
+ * saves the trace to file directly, but this is not recommended in a real-time\r
+ * system since the scheduler is blocked during the processing of vTracePortEnd.\r
+ *****************************************************************************/\r
+#ifndef WIN32\r
+#define RECORDER_STORE_MODE STORE_MODE_RING_BUFFER\r
+#else\r
+/* Default in the Win32 demo */\r
+#define RECORDER_STORE_MODE STORE_MODE_STOP_WHEN_FULL\r
+#endif\r
+\r
+/******************************************************************************\r
+ * STOP_AFTER_N_EVENTS\r
+ *\r
+ * Macro which should be defined as an integer value, or not defined.\r
+ * Default is -1\r
+ *\r
+ * STOP_AFTER_N_EVENTS is intended for tests of the ring buffer mode (when\r
+ * RECORDER_STORE_MODE is STORE_MODE_RING_BUFFER). It stops the recording when\r
+ * the specified number of events has been observed. This value can be larger\r
+ * than the buffer size, to allow for test of the "wrapping around" that occurs\r
+ * in ring buffer mode . A negative value (or no definition of this macro)\r
+ * disables this feature.\r
+ *****************************************************************************/\r
+#define STOP_AFTER_N_EVENTS -1\r
+\r
+/******************************************************************************\r
+ * USE_IMPLICIT_IFE_RULES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * ### Instance Finish Events (IFE) ###\r
+ *\r
+ * For tasks with "infinite" main loops (non-terminating tasks), the concept\r
+ * of a task instance has no clear definition, it is an application-specific\r
+ * thing. FreeRTOS+Trace allows you to define Instance Finish Events (IFEs),\r
+ * which marks the point in a cyclic task when the "task instance" ends.\r
+ * The IFE is a blocking kernel call, typically in the main loop of a task\r
+ * which typically reads a message queue, waits for a semaphore or performs\r
+ * an explicit delay.\r
+ *\r
+ * If USE_IMPLICIT_IFE_RULES is one (1), the following FreeRTOS kernel calls\r
+ * are considered by default to be IFEs (Implicit IFEs):\r
+ *  - vTaskDelay\r
+ *  - vTaskDelayUntil\r
+ *  - vTaskSuspend\r
+ *  - xQueueReceive (blocking cases only)\r
+ *  - xSemaphoreTake (blocking cases only)\r
+ *\r
+ * However, Implicit IFEs only applies to blocking kernel calls. If an\r
+ * xQueueReceive reads a message without blocking, it does not create a new\r
+ * instance since no blocking occurred.\r
+ *\r
+ * Moreover, the actual IFE might sometimes be another blocking call such as\r
+ * xQueueSend or xSemaphoreGive. We therefore allow for user-defined\r
+ * Explicit IFEs by calling\r
+ *\r
+ *     vTraceTaskInstanceIsFinished()\r
+ *\r
+ * right before the kernel call considered as IFE. This does not create an\r
+ * additional event but instead stores the service code and object handle\r
+ * of the IFE call as properties of the task.\r
+ *\r
+ * If using Explicit IFEs and the task also calls an Implicit IFE like\r
+ * vTaskDelay, this may result in additional incorrect task instances.\r
+ * This is solved by disabling the Implicit IFEs for the task, by adding\r
+ * a call to\r
+ * \r
+ *     vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+ * \r
+ * in the very beginning of that task. This allows you to combine Explicit IFEs\r
+ * for some tasks with Implicit IFEs for the rest of the tasks, if\r
+ * USE_IMPLICIT_IFE_RULES is 1.\r
+ *\r
+ * By setting USE_IMPLICIT_IFE_RULES to zero (0), the implicit IFEs are disabled\r
+ * for all tasks. Tasks will then be considered to have a single instance only, \r
+ * covering all execution fragments, unless you define an explicit IFE in each\r
+ * task by calling vTraceTaskInstanceIsFinished before the blocking call.\r
+ *****************************************************************************/\r
+#define USE_IMPLICIT_IFE_RULES 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_SAVE_TO_FILE\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If enabled (1), the recorder will include code for saving the trace\r
+ * to a local file system.\r
+ ******************************************************************************/\r
+#ifdef WIN32\r
+    #define INCLUDE_SAVE_TO_FILE 1\r
+#else\r
+    #define INCLUDE_SAVE_TO_FILE 0\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PRIORITY\r
+ *\r
+ * Macro which sets the priority of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is tskIDLE_PRIORITY + 1\r
+ * Note that if your system constantly has a high CPU load from high-priority \r
+ * tasks, this might not be get a chance to execute.\r
+ * \r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_PRIORITY (tskIDLE_PRIORITY + 1)\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_STACKSIZE\r
+ *\r
+ * Macro which sets the stack size of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is intentionally \r
+ * excluded from the demo trace.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_STACKSIZE 500\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PERIOD\r
+ *\r
+ * Macro which sets the period of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is 1000 FreeRTOS ticks (typically 1 second). On the Windows port, a \r
+ * lower value is suggested since the Windows port runs very slowly, often 20-40\r
+ * times slower than the simulated FreeRTOS time.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#ifdef WIN32\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 100\r
+#else\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TEAM_LICENSE_CODE\r
+ *\r
+ * Macro which defines a string - the team license code.\r
+ * If no team license is available, this should be an empty string "".\r
+ * This should be maximum 32 chars, including zero-termination.\r
+ *****************************************************************************/\r
+#define TEAM_LICENSE_CODE ""\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SelectServer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SelectServer.c
new file mode 100644 (file)
index 0000000..2cd31d6
--- /dev/null
@@ -0,0 +1,258 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems, who sell the code with commercial support,\r
+    indemnification and middleware, under the OpenRTOS brand.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/*_RB_ See http://TBD for a description of these tasks. */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+#define selTINY_DELAY                          ( ( portTickType ) 2 )\r
+#define selNUMBER_OF_SOCKETS           ( 3 )\r
+#define selSELECT_QUEUE_SIZE           ( selNUMBER_OF_SOCKETS * 2 )\r
+\r
+/*\r
+ * Sends data to multiple different sockets.\r
+ */\r
+static void prvMultipleSocketTxTask( void *pvParameters );\r
+\r
+/*\r
+ * Uses the FreeRTOS_select() API function to receive from multiple sockets.\r
+ */\r
+static void prvMultipleSocketRxTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+static xSocket_t xRxSockets[ selNUMBER_OF_SOCKETS ] = { 0 };\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, unsigned portBASE_TYPE uxPriority )\r
+{\r
+       /* Create task that sends to multiple sockets, and the task that uses the\r
+       FreeRTOS_select() function to receive from multiple sockets.  The first\r
+       port number to use is passed into both tasks using the task's parameter.\r
+       Other port numbers are consecutive from the first. */\r
+       xTaskCreate( prvMultipleSocketTxTask, ( const signed char * const ) "MultiTx", usStackSize, ( void * ) ulFirstPortNumber, uxPriority, NULL );\r
+       xTaskCreate( prvMultipleSocketRxTask, ( const signed char * const ) "MultiRx", usStackSize, ( void * ) ulFirstPortNumber, uxPriority, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvMultipleSocketRxTask( void *pvParameters )\r
+{\r
+xSocketSet_t xFD_Set;\r
+xSocket_t xSocket;\r
+struct freertos_sockaddr xAddress;\r
+uint32_t xClientLength = sizeof( struct freertos_sockaddr ), ulFirstRxPortNumber, x;\r
+uint32_t ulReceivedValue = 0, ulExpectedValue = 0UL, ulReceivedCount[ selNUMBER_OF_SOCKETS ] = { 0 };\r
+int32_t lBytes;\r
+const portTickType xRxBlockTime = 0;\r
+\r
+       /* The number of the port the first Rx socket will be bound to is passed in\r
+       as the task parameter.  Other port numbers used are consecutive from this. */\r
+       ulFirstRxPortNumber = ( uint32_t ) pvParameters;\r
+\r
+       /* Create the set of sockets that will be passed into FreeRTOS_select(). */\r
+       xFD_Set = FreeRTOS_CreateSocketSet( selSELECT_QUEUE_SIZE );\r
+\r
+       for( x = 0; x < selNUMBER_OF_SOCKETS; x++ )\r
+       {\r
+               /* Create the next Rx socket. */\r
+               xRxSockets[ x ] = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( xRxSockets[ x ] );\r
+\r
+               /* Bind to the next port number. */\r
+               xAddress.sin_port = FreeRTOS_htons( ( uint16_t ) ( ulFirstRxPortNumber + x ) );\r
+               FreeRTOS_bind( xRxSockets[ x ], &xAddress, sizeof( struct freertos_sockaddr ) );\r
+\r
+               /* There should always be data available on the socket returned from\r
+               FreeRTOS_select() so blocking on a read should not be necessary. */\r
+               FreeRTOS_setsockopt( xRxSockets[ x ], 0, FREERTOS_SO_RCVTIMEO, &xRxBlockTime, sizeof( xRxBlockTime ) );\r
+\r
+               /* Add the created socket to the set. */\r
+               FreeRTOS_FD_SET( xRxSockets[ x ], xFD_Set );\r
+       }\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait for a socket from the set to become available for reading. */\r
+               xSocket = FreeRTOS_select( xFD_Set, portMAX_DELAY );\r
+\r
+               /* xSocket should never be NULL because FreeRTOS_select() was called\r
+               with an indefinite delay (assuming INCLUDE_vTaskSuspend is set to 1). */\r
+               configASSERT( xSocket );\r
+\r
+               lBytes = FreeRTOS_recvfrom( xSocket, &( ulReceivedValue ), sizeof( uint32_t ), 0, &xAddress, &xClientLength );\r
+\r
+               /* It is possible that the first value received will not be zero\r
+               because the first few transmitted packets may have been dropped to\r
+               send an ARP and then wait the ARP reply. */\r
+               if( ulExpectedValue == 0 )\r
+               {\r
+                       if( ulExpectedValue != ulReceivedValue )\r
+                       {\r
+                               /* Correct for packets lost to ARP traffic. */\r
+                               ulExpectedValue = ulReceivedValue;\r
+                       }\r
+               }\r
+\r
+               /* Data should always be available even though the block time was set\r
+               to zero because the socket was returned from FreeRTOS_select(). */\r
+               configASSERT( lBytes == 4 );\r
+               configASSERT( ulReceivedValue == ulExpectedValue );\r
+\r
+               ulExpectedValue++;\r
+\r
+               /* Keep a record of the number of times each socket has been used so it\r
+               can be verified (using the debugger) that they all get used. */\r
+               for( x= 0; x < selNUMBER_OF_SOCKETS; x++ )\r
+               {\r
+                       if( xSocket == xRxSockets[ x ] )\r
+                       {\r
+                               ( ulReceivedCount[ x ] )++;\r
+                               break;\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvMultipleSocketTxTask( void *pvParameters )\r
+{\r
+uint32_t ulTxValue = 0;\r
+struct freertos_sockaddr xDestinationAddress;\r
+uint32_t ulIPAddress, ulFirstDestinationPortNumber, xPortNumber;\r
+xSocket_t xTxSocket;\r
+const portTickType xShortDelay = 100 / portTICK_RATE_MS, xSendBlockTime = 500 / portTICK_RATE_MS;\r
+\r
+       srand( ( unsigned int ) &xPortNumber );\r
+\r
+       /* The first destination port number is passed in as the task parameter.\r
+       Other destination port numbers used are consecutive from this. */\r
+       ulFirstDestinationPortNumber = ( uint32_t ) pvParameters;\r
+\r
+       /* Create the socket used to send to the sockets created by the Rx task.\r
+       Let the IP stack select a port to bind to. */\r
+       xTxSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+       FreeRTOS_bind( xTxSocket, NULL, sizeof( struct freertos_sockaddr ) );\r
+\r
+       /* The Rx and Tx tasks execute at the same priority so it is possible that\r
+       the Tx task will fill up the send queue - set a Tx block time to ensure\r
+       flow control is managed if this happens. */\r
+       FreeRTOS_setsockopt( xTxSocket, 0, FREERTOS_SO_SNDTIMEO, &xSendBlockTime, sizeof( xSendBlockTime ) );\r
+\r
+       /* It is assumed that this task is not created until the network is up,\r
+       so the IP address can be obtained immediately.  Store the IP address being\r
+       used in ulIPAddress.  This is done so the socket can send to a different\r
+       port on the same IP address. */\r
+       FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );\r
+\r
+       /* This test sends to itself, so data sent from here is received by a server\r
+       socket on the same IP address.  Setup the freertos_sockaddr structure with\r
+       this nodes IP address. */\r
+       xDestinationAddress.sin_addr = ulIPAddress;\r
+\r
+       /* Block for a short time to ensure the task implemented by the\r
+       prvMultipleSocketRxTask() function has finished creating the Rx sockets. */\r
+       vTaskDelay( xShortDelay );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Pseudo randomly select the destination port number from the range of\r
+               valid destination port numbers. */\r
+               xPortNumber = rand() % selNUMBER_OF_SOCKETS;\r
+               xDestinationAddress.sin_port = ( uint16_t ) ( ulFirstDestinationPortNumber + xPortNumber );\r
+               xDestinationAddress.sin_port = FreeRTOS_htons( xDestinationAddress.sin_port );\r
+\r
+               /* Send an incrementing value. */\r
+               FreeRTOS_sendto( xTxSocket, &ulTxValue, sizeof( ulTxValue ), 0, &xDestinationAddress, sizeof( xDestinationAddress ) );\r
+               ulTxValue++;\r
+\r
+               /* Delay here because in the Windows simulator the MAC interrupt\r
+               simulator delays, so network trafic cannot be received any faster\r
+               than this. */\r
+               vTaskDelay( configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY );\r
+       }\r
+}\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SimpleClientAndServer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/SimpleClientAndServer.c
new file mode 100644 (file)
index 0000000..43d1f1a
--- /dev/null
@@ -0,0 +1,406 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/* \r
+ * Creates two transmitting tasks and two receiving tasks.  The transmitting\r
+ * tasks send values that are received by the receiving tasks.  One set of tasks\r
+ * uses the standard API.  The other set of tasks uses the zero copy API.\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+#define simpTINY_DELAY ( ( portTickType ) 2 )\r
+\r
+/*\r
+ * Uses a socket to send data without using the zero copy option.\r
+ * prvSimpleServerTask() will receive the data.\r
+ */\r
+static void prvSimpleClientTask( void *pvParameters );\r
+\r
+/*\r
+ * Uses a socket to receive the data sent by the prvSimpleClientTask() task.\r
+ * Does not use the zero copy option.\r
+ */\r
+static void prvSimpleServerTask( void *pvParameters );\r
+\r
+/*\r
+ * Uses a socket to send data using the zero copy option.\r
+ * prvSimpleZeroCopyServerTask() will receive the data.\r
+ */\r
+static void prvSimpleZeroCopyUDPClientTask( void *pvParameters );\r
+\r
+/*\r
+ * Uses a socket to receive the data sent by the prvSimpleZeroCopyUDPClientTask()\r
+ * task.  Uses the zero copy option.\r
+ */\r
+static void prvSimpleZeroCopyServerTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority )\r
+{\r
+       /* Create the client and server tasks that do not use the zero copy\r
+       interface. */\r
+       xTaskCreate( prvSimpleClientTask, "SimpCpyClnt", usStackSize, ( void * ) ulPort, uxPriority, NULL );\r
+       xTaskCreate( prvSimpleServerTask, "SimpCpySrv", usStackSize, ( void * ) ulPort, uxPriority + 1, NULL );\r
+\r
+       /* Create the client and server tasks that do use the zero copy interface. */\r
+       xTaskCreate( prvSimpleZeroCopyUDPClientTask, "SimpZCpyClnt", usStackSize, ( void * ) ( ulPort + 1 ), uxPriority, NULL );\r
+       xTaskCreate( prvSimpleZeroCopyServerTask, "SimpZCpySrv", usStackSize, ( void * ) ( ulPort + 1 ), uxPriority + 1, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSimpleClientTask( void *pvParameters )\r
+{\r
+xSocket_t xClientSocket;\r
+struct freertos_sockaddr xDestinationAddress;\r
+uint8_t cString[ 50 ];\r
+portBASE_TYPE lReturned;\r
+uint32_t ulCount = 0UL, ulIPAddress;\r
+const uint32_t ulLoopsPerSocket = 10UL;\r
+const portTickType x150ms = 150UL / portTICK_RATE_MS;\r
+\r
+       /* Remove compiler warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* It is assumed that this task is not created until the network is up,\r
+       so the IP address can be obtained immediately.  store the IP address being\r
+       used in ulIPAddress.  This is done so the socket can send to a different\r
+       port on the same IP address. */\r
+       FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );\r
+\r
+       /* This test sends to itself, so data sent from here is received by a server\r
+       socket on the same IP address.  Setup the freertos_sockaddr structure with\r
+       this nodes IP address, and the port number being sent to.  The strange\r
+       casting is to try and remove compiler warnings on 32 bit machines. */\r
+       xDestinationAddress.sin_addr = ulIPAddress;\r
+       xDestinationAddress.sin_port = ( uint16_t ) ( ( uint32_t ) pvParameters ) & 0xffffUL;\r
+       xDestinationAddress.sin_port = FreeRTOS_htons( xDestinationAddress.sin_port );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Create the socket. */\r
+               xClientSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( xClientSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+               /* The count is used to differentiate between different messages sent to\r
+               the server, and to break out of the do while loop below. */\r
+               ulCount = 0UL;\r
+\r
+               do\r
+               {\r
+                       /* Create the string that is sent to the server. */\r
+                       sprintf( ( char * ) cString, "Server received (not zero copy): Message number %lu\r\n", ulCount );\r
+\r
+                       /* Send the string to the socket.  ulFlags is set to 0, so the zero\r
+                       copy option is not selected.  That means the data from cString[] is\r
+                       copied into a network buffer inside FreeRTOS_sendto(), and cString[]\r
+                       can be reused as soon as FreeRTOS_sendto() has returned. */\r
+                       lReturned = FreeRTOS_sendto( xClientSocket, ( void * ) cString, strlen( ( const char * ) cString ), 0, &xDestinationAddress, sizeof( xDestinationAddress ) );\r
+\r
+                       ulCount++;\r
+\r
+               } while( ( lReturned != FREERTOS_SOCKET_ERROR ) && ( ulCount < ulLoopsPerSocket ) );\r
+\r
+               FreeRTOS_closesocket( xClientSocket );\r
+\r
+               /* A short delay to prevent the messages printed by the server task\r
+               scrolling off the screen too quickly, and to prevent reduce the network\r
+               loading. */\r
+               vTaskDelay( x150ms );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSimpleServerTask( void *pvParameters )\r
+{\r
+long lBytes;\r
+uint8_t cReceivedString[ 60 ];\r
+struct freertos_sockaddr xClient, xBindAddress;\r
+uint32_t xClientLength = sizeof( xClient );\r
+xSocket_t xListeningSocket;\r
+\r
+       /* Just to prevent compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Attempt to open the socket. */\r
+       xListeningSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+       configASSERT( xListeningSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+       /* This test receives data sent from a different port on the same IP\r
+       address.  Configure the freertos_sockaddr structure with the address being\r
+       bound to.  The strange casting is to try and remove     compiler warnings on 32\r
+       bit machines.  Note that this task is only created after the network is up,\r
+       so the IP address is valid here. */\r
+       xBindAddress.sin_port = ( uint16_t ) ( ( uint32_t ) pvParameters ) & 0xffffUL;\r
+       xBindAddress.sin_port = FreeRTOS_htons( xBindAddress.sin_port );\r
+\r
+       /* Bind the socket to the port that the client task will send to. */\r
+       FreeRTOS_bind( xListeningSocket, &xBindAddress, sizeof( xBindAddress ) );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Zero out the receive array so there is NULL at the end of the string\r
+               when it is printed out. */\r
+               memset( cReceivedString, 0x00, sizeof( cReceivedString ) );\r
+\r
+               /* Receive data on the socket.  ulFlags is zero, so the zero copy option\r
+               is not set and the received data is copied into the buffer pointed to by\r
+               cReceivedString.  By default the block time is portMAX_DELAY.\r
+               xClientLength is not actually used by FreeRTOS_recvfrom(), but is set\r
+               appropriately in case future versions do use it. */\r
+               lBytes = FreeRTOS_recvfrom( xListeningSocket, cReceivedString, sizeof( cReceivedString ), 0, &xClient, &xClientLength );\r
+\r
+               /* Print the received characters. */\r
+               if( lBytes > 0 )\r
+               {\r
+                       vOutputString( ( char * ) cReceivedString );\r
+               }\r
+\r
+               /* Error check. */\r
+               configASSERT( lBytes == ( portBASE_TYPE ) strlen( ( const char * ) cReceivedString ) );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSimpleZeroCopyUDPClientTask( void *pvParameters )\r
+{\r
+xSocket_t xClientSocket;\r
+uint8_t *pucUDPPayloadBuffer;\r
+struct freertos_sockaddr xDestinationAddress;\r
+portBASE_TYPE lReturned;\r
+uint32_t ulCount = 0UL, ulIPAddress;\r
+const uint32_t ulLoopsPerSocket = 10UL;\r
+const uint8_t *pucStringToSend = ( const uint8_t * ) "Server received (using zero copy): Message number ";\r
+const portTickType x150ms = 150UL / portTICK_RATE_MS;\r
+/* 15 is added to ensure the number, \r\n and terminating zero fit. */\r
+const size_t xStringLength = strlen( ( char * ) pucStringToSend ) + 15;\r
+\r
+       /* Remove compiler warning about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* It is assumed that this task is not created until the network is up,\r
+       so the IP address can be obtained immediately.  store the IP address being\r
+       used in ulIPAddress.  This is done so the socket can send to a different\r
+       port on the same IP address. */\r
+       FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );\r
+\r
+       /* This test sends to itself, so data sent from here is received by a server\r
+       socket on the same IP address.  Setup the freertos_sockaddr structure with\r
+       this nodes IP address, and the port number being sent to.  The strange\r
+       casting is to try and remove compiler warnings on 32 bit machines. */\r
+       xDestinationAddress.sin_addr = ulIPAddress;\r
+       xDestinationAddress.sin_port = ( uint16_t ) ( ( uint32_t ) pvParameters ) & 0xffffUL;\r
+       xDestinationAddress.sin_port = FreeRTOS_htons( xDestinationAddress.sin_port );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Create the socket. */\r
+               xClientSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( xClientSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+               /* The count is used to differentiate between different messages sent to\r
+               the server, and to break out of the do while loop below. */\r
+               ulCount = 0UL;\r
+\r
+               do\r
+               {\r
+                       /* This task is going to send using the zero copy interface.  The\r
+                       data being sent is therefore written directly into a buffer that is\r
+                       passed into, rather than copied into, the FreeRTOS_sendto()\r
+                       function.\r
+\r
+                       First obtain a buffer of adequate length from the IP stack into which\r
+                       the string will be written.  Although a max delay is used, the actual\r
+                       delay will be capped to ipconfigMAX_SEND_BLOCK_TIME_TICKS, hence\r
+                       the do while loop is used to ensure a buffer is obtained. */\r
+                       do\r
+                       {\r
+                       } while( ( pucUDPPayloadBuffer = ( uint8_t * ) FreeRTOS_GetUDPPayloadBuffer( xStringLength, portMAX_DELAY ) ) == NULL );\r
+\r
+                       /* A buffer was successfully obtained.  Create the string that is\r
+                       sent to the server.  First the string is filled with zeros as this will\r
+                       effectively be the null terminator when the string is received at the other\r
+                       end.  Note that the string is being written directly into the buffer\r
+                       obtained from the IP stack above. */\r
+                       memset( ( void * ) pucUDPPayloadBuffer, 0x00, xStringLength );\r
+                       sprintf( ( char * ) pucUDPPayloadBuffer, "%s%lu\r\n", ( char * ) pucStringToSend, ulCount );\r
+\r
+                       /* Pass the buffer into the send function.  ulFlags has the\r
+                       FREERTOS_ZERO_COPY bit set so the IP stack will take control of the\r
+                       buffer rather than copy data out of the buffer. */\r
+                       lReturned = FreeRTOS_sendto( xClientSocket,                             /* The socket being sent to. */\r
+                                                                               ( void * ) pucUDPPayloadBuffer, /* A pointer to the the data being sent. */\r
+                                                                               strlen( ( const char * ) pucUDPPayloadBuffer ) + 1, /* The length of the data being sent - including the string's null terminator. */\r
+                                                                               FREERTOS_ZERO_COPY,                     /* ulFlags with the FREERTOS_ZERO_COPY bit set. */\r
+                                                                               &xDestinationAddress,                   /* Where the data is being sent. */\r
+                                                                               sizeof( xDestinationAddress ) );\r
+\r
+                       if( lReturned == 0 )\r
+                       {\r
+                               /* The send operation failed, so this task is still responsible\r
+                               for the buffer obtained from the IP stack.  To ensure the buffer\r
+                               is not lost it must either be used again, or, as in this case,\r
+                               returned to the IP stack using FreeRTOS_ReleaseUDPPayloadBuffer().\r
+                               pucUDPPayloadBuffer can be safely re-used after this call. */\r
+                               FreeRTOS_ReleaseUDPPayloadBuffer( ( void * ) pucUDPPayloadBuffer );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The send was successful so the IP stack is now managing the\r
+                               buffer pointed to by pucUDPPayloadBuffer, and the IP stack will\r
+                               return the buffer once it has been sent.  pucUDPPayloadBuffer can\r
+                               be safely re-used. */\r
+                       }\r
+\r
+                       ulCount++;\r
+\r
+               } while( ( lReturned != FREERTOS_SOCKET_ERROR ) && ( ulCount < ulLoopsPerSocket ) );\r
+\r
+               FreeRTOS_closesocket( xClientSocket );\r
+\r
+               /* A short delay to prevent the messages scrolling off the screen too\r
+               quickly. */\r
+               vTaskDelay( x150ms );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSimpleZeroCopyServerTask( void *pvParameters )\r
+{\r
+int32_t lBytes;\r
+uint8_t *pucUDPPayloadBuffer;\r
+struct freertos_sockaddr xClient, xBindAddress;\r
+uint32_t xClientLength = sizeof( xClient ), ulIPAddress;\r
+xSocket_t xListeningSocket;\r
+\r
+       /* Just to prevent compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Attempt to open the socket. */\r
+       xListeningSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+       configASSERT( xListeningSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+       /* This test receives data sent from a different port on the same IP address.\r
+       Obtain the nodes IP address.  Configure the freertos_sockaddr structure with\r
+       the address being bound to.  The strange casting is to try and remove\r
+       compiler warnings on 32 bit machines.  Note that this task is only created\r
+       after the network is up, so the IP address is valid here. */\r
+       FreeRTOS_GetAddressConfiguration( &ulIPAddress, NULL, NULL, NULL );\r
+       xBindAddress.sin_addr = ulIPAddress;\r
+       xBindAddress.sin_port = ( uint16_t ) ( ( uint32_t ) pvParameters ) & 0xffffUL;\r
+       xBindAddress.sin_port = FreeRTOS_htons( xBindAddress.sin_port );\r
+\r
+       /* Bind the socket to the port that the client task will send to. */\r
+       FreeRTOS_bind( xListeningSocket, &xBindAddress, sizeof( xBindAddress ) );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Receive data on the socket.  ulFlags has the zero copy bit set\r
+               (FREERTOS_ZERO_COPY) indicating to the stack that a reference to the\r
+               received data should be passed out to this task using the second\r
+               parameter to the FreeRTOS_recvfrom() call.  When this is done the\r
+               IP stack is no longer responsible for releasing the buffer, and\r
+               the task *must* return the buffer to the stack when it is no longer\r
+               needed.  By default the block time is portMAX_DELAY. */\r
+               lBytes = FreeRTOS_recvfrom( xListeningSocket, ( void * ) &pucUDPPayloadBuffer, 0, FREERTOS_ZERO_COPY, &xClient, &xClientLength );\r
+\r
+               /* It is expected to receive one more byte than the string length as\r
+               the NULL terminator is also transmitted. */\r
+               configASSERT( lBytes == ( ( portBASE_TYPE ) strlen( ( const char * ) pucUDPPayloadBuffer ) + 1 ) );\r
+\r
+               /* Print the received characters. */\r
+               if( lBytes > 0 )\r
+               {\r
+                       vOutputString( ( char * ) pucUDPPayloadBuffer );\r
+               }\r
+\r
+               if( lBytes >= 0 )\r
+               {\r
+                       /* The buffer *must* be freed once it is no longer needed. */\r
+                       FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );\r
+               }\r
+       }\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/UDPCommandServer.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/UDPCommandServer.c
new file mode 100644 (file)
index 0000000..0b7952f
--- /dev/null
@@ -0,0 +1,255 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+CLI includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+\r
+/* Demo app includes. */\r
+#include "UDPCommandInterpreter.h"\r
+\r
+/* Dimensions the buffer into which input characters are placed. */\r
+#define cmdMAX_INPUT_SIZE      60\r
+\r
+/* Dimensions the buffer into which string outputs can be placed. */\r
+#define cmdMAX_OUTPUT_SIZE     1024\r
+\r
+/* Dimensions the buffer passed to the recvfrom() call. */\r
+#define cmdSOCKET_INPUT_BUFFER_SIZE 60\r
+\r
+/*\r
+ * The task that runs FreeRTOS+CLI.\r
+ */\r
+void vUDPCommandInterpreterTask( void *pvParameters );\r
+\r
+/*\r
+ * Open and configure the UDP socket.\r
+ */\r
+static xSocket_t prvOpenUDPServerSocket( uint16_t usPort );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority )\r
+{\r
+       xTaskCreate( vUDPCommandInterpreterTask, ( signed char * ) "CLI", usStackSize, ( void * ) ulPort, uxPriority, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* \r
+ * Task that provides the input and output for the FreeRTOS+CLI command\r
+ * interpreter.  In this case a UDP port is used.  See the URL in the comments\r
+ * within main.c for the location of the online documentation.\r
+ */\r
+void vUDPCommandInterpreterTask( void *pvParameters )\r
+{\r
+long lBytes, lByte;\r
+signed char cInChar, cInputIndex = 0;\r
+static signed char cInputString[ cmdMAX_INPUT_SIZE ], cOutputString[ cmdMAX_OUTPUT_SIZE ], cLocalBuffer[ cmdSOCKET_INPUT_BUFFER_SIZE ];\r
+portBASE_TYPE xMoreDataToFollow;\r
+struct freertos_sockaddr xClient;\r
+socklen_t xClientAddressLength = 0; /* This is required as a parameter to maintain the sendto() Berkeley sockets API - but it is not actually used so can take any value. */\r
+xSocket_t xSocket;\r
+extern const uint8_t ucIPAddress[ 4 ];\r
+extern const uint8_t ucMACAddress[ 6 ];\r
+\r
+       /* Just to prevent compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Attempt to open the socket.  The port number is passed in the task\r
+       parameter.  The strange casting is to remove compiler warnings on 32-bit\r
+       machines. */\r
+       xSocket = prvOpenUDPServerSocket( ( uint16_t ) ( ( uint32_t ) pvParameters ) & 0xffffUL );\r
+\r
+       if( xSocket != FREERTOS_INVALID_SOCKET )\r
+       {\r
+               for( ;; )\r
+               {\r
+                       /* Wait for incoming data on the opened socket. */\r
+                       lBytes = FreeRTOS_recvfrom( xSocket, ( void * ) cLocalBuffer, sizeof( cLocalBuffer ), 0, &xClient, &xClientAddressLength );\r
+\r
+                       if( lBytes != FREERTOS_SOCKET_ERROR )\r
+                       {\r
+                               /* Process each received byte in turn. */\r
+                               lByte = 0;\r
+                               while( lByte < lBytes )\r
+                               {\r
+                                       /* The next character in the input buffer. */\r
+                                       cInChar = cLocalBuffer[ lByte ];\r
+                                       lByte++;\r
+\r
+                                       /* Newline characters are taken as the end of the command\r
+                                       string. */\r
+                                       if( cInChar == '\n' )\r
+                                       {\r
+                                               /* Process the input string received prior to the \r
+                                               newline. */\r
+                                               do\r
+                                               {\r
+                                                       /* Pass the string to FreeRTOS+CLI. */\r
+                                                       xMoreDataToFollow = FreeRTOS_CLIProcessCommand( cInputString, cOutputString, cmdMAX_OUTPUT_SIZE );\r
+                                                       \r
+                                                       /* Send the output generated by the command's\r
+                                                       implementation. */\r
+                                                       FreeRTOS_sendto( xSocket, cOutputString,  strlen( ( const char * ) cOutputString ), 0, &xClient, xClientAddressLength );\r
+\r
+                                               } while( xMoreDataToFollow != pdFALSE ); /* Until the command does not generate any more output. */\r
+\r
+                                               /* All the strings generated by the command processing \r
+                                               have been sent.  Clear the input string ready to receive \r
+                                               the next command. */\r
+                                               cInputIndex = 0;\r
+                                               memset( cInputString, 0x00, cmdMAX_INPUT_SIZE );\r
+                                               \r
+                                               /* Transmit a spacer, just to make the command console\r
+                                               easier to read. */\r
+                                               FreeRTOS_sendto( xSocket, "\r\n",  strlen( "\r\n" ), 0, &xClient, xClientAddressLength );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               if( cInChar == '\r' )\r
+                                               {\r
+                                                       /* Ignore the character.  Newlines are used to \r
+                                                       detect the end of the input string. */\r
+                                               }\r
+                                               else if( cInChar == '\b' )\r
+                                               {\r
+                                                       /* Backspace was pressed.  Erase the last character \r
+                                                       in the string - if any. */\r
+                                                       if( cInputIndex > 0 )\r
+                                                       {\r
+                                                               cInputIndex--;\r
+                                                               cInputString[ cInputIndex ] = '\0';\r
+                                                       }\r
+                                               }\r
+                                               else\r
+                                               {\r
+                                                       /* A character was entered.  Add it to the string\r
+                                                       entered so far.  When a \n is entered the complete\r
+                                                       string will be passed to the command interpreter. */\r
+                                                       if( cInputIndex < cmdMAX_INPUT_SIZE )\r
+                                                       {\r
+                                                               cInputString[ cInputIndex ] = cInChar;\r
+                                                               cInputIndex++;\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               } \r
+       }\r
+       else\r
+       {\r
+               /* The socket could not be opened. */\r
+               vTaskDelete( NULL );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static xSocket_t prvOpenUDPServerSocket( uint16_t usPort )\r
+{\r
+struct freertos_sockaddr xServer;\r
+xSocket_t xSocket = FREERTOS_INVALID_SOCKET;\r
+\r
+       xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+       if( xSocket != FREERTOS_INVALID_SOCKET)\r
+       {\r
+               /* Zero out the server structure. */\r
+               memset( ( void * ) &xServer, 0x00, sizeof( xServer ) );\r
+\r
+               /* Set family and port. */\r
+               xServer.sin_port = FreeRTOS_htons( usPort );\r
+\r
+               /* Bind the address to the socket. */\r
+               if( FreeRTOS_bind( xSocket, &xServer, sizeof( xServer ) ) == -1 )\r
+               {                       \r
+                       FreeRTOS_closesocket( xSocket );\r
+                       xSocket = FREERTOS_INVALID_SOCKET;\r
+               }\r
+       }\r
+\r
+       return xSocket;\r
+}\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SelectServer.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SelectServer.h
new file mode 100644 (file)
index 0000000..54c4e52
--- /dev/null
@@ -0,0 +1,80 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef SELECT_SERVER_H\r
+#define SELECT_SERVER_H\r
+\r
+void vStartSelectUDPServerTasks( uint16_t usStackSize, uint32_t ulFirstPortNumber, unsigned portBASE_TYPE uxPriority );\r
+\r
+#endif /* SELECT_SERVER_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SimpleClientAndServer.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/SimpleClientAndServer.h
new file mode 100644 (file)
index 0000000..538f3ff
--- /dev/null
@@ -0,0 +1,80 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef SIMPLE_CLIENT_AND_SERVER_H\r
+#define SIMPLE_CLIENT_AND_SERVER_H\r
+\r
+void vStartSimpleUDPClientServerTasks( uint16_t usStackSize, uint32_t ulsPort, unsigned portBASE_TYPE uxPriority );\r
+\r
+#endif /* SIMPLE_CLIENT_AND_SERVER_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/UDPCommandInterpreter.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/DemoTasks/include/UDPCommandInterpreter.h
new file mode 100644 (file)
index 0000000..dc8d274
--- /dev/null
@@ -0,0 +1,80 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef UDP_COMMAND_INTERPRETER_H\r
+#define UDP_COMMAND_INTERPRETER_H\r
+\r
+void vStartUDPCommandInterpreterTask( uint16_t usStackSize, uint32_t ulPort, unsigned portBASE_TYPE uxPriority );\r
+\r
+#endif /* UDP_COMMAND_INTERPRETER_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..faee16e
--- /dev/null
@@ -0,0 +1,239 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
+ * http://www.freertos.org/a00110.html\r
+ *\r
+ * The bottom of this file contains some constants specific to running the UDP\r
+ * stack in this demo.  Constants specific to FreeRTOS+UDP itself (rather than\r
+ * the demo) are contained in FreeRTOSIPConfig.h.\r
+ *----------------------------------------------------------*/\r
+\r
+#define configUSE_PREEMPTION                   1\r
+#define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 7 )\r
+#define configTICK_RATE_HZ                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 32U * 1024U ) )\r
+#define configMAX_TASK_NAME_LEN                        ( 7 )\r
+#define configUSE_TRACE_FACILITY               1\r
+#define configUSE_16_BIT_TICKS                 0\r
+#define configIDLE_SHOULD_YIELD                        1\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configUSE_MUTEXES                              1\r
+#define configUSE_RECURSIVE_MUTEXES            1\r
+#define configQUEUE_REGISTRY_SIZE              0\r
+#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_ALTERNATIVE_API              0\r
+\r
+/* Hook function related definitions. */\r
+#define configUSE_TICK_HOOK                            0\r
+#define configUSE_IDLE_HOOK                            1\r
+#define configUSE_MALLOC_FAILED_HOOK   1\r
+#define configCHECK_FOR_STACK_OVERFLOW 0 /* Not applicable to the Win32 port. */\r
+\r
+/* Software timer related definitions. */\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
+#define configTIMER_QUEUE_LENGTH               5\r
+#define configTIMER_TASK_STACK_DEPTH   ( configMINIMAL_STACK_SIZE * 2 )\r
+\r
+/* Run time stats gathering definitions. */\r
+unsigned long ulGetRunTimeCounterValue( void );\r
+void vConfigureTimerForRunTimeStats( void );\r
+#define configGENERATE_RUN_TIME_STATS  1\r
+#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
+#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()\r
+\r
+/* Co-routine definitions. */\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero\r
+to exclude the API function. */\r
+#define INCLUDE_vTaskPrioritySet                       1\r
+#define INCLUDE_uxTaskPriorityGet                      1\r
+#define INCLUDE_vTaskDelete                                    1\r
+#define INCLUDE_vTaskCleanUpResources          0\r
+#define INCLUDE_vTaskSuspend                           1\r
+#define INCLUDE_vTaskDelayUntil                                1\r
+#define INCLUDE_vTaskDelay                                     1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark    1\r
+#define INCLUDE_xTaskGetSchedulerState         1\r
+#define INCLUDE_xTimerGetTimerTaskHandle       0\r
+#define INCLUDE_xTaskGetIdleTaskHandle         0\r
+#define INCLUDE_xQueueGetMutexHolder           1\r
+\r
+/* Assert call defined for debug builds. */\r
+#ifdef _DEBUG\r
+       extern void vAssertCalled( void );\r
+       #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
+#endif /* _DEBUG */\r
+\r
+\r
+\r
+/* Application specific definitions follow. **********************************/\r
+\r
+/* If configINCLUDE_DEMO_DEBUG_STATS is set to one, then a few basic IP trace\r
+macros are defined to gather some UDP stack statistics that can then be viewed\r
+through the CLI interface. */\r
+#define configINCLUDE_DEMO_DEBUG_STATS 1\r
+\r
+/* The size of the global output buffer that is available for use when there\r
+are multiple command interpreters running at once (for example, one on a UART\r
+and one on TCP/IP).  This is done to prevent an output buffer being defined by\r
+each implementation - which would waste RAM.  In this case, there is only one\r
+command interpreter running, and it has its own local output buffer, so the\r
+global buffer is just set to be one byte long as it is not used and should not\r
+take up unnecessary RAM. */\r
+#define configCOMMAND_INT_MAX_OUTPUT_SIZE 1\r
+\r
+/* Only used when running in the FreeRTOS Windows simulator.  Defines the\r
+priority of the task used to simulate Ethernet interrupts. */\r
+#define configMAC_ISR_SIMULATOR_PRIORITY       ( configMAX_PRIORITIES - 1 )\r
+\r
+/* This demo creates a virtual network connection by accessing the raw Ethernet\r
+or WiFi data to and from a real network connection.  Many computers have more\r
+than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell\r
+the demo which real port should be used to create the virtual port.  The ports\r
+available are displayed on the console when the application is executed.  For\r
+example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 1\r
+results in the wired network being used, while setting\r
+configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being\r
+used. */\r
+#define configNETWORK_INTERFACE_TO_USE 1L\r
+\r
+/* The address of an echo server that will be used by the two demo echo client\r
+tasks.\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Common_Echo_Clients.shtml */\r
+#define configECHO_SERVER_ADDR0        172\r
+#define configECHO_SERVER_ADDR1 25\r
+#define configECHO_SERVER_ADDR2 218\r
+#define configECHO_SERVER_ADDR3 200\r
+\r
+/* Default MAC address configuration.  The demo creates a virtual network\r
+connection that uses this MAC address by accessing the raw Ethernet/WiFi data\r
+to and from a real network connection on the host PC.  See the\r
+configNETWORK_INTERFACE_TO_USE definition above for information on how to\r
+configure the real network connection to use. */\r
+#define configMAC_ADDR0        0x00\r
+#define configMAC_ADDR1        0x11\r
+#define configMAC_ADDR2        0x22\r
+#define configMAC_ADDR3        0x33\r
+#define configMAC_ADDR4        0x44\r
+#define configMAC_ADDR5        0x55\r
+\r
+/* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
+ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configIP_ADDR0         172\r
+#define configIP_ADDR1         25\r
+#define configIP_ADDR2         218\r
+#define configIP_ADDR3         200\r
+\r
+/* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
+0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configGATEWAY_ADDR0    192\r
+#define configGATEWAY_ADDR1    168\r
+#define configGATEWAY_ADDR2    1\r
+#define configGATEWAY_ADDR3    1\r
+\r
+/* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
+208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
+to 1 but a DNS server cannot be contacted.*/\r
+#define configDNS_SERVER_ADDR0         208\r
+#define configDNS_SERVER_ADDR1         67\r
+#define configDNS_SERVER_ADDR2         222\r
+#define configDNS_SERVER_ADDR3         222\r
+\r
+/* Defalt netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
+ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
+#define configNET_MASK0                255\r
+#define configNET_MASK1                255\r
+#define configNET_MASK2                255\r
+#define configNET_MASK3                0\r
+\r
+/* Provided to guard prints to the console with a semaphore. */\r
+void vOutputString( char *pcMessage );\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSIPConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOSIPConfig.h
new file mode 100644 (file)
index 0000000..43ec3ee
--- /dev/null
@@ -0,0 +1,242 @@
+/*\r
+ * FreeRTOS+UDP Preview 002 (C) 2012 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for configuration information.\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Configuration.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+#ifndef FREERTOS_IP_CONFIG_H\r
+#define FREERTOS_IP_CONFIG_H\r
+\r
+/* The IP stack executes it its own task (although any application task can make\r
+use of its services through the published sockets API). ipconfigUDP_TASK_PRIORITY\r
+sets the priority of the task that executes the IP stack.  The priority is a\r
+standard FreeRTOS task priority so can take any value from 0 (the lowest\r
+priority) to (configMAX_PRIORITIES - 1) (the highest priority).\r
+configMAX_PRIORITIES is a standard FreeRTOS configuration parameter defined in\r
+FreeRTOSConfig.h, not FreeRTOSIPConfig.h. Consideration needs to be given as to\r
+the priority assigned to the task executing the IP stack relative to the\r
+priority assigned to tasks that use the IP stack. */\r
+#define ipconfigUDP_TASK_PRIORITY                      ( configMAX_PRIORITIES - 2 )\r
+\r
+/* The size, in words (not bytes), of the stack allocated to the FreeRTOS+UDP\r
+task.  This setting is less important when the FreeRTOS Win32 simulator is used\r
+as the Win32 simulator only stores a fixed amount of information on the task\r
+stack.  FreeRTOS includes optional stack overflow detection, see:\r
+http://www.freertos.org/Stacks-and-stack-overflow-checking.html */\r
+#define ipconfigUDP_TASK_STACK_SIZE_WORDS      ( configMINIMAL_STACK_SIZE * 5 )\r
+\r
+/* ipconfigRAND32() is called by the IP stack to generate a random number that\r
+is then used as a DHCP transaction number.  Random number generation is performed\r
+via this macro to allow applications to use their own random number generation\r
+method.  For example, it might be possible to generate a random number by\r
+sampling noise on an analogue input. */\r
+#define ipconfigRAND32()       1\r
+\r
+/* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+UDP will call the\r
+network event hook at the appropriate times.  If ipconfigUSE_NETWORK_EVENT_HOOK\r
+is not set to 1 then the network event hook will never be called.  See\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml\r
+*/\r
+#define ipconfigUSE_NETWORK_EVENT_HOOK 1\r
+\r
+/* Sockets have a send block time attribute.  If FreeRTOS_sendto() is called but\r
+a network buffer cannot be obtained then the calling task is held in the Blocked\r
+state (so other tasks can continue to executed) until either a network buffer\r
+becomes available or the send block time expires.  If the send block time expires\r
+then the send operation is aborted.  The maximum allowable send block time is\r
+capped to the value set by ipconfigMAX_SEND_BLOCK_TIME_TICKS.  Capping the\r
+maximum allowable send block time prevents prevents a deadlock occurring when\r
+all the network buffers are in use and the tasks that process (and subsequently\r
+free) the network buffers are themselves blocked waiting for a network buffer.\r
+ipconfigMAX_SEND_BLOCK_TIME_TICKS is specified in RTOS ticks.  A time in\r
+milliseconds can be converted to a time in ticks by dividing the time in\r
+milliseconds by portTICK_RATE_MS. */\r
+#define ipconfigMAX_SEND_BLOCK_TIME_TICKS ( 20 / portTICK_RATE_MS )\r
+\r
+/* If ipconfigUSE_DHCP is 1 then FreeRTOS+UDP will attempt to retrieve an IP\r
+address, netmask, DNS server address and gateway address from a DHCP server.  If\r
+ipconfigUSE_DHCP is 0 then FreeRTOS+UDP will use a static IP address.  The\r
+stack will revert to using the static IP address even when ipconfigUSE_DHCP is\r
+set to 1 if a valid configuration cannot be obtained from a DHCP server for any\r
+reason.  The static configuration used is that passed into the stack by the\r
+FreeRTOS_IPInit() function call. */\r
+#define ipconfigUSE_DHCP       0\r
+\r
+/* When ipconfigUSE_DHCP is set to 1, DHCP requests will be sent out at\r
+increasing time intervals until either a reply is received from a DHCP server\r
+and accepted, or the interval between transmissions reaches\r
+ipconfigMAXIMUM_DISCOVER_TX_PERIOD.  The IP stack will revert to using the\r
+static IP address passed as a parameter to FreeRTOS_IPInit() if the\r
+re-transmission time interval reaches ipconfigMAXIMUM_DISCOVER_TX_PERIOD without\r
+a DHCP reply being received. */\r
+#ifdef _WINDOWS_\r
+       /* The windows simulated time is not real time so the max delay is much\r
+       shorter. */\r
+       #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 999 / portTICK_RATE_MS )\r
+#else\r
+       #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 120000 / portTICK_RATE_MS )\r
+#endif /* _WINDOWS_ */\r
+\r
+/* The ARP cache is a table that maps IP addresses to MAC addresses.  The IP\r
+stack can only send a UDP message to a remove IP address if it knowns the MAC\r
+address associated with the IP address, or the MAC address of the router used to\r
+contact the remote IP address.  When a UDP message is received from a remote IP\r
+address the MAC address and IP address are added to the ARP cache.  When a UDP\r
+message is sent to a remote IP address that does not already appear in the ARP\r
+cache then the UDP message is replaced by a ARP message that solicits the\r
+required MAC address information.  ipconfigARP_CACHE_ENTRIES defines the maximum\r
+number of entries that can exist in the ARP table at any one time. */\r
+#define ipconfigARP_CACHE_ENTRIES              6\r
+\r
+/* ARP requests that do not result in an ARP response will be re-transmitted a\r
+maximum of ipconfigMAX_ARP_RETRANSMISSIONS times before the ARP request is\r
+aborted. */\r
+#define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )\r
+\r
+/* ipconfigMAX_ARP_AGE defines the maximum time between an entry in the ARP\r
+table being created or refreshed and the entry being removed because it is stale.\r
+New ARP requests are sent for ARP cache entries that are nearing their maximum\r
+age.  ipconfigMAX_ARP_AGE is specified in tens of seconds, so a value of 150 is\r
+equal to 1500 seconds (or 25 minutes). */\r
+#define ipconfigMAX_ARP_AGE                    150\r
+\r
+/* Implementing FreeRTOS_inet_addr() necessitates the use of string handling\r
+routines, which are relatively large.  To save code space the full\r
+FreeRTOS_inet_addr() implementation is made optional, and a smaller and faster\r
+alternative called FreeRTOS_inet_addr_quick() is provided.  FreeRTOS_inet_addr()\r
+takes an IP in decimal dot format (for example, "192.168.0.1") as its parameter.\r
+FreeRTOS_inet_addr_quick() takes an IP address as four separate numerical octets\r
+(for example, 192, 168, 0, 1) as its parameters.  If\r
+ipconfigINCLUDE_FULL_INET_ADDR is set to 1 then both FreeRTOS_inet_addr() and\r
+FreeRTOS_indet_addr_quick() are available.  If ipconfigINCLUDE_FULL_INET_ADDR is\r
+not set to 1 then only FreeRTOS_indet_addr_quick() is available. */\r
+#define ipconfigINCLUDE_FULL_INET_ADDR 1\r
+\r
+/* ipconfigNUM_NETWORK_BUFFERS defines the total number of network buffer that\r
+are available to the IP stack.  The total number of network buffers is limited\r
+to ensure the total amount of RAM that can be consumed by the IP stack is capped\r
+to a pre-determinable value. */\r
+#define ipconfigNUM_NETWORK_BUFFERS            45\r
+\r
+/* A FreeRTOS queue is used to send events from application tasks to the IP\r
+stack.  ipconfigEVENT_QUEUE_LENGTH sets the maximum number of events that can\r
+be queued for processing at any one time.  The event queue must be a minimum of\r
+5 greater than the total number of network buffers. */\r
+#define ipconfigEVENT_QUEUE_LENGTH             ( ipconfigNUM_NETWORK_BUFFERS + 5 )\r
+\r
+/* The address of a socket is the combination of its IP address and its port\r
+number.  FreeRTOS_bind() is used to manually allocate a port number to a socket\r
+(to 'bind' the socket to a port), but manual binding is not normally necessary\r
+for client sockets (those sockets that initiate outgoing connections rather than\r
+wait for incoming connections on a known port number).  If\r
+ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 1 then calling\r
+FreeRTOS_sendto() on a socket that has not yet been bound will result in the IP\r
+stack automatically binding the socket to a port number from the range\r
+socketAUTO_PORT_ALLOCATION_START_NUMBER to 0xffff.  If\r
+ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is set to 0 then calling FreeRTOS_sendto()\r
+on a socket that has not yet been bound will result in the send operation being\r
+aborted. */\r
+#define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1\r
+\r
+/* Defines the Time To Live (TTL) values used in outgoing UDP packets. */\r
+#define updconfigIP_TIME_TO_LIVE               128\r
+\r
+/* If ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 1 then UDP packets that\r
+contain more data than will fit in a single network frame will be fragmented\r
+across multiple IP packets.  Also see the ipconfigNETWORK_MTU setting.  If\r
+ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must\r
+be divisible by 8.  Setting ipconfigCAN_FRAGMENT_OUTGOING_PACKETS to 1 will\r
+increase both the code size and execution time. */\r
+#define ipconfigCAN_FRAGMENT_OUTGOING_PACKETS 0\r
+\r
+/* The MTU is the maximum number of bytes the payload of a network frame can\r
+contain.  For normal Ethernet V2 frames the maximum MTU is 1500.  Setting a\r
+lower value can save RAM, depending on the buffer management scheme used.  If\r
+ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is 1 then (ipconfigNETWORK_MTU - 28) must\r
+be divisible by 8. */\r
+#define ipconfigNETWORK_MTU 1500\r
+\r
+/* Set ipconfigUSE_DNS to 1 to include a basic DNS client/resolver.  DNS is used\r
+through the FreeRTOS_gethostbyname() API function. */\r
+#define ipconfigUSE_DNS                1\r
+\r
+/* If ipconfigREPLY_TO_INCOMING_PINGS is set to 1 then the IP stack will\r
+generate replies to incoming ICMP echo (ping) requests. */\r
+#define ipconfigREPLY_TO_INCOMING_PINGS                                1\r
+\r
+/* If ipconfigSUPPORT_OUTGOING_PINGS is set to 1 then the\r
+FreeRTOS_SendPingRequest() API function is available. */\r
+#define ipconfigSUPPORT_OUTGOING_PINGS                         1\r
+\r
+/* If ipconfigSUPPORT_SELECT_FUNCTION is set to 1 then the FreeRTOS_select()\r
+(and associated) API function is available. */\r
+#define ipconfigSUPPORT_SELECT_FUNCTION                                1\r
+\r
+/* Used for stack testing only, and must be implemented in the network\r
+interface. */\r
+#define updconfigLOOPBACK_ETHERNET_PACKETS     0\r
+\r
+/* If ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES is set to 1 then Ethernet frames\r
+that are not in Ethernet II format will be dropped.  This option is included for\r
+potential future IP stack developments. */\r
+#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1\r
+\r
+/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1 then it is the\r
+responsibility of the Ethernet interface to filter out packets that are of no\r
+interest.  If the Ethernet interface does not implement this functionality, then\r
+set ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES to 0 to have the IP stack\r
+perform the filtering instead (it is much less efficient for the stack to do it\r
+because the packet will already have been passed into the stack).  If the\r
+Ethernet driver does all the necessary filtering in hardware then software\r
+filtering can be removed by using a value other than 1 or 0. */\r
+#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES    1\r
+\r
+/* The windows simulator cannot really simulate MAC interrupts, and needs to\r
+block occasionally to allow other tasks to run. */\r
+#ifdef _WINDOWS_\r
+       #define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 3 / portTICK_RATE_MS )\r
+#endif\r
+\r
+/* The example IP trace macros are included here so the definitions are\r
+available in all the FreeRTOS+UDP source files. */\r
+#include "DemoIPTrace.h"\r
+\r
+#endif /* FREERTOS_IP_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOS_Plus_UDP_with_CLI.sln b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/FreeRTOS_Plus_UDP_with_CLI.sln
new file mode 100644 (file)
index 0000000..3f819af
--- /dev/null
@@ -0,0 +1,20 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual C++ Express 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WIN32", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/READ_ME.url b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/READ_ME.url
new file mode 100644 (file)
index 0000000..0d3763a
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/RTOS_UDP_CLI_Windows_Simulator.shtml\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/Run-time-stats-utils.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/Run-time-stats-utils.c
new file mode 100644 (file)
index 0000000..8fa742b
--- /dev/null
@@ -0,0 +1,147 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/*\r
+ * Utility functions required to gather run time statistics.  See:\r
+ * http://www.freertos.org/rtos-run-time-stats.html\r
+ *\r
+ * Note that this is a simulated port, where simulated time is a lot slower than\r
+ * real time, therefore the run time counter values have no real meaningful\r
+ * units.\r
+ *\r
+ * Also note that it is assumed this demo is going to be used for short periods\r
+ * of time only, and therefore timer overflows are not handled.\r
+*/\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+\r
+/* Variables used in the creation of the run time stats time base.  Run time \r
+stats record how much time each task spends in the Running state. */\r
+static long long llInitialRunTimeCounterValue = 0LL, llTicksPerHundedthMillisecond = 0LL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vConfigureTimerForRunTimeStats( void )\r
+{\r
+LARGE_INTEGER liPerformanceCounterFrequency, liInitialRunTimeValue;\r
+\r
+       /* Initialise the variables used to create the run time stats time base.\r
+       Run time stats record how much time each task spends in the Running \r
+       state. */\r
+\r
+       if( QueryPerformanceFrequency( &liPerformanceCounterFrequency ) == 0 )\r
+       {\r
+               llTicksPerHundedthMillisecond = 1;\r
+       }\r
+       else\r
+       {\r
+               /* How many times does the performance counter increment in 1/100th\r
+               millisecond. */\r
+               llTicksPerHundedthMillisecond = liPerformanceCounterFrequency.QuadPart / 100000LL;\r
+\r
+               /* What is the performance counter value now, this will be subtracted\r
+               from readings taken at run time. */\r
+               QueryPerformanceCounter( &liInitialRunTimeValue );\r
+               llInitialRunTimeCounterValue = liInitialRunTimeValue.QuadPart;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned long ulGetRunTimeCounterValue( void )\r
+{\r
+LARGE_INTEGER liCurrentCount;\r
+unsigned long ulReturn;\r
+\r
+       /* What is the performance counter value now? */\r
+       QueryPerformanceCounter( &liCurrentCount );\r
+\r
+       /* Subtract the performance counter value reading taken when the \r
+       application started to get a count from that reference point, then\r
+       scale to (simulated) 1/100ths of a millisecond. */\r
+       if( llTicksPerHundedthMillisecond == 0 )\r
+       {\r
+               /* The trace macros can call this function before the kernel has been\r
+               started, in which case llTicksPerHundedthMillisecond will not have been\r
+               initialised. */\r
+               ulReturn = 0;\r
+       }\r
+       else\r
+       {\r
+               ulReturn = ( unsigned long ) ( ( liCurrentCount.QuadPart - llInitialRunTimeCounterValue ) / llTicksPerHundedthMillisecond );\r
+       }\r
+\r
+       return ulReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj
new file mode 100644 (file)
index 0000000..298b687
--- /dev/null
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>\r
+    <ProjectName>RTOSDemo</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.\Trace_Recorder_Configuration;..\Common\FreeRTOS_Plus_UDP_Demos\EchoClients;..\Common\FreeRTOS_Plus_UDP_Demos\TraceMacros\Example1;..\..\Source\FreeRTOS-Plus-UDP\portable\BufferManagement;.\DemoTasks\include;..\..\Source\FreeRTOS-Plus-UDP\portable\Compiler\MSVC;.\WinPCap;..\..\..\FreeRTOS\Source\include;..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\Source\FreeRTOS-Plus-CLI;..\..\Source\FreeRTOS-Plus-Trace\Include;..\..\Source\FreeRTOS-Plus-UDP\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+      <AdditionalOptions>/wd4210 %(AdditionalOptions)</AdditionalOptions>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Debug/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalDependencies>wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>.\WinPCap</AdditionalLibraryDirectories>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Debug/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <PreprocessorDefinitions>_WINSOCKAPI_;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <AdditionalIncludeDirectories>..\Common\Utils;..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap;..\Common\ethernet\lwip-1.4.0\src\include\ipv4;..\Common\ethernet\lwip-1.4.0\src\include;..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\ethernet\lwip-1.4.0\ports\win32\include;..\Common\Include;.\lwIP_Apps;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Release/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalLibraryDirectories>..\Common\ethernet\lwip-1.4.0\ports\win32\WinPCap</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Release/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c" />\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_DHCP.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_DNS.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_Sockets.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_UDP_IP.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\portable\BufferManagement\BufferAllocation_2.c" />\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\WinPCap\NetworkInterface.c" />\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\CLICommands\CLI-commands.c" />\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\EchoClients\TwoEchoClients.c" />\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\TraceMacros\Example1\DemoIPTrace.c" />\r
+    <ClCompile Include="DemoTasks\SelectServer.c" />\r
+    <ClCompile Include="DemoTasks\SimpleClientAndServer.c" />\r
+    <ClCompile Include="DemoTasks\UDPCommandServer.c" />\r
+    <ClCompile Include="main.c">\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="Run-time-stats-utils.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_DNS.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_Sockets.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_UDP_IP.h" />\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\NetworkInterface.h" />\r
+    <ClInclude Include="FreeRTOSConfig.h" />\r
+    <ClInclude Include="FreeRTOSIPConfig.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.filters b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.filters
new file mode 100644 (file)
index 0000000..5a76f97
--- /dev/null
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{38712199-cebf-4124-bf15-398f7c3419ea}</UniqueIdentifier>\r
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+    <Filter Include="Demo App Source">\r
+      <UniqueIdentifier>{34567deb-d5ab-4a56-8640-0aaec609521a}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS">\r
+      <UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source">\r
+      <UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>\r
+      <Extensions>*.c</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS\Source\Portable">\r
+      <UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+">\r
+      <UniqueIdentifier>{e5ad4ec7-23dc-4295-8add-2acaee488f5a}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+CLI">\r
+      <UniqueIdentifier>{fd43c0ed-fdbc-437f-a5a3-c50399690bd7}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+UDP">\r
+      <UniqueIdentifier>{8672fa26-b119-481f-8b8d-086419c01a3e}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+UDP\portable">\r
+      <UniqueIdentifier>{4570be11-ec96-4b55-ac58-24b50ada980a}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+UDP\include">\r
+      <UniqueIdentifier>{5d93ed51-023a-41ad-9243-8d230165d34b}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Demo App Source\DemoTasks">\r
+      <UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Demo App Source\Configuration Files">\r
+      <UniqueIdentifier>{19ff1a34-36de-4c48-9d10-3fb1fa0d1fa4}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>\r
+    </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS+CLI\include">\r
+      <UniqueIdentifier>{c5889fe2-af0f-4cea-927f-6a6935ec5e14}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="main.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\timers.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\list.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\queue.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\tasks.c">\r
+      <Filter>FreeRTOS\Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Run-time-stats-utils.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DemoTasks\SimpleClientAndServer.c">\r
+      <Filter>Demo App Source\DemoTasks</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DemoTasks\UDPCommandServer.c">\r
+      <Filter>Demo App Source\DemoTasks</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\FreeRTOS\Source\portable\MemMang\heap_4.c">\r
+      <Filter>FreeRTOS\Source\Portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_UDP_IP.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_DHCP.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_DNS.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\FreeRTOS_Sockets.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\portable\BufferManagement\BufferAllocation_2.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\WinPCap\NetworkInterface.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\portable</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.c">\r
+      <Filter>FreeRTOS+\FreeRTOS+CLI</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\CLICommands\CLI-commands.c">\r
+      <Filter>Demo App Source</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\EchoClients\TwoEchoClients.c">\r
+      <Filter>Demo App Source\DemoTasks</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Common\FreeRTOS_Plus_UDP_Demos\TraceMacros\Example1\DemoIPTrace.c">\r
+      <Filter>Demo App Source\DemoTasks</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DemoTasks\SelectServer.c">\r
+      <Filter>Demo App Source\DemoTasks</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="FreeRTOSConfig.h">\r
+      <Filter>Demo App Source\Configuration Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="FreeRTOSIPConfig.h">\r
+      <Filter>Demo App Source\Configuration Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\NetworkInterface.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_DNS.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_Sockets.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-UDP\include\FreeRTOS_UDP_IP.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+UDP\include</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Source\FreeRTOS-Plus-CLI\FreeRTOS_CLI.h">\r
+      <Filter>FreeRTOS+\FreeRTOS+CLI\include</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.user b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WIN32.vcxproj.user
new file mode 100644 (file)
index 0000000..695b5c7
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+</Project>
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Packet32.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Packet32.h
new file mode 100644 (file)
index 0000000..1e0eacd
--- /dev/null
@@ -0,0 +1,359 @@
+/*\r
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)\r
+ * Copyright (c) 2005 - 2007 CACE Technologies, Davis (California)\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies \r
+ * nor the names of its contributors may be used to endorse or promote \r
+ * products derived from this software without specific prior written \r
+ * permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+\r
+/** @ingroup packetapi\r
+ *  @{ \r
+ */\r
+\r
+/** @defgroup packet32h Packet.dll definitions and data structures\r
+ *  Packet32.h contains the data structures and the definitions used by packet.dll.\r
+ *  The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included\r
+ *  by the applications that use the functions of this library\r
+ *  @{\r
+ */\r
+\r
+#ifndef __PACKET32\r
+#define __PACKET32\r
+\r
+#include <winsock2.h>\r
+\r
+#ifdef HAVE_AIRPCAP_API\r
+#include <airpcap.h>\r
+#else\r
+#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)\r
+#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_\r
+typedef struct _AirpcapHandle *PAirpcapHandle;\r
+#endif /* AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ */\r
+#endif /* HAVE_AIRPCAP_API */\r
+\r
+#ifdef HAVE_DAG_API\r
+#include <dagc.h>\r
+#endif /* HAVE_DAG_API */\r
+\r
+// Working modes\r
+#define PACKET_MODE_CAPT 0x0 ///< Capture mode\r
+#define PACKET_MODE_STAT 0x1 ///< Statistical mode\r
+#define PACKET_MODE_MON 0x2 ///< Monitoring mode\r
+#define PACKET_MODE_DUMP 0x10 ///< Dump mode\r
+#define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode\r
+\r
+\r
+/// Alignment macro. Defines the alignment size.\r
+#define Packet_ALIGNMENT sizeof(int)\r
+/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. \r
+#define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))\r
+\r
+#define NdisMediumNull -1              ///< Custom linktype: NDIS doesn't provide an equivalent\r
+#define NdisMediumCHDLC        -2              ///< Custom linktype: NDIS doesn't provide an equivalent\r
+#define NdisMediumPPPSerial    -3      ///< Custom linktype: NDIS doesn't provide an equivalent\r
+#define NdisMediumBare80211    -4      ///< Custom linktype: NDIS doesn't provide an equivalent\r
+#define NdisMediumRadio80211   -5      ///< Custom linktype: NDIS doesn't provide an equivalent\r
+#define NdisMediumPpi          -6      ///< Custom linktype: NDIS doesn't provide an equivalent\r
+\r
+// Loopback behaviour definitions\r
+#define NPF_DISABLE_LOOPBACK   1       ///< Drop the packets sent by the NPF driver\r
+#define NPF_ENABLE_LOOPBACK            2       ///< Capture the packets sent by the NPF driver\r
+\r
+/*!\r
+  \brief Network type structure.\r
+\r
+  This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.\r
+*/\r
+typedef struct NetType\r
+{\r
+       UINT LinkType;  ///< The MAC of the current network adapter (see function PacketGetNetType() for more information)\r
+       ULONGLONG LinkSpeed;    ///< The speed of the network in bits per second\r
+}NetType;\r
+\r
+\r
+//some definitions stolen from libpcap\r
+\r
+#ifndef BPF_MAJOR_VERSION\r
+\r
+/*!\r
+  \brief A BPF pseudo-assembly program.\r
+\r
+  The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. \r
+*/\r
+struct bpf_program \r
+{\r
+       UINT bf_len;                            ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.\r
+       struct bpf_insn *bf_insns;      ///< A pointer to the first instruction of the program.\r
+};\r
+\r
+/*!\r
+  \brief A single BPF pseudo-instruction.\r
+\r
+  bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.\r
+*/\r
+struct bpf_insn \r
+{\r
+       USHORT  code;           ///< Instruction type and addressing mode.\r
+       UCHAR   jt;                     ///< Jump if true\r
+       UCHAR   jf;                     ///< Jump if false\r
+       int k;                          ///< Generic field used for various purposes.\r
+};\r
+\r
+/*!\r
+  \brief Structure that contains a couple of statistics values on the current capture.\r
+\r
+  It is used by packet.dll to return statistics about a capture session.\r
+*/\r
+struct bpf_stat \r
+{\r
+       UINT bs_recv;           ///< Number of packets that the driver received from the network adapter \r
+                                               ///< from the beginning of the current capture. This value includes the packets \r
+                                               ///< lost by the driver.\r
+       UINT bs_drop;           ///< number of packets that the driver lost from the beginning of a capture. \r
+                                               ///< Basically, a packet is lost when the the buffer of the driver is full. \r
+                                               ///< In this situation the packet cannot be stored and the driver rejects it.\r
+       UINT ps_ifdrop;         ///< drops by interface. XXX not yet supported\r
+       UINT bs_capt;           ///< number of packets that pass the filter, find place in the kernel buffer and\r
+                                               ///< thus reach the application.\r
+};\r
+\r
+/*!\r
+  \brief Packet header.\r
+\r
+  This structure defines the header associated with every packet delivered to the application.\r
+*/\r
+struct bpf_hdr \r
+{\r
+       struct timeval  bh_tstamp;      ///< The timestamp associated with the captured packet. \r
+                                                               ///< It is stored in a TimeVal structure.\r
+       UINT    bh_caplen;                      ///< Length of captured portion. The captured portion <b>can be different</b>\r
+                                                               ///< from the original packet, because it is possible (with a proper filter)\r
+                                                               ///< to instruct the driver to capture only a portion of the packets.\r
+       UINT    bh_datalen;                     ///< Original length of packet\r
+       USHORT          bh_hdrlen;              ///< Length of bpf header (this struct plus alignment padding). In some cases,\r
+                                                               ///< a padding could be added between the end of this structure and the packet\r
+                                                               ///< data for performance reasons. This filed can be used to retrieve the actual data \r
+                                                               ///< of the packet.\r
+};\r
+\r
+/*!\r
+  \brief Dump packet header.\r
+\r
+  This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().\r
+  It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a\r
+  packet in a dump file. This makes straightforward sending WinPcap dump files to the network.\r
+*/\r
+struct dump_bpf_hdr{\r
+    struct timeval     ts;                     ///< Time stamp of the packet\r
+    UINT                       caplen;         ///< Length of captured portion. The captured portion can smaller than the \r
+                                                               ///< the original packet, because it is possible (with a proper filter) to \r
+                                                               ///< instruct the driver to capture only a portion of the packets. \r
+    UINT                       len;            ///< Length of the original packet (off wire).\r
+};\r
+\r
+\r
+#endif\r
+\r
+struct bpf_stat;\r
+\r
+#define        DOSNAMEPREFIX   TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices\r
+#define        MAX_LINK_NAME_LENGTH    64                      //< Maximum length of the devices symbolic links\r
+#define        NMAX_PACKET 65535\r
+\r
+/*!\r
+  \brief Addresses of a network adapter.\r
+\r
+  This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with \r
+  an adapter.\r
+*/\r
+typedef struct npf_if_addr {\r
+       struct sockaddr_storage IPAddress;      ///< IP address.\r
+       struct sockaddr_storage SubnetMask;     ///< Netmask for that address.\r
+       struct sockaddr_storage Broadcast;      ///< Broadcast address.\r
+}npf_if_addr;\r
+\r
+\r
+#define ADAPTER_NAME_LENGTH 256 + 12   ///<  Maximum length for the name of an adapter. The value is the same used by the IP Helper API.\r
+#define ADAPTER_DESC_LENGTH 128                        ///<  Maximum length for the description of an adapter. The value is the same used by the IP Helper API.\r
+#define MAX_MAC_ADDR_LENGTH 8                  ///<  Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.\r
+#define MAX_NETWORK_ADDRESSES 16               ///<  Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.\r
+\r
+\r
+typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API\r
+typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API\r
+\r
+#define INFO_FLAG_NDIS_ADAPTER         0       ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter\r
+#define INFO_FLAG_NDISWAN_ADAPTER      1       ///< Flag for ADAPTER_INFO: this is a NdisWan adapter, and it's managed by WANPACKET\r
+#define INFO_FLAG_DAG_CARD                     2       ///< Flag for ADAPTER_INFO: this is a DAG card\r
+#define INFO_FLAG_DAG_FILE                     6       ///< Flag for ADAPTER_INFO: this is a DAG file\r
+#define INFO_FLAG_DONT_EXPORT          8       ///< Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones.\r
+#define INFO_FLAG_AIRPCAP_CARD         16      ///< Flag for ADAPTER_INFO: this is an airpcap card\r
+#define INFO_FLAG_NPFIM_DEVICE         32\r
+\r
+/*!\r
+  \brief Describes an opened network adapter.\r
+\r
+  This structure is the most important for the functioning of packet.dll, but the great part of its fields\r
+  should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters\r
+*/\r
+typedef struct _ADAPTER  { \r
+       HANDLE hFile;                           ///< \internal Handle to an open instance of the NPF driver.\r
+       CHAR  SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.\r
+       int NumWrites;                          ///< \internal Number of times a packets written on this adapter will be repeated \r
+                                                               ///< on the wire.\r
+       HANDLE ReadEvent;                       ///< A notification event associated with the read calls on the adapter.\r
+                                                               ///< It can be passed to standard Win32 functions (like WaitForSingleObject\r
+                                                               ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some \r
+                                                               ///< data. It is particularly useful in GUI applications that need to wait \r
+                                                               ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()\r
+                                                               ///< function can be used to define the minimum amount of data in the kernel buffer\r
+                                                               ///< that will cause the event to be signalled. \r
+       \r
+       UINT ReadTimeOut;                       ///< \internal The amount of time after which a read on the driver will be released and \r
+                                                               ///< ReadEvent will be signaled, also if no packets were captured\r
+       CHAR Name[ADAPTER_NAME_LENGTH];\r
+       PWAN_ADAPTER pWanAdapter;\r
+       UINT Flags;                                     ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.\r
+\r
+#ifdef HAVE_AIRPCAP_API\r
+       PAirpcapHandle  AirpcapAd;\r
+#endif // HAVE_AIRPCAP_API\r
+\r
+#ifdef HAVE_NPFIM_API\r
+       void* NpfImHandle;\r
+#endif // HAVE_NPFIM_API\r
+\r
+#ifdef HAVE_DAG_API\r
+       dagc_t *pDagCard;                       ///< Pointer to the dagc API adapter descriptor for this adapter\r
+       PCHAR DagBuffer;                        ///< Pointer to the buffer with the packets that is received from the DAG card\r
+       struct timeval DagReadTimeout;  ///< Read timeout. The dagc API requires a timeval structure\r
+       unsigned DagFcsLen;                     ///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry\r
+       DWORD DagFastProcess;           ///< True if the user requests fast capture processing on this card. Higher level applications can use this value to provide a faster but possibly unprecise capture (for example, libpcap doesn't convert the timestamps).\r
+#endif // HAVE_DAG_API\r
+}  ADAPTER, *LPADAPTER;\r
+\r
+/*!\r
+  \brief Structure that contains a group of packets coming from the driver.\r
+\r
+  This structure defines the header associated with every packet delivered to the application.\r
+*/\r
+typedef struct _PACKET {  \r
+       HANDLE       hEvent;            ///< \deprecated Still present for compatibility with old applications.\r
+       OVERLAPPED   OverLapped;        ///< \deprecated Still present for compatibility with old applications.\r
+       PVOID        Buffer;            ///< Buffer with containing the packets. See the PacketReceivePacket() for\r
+                                                               ///< details about the organization of the data in this buffer\r
+       UINT         Length;            ///< Length of the buffer\r
+       DWORD        ulBytesReceived;   ///< Number of valid bytes present in the buffer, i.e. amount of data\r
+                                                                       ///< received by the last call to PacketReceivePacket()\r
+       BOOLEAN      bIoComplete;       ///< \deprecated Still present for compatibility with old applications.\r
+}  PACKET, *LPPACKET;\r
+\r
+/*!\r
+  \brief Structure containing an OID request.\r
+\r
+  It is used by the PacketRequest() function to send an OID to the interface card driver. \r
+  It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, \r
+  the list of the multicast groups defined on it, and so on.\r
+*/\r
+struct _PACKET_OID_DATA {\r
+    ULONG Oid;                                 ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h\r
+                                                               ///< for a complete list of valid codes.\r
+    ULONG Length;                              ///< Length of the data field\r
+    UCHAR Data[1];                             ///< variable-lenght field that contains the information passed to or received \r
+                                                               ///< from the adapter.\r
+}; \r
+typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/**\r
+ *  @}\r
+ */\r
+\r
+/*\r
+BOOLEAN QueryWinPcapRegistryStringA(CHAR *SubKeyName,\r
+                                                                CHAR *Value,\r
+                                                                UINT *pValueLen,\r
+                                                                CHAR *DefaultVal);\r
+\r
+BOOLEAN QueryWinPcapRegistryStringW(WCHAR *SubKeyName,\r
+                                                                WCHAR *Value,\r
+                                                                UINT *pValueLen,\r
+                                                                WCHAR *DefaultVal);\r
+*/\r
+                                                                \r
+//---------------------------------------------------------------------------\r
+// EXPORTED FUNCTIONS\r
+//---------------------------------------------------------------------------\r
+\r
+PCHAR PacketGetVersion();\r
+PCHAR PacketGetDriverVersion();\r
+BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);\r
+BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);\r
+BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);\r
+BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);\r
+BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);\r
+BOOLEAN PacketSetLoopbackBehavior(LPADAPTER  AdapterObject, UINT LoopbackBehavior);\r
+INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen);\r
+BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);\r
+BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);\r
+BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);\r
+BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);\r
+LPADAPTER PacketOpenAdapter(PCHAR AdapterName);\r
+BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);\r
+INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);\r
+LPPACKET PacketAllocatePacket(void);\r
+VOID PacketInitPacket(LPPACKET lpPacket,PVOID  Buffer,UINT  Length);\r
+VOID PacketFreePacket(LPPACKET lpPacket);\r
+BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);\r
+BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);\r
+BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG  BufferSize);\r
+BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);\r
+BOOLEAN PacketRequest(LPADAPTER  AdapterObject,BOOLEAN Set,PPACKET_OID_DATA  OidData);\r
+HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);\r
+BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);\r
+BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);\r
+BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);\r
+BOOL PacketStopDriver();\r
+VOID PacketCloseAdapter(LPADAPTER lpAdapter);\r
+BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength);\r
+BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags);\r
+PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject);\r
+\r
+//\r
+// Used by PacketStartOemEx\r
+//\r
+#define PACKET_START_OEM_NO_NETMON     0x00000001\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif \r
+\r
+#endif //__PACKET32\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/PacketData.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/PacketData.h
new file mode 100644 (file)
index 0000000..8124db6
--- /dev/null
@@ -0,0 +1,267 @@
+char pkt1[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x30, 0x09, 0x9c, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x07, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc7, 0x35, 0x00, 0x00, 0x00, 0x00, 0x70, 0x02,\r
+0x40, 0x00, 0xdf, 0xab, 0x00, 0x00, 0x02, 0x04,\r
+0x05, 0xb4, 0x01, 0x01, 0x04, 0x02 };\r
+\r
+char pkt2[] = {\r
+0x00, 0x14, 0x22, 0xcb, 0x18, 0x2d, 0x00, 0x01,\r
+0x02, 0x45, 0x09, 0x11, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x2c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x06,\r
+0xf8, 0xa6, 0xc0, 0xa8, 0x00, 0x0c, 0xc0, 0xa8,\r
+0x00, 0xc8, 0x00, 0x50, 0x0f, 0xe2, 0x00, 0x00,\r
+0x06, 0x68, 0x09, 0xe7, 0xc7, 0x36, 0x60, 0x12,\r
+0x05, 0x92, 0x28, 0xca, 0x00, 0x00, 0x02, 0x04,\r
+0x05, 0x92 };\r
+\r
+char pkt3[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x28, 0x09, 0x9e, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x0d, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc7, 0x36, 0x00, 0x00, 0x06, 0x69, 0x50, 0x10,\r
+0x42, 0xd8, 0x82, 0x3f, 0x00, 0x00 };\r
+\r
+char pkt4[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x02, 0x27, 0x09, 0x9f, 0x40, 0x00, 0x80, 0x06,\r
+0x6d, 0x0d, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc7, 0x36, 0x00, 0x00, 0x06, 0x69, 0x50, 0x18,\r
+0x42, 0xd8, 0x84, 0x3e, 0x00, 0x00, 0x47, 0x45,\r
+0x54, 0x20, 0x2f, 0x20, 0x48, 0x54, 0x54, 0x50,\r
+0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x41, 0x63,\r
+0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x69, 0x6d,\r
+0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0x2c,\r
+0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78,\r
+0x2d, 0x78, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70,\r
+0x2c, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,\r
+0x6a, 0x70, 0x65, 0x67, 0x2c, 0x20, 0x69, 0x6d,\r
+0x61, 0x67, 0x65, 0x2f, 0x70, 0x6a, 0x70, 0x65,\r
+0x67, 0x2c, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,\r
+0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,\r
+0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65, 0x78,\r
+0x63, 0x65, 0x6c, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x6d, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2c,\r
+0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,\r
+0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,\r
+0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77, 0x65,\r
+0x72, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2c, 0x20,\r
+0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,\r
+0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73,\r
+0x2d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,\r
+0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x70,\r
+0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,\r
+0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x78,\r
+0x62, 0x61, 0x70, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,\r
+0x78, 0x70, 0x73, 0x64, 0x6f, 0x63, 0x75, 0x6d,\r
+0x65, 0x6e, 0x74, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x78, 0x61, 0x6d, 0x6c, 0x2b, 0x78, 0x6d,\r
+0x6c, 0x2c, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, 0x0a,\r
+0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x4c,\r
+0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a,\r
+0x20, 0x65, 0x6e, 0x2d, 0x67, 0x62, 0x0d, 0x0a,\r
+0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x45,\r
+0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a,\r
+0x20, 0x67, 0x7a, 0x69, 0x70, 0x2c, 0x20, 0x64,\r
+0x65, 0x66, 0x6c, 0x61, 0x74, 0x65, 0x0d, 0x0a,\r
+0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65,\r
+0x6e, 0x74, 0x3a, 0x20, 0x4d, 0x6f, 0x7a, 0x69,\r
+0x6c, 0x6c, 0x61, 0x2f, 0x34, 0x2e, 0x30, 0x20,\r
+0x28, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69,\r
+0x62, 0x6c, 0x65, 0x3b, 0x20, 0x4d, 0x53, 0x49,\r
+0x45, 0x20, 0x36, 0x2e, 0x30, 0x3b, 0x20, 0x57,\r
+0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x20, 0x4e,\r
+0x54, 0x20, 0x35, 0x2e, 0x31, 0x3b, 0x20, 0x53,\r
+0x56, 0x31, 0x3b, 0x20, 0x47, 0x6f, 0x6f, 0x67,\r
+0x6c, 0x65, 0x54, 0x35, 0x3b, 0x20, 0x2e, 0x4e,\r
+0x45, 0x54, 0x20, 0x43, 0x4c, 0x52, 0x20, 0x32,\r
+0x2e, 0x30, 0x2e, 0x35, 0x30, 0x37, 0x32, 0x37,\r
+0x3b, 0x20, 0x2e, 0x4e, 0x45, 0x54, 0x20, 0x43,\r
+0x4c, 0x52, 0x20, 0x33, 0x2e, 0x30, 0x2e, 0x30,\r
+0x34, 0x35, 0x30, 0x36, 0x2e, 0x36, 0x34, 0x38,\r
+0x3b, 0x20, 0x2e, 0x4e, 0x45, 0x54, 0x20, 0x43,\r
+0x4c, 0x52, 0x20, 0x33, 0x2e, 0x35, 0x2e, 0x32,\r
+0x31, 0x30, 0x32, 0x32, 0x29, 0x0d, 0x0a, 0x48,\r
+0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32,\r
+0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31,\r
+0x32, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,\r
+0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x4b,\r
+0x65, 0x65, 0x70, 0x2d, 0x41, 0x6c, 0x69, 0x76,\r
+0x65, 0x0d, 0x0a, 0x0d, 0x0a };\r
+\r
+char pkt5[] = {\r
+0x00, 0x14, 0x22, 0xcb, 0x18, 0x2d, 0x00, 0x01,\r
+0x02, 0x45, 0x09, 0x11, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x2c, 0x00, 0x02, 0x00, 0x00, 0x40, 0x06,\r
+0xf8, 0xa5, 0xc0, 0xa8, 0x00, 0x0c, 0xc0, 0xa8,\r
+0x00, 0xc8, 0x00, 0x50, 0x0f, 0xe2, 0x00, 0x00,\r
+0x06, 0x68, 0x09, 0xe7, 0xc7, 0x36, 0x60, 0x12,\r
+0x05, 0x92, 0x28, 0xca, 0x00, 0x00, 0x02, 0x04,\r
+0x05, 0x92 };\r
+\r
+char pkt6[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x28, 0x09, 0xa1, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x0a, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc9, 0x35, 0x00, 0x00, 0x06, 0x69, 0x50, 0x10,\r
+0x42, 0xd8, 0x82, 0x3f, 0x00, 0x00 };\r
+\r
+char pkt7[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x02, 0x27, 0x09, 0xa2, 0x40, 0x00, 0x80, 0x06,\r
+0x6d, 0x0a, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc7, 0x36, 0x00, 0x00, 0x06, 0x69, 0x50, 0x18,\r
+0x42, 0xd8, 0x84, 0x3e, 0x00, 0x00, 0x47, 0x45,\r
+0x54, 0x20, 0x2f, 0x20, 0x48, 0x54, 0x54, 0x50,\r
+0x2f, 0x31, 0x2e, 0x31, 0x0d, 0x0a, 0x41, 0x63,\r
+0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x69, 0x6d,\r
+0x61, 0x67, 0x65, 0x2f, 0x67, 0x69, 0x66, 0x2c,\r
+0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x78,\r
+0x2d, 0x78, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70,\r
+0x2c, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f,\r
+0x6a, 0x70, 0x65, 0x67, 0x2c, 0x20, 0x69, 0x6d,\r
+0x61, 0x67, 0x65, 0x2f, 0x70, 0x6a, 0x70, 0x65,\r
+0x67, 0x2c, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,\r
+0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76,\r
+0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d, 0x65, 0x78,\r
+0x63, 0x65, 0x6c, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x6d, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2c,\r
+0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,\r
+0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x6e, 0x64,\r
+0x2e, 0x6d, 0x73, 0x2d, 0x70, 0x6f, 0x77, 0x65,\r
+0x72, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2c, 0x20,\r
+0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,\r
+0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73,\r
+0x2d, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,\r
+0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x70,\r
+0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,\r
+0x6e, 0x2f, 0x78, 0x2d, 0x6d, 0x73, 0x2d, 0x78,\r
+0x62, 0x61, 0x70, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x76, 0x6e, 0x64, 0x2e, 0x6d, 0x73, 0x2d,\r
+0x78, 0x70, 0x73, 0x64, 0x6f, 0x63, 0x75, 0x6d,\r
+0x65, 0x6e, 0x74, 0x2c, 0x20, 0x61, 0x70, 0x70,\r
+0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\r
+0x2f, 0x78, 0x61, 0x6d, 0x6c, 0x2b, 0x78, 0x6d,\r
+0x6c, 0x2c, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, 0x0a,\r
+0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x4c,\r
+0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3a,\r
+0x20, 0x65, 0x6e, 0x2d, 0x67, 0x62, 0x0d, 0x0a,\r
+0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x45,\r
+0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3a,\r
+0x20, 0x67, 0x7a, 0x69, 0x70, 0x2c, 0x20, 0x64,\r
+0x65, 0x66, 0x6c, 0x61, 0x74, 0x65, 0x0d, 0x0a,\r
+0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65,\r
+0x6e, 0x74, 0x3a, 0x20, 0x4d, 0x6f, 0x7a, 0x69,\r
+0x6c, 0x6c, 0x61, 0x2f, 0x34, 0x2e, 0x30, 0x20,\r
+0x28, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69,\r
+0x62, 0x6c, 0x65, 0x3b, 0x20, 0x4d, 0x53, 0x49,\r
+0x45, 0x20, 0x36, 0x2e, 0x30, 0x3b, 0x20, 0x57,\r
+0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x20, 0x4e,\r
+0x54, 0x20, 0x35, 0x2e, 0x31, 0x3b, 0x20, 0x53,\r
+0x56, 0x31, 0x3b, 0x20, 0x47, 0x6f, 0x6f, 0x67,\r
+0x6c, 0x65, 0x54, 0x35, 0x3b, 0x20, 0x2e, 0x4e,\r
+0x45, 0x54, 0x20, 0x43, 0x4c, 0x52, 0x20, 0x32,\r
+0x2e, 0x30, 0x2e, 0x35, 0x30, 0x37, 0x32, 0x37,\r
+0x3b, 0x20, 0x2e, 0x4e, 0x45, 0x54, 0x20, 0x43,\r
+0x4c, 0x52, 0x20, 0x33, 0x2e, 0x30, 0x2e, 0x30,\r
+0x34, 0x35, 0x30, 0x36, 0x2e, 0x36, 0x34, 0x38,\r
+0x3b, 0x20, 0x2e, 0x4e, 0x45, 0x54, 0x20, 0x43,\r
+0x4c, 0x52, 0x20, 0x33, 0x2e, 0x35, 0x2e, 0x32,\r
+0x31, 0x30, 0x32, 0x32, 0x29, 0x0d, 0x0a, 0x48,\r
+0x6f, 0x73, 0x74, 0x3a, 0x20, 0x31, 0x39, 0x32,\r
+0x2e, 0x31, 0x36, 0x38, 0x2e, 0x30, 0x2e, 0x31,\r
+0x32, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,\r
+0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x4b,\r
+0x65, 0x65, 0x70, 0x2d, 0x41, 0x6c, 0x69, 0x76,\r
+0x65, 0x0d, 0x0a, 0x0d, 0x0a };\r
+\r
+char pkt8[] = {\r
+0x00, 0x14, 0x22, 0xcb, 0x18, 0x2d, 0x00, 0x01,\r
+0x02, 0x45, 0x09, 0x11, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x2c, 0x00, 0x03, 0x00, 0x00, 0x40, 0x06,\r
+0xf8, 0xa4, 0xc0, 0xa8, 0x00, 0x0c, 0xc0, 0xa8,\r
+0x00, 0xc8, 0x00, 0x50, 0x0f, 0xe2, 0x00, 0x00,\r
+0x06, 0x68, 0x09, 0xe7, 0xc7, 0x36, 0x60, 0x12,\r
+0x05, 0x92, 0x28, 0xca, 0x00, 0x00, 0x02, 0x04,\r
+0x05, 0x92 };\r
+\r
+char pkt9[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x28, 0x09, 0xa3, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x08, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc9, 0x35, 0x00, 0x00, 0x06, 0x69, 0x50, 0x10,\r
+0x42, 0xd8, 0x82, 0x3f, 0x00, 0x00 };\r
+\r
+char pkt10[] = {\r
+0x00, 0x14, 0x22, 0xcb, 0x18, 0x2d, 0x00, 0x01,\r
+0x02, 0x45, 0x09, 0x11, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x2c, 0x00, 0x04, 0x00, 0x00, 0x40, 0x06,\r
+0xf8, 0xa3, 0xc0, 0xa8, 0x00, 0x0c, 0xc0, 0xa8,\r
+0x00, 0xc8, 0x00, 0x50, 0x0f, 0xe2, 0x00, 0x00,\r
+0x06, 0x68, 0x09, 0xe7, 0xc7, 0x36, 0x60, 0x12,\r
+0x05, 0x92, 0x28, 0xca, 0x00, 0x00, 0x02, 0x04,\r
+0x05, 0x92 };\r
+\r
+char pkt11[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x28, 0x09, 0xa6, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x05, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc9, 0x35, 0x00, 0x00, 0x06, 0x69, 0x50, 0x10,\r
+0x42, 0xd8, 0x82, 0x3f, 0x00, 0x00 };\r
+\r
+char pkt12[] = {\r
+0x00, 0x01, 0x02, 0x45, 0x09, 0x11, 0x00, 0x14,\r
+0x22, 0xcb, 0x18, 0x2d, 0x08, 0x00, 0x45, 0x00,\r
+0x00, 0x28, 0x09, 0xa7, 0x40, 0x00, 0x80, 0x06,\r
+0x6f, 0x04, 0xc0, 0xa8, 0x00, 0xc8, 0xc0, 0xa8,\r
+0x00, 0x0c, 0x0f, 0xe2, 0x00, 0x50, 0x09, 0xe7,\r
+0xc9, 0x35, 0x00, 0x00, 0x06, 0x69, 0x50, 0x14,\r
+0x00, 0x00, 0x43, 0xf4, 0x00, 0x00 };\r
+\r
+\r
+typedef struct\r
+{\r
+       char *pcData;\r
+       int iDataLen;\r
+} xPacketData;\r
+\r
+xPacketData xAllPackets[] =\r
+{\r
+       { pkt1, sizeof( pkt1 ) },\r
+//     { pkt2, sizeof( pkt2 ) },\r
+       { pkt3, sizeof( pkt3 ) },\r
+       { pkt4, sizeof( pkt4 ) },\r
+//     { pkt5, sizeof( pkt5 ) },\r
+       { pkt6, sizeof( pkt6 ) },\r
+       { pkt7, sizeof( pkt7 ) },\r
+       { pkt8, sizeof( pkt8 ) },\r
+       { pkt9, sizeof( pkt9 ) },\r
+       { pkt10, sizeof( pkt10 ) },\r
+//     { pkt11, sizeof( pkt11 ) },\r
+//     { pkt12, sizeof( pkt12 ) },\r
+//     { pkt13, sizeof( pkt13 ) },\r
+//     { pkt14, sizeof( pkt14 ) },\r
+//     { pkt15, sizeof( pkt15 ) },\r
+//     { pkt16, sizeof( pkt16 ) },\r
+};\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Win32-Extensions.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/Win32-Extensions.h
new file mode 100644 (file)
index 0000000..d3b063b
--- /dev/null
@@ -0,0 +1,113 @@
+/*\r
+ * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)\r
+ * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)\r
+ * All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies \r
+ * nor the names of its contributors may be used to endorse or promote \r
+ * products derived from this software without specific prior written \r
+ * permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ */\r
+\r
+#ifndef __WIN32_EXTENSIONS_H__\r
+#define __WIN32_EXTENSIONS_H__\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Definitions */\r
+\r
+/*!\r
+  \brief A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit().\r
+*/\r
+struct pcap_send_queue\r
+{\r
+       u_int maxlen;           ///< Maximum size of the the queue, in bytes. This variable contains the size of the buffer field.\r
+       u_int len;                      ///< Current size of the queue, in bytes.\r
+       char *buffer;           ///< Buffer containing the packets to be sent.\r
+};\r
+\r
+typedef struct pcap_send_queue pcap_send_queue;\r
+\r
+/*!\r
+  \brief This typedef is a support for the pcap_get_airpcap_handle() function\r
+*/\r
+#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)\r
+#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_\r
+typedef struct _AirpcapHandle *PAirpcapHandle;\r
+#endif\r
+\r
+#define                BPF_MEM_EX_IMM  0xc0\r
+#define                BPF_MEM_EX_IND  0xe0\r
+\r
+/*used for ST*/\r
+#define                BPF_MEM_EX              0xc0\r
+#define                BPF_TME                                 0x08\r
+\r
+#define                BPF_LOOKUP                              0x90   \r
+#define                BPF_EXECUTE                             0xa0\r
+#define                BPF_INIT                                0xb0\r
+#define                BPF_VALIDATE                    0xc0\r
+#define                BPF_SET_ACTIVE                  0xd0\r
+#define                BPF_RESET                               0xe0\r
+#define                BPF_SET_MEMORY                  0x80\r
+#define                BPF_GET_REGISTER_VALUE  0x70\r
+#define                BPF_SET_REGISTER_VALUE  0x60\r
+#define                BPF_SET_WORKING                 0x50\r
+#define                BPF_SET_ACTIVE_READ             0x40\r
+#define                BPF_SET_AUTODELETION    0x30\r
+#define                BPF_SEPARATION                  0xff\r
+\r
+/* Prototypes */\r
+pcap_send_queue* pcap_sendqueue_alloc(u_int memsize);\r
+\r
+void pcap_sendqueue_destroy(pcap_send_queue* queue);\r
+\r
+int pcap_sendqueue_queue(pcap_send_queue* queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data);\r
+\r
+u_int pcap_sendqueue_transmit(pcap_t *p, pcap_send_queue* queue, int sync);\r
+\r
+HANDLE pcap_getevent(pcap_t *p);\r
+\r
+struct pcap_stat *pcap_stats_ex(pcap_t *p, int *pcap_stat_size);\r
+\r
+int pcap_setuserbuffer(pcap_t *p, int size);\r
+\r
+int pcap_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks);\r
+\r
+int pcap_live_dump_ended(pcap_t *p, int sync);\r
+\r
+int pcap_offline_filter(struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data);\r
+\r
+int pcap_start_oem(char* err_str, int flags);\r
+\r
+PAirpcapHandle pcap_get_airpcap_handle(pcap_t *p);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif //__WIN32_EXTENSIONS_H__\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/arch.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/arch.c
new file mode 100644 (file)
index 0000000..532ac35
--- /dev/null
@@ -0,0 +1,383 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/* WinPCap includes. */\r
+#include "pcap.h"\r
+#include "remote-ext.h"\r
+\r
+/* uIP includes. */\r
+#include "net/uip.h"\r
+#include "net/uip_arp.h"\r
+#include "net/clock-arch.h"\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+\r
+/*\r
+ * Query the computer the simulation is being executed on to find the network\r
+ * interfaces it has installed.\r
+ */\r
+static pcap_if_t * prvPrintAvailableNetworkInterfaces( void );\r
+\r
+/*\r
+ * Open the network interface.  The number of the interface to be opened is set\r
+ * by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.\r
+ */\r
+static void prvOpenSelectedNetworkInterface( pcap_if_t *pxAllNetworkInterfaces );\r
+\r
+/*\r
+ * Configure the capture filter to allow blocking reads, and to filter out\r
+ * packets that are not of interest to this demo.\r
+ */\r
+static void prvConfigureCaptureBehaviour( void );\r
+\r
+pcap_t *pxOpenedInterfaceHandle = NULL;\r
+LARGE_INTEGER freq, sys_start_time;\r
+\r
+#define archNUM_BUFFERS        5\r
+#define archNUM_BUFFER_POINTERS ( archNUM_BUFFERS - 1 )\r
+\r
+static void prvInterruptSimulator( void *pvParameters );\r
+\r
+static unsigned char ucEthernetBuffer[ archNUM_BUFFERS ][ UIP_CONF_BUFFER_SIZE ];\r
+static unsigned char *pucEthernetBufferPointers[ archNUM_BUFFER_POINTERS ];\r
+\r
+static long lLengthOfDataInBuffer[ archNUM_BUFFER_POINTERS ] = { 0 };\r
+static unsigned char ucNextBufferToFill = 0U, ucNextBufferToProcess = 0U;\r
+\r
+unsigned char *uip_buf = NULL;\r
+char cErrorBuffer[PCAP_ERRBUF_SIZE];\r
+\r
+void vNetifTx( void )\r
+{\r
+       pcap_sendpacket( pxOpenedInterfaceHandle, uip_buf, uip_len );\r
+       pcap_sendpacket( pxOpenedInterfaceHandle, uip_buf, uip_len );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned portBASE_TYPE uxNetifRx( void )\r
+{\r
+unsigned portBASE_TYPE xDataLen;\r
+unsigned char *pucTemp;\r
+\r
+       /* Check there is really data available. */\r
+       xDataLen = lLengthOfDataInBuffer[ ucNextBufferToProcess ];\r
+       if( xDataLen != 0L )\r
+       {\r
+\r
+               /* The buffer pointed to by uip_buf is going to change.  Remember which\r
+               buffer uip_buf is currently pointing to. */\r
+               pucTemp = uip_buf;\r
+\r
+               /* Point uip_buf at the next buffer that contains data. */\r
+               uip_buf = pucEthernetBufferPointers[ ucNextBufferToProcess ];\r
+\r
+               /* The buffer pointed to by \r
+               pucEthernetBufferPointeres[ ucNextBufferToProcess ] is now in use by\r
+               uip_buf, but the buffer uip_buf was pointing to on entry to this\r
+               function is free.  Set \r
+               pucEthernetBufferPointeres[ ucNextBufferToProcess ] to the free \r
+               buffer. */\r
+               pucEthernetBufferPointers[ ucNextBufferToProcess ] = pucTemp;\r
+               lLengthOfDataInBuffer[ ucNextBufferToProcess ] = 0L;\r
+\r
+               ucNextBufferToProcess++;\r
+               if( ucNextBufferToProcess >= archNUM_BUFFER_POINTERS )\r
+               {\r
+                       ucNextBufferToProcess = 0L;\r
+               }\r
+       }\r
+\r
+       return xDataLen;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetifInit( void )\r
+{\r
+portBASE_TYPE x;\r
+pcap_if_t *pxAllNetworkInterfaces;\r
+\r
+       /* Allocate a free buffer to each buffer pointer. */\r
+       for( x = 0; x < sizeof( pucEthernetBufferPointers ) / sizeof( unsigned char * ); x++ )\r
+       {\r
+               pucEthernetBufferPointers[ x ] = &( ucEthernetBuffer[ x ][ 0 ] );\r
+       }\r
+\r
+       /* Start with uip_buf pointing to a buffer that is not referenced from the\r
+       pucEthernetBufferPointers[] array. */\r
+       uip_buf = &( ucEthernetBuffer[ archNUM_BUFFERS - 1 ][ 0 ] );\r
+\r
+       /* Query the computer the simulation is being executed on to find the \r
+       network interfaces it has installed. */\r
+       pxAllNetworkInterfaces = prvPrintAvailableNetworkInterfaces();\r
+       \r
+       /* Open the network interface.  The number of the interface to be opened is \r
+       set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.\r
+       Calling this function will set the pxOpenedInterfaceHandle variable.  If,\r
+       after calling this function, pxOpenedInterfaceHandle is equal to NULL, then\r
+       the interface could not be opened. */\r
+       if( pxAllNetworkInterfaces != NULL )\r
+       {\r
+               prvOpenSelectedNetworkInterface( pxAllNetworkInterfaces );\r
+       }\r
+       \r
+\r
+       return x;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static pcap_if_t * prvPrintAvailableNetworkInterfaces( void )\r
+{    \r
+pcap_if_t * pxAllNetworkInterfaces = NULL, *xInterface;\r
+long lInterfaceNumber = 1;\r
+\r
+    if( pcap_findalldevs_ex( PCAP_SRC_IF_STRING, NULL, &pxAllNetworkInterfaces, cErrorBuffer ) == -1 )\r
+    {\r
+        printf( "\r\nCould not obtain a list of network interfaces\r\n%s\r\n", cErrorBuffer );\r
+        pxAllNetworkInterfaces = NULL;\r
+    }\r
+\r
+       if( pxAllNetworkInterfaces != NULL )\r
+       {\r
+               /* Print out the list of network interfaces.  The first in the list\r
+               is interface '1', not interface '0'. */\r
+               for( xInterface = pxAllNetworkInterfaces; xInterface != NULL; xInterface = xInterface->next )\r
+               {\r
+                       printf( "%d. %s", lInterfaceNumber, xInterface->name );\r
+                       \r
+                       if( xInterface->description != NULL )\r
+                       {\r
+                               printf( " (%s)\r\n", xInterface->description );\r
+                       }\r
+                       else\r
+                       {\r
+                               printf( " (No description available)\r\n") ;\r
+                       }\r
+                       \r
+                       lInterfaceNumber++;\r
+               }\r
+       }\r
+\r
+    if( lInterfaceNumber == 1 )\r
+    {\r
+               /* The interface number was never incremented, so the above for() loop\r
+               did not execute meaning no interfaces were found. */\r
+        printf( " \r\nNo network interfaces were found.\r\n" );\r
+        pxAllNetworkInterfaces = NULL;\r
+    }\r
+\r
+       printf( "\r\nThe interface that will be opened is set by configNETWORK_INTERFACE_TO_USE which should be defined in FreeRTOSConfig.h\r\n" );\r
+       printf( "Attempting to open interface number %d.\r\n", configNETWORK_INTERFACE_TO_USE );\r
+       \r
+    if( ( configNETWORK_INTERFACE_TO_USE < 1L ) || ( configNETWORK_INTERFACE_TO_USE > lInterfaceNumber ) )\r
+    {\r
+        printf("\r\nconfigNETWORK_INTERFACE_TO_USE is not in the valid range.\r\n" );\r
+               \r
+               if( pxAllNetworkInterfaces != NULL )\r
+               {\r
+                       /* Free the device list, as no devices are going to be opened. */\r
+                       pcap_freealldevs( pxAllNetworkInterfaces );\r
+                       pxAllNetworkInterfaces = NULL;\r
+               }\r
+    }\r
+\r
+       return pxAllNetworkInterfaces;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvOpenSelectedNetworkInterface( pcap_if_t *pxAllNetworkInterfaces )\r
+{\r
+pcap_if_t *xInterface;\r
+long x;\r
+\r
+    /* Walk the list of devices until the selected device is located. */\r
+       xInterface = pxAllNetworkInterfaces;\r
+    for( x = 0L; x < ( configNETWORK_INTERFACE_TO_USE - 1L ); x++ )\r
+       {\r
+               xInterface = xInterface->next;\r
+       }\r
+\r
+    /* Open the selected interface. */\r
+       pxOpenedInterfaceHandle = pcap_open(    xInterface->name,               /* The name of the selected interface. */\r
+                                                                                       UIP_CONF_BUFFER_SIZE,           /* The size of the packet to capture. */\r
+                                                                                       PCAP_OPENFLAG_PROMISCUOUS,      /* Open in promiscious mode as the MAC and \r
+                                                                                                                                               IP address is going to be "simulated", and \r
+                                                                                                                                               not be the real MAC and IP address.  This allows\r
+                                                                                                                                               trafic to the simulated IP address to be routed\r
+                                                                                                                                               to uIP, and trafic to the real IP address to be\r
+                                                                                                                                               routed to the Windows TCP/IP stack. */\r
+                                                                                       0xfffffffL,                     /* The read time out.  This is going to block\r
+                                                                                                                                               until data is available. */\r
+                                                                                       NULL,                                   /* No authentication is required as this is\r
+                                                                                                                                               not a remote capture session. */\r
+                                                                                       cErrorBuffer            \r
+                                                                          );\r
+                                                                          \r
+    if ( pxOpenedInterfaceHandle == NULL )\r
+    {\r
+        printf( "\r\n%s is not supported by WinPcap and cannot be opened\r\n", xInterface->name );\r
+    }\r
+       else\r
+       {\r
+               /* Configure the capture filter to allow blocking reads, and to filter \r
+               out packets that are not of interest to this demo. */\r
+               prvConfigureCaptureBehaviour();\r
+       }\r
+\r
+       /* The device list is no longer required. */\r
+       pcap_freealldevs( pxAllNetworkInterfaces );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvConfigureCaptureBehaviour( void )\r
+{\r
+struct bpf_program xFilterCode;\r
+const long lMinBytesToCopy = 10L, lBlocking = 0L;\r
+unsigned long ulNetMask;\r
+\r
+       /* Unblock a read as soon as anything is received. */\r
+       pcap_setmintocopy( pxOpenedInterfaceHandle, lMinBytesToCopy );\r
+\r
+       /* Allow blocking. */\r
+       pcap_setnonblock( pxOpenedInterfaceHandle, lBlocking, cErrorBuffer );\r
+\r
+       /* Set up a filter so only the packets of interest are passed to the uIP\r
+       stack.  cErrorBuffer is used for convenience to create the string.  Don't\r
+       confuse this with an error message. */\r
+       sprintf( cErrorBuffer, "broadcast or multicast or host %d.%d.%d.%d", configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 );\r
+\r
+       ulNetMask = ( configNET_MASK3 << 24UL ) | ( configNET_MASK2 << 16UL ) | ( configNET_MASK1 << 8L ) | configNET_MASK0;\r
+\r
+       if( pcap_compile(pxOpenedInterfaceHandle, &xFilterCode, cErrorBuffer, 1, ulNetMask ) < 0 )\r
+    {\r
+        printf("\r\nThe packet filter string is invalid\r\n" );\r
+    }\r
+       else\r
+       {    \r
+               if( pcap_setfilter( pxOpenedInterfaceHandle, &xFilterCode ) < 0 )\r
+               {\r
+                       printf( "\r\nAn error occurred setting the packet filter.\r\n" );\r
+               }\r
+       }\r
+\r
+       /* Create a task that simulates an interrupt in a real system.  This will\r
+       block waiting for packets, then send a message to the uIP task when data\r
+       is available. */\r
+       xTaskCreate( prvInterruptSimulator, ( signed char * ) "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, ( configuIP_TASK_PRIORITY - 1 ), NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvInterruptSimulator( void *pvParameters )\r
+{\r
+static struct pcap_pkthdr *pxHeader;\r
+const unsigned char *pucPacketData;\r
+extern xQueueHandle xEMACEventQueue;\r
+const unsigned long ulRxEvent = uipETHERNET_RX_EVENT;\r
+long lResult;\r
+\r
+       /* Just to kill the compiler warning. */\r
+       ( void ) pvParameters;\r
+\r
+       for( ;; )\r
+       {\r
+               /* Get the next packet. */\r
+               lResult = pcap_next_ex( pxOpenedInterfaceHandle, &pxHeader, &pucPacketData );\r
+               if( lResult )\r
+               {\r
+                       /* Is the next buffer into which data should be placed free? */\r
+                       if( lLengthOfDataInBuffer[ ucNextBufferToFill ] == 0L )\r
+                       {\r
+                               /* Copy the data from the captured packet into the buffer. */\r
+                               memcpy( pucEthernetBufferPointers[ ucNextBufferToFill ], pucPacketData, pxHeader->len );\r
+\r
+                               /* Note the amount of data that was copied. */\r
+                               lLengthOfDataInBuffer[ ucNextBufferToFill ] = pxHeader->len;\r
+\r
+                               /* Move onto the next buffer, wrapping around if necessary. */\r
+                               ucNextBufferToFill++;\r
+                               if( ucNextBufferToFill >= archNUM_BUFFER_POINTERS )\r
+                               {\r
+                                       ucNextBufferToFill = 0U;\r
+                               }\r
+\r
+                               /* Data was received and stored.  Send a message to the uIP task\r
+                               to let it know. */\r
+                               xQueueSendToBack( xEMACEventQueue, &ulRxEvent, portMAX_DELAY );\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/bittypes.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/bittypes.h
new file mode 100644 (file)
index 0000000..f55fcec
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 1999 WIDE Project.
+ * 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. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS 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 _BITTYPES_H
+#define _BITTYPES_H
+
+#ifndef HAVE_U_INT8_T
+
+#if SIZEOF_CHAR == 1
+typedef unsigned char u_int8_t;
+typedef signed char _int8_t;
+#elif SIZEOF_INT == 1
+typedef unsigned int u_int8_t;
+typedef signed int int8_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int8_t"
+#endif
+#define HAVE_U_INT8_T 1
+#define HAVE_INT8_T 1
+
+#endif /* HAVE_U_INT8_T */
+
+#ifndef HAVE_U_INT16_T 
+
+#if SIZEOF_SHORT == 2
+typedef unsigned short u_int16_t;
+typedef signed short _int16_t;
+#elif SIZEOF_INT == 2
+typedef unsigned int u_int16_t;
+typedef signed int int16_t;
+#elif SIZEOF_CHAR == 2
+typedef unsigned char u_int16_t;
+typedef signed char int16_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int16_t"
+#endif
+#define HAVE_U_INT16_T 1
+#define HAVE_INT16_T 1
+
+#endif /* HAVE_U_INT16_T */
+
+#ifndef HAVE_U_INT32_T
+
+#if SIZEOF_INT == 4
+typedef unsigned int u_int32_t;
+typedef signed int _int32_t;
+#elif SIZEOF_LONG == 4
+typedef unsigned long u_int32_t;
+typedef signed long int32_t;
+#elif SIZEOF_SHORT == 4
+typedef unsigned short u_int32_t;
+typedef signed short int32_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int32_t"
+#endif
+#define HAVE_U_INT32_T 1
+#define HAVE_INT32_T 1
+
+#endif /* HAVE_U_INT32_T */
+
+#ifndef HAVE_U_INT64_T
+#if SIZEOF_LONG_LONG == 8
+typedef unsigned long long u_int64_t;
+typedef long long int64_t;
+#elif defined(_MSC_EXTENSIONS)
+typedef unsigned _int64 u_int64_t;
+typedef _int64 int64_t;
+#elif SIZEOF_INT == 8
+typedef unsigned int u_int64_t;
+#elif SIZEOF_LONG == 8
+typedef unsigned long u_int64_t;
+#elif SIZEOF_SHORT == 8
+typedef unsigned short u_int64_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int64_t"
+#endif
+
+#endif /* HAVE_U_INT64_T */
+
+#ifndef PRId64
+#ifdef _MSC_EXTENSIONS
+#define PRId64 "I64d"
+#else /* _MSC_EXTENSIONS */
+#define PRId64 "lld"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRId64 */
+
+#ifndef PRIo64
+#ifdef _MSC_EXTENSIONS
+#define PRIo64 "I64o"
+#else /* _MSC_EXTENSIONS */
+#define PRIo64 "llo"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIo64 */
+
+#ifndef PRIx64
+#ifdef _MSC_EXTENSIONS
+#define PRIx64 "I64x"
+#else /* _MSC_EXTENSIONS */
+#define PRIx64 "llx"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIx64 */
+
+#ifndef PRIu64
+#ifdef _MSC_EXTENSIONS
+#define PRIu64 "I64u"
+#else /* _MSC_EXTENSIONS */
+#define PRIu64 "llu"
+#endif /* _MSC_EXTENSIONS */
+#endif /* PRIu64 */
+
+#endif /* _BITTYPES_H */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/ip6_misc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/ip6_misc.h
new file mode 100644 (file)
index 0000000..562fa61
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 1993, 1994, 1997
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/Win32/Include/ip6_misc.h,v 1.5 2006-01-22 18:02:18 gianluca Exp $ (LBL)
+ */
+
+/*
+ * This file contains a collage of declarations for IPv6 from FreeBSD not present in Windows
+ */
+
+#include <winsock2.h>
+
+#include <ws2tcpip.h>
+
+#ifndef __MINGW32__
+#define        IN_MULTICAST(a)         IN_CLASSD(a)
+#endif
+
+#define        IN_EXPERIMENTAL(a)      ((((u_int32_t) (a)) & 0xf0000000) == 0xf0000000)
+
+#define        IN_LOOPBACKNET          127
+
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
+/* IPv6 address */
+struct in6_addr
+  {
+    union
+      {
+       u_int8_t                u6_addr8[16];
+       u_int16_t       u6_addr16[8];
+       u_int32_t       u6_addr32[4];
+      } in6_u;
+#define s6_addr                        in6_u.u6_addr8
+#define s6_addr16              in6_u.u6_addr16
+#define s6_addr32              in6_u.u6_addr32
+#define s6_addr64              in6_u.u6_addr64
+  };
+
+#define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
+#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
+#endif /* __MINGW32__ */
+
+
+#if (defined _MSC_VER) || (defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF))
+typedef unsigned short sa_family_t;
+#endif
+
+
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
+
+#define        __SOCKADDR_COMMON(sa_prefix) \
+  sa_family_t sa_prefix##family
+
+/* Ditto, for IPv6.  */
+struct sockaddr_in6
+  {
+    __SOCKADDR_COMMON (sin6_);
+    u_int16_t sin6_port;               /* Transport layer port # */
+    u_int32_t sin6_flowinfo;   /* IPv6 flow information */
+    struct in6_addr sin6_addr; /* IPv6 address */
+  };
+
+#define IN6_IS_ADDR_V4MAPPED(a) \
+       ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
+        (((u_int32_t *) (a))[2] == htonl (0xffff)))
+
+#define IN6_IS_ADDR_MULTICAST(a) (((u_int8_t *) (a))[0] == 0xff)
+
+#define IN6_IS_ADDR_LINKLOCAL(a) \
+       ((((u_int32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000))
+
+#define IN6_IS_ADDR_LOOPBACK(a) \
+       (((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \
+        ((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1))
+#endif /* __MINGW32__ */
+
+#define ip6_vfc   ip6_ctlun.ip6_un2_vfc
+#define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow
+#define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen
+#define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt
+#define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim
+#define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim
+
+#define nd_rd_type               nd_rd_hdr.icmp6_type
+#define nd_rd_code               nd_rd_hdr.icmp6_code
+#define nd_rd_cksum              nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved           nd_rd_hdr.icmp6_data32[0]
+
+/*
+ *     IPV6 extension headers
+ */
+#define IPPROTO_HOPOPTS                0       /* IPv6 hop-by-hop options      */
+#define IPPROTO_IPV6           41  /* IPv6 header.  */
+#define IPPROTO_ROUTING                43      /* IPv6 routing header          */
+#define IPPROTO_FRAGMENT       44      /* IPv6 fragmentation header    */
+#define IPPROTO_ESP            50      /* encapsulating security payload */
+#define IPPROTO_AH             51      /* authentication header        */
+#define IPPROTO_ICMPV6         58      /* ICMPv6                       */
+#define IPPROTO_NONE           59      /* IPv6 no next header          */
+#define IPPROTO_DSTOPTS                60      /* IPv6 destination options     */
+#define IPPROTO_PIM                    103 /* Protocol Independent Multicast.  */
+
+#define         IPV6_RTHDR_TYPE_0 0
+
+/* Option types and related macros */
+#define IP6OPT_PAD1            0x00    /* 00 0 00000 */
+#define IP6OPT_PADN            0x01    /* 00 0 00001 */
+#define IP6OPT_JUMBO           0xC2    /* 11 0 00010 = 194 */
+#define IP6OPT_JUMBO_LEN       6
+#define IP6OPT_ROUTER_ALERT    0x05    /* 00 0 00101 */
+
+#define IP6OPT_RTALERT_LEN     4
+#define IP6OPT_RTALERT_MLD     0       /* Datagram contains an MLD message */
+#define IP6OPT_RTALERT_RSVP    1       /* Datagram contains an RSVP message */
+#define IP6OPT_RTALERT_ACTNET  2       /* contains an Active Networks msg */
+#define IP6OPT_MINLEN          2
+
+#define IP6OPT_BINDING_UPDATE  0xc6    /* 11 0 00110 */
+#define IP6OPT_BINDING_ACK     0x07    /* 00 0 00111 */
+#define IP6OPT_BINDING_REQ     0x08    /* 00 0 01000 */
+#define IP6OPT_HOME_ADDRESS    0xc9    /* 11 0 01001 */
+#define IP6OPT_EID             0x8a    /* 10 0 01010 */
+
+#define IP6OPT_TYPE(o)         ((o) & 0xC0)
+#define IP6OPT_TYPE_SKIP       0x00
+#define IP6OPT_TYPE_DISCARD    0x40
+#define IP6OPT_TYPE_FORCEICMP  0x80
+#define IP6OPT_TYPE_ICMP       0xC0
+
+#define IP6OPT_MUTABLE         0x20
+
+
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)
+#ifndef EAI_ADDRFAMILY
+struct addrinfo {
+       int     ai_flags;       /* AI_PASSIVE, AI_CANONNAME */
+       int     ai_family;      /* PF_xxx */
+       int     ai_socktype;    /* SOCK_xxx */
+       int     ai_protocol;    /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+       size_t  ai_addrlen;     /* length of ai_addr */
+       char    *ai_canonname;  /* canonical name for hostname */
+       struct sockaddr *ai_addr;       /* binary address */
+       struct addrinfo *ai_next;       /* next structure in linked list */
+};
+#endif
+#endif /* __MINGW32__ */
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/netif.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/netif.h
new file mode 100644 (file)
index 0000000..1af9a4c
--- /dev/null
@@ -0,0 +1,99 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+#ifndef NET_IF_H\r
+#define NET_IF_H\r
+\r
+/*\r
+ * Send uip_len bytes from uip_buf to the network interface selected by the \r
+ * configNETWORK_INTERFACE_TO_USE constant (defined in FreeRTOSConfig.h). \r
+ */\r
+void vNetifTx( void );\r
+\r
+/*\r
+ * Receive bytes from the network interface selected by the \r
+ * configNETWORK_INTERFACE_TO_USE constant (defined in FreeRTOSConfig.h).  The\r
+ * bytes are placed in uip_buf.  The number of bytes copied into uip_buf is\r
+ * returned.\r
+ */\r
+unsigned portBASE_TYPE uxNetifRx( void );\r
+\r
+/*\r
+ * Prepare a packet capture session.  This will print out all the network \r
+ * interfaces available, and the one actually used is set by the \r
+ * configNETWORK_INTERFACE_TO_USE constant that is defined in \r
+ * FreeRTOSConfig.h. */\r
+portBASE_TYPE xNetifInit( void );\r
+\r
+#endif /* NET_IF_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-bpf.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-bpf.h
new file mode 100644 (file)
index 0000000..5fe129d
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from the Stanford/CMU enet packet filter,
+ * (net/enet.c) distributed as part of 4.3BSD, and code contributed
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 
+ * Berkeley Laboratory.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.50 2007/04/01 21:43:55 guy Exp $ (LBL)
+ */
+
+/*
+ * For backwards compatibility.
+ *
+ * Note to OS vendors: do NOT get rid of this file!  Some applications
+ * might expect to be able to include <pcap-bpf.h>.
+ */
+#include <pcap/bpf.h>
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-namedb.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-namedb.h
new file mode 100644 (file)
index 0000000..80a2f00
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1994, 1996
+ *     The Regents of the University of California.  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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the Computer Systems
+ *     Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap-namedb.h,v 1.13 2006/10/04 18:13:32 guy Exp $ (LBL)
+ */
+
+/*
+ * For backwards compatibility.
+ *
+ * Note to OS vendors: do NOT get rid of this file!  Some applications
+ * might expect to be able to include <pcap-namedb.h>.
+ */
+#include <pcap/namedb.h>
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-stdinc.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap-stdinc.h
new file mode 100644 (file)
index 0000000..f1ea03f
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
+ * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
+ * 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. Neither the name of the Politecnico di Torino nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL)
+ */
+
+#define SIZEOF_CHAR 1
+#define SIZEOF_SHORT 2
+#define SIZEOF_INT 4
+#ifndef _MSC_EXTENSIONS
+#define SIZEOF_LONG_LONG 8
+#endif
+
+/*
+ * Avoids a compiler warning in case this was already defined      
+ * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
+ * to prevent it from including 'winsock.h')
+ */
+#ifdef _WINSOCKAPI_
+#undef _WINSOCKAPI_
+#endif
+//_RB_#include <winsock2.h>
+
+#include <fcntl.h>
+
+#include "bittypes.h"
+#include <time.h>
+#include <io.h>
+
+#ifndef __MINGW32__
+#include "IP6_misc.h"
+#endif
+
+#define caddr_t char*
+
+#if _MSC_VER < 1500
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#define strdup _strdup
+#endif
+
+#define inline __inline 
+
+#ifdef __MINGW32__
+#include <stdint.h>
+#else /*__MINGW32__*/
+/* MSVC compiler */
+#ifndef _UINTPTR_T_DEFINED
+#ifdef  _WIN64
+typedef unsigned __int64    uintptr_t;
+#else
+typedef _W64 unsigned int   uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+
+#ifndef _INTPTR_T_DEFINED
+#ifdef  _WIN64
+typedef __int64    intptr_t;
+#else
+typedef _W64 int   intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif 
+
+#endif /*__MINGW32__*/
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap.h
new file mode 100644 (file)
index 0000000..ad8fc40
--- /dev/null
@@ -0,0 +1,407 @@
+/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996, 1997
+ *     The Regents of the University of California.  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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the Computer Systems
+ *     Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/pcap.h,v 1.4.2.11 2008-10-06 15:38:39 gianluca Exp $ (LBL)
+ */
+
+#ifndef lib_pcap_pcap_h
+#define lib_pcap_pcap_h
+
+#if defined(WIN32)
+  #include <pcap-stdinc.h>
+#elif defined(MSDOS)
+  #include <sys/types.h>
+  #include <sys/socket.h>  /* u_int, u_char etc. */
+#else /* UN*X */
+  #include <sys/types.h>
+  #include <sys/time.h>
+#endif /* WIN32/MSDOS/UN*X */
+
+#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap/bpf.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_REMOTE
+       // We have to define the SOCKET here, although it has been defined in sockutils.h
+       // This is to avoid the distribution of the 'sockutils.h' file around
+       // (for example in the WinPcap developer's pack)
+       #ifndef SOCKET
+               #ifdef WIN32
+                       #define SOCKET unsigned int
+               #else
+                       #define SOCKET int
+               #endif
+       #endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PCAP_VERSION_MAJOR 2
+#define PCAP_VERSION_MINOR 4
+
+#define PCAP_ERRBUF_SIZE 256
+
+/*
+ * Compatibility for systems that have a bpf.h that
+ * predates the bpf typedefs for 64-bit support.
+ */
+#if BPF_RELEASE - 0 < 199406
+typedef        int bpf_int32;
+typedef        u_int bpf_u_int32;
+#endif
+
+typedef struct pcap pcap_t;
+typedef struct pcap_dumper pcap_dumper_t;
+typedef struct pcap_if pcap_if_t;
+typedef struct pcap_addr pcap_addr_t;
+
+/*
+ * The first record in the file contains saved values for some
+ * of the flags used in the printout phases of tcpdump.
+ * Many fields here are 32 bit ints so compilers won't insert unwanted
+ * padding; these files need to be interchangeable across architectures.
+ *
+ * Do not change the layout of this structure, in any way (this includes
+ * changes that only affect the length of fields in this structure).
+ *
+ * Also, do not change the interpretation of any of the members of this
+ * structure, in any way (this includes using values other than
+ * LINKTYPE_ values, as defined in "savefile.c", in the "linktype"
+ * field).
+ *
+ * Instead:
+ *
+ *     introduce a new structure for the new format, if the layout
+ *     of the structure changed;
+ *
+ *     send mail to "tcpdump-workers@lists.tcpdump.org", requesting
+ *     a new magic number for your new capture file format, and, when
+ *     you get the new magic number, put it in "savefile.c";
+ *
+ *     use that magic number for save files with the changed file
+ *     header;
+ *
+ *     make the code in "savefile.c" capable of reading files with
+ *     the old file header as well as files with the new file header
+ *     (using the magic number to determine the header format).
+ *
+ * Then supply the changes as a patch at
+ *
+ *     http://sourceforge.net/projects/libpcap/
+ *
+ * so that future versions of libpcap and programs that use it (such as
+ * tcpdump) will be able to read your new capture file format.
+ */
+struct pcap_file_header {
+       bpf_u_int32 magic;
+       u_short version_major;
+       u_short version_minor;
+       bpf_int32 thiszone;     /* gmt to local correction */
+       bpf_u_int32 sigfigs;    /* accuracy of timestamps */
+       bpf_u_int32 snaplen;    /* max length saved portion of each pkt */
+       bpf_u_int32 linktype;   /* data link type (LINKTYPE_*) */
+};
+
+/*
+ * Macros for the value returned by pcap_datalink_ext().
+ * 
+ * If LT_FCS_LENGTH_PRESENT(x) is true, the LT_FCS_LENGTH(x) macro
+ * gives the FCS length of packets in the capture.
+ */
+#define LT_FCS_LENGTH_PRESENT(x)       ((x) & 0x04000000)
+#define LT_FCS_LENGTH(x)               (((x) & 0xF0000000) >> 28)
+#define LT_FCS_DATALINK_EXT(x)         ((((x) & 0xF) << 28) | 0x04000000)
+
+typedef enum {
+       PCAP_D_INOUT = 0,
+       PCAP_D_IN,
+       PCAP_D_OUT
+} pcap_direction_t;
+
+/*
+ * Generic per-packet information, as supplied by libpcap.
+ *
+ * The time stamp can and should be a "struct timeval", regardless of
+ * whether your system supports 32-bit tv_sec in "struct timeval",
+ * 64-bit tv_sec in "struct timeval", or both if it supports both 32-bit
+ * and 64-bit applications.  The on-disk format of savefiles uses 32-bit
+ * tv_sec (and tv_usec); this structure is irrelevant to that.  32-bit
+ * and 64-bit versions of libpcap, even if they're on the same platform,
+ * should supply the appropriate version of "struct timeval", even if
+ * that's not what the underlying packet capture mechanism supplies.
+ */
+struct pcap_pkthdr {
+       struct timeval ts;      /* time stamp */
+       bpf_u_int32 caplen;     /* length of portion present */
+       bpf_u_int32 len;        /* length this packet (off wire) */
+};
+
+/*
+ * As returned by the pcap_stats()
+ */
+struct pcap_stat {
+       u_int ps_recv;          /* number of packets received */
+       u_int ps_drop;          /* number of packets dropped */
+       u_int ps_ifdrop;        /* drops by interface XXX not yet supported */
+#ifdef HAVE_REMOTE
+       u_int ps_capt;          /* number of packets that are received by the application; please get rid off the Win32 ifdef */
+       u_int ps_sent;          /* number of packets sent by the server on the network */
+       u_int ps_netdrop;       /* number of packets lost on the network */
+#endif /* HAVE_REMOTE */
+};
+
+#ifdef MSDOS
+/*
+ * As returned by the pcap_stats_ex()
+ */
+struct pcap_stat_ex {
+       u_long  rx_packets;        /* total packets received       */
+       u_long  tx_packets;        /* total packets transmitted    */
+       u_long  rx_bytes;          /* total bytes received         */
+       u_long  tx_bytes;          /* total bytes transmitted      */
+       u_long  rx_errors;         /* bad packets received         */
+       u_long  tx_errors;         /* packet transmit problems     */
+       u_long  rx_dropped;        /* no space in Rx buffers       */
+       u_long  tx_dropped;        /* no space available for Tx    */
+       u_long  multicast;         /* multicast packets received   */
+       u_long  collisions;
+
+       /* detailed rx_errors: */
+       u_long  rx_length_errors;
+       u_long  rx_over_errors;    /* receiver ring buff overflow  */
+       u_long  rx_crc_errors;     /* recv'd pkt with crc error    */
+       u_long  rx_frame_errors;   /* recv'd frame alignment error */
+       u_long  rx_fifo_errors;    /* recv'r fifo overrun          */
+       u_long  rx_missed_errors;  /* recv'r missed packet         */
+
+       /* detailed tx_errors */
+       u_long  tx_aborted_errors;
+       u_long  tx_carrier_errors;
+       u_long  tx_fifo_errors;
+       u_long  tx_heartbeat_errors;
+       u_long  tx_window_errors;
+     };
+#endif
+
+/*
+ * Item in a list of interfaces.
+ */
+struct pcap_if {
+       struct pcap_if *next;
+       char *name;             /* name to hand to "pcap_open_live()" */
+       char *description;      /* textual description of interface, or NULL */
+       struct pcap_addr *addresses;
+       bpf_u_int32 flags;      /* PCAP_IF_ interface flags */
+};
+
+#define PCAP_IF_LOOPBACK       0x00000001      /* interface is loopback */
+
+/*
+ * Representation of an interface address.
+ */
+struct pcap_addr {
+       struct pcap_addr *next;
+       struct sockaddr *addr;          /* address */
+       struct sockaddr *netmask;       /* netmask for that address */
+       struct sockaddr *broadaddr;     /* broadcast address for that address */
+       struct sockaddr *dstaddr;       /* P2P destination address for that address */
+};
+
+typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *,
+                            const u_char *);
+
+/*
+ * Error codes for the pcap API.
+ * These will all be negative, so you can check for the success or
+ * failure of a call that returns these codes by checking for a
+ * negative value.
+ */
+#define PCAP_ERROR                     -1      /* generic error code */
+#define PCAP_ERROR_BREAK               -2      /* loop terminated by pcap_breakloop */
+#define PCAP_ERROR_NOT_ACTIVATED       -3      /* the capture needs to be activated */
+#define PCAP_ERROR_ACTIVATED           -4      /* the operation can't be performed on already activated captures */
+#define PCAP_ERROR_NO_SUCH_DEVICE      -5      /* no such device exists */
+#define PCAP_ERROR_RFMON_NOTSUP                -6      /* this device doesn't support rfmon (monitor) mode */
+#define PCAP_ERROR_NOT_RFMON           -7      /* operation supported only in monitor mode */
+#define PCAP_ERROR_PERM_DENIED         -8      /* no permission to open the device */
+#define PCAP_ERROR_IFACE_NOT_UP                -9      /* interface isn't up */
+
+/*
+ * Warning codes for the pcap API.
+ * These will all be positive and non-zero, so they won't look like
+ * errors.
+ */
+#define PCAP_WARNING                   1       /* generic warning code */
+#define PCAP_WARNING_PROMISC_NOTSUP    2       /* this device doesn't support promiscuous mode */
+
+char   *pcap_lookupdev(char *);
+int    pcap_lookupnet(const char *, bpf_u_int32 *, bpf_u_int32 *, char *);
+
+pcap_t *pcap_create(const char *, char *);
+int    pcap_set_snaplen(pcap_t *, int);
+int    pcap_set_promisc(pcap_t *, int);
+int    pcap_can_set_rfmon(pcap_t *);
+int    pcap_set_rfmon(pcap_t *, int);
+int    pcap_set_timeout(pcap_t *, int);
+int    pcap_set_buffer_size(pcap_t *, int);
+int    pcap_activate(pcap_t *);
+
+pcap_t *pcap_open_live(const char *, int, int, int, char *);
+pcap_t *pcap_open_dead(int, int);
+pcap_t *pcap_open_offline(const char *, char *);
+#if defined(WIN32)
+pcap_t  *pcap_hopen_offline(intptr_t, char *);
+#if !defined(LIBPCAP_EXPORTS)
+#define pcap_fopen_offline(f,b) \
+       pcap_hopen_offline(_get_osfhandle(_fileno(f)), b)
+#else /*LIBPCAP_EXPORTS*/
+static pcap_t *pcap_fopen_offline(FILE *, char *);
+#endif
+#else /*WIN32*/
+pcap_t *pcap_fopen_offline(FILE *, char *);
+#endif /*WIN32*/
+
+void   pcap_close(pcap_t *);
+int    pcap_loop(pcap_t *, int, pcap_handler, u_char *);
+int    pcap_dispatch(pcap_t *, int, pcap_handler, u_char *);
+const u_char*
+       pcap_next(pcap_t *, struct pcap_pkthdr *);
+int    pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **);
+void   pcap_breakloop(pcap_t *);
+int    pcap_stats(pcap_t *, struct pcap_stat *);
+int    pcap_setfilter(pcap_t *, struct bpf_program *);
+int    pcap_setdirection(pcap_t *, pcap_direction_t);
+int    pcap_getnonblock(pcap_t *, char *);
+int    pcap_setnonblock(pcap_t *, int, char *);
+int    pcap_inject(pcap_t *, const void *, size_t);
+int    pcap_sendpacket(pcap_t *, const u_char *, int);
+const char *pcap_statustostr(int);
+const char *pcap_strerror(int);
+char   *pcap_geterr(pcap_t *);
+void   pcap_perror(pcap_t *, char *);
+int    pcap_compile(pcap_t *, struct bpf_program *, const char *, int,
+           bpf_u_int32);
+int    pcap_compile_nopcap(int, int, struct bpf_program *,
+           const char *, int, bpf_u_int32);
+void   pcap_freecode(struct bpf_program *);
+int    pcap_offline_filter(struct bpf_program *, const struct pcap_pkthdr *,
+           const u_char *);
+int    pcap_datalink(pcap_t *);
+int    pcap_datalink_ext(pcap_t *);
+int    pcap_list_datalinks(pcap_t *, int **);
+int    pcap_set_datalink(pcap_t *, int);
+void   pcap_free_datalinks(int *);
+int    pcap_datalink_name_to_val(const char *);
+const char *pcap_datalink_val_to_name(int);
+const char *pcap_datalink_val_to_description(int);
+int    pcap_snapshot(pcap_t *);
+int    pcap_is_swapped(pcap_t *);
+int    pcap_major_version(pcap_t *);
+int    pcap_minor_version(pcap_t *);
+
+/* XXX */
+FILE   *pcap_file(pcap_t *);
+int    pcap_fileno(pcap_t *);
+
+pcap_dumper_t *pcap_dump_open(pcap_t *, const char *);
+pcap_dumper_t *pcap_dump_fopen(pcap_t *, FILE *fp);
+FILE   *pcap_dump_file(pcap_dumper_t *);
+long   pcap_dump_ftell(pcap_dumper_t *);
+int    pcap_dump_flush(pcap_dumper_t *);
+void   pcap_dump_close(pcap_dumper_t *);
+void   pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
+
+int    pcap_findalldevs(pcap_if_t **, char *);
+void   pcap_freealldevs(pcap_if_t *);
+
+const char *pcap_lib_version(void);
+
+/* XXX this guy lives in the bpf tree */
+u_int  bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
+int    bpf_validate(const struct bpf_insn *f, int len);
+char   *bpf_image(const struct bpf_insn *, int);
+void   bpf_dump(const struct bpf_program *, int);
+
+#if defined(WIN32)
+
+/*
+ * Win32 definitions
+ */
+
+int pcap_setbuff(pcap_t *p, int dim);
+int pcap_setmode(pcap_t *p, int mode);
+int pcap_setmintocopy(pcap_t *p, int size);
+
+#ifdef WPCAP
+/* Include file with the wpcap-specific extensions */
+#include <Win32-Extensions.h>
+#endif /* WPCAP */
+
+#define MODE_CAPT 0
+#define MODE_STAT 1
+#define MODE_MON 2
+
+#elif defined(MSDOS)
+
+/*
+ * MS-DOS definitions
+ */
+
+int  pcap_stats_ex (pcap_t *, struct pcap_stat_ex *);
+void pcap_set_wait (pcap_t *p, void (*yield)(void), int wait);
+u_long pcap_mac_packets (void);
+
+#else /* UN*X */
+
+/*
+ * UN*X definitions
+ */
+
+int    pcap_get_selectable_fd(pcap_t *);
+
+#endif /* WIN32/MSDOS/UN*X */
+
+#ifdef HAVE_REMOTE
+/* Includes most of the public stuff that is needed for the remote capture */
+#include <remote-ext.h>
+#endif  /* HAVE_REMOTE */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bluetooth.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bluetooth.h
new file mode 100644 (file)
index 0000000..7bf65df
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2006 Paolo Abeni (Italy)
+ * 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 the author may not be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS 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.
+ *
+ * bluetooth data struct
+ * By Paolo Abeni <paolo.abeni@email.it>
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/bluetooth.h,v 1.1 2007/09/22 02:10:17 guy Exp $
+ */
+#ifndef _PCAP_BLUETOOTH_STRUCTS_H__
+#define _PCAP_BLUETOOTH_STRUCTS_H__
+
+/*
+ * Header prepended libpcap to each bluetooth h:4 frame.
+ * fields are in network byte order
+ */
+typedef struct _pcap_bluetooth_h4_header {
+       u_int32_t direction; /* if first bit is set direction is incoming */
+} pcap_bluetooth_h4_header;
+
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bpf.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/bpf.h
new file mode 100644 (file)
index 0000000..9f4ca33
--- /dev/null
@@ -0,0 +1,934 @@
+/*-
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from the Stanford/CMU enet packet filter,
+ * (net/enet.c) distributed as part of 4.3BSD, and code contributed
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 
+ * Berkeley Laboratory.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.8 2008-09-22 20:16:01 guy Exp $ (LBL)
+ */
+
+/*
+ * This is libpcap's cut-down version of bpf.h; it includes only
+ * the stuff needed for the code generator and the userland BPF
+ * interpreter, and the libpcap APIs for setting filters, etc..
+ *
+ * "pcap-bpf.c" will include the native OS version, as it deals with
+ * the OS's BPF implementation.
+ *
+ * XXX - should this all just be moved to "pcap.h"?
+ */
+
+#ifndef BPF_MAJOR_VERSION
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* BSD style release date */
+#define BPF_RELEASE 199606
+
+#ifdef MSDOS /* must be 32-bit */
+typedef long          bpf_int32;
+typedef unsigned long bpf_u_int32;
+#else
+typedef        int bpf_int32;
+typedef        u_int bpf_u_int32;
+#endif
+
+/*
+ * Alignment macros.  BPF_WORDALIGN rounds up to the next 
+ * even multiple of BPF_ALIGNMENT. 
+ */
+#ifndef __NetBSD__
+#define BPF_ALIGNMENT sizeof(bpf_int32)
+#else
+#define BPF_ALIGNMENT sizeof(long)
+#endif
+#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
+
+#define BPF_MAXBUFSIZE 0x8000
+#define BPF_MINBUFSIZE 32
+
+/*
+ * Structure for "pcap_compile()", "pcap_setfilter()", etc..
+ */
+struct bpf_program {
+       u_int bf_len;
+       struct bpf_insn *bf_insns;
+};
+/*
+ * Struct return by BIOCVERSION.  This represents the version number of 
+ * the filter language described by the instruction encodings below.
+ * bpf understands a program iff kernel_major == filter_major &&
+ * kernel_minor >= filter_minor, that is, if the value returned by the
+ * running kernel has the same major number and a minor number equal
+ * equal to or less than the filter being downloaded.  Otherwise, the
+ * results are undefined, meaning an error may be returned or packets
+ * may be accepted haphazardly.
+ * It has nothing to do with the source code version.
+ */
+struct bpf_version {
+       u_short bv_major;
+       u_short bv_minor;
+};
+/* Current version number of filter architecture. */
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+/*
+ * Data-link level type codes.
+ *
+ * Do *NOT* add new values to this list without asking
+ * "tcpdump-workers@lists.tcpdump.org" for a value.  Otherwise, you run
+ * the risk of using a value that's already being used for some other
+ * purpose, and of having tools that read libpcap-format captures not
+ * being able to handle captures with your new DLT_ value, with no hope
+ * that they will ever be changed to do so (as that would destroy their
+ * ability to read captures using that value for that other purpose).
+ */
+
+/*
+ * These are the types that are the same on all platforms, and that
+ * have been defined by <net/bpf.h> for ages.
+ */
+#define DLT_NULL       0       /* BSD loopback encapsulation */
+#define DLT_EN10MB     1       /* Ethernet (10Mb) */
+#define DLT_EN3MB      2       /* Experimental Ethernet (3Mb) */
+#define DLT_AX25       3       /* Amateur Radio AX.25 */
+#define DLT_PRONET     4       /* Proteon ProNET Token Ring */
+#define DLT_CHAOS      5       /* Chaos */
+#define DLT_IEEE802    6       /* 802.5 Token Ring */
+#define DLT_ARCNET     7       /* ARCNET, with BSD-style header */
+#define DLT_SLIP       8       /* Serial Line IP */
+#define DLT_PPP                9       /* Point-to-point Protocol */
+#define DLT_FDDI       10      /* FDDI */
+
+/*
+ * These are types that are different on some platforms, and that
+ * have been defined by <net/bpf.h> for ages.  We use #ifdefs to
+ * detect the BSDs that define them differently from the traditional
+ * libpcap <net/bpf.h>
+ *
+ * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,
+ * but I don't know what the right #define is for BSD/OS.
+ */
+#define DLT_ATM_RFC1483        11      /* LLC-encapsulated ATM */
+
+#ifdef __OpenBSD__
+#define DLT_RAW                14      /* raw IP */
+#else
+#define DLT_RAW                12      /* raw IP */
+#endif
+
+/*
+ * Given that the only OS that currently generates BSD/OS SLIP or PPP
+ * is, well, BSD/OS, arguably everybody should have chosen its values
+ * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they
+ * didn't.  So it goes.
+ */
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+#ifndef DLT_SLIP_BSDOS
+#define DLT_SLIP_BSDOS 13      /* BSD/OS Serial Line IP */
+#define DLT_PPP_BSDOS  14      /* BSD/OS Point-to-point Protocol */
+#endif
+#else
+#define DLT_SLIP_BSDOS 15      /* BSD/OS Serial Line IP */
+#define DLT_PPP_BSDOS  16      /* BSD/OS Point-to-point Protocol */
+#endif
+
+/*
+ * 17 is used for DLT_OLD_PFLOG in OpenBSD;
+ *     OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below.
+ * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else.
+ */
+
+#define DLT_ATM_CLIP   19      /* Linux Classical-IP over ATM */
+
+/*
+ * Apparently Redback uses this for its SmartEdge 400/800.  I hope
+ * nobody else decided to use it, too.
+ */
+#define DLT_REDBACK_SMARTEDGE  32
+
+/*
+ * These values are defined by NetBSD; other platforms should refrain from
+ * using them for other purposes, so that NetBSD savefiles with link
+ * types of 50 or 51 can be read as this type on all platforms.
+ */
+#define DLT_PPP_SERIAL 50      /* PPP over serial with HDLC encapsulation */
+#define DLT_PPP_ETHER  51      /* PPP over Ethernet */
+
+/*
+ * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses
+ * a link-layer type of 99 for the tcpdump it supplies.  The link-layer
+ * header has 6 bytes of unknown data, something that appears to be an
+ * Ethernet type, and 36 bytes that appear to be 0 in at least one capture
+ * I've seen.
+ */
+#define DLT_SYMANTEC_FIREWALL  99
+
+/*
+ * Values between 100 and 103 are used in capture file headers as
+ * link-layer types corresponding to DLT_ types that differ
+ * between platforms; don't use those values for new DLT_ new types.
+ */
+
+/*
+ * This value was defined by libpcap 0.5; platforms that have defined
+ * it with a different value should define it here with that value -
+ * a link type of 104 in a save file will be mapped to DLT_C_HDLC,
+ * whatever value that happens to be, so programs will correctly
+ * handle files with that link type regardless of the value of
+ * DLT_C_HDLC.
+ *
+ * The name DLT_C_HDLC was used by BSD/OS; we use that name for source
+ * compatibility with programs written for BSD/OS.
+ *
+ * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,
+ * for source compatibility with programs written for libpcap 0.5.
+ */
+#define DLT_C_HDLC     104     /* Cisco HDLC */
+#define DLT_CHDLC      DLT_C_HDLC
+
+#define DLT_IEEE802_11 105     /* IEEE 802.11 wireless */
+
+/*
+ * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,
+ * except when it isn't.  (I.e., sometimes it's just raw IP, and
+ * sometimes it isn't.)  We currently handle it as DLT_LINUX_SLL,
+ * so that we don't have to worry about the link-layer header.)
+ */
+
+/*
+ * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides
+ * with other values.
+ * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header
+ * (DLCI, etc.).
+ */
+#define DLT_FRELAY     107
+
+/*
+ * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except
+ * that the AF_ type in the link-layer header is in network byte order.
+ *
+ * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so
+ * we don't use 12 for it in OSes other than OpenBSD.
+ */
+#ifdef __OpenBSD__
+#define DLT_LOOP       12
+#else
+#define DLT_LOOP       108
+#endif
+
+/*
+ * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's
+ * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other
+ * than OpenBSD.
+ */
+#ifdef __OpenBSD__
+#define DLT_ENC                13
+#else
+#define DLT_ENC                109
+#endif
+
+/*
+ * Values between 110 and 112 are reserved for use in capture file headers
+ * as link-layer types corresponding to DLT_ types that might differ
+ * between platforms; don't use those values for new DLT_ types
+ * other than the corresponding DLT_ types.
+ */
+
+/*
+ * This is for Linux cooked sockets.
+ */
+#define DLT_LINUX_SLL  113
+
+/*
+ * Apple LocalTalk hardware.
+ */
+#define DLT_LTALK      114
+
+/*
+ * Acorn Econet.
+ */
+#define DLT_ECONET     115
+
+/*
+ * Reserved for use with OpenBSD ipfilter.
+ */
+#define DLT_IPFILTER   116
+
+/*
+ * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023
+ * in SuSE 6.3, so we can't use 17 for it in capture-file headers.
+ *
+ * XXX: is there a conflict with DLT_PFSYNC 18 as well?
+ */
+#ifdef __OpenBSD__
+#define DLT_OLD_PFLOG  17
+#define DLT_PFSYNC     18
+#endif
+#define DLT_PFLOG      117
+
+/*
+ * Registered for Cisco-internal use.
+ */
+#define DLT_CISCO_IOS  118
+
+/*
+ * For 802.11 cards using the Prism II chips, with a link-layer
+ * header including Prism monitor mode information plus an 802.11
+ * header.
+ */
+#define DLT_PRISM_HEADER       119
+
+/*
+ * Reserved for Aironet 802.11 cards, with an Aironet link-layer header
+ * (see Doug Ambrisko's FreeBSD patches).
+ */
+#define DLT_AIRONET_HEADER     120
+
+/*
+ * Reserved for Siemens HiPath HDLC.
+ */
+#define DLT_HHDLC              121
+
+/*
+ * This is for RFC 2625 IP-over-Fibre Channel.
+ *
+ * This is not for use with raw Fibre Channel, where the link-layer
+ * header starts with a Fibre Channel frame header; it's for IP-over-FC,
+ * where the link-layer header starts with an RFC 2625 Network_Header
+ * field.
+ */
+#define DLT_IP_OVER_FC         122
+
+/*
+ * This is for Full Frontal ATM on Solaris with SunATM, with a
+ * pseudo-header followed by an AALn PDU.
+ *
+ * There may be other forms of Full Frontal ATM on other OSes,
+ * with different pseudo-headers.
+ *
+ * If ATM software returns a pseudo-header with VPI/VCI information
+ * (and, ideally, packet type information, e.g. signalling, ILMI,
+ * LANE, LLC-multiplexed traffic, etc.), it should not use
+ * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump
+ * and the like don't have to infer the presence or absence of a
+ * pseudo-header and the form of the pseudo-header.
+ */
+#define DLT_SUNATM             123     /* Solaris+SunATM */
+
+/* 
+ * Reserved as per request from Kent Dahlgren <kent@praesum.com>
+ * for private use.
+ */
+#define DLT_RIO                 124     /* RapidIO */
+#define DLT_PCI_EXP             125     /* PCI Express */
+#define DLT_AURORA              126     /* Xilinx Aurora link layer */
+
+/*
+ * Header for 802.11 plus a number of bits of link-layer information
+ * including radio information, used by some recent BSD drivers as
+ * well as the madwifi Atheros driver for Linux.
+ */
+#define DLT_IEEE802_11_RADIO   127     /* 802.11 plus radiotap radio header */
+
+/*
+ * Reserved for the TZSP encapsulation, as per request from
+ * Chris Waters <chris.waters@networkchemistry.com>
+ * TZSP is a generic encapsulation for any other link type,
+ * which includes a means to include meta-information
+ * with the packet, e.g. signal strength and channel
+ * for 802.11 packets.
+ */
+#define DLT_TZSP                128     /* Tazmen Sniffer Protocol */
+
+/*
+ * BSD's ARCNET headers have the source host, destination host,
+ * and type at the beginning of the packet; that's what's handed
+ * up to userland via BPF.
+ *
+ * Linux's ARCNET headers, however, have a 2-byte offset field
+ * between the host IDs and the type; that's what's handed up
+ * to userland via PF_PACKET sockets.
+ *
+ * We therefore have to have separate DLT_ values for them.
+ */
+#define DLT_ARCNET_LINUX       129     /* ARCNET */
+
+/*
+ * Juniper-private data link types, as per request from
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
+ * for passing on chassis-internal metainformation such as
+ * QOS profiles, etc..
+ */
+#define DLT_JUNIPER_MLPPP       130
+#define DLT_JUNIPER_MLFR        131
+#define DLT_JUNIPER_ES          132
+#define DLT_JUNIPER_GGSN        133
+#define DLT_JUNIPER_MFR         134
+#define DLT_JUNIPER_ATM2        135
+#define DLT_JUNIPER_SERVICES    136
+#define DLT_JUNIPER_ATM1        137
+
+/*
+ * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund
+ * <dieter@apple.com>.  The header that's presented is an Ethernet-like
+ * header:
+ *
+ *     #define FIREWIRE_EUI64_LEN      8
+ *     struct firewire_header {
+ *             u_char  firewire_dhost[FIREWIRE_EUI64_LEN];
+ *             u_char  firewire_shost[FIREWIRE_EUI64_LEN];
+ *             u_short firewire_type;
+ *     };
+ *
+ * with "firewire_type" being an Ethernet type value, rather than,
+ * for example, raw GASP frames being handed up.
+ */
+#define DLT_APPLE_IP_OVER_IEEE1394     138
+
+/*
+ * Various SS7 encapsulations, as per a request from Jeff Morriss
+ * <jeff.morriss[AT]ulticom.com> and subsequent discussions.
+ */
+#define DLT_MTP2_WITH_PHDR     139     /* pseudo-header with various info, followed by MTP2 */
+#define DLT_MTP2               140     /* MTP2, without pseudo-header */
+#define DLT_MTP3               141     /* MTP3, without pseudo-header or MTP2 */
+#define DLT_SCCP               142     /* SCCP, without pseudo-header or MTP2 or MTP3 */
+
+/*
+ * DOCSIS MAC frames.
+ */
+#define DLT_DOCSIS             143
+
+/*
+ * Linux-IrDA packets. Protocol defined at http://www.irda.org.
+ * Those packets include IrLAP headers and above (IrLMP...), but
+ * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy
+ * framing can be handled by the hardware and depend on the bitrate.
+ * This is exactly the format you would get capturing on a Linux-IrDA
+ * interface (irdaX), but not on a raw serial port.
+ * Note the capture is done in "Linux-cooked" mode, so each packet include
+ * a fake packet header (struct sll_header). This is because IrDA packet
+ * decoding is dependant on the direction of the packet (incomming or
+ * outgoing).
+ * When/if other platform implement IrDA capture, we may revisit the
+ * issue and define a real DLT_IRDA...
+ * Jean II
+ */
+#define DLT_LINUX_IRDA         144
+
+/*
+ * Reserved for IBM SP switch and IBM Next Federation switch.
+ */
+#define DLT_IBM_SP             145
+#define DLT_IBM_SN             146
+
+/*
+ * Reserved for private use.  If you have some link-layer header type
+ * that you want to use within your organization, with the capture files
+ * using that link-layer header type not ever be sent outside your
+ * organization, you can use these values.
+ *
+ * No libpcap release will use these for any purpose, nor will any
+ * tcpdump release use them, either.
+ *
+ * Do *NOT* use these in capture files that you expect anybody not using
+ * your private versions of capture-file-reading tools to read; in
+ * particular, do *NOT* use them in products, otherwise you may find that
+ * people won't be able to use tcpdump, or snort, or Ethereal, or... to
+ * read capture files from your firewall/intrusion detection/traffic
+ * monitoring/etc. appliance, or whatever product uses that DLT_ value,
+ * and you may also find that the developers of those applications will
+ * not accept patches to let them read those files.
+ *
+ * Also, do not use them if somebody might send you a capture using them
+ * for *their* private type and tools using them for *your* private type
+ * would have to read them.
+ *
+ * Instead, ask "tcpdump-workers@lists.tcpdump.org" for a new DLT_ value,
+ * as per the comment above, and use the type you're given.
+ */
+#define DLT_USER0              147
+#define DLT_USER1              148
+#define DLT_USER2              149
+#define DLT_USER3              150
+#define DLT_USER4              151
+#define DLT_USER5              152
+#define DLT_USER6              153
+#define DLT_USER7              154
+#define DLT_USER8              155
+#define DLT_USER9              156
+#define DLT_USER10             157
+#define DLT_USER11             158
+#define DLT_USER12             159
+#define DLT_USER13             160
+#define DLT_USER14             161
+#define DLT_USER15             162
+
+/*
+ * For future use with 802.11 captures - defined by AbsoluteValue
+ * Systems to store a number of bits of link-layer information
+ * including radio information:
+ *
+ *     http://www.shaftnet.org/~pizza/software/capturefrm.txt
+ *
+ * but it might be used by some non-AVS drivers now or in the
+ * future.
+ */
+#define DLT_IEEE802_11_RADIO_AVS 163   /* 802.11 plus AVS radio header */
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
+ * for passing on chassis-internal metainformation such as
+ * QOS profiles, etc..
+ */
+#define DLT_JUNIPER_MONITOR     164
+
+/*
+ * Reserved for BACnet MS/TP.
+ */
+#define DLT_BACNET_MS_TP       165
+
+/*
+ * Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
+ *
+ * This is used in some OSes to allow a kernel socket filter to distinguish
+ * between incoming and outgoing packets, on a socket intended to
+ * supply pppd with outgoing packets so it can do dial-on-demand and
+ * hangup-on-lack-of-demand; incoming packets are filtered out so they
+ * don't cause pppd to hold the connection up (you don't want random
+ * input packets such as port scans, packets from old lost connections,
+ * etc. to force the connection to stay up).
+ *
+ * The first byte of the PPP header (0xff03) is modified to accomodate
+ * the direction - 0x00 = IN, 0x01 = OUT.
+ */
+#define DLT_PPP_PPPD           166
+
+/*
+ * Names for backwards compatibility with older versions of some PPP
+ * software; new software should use DLT_PPP_PPPD.
+ */
+#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD
+#define DLT_LINUX_PPP_WITHDIRECTION    DLT_PPP_PPPD
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
+ * for passing on chassis-internal metainformation such as
+ * QOS profiles, cookies, etc..
+ */
+#define DLT_JUNIPER_PPPOE       167
+#define DLT_JUNIPER_PPPOE_ATM   168
+
+#define DLT_GPRS_LLC           169     /* GPRS LLC */
+#define DLT_GPF_T              170     /* GPF-T (ITU-T G.7041/Y.1303) */
+#define DLT_GPF_F              171     /* GPF-F (ITU-T G.7041/Y.1303) */
+
+/*
+ * Requested by Oolan Zimmer <oz@gcom.com> for use in Gcom's T1/E1 line
+ * monitoring equipment.
+ */
+#define DLT_GCOM_T1E1          172
+#define DLT_GCOM_SERIAL                173
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_ is used
+ * for internal communication to Physical Interface Cards (PIC)
+ */
+#define DLT_JUNIPER_PIC_PEER    174
+
+/*
+ * Link types requested by Gregor Maier <gregor@endace.com> of Endace
+ * Measurement Systems.  They add an ERF header (see
+ * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of
+ * the link-layer header.
+ */
+#define DLT_ERF_ETH            175     /* Ethernet */
+#define DLT_ERF_POS            176     /* Packet-over-SONET */
+
+/*
+ * Requested by Daniele Orlandi <daniele@orlandi.com> for raw LAPD
+ * for vISDN (http://www.orlandi.com/visdn/).  Its link-layer header
+ * includes additional information before the LAPD header, so it's
+ * not necessarily a generic LAPD header.
+ */
+#define DLT_LINUX_LAPD         177
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>. 
+ * The DLT_ are used for prepending meta-information
+ * like interface index, interface name
+ * before standard Ethernet, PPP, Frelay & C-HDLC Frames
+ */
+#define DLT_JUNIPER_ETHER       178
+#define DLT_JUNIPER_PPP         179
+#define DLT_JUNIPER_FRELAY      180
+#define DLT_JUNIPER_CHDLC       181
+
+/*
+ * Multi Link Frame Relay (FRF.16)
+ */
+#define DLT_MFR                 182
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>. 
+ * The DLT_ is used for internal communication with a
+ * voice Adapter Card (PIC)
+ */
+#define DLT_JUNIPER_VP          183
+
+/*
+ * Arinc 429 frames.
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
+ * Every frame contains a 32bit A429 label.
+ * More documentation on Arinc 429 can be found at
+ * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf
+ */
+#define DLT_A429                184
+
+/*
+ * Arinc 653 Interpartition Communication messages.
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
+ * Please refer to the A653-1 standard for more information.
+ */
+#define DLT_A653_ICM            185
+
+/*
+ * USB packets, beginning with a USB setup header; requested by
+ * Paolo Abeni <paolo.abeni@email.it>.
+ */
+#define DLT_USB                        186
+
+/*
+ * Bluetooth HCI UART transport layer (part H:4); requested by
+ * Paolo Abeni.
+ */
+#define DLT_BLUETOOTH_HCI_H4   187
+
+/*
+ * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz
+ * <cruz_petagay@bah.com>.
+ */
+#define DLT_IEEE802_16_MAC_CPS 188
+
+/*
+ * USB packets, beginning with a Linux USB header; requested by
+ * Paolo Abeni <paolo.abeni@email.it>.
+ */
+#define DLT_USB_LINUX          189
+
+/*
+ * Controller Area Network (CAN) v. 2.0B packets.
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
+ * Used to dump CAN packets coming from a CAN Vector board.
+ * More documentation on the CAN v2.0B frames can be found at
+ * http://www.can-cia.org/downloads/?269
+ */
+#define DLT_CAN20B              190
+
+/*
+ * IEEE 802.15.4, with address fields padded, as is done by Linux
+ * drivers; requested by Juergen Schimmer.
+ */
+#define DLT_IEEE802_15_4_LINUX 191
+
+/*
+ * Per Packet Information encapsulated packets.
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
+ */
+#define DLT_PPI                        192
+
+/*
+ * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
+ * requested by Charles Clancy.
+ */
+#define DLT_IEEE802_16_MAC_CPS_RADIO   193
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>. 
+ * The DLT_ is used for internal communication with a
+ * integrated service module (ISM).
+ */
+#define DLT_JUNIPER_ISM         194
+
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing); requested by Mikko Saarnivala <mikko.saarnivala@sensinode.com>.
+ */
+#define DLT_IEEE802_15_4       195
+
+/*
+ * Various link-layer types, with a pseudo-header, for SITA
+ * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com).
+ */
+#define DLT_SITA               196
+
+/*
+ * Various link-layer types, with a pseudo-header, for Endace DAG cards;
+ * encapsulates Endace ERF records.  Requested by Stephen Donnelly
+ * <stephen@endace.com>.
+ */
+#define DLT_ERF                        197
+
+/*
+ * Special header prepended to Ethernet packets when capturing from a
+ * u10 Networks board.  Requested by Phil Mulholland
+ * <phil@u10networks.com>.
+ */
+#define DLT_RAIF1              198
+
+/*
+ * IPMB packet for IPMI, beginning with the I2C slave address, followed
+ * by the netFn and LUN, etc..  Requested by Chanthy Toeung
+ * <chanthy.toeung@ca.kontron.com>.
+ */
+#define DLT_IPMB               199
+
+/*
+ * Juniper-private data link type, as per request from
+ * Hannes Gredler <hannes@juniper.net>. 
+ * The DLT_ is used for capturing data on a secure tunnel interface.
+ */
+#define DLT_JUNIPER_ST          200
+
+/*
+ * Bluetooth HCI UART transport layer (part H:4), with pseudo-header
+ * that includes direction information; requested by Paolo Abeni.
+ */
+#define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201
+
+/*
+ * AX.25 packet with a 1-byte KISS header; see
+ *
+ *     http://www.ax25.net/kiss.htm
+ *
+ * as per Richard Stearn <richard@rns-stearn.demon.co.uk>.
+ */
+#define DLT_AX25_KISS          202
+
+/*
+ * LAPD packets from an ISDN channel, starting with the address field,
+ * with no pseudo-header.
+ * Requested by Varuna De Silva <varunax@gmail.com>.
+ */
+#define DLT_LAPD               203
+
+/*
+ * Variants of various link-layer headers, with a one-byte direction
+ * pseudo-header prepended - zero means "received by this host",
+ * non-zero (any non-zero value) means "sent by this host" - as per
+ * Will Barker <w.barker@zen.co.uk>.
+ */
+#define DLT_PPP_WITH_DIR       204     /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */
+#define DLT_C_HDLC_WITH_DIR    205     /* Cisco HDLC */
+#define DLT_FRELAY_WITH_DIR    206     /* Frame Relay */
+#define DLT_LAPB_WITH_DIR      207     /* LAPB */
+
+/*
+ * 208 is reserved for an as-yet-unspecified proprietary link-layer
+ * type, as requested by Will Barker.
+ */
+
+/*
+ * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
+ * <avn@pigeonpoint.com>.
+ */
+#define DLT_IPMB_LINUX         209
+
+/*
+ * FlexRay automotive bus - http://www.flexray.com/ - as requested
+ * by Hannes Kaelber <hannes.kaelber@x2e.de>.
+ */
+#define DLT_FLEXRAY            210
+
+/*
+ * Media Oriented Systems Transport (MOST) bus for multimedia
+ * transport - http://www.mostcooperation.com/ - as requested
+ * by Hannes Kaelber <hannes.kaelber@x2e.de>.
+ */
+#define DLT_MOST               211
+
+/*
+ * Local Interconnect Network (LIN) bus for vehicle networks -
+ * http://www.lin-subbus.org/ - as requested by Hannes Kaelber
+ * <hannes.kaelber@x2e.de>.
+ */
+#define DLT_LIN                        212
+
+/*
+ * X2E-private data link type used for serial line capture,
+ * as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.
+ */
+#define DLT_X2E_SERIAL         213
+
+/*
+ * X2E-private data link type used for the Xoraya data logger
+ * family, as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.
+ */
+#define DLT_X2E_XORAYA         214
+
+/*
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
+ * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
+ * of 0 as preamble, one octet of SFD, one octet of frame length+
+ * reserved bit, and then the MAC-layer data, starting with the
+ * frame control field).
+ *
+ * Requested by Max Filippov <jcmvbkbc@gmail.com>.
+ */
+#define DLT_IEEE802_15_4_NONASK_PHY    215
+
+
+/*
+ * DLT and savefile link type values are split into a class and
+ * a member of that class.  A class value of 0 indicates a regular
+ * DLT_/LINKTYPE_ value.
+ */
+#define DLT_CLASS(x)           ((x) & 0x03ff0000)
+
+/*
+ * NetBSD-specific generic "raw" link type.  The class value indicates
+ * that this is the generic raw type, and the lower 16 bits are the
+ * address family we're dealing with.  Those values are NetBSD-specific;
+ * do not assume that they correspond to AF_ values for your operating
+ * system.
+ */
+#define        DLT_CLASS_NETBSD_RAWAF  0x02240000
+#define        DLT_NETBSD_RAWAF(af)    (DLT_CLASS_NETBSD_RAWAF | (af))
+#define        DLT_NETBSD_RAWAF_AF(x)  ((x) & 0x0000ffff)
+#define        DLT_IS_NETBSD_RAWAF(x)  (DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)
+
+
+/*
+ * The instruction encodings.
+ */
+/* instruction classes */
+#define BPF_CLASS(code) ((code) & 0x07)
+#define                BPF_LD          0x00
+#define                BPF_LDX         0x01
+#define                BPF_ST          0x02
+#define                BPF_STX         0x03
+#define                BPF_ALU         0x04
+#define                BPF_JMP         0x05
+#define                BPF_RET         0x06
+#define                BPF_MISC        0x07
+
+/* ld/ldx fields */
+#define BPF_SIZE(code) ((code) & 0x18)
+#define                BPF_W           0x00
+#define                BPF_H           0x08
+#define                BPF_B           0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define                BPF_IMM         0x00
+#define                BPF_ABS         0x20
+#define                BPF_IND         0x40
+#define                BPF_MEM         0x60
+#define                BPF_LEN         0x80
+#define                BPF_MSH         0xa0
+
+/* alu/jmp fields */
+#define BPF_OP(code)   ((code) & 0xf0)
+#define                BPF_ADD         0x00
+#define                BPF_SUB         0x10
+#define                BPF_MUL         0x20
+#define                BPF_DIV         0x30
+#define                BPF_OR          0x40
+#define                BPF_AND         0x50
+#define                BPF_LSH         0x60
+#define                BPF_RSH         0x70
+#define                BPF_NEG         0x80
+#define                BPF_JA          0x00
+#define                BPF_JEQ         0x10
+#define                BPF_JGT         0x20
+#define                BPF_JGE         0x30
+#define                BPF_JSET        0x40
+#define BPF_SRC(code)  ((code) & 0x08)
+#define                BPF_K           0x00
+#define                BPF_X           0x08
+
+/* ret - BPF_K and BPF_X also apply */
+#define BPF_RVAL(code) ((code) & 0x18)
+#define                BPF_A           0x10
+
+/* misc */
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define                BPF_TAX         0x00
+#define                BPF_TXA         0x80
+
+/*
+ * The instruction data structure.
+ */
+struct bpf_insn {
+       u_short code;
+       u_char  jt;
+       u_char  jf;
+       bpf_u_int32 k;
+};
+
+/*
+ * Macros for insn array initializers.
+ */
+#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
+#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
+
+#if __STDC__ || defined(__cplusplus)
+extern int bpf_validate(const struct bpf_insn *, int);
+extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
+#else
+extern int bpf_validate();
+extern u_int bpf_filter();
+#endif
+
+/*
+ * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
+ */
+#define BPF_MEMWORDS 16
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/namedb.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/namedb.h
new file mode 100644 (file)
index 0000000..9002c75
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 1994, 1996
+ *     The Regents of the University of California.  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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the Computer Systems
+ *     Engineering Group at Lawrence Berkeley Laboratory.
+ * 4. Neither the name of the University nor of the Laboratory may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/namedb.h,v 1.1 2006/10/04 18:09:22 guy Exp $ (LBL)
+ */
+
+#ifndef lib_pcap_namedb_h
+#define lib_pcap_namedb_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * As returned by the pcap_next_etherent()
+ * XXX this stuff doesn't belong in this interface, but this
+ * library already must do name to address translation, so
+ * on systems that don't have support for /etc/ethers, we
+ * export these hooks since they'll
+ */
+struct pcap_etherent {
+       u_char addr[6];
+       char name[122];
+};
+#ifndef PCAP_ETHERS_FILE
+#define PCAP_ETHERS_FILE "/etc/ethers"
+#endif
+struct pcap_etherent *pcap_next_etherent(FILE *);
+u_char *pcap_ether_hostton(const char*);
+u_char *pcap_ether_aton(const char *);
+
+bpf_u_int32 **pcap_nametoaddr(const char *);
+#ifdef INET6
+struct addrinfo *pcap_nametoaddrinfo(const char *);
+#endif
+bpf_u_int32 pcap_nametonetaddr(const char *);
+
+int    pcap_nametoport(const char *, int *, int *);
+int    pcap_nametoportrange(const char *, int *, int *, int *);
+int    pcap_nametoproto(const char *);
+int    pcap_nametoeproto(const char *);
+int    pcap_nametollc(const char *);
+/*
+ * If a protocol is unknown, PROTO_UNDEF is returned.
+ * Also, pcap_nametoport() returns the protocol along with the port number.
+ * If there are ambiguous entried in /etc/services (i.e. domain
+ * can be either tcp or udp) PROTO_UNDEF is returned.
+ */
+#define PROTO_UNDEF            -1
+
+/* XXX move these to pcap-int.h? */
+int __pcap_atodn(const char *, bpf_u_int32 *);
+int __pcap_atoin(const char *, bpf_u_int32 *);
+u_short        __pcap_nametodnaddr(const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/sll.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/sll.h
new file mode 100644 (file)
index 0000000..e9d5452
--- /dev/null
@@ -0,0 +1,129 @@
+/*-
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from the Stanford/CMU enet packet filter,
+ * (net/enet.c) distributed as part of 4.3BSD, and code contributed
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
+ * Berkeley Laboratory.
+ *
+ * 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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/sll.h,v 1.2.2.1 2008-05-30 01:36:06 guy Exp $ (LBL)
+ */
+
+/*
+ * For captures on Linux cooked sockets, we construct a fake header
+ * that includes:
+ *
+ *     a 2-byte "packet type" which is one of:
+ *
+ *             LINUX_SLL_HOST          packet was sent to us
+ *             LINUX_SLL_BROADCAST     packet was broadcast
+ *             LINUX_SLL_MULTICAST     packet was multicast
+ *             LINUX_SLL_OTHERHOST     packet was sent to somebody else
+ *             LINUX_SLL_OUTGOING      packet was sent *by* us;
+ *
+ *     a 2-byte Ethernet protocol field;
+ *
+ *     a 2-byte link-layer type;
+ *
+ *     a 2-byte link-layer address length;
+ *
+ *     an 8-byte source link-layer address, whose actual length is
+ *     specified by the previous value.
+ *
+ * All fields except for the link-layer address are in network byte order.
+ *
+ * DO NOT change the layout of this structure, or change any of the
+ * LINUX_SLL_ values below.  If you must change the link-layer header
+ * for a "cooked" Linux capture, introduce a new DLT_ type (ask
+ * "tcpdump-workers@lists.tcpdump.org" for one, so that you don't give it
+ * a value that collides with a value already being used), and use the
+ * new header in captures of that type, so that programs that can
+ * handle DLT_LINUX_SLL captures will continue to handle them correctly
+ * without any change, and so that capture files with different headers
+ * can be told apart and programs that read them can dissect the
+ * packets in them.
+ */
+
+#ifndef lib_pcap_sll_h
+#define lib_pcap_sll_h
+
+/*
+ * A DLT_LINUX_SLL fake link-layer header.
+ */
+#define SLL_HDR_LEN    16              /* total header length */
+#define SLL_ADDRLEN    8               /* length of address field */
+
+struct sll_header {
+       u_int16_t sll_pkttype;          /* packet type */
+       u_int16_t sll_hatype;           /* link-layer address type */
+       u_int16_t sll_halen;            /* link-layer address length */
+       u_int8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */
+       u_int16_t sll_protocol;         /* protocol */
+};
+
+/*
+ * The LINUX_SLL_ values for "sll_pkttype"; these correspond to the
+ * PACKET_ values on Linux, but are defined here so that they're
+ * available even on systems other than Linux, and so that they
+ * don't change even if the PACKET_ values change.
+ */
+#define LINUX_SLL_HOST         0
+#define LINUX_SLL_BROADCAST    1
+#define LINUX_SLL_MULTICAST    2
+#define LINUX_SLL_OTHERHOST    3
+#define LINUX_SLL_OUTGOING     4
+
+/*
+ * The LINUX_SLL_ values for "sll_protocol"; these correspond to the
+ * ETH_P_ values on Linux, but are defined here so that they're
+ * available even on systems other than Linux.  We assume, for now,
+ * that the ETH_P_ values won't change in Linux; if they do, then:
+ *
+ *     if we don't translate them in "pcap-linux.c", capture files
+ *     won't necessarily be readable if captured on a system that
+ *     defines ETH_P_ values that don't match these values;
+ *
+ *     if we do translate them in "pcap-linux.c", that makes life
+ *     unpleasant for the BPF code generator, as the values you test
+ *     for in the kernel aren't the values that you test for when
+ *     reading a capture file, so the fixup code run on BPF programs
+ *     handed to the kernel ends up having to do more work.
+ *
+ * Add other values here as necessary, for handling packet types that
+ * might show up on non-Ethernet, non-802.x networks.  (Not all the ones
+ * in the Linux "if_ether.h" will, I suspect, actually show up in
+ * captures.)
+ */
+#define LINUX_SLL_P_802_3      0x0001  /* Novell 802.3 frames without 802.2 LLC header */
+#define LINUX_SLL_P_802_2      0x0004  /* 802.2 frames (not D/I/X Ethernet) */
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/usb.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/usb.h
new file mode 100644 (file)
index 0000000..adcd19c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2006 Paolo Abeni (Italy)
+ * 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 the author may not be used to endorse or promote 
+ * products derived from this software without specific prior written 
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS 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.
+ *
+ * Basic USB data struct
+ * By Paolo Abeni <paolo.abeni@email.it>
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/usb.h,v 1.6 2007/09/22 02:06:08 guy Exp $
+ */
+#ifndef _PCAP_USB_STRUCTS_H__
+#define _PCAP_USB_STRUCTS_H__
+
+/* 
+ * possible transfer mode
+ */
+#define URB_TRANSFER_IN   0x80
+#define URB_ISOCHRONOUS   0x0
+#define URB_INTERRUPT     0x1
+#define URB_CONTROL       0x2
+#define URB_BULK          0x3
+
+/*
+ * possible event type
+ */
+#define URB_SUBMIT        'S'
+#define URB_COMPLETE      'C'
+#define URB_ERROR         'E'
+
+/*
+ * USB setup header as defined in USB specification.
+ * Appears at the front of each packet in DLT_USB captures.
+ */
+typedef struct _usb_setup {
+       u_int8_t bmRequestType;
+       u_int8_t bRequest;
+       u_int16_t wValue;
+       u_int16_t wIndex;
+       u_int16_t wLength;
+} pcap_usb_setup;
+
+
+/*
+ * Header prepended by linux kernel to each event.
+ * Appears at the front of each packet in DLT_USB_LINUX captures.
+ */
+typedef struct _usb_header {
+       u_int64_t id;
+       u_int8_t event_type;
+       u_int8_t transfer_type;
+       u_int8_t endpoint_number;
+       u_int8_t device_address;
+       u_int16_t bus_id;
+       char setup_flag;/*if !=0 the urb setup header is not present*/
+       char data_flag; /*if !=0 no urb data is present*/
+       int64_t ts_sec;
+       int32_t ts_usec;
+       int32_t status;
+       u_int32_t urb_len;
+       u_int32_t data_len; /* amount of urb data really present in this event*/
+       pcap_usb_setup setup;
+} pcap_usb_header;
+
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/vlan.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/pcap/vlan.h
new file mode 100644 (file)
index 0000000..b0cb794
--- /dev/null
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+ *     The Regents of the University of California.  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. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the University of
+ *      California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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.
+ *
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/vlan.h,v 1.1.2.2 2008-08-06 07:45:59 guy Exp $
+ */
+
+#ifndef lib_pcap_vlan_h
+#define lib_pcap_vlan_h
+
+struct vlan_tag {
+       u_int16_t       vlan_tpid;              /* ETH_P_8021Q */
+       u_int16_t       vlan_tci;               /* VLAN TCI */
+};
+
+#define VLAN_TAG_LEN   4
+
+#endif
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/remote-ext.h b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/remote-ext.h
new file mode 100644 (file)
index 0000000..9f54d69
--- /dev/null
@@ -0,0 +1,444 @@
+/*\r
+ * Copyright (c) 2002 - 2003\r
+ * NetGroup, Politecnico di Torino (Italy)\r
+ * All rights reserved.\r
+ * \r
+ * Redistribution and use in source and binary forms, with or without \r
+ * modification, are permitted provided that the following conditions \r
+ * are met:\r
+ * \r
+ * 1. Redistributions of source code must retain the above copyright \r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright \r
+ * notice, this list of conditions and the following disclaimer in the \r
+ * documentation and/or other materials provided with the distribution. \r
+ * 3. Neither the name of the Politecnico di Torino nor the names of its \r
+ * contributors may be used to endorse or promote products derived from \r
+ * this software without specific prior written permission. \r
+ * \r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR \r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, \r
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY \r
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ * \r
+ */\r
+\r
+\r
+#ifndef __REMOTE_EXT_H__\r
+#define __REMOTE_EXT_H__\r
+\r
+\r
+#ifndef HAVE_REMOTE\r
+#error Please do not include this file directly. Just define HAVE_REMOTE and then include pcap.h\r
+#endif\r
+\r
+// Definition for Microsoft Visual Studio\r
+#if _MSC_VER > 1000\r
+#pragma once\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+       \file remote-ext.h\r
+\r
+       The goal of this file it to include most of the new definitions that should be\r
+       placed into the pcap.h file.\r
+\r
+       It includes all new definitions (structures and functions like pcap_open().\r
+    Some of the functions are not really a remote feature, but, right now, \r
+       they are placed here.\r
+*/\r
+\r
+\r
+\r
+// All this stuff is public\r
+/*! \addtogroup remote_struct\r
+       \{\r
+*/\r
+\r
+\r
+\r
+\r
+/*!\r
+       \brief Defines the maximum buffer size in which address, port, interface names are kept.\r
+\r
+       In case the adapter name or such is larger than this value, it is truncated.\r
+       This is not used by the user; however it must be aware that an hostname / interface\r
+       name longer than this value will be truncated.\r
+*/\r
+#define PCAP_BUF_SIZE 1024\r
+\r
+\r
+/*! \addtogroup remote_source_ID\r
+       \{\r
+*/\r
+\r
+\r
+/*!\r
+       \brief Internal representation of the type of source in use (file, \r
+       remote/local interface).\r
+\r
+       This indicates a file, i.e. the user want to open a capture from a local file.\r
+*/\r
+#define PCAP_SRC_FILE 2\r
+/*!\r
+       \brief Internal representation of the type of source in use (file, \r
+       remote/local interface).\r
+\r
+       This indicates a local interface, i.e. the user want to open a capture from \r
+       a local interface. This does not involve the RPCAP protocol.\r
+*/\r
+#define PCAP_SRC_IFLOCAL 3\r
+/*!\r
+       \brief Internal representation of the type of source in use (file, \r
+       remote/local interface).\r
+\r
+       This indicates a remote interface, i.e. the user want to open a capture from \r
+       an interface on a remote host. This does involve the RPCAP protocol.\r
+*/\r
+#define PCAP_SRC_IFREMOTE 4\r
+\r
+/*!\r
+       \}\r
+*/\r
+\r
+\r
+\r
+/*! \addtogroup remote_source_string\r
+\r
+       The formats allowed by the pcap_open() are the following:\r
+       - file://path_and_filename [opens a local file]\r
+       - rpcap://devicename [opens the selected device devices available on the local host, without using the RPCAP protocol]\r
+       - rpcap://host/devicename [opens the selected device available on a remote host]\r
+       - rpcap://host:port/devicename [opens the selected device available on a remote host, using a non-standard port for RPCAP]\r
+       - adaptername [to open a local adapter; kept for compability, but it is strongly discouraged]\r
+       - (NULL) [to open the first local adapter; kept for compability, but it is strongly discouraged]\r
+\r
+       The formats allowed by the pcap_findalldevs_ex() are the following:\r
+       - file://folder/ [lists all the files in the given folder]\r
+       - rpcap:// [lists all local adapters]\r
+       - rpcap://host:port/ [lists the devices available on a remote host]\r
+\r
+       Referring to the 'host' and 'port' paramters, they can be either numeric or literal. Since\r
+       IPv6 is fully supported, these are the allowed formats:\r
+\r
+       - host (literal): e.g. host.foo.bar\r
+       - host (numeric IPv4): e.g. 10.11.12.13\r
+       - host (numeric IPv4, IPv6 style): e.g. [10.11.12.13]\r
+       - host (numeric IPv6): e.g. [1:2:3::4]\r
+       - port: can be either numeric (e.g. '80') or literal (e.g. 'http')\r
+\r
+       Here you find some allowed examples:\r
+       - rpcap://host.foo.bar/devicename [everything literal, no port number]\r
+       - rpcap://host.foo.bar:1234/devicename [everything literal, with port number]\r
+       - rpcap://10.11.12.13/devicename [IPv4 numeric, no port number]\r
+       - rpcap://10.11.12.13:1234/devicename [IPv4 numeric, with port number]\r
+       - rpcap://[10.11.12.13]:1234/devicename [IPv4 numeric with IPv6 format, with port number]\r
+       - rpcap://[1:2:3::4]/devicename [IPv6 numeric, no port number]\r
+       - rpcap://[1:2:3::4]:1234/devicename [IPv6 numeric, with port number]\r
+       - rpcap://[1:2:3::4]:http/devicename [IPv6 numeric, with literal port number]\r
+       \r
+       \{\r
+*/\r
+\r
+\r
+/*!\r
+       \brief String that will be used to determine the type of source in use (file,\r
+       remote/local interface).\r
+\r
+       This string will be prepended to the interface name in order to create a string\r
+       that contains all the information required to open the source.\r
+\r
+       This string indicates that the user wants to open a capture from a local file.\r
+*/\r
+#define PCAP_SRC_FILE_STRING "file://"\r
+/*!\r
+       \brief String that will be used to determine the type of source in use (file,\r
+       remote/local interface).\r
+\r
+       This string will be prepended to the interface name in order to create a string\r
+       that contains all the information required to open the source.\r
+\r
+       This string indicates that the user wants to open a capture from a network interface.\r
+       This string does not necessarily involve the use of the RPCAP protocol. If the\r
+       interface required resides on the local host, the RPCAP protocol is not involved\r
+       and the local functions are used.\r
+*/\r
+#define PCAP_SRC_IF_STRING "rpcap://"\r
+\r
+/*!\r
+       \}\r
+*/\r
+\r
+\r
+\r
+\r
+\r
+/*!\r
+       \addtogroup remote_open_flags\r
+       \{\r
+*/\r
+\r
+/*!\r
+       \brief Defines if the adapter has to go in promiscuous mode.\r
+\r
+       It is '1' if you have to open the adapter in promiscuous mode, '0' otherwise.\r
+       Note that even if this parameter is false, the interface could well be in promiscuous\r
+       mode for some other reason (for example because another capture process with \r
+       promiscuous mode enabled is currently using that interface).\r
+       On on Linux systems with 2.2 or later kernels (that have the "any" device), this\r
+       flag does not work on the "any" device; if an argument of "any" is supplied,\r
+       the 'promisc' flag is ignored.\r
+*/\r
+#define PCAP_OPENFLAG_PROMISCUOUS              1\r
+\r
+/*!\r
+       \brief Defines if the data trasfer (in case of a remote\r
+       capture) has to be done with UDP protocol.\r
+\r
+       If it is '1' if you want a UDP data connection, '0' if you want\r
+       a TCP data connection; control connection is always TCP-based.\r
+       A UDP connection is much lighter, but it does not guarantee that all\r
+       the captured packets arrive to the client workstation. Moreover, \r
+       it could be harmful in case of network congestion.\r
+       This flag is meaningless if the source is not a remote interface.\r
+       In that case, it is simply ignored.\r
+*/\r
+#define PCAP_OPENFLAG_DATATX_UDP                       2\r
+\r
+\r
+/*!\r
+       \brief Defines if the remote probe will capture its own generated traffic.\r
+\r
+       In case the remote probe uses the same interface to capture traffic and to send\r
+       data back to the caller, the captured traffic includes the RPCAP traffic as well.\r
+       If this flag is turned on, the RPCAP traffic is excluded from the capture, so that\r
+       the trace returned back to the collector is does not include this traffic.\r
+*/\r
+#define PCAP_OPENFLAG_NOCAPTURE_RPCAP  4\r
+\r
+/*!\r
+       \brief Defines if the local adapter will capture its own generated traffic.\r
+\r
+       This flag tells the underlying capture driver to drop the packets that were sent by itself. \r
+       This is usefult when building applications like bridges, that should ignore the traffic\r
+       they just sent.\r
+*/\r
+#define PCAP_OPENFLAG_NOCAPTURE_LOCAL  8\r
+\r
+/*!\r
+       \brief This flag configures the adapter for maximum responsiveness.\r
+\r
+       In presence of a large value for nbytes, WinPcap waits for the arrival of several packets before \r
+       copying the data to the user. This guarantees a low number of system calls, i.e. lower processor usage, \r
+       i.e. better performance, which is good for applications like sniffers. If the user sets the \r
+       PCAP_OPENFLAG_MAX_RESPONSIVENESS flag, the capture driver will copy the packets as soon as the application \r
+       is ready to receive them. This is suggested for real time applications (like, for example, a bridge) \r
+       that need the best responsiveness.*/\r
+#define PCAP_OPENFLAG_MAX_RESPONSIVENESS       16\r
+\r
+/*!\r
+       \}\r
+*/\r
+\r
+\r
+/*!\r
+       \addtogroup remote_samp_methods\r
+       \{\r
+*/\r
+\r
+/*!\r
+       \brief No sampling has to be done on the current capture.\r
+\r
+       In this case, no sampling algorithms are applied to the current capture.\r
+*/\r
+#define PCAP_SAMP_NOSAMP       0\r
+\r
+/*!\r
+       \brief It defines that only 1 out of N packets must be returned to the user.\r
+\r
+       In this case, the 'value' field of the 'pcap_samp' structure indicates the\r
+       number of packets (minus 1) that must be discarded before one packet got accepted.\r
+       In other words, if 'value = 10', the first packet is returned to the caller, while\r
+       the following 9 are discarded.\r
+*/\r
+#define PCAP_SAMP_1_EVERY_N    1\r
+\r
+/*!\r
+       \brief It defines that we have to return 1 packet every N milliseconds.\r
+\r
+       In this case, the 'value' field of the 'pcap_samp' structure indicates the 'waiting\r
+       time' in milliseconds before one packet got accepted.\r
+       In other words, if 'value = 10', the first packet is returned to the caller; the next \r
+       returned one will be the first packet that arrives when 10ms have elapsed. \r
+*/\r
+#define PCAP_SAMP_FIRST_AFTER_N_MS 2\r
+\r
+/*!\r
+       \}\r
+*/\r
+\r
+\r
+/*!\r
+       \addtogroup remote_auth_methods\r
+       \{\r
+*/\r
+\r
+/*!\r
+       \brief It defines the NULL authentication.\r
+\r
+       This value has to be used within the 'type' member of the pcap_rmtauth structure.\r
+       The 'NULL' authentication has to be equal to 'zero', so that old applications\r
+       can just put every field of struct pcap_rmtauth to zero, and it does work.\r
+*/\r
+#define RPCAP_RMTAUTH_NULL 0\r
+/*!\r
+       \brief It defines the username/password authentication.\r
+\r
+       With this type of authentication, the RPCAP protocol will use the username/\r
+       password provided to authenticate the user on the remote machine. If the\r
+       authentication is successful (and the user has the right to open network devices)\r
+       the RPCAP connection will continue; otherwise it will be dropped.\r
+\r
+       This value has to be used within the 'type' member of the pcap_rmtauth structure.\r
+*/\r
+#define RPCAP_RMTAUTH_PWD 1\r
+\r
+/*!\r
+       \}\r
+*/\r
+\r
+\r
+\r
+\r
+/*!\r
+\r
+       \brief This structure keeps the information needed to autheticate\r
+       the user on a remote machine.\r
+       \r
+       The remote machine can either grant or refuse the access according \r
+       to the information provided.\r
+       In case the NULL authentication is required, both 'username' and\r
+       'password' can be NULL pointers.\r
+       \r
+       This structure is meaningless if the source is not a remote interface;\r
+       in that case, the functions which requires such a structure can accept\r
+       a NULL pointer as well.\r
+*/\r
+struct pcap_rmtauth\r
+{\r
+       /*!\r
+               \brief Type of the authentication required.\r
+\r
+               In order to provide maximum flexibility, we can support different types\r
+               of authentication based on the value of this 'type' variable. The currently \r
+               supported authentication methods are defined into the\r
+               \link remote_auth_methods Remote Authentication Methods Section\endlink.\r
+\r
+       */\r
+       int type;\r
+       /*!\r
+               \brief Zero-terminated string containing the username that has to be \r
+               used on the remote machine for authentication.\r
+               \r
+               This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication\r
+               and it can be NULL.\r
+       */\r
+       char *username;\r
+       /*!\r
+               \brief Zero-terminated string containing the password that has to be \r
+               used on the remote machine for authentication.\r
+               \r
+               This field is meaningless in case of the RPCAP_RMTAUTH_NULL authentication\r
+               and it can be NULL.\r
+       */\r
+       char *password;\r
+};\r
+\r
+\r
+/*!\r
+       \brief This structure defines the information related to sampling.\r
+\r
+       In case the sampling is requested, the capturing device should read\r
+       only a subset of the packets coming from the source. The returned packets depend\r
+       on the sampling parameters.\r
+\r
+       \warning The sampling process is applied <strong>after</strong> the filtering process.\r
+       In other words, packets are filtered first, then the sampling process selects a\r
+       subset of the 'filtered' packets and it returns them to the caller.\r
+*/\r
+struct pcap_samp\r
+{\r
+       /*!\r
+               Method used for sampling. Currently, the supported methods are listed in the\r
+               \link remote_samp_methods Sampling Methods Section\endlink.\r
+       */\r
+       int method;\r
+\r
+       /*!\r
+               This value depends on the sampling method defined. For its meaning, please check\r
+               at the \link remote_samp_methods Sampling Methods Section\endlink.\r
+       */\r
+       int value;\r
+};\r
+\r
+\r
+\r
+\r
+//! Maximum lenght of an host name (needed for the RPCAP active mode)\r
+#define RPCAP_HOSTLIST_SIZE 1024\r
+\r
+\r
+/*!\r
+       \}\r
+*/ // end of public documentation\r
+\r
+\r
+// Exported functions\r
+\r
+\r
+\r
+/** \name New WinPcap functions\r
+\r
+       This section lists the new functions that are able to help considerably in writing\r
+       WinPcap programs because of their easiness of use.\r
+ */\r
+//\{\r
+pcap_t *pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *errbuf);\r
+int pcap_createsrcstr(char *source, int type, const char *host, const char *port, const char *name, char *errbuf);\r
+int pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf);\r
+int pcap_findalldevs_ex(char *source, struct pcap_rmtauth *auth, pcap_if_t **alldevs, char *errbuf);\r
+struct pcap_samp *pcap_setsampling(pcap_t *p);\r
+\r
+//\}\r
+// End of new winpcap functions\r
+\r
+\r
+\r
+/** \name Remote Capture functions\r
+ */\r
+//\{ \r
+SOCKET pcap_remoteact_accept(const char *address, const char *port, const char *hostlist, char *connectinghost, struct pcap_rmtauth *auth, char *errbuf);\r
+int pcap_remoteact_list(char *hostlist, char sep, int size, char *errbuf);\r
+int pcap_remoteact_close(const char *host, char *errbuf);\r
+void pcap_remoteact_cleanup();\r
+//\}\r
+// End of remote capture functions\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/wpcap.lib b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/wpcap.lib
new file mode 100644 (file)
index 0000000..f832e04
Binary files /dev/null and b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/WinPCap/wpcap.lib differ
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_Windows_Simulator/main.c
new file mode 100644 (file)
index 0000000..4afe073
--- /dev/null
@@ -0,0 +1,354 @@
+/*\r
+    FreeRTOS V7.4.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+\r
+    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
+    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+\r
+    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
+    details. You should have received a copy of the GNU General Public License\r
+    and the FreeRTOS license exception along with FreeRTOS; if not itcan be\r
+    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
+    writing to Real Time Engineers Ltd., contact details for whom are available\r
+    on the FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                     *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions, \r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
+    fully thread aware and reentrant UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
+    Integrity Systems, who sell the code with commercial support, \r
+    indemnification and middleware, under the OpenRTOS brand.\r
+    \r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety \r
+    engineered and independently SIL3 certified version for use in safety and \r
+    mission critical applications that require provable dependability.\r
+*/\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* Demo application includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "SimpleClientAndServer.h"\r
+#include "TwoEchoClients.h"\r
+#include "UDPCommandInterpreter.h"\r
+#include "SelectServer.h"\r
+\r
+/* UDP command server task parameters. */\r
+#define mainUDP_CLI_TASK_PRIORITY                                      ( tskIDLE_PRIORITY )\r
+#define mainUDP_CLI_PORT_NUMBER                                                ( 5001UL )\r
+#define mainUDP_CLI_TASK_STACK_SIZE                                    ( configMINIMAL_STACK_SIZE )\r
+\r
+/* Simple UDP client and server task parameters. */\r
+#define mainSIMPLE_CLIENT_SERVER_TASK_PRIORITY         ( tskIDLE_PRIORITY )\r
+#define mainSIMPLE_CLIENT_SERVER_PORT                          ( 5005UL )\r
+#define mainSIMPLE_CLIENT_SERVER_TASK_STACK_SIZE       ( configMINIMAL_STACK_SIZE )\r
+\r
+/* Select UDP server task parameters. */\r
+#define mainSELECT_SERVER_TASK_PRIORITY                                ( tskIDLE_PRIORITY )\r
+#define mainSELECT_SERVER_PORT                                         ( 10001UL )\r
+#define mainSELECT_SERVER_TASK_STACK_SIZE                      ( configMINIMAL_STACK_SIZE )\r
+\r
+/* Echo client task parameters. */\r
+#define mainECHO_CLIENT_TASK_STACK_SIZE                        ( configMINIMAL_STACK_SIZE * 2 )\r
+#define mainECHO_CLIENT_TASK_PRIORITY                          ( tskIDLE_PRIORITY + 1 )\r
+\r
+/* Set the following constants to 1 or 0 to define which tasks to include and \r
+exclude. */\r
+#define mainCREATE_UDP_CLI_TASKS                                       1\r
+#define mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS      0\r
+#define mainCREATE_SELECT_UDP_SERVER_TASKS                     1\r
+#define mainCREATE_UDP_ECHO_TASKS                                      0\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Register commands that can be used with FreeRTOS+CLI through the UDP socket.\r
+ * The commands are defined in CLI-commands.c.\r
+ */\r
+extern void vRegisterCLICommands( void );\r
+\r
+/* The default IP and MAC address used by the demo.  The address configuration\r
+defined here will be used if ipconfigUSE_DHCP is 0, or if ipconfigUSE_DHCP is\r
+1 but a DHCP server could not be contacted.  See the online documentation for\r
+more information. */\r
+static const uint8_t ucIPAddress[ 4 ] = { configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3 };\r
+static const uint8_t ucNetMask[ 4 ] = { configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3 };\r
+static const uint8_t ucGatewayAddress[ 4 ] = { configGATEWAY_ADDR0, configGATEWAY_ADDR1, configGATEWAY_ADDR2, configGATEWAY_ADDR3 };\r
+static const uint8_t ucDNSServerAddress[ 4 ] = { configDNS_SERVER_ADDR0, configDNS_SERVER_ADDR1, configDNS_SERVER_ADDR2, configDNS_SERVER_ADDR3 };\r
+\r
+/* Default MAC address configuration.  The demo creates a virtual network\r
+connection that uses this MAC address by accessing the raw Ethernet data\r
+to and from a real network connection on the host PC.  See the\r
+configNETWORK_INTERFACE_TO_USE definition for information on how to configure\r
+the real network connection to use. */\r
+const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };\r
+\r
+/* Used to guard prints to the console. */\r
+static xSemaphoreHandle xConsoleMutex = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+\r
+/******************************************************************************\r
+ *\r
+ * See the following web page for information on using this demo.\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/RTOS_UDP_CLI_Windows_Simulator.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+int main( void )\r
+{\r
+const uint32_t ulLongTime_ms = 250UL;\r
+\r
+       /* Create a mutex that is used to guard against the console being accessed \r
+       by more than one task simultaniously. */\r
+       xConsoleMutex = xSemaphoreCreateMutex();\r
+\r
+       /* Initialise the network interface.  Tasks that use the network are\r
+       created in the network event hook when the network is connected and ready\r
+       for use.  The address values passed in here are used if ipconfigUSE_DHCP is\r
+       set to 0, or if ipconfigUSE_DHCP is set to 1 but a DHCP server cannot be\r
+       contacted. */\r
+       FreeRTOS_IPInit( ucIPAddress, ucNetMask, ucGatewayAddress, ucDNSServerAddress, ucMACAddress );\r
+\r
+       /* Register commands with the FreeRTOS+CLI command interpreter. */\r
+       vRegisterCLICommands();\r
+\r
+       /* Start the RTOS scheduler. */\r
+       vTaskStartScheduler();\r
+\r
+       /* If all is well, the scheduler will now be running, and the following\r
+       line will never be reached.  If the following line does execute, then\r
+       there was insufficient FreeRTOS heap memory available for the idle and/or\r
+       timer tasks     to be created.  See the memory management section on the\r
+       FreeRTOS web site for more details (this is standard text that is not not\r
+       really applicable to the Win32 simulator port). */\r
+       for( ;; )\r
+       {\r
+               Sleep( ulLongTime_ms );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+const unsigned long ulMSToSleep = 5;\r
+\r
+       /* This function is called on each cycle of the idle task if\r
+       configUSE_IDLE_HOOK is set to 1 in FreeRTOSConfig.h.  Sleep to reduce CPU\r
+       load. */\r
+       Sleep( ulMSToSleep );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( void )\r
+{\r
+const unsigned long ulLongSleep = 1000UL;\r
+volatile uint32_t ulBlockVariable = 0UL;\r
+\r
+       /* Setting ulBlockVariable to a non-zero value in the debugger will allow\r
+       this function to be exited. */\r
+       taskDISABLE_INTERRUPTS();\r
+       {\r
+               while( ulBlockVariable == 0UL )\r
+               {\r
+                       Sleep( ulLongSleep );\r
+               }\r
+       }\r
+       taskENABLE_INTERRUPTS();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vOutputString( char *pcMessage )\r
+{\r
+       /* Wrap the standard windows console output (as opposed to the FreeRTOS+CLI\r
+       console) with a mutex to ensure it can only be accessed by one task at a\r
+       time. */\r
+       xSemaphoreTake( xConsoleMutex, portMAX_DELAY );\r
+               printf( pcMessage );\r
+       xSemaphoreGive( xConsoleMutex );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called by FreeRTOS+UDP when the network connects. */\r
+void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )\r
+{\r
+uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress;\r
+int8_t cBuffer[ 16 ];\r
+static portBASE_TYPE xTasksAlreadyCreated = pdFALSE;\r
+\r
+       if( eNetworkEvent == eNetworkUp )\r
+       {\r
+               /* Create the tasks that use the IP stack if they have not already been\r
+               created. */\r
+               if( xTasksAlreadyCreated == pdFALSE )\r
+               {\r
+                       #if( mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS == 1 )\r
+                       {\r
+                               /* Create tasks that demonstrate sending and receiving in both\r
+                               standard and zero copy mode. */\r
+                               vStartSimpleUDPClientServerTasks( mainSIMPLE_CLIENT_SERVER_TASK_STACK_SIZE, mainSIMPLE_CLIENT_SERVER_PORT, mainSIMPLE_CLIENT_SERVER_TASK_PRIORITY );\r
+                       }\r
+                       #endif /* mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS */\r
+\r
+                       #if( mainCREATE_SELECT_UDP_SERVER_TASKS == 1 )\r
+                       {\r
+                               /* Create tasks that demonstrate sending and receiving in both\r
+                               standard and zero copy mode. */\r
+                               vStartSelectUDPServerTasks( mainSELECT_SERVER_TASK_STACK_SIZE, mainSELECT_SERVER_PORT, mainSELECT_SERVER_TASK_PRIORITY );\r
+                       }\r
+                       #endif /* mainCREATE_SIMPLE_UDP_CLIENT_SERVER_TASKS */\r
+\r
+\r
+                       #if( mainCREATE_UDP_ECHO_TASKS == 1 )\r
+                       {\r
+                               /* Create the tasks that transmit to and receive from a standard\r
+                               echo server (see the web documentation for this port) in both\r
+                               standard and zero copy mode. */\r
+                               vStartEchoClientTasks( mainECHO_CLIENT_TASK_STACK_SIZE, mainECHO_CLIENT_TASK_PRIORITY );\r
+                       }\r
+                       #endif /* mainCREATE_UDP_ECHO_TASKS */\r
+\r
+                       #if( mainCREATE_UDP_CLI_TASKS == 1 )\r
+                       {\r
+                               /* Create the task that handles the CLI on a UDP port.  The port number\r
+                               is set using the configUDP_CLI_PORT_NUMBER setting in FreeRTOSConfig.h. */\r
+                               vStartUDPCommandInterpreterTask( mainUDP_CLI_TASK_STACK_SIZE, mainUDP_CLI_PORT_NUMBER, mainUDP_CLI_TASK_PRIORITY );\r
+                       }\r
+                       #endif /* mainCREATE_UDP_CLI_TASKS */\r
+\r
+                       xTasksAlreadyCreated = pdTRUE;\r
+               }\r
+\r
+               /* Print out the network configuration, which may have come from a DHCP\r
+               server. */\r
+               FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, &ulDNSServerAddress );\r
+               vOutputString( "IP Address: " );\r
+               FreeRTOS_inet_ntoa( ulIPAddress, cBuffer );\r
+               vOutputString( ( char * ) cBuffer );\r
+               vOutputString( "\r\nSubnet Mask: " );\r
+               FreeRTOS_inet_ntoa( ulNetMask, cBuffer );\r
+               vOutputString( ( char * ) cBuffer );\r
+               vOutputString( "\r\nGateway Address: " );\r
+               FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer );\r
+               vOutputString( ( char * ) cBuffer );\r
+               vOutputString( "\r\nDNS Server Address: " );\r
+               FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer );\r
+               vOutputString( ( char * ) cBuffer );\r
+               vOutputString( "\r\n\r\n" );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called automatically when a reply to an outgoing ping is received. */\r
+void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier )\r
+{\r
+static const uint8_t *pcSuccess = ( uint8_t * ) "Ping reply received - ";\r
+static const uint8_t *pcInvalidChecksum = ( uint8_t * ) "Ping reply received with invalid checksum - ";\r
+static const uint8_t *pcInvalidData = ( uint8_t * ) "Ping reply received with invalid data - ";\r
+static uint8_t cMessage[ 50 ];\r
+\r
+\r
+       switch( eStatus )\r
+       {\r
+               case eSuccess   :\r
+                       vOutputString( ( char * ) pcSuccess );\r
+                       break;\r
+\r
+               case eInvalidChecksum :\r
+                       vOutputString( ( char * ) pcInvalidChecksum );\r
+                       break;\r
+\r
+               case eInvalidData :\r
+                       vOutputString( ( char * ) pcInvalidData );\r
+                       break;\r
+\r
+               default :\r
+                       /* It is not possible to get here as all enums have their own\r
+                       case. */\r
+                       break;\r
+       }\r
+\r
+       sprintf( ( char * ) cMessage, "identifier %d\r\n", ( int ) usIdentifier );\r
+       vOutputString( ( char * ) cMessage );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationMallocFailedHook( void )\r
+{\r
+       /* vApplicationMallocFailedHook() will only be called if\r
+       configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
+       function that will get called if a call to pvPortMalloc() fails.\r
+       pvPortMalloc() is called internally by the kernel whenever a task, queue,\r
+       timer or semaphore is created.  It is also called by various parts of the\r
+       demo application.  If heap_1.c, heap_2.c or heap_4.c are used, then the \r
+       size of the heap available to pvPortMalloc() is defined by \r
+       configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() \r
+       API function can be used to query the size of free heap space that remains \r
+       (although it does not provide information on how the remaining heap might \r
+       be fragmented). */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/AUTHORS b/FreeRTOS-Plus/Source/CyaSSL/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/FreeRTOS-Plus/Source/CyaSSL/COPYING b/FreeRTOS-Plus/Source/CyaSSL/COPYING
new file mode 100644 (file)
index 0000000..d60c31a
--- /dev/null
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ChangeLog b/FreeRTOS-Plus/Source/CyaSSL/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/FreeRTOS-Plus/Source/CyaSSL/LICENSE_INFORMATION.txt b/FreeRTOS-Plus/Source/CyaSSL/LICENSE_INFORMATION.txt
new file mode 100644 (file)
index 0000000..930f4cb
--- /dev/null
@@ -0,0 +1,7 @@
+Note the CyaSSL license terms are different to the FreeRTOS license terms.\r
+\r
+CyaSSL is dual licensed.  The files are provided here under an unmodified open\r
+source GNU GPL license.  Commercial licenses are also available.  \r
+See http://www.FreeRTOS.org/ssl\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/Makefile.am b/FreeRTOS-Plus/Source/CyaSSL/Makefile.am
new file mode 100644 (file)
index 0000000..8362665
--- /dev/null
@@ -0,0 +1,78 @@
+# includes append to these:
+SUFFIXES =
+TESTS =
+CLEANFILES =
+DISTCLEANFILES =
+bin_PROGRAMS =
+noinst_HEADERS =
+lib_LTLIBRARIES =
+man_MANS =
+noinst_LTLIBRARIES =
+noinst_PROGRAMS =
+include_HEADERS =
+nobase_include_HEADERS =
+check_PROGRAMS =
+EXTRA_HEADERS =
+BUILT_SOURCES=
+EXTRA_DIST=
+doc_DATA=
+
+exampledir = $(docdir)/@PACKAGE@/example
+example_DATA=
+EXTRA_DIST+= $(example_DATA)
+
+EXTRA_DIST+= $(doc_DATA)
+
+ACLOCAL_AMFLAGS= -I m4 --install
+
+EXTRA_DIST+= lib/dummy
+
+EXTRA_DIST+= cyassl-ntru.vcproj
+EXTRA_DIST+= cyassl.vcproj
+EXTRA_DIST+= cyassl-iphone.xcodeproj/project.pbxproj
+EXTRA_DIST+= cyassl-ntru.sln
+EXTRA_DIST+= cyassl.sln
+
+include cyassl/include.am
+include certs/include.am
+include certs/crl/include.am
+include doc/include.am
+include swig/include.am
+
+include src/include.am
+include ctaocrypt/benchmark/include.am
+include ctaocrypt/src/include.am
+include ctaocrypt/test/include.am
+include examples/client/include.am
+include examples/server/include.am
+include examples/echoclient/include.am
+include examples/echoserver/include.am
+include testsuite/include.am
+include tests/include.am
+include sslSniffer/sslSnifferTest/include.am
+
+TESTS += $(check_PROGRAMS)
+test: check
+
+# !!!! first line of rule has to start with a hard (real) tab, not spaces
+egs:
+       $(MAKE) examples/client/client; \
+       $(MAKE) examples/echoclient/echoclient;\
+       $(MAKE) examples/server/server; \
+       $(MAKE) examples/echoserver/echoserver;
+
+ctc:
+       $(MAKE) ctaocrypt/test/testctaocrypt; \
+       $(MAKE) ctaocrypt/benchmark/benchmark; 
+
+merge-clean:
+       @find ./ | $(GREP) \.gcda | xargs rm -f
+       @find ./ | $(GREP) \.gcno | xargs rm -f
+       @find ./ | $(GREP) \.gz | xargs rm -f
+       @find ./ | $(GREP) \.orig | xargs rm -f
+       @find ./ | $(GREP) \.rej | xargs rm -f
+       @find ./ | $(GREP) \.rpm | xargs rm -f
+       @find ./ | $(GREP) \.THIS | xargs rm -f
+       @find ./ | $(GREP) \.OTHER | xargs rm -f
+       @find ./ | $(GREP) \.BASE | xargs rm -f
+       @find ./ | $(GREP) \~$$ | xargs rm -f
diff --git a/FreeRTOS-Plus/Source/CyaSSL/Makefile.in b/FreeRTOS-Plus/Source/CyaSSL/Makefile.in
new file mode 100644 (file)
index 0000000..f40b3da
--- /dev/null
@@ -0,0 +1,2112 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+bin_PROGRAMS =
+noinst_PROGRAMS = ctaocrypt/benchmark/benchmark$(EXEEXT) \
+       ctaocrypt/test/testctaocrypt$(EXEEXT) \
+       examples/client/client$(EXEEXT) \
+       examples/server/server$(EXEEXT) \
+       examples/echoclient/echoclient$(EXEEXT) \
+       examples/echoserver/echoserver$(EXEEXT) \
+       testsuite/testsuite$(EXEEXT) tests/unit$(EXEEXT) \
+       sslSniffer/sslSnifferTest/snifftest$(EXEEXT)
+check_PROGRAMS = testsuite/testsuite$(EXEEXT) tests/unit$(EXEEXT)
+DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
+       $(nobase_include_HEADERS) $(noinst_HEADERS) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/certs/crl/include.am $(srcdir)/certs/include.am \
+       $(srcdir)/config.in $(srcdir)/ctaocrypt/benchmark/include.am \
+       $(srcdir)/ctaocrypt/src/include.am \
+       $(srcdir)/ctaocrypt/test/include.am \
+       $(srcdir)/cyassl/ctaocrypt/include.am \
+       $(srcdir)/cyassl/include.am \
+       $(srcdir)/cyassl/openssl/include.am $(srcdir)/doc/include.am \
+       $(srcdir)/examples/client/include.am \
+       $(srcdir)/examples/echoclient/include.am \
+       $(srcdir)/examples/echoserver/include.am \
+       $(srcdir)/examples/server/include.am $(srcdir)/src/include.am \
+       $(srcdir)/sslSniffer/sslSnifferTest/include.am \
+       $(srcdir)/stamp-h.in $(srcdir)/swig/include.am \
+       $(srcdir)/tests/include.am $(srcdir)/testsuite/include.am \
+       $(top_srcdir)/configure $(top_srcdir)/cyassl/version.h.in \
+       $(top_srcdir)/support/libcyassl.pc.in AUTHORS COPYING \
+       ChangeLog NEWS config/compile config/config.guess \
+       config/config.sub config/depcomp config/install-sh \
+       config/ltmain.sh config/missing
+@BUILD_AESNI_TRUE@am__append_1 = ctaocrypt/src/aes_asm.s
+@BUILD_MD2_TRUE@am__append_2 = ctaocrypt/src/md2.c
+@BUILD_RIPEMD_TRUE@am__append_3 = ctaocrypt/src/ripemd.c
+@BUILD_SHA512_TRUE@am__append_4 = ctaocrypt/src/sha512.c
+@BUILD_SNIFFER_TRUE@am__append_5 = src/sniffer.c
+@BUILD_HC128_TRUE@am__append_6 = ctaocrypt/src/hc128.c
+@BUILD_NOINLINE_TRUE@am__append_7 = ctaocrypt/src/misc.c
+@BUILD_FASTMATH_TRUE@am__append_8 = ctaocrypt/src/tfm.c
+@BUILD_FASTMATH_FALSE@am__append_9 = ctaocrypt/src/integer.c
+@BUILD_ECC_TRUE@am__append_10 = ctaocrypt/src/ecc.c
+@BUILD_OCSP_TRUE@am__append_11 = src/ocsp.c
+@BUILD_CRL_TRUE@am__append_12 = src/crl.c
+@BUILD_CRL_MONITOR_TRUE@am__append_13 = $(PTHREAD_CFLAGS)
+@BUILD_CRL_MONITOR_TRUE@am__append_14 = $(PTHREAD_LIBS)
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
+       $(top_srcdir)/m4/hexversion.m4 \
+       $(top_srcdir)/m4/lib_socket_nsl.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+       $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+       $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = stamp-h cyassl/version.h support/libcyassl.pc
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+       "$(DESTDIR)$(docdir)" "$(DESTDIR)$(exampledir)" \
+       "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+@BUILD_CRL_MONITOR_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+src_libcyassl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_2)
+am__src_libcyassl_la_SOURCES_DIST = src/internal.c src/io.c src/keys.c \
+       src/ssl.c src/tls.c ctaocrypt/src/asn.c ctaocrypt/src/coding.c \
+       ctaocrypt/src/des3.c ctaocrypt/src/hmac.c ctaocrypt/src/md5.c \
+       ctaocrypt/src/md4.c ctaocrypt/src/random.c ctaocrypt/src/rsa.c \
+       ctaocrypt/src/sha.c ctaocrypt/src/aes.c ctaocrypt/src/sha256.c \
+       ctaocrypt/src/dh.c ctaocrypt/src/dsa.c ctaocrypt/src/arc4.c \
+       ctaocrypt/src/rabbit.c ctaocrypt/src/pwdbased.c \
+       ctaocrypt/src/logging.c ctaocrypt/src/memory.c \
+       ctaocrypt/src/aes_asm.s ctaocrypt/src/md2.c \
+       ctaocrypt/src/ripemd.c ctaocrypt/src/sha512.c src/sniffer.c \
+       ctaocrypt/src/hc128.c ctaocrypt/src/misc.c ctaocrypt/src/tfm.c \
+       ctaocrypt/src/integer.c ctaocrypt/src/ecc.c src/ocsp.c \
+       src/crl.c
+am__dirstamp = $(am__leading_dot)dirstamp
+@BUILD_AESNI_TRUE@am__objects_1 = ctaocrypt/src/aes_asm.lo
+@BUILD_MD2_TRUE@am__objects_2 = ctaocrypt/src/src_libcyassl_la-md2.lo
+@BUILD_RIPEMD_TRUE@am__objects_3 =  \
+@BUILD_RIPEMD_TRUE@    ctaocrypt/src/src_libcyassl_la-ripemd.lo
+@BUILD_SHA512_TRUE@am__objects_4 =  \
+@BUILD_SHA512_TRUE@    ctaocrypt/src/src_libcyassl_la-sha512.lo
+@BUILD_SNIFFER_TRUE@am__objects_5 = src/src_libcyassl_la-sniffer.lo
+@BUILD_HC128_TRUE@am__objects_6 =  \
+@BUILD_HC128_TRUE@     ctaocrypt/src/src_libcyassl_la-hc128.lo
+@BUILD_NOINLINE_TRUE@am__objects_7 =  \
+@BUILD_NOINLINE_TRUE@  ctaocrypt/src/src_libcyassl_la-misc.lo
+@BUILD_FASTMATH_TRUE@am__objects_8 =  \
+@BUILD_FASTMATH_TRUE@  ctaocrypt/src/src_libcyassl_la-tfm.lo
+@BUILD_FASTMATH_FALSE@am__objects_9 = ctaocrypt/src/src_libcyassl_la-integer.lo
+@BUILD_ECC_TRUE@am__objects_10 =  \
+@BUILD_ECC_TRUE@       ctaocrypt/src/src_libcyassl_la-ecc.lo
+@BUILD_OCSP_TRUE@am__objects_11 = src/src_libcyassl_la-ocsp.lo
+@BUILD_CRL_TRUE@am__objects_12 = src/src_libcyassl_la-crl.lo
+am_src_libcyassl_la_OBJECTS = src/src_libcyassl_la-internal.lo \
+       src/src_libcyassl_la-io.lo src/src_libcyassl_la-keys.lo \
+       src/src_libcyassl_la-ssl.lo src/src_libcyassl_la-tls.lo \
+       ctaocrypt/src/src_libcyassl_la-asn.lo \
+       ctaocrypt/src/src_libcyassl_la-coding.lo \
+       ctaocrypt/src/src_libcyassl_la-des3.lo \
+       ctaocrypt/src/src_libcyassl_la-hmac.lo \
+       ctaocrypt/src/src_libcyassl_la-md5.lo \
+       ctaocrypt/src/src_libcyassl_la-md4.lo \
+       ctaocrypt/src/src_libcyassl_la-random.lo \
+       ctaocrypt/src/src_libcyassl_la-rsa.lo \
+       ctaocrypt/src/src_libcyassl_la-sha.lo \
+       ctaocrypt/src/src_libcyassl_la-aes.lo \
+       ctaocrypt/src/src_libcyassl_la-sha256.lo \
+       ctaocrypt/src/src_libcyassl_la-dh.lo \
+       ctaocrypt/src/src_libcyassl_la-dsa.lo \
+       ctaocrypt/src/src_libcyassl_la-arc4.lo \
+       ctaocrypt/src/src_libcyassl_la-rabbit.lo \
+       ctaocrypt/src/src_libcyassl_la-pwdbased.lo \
+       ctaocrypt/src/src_libcyassl_la-logging.lo \
+       ctaocrypt/src/src_libcyassl_la-memory.lo $(am__objects_1) \
+       $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+       $(am__objects_5) $(am__objects_6) $(am__objects_7) \
+       $(am__objects_8) $(am__objects_9) $(am__objects_10) \
+       $(am__objects_11) $(am__objects_12)
+src_libcyassl_la_OBJECTS = $(am_src_libcyassl_la_OBJECTS)
+src_libcyassl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_libcyassl_la_CFLAGS) \
+       $(CFLAGS) $(src_libcyassl_la_LDFLAGS) $(LDFLAGS) -o $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am_ctaocrypt_benchmark_benchmark_OBJECTS =  \
+       ctaocrypt/benchmark/benchmark.$(OBJEXT)
+ctaocrypt_benchmark_benchmark_OBJECTS =  \
+       $(am_ctaocrypt_benchmark_benchmark_OBJECTS)
+am_ctaocrypt_test_testctaocrypt_OBJECTS =  \
+       ctaocrypt/test/test.$(OBJEXT)
+ctaocrypt_test_testctaocrypt_OBJECTS =  \
+       $(am_ctaocrypt_test_testctaocrypt_OBJECTS)
+am_examples_client_client_OBJECTS = examples/client/client.$(OBJEXT)
+examples_client_client_OBJECTS = $(am_examples_client_client_OBJECTS)
+am_examples_echoclient_echoclient_OBJECTS =  \
+       examples/echoclient/echoclient.$(OBJEXT)
+examples_echoclient_echoclient_OBJECTS =  \
+       $(am_examples_echoclient_echoclient_OBJECTS)
+am_examples_echoserver_echoserver_OBJECTS =  \
+       examples/echoserver/echoserver.$(OBJEXT)
+examples_echoserver_echoserver_OBJECTS =  \
+       $(am_examples_echoserver_echoserver_OBJECTS)
+am_examples_server_server_OBJECTS = examples/server/server.$(OBJEXT)
+examples_server_server_OBJECTS = $(am_examples_server_server_OBJECTS)
+am_sslSniffer_sslSnifferTest_snifftest_OBJECTS =  \
+       sslSniffer/sslSnifferTest/snifftest.$(OBJEXT)
+sslSniffer_sslSnifferTest_snifftest_OBJECTS =  \
+       $(am_sslSniffer_sslSnifferTest_snifftest_OBJECTS)
+am_tests_unit_OBJECTS = tests/tests_unit-unit.$(OBJEXT) \
+       tests/tests_unit-api.$(OBJEXT) \
+       tests/tests_unit-suites.$(OBJEXT) \
+       tests/tests_unit-hash.$(OBJEXT) \
+       examples/client/tests_unit-client.$(OBJEXT) \
+       examples/server/tests_unit-server.$(OBJEXT)
+tests_unit_OBJECTS = $(am_tests_unit_OBJECTS)
+tests_unit_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(tests_unit_CFLAGS) \
+       $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_testsuite_testsuite_OBJECTS =  \
+       ctaocrypt/test/testsuite_testsuite-test.$(OBJEXT) \
+       examples/client/testsuite_testsuite-client.$(OBJEXT) \
+       examples/echoclient/testsuite_testsuite-echoclient.$(OBJEXT) \
+       examples/echoserver/testsuite_testsuite-echoserver.$(OBJEXT) \
+       examples/server/testsuite_testsuite-server.$(OBJEXT) \
+       testsuite/testsuite_testsuite-testsuite.$(OBJEXT)
+testsuite_testsuite_OBJECTS = $(am_testsuite_testsuite_OBJECTS)
+testsuite_testsuite_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+       $(testsuite_testsuite_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+LTCCASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
+SOURCES = $(src_libcyassl_la_SOURCES) \
+       $(ctaocrypt_benchmark_benchmark_SOURCES) \
+       $(ctaocrypt_test_testctaocrypt_SOURCES) \
+       $(examples_client_client_SOURCES) \
+       $(examples_echoclient_echoclient_SOURCES) \
+       $(examples_echoserver_echoserver_SOURCES) \
+       $(examples_server_server_SOURCES) \
+       $(sslSniffer_sslSnifferTest_snifftest_SOURCES) \
+       $(tests_unit_SOURCES) $(testsuite_testsuite_SOURCES)
+DIST_SOURCES = $(am__src_libcyassl_la_SOURCES_DIST) \
+       $(ctaocrypt_benchmark_benchmark_SOURCES) \
+       $(ctaocrypt_test_testctaocrypt_SOURCES) \
+       $(examples_client_client_SOURCES) \
+       $(examples_echoclient_echoclient_SOURCES) \
+       $(examples_echoserver_echoserver_SOURCES) \
+       $(examples_server_server_SOURCES) \
+       $(sslSniffer_sslSnifferTest_snifftest_SOURCES) \
+       $(tests_unit_SOURCES) $(testsuite_testsuite_SOURCES)
+docDATA_INSTALL = $(INSTALL_DATA)
+exampleDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(doc_DATA) $(example_DATA)
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+nobase_includeHEADERS_INSTALL = $(install_sh_DATA)
+HEADERS = $(include_HEADERS) $(nobase_include_HEADERS) \
+       $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_LDFLAGS = @AM_LDFLAGS@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYASSL_LIBRARY_VERSION = @CYASSL_LIBRARY_VERSION@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HEX_VERSION = @HEX_VERSION@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# includes append to these:
+SUFFIXES = 
+TESTS = $(check_PROGRAMS)
+CLEANFILES = 
+DISTCLEANFILES = 
+noinst_HEADERS = 
+lib_LTLIBRARIES = src/libcyassl.la
+man_MANS = 
+noinst_LTLIBRARIES = 
+include_HEADERS = 
+nobase_include_HEADERS = cyassl/ctaocrypt/aes.h \
+       cyassl/ctaocrypt/arc4.h cyassl/ctaocrypt/asn.h \
+       cyassl/ctaocrypt/asn_public.h cyassl/ctaocrypt/coding.h \
+       cyassl/ctaocrypt/des3.h cyassl/ctaocrypt/dh.h \
+       cyassl/ctaocrypt/dsa.h cyassl/ctaocrypt/ecc.h \
+       cyassl/ctaocrypt/error.h cyassl/ctaocrypt/hc128.h \
+       cyassl/ctaocrypt/hmac.h cyassl/ctaocrypt/integer.h \
+       cyassl/ctaocrypt/md2.h cyassl/ctaocrypt/md4.h \
+       cyassl/ctaocrypt/md5.h cyassl/ctaocrypt/misc.h \
+       cyassl/ctaocrypt/pwdbased.h cyassl/ctaocrypt/rabbit.h \
+       cyassl/ctaocrypt/random.h cyassl/ctaocrypt/ripemd.h \
+       cyassl/ctaocrypt/rsa.h cyassl/ctaocrypt/settings.h \
+       cyassl/ctaocrypt/sha256.h cyassl/ctaocrypt/sha512.h \
+       cyassl/ctaocrypt/sha.h cyassl/ctaocrypt/tfm.h \
+       cyassl/ctaocrypt/types.h cyassl/ctaocrypt/visibility.h \
+       cyassl/ctaocrypt/logging.h cyassl/ctaocrypt/memory.h \
+       cyassl/ctaocrypt/mpi_class.h cyassl/ctaocrypt/mpi_superclass.h \
+       cyassl/openssl/asn1.h cyassl/openssl/bio.h cyassl/openssl/bn.h \
+       cyassl/openssl/conf.h cyassl/openssl/crypto.h \
+       cyassl/openssl/des.h cyassl/openssl/dh.h cyassl/openssl/dsa.h \
+       cyassl/openssl/ecdsa.h cyassl/openssl/ec.h \
+       cyassl/openssl/engine.h cyassl/openssl/err.h \
+       cyassl/openssl/evp.h cyassl/openssl/hmac.h \
+       cyassl/openssl/lhash.h cyassl/openssl/md4.h \
+       cyassl/openssl/md5.h cyassl/openssl/ripemd.h \
+       cyassl/openssl/ocsp.h cyassl/openssl/opensslconf.h \
+       cyassl/openssl/opensslv.h cyassl/openssl/ossl_typ.h \
+       cyassl/openssl/pem.h cyassl/openssl/pkcs12.h \
+       cyassl/openssl/rand.h cyassl/openssl/rsa.h \
+       cyassl/openssl/sha.h cyassl/openssl/ssl.h \
+       cyassl/openssl/stack.h cyassl/openssl/ui.h \
+       cyassl/openssl/x509.h cyassl/openssl/x509v3.h cyassl/error.h \
+       cyassl/internal.h cyassl/ssl.h cyassl/sniffer_error.h \
+       cyassl/sniffer.h cyassl/callbacks.h cyassl/test.h \
+       cyassl/version.h cyassl/ocsp.h cyassl/crl.h
+EXTRA_HEADERS = 
+BUILT_SOURCES = 
+EXTRA_DIST = $(example_DATA) $(doc_DATA) lib/dummy cyassl-ntru.vcproj \
+       cyassl.vcproj cyassl-iphone.xcodeproj/project.pbxproj \
+       cyassl-ntru.sln cyassl.sln cyassl/sniffer_error.rc \
+       certs/ca-cert.pem certs/ca-key.pem certs/client-cert.pem \
+       certs/client-keyEnc.pem certs/client-key.pem certs/ecc-key.pem \
+       certs/ecc-keyPkcs8.pem certs/ecc-client-key.pem \
+       certs/client-ecc-cert.pem certs/ntru-cert.pem certs/dh2048.pem \
+       certs/server-cert.pem certs/server-ecc.pem \
+       certs/server-ecc-rsa.pem certs/server-keyEnc.pem \
+       certs/server-key.pem certs/server-keyPkcs8Enc12.pem \
+       certs/server-keyPkcs8Enc2.pem certs/server-keyPkcs8Enc.pem \
+       certs/server-keyPkcs8.pem certs/ca-key.der \
+       certs/client-cert.der certs/client-key.der certs/dh2048.der \
+       certs/rsa2048.der certs/dsa2048.der certs/ecc-key.der \
+       certs/ntru-key.raw certs/crl/crl.pem certs/crl/cliCrl.pem \
+       certs/crl/eccSrvCRL.pem certs/crl/eccCliCRL.pem \
+       certs/crl/crl.revoked swig/PythonBuild.sh swig/README \
+       swig/cyassl.i swig/cyassl_adds.c swig/python_cyassl.vcproj \
+       swig/rsasign.py swig/runme.py \
+       ctaocrypt/benchmark/benchmark.sln \
+       ctaocrypt/benchmark/benchmark.vcproj ctaocrypt/src/misc.c \
+       ctaocrypt/src/asm.c ctaocrypt/src/ecc_fp.c \
+       ctaocrypt/src/fp_mont_small.i ctaocrypt/src/fp_mul_comba_12.i \
+       ctaocrypt/src/fp_mul_comba_17.i \
+       ctaocrypt/src/fp_mul_comba_20.i \
+       ctaocrypt/src/fp_mul_comba_24.i \
+       ctaocrypt/src/fp_mul_comba_28.i \
+       ctaocrypt/src/fp_mul_comba_32.i ctaocrypt/src/fp_mul_comba_3.i \
+       ctaocrypt/src/fp_mul_comba_48.i ctaocrypt/src/fp_mul_comba_4.i \
+       ctaocrypt/src/fp_mul_comba_64.i ctaocrypt/src/fp_mul_comba_6.i \
+       ctaocrypt/src/fp_mul_comba_7.i ctaocrypt/src/fp_mul_comba_8.i \
+       ctaocrypt/src/fp_mul_comba_9.i \
+       ctaocrypt/src/fp_mul_comba_small_set.i \
+       ctaocrypt/src/fp_sqr_comba_12.i \
+       ctaocrypt/src/fp_sqr_comba_17.i \
+       ctaocrypt/src/fp_sqr_comba_20.i \
+       ctaocrypt/src/fp_sqr_comba_24.i \
+       ctaocrypt/src/fp_sqr_comba_28.i \
+       ctaocrypt/src/fp_sqr_comba_32.i ctaocrypt/src/fp_sqr_comba_3.i \
+       ctaocrypt/src/fp_sqr_comba_48.i ctaocrypt/src/fp_sqr_comba_4.i \
+       ctaocrypt/src/fp_sqr_comba_64.i ctaocrypt/src/fp_sqr_comba_6.i \
+       ctaocrypt/src/fp_sqr_comba_7.i ctaocrypt/src/fp_sqr_comba_8.i \
+       ctaocrypt/src/fp_sqr_comba_9.i \
+       ctaocrypt/src/fp_sqr_comba_small_set.i ctaocrypt/test/test.sln \
+       ctaocrypt/test/test.vcproj examples/client/client.sln \
+       examples/client/client-ntru.vcproj \
+       examples/client/client.vcproj examples/server/server.sln \
+       examples/server/server-ntru.vcproj \
+       examples/server/server.vcproj \
+       examples/echoclient/echoclient.sln \
+       examples/echoclient/echoclient-ntru.vcproj \
+       examples/echoclient/echoclient.vcproj \
+       examples/echoserver/echoserver.sln \
+       examples/echoserver/echoserver-ntru.vcproj \
+       examples/echoserver/echoserver.vcproj testsuite/testsuite.sln \
+       testsuite/testsuite-ntru.vcproj testsuite/testsuite.vcproj \
+       input quit tests/unit.h tests/test.conf \
+       tests/test-openssl.conf tests/test-hc128.conf \
+       tests/test-psk.conf tests/test-ntru.conf tests/test-ecc.conf \
+       tests/test-aesgcm.conf tests/test-aesgcm-ecc.conf \
+       tests/test-aesgcm-openssl.conf tests/test-dtls.conf \
+       sslSniffer/sslSniffer.vcproj \
+       sslSniffer/sslSnifferTest/sslSniffTest.vcproj
+doc_DATA = certs/taoCert.txt doc/README.txt
+exampledir = $(docdir)/@PACKAGE@/example
+example_DATA = examples/client/client.c examples/server/server.c \
+       examples/echoclient/echoclient.c \
+       examples/echoserver/echoserver.c
+ACLOCAL_AMFLAGS = -I m4 --install
+src_libcyassl_la_SOURCES = src/internal.c src/io.c src/keys.c \
+       src/ssl.c src/tls.c ctaocrypt/src/asn.c ctaocrypt/src/coding.c \
+       ctaocrypt/src/des3.c ctaocrypt/src/hmac.c ctaocrypt/src/md5.c \
+       ctaocrypt/src/md4.c ctaocrypt/src/random.c ctaocrypt/src/rsa.c \
+       ctaocrypt/src/sha.c ctaocrypt/src/aes.c ctaocrypt/src/sha256.c \
+       ctaocrypt/src/dh.c ctaocrypt/src/dsa.c ctaocrypt/src/arc4.c \
+       ctaocrypt/src/rabbit.c ctaocrypt/src/pwdbased.c \
+       ctaocrypt/src/logging.c ctaocrypt/src/memory.c $(am__append_1) \
+       $(am__append_2) $(am__append_3) $(am__append_4) \
+       $(am__append_5) $(am__append_6) $(am__append_7) \
+       $(am__append_8) $(am__append_9) $(am__append_10) \
+       $(am__append_11) $(am__append_12)
+src_libcyassl_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined -version-info ${CYASSL_LIBRARY_VERSION}
+src_libcyassl_la_LIBADD = $(LIBM) $(am__append_14)
+src_libcyassl_la_CFLAGS = -DBUILDING_CYASSL $(AM_CFLAGS) \
+       $(am__append_13)
+src_libcyassl_la_CPPFLAGS = -DBUILDING_CYASSL $(AM_CPPFLAGS)
+ctaocrypt_benchmark_benchmark_SOURCES = ctaocrypt/benchmark/benchmark.c
+ctaocrypt_benchmark_benchmark_LDADD = src/libcyassl.la
+ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
+ctaocrypt_test_testctaocrypt_SOURCES = ctaocrypt/test/test.c
+ctaocrypt_test_testctaocrypt_LDADD = src/libcyassl.la
+ctaocrypt_test_testctaocrypt_DEPENDENCIES = src/libcyassl.la
+examples_client_client_SOURCES = examples/client/client.c
+examples_client_client_LDADD = src/libcyassl.la
+examples_client_client_DEPENDENCIES = src/libcyassl.la
+examples_server_server_SOURCES = examples/server/server.c
+examples_server_server_LDADD = src/libcyassl.la
+examples_server_server_DEPENDENCIES = src/libcyassl.la
+examples_echoclient_echoclient_SOURCES = examples/echoclient/echoclient.c
+examples_echoclient_echoclient_LDADD = src/libcyassl.la
+examples_echoclient_echoclient_DEPENDENCIES = src/libcyassl.la
+examples_echoserver_echoserver_SOURCES = examples/echoserver/echoserver.c
+examples_echoserver_echoserver_LDADD = src/libcyassl.la
+examples_echoserver_echoserver_DEPENDENCIES = src/libcyassl.la
+testsuite_testsuite_SOURCES = \
+                             ctaocrypt/test/test.c \
+                             examples/client/client.c \
+                             examples/echoclient/echoclient.c \
+                             examples/echoserver/echoserver.c \
+                             examples/server/server.c \
+                             testsuite/testsuite.c
+
+testsuite_testsuite_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS) $(PTHREAD_CFLAGS)
+testsuite_testsuite_LDADD = src/libcyassl.la $(PTHREAD_LIBS)
+testsuite_testsuite_DEPENDENCIES = src/libcyassl.la
+tests_unit_SOURCES = \
+                             tests/unit.c \
+                             tests/api.c \
+                             tests/suites.c \
+                  tests/hash.c \
+                             examples/client/client.c \
+                             examples/server/server.c
+
+tests_unit_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS) $(PTHREAD_CFLAGS)
+tests_unit_LDADD = src/libcyassl.la  $(PTHREAD_LIBS)
+tests_unit_DEPENDENCIES = src/libcyassl.la
+sslSniffer_sslSnifferTest_snifftest_SOURCES = sslSniffer/sslSnifferTest/snifftest.c
+@BUILD_SNIFFER_TRUE@sslSniffer_sslSnifferTest_snifftest_LDADD = src/libcyassl.la -lpcap
+@BUILD_SNIFFER_TRUE@sslSniffer_sslSnifferTest_snifftest_DEPENDENCIES = src/libcyassl.la
+all: $(BUILT_SOURCES) config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj .s
+am--refresh:
+       @:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/cyassl/include.am $(srcdir)/cyassl/ctaocrypt/include.am $(srcdir)/cyassl/openssl/include.am $(srcdir)/certs/include.am $(srcdir)/certs/crl/include.am $(srcdir)/doc/include.am $(srcdir)/swig/include.am $(srcdir)/src/include.am $(srcdir)/ctaocrypt/benchmark/include.am $(srcdir)/ctaocrypt/src/include.am $(srcdir)/ctaocrypt/test/include.am $(srcdir)/examples/client/include.am $(srcdir)/examples/server/include.am $(srcdir)/examples/echoclient/include.am $(srcdir)/examples/echoserver/include.am $(srcdir)/testsuite/include.am $(srcdir)/tests/include.am $(srcdir)/sslSniffer/sslSnifferTest/include.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+             cd $(srcdir) && $(AUTOMAKE) --foreign  \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --foreign  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+       else :; fi
+
+stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.in:  $(am__configure_deps) 
+       cd $(top_srcdir) && $(AUTOHEADER)
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f config.h stamp-h1
+stamp-h: $(top_builddir)/config.status $(srcdir)/stamp-h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+cyassl/version.h: $(top_builddir)/config.status $(top_srcdir)/cyassl/version.h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+support/libcyassl.pc: $(top_builddir)/config.status $(top_srcdir)/support/libcyassl.pc.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           f=$(am__strip_dir) \
+           echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+           $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+         else :; fi; \
+       done
+
+uninstall-libLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         p=$(am__strip_dir) \
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+       done
+
+clean-libLTLIBRARIES:
+       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+src/$(am__dirstamp):
+       @$(MKDIR_P) src
+       @: > src/$(am__dirstamp)
+src/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) src/$(DEPDIR)
+       @: > src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-internal.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-io.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-keys.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-ssl.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-tls.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/src
+       @: > ctaocrypt/src/$(am__dirstamp)
+ctaocrypt/src/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/src/$(DEPDIR)
+       @: > ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-asn.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-coding.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-des3.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-hmac.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-md5.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-md4.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-random.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-rsa.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-sha.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-aes.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-sha256.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-dh.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-dsa.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-arc4.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-rabbit.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-pwdbased.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-logging.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-memory.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/aes_asm.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-md2.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-ripemd.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-sha512.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-sniffer.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-hc128.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-misc.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-tfm.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-integer.lo:  \
+       ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/src/src_libcyassl_la-ecc.lo: ctaocrypt/src/$(am__dirstamp) \
+       ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-ocsp.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/src_libcyassl_la-crl.lo: src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/libcyassl.la: $(src_libcyassl_la_OBJECTS) $(src_libcyassl_la_DEPENDENCIES) src/$(am__dirstamp)
+       $(src_libcyassl_la_LINK) -rpath $(libdir) $(src_libcyassl_la_OBJECTS) $(src_libcyassl_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         if test -f $$p \
+            || test -f $$p1 \
+         ; then \
+           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+          echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+          $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+         else :; fi; \
+       done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+         echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+         rm -f "$(DESTDIR)$(bindir)/$$f"; \
+       done
+
+clean-binPROGRAMS:
+       @list='$(bin_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+
+clean-checkPROGRAMS:
+       @list='$(check_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+
+clean-noinstPROGRAMS:
+       @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+         f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+         echo " rm -f $$p $$f"; \
+         rm -f $$p $$f ; \
+       done
+ctaocrypt/benchmark/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/benchmark
+       @: > ctaocrypt/benchmark/$(am__dirstamp)
+ctaocrypt/benchmark/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/benchmark/$(DEPDIR)
+       @: > ctaocrypt/benchmark/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/benchmark/benchmark.$(OBJEXT):  \
+       ctaocrypt/benchmark/$(am__dirstamp) \
+       ctaocrypt/benchmark/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/benchmark/benchmark$(EXEEXT): $(ctaocrypt_benchmark_benchmark_OBJECTS) $(ctaocrypt_benchmark_benchmark_DEPENDENCIES) ctaocrypt/benchmark/$(am__dirstamp)
+       @rm -f ctaocrypt/benchmark/benchmark$(EXEEXT)
+       $(LINK) $(ctaocrypt_benchmark_benchmark_OBJECTS) $(ctaocrypt_benchmark_benchmark_LDADD) $(LIBS)
+ctaocrypt/test/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/test
+       @: > ctaocrypt/test/$(am__dirstamp)
+ctaocrypt/test/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) ctaocrypt/test/$(DEPDIR)
+       @: > ctaocrypt/test/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/test/test.$(OBJEXT): ctaocrypt/test/$(am__dirstamp) \
+       ctaocrypt/test/$(DEPDIR)/$(am__dirstamp)
+ctaocrypt/test/testctaocrypt$(EXEEXT): $(ctaocrypt_test_testctaocrypt_OBJECTS) $(ctaocrypt_test_testctaocrypt_DEPENDENCIES) ctaocrypt/test/$(am__dirstamp)
+       @rm -f ctaocrypt/test/testctaocrypt$(EXEEXT)
+       $(LINK) $(ctaocrypt_test_testctaocrypt_OBJECTS) $(ctaocrypt_test_testctaocrypt_LDADD) $(LIBS)
+examples/client/$(am__dirstamp):
+       @$(MKDIR_P) examples/client
+       @: > examples/client/$(am__dirstamp)
+examples/client/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) examples/client/$(DEPDIR)
+       @: > examples/client/$(DEPDIR)/$(am__dirstamp)
+examples/client/client.$(OBJEXT): examples/client/$(am__dirstamp) \
+       examples/client/$(DEPDIR)/$(am__dirstamp)
+examples/client/client$(EXEEXT): $(examples_client_client_OBJECTS) $(examples_client_client_DEPENDENCIES) examples/client/$(am__dirstamp)
+       @rm -f examples/client/client$(EXEEXT)
+       $(LINK) $(examples_client_client_OBJECTS) $(examples_client_client_LDADD) $(LIBS)
+examples/echoclient/$(am__dirstamp):
+       @$(MKDIR_P) examples/echoclient
+       @: > examples/echoclient/$(am__dirstamp)
+examples/echoclient/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) examples/echoclient/$(DEPDIR)
+       @: > examples/echoclient/$(DEPDIR)/$(am__dirstamp)
+examples/echoclient/echoclient.$(OBJEXT):  \
+       examples/echoclient/$(am__dirstamp) \
+       examples/echoclient/$(DEPDIR)/$(am__dirstamp)
+examples/echoclient/echoclient$(EXEEXT): $(examples_echoclient_echoclient_OBJECTS) $(examples_echoclient_echoclient_DEPENDENCIES) examples/echoclient/$(am__dirstamp)
+       @rm -f examples/echoclient/echoclient$(EXEEXT)
+       $(LINK) $(examples_echoclient_echoclient_OBJECTS) $(examples_echoclient_echoclient_LDADD) $(LIBS)
+examples/echoserver/$(am__dirstamp):
+       @$(MKDIR_P) examples/echoserver
+       @: > examples/echoserver/$(am__dirstamp)
+examples/echoserver/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) examples/echoserver/$(DEPDIR)
+       @: > examples/echoserver/$(DEPDIR)/$(am__dirstamp)
+examples/echoserver/echoserver.$(OBJEXT):  \
+       examples/echoserver/$(am__dirstamp) \
+       examples/echoserver/$(DEPDIR)/$(am__dirstamp)
+examples/echoserver/echoserver$(EXEEXT): $(examples_echoserver_echoserver_OBJECTS) $(examples_echoserver_echoserver_DEPENDENCIES) examples/echoserver/$(am__dirstamp)
+       @rm -f examples/echoserver/echoserver$(EXEEXT)
+       $(LINK) $(examples_echoserver_echoserver_OBJECTS) $(examples_echoserver_echoserver_LDADD) $(LIBS)
+examples/server/$(am__dirstamp):
+       @$(MKDIR_P) examples/server
+       @: > examples/server/$(am__dirstamp)
+examples/server/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) examples/server/$(DEPDIR)
+       @: > examples/server/$(DEPDIR)/$(am__dirstamp)
+examples/server/server.$(OBJEXT): examples/server/$(am__dirstamp) \
+       examples/server/$(DEPDIR)/$(am__dirstamp)
+examples/server/server$(EXEEXT): $(examples_server_server_OBJECTS) $(examples_server_server_DEPENDENCIES) examples/server/$(am__dirstamp)
+       @rm -f examples/server/server$(EXEEXT)
+       $(LINK) $(examples_server_server_OBJECTS) $(examples_server_server_LDADD) $(LIBS)
+sslSniffer/sslSnifferTest/$(am__dirstamp):
+       @$(MKDIR_P) sslSniffer/sslSnifferTest
+       @: > sslSniffer/sslSnifferTest/$(am__dirstamp)
+sslSniffer/sslSnifferTest/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) sslSniffer/sslSnifferTest/$(DEPDIR)
+       @: > sslSniffer/sslSnifferTest/$(DEPDIR)/$(am__dirstamp)
+sslSniffer/sslSnifferTest/snifftest.$(OBJEXT):  \
+       sslSniffer/sslSnifferTest/$(am__dirstamp) \
+       sslSniffer/sslSnifferTest/$(DEPDIR)/$(am__dirstamp)
+sslSniffer/sslSnifferTest/snifftest$(EXEEXT): $(sslSniffer_sslSnifferTest_snifftest_OBJECTS) $(sslSniffer_sslSnifferTest_snifftest_DEPENDENCIES) sslSniffer/sslSnifferTest/$(am__dirstamp)
+       @rm -f sslSniffer/sslSnifferTest/snifftest$(EXEEXT)
+       $(LINK) $(sslSniffer_sslSnifferTest_snifftest_OBJECTS) $(sslSniffer_sslSnifferTest_snifftest_LDADD) $(LIBS)
+tests/$(am__dirstamp):
+       @$(MKDIR_P) tests
+       @: > tests/$(am__dirstamp)
+tests/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) tests/$(DEPDIR)
+       @: > tests/$(DEPDIR)/$(am__dirstamp)
+tests/tests_unit-unit.$(OBJEXT): tests/$(am__dirstamp) \
+       tests/$(DEPDIR)/$(am__dirstamp)
+tests/tests_unit-api.$(OBJEXT): tests/$(am__dirstamp) \
+       tests/$(DEPDIR)/$(am__dirstamp)
+tests/tests_unit-suites.$(OBJEXT): tests/$(am__dirstamp) \
+       tests/$(DEPDIR)/$(am__dirstamp)
+tests/tests_unit-hash.$(OBJEXT): tests/$(am__dirstamp) \
+       tests/$(DEPDIR)/$(am__dirstamp)
+examples/client/tests_unit-client.$(OBJEXT):  \
+       examples/client/$(am__dirstamp) \
+       examples/client/$(DEPDIR)/$(am__dirstamp)
+examples/server/tests_unit-server.$(OBJEXT):  \
+       examples/server/$(am__dirstamp) \
+       examples/server/$(DEPDIR)/$(am__dirstamp)
+tests/unit$(EXEEXT): $(tests_unit_OBJECTS) $(tests_unit_DEPENDENCIES) tests/$(am__dirstamp)
+       @rm -f tests/unit$(EXEEXT)
+       $(tests_unit_LINK) $(tests_unit_OBJECTS) $(tests_unit_LDADD) $(LIBS)
+ctaocrypt/test/testsuite_testsuite-test.$(OBJEXT):  \
+       ctaocrypt/test/$(am__dirstamp) \
+       ctaocrypt/test/$(DEPDIR)/$(am__dirstamp)
+examples/client/testsuite_testsuite-client.$(OBJEXT):  \
+       examples/client/$(am__dirstamp) \
+       examples/client/$(DEPDIR)/$(am__dirstamp)
+examples/echoclient/testsuite_testsuite-echoclient.$(OBJEXT):  \
+       examples/echoclient/$(am__dirstamp) \
+       examples/echoclient/$(DEPDIR)/$(am__dirstamp)
+examples/echoserver/testsuite_testsuite-echoserver.$(OBJEXT):  \
+       examples/echoserver/$(am__dirstamp) \
+       examples/echoserver/$(DEPDIR)/$(am__dirstamp)
+examples/server/testsuite_testsuite-server.$(OBJEXT):  \
+       examples/server/$(am__dirstamp) \
+       examples/server/$(DEPDIR)/$(am__dirstamp)
+testsuite/$(am__dirstamp):
+       @$(MKDIR_P) testsuite
+       @: > testsuite/$(am__dirstamp)
+testsuite/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) testsuite/$(DEPDIR)
+       @: > testsuite/$(DEPDIR)/$(am__dirstamp)
+testsuite/testsuite_testsuite-testsuite.$(OBJEXT):  \
+       testsuite/$(am__dirstamp) testsuite/$(DEPDIR)/$(am__dirstamp)
+testsuite/testsuite$(EXEEXT): $(testsuite_testsuite_OBJECTS) $(testsuite_testsuite_DEPENDENCIES) testsuite/$(am__dirstamp)
+       @rm -f testsuite/testsuite$(EXEEXT)
+       $(testsuite_testsuite_LINK) $(testsuite_testsuite_OBJECTS) $(testsuite_testsuite_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+       -rm -f ctaocrypt/benchmark/benchmark.$(OBJEXT)
+       -rm -f ctaocrypt/src/aes_asm.$(OBJEXT)
+       -rm -f ctaocrypt/src/aes_asm.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-aes.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-aes.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-arc4.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-arc4.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-asn.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-asn.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-coding.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-coding.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-des3.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-des3.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-dh.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-dh.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-dsa.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-dsa.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-ecc.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-ecc.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-hc128.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-hc128.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-hmac.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-hmac.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-integer.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-integer.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-logging.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-logging.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-md2.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-md2.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-md4.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-md4.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-md5.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-md5.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-memory.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-memory.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-misc.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-misc.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-pwdbased.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-pwdbased.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-rabbit.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-rabbit.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-random.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-random.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-ripemd.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-ripemd.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-rsa.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-rsa.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha256.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha256.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha512.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-sha512.lo
+       -rm -f ctaocrypt/src/src_libcyassl_la-tfm.$(OBJEXT)
+       -rm -f ctaocrypt/src/src_libcyassl_la-tfm.lo
+       -rm -f ctaocrypt/test/test.$(OBJEXT)
+       -rm -f ctaocrypt/test/testsuite_testsuite-test.$(OBJEXT)
+       -rm -f examples/client/client.$(OBJEXT)
+       -rm -f examples/client/tests_unit-client.$(OBJEXT)
+       -rm -f examples/client/testsuite_testsuite-client.$(OBJEXT)
+       -rm -f examples/echoclient/echoclient.$(OBJEXT)
+       -rm -f examples/echoclient/testsuite_testsuite-echoclient.$(OBJEXT)
+       -rm -f examples/echoserver/echoserver.$(OBJEXT)
+       -rm -f examples/echoserver/testsuite_testsuite-echoserver.$(OBJEXT)
+       -rm -f examples/server/server.$(OBJEXT)
+       -rm -f examples/server/tests_unit-server.$(OBJEXT)
+       -rm -f examples/server/testsuite_testsuite-server.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-crl.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-crl.lo
+       -rm -f src/src_libcyassl_la-internal.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-internal.lo
+       -rm -f src/src_libcyassl_la-io.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-io.lo
+       -rm -f src/src_libcyassl_la-keys.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-keys.lo
+       -rm -f src/src_libcyassl_la-ocsp.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-ocsp.lo
+       -rm -f src/src_libcyassl_la-sniffer.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-sniffer.lo
+       -rm -f src/src_libcyassl_la-ssl.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-ssl.lo
+       -rm -f src/src_libcyassl_la-tls.$(OBJEXT)
+       -rm -f src/src_libcyassl_la-tls.lo
+       -rm -f sslSniffer/sslSnifferTest/snifftest.$(OBJEXT)
+       -rm -f tests/tests_unit-api.$(OBJEXT)
+       -rm -f tests/tests_unit-hash.$(OBJEXT)
+       -rm -f tests/tests_unit-suites.$(OBJEXT)
+       -rm -f tests/tests_unit-unit.$(OBJEXT)
+       -rm -f testsuite/testsuite_testsuite-testsuite.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/benchmark/$(DEPDIR)/benchmark.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-aes.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-arc4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-asn.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-coding.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-des3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dh.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dsa.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ecc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hc128.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hmac.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-integer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-logging.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-memory.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-misc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-pwdbased.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rabbit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-random.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ripemd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rsa.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha256.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha512.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-tfm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/test/$(DEPDIR)/test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/client/$(DEPDIR)/client.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/client/$(DEPDIR)/tests_unit-client.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/client/$(DEPDIR)/testsuite_testsuite-client.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/echoclient/$(DEPDIR)/echoclient.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/echoserver/$(DEPDIR)/echoserver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/server/$(DEPDIR)/server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/server/$(DEPDIR)/tests_unit-server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@examples/server/$(DEPDIR)/testsuite_testsuite-server.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-crl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-internal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-io.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-keys.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-ocsp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-sniffer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-ssl.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libcyassl_la-tls.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sslSniffer/sslSnifferTest/$(DEPDIR)/snifftest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_unit-api.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_unit-hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_unit-suites.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_unit-unit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   mv -f $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   mv -f $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   mv -f $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+src/src_libcyassl_la-internal.lo: src/internal.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-internal.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-internal.Tpo -c -o src/src_libcyassl_la-internal.lo `test -f 'src/internal.c' || echo '$(srcdir)/'`src/internal.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-internal.Tpo src/$(DEPDIR)/src_libcyassl_la-internal.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/internal.c' object='src/src_libcyassl_la-internal.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-internal.lo `test -f 'src/internal.c' || echo '$(srcdir)/'`src/internal.c
+
+src/src_libcyassl_la-io.lo: src/io.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-io.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-io.Tpo -c -o src/src_libcyassl_la-io.lo `test -f 'src/io.c' || echo '$(srcdir)/'`src/io.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-io.Tpo src/$(DEPDIR)/src_libcyassl_la-io.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/io.c' object='src/src_libcyassl_la-io.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-io.lo `test -f 'src/io.c' || echo '$(srcdir)/'`src/io.c
+
+src/src_libcyassl_la-keys.lo: src/keys.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-keys.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-keys.Tpo -c -o src/src_libcyassl_la-keys.lo `test -f 'src/keys.c' || echo '$(srcdir)/'`src/keys.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-keys.Tpo src/$(DEPDIR)/src_libcyassl_la-keys.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/keys.c' object='src/src_libcyassl_la-keys.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-keys.lo `test -f 'src/keys.c' || echo '$(srcdir)/'`src/keys.c
+
+src/src_libcyassl_la-ssl.lo: src/ssl.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-ssl.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-ssl.Tpo -c -o src/src_libcyassl_la-ssl.lo `test -f 'src/ssl.c' || echo '$(srcdir)/'`src/ssl.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-ssl.Tpo src/$(DEPDIR)/src_libcyassl_la-ssl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/ssl.c' object='src/src_libcyassl_la-ssl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-ssl.lo `test -f 'src/ssl.c' || echo '$(srcdir)/'`src/ssl.c
+
+src/src_libcyassl_la-tls.lo: src/tls.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-tls.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-tls.Tpo -c -o src/src_libcyassl_la-tls.lo `test -f 'src/tls.c' || echo '$(srcdir)/'`src/tls.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-tls.Tpo src/$(DEPDIR)/src_libcyassl_la-tls.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/tls.c' object='src/src_libcyassl_la-tls.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-tls.lo `test -f 'src/tls.c' || echo '$(srcdir)/'`src/tls.c
+
+ctaocrypt/src/src_libcyassl_la-asn.lo: ctaocrypt/src/asn.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-asn.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-asn.Tpo -c -o ctaocrypt/src/src_libcyassl_la-asn.lo `test -f 'ctaocrypt/src/asn.c' || echo '$(srcdir)/'`ctaocrypt/src/asn.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-asn.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-asn.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/asn.c' object='ctaocrypt/src/src_libcyassl_la-asn.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-asn.lo `test -f 'ctaocrypt/src/asn.c' || echo '$(srcdir)/'`ctaocrypt/src/asn.c
+
+ctaocrypt/src/src_libcyassl_la-coding.lo: ctaocrypt/src/coding.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-coding.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-coding.Tpo -c -o ctaocrypt/src/src_libcyassl_la-coding.lo `test -f 'ctaocrypt/src/coding.c' || echo '$(srcdir)/'`ctaocrypt/src/coding.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-coding.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-coding.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/coding.c' object='ctaocrypt/src/src_libcyassl_la-coding.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-coding.lo `test -f 'ctaocrypt/src/coding.c' || echo '$(srcdir)/'`ctaocrypt/src/coding.c
+
+ctaocrypt/src/src_libcyassl_la-des3.lo: ctaocrypt/src/des3.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-des3.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-des3.Tpo -c -o ctaocrypt/src/src_libcyassl_la-des3.lo `test -f 'ctaocrypt/src/des3.c' || echo '$(srcdir)/'`ctaocrypt/src/des3.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-des3.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-des3.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/des3.c' object='ctaocrypt/src/src_libcyassl_la-des3.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-des3.lo `test -f 'ctaocrypt/src/des3.c' || echo '$(srcdir)/'`ctaocrypt/src/des3.c
+
+ctaocrypt/src/src_libcyassl_la-hmac.lo: ctaocrypt/src/hmac.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-hmac.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hmac.Tpo -c -o ctaocrypt/src/src_libcyassl_la-hmac.lo `test -f 'ctaocrypt/src/hmac.c' || echo '$(srcdir)/'`ctaocrypt/src/hmac.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hmac.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hmac.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/hmac.c' object='ctaocrypt/src/src_libcyassl_la-hmac.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-hmac.lo `test -f 'ctaocrypt/src/hmac.c' || echo '$(srcdir)/'`ctaocrypt/src/hmac.c
+
+ctaocrypt/src/src_libcyassl_la-md5.lo: ctaocrypt/src/md5.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-md5.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md5.Tpo -c -o ctaocrypt/src/src_libcyassl_la-md5.lo `test -f 'ctaocrypt/src/md5.c' || echo '$(srcdir)/'`ctaocrypt/src/md5.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md5.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md5.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/md5.c' object='ctaocrypt/src/src_libcyassl_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-md5.lo `test -f 'ctaocrypt/src/md5.c' || echo '$(srcdir)/'`ctaocrypt/src/md5.c
+
+ctaocrypt/src/src_libcyassl_la-md4.lo: ctaocrypt/src/md4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-md4.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md4.Tpo -c -o ctaocrypt/src/src_libcyassl_la-md4.lo `test -f 'ctaocrypt/src/md4.c' || echo '$(srcdir)/'`ctaocrypt/src/md4.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md4.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/md4.c' object='ctaocrypt/src/src_libcyassl_la-md4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-md4.lo `test -f 'ctaocrypt/src/md4.c' || echo '$(srcdir)/'`ctaocrypt/src/md4.c
+
+ctaocrypt/src/src_libcyassl_la-random.lo: ctaocrypt/src/random.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-random.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-random.Tpo -c -o ctaocrypt/src/src_libcyassl_la-random.lo `test -f 'ctaocrypt/src/random.c' || echo '$(srcdir)/'`ctaocrypt/src/random.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-random.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-random.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/random.c' object='ctaocrypt/src/src_libcyassl_la-random.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-random.lo `test -f 'ctaocrypt/src/random.c' || echo '$(srcdir)/'`ctaocrypt/src/random.c
+
+ctaocrypt/src/src_libcyassl_la-rsa.lo: ctaocrypt/src/rsa.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-rsa.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rsa.Tpo -c -o ctaocrypt/src/src_libcyassl_la-rsa.lo `test -f 'ctaocrypt/src/rsa.c' || echo '$(srcdir)/'`ctaocrypt/src/rsa.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rsa.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rsa.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/rsa.c' object='ctaocrypt/src/src_libcyassl_la-rsa.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-rsa.lo `test -f 'ctaocrypt/src/rsa.c' || echo '$(srcdir)/'`ctaocrypt/src/rsa.c
+
+ctaocrypt/src/src_libcyassl_la-sha.lo: ctaocrypt/src/sha.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-sha.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha.Tpo -c -o ctaocrypt/src/src_libcyassl_la-sha.lo `test -f 'ctaocrypt/src/sha.c' || echo '$(srcdir)/'`ctaocrypt/src/sha.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/sha.c' object='ctaocrypt/src/src_libcyassl_la-sha.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-sha.lo `test -f 'ctaocrypt/src/sha.c' || echo '$(srcdir)/'`ctaocrypt/src/sha.c
+
+ctaocrypt/src/src_libcyassl_la-aes.lo: ctaocrypt/src/aes.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-aes.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-aes.Tpo -c -o ctaocrypt/src/src_libcyassl_la-aes.lo `test -f 'ctaocrypt/src/aes.c' || echo '$(srcdir)/'`ctaocrypt/src/aes.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-aes.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-aes.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/aes.c' object='ctaocrypt/src/src_libcyassl_la-aes.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-aes.lo `test -f 'ctaocrypt/src/aes.c' || echo '$(srcdir)/'`ctaocrypt/src/aes.c
+
+ctaocrypt/src/src_libcyassl_la-sha256.lo: ctaocrypt/src/sha256.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-sha256.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha256.Tpo -c -o ctaocrypt/src/src_libcyassl_la-sha256.lo `test -f 'ctaocrypt/src/sha256.c' || echo '$(srcdir)/'`ctaocrypt/src/sha256.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha256.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha256.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/sha256.c' object='ctaocrypt/src/src_libcyassl_la-sha256.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-sha256.lo `test -f 'ctaocrypt/src/sha256.c' || echo '$(srcdir)/'`ctaocrypt/src/sha256.c
+
+ctaocrypt/src/src_libcyassl_la-dh.lo: ctaocrypt/src/dh.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-dh.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dh.Tpo -c -o ctaocrypt/src/src_libcyassl_la-dh.lo `test -f 'ctaocrypt/src/dh.c' || echo '$(srcdir)/'`ctaocrypt/src/dh.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dh.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dh.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/dh.c' object='ctaocrypt/src/src_libcyassl_la-dh.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-dh.lo `test -f 'ctaocrypt/src/dh.c' || echo '$(srcdir)/'`ctaocrypt/src/dh.c
+
+ctaocrypt/src/src_libcyassl_la-dsa.lo: ctaocrypt/src/dsa.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-dsa.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dsa.Tpo -c -o ctaocrypt/src/src_libcyassl_la-dsa.lo `test -f 'ctaocrypt/src/dsa.c' || echo '$(srcdir)/'`ctaocrypt/src/dsa.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dsa.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-dsa.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/dsa.c' object='ctaocrypt/src/src_libcyassl_la-dsa.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-dsa.lo `test -f 'ctaocrypt/src/dsa.c' || echo '$(srcdir)/'`ctaocrypt/src/dsa.c
+
+ctaocrypt/src/src_libcyassl_la-arc4.lo: ctaocrypt/src/arc4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-arc4.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-arc4.Tpo -c -o ctaocrypt/src/src_libcyassl_la-arc4.lo `test -f 'ctaocrypt/src/arc4.c' || echo '$(srcdir)/'`ctaocrypt/src/arc4.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-arc4.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-arc4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/arc4.c' object='ctaocrypt/src/src_libcyassl_la-arc4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-arc4.lo `test -f 'ctaocrypt/src/arc4.c' || echo '$(srcdir)/'`ctaocrypt/src/arc4.c
+
+ctaocrypt/src/src_libcyassl_la-rabbit.lo: ctaocrypt/src/rabbit.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-rabbit.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rabbit.Tpo -c -o ctaocrypt/src/src_libcyassl_la-rabbit.lo `test -f 'ctaocrypt/src/rabbit.c' || echo '$(srcdir)/'`ctaocrypt/src/rabbit.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rabbit.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-rabbit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/rabbit.c' object='ctaocrypt/src/src_libcyassl_la-rabbit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-rabbit.lo `test -f 'ctaocrypt/src/rabbit.c' || echo '$(srcdir)/'`ctaocrypt/src/rabbit.c
+
+ctaocrypt/src/src_libcyassl_la-pwdbased.lo: ctaocrypt/src/pwdbased.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-pwdbased.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-pwdbased.Tpo -c -o ctaocrypt/src/src_libcyassl_la-pwdbased.lo `test -f 'ctaocrypt/src/pwdbased.c' || echo '$(srcdir)/'`ctaocrypt/src/pwdbased.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-pwdbased.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-pwdbased.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/pwdbased.c' object='ctaocrypt/src/src_libcyassl_la-pwdbased.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-pwdbased.lo `test -f 'ctaocrypt/src/pwdbased.c' || echo '$(srcdir)/'`ctaocrypt/src/pwdbased.c
+
+ctaocrypt/src/src_libcyassl_la-logging.lo: ctaocrypt/src/logging.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-logging.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-logging.Tpo -c -o ctaocrypt/src/src_libcyassl_la-logging.lo `test -f 'ctaocrypt/src/logging.c' || echo '$(srcdir)/'`ctaocrypt/src/logging.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-logging.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-logging.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/logging.c' object='ctaocrypt/src/src_libcyassl_la-logging.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-logging.lo `test -f 'ctaocrypt/src/logging.c' || echo '$(srcdir)/'`ctaocrypt/src/logging.c
+
+ctaocrypt/src/src_libcyassl_la-memory.lo: ctaocrypt/src/memory.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-memory.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-memory.Tpo -c -o ctaocrypt/src/src_libcyassl_la-memory.lo `test -f 'ctaocrypt/src/memory.c' || echo '$(srcdir)/'`ctaocrypt/src/memory.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-memory.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-memory.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/memory.c' object='ctaocrypt/src/src_libcyassl_la-memory.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-memory.lo `test -f 'ctaocrypt/src/memory.c' || echo '$(srcdir)/'`ctaocrypt/src/memory.c
+
+ctaocrypt/src/src_libcyassl_la-md2.lo: ctaocrypt/src/md2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-md2.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md2.Tpo -c -o ctaocrypt/src/src_libcyassl_la-md2.lo `test -f 'ctaocrypt/src/md2.c' || echo '$(srcdir)/'`ctaocrypt/src/md2.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md2.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-md2.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/md2.c' object='ctaocrypt/src/src_libcyassl_la-md2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-md2.lo `test -f 'ctaocrypt/src/md2.c' || echo '$(srcdir)/'`ctaocrypt/src/md2.c
+
+ctaocrypt/src/src_libcyassl_la-ripemd.lo: ctaocrypt/src/ripemd.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-ripemd.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ripemd.Tpo -c -o ctaocrypt/src/src_libcyassl_la-ripemd.lo `test -f 'ctaocrypt/src/ripemd.c' || echo '$(srcdir)/'`ctaocrypt/src/ripemd.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ripemd.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ripemd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/ripemd.c' object='ctaocrypt/src/src_libcyassl_la-ripemd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-ripemd.lo `test -f 'ctaocrypt/src/ripemd.c' || echo '$(srcdir)/'`ctaocrypt/src/ripemd.c
+
+ctaocrypt/src/src_libcyassl_la-sha512.lo: ctaocrypt/src/sha512.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-sha512.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha512.Tpo -c -o ctaocrypt/src/src_libcyassl_la-sha512.lo `test -f 'ctaocrypt/src/sha512.c' || echo '$(srcdir)/'`ctaocrypt/src/sha512.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha512.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-sha512.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/sha512.c' object='ctaocrypt/src/src_libcyassl_la-sha512.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-sha512.lo `test -f 'ctaocrypt/src/sha512.c' || echo '$(srcdir)/'`ctaocrypt/src/sha512.c
+
+src/src_libcyassl_la-sniffer.lo: src/sniffer.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-sniffer.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-sniffer.Tpo -c -o src/src_libcyassl_la-sniffer.lo `test -f 'src/sniffer.c' || echo '$(srcdir)/'`src/sniffer.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-sniffer.Tpo src/$(DEPDIR)/src_libcyassl_la-sniffer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/sniffer.c' object='src/src_libcyassl_la-sniffer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-sniffer.lo `test -f 'src/sniffer.c' || echo '$(srcdir)/'`src/sniffer.c
+
+ctaocrypt/src/src_libcyassl_la-hc128.lo: ctaocrypt/src/hc128.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-hc128.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hc128.Tpo -c -o ctaocrypt/src/src_libcyassl_la-hc128.lo `test -f 'ctaocrypt/src/hc128.c' || echo '$(srcdir)/'`ctaocrypt/src/hc128.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hc128.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-hc128.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/hc128.c' object='ctaocrypt/src/src_libcyassl_la-hc128.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-hc128.lo `test -f 'ctaocrypt/src/hc128.c' || echo '$(srcdir)/'`ctaocrypt/src/hc128.c
+
+ctaocrypt/src/src_libcyassl_la-misc.lo: ctaocrypt/src/misc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-misc.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-misc.Tpo -c -o ctaocrypt/src/src_libcyassl_la-misc.lo `test -f 'ctaocrypt/src/misc.c' || echo '$(srcdir)/'`ctaocrypt/src/misc.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-misc.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-misc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/misc.c' object='ctaocrypt/src/src_libcyassl_la-misc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-misc.lo `test -f 'ctaocrypt/src/misc.c' || echo '$(srcdir)/'`ctaocrypt/src/misc.c
+
+ctaocrypt/src/src_libcyassl_la-tfm.lo: ctaocrypt/src/tfm.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-tfm.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-tfm.Tpo -c -o ctaocrypt/src/src_libcyassl_la-tfm.lo `test -f 'ctaocrypt/src/tfm.c' || echo '$(srcdir)/'`ctaocrypt/src/tfm.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-tfm.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-tfm.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/tfm.c' object='ctaocrypt/src/src_libcyassl_la-tfm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-tfm.lo `test -f 'ctaocrypt/src/tfm.c' || echo '$(srcdir)/'`ctaocrypt/src/tfm.c
+
+ctaocrypt/src/src_libcyassl_la-integer.lo: ctaocrypt/src/integer.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-integer.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-integer.Tpo -c -o ctaocrypt/src/src_libcyassl_la-integer.lo `test -f 'ctaocrypt/src/integer.c' || echo '$(srcdir)/'`ctaocrypt/src/integer.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-integer.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-integer.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/integer.c' object='ctaocrypt/src/src_libcyassl_la-integer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-integer.lo `test -f 'ctaocrypt/src/integer.c' || echo '$(srcdir)/'`ctaocrypt/src/integer.c
+
+ctaocrypt/src/src_libcyassl_la-ecc.lo: ctaocrypt/src/ecc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT ctaocrypt/src/src_libcyassl_la-ecc.lo -MD -MP -MF ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ecc.Tpo -c -o ctaocrypt/src/src_libcyassl_la-ecc.lo `test -f 'ctaocrypt/src/ecc.c' || echo '$(srcdir)/'`ctaocrypt/src/ecc.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ecc.Tpo ctaocrypt/src/$(DEPDIR)/src_libcyassl_la-ecc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/src/ecc.c' object='ctaocrypt/src/src_libcyassl_la-ecc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o ctaocrypt/src/src_libcyassl_la-ecc.lo `test -f 'ctaocrypt/src/ecc.c' || echo '$(srcdir)/'`ctaocrypt/src/ecc.c
+
+src/src_libcyassl_la-ocsp.lo: src/ocsp.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-ocsp.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-ocsp.Tpo -c -o src/src_libcyassl_la-ocsp.lo `test -f 'src/ocsp.c' || echo '$(srcdir)/'`src/ocsp.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-ocsp.Tpo src/$(DEPDIR)/src_libcyassl_la-ocsp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/ocsp.c' object='src/src_libcyassl_la-ocsp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-ocsp.lo `test -f 'src/ocsp.c' || echo '$(srcdir)/'`src/ocsp.c
+
+src/src_libcyassl_la-crl.lo: src/crl.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -MT src/src_libcyassl_la-crl.lo -MD -MP -MF src/$(DEPDIR)/src_libcyassl_la-crl.Tpo -c -o src/src_libcyassl_la-crl.lo `test -f 'src/crl.c' || echo '$(srcdir)/'`src/crl.c
+@am__fastdepCC_TRUE@   mv -f src/$(DEPDIR)/src_libcyassl_la-crl.Tpo src/$(DEPDIR)/src_libcyassl_la-crl.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/crl.c' object='src/src_libcyassl_la-crl.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libcyassl_la_CPPFLAGS) $(CPPFLAGS) $(src_libcyassl_la_CFLAGS) $(CFLAGS) -c -o src/src_libcyassl_la-crl.lo `test -f 'src/crl.c' || echo '$(srcdir)/'`src/crl.c
+
+tests/tests_unit-unit.o: tests/unit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-unit.o -MD -MP -MF tests/$(DEPDIR)/tests_unit-unit.Tpo -c -o tests/tests_unit-unit.o `test -f 'tests/unit.c' || echo '$(srcdir)/'`tests/unit.c
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-unit.Tpo tests/$(DEPDIR)/tests_unit-unit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/unit.c' object='tests/tests_unit-unit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-unit.o `test -f 'tests/unit.c' || echo '$(srcdir)/'`tests/unit.c
+
+tests/tests_unit-unit.obj: tests/unit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-unit.obj -MD -MP -MF tests/$(DEPDIR)/tests_unit-unit.Tpo -c -o tests/tests_unit-unit.obj `if test -f 'tests/unit.c'; then $(CYGPATH_W) 'tests/unit.c'; else $(CYGPATH_W) '$(srcdir)/tests/unit.c'; fi`
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-unit.Tpo tests/$(DEPDIR)/tests_unit-unit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/unit.c' object='tests/tests_unit-unit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-unit.obj `if test -f 'tests/unit.c'; then $(CYGPATH_W) 'tests/unit.c'; else $(CYGPATH_W) '$(srcdir)/tests/unit.c'; fi`
+
+tests/tests_unit-api.o: tests/api.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-api.o -MD -MP -MF tests/$(DEPDIR)/tests_unit-api.Tpo -c -o tests/tests_unit-api.o `test -f 'tests/api.c' || echo '$(srcdir)/'`tests/api.c
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-api.Tpo tests/$(DEPDIR)/tests_unit-api.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/api.c' object='tests/tests_unit-api.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-api.o `test -f 'tests/api.c' || echo '$(srcdir)/'`tests/api.c
+
+tests/tests_unit-api.obj: tests/api.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-api.obj -MD -MP -MF tests/$(DEPDIR)/tests_unit-api.Tpo -c -o tests/tests_unit-api.obj `if test -f 'tests/api.c'; then $(CYGPATH_W) 'tests/api.c'; else $(CYGPATH_W) '$(srcdir)/tests/api.c'; fi`
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-api.Tpo tests/$(DEPDIR)/tests_unit-api.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/api.c' object='tests/tests_unit-api.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-api.obj `if test -f 'tests/api.c'; then $(CYGPATH_W) 'tests/api.c'; else $(CYGPATH_W) '$(srcdir)/tests/api.c'; fi`
+
+tests/tests_unit-suites.o: tests/suites.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-suites.o -MD -MP -MF tests/$(DEPDIR)/tests_unit-suites.Tpo -c -o tests/tests_unit-suites.o `test -f 'tests/suites.c' || echo '$(srcdir)/'`tests/suites.c
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-suites.Tpo tests/$(DEPDIR)/tests_unit-suites.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/suites.c' object='tests/tests_unit-suites.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-suites.o `test -f 'tests/suites.c' || echo '$(srcdir)/'`tests/suites.c
+
+tests/tests_unit-suites.obj: tests/suites.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-suites.obj -MD -MP -MF tests/$(DEPDIR)/tests_unit-suites.Tpo -c -o tests/tests_unit-suites.obj `if test -f 'tests/suites.c'; then $(CYGPATH_W) 'tests/suites.c'; else $(CYGPATH_W) '$(srcdir)/tests/suites.c'; fi`
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-suites.Tpo tests/$(DEPDIR)/tests_unit-suites.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/suites.c' object='tests/tests_unit-suites.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-suites.obj `if test -f 'tests/suites.c'; then $(CYGPATH_W) 'tests/suites.c'; else $(CYGPATH_W) '$(srcdir)/tests/suites.c'; fi`
+
+tests/tests_unit-hash.o: tests/hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-hash.o -MD -MP -MF tests/$(DEPDIR)/tests_unit-hash.Tpo -c -o tests/tests_unit-hash.o `test -f 'tests/hash.c' || echo '$(srcdir)/'`tests/hash.c
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-hash.Tpo tests/$(DEPDIR)/tests_unit-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/hash.c' object='tests/tests_unit-hash.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-hash.o `test -f 'tests/hash.c' || echo '$(srcdir)/'`tests/hash.c
+
+tests/tests_unit-hash.obj: tests/hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT tests/tests_unit-hash.obj -MD -MP -MF tests/$(DEPDIR)/tests_unit-hash.Tpo -c -o tests/tests_unit-hash.obj `if test -f 'tests/hash.c'; then $(CYGPATH_W) 'tests/hash.c'; else $(CYGPATH_W) '$(srcdir)/tests/hash.c'; fi`
+@am__fastdepCC_TRUE@   mv -f tests/$(DEPDIR)/tests_unit-hash.Tpo tests/$(DEPDIR)/tests_unit-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tests/hash.c' object='tests/tests_unit-hash.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o tests/tests_unit-hash.obj `if test -f 'tests/hash.c'; then $(CYGPATH_W) 'tests/hash.c'; else $(CYGPATH_W) '$(srcdir)/tests/hash.c'; fi`
+
+examples/client/tests_unit-client.o: examples/client/client.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT examples/client/tests_unit-client.o -MD -MP -MF examples/client/$(DEPDIR)/tests_unit-client.Tpo -c -o examples/client/tests_unit-client.o `test -f 'examples/client/client.c' || echo '$(srcdir)/'`examples/client/client.c
+@am__fastdepCC_TRUE@   mv -f examples/client/$(DEPDIR)/tests_unit-client.Tpo examples/client/$(DEPDIR)/tests_unit-client.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/client/client.c' object='examples/client/tests_unit-client.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o examples/client/tests_unit-client.o `test -f 'examples/client/client.c' || echo '$(srcdir)/'`examples/client/client.c
+
+examples/client/tests_unit-client.obj: examples/client/client.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT examples/client/tests_unit-client.obj -MD -MP -MF examples/client/$(DEPDIR)/tests_unit-client.Tpo -c -o examples/client/tests_unit-client.obj `if test -f 'examples/client/client.c'; then $(CYGPATH_W) 'examples/client/client.c'; else $(CYGPATH_W) '$(srcdir)/examples/client/client.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/client/$(DEPDIR)/tests_unit-client.Tpo examples/client/$(DEPDIR)/tests_unit-client.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/client/client.c' object='examples/client/tests_unit-client.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o examples/client/tests_unit-client.obj `if test -f 'examples/client/client.c'; then $(CYGPATH_W) 'examples/client/client.c'; else $(CYGPATH_W) '$(srcdir)/examples/client/client.c'; fi`
+
+examples/server/tests_unit-server.o: examples/server/server.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT examples/server/tests_unit-server.o -MD -MP -MF examples/server/$(DEPDIR)/tests_unit-server.Tpo -c -o examples/server/tests_unit-server.o `test -f 'examples/server/server.c' || echo '$(srcdir)/'`examples/server/server.c
+@am__fastdepCC_TRUE@   mv -f examples/server/$(DEPDIR)/tests_unit-server.Tpo examples/server/$(DEPDIR)/tests_unit-server.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/server/server.c' object='examples/server/tests_unit-server.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o examples/server/tests_unit-server.o `test -f 'examples/server/server.c' || echo '$(srcdir)/'`examples/server/server.c
+
+examples/server/tests_unit-server.obj: examples/server/server.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -MT examples/server/tests_unit-server.obj -MD -MP -MF examples/server/$(DEPDIR)/tests_unit-server.Tpo -c -o examples/server/tests_unit-server.obj `if test -f 'examples/server/server.c'; then $(CYGPATH_W) 'examples/server/server.c'; else $(CYGPATH_W) '$(srcdir)/examples/server/server.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/server/$(DEPDIR)/tests_unit-server.Tpo examples/server/$(DEPDIR)/tests_unit-server.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/server/server.c' object='examples/server/tests_unit-server.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_unit_CFLAGS) $(CFLAGS) -c -o examples/server/tests_unit-server.obj `if test -f 'examples/server/server.c'; then $(CYGPATH_W) 'examples/server/server.c'; else $(CYGPATH_W) '$(srcdir)/examples/server/server.c'; fi`
+
+ctaocrypt/test/testsuite_testsuite-test.o: ctaocrypt/test/test.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT ctaocrypt/test/testsuite_testsuite-test.o -MD -MP -MF ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Tpo -c -o ctaocrypt/test/testsuite_testsuite-test.o `test -f 'ctaocrypt/test/test.c' || echo '$(srcdir)/'`ctaocrypt/test/test.c
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Tpo ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/test/test.c' object='ctaocrypt/test/testsuite_testsuite-test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o ctaocrypt/test/testsuite_testsuite-test.o `test -f 'ctaocrypt/test/test.c' || echo '$(srcdir)/'`ctaocrypt/test/test.c
+
+ctaocrypt/test/testsuite_testsuite-test.obj: ctaocrypt/test/test.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT ctaocrypt/test/testsuite_testsuite-test.obj -MD -MP -MF ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Tpo -c -o ctaocrypt/test/testsuite_testsuite-test.obj `if test -f 'ctaocrypt/test/test.c'; then $(CYGPATH_W) 'ctaocrypt/test/test.c'; else $(CYGPATH_W) '$(srcdir)/ctaocrypt/test/test.c'; fi`
+@am__fastdepCC_TRUE@   mv -f ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Tpo ctaocrypt/test/$(DEPDIR)/testsuite_testsuite-test.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ctaocrypt/test/test.c' object='ctaocrypt/test/testsuite_testsuite-test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o ctaocrypt/test/testsuite_testsuite-test.obj `if test -f 'ctaocrypt/test/test.c'; then $(CYGPATH_W) 'ctaocrypt/test/test.c'; else $(CYGPATH_W) '$(srcdir)/ctaocrypt/test/test.c'; fi`
+
+examples/client/testsuite_testsuite-client.o: examples/client/client.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/client/testsuite_testsuite-client.o -MD -MP -MF examples/client/$(DEPDIR)/testsuite_testsuite-client.Tpo -c -o examples/client/testsuite_testsuite-client.o `test -f 'examples/client/client.c' || echo '$(srcdir)/'`examples/client/client.c
+@am__fastdepCC_TRUE@   mv -f examples/client/$(DEPDIR)/testsuite_testsuite-client.Tpo examples/client/$(DEPDIR)/testsuite_testsuite-client.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/client/client.c' object='examples/client/testsuite_testsuite-client.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/client/testsuite_testsuite-client.o `test -f 'examples/client/client.c' || echo '$(srcdir)/'`examples/client/client.c
+
+examples/client/testsuite_testsuite-client.obj: examples/client/client.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/client/testsuite_testsuite-client.obj -MD -MP -MF examples/client/$(DEPDIR)/testsuite_testsuite-client.Tpo -c -o examples/client/testsuite_testsuite-client.obj `if test -f 'examples/client/client.c'; then $(CYGPATH_W) 'examples/client/client.c'; else $(CYGPATH_W) '$(srcdir)/examples/client/client.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/client/$(DEPDIR)/testsuite_testsuite-client.Tpo examples/client/$(DEPDIR)/testsuite_testsuite-client.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/client/client.c' object='examples/client/testsuite_testsuite-client.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/client/testsuite_testsuite-client.obj `if test -f 'examples/client/client.c'; then $(CYGPATH_W) 'examples/client/client.c'; else $(CYGPATH_W) '$(srcdir)/examples/client/client.c'; fi`
+
+examples/echoclient/testsuite_testsuite-echoclient.o: examples/echoclient/echoclient.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/echoclient/testsuite_testsuite-echoclient.o -MD -MP -MF examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Tpo -c -o examples/echoclient/testsuite_testsuite-echoclient.o `test -f 'examples/echoclient/echoclient.c' || echo '$(srcdir)/'`examples/echoclient/echoclient.c
+@am__fastdepCC_TRUE@   mv -f examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Tpo examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/echoclient/echoclient.c' object='examples/echoclient/testsuite_testsuite-echoclient.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/echoclient/testsuite_testsuite-echoclient.o `test -f 'examples/echoclient/echoclient.c' || echo '$(srcdir)/'`examples/echoclient/echoclient.c
+
+examples/echoclient/testsuite_testsuite-echoclient.obj: examples/echoclient/echoclient.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/echoclient/testsuite_testsuite-echoclient.obj -MD -MP -MF examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Tpo -c -o examples/echoclient/testsuite_testsuite-echoclient.obj `if test -f 'examples/echoclient/echoclient.c'; then $(CYGPATH_W) 'examples/echoclient/echoclient.c'; else $(CYGPATH_W) '$(srcdir)/examples/echoclient/echoclient.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Tpo examples/echoclient/$(DEPDIR)/testsuite_testsuite-echoclient.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/echoclient/echoclient.c' object='examples/echoclient/testsuite_testsuite-echoclient.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/echoclient/testsuite_testsuite-echoclient.obj `if test -f 'examples/echoclient/echoclient.c'; then $(CYGPATH_W) 'examples/echoclient/echoclient.c'; else $(CYGPATH_W) '$(srcdir)/examples/echoclient/echoclient.c'; fi`
+
+examples/echoserver/testsuite_testsuite-echoserver.o: examples/echoserver/echoserver.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/echoserver/testsuite_testsuite-echoserver.o -MD -MP -MF examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Tpo -c -o examples/echoserver/testsuite_testsuite-echoserver.o `test -f 'examples/echoserver/echoserver.c' || echo '$(srcdir)/'`examples/echoserver/echoserver.c
+@am__fastdepCC_TRUE@   mv -f examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Tpo examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/echoserver/echoserver.c' object='examples/echoserver/testsuite_testsuite-echoserver.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/echoserver/testsuite_testsuite-echoserver.o `test -f 'examples/echoserver/echoserver.c' || echo '$(srcdir)/'`examples/echoserver/echoserver.c
+
+examples/echoserver/testsuite_testsuite-echoserver.obj: examples/echoserver/echoserver.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/echoserver/testsuite_testsuite-echoserver.obj -MD -MP -MF examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Tpo -c -o examples/echoserver/testsuite_testsuite-echoserver.obj `if test -f 'examples/echoserver/echoserver.c'; then $(CYGPATH_W) 'examples/echoserver/echoserver.c'; else $(CYGPATH_W) '$(srcdir)/examples/echoserver/echoserver.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Tpo examples/echoserver/$(DEPDIR)/testsuite_testsuite-echoserver.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/echoserver/echoserver.c' object='examples/echoserver/testsuite_testsuite-echoserver.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/echoserver/testsuite_testsuite-echoserver.obj `if test -f 'examples/echoserver/echoserver.c'; then $(CYGPATH_W) 'examples/echoserver/echoserver.c'; else $(CYGPATH_W) '$(srcdir)/examples/echoserver/echoserver.c'; fi`
+
+examples/server/testsuite_testsuite-server.o: examples/server/server.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/server/testsuite_testsuite-server.o -MD -MP -MF examples/server/$(DEPDIR)/testsuite_testsuite-server.Tpo -c -o examples/server/testsuite_testsuite-server.o `test -f 'examples/server/server.c' || echo '$(srcdir)/'`examples/server/server.c
+@am__fastdepCC_TRUE@   mv -f examples/server/$(DEPDIR)/testsuite_testsuite-server.Tpo examples/server/$(DEPDIR)/testsuite_testsuite-server.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/server/server.c' object='examples/server/testsuite_testsuite-server.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/server/testsuite_testsuite-server.o `test -f 'examples/server/server.c' || echo '$(srcdir)/'`examples/server/server.c
+
+examples/server/testsuite_testsuite-server.obj: examples/server/server.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT examples/server/testsuite_testsuite-server.obj -MD -MP -MF examples/server/$(DEPDIR)/testsuite_testsuite-server.Tpo -c -o examples/server/testsuite_testsuite-server.obj `if test -f 'examples/server/server.c'; then $(CYGPATH_W) 'examples/server/server.c'; else $(CYGPATH_W) '$(srcdir)/examples/server/server.c'; fi`
+@am__fastdepCC_TRUE@   mv -f examples/server/$(DEPDIR)/testsuite_testsuite-server.Tpo examples/server/$(DEPDIR)/testsuite_testsuite-server.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='examples/server/server.c' object='examples/server/testsuite_testsuite-server.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o examples/server/testsuite_testsuite-server.obj `if test -f 'examples/server/server.c'; then $(CYGPATH_W) 'examples/server/server.c'; else $(CYGPATH_W) '$(srcdir)/examples/server/server.c'; fi`
+
+testsuite/testsuite_testsuite-testsuite.o: testsuite/testsuite.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT testsuite/testsuite_testsuite-testsuite.o -MD -MP -MF testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Tpo -c -o testsuite/testsuite_testsuite-testsuite.o `test -f 'testsuite/testsuite.c' || echo '$(srcdir)/'`testsuite/testsuite.c
+@am__fastdepCC_TRUE@   mv -f testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Tpo testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='testsuite/testsuite.c' object='testsuite/testsuite_testsuite-testsuite.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o testsuite/testsuite_testsuite-testsuite.o `test -f 'testsuite/testsuite.c' || echo '$(srcdir)/'`testsuite/testsuite.c
+
+testsuite/testsuite_testsuite-testsuite.obj: testsuite/testsuite.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -MT testsuite/testsuite_testsuite-testsuite.obj -MD -MP -MF testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Tpo -c -o testsuite/testsuite_testsuite-testsuite.obj `if test -f 'testsuite/testsuite.c'; then $(CYGPATH_W) 'testsuite/testsuite.c'; else $(CYGPATH_W) '$(srcdir)/testsuite/testsuite.c'; fi`
+@am__fastdepCC_TRUE@   mv -f testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Tpo testsuite/$(DEPDIR)/testsuite_testsuite-testsuite.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='testsuite/testsuite.c' object='testsuite/testsuite_testsuite-testsuite.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testsuite_testsuite_CFLAGS) $(CFLAGS) -c -o testsuite/testsuite_testsuite-testsuite.obj `if test -f 'testsuite/testsuite.c'; then $(CYGPATH_W) 'testsuite/testsuite.c'; else $(CYGPATH_W) '$(srcdir)/testsuite/testsuite.c'; fi`
+
+.s.o:
+       $(CCASCOMPILE) -c -o $@ $<
+
+.s.obj:
+       $(CCASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.s.lo:
+       $(LTCCASCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+       -rm -rf ctaocrypt/src/.libs ctaocrypt/src/_libs
+       -rm -rf src/.libs src/_libs
+
+distclean-libtool:
+       -rm -f libtool
+install-docDATA: $(doc_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
+       @list='$(doc_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
+         $(docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
+       done
+
+uninstall-docDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(doc_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(docdir)/$$f"; \
+       done
+install-exampleDATA: $(example_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
+       @list='$(example_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(exampleDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(exampledir)/$$f'"; \
+         $(exampleDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(exampledir)/$$f"; \
+       done
+
+uninstall-exampleDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(example_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(exampledir)/$$f'"; \
+         rm -f "$(DESTDIR)$(exampledir)/$$f"; \
+       done
+install-includeHEADERS: $(include_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+       @list='$(include_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+         $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+       done
+
+uninstall-includeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(include_HEADERS)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(includedir)/$$f"; \
+       done
+install-nobase_includeHEADERS: $(nobase_include_HEADERS)
+       @$(NORMAL_INSTALL)
+       test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
+       @$(am__vpath_adj_setup) \
+       list='$(nobase_include_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         $(am__vpath_adj) \
+         echo " $(nobase_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+         $(nobase_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+       done
+
+uninstall-nobase_includeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @$(am__vpath_adj_setup) \
+       list='$(nobase_include_HEADERS)'; for p in $$list; do \
+         $(am__vpath_adj) \
+         echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+         rm -f "$(DESTDIR)$(includedir)/$$f"; \
+       done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[        ]'; \
+       srcdir=$(srcdir); export srcdir; \
+       list=' $(TESTS) '; \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               echo "XPASS: $$tst"; \
+             ;; \
+             *) \
+               echo "PASS: $$tst"; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *$$ws$$tst$$ws*) \
+               xfail=`expr $$xfail + 1`; \
+               echo "XFAIL: $$tst"; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               echo "FAIL: $$tst"; \
+             ;; \
+             esac; \
+           else \
+             skip=`expr $$skip + 1`; \
+             echo "SKIP: $$tst"; \
+           fi; \
+         done; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="All $$all tests passed"; \
+           else \
+             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+           fi; \
+         else \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all tests failed"; \
+           else \
+             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+           fi; \
+         fi; \
+         dashes="$$banner"; \
+         skipped=""; \
+         if test "$$skip" -ne 0; then \
+           skipped="($$skip tests were not run)"; \
+           test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$skipped"; \
+         fi; \
+         report=""; \
+         if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+           report="Please report to $(PACKAGE_BUGREPORT)"; \
+           test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+             dashes="$$report"; \
+         fi; \
+         dashes=`echo "$$dashes" | sed s/./=/g`; \
+         echo "$$dashes"; \
+         echo "$$banner"; \
+         test -z "$$skipped" || echo "$$skipped"; \
+         test -z "$$report" || echo "$$report"; \
+         echo "$$dashes"; \
+         test "$$failed" -eq 0; \
+       else :; fi
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d $(distdir) || mkdir $(distdir)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+       -find $(distdir) -type d ! -perm -755 -exec chmod u+rwx,go+rx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r $(distdir)
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       $(am__remove_distdir)
+
+dist-tarZ: distdir
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__remove_distdir)
+
+dist-shar: distdir
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__remove_distdir)
+
+dist dist-all: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       mkdir $(distdir)/_build
+       mkdir $(distdir)/_inst
+       chmod a-w $(distdir)
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && cd $(distdir)/_build \
+         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @cd $(distuninstallcheck_dir) \
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \
+               config.h
+install-binPROGRAMS: install-libLTLIBRARIES
+
+installdirs:
+       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -rm -f ctaocrypt/benchmark/$(DEPDIR)/$(am__dirstamp)
+       -rm -f ctaocrypt/benchmark/$(am__dirstamp)
+       -rm -f ctaocrypt/src/$(DEPDIR)/$(am__dirstamp)
+       -rm -f ctaocrypt/src/$(am__dirstamp)
+       -rm -f ctaocrypt/test/$(DEPDIR)/$(am__dirstamp)
+       -rm -f ctaocrypt/test/$(am__dirstamp)
+       -rm -f examples/client/$(DEPDIR)/$(am__dirstamp)
+       -rm -f examples/client/$(am__dirstamp)
+       -rm -f examples/echoclient/$(DEPDIR)/$(am__dirstamp)
+       -rm -f examples/echoclient/$(am__dirstamp)
+       -rm -f examples/echoserver/$(DEPDIR)/$(am__dirstamp)
+       -rm -f examples/echoserver/$(am__dirstamp)
+       -rm -f examples/server/$(DEPDIR)/$(am__dirstamp)
+       -rm -f examples/server/$(am__dirstamp)
+       -rm -f src/$(DEPDIR)/$(am__dirstamp)
+       -rm -f src/$(am__dirstamp)
+       -rm -f sslSniffer/sslSnifferTest/$(DEPDIR)/$(am__dirstamp)
+       -rm -f sslSniffer/sslSnifferTest/$(am__dirstamp)
+       -rm -f tests/$(DEPDIR)/$(am__dirstamp)
+       -rm -f tests/$(am__dirstamp)
+       -rm -f testsuite/$(DEPDIR)/$(am__dirstamp)
+       -rm -f testsuite/$(am__dirstamp)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+       clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+       clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ctaocrypt/benchmark/$(DEPDIR) ctaocrypt/src/$(DEPDIR) ctaocrypt/test/$(DEPDIR) examples/client/$(DEPDIR) examples/echoclient/$(DEPDIR) examples/echoserver/$(DEPDIR) examples/server/$(DEPDIR) src/$(DEPDIR) sslSniffer/sslSnifferTest/$(DEPDIR) tests/$(DEPDIR) testsuite/$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-docDATA install-exampleDATA \
+       install-includeHEADERS install-nobase_includeHEADERS
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -rf ctaocrypt/benchmark/$(DEPDIR) ctaocrypt/src/$(DEPDIR) ctaocrypt/test/$(DEPDIR) examples/client/$(DEPDIR) examples/echoclient/$(DEPDIR) examples/echoserver/$(DEPDIR) examples/server/$(DEPDIR) src/$(DEPDIR) sslSniffer/sslSnifferTest/$(DEPDIR) tests/$(DEPDIR) testsuite/$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-docDATA \
+       uninstall-exampleDATA uninstall-includeHEADERS \
+       uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+       clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+       clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+       clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \
+       dist-shar dist-tarZ dist-zip distcheck distclean \
+       distclean-compile distclean-generic distclean-hdr \
+       distclean-libtool distclean-tags distcleancheck distdir \
+       distuninstallcheck dvi dvi-am html html-am info info-am \
+       install install-am install-binPROGRAMS install-data \
+       install-data-am install-docDATA install-dvi install-dvi-am \
+       install-exampleDATA install-exec install-exec-am install-html \
+       install-html-am install-includeHEADERS install-info \
+       install-info-am install-libLTLIBRARIES install-man \
+       install-nobase_includeHEADERS install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-binPROGRAMS \
+       uninstall-docDATA uninstall-exampleDATA \
+       uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+       uninstall-nobase_includeHEADERS
+
+test: check
+
+# !!!! first line of rule has to start with a hard (real) tab, not spaces
+egs:
+       $(MAKE) examples/client/client; \
+       $(MAKE) examples/echoclient/echoclient;\
+       $(MAKE) examples/server/server; \
+       $(MAKE) examples/echoserver/echoserver;
+
+ctc:
+       $(MAKE) ctaocrypt/test/testctaocrypt; \
+       $(MAKE) ctaocrypt/benchmark/benchmark; 
+
+merge-clean:
+       @find ./ | $(GREP) \.gcda | xargs rm -f
+       @find ./ | $(GREP) \.gcno | xargs rm -f
+       @find ./ | $(GREP) \.gz | xargs rm -f
+       @find ./ | $(GREP) \.orig | xargs rm -f
+       @find ./ | $(GREP) \.rej | xargs rm -f
+       @find ./ | $(GREP) \.rpm | xargs rm -f
+       @find ./ | $(GREP) \.THIS | xargs rm -f
+       @find ./ | $(GREP) \.OTHER | xargs rm -f
+       @find ./ | $(GREP) \.BASE | xargs rm -f
+       @find ./ | $(GREP) \~$$ | xargs rm -f
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/NEWS b/FreeRTOS-Plus/Source/CyaSSL/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/FreeRTOS-Plus/Source/CyaSSL/README b/FreeRTOS-Plus/Source/CyaSSL/README
new file mode 100644 (file)
index 0000000..a88a90a
--- /dev/null
@@ -0,0 +1,723 @@
+*** Notes, Please read ***
+
+Note 1)
+CyaSSL now needs all examples and tests to be run from the CyaSSL home
+directory.  This is because it finds certs and keys from ./certs/.  Trying to
+maintain the ability to run each program from its own directory, the testsuite
+directory, the main directory (for make check/test), and for the various
+different project layouts (with or without config) was becoming harder and 
+harder.  Now to run testsuite just do:
+
+./testsuite/testsuite
+
+or 
+
+make test    (when using autoconf)
+
+On *nix or Windows the examples and testsuite will check to see if the current
+directory is the source directory and if so, attempt to change to the CyaSSL
+home directory.  This should work in most setup cases, if not, just follow the
+beginning of the note and specify the full path.
+
+
+Note 2)
+CyaSSL takes a different approach to certificate verification than OpenSSL does.
+The default policy for the client is to verify the server, this means that if
+you don't load CAs to verify the server you'll get a connect error, unable to 
+verify (-155).  It you want to mimic OpenSSL behavior of having SSL_connect
+succeed even if verifying the server fails and reducing security you can do
+this by calling:
+
+SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
+
+before calling SSL_new();  Though it's not recommended.
+
+*** end Note ***
+
+CyaSSL Release 2.3.0 (8/10/2012)
+
+Release 2.3.0 CyaSSL has bug fixes and a few new features including:
+- AES-GCM crypto and cipher suites
+- make test cipher suite checks
+- Subject AltName processing
+- Command line support for client/server examples
+- Sniffer SessionTicket support
+- SHA-384 cipher suites
+- Verify cipher suite validity when user overrides
+- CRL dir monitoring
+- DTLS Cookie support, reliability coming soon
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+
+
+***************CyaSSL Release 2.2.0 (5/18/2012)
+
+Release 2.2.0 CyaSSL has bug fixes and a few new features including:
+- Initial CRL support (--enable-crl)
+- Initial OCSP support (--enable-ocsp)
+- Add static ECDH suites
+- SHA-384 support
+- ECC client certificate support
+- Add medium session cache size (1055 sessions) 
+- Updated unit tests
+- Protection against mutex reinitialization
+
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+
+
+***************CyaSSL Release 2.0.8 (2/24/2012)
+
+Release 2.0.8 CyaSSL has bug fixes and a few new features including:
+- A fix for malicious certificates pointed out by Remi Gacogne (thanks)
+  resulting in NULL pointer use.
+- Respond to renegotiation attempt with no_renegoatation alert
+- Add basic path support for load_verify_locations()
+- Add set Temp EC-DHE key size
+- Extra checks on rsa test when porting into
+
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+
+
+************* CyaSSL Release 2.0.6 (1/27/2012)
+
+Release 2.0.6 CyaSSL has bug fixes and a few new features including:
+- Fixes for CA basis constraint check
+- CTX reference counting
+- Initial unit test additions
+- Lean and Mean Windows fix
+- ECC benchmarking
+- SSMTP build support
+- Ability to group handshake messages with set_group_messages(ctx/ssl)
+- CA cache addition callback
+- Export Base64_Encode for general use
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+
+
+************* CyaSSL Release 2.0.2 (12/05/2011)
+
+Release 2.0.2 CyaSSL has bug fixes and a few new features including:
+- CTaoCrypt Runtime library detection settings when directly using the crypto
+  library
+- Default certificate generation now uses SHAwRSA and adds SHA256wRSA generation
+- All test certificates now use 2048bit and SHA-1 for better modern browser
+  support
+- Direct AES block access and AES-CTR (counter) mode
+- Microchip pic32 support
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+
+
+************* CyaSSL Release 2.0.0rc3 (9/28/2011)
+
+Release 2.0.0rc3 for CyaSSL has bug fixes and a few new features including:
+- updated autoconf support
+- better make install and uninstall  (uses system directories)
+- make test / make check
+- CyaSSL headers now in <cyassl/*.h>
+- CTaocrypt headers now in <cyassl/ctaocrypt/*.h>
+- OpenSSL compatibility headers now in <cyassl/openssl/*.h>
+- examples and tests all run from home diretory so can use certs in ./certs
+        (see note 1)
+
+So previous applications that used the OpenSSL compatibility header
+<openssl/ssl.h> now need to include <cyassl/openssl/ssl.h> instead, no other
+changes are required.
+
+Special Thanks to Brian Aker for his autoconf, install, and header patches.
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+************CyaSSL Release 2.0.0rc2 (6/6/2011)
+
+Release 2.0.0rc2 for CyaSSL has bug fixes and a few new features including:
+- bug fixes (Alerts, DTLS with DHE)
+- FreeRTOS support
+- lwIP support
+- Wshadow warnings removed
+- asn public header
+- CTaoCrypt public headers now all have ctc_ prefix (the manual is still being
+        updated to relfect this change)
+- and more.
+
+This is the 2nd and perhaps final release candidate for version 2.
+Please send any comments or questions to support@yassl.com.
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+***********CyaSSL Release 2.0.0rc1 (5/2/2011)
+
+Release 2.0.0rc1 for CyaSSL has many new features including:
+- bug fixes
+- SHA-256 cipher suites 
+- Root Certificate Verification (instead of needing all certs in the chain) 
+- PKCS #8 private key encryption (supports PKCS #5 v1-v2 and PKCS #12) 
+- Serial number retrieval for x509 
+- PBKDF2 and PKCS #12 PBKDF 
+- UID parsing for x509 
+- SHA-256 certificate signatures 
+- Client and server can send chains (SSL_CTX_use_certificate_chain_file) 
+- CA loading can now parse multiple certificates per file
+- Dynamic memory runtime hooks
+- Runtime hooks for logging
+- EDH on server side
+- More informative error codes
+- More informative logging messages
+- Version downgrade more robust (use SSL_v23*)
+- Shared build only by default through ./configure
+- Compiler visibility is now used, internal functions not polluting namespace
+- Single Makefile, no recursion, for faster and simpler building
+- Turn on all warnings possible build option, warning fixes
+- and more.
+
+Because of all the new features and the multiple OS, compiler, feature-set
+options that CyaSSL allows, there may be some configuration fixes needed.
+Please send any comments or questions to support@yassl.com.
+
+The CyaSSL manual is available at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf.  For build instructions 
+and comments about the new features please check the manual.
+
+****************** CyaSSL Release 1.9.0 (3/2/2011)
+
+Release 1.9.0 for CyaSSL adds bug fixes, improved TLSv1.2 through testing and
+better hash/sig algo ids, --enable-webServer for the yaSSL embedded web server,
+improper AES key setup detection, user cert verify callback improvements, and
+more.
+
+The CyaSSL manual offering is included in the doc/ directory.  For build
+instructions and comments about the new features please check the manual.
+
+Please send any comments or questions to support@yassl.com.
+
+****************** CyaSSL Release 1.8.0 (12/23/2010)
+
+Release 1.8.0 for CyaSSL adds bug fixes, x509 v3 CA signed certificate
+generation, a C standard library abstraction layer, lower memory use, increased
+portability through the os_settings.h file, and the ability to use NTRU cipher
+suites when used in conjunction with an NTRU license and library.
+
+The initial CyaSSL manual offering is included in the doc/ directory.  For
+build instructions and comments about the new features please check the manual.
+
+Please send any comments or questions to support@yassl.com.
+
+Happy Holidays.
+
+********************* CyaSSL Release 1.6.5 (9/9/2010)
+
+Release 1.6.5 for CyaSSL adds bug fixes and x509 v3 self signed certificate
+generation.
+For general build instructions see doc/Building_CyaSSL.pdf.
+
+To enable certificate generation support add this option to ./configure
+./configure --enable-certgen
+
+An example is included in ctaocrypt/test/test.c and documentation is provided
+in doc/CyaSSL_Extensions_Reference.pdf item 11.
+
+********************** CyaSSL Release 1.6.0 (8/27/2010)
+
+Release 1.6.0 for CyaSSL adds bug fixes, RIPEMD-160, SHA-512, and RSA key
+generation.
+For general build instructions see doc/Building_CyaSSL.pdf.
+
+To add RIPEMD-160 support add this option to ./configure
+./configure --enable-ripemd
+
+To add SHA-512 support add this option to ./configure
+./configure --enable-sha512
+
+To add RSA key generation support add this option to ./configure
+./configure --enable-keygen
+
+Please see ctaocrypt/test/test.c for examples and usage.
+
+For Windows, RIPEMD-160 and SHA-512 are enabled by default but key generation is
+off by default.  To turn key generation on add the define CYASSL_KEY_GEN to
+CyaSSL.
+
+
+*************   CyaSSL Release 1.5.6 (7/28/2010)
+
+Release 1.5.6 for CyaSSL adds bug fixes, compatibility for our JSSE provider,
+and a fix for GCC builds on some systems.
+For general build instructions see doc/Building_CyaSSL.pdf.
+
+To add AES-NI support add this option to ./configure
+./configure --enable-aesni
+
+You'll need GCC 4.4.3 or later to make use of the assembly.
+
+**************  CyaSSL Release 1.5.4 (7/7/2010)
+
+Release 1.5.4 for CyaSSL adds bug fixes, support for AES-NI, SHA1 speed 
+improvements from loop unrolling, and support for the Mongoose Web Server.
+For general build instructions see doc/Building_CyaSSL.pdf.
+
+To add AES-NI support add this option to ./configure
+./configure --enable-aesni
+
+You'll need GCC 4.4.3 or later to make use of the assembly.
+
+***************  CyaSSL Release 1.5.0 (5/11/2010)
+
+Release 1.5.0 for CyaSSL adds bug fixes, GoAhead WebServer support, sniffer
+support, and initial swig interface support.
+
+For general build instructions see doc/Building_CyaSSL.pdf.
+
+To add support for GoAhead WebServer either --enable-opensslExtra or if you
+don't want all the features of opensslExtra you can just define GOAHEAD_WS
+instead.  GOAHEAD_WS can be added to ./configure with CFLAGS=-DGOAHEAD_WS or
+you can define it yourself.
+
+To look at the sniffer support please see the sniffertest app in
+sslSniffer/sslSnifferTest.  Build with --enable-sniffer on *nix or use the
+vcproj files on windows.  You'll need to have pcap installed on *nix and
+WinPcap on windows.
+
+A swig interface file is now located in the swig directory for using Python,
+Java, Perl, and others with CyaSSL.  This is initial support and experimental,
+please send questions or comments to support@yassl.com.
+
+When doing load testing with CyaSSL, on the echoserver example say, the client
+machine may run out of tcp ephemeral ports, they will end up in the TIME_WAIT
+queue, and can't be reused by default.  There are generally two ways to fix
+this.  1) Reduce the length sockets remain on the TIME_WAIT queue or 2) Allow
+items on the TIME_WAIT queue to be reused.
+
+
+To reduce the TIME_WAIT length in OS X to 3 seconds (3000 milliseconds)
+
+sudo sysctl -w net.inet.tcp.msl=3000
+
+In Linux
+
+sudo sysctl -w net.ipv4.tcp_tw_reuse=1
+
+allows reuse of sockets in TIME_WAIT
+
+sudo sysctl -w net.ipv4.tcp_tw_recycle=1
+
+works but seems to remove sockets from  TIME_WAIT entirely?
+
+sudo sysctl -w net.ipv4.tcp_fin_timeout=1
+
+doen't control TIME_WAIT, it controls FIN_WAIT(2) contrary to some posts
+
+
+******************** CyaSSL Release 1.4.0 (2/18/2010)
+
+Release 1.3.0 for CyaSSL adds bug fixes, better multi TLS/SSL version support
+through SSLv23_server_method(), and improved documentation in the doc/ folder.
+
+For general build instructions doc/Building_CyaSSL.pdf.
+
+******************** CyaSSL Release 1.3.0 (1/21/2010)
+
+Release 1.3.0 for CyaSSL adds bug fixes, a potential security problem fix,
+better porting support, removal of assert()s, and a complete THREADX port.
+
+For general build instructions see rc1 below.
+
+******************** CyaSSL Release 1.2.0 (11/2/2009)
+
+Release 1.2.0 for CyaSSL adds bug fixes and session negotiation if first use is
+read or write.
+
+For general build instructions see rc1 below.
+
+******************** CyaSSL Release 1.1.0 (9/2/2009)
+
+Release 1.1.0 for CyaSSL adds bug fixes, a check against malicious session
+cache use, support for lighttpd, and TLS 1.2.
+
+To get TLS 1.2 support please use the client and server functions:
+
+SSL_METHOD *TLSv1_2_server_method(void);
+SSL_METHOD *TLSv1_2_client_method(void);
+
+CyaSSL was tested against lighttpd 1.4.23.  To build CyaSSL for use with 
+lighttpd use the following commands from the CyaSSL install dir <CyaSSLDir>:
+
+./configure --disable-shared --enable-opensslExtra --enable-fastmath --without-zlib
+
+make
+make openssl-links
+
+Then to build lighttpd with CyaSSL use the following commands from the
+lighttpd install dir:
+
+./configure --with-openssl --with-openssl-includes=<CyaSSLDir>/include --with-openssl-libs=<CyaSSLDir>/lib LDFLAGS=-lm
+
+make
+
+On some systems you may get a linker error about a duplicate symbol for
+MD5_Init or other MD5 calls.  This seems to be caused by the lighttpd src file
+md5.c, which defines MD5_Init(), and is included in liblightcomp_la-md5.o.
+When liblightcomp is linked with the SSL_LIBs the linker may complain about
+the duplicate symbol.  This can be fixed by editing the lighttpd src file md5.c
+and adding this line to the beginning of the file:
+
+#if 0
+
+and this line to the end of the file
+
+#endif
+
+Then from the lighttpd src dir do a:
+
+make clean
+make
+
+
+If you get link errors about undefined symbols more than likely the actual
+OpenSSL libraries are found by the linker before the CyaSSL openssl-links that
+point to the CyaSSL library, causing the linker confusion.  This can be fixed
+by editing the Makefile in the lighttpd src directory and changing the line:
+
+SSL_LIB = -lssl -lcrypto
+
+to
+
+SSL_LIB = -lcyassl
+
+Then from the lighttpd src dir do a:
+
+make clean
+make
+
+This should remove any confusion the linker may be having with missing symbols.
+
+For any questions or concerns please contact support@yassl.com .
+
+For general build instructions see rc1 below.
+
+******************CyaSSL Release 1.0.6 (8/03/2009)
+
+Release 1.0.6 for CyaSSL adds bug fixes, an improved session cache, and faster
+math with a huge code option.
+
+The session cache now defaults to a client mode, also good for embedded servers.
+For servers not under heavy load (less than 200 new sessions per minute), define
+BIG_SESSION_CACHE.  If the server will be under heavy load, define
+HUGE_SESSION_CACHE.
+
+There is now a fasthugemath option for configure.  This enables fastmath plus
+even faster math by greatly increasing the code size of the math library. Use
+the benchmark utility to compare public key operations.
+
+
+For general build instructions see rc1 below.
+
+******************CyaSSL Release 1.0.3 (5/10/2009)
+
+Release 1.0.3 for CyaSSL adds bug fixes and add increased support for OpenSSL
+compatibility when building other applications.
+
+Release 1.0.3 includes an alpha release of DTLS for both client and servers.
+This is only for testing purposes at this time.  Rebroadcast and reordering
+aren't fully implemented at this time but will be for the next release.
+
+For general build instructions see rc1 below.
+
+******************CyaSSL Release 1.0.2 (4/3/2009)
+
+Release 1.0.2 for CyaSSL adds bug fixes for a couple I/O issues.  Some systems
+will send a SIGPIPE on socket recv() at any time and this should be handled by
+the application by turning off SIGPIPE through setsockopt() or returning from
+the handler.
+
+Release 1.0.2 includes an alpha release of DTLS for both client and servers.
+This is only for testing purposes at this time.  Rebroadcast and reordering
+aren't fully implemented at this time but will be for the next release.
+
+For general build instructions see rc1 below.
+
+*****************CyaSSL Release Candidiate 3 rc3-1.0.0 (2/25/2009)
+
+
+Release Candidate 3 for CyaSSL 1.0.0 adds bug fixes and adds a project file for
+iPhone development with Xcode.  cyassl-iphone.xcodeproj is located in the root
+directory.  This release also includes a fix for supporting other
+implementations that bundle multiple messages at the record layer, this was
+lost when cyassl i/o was re-implemented but is now fixed.
+
+For general build instructions see rc1 below.
+
+*****************CyaSSL Release Candidiate 2 rc2-1.0.0 (1/21/2009)
+
+
+Release Candidate 2 for CyaSSL 1.0.0 adds bug fixes and adds two new stream
+ciphers along with their respective cipher suites.  CyaSSL adds support for
+HC-128 and RABBIT stream ciphers.  The new suites are:
+
+TLS_RSA_WITH_HC_128_CBC_SHA
+TLS_RSA_WITH_RABBIT_CBC_SHA
+
+And the corresponding cipher names are
+
+HC128-SHA
+RABBIT-SHA
+
+CyaSSL also adds support for building with devkitPro for PPC by changing the
+library proper to use libogc.  The examples haven't been changed yet but if
+there's interest they can be.  Here's an example ./configure to build CyaSSL
+for devkitPro:
+
+./configure --disable-shared CC=/pathTo/devkitpro/devkitPPC/bin/powerpc-gekko-gcc --host=ppc --without-zlib --enable-singleThreaded RANLIB=/pathTo/devkitpro/devkitPPC/bin/powerpc-gekko-ranlib CFLAGS="-DDEVKITPRO -DGEKKO"
+
+For linking purposes you'll need
+
+LDFLAGS="-g -mrvl -mcpu=750 -meabi -mhard-float -Wl,-Map,$(notdir $@).map"
+
+For general build instructions see rc1 below.
+
+
+********************CyaSSL Release Candidiate 1 rc1-1.0.0 (12/17/2008)
+
+
+Release Candidate 1 for CyaSSL 1.0.0 contains major internal changes.  Several
+areas have optimization improvements, less dynamic memory use, and the I/O
+strategy has been refactored to allow alternate I/O handling or Library use.
+Many thanks to Thierry Fournier for providing these ideas and most of the work.
+
+Because of these changes, this release is only a candidate since some problems
+are probably inevitable on some platform with some I/O use.  Please report any
+problems and we'll try to resolve them as soon as possible.  You can contact us
+at support@yassl.com or todd@yassl.com.
+
+Using TomsFastMath by passing --enable-fastmath to ./configure now uses assembly
+on some platforms.  This is new so please report any problems as every compiler,
+mode, OS combination hasn't been tested.  On ia32 all of the registers need to
+be available so be sure to pass these options to CFLAGS:
+
+CFLAGS="-O3 -fomit-frame-pointer"
+
+OS X will also need -mdynamic-no-pic added to CFLAGS
+
+Also if you're building in shared mode for ia32 you'll need to pass options to
+LDFLAGS as well on OS X:
+
+LDFLAGS=-Wl,-read_only_relocs,warning
+
+This gives warnings for some symbols but seems to work.
+
+
+--To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin:
+
+    ./configure
+    make
+
+    from the ./testsuite/ directory run ./testsuite 
+
+to make a debug build:
+
+    ./configure --enable-debug --disable-shared
+    make
+
+
+
+--To build on Win32
+
+Choose (Re)Build All from the project workspace
+
+Run the testsuite program
+
+
+
+
+
+*************************CyaSSL version 0.9.9 (7/25/2008) 
+
+This release of CyaSSL adds bug fixes, Pre-Shared Keys, over-rideable memory
+handling, and optionally TomsFastMath.  Thanks to Moisés Guimarães for the
+work on TomsFastMath.
+
+To optionally use TomsFastMath pass --enable-fastmath to ./configure
+Or define USE_FAST_MATH in each project from CyaSSL for MSVC.
+
+Please use the benchmark routine before and after to see the performance
+difference, on some platforms the gains will be little but RSA encryption
+always seems to be faster.  On x86-64 machines with GCC the normal math library
+may outperform the fast one when using CFLAGS=-m64 because TomsFastMath can't
+yet use -m64 because of GCCs inability to do 128bit division.
+
+     **** UPDATE GCC 4.2.1 can now do 128bit division ***
+
+See notes below (0.2.0) for complete build instructions.
+
+
+****************CyaSSL version 0.9.8 (5/7/2008) 
+
+This release of CyaSSL adds bug fixes, client side Diffie-Hellman, and better
+socket handling.
+
+See notes below (0.2.0) for complete build instructions.
+
+
+****************CyaSSL version 0.9.6 (1/31/2008) 
+
+This release of CyaSSL adds bug fixes, increased session management, and a fix
+for gnutls.
+
+See notes below (0.2.0) for complete build instructions.
+
+
+****************CyaSSL version 0.9.0 (10/15/2007) 
+
+This release of CyaSSL adds bug fixes, MSVC 2005 support, GCC 4.2 support, 
+IPV6 support and test, and new test certificates.
+
+See notes below (0.2.0) for complete build instructions.
+
+
+****************CyaSSL version 0.8.0 (1/10/2007) 
+
+This release of CyaSSL adds increased socket support, for non-blocking writes,
+connects, and interrupted system calls.
+
+See notes below (0.2.0) for complete build instructions.
+
+
+****************CyaSSL version 0.6.3 (10/30/2006) 
+
+This release of CyaSSL adds debug logging to stderr to aid in the debugging of
+CyaSSL on systems that may not provide the best support.
+
+If CyaSSL is built with debugging support then you need to call
+CyaSSL_Debugging_ON() to turn logging on.
+
+On Unix use ./configure --enable-debug
+
+On Windows define DEBUG_CYASSL when building CyaSSL
+
+
+To turn logging back off call CyaSSL_Debugging_OFF()
+
+See notes below (0.2.0) for complete build instructions.
+
+
+*****************CyaSSL version 0.6.2 (10/29/2006) 
+
+This release of CyaSSL adds TLS 1.1.
+
+Note that CyaSSL has certificate verification on by default, unlike OpenSSL.
+To emulate OpenSSL behavior, you must call SSL_CTX_set_verify() with
+SSL_VERIFY_NONE.  In order to have full security you should never do this, 
+provide CyaSSL with the proper certificates to eliminate impostors and call
+CyaSSL_check_domain_name() to prevent man in the middle attacks.
+
+See notes below (0.2.0) for build instructions.
+
+*****************CyaSSL version 0.6.0 (10/25/2006) 
+
+This release of CyaSSL adds more SSL functions, better autoconf, nonblocking
+I/O for accept, connect, and read.  There is now an --enable-small configure
+option that turns off TLS, AES, DES3, HMAC, and ERROR_STRINGS, see configure.in
+for the defines.  Note that TLS requires HMAC and AES requires TLS.
+
+See notes below (0.2.0) for build instructions.
+
+
+*****************CyaSSL version 0.5.5 (09/27/2006) 
+
+This mini release of CyaSSL adds better input processing through buffered input
+and big message support.  Added SSL_pending() and some sanity checks on user
+settings.
+
+See notes below (0.2.0) for build instructions.
+
+
+*****************CyaSSL version 0.5.0 (03/27/2006) 
+
+This release of CyaSSL adds AES support and minor bug fixes. 
+
+See notes below (0.2.0) for build instructions.
+
+
+*****************CyaSSL version 0.4.0 (03/15/2006)
+
+This release of CyaSSL adds TLSv1 client/server support and libtool. 
+
+See notes below for build instructions.
+
+
+*****************CyaSSL version 0.3.0 (02/26/2006)
+
+This release of CyaSSL adds SSLv3 server support and session resumption. 
+
+See notes below for build instructions.
+
+
+*****************CyaSSL version 0.2.0 (02/19/2006)
+
+
+This is the first release of CyaSSL and its crypt brother, CTaoCrypt.  CyaSSL
+is written in ANSI C with the idea of a small code size, footprint, and memory
+usage in mind.  CTaoCrypt can be as small as 32K, and the current client
+version of CyaSSL can be as small as 12K.
+
+
+The first release of CTaoCrypt supports MD5, SHA-1, 3DES, ARC4, Big Integer
+Support, RSA, ASN parsing, and basic x509 (en/de)coding.
+
+The first release of CyaSSL supports normal client RSA mode SSLv3 connections
+with support for SHA-1 and MD5 digests.  Ciphers include 3DES and RC4.
+
+
+--To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin:
+
+    ./configure
+    make
+
+    from the ./testsuite/ directory run ./testsuite 
+
+to make a debug build:
+
+    ./configure --enable-debug --disable-shared
+    make
+
+
+
+--To build on Win32
+
+Choose (Re)Build All from the project workspace
+
+Run the testsuite program
+
+
+
+*** The next release of CyaSSL will support a server and more OpenSSL
+compatibility functions.
+
+
+Please send questions or comments to todd@yassl.com
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ReadMeFirst.url b/FreeRTOS-Plus/Source/CyaSSL/ReadMeFirst.url
new file mode 100644 (file)
index 0000000..19432f5
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/ssl\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/aclocal.m4 b/FreeRTOS-Plus/Source/CyaSSL/aclocal.m4
new file mode 100644 (file)
index 0000000..ee7bb04
--- /dev/null
@@ -0,0 +1,944 @@
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf.  If you want to use that,
+you should regenerate the build system entirely.], [63])])
+
+# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+
+# Figure out how to run the assembler.                      -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/ax_pthread.m4])
+m4_include([m4/hexversion.m4])
+m4_include([m4/lib_socket_nsl.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/visibility.m4])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ca-cert.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ca-cert.pem
new file mode 100644 (file)
index 0000000..4a9786a
--- /dev/null
@@ -0,0 +1,87 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e9:d0:a7:5f:79:25:f4:3c
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:18:15 2011 GMT
+            Not After : Jul 20 18:18:15 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
+                    f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
+                    de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
+                    21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
+                    32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
+                    8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
+                    a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
+                    a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
+                    82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
+                    3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
+                    76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
+                    73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
+                    de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
+                    cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
+                    b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
+                    13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
+                    ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
+                    36:79
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+            X509v3 Authority Key Identifier: 
+                keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+                DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:E9:D0:A7:5F:79:25:F4:3C
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
+        4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
+        e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
+        f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
+        af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
+        98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
+        8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
+        1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
+        61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
+        1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
+        60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
+        18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
+        f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
+        b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
+        5a:1f:7f:ca
+-----BEGIN CERTIFICATE-----
+MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
+VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
+A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
+dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
+MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
+8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
+EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
+dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
+mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
+CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
+BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
+P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
+dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
+BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
+9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
+PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
+Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
+G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
+ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
+rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.der b/FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.der
new file mode 100644 (file)
index 0000000..14456f3
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ca-key.pem
new file mode 100644 (file)
index 0000000..774feba
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAvwzKLRSyHoRCW804H0ryTXUQ8bY1n9/KfQOY06zeA2buKvHY
+sH1uB1QLEJghTYDLEiDnzE/eRX3Jcncy6sqQu2lSEAMvqPOVxfGLYlYb72dvpBBB
+la0Km+OlwLDScHZQMFuo6AgsfO2nonqNOCkcrMft8nyVsJWCfUlcOM13Je+9gHVT
+lDw9ymNbnxW10x0TLxnRPNt2Osy4fcnlwtfaQG/YIdxzG0ItU5z+Gvx9q3o2P5je
+hHwFZ85qFDiHqfGMtWjLaH9xICv1oGP1Vi+jJtK3b7FaF9c4mQj+k1hv/sMTSQgW
+C6dNZwBSMWcjTpjtUUUduQTZC+zYKLNLve02eQIDAQABAoIBAD1uTmAahH+dhXzh
+Swd84NaZKt6d+TY0DncOPgjqT+UGJtT2OPffDQ8cLgai9CponGNy4zXmBJGRtcGx
+pFSs18b7QaDWdW+9C06/sVLoX0kmmFZHx97p6jxgAb8o3DG/SV+TSYd6gVuWS03K
+XDhPt+Gy08ch2jwShwfkG9xD7OjsVGHn9u2mCy7134J/xh9hGZykgznfIYWJb3ev
+hhUyCKJaCyZh+3AMypw4fbwi7uujqBYA+YqAHgCEqEpB+IQDZy8jWy+baybDBzSU
+owM7ctWfcuCtzDSrvcfV9SYwhQ8wIzlS/zzLmSFNiKWr7mK5x+C7R4fBac9z8zC+
+zjkEnOUCgYEA4XZFgFm200nfCu8S1g/wt8sqN7+n+LVN9TE1reSjlKHb8ZattQVk
+hYP8G1spqr74Jj92fq0c8MvXJrQbBY5Whn4IYiHBhtZHeT63XaTGOtexdCD2UJdB
+BFPtPybWb5H6aCbsKtya8efc+3PweUMbIaNZBGNSB8nX5tEbXV6W+lMCgYEA2O1O
+ZGFrkQxhAbUPu0RnUx7cB8Qkfp5shCORDOQSBBZNeJjMlj0gTg9Fmrb4s5MNsqIb
+KfImecjF0nh+XnPy13Bhu0DOYQX+aR6CKeYUuKHnltAjPwWTAPLhTX7tt5Zs9/Dk
+0c8BmE/cdFSqbV5aQTH+/5q2oAXdqRBU+GvQqoMCgYAh0wSKROtQt3xmv4cr5ihO
+6oPi6TXh8hFH/6H1/J8t5TqB/AEDb1OtVCe2Uu7lVtETq+GzD3WQCoS0ocCMDNae
+RrorPrUx7WO7pNUNj3LN0R4mNeu+G3L9mzm0h7cT9eqDRZOYuo/kSsy0TKh/CLpB
+SahJKD1ePcHONwDL+SzdUQKBgQChV58+udavg22DP4/70NyozgMJI7GhG2PKxElW
+NSvRLmVglQVVmRE1/dXfRMeliHJfsoJRqHFFkzbPXB9hUQwFgOivxXu6XiLjPHXD
+hAVVbdY6LYSJkzPLONqqMQXNzmwt3VXTVwvwpTVqsK4xukOWygDHS+MZEkPTQvpv
+6oDA0QKBgQC524kgNCdwYjTqXyViEvOdgb9I7poOwY0Q/2WanS0aipRayMClpYRh
+ntQkue+pncl3C8dwZj26yFTf0jPh9X/5J2G+V0Xdt0UXJPUj5DgOkSfu4yDYFMiU
+R3dAd0UYng3OeT9XMVYJSWe+lFhP9sSr4onj44rABVUsJMBKlwQnmg==
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.der b/FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.der
new file mode 100644 (file)
index 0000000..a656ff9
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/client-cert.pem
new file mode 100644 (file)
index 0000000..278b43f
--- /dev/null
@@ -0,0 +1,87 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            87:4a:75:be:91:66:d8:3d
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:21:55 2011 GMT
+            Not After : Jul 20 18:21:55 2014 GMT
+        Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:c3:03:d1:2b:fe:39:a4:32:45:3b:53:c8:84:2b:
+                    2a:7c:74:9a:bd:aa:2a:52:07:47:d6:a6:36:b2:07:
+                    32:8e:d0:ba:69:7b:c6:c3:44:9e:d4:81:48:fd:2d:
+                    68:a2:8b:67:bb:a1:75:c8:36:2c:4a:d2:1b:f7:8b:
+                    ba:cf:0d:f9:ef:ec:f1:81:1e:7b:9b:03:47:9a:bf:
+                    65:cc:7f:65:24:69:a6:e8:14:89:5b:e4:34:f7:c5:
+                    b0:14:93:f5:67:7b:3a:7a:78:e1:01:56:56:91:a6:
+                    13:42:8d:d2:3c:40:9c:4c:ef:d1:86:df:37:51:1b:
+                    0c:a1:3b:f5:f1:a3:4a:35:e4:e1:ce:96:df:1b:7e:
+                    bf:4e:97:d0:10:e8:a8:08:30:81:af:20:0b:43:14:
+                    c5:74:67:b4:32:82:6f:8d:86:c2:88:40:99:36:83:
+                    ba:1e:40:72:22:17:d7:52:65:24:73:b0:ce:ef:19:
+                    cd:ae:ff:78:6c:7b:c0:12:03:d4:4e:72:0d:50:6d:
+                    3b:a3:3b:a3:99:5e:9d:c8:d9:0c:85:b3:d9:8a:d9:
+                    54:26:db:6d:fa:ac:bb:ff:25:4c:c4:d1:79:f4:71:
+                    d3:86:40:18:13:b0:63:b5:72:4e:30:c4:97:84:86:
+                    2d:56:2f:d7:15:f7:7f:c0:ae:f5:fc:5b:e5:fb:a1:
+                    ba:d3
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
+            X509v3 Authority Key Identifier: 
+                keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
+                DirName:/C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:87:4A:75:BE:91:66:D8:3D
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        1c:7c:42:81:29:9e:21:cf:d0:d8:c1:54:6f:cc:ae:14:09:38:
+        ff:68:98:9a:95:53:76:18:7b:e6:30:76:ec:28:0d:75:a7:de:
+        e0:cd:8e:d5:55:23:6a:47:2b:4e:8d:fc:7d:06:a3:d8:0f:ad:
+        5e:d6:04:c9:00:33:fb:77:27:d3:b5:03:b3:7b:21:74:31:0b:
+        4a:af:2d:1a:b3:93:8e:cc:f3:5f:3d:90:3f:cc:e3:55:19:91:
+        7b:78:24:2e:4a:09:bb:18:4e:61:2d:9c:c6:0a:a0:34:91:88:
+        70:6b:3b:48:47:bc:79:94:a2:a0:4d:32:47:54:c2:a3:dc:2e:
+        d2:51:4c:29:39:11:ff:e2:15:5e:58:97:36:f6:e9:06:06:86:
+        0e:8d:9d:95:03:72:b2:8b:19:7c:e9:14:6e:a1:88:73:68:58:
+        6d:71:5e:c2:d5:d3:13:d2:5f:de:ea:03:be:e2:00:40:e5:ce:
+        fd:e6:92:31:57:c3:eb:bb:66:ac:cb:2f:1a:fa:e0:62:a2:47:
+        f4:93:43:2a:4b:6c:5e:0a:2f:f9:e7:e6:4a:63:86:b0:ac:2a:
+        a1:eb:b4:5b:67:cd:32:e4:b6:11:4b:9a:72:66:0d:a2:4a:76:
+        8f:fe:22:bc:83:fd:db:b7:d5:a9:ee:05:c9:b1:71:7e:1b:2b:
+        e1:e3:af:c0
+-----BEGIN CERTIFICATE-----
+MIIEmDCCA4CgAwIBAgIJAIdKdb6RZtg9MA0GCSqGSIb3DQEBBQUAMIGOMQswCQYD
+VQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwG
+A1UEChMFeWFTU0wxFDASBgNVBAsTC1Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cu
+eWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMTEw
+MjQxODIxNTVaFw0xNDA3MjAxODIxNTVaMIGOMQswCQYDVQQGEwJVUzEPMA0GA1UE
+CBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFTU0wxFDAS
+BgNVBAsTC1Byb2dyYW1taW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJ
+KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAMMD0Sv+OaQyRTtTyIQrKnx0mr2qKlIHR9amNrIHMo7Quml7xsNE
+ntSBSP0taKKLZ7uhdcg2LErSG/eLus8N+e/s8YEee5sDR5q/Zcx/ZSRppugUiVvk
+NPfFsBST9Wd7Onp44QFWVpGmE0KN0jxAnEzv0YbfN1EbDKE79fGjSjXk4c6W3xt+
+v06X0BDoqAgwga8gC0MUxXRntDKCb42GwohAmTaDuh5AciIX11JlJHOwzu8Zza7/
+eGx7wBID1E5yDVBtO6M7o5lencjZDIWz2YrZVCbbbfqsu/8lTMTRefRx04ZAGBOw
+Y7VyTjDEl4SGLVYv1xX3f8Cu9fxb5fuhutMCAwEAAaOB9jCB8zAdBgNVHQ4EFgQU
+M9hFZtdohxh+VA1wJ5HHJteFZcAwgcMGA1UdIwSBuzCBuIAUM9hFZtdohxh+VA1w
+J5HHJteFZcChgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24x
+ETAPBgNVBAcTCFBvcnRsYW5kMQ4wDAYDVQQKEwV5YVNTTDEUMBIGA1UECxMLUHJv
+Z3JhbW1pbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEW
+DmluZm9AeWFzc2wuY29tggkAh0p1vpFm2D0wDAYDVR0TBAUwAwEB/zANBgkqhkiG
+9w0BAQUFAAOCAQEAHHxCgSmeIc/Q2MFUb8yuFAk4/2iYmpVTdhh75jB27CgNdafe
+4M2O1VUjakcrTo38fQaj2A+tXtYEyQAz+3cn07UDs3shdDELSq8tGrOTjszzXz2Q
+P8zjVRmRe3gkLkoJuxhOYS2cxgqgNJGIcGs7SEe8eZSioE0yR1TCo9wu0lFMKTkR
+/+IVXliXNvbpBgaGDo2dlQNysosZfOkUbqGIc2hYbXFewtXTE9Jf3uoDvuIAQOXO
+/eaSMVfD67tmrMsvGvrgYqJH9JNDKktsXgov+efmSmOGsKwqoeu0W2fNMuS2EUua
+cmYNokp2j/4ivIP927fVqe4FybFxfhsr4eOvwA==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-ecc-cert.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/client-ecc-cert.pem
new file mode 100644 (file)
index 0000000..4d0448f
--- /dev/null
@@ -0,0 +1,54 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            bf:cc:cb:7a:0a:07:42:82
+        Signature Algorithm: ecdsa-with-SHA1
+        Issuer: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: May  1 23:51:33 2012 GMT
+            Not After : Jan 26 23:51:33 2015 GMT
+        Subject: C=US, ST=Oregon, L=Salem, O=Client ECC, OU=Fast, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: id-ecPublicKey
+            EC Public Key:
+                pub: 
+                    04:55:bf:f4:0f:44:50:9a:3d:ce:9b:b7:f0:c5:4d:
+                    f5:70:7b:d4:ec:24:8e:19:80:ec:5a:4c:a2:24:03:
+                    62:2c:9b:da:ef:a2:35:12:43:84:76:16:c6:56:95:
+                    06:cc:01:a9:bd:f6:75:1a:42:f7:bd:a9:b2:36:22:
+                    5f:c7:5d:7f:b4
+                ASN1 OID: prime256v1
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
+            X509v3 Authority Key Identifier: 
+                keyid:EB:D4:4B:59:6B:95:61:3F:51:57:B6:04:4D:89:41:88:44:5C:AB:F2
+                DirName:/C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:BF:CC:CB:7A:0A:07:42:82
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: ecdsa-with-SHA1
+        30:44:02:20:26:08:44:95:35:2e:fa:9d:20:01:a6:79:60:ed:
+        35:a7:0a:dd:7a:0e:75:c5:80:d2:0b:9f:6a:90:d6:31:76:75:
+        02:20:2d:87:a2:bb:d5:e2:42:61:35:19:59:40:1d:fd:71:4f:
+        28:65:96:99:e6:85:1b:09:ad:d4:58:71:56:63:0b:c7
+-----BEGIN CERTIFICATE-----
+MIIC+jCCAqKgAwIBAgIJAL/My3oKB0KCMAkGByqGSM49BAEwgYkxCzAJBgNVBAYT
+AlVTMQ8wDQYDVQQIEwZPcmVnb24xDjAMBgNVBAcTBVNhbGVtMRMwEQYDVQQKEwpD
+bGllbnQgRUNDMQ0wCwYDVQQLEwRGYXN0MRYwFAYDVQQDEw13d3cueWFzc2wuY29t
+MR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0xMjA1MDEyMzUxMzNa
+Fw0xNTAxMjYyMzUxMzNaMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29u
+MQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsGA1UECxME
+RmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5m
+b0B5YXNzbC5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARVv/QPRFCaPc6b
+t/DFTfVwe9TsJI4ZgOxaTKIkA2Ism9rvojUSQ4R2FsZWlQbMAam99nUaQve9qbI2
+Il/HXX+0o4HxMIHuMB0GA1UdDgQWBBTr1EtZa5VhP1FXtgRNiUGIRFyr8jCBvgYD
+VR0jBIG2MIGzgBTr1EtZa5VhP1FXtgRNiUGIRFyr8qGBj6SBjDCBiTELMAkGA1UE
+BhMCVVMxDzANBgNVBAgTBk9yZWdvbjEOMAwGA1UEBxMFU2FsZW0xEzARBgNVBAoT
+CkNsaWVudCBFQ0MxDTALBgNVBAsTBEZhc3QxFjAUBgNVBAMTDXd3dy55YXNzbC5j
+b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkAv8zLegoHQoIwDAYD
+VR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCICYIRJU1LvqdIAGmeWDtNacK3XoO
+dcWA0gufapDWMXZ1AiAth6K71eJCYTUZWUAd/XFPKGWWmeaFGwmt1FhxVmMLxw==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-key.der b/FreeRTOS-Plus/Source/CyaSSL/certs/client-key.der
new file mode 100644 (file)
index 0000000..94dc253
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/client-key.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-key.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/client-key.pem
new file mode 100644 (file)
index 0000000..c4e7ad2
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAwwPRK/45pDJFO1PIhCsqfHSavaoqUgdH1qY2sgcyjtC6aXvG
+w0Se1IFI/S1oootnu6F1yDYsStIb94u6zw357+zxgR57mwNHmr9lzH9lJGmm6BSJ
+W+Q098WwFJP1Z3s6enjhAVZWkaYTQo3SPECcTO/Rht83URsMoTv18aNKNeThzpbf
+G36/TpfQEOioCDCBryALQxTFdGe0MoJvjYbCiECZNoO6HkByIhfXUmUkc7DO7xnN
+rv94bHvAEgPUTnINUG07ozujmV6dyNkMhbPZitlUJttt+qy7/yVMxNF59HHThkAY
+E7BjtXJOMMSXhIYtVi/XFfd/wK71/Fvl+6G60wIDAQABAoIBAQCi5thfEHFkCJ4u
+bdFtHoXSCrGMR84sUWqgEp5T3pFMHW3qWXvyd6rZxtmKq9jhFuRjJv+1bBNZuOOl
+yHIXLgyfb+VZP3ZvSbERwlouFikN3reO3EDVou7gHqH0vpfbhmOWFM2YCWAtMHac
+PM3miO5HknkLWgDiXl8RfH35CLcgBokqXf0AqyLh8LO8JKleJg4fAC3+IZpTW23T
+K6uUgmhDNtj2L8Yi/LVBXQ0zYOqkfX7oS1WRVtNcV48flBcvqt7pnqj0z4pMjqDk
+VnOyz0+GxWk88yQgi1yWDPprEjuaZ8HfxpaypdWSDZsJQmgkEEXUUOQXOUjQNYuU
+bRHej8pZAoGBAOokp/lpM+lx3FJ9iCEoL0neunIW6cxHeogNlFeEWBY6gbA/os+m
+bB6wBikAj+d3dqzbysfZXps/JpBSrvw4kAAUu7QPWJTnL2p+HE9BIdQxWR9OihqN
+p1dsItjl9H4yphDLZKVVA4emJwWMw9e2J7JNujDaR49U0z2LhI2UmFilAoGBANU4
+G8OPxZMMRwtvNZLFsI1GyJIYj/WACvfvof6AubUqusoYsF2lB9CTjdicBBzUYo6m
+JoEB/86KKmM0NUCqbYDeiSNqV02ebq2TTlaQC22dc4sMric93k7wqsVseGdslFKc
+N2dsLe+7r9+mkDzER8+Nlp6YqbSfxaZQ3LPw+3QXAoGAXoMJYr26fKK/QnT1fBzS
+ackEDYV+Pj0kEsMYe/Mp818OdmxZdeRBhGmdMvPNIquwNbpKsjzl2Vi2Yk9d3uWe
+CspTsiz3nrNrClt5ZexukU6SIPb8/Bbt03YM4ux/smkTa3gOWkZktF63JaBadTpL
+78c8Pvf9JrggxJkKmnO+wxkCgYEAukSTFKw0GTtfkWCs97TWgQU2UVM96GXcry7c
+YT7Jfbh/h/A7mwOCKTfOck4R1bHBDAegmZFKjX/sec/xObXphexi99p9vGRNIjwO
+8tZR9YfYmcARIF0PKf1b4q7ZHNkhVm38hNBf7RAVHBgh58Q9S9fQnmqVzyLJA3ue
+42AB/C8CgYAR0EvPG2e5nxB1R4ZlrjHCxjCsWQZQ2Q+1cAb38NPIYnyo2m72IT/T
+f1/qiqs/2Spe81HSwjA34y2jdQ0eTSE01VdwXIm/cuxKbmjVzRh0M06MOkWP5pZA
+62P5GYY6Ud2JS7Dz+Z9dKJU4vjWrylznk1M0oUVdEzllQkahn831vw==
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/client-keyEnc.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/client-keyEnc.pem
new file mode 100644 (file)
index 0000000..0097c07
--- /dev/null
@@ -0,0 +1,12 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,BDE979D13CCC0ABD
+
+N7yz2JV13EmQ7MZPL5wamid5+G1V1gp8FKqMemAC5JDxonS/W9oViMLUcxbfPTDx
+FznKdYSVTIQ7vv3ofmDG4MEyV/2C568N2kdtAw+jTfrZFN+IU9CI+W+In/nacirF
+02sAcvDMofustnooKNOO7/iyb5+3vRvEt5vSSRQn5WuSQ9sUKjuzoLs/lbf7fyAt
+4NeqfI3rYBZXxiUOLITOGXzGNRuFoY+o2uDCfelLAJ8uhiVG6ME3LeJEo1dT5lZ8
+CSJOLPasKg0iG4V7olM4j9FvAfZr48RRsSfUen756Jo2HpI4bad8LKhFYIdNs2Au
+WwKLmjpo6QB9hBmRshR04rEXPdrgTqLBExCE08PyaGYnWU8ggWritCeBzDQFj/n4
+sI+NO0Mymuvg98e5RpO52lg3Xnqv9RIK3guLFOmI6aEHC0PS4WwOEQ==
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/cliCrl.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/cliCrl.pem
new file mode 100644 (file)
index 0000000..67a5713
--- /dev/null
@@ -0,0 +1,39 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: /C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com
+        Last Update: Aug 10 18:01:01 2012 GMT
+        Next Update: Dec  8 18:01:01 2012 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                62
+No Revoked Certificates.
+    Signature Algorithm: sha1WithRSAEncryption
+        1e:69:b2:c4:72:a7:b2:c9:e1:b9:ac:06:40:2c:c5:66:9a:07:
+        6c:91:2e:17:09:c7:86:b4:62:2d:0f:1f:a3:a3:1c:93:ce:45:
+        53:d5:57:94:a6:77:af:51:da:86:e4:1e:6f:57:c8:cc:5f:07:
+        8d:a5:db:bd:b3:f7:cf:e2:11:3c:e2:51:79:7e:b3:a9:47:f7:
+        c1:17:12:5b:7c:e5:c3:71:17:d2:ce:59:d4:0d:dc:45:ff:bc:
+        fe:a7:76:7b:92:88:52:0c:a5:e0:79:75:86:50:27:15:2a:01:
+        66:a6:ba:96:d4:9a:14:1d:92:7d:63:72:5f:25:9b:05:72:cb:
+        ed:6d:7c:92:1f:4f:3e:64:cb:5d:80:9e:ad:c8:47:83:88:5b:
+        3d:07:3f:d3:6a:2c:dd:c9:f7:09:bb:05:2f:9a:f4:73:15:f4:
+        61:b1:47:87:9c:bf:c9:61:42:19:14:b8:67:9c:c5:c1:86:f1:
+        e8:63:71:40:6c:2f:b1:c1:0c:1f:f4:c4:80:e2:d0:cb:88:6b:
+        51:1e:e9:b0:06:19:7c:6d:85:cf:05:7f:fe:3d:35:79:9e:f0:
+        5b:f4:06:63:d4:eb:d2:e2:70:29:a9:02:b4:c1:b4:bd:53:f4:
+        8f:b3:df:37:91:44:d5:e8:c4:10:86:76:0e:49:2b:ba:9a:a4:
+        dd:33:0e:7e
+-----BEGIN X509 CRL-----
+MIIB6DCB0QIBATANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxDzANBgNV
+BAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
+EgYDVQQLEwtQcm9ncmFtbWluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
+CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20XDTEyMDgxMDE4MDEwMVoXDTEyMTIw
+ODE4MDEwMVqgDjAMMAoGA1UdFAQDAgE+MA0GCSqGSIb3DQEBBQUAA4IBAQAeabLE
+cqeyyeG5rAZALMVmmgdskS4XCceGtGItDx+joxyTzkVT1VeUpnevUdqG5B5vV8jM
+XweNpdu9s/fP4hE84lF5frOpR/fBFxJbfOXDcRfSzlnUDdxF/7z+p3Z7kohSDKXg
+eXWGUCcVKgFmprqW1JoUHZJ9Y3JfJZsFcsvtbXySH08+ZMtdgJ6tyEeDiFs9Bz/T
+aizdyfcJuwUvmvRzFfRhsUeHnL/JYUIZFLhnnMXBhvHoY3FAbC+xwQwf9MSA4tDL
+iGtRHumwBhl8bYXPBX/+PTV5nvBb9AZj1OvS4nApqQK0wbS9U/SPs983kUTV6MQQ
+hnYOSSu6mqTdMw5+
+-----END X509 CRL-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.pem
new file mode 100644 (file)
index 0000000..b68ff3f
--- /dev/null
@@ -0,0 +1,39 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+        Last Update: Aug 10 18:01:01 2012 GMT
+        Next Update: Dec  8 18:01:01 2012 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                60
+No Revoked Certificates.
+    Signature Algorithm: sha1WithRSAEncryption
+        26:1c:06:6a:42:ff:8b:18:71:4e:ef:7c:02:74:43:6f:7b:83:
+        99:2f:e1:4e:74:0f:f9:99:62:a1:90:88:11:1b:d8:59:3b:1e:
+        34:dd:f4:92:81:6f:49:2c:9a:5f:ba:21:6f:11:95:19:6e:da:
+        38:a4:4e:a0:7e:4a:fb:7c:c6:9f:c8:26:2d:9b:cd:e8:30:14:
+        10:38:56:63:89:bf:a7:eb:11:0f:7c:81:60:d7:c3:ab:07:ef:
+        6c:af:81:4d:b9:cd:6e:91:c6:42:13:01:d8:1a:62:cb:52:fd:
+        44:0b:fa:9f:34:de:75:ba:5a:3d:df:d4:b1:7e:a0:b9:3f:f5:
+        ed:a3:e6:ef:ef:20:95:45:3c:75:8c:a8:5c:ae:8c:e9:3c:f1:
+        e6:34:fd:65:bb:9a:f9:5f:8c:96:7c:32:12:50:43:2b:30:94:
+        4e:8a:f0:c3:5e:c9:e2:49:08:83:64:7a:3b:f3:d5:30:f3:78:
+        4b:20:3c:51:d0:da:37:14:f4:c8:f2:ab:41:d2:c3:b9:7a:7f:
+        42:17:42:79:a4:10:67:4e:84:d4:e9:a9:e8:dd:46:5d:b2:f4:
+        e8:3d:1c:24:3c:81:e7:56:bb:43:11:e2:d9:a2:9d:ce:b5:78:
+        ad:19:14:7c:d7:37:e8:bf:f7:30:fc:4d:05:a9:33:6b:12:9f:
+        24:19:39:35
+-----BEGIN X509 CRL-----
+MIIB6jCB0wIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
+BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
+MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
+GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIx
+MjA4MTgwMTAxWqAOMAwwCgYDVR0UBAMCATwwDQYJKoZIhvcNAQEFBQADggEBACYc
+BmpC/4sYcU7vfAJ0Q297g5kv4U50D/mZYqGQiBEb2Fk7HjTd9JKBb0ksml+6IW8R
+lRlu2jikTqB+Svt8xp/IJi2bzegwFBA4VmOJv6frEQ98gWDXw6sH72yvgU25zW6R
+xkITAdgaYstS/UQL+p803nW6Wj3f1LF+oLk/9e2j5u/vIJVFPHWMqFyujOk88eY0
+/WW7mvlfjJZ8MhJQQyswlE6K8MNeyeJJCINkejvz1TDzeEsgPFHQ2jcU9Mjyq0HS
+w7l6f0IXQnmkEGdOhNTpqejdRl2y9Og9HCQ8gedWu0MR4tminc61eK0ZFHzXN+i/
+9zD8TQWpM2sSnyQZOTU=
+-----END X509 CRL-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.revoked b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/crl.revoked
new file mode 100644 (file)
index 0000000..cf6ec55
--- /dev/null
@@ -0,0 +1,41 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: /C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+        Last Update: Aug 10 18:01:01 2012 GMT
+        Next Update: Dec  8 18:01:01 2012 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                61
+Revoked Certificates:
+    Serial Number: 02
+        Revocation Date: Aug 10 18:01:01 2012 GMT
+    Signature Algorithm: sha1WithRSAEncryption
+        5c:eb:53:33:02:74:bb:c1:37:37:81:1a:36:9c:eb:d0:28:87:
+        12:56:1a:d8:ec:ae:8e:ef:42:d0:61:07:f0:f0:b5:e8:2a:16:
+        5e:78:ab:e9:ad:62:f3:6c:c5:fe:7a:b5:c7:0e:8a:e3:0a:2d:
+        63:b5:ec:c4:c1:1f:1e:c3:77:b7:24:10:4b:09:b1:d8:ea:40:
+        4f:74:6a:9a:d7:57:bd:b9:d3:e2:42:81:81:b2:5c:42:d8:d3:
+        21:3f:f2:05:e2:11:8f:ce:60:cc:3b:76:55:e6:5f:6d:71:13:
+        b1:7e:2c:50:d2:29:fe:f2:ad:96:f9:ee:8f:5c:c3:0a:73:e7:
+        78:c5:8f:6e:0d:35:66:64:4a:76:05:93:9f:eb:05:b2:c3:a1:
+        f5:d5:4c:4b:6e:79:f2:8d:51:90:7c:9d:a9:f5:94:7f:93:fe:
+        39:da:c1:fb:8c:94:66:1d:d4:40:a9:48:ee:3b:91:14:83:4e:
+        b4:ea:93:07:f6:be:48:4a:ec:4c:26:61:2d:a2:66:01:c5:d8:
+        d3:18:f6:d0:1b:d2:94:13:c9:94:84:54:e4:44:10:01:66:25:
+        47:ee:b2:19:4a:65:e3:79:42:9e:12:af:a7:4a:a4:66:35:e3:
+        1a:db:2c:80:ff:a4:9c:2e:6e:32:8e:50:5d:ec:7e:de:1a:01:
+        a9:08:fc:a2
+-----BEGIN X509 CRL-----
+MIICADCB6QIBATANBgkqhkiG9w0BAQUFADCBkDELMAkGA1UEBhMCVVMxEDAOBgNV
+BAgTB01vbnRhbmExEDAOBgNVBAcTB0JvemVtYW4xETAPBgNVBAoTCFNhd3Rvb3Ro
+MRMwEQYDVQQLEwpDb25zdWx0aW5nMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
+GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIx
+MjA4MTgwMTAxWjAUMBICAQIXDTEyMDgxMDE4MDEwMVqgDjAMMAoGA1UdFAQDAgE9
+MA0GCSqGSIb3DQEBBQUAA4IBAQBc61MzAnS7wTc3gRo2nOvQKIcSVhrY7K6O70LQ
+YQfw8LXoKhZeeKvprWLzbMX+erXHDorjCi1jtezEwR8ew3e3JBBLCbHY6kBPdGqa
+11e9udPiQoGBslxC2NMhP/IF4hGPzmDMO3ZV5l9tcROxfixQ0in+8q2W+e6PXMMK
+c+d4xY9uDTVmZEp2BZOf6wWyw6H11UxLbnnyjVGQfJ2p9ZR/k/452sH7jJRmHdRA
+qUjuO5EUg0606pMH9r5ISuxMJmEtomYBxdjTGPbQG9KUE8mUhFTkRBABZiVH7rIZ
+SmXjeUKeEq+nSqRmNeMa2yyA/6ScLm4yjlBd7H7eGgGpCPyi
+-----END X509 CRL-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccCliCRL.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccCliCRL.pem
new file mode 100644 (file)
index 0000000..a407948
--- /dev/null
@@ -0,0 +1,24 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: ecdsa-with-SHA1
+        Issuer: /C=US/ST=Oregon/L=Salem/O=Client ECC/OU=Fast/CN=www.yassl.com/emailAddress=info@yassl.com
+        Last Update: Aug 10 18:01:01 2012 GMT
+        Next Update: Dec  8 18:01:01 2012 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                63
+No Revoked Certificates.
+    Signature Algorithm: ecdsa-with-SHA1
+        30:44:02:20:7f:8d:d7:28:61:96:4c:b7:a8:17:0a:7f:9d:cf:
+        fa:29:e1:1d:cb:30:61:1b:b3:6b:f0:61:68:15:25:76:62:32:
+        02:20:55:ca:fc:37:b4:4c:f9:78:99:b3:c9:d4:1a:e1:fa:f7:
+        8a:4a:94:ce:31:ed:b0:1f:dc:64:d7:2a:59:47:b9:2d
+-----BEGIN X509 CRL-----
+MIIBHzCByAIBATAJBgcqhkjOPQQBMIGJMQswCQYDVQQGEwJVUzEPMA0GA1UECBMG
+T3JlZ29uMQ4wDAYDVQQHEwVTYWxlbTETMBEGA1UEChMKQ2xpZW50IEVDQzENMAsG
+A1UECxMERmFzdDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJ
+ARYOaW5mb0B5YXNzbC5jb20XDTEyMDgxMDE4MDEwMVoXDTEyMTIwODE4MDEwMVqg
+DjAMMAoGA1UdFAQDAgE/MAkGByqGSM49BAEDRwAwRAIgf43XKGGWTLeoFwp/nc/6
+KeEdyzBhG7Nr8GFoFSV2YjICIFXK/De0TPl4mbPJ1Brh+veKSpTOMe2wH9xk1ypZ
+R7kt
+-----END X509 CRL-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccSrvCRL.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/eccSrvCRL.pem
new file mode 100644 (file)
index 0000000..16d8b56
--- /dev/null
@@ -0,0 +1,24 @@
+Certificate Revocation List (CRL):
+        Version 2 (0x1)
+        Signature Algorithm: ecdsa-with-SHA1
+        Issuer: /C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
+        Last Update: Aug 10 18:01:01 2012 GMT
+        Next Update: Dec  8 18:01:01 2012 GMT
+        CRL extensions:
+            X509v3 CRL Number: 
+                64
+No Revoked Certificates.
+    Signature Algorithm: ecdsa-with-SHA1
+        30:44:02:20:59:42:06:a7:73:69:03:08:05:e8:4b:95:ca:cf:
+        f1:30:9e:84:4b:3c:52:c8:10:b9:c8:36:c8:07:64:65:fd:bf:
+        02:20:71:60:a7:35:d6:8c:52:c2:df:06:dc:40:52:c5:ef:4c:
+        8b:ec:96:4b:72:b0:c4:36:3e:c8:9d:62:5e:49:f2:5f
+-----BEGIN X509 CRL-----
+MIIBITCBygIBATAJBgcqhkjOPQQBMIGLMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
+V2FzaGluZ3RvbjEQMA4GA1UEBxMHU2VhdHRsZTEQMA4GA1UEChMHRWxpcHRpYzEM
+MAoGA1UECxMDRUNDMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
+AQkBFg5pbmZvQHlhc3NsLmNvbRcNMTIwODEwMTgwMTAxWhcNMTIxMjA4MTgwMTAx
+WqAOMAwwCgYDVR0UBAMCAUAwCQYHKoZIzj0EAQNHADBEAiBZQganc2kDCAXoS5XK
+z/EwnoRLPFLIELnINsgHZGX9vwIgcWCnNdaMUsLfBtxAUsXvTIvslktysMQ2Psid
+Yl5J8l8=
+-----END X509 CRL-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/crl/include.am b/FreeRTOS-Plus/Source/CyaSSL/certs/crl/include.am
new file mode 100644 (file)
index 0000000..7adca32
--- /dev/null
@@ -0,0 +1,14 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+EXTRA_DIST += \
+            certs/crl/crl.pem \
+            certs/crl/cliCrl.pem \
+            certs/crl/eccSrvCRL.pem \
+            certs/crl/eccCliCRL.pem
+
+EXTRA_DIST += \
+            certs/crl/crl.revoked
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.der b/FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.der
new file mode 100644 (file)
index 0000000..afdc522
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/dh2048.pem
new file mode 100644 (file)
index 0000000..1e2b848
--- /dev/null
@@ -0,0 +1,29 @@
+Diffie-Hellman-Parameters: (2048 bit)
+    prime:
+        00:b0:a1:08:06:9c:08:13:ba:59:06:3c:bc:30:d5:
+        f5:00:c1:4f:44:a7:d6:ef:4a:c6:25:27:1c:e8:d2:
+        96:53:0a:5c:91:dd:a2:c2:94:84:bf:7d:b2:44:9f:
+        9b:d2:c1:8a:c5:be:72:5c:a7:e7:91:e6:d4:9f:73:
+        07:85:5b:66:48:c7:70:fa:b4:ee:02:c9:3d:9a:4a:
+        da:3d:c1:46:3e:19:69:d1:17:46:07:a3:4d:9f:2b:
+        96:17:39:6d:30:8d:2a:f3:94:d3:75:cf:a0:75:e6:
+        f2:92:1f:1a:70:05:aa:04:83:57:30:fb:da:76:93:
+        38:50:e8:27:fd:63:ee:3c:e5:b7:c8:09:ae:6f:50:
+        35:8e:84:ce:4a:00:e9:12:7e:5a:31:d7:33:fc:21:
+        13:76:cc:16:30:db:0c:fc:c5:62:a7:35:b8:ef:b7:
+        b0:ac:c0:36:f6:d9:c9:46:48:f9:40:90:00:2b:1b:
+        aa:6c:e3:1a:c3:0b:03:9e:1b:c2:46:e4:48:4e:22:
+        73:6f:c3:5f:d4:9a:d6:30:07:48:d6:8c:90:ab:d4:
+        f6:f1:e3:48:d3:58:4b:a6:b9:cd:29:bf:68:1f:08:
+        4b:63:86:2f:5c:6b:d6:b6:06:65:f7:a6:dc:00:67:
+        6b:bb:c3:a9:41:83:fb:c7:fa:c8:e2:1e:7e:af:00:
+        3f:93
+    generator: 2 (0x2)
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEAsKEIBpwIE7pZBjy8MNX1AMFPRKfW70rGJScc6NKWUwpckd2iwpSE
+v32yRJ+b0sGKxb5yXKfnkebUn3MHhVtmSMdw+rTuAsk9mkraPcFGPhlp0RdGB6NN
+nyuWFzltMI0q85TTdc+gdebykh8acAWqBINXMPvadpM4UOgn/WPuPOW3yAmub1A1
+joTOSgDpEn5aMdcz/CETdswWMNsM/MVipzW477ewrMA29tnJRkj5QJAAKxuqbOMa
+wwsDnhvCRuRITiJzb8Nf1JrWMAdI1oyQq9T28eNI01hLprnNKb9oHwhLY4YvXGvW
+tgZl96bcAGdru8OpQYP7x/rI4h5+rwA/kwIBAg==
+-----END DH PARAMETERS-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/dsa2048.der b/FreeRTOS-Plus/Source/CyaSSL/certs/dsa2048.der
new file mode 100644 (file)
index 0000000..0bcb0b4
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/dsa2048.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-client-key.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-client-key.pem
new file mode 100644 (file)
index 0000000..cf9812d
--- /dev/null
@@ -0,0 +1,9 @@
+ASN1 OID: prime256v1
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIPjPkmu9HijxqKuhI08ydBiIUK1+x+yS+I+XTa9WiWXHoAoGCCqGSM49
+AwEHoUQDQgAEVb/0D0RQmj3Om7fwxU31cHvU7CSOGYDsWkyiJANiLJva76I1EkOE
+dhbGVpUGzAGpvfZ1GkL3vamyNiJfx11/tA==
+-----END EC PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.der b/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.der
new file mode 100644 (file)
index 0000000..a88d141
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-key.pem
new file mode 100644 (file)
index 0000000..03e7a61
--- /dev/null
@@ -0,0 +1,9 @@
+ASN1 OID: prime256v1
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIEW2aQJznGyFoThbcujox6zEA41TNQT6bCjcNI3hqAmMoAoGCCqGSM49
+AwEHoUQDQgAEuzOsTCdQSsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKT
+mjFbl5Ihf/DPGNqREQI0huggWDMLgDSJ2A==
+-----END EC PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-keyPkcs8.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ecc-keyPkcs8.pem
new file mode 100644 (file)
index 0000000..ca03d98
--- /dev/null
@@ -0,0 +1,5 @@
+-----BEGIN PRIVATE KEY-----
+MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgRbZpAnOcbIWhOFty
+6OjHrMQDjVM1BPpsKNw0jeGoCYyhRANCAAS7M6xMJ1BKxkqlBMM83p8223ItzpTq
+K/rLIAk5LBboYQLpr03TApOaMVuXkiF/8M8Y2pERAjSG6CBYMwuANInY
+-----END PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/include.am b/FreeRTOS-Plus/Source/CyaSSL/certs/include.am
new file mode 100644 (file)
index 0000000..fcedd00
--- /dev/null
@@ -0,0 +1,40 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+EXTRA_DIST += \
+            certs/ca-cert.pem \
+            certs/ca-key.pem \
+            certs/client-cert.pem \
+            certs/client-keyEnc.pem \
+            certs/client-key.pem \
+            certs/ecc-key.pem \
+            certs/ecc-keyPkcs8.pem \
+            certs/ecc-client-key.pem \
+            certs/client-ecc-cert.pem \
+            certs/ntru-cert.pem \
+            certs/dh2048.pem \
+            certs/server-cert.pem \
+            certs/server-ecc.pem \
+            certs/server-ecc-rsa.pem \
+            certs/server-keyEnc.pem \
+            certs/server-key.pem \
+            certs/server-keyPkcs8Enc12.pem \
+            certs/server-keyPkcs8Enc2.pem \
+            certs/server-keyPkcs8Enc.pem \
+            certs/server-keyPkcs8.pem
+
+EXTRA_DIST += \
+            certs/ca-key.der \
+            certs/client-cert.der \
+            certs/client-key.der \
+            certs/dh2048.der \
+            certs/rsa2048.der \
+            certs/dsa2048.der \
+            certs/ecc-key.der
+
+
+doc_DATA+= certs/taoCert.txt
+
+EXTRA_DIST+= certs/ntru-key.raw
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ntru-cert.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/ntru-cert.pem
new file mode 100644 (file)
index 0000000..aa06dfb
--- /dev/null
@@ -0,0 +1,28 @@
+-----BEGIN CERTIFICATE-----
+MIIEyTCCA7GgAwIBAgIIASZ+ezr7rN0wDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNV
+BAYTAlVTMRAwDgYDVQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYD
+VQQKEwhTYXd0b290aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3
+Lnlhc3NsLmNvbTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wIhgPMjAx
+MTEyMDUwMDE2MzdaGA8yMDEzMDQxOTAxMTYzN1owgYoxCzAJBgNVBAYTAlVTMQsw
+CQYDVQQIEwJPUjERMA8GA1UEBxMIUG9ydGxhbmQxDjAMBgNVBAoTBXlhU1NMMRQw
+EgYDVQQLEwtEZXZlbG9wbWVudDEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEdMBsG
+CSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggJLMBgGCisGAQQBwXABAQIGCisG
+AQQBwXABAi4DggItAASCAihFDRAy0fOBZth/IRQFJeuEUgrViJfGvKOUuNW6yYmn
+9/YXT2I3/aiBZ/udSehoEFVPNgLs/ZWwNrsIuETH5TPkS1e9Ig4I5G839deKT89M
+Qpq7GiKLwlLY3He/a6O+/UMEFH4ShdhDopsH2+IsWCX0H7Lvp8L8RqURrQNFXvlr
+xRAFiBixEQNry2HyEcVz/9TQSdifE4KGUtneErqsk1/Sms1m1/NqW30H77YerJfs
+QWsOEgasoJnYWS6knJC4XsUbJKqKcHRc6XeODOyf72J3ESvES2C+cqEsShxVP7zG
+hDiHurwfyvIAUL4bZSBtlAqt60iOEsXScXwdbNrj+4iuFAyjX8+JrxGMbDNi3X5l
+L2RLUiEIKUSGUozbDlR3jU2WoHUm76mZwjGe1+vOKpvqh5yrRoyqiDERj8wsGrDO
+MdoheW1xSjQ3p5fQ/UOtagWA5Lh/MqbCIHdMzMLpbOmfhFJA5BXaNg/qThhjpmvf
+csYfwWCWukKKbjfY7cxOVMuUN0VvoYBjOxt5UQhXuPjH/+5s4J7E/IxQrWz6fhcG
+wfvJjWJjedfhP23Jm4zodbwtU6MgPF641DcAwcnBqSi/Ugi7d0YeHMqTJkSnIJZV
+r3v1YLuqiFDzB6bx69DGpCxFMxIpdOPq4a9WpeQQ9H7cBK0HFl4tRPNnQ2XCrKMc
+86gQ35aaM2vPvgj0d/zgC0AG8WFQEG1wYBvLEgfiQsi7auXoScYZA8AwDQYJKoZI
+hvcNAQEFBQADggEBAJ7eyiJIGiyyrhAdaYOit3U3CUkGSatNXTkn8PRO8SwzPWCi
+FQ+4AePYV+/ovtNZiqLwm7mVa3s2CS8LCk2s9/ld22cDJNV+gDkzrelUyTLUi0jr
+zZJwEiaNXIEkYrLGifSzoNUgQBTzDmOSkm2UpIX70GTsXF73FKdqonf1VTnopVKa
+XZDpIG3/TKyh8jCwowMrkxnHS886FhXiHGCBzM1rnp3S+r3b+rTqoKoeuZQnDgJP
+IZwnZL6agtwbUfmZj6/868irlsLtC9M5nKBtj/U/tQIrW52XEhBqChmTXIq0JNL1
+++kWLLeu9t0T53Pth3VxMT/ePV0aURQvjINm60o=
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/ntru-key.raw b/FreeRTOS-Plus/Source/CyaSSL/certs/ntru-key.raw
new file mode 100644 (file)
index 0000000..69c6c23
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/ntru-key.raw differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/rsa2048.der b/FreeRTOS-Plus/Source/CyaSSL/certs/rsa2048.der
new file mode 100644 (file)
index 0000000..837095b
Binary files /dev/null and b/FreeRTOS-Plus/Source/CyaSSL/certs/rsa2048.der differ
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-cert.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-cert.pem
new file mode 100644 (file)
index 0000000..8381265
--- /dev/null
@@ -0,0 +1,158 @@
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 2 (0x2)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:27:13 2011 GMT
+            Not After : Jul 20 18:27:13 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=yaSSL, OU=Support, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:c0:95:08:e1:57:41:f2:71:6d:b7:d2:45:41:27:
+                    01:65:c6:45:ae:f2:bc:24:30:b8:95:ce:2f:4e:d6:
+                    f6:1c:88:bc:7c:9f:fb:a8:67:7f:fe:5c:9c:51:75:
+                    f7:8a:ca:07:e7:35:2f:8f:e1:bd:7b:c0:2f:7c:ab:
+                    64:a8:17:fc:ca:5d:7b:ba:e0:21:e5:72:2e:6f:2e:
+                    86:d8:95:73:da:ac:1b:53:b9:5f:3f:d7:19:0d:25:
+                    4f:e1:63:63:51:8b:0b:64:3f:ad:43:b8:a5:1c:5c:
+                    34:b3:ae:00:a0:63:c5:f6:7f:0b:59:68:78:73:a6:
+                    8c:18:a9:02:6d:af:c3:19:01:2e:b8:10:e3:c6:cc:
+                    40:b4:69:a3:46:33:69:87:6e:c4:bb:17:a6:f3:e8:
+                    dd:ad:73:bc:7b:2f:21:b5:fd:66:51:0c:bd:54:b3:
+                    e1:6d:5f:1c:bc:23:73:d1:09:03:89:14:d2:10:b9:
+                    64:c3:2a:d0:a1:96:4a:bc:e1:d4:1a:5b:c7:a0:c0:
+                    c1:63:78:0f:44:37:30:32:96:80:32:23:95:a1:77:
+                    ba:13:d2:97:73:e2:5d:25:c9:6a:0d:c3:39:60:a4:
+                    b4:b0:69:42:42:09:e9:d8:08:bc:33:20:b3:58:22:
+                    a7:aa:eb:c4:e1:e6:61:83:c5:d2:96:df:d9:d0:4f:
+                    ad:d7
+                Exponent: 65537 (0x10001)
+    Signature Algorithm: sha1WithRSAEncryption
+        71:4e:d3:62:df:cc:4c:f7:cd:b7:6e:52:0b:6c:6e:e0:bd:c2:
+        2d:07:d7:c0:b0:6e:43:1e:35:bc:30:01:50:f0:ff:99:23:6c:
+        18:1a:41:b6:11:d6:d4:19:61:fd:e4:77:97:1c:39:e1:57:ab:
+        c5:15:63:77:11:36:5e:74:e2:24:0b:1f:41:78:ad:b7:81:e7:
+        b4:40:66:80:f0:4b:91:a0:6d:a8:6e:3d:53:d9:8b:ce:2a:e1:
+        0b:45:65:87:a1:96:ae:ee:3e:88:d5:12:1f:78:17:ae:2c:c5:
+        73:44:d8:dc:f4:af:d8:cc:ae:4c:e1:0c:be:55:a4:99:f7:6e:
+        96:c0:c8:45:87:bf:dc:51:57:ff:9e:73:37:6a:18:9c:c3:f9:
+        22:7a:f4:b0:52:bd:fc:21:30:f8:c5:ff:1e:87:7d:ad:a2:5a:
+        35:f5:22:a8:b4:0a:76:38:e6:76:b0:98:af:1b:ec:8a:0a:43:
+        74:d2:85:34:37:84:07:e1:f6:23:b2:29:de:a6:b6:b7:4c:57:
+        7e:96:06:cb:a9:16:25:29:3a:03:2d:55:7d:a6:8c:a4:f7:9e:
+        81:c9:95:b6:7c:c1:4a:ce:94:66:0c:ca:88:eb:d2:09:f5:5b:
+        19:58:82:df:27:fd:67:95:78:b7:02:06:d5:a7:61:bd:ef:3a:
+        fc:b2:61:cd
+-----BEGIN CERTIFICATE-----
+MIIDkDCCAngCAQIwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTExMDI0MTgyNzEzWhcN
+MTQwNzIwMTgyNzEzWjCBijELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB01vbnRhbmEx
+EDAOBgNVBAcTB0JvemVtYW4xDjAMBgNVBAoTBXlhU1NMMRAwDgYDVQQLEwdTdXBw
+b3J0MRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZv
+QHlhc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMCVCOFX
+QfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hnf/5cnFF194rKB+c1L4/h
+vXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/XGQ0lT+FjY1GLC2Q/rUO4
+pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bMQLRpo0YzaYduxLsXpvPo
+3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq0KGWSrzh1Bpbx6DAwWN4
+D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ6dgIvDMgs1gip6rrxOHm
+YYPF0pbf2dBPrdcCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAcU7TYt/MTPfNt25S
+C2xu4L3CLQfXwLBuQx41vDABUPD/mSNsGBpBthHW1Blh/eR3lxw54VerxRVjdxE2
+XnTiJAsfQXitt4HntEBmgPBLkaBtqG49U9mLzirhC0Vlh6GWru4+iNUSH3gXrizF
+c0TY3PSv2MyuTOEMvlWkmfdulsDIRYe/3FFX/55zN2oYnMP5Inr0sFK9/CEw+MX/
+Hod9raJaNfUiqLQKdjjmdrCYrxvsigpDdNKFNDeEB+H2I7Ip3qa2t0xXfpYGy6kW
+JSk6Ay1VfaaMpPeegcmVtnzBSs6UZgzKiOvSCfVbGViC3yf9Z5V4twIG1adhve86
+/LJhzQ==
+-----END CERTIFICATE-----
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            e9:d0:a7:5f:79:25:f4:3c
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Oct 24 18:18:15 2011 GMT
+            Not After : Jul 20 18:18:15 2014 GMT
+        Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: rsaEncryption
+            RSA Public Key: (2048 bit)
+                Modulus (2048 bit):
+                    00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
+                    f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
+                    de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
+                    21:4d:80:cb:12:20:e7:cc:4f:de:45:7d:c9:72:77:
+                    32:ea:ca:90:bb:69:52:10:03:2f:a8:f3:95:c5:f1:
+                    8b:62:56:1b:ef:67:6f:a4:10:41:95:ad:0a:9b:e3:
+                    a5:c0:b0:d2:70:76:50:30:5b:a8:e8:08:2c:7c:ed:
+                    a7:a2:7a:8d:38:29:1c:ac:c7:ed:f2:7c:95:b0:95:
+                    82:7d:49:5c:38:cd:77:25:ef:bd:80:75:53:94:3c:
+                    3d:ca:63:5b:9f:15:b5:d3:1d:13:2f:19:d1:3c:db:
+                    76:3a:cc:b8:7d:c9:e5:c2:d7:da:40:6f:d8:21:dc:
+                    73:1b:42:2d:53:9c:fe:1a:fc:7d:ab:7a:36:3f:98:
+                    de:84:7c:05:67:ce:6a:14:38:87:a9:f1:8c:b5:68:
+                    cb:68:7f:71:20:2b:f5:a0:63:f5:56:2f:a3:26:d2:
+                    b7:6f:b1:5a:17:d7:38:99:08:fe:93:58:6f:fe:c3:
+                    13:49:08:16:0b:a7:4d:67:00:52:31:67:23:4e:98:
+                    ed:51:45:1d:b9:04:d9:0b:ec:d8:28:b3:4b:bd:ed:
+                    36:79
+                Exponent: 65537 (0x10001)
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+            X509v3 Authority Key Identifier: 
+                keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
+                DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:E9:D0:A7:5F:79:25:F4:3C
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: sha1WithRSAEncryption
+        5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26:
+        4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6:
+        e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c:
+        f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e:
+        af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18:
+        98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02:
+        8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab:
+        1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80:
+        61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87:
+        1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f:
+        60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf:
+        18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12:
+        f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4:
+        b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70:
+        5a:1f:7f:ca
+-----BEGIN CERTIFICATE-----
+MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD
+VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G
+A1UEChMIU2F3dG9vdGgxEzARBgNVBAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3
+dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTEx
+MTAyNDE4MTgxNVoXDTE0MDcyMDE4MTgxNVowgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDxtjWf38p9A5jTrN4DZu4q
+8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQAy+o85XF8YtiVhvvZ2+k
+EEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3yfJWwlYJ9SVw4zXcl772A
+dVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh3HMbQi1TnP4a/H2rejY/
+mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdvsVoX1ziZCP6TWG/+wxNJ
+CBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMBAAGjgfgwgfUwHQYDVR0O
+BBYEFCeOZxF0wyYdP+0zY7Ok2B0w5ejVMIHFBgNVHSMEgb0wgbqAFCeOZxF0wyYd
+P+0zY7Ok2B0w5ejVoYGWpIGTMIGQMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHTW9u
+dGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8GA1UEChMIU2F3dG9vdGgxEzARBgNV
+BAsTCkNvbnN1bHRpbmcxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG
+9w0BCQEWDmluZm9AeWFzc2wuY29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513
+PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH
+Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr
+G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m
+ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi
+rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc-rsa.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc-rsa.pem
new file mode 100644 (file)
index 0000000..5f25d9d
--- /dev/null
@@ -0,0 +1,54 @@
+Certificate:
+    Data:
+        Version: 1 (0x0)
+        Serial Number: 9 (0x9)
+        Signature Algorithm: sha1WithRSAEncryption
+        Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Aug  8 21:58:29 2012 GMT
+            Not After : May  5 21:58:29 2015 GMT
+        Subject: C=US, ST=Washington, L=Seattle, O=Elliptic - RSAsig, OU=ECC-RSAsig, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: id-ecPublicKey
+            EC Public Key:
+                pub: 
+                    04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
+                    9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
+                    16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92:
+                    21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33:
+                    0b:80:34:89:d8
+                ASN1 OID: prime256v1
+    Signature Algorithm: sha1WithRSAEncryption
+        a0:1c:de:98:e8:61:c8:fb:0a:0e:af:ea:99:4b:c0:49:e6:66:
+        68:5e:7a:18:b8:0c:e3:0f:16:86:bc:b5:86:79:02:69:1c:b7:
+        e7:ff:53:d9:05:5d:27:39:24:54:67:14:de:ef:8e:c2:a0:11:
+        ca:c8:27:99:b9:d6:e9:71:1f:86:c9:8f:b1:74:a2:9f:93:6a:
+        0c:74:cf:17:77:8c:26:08:6e:a8:ac:69:d4:55:15:a2:95:87:
+        43:7a:ab:72:93:73:40:58:c2:bb:9c:89:f2:73:20:69:df:f1:
+        f3:65:08:9c:00:67:97:a6:71:00:2b:31:84:10:ac:bd:54:ac:
+        fd:b3:eb:12:36:77:f6:0a:e3:9a:96:d2:a6:22:bc:1d:6b:ce:
+        3c:0d:7b:d9:1c:1d:f1:ee:ec:ce:83:c8:98:c9:65:3e:06:31:
+        c3:b2:87:da:09:b4:90:0b:e2:6b:29:0e:d6:ae:53:1d:10:98:
+        e2:dc:f9:63:38:a1:a2:af:46:23:a4:4c:ab:0c:0b:08:be:cd:
+        a4:a6:6d:46:f0:f8:e0:31:99:85:39:10:4a:a0:04:54:3b:21:
+        e1:e9:b4:f3:a5:06:cd:37:ae:2c:ca:5d:ac:90:b5:ab:92:81:
+        aa:bf:2d:3f:8e:ee:4d:12:81:0a:8e:a4:ca:87:93:af:b0:25:
+        7e:e2:07:f7
+-----BEGIN CERTIFICATE-----
+MIIC1zCCAb8CAQkwDQYJKoZIhvcNAQEFBQAwgZAxCzAJBgNVBAYTAlVTMRAwDgYD
+VQQIEwdNb250YW5hMRAwDgYDVQQHEwdCb3plbWFuMREwDwYDVQQKEwhTYXd0b290
+aDETMBEGA1UECxMKQ29uc3VsdGluZzEWMBQGA1UEAxMNd3d3Lnlhc3NsLmNvbTEd
+MBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb20wHhcNMTIwODA4MjE1ODI5WhcN
+MTUwNTA1MjE1ODI5WjCBnDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
+b24xEDAOBgNVBAcTB1NlYXR0bGUxGjAYBgNVBAoTEUVsbGlwdGljIC0gUlNBc2ln
+MRMwEQYDVQQLEwpFQ0MtUlNBc2lnMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0w
+GwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49
+AwEHA0IABLszrEwnUErGSqUEwzzenzbbci3OlOor+ssgCTksFuhhAumvTdMCk5ox
+W5eSIX/wzxjakRECNIboIFgzC4A0idgwDQYJKoZIhvcNAQEFBQADggEBAKAc3pjo
+Ycj7Cg6v6plLwEnmZmheehi4DOMPFoa8tYZ5Amkct+f/U9kFXSc5JFRnFN7vjsKg
+EcrIJ5m51ulxH4bJj7F0op+Tagx0zxd3jCYIbqisadRVFaKVh0N6q3KTc0BYwruc
+ifJzIGnf8fNlCJwAZ5emcQArMYQQrL1UrP2z6xI2d/YK45qW0qYivB1rzjwNe9kc
+HfHu7M6DyJjJZT4GMcOyh9oJtJAL4mspDtauUx0QmOLc+WM4oaKvRiOkTKsMCwi+
+zaSmbUbw+OAxmYU5EEqgBFQ7IeHptPOlBs03rizKXayQtauSgaq/LT+O7k0SgQqO
+pMqHk6+wJX7iB/c=
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-ecc.pem
new file mode 100644 (file)
index 0000000..a12207f
--- /dev/null
@@ -0,0 +1,55 @@
+Certificate:
+    Data:
+        Version: 3 (0x2)
+        Serial Number:
+            f4:cc:72:08:11:35:69:b3
+        Signature Algorithm: ecdsa-with-SHA1
+        Issuer: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
+        Validity
+            Not Before: Jan 25 20:09:20 2011 GMT
+            Not After : Oct 21 20:09:20 2013 GMT
+        Subject: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.yassl.com/emailAddress=info@yassl.com
+        Subject Public Key Info:
+            Public Key Algorithm: id-ecPublicKey
+            EC Public Key:
+                pub: 
+                    04:bb:33:ac:4c:27:50:4a:c6:4a:a5:04:c3:3c:de:
+                    9f:36:db:72:2d:ce:94:ea:2b:fa:cb:20:09:39:2c:
+                    16:e8:61:02:e9:af:4d:d3:02:93:9a:31:5b:97:92:
+                    21:7f:f0:cf:18:da:91:11:02:34:86:e8:20:58:33:
+                    0b:80:34:89:d8
+                ASN1 OID: prime256v1
+        X509v3 extensions:
+            X509v3 Subject Key Identifier: 
+                5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
+            X509v3 Authority Key Identifier: 
+                keyid:5D:5D:26:EF:AC:7E:36:F9:9B:76:15:2B:4A:25:02:23:EF:B2:89:30
+                DirName:/C=US/ST=Washington/L=Seattle/O=Eliptic/OU=ECC/CN=www.yassl.com/emailAddress=info@yassl.com
+                serial:F4:CC:72:08:11:35:69:B3
+
+            X509v3 Basic Constraints: 
+                CA:TRUE
+    Signature Algorithm: ecdsa-with-SHA1
+        30:44:02:20:08:9b:66:9f:39:ef:49:2b:99:92:31:65:a1:87:
+        10:91:63:fe:69:e0:5f:b0:49:66:0a:71:41:fd:08:c0:8e:4c:
+        02:20:02:2a:60:37:e4:94:6b:3e:39:a8:6c:4f:07:75:2b:28:
+        b3:f5:9d:c2:26:c7:64:1b:a9:7f:6e:e9:2a:a3:5e:4e
+-----BEGIN CERTIFICATE-----
+MIIDADCCAqigAwIBAgIJAPTMcggRNWmzMAkGByqGSM49BAEwgYsxCzAJBgNVBAYT
+AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYD
+VQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5j
+b20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTExMDEyNTIwMDky
+MFoXDTEzMTAyMTIwMDkyMFowgYsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo
+aW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRAwDgYDVQQKEwdFbGlwdGljMQwwCgYD
+VQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEW
+DmluZm9AeWFzc2wuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuzOsTCdQ
+SsZKpQTDPN6fNttyLc6U6iv6yyAJOSwW6GEC6a9N0wKTmjFbl5Ihf/DPGNqREQI0
+huggWDMLgDSJ2KOB8zCB8DAdBgNVHQ4EFgQUXV0m76x+NvmbdhUrSiUCI++yiTAw
+gcAGA1UdIwSBuDCBtYAUXV0m76x+NvmbdhUrSiUCI++yiTChgZGkgY4wgYsxCzAJ
+BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxl
+MRAwDgYDVQQKEwdFbGlwdGljMQwwCgYDVQQLEwNFQ0MxFjAUBgNVBAMTDXd3dy55
+YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggkA9MxyCBE1
+abMwDAYDVR0TBAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCIAibZp8570krmZIxZaGH
+EJFj/mngX7BJZgpxQf0IwI5MAiACKmA35JRrPjmobE8HdSsos/WdwibHZBupf27p
+KqNeTg==
+-----END CERTIFICATE-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-key.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-key.pem
new file mode 100644 (file)
index 0000000..d1627f4
--- /dev/null
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAwJUI4VdB8nFtt9JFQScBZcZFrvK8JDC4lc4vTtb2HIi8fJ/7
+qGd//lycUXX3isoH5zUvj+G9e8AvfKtkqBf8yl17uuAh5XIuby6G2JVz2qwbU7lf
+P9cZDSVP4WNjUYsLZD+tQ7ilHFw0s64AoGPF9n8LWWh4c6aMGKkCba/DGQEuuBDj
+xsxAtGmjRjNph27Euxem8+jdrXO8ey8htf1mUQy9VLPhbV8cvCNz0QkDiRTSELlk
+wyrQoZZKvOHUGlvHoMDBY3gPRDcwMpaAMiOVoXe6E9KXc+JdJclqDcM5YKS0sGlC
+Qgnp2Ai8MyCzWCKnquvE4eZhg8XSlt/Z0E+t1wIDAQABAoIBAQCa0DQPUmIFUAHv
+n+1kbsLE2hryhNeSEEiSxOlq64t1bMZ5OPLJckqGZFSVd8vDmp231B2kAMieTuTd
+x7pnFsF0vKnWlI8rMBr77d8hBSPZSjm9mGtlmrjcxH3upkMVLj2+HSJgKnMw1T7Y
+oqyGQy7E9WReP4l1DxHYUSVOn9iqo85gs+KK2X4b8GTKmlsFC1uqy+XjP24yIgXz
+0PrvdFKB4l90073/MYNFdfpjepcu1rYZxpIm5CgGUFAOeC6peA0Ul7QS2DFAq6EB
+QcIw+AdfFuRhd9Jg8p+N6PS662PeKpeB70xs5lU0USsoNPRTHMRYCj+7r7X3SoVD
+LTzxWFiBAoGBAPIsVHY5I2PJEDK3k62vvhl1loFk5rW4iUJB0W3QHBv4G6xpyzY8
+ZH3c9Bm4w2CxV0hfUk9ZOlV/MsAZQ1A/rs5vF/MOn0DKTq0VO8l56cBZOHNwnAp8
+yTpIMqfYSXUKhcLC/RVz2pkJKmmanwpxv7AEpox6Wm9IWlQ7xrFTF9/nAoGBAMuT
+3ncVXbdcXHzYkKmYLdZpDmOzo9ymzItqpKISjI57SCyySzfcBhh96v52odSh6T8N
+zRtfr1+elltbD6F8r7ObkNtXczrtsCNErkFPHwdCEyNMy/r0FKTV9542fFufqDzB
+hV900jkt/9CE3/uzIHoumxeu5roLrl9TpFLtG8SRAoGBAOyY2rvV/vlSSn0CVUlv
+VW5SL4SjK7OGYrNU0mNS2uOIdqDvixWl0xgUcndex6MEH54ZYrUbG57D8rUy+UzB
+qusMJn3UX0pRXKRFBnBEp1bA1CIUdp7YY1CJkNPiv4GVkjFBhzkaQwsYpVMfORpf
+H0O8h2rfbtMiAP4imHBOGhkpAoGBAIpBVihRnl/Ungs7mKNU8mxW1KrpaTOFJAza
+1AwtxL9PAmk4fNTm3Ezt1xYRwz4A58MmwFEC3rt1nG9WnHrzju/PisUr0toGakTJ
+c/5umYf4W77xfOZltU9s8MnF/xbKixsX4lg9ojerAby/QM5TjI7t7+5ZneBj5nxe
+9Y5L8TvBAoGATUX5QIzFW/QqGoq08hysa+kMVja3TnKW1eWK0uL/8fEYEz2GCbjY
+dqfJHHFSlDBD4PF4dP1hG0wJzOZoKnGtHN9DvFbbpaS+NXCkXs9P/ABVmTo9I89n
+WvUi+LUp0EQR6zUuRr79jhiyX6i/GTKh9dwD5nyaHwx8qbAOITc78bA=
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyEnc.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyEnc.pem
new file mode 100644 (file)
index 0000000..e5ab57d
--- /dev/null
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-CBC,136C7D8A69656668
+
+jvNTyPaztxPIoAzbdmZnD0Zw2+60tMxNc0GMHNmeOyG25aHP/dT+TWiKFpFVkkkY
+uoCIhYUyw7gmpw+CnRJwWd+ans4nrvAjwy5oWJvarvsyUpjqvnPoIlAqd+d4TDKN
+eESzcI76+gHdisAtCrQD+fGqgTZhli5TgDbnpasL/QnY2qDlutvakkVw7gPXe156
+2Phy8WN+efr65J6wt3K/dj7Datl9u4JeHQK81gYyWBVX+EagEjPGDzkFQCj9Z0q7
+8K3iB5GW1JAqJS0IfZPB40AnSTF/n1TL1SN3qfU3l7hTGNrx9o7580bgDEoAR7pI
+F8eZlS15KHtZmh11AnU1KTKZ6kmgnNqeMTGMN6N0ct2wMKW1dV87eTDlF0oiR2ol
+XwtFgKmrIjfpmzkdWjbJmWnGMjD56KdiFZga/ZyKMsPrVoYLgfJEpn36iQspfygx
+HCGNTf0PjIsjEWU0WyQiF86t+c45W3wNFsv/AxVyfMl+su02yrd6u2ecuQDir3Cs
+b2k8IKtQgVe/NIpEWLKuiHG5oedIPPQyDYK5uq+gHxCGeOoKnWlsWFEHZRiza4X5
+tbgTrJB8Sw0ENWrvVGGmQZN4pSImlsMwzQ2qik5CQ00N1b3+56/obn0z75I3bUSb
+tC5g8DRjl6oclAenNgh/MYMT287y5W2dD4npxHcekX4O3J2CDXNfg4vV2j5GRxtg
+LVJdYE2p7bpYePCDHrYng8b9ubBprx0CrEnkIvvtUjzNPf6VDL0+MBKl+XgR2/nz
+iRqTuZnlGGOyM+KYDwXpgwfs/HfvFGksxTAlO/40GkGh+WGPaIoNyCK0SgQKhyb4
+JIkR0vd2/yLg3lWMJrGwh7A0Gm07Z/781oURP3uWd+PaCOgGcd5ipcAjcEyuxNly
+AthipWqmQWUcbf6Z2N9j3OA22Hv2Uzk8HSfi9VOZtL9svdEEZ0NnOekJgnc6stQp
+bXiknlK/T5WdrWxSyCfgUq68Vf6DFfIRAVuFdJ3WHT2wVXHrDfft6D+Ne/XCxPoE
+8zGmkyusaph33UHQ1oNyUbLbwcDCDSmOo8gYoedD3IwxtMA3wJRugomqosItwV8X
+vkgmcy8eSE/+gZUxJEN2gnLcfKFhCkC80J6oFhmoDD6vuUnPHcFdKZgVPw2rzPk5
+Vb1kX+gpORplYmKpq1vz/ujscL4T0TmYLz02hkIS4edpW55ncTTv7JWefpRiTB1J
+RB3td3me4htqR+YIDWJ+emrOmqsCG2WvpAS+MTw2mj1jYk9LL/ZYobTjSCEWmuwT
+yVK6m303irR7HQDauxhslRFgoK21w63viOyj5NKIU1gQtaAANGDxcgORC1XLjjgt
+oNutSQA+7P42vfHSHK4cnTBXl6V32H/GyVpdHQOZqSrqIjgLmUZodSmRPROxosZF
+a46B1O7m/rJFxkiKW4vod+/WqjoE0Hhfrb8rRrkRjzGeCqqSSnQ3vrunVkvF8hlA
+b6FOv4ZBJL4piC1GKH+rscqke9NEiDqXN8C3iYz86jbck/Ha21yUS8T3X7N52sg+
+B3AmOGnLK6BebYeto9vZxQjacChJZSixSxLV+l9/nVQ0+mW42azHdzk0ru59TGAj
+-----END RSA PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8.pem
new file mode 100644 (file)
index 0000000..a24c5a2
--- /dev/null
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDAlQjhV0HycW23
+0kVBJwFlxkWu8rwkMLiVzi9O1vYciLx8n/uoZ3/+XJxRdfeKygfnNS+P4b17wC98
+q2SoF/zKXXu64CHlci5vLobYlXParBtTuV8/1xkNJU/hY2NRiwtkP61DuKUcXDSz
+rgCgY8X2fwtZaHhzpowYqQJtr8MZAS64EOPGzEC0aaNGM2mHbsS7F6bz6N2tc7x7
+LyG1/WZRDL1Us+FtXxy8I3PRCQOJFNIQuWTDKtChlkq84dQaW8egwMFjeA9ENzAy
+loAyI5Whd7oT0pdz4l0lyWoNwzlgpLSwaUJCCenYCLwzILNYIqeq68Th5mGDxdKW
+39nQT63XAgMBAAECggEBAJrQNA9SYgVQAe+f7WRuwsTaGvKE15IQSJLE6Wrri3Vs
+xnk48slySoZkVJV3y8OanbfUHaQAyJ5O5N3HumcWwXS8qdaUjyswGvvt3yEFI9lK
+Ob2Ya2WauNzEfe6mQxUuPb4dImAqczDVPtiirIZDLsT1ZF4/iXUPEdhRJU6f2Kqj
+zmCz4orZfhvwZMqaWwULW6rL5eM/bjIiBfPQ+u90UoHiX3TTvf8xg0V1+mN6ly7W
+thnGkibkKAZQUA54Lql4DRSXtBLYMUCroQFBwjD4B18W5GF30mDyn43o9LrrY94q
+l4HvTGzmVTRRKyg09FMcxFgKP7uvtfdKhUMtPPFYWIECgYEA8ixUdjkjY8kQMreT
+ra++GXWWgWTmtbiJQkHRbdAcG/gbrGnLNjxkfdz0GbjDYLFXSF9ST1k6VX8ywBlD
+UD+uzm8X8w6fQMpOrRU7yXnpwFk4c3CcCnzJOkgyp9hJdQqFwsL9FXPamQkqaZqf
+CnG/sASmjHpab0haVDvGsVMX3+cCgYEAy5PedxVdt1xcfNiQqZgt1mkOY7Oj3KbM
+i2qkohKMjntILLJLN9wGGH3q/nah1KHpPw3NG1+vX56WW1sPoXyvs5uQ21dzOu2w
+I0SuQU8fB0ITI0zL+vQUpNX3njZ8W5+oPMGFX3TSOS3/0ITf+7Mgei6bF67muguu
+X1OkUu0bxJECgYEA7Jjau9X++VJKfQJVSW9VblIvhKMrs4Zis1TSY1La44h2oO+L
+FaXTGBRyd17HowQfnhlitRsbnsPytTL5TMGq6wwmfdRfSlFcpEUGcESnVsDUIhR2
+nthjUImQ0+K/gZWSMUGHORpDCxilUx85Gl8fQ7yHat9u0yIA/iKYcE4aGSkCgYEA
+ikFWKFGeX9SeCzuYo1TybFbUqulpM4UkDNrUDC3Ev08CaTh81ObcTO3XFhHDPgDn
+wybAUQLeu3Wcb1acevOO78+KxSvS2gZqRMlz/m6Zh/hbvvF85mW1T2zwycX/FsqL
+GxfiWD2iN6sBvL9AzlOMju3v7lmd4GPmfF71jkvxO8ECgYBNRflAjMVb9CoairTy
+HKxr6QxWNrdOcpbV5YrS4v/x8RgTPYYJuNh2p8kccVKUMEPg8Xh0/WEbTAnM5mgq
+ca0c30O8VtulpL41cKRez0/8AFWZOj0jz2da9SL4tSnQRBHrNS5Gvv2OGLJfqL8Z
+MqH13APmfJofDHypsA4hNzvxsA==
+-----END PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc.pem
new file mode 100644 (file)
index 0000000..4be31a3
--- /dev/null
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE6TAbBgkqhkiG9w0BBQMwDgQIr3AyvPqfFRQCAggABIIEyPUs6wCboqtKmExH
+zfez3vfHn2cp6s3X563Bz73hYn/8vXtI/q0oDNOpgav60/N7rMy50fno3LmW0/6E
++UN4MwofmBS3lp1ZVY3KmzDy6lz5vcFo4GCCj+X6dacsyBQ4lFOge5BihQ3R9cKt
+dSrd1EFKwGGu3qTDG7ajTZukmYjxuRqpyHqPO5OJO7yXxHOB7B7sSKIyJRCkkucd
+oBC86kQdWraweSYj+Klza6VjKzmNzDBx9Fyhrj9XGXJ3rJLhjgNpelwX+PIMU31i
+/yklI4jm0aMSoAvXgdBXZuOsnsI27GXxy//i7AOgLLWi+Bu4dJSSl5PMtespf83u
+5jSysJymXiNcN6vEautGyjCujdMs5c/FEMbgubAMXymCI9DsAN+5dNMDY8Zrfqdl
+hFKfctcu8BxFa+0tavJ28fOEBuEyJLsQ9OvvS7dn4AV502JRKWObfsw7fi+mMzMu
+oxhYo99MRqic6a9uDmYB3SPeU31eOHiEi0n51D7Gtcn++F+IaDFwSHMirThzakGn
+go3nj0yq62euzVcEuhIfTTAe3F2tqzpzznVFbs1XgrGVREJ6gp5vRgMUUGYIqQir
+p5oW0HVRI4iuoSjdN4/wNAxIP9zakwYx+vWx1VXhDVEJfgNmxDRvEbF+OOz+iJCf
+7A2e8L+kZ/5oC3HO8h7GdHNTUjRRdh8FUM8lGo+HbMYDznMy/bJlIP2bx9hIIha7
+U70i09glS2Z7Ei+VecJbvFzdro0vdYyGO2ef8bWwCc5JMucxDcRklWdUxK6amKJN
+VpXL3TW0VYCfr1rLmZXUfBGk/KXM20/BoM04WLjeR3oiV/2b7SYK7GnJ7kBmAHHx
+gnrwMDO3JvH89CwlHRizVSQl59ViqEMGLmbHThcMqkEOkFphB2xox7/IOVyp6cFn
+mY0ZCrbhdX+L6t5jiyq/4us5bzF7FOBYsJr6n1Rm9b8eeOL693y/6uM3CvTJcTOb
+5RqWiHgTgmefeOeUQ0/dVgvEOIWz2yqBQmHKiB4+0CGGIRwUOXBrTKSLilumsjQe
+qGhJ6yw25VIpdXsMD1WVviczgRTNYjdldIJoHQdvpCEAhQ1RR3rkuIPniTumJFmY
+CnjfNqjtkaZWIN1nOCmcu50tswksWEEFEfkcP1xyzhr3EVCYAoFncLTp5vHBtdmg
+6KBdar40/OFGAcbDGDX1g3XEEi6jHmy0Lyz7M3DwESgaMgwzscsQLr+wMITk1IUN
+yfiXHl1CQjGxhDj8KoAhdDjjPENkSlCSd1vEO+lg1/IFb1dtnL2DJp6BQt9/VLHo
+Fp3pdZ7r95H20+pEhCZp0HXLNo1o8xjJQ5RWUCs1Zc1cauDOAh8lAjps6MBxTa3a
+LOgTW9lgiAQ+S1g2jK4BmqbLvZUF+Z6xupc8uE3E3HhJolmDRYojMNFNmmvODa8M
+CneWmj3T1KvqEToAIq46mStlTfQufSMpaJ73Wds4gmIiGwn5hIuUN6f3kybbt4f2
+4DLZXMcjYweLi9tJtFC+JaO0rS5gtX/k/ys1QSblSU5qfRu1XfwNAcZO1ReKgGYN
+ymI78cSACGIcEvAwin8CdRu3W99NbMqHW9AcCETFlTsC3wNlQxyYSem75sjPaWVF
+sxLy7YxEJ8tDEJZbSQ==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc12.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc12.pem
new file mode 100644 (file)
index 0000000..a1e4388
--- /dev/null
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE5TAcBgoqhkiG9w0BDAEBMA4ECFytdly5R2o9AgIIAASCBMOa6fgAUIR5GokK
+Z81YZMxC3sNqAwjLEkOwmez2za2fq+2mw6T8tB5W75lFpWyXD1MDPa1PpLzyw27c
+d2C8nipCzp37yYLmXr+aS519CBJR80ily/WLcdv+ScsA6pjOEW2p+VDY55jFp2pr
+n94/K2nFQpMxAdjxnqQCF5ewMLqzy3o3s6U3V9zIxy/xlLYi//UWFI8fqtOikqs4
+apWLNqJONRZq95OITKO/Nhz7GyEfjrewJmv4zVToEnSagSwbR4IVFn5Lok8rSpI9
+qwey9wsB1CguVwR0O2NjDVKUGXinfhdr+zMQlCoz+xY/Q1TkH4gEY5wpln4cBvtm
+PL/BnD4wEWHh8vS61wfOQ7wPgY+cdCe75stTrKzc6amVJB+40Qi3Vt4TEPGwcP16
+/qGl0zpYuAgilPtuEBw3GX3LiigpHmSt43D3DiYNGzv+Aran2Ei9iGSGeI2zHz8r
+WFZEnptAwlqeyL7+MZjAOXlu6QG1yix8HvZLmtBHrE2MhuR4KbS3fAUCNQpn8OKu
+zxYzs1ti5F2V4c9yK63gSz3H1ObRNsM2OkpUbSVGqLUN6a8HsI6yYh4we6q0gxKD
+VGdzEz4S1BFEBfXWVSPnRNMR4YD8kiQEPutUZFLiWWZ7WliH5yNfHZUia8dovxFa
+MWmAbSjMKRGvV+LvAGQHYBVfJSQO6VvBfBDtu0H4rLr8urmcPY+hbw1XxGfKSQp1
+iIdvVwjefl8wM9LSRsvqY5l4mu+XDPanQlFbzKBOSyLQts97ys3AR+jkK8Bmv14l
+xmCF8bJzzz5a2wAqbPhWIbk4J4VfcJEXNMzd19w4SxGv9fUXNiZZElUdNE+wtRsQ
+YvACYn9sZ6JUwg9hNTLXuXZY47LuQrrdTDHupoVA9zLvUYMKgO+pjwS8uy1dLQao
+0aztHLZEXuVJvpiRoMtYZl37ZNoLHQJeZUNyNATshAoD1+uSc7aywl8yqdTzXRR2
+g0rkExXEVJ5OPyzbFdOQSC5HoOC7dInIBmkrSFEJMKDkMzwYI+uSoIbn+8i+Gjzy
+Vh3/lftts/BIvr4NAh1ZAq/215jZSdAGo+1VZeuBeybwh3RBdBl8PhDBviTvbxSk
+P+F1T+UcbAz9bgjQJgNvDb9XHNI8rfEhfDPX/Pr4VvxBZNndmRJVQDKi23YD/7yF
+WAwXy418M7DPqp7NYmUHFe7JRm9bHk41EeknLZaZGW5qHwQKA10RoJCgjoOIFTsd
+kD3Qq/0mEuOiuJn5UPE19xtUpvFWamDf3s3zSHM7VJ+gGNrS/WbQ+KmTimj0Wucd
+2vWiNCGbhWwmp3LLKQlB5xDwXJy099SZUUkgcxGmfcT7FOpd3QSLYnwtPz8uLW0N
+76zbiUTYCQ/ASLrwcKFGCKKBz62DlRreK23E/RjqkKKCVFzzg8AzQTa02ml+wQyG
++5EOwEF2yIrhV0p4hY/GDAIe3cdchiy1EQf6xH/IxPF/QsKNp0CfHVPgdFwLzjM2
+oFD3analGblxp9CMiDbiKTOdFPL8XcguufqpWra2jtUbe07HQaeU2NcM2TeB2KsU
+PhgBwgdNxW69K55iHReaZtuLw0GhD+KBrm7gSteVniiYLzLKzxmMycGGtoNwpbGi
+MMJBE+BYZylG
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc2.pem b/FreeRTOS-Plus/Source/CyaSSL/certs/server-keyPkcs8Enc2.pem
new file mode 100644 (file)
index 0000000..297f2a0
--- /dev/null
@@ -0,0 +1,30 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIxaI9IblN3acCAggA
+MBQGCCqGSIb3DQMHBAi7kwdRvCrqMgSCBMjkSOSVfmu42O0q2GzFrJVr3cam9ZKe
+InQsxqtgADdBxMgJJVnr360tUNPQyyvfCH//Duhz+aJIC0MQZkWR3ZSy5pfHX+vr
+C3wd741VOlI44uEdzRktlPc11saMDyKS04/K9aaYIDqspOiobt9WZLQildXl1n8j
+N+7Laj7A/vxJ5GUJ4hdPwQOIeuJXTDDzn+Ld12XXGH+Iw1M5Cx3tBw1TNizSnmXQ
+vf/MsfsWsZbHBppCXZbF27jJA+6Bg7dGT0OZM0pI+ZQvyHr+qjog0hollY9KjwTG
+h+hsM7umWFJdeRMrmkTrX/R9HY/c5I4ExNSp1AtMmFeeU8h2VTJtYcoykUU1q2pF
+KHfjPghwmYromQGR4nPA9sqa9s+VMq9OaqoJDoBwNobdFr7sEtMLT08vTa0+rMX7
+bmjAF44/dVBYpBxXjTQ0pXVeb24Q00Sn6NOI4fTsBnkR+WTtuwz/L0qaGnJlh10y
+sQ3+95cUtZc3SZS67yYUx5auswqT3V4JCmhJcHNi+/jHyrj9D8nVWibQ2TBmgUf+
+0NzvdKb7sraEx7PSgFWDMLoQrd2+cqsJArpY9TbLSLhBDrOVc8v/lXYuK6QI0gMd
+HIwAZARUZMoI3WS6icTLYyLdQPMsFzI6U0arkbrdhjNNd3kVqeFEJ+oF0rkuAcJJ
+K8eUcsby1AIBS/9tuW1gSYubmuXsZX8xbYbJnHUqGOTAVa7jo8eVUTiyUfPXa+0N
+s1tTpZXtOOlqncZ08mPHppshdKF2cpuh0JNjiR6fHvXytGWFGMsKtxdwKs/14UCg
+qoTW0EQU4ONfBxR2PtX8PlNV4bOt704HP8Vc0H9JV2uWpJaLRzY2bBiPgKcrO9Eh
+83zFrPu/0obBQTxnP3mMihxvCndflHQqeJ0V1YYw9n4+XbgBqULXDQs7OetRohnY
+gYyc//NdC2I8mbdabFYvUTWSH6oMA6lqkwTjTTwtn5E8BJkRi1sIq4jNFUekpm2T
+5AwP7xWn//PM+B12CPoIgYtYT6Yhbf8arXuGU28y1Ahhi/hKcpR9HRPQeyaR62vi
+skjjycfn38wcj0WrIVnOceGgPa3EBrkkTaPUHvMQ5G/xzMZ82o3CnmwdnH+lp3eg
+TLcLm8Yp9InkMJNVOrGLxFvmTljl3h9x2JVuE0wtuWt91QVmfCZo0k3Cx46ad7xB
+eK20veTy+PySy2U3W1twGfsXXXRwaQiXXRrgPciK0LcGXZneShZuebk04U31sq4F
+rYaMAzIDDmvwbjh+UpNcl1VdBDGGePxzzOD3HHYPbm240HVMPuS85P2kFjak3PdJ
+GqsRUS1SRp1e451aFGjzggPLXFjAfDMaxrgjSWapRzu78i+xvcvf69979oX0KO9Y
+KMSC14RnmnT1+UdKxX+p9r1AwfH/vJxM34AOSva1uLiSJckRGYGOzuaYsTT9ZAx/
+q3CNALF4qFUMWmJnvQDYmCUnw6lJl3CazbtV5RI2ILQX6ZHR6YAHT5hYY43k+AnZ
+mFW6BGKoX/f4iVqYtjQWiGWAJAf6C9+548O2t9MiVcgQf4Nvj6lFLM00pzFn7jW4
+DsDFUBmmrSF8wfR7SRpOc/ViVZBRleYPLsMu0tmD29fowqqBY0MEkxqSahFAGTgk
+sao=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/FreeRTOS-Plus/Source/CyaSSL/certs/taoCert.txt b/FreeRTOS-Plus/Source/CyaSSL/certs/taoCert.txt
new file mode 100644 (file)
index 0000000..f0bb921
--- /dev/null
@@ -0,0 +1,157 @@
+
+***** Create a self signed cert ************
+
+1) openssl genrsa 512 > client-key.pem
+
+2) openssl req -new -x509 -nodes -md5 -days 1000 -key client-key.pem > client-cert.pem
+
+3) note sha1 would be -sha1
+
+-- adding metadata to beginning
+
+3) openssl x509 -in client-cert.pem -text > tmp.pem
+
+4) mv tmp.pem client-cert.pem
+
+
+***** Create a CA, signing authority **********
+
+same as self signed, use ca prefix instead of client
+
+
+***** Create a cert signed by CA **************
+
+1) openssl req -newkey rsa:512 -md5 -days 1000 -nodes -keyout server-key.pem > server-req.pem
+
+* note if using exisitng key do: -new -key keyName
+
+2) copy ca-key.pem ca-cert.srl   (why ????)
+
+3) openssl x509 -req -in server-req.pem -days 1000 -md5 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem
+
+
+
+***** To create a dsa cert ********************
+
+1) openssl dsaparam 512 > dsa512.param       # creates group params
+
+2) openssl gendsa dsa512.param > dsa512.pem  # creates private key
+
+3) openssl req -new -x509 -nodes -days 1000 -key dsa512.pem > dsa-cert.pem 
+
+
+
+
+***** To convert from PEM to DER **************
+
+a) openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
+
+to convert rsa private PEM to DER :
+
+b) openssl rsa -in key.pem -outform DER -out key.der
+
+
+**** To encrypt rsa key already in pem **********
+
+a) openssl rsa <server-key.pem.bak -des >server-keyEnc.pem
+
+note location of des, pass = yassl123
+
+
+*** To make a public key from a private key ******
+
+
+openssl rsa -in 1024rsa.priv -pubout -out 1024rsa.pub
+
+
+**** To convert to pkcs8 *******
+
+openssl pkcs8 -nocrypt -topk8 -in server-key.pem -out server-keyPkcs8.pem
+
+
+**** To convert to pkcs8 encrypted *******
+
+openssl pkcs8 -topk8 -in server-key.pem -out server-keyPkcs8Enc.pem
+
+passwd: yassl123
+
+to use PKCS#5 v2 instead of v1.5 which is default add
+
+-v2 des3       # file Pkcs8Enc2
+
+to use PKCS#12 instead use -v1 witch a 12 algo like
+
+-v1 PBE-SHA1-RC4-128   # file Pkcs8Enc12 , see man pkcs8 for more info
+
+
+**** To convert from pkcs8 to traditional ****
+
+openssl pkcs8 -nocrypt -in server-keyPkcs8.pem -out server-key.pem
+
+
+*** DH paramters ***
+
+openssl dhparam 2048 > dh2048.param
+
+to add metadata
+
+openssl dhparam -in dh2048.param -text > dh2048.pem
+
+**** ECC ******
+
+1) make a key
+
+    to see types available do
+        openssl ecparam -list_curves
+
+    make a new key
+        openssl ecparam -genkey -text -name secp256r1 -out ecc-key.pem
+
+
+*** CRL ***
+
+1) create a crl
+
+a) openssl ca -gencrl -crldays 120 -out crl.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
+
+Error No ./CA root/index.txt so:
+
+b) touch ./CA root/index.txt
+
+a) again
+
+Error No ./CA root/crlnumber so:
+
+c) touch ./CA root/crlnumber
+
+a) again
+
+Error unable to load CRL number
+
+d) add '01' to crlnumber file
+
+a) again
+
+2)  view crl file
+
+openssl crl -in crl.pem -text
+
+3) revoke
+
+openssl ca -revoke server-cert.pem -keyfile ./ca-key.pem -cert ./ca-cert.pem
+
+Then regenerate crl with a)
+
+4) verify
+
+openssl verify -CAfile ./ca-cert.pem  ./server-cert.pem
+
+OK
+
+Make file with both ca and crl
+
+cat ca-cert.pem crl.pem > ca-crl.pem
+
+openssl verify -CAfile ./ca-crl.pem -crl_check ./ca-cert.pem
+
+revoked
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config.in b/FreeRTOS-Plus/Source/CyaSSL/config.in
new file mode 100644 (file)
index 0000000..0b87d4f
--- /dev/null
@@ -0,0 +1,166 @@
+/* config.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#undef HAVE_INET_NTOA
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `network' library (-lnetwork). */
+#undef HAVE_LIBNETWORK
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Have PTHREAD_PRIO_INHERIT. */
+#undef HAVE_PTHREAD_PRIO_INHERIT
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+   declarations. */
+#undef HAVE_VISIBILITY
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT8_T
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint8_t
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/compile b/FreeRTOS-Plus/Source/CyaSSL/config/compile
new file mode 100644 (file)
index 0000000..1b1d232
--- /dev/null
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+       # configure might choose to run compile as `compile cc -o foo foo.c'.
+       # So we strip `-o arg' only if arg is an object.
+       eat=1
+       case $2 in
+         *.o | *.obj)
+           ofile=$2
+           ;;
+         *)
+           set x "$@" -o "$2"
+           shift
+           ;;
+       esac
+       ;;
+      *.c)
+       cfile=$1
+       set x "$@" "$1"
+       shift
+       ;;
+      *)
+       set x "$@" "$1"
+       shift
+       ;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/config.guess b/FreeRTOS-Plus/Source/CyaSSL/config/config.guess
new file mode 100644 (file)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       if test x"$CC_FOR_BUILD" = x ; then
+         CC_FOR_BUILD=no_compiler_found ;
+       fi
+       ;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+       # NetBSD (nbsd) targets should (where applicable) match one or
+       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+       # switched to ELF, *-*-netbsd* would select the old
+       # object file format.  This provides both forward
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+       esac
+       # The Operating System including object format, if it has switched
+       # to ELF recently, or will in the future.
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep __ELF__ >/dev/null
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               os=netbsd
+               ;;
+       esac
+       # The OS release
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+               ;;
+       esac
+       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+       # contains redundant information, the shorter form:
+       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+       echo "${machine}-${os}${release}"
+       exit ;;
+    *:OpenBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
+    *:ekkoBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    *:MirBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    alpha:OSF1:*:*)
+       case $UNAME_RELEASE in
+       *4.0)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               ;;
+       *5.*)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               ;;
+       esac
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "EV7.9 (21364A)")
+               UNAME_MACHINE="alphaev79" ;;
+       esac
+       # A Pn.n version is a patched version.
+       # A Vn.n version is a released version.
+       # A Tn.n version is a released field test version.
+       # A Xn.n version is an unreleased experimental baselevel.
+       # 1.2 uses "1.2" for uname -r.
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       exit ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
+       exit ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-amigaos
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+       exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix${UNAME_RELEASE}
+       exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7; exit ;;
+       esac ;;
+    sun4H:SunOS:5.*:*)
+       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    i86pc:SunOS:5.*:*)
+       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:6*:*)
+       # According to config.sub, this is the proper way to canonicalize
+       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+       # it's likely to be more like Solaris than SunOS4.
+       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit ;;
+    sun*:*:4.2BSD:*)
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos${UNAME_RELEASE}
+               ;;
+           sun4)
+               echo sparc-sun-sunos${UNAME_RELEASE}
+               ;;
+       esac
+       exit ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+       echo m68k-apple-machten${UNAME_RELEASE}
+       exit ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten${UNAME_RELEASE}
+       exit ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix${UNAME_RELEASE}
+       exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       then
+           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+           else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
+       fi
+       exit ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
+               sed 's/^                //' << EOF >$dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       exit ;;
+    *:AIX:*:[45])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit ;;
+    9000/[34678]??:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           9000/[678][0-9][0-9])
+               if [ -x /usr/bin/getconf ]; then
+                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+               {
+               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+               case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+                   switch (bits)
+                       {
+                       case 64: puts ("hppa2.0w"); break;
+                       case 32: puts ("hppa2.0n"); break;
+                       default: puts ("hppa2.0"); break;
+                       } break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+                   puts ("hppa2.0"); break;
+              #endif
+               default: puts ("hppa1.0"); break;
+               }
+                  exit (0);
+              }
+EOF
+                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           eval $set_cc_for_build
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep __LP64__ >/dev/null
+           then
+               HP_ARCH="hppa2.0w"
+           else
+               HP_ARCH="hppa64"
+           fi
+       fi
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit ;;
+    ia64:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux${HPUX_REV}
+       exit ;;
+    3050*:HI-UX:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
+       echo unknown-hitachi-hiuxwe2
+       exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*[A-Z]90:*:*:*)
+       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+             -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    *:UNICOS/mp:*:*)
+       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:FreeBSD:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    i*:MINGW*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
+    i*:PW*:*)
+       echo ${UNAME_MACHINE}-pc-pw32
+       exit ;;
+    x86:Interix*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i586-pc-interix
+       exit ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin
+       exit ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    *:GNU:*:*)
+       # the GNU system
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       exit ;;
+    *:GNU/*:*:*)
+       # other systems with GNU libc and userland
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       exit ;;
+    i*86:Minix:*:*)
+       echo ${UNAME_MACHINE}-pc-minix
+       exit ;;
+    arm*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    cris:Linux:*:*)
+       echo cris-axis-linux-gnu
+       exit ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux-gnu
+       exit ;;
+    frv:Linux:*:*)
+       echo frv-unknown-linux-gnu
+       exit ;;
+    ia64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    m68*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    mips:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips
+       #undef mipsel
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mipsel
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips64
+       #undef mips64el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mips64el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips64
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-gnu
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+       # Look for CPU level
+       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+         PA7*) echo hppa1.1-unknown-linux-gnu ;;
+         PA8*) echo hppa2.0-unknown-linux-gnu ;;
+         *)    echo hppa-unknown-linux-gnu ;;
+       esac
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+       echo ${UNAME_MACHINE}-ibm-linux
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    i*86:Linux:*:*)
+       # The BFD linker knows what the default object file format is, so
+       # first see if it will tell us. cd to the root directory to prevent
+       # problems with other programs or directories called `ld' in the path.
+       # Set LC_ALL=C to ensure ld outputs messages in English.
+       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+                        | sed -ne '/supported targets:/!d
+                                   s/[         ][      ]*/ /g
+                                   s/.*supported targets: *//
+                                   s/ .*//
+                                   p'`
+        case "$ld_supported_targets" in
+         elf32-i386)
+               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+               ;;
+         a.out-i386-linux)
+               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               exit ;;
+         coff-i386)
+               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+               exit ;;
+         "")
+               # Either a pre-BFD a.out linker (linux-gnuoldld) or
+               # one that does not give us useful --help.
+               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+               exit ;;
+       esac
+       # Determine whether the default compiler is a.out or elf
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       test x"${LIBC}" != x && {
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+               exit
+       }
+       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+       ;;
+    i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
+       echo i386-sequent-sysv4
+       exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+       # I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       exit ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       exit ;;
+    i*86:syllable:*:*)
+       echo ${UNAME_MACHINE}-pc-syllable
+       exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+       if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       exit ;;
+    i*86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       exit ;;
+    pc:*:*:*)
+       # Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+       echo i386-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       exit ;;
+    i860:*:4.*:*) # i860-SVR4
+       if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+       fi
+       exit ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+       OS_REL=''
+       test -r /etc/.relid \
+       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
+    *:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo hppa1.1-stratus-vos
+       exit ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit ;;
+    news*:NEWS-OS:6*:*)
+       echo mips-sony-newsos6
+       exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+        exit ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       exit ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       exit ;;
+    Power*:Rhapsody:*:*)
+       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Darwin:*:*)
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       case $UNAME_PROCESSOR in
+           unknown) UNAME_PROCESSOR=powerpc ;;
+       esac
+       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    *:NonStop-UX:*:*)
+       echo mips-compaq-nonstopux
+       exit ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit ;;
+    DS/*:UNIX_System_V:*:*)
+       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       exit ;;
+    *:Plan9:*:*)
+       # "uname -m" is not consistent, so use $cputype instead. 386
+       # is converted to i386 for consistency with other x86
+       # operating systems.
+       if test "$cputype" = "386"; then
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo ${UNAME_MACHINE}-unknown-plan9
+       exit ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+       exit ;;
+    *:DragonFly:*:*)
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "${UNAME_MACHINE}" in
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       exit ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+         ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+       printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+       printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+       echo c1-convex-bsd
+       exit ;;
+    c2*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit ;;
+    c34*)
+       echo c34-convex-bsd
+       exit ;;
+    c38*)
+       echo c38-convex-bsd
+       exit ;;
+    c4*)
+       echo c4-convex-bsd
+       exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/config.sub b/FreeRTOS-Plus/Source/CyaSSL/config/config.sub
new file mode 100644 (file)
index 0000000..fab0aa3
--- /dev/null
@@ -0,0 +1,1616 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-09-20'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple | -axis | -knuth | -cray)
+               os=
+               basic_machine=$1
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5)
+               os=-sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64vr | mips64vrel \
+       | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa-* \
+       | ymp-* \
+       | z8k-*)
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-unknown
+               ;;
+       amigaos | amigados)
+               basic_machine=m68k-unknown
+               os=-amigaos
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-unknown
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | j90)
+               basic_machine=j90-cray
+               os=-unicos
+               ;;
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
+               ;;
+       cr16c)
+               basic_machine=cr16c-unknown
+               os=-elf
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
+       cris | cris-* | etrax*)
+               basic_machine=cris-axis
+               ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       go32)
+               basic_machine=i386-pc
+               os=-go32
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               ;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+       i*86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i*86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i*86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i*86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
+       msdos)
+               basic_machine=i386-pc
+               os=-msdos
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
+       nonstopux)
+               basic_machine=mips-compaq
+               os=-nonstopux
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       openrisc | openrisc-*)
+               basic_machine=or32-unknown
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc)    basic_machine=powerpc-unknown
+               ;;
+       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       pw32)
+               basic_machine=i586-unknown
+               os=-pw32
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       t3e)
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
+               os=-unicos
+               ;;
+       tic54x | c54x*)
+               basic_machine=tic54x-unknown
+               os=-coff
+               ;;
+       tic55x | c55x*)
+               basic_machine=tic55x-unknown
+               os=-coff
+               ;;
+       tic6x | c6x*)
+               basic_machine=tic6x-unknown
+               os=-coff
+               ;;
+       tx39)
+               basic_machine=mipstx39-unknown
+               ;;
+       tx39el)
+               basic_machine=mipstx39el-unknown
+               ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
+       xps | xps100)
+               basic_machine=xps100-honeywell
+               ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp10)
+               # there are many clones, so DEC is not a safe bet
+               basic_machine=pdp10-unknown
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               basic_machine=sparc-sun
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+               ;;
+       -mac*)
+               os=`echo $os | sed -e 's|mac|macos|'`
+               ;;
+       -linux-dietlibc)
+               os=-linux-dietlibc
+               ;;
+       -linux*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+        -os400*)
+               os=-os400
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+        -tpf*)
+               os=-tpf
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -kaos*)
+               os=-kaos
+               ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       # This must come before the *-dec entry.
+       pdp10-*)
+               os=-tops20
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               # This also exists in the configure program, but was not the
+               # default.
+               # os=-sunos4
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-haiku)
+               os=-haiku
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-knuth)
+               os=-mmixware
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/depcomp b/FreeRTOS-Plus/Source/CyaSSL/config/depcomp
new file mode 100644 (file)
index 0000000..ca5ea4e
--- /dev/null
@@ -0,0 +1,584 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/install-sh b/FreeRTOS-Plus/Source/CyaSSL/config/install-sh
new file mode 100644 (file)
index 0000000..4fbbae7
--- /dev/null
@@ -0,0 +1,507 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-10-14.15
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        shift
+        shift
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+       shift
+       shift
+       continue;;
+
+    -T) no_target_directory=true
+       shift
+       continue;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dstarg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dstarg"
+      shift # fnord
+    fi
+    shift # arg
+    dstarg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+       echo "$0: $dstarg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix=/ ;;
+       -*) prefix=./ ;;
+       *)  prefix= ;;
+      esac
+
+      case $posix_glob in
+        '')
+         if (set -f) 2>/dev/null; then
+           posix_glob=true
+         else
+           posix_glob=false
+         fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
+      shift
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+      || {
+          # The rename failed, perhaps because mv can't rename something else
+          # to itself, or perhaps because mv is so ancient that it does not
+          # support -f.
+
+          # Now remove or move aside any old file at destination location.
+          # We try this two ways since rm can't unlink itself on some
+          # systems and the destination file might be busy for other
+          # reasons.  In this case, the final cleanup might fail but the new
+          # file should still install successfully.
+          {
+            if test -f "$dst"; then
+              $doit $rmcmd -f "$dst" 2>/dev/null \
+              || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+                    && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+              || {
+                echo "$0: cannot unlink or rename $dst" >&2
+                (exit 1); exit 1
+              }
+            else
+              :
+            fi
+          } &&
+
+          # Now rename the file to the real destination.
+          $doit $mvcmd "$dsttmp" "$dst"
+        }
+    } || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/ltmain.sh b/FreeRTOS-Plus/Source/CyaSSL/config/ltmain.sh
new file mode 100644 (file)
index 0000000..c856b8d
--- /dev/null
@@ -0,0 +1,8745 @@
+# Generated from ltmain.m4sh.
+
+# libtool (GNU libtool) 2.2.10
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:        $host
+#         shell:               $SHELL
+#         compiler:            $LTCC
+#         compiler flags:              $LTCFLAGS
+#         linker:              $LD (gnu? $with_gnu_ld)
+#         $progname:   (GNU libtool) 2.2.10
+#         automake:    $automake_version
+#         autoconf:    $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.2.10
+TIMESTAMP=""
+package_revision=1.3175
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+         export $lt_var
+         lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+         lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+       fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/usr/bin/sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77     # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS="  $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+               s@/\./@/@g
+               t dotsl
+               s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+       # list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+       IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+       func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+       my_arg=`$ECHO "$1" | $SED \
+           -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+           $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/(C)/!b go
+       :more
+       /\./!{
+         N
+         s/\n# / /
+         b more
+       }
+       :go
+       /^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+       s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+       s/^# *$//
+       s*\$progname*'$progname'*
+       s*\$host*'"$host"'*
+       s*\$SHELL*'"$SHELL"'*
+       s*\$LTCC*'"$LTCC"'*
+       s*\$LTCFLAGS*'"$LTCFLAGS"'*
+       s*\$LD*'"$LD"'*
+       s/\$with_gnu_ld/'"$with_gnu_ld"'/
+       s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+       s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+       p
+     }' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+       taglist="$taglist $tagname"
+
+       # Evaluate the configuration.  Be careful to quote the path
+       # and the sed script, to avoid splitting on whitespace, but
+       # also don't use non-portable quotes within backquotes within
+       # quotes we have to do it in 2 steps:
+       extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+       eval "$extractedcf"
+      else
+       func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
+    ;;
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
+    ;;
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
+    ;;
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
+    ;;
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
+    ;;
+  esac
+
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+      --config)                func_config                                     ;;
+
+      --debug)         preserve_args="$preserve_args $opt"
+                       func_echo "enabling shell trace mode"
+                       opt_debug='set -x'
+                       $opt_debug
+                       ;;
+
+      -dlopen)         test "$#" -eq 0 && func_missing_arg "$opt" && break
+                       execute_dlfiles="$execute_dlfiles $1"
+                       shift
+                       ;;
+
+      --dry-run | -n)  opt_dry_run=:                                   ;;
+      --features)       func_features                                  ;;
+      --finish)                mode="finish"                                   ;;
+
+      --mode)          test "$#" -eq 0 && func_missing_arg "$opt" && break
+                       case $1 in
+                         # Valid mode arguments:
+                         clean)        ;;
+                         compile)      ;;
+                         execute)      ;;
+                         finish)       ;;
+                         install)      ;;
+                         link)         ;;
+                         relink)       ;;
+                         uninstall)    ;;
+
+                         # Catch anything else as an error
+                         *) func_error "invalid argument for $opt"
+                            exit_cmd=exit
+                            break
+                            ;;
+                       esac
+
+                       mode="$1"
+                       shift
+                       ;;
+
+      --preserve-dup-deps)
+                       opt_duplicate_deps=:                            ;;
+
+      --quiet|--silent)        preserve_args="$preserve_args $opt"
+                       opt_silent=:
+                       opt_verbose=false
+                       ;;
+
+      --no-quiet|--no-silent)
+                       preserve_args="$preserve_args $opt"
+                       opt_silent=false
+                       ;;
+
+      --verbose| -v)   preserve_args="$preserve_args $opt"
+                       opt_silent=false
+                       opt_verbose=:
+                       ;;
+
+      --no-verbose)    preserve_args="$preserve_args $opt"
+                       opt_verbose=false
+                       ;;
+
+      --tag)           test "$#" -eq 0 && func_missing_arg "$opt" && break
+                       preserve_args="$preserve_args $opt $1"
+                       func_enable_tag "$1"    # tagname is set here
+                       shift
+                       ;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+                       func_opt_split "$opt"
+                       set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+                       shift
+                       ;;
+
+      -\?|-h)          func_usage                                      ;;
+      --help)          opt_help=:                                      ;;
+      --help-all)      opt_help=': help-all'                           ;;
+      --version)       func_version                                    ;;
+
+      -*)              func_fatal_help "unrecognized option \`$opt'"   ;;
+
+      *)               nonopt="$opt"
+                       break
+                       ;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
+
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
+  fi
+
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+       for lalib_p_l in 1 2 3 4
+       do
+           read lalib_p_line
+           case "$lalib_p_line" in
+               \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+           esac
+       done
+       exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+       func_dirname_and_basename "$1" "" "."
+       func_stripname '' '.exe' "$func_basename_result"
+       func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)        . "$1" ;;
+    *)         . "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+       CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+           CC_quoted=
+           for arg in $CC; do
+             # Double-quote args containing other shell metacharacters.
+             func_quote_for_eval "$arg"
+             CC_quoted="$CC_quoted $func_quote_for_eval_result"
+           done
+           CC_expanded=`func_echo_all $CC`
+           CC_quoted_expanded=`func_echo_all $CC_quoted`
+           case "$@ " in
+           " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+           " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+             # The compiler in the base compile command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         func_echo "unable to infer tagged configuration"
+         func_fatal_error "specify a tag with \`--tag'"
+#      else
+#        func_verbose "using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg="$arg"
+       arg_mode=normal
+       ;;
+
+      target )
+       libobj="$arg"
+       arg_mode=normal
+       continue
+       ;;
+
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         test -n "$libobj" && \
+           func_fatal_error "you cannot specify \`-o' more than once"
+         arg_mode=target
+         continue
+         ;;
+
+       -pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+         continue
+         ;;
+
+       -shared | -static | -prefer-pic | -prefer-non-pic)
+         later="$later $arg"
+         continue
+         ;;
+
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
+
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
+
+       -Wc,*)
+         func_stripname '-Wc,' '' "$arg"
+         args=$func_stripname_result
+         lastarg=
+         save_ifs="$IFS"; IFS=','
+         for arg in $args; do
+           IFS="$save_ifs"
+           func_quote_for_eval "$arg"
+           lastarg="$lastarg $func_quote_for_eval_result"
+         done
+         IFS="$save_ifs"
+         func_stripname ' ' '' "$lastarg"
+         lastarg=$func_stripname_result
+
+         # Add the arguments to base_compile.
+         base_compile="$base_compile $lastarg"
+         continue
+         ;;
+
+       *)
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg="$srcfile"
+         srcfile="$arg"
+         ;;
+       esac  #  case $arg
+       ;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+       func_basename "$srcfile"
+       libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       continue
+       ;;
+
+      -static)
+       build_libtool_libs=no
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'   &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+       $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+       command="$base_compile $qsrcfile $pic_flag"
+      else
+       # Don't build PIC code
+       command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+       # Place PIC objects in $objdir
+       command="$command -o $lobj"
+      fi
+
+      func_show_eval_locale "$command" \
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+       func_show_eval '$MV "$output_obj" "$lobj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+       suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+       # Don't build PIC code
+       command="$base_compile $qsrcfile$pie_flag"
+      else
+       command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+       command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+       func_show_eval '$MV "$output_obj" "$obj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+       removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for mode in compile link execute install finish uninstall clean; do
+       func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for mode in compile link execute install finish uninstall clean; do
+       echo
+       func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+       H
+       d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+       || func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+       # Read the libtool library.
+       dlname=
+       library_names=
+       func_source "$file"
+
+       # Skip this library if it cannot be dlopened.
+       if test -z "$dlname"; then
+         # Warn if it was a shared library.
+         test -n "$library_names" && \
+           func_warning "\`$file' was not linked with \`-export-dynamic'"
+         continue
+       fi
+
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+
+       if test -f "$dir/$objdir/$dlname"; then
+         dir="$dir/$objdir"
+       else
+         if test ! -f "$dir/$dlname"; then
+           func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+         fi
+       fi
+       ;;
+
+      *.lo)
+       # Just add the directory containing the .lo file.
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       ;;
+
+      *)
+       func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+       continue
+       ;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+       eval "$shlibpath_var=\"\$dir\""
+      else
+       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+       # Do a test to see if this is really a libtool program.
+       if func_ltwrapper_script_p "$file"; then
+         func_source "$file"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       elif func_ltwrapper_executable_p "$file"; then
+         func_ltwrapper_scriptname "$file"
+         func_source "$func_ltwrapper_scriptname_result"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       fi
+       ;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+       # Export the shlibpath_var.
+       eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+       eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+             else
+               $lt_unset $lt_var
+             fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+       eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+       echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+       libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+       if test -n "$finish_cmds"; then
+         # Do each command in the finish commands.
+         func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+       fi
+       if test -n "$finish_eval"; then
+         # Do the single finish_eval.
+         eval cmds=\"$finish_eval\"
+         $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+       fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    echo "----------------------------------------------------------------------"
+    echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    echo
+    echo "If you ever happen to want to link against installed libraries"
+    echo "in a given directory, LIBDIR, you must either use libtool, and"
+    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $ECHO "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    echo
+
+    echo "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+       echo "pages."
+       ;;
+      *)
+        echo "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+       files="$files $dest"
+       dest=$arg
+       continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+       if $install_cp; then :; else
+         prev=$arg
+       fi
+       ;;
+      -g | -m | -o)
+       prev=$arg
+       ;;
+      -s)
+       stripme=" -s"
+       continue
+       ;;
+      -*)
+       ;;
+      *)
+       # If the previous option needed an argument, then skip it.
+       if test -n "$prev"; then
+         if test "x$prev" = x-m && test -n "$install_override_mode"; then
+           arg2=$install_override_mode
+           no_mode=false
+         fi
+         prev=
+       else
+         dest=$arg
+         continue
+       fi
+       ;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+       func_quote_for_eval "$arg2"
+      fi
+      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+       func_quote_for_eval "$install_override_mode"
+       install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+       func_fatal_help "no file or destination specified"
+      else
+       func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+       func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+       case $file in
+       *.lo) ;;
+       *)
+         func_fatal_help "\`$destdir' must be an absolute directory name"
+         ;;
+       esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+       # Do the static libraries later.
+       staticlibs="$staticlibs $file"
+       ;;
+
+      *.la)
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$file' is not a valid libtool archive"
+
+       library_names=
+       old_library=
+       relink_command=
+       func_source "$file"
+
+       # Add the libdir to current_libdirs if it is the destination.
+       if test "X$destdir" = "X$libdir"; then
+         case "$current_libdirs " in
+         *" $libdir "*) ;;
+         *) current_libdirs="$current_libdirs $libdir" ;;
+         esac
+       else
+         # Note the libdir as a future libdir.
+         case "$future_libdirs " in
+         *" $libdir "*) ;;
+         *) future_libdirs="$future_libdirs $libdir" ;;
+         esac
+       fi
+
+       func_dirname "$file" "/" ""
+       dir="$func_dirname_result"
+       dir="$dir$objdir"
+
+       if test -n "$relink_command"; then
+         # Determine the prefix the user has applied to our future dir.
+         inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+         # Don't allow the user to place us outside of our expected
+         # location b/c this prevents finding dependent libraries that
+         # are installed to the same prefix.
+         # At present, this check doesn't affect windows .dll's that
+         # are installed into $libdir/../bin (currently, that works fine)
+         # but it's something to keep an eye on.
+         test "$inst_prefix_dir" = "$destdir" && \
+           func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+         if test -n "$inst_prefix_dir"; then
+           # Stick the inst_prefix_dir data into the link command.
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+         else
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+         fi
+
+         func_warning "relinking \`$file'"
+         func_show_eval "$relink_command" \
+           'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+       fi
+
+       # See the names of the shared library.
+       set dummy $library_names; shift
+       if test -n "$1"; then
+         realname="$1"
+         shift
+
+         srcname="$realname"
+         test -n "$relink_command" && srcname="$realname"T
+
+         # Install the shared library and build the symlinks.
+         func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+             'exit $?'
+         tstripme="$stripme"
+         case $host_os in
+         cygwin* | mingw* | pw32* | cegcc*)
+           case $realname in
+           *.dll.a)
+             tstripme=""
+             ;;
+           esac
+           ;;
+         esac
+         if test -n "$tstripme" && test -n "$striplib"; then
+           func_show_eval "$striplib $destdir/$realname" 'exit $?'
+         fi
+
+         if test "$#" -gt 0; then
+           # Delete the old symlinks, and create new ones.
+           # Try `ln -sf' first, because the `ln' binary might depend on
+           # the symlink we replace!  Solaris /bin/ln does not understand -f,
+           # so we also need to try rm && ln -s.
+           for linkname
+           do
+             test "$linkname" != "$realname" \
+               && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+           done
+         fi
+
+         # Do each command in the postinstall commands.
+         lib="$destdir/$realname"
+         func_execute_cmds "$postinstall_cmds" 'exit $?'
+       fi
+
+       # Install the pseudo-library for information purposes.
+       func_basename "$file"
+       name="$func_basename_result"
+       instname="$dir/$name"i
+       func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+       # Maybe install the static library, too.
+       test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+       ;;
+
+      *.lo)
+       # Install (i.e. copy) a libtool object.
+
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # Deduce the name of the destination old-style object file.
+       case $destfile in
+       *.lo)
+         func_lo2o "$destfile"
+         staticdest=$func_lo2o_result
+         ;;
+       *.$objext)
+         staticdest="$destfile"
+         destfile=
+         ;;
+       *)
+         func_fatal_help "cannot copy a libtool object to \`$destfile'"
+         ;;
+       esac
+
+       # Install the libtool object if requested.
+       test -n "$destfile" && \
+         func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+       # Install the old object if enabled.
+       if test "$build_old_libs" = yes; then
+         # Deduce the name of the old-style object file.
+         func_lo2o "$file"
+         staticobj=$func_lo2o_result
+         func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+       fi
+       exit $EXIT_SUCCESS
+       ;;
+
+      *)
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             func_stripname '' '.exe' "$file"
+             file=$func_stripname_result
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
+       # Do a test to see if this is really a libtool program.
+       case $host in
+       *cygwin* | *mingw*)
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             wrapper=$func_ltwrapper_scriptname_result
+           else
+             func_stripname '' '.exe' "$file"
+             wrapper=$func_stripname_result
+           fi
+           ;;
+       *)
+           wrapper=$file
+           ;;
+       esac
+       if func_ltwrapper_script_p "$wrapper"; then
+         notinst_deplibs=
+         relink_command=
+
+         func_source "$wrapper"
+
+         # Check the variables that should have been set.
+         test -z "$generated_by_libtool_version" && \
+           func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+         finalize=yes
+         for lib in $notinst_deplibs; do
+           # Check to see that each library is installed.
+           libdir=
+           if test -f "$lib"; then
+             func_source "$lib"
+           fi
+           libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+           if test -n "$libdir" && test ! -f "$libfile"; then
+             func_warning "\`$lib' has not been installed in \`$libdir'"
+             finalize=no
+           fi
+         done
+
+         relink_command=
+         func_source "$wrapper"
+
+         outputname=
+         if test "$fast_install" = no && test -n "$relink_command"; then
+           $opt_dry_run || {
+             if test "$finalize" = yes; then
+               tmpdir=`func_mktempdir`
+               func_basename "$file$stripped_ext"
+               file="$func_basename_result"
+               outputname="$tmpdir/$file"
+               # Replace the output file specification.
+               relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+               $opt_silent || {
+                 func_quote_for_expand "$relink_command"
+                 eval "func_echo $func_quote_for_expand_result"
+               }
+               if eval "$relink_command"; then :
+                 else
+                 func_error "error: relink \`$file' with the above command before installing it"
+                 $opt_dry_run || ${RM}r "$tmpdir"
+                 continue
+               fi
+               file="$outputname"
+             else
+               func_warning "cannot relink \`$file'"
+             fi
+           }
+         else
+           # Install the binary that we compiled earlier.
+           file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+         fi
+       fi
+
+       # remove .exe since cygwin /usr/bin/install will append another
+       # one anyway
+       case $install_prog,$host in
+       */usr/bin/install*,*cygwin*)
+         case $file:$destfile in
+         *.exe:*.exe)
+           # this is ok
+           ;;
+         *.exe:*)
+           destfile=$destfile.exe
+           ;;
+         *:*.exe)
+           func_stripname '' '.exe' "$destfile"
+           destfile=$func_stripname_result
+           ;;
+         esac
+         ;;
+       esac
+       func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+       $opt_dry_run || if test -n "$outputname"; then
+         ${RM}r "$tmpdir"
+       fi
+       ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+       func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+       my_dlsyms="${my_outputname}S.c"
+      else
+       func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+       # Discover the nlist of each of the dlfiles.
+       nlist="$output_objdir/${my_outputname}.nm"
+
+       func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+       # Parse the name list into a source file.
+       func_verbose "creating $output_objdir/$my_dlsyms"
+
+       $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+       if test "$dlself" = yes; then
+         func_verbose "generating symbol list for \`$output'"
+
+         $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+         # Add our own program objects to the symbol list.
+         progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+         for progfile in $progfiles; do
+           func_verbose "extracting global C symbols from \`$progfile'"
+           $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+         done
+
+         if test -n "$exclude_expsyms"; then
+           $opt_dry_run || {
+             eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         if test -n "$export_symbols_regex"; then
+           $opt_dry_run || {
+             eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         # Prepare the list of exported symbols
+         if test -z "$export_symbols"; then
+           export_symbols="$output_objdir/$outputname.exp"
+           $opt_dry_run || {
+             $RM $export_symbols
+             eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+             case $host in
+             *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+               ;;
+             esac
+           }
+         else
+           $opt_dry_run || {
+             eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+             case $host in
+               *cygwin* | *mingw* | *cegcc* )
+                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                 ;;
+             esac
+           }
+         fi
+       fi
+
+       for dlprefile in $dlprefiles; do
+         func_verbose "extracting global C symbols from \`$dlprefile'"
+         func_basename "$dlprefile"
+         name="$func_basename_result"
+         $opt_dry_run || {
+           eval '$ECHO ": $name " >> "$nlist"'
+           eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+         }
+       done
+
+       $opt_dry_run || {
+         # Make sure we have at least an empty file.
+         test -f "$nlist" || : > "$nlist"
+
+         if test -n "$exclude_expsyms"; then
+           $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+           $MV "$nlist"T "$nlist"
+         fi
+
+         # Try sorting and uniquifying the output.
+         if $GREP -v "^: " < "$nlist" |
+             if sort -k 3 </dev/null >/dev/null 2>&1; then
+               sort -k 3
+             else
+               sort +2
+             fi |
+             uniq > "$nlist"S; then
+           :
+         else
+           $GREP -v "^: " < "$nlist" > "$nlist"S
+         fi
+
+         if test -f "$nlist"S; then
+           eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+         else
+           echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+         fi
+
+         echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+         case $host in
+         *cygwin* | *mingw* | *cegcc* )
+           echo >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+           lt_dlsym_const= ;;
+         *osf5*)
+           echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+           lt_dlsym_const= ;;
+         *)
+           lt_dlsym_const=const ;;
+         esac
+
+         echo >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+         case $need_lib_prefix in
+         no)
+           eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         *)
+           eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         esac
+         echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+       } # !$opt_dry_run
+
+       pic_flag_for_symtable=
+       case "$compile_command " in
+       *" -static "*) ;;
+       *)
+         case $host in
+         # compiling the symbol table file with pic_flag works around
+         # a FreeBSD bug that causes programs to crash when -lm is
+         # linked before any other PIC object.  But we must not use
+         # pic_flag when linking with -static.  The problem exists in
+         # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+         *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+           pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+         *-*-hpux*)
+           pic_flag_for_symtable=" $pic_flag"  ;;
+         *)
+           if test "X$my_pic_p" != Xno; then
+             pic_flag_for_symtable=" $pic_flag"
+           fi
+           ;;
+         esac
+         ;;
+       esac
+       symtab_cflags=
+       for arg in $LTCFLAGS; do
+         case $arg in
+         -pie | -fpie | -fPIE) ;;
+         *) symtab_cflags="$symtab_cflags $arg" ;;
+         esac
+       done
+
+       # Now compile the dynamic symbol file.
+       func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+       # Clean up the generated files.
+       func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+       # Transform the symbol file into the correct name.
+       symfileobj="$output_objdir/${my_outputname}S.$objext"
+       case $host in
+       *cygwin* | *mingw* | *cegcc* )
+         if test -f "$output_objdir/$my_outputname.def"; then
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+         else
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         fi
+         ;;
+       *)
+         compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         ;;
+       esac
+       ;;
+      *)
+       func_fatal_error "unknown suffix for \`$my_dlsyms'"
+       ;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+       $SED -n -e '
+           1,100{
+               / I /{
+                   s,.*,import,
+                   p
+                   q
+               }
+           }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+                  'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         func_arith $extracted_serial + 1
+         extracted_serial=$func_arith_result
+         my_xlib_u=lt$extracted_serial-$my_xlib ;;
+       *) break ;;
+       esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+       func_verbose "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       $opt_dry_run || {
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`basename "$darwin_archive"`
+         darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+         if test -n "$darwin_arches"; then
+           darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+             $LIPO -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           $RM -rf unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd $darwin_orig_dir
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       } # !$opt_dry_run
+       ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+       ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+       func_emit_wrapper_arg1=${1-no}
+
+       $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  for lt_wr_arg
+  do
+    case \$lt_wr_arg in
+    --lt-*) ;;
+    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+    esac
+    shift
+  done
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+       if test "$fast_install" = yes; then
+         $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+         $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+       $ECHO \"\$relink_command_output\" >&2
+       $RM \"\$progdir/\$file\"
+       exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+       else
+         $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+       fi
+
+       $ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+       # Export our shlibpath_var if we have one.
+       if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+         $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+       fi
+
+       # fixup the dll searchpath if we need to.
+       if test -n "$dllsearchpath"; then
+         $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+       fi
+
+       $ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
+              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_result=`cygpath -w "$1" |
+             $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  \`$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1"; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+       func_stripname : : "$1"
+        func_to_host_pathlist_tmp1=$func_stripname_result
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            func_to_host_pathlist_result=`
+             ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
+             $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
+                  fi
+                fi
+              fi
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result"; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  \`$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_append func_to_host_pathlist_result ";"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+       cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+           cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+       (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+           cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+           if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+             cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+           else
+             cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+             cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+           else
+             cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test "$fast_install" = yes; then
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+           else
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+           fi
+
+
+           cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+       {
+EOF
+           case "$host" in
+             *mingw* | *cygwin* )
+               # make stdout use "unix" line endings
+               echo "          setmode(1,_O_BINARY);"
+               ;;
+             esac
+
+           cat <<"EOF"
+         lt_dump_script (stdout);
+         return 0;
+       }
+      if (strcmp (argv[i], debug_opt) == 0)
+       {
+          lt_debug = 1;
+          continue;
+       }
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+                   "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+           cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+           cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+                 tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+                 actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(main) libtool target name: %s\n",
+                 target_name);
+EOF
+
+           cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+                   strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+           cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+           case $host_os in
+             mingw*)
+           cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+       *p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+       *p = '/';
+      }
+  }
+EOF
+           ;;
+           esac
+
+           cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+                 nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+                     i, nonnull (newargz[i]));
+    }
+
+EOF
+
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+                     "(main) failed to launch target \"%s\": %s\n",
+                     lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+               ;;
+             *)
+               cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+               ;;
+           esac
+
+           cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+                         string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+       return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+       {
+         concat_name = xstrdup (wrapper);
+         if (check_executable (concat_name))
+           return concat_name;
+         XFREE (concat_name);
+       }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+       has_slash = 1;
+       break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+       {
+         for (p = path; *p; p = p_next)
+           {
+             const char *q;
+             size_t p_len;
+             for (q = p; *q; q++)
+               if (IS_PATH_SEPARATOR (*q))
+                 break;
+             p_len = q - p;
+             p_next = (*q == '\0' ? q : q + 1);
+             if (p_len == 0)
+               {
+                 /* empty path: current directory */
+                 if (getcwd (tmp, LT_PATHMAX) == NULL)
+                   lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+                 tmp_len = strlen (tmp);
+                 concat_name =
+                   XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, tmp, tmp_len);
+                 concat_name[tmp_len] = '/';
+                 strcpy (concat_name + tmp_len + 1, wrapper);
+               }
+             else
+               {
+                 concat_name =
+                   XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, p, p_len);
+                 concat_name[p_len] = '/';
+                 strcpy (concat_name + p_len + 1, wrapper);
+               }
+             if (check_executable (concat_name))
+               return concat_name;
+             XFREE (concat_name);
+           }
+       }
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+                     "checking path component for symlinks: %s\n",
+                     tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+       {
+         if (S_ISLNK (s.st_mode) != 0)
+           {
+             has_symlinks = 1;
+             break;
+           }
+
+         /* search backwards for last DIR_SEPARATOR */
+         p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+         while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           p--;
+         if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           {
+             /* no more DIR_SEPARATORS left */
+             break;
+           }
+         *p = '\0';
+       }
+      else
+       {
+         lt_fatal (__FILE__, __LINE__,
+                   "error accessing file \"%s\": %s",
+                   tmp_pathspec, nonnull (strerror (errno)));
+       }
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+               "could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+       *str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+              int line, const char *mode,
+              const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+       new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+       {
+         int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+         size_t length;
+         unsigned int backslashes;
+         const char *s;
+         char *quoted_string;
+         char *p;
+
+         length = 0;
+         backslashes = 0;
+         if (quote_around)
+           length++;
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               length += backslashes + 1;
+             length++;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           length += backslashes + 1;
+
+         quoted_string = XMALLOC (char, length + 1);
+
+         p = quoted_string;
+         backslashes = 0;
+         if (quote_around)
+           *p++ = '"';
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               {
+                 unsigned int j;
+                 for (j = backslashes + 1; j > 0; j--)
+                   *p++ = '\\';
+               }
+             *p++ = c;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           {
+             unsigned int j;
+             for (j = backslashes; j > 0; j--)
+               *p++ = '\\';
+             *p++ = '"';
+           }
+         *p = '\0';
+
+         new_argv[i] = quoted_string;
+       }
+      else
+       new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+               ;;
+           esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+           func_emit_wrapper yes |
+              $SED -e 's/\([\\"]\)/\\\1/g' \
+                  -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
+
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       break
+       ;;
+      -all-static | -static | -static-libtool-libs)
+       case $arg in
+       -all-static)
+         if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+           func_warning "complete static linking is impossible in this configuration"
+         fi
+         if test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       -static)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=built
+         ;;
+       -static-libtool-libs)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       esac
+       build_libtool_libs=no
+       build_old_libs=yes
+       break
+       ;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+       case $prev in
+       output)
+         func_append compile_command " @OUTPUT@"
+         func_append finalize_command " @OUTPUT@"
+         ;;
+       esac
+
+       case $prev in
+       bindir)
+         bindir="$arg"
+         prev=
+         continue
+         ;;
+       dlfiles|dlprefiles)
+         if test "$preload" = no; then
+           # Add the symbol object into the linking commands.
+           func_append compile_command " @SYMFILE@"
+           func_append finalize_command " @SYMFILE@"
+           preload=yes
+         fi
+         case $arg in
+         *.la | *.lo) ;;  # We handle these cases below.
+         force)
+           if test "$dlself" = no; then
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         self)
+           if test "$prev" = dlprefiles; then
+             dlself=yes
+           elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+             dlself=yes
+           else
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         *)
+           if test "$prev" = dlfiles; then
+             dlfiles="$dlfiles $arg"
+           else
+             dlprefiles="$dlprefiles $arg"
+           fi
+           prev=
+           continue
+           ;;
+         esac
+         ;;
+       expsyms)
+         export_symbols="$arg"
+         test -f "$arg" \
+           || func_fatal_error "symbol file \`$arg' does not exist"
+         prev=
+         continue
+         ;;
+       expsyms_regex)
+         export_symbols_regex="$arg"
+         prev=
+         continue
+         ;;
+       framework)
+         case $host in
+           *-*-darwin*)
+             case "$deplibs " in
+               *" $qarg.ltframework "*) ;;
+               *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+                  ;;
+             esac
+             ;;
+         esac
+         prev=
+         continue
+         ;;
+       inst_prefix)
+         inst_prefix_dir="$arg"
+         prev=
+         continue
+         ;;
+       objectlist)
+         if test -f "$arg"; then
+           save_arg=$arg
+           moreargs=
+           for fil in `cat "$save_arg"`
+           do
+#            moreargs="$moreargs $fil"
+             arg=$fil
+             # A libtool-controlled object.
+
+             # Check to see that this really is a libtool object.
+             if func_lalib_unsafe_p "$arg"; then
+               pic_object=
+               non_pic_object=
+
+               # Read the .lo file
+               func_source "$arg"
+
+               if test -z "$pic_object" ||
+                  test -z "$non_pic_object" ||
+                  test "$pic_object" = none &&
+                  test "$non_pic_object" = none; then
+                 func_fatal_error "cannot find name of object for \`$arg'"
+               fi
+
+               # Extract subdirectory from the argument.
+               func_dirname "$arg" "/" ""
+               xdir="$func_dirname_result"
+
+               if test "$pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object="$xdir$pic_object"
+
+                 if test "$prev" = dlfiles; then
+                   if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+                     dlfiles="$dlfiles $pic_object"
+                     prev=
+                     continue
+                   else
+                     # If libtool objects are unsupported, then we need to preload.
+                     prev=dlprefiles
+                   fi
+                 fi
+
+                 # CHECK ME:  I think I busted this.  -Ossama
+                 if test "$prev" = dlprefiles; then
+                   # Preload the old-style object.
+                   dlprefiles="$dlprefiles $pic_object"
+                   prev=
+                 fi
+
+                 # A PIC object.
+                 func_append libobjs " $pic_object"
+                 arg="$pic_object"
+               fi
+
+               # Non-PIC object.
+               if test "$non_pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 non_pic_object="$xdir$non_pic_object"
+
+                 # A standard non-PIC object
+                 func_append non_pic_objects " $non_pic_object"
+                 if test -z "$pic_object" || test "$pic_object" = none ; then
+                   arg="$non_pic_object"
+                 fi
+               else
+                 # If the PIC object exists, use it instead.
+                 # $xdir was prepended to $pic_object above.
+                 non_pic_object="$pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               fi
+             else
+               # Only an error if not doing a dry-run.
+               if $opt_dry_run; then
+                 # Extract subdirectory from the argument.
+                 func_dirname "$arg" "/" ""
+                 xdir="$func_dirname_result"
+
+                 func_lo2o "$arg"
+                 pic_object=$xdir$objdir/$func_lo2o_result
+                 non_pic_object=$xdir$func_lo2o_result
+                 func_append libobjs " $pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               else
+                 func_fatal_error "\`$arg' is not a valid libtool object"
+               fi
+             fi
+           done
+         else
+           func_fatal_error "link input file \`$arg' does not exist"
+         fi
+         arg=$save_arg
+         prev=
+         continue
+         ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
+       release)
+         release="-$arg"
+         prev=
+         continue
+         ;;
+       rpath | xrpath)
+         # We need an absolute path.
+         case $arg in
+         [\\/]* | [A-Za-z]:[\\/]*) ;;
+         *)
+           func_fatal_error "only absolute run-paths are allowed"
+           ;;
+         esac
+         if test "$prev" = rpath; then
+           case "$rpath " in
+           *" $arg "*) ;;
+           *) rpath="$rpath $arg" ;;
+           esac
+         else
+           case "$xrpath " in
+           *" $arg "*) ;;
+           *) xrpath="$xrpath $arg" ;;
+           esac
+         fi
+         prev=
+         continue
+         ;;
+       shrext)
+         shrext_cmds="$arg"
+         prev=
+         continue
+         ;;
+       weak)
+         weak_libs="$weak_libs $arg"
+         prev=
+         continue
+         ;;
+       xcclinker)
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xcompiler)
+         compiler_flags="$compiler_flags $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xlinker)
+         linker_flags="$linker_flags $qarg"
+         compiler_flags="$compiler_flags $wl$qarg"
+         prev=
+         func_append compile_command " $wl$qarg"
+         func_append finalize_command " $wl$qarg"
+         continue
+         ;;
+       *)
+         eval "$prev=\"\$arg\""
+         prev=
+         continue
+         ;;
+       esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+       if test -n "$link_static_flag"; then
+         # See comment for -static flag below, for more details.
+         func_append compile_command " $link_static_flag"
+         func_append finalize_command " $link_static_flag"
+       fi
+       continue
+       ;;
+
+      -allow-undefined)
+       # FIXME: remove this flag sometime in the future.
+       func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+       ;;
+
+      -avoid-version)
+       avoid_version=yes
+       continue
+       ;;
+
+      -bindir)
+       prev=bindir
+       continue
+       ;;
+
+      -dlopen)
+       prev=dlfiles
+       continue
+       ;;
+
+      -dlpreopen)
+       prev=dlprefiles
+       continue
+       ;;
+
+      -export-dynamic)
+       export_dynamic=yes
+       continue
+       ;;
+
+      -export-symbols | -export-symbols-regex)
+       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+         func_fatal_error "more than one -exported-symbols argument is not allowed"
+       fi
+       if test "X$arg" = "X-export-symbols"; then
+         prev=expsyms
+       else
+         prev=expsyms_regex
+       fi
+       continue
+       ;;
+
+      -framework)
+       prev=framework
+       continue
+       ;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+       case $with_gcc/$host in
+       no/*-*-irix* | /*-*-irix*)
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+         ;;
+       esac
+       continue
+       ;;
+
+      -L*)
+       func_stripname '-L' '' "$arg"
+       dir=$func_stripname_result
+       if test -z "$dir"; then
+         if test "$#" -gt 0; then
+           func_fatal_error "require no space between \`-L' and \`$1'"
+         else
+           func_fatal_error "need path for \`-L' option"
+         fi
+       fi
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         absdir=`cd "$dir" && pwd`
+         test -z "$absdir" && \
+           func_fatal_error "cannot determine absolute directory name of \`$dir'"
+         dir="$absdir"
+         ;;
+       esac
+       case "$deplibs " in
+       *" -L$dir "*) ;;
+       *)
+         deplibs="$deplibs -L$dir"
+         lib_search_path="$lib_search_path $dir"
+         ;;
+       esac
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$dir:"*) ;;
+         ::) dllsearchpath=$dir;;
+         *) dllsearchpath="$dllsearchpath:$dir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
+         ;;
+       esac
+       continue
+       ;;
+
+      -l*)
+       if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # These systems don't actually have a C or math library (as such)
+           continue
+           ;;
+         *-*-os2*)
+           # These systems don't actually have a C library (as such)
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C and math libraries are in the System framework
+           deplibs="$deplibs System.ltframework"
+           continue
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test "X$arg" = "X-lc" && continue
+           ;;
+         esac
+       elif test "X$arg" = "X-lc_r"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
+       fi
+       deplibs="$deplibs $arg"
+       continue
+       ;;
+
+      -module)
+       module=yes
+       continue
+       ;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
+       compiler_flags="$compiler_flags $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+       compiler_flags="$compiler_flags $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       case "$new_inherited_linker_flags " in
+           *" $arg "*) ;;
+           * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+       esac
+       continue
+       ;;
+
+      -multi_module)
+       single_module="${wl}-multi_module"
+       continue
+       ;;
+
+      -no-fast-install)
+       fast_install=no
+       continue
+       ;;
+
+      -no-install)
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # and Darwin in order for the loader to find any dlls it needs.
+         func_warning "\`-no-install' is ignored for $host"
+         func_warning "assuming \`-no-fast-install' instead"
+         fast_install=no
+         ;;
+       *) no_install=yes ;;
+       esac
+       continue
+       ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
+      -release)
+       prev=release
+       continue
+       ;;
+
+      -rpath)
+       prev=rpath
+       continue
+       ;;
+
+      -R)
+       prev=xrpath
+       continue
+       ;;
+
+      -R*)
+       func_stripname '-R' '' "$arg"
+       dir=$func_stripname_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         func_fatal_error "only absolute run-paths are allowed"
+         ;;
+       esac
+       case "$xrpath " in
+       *" $dir "*) ;;
+       *) xrpath="$xrpath $dir" ;;
+       esac
+       continue
+       ;;
+
+      -shared)
+       # The effects of -shared are defined in a previous loop.
+       continue
+       ;;
+
+      -shrext)
+       prev=shrext
+       continue
+       ;;
+
+      -static | -static-libtool-libs)
+       # The effects of -static are defined in a previous loop.
+       # We used to do the same as -all-static on platforms that
+       # didn't have a PIC flag, but the assumption that the effects
+       # would be equivalent was wrong.  It would break on at least
+       # Digital Unix and AIX.
+       continue
+       ;;
+
+      -thread-safe)
+       thread_safe=yes
+       continue
+       ;;
+
+      -version-info)
+       prev=vinfo
+       continue
+       ;;
+
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
+
+      -weak)
+        prev=weak
+       continue
+       ;;
+
+      -Wc,*)
+       func_stripname '-Wc,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         arg="$arg $func_quote_for_eval_result"
+         compiler_flags="$compiler_flags $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Wl,*)
+       func_stripname '-Wl,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         arg="$arg $wl$func_quote_for_eval_result"
+         compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+         linker_flags="$linker_flags $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Xcompiler)
+       prev=xcompiler
+       continue
+       ;;
+
+      -Xlinker)
+       prev=xlinker
+       continue
+       ;;
+
+      -XCClinker)
+       prev=xcclinker
+       continue
+       ;;
+
+      # -msg_* for osf cc
+      -msg_*)
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      *.$objext)
+       # A standard object.
+       objs="$objs $arg"
+       ;;
+
+      *.lo)
+       # A libtool-controlled object.
+
+       # Check to see that this really is a libtool object.
+       if func_lalib_unsafe_p "$arg"; then
+         pic_object=
+         non_pic_object=
+
+         # Read the .lo file
+         func_source "$arg"
+
+         if test -z "$pic_object" ||
+            test -z "$non_pic_object" ||
+            test "$pic_object" = none &&
+            test "$non_pic_object" = none; then
+           func_fatal_error "cannot find name of object for \`$arg'"
+         fi
+
+         # Extract subdirectory from the argument.
+         func_dirname "$arg" "/" ""
+         xdir="$func_dirname_result"
+
+         if test "$pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           pic_object="$xdir$pic_object"
+
+           if test "$prev" = dlfiles; then
+             if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+               dlfiles="$dlfiles $pic_object"
+               prev=
+               continue
+             else
+               # If libtool objects are unsupported, then we need to preload.
+               prev=dlprefiles
+             fi
+           fi
+
+           # CHECK ME:  I think I busted this.  -Ossama
+           if test "$prev" = dlprefiles; then
+             # Preload the old-style object.
+             dlprefiles="$dlprefiles $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           func_append libobjs " $pic_object"
+           arg="$pic_object"
+         fi
+
+         # Non-PIC object.
+         if test "$non_pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           non_pic_object="$xdir$non_pic_object"
+
+           # A standard non-PIC object
+           func_append non_pic_objects " $non_pic_object"
+           if test -z "$pic_object" || test "$pic_object" = none ; then
+             arg="$non_pic_object"
+           fi
+         else
+           # If the PIC object exists, use it instead.
+           # $xdir was prepended to $pic_object above.
+           non_pic_object="$pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         fi
+       else
+         # Only an error if not doing a dry-run.
+         if $opt_dry_run; then
+           # Extract subdirectory from the argument.
+           func_dirname "$arg" "/" ""
+           xdir="$func_dirname_result"
+
+           func_lo2o "$arg"
+           pic_object=$xdir$objdir/$func_lo2o_result
+           non_pic_object=$xdir$func_lo2o_result
+           func_append libobjs " $pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         else
+           func_fatal_error "\`$arg' is not a valid libtool object"
+         fi
+       fi
+       ;;
+
+      *.$libext)
+       # An archive.
+       deplibs="$deplibs $arg"
+       old_deplibs="$old_deplibs $arg"
+       continue
+       ;;
+
+      *.la)
+       # A libtool-controlled library.
+
+       if test "$prev" = dlfiles; then
+         # This library was specified with -dlopen.
+         dlfiles="$dlfiles $arg"
+         prev=
+       elif test "$prev" = dlprefiles; then
+         # The library was specified with -dlpreopen.
+         dlprefiles="$dlprefiles $arg"
+         prev=
+       else
+         deplibs="$deplibs $arg"
+       fi
+       continue
+       ;;
+
+      # Some other compiler argument.
+      *)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_duplicate_deps ; then
+       case "$libs " in
+       *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+       esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+         esac
+         pre_post_deps="$pre_post_deps $pre_post_dep"
+       done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+       passes="conv dlpreopen link"
+       for file in $dlfiles $dlprefiles; do
+         case $file in
+         *.la) ;;
+         *)
+           func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+           ;;
+         esac
+       done
+       ;;
+    prog)
+       compile_deplibs=
+       finalize_deplibs=
+       alldeplibs=no
+       newdlfiles=
+       newdlprefiles=
+       passes="conv scan dlopen dlpreopen link"
+       ;;
+    *)  passes="conv"
+       ;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+       ## FIXME: Find the place where the list is rebuilt in the wrong
+       ##        order, and fix it there properly
+        tmp_deplibs=
+       for deplib in $deplibs; do
+         tmp_deplibs="$deplib $tmp_deplibs"
+       done
+       deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+        test "$linkmode,$pass" = "prog,scan"; then
+       libs="$deplibs"
+       deplibs=
+      fi
+      if test "$linkmode" = prog; then
+       case $pass in
+       dlopen) libs="$dlfiles" ;;
+       dlpreopen) libs="$dlprefiles" ;;
+       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+       esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+       # Collect and forward deplibs of preopened libtool libs
+       for lib in $dlprefiles; do
+         # Ignore non-libtool-libs
+         dependency_libs=
+         case $lib in
+         *.la) func_source "$lib" ;;
+         esac
+
+         # Collect preopened libtool deplibs, except any this library
+         # has declared as weak libs
+         for deplib in $dependency_libs; do
+           func_basename "$deplib"
+            deplib_base=$func_basename_result
+           case " $weak_libs " in
+           *" $deplib_base "*) ;;
+           *) deplibs="$deplibs $deplib" ;;
+           esac
+         done
+       done
+       libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+       # Collect dlpreopened libraries
+       save_deplibs="$deplibs"
+       deplibs=
+      fi
+
+      for deplib in $libs; do
+       lib=
+       found=no
+       case $deplib in
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           compiler_flags="$compiler_flags $deplib"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -l*)
+         if test "$linkmode" != lib && test "$linkmode" != prog; then
+           func_warning "\`-l' is ignored for archives/objects"
+           continue
+         fi
+         func_stripname '-l' '' "$deplib"
+         name=$func_stripname_result
+         if test "$linkmode" = lib; then
+           searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+         else
+           searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+         fi
+         for searchdir in $searchdirs; do
+           for search_ext in .la $std_shrext .so .a; do
+             # Search the libtool library
+             lib="$searchdir/lib${name}${search_ext}"
+             if test -f "$lib"; then
+               if test "$search_ext" = ".la"; then
+                 found=yes
+               else
+                 found=no
+               fi
+               break 2
+             fi
+           done
+         done
+         if test "$found" != yes; then
+           # deplib doesn't seem to be a libtool library
+           if test "$linkmode,$pass" = "prog,link"; then
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             deplibs="$deplib $deplibs"
+             test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+           fi
+           continue
+         else # deplib is a libtool library
+           # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+           # We need to do some special things here, and not later.
+           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+             case " $predeps $postdeps " in
+             *" $deplib "*)
+               if func_lalib_p "$lib"; then
+                 library_names=
+                 old_library=
+                 func_source "$lib"
+                 for l in $old_library $library_names; do
+                   ll="$l"
+                 done
+                 if test "X$ll" = "X$old_library" ; then # only static version available
+                   found=no
+                   func_dirname "$lib" "" "."
+                   ladir="$func_dirname_result"
+                   lib=$ladir/$old_library
+                   if test "$linkmode,$pass" = "prog,link"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
+         fi
+         ;; # -l
+       *.ltframework)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           deplibs="$deplib $deplibs"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -L*)
+         case $linkmode in
+         lib)
+           deplibs="$deplib $deplibs"
+           test "$pass" = conv && continue
+           newdependency_libs="$deplib $newdependency_libs"
+           func_stripname '-L' '' "$deplib"
+           newlib_search_path="$newlib_search_path $func_stripname_result"
+           ;;
+         prog)
+           if test "$pass" = conv; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test "$pass" = scan; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           func_stripname '-L' '' "$deplib"
+           newlib_search_path="$newlib_search_path $func_stripname_result"
+           ;;
+         *)
+           func_warning "\`-L' is ignored for archives/objects"
+           ;;
+         esac # linkmode
+         continue
+         ;; # -L
+       -R*)
+         if test "$pass" = link; then
+           func_stripname '-R' '' "$deplib"
+           dir=$func_stripname_result
+           # Make sure the xrpath contains only unique directories.
+           case "$xrpath " in
+           *" $dir "*) ;;
+           *) xrpath="$xrpath $dir" ;;
+           esac
+         fi
+         deplibs="$deplib $deplibs"
+         continue
+         ;;
+       *.la) lib="$deplib" ;;
+       *.$libext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
+         case $linkmode in
+         lib)
+           # Linking convenience modules into shared libraries is allowed,
+           # but linking other static libraries is non-portable.
+           case " $dlpreconveniencelibs " in
+           *" $deplib "*) ;;
+           *)
+             valid_a_lib=no
+             case $deplibs_check_method in
+               match_pattern*)
+                 set dummy $deplibs_check_method; shift
+                 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+                 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                   valid_a_lib=yes
+                 fi
+               ;;
+               pass_all)
+                 valid_a_lib=yes
+               ;;
+             esac
+             if test "$valid_a_lib" != yes; then
+               echo
+               $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because the file extensions .$libext of this argument makes me believe"
+               echo "*** that it is just a static archive that I should not use here."
+             else
+               echo
+               $ECHO "*** Warning: Linking the shared library $output against the"
+               $ECHO "*** static library $deplib is not portable!"
+               deplibs="$deplib $deplibs"
+             fi
+             ;;
+           esac
+           continue
+           ;;
+         prog)
+           if test "$pass" != link; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           continue
+           ;;
+         esac # linkmode
+         ;; # *.$libext
+       *.lo | *.$objext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+             # If there is no dlopen support or we're linking statically,
+             # we need to preload.
+             newdlprefiles="$newdlprefiles $deplib"
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             newdlfiles="$newdlfiles $deplib"
+           fi
+         fi
+         continue
+         ;;
+       %DEPLIBS%)
+         alldeplibs=yes
+         continue
+         ;;
+       esac # case $deplib
+
+       if test "$found" = yes || test -f "$lib"; then :
+       else
+         func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+       fi
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$lib" \
+         || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+       func_dirname "$lib" "" "."
+       ladir="$func_dirname_result"
+
+       dlname=
+       dlopen=
+       dlpreopen=
+       libdir=
+       library_names=
+       old_library=
+       inherited_linker_flags=
+       # If the library was installed with an old release of libtool,
+       # it will not redefine variables installed, or shouldnotlink
+       installed=yes
+       shouldnotlink=no
+       avoidtemprpath=
+
+
+       # Read the .la file
+       func_source "$lib"
+
+       # Convert "-framework foo" to "foo.ltframework"
+       if test -n "$inherited_linker_flags"; then
+         tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+         for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+           case " $new_inherited_linker_flags " in
+             *" $tmp_inherited_linker_flag "*) ;;
+             *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+           esac
+         done
+       fi
+       dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       if test "$linkmode,$pass" = "lib,link" ||
+          test "$linkmode,$pass" = "prog,scan" ||
+          { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+         test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+         test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+       fi
+
+       if test "$pass" = conv; then
+         # Only check for convenience libraries
+         deplibs="$lib $deplibs"
+         if test -z "$libdir"; then
+           if test -z "$old_library"; then
+             func_fatal_error "cannot find name of link library for \`$lib'"
+           fi
+           # It is a libtool convenience library, so add in its objects.
+           convenience="$convenience $ladir/$objdir/$old_library"
+           old_convenience="$old_convenience $ladir/$objdir/$old_library"
+         elif test "$linkmode" != prog && test "$linkmode" != lib; then
+           func_fatal_error "\`$lib' is not a convenience library"
+         fi
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           deplibs="$deplib $deplibs"
+           if $opt_duplicate_deps ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
+           tmp_libs="$tmp_libs $deplib"
+         done
+         continue
+       fi # $pass = conv
+
+
+       # Get the name of the library we link against.
+       linklib=
+       for l in $old_library $library_names; do
+         linklib="$l"
+       done
+       if test -z "$linklib"; then
+         func_fatal_error "cannot find name of link library for \`$lib'"
+       fi
+
+       # This library was specified with -dlopen.
+       if test "$pass" = dlopen; then
+         if test -z "$libdir"; then
+           func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+         fi
+         if test -z "$dlname" ||
+            test "$dlopen_support" != yes ||
+            test "$build_libtool_libs" = no; then
+           # If there is no dlname, no dlopen support or we're linking
+           # statically, we need to preload.  We also need to preload any
+           # dependent libraries so libltdl's deplib preloader doesn't
+           # bomb out in the load deplibs phase.
+           dlprefiles="$dlprefiles $lib $dependency_libs"
+         else
+           newdlfiles="$newdlfiles $lib"
+         fi
+         continue
+       fi # $pass = dlopen
+
+       # We need an absolute path.
+       case $ladir in
+       [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+       *)
+         abs_ladir=`cd "$ladir" && pwd`
+         if test -z "$abs_ladir"; then
+           func_warning "cannot determine absolute directory name of \`$ladir'"
+           func_warning "passing it literally to the linker, although it might fail"
+           abs_ladir="$ladir"
+         fi
+         ;;
+       esac
+       func_basename "$lib"
+       laname="$func_basename_result"
+
+       # Find the relevant object directory and library name.
+       if test "X$installed" = Xyes; then
+         if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           func_warning "library \`$lib' was moved."
+           dir="$ladir"
+           absdir="$abs_ladir"
+           libdir="$abs_ladir"
+         else
+           dir="$libdir"
+           absdir="$libdir"
+         fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+       else
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           notinst_path="$notinst_path $abs_ladir"
+         fi
+       fi # $installed = yes
+       func_stripname 'lib' '.la' "$laname"
+       name=$func_stripname_result
+
+       # This library was specified with -dlpreopen.
+       if test "$pass" = dlpreopen; then
+         if test -z "$libdir" && test "$linkmode" = prog; then
+           func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+         fi
+         # Prefer using a static library (so that no silly _DYNAMIC symbols
+         # are required to link).
+         if test -n "$old_library"; then
+           newdlprefiles="$newdlprefiles $dir/$old_library"
+           # Keep a list of preopened convenience libraries to check
+           # that they are being used correctly in the link pass.
+           test -z "$libdir" && \
+               dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+         # Otherwise, use the dlname, so that lt_dlopen finds it.
+         elif test -n "$dlname"; then
+           newdlprefiles="$newdlprefiles $dir/$dlname"
+         else
+           newdlprefiles="$newdlprefiles $dir/$linklib"
+         fi
+       fi # $pass = dlpreopen
+
+       if test -z "$libdir"; then
+         # Link the convenience library
+         if test "$linkmode" = lib; then
+           deplibs="$dir/$old_library $deplibs"
+         elif test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$dir/$old_library $compile_deplibs"
+           finalize_deplibs="$dir/$old_library $finalize_deplibs"
+         else
+           deplibs="$lib $deplibs" # used for prog,scan pass
+         fi
+         continue
+       fi
+
+
+       if test "$linkmode" = prog && test "$pass" != link; then
+         newlib_search_path="$newlib_search_path $ladir"
+         deplibs="$lib $deplibs"
+
+         linkalldeplibs=no
+         if test "$link_all_deplibs" != no || test -z "$library_names" ||
+            test "$build_libtool_libs" = no; then
+           linkalldeplibs=yes
+         fi
+
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           case $deplib in
+           -L*) func_stripname '-L' '' "$deplib"
+                newlib_search_path="$newlib_search_path $func_stripname_result"
+                ;;
+           esac
+           # Need to link against all dependency_libs?
+           if test "$linkalldeplibs" = yes; then
+             deplibs="$deplib $deplibs"
+           else
+             # Need to hardcode shared library paths
+             # or/and link against static libraries
+             newdependency_libs="$deplib $newdependency_libs"
+           fi
+           if $opt_duplicate_deps ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
+           tmp_libs="$tmp_libs $deplib"
+         done # for deplib
+         continue
+       fi # $linkmode = prog...
+
+       if test "$linkmode,$pass" = "prog,link"; then
+         if test -n "$library_names" &&
+            { { test "$prefer_static_libs" = no ||
+                test "$prefer_static_libs,$installed" = "built,yes"; } ||
+              test -z "$old_library"; }; then
+           # We need to hardcode the library path
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+             # Make sure the rpath contains only unique directories.
+             case "$temp_rpath:" in
+             *"$absdir:"*) ;;
+             *) temp_rpath="$temp_rpath$absdir:" ;;
+             esac
+           fi
+
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) compile_rpath="$compile_rpath $absdir"
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) finalize_rpath="$finalize_rpath $libdir"
+             esac
+             ;;
+           esac
+         fi # $linkmode,$pass = prog,link...
+
+         if test "$alldeplibs" = yes &&
+            { test "$deplibs_check_method" = pass_all ||
+              { test "$build_libtool_libs" = yes &&
+                test -n "$library_names"; }; }; then
+           # We only need to search for static libraries
+           continue
+         fi
+       fi
+
+       link_static=no # Whether the deplib will be linked statically
+       use_static_libs=$prefer_static_libs
+       if test "$use_static_libs" = built && test "$installed" = yes; then
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
+         case $host in
+         *cygwin* | *mingw* | *cegcc*)
+             # No point in relinking DLLs because paths are not encoded
+             notinst_deplibs="$notinst_deplibs $lib"
+             need_relink=no
+           ;;
+         *)
+           if test "$installed" = no; then
+             notinst_deplibs="$notinst_deplibs $lib"
+             need_relink=yes
+           fi
+           ;;
+         esac
+         # This is a shared library
+
+         # Warn about portability, can't link against -module's on some
+         # systems (darwin).  Don't bleat about dlopened modules though!
+         dlopenmodule=""
+         for dlpremoduletest in $dlprefiles; do
+           if test "X$dlpremoduletest" = "X$lib"; then
+             dlopenmodule="$dlpremoduletest"
+             break
+           fi
+         done
+         if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+           echo
+           if test "$linkmode" = prog; then
+             $ECHO "*** Warning: Linking the executable $output against the loadable module"
+           else
+             $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+           fi
+           $ECHO "*** $linklib is not portable!"
+         fi
+         if test "$linkmode" = lib &&
+            test "$hardcode_into_libs" = yes; then
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) compile_rpath="$compile_rpath $absdir"
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) finalize_rpath="$finalize_rpath $libdir"
+             esac
+             ;;
+           esac
+         fi
+
+         if test -n "$old_archive_from_expsyms_cmds"; then
+           # figure out the soname
+           set dummy $library_names
+           shift
+           realname="$1"
+           shift
+           libname=`eval "\\$ECHO \"$libname_spec\""`
+           # use dlname if we got it. it's perfectly good, no?
+           if test -n "$dlname"; then
+             soname="$dlname"
+           elif test -n "$soname_spec"; then
+             # bleh windows
+             case $host in
+             *cygwin* | mingw* | *cegcc*)
+               func_arith $current - $age
+               major=$func_arith_result
+               versuffix="-$major"
+               ;;
+             esac
+             eval soname=\"$soname_spec\"
+           else
+             soname="$realname"
+           fi
+
+           # Make a new name for the extract_expsyms_cmds to use
+           soroot="$soname"
+           func_basename "$soroot"
+           soname="$func_basename_result"
+           func_stripname 'lib' '.dll' "$soname"
+           newlib=libimp-$func_stripname_result.a
+
+           # If the library has no export list, then create one now
+           if test -f "$output_objdir/$soname-def"; then :
+           else
+             func_verbose "extracting exported symbol list from \`$soname'"
+             func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+           fi
+
+           # Create $newlib
+           if test -f "$output_objdir/$newlib"; then :; else
+             func_verbose "generating import library for \`$soname'"
+             func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+           fi
+           # make sure the library variables are pointing to the new library
+           dir=$output_objdir
+           linklib=$newlib
+         fi # test -n "$old_archive_from_expsyms_cmds"
+
+         if test "$linkmode" = prog || test "$mode" != relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           lib_linked=yes
+           case $hardcode_action in
+           immediate | unsupported)
+             if test "$hardcode_direct" = no; then
+               add="$dir/$linklib"
+               case $host in
+                 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+                 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+                 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+                   *-*-unixware7*) add_dir="-L$dir" ;;
+                 *-*-darwin* )
+                   # if the lib is a (non-dlopened) module then we can not
+                   # link against it, someone is ignoring the earlier warnings
+                   if /usr/bin/file -L $add 2> /dev/null |
+                        $GREP ": [^:]* bundle" >/dev/null ; then
+                     if test "X$dlopenmodule" != "X$lib"; then
+                       $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+                       if test -z "$old_library" ; then
+                         echo
+                         echo "*** And there doesn't seem to be a static archive available"
+                         echo "*** The link will probably fail, sorry"
+                       else
+                         add="$dir/$old_library"
+                       fi
+                     elif test -n "$old_library"; then
+                       add="$dir/$old_library"
+                     fi
+                   fi
+               esac
+             elif test "$hardcode_minus_L" = no; then
+               case $host in
+               *-*-sunos*) add_shlibpath="$dir" ;;
+               esac
+               add_dir="-L$dir"
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = no; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           relink)
+             if test "$hardcode_direct" = yes &&
+                test "$hardcode_direct_absolute" = no; then
+               add="$dir/$linklib"
+             elif test "$hardcode_minus_L" = yes; then
+               add_dir="-L$dir"
+               # Try looking first in the location we're being installed to.
+               if test -n "$inst_prefix_dir"; then
+                 case $libdir in
+                   [\\/]*)
+                     add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = yes; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           *) lib_linked=no ;;
+           esac
+
+           if test "$lib_linked" != yes; then
+             func_fatal_configuration "unsupported hardcode properties"
+           fi
+
+           if test -n "$add_shlibpath"; then
+             case :$compile_shlibpath: in
+             *":$add_shlibpath:"*) ;;
+             *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+             esac
+           fi
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+             test -n "$add" && compile_deplibs="$add $compile_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+             if test "$hardcode_direct" != yes &&
+                test "$hardcode_minus_L" != yes &&
+                test "$hardcode_shlibpath_var" = yes; then
+               case :$finalize_shlibpath: in
+               *":$libdir:"*) ;;
+               *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+               esac
+             fi
+           fi
+         fi
+
+         if test "$linkmode" = prog || test "$mode" = relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
+           if test "$hardcode_direct" = yes &&
+              test "$hardcode_direct_absolute" = no; then
+             add="$libdir/$linklib"
+           elif test "$hardcode_minus_L" = yes; then
+             add_dir="-L$libdir"
+             add="-l$name"
+           elif test "$hardcode_shlibpath_var" = yes; then
+             case :$finalize_shlibpath: in
+             *":$libdir:"*) ;;
+             *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+             esac
+             add="-l$name"
+           elif test "$hardcode_automatic" = yes; then
+             if test -n "$inst_prefix_dir" &&
+                test -f "$inst_prefix_dir$libdir/$linklib" ; then
+               add="$inst_prefix_dir$libdir/$linklib"
+             else
+               add="$libdir/$linklib"
+             fi
+           else
+             # We cannot seem to hardcode it, guess we'll fake it.
+             add_dir="-L$libdir"
+             # Try looking first in the location we're being installed to.
+             if test -n "$inst_prefix_dir"; then
+               case $libdir in
+                 [\\/]*)
+                   add_dir="$add_dir -L$inst_prefix_dir$libdir"
+                   ;;
+               esac
+             fi
+             add="-l$name"
+           fi
+
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+             test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+           fi
+         fi
+       elif test "$linkmode" = prog; then
+         # Here we assume that one of hardcode_direct or hardcode_minus_L
+         # is not unsupported.  This is valid on all known static and
+         # shared platforms.
+         if test "$hardcode_direct" != unsupported; then
+           test -n "$old_library" && linklib="$old_library"
+           compile_deplibs="$dir/$linklib $compile_deplibs"
+           finalize_deplibs="$dir/$linklib $finalize_deplibs"
+         else
+           compile_deplibs="-l$name -L$dir $compile_deplibs"
+           finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+         fi
+       elif test "$build_libtool_libs" = yes; then
+         # Not a shared library
+         if test "$deplibs_check_method" != pass_all; then
+           # We're trying link a shared library against a static one
+           # but the system doesn't support it.
+
+           # Just print a warning and add the library to dependency_libs so
+           # that the program can be linked against the static library.
+           echo
+           $ECHO "*** Warning: This system can not link to static lib archive $lib."
+           echo "*** I have the capability to make that library automatically link in when"
+           echo "*** you link to this library.  But I can only do this if you have a"
+           echo "*** shared version of the library, which you do not appear to have."
+           if test "$module" = yes; then
+             echo "*** But as you try to build a module library, libtool will still create "
+             echo "*** a static module, that should work as long as the dlopening application"
+             echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+             if test -z "$global_symbol_pipe"; then
+               echo
+               echo "*** However, this would only work if libtool was able to extract symbol"
+               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+               echo "*** not find such a program.  So, this module is probably useless."
+               echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             fi
+             if test "$build_old_libs" = no; then
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         else
+           deplibs="$dir/$old_library $deplibs"
+           link_static=yes
+         fi
+       fi # link shared/static library?
+
+       if test "$linkmode" = lib; then
+         if test -n "$dependency_libs" &&
+            { test "$hardcode_into_libs" != yes ||
+              test "$build_old_libs" = yes ||
+              test "$link_static" = yes; }; then
+           # Extract -R from dependency_libs
+           temp_deplibs=
+           for libdir in $dependency_libs; do
+             case $libdir in
+             -R*) func_stripname '-R' '' "$libdir"
+                  temp_xrpath=$func_stripname_result
+                  case " $xrpath " in
+                  *" $temp_xrpath "*) ;;
+                  *) xrpath="$xrpath $temp_xrpath";;
+                  esac;;
+             *) temp_deplibs="$temp_deplibs $libdir";;
+             esac
+           done
+           dependency_libs="$temp_deplibs"
+         fi
+
+         newlib_search_path="$newlib_search_path $absdir"
+         # Link against this library
+         test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+         # ... and its dependency_libs
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           newdependency_libs="$deplib $newdependency_libs"
+           if $opt_duplicate_deps ; then
+             case "$tmp_libs " in
+             *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+             esac
+           fi
+           tmp_libs="$tmp_libs $deplib"
+         done
+
+         if test "$link_all_deplibs" != no; then
+           # Add the search paths of all dependency libraries
+           for deplib in $dependency_libs; do
+             path=
+             case $deplib in
+             -L*) path="$deplib" ;;
+             *.la)
+               func_dirname "$deplib" "" "."
+               dir="$func_dirname_result"
+               # We need an absolute path.
+               case $dir in
+               [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+               *)
+                 absdir=`cd "$dir" && pwd`
+                 if test -z "$absdir"; then
+                   func_warning "cannot determine absolute directory name of \`$dir'"
+                   absdir="$dir"
+                 fi
+                 ;;
+               esac
+               if $GREP "^installed=no" $deplib > /dev/null; then
+               case $host in
+               *-*-darwin*)
+                 depdepl=
+                 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+                 if test -n "$deplibrary_names" ; then
+                   for tmp in $deplibrary_names ; do
+                     depdepl=$tmp
+                   done
+                   if test -f "$absdir/$objdir/$depdepl" ; then
+                     depdepl="$absdir/$objdir/$depdepl"
+                     darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+                     compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+                     linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+                     path=
+                   fi
+                 fi
+                 ;;
+               *)
+                 path="-L$absdir/$objdir"
+                 ;;
+               esac
+               else
+                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+                 test -z "$libdir" && \
+                   func_fatal_error "\`$deplib' is not a valid libtool archive"
+                 test "$absdir" != "$libdir" && \
+                   func_warning "\`$deplib' seems to be moved"
+
+                 path="-L$absdir"
+               fi
+               ;;
+             esac
+             case " $deplibs " in
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
+             esac
+           done
+         fi # link_all_deplibs != no
+       fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+       if test "$linkmode" = "prog"; then
+         compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+         finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+       else
+         compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+       # Link the dlpreopened libraries before other libraries
+       for deplib in $save_deplibs; do
+         deplibs="$deplib $deplibs"
+       done
+      fi
+      if test "$pass" != dlopen; then
+       if test "$pass" != conv; then
+         # Make sure lib_search_path contains only unique directories.
+         lib_search_path=
+         for dir in $newlib_search_path; do
+           case "$lib_search_path " in
+           *" $dir "*) ;;
+           *) lib_search_path="$lib_search_path $dir" ;;
+           esac
+         done
+         newlib_search_path=
+       fi
+
+       if test "$linkmode,$pass" != "prog,link"; then
+         vars="deplibs"
+       else
+         vars="compile_deplibs finalize_deplibs"
+       fi
+       for var in $vars dependency_libs; do
+         # Add libraries to $var in reverse order
+         eval tmp_libs=\"\$$var\"
+         new_libs=
+         for deplib in $tmp_libs; do
+           # FIXME: Pedantically, this is the right thing to do, so
+           #        that some nasty dependency loop isn't accidentally
+           #        broken:
+           #new_libs="$deplib $new_libs"
+           # Pragmatically, this seems to cause very few problems in
+           # practice:
+           case $deplib in
+           -L*) new_libs="$deplib $new_libs" ;;
+           -R*) ;;
+           *)
+             # And here is the reason: when a library appears more
+             # than once as an explicit dependence of a library, or
+             # is implicitly linked in more than once by the
+             # compiler, it is considered special, and multiple
+             # occurrences thereof are not removed.  Compare this
+             # with having the same library being listed as a
+             # dependency of multiple other libraries: in this case,
+             # we know (pedantically, we assume) the library does not
+             # need to be listed more than once, so we keep only the
+             # last copy.  This is not always right, but it is rare
+             # enough that we require users that really mean to play
+             # such unportable linking tricks to link the library
+             # using -Wl,-lname, so that libtool does not consider it
+             # for duplicate removal.
+             case " $specialdeplibs " in
+             *" $deplib "*) new_libs="$deplib $new_libs" ;;
+             *)
+               case " $new_libs " in
+               *" $deplib "*) ;;
+               *) new_libs="$deplib $new_libs" ;;
+               esac
+               ;;
+             esac
+             ;;
+           esac
+         done
+         tmp_libs=
+         for deplib in $new_libs; do
+           case $deplib in
+           -L*)
+             case " $tmp_libs " in
+             *" $deplib "*) ;;
+             *) tmp_libs="$tmp_libs $deplib" ;;
+             esac
+             ;;
+           *) tmp_libs="$tmp_libs $deplib" ;;
+           esac
+         done
+         eval $var=\"$tmp_libs\"
+       done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+       case " $predeps $postdeps $compiler_lib_search_path " in
+       *" $i "*)
+         i=""
+         ;;
+       esac
+       if test -n "$i" ; then
+         tmp_libs="$tmp_libs $i"
+       fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+       func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+       func_stripname 'lib' '.la' "$outputname"
+       name=$func_stripname_result
+       eval shared_ext=\"$shrext_cmds\"
+       eval libname=\"$libname_spec\"
+       ;;
+      *)
+       test "$module" = no && \
+         func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+       if test "$need_lib_prefix" != no; then
+         # Add the "lib" prefix for modules if required
+         func_stripname '' '.la' "$outputname"
+         name=$func_stripname_result
+         eval shared_ext=\"$shrext_cmds\"
+         eval libname=\"$libname_spec\"
+       else
+         func_stripname '' '.la' "$outputname"
+         libname=$func_stripname_result
+       fi
+       ;;
+      esac
+
+      if test -n "$objs"; then
+       if test "$deplibs_check_method" != pass_all; then
+         func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+       else
+         echo
+         $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+         $ECHO "*** objects $objs is not portable!"
+         libobjs="$libobjs $objs"
+       fi
+      fi
+
+      test "$dlself" != no && \
+       func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+       func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+       if test "$build_libtool_libs" = yes; then
+         # Building a libtool convenience library.
+         # Some compilers have problems with a `.al' extension so
+         # convenience libraries should have the same extension an
+         # archive normally would.
+         oldlibs="$output_objdir/$libname.$libext $oldlibs"
+         build_libtool_libs=convenience
+         build_old_libs=yes
+       fi
+
+       test -n "$vinfo" && \
+         func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+       test -n "$release" && \
+         func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+       # Parse the version information argument.
+       save_ifs="$IFS"; IFS=':'
+       set dummy $vinfo 0 0 0
+       shift
+       IFS="$save_ifs"
+
+       test -n "$7" && \
+         func_fatal_help "too many parameters to \`-version-info'"
+
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+
+       case $vinfo_number in
+       yes)
+         number_major="$1"
+         number_minor="$2"
+         number_revision="$3"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # which has an extra 1 added just for fun
+         #
+         case $version_type in
+         darwin|linux|osf|windows|none)
+           func_arith $number_major + $number_minor
+           current=$func_arith_result
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|qnx|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           func_arith $number_major + $number_minor
+           current=$func_arith_result
+           age="$number_minor"
+           revision="$number_minor"
+           lt_irix_increment=no
+           ;;
+         esac
+         ;;
+       no)
+         current="$1"
+         revision="$2"
+         age="$3"
+         ;;
+       esac
+
+       # Check that each of the things are valid numbers.
+       case $current in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "CURRENT \`$current' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $revision in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "REVISION \`$revision' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $age in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "AGE \`$age' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       if test "$age" -gt "$current"; then
+         func_error "AGE \`$age' is greater than the current interface number \`$current'"
+         func_fatal_error "\`$vinfo' is not valid version information"
+       fi
+
+       # Calculate the version variables.
+       major=
+       versuffix=
+       verstring=
+       case $version_type in
+       none) ;;
+
+       darwin)
+         # Like Linux, but with the current version available in
+         # verstring for coding it into the library header
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         # Darwin ld doesn't like 0 for these options...
+         func_arith $current + 1
+         minor_current=$func_arith_result
+         xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+         ;;
+
+       freebsd-aout)
+         major=".$current"
+         versuffix=".$current.$revision";
+         ;;
+
+       freebsd-elf)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       irix | nonstopux)
+         if test "X$lt_irix_increment" = "Xno"; then
+           func_arith $current - $age
+         else
+           func_arith $current - $age + 1
+         fi
+         major=$func_arith_result
+
+         case $version_type in
+           nonstopux) verstring_prefix=nonstopux ;;
+           *)         verstring_prefix=sgi ;;
+         esac
+         verstring="$verstring_prefix$major.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$revision
+         while test "$loop" -ne 0; do
+           func_arith $revision - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring_prefix$major.$iface:$verstring"
+         done
+
+         # Before this point, $major must not contain `.'.
+         major=.$major
+         versuffix="$major.$revision"
+         ;;
+
+       linux)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         ;;
+
+       osf)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=".$current.$age.$revision"
+         verstring="$current.$age.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$age
+         while test "$loop" -ne 0; do
+           func_arith $current - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring:${iface}.0"
+         done
+
+         # Make executables depend on our current version.
+         verstring="$verstring:${current}.0"
+         ;;
+
+       qnx)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       sunos)
+         major=".$current"
+         versuffix=".$current.$revision"
+         ;;
+
+       windows)
+         # Use '-' rather than '.', since we only want one
+         # extension on DOS 8.3 filesystems.
+         func_arith $current - $age
+         major=$func_arith_result
+         versuffix="-$major"
+         ;;
+
+       *)
+         func_fatal_configuration "unknown library version type \`$version_type'"
+         ;;
+       esac
+
+       # Clear the version info if we defaulted, and they specified a release.
+       if test -z "$vinfo" && test -n "$release"; then
+         major=
+         case $version_type in
+         darwin)
+           # we can't check for "0.0" in archive_cmds due to quoting
+           # problems, so we reset it completely
+           verstring=
+           ;;
+         *)
+           verstring="0.0"
+           ;;
+         esac
+         if test "$need_version" = no; then
+           versuffix=
+         else
+           versuffix=".0.0"
+         fi
+       fi
+
+       # Remove version info from name if versioning should be avoided
+       if test "$avoid_version" = yes && test "$need_version" = no; then
+         major=
+         versuffix=
+         verstring=""
+       fi
+
+       # Check to see if the archive will have undefined symbols.
+       if test "$allow_undefined" = yes; then
+         if test "$allow_undefined_flag" = unsupported; then
+           func_warning "undefined symbols not allowed in $host shared libraries"
+           build_libtool_libs=no
+           build_old_libs=yes
+         fi
+       else
+         # Don't allow undefined symbols.
+         allow_undefined_flag="$no_undefined_flag"
+       fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$mode" != relink; then
+       # Remove our outputs, but don't remove object files since they
+       # may have been created when compiling PIC objects.
+       removelist=
+       tempremovelist=`$ECHO "$output_objdir/*"`
+       for p in $tempremovelist; do
+         case $p in
+           *.$objext | *.gcno)
+              ;;
+           $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if test "X$precious_files_regex" != "X"; then
+                if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+                then
+                  continue
+                fi
+              fi
+              removelist="$removelist $p"
+              ;;
+           *) ;;
+         esac
+       done
+       test -n "$removelist" && \
+         func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+       oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+       # Transform .lo files to .o files.
+       oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #        lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #        deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #        dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       temp_xrpath=
+       for libdir in $xrpath; do
+         temp_xrpath="$temp_xrpath -R$libdir"
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         esac
+       done
+       if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+         dependency_libs="$temp_xrpath $dependency_libs"
+       fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+       case " $dlprefiles $dlfiles " in
+       *" $lib "*) ;;
+       *) dlfiles="$dlfiles $lib" ;;
+       esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+       case "$dlprefiles " in
+       *" $lib "*) ;;
+       *) dlprefiles="$dlprefiles $lib" ;;
+       esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+       if test -n "$rpath"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # these systems don't actually have a c library (as such)!
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C library is in the System framework
+           deplibs="$deplibs System.ltframework"
+           ;;
+         *-*-netbsd*)
+           # Don't link with libc until the a.out ld.so is fixed.
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           ;;
+         *)
+           # Add libc to deplibs on all other systems if necessary.
+           if test "$build_libtool_need_lc" = "yes"; then
+             deplibs="$deplibs -lc"
+           fi
+           ;;
+         esac
+       fi
+
+       # Transform deplibs into only deplibs that can be linked in shared.
+       name_save=$name
+       libname_save=$libname
+       release_save=$release
+       versuffix_save=$versuffix
+       major_save=$major
+       # I'm not sure if I'm treating the release correctly.  I think
+       # release should show up in the -l (ie -lgmp5) so we don't want to
+       # add it in twice.  Is that correct?
+       release=""
+       versuffix=""
+       major=""
+       newdeplibs=
+       droppeddeps=no
+       case $deplibs_check_method in
+       pass_all)
+         # Don't check for shared/static.  Everything works.
+         # This might be a little naive.  We might want to check
+         # whether the library exists or not.  But this is on
+         # osf3 & osf4 and I'm not really sure... Just
+         # implementing what was already the behavior.
+         newdeplibs=$deplibs
+         ;;
+       test_compile)
+         # This code stresses the "libraries are programs" paradigm to its
+         # limits. Maybe even breaks it.  We compile a program, linking it
+         # against the deplibs as a proxy for the library.  Then we can check
+         # whether they linked in statically or dynamically with ldd.
+         $opt_dry_run || $RM conftest.c
+         cat > conftest.c <<EOF
+         int main() { return 0; }
+EOF
+         $opt_dry_run || $RM conftest
+         if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+           ldd_output=`ldd conftest`
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                 case " $predeps $postdeps " in
+                 *" $i "*)
+                   newdeplibs="$newdeplibs $i"
+                   i=""
+                   ;;
+                 esac
+               fi
+               if test -n "$i" ; then
+                 libname=`eval "\\$ECHO \"$libname_spec\""`
+                 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                 set dummy $deplib_matches; shift
+                 deplib_match=$1
+                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                   newdeplibs="$newdeplibs $i"
+                 else
+                   droppeddeps=yes
+                   echo
+                   $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                   echo "*** I have the capability to make that library automatically link in when"
+                   echo "*** you link to this library.  But I can only do this if you have a"
+                   echo "*** shared version of the library, which I believe you do not have"
+                   echo "*** because a test_compile did reveal that the linker did not use it for"
+                   echo "*** its dynamic dependency list that programs get resolved with at runtime."
+                 fi
+               fi
+               ;;
+             *)
+               newdeplibs="$newdeplibs $i"
+               ;;
+             esac
+           done
+         else
+           # Error occurred in the first compile.  Let's try to salvage
+           # the situation: Compile a separate program for each library.
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               $opt_dry_run || $RM conftest
+               if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+                 ldd_output=`ldd conftest`
+                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                   case " $predeps $postdeps " in
+                   *" $i "*)
+                     newdeplibs="$newdeplibs $i"
+                     i=""
+                     ;;
+                   esac
+                 fi
+                 if test -n "$i" ; then
+                   libname=`eval "\\$ECHO \"$libname_spec\""`
+                   deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                   set dummy $deplib_matches; shift
+                   deplib_match=$1
+                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                     newdeplibs="$newdeplibs $i"
+                   else
+                     droppeddeps=yes
+                     echo
+                     $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                     echo "*** I have the capability to make that library automatically link in when"
+                     echo "*** you link to this library.  But I can only do this if you have a"
+                     echo "*** shared version of the library, which you do not appear to have"
+                     echo "*** because a test_compile did reveal that the linker did not use this one"
+                     echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+                   fi
+                 fi
+               else
+                 droppeddeps=yes
+                 echo
+                 $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+                 echo "*** make it link in!  You will probably need to install it or some"
+                 echo "*** library that it depends on before this library will be fully"
+                 echo "*** functional.  Installing it before continuing would be even better."
+               fi
+               ;;
+             *)
+               newdeplibs="$newdeplibs $i"
+               ;;
+             esac
+           done
+         fi
+         ;;
+       file_magic*)
+         set dummy $deplibs_check_method; shift
+         file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                     # Follow soft links.
+                     if ls -lLd "$potent_lib" 2>/dev/null |
+                        $GREP " -> " >/dev/null; then
+                       continue
+                     fi
+                     # The statement above tries to avoid entering an
+                     # endless loop below, in case of cyclic links.
+                     # We might still enter an endless loop, since a link
+                     # loop can be closed while we follow links,
+                     # but so what?
+                     potlib="$potent_lib"
+                     while test -h "$potlib" 2>/dev/null; do
+                       potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+                       case $potliblink in
+                       [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+                       *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+                       esac
+                     done
+                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+                        $SED -e 10q |
+                        $EGREP "$file_magic_regex" > /dev/null; then
+                       newdeplibs="$newdeplibs $a_deplib"
+                       a_deplib=""
+                       break 2
+                     fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a file magic. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             newdeplibs="$newdeplibs $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       match_pattern*)
+         set dummy $deplibs_check_method; shift
+         match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 newdeplibs="$newdeplibs $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                   potlib="$potent_lib" # see symlink-check above in file_magic test
+                   if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+                      $EGREP "$match_pattern_regex" > /dev/null; then
+                     newdeplibs="$newdeplibs $a_deplib"
+                     a_deplib=""
+                     break 2
+                   fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a regex pattern. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             newdeplibs="$newdeplibs $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       none | unknown | *)
+         newdeplibs=""
+         tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+         if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+           for i in $predeps $postdeps ; do
+             # can't use Xsed below, because $i might contain '/'
+             tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+           done
+         fi
+         case $tmp_deplibs in
+         *[!\  \ ]*)
+           echo
+           if test "X$deplibs_check_method" = "Xnone"; then
+             echo "*** Warning: inter-library dependencies are not supported in this platform."
+           else
+             echo "*** Warning: inter-library dependencies are not known to be supported."
+           fi
+           echo "*** All declared inter-library dependencies are being dropped."
+           droppeddeps=yes
+           ;;
+         esac
+         ;;
+       esac
+       versuffix=$versuffix_save
+       major=$major_save
+       release=$release_save
+       libname=$libname_save
+       name=$name_save
+
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+         # On Rhapsody replace the C library with the System framework
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+         ;;
+       esac
+
+       if test "$droppeddeps" = yes; then
+         if test "$module" = yes; then
+           echo
+           echo "*** Warning: libtool could not satisfy all declared inter-library"
+           $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+           echo "*** a static module, that should work as long as the dlopening"
+           echo "*** application is linked with the -dlopen flag."
+           if test -z "$global_symbol_pipe"; then
+             echo
+             echo "*** However, this would only work if libtool was able to extract symbol"
+             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+             echo "*** not find such a program.  So, this module is probably useless."
+             echo "*** \`nm' from GNU binutils and a full rebuild may help."
+           fi
+           if test "$build_old_libs" = no; then
+             oldlibs="$output_objdir/$libname.$libext"
+             build_libtool_libs=module
+             build_old_libs=yes
+           else
+             build_libtool_libs=no
+           fi
+         else
+           echo "*** The inter-library dependencies that have been dropped here will be"
+           echo "*** automatically added whenever a program is linked with this library"
+           echo "*** or is declared to -dlopen it."
+
+           if test "$allow_undefined" = no; then
+             echo
+             echo "*** Since this library must not contain undefined symbols,"
+             echo "*** because either the platform does not support them or"
+             echo "*** it was explicitly requested with -no-undefined,"
+             echo "*** libtool will only create a static version of it."
+             if test "$build_old_libs" = no; then
+               oldlibs="$output_objdir/$libname.$libext"
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         fi
+       fi
+       # Done checking deplibs!
+       deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+       *-*-darwin*)
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $deplibs " in
+         *" -L$path/$objdir "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+       if test "$hardcode_into_libs" = yes; then
+         # Hardcode the library paths
+         hardcode_libdirs=
+         dep_rpath=
+         rpath="$finalize_rpath"
+         test "$mode" != relink && rpath="$compile_rpath$rpath"
+         for libdir in $rpath; do
+           if test -n "$hardcode_libdir_flag_spec"; then
+             if test -n "$hardcode_libdir_separator"; then
+               if test -z "$hardcode_libdirs"; then
+                 hardcode_libdirs="$libdir"
+               else
+                 # Just accumulate the unique libdirs.
+                 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                   ;;
+                 *)
+                   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+                   ;;
+                 esac
+               fi
+             else
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               dep_rpath="$dep_rpath $flag"
+             fi
+           elif test -n "$runpath_var"; then
+             case "$perm_rpath " in
+             *" $libdir "*) ;;
+             *) perm_rpath="$perm_rpath $libdir" ;;
+             esac
+           fi
+         done
+         # Substitute the hardcoded libdirs into the rpath.
+         if test -n "$hardcode_libdir_separator" &&
+            test -n "$hardcode_libdirs"; then
+           libdir="$hardcode_libdirs"
+           if test -n "$hardcode_libdir_flag_spec_ld"; then
+             eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+           else
+             eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+           fi
+         fi
+         if test -n "$runpath_var" && test -n "$perm_rpath"; then
+           # We should set the runpath_var.
+           rpath=
+           for dir in $perm_rpath; do
+             rpath="$rpath$dir:"
+           done
+           eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+         fi
+         test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+       fi
+
+       shlibpath="$finalize_shlibpath"
+       test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+       if test -n "$shlibpath"; then
+         eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+       fi
+
+       # Get the real and link names of the library.
+       eval shared_ext=\"$shrext_cmds\"
+       eval library_names=\"$library_names_spec\"
+       set dummy $library_names
+       shift
+       realname="$1"
+       shift
+
+       if test -n "$soname_spec"; then
+         eval soname=\"$soname_spec\"
+       else
+         soname="$realname"
+       fi
+       if test -z "$dlname"; then
+         dlname=$soname
+       fi
+
+       lib="$output_objdir/$realname"
+       linknames=
+       for link
+       do
+         linknames="$linknames $link"
+       done
+
+       # Use standard objects if they are pic
+       test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       test "X$libobjs" = "X " && libobjs=
+
+       delfiles=
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+         export_symbols="$output_objdir/$libname.uexp"
+         delfiles="$delfiles $export_symbols"
+       fi
+
+       orig_export_symbols=
+       case $host_os in
+       cygwin* | mingw* | cegcc*)
+         if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+           # exporting using user supplied symfile
+           if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+             # and it's NOT already a .def file. Must figure out
+             # which of the given symbols are data symbols and tag
+             # them as such. So, trigger use of export_symbols_cmds.
+             # export_symbols gets reassigned inside the "prepare
+             # the list of exported symbols" if statement, so the
+             # include_expsyms logic still works.
+             orig_export_symbols="$export_symbols"
+             export_symbols=
+             always_export_symbols=yes
+           fi
+         fi
+         ;;
+       esac
+
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+           func_verbose "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $opt_dry_run || $RM $export_symbols
+           cmds=$export_symbols_cmds
+           save_ifs="$IFS"; IFS='~'
+           for cmd in $cmds; do
+             IFS="$save_ifs"
+             eval cmd=\"$cmd\"
+             func_len " $cmd"
+             len=$func_len_result
+             if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+               func_show_eval "$cmd" 'exit $?'
+               skipped_export=false
+             else
+               # The command line is too long to execute in one step.
+               func_verbose "using reloadable object file for export list..."
+               skipped_export=:
+               # Break out early, otherwise skipped_export may be
+               # set to false by a later but shorter cmd.
+               break
+             fi
+           done
+           IFS="$save_ifs"
+           if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+       fi
+
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         tmp_export_symbols="$export_symbols"
+         test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+         $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+       fi
+
+       if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+         # The given exports_symbols file has to be filtered, so filter it.
+         func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+         # FIXME: $output_objdir/$libname.filter potentially contains lots of
+         # 's' commands which not all seds can handle. GNU sed should be fine
+         # though. Also, the filter scales superlinearly with the number of
+         # global variables. join(1) would be nice here, but unfortunately
+         # isn't a blessed tool.
+         $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+         delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+         export_symbols=$output_objdir/$libname.def
+         $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+       fi
+
+       tmp_deplibs=
+       for test_deplib in $deplibs; do
+         case " $convenience " in
+         *" $test_deplib "*) ;;
+         *)
+           tmp_deplibs="$tmp_deplibs $test_deplib"
+           ;;
+         esac
+       done
+       deplibs="$tmp_deplibs"
+
+       if test -n "$convenience"; then
+         if test -n "$whole_archive_flag_spec" &&
+           test "$compiler_needs_object" = yes &&
+           test -z "$libobjs"; then
+           # extract the archives, so we have objects to list.
+           # TODO: could optimize this to just extract one archive.
+           whole_archive_flag_spec=
+         fi
+         if test -n "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         else
+           gentop="$output_objdir/${outputname}x"
+           generated="$generated $gentop"
+
+           func_extract_archives $gentop $convenience
+           libobjs="$libobjs $func_extract_archives_result"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+       fi
+
+       if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+         eval flag=\"$thread_safe_flag_spec\"
+         linker_flags="$linker_flags $flag"
+       fi
+
+       # Make a backup of the uninstalled library when relinking
+       if test "$mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+       fi
+
+       # Do each of the archive commands.
+       if test "$module" = yes && test -n "$module_cmds" ; then
+         if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+           eval test_cmds=\"$module_expsym_cmds\"
+           cmds=$module_expsym_cmds
+         else
+           eval test_cmds=\"$module_cmds\"
+           cmds=$module_cmds
+         fi
+       else
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           eval test_cmds=\"$archive_expsym_cmds\"
+           cmds=$archive_expsym_cmds
+         else
+           eval test_cmds=\"$archive_cmds\"
+           cmds=$archive_cmds
+         fi
+       fi
+
+       if test "X$skipped_export" != "X:" &&
+          func_len " $test_cmds" &&
+          len=$func_len_result &&
+          test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         :
+       else
+         # The command line is too long to link in one step, link piecewise
+         # or, if using GNU ld and skipped_export is not :, use a linker
+         # script.
+
+         # Save the value of $output and $libobjs because we want to
+         # use them later.  If we have whole_archive_flag_spec, we
+         # want to use save_libobjs as it was before
+         # whole_archive_flag_spec was expanded, because we can't
+         # assume the linker understands whole_archive_flag_spec.
+         # This may have to be revisited, in case too many
+         # convenience libraries get linked in and end up exceeding
+         # the spec.
+         if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+         fi
+         save_output=$output
+         func_basename "$output"
+         output_la=$func_basename_result
+
+         # Clear the reloadable object creation command queue and
+         # initialize k to one.
+         test_cmds=
+         concat_cmds=
+         objlist=
+         last_robj=
+         k=1
+
+         if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+           output=${output_objdir}/${output_la}.lnkscript
+           func_verbose "creating GNU ld script: $output"
+           echo 'INPUT (' > $output
+           for obj in $save_libobjs
+           do
+             $ECHO "$obj" >> $output
+           done
+           echo ')' >> $output
+           delfiles="$delfiles $output"
+         elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+           output=${output_objdir}/${output_la}.lnk
+           func_verbose "creating linker input file list: $output"
+           : > $output
+           set x $save_libobjs
+           shift
+           firstobj=
+           if test "$compiler_needs_object" = yes; then
+             firstobj="$1 "
+             shift
+           fi
+           for obj
+           do
+             $ECHO "$obj" >> $output
+           done
+           delfiles="$delfiles $output"
+           output=$firstobj\"$file_list_spec$output\"
+         else
+           if test -n "$save_libobjs"; then
+             func_verbose "creating reloadable object files..."
+             output=$output_objdir/$output_la-${k}.$objext
+             eval test_cmds=\"$reload_cmds\"
+             func_len " $test_cmds"
+             len0=$func_len_result
+             len=$len0
+
+             # Loop over the list of objects to be linked.
+             for obj in $save_libobjs
+             do
+               func_len " $obj"
+               func_arith $len + $func_len_result
+               len=$func_arith_result
+               if test "X$objlist" = X ||
+                  test "$len" -lt "$max_cmd_len"; then
+                 func_append objlist " $obj"
+               else
+                 # The command $test_cmds is almost too long, add a
+                 # command to the queue.
+                 if test "$k" -eq 1 ; then
+                   # The first file doesn't have a previous command to add.
+                   reload_objs=$objlist
+                   eval concat_cmds=\"$reload_cmds\"
+                 else
+                   # All subsequent reloadable object files will link in
+                   # the last one created.
+                   reload_objs="$objlist $last_robj"
+                   eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+                 fi
+                 last_robj=$output_objdir/$output_la-${k}.$objext
+                 func_arith $k + 1
+                 k=$func_arith_result
+                 output=$output_objdir/$output_la-${k}.$objext
+                 objlist=" $obj"
+                 func_len " $last_robj"
+                 func_arith $len0 + $func_len_result
+                 len=$func_arith_result
+               fi
+             done
+             # Handle the remaining objects by creating one last
+             # reloadable object file.  All subsequent reloadable object
+             # files will link in the last one created.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             reload_objs="$objlist $last_robj"
+             eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+             fi
+             delfiles="$delfiles $output"
+
+           else
+             output=
+           fi
+
+           if ${skipped_export-false}; then
+             func_verbose "generating symbol list for \`$libname.la'"
+             export_symbols="$output_objdir/$libname.exp"
+             $opt_dry_run || $RM $export_symbols
+             libobjs=$output
+             # Append the command to create the export file.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+             fi
+           fi
+
+           test -n "$save_libobjs" &&
+             func_verbose "creating a temporary reloadable object file: $output"
+
+           # Loop through the commands generated above and execute them.
+           save_ifs="$IFS"; IFS='~'
+           for cmd in $concat_cmds; do
+             IFS="$save_ifs"
+             $opt_silent || {
+                 func_quote_for_expand "$cmd"
+                 eval "func_echo $func_quote_for_expand_result"
+             }
+             $opt_dry_run || eval "$cmd" || {
+               lt_exit=$?
+
+               # Restore the uninstalled library and exit
+               if test "$mode" = relink; then
+                 ( cd "$output_objdir" && \
+                   $RM "${realname}T" && \
+                   $MV "${realname}U" "$realname" )
+               fi
+
+               exit $lt_exit
+             }
+           done
+           IFS="$save_ifs"
+
+           if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+
+          if ${skipped_export-false}; then
+           if test -n "$export_symbols" && test -n "$include_expsyms"; then
+             tmp_export_symbols="$export_symbols"
+             test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+             $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+           fi
+
+           if test -n "$orig_export_symbols"; then
+             # The given exports_symbols file has to be filtered, so filter it.
+             func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+             # FIXME: $output_objdir/$libname.filter potentially contains lots of
+             # 's' commands which not all seds can handle. GNU sed should be fine
+             # though. Also, the filter scales superlinearly with the number of
+             # global variables. join(1) would be nice here, but unfortunately
+             # isn't a blessed tool.
+             $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+             delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+             export_symbols=$output_objdir/$libname.def
+             $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+           fi
+         fi
+
+         libobjs=$output
+         # Restore the value of output.
+         output=$save_output
+
+         if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+         # Expand the library linking commands again to reset the
+         # value of $libobjs for piecewise linking.
+
+         # Do each of the archive commands.
+         if test "$module" = yes && test -n "$module_cmds" ; then
+           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+             cmds=$module_expsym_cmds
+           else
+             cmds=$module_cmds
+           fi
+         else
+           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+             cmds=$archive_expsym_cmds
+           else
+             cmds=$archive_cmds
+           fi
+         fi
+       fi
+
+       if test -n "$delfiles"; then
+         # Append the command to remove temporary files to $cmds.
+         eval cmds=\"\$cmds~\$RM $delfiles\"
+       fi
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         generated="$generated $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         libobjs="$libobjs $func_extract_archives_result"
+         test "X$libobjs" = "X " && libobjs=
+       fi
+
+       save_ifs="$IFS"; IFS='~'
+       for cmd in $cmds; do
+         IFS="$save_ifs"
+         eval cmd=\"$cmd\"
+         $opt_silent || {
+           func_quote_for_expand "$cmd"
+           eval "func_echo $func_quote_for_expand_result"
+         }
+         $opt_dry_run || eval "$cmd" || {
+           lt_exit=$?
+
+           # Restore the uninstalled library and exit
+           if test "$mode" = relink; then
+             ( cd "$output_objdir" && \
+               $RM "${realname}T" && \
+               $MV "${realname}U" "$realname" )
+           fi
+
+           exit $lt_exit
+         }
+       done
+       IFS="$save_ifs"
+
+       # Restore the uninstalled library and exit
+       if test "$mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+         if test -n "$convenience"; then
+           if test -z "$whole_archive_flag_spec"; then
+             func_show_eval '${RM}r "$gentop"'
+           fi
+         fi
+
+         exit $EXIT_SUCCESS
+       fi
+
+       # Create links to the real library.
+       for linkname in $linknames; do
+         if test "$realname" != "$linkname"; then
+           func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+         fi
+       done
+
+       # If -module or -export-dynamic was specified, set the dlname.
+       if test "$module" = yes || test "$export_dynamic" = yes; then
+         # On all known operating systems, these are identical.
+         dlname="$soname"
+       fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+       test -n "$objs$old_deplibs" && \
+         func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+       libobj=$output
+       func_lo2o "$libobj"
+       obj=$func_lo2o_result
+       ;;
+      *)
+       libobj=
+       obj="$output"
+       ;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+         reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+       else
+         gentop="$output_objdir/${obj}x"
+         generated="$generated $gentop"
+
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
+       fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       # Create an invalid libtool object if no PIC, so that we don't
+       # accidentally link it into a program.
+       # $show "echo timestamp > $libobj"
+       # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+       exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+       # Only do commands if we really have different PIC objects.
+       reload_objs="$libobjs $reload_conv_objs"
+       output="$libobj"
+       func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+       func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+       *cygwin*) func_stripname '' '.exe' "$output"
+                 output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+       && test "$dlopen_self" = unknown \
+       && test "$dlopen_self_static" = unknown && \
+         func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+       # On Rhapsody replace the C library is the System framework
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       ;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+       # Don't allow lazy linking, it breaks C++ global constructors
+       # But is supposedly fixed on 10.4 or later (yay!).
+       if test "$tagname" = CXX ; then
+         case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+           10.[0123])
+             compile_command="$compile_command ${wl}-bind_at_load"
+             finalize_command="$finalize_command ${wl}-bind_at_load"
+           ;;
+         esac
+       fi
+       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       ;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $compile_deplibs " in
+         *" -L$path/$objdir "*)
+           new_libs="$new_libs -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $compile_deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) new_libs="$new_libs $deplib" ;;
+         esac
+         ;;
+       *) new_libs="$new_libs $deplib" ;;
+       esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       for libdir in $rpath $xrpath; do
+         # This is the magic to use -rpath.
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_rpath="$finalize_rpath $libdir" ;;
+         esac
+       done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           rpath="$rpath $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$perm_rpath " in
+         *" $libdir "*) ;;
+         *) perm_rpath="$perm_rpath $libdir" ;;
+         esac
+       fi
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$libdir:"*) ;;
+         ::) dllsearchpath=$libdir;;
+         *) dllsearchpath="$dllsearchpath:$libdir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) dllsearchpath="$dllsearchpath:$testbindir";;
+         esac
+         ;;
+       esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           rpath="$rpath $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$finalize_perm_rpath " in
+         *" $libdir "*) ;;
+         *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+         esac
+       fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+       # Transform all the library objects into standard objects.
+       compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+       func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+       # Replace the output file specification.
+       compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       link_command="$compile_command$compile_rpath"
+
+       # We have no uninstalled library dependencies, so finalize right now.
+       exit_status=0
+       func_show_eval "$link_command" 'exit_status=$?'
+
+       # Delete the generated files.
+       if test -f "$output_objdir/${outputname}S.${objext}"; then
+         func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+       fi
+
+       exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+       compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+       if test -n "$perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $perm_rpath; do
+           rpath="$rpath$dir:"
+         done
+         compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+       if test -n "$finalize_perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $finalize_perm_rpath; do
+           rpath="$rpath$dir:"
+         done
+         finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+      fi
+
+      if test "$no_install" = yes; then
+       # We don't need to create a wrapper script.
+       link_command="$compile_var$compile_command$compile_rpath"
+       # Replace the output file specification.
+       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       # Delete the old output file.
+       $opt_dry_run || $RM $output
+       # Link the executable and exit
+       func_show_eval "$link_command" 'exit $?'
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+       # Fast installation is not supported
+       link_command="$compile_var$compile_command$compile_rpath"
+       relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+       func_warning "this platform does not like uninstalled shared libraries"
+       func_warning "\`$output' will be relinked during installation"
+      else
+       if test "$fast_install" != no; then
+         link_command="$finalize_var$compile_command$finalize_rpath"
+         if test "$fast_install" = yes; then
+           relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+         else
+           # fast_install is set to needless
+           relink_command=
+         fi
+       else
+         link_command="$compile_var$compile_command$compile_rpath"
+         relink_command="$finalize_var$finalize_command$finalize_rpath"
+       fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+       # Preserve any variables that may affect compiler behavior
+       for var in $variables_saved_for_relink; do
+         if eval test -z \"\${$var+set}\"; then
+           relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+         elif eval var_value=\$$var; test -z "$var_value"; then
+           relink_command="$var=; export $var; $relink_command"
+         else
+           func_quote_for_eval "$var_value"
+           relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+         fi
+       done
+       relink_command="(cd `pwd`; $relink_command)"
+       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+       # win32 will think the script is a binary if it has
+       # a .exe suffix, so we strip it off here.
+       case $output in
+         *.exe) func_stripname '' '.exe' "$output"
+                output=$func_stripname_result ;;
+       esac
+       # test for cygwin because mv fails w/o .exe extensions
+       case $host in
+         *cygwin*)
+           exeext=.exe
+           func_stripname '' '.exe' "$outputname"
+           outputname=$func_stripname_result ;;
+         *) exeext= ;;
+       esac
+       case $host in
+         *cygwin* | *mingw* )
+           func_dirname_and_basename "$output" "" "."
+           output_name=$func_basename_result
+           output_path=$func_dirname_result
+           cwrappersource="$output_path/$objdir/lt-$output_name.c"
+           cwrapper="$output_path/$output_name.exe"
+           $RM $cwrappersource $cwrapper
+           trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_cwrapperexe_src > $cwrappersource
+
+           # The wrapper executable is built using the $host compiler,
+           # because it contains $host paths and files. If cross-
+           # compiling, it, like the target executable, must be
+           # executed on the $host or under an emulation environment.
+           $opt_dry_run || {
+             $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+             $STRIP $cwrapper
+           }
+
+           # Now, create the wrapper script for func_source use:
+           func_ltwrapper_scriptname $cwrapper
+           $RM $func_ltwrapper_scriptname_result
+           trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+           $opt_dry_run || {
+             # note: this script will not be executed, so do not chmod.
+             if test "x$build" = "x$host" ; then
+               $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+             else
+               func_emit_wrapper no > $func_ltwrapper_scriptname_result
+             fi
+           }
+         ;;
+         * )
+           $RM $output
+           trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_wrapper no > $output
+           chmod +x $output
+         ;;
+       esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+       oldobjs="$libobjs_save $symfileobj"
+       addlibs="$convenience"
+       build_libtool_libs=no
+      else
+       if test "$build_libtool_libs" = module; then
+         oldobjs="$libobjs_save"
+         build_libtool_libs=no
+       else
+         oldobjs="$old_deplibs $non_pic_objects"
+         if test "$preload" = yes && test -f "$symfileobj"; then
+           oldobjs="$oldobjs $symfileobj"
+         fi
+       fi
+       addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+       gentop="$output_objdir/${outputname}x"
+       generated="$generated $gentop"
+
+       func_extract_archives $gentop $addlibs
+       oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         generated="$generated $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         oldobjs="$oldobjs $func_extract_archives_result"
+       fi
+
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             func_basename "$obj"
+             $ECHO "$func_basename_result"
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         echo "copying selected object files to avoid basename conflicts..."
+         gentop="$output_objdir/${outputname}x"
+         generated="$generated $gentop"
+         func_mkdir_p "$gentop"
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           func_basename "$obj"
+           objbase="$func_basename_result"
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               func_arith $counter + 1
+               counter=$func_arith_result
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             oldobjs="$oldobjs $gentop/$newobj"
+             ;;
+           *) oldobjs="$oldobjs $obj" ;;
+           esac
+         done
+       fi
+       eval cmds=\"$old_archive_cmds\"
+
+       func_len " $cmds"
+       len=$func_len_result
+       if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         func_verbose "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+         oldobjs=
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         eval test_cmds=\"$old_archive_cmds\"
+         func_len " $test_cmds"
+         len0=$func_len_result
+         len=$len0
+         for obj in $save_oldobjs
+         do
+           func_len " $obj"
+           func_arith $len + $func_len_result
+           len=$func_arith_result
+           func_append objlist " $obj"
+           if test "$len" -lt "$max_cmd_len"; then
+             :
+           else
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj" ; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+             objlist=
+             len=$len0
+           fi
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test "X$oldobjs" = "X" ; then
+           eval cmds=\"\$concat_cmds\"
+         else
+           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+         fi
+       fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+       if eval test -z \"\${$var+set}\"; then
+         relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+       elif eval var_value=\$$var; test -z "$var_value"; then
+         relink_command="$var=; export $var; $relink_command"
+       else
+         func_quote_for_eval "$var_value"
+         relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+       fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+       relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+       for installed in no yes; do
+         if test "$installed" = yes; then
+           if test -z "$install_libdir"; then
+             break
+           fi
+           output="$output_objdir/$outputname"i
+           # Replace all uninstalled libtool libraries with the installed ones
+           newdependency_libs=
+           for deplib in $dependency_libs; do
+             case $deplib in
+             *.la)
+               func_basename "$deplib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$deplib' is not a valid libtool archive"
+               newdependency_libs="$newdependency_libs $libdir/$name"
+               ;;
+             *) newdependency_libs="$newdependency_libs $deplib" ;;
+             esac
+           done
+           dependency_libs="$newdependency_libs"
+           newdlfiles=
+
+           for lib in $dlfiles; do
+             case $lib in
+             *.la)
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               newdlfiles="$newdlfiles $libdir/$name"
+               ;;
+             *) newdlfiles="$newdlfiles $lib" ;;
+             esac
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+             *.la)
+               # Only pass preopened files to the pseudo-archive (for
+               # eventual linking with the app. that links it) if we
+               # didn't already link the preopened objects directly into
+               # the library:
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               newdlprefiles="$newdlprefiles $libdir/$name"
+               ;;
+             esac
+           done
+           dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlfiles="$newdlfiles $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlprefiles="$newdlprefiles $abs"
+           done
+           dlprefiles="$newdlprefiles"
+         fi
+         $RM $output
+         # place dlname in correct position for cygwin
+         # In fact, it would be nice if we could use this code for all target
+         # systems that can't hard-code library paths into their executables
+         # and that have no shared library path variable independent of PATH,
+         # but it turns out we can't easily determine that from inspecting
+         # libtool variables, so we have to hard-code the OSs to which it
+         # applies here; at the moment, that means platforms that use the PE
+         # object format with DLL files.  See the long comment at the top of
+         # tests/bindir.at for full details.
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+             # If a -bindir argument was supplied, place the dll there.
+             if test "x$bindir" != x ;
+             then
+               func_relative_path "$install_libdir" "$bindir"
+               tdlname=$func_relative_path_result$dlname
+             else
+               # Otherwise fall back on heuristic.
+               tdlname=../bin/$dlname
+             fi
+             ;;
+         esac
+         $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+         if test "$installed" = no && test "$need_relink" = yes; then
+           $ECHO >> $output "\
+relink_command=\"$relink_command\""
+         fi
+       done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+       objdir="$origobjdir"
+      else
+       objdir="$dir/$origobjdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+       case " $rmdirs " in
+         *" $objdir "*) ;;
+         *) rmdirs="$rmdirs $objdir" ;;
+       esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+        { test -h "$file"; } >/dev/null 2>&1 ||
+        test -f "$file"; then
+       :
+      elif test -d "$file"; then
+       exit_status=1
+       continue
+      elif test "$rmforce" = yes; then
+       continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+       # Possibly a libtool archive, so verify it.
+       if func_lalib_p "$file"; then
+         func_source $dir/$name
+
+         # Delete the libtool libraries and symlinks.
+         for n in $library_names; do
+           rmfiles="$rmfiles $objdir/$n"
+         done
+         test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+         case "$mode" in
+         clean)
+           case "  $library_names " in
+           # "  " in the beginning catches empty $dlname
+           *" $dlname "*) ;;
+           *) rmfiles="$rmfiles $objdir/$dlname" ;;
+           esac
+           test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+           ;;
+         uninstall)
+           if test -n "$library_names"; then
+             # Do each command in the postuninstall commands.
+             func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+
+           if test -n "$old_library"; then
+             # Do each command in the old_postuninstall commands.
+             func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+           # FIXME: should reinstall the best remaining shared library.
+           ;;
+         esac
+       fi
+       ;;
+
+      *.lo)
+       # Possibly a libtool object, so verify it.
+       if func_lalib_p "$file"; then
+
+         # Read the .lo file
+         func_source $dir/$name
+
+         # Add PIC object to the list of files to remove.
+         if test -n "$pic_object" &&
+            test "$pic_object" != none; then
+           rmfiles="$rmfiles $dir/$pic_object"
+         fi
+
+         # Add non-PIC object to the list of files to remove.
+         if test -n "$non_pic_object" &&
+            test "$non_pic_object" != none; then
+           rmfiles="$rmfiles $dir/$non_pic_object"
+         fi
+       fi
+       ;;
+
+      *)
+       if test "$mode" = clean ; then
+         noexename=$name
+         case $file in
+         *.exe)
+           func_stripname '' '.exe' "$file"
+           file=$func_stripname_result
+           func_stripname '' '.exe' "$name"
+           noexename=$func_stripname_result
+           # $file with .exe has already been added to rmfiles,
+           # add $file without .exe
+           rmfiles="$rmfiles $file"
+           ;;
+         esac
+         # Do a test to see if this is a libtool program.
+         if func_ltwrapper_p "$file"; then
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             relink_command=
+             func_source $func_ltwrapper_scriptname_result
+             rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+           else
+             relink_command=
+             func_source $dir/$noexename
+           fi
+
+           # note $name still contains .exe if it was in $file originally
+           # as does the version of $file that was added into $rmfiles
+           rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+           if test "$fast_install" = yes && test -n "$relink_command"; then
+             rmfiles="$rmfiles $objdir/lt-$name"
+           fi
+           if test "X$noexename" != "X$name" ; then
+             rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+           fi
+         fi
+       fi
+       ;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+       func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/config/missing b/FreeRTOS-Plus/Source/CyaSSL/config/missing
new file mode 100644 (file)
index 0000000..1c8ff70
--- /dev/null
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f lex.yy.c; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case $firstarg in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case $firstarg in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/FreeRTOS-Plus/Source/CyaSSL/configure b/FreeRTOS-Plus/Source/CyaSSL/configure
new file mode 100644 (file)
index 0000000..aff17db
--- /dev/null
@@ -0,0 +1,26020 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for cyassl 2.3.0.
+#
+# Report bugs to <http://www.yassl.com>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+
+(
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+(
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='cyassl'
+PACKAGE_TARNAME='cyassl'
+PACKAGE_VERSION='2.3.0'
+PACKAGE_STRING='cyassl 2.3.0'
+PACKAGE_BUGREPORT='http://www.yassl.com'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_func_list=
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+CYASSL_LIBRARY_VERSION
+AS
+DLLTOOL
+OBJDUMP
+LIBTOOL
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+SED
+GREP
+EGREP
+FGREP
+LD
+DUMPBIN
+ac_ct_DUMPBIN
+NM
+LN_S
+AR
+RANLIB
+DSYMUTIL
+NMEDIT
+LIPO
+OTOOL
+OTOOL64
+CPP
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+CXXCPP
+CFLAG_VISIBILITY
+HAVE_VISIBILITY
+LIBOBJS
+CCAS
+CCASFLAGS
+CCASDEPMODE
+am__fastdepCCAS_TRUE
+am__fastdepCCAS_FALSE
+LIBM
+BUILD_FASTMATH_TRUE
+BUILD_FASTMATH_FALSE
+BUILD_SNIFFER_TRUE
+BUILD_SNIFFER_FALSE
+BUILD_AESGCM_TRUE
+BUILD_AESGCM_FALSE
+BUILD_AESNI_TRUE
+BUILD_AESNI_FALSE
+BUILD_MD2_TRUE
+BUILD_MD2_FALSE
+BUILD_RIPEMD_TRUE
+BUILD_RIPEMD_FALSE
+BUILD_SHA512_TRUE
+BUILD_SHA512_FALSE
+BUILD_HC128_TRUE
+BUILD_HC128_FALSE
+BUILD_NOINLINE_TRUE
+BUILD_NOINLINE_FALSE
+BUILD_ECC_TRUE
+BUILD_ECC_FALSE
+BUILD_OCSP_TRUE
+BUILD_OCSP_FALSE
+BUILD_CRL_TRUE
+BUILD_CRL_FALSE
+BUILD_CRL_MONITOR_TRUE
+BUILD_CRL_MONITOR_FALSE
+BUILD_NTRU_TRUE
+BUILD_NTRU_FALSE
+ax_pthread_config
+PTHREAD_CC
+PTHREAD_LIBS
+PTHREAD_CFLAGS
+HEX_VERSION
+AM_CFLAGS
+AM_LDFLAGS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+CCAS
+CCASFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$0" : 'X\(//\)[^/]' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures cyassl 2.3.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                         [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                         [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/cyassl]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of cyassl 2.3.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-debug          Enable CyaSSL debugging support (default: disabled)
+  --enable-small          Enable smallest build (default: disabled)
+  --enable-singleThreaded Enable CyaSSL single threaded (default: disabled)
+  --enable-dtls           Enable CyaSSL DTLS (default: disabled)
+  --enable-opensslExtra   Enable extra OpenSSL API, size+ (default: disabled)
+  --enable-ipv6           Enable testing of IPV6 (default: disabled)
+  --enable-fortress       Enable SSL fortress build (default: disabled)
+  --enable-bump           Enable SSL Bump build (default: disabled)
+  --enable-fastmath       Enable fast math for BigInts (default: disabled)
+  --enable-fasthugemath   Enable fast math + huge code (default: disabled)
+  --enable-bigcache       Enable big session cache (default: disabled)
+  --enable-hugecache      Enable huge session cache (default: disabled)
+  --enable-smallcache     Enable small session cache (default: disabled)
+  --enable-sniffer        Enable CyaSSL sniffer support (default: disabled)
+  --enable-aesgcm         Enable CyaSSL AES-GCM support (default: disabled)
+  --enable-aesni          Enable CyaSSL AES-NI support (default: disabled)
+  --enable-md2            Enable CyaSSL MD2 support (default: disabled)
+  --enable-ripemd         Enable CyaSSL RIPEMD-160 support (default: disabled)
+  --enable-sha512         Enable CyaSSL SHA-512 support (default: disabled)
+  --enable-sessioncerts   Enable session cert storing (default: disabled)
+  --enable-keygen         Enable key generation (default: disabled)
+  --enable-certgen        Enable cert generation (default: disabled)
+  --enable-hc128          Enable HC-128 (default: disabled)
+  --enable-psk            Enable PSK (default: disabled)
+  --enable-webServer      Enable Web Server (default: disabled)
+  --enable-noFilesystem   Enable No Filesystem (default: disabled)
+  --enable-noInline       Enable No inline (default: disabled)
+  --enable-ecc            Enable ECC (default: disabled)
+  --enable-ocsp           Enable OCSP (default: disabled)
+  --enable-crl            Enable CRL (default: disabled)
+  --enable-crl-monitor    Enable CRL Monitor (default: disabled)
+  --enable-ntru           Enable NTRU (default: disabled)
+  --enable-testcert       Enable Test Cert (default: disabled)
+  --enable-gcc-lots-o-warnings
+                          Enable lots of gcc warnings (default: disabled)
+  --enable-gcc-hardening  Enable compiler security checks (default: disabled)
+  --enable-linker-hardening
+                          Enable linker security fixups (default: disabled)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-libz=PATH        PATH to libz install (default /usr/)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+  CCAS        assembler compiler command (defaults to CC)
+  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <http://www.yassl.com>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+cyassl configure 2.3.0
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by cyassl $as_me 2.3.0, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+ac_header_list="$ac_header_list sys/time.h"
+ac_header_list="$ac_header_list unistd.h"
+ac_func_list="$ac_func_list alarm"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+       { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+       { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+       ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+am__api_version='1.10'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm -f conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  SET_MAKE=
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='cyassl'
+ VERSION='2.3.0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+
+{ echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5
+echo $ECHO_N "checking how to create a ustar tar archive... $ECHO_C" >&6; }
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar plaintar pax cpio none'
+_am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      { echo "$as_me:$LINENO: $_am_tar --version" >&5
+   ($_am_tar --version) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && break
+    done
+    am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x ustar -w "$$tardir"'
+    am__tar_='pax -L -x ustar -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+    am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+    am__untar='cpio -i -H ustar -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_ustar}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+   (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+   ($am__untar <conftest.tar) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+if test "${am_cv_prog_tar_ustar+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  am_cv_prog_tar_ustar=$_am_tool
+fi
+
+{ echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5
+echo "${ECHO_T}$am_cv_prog_tar_ustar" >&6; }
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h:config.in"
+
+
+#shared library versioning
+CYASSL_LIBRARY_VERSION=3:1:0
+#                      | | |
+#               +------+ | +---+
+#               |        |     |
+#              current:revision:age
+#               |        |     |
+#               |        |     +- increment if interfaces have been added
+#               |        |        set to zero if interfaces have been removed
+#                        |        or changed
+#               |        +- increment if source code has changed
+#               |           set to zero if current is incremented
+#               +- increment if interfaces have been added, removed or changed
+
+
+# Make sure configure doesn't add to CFLAGS
+CFLAGS="$CFLAGS $C_EXTRA_FLAGS"
+
+case `pwd` in
+  *\ * | *\    *)
+    { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.10'
+macro_revision='1.3175'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ echo "$as_me:$LINENO: checking how to print strings" >&5
+echo $ECHO_N "checking how to print strings... $ECHO_C" >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { echo "$as_me:$LINENO: result: printf" >&5
+echo "${ECHO_T}printf" >&6; } ;;
+  print*) { echo "$as_me:$LINENO: result: print -r" >&5
+echo "${ECHO_T}print -r" >&6; } ;;
+  *) { echo "$as_me:$LINENO: result: cat" >&5
+echo "${ECHO_T}cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     # Extract the first word of "sed gsed" to use in msg output
+if test -z "$SED"; then
+set dummy sed gsed; ac_prog_name=$2
+if test "${ac_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_SED_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+    # Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_SED_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+SED="$ac_cv_path_SED"
+if test -z "$SED"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+echo "${ECHO_T}$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for fgrep" >&5
+echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     # Extract the first word of "fgrep" to use in msg output
+if test -z "$FGREP"; then
+set dummy fgrep; ac_prog_name=$2
+if test "${ac_cv_path_FGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_FGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in fgrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+    # Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_FGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+FGREP="$ac_cv_path_FGREP"
+if test -z "$FGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+echo "${ECHO_T}$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+echo "${ECHO_T}$DUMPBIN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -r -f conftest*
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+echo "${ECHO_T}$lt_cv_nm_interface" >&6; }
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ echo "$as_me:$LINENO: result: $xsi_shell" >&5
+echo "${ECHO_T}$xsi_shell" >&6; }
+
+
+{ echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+echo "${ECHO_T}$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+echo "${ECHO_T}$OBJDUMP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -r -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6; }
+else
+  { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*|powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       lt_cv_cc_needs_belf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+echo "${ECHO_T}$DSYMUTIL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { echo "$as_me:$LINENO: result: $NMEDIT" >&5
+echo "${ECHO_T}$NMEDIT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { echo "$as_me:$LINENO: result: $LIPO" >&5
+echo "${ECHO_T}$LIPO" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+echo "${ECHO_T}$ac_ct_LIPO" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { echo "$as_me:$LINENO: result: $OTOOL" >&5
+echo "${ECHO_T}$OTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+echo "${ECHO_T}$ac_ct_OTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { echo "$as_me:$LINENO: result: $OTOOL64" >&5
+echo "${ECHO_T}$OTOOL64" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+echo "${ECHO_T}$ac_ct_OTOOL64" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&5
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }
+    { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  lt_cv_ld_exported_symbols_list=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
+    { echo "$as_me:$LINENO: checking for -force_load linker flag" >&5
+echo $ECHO_N "checking for -force_load linker flag... $ECHO_C" >&6; }
+if test "${lt_cv_ld_force_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_ld_force_load" >&5
+echo "${ECHO_T}$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f -r conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f -r conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { echo "$as_me:$LINENO: result: $AS" >&5
+echo "${ECHO_T}$AS" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AS="as"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
+echo "${ECHO_T}$ac_ct_AS" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_AS" = x; then
+    AS="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+echo "${ECHO_T}$DLLTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
+echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+echo "${ECHO_T}$OBJDUMP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+  ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+        enable_dlopen=no
+
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         lt_prog_compiler_pic='-KPIC'
+         lt_prog_compiler_static='-Bstatic'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM -r conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM -r conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  hard_links=yes
+  $RM -r conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+         hardcode_libdir_flag_spec=
+         hardcode_libdir_flag_spec_ld='-rpath $libdir'
+         archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_flag_spec_ld='+b $libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { echo "$as_me:$LINENO: checking if $CC understands -b" >&5
+echo $ECHO_N "checking if $CC understands -b... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler__b+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  $RM -r conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
+echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    { echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  { echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+    else
+      { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    fi
+    ;;
+  *)
+    { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6; }
+
+  { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6; }
+
+  { echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           hardcode_direct_CXX=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           hardcode_minus_L_CXX=yes
+           hardcode_libdir_flag_spec_CXX='-L$libdir'
+           hardcode_libdir_separator_CXX=
+         fi
+          esac
+          shared_flag='-shared'
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag="$shared_flag "'${wl}-G'
+         fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test "$aix_use_runtimelinking" = yes; then
+             shared_flag='${wl}-G'
+           else
+             shared_flag='${wl}-bM:SRE'
+           fi
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        always_export_symbols_CXX=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+           hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+           allow_undefined_flag_CXX="-z nodefs"
+           archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           no_undefined_flag_CXX=' ${wl}-bernotok'
+           allow_undefined_flag_CXX=' ${wl}-berok'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             whole_archive_flag_spec_CXX='$convenience'
+           fi
+           archive_cmds_need_lc_CXX=yes
+           # This is similar to how AIX traditionally builds its shared
+           # libraries.
+           archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         allow_undefined_flag_CXX=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       else
+         ld_shlibs_CXX=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         ld_shlibs_CXX=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+        # as there is no search path for DLLs.
+        hardcode_libdir_flag_spec_CXX='-L$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+        allow_undefined_flag_CXX=unsupported
+        always_export_symbols_CXX=no
+        enable_shared_with_static_runtimes_CXX=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           cp $export_symbols $output_objdir/$soname.def;
+          else
+           echo EXPORTS > $output_objdir/$soname.def;
+           cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          ld_shlibs_CXX=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+
+  else
+  ld_shlibs_CXX=no
+  fi
+
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+        esac
+        ;;
+
+      freebsd[12]*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        ld_shlibs_CXX=no
+        ;;
+
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+         hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+         hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             export_dynamic_flag_spec_CXX='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test $with_gnu_ld = no; then
+               case $host_cpu in
+                 hppa*64*)
+                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             ld_shlibs_CXX=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+       hardcode_direct_CXX=no
+       hardcode_shlibpath_var_CXX=no
+       hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+       export_dynamic_flag_spec_CXX='${wl}-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test "$with_gnu_ld" = no; then
+               archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+             else
+               archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+             fi
+           fi
+           link_all_deplibs_CXX=yes
+           ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           archive_cmds_need_lc_CXX=no
+           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+           whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+             prelink_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             old_archive_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+               $RANLIB $oldlib'
+             archive_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             archive_expsym_cmds_CXX='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           esac
+
+           hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+           whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+           hardcode_libdir_separator_CXX=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+           export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+           archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           if test "x$supports_anon_versioning" = xyes; then
+             archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+               echo "local: *; };" >> $output_objdir/$libname.ver~
+               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             no_undefined_flag_CXX=' -zdefs'
+             archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+             hardcode_libdir_flag_spec_CXX='-R$libdir'
+             whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             compiler_needs_object_CXX=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       ld_shlibs_CXX=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         hardcode_libdir_flag_spec_CXX='-R$libdir'
+         hardcode_direct_CXX=yes
+         hardcode_shlibpath_var_CXX=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+       ;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+       ld_shlibs_CXX=no
+       ;;
+
+      openbsd*)
+       if test -f /usr/libexec/ld.so; then
+         hardcode_direct_CXX=yes
+         hardcode_shlibpath_var_CXX=no
+         hardcode_direct_absolute_CXX=yes
+         archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+           archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+           export_dynamic_flag_spec_CXX='${wl}-E'
+           whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         ld_shlibs_CXX=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+           hardcode_libdir_separator_CXX=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+               archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+               ;;
+             *)
+               allow_undefined_flag_CXX=' -expect_unresolved \*'
+               archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                 echo "-hidden">> $lib.exp~
+                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+                 $RM $lib.exp'
+               hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+               ;;
+           esac
+
+           hardcode_libdir_separator_CXX=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+             case $host in
+               osf3*)
+                 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+               *)
+                 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+             esac
+
+             hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+             hardcode_libdir_separator_CXX=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             ld_shlibs_CXX=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+           no_undefined_flag_CXX=' -zdefs'
+           archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           hardcode_libdir_flag_spec_CXX='-R$libdir'
+           hardcode_shlibpath_var_CXX=no
+           case $host_os in
+             solaris2.[0-5] | solaris2.[0-5].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands `-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           link_all_deplibs_CXX=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require `-G' NOT `-shared' on this
+               # platform.
+               archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+             case $host_os in
+               solaris2.[0-5] | solaris2.[0-5].*) ;;
+               *)
+                 whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='${wl}-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We can NOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       no_undefined_flag_CXX='${wl}-z,text'
+       allow_undefined_flag_CXX='${wl}-z,nodefs'
+       archive_cmds_need_lc_CXX=no
+       hardcode_shlibpath_var_CXX=no
+       hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+       hardcode_libdir_separator_CXX=':'
+       link_all_deplibs_CXX=yes
+       export_dynamic_flag_spec_CXX='${wl}-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+             '"$old_archive_cmds_CXX"
+           reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+             '"$reload_cmds_CXX"
+           ;;
+         *)
+           archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           ld_shlibs_CXX=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
+
+    { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+    test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+    GCC_CXX="$GXX"
+    LD_CXX="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$compiler_lib_search_path_CXX"; then
+            compiler_lib_search_path_CXX="${prev}${p}"
+          else
+            compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$postdeps_CXX"; then
+          postdeps_CXX="${prev}${p}"
+        else
+          postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$predep_objects_CXX"; then
+          predep_objects_CXX="$p"
+        else
+          predep_objects_CXX="$predep_objects_CXX $p"
+        fi
+       else
+        if test -z "$postdep_objects_CXX"; then
+          postdep_objects_CXX="$p"
+        else
+          postdep_objects_CXX="$postdep_objects_CXX $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       lt_prog_compiler_pic_CXX='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[4-9]*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         lt_prog_compiler_static_CXX='-Bstatic'
+       else
+         lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             lt_prog_compiler_pic_CXX='+Z'
+           fi
+           ;;
+         aCC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             lt_prog_compiler_pic_CXX='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_static_CXX='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           lt_prog_compiler_pic_CXX='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fPIC'
+           lt_prog_compiler_static_CXX='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-fpic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-qpic'
+           lt_prog_compiler_static_CXX='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             lt_prog_compiler_pic_CXX='-KPIC'
+             lt_prog_compiler_static_CXX='-Bstatic'
+             lt_prog_compiler_wl_CXX='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           lt_prog_compiler_pic_CXX='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           lt_prog_compiler_wl_CXX='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           lt_prog_compiler_wl_CXX='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           lt_prog_compiler_pic_CXX=
+           lt_prog_compiler_static_CXX='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           lt_prog_compiler_wl_CXX='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           lt_prog_compiler_pic_CXX='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           lt_prog_compiler_pic_CXX='-pic'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           lt_prog_compiler_pic_CXX='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           lt_prog_compiler_wl_CXX='-Wl,'
+           lt_prog_compiler_pic_CXX='-KPIC'
+           lt_prog_compiler_static_CXX='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           lt_prog_compiler_pic_CXX='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       lt_prog_compiler_can_build_shared_CXX=no
+       ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+    { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM -r conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM -r conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  hard_links=yes
+  $RM -r conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+
+{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
+if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  $RM -r conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl_CXX
+         pic_flag=$lt_prog_compiler_pic_CXX
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+         allow_undefined_flag_CXX=
+         if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+         then
+           lt_cv_archive_cmds_need_lc_CXX=no
+         else
+           lt_cv_archive_cmds_need_lc_CXX=yes
+         fi
+         allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM -r conftest*
+
+fi
+{ echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+                { echo "$as_me:$LINENO: checking whether the -Werror option is usable" >&5
+echo $ECHO_N "checking whether the -Werror option is usable... $ECHO_C" >&6; }
+    if test "${gl_cv_cc_vis_werror+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Werror"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_cc_vis_werror=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_cc_vis_werror=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$gl_save_CFLAGS"
+fi
+
+    { echo "$as_me:$LINENO: result: $gl_cv_cc_vis_werror" >&5
+echo "${ECHO_T}$gl_cv_cc_vis_werror" >&6; }
+        { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5
+echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; }
+    if test "${gl_cv_cc_visibility+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+                                    if test $gl_cv_cc_vis_werror = yes; then
+        CFLAGS="$CFLAGS -Werror"
+      fi
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+         void dummyfunc (void) {}
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  gl_cv_cc_visibility=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       gl_cv_cc_visibility=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$gl_save_CFLAGS"
+fi
+
+    { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5
+echo "${ECHO_T}$gl_cv_cc_visibility" >&6; }
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
+
+
+
+
+
+
+for ac_func in gethostbyname
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in gettimeofday
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in inet_ntoa
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in memset
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in socket
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_header in arpa/inet.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in fcntl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in limits.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netdb.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in netinet/in.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in stddef.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/ioctl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/socket.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in sys/time.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in errno.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ echo "$as_me:$LINENO: checking for socket in -lnetwork" >&5
+echo $ECHO_N "checking for socket in -lnetwork... $ECHO_C" >&6; }
+if test "${ac_cv_lib_network_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetwork  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_network_socket=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_network_socket=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_network_socket" >&5
+echo "${ECHO_T}$ac_cv_lib_network_socket" >&6; }
+if test $ac_cv_lib_network_socket = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNETWORK 1
+_ACEOF
+
+  LIBS="-lnetwork $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+typedef long long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_long_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_long_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long_long=$ac_lo;;
+'') if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+typedef long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr $ac_mid + 1`
+                       if test $ac_lo -le $ac_mid; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_hi=`expr '(' $ac_mid ')' - 1`
+                       if test $ac_mid -le $ac_hi; then
+                         ac_lo= ac_hi=
+                         break
+                       fi
+                       ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+   typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+       return 1;
+      fprintf (f, "%lu\n", i);
+    }
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+     { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+   else
+     ac_cv_sizeof_long=0
+   fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+       && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       # It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long int l;
+    char c[sizeof (long int)];
+  } u;
+  u.l = 1;
+  return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=no
+fi
+
+
+
+
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=no
+fi
+
+
+
+
+
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
+echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; }
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_malloc_0_nonnull=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 1
+_ACEOF
+
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 0
+_ACEOF
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define malloc rpl_malloc
+_ACEOF
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_time=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+
+
+
+for ac_header in $ac_header_list
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+for ac_func in $ac_func_list
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for working mktime" >&5
+echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; }
+if test "${ac_cv_func_working_mktime+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_working_mktime=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Test program from Paul Eggert and Tony Leneis.  */
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifndef HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests.  */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable.  */
+static char *tz_strings[] = {
+  (char *) 0, "TZ=GMT0", "TZ=JST-9",
+  "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+   Based on a problem report from Andreas Jaeger.  */
+static int
+spring_forward_gap ()
+{
+  /* glibc (up to about 1998-10-07) failed this test. */
+  struct tm tm;
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+  tm.tm_year = 98;
+  tm.tm_mon = 3;
+  tm.tm_mday = 5;
+  tm.tm_hour = 2;
+  tm.tm_min = 0;
+  tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+  return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (now)
+     time_t now;
+{
+  struct tm *lt;
+  return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (now)
+     time_t now;
+{
+  return (mktime_test1 (now)
+         && mktime_test1 ((time_t) (time_t_max - now))
+         && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+  /* Based on code from Ariel Faigon.  */
+  struct tm tm;
+  tm.tm_year = 96;
+  tm.tm_mon = 3;
+  tm.tm_mday = 0;
+  tm.tm_hour = 0;
+  tm.tm_min = 0;
+  tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+  mktime (&tm);
+  return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (j)
+     int j;
+{
+  struct tm tm;
+  time_t now;
+  tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+  now = mktime (&tm);
+  if (now != (time_t) -1)
+    {
+      struct tm *lt = localtime (&now);
+      if (! (lt
+            && lt->tm_year == tm.tm_year
+            && lt->tm_mon == tm.tm_mon
+            && lt->tm_mday == tm.tm_mday
+            && lt->tm_hour == tm.tm_hour
+            && lt->tm_min == tm.tm_min
+            && lt->tm_sec == tm.tm_sec
+            && lt->tm_yday == tm.tm_yday
+            && lt->tm_wday == tm.tm_wday
+            && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+                 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+       return 0;
+    }
+  return 1;
+}
+
+static int
+year_2050_test ()
+{
+  /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+     ignoring leap seconds.  */
+  unsigned long int answer = 2527315200UL;
+
+  struct tm tm;
+  time_t t;
+  tm.tm_year = 2050 - 1900;
+  tm.tm_mon = 2 - 1;
+  tm.tm_mday = 1;
+  tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+  t = mktime (&tm);
+
+  /* Check that the result is either a failure, or close enough
+     to the correct answer that we can assume the discrepancy is
+     due to leap seconds.  */
+  return (t == (time_t) -1
+         || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+int
+main ()
+{
+  time_t t, delta;
+  int i, j;
+
+  /* This test makes some buggy mktime implementations loop.
+     Give up after 60 seconds; a mktime slower than that
+     isn't worth using anyway.  */
+  alarm (60);
+
+  for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+    continue;
+  time_t_max--;
+  if ((time_t) -1 < 0)
+    for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
+      continue;
+  delta = time_t_max / 997; /* a suitable prime number */
+  for (i = 0; i < N_STRINGS; i++)
+    {
+      if (tz_strings[i])
+       putenv (tz_strings[i]);
+
+      for (t = 0; t <= time_t_max - delta; t += delta)
+       if (! mktime_test (t))
+         return 1;
+      if (! (mktime_test ((time_t) 1)
+            && mktime_test ((time_t) (60 * 60))
+            && mktime_test ((time_t) (60 * 60 * 24))))
+       return 1;
+
+      for (j = 1; 0 < j; j *= 2)
+       if (! bigtime_test (j))
+         return 1;
+      if (! bigtime_test (j - 1))
+       return 1;
+    }
+  return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_working_mktime=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5
+echo "${ECHO_T}$ac_cv_func_working_mktime" >&6; }
+if test $ac_cv_func_working_mktime = no; then
+  case " $LIBOBJS " in
+  *" mktime.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS mktime.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to http://www.yassl.com ##
+## ----------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5
+echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; }
+if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_realloc_0_nonnull=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
+echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_REALLOC 1
+_ACEOF
+
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_REALLOC 0
+_ACEOF
+
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define realloc rpl_realloc
+_ACEOF
+
+fi
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; }
+else
+  { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; }
+fi
+set dummy $CC; ac_cc=`echo $2 |
+                     sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        test -f conftest2.$ac_objext && { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+       # cc works too.
+       :
+      else
+       # cc exists but doesn't like -o.
+       eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f -r core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+  return 0;
+if (sizeof (ac__type_new_))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_size_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_size_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+  { echo "$as_me:$LINENO: checking for uint8_t" >&5
+echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6; }
+if test "${ac_cv_c_uint8_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_c_uint8_t=no
+     for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \
+        'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  case $ac_type in
+  uint8_t) ac_cv_c_uint8_t=yes ;;
+  *) ac_cv_c_uint8_t=$ac_type ;;
+esac
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test "$ac_cv_c_uint8_t" != no && break
+     done
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5
+echo "${ECHO_T}$ac_cv_c_uint8_t" >&6; }
+  case $ac_cv_c_uint8_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<\_ACEOF
+#define _UINT8_T 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+  esac
+
+# By default we simply use the C compiler to build assembly code.
+
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+
+
+
+depcc="$CCAS"   am_compiler_list=
+
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CCAS_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CCAS_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CCAS_dependencies_compiler_type=none
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; }
+CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
+  am__fastdepCCAS_TRUE=
+  am__fastdepCCAS_FALSE='#'
+else
+  am__fastdepCCAS_TRUE='#'
+  am__fastdepCCAS_FALSE=
+fi
+
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  { echo "$as_me:$LINENO: checking for _mwvalidcheckl in -lmw" >&5
+echo $ECHO_N "checking for _mwvalidcheckl in -lmw... $ECHO_C" >&6; }
+if test "${ac_cv_lib_mw__mwvalidcheckl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmw  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char _mwvalidcheckl ();
+int
+main ()
+{
+return _mwvalidcheckl ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_mw__mwvalidcheckl=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_mw__mwvalidcheckl=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_mw__mwvalidcheckl" >&5
+echo "${ECHO_T}$ac_cv_lib_mw__mwvalidcheckl" >&6; }
+if test $ac_cv_lib_mw__mwvalidcheckl = yes; then
+  LIBM="-lmw"
+fi
+
+  { echo "$as_me:$LINENO: checking for cos in -lm" >&5
+echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_cos=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_m_cos=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
+echo "${ECHO_T}$ac_cv_lib_m_cos" >&6; }
+if test $ac_cv_lib_m_cos = yes; then
+  LIBM="$LIBM -lm"
+fi
+
+  ;;
+*)
+  { echo "$as_me:$LINENO: checking for cos in -lm" >&5
+echo $ECHO_N "checking for cos in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_cos=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_m_cos=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
+echo "${ECHO_T}$ac_cv_lib_m_cos" >&6; }
+if test $ac_cv_lib_m_cos = yes; then
+  LIBM="-lm"
+fi
+
+  ;;
+esac
+
+
+
+OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
+OPTIMIZE_FAST_CFLAGS="-O3 -fomit-frame-pointer"
+OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET"
+DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_CYASSL"
+
+
+# DEBUG
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug;  ENABLED_DEBUG=$enableval
+else
+   ENABLED_DEBUG=no
+
+fi
+
+if test "$ENABLED_DEBUG" = "yes"
+then
+  # Full debug. Very slow in some cases
+  AM_CFLAGS="$DEBUG_CFLAGS $AM_CFLAGS"
+else
+  # Optimized version. No debug
+  AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
+fi
+
+
+# SMALL BUILD
+# Check whether --enable-small was given.
+if test "${enable_small+set}" = set; then
+  enableval=$enable_small;  ENABLED_SMALL=$enableval
+else
+   ENABLED_SMALL=no
+
+fi
+
+if test "$ENABLED_SMALL" = "yes"
+then
+  # make small no tls build with smallest cipher
+  # if you only want server or client you can define NO_CYASSL_SERVER or
+  # NO_CYASSL_CLIENT but then some of the examples and testsuite won't build
+  # note that TLS needs HMAC
+  AM_CFLAGS="-DNO_TLS -DNO_HMAC -DNO_AES -DNO_DES3 -DNO_SHA256 -DNO_ERROR_STRINGS -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED $AM_CFLAGS"
+fi
+
+
+# SINGLE THREADED
+# Check whether --enable-singleThreaded was given.
+if test "${enable_singleThreaded+set}" = set; then
+  enableval=$enable_singleThreaded;  ENABLED_SINGLETHREADED=$enableval
+else
+   ENABLED_SINGLETHREADED=no
+
+fi
+
+if test "$ENABLED_SINGLETHREADED" = "yes"
+then
+  AM_CFLAGS="-DSINGLE_THREADED $AM_CFLAGS"
+fi
+
+
+# DTLS
+# Check whether --enable-dtls was given.
+if test "${enable_dtls+set}" = set; then
+  enableval=$enable_dtls;  ENABLED_DTLS=$enableval
+else
+   ENABLED_DTLS=no
+
+fi
+
+if test "$ENABLED_DTLS" = "yes"
+then
+  AM_CFLAGS="-DCYASSL_DTLS $AM_CFLAGS"
+fi
+
+
+# OPENSSL Extra Compatibility
+# Check whether --enable-opensslExtra was given.
+if test "${enable_opensslExtra+set}" = set; then
+  enableval=$enable_opensslExtra;  ENABLED_OPENSSLEXTRA=$enableval
+else
+   ENABLED_OPENSSLEXTRA=no
+
+fi
+
+if test "$ENABLED_OPENSSLEXTRA" = "yes"
+then
+  AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
+fi
+
+if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    { { echo "$as_me:$LINENO: error: cannot enable small and opensslExtra, only one or the other." >&5
+echo "$as_me: error: cannot enable small and opensslExtra, only one or the other." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+# IPv6 Test Apps
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+  enableval=$enable_ipv6;  ENABLED_IPV6=$enableval
+else
+   ENABLED_IPV6=no
+
+fi
+
+
+if test "$ENABLED_IPV6" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
+fi
+
+
+# Fortress build
+# Check whether --enable-fortress was given.
+if test "${enable_fortress+set}" = set; then
+  enableval=$enable_fortress;  ENABLED_FORTRESS=$enableval
+else
+   ENABLED_FORTRESS=no
+
+fi
+
+
+if test "$ENABLED_FORTRESS" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN"
+fi
+
+
+# ssl bump build
+# Check whether --enable-bump was given.
+if test "${enable_bump+set}" = set; then
+  enableval=$enable_bump;  ENABLED_BUMP=$enableval
+else
+   ENABLED_BUMP=no
+
+fi
+
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT"
+fi
+
+# fastmath
+# Check whether --enable-fastmath was given.
+if test "${enable_fastmath+set}" = set; then
+  enableval=$enable_fastmath;  ENABLED_FASTMATH=$enableval
+else
+   ENABLED_FASTMATH=no
+
+fi
+
+
+if test "x$ENABLED_FASTMATH" = "xyes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
+fi
+
+
+# fast HUGE math
+# Check whether --enable-fasthugemath was given.
+if test "${enable_fasthugemath+set}" = set; then
+  enableval=$enable_fasthugemath;  ENABLED_FASTHUGEMATH=$enableval
+else
+   ENABLED_FASTHUGEMATH=no
+
+fi
+
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    ENABLED_FASTHUGEMATH="yes"
+fi
+
+if test "$ENABLED_FASTHUGEMATH" = "yes"
+then
+    ENABLED_FASTMATH="yes"
+    AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
+fi
+
+ if test "x$ENABLED_FASTMATH" = "xyes"; then
+  BUILD_FASTMATH_TRUE=
+  BUILD_FASTMATH_FALSE='#'
+else
+  BUILD_FASTMATH_TRUE='#'
+  BUILD_FASTMATH_FALSE=
+fi
+
+
+
+# big cache
+# Check whether --enable-bigcache was given.
+if test "${enable_bigcache+set}" = set; then
+  enableval=$enable_bigcache;  ENABLED_BIGCACHE=$enableval
+else
+   ENABLED_BIGCACHE=no
+
+fi
+
+
+if test "$ENABLED_BIGCACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
+fi
+
+
+# HUGE cache
+# Check whether --enable-hugecache was given.
+if test "${enable_hugecache+set}" = set; then
+  enableval=$enable_hugecache;  ENABLED_HUGECACHE=$enableval
+else
+   ENABLED_HUGECACHE=no
+
+fi
+
+
+if test "$ENABLED_HUGECACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
+fi
+
+
+# SMALL cache
+# Check whether --enable-smallcache was given.
+if test "${enable_smallcache+set}" = set; then
+  enableval=$enable_smallcache;  ENABLED_SMALLCACHE=$enableval
+else
+   ENABLED_SMALLCACHE=no
+
+fi
+
+
+if test "$ENABLED_SMALLCACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
+fi
+
+
+# SNIFFER
+# Check whether --enable-sniffer was given.
+if test "${enable_sniffer+set}" = set; then
+  enableval=$enable_sniffer;  ENABLED_SNIFFER=$enableval
+else
+   ENABLED_SNIFFER=no
+
+fi
+
+
+if test "$ENABLED_SNIFFER" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
+fi
+
+ if test "x$ENABLED_SNIFFER" = "xyes"; then
+  BUILD_SNIFFER_TRUE=
+  BUILD_SNIFFER_FALSE='#'
+else
+  BUILD_SNIFFER_TRUE='#'
+  BUILD_SNIFFER_FALSE=
+fi
+
+
+# AES-GCM
+# Check whether --enable-aesgcm was given.
+if test "${enable_aesgcm+set}" = set; then
+  enableval=$enable_aesgcm;  ENABLED_AESGCM=$enableval
+else
+   ENABLED_AESGCM=no
+
+fi
+
+
+if test "$ENABLED_AESGCM" = "word32"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "small"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "table"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM -DCYASSL_SHA384 -DCYASSL_SHA512"
+fi
+
+ if test "x$ENABLED_AESGCM" = "xyes"; then
+  BUILD_AESGCM_TRUE=
+  BUILD_AESGCM_FALSE='#'
+else
+  BUILD_AESGCM_TRUE='#'
+  BUILD_AESGCM_FALSE=
+fi
+
+
+# AES-NI
+# Check whether --enable-aesni was given.
+if test "${enable_aesni+set}" = set; then
+  enableval=$enable_aesni;  ENABLED_AESNI=$enableval
+else
+   ENABLED_AESNI=no
+
+fi
+
+
+if test "$ENABLED_AESNI" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_AESNI"
+    if test "$GCC" = "yes"
+    then
+        # GCC needs these flags, icc doesn't
+        AM_CFLAGS="$AM_CFLAGS -maes -msse4"
+    fi
+fi
+
+ if test "x$ENABLED_AESNI" = "xyes"; then
+  BUILD_AESNI_TRUE=
+  BUILD_AESNI_FALSE='#'
+else
+  BUILD_AESNI_TRUE='#'
+  BUILD_AESNI_FALSE=
+fi
+
+
+
+# MD2
+# Check whether --enable-md2 was given.
+if test "${enable_md2+set}" = set; then
+  enableval=$enable_md2;  ENABLED_MD2=$enableval
+else
+   ENABLED_MD2=no
+
+fi
+
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    ENABLED_MD2="yes"
+fi
+
+if test "$ENABLED_MD2" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_MD2"
+fi
+
+ if test "x$ENABLED_MD2" = "xyes"; then
+  BUILD_MD2_TRUE=
+  BUILD_MD2_FALSE='#'
+else
+  BUILD_MD2_TRUE='#'
+  BUILD_MD2_FALSE=
+fi
+
+
+
+# RIPEMD
+# Check whether --enable-ripemd was given.
+if test "${enable_ripemd+set}" = set; then
+  enableval=$enable_ripemd;  ENABLED_RIPEMD=$enableval
+else
+   ENABLED_RIPEMD=no
+
+fi
+
+
+if test "$ENABLED_RIPEMD" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_RIPEMD"
+fi
+
+ if test "x$ENABLED_RIPEMD" = "xyes"; then
+  BUILD_RIPEMD_TRUE=
+  BUILD_RIPEMD_FALSE='#'
+else
+  BUILD_RIPEMD_TRUE='#'
+  BUILD_RIPEMD_FALSE=
+fi
+
+
+
+# SHA512
+# Check whether --enable-sha512 was given.
+if test "${enable_sha512+set}" = set; then
+  enableval=$enable_sha512;  ENABLED_SHA512=$enableval
+else
+   ENABLED_SHA512=no
+
+fi
+
+
+if test "$ENABLED_SHA512" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512"
+fi
+
+if test "$ENABLED_FORTRESS" = "yes"
+then
+    ENABLED_SHA512="yes"
+fi
+
+if test "$ENABLED_AESGCM" = "yes"
+then
+    ENABLED_SHA512="yes"
+fi
+
+
+ if test "x$ENABLED_SHA512" = "xyes"; then
+  BUILD_SHA512_TRUE=
+  BUILD_SHA512_FALSE='#'
+else
+  BUILD_SHA512_TRUE='#'
+  BUILD_SHA512_FALSE=
+fi
+
+
+
+# SESSION CERTS
+# Check whether --enable-sessioncerts was given.
+if test "${enable_sessioncerts+set}" = set; then
+  enableval=$enable_sessioncerts;  ENABLED_SESSIONCERTS=$enableval
+else
+   ENABLED_SESSIONCERTS=no
+
+fi
+
+
+if test "$ENABLED_SESSIONCERTS" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
+fi
+
+
+# KEY GENERATION
+# Check whether --enable-keygen was given.
+if test "${enable_keygen+set}" = set; then
+  enableval=$enable_keygen;  ENABLED_KEYGEN=$enableval
+else
+   ENABLED_KEYGEN=no
+
+fi
+
+
+if test "$ENABLED_KEYGEN" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
+fi
+
+
+# CERT GENERATION
+# Check whether --enable-certgen was given.
+if test "${enable_certgen+set}" = set; then
+  enableval=$enable_certgen;  ENABLED_CERTGEN=$enableval
+else
+   ENABLED_CERTGEN=no
+
+fi
+
+
+if test "$ENABLED_CERTGEN" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
+fi
+
+
+# HC128
+# Check whether --enable-hc128 was given.
+if test "${enable_hc128+set}" = set; then
+  enableval=$enable_hc128;  ENABLED_HC128=$enableval
+else
+   ENABLED_HC128=no
+
+fi
+
+
+if test "$ENABLED_HC128" = "no"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
+else
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
+fi
+
+ if test "x$ENABLED_HC128" = "xyes"; then
+  BUILD_HC128_TRUE=
+  BUILD_HC128_FALSE='#'
+else
+  BUILD_HC128_TRUE='#'
+  BUILD_HC128_FALSE=
+fi
+
+
+
+# PSK
+# Check whether --enable-psk was given.
+if test "${enable_psk+set}" = set; then
+  enableval=$enable_psk;  ENABLED_PSK=$enableval
+else
+   ENABLED_PSK=no
+
+fi
+
+
+if test "$ENABLED_PSK" = "no"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
+fi
+
+
+# Web Server Build
+# Check whether --enable-webServer was given.
+if test "${enable_webServer+set}" = set; then
+  enableval=$enable_webServer;  ENABLED_WEBSERVER=$enableval
+else
+   ENABLED_WEBSERVER=no
+
+fi
+
+
+if test "$ENABLED_WEBSERVER" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
+fi
+
+
+# No Filesystem Build
+# Check whether --enable-noFilesystem was given.
+if test "${enable_noFilesystem+set}" = set; then
+  enableval=$enable_noFilesystem;  ENABLED_NOFILESYSTEM=$enableval
+else
+   ENABLED_NOFILESYSTEM=no
+
+fi
+
+
+if test "$ENABLED_NOFILESYSTEM" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
+fi
+
+
+# No inline Build
+# Check whether --enable-noInline was given.
+if test "${enable_noInline+set}" = set; then
+  enableval=$enable_noInline;  ENABLED_NOINLINE=$enableval
+else
+   ENABLED_NOINLINE=no
+
+fi
+
+
+if test "$ENABLED_NOINLINE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
+fi
+
+ if test "x$ENABLED_NOINLINE" = "xyes"; then
+  BUILD_NOINLINE_TRUE=
+  BUILD_NOINLINE_FALSE='#'
+else
+  BUILD_NOINLINE_TRUE='#'
+  BUILD_NOINLINE_FALSE=
+fi
+
+
+
+# ECC
+# Check whether --enable-ecc was given.
+if test "${enable_ecc+set}" = set; then
+  enableval=$enable_ecc;  ENABLED_ECC=$enableval
+else
+   ENABLED_ECC=no
+
+fi
+
+
+if test "$ENABLED_ECC" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC"
+fi
+
+ if test "x$ENABLED_ECC" = "xyes"; then
+  BUILD_ECC_TRUE=
+  BUILD_ECC_FALSE='#'
+else
+  BUILD_ECC_TRUE='#'
+  BUILD_ECC_FALSE=
+fi
+
+
+
+if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    { { echo "$as_me:$LINENO: error: cannot enable ecc and small, ecc requires TLS which small turns off." >&5
+echo "$as_me: error: cannot enable ecc and small, ecc requires TLS which small turns off." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+# OCSP
+# Check whether --enable-ocsp was given.
+if test "${enable_ocsp+set}" = set; then
+  enableval=$enable_ocsp;  ENABLED_OCSP=$enableval
+else
+   ENABLED_OCSP=no
+fi
+
+
+if test "$ENABLED_OCSP" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
+fi
+
+ if test "x$ENABLED_OCSP" = "xyes"; then
+  BUILD_OCSP_TRUE=
+  BUILD_OCSP_FALSE='#'
+else
+  BUILD_OCSP_TRUE='#'
+  BUILD_OCSP_FALSE=
+fi
+
+
+
+# CRL
+# Check whether --enable-crl was given.
+if test "${enable_crl+set}" = set; then
+  enableval=$enable_crl;  ENABLED_CRL=$enableval
+else
+   ENABLED_CRL=no
+fi
+
+
+if test "$ENABLED_CRL" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
+fi
+
+ if test "x$ENABLED_CRL" = "xyes"; then
+  BUILD_CRL_TRUE=
+  BUILD_CRL_FALSE='#'
+else
+  BUILD_CRL_TRUE='#'
+  BUILD_CRL_FALSE=
+fi
+
+
+
+# CRL Monitor
+# Check whether --enable-crl-monitor was given.
+if test "${enable_crl_monitor+set}" = set; then
+  enableval=$enable_crl_monitor;  ENABLED_CRL_MONITOR=$enableval
+else
+   ENABLED_CRL_MONITOR=no
+fi
+
+
+if test "$ENABLED_CRL_MONITOR" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
+fi
+
+ if test "x$ENABLED_CRL_MONITOR" = "xyes"; then
+  BUILD_CRL_MONITOR_TRUE=
+  BUILD_CRL_MONITOR_FALSE='#'
+else
+  BUILD_CRL_MONITOR_TRUE='#'
+  BUILD_CRL_MONITOR_FALSE=
+fi
+
+
+
+# NTRU
+ntruHome=`pwd`/NTRU_algorithm
+ntruInclude=$ntruHome/cryptolib
+ntruLib=$ntruHome
+# Check whether --enable-ntru was given.
+if test "${enable_ntru+set}" = set; then
+  enableval=$enable_ntru;  ENABLED_NTRU=$enableval
+else
+   ENABLED_NTRU=no
+
+fi
+
+
+if test "$ENABLED_NTRU" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU -I$ntruInclude"
+    AM_LDFLAGS="$AM_LDFLAGS -L$ntruLib"
+    LIBS="$LIBS -lntru_encrypt"
+fi
+
+ if test "x$ENABLED_NTRU" = "xyes"; then
+  BUILD_NTRU_TRUE=
+  BUILD_NTRU_FALSE='#'
+else
+  BUILD_NTRU_TRUE='#'
+  BUILD_NTRU_FALSE=
+fi
+
+
+if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    { { echo "$as_me:$LINENO: error: cannot enable ntru and small, ntru requires TLS which small turns off." >&5
+echo "$as_me: error: cannot enable ntru and small, ntru requires TLS which small turns off." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+# Test certs, use internal cert functions for extra testing
+# Check whether --enable-testcert was given.
+if test "${enable_testcert+set}" = set; then
+  enableval=$enable_testcert;  ENABLED_TESTCERT=$enableval
+else
+   ENABLED_TESTCERT=no
+
+fi
+
+
+if test "$ENABLED_TESTCERT" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_TEST_CERT"
+fi
+
+
+# LIBZ
+trylibzdir=""
+
+# Check whether --with-libz was given.
+if test "${with_libz+set}" = set; then
+  withval=$with_libz;
+        { echo "$as_me:$LINENO: checking for libz" >&5
+echo $ECHO_N "checking for libz... $ECHO_C" >&6; }
+        CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
+        LIBS="$LIBS -lz"
+
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <zlib.h>
+int
+main ()
+{
+ deflateInit(0, 8);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+   libz_linked=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+        libz_linked=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+        if test "x$libz_linked" == "xno" ; then
+            if test "x$withval" != "xno" ; then
+                trylibzdir=$withval
+            fi
+            if test "x$withval" == "xyes" ; then
+                trylibzdir="/usr"
+            fi
+
+            AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
+            CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
+
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <zlib.h>
+int
+main ()
+{
+ deflateInit(0, 8);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+   libz_linked=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+        libz_linked=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+            if test "x$libz_linked" == "xno" ; then
+                { { echo "$as_me:$LINENO: error: libz isn't found.
+                If it's already installed, specify its path using --with-libz=/dir/" >&5
+echo "$as_me: error: libz isn't found.
+                If it's already installed, specify its path using --with-libz=/dir/" >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        else
+            { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+        fi
+
+
+
+fi
+
+
+
+# OPTIMIZE FLAGS
+if test "$GCC" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
+    if test "$ENABLED_DEBUG" = "no"
+    then
+        if test "$ENABLED_FASTMATH" = "yes"
+        then
+            AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
+            if test "$ENABLED_FASTHUGEMATH" = "yes"
+            then
+                AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
+            fi
+        else
+            AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
+        fi
+    fi
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; }
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
+int
+main ()
+{
+return pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ax_pthread_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        { echo "$as_me:$LINENO: result: $ax_pthread_ok" >&5
+echo "${ECHO_T}$ax_pthread_ok" >&6; }
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+        *-darwin*)
+        ax_pthread_flags="-pthread $ax_pthread_flags"
+        ;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
+echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; }
+                ;;
+
+                -*)
+                { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
+echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; }
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                pthread-config)
+                # Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ax_pthread_config+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ax_pthread_config="yes"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi
+fi
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { echo "$as_me:$LINENO: result: $ax_pthread_config" >&5
+echo "${ECHO_T}$ax_pthread_config" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+                if test x"$ax_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
+echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; }
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }
+int
+main ()
+{
+pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ax_pthread_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        { echo "$as_me:$LINENO: result: $ax_pthread_ok" >&5
+echo "${ECHO_T}$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
+echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; }
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int attr = $attr; return attr /* ; */
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  attr_name=$attr; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        done
+        { echo "$as_me:$LINENO: result: $attr_name" >&5
+echo "${ECHO_T}$attr_name" >&6; }
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
+_ACEOF
+
+        fi
+
+        { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
+echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        { echo "$as_me:$LINENO: result: ${flag}" >&5
+echo "${ECHO_T}${flag}" >&6; }
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        { echo "$as_me:$LINENO: checking for PTHREAD_PRIO_INHERIT" >&5
+echo $ECHO_N "checking for PTHREAD_PRIO_INHERIT... $ECHO_C" >&6; }
+if test "${ax_cv_PTHREAD_PRIO_INHERIT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+                cat >conftest.$ac_ext <<_ACEOF
+
+                    /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int i = PTHREAD_PRIO_INHERIT;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ax_cv_PTHREAD_PRIO_INHERIT=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ax_cv_PTHREAD_PRIO_INHERIT=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+echo "${ECHO_T}$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+        if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_PRIO_INHERIT 1
+_ACEOF
+
+fi
+
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+        if test x"$GCC" != xyes; then
+          for ac_prog in xlc_r cc_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5
+echo "${ECHO_T}$PTHREAD_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
+
+        else
+          PTHREAD_CC=$CC
+        fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD 1
+_ACEOF
+
+
+        :
+else
+        ax_pthread_ok=no
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD 0
+_ACEOF
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+       { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_gethostbyname=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_gethostbyname+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  :
+else
+  ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+       { echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; }
+if test "${ac_cv_search_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_socket=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_socket+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_socket+set}" = set; then
+  :
+else
+  ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+
+               { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
+if test "${ac_cv_lib_socket_socket+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket -lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_socket_socket=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_socket_socket=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
+if test $ac_cv_lib_socket_socket = yes; then
+  LIBS="-lsocket -lnsl $LIBS"
+fi
+
+fi
+
+
+
+GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef          \
+  -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes                \
+  -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment           \
+  -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls     \
+  -Wnested-externs -Wbad-function-cast -Wswitch-enum -Winit-self          \
+  -Wmissing-field-initializers -Wdeclaration-after-statement              \
+  -Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id     \
+  -Woverride-init -Wstrict-overflow=1 -Wextra -Wstack-protector -Wformat  \
+  -Wformat-security -Wpointer-sign -Wshadow -Wswitch-default"
+
+case "$host_os" in
+  *linux*)
+GCCWARNINGS="$GCCWARNINGS -Warray-bounds"
+  ;;
+esac
+
+# Check whether --enable-gcc-lots-o-warnings was given.
+if test "${enable_gcc_lots_o_warnings+set}" = set; then
+  enableval=$enable_gcc_lots_o_warnings; if test x$enableval = xyes; then
+    AM_CFLAGS="$AM_CFLAGS $GCCWARNINGS"
+fi
+fi
+
+
+# Check whether --enable-gcc-hardening was given.
+if test "${enable_gcc_hardening+set}" = set; then
+  enableval=$enable_gcc_hardening; if test x$enableval = xyes; then
+    AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+    AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
+    AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
+    LDFLAGS="$LDFLAGS -pie"
+fi
+fi
+
+
+# Check whether --enable-linker-hardening was given.
+if test "${enable_linker_hardening+set}" = set; then
+  enableval=$enable_linker_hardening; if test x$enableval = xyes; then
+    LDFLAGS="$LDFLAGS -z relro -z now"
+fi
+fi
+
+
+
+
+  HEX_VERSION=`echo $VERSION | sed 's|\-a-z0-9*$||' | \
+    awk -F. '{printf "0x%0.2d%0.3d%0.3d", $1, $2, $3}'`
+
+
+AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
+
+
+
+# FINAL
+ac_config_files="$ac_config_files stamp-h"
+
+ac_config_files="$ac_config_files Makefile"
+
+ac_config_files="$ac_config_files cyassl/version.h"
+
+ac_config_files="$ac_config_files support/libcyassl.pc"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_FASTMATH_TRUE}" && test -z "${BUILD_FASTMATH_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_FASTMATH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_FASTMATH\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_SNIFFER_TRUE}" && test -z "${BUILD_SNIFFER_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_SNIFFER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_SNIFFER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_AESGCM_TRUE}" && test -z "${BUILD_AESGCM_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_AESGCM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_AESGCM\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_AESNI_TRUE}" && test -z "${BUILD_AESNI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_AESNI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_AESNI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_MD2_TRUE}" && test -z "${BUILD_MD2_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_MD2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_MD2\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_RIPEMD_TRUE}" && test -z "${BUILD_RIPEMD_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_RIPEMD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_RIPEMD\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_SHA512_TRUE}" && test -z "${BUILD_SHA512_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_SHA512\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_SHA512\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_HC128_TRUE}" && test -z "${BUILD_HC128_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_HC128\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_HC128\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_NOINLINE_TRUE}" && test -z "${BUILD_NOINLINE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_NOINLINE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_NOINLINE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_ECC_TRUE}" && test -z "${BUILD_ECC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_ECC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_ECC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_OCSP_TRUE}" && test -z "${BUILD_OCSP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_OCSP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_OCSP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_CRL_TRUE}" && test -z "${BUILD_CRL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CRL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_CRL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_CRL_MONITOR_TRUE}" && test -z "${BUILD_CRL_MONITOR_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CRL_MONITOR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_CRL_MONITOR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_NTRU_TRUE}" && test -z "${BUILD_NTRU_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_NTRU\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_NTRU\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by cyassl $as_me 2.3.0, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                  instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                  instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+cyassl config.status 2.3.0
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+fix_srcfile_path_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "cyassl/version.h") CONFIG_FILES="$CONFIG_FILES cyassl/version.h" ;;
+    "support/libcyassl.pc") CONFIG_FILES="$CONFIG_FILES support/libcyassl.pc" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+CYASSL_LIBRARY_VERSION!$CYASSL_LIBRARY_VERSION$ac_delim
+AS!$AS$ac_delim
+DLLTOOL!$DLLTOOL$ac_delim
+OBJDUMP!$OBJDUMP$ac_delim
+LIBTOOL!$LIBTOOL$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+SED!$SED$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+FGREP!$FGREP$ac_delim
+LD!$LD$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+DUMPBIN!$DUMPBIN$ac_delim
+ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim
+NM!$NM$ac_delim
+LN_S!$LN_S$ac_delim
+AR!$AR$ac_delim
+RANLIB!$RANLIB$ac_delim
+DSYMUTIL!$DSYMUTIL$ac_delim
+NMEDIT!$NMEDIT$ac_delim
+LIPO!$LIPO$ac_delim
+OTOOL!$OTOOL$ac_delim
+OTOOL64!$OTOOL64$ac_delim
+CPP!$CPP$ac_delim
+CXX!$CXX$ac_delim
+CXXFLAGS!$CXXFLAGS$ac_delim
+ac_ct_CXX!$ac_ct_CXX$ac_delim
+CXXDEPMODE!$CXXDEPMODE$ac_delim
+am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+CXXCPP!$CXXCPP$ac_delim
+CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim
+HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+CCAS!$CCAS$ac_delim
+CCASFLAGS!$CCASFLAGS$ac_delim
+CCASDEPMODE!$CCASDEPMODE$ac_delim
+am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim
+am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim
+LIBM!$LIBM$ac_delim
+BUILD_FASTMATH_TRUE!$BUILD_FASTMATH_TRUE$ac_delim
+BUILD_FASTMATH_FALSE!$BUILD_FASTMATH_FALSE$ac_delim
+BUILD_SNIFFER_TRUE!$BUILD_SNIFFER_TRUE$ac_delim
+BUILD_SNIFFER_FALSE!$BUILD_SNIFFER_FALSE$ac_delim
+BUILD_AESGCM_TRUE!$BUILD_AESGCM_TRUE$ac_delim
+BUILD_AESGCM_FALSE!$BUILD_AESGCM_FALSE$ac_delim
+BUILD_AESNI_TRUE!$BUILD_AESNI_TRUE$ac_delim
+BUILD_AESNI_FALSE!$BUILD_AESNI_FALSE$ac_delim
+BUILD_MD2_TRUE!$BUILD_MD2_TRUE$ac_delim
+BUILD_MD2_FALSE!$BUILD_MD2_FALSE$ac_delim
+BUILD_RIPEMD_TRUE!$BUILD_RIPEMD_TRUE$ac_delim
+BUILD_RIPEMD_FALSE!$BUILD_RIPEMD_FALSE$ac_delim
+BUILD_SHA512_TRUE!$BUILD_SHA512_TRUE$ac_delim
+BUILD_SHA512_FALSE!$BUILD_SHA512_FALSE$ac_delim
+BUILD_HC128_TRUE!$BUILD_HC128_TRUE$ac_delim
+BUILD_HC128_FALSE!$BUILD_HC128_FALSE$ac_delim
+BUILD_NOINLINE_TRUE!$BUILD_NOINLINE_TRUE$ac_delim
+BUILD_NOINLINE_FALSE!$BUILD_NOINLINE_FALSE$ac_delim
+BUILD_ECC_TRUE!$BUILD_ECC_TRUE$ac_delim
+BUILD_ECC_FALSE!$BUILD_ECC_FALSE$ac_delim
+BUILD_OCSP_TRUE!$BUILD_OCSP_TRUE$ac_delim
+BUILD_OCSP_FALSE!$BUILD_OCSP_FALSE$ac_delim
+BUILD_CRL_TRUE!$BUILD_CRL_TRUE$ac_delim
+BUILD_CRL_FALSE!$BUILD_CRL_FALSE$ac_delim
+BUILD_CRL_MONITOR_TRUE!$BUILD_CRL_MONITOR_TRUE$ac_delim
+BUILD_CRL_MONITOR_FALSE!$BUILD_CRL_MONITOR_FALSE$ac_delim
+BUILD_NTRU_TRUE!$BUILD_NTRU_TRUE$ac_delim
+BUILD_NTRU_FALSE!$BUILD_NTRU_FALSE$ac_delim
+ax_pthread_config!$ax_pthread_config$ac_delim
+PTHREAD_CC!$PTHREAD_CC$ac_delim
+PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim
+PTHREAD_CFLAGS!$PTHREAD_CFLAGS$ac_delim
+HEX_VERSION!$HEX_VERSION$ac_delim
+AM_CFLAGS!$AM_CFLAGS$ac_delim
+AM_LDFLAGS!$AM_LDFLAGS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15
+    $RM -f "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+    "stamp-h":F) echo timestamp > stamp-h ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/configure.ac b/FreeRTOS-Plus/Source/CyaSSL/configure.ac
new file mode 100644 (file)
index 0000000..88a368d
--- /dev/null
@@ -0,0 +1,736 @@
+# configure.ac
+#
+# Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+#
+# This file is part of CyaSSL.
+#
+#
+
+AC_INIT([cyassl],[2.3.0],[http://www.yassl.com])
+
+AC_CONFIG_AUX_DIR(config)
+
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability foreign tar-ustar subdir-objects)
+
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+
+AC_PREREQ([2.61])
+
+AC_CONFIG_MACRO_DIR(m4)
+
+AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
+
+
+#shared library versioning
+CYASSL_LIBRARY_VERSION=3:1:0
+#                      | | |
+#               +------+ | +---+
+#               |        |     |
+#              current:revision:age
+#               |        |     |
+#               |        |     +- increment if interfaces have been added
+#               |        |        set to zero if interfaces have been removed
+#                        |        or changed
+#               |        +- increment if source code has changed
+#               |           set to zero if current is incremented
+#               +- increment if interfaces have been added, removed or changed
+AC_SUBST(CYASSL_LIBRARY_VERSION)
+
+# Make sure configure doesn't add to CFLAGS
+CFLAGS="$CFLAGS $C_EXTRA_FLAGS"
+
+LT_INIT([win32-dll])
+LT_LANG([C++])
+LT_LANG([C])
+gl_VISIBILITY
+
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AC_CHECK_FUNCS([gethostbyname])
+AC_CHECK_FUNCS([gettimeofday])
+AC_CHECK_FUNCS([inet_ntoa])
+AC_CHECK_FUNCS([memset])
+AC_CHECK_FUNCS([socket])
+AC_CHECK_HEADERS([arpa/inet.h])
+AC_CHECK_HEADERS([fcntl.h])
+AC_CHECK_HEADERS([limits.h])
+AC_CHECK_HEADERS([netdb.h])
+AC_CHECK_HEADERS([netinet/in.h])
+AC_CHECK_HEADERS([stddef.h])
+AC_CHECK_HEADERS([sys/ioctl.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([sys/time.h])
+AC_CHECK_HEADERS(errno.h)
+AC_CHECK_LIB(network,socket)
+AC_CHECK_SIZEOF(long long, 8)
+AC_CHECK_SIZEOF(long, 4)
+AC_C_BIGENDIAN
+AC_DISABLE_STATIC
+AC_DISABLE_STATIC
+AC_FUNC_MALLOC
+AC_FUNC_MKTIME
+AC_FUNC_REALLOC
+
+AC_PROG_CC
+AC_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_INSTALL
+LT_INIT
+AC_TYPE_SIZE_T
+AC_TYPE_UINT8_T
+AM_PROG_AS
+AM_PROG_CC_C_O
+LT_LIB_M
+
+OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
+OPTIMIZE_FAST_CFLAGS="-O3 -fomit-frame-pointer"
+OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET"
+DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_CYASSL"
+
+
+# DEBUG
+AC_ARG_ENABLE(debug,
+    [  --enable-debug          Enable CyaSSL debugging support (default: disabled)],
+    [ ENABLED_DEBUG=$enableval ],
+    [ ENABLED_DEBUG=no ]
+    )
+if test "$ENABLED_DEBUG" = "yes"
+then
+  # Full debug. Very slow in some cases
+  AM_CFLAGS="$DEBUG_CFLAGS $AM_CFLAGS"
+else
+  # Optimized version. No debug
+  AM_CFLAGS="$AM_CFLAGS -DNDEBUG"
+fi
+
+
+# SMALL BUILD
+AC_ARG_ENABLE(small,
+    [  --enable-small          Enable smallest build (default: disabled)],
+    [ ENABLED_SMALL=$enableval ],
+    [ ENABLED_SMALL=no ]
+    )
+if test "$ENABLED_SMALL" = "yes"
+then
+  # make small no tls build with smallest cipher
+  # if you only want server or client you can define NO_CYASSL_SERVER or
+  # NO_CYASSL_CLIENT but then some of the examples and testsuite won't build
+  # note that TLS needs HMAC
+  AM_CFLAGS="-DNO_TLS -DNO_HMAC -DNO_AES -DNO_DES3 -DNO_SHA256 -DNO_ERROR_STRINGS -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED $AM_CFLAGS" 
+fi
+
+
+# SINGLE THREADED
+AC_ARG_ENABLE(singleThreaded,
+    [  --enable-singleThreaded Enable CyaSSL single threaded (default: disabled)],
+    [ ENABLED_SINGLETHREADED=$enableval ],
+    [ ENABLED_SINGLETHREADED=no ]
+    )
+if test "$ENABLED_SINGLETHREADED" = "yes"
+then
+  AM_CFLAGS="-DSINGLE_THREADED $AM_CFLAGS"
+fi
+
+
+# DTLS
+AC_ARG_ENABLE(dtls,
+    [  --enable-dtls           Enable CyaSSL DTLS (default: disabled)],
+    [ ENABLED_DTLS=$enableval ],
+    [ ENABLED_DTLS=no ]
+    )
+if test "$ENABLED_DTLS" = "yes"
+then
+  AM_CFLAGS="-DCYASSL_DTLS $AM_CFLAGS"
+fi
+
+
+# OPENSSL Extra Compatibility
+AC_ARG_ENABLE(opensslExtra,
+    [  --enable-opensslExtra   Enable extra OpenSSL API, size+ (default: disabled)],
+    [ ENABLED_OPENSSLEXTRA=$enableval ],
+    [ ENABLED_OPENSSLEXTRA=no ]
+    )
+if test "$ENABLED_OPENSSLEXTRA" = "yes"
+then
+  AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
+fi
+
+if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    AC_MSG_ERROR([cannot enable small and opensslExtra, only one or the other.])
+fi
+
+
+# IPv6 Test Apps
+AC_ARG_ENABLE(ipv6,
+    [  --enable-ipv6           Enable testing of IPV6 (default: disabled)],
+    [ ENABLED_IPV6=$enableval ],
+    [ ENABLED_IPV6=no ]
+    )
+
+if test "$ENABLED_IPV6" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
+fi
+
+
+# Fortress build 
+AC_ARG_ENABLE(fortress,
+    [  --enable-fortress       Enable SSL fortress build (default: disabled)],
+    [ ENABLED_FORTRESS=$enableval ],
+    [ ENABLED_FORTRESS=no ]
+    )
+
+if test "$ENABLED_FORTRESS" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN"
+fi
+
+
+# ssl bump build 
+AC_ARG_ENABLE(bump,
+    [  --enable-bump           Enable SSL Bump build (default: disabled)],
+    [ ENABLED_BUMP=$enableval ],
+    [ ENABLED_BUMP=no ]
+    )
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT"
+fi
+
+# fastmath
+AC_ARG_ENABLE(fastmath,
+    [  --enable-fastmath       Enable fast math for BigInts (default: disabled)],
+    [ ENABLED_FASTMATH=$enableval ],
+    [ ENABLED_FASTMATH=no ]
+    )
+
+if test "x$ENABLED_FASTMATH" = "xyes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
+fi
+
+
+# fast HUGE math
+AC_ARG_ENABLE(fasthugemath,
+    [  --enable-fasthugemath   Enable fast math + huge code (default: disabled)],
+    [ ENABLED_FASTHUGEMATH=$enableval ],
+    [ ENABLED_FASTHUGEMATH=no ]
+    )
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    ENABLED_FASTHUGEMATH="yes"
+fi
+
+if test "$ENABLED_FASTHUGEMATH" = "yes"
+then
+    ENABLED_FASTMATH="yes"
+    AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
+fi
+
+AM_CONDITIONAL([BUILD_FASTMATH], [test "x$ENABLED_FASTMATH" = "xyes"])
+
+
+# big cache
+AC_ARG_ENABLE(bigcache,
+    [  --enable-bigcache       Enable big session cache (default: disabled)],
+    [ ENABLED_BIGCACHE=$enableval ],
+    [ ENABLED_BIGCACHE=no ]
+    )
+
+if test "$ENABLED_BIGCACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
+fi
+
+
+# HUGE cache
+AC_ARG_ENABLE(hugecache,
+    [  --enable-hugecache      Enable huge session cache (default: disabled)],
+    [ ENABLED_HUGECACHE=$enableval ],
+    [ ENABLED_HUGECACHE=no ]
+    )
+
+if test "$ENABLED_HUGECACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
+fi
+
+
+# SMALL cache
+AC_ARG_ENABLE(smallcache,
+    [  --enable-smallcache     Enable small session cache (default: disabled)],
+    [ ENABLED_SMALLCACHE=$enableval ],
+    [ ENABLED_SMALLCACHE=no ]
+    )
+
+if test "$ENABLED_SMALLCACHE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
+fi
+
+
+# SNIFFER
+AC_ARG_ENABLE(sniffer,
+    [  --enable-sniffer        Enable CyaSSL sniffer support (default: disabled)],
+    [ ENABLED_SNIFFER=$enableval ],
+    [ ENABLED_SNIFFER=no ]
+    )
+
+if test "$ENABLED_SNIFFER" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
+fi
+
+AM_CONDITIONAL([BUILD_SNIFFER], [test "x$ENABLED_SNIFFER" = "xyes"])
+
+# AES-GCM
+AC_ARG_ENABLE(aesgcm,
+    [  --enable-aesgcm         Enable CyaSSL AES-GCM support (default: disabled)],
+    [ ENABLED_AESGCM=$enableval ],
+    [ ENABLED_AESGCM=no ]
+    )
+
+if test "$ENABLED_AESGCM" = "word32"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "small"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "table"
+then
+    AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
+    ENABLED_AESGCM=yes
+fi
+
+if test "$ENABLED_AESGCM" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM -DCYASSL_SHA384 -DCYASSL_SHA512"
+fi
+
+AM_CONDITIONAL([BUILD_AESGCM], [test "x$ENABLED_AESGCM" = "xyes"])
+
+# AES-NI
+AC_ARG_ENABLE(aesni,
+    [  --enable-aesni          Enable CyaSSL AES-NI support (default: disabled)],
+    [ ENABLED_AESNI=$enableval ],
+    [ ENABLED_AESNI=no ]
+    )
+
+if test "$ENABLED_AESNI" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_AESNI"
+    if test "$GCC" = "yes"
+    then
+        # GCC needs these flags, icc doesn't
+        AM_CFLAGS="$AM_CFLAGS -maes -msse4"
+    fi
+fi
+
+AM_CONDITIONAL([BUILD_AESNI], [test "x$ENABLED_AESNI" = "xyes"])
+
+
+# MD2
+AC_ARG_ENABLE(md2,
+    [  --enable-md2            Enable CyaSSL MD2 support (default: disabled)],
+    [ ENABLED_MD2=$enableval ],
+    [ ENABLED_MD2=no ]
+    )
+
+if test "$ENABLED_BUMP" = "yes"
+then
+    ENABLED_MD2="yes"
+fi
+
+if test "$ENABLED_MD2" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_MD2"
+fi
+
+AM_CONDITIONAL([BUILD_MD2], [test "x$ENABLED_MD2" = "xyes"])
+
+
+# RIPEMD
+AC_ARG_ENABLE(ripemd,
+    [  --enable-ripemd         Enable CyaSSL RIPEMD-160 support (default: disabled)],
+    [ ENABLED_RIPEMD=$enableval ],
+    [ ENABLED_RIPEMD=no ]
+    )
+
+if test "$ENABLED_RIPEMD" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_RIPEMD"
+fi
+
+AM_CONDITIONAL([BUILD_RIPEMD], [test "x$ENABLED_RIPEMD" = "xyes"])
+
+
+# SHA512
+AC_ARG_ENABLE(sha512,
+    [  --enable-sha512         Enable CyaSSL SHA-512 support (default: disabled)],
+    [ ENABLED_SHA512=$enableval ],
+    [ ENABLED_SHA512=no ]
+    )
+
+if test "$ENABLED_SHA512" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512"
+fi
+
+if test "$ENABLED_FORTRESS" = "yes"
+then
+    ENABLED_SHA512="yes"
+fi
+
+if test "$ENABLED_AESGCM" = "yes"
+then
+    ENABLED_SHA512="yes"
+fi
+
+
+AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
+
+
+# SESSION CERTS
+AC_ARG_ENABLE(sessioncerts,
+    [  --enable-sessioncerts   Enable session cert storing (default: disabled)],
+    [ ENABLED_SESSIONCERTS=$enableval ],
+    [ ENABLED_SESSIONCERTS=no ]
+    )
+
+if test "$ENABLED_SESSIONCERTS" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
+fi
+
+
+# KEY GENERATION
+AC_ARG_ENABLE(keygen,
+    [  --enable-keygen         Enable key generation (default: disabled)],
+    [ ENABLED_KEYGEN=$enableval ],
+    [ ENABLED_KEYGEN=no ]
+    )
+
+if test "$ENABLED_KEYGEN" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
+fi
+
+
+# CERT GENERATION
+AC_ARG_ENABLE(certgen,
+    [  --enable-certgen        Enable cert generation (default: disabled)],
+    [ ENABLED_CERTGEN=$enableval ],
+    [ ENABLED_CERTGEN=no ]
+    )
+
+if test "$ENABLED_CERTGEN" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
+fi
+
+
+# HC128 
+AC_ARG_ENABLE(hc128,
+    [  --enable-hc128          Enable HC-128 (default: disabled)],
+    [ ENABLED_HC128=$enableval ],
+    [ ENABLED_HC128=no ]
+    )
+
+if test "$ENABLED_HC128" = "no"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
+else
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
+fi
+
+AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])
+
+
+# PSK 
+AC_ARG_ENABLE(psk,
+    [  --enable-psk            Enable PSK (default: disabled)],
+    [ ENABLED_PSK=$enableval ],
+    [ ENABLED_PSK=no ]
+    )
+
+if test "$ENABLED_PSK" = "no"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
+fi
+
+
+# Web Server Build 
+AC_ARG_ENABLE(webServer,
+    [  --enable-webServer      Enable Web Server (default: disabled)],
+    [ ENABLED_WEBSERVER=$enableval ],
+    [ ENABLED_WEBSERVER=no ]
+    )
+
+if test "$ENABLED_WEBSERVER" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
+fi
+
+
+# No Filesystem Build 
+AC_ARG_ENABLE(noFilesystem,
+    [  --enable-noFilesystem   Enable No Filesystem (default: disabled)],
+    [ ENABLED_NOFILESYSTEM=$enableval ],
+    [ ENABLED_NOFILESYSTEM=no ]
+    )
+
+if test "$ENABLED_NOFILESYSTEM" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
+fi
+
+
+# No inline Build 
+AC_ARG_ENABLE(noInline,
+    [  --enable-noInline       Enable No inline (default: disabled)],
+    [ ENABLED_NOINLINE=$enableval ],
+    [ ENABLED_NOINLINE=no ]
+    )
+
+if test "$ENABLED_NOINLINE" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
+fi
+
+AM_CONDITIONAL([BUILD_NOINLINE], [test "x$ENABLED_NOINLINE" = "xyes"])
+
+
+# ECC 
+AC_ARG_ENABLE(ecc,
+    [  --enable-ecc            Enable ECC (default: disabled)],
+    [ ENABLED_ECC=$enableval ],
+    [ ENABLED_ECC=no ]
+    )
+
+if test "$ENABLED_ECC" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC"
+fi
+
+AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
+
+
+if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.]) 
+fi
+
+
+# OCSP
+AC_ARG_ENABLE(ocsp,
+    [  --enable-ocsp           Enable OCSP (default: disabled)],
+    [ ENABLED_OCSP=$enableval ],
+    [ ENABLED_OCSP=no ],
+    )
+
+if test "$ENABLED_OCSP" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
+fi
+
+AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
+
+
+# CRL 
+AC_ARG_ENABLE(crl,
+    [  --enable-crl            Enable CRL (default: disabled)],
+    [ ENABLED_CRL=$enableval ],
+    [ ENABLED_CRL=no ],
+    )
+
+if test "$ENABLED_CRL" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
+fi
+
+AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
+
+
+# CRL Monitor
+AC_ARG_ENABLE(crl-monitor,
+    [  --enable-crl-monitor    Enable CRL Monitor (default: disabled)],
+    [ ENABLED_CRL_MONITOR=$enableval ],
+    [ ENABLED_CRL_MONITOR=no ],
+    )
+
+if test "$ENABLED_CRL_MONITOR" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
+fi
+
+AM_CONDITIONAL([BUILD_CRL_MONITOR], [test "x$ENABLED_CRL_MONITOR" = "xyes"])
+
+
+# NTRU
+ntruHome=`pwd`/NTRU_algorithm
+ntruInclude=$ntruHome/cryptolib
+ntruLib=$ntruHome
+AC_ARG_ENABLE(ntru,
+    [  --enable-ntru           Enable NTRU (default: disabled)],
+    [ ENABLED_NTRU=$enableval ],
+    [ ENABLED_NTRU=no ]
+    )
+
+if test "$ENABLED_NTRU" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU -I$ntruInclude"
+    AM_LDFLAGS="$AM_LDFLAGS -L$ntruLib"
+    LIBS="$LIBS -lntru_encrypt"
+fi
+
+AM_CONDITIONAL([BUILD_NTRU], [test "x$ENABLED_NTRU" = "xyes"])
+
+if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes"
+then
+    AC_MSG_ERROR([cannot enable ntru and small, ntru requires TLS which small turns off.]) 
+fi
+
+
+# Test certs, use internal cert functions for extra testing 
+AC_ARG_ENABLE(testcert,
+    [  --enable-testcert       Enable Test Cert (default: disabled)],
+    [ ENABLED_TESTCERT=$enableval ],
+    [ ENABLED_TESTCERT=no ]
+    )
+
+if test "$ENABLED_TESTCERT" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -DCYASSL_TEST_CERT"
+fi
+
+
+# LIBZ
+trylibzdir=""
+AC_ARG_WITH(libz,
+    [  --with-libz=PATH        PATH to libz install (default /usr/) ],
+    [
+        AC_MSG_CHECKING([for libz])
+        CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
+        LIBS="$LIBS -lz"
+
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
+
+        if test "x$libz_linked" == "xno" ; then
+            if test "x$withval" != "xno" ; then
+                trylibzdir=$withval
+            fi
+            if test "x$withval" == "xyes" ; then
+                trylibzdir="/usr"
+            fi
+
+            AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
+            CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
+
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
+
+            if test "x$libz_linked" == "xno" ; then
+                AC_MSG_ERROR([libz isn't found.
+                If it's already installed, specify its path using --with-libz=/dir/])
+            fi
+            AC_MSG_RESULT([yes])
+        else
+            AC_MSG_RESULT([yes])
+        fi
+
+    ]
+)
+
+
+# OPTIMIZE FLAGS
+if test "$GCC" = "yes"
+then
+    AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
+    if test "$ENABLED_DEBUG" = "no"
+    then
+        if test "$ENABLED_FASTMATH" = "yes"
+        then
+            AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
+            if test "$ENABLED_FASTHUGEMATH" = "yes"
+            then
+                AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
+            fi
+        else
+            AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
+        fi
+    fi
+fi
+
+AX_PTHREAD([
+            AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
+            ],
+            [
+             AC_DEFINE([HAVE_PTHREAD], [0], [Define if you have POSIX threads libraries and header files.])
+             ])
+
+LIB_SOCKET_NSL
+
+dnl Various GCC warnings that should never fire for release quality code
+GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef          \
+  -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes                \
+  -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment           \
+  -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls     \
+  -Wnested-externs -Wbad-function-cast -Wswitch-enum -Winit-self          \
+  -Wmissing-field-initializers -Wdeclaration-after-statement              \
+  -Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id     \
+  -Woverride-init -Wstrict-overflow=1 -Wextra -Wstack-protector -Wformat  \
+  -Wformat-security -Wpointer-sign -Wshadow -Wswitch-default"
+
+case "$host_os" in
+  *linux*)
+GCCWARNINGS="$GCCWARNINGS -Warray-bounds"
+  ;;
+esac
+
+AC_ARG_ENABLE(gcc-lots-o-warnings,
+AS_HELP_STRING(--enable-gcc-lots-o-warnings, Enable lots of gcc warnings (default: disabled)),
+[if test x$enableval = xyes; then
+    AM_CFLAGS="$AM_CFLAGS $GCCWARNINGS"
+fi])
+
+AC_ARG_ENABLE(gcc-hardening,
+AS_HELP_STRING(--enable-gcc-hardening, Enable compiler security checks (default: disabled)),
+[if test x$enableval = xyes; then
+    AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+    AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
+    AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
+    LDFLAGS="$LDFLAGS -pie"
+fi])
+
+dnl Linker hardening options
+dnl Currently these options are ELF specific - you can't use this with MacOSX
+AC_ARG_ENABLE(linker-hardening,
+AS_HELP_STRING(--enable-linker-hardening, Enable linker security fixups (default: disabled)),
+[if test x$enableval = xyes; then
+    LDFLAGS="$LDFLAGS -z relro -z now"
+fi])
+
+CREATE_HEX_VERSION
+AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_LDFLAGS)
+
+# FINAL
+AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([cyassl/version.h])
+AC_CONFIG_FILES([support/libcyassl.pc])
+
+AC_OUTPUT
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.c
new file mode 100644 (file)
index 0000000..b1e6620
--- /dev/null
@@ -0,0 +1,681 @@
+/* benchmark.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* CTaoCrypt benchmark */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <string.h>
+#include <stdio.h>
+
+#include <cyassl/ctaocrypt/des3.h>
+#include <cyassl/ctaocrypt/arc4.h>
+#include <cyassl/ctaocrypt/hc128.h>
+#include <cyassl/ctaocrypt/rabbit.h>
+#include <cyassl/ctaocrypt/aes.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/sha256.h>
+#include <cyassl/ctaocrypt/sha512.h>
+#include <cyassl/ctaocrypt/rsa.h>
+#include <cyassl/ctaocrypt/asn.h>
+#include <cyassl/ctaocrypt/ripemd.h>
+#include <cyassl/ctaocrypt/ecc.h>
+
+#include <cyassl/ctaocrypt/dh.h>
+
+#ifdef _MSC_VER
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
+    #pragma warning(disable: 4996)
+#endif
+
+void bench_des();
+void bench_arc4();
+void bench_hc128();
+void bench_rabbit();
+void bench_aes(int);
+void bench_aesgcm();
+
+void bench_md5();
+void bench_sha();
+void bench_sha256();
+void bench_sha512();
+void bench_ripemd();
+
+void bench_rsa();
+void bench_rsaKeyGen();
+void bench_dh();
+#ifdef HAVE_ECC
+void bench_eccKeyGen();
+void bench_eccKeyAgree();
+#endif
+
+double current_time();
+
+
+
+int main(int argc, char** argv)
+{
+#ifndef NO_AES
+    bench_aes(0);
+    bench_aes(1);
+#endif
+#ifdef HAVE_AESGCM
+    bench_aesgcm();
+#endif
+    bench_arc4();
+#ifdef HAVE_HC128
+    bench_hc128();
+#endif
+#ifndef NO_RABBIT
+    bench_rabbit();
+#endif
+#ifndef NO_DES3
+    bench_des();
+#endif
+    
+    printf("\n");
+
+    bench_md5();
+    bench_sha();
+#ifndef NO_SHA256
+    bench_sha256();
+#endif
+#ifdef CYASSL_SHA512
+    bench_sha512();
+#endif
+#ifdef CYASSL_RIPEMD
+    bench_ripemd();
+#endif
+
+    printf("\n");
+    
+    bench_rsa();
+
+#ifndef NO_DH
+    bench_dh();
+#endif
+
+#ifdef CYASSL_KEY_GEN
+    bench_rsaKeyGen();
+#endif
+
+#ifdef HAVE_ECC 
+    bench_eccKeyGen();
+    bench_eccKeyAgree();
+#endif
+
+    return 0;
+}
+
+const int megs  = 5;     /* how many megs to test (en/de)cryption */
+const int times = 100;   /* public key iterations */
+
+const byte key[] = 
+{
+    0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
+    0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10,
+    0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67
+};
+
+const byte iv[] = 
+{
+    0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,
+    0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+    0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81
+    
+};
+
+
+byte plain [1024*1024];
+byte cipher[1024*1024];
+
+
+#ifndef NO_AES
+void bench_aes(int show)
+{
+    Aes    enc;
+    double start, total, persec;
+    int    i;
+
+    AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        AesCbcEncrypt(&enc, plain, cipher, sizeof(plain));
+
+    total = current_time() - start;
+
+    persec = 1 / total * megs;
+
+    if (show)
+        printf("AES      %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                                    persec);
+}
+#endif
+
+
+byte additional[13];
+byte tag[16];
+
+
+#ifdef HAVE_AESGCM
+void bench_aesgcm()
+{
+    Aes    enc;
+    double start, total, persec;
+    int    i;
+
+    AesGcmSetKey(&enc, key, 16, iv);
+    AesGcmSetExpIV(&enc, iv+4);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        AesGcmEncrypt(&enc, cipher, plain, sizeof(plain),
+                        tag, 16, additional, 13);
+
+    total = current_time() - start;
+
+    persec = 1 / total * megs;
+    printf("AES-GCM  %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                                    persec);
+}
+#endif
+
+
+#ifndef NO_DES3
+void bench_des()
+{
+    Des3   enc;
+    double start, total, persec;
+    int    i;
+
+    Des3_SetKey(&enc, key, iv, DES_ENCRYPTION);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        Des3_CbcEncrypt(&enc, plain, cipher, sizeof(plain));
+
+    total = current_time() - start;
+
+    persec = 1 / total * megs;
+
+    printf("3DES     %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif
+
+
+void bench_arc4()
+{
+    Arc4   enc;
+    double start, total, persec;
+    int    i;
+    
+    Arc4SetKey(&enc, key, 16);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        Arc4Process(&enc, cipher, plain, sizeof(plain));
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("ARC4     %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+
+
+#ifdef HAVE_HC128
+void bench_hc128()
+{
+    HC128  enc;
+    double start, total, persec;
+    int    i;
+    
+    Hc128_SetKey(&enc, key, iv);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        Hc128_Process(&enc, cipher, plain, sizeof(plain));
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("HC128    %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif /* HAVE_HC128 */
+
+
+#ifndef NO_RABBIT
+void bench_rabbit()
+{
+    Rabbit  enc;
+    double start, total, persec;
+    int    i;
+    
+    RabbitSetKey(&enc, key, iv);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        RabbitProcess(&enc, cipher, plain, sizeof(plain));
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("RABBIT   %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif /* NO_RABBIT */
+
+
+void bench_md5()
+{
+    Md5    hash;
+    byte   digest[MD5_DIGEST_SIZE];
+    double start, total, persec;
+    int    i;
+
+    InitMd5(&hash);
+    start = current_time();
+
+    for(i = 0; i < megs; i++)
+        Md5Update(&hash, plain, sizeof(plain));
+   
+    Md5Final(&hash, digest);
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("MD5      %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+
+
+void bench_sha()
+{
+    Sha    hash;
+    byte   digest[SHA_DIGEST_SIZE];
+    double start, total, persec;
+    int    i;
+        
+    InitSha(&hash);
+    start = current_time();
+    
+    for(i = 0; i < megs; i++)
+        ShaUpdate(&hash, plain, sizeof(plain));
+   
+    ShaFinal(&hash, digest);
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("SHA      %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+
+
+#ifndef NO_SHA256
+void bench_sha256()
+{
+    Sha256 hash;
+    byte   digest[SHA256_DIGEST_SIZE];
+    double start, total, persec;
+    int    i;
+        
+    InitSha256(&hash);
+    start = current_time();
+    
+    for(i = 0; i < megs; i++)
+        Sha256Update(&hash, plain, sizeof(plain));
+   
+    Sha256Final(&hash, digest);
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("SHA-256  %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif
+
+#ifdef CYASSL_SHA512
+void bench_sha512()
+{
+    Sha512 hash;
+    byte   digest[SHA512_DIGEST_SIZE];
+    double start, total, persec;
+    int    i;
+        
+    InitSha512(&hash);
+    start = current_time();
+    
+    for(i = 0; i < megs; i++)
+        Sha512Update(&hash, plain, sizeof(plain));
+   
+    Sha512Final(&hash, digest);
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("SHA-512  %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif
+
+#ifdef CYASSL_RIPEMD
+void bench_ripemd()
+{
+    RipeMd hash;
+    byte   digest[RIPEMD_DIGEST_SIZE];
+    double start, total, persec;
+    int    i;
+        
+    InitRipeMd(&hash);
+    start = current_time();
+    
+    for(i = 0; i < megs; i++)
+        RipeMdUpdate(&hash, plain, sizeof(plain));
+   
+    RipeMdFinal(&hash, digest);
+
+    total = current_time() - start;
+    persec = 1 / total * megs;
+
+    printf("RIPEMD   %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total,
+                                                             persec);
+}
+#endif
+
+
+RNG rng;
+
+void bench_rsa()
+{
+    int    i;
+    byte   tmp[4096];
+    size_t bytes;
+    word32 idx = 0;
+
+    byte      message[] = "Everyone gets Friday off.";
+    byte      cipher[512];  /* for up to 4096 bit */
+    byte*     output;
+    const int len = (int)strlen((char*)message);
+    double    start, total, each, milliEach;
+    
+    RsaKey key;
+    FILE*  file = fopen("./certs/rsa2048.der", "rb");
+
+    if (!file) {
+        printf("can't find ./certs/rsa2048.der, "
+               "Please run from CyaSSL home dir\n");
+        return;
+    }
+
+    InitRng(&rng);
+    bytes = fread(tmp, 1, sizeof(tmp), file);
+    InitRsaKey(&key, 0);
+    bytes = RsaPrivateKeyDecode(tmp, &idx, &key, (word32)bytes);
+    
+    start = current_time();
+
+    for (i = 0; i < times; i++)
+        bytes = RsaPublicEncrypt(message,len,cipher,sizeof(cipher), &key, &rng);
+
+    total = current_time() - start;
+    each  = total / times;   /* per second   */
+    milliEach = each * 1000; /* milliseconds */
+
+    printf("RSA 2048 encryption took %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, times);
+
+    start = current_time();
+
+    for (i = 0; i < times; i++)
+        RsaPrivateDecryptInline(cipher, (word32)bytes, &output, &key);
+
+    total = current_time() - start;
+    each  = total / times;   /* per second   */
+    milliEach = each * 1000; /* milliseconds */
+
+    printf("RSA 2048 decryption took %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, times);
+
+    fclose(file);
+    FreeRsaKey(&key);
+}
+
+
+#ifndef NO_DH
+void bench_dh()
+{
+    int    i;
+    byte   tmp[1024];
+    size_t bytes;
+    word32 idx = 0, pubSz, privSz, pubSz2, privSz2, agreeSz;
+
+    byte   pub[256];    /* for 2048 bit */
+    byte   priv[256];   /* for 2048 bit */
+    byte   pub2[256];   /* for 2048 bit */
+    byte   priv2[256];  /* for 2048 bit */
+    byte   agree[256];  /* for 2048 bit */
+    
+    double start, total, each, milliEach;
+    DhKey  key;
+    FILE*  file = fopen("./certs/dh2048.der", "rb");
+
+    if (!file) {
+        printf("can't find ./certs/dh2048.der, "
+               "Please run from CyaSSL home dir\n");
+        return;
+    }
+
+    bytes = fread(tmp, 1, sizeof(tmp), file);
+    InitDhKey(&key);
+    bytes = DhKeyDecode(tmp, &idx, &key, (word32)bytes);
+
+    start = current_time();
+
+    for (i = 0; i < times; i++)
+        DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz);
+
+    total = current_time() - start;
+    each  = total / times;   /* per second   */
+    milliEach = each * 1000; /* milliseconds */
+
+    printf("DH  2048 key generation  %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, times);
+
+    DhGenerateKeyPair(&key, &rng, priv2, &privSz2, pub2, &pubSz2);
+    start = current_time();
+
+    for (i = 0; i < times; i++)
+        DhAgree(&key, agree, &agreeSz, priv, privSz, pub2, pubSz2);
+
+    total = current_time() - start;
+    each  = total / times;   /* per second   */
+    milliEach = each * 1000; /* milliseconds */
+
+    printf("DH  2048 key agreement   %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, times);
+
+    fclose(file);
+    FreeDhKey(&key);
+}
+#endif
+
+#ifdef CYASSL_KEY_GEN
+void bench_rsaKeyGen()
+{
+    RsaKey genKey;
+    double start, total, each, milliEach;
+    int    i;
+    const int genTimes = 5;
+  
+    /* 1024 bit */ 
+    start = current_time();
+
+    for(i = 0; i < genTimes; i++) {
+        InitRsaKey(&genKey, 0); 
+        MakeRsaKey(&genKey, 1024, 65537, &rng);
+        FreeRsaKey(&genKey);
+    }
+
+    total = current_time() - start;
+    each  = total / genTimes;  /* per second  */
+    milliEach = each * 1000;   /* millisconds */
+    printf("\n");
+    printf("RSA 1024 key generation  %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, genTimes);
+
+    /* 2048 bit */
+    start = current_time();
+
+    for(i = 0; i < genTimes; i++) {
+        InitRsaKey(&genKey, 0); 
+        MakeRsaKey(&genKey, 2048, 65537, &rng);
+        FreeRsaKey(&genKey);
+    }
+
+    total = current_time() - start;
+    each  = total / genTimes;  /* per second  */
+    milliEach = each * 1000;   /* millisconds */
+    printf("RSA 2048 key generation  %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, genTimes);
+}
+#endif /* CYASSL_KEY_GEN */
+
+#ifdef HAVE_ECC 
+void bench_eccKeyGen()
+{
+    ecc_key genKey;
+    double start, total, each, milliEach;
+    int    i;
+    const int genTimes = 5;
+  
+    /* 256 bit */ 
+    start = current_time();
+
+    for(i = 0; i < genTimes; i++) {
+        int ret = ecc_make_key(&rng, 32, &genKey);
+        ecc_free(&genKey);
+    }
+
+    total = current_time() - start;
+    each  = total / genTimes;  /* per second  */
+    milliEach = each * 1000;   /* millisconds */
+    printf("\n");
+    printf("ECC  256 key generation  %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, genTimes);
+}
+
+
+void bench_eccKeyAgree()
+{
+    ecc_key genKey, genKey2;
+    double start, total, each, milliEach;
+    int    i;
+    const int agreeTimes = 5;
+    byte   shared[1024];
+    byte   sig[1024];
+    byte   digest[32];
+    word32 x;
+  
+    ecc_make_key(&rng, 32, &genKey);
+    ecc_make_key(&rng, 32, &genKey2);
+
+    /* 256 bit */ 
+    start = current_time();
+
+    for(i = 0; i < agreeTimes; i++) {
+        x = sizeof(shared);
+        ecc_shared_secret(&genKey, &genKey2, shared, &x);
+    }
+
+    total = current_time() - start;
+    each  = total / agreeTimes;  /* per second  */
+    milliEach = each * 1000;   /* millisconds */
+    printf("EC-DHE   key agreement   %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, agreeTimes);
+
+    /* make dummy digest */
+    for (i = 0; i < sizeof(digest); i++)
+        digest[i] = i;
+
+
+    start = current_time();
+
+    for(i = 0; i < agreeTimes; i++) {
+        x = sizeof(sig);
+        ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &genKey);
+    }
+
+    total = current_time() - start;
+    each  = total / agreeTimes;  /* per second  */
+    milliEach = each * 1000;   /* millisconds */
+    printf("EC-DSA   sign time       %6.2f milliseconds, avg over %d" 
+           " iterations\n", milliEach, agreeTimes);
+
+    ecc_free(&genKey2);
+    ecc_free(&genKey);
+}
+#endif /* HAVE_ECC */
+
+
+#ifdef _WIN32
+
+    #define WIN32_LEAN_AND_MEAN
+    #include <windows.h>
+
+    double current_time()
+    {
+        static int init = 0;
+        static LARGE_INTEGER freq;
+    
+        LARGE_INTEGER count;
+
+        if (!init) {
+            QueryPerformanceFrequency(&freq);
+            init = 1;
+        }
+
+        QueryPerformanceCounter(&count);
+
+        return (double)count.QuadPart / freq.QuadPart;
+    }
+
+#else
+
+    #include <sys/time.h>
+
+    double current_time()
+    {
+        struct timeval tv;
+        gettimeofday(&tv, 0);
+
+        return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
+    }
+
+#endif /* _WIN32 */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.sln b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.sln
new file mode 100644 (file)
index 0000000..e3e9483
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "benchmark.vcproj", "{615AEC46-5595-4DEA-9490-DBD5DE0F8772}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {615AEC46-5595-4DEA-9490-DBD5DE0F8772}.Debug|Win32.ActiveCfg = Debug|Win32
+               {615AEC46-5595-4DEA-9490-DBD5DE0F8772}.Debug|Win32.Build.0 = Debug|Win32
+               {615AEC46-5595-4DEA-9490-DBD5DE0F8772}.Release|Win32.ActiveCfg = Release|Win32
+               {615AEC46-5595-4DEA-9490-DBD5DE0F8772}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.vcproj b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/benchmark.vcproj
new file mode 100644 (file)
index 0000000..5db23c3
--- /dev/null
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="benchmark"
+       ProjectGUID="{615AEC46-5595-4DEA-9490-DBD5DE0F8772}"
+       Keyword="Win32Proj"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="Debug"
+                       IntermediateDirectory="Debug"
+                       ConfigurationType="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="../include"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               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="Release"
+                       IntermediateDirectory="Release"
+                       ConfigurationType="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="../include"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               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="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\benchmark.c"
+                               >
+                       </File>
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/include.am b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/benchmark/include.am
new file mode 100644 (file)
index 0000000..8d4895b
--- /dev/null
@@ -0,0 +1,9 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+noinst_PROGRAMS += ctaocrypt/benchmark/benchmark
+ctaocrypt_benchmark_benchmark_SOURCES      = ctaocrypt/benchmark/benchmark.c
+ctaocrypt_benchmark_benchmark_LDADD        = src/libcyassl.la
+ctaocrypt_benchmark_benchmark_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += ctaocrypt/benchmark/benchmark.sln 
+EXTRA_DIST += ctaocrypt/benchmark/benchmark.vcproj
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes.c
new file mode 100644 (file)
index 0000000..9d21024
--- /dev/null
@@ -0,0 +1,2156 @@
+/* aes.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_AES
+
+#include <cyassl/ctaocrypt/aes.h>
+#include <cyassl/ctaocrypt/error.h>
+#include <cyassl/ctaocrypt/logging.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifdef _MSC_VER
+    /* 4127 warning constant while(1)  */
+    #pragma warning(disable: 4127)
+#endif
+
+
+static const word32 rcon[] = {
+    0x01000000, 0x02000000, 0x04000000, 0x08000000,
+    0x10000000, 0x20000000, 0x40000000, 0x80000000,
+    0x1B000000, 0x36000000, 
+    /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
+};
+
+
+static const word32 Te[5][256] = {
+{
+    0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
+    0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
+    0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
+    0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
+    0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
+    0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
+    0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
+    0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
+    0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
+    0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
+    0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
+    0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
+    0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
+    0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
+    0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
+    0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
+    0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
+    0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
+    0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
+    0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
+    0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
+    0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
+    0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
+    0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
+    0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
+    0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
+    0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
+    0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
+    0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
+    0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
+    0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
+    0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
+    0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
+    0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
+    0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
+    0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
+    0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
+    0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
+    0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
+    0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
+    0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
+    0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
+    0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
+    0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
+    0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
+    0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
+    0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
+    0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
+    0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
+    0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
+    0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
+    0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
+    0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
+    0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
+    0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
+    0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
+    0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
+    0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
+    0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
+    0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
+    0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
+    0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
+    0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
+    0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
+},
+{
+    0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
+    0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
+    0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
+    0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
+    0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
+    0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
+    0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
+    0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
+    0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
+    0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
+    0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
+    0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
+    0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
+    0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
+    0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
+    0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
+    0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
+    0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
+    0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
+    0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
+    0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
+    0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
+    0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
+    0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
+    0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
+    0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
+    0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
+    0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
+    0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
+    0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
+    0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
+    0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
+    0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
+    0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
+    0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
+    0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
+    0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
+    0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
+    0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
+    0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
+    0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
+    0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
+    0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
+    0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
+    0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
+    0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
+    0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
+    0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
+    0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
+    0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
+    0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
+    0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
+    0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
+    0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
+    0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
+    0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
+    0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
+    0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
+    0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
+    0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
+    0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
+    0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
+    0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
+    0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
+},
+{
+    0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
+    0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
+    0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
+    0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
+    0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
+    0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
+    0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
+    0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
+    0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
+    0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
+    0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
+    0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
+    0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
+    0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
+    0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
+    0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
+    0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
+    0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
+    0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
+    0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
+    0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
+    0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
+    0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
+    0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
+    0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
+    0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
+    0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
+    0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
+    0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
+    0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
+    0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
+    0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
+    0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
+    0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
+    0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
+    0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
+    0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
+    0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
+    0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
+    0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
+    0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
+    0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
+    0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
+    0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
+    0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
+    0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
+    0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
+    0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
+    0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
+    0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
+    0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
+    0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
+    0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
+    0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
+    0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
+    0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
+    0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
+    0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
+    0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
+    0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
+    0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
+    0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
+    0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
+    0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
+},
+{
+    0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
+    0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
+    0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
+    0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
+    0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
+    0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
+    0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
+    0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
+    0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
+    0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
+    0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
+    0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
+    0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
+    0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
+    0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
+    0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
+    0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
+    0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
+    0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
+    0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
+    0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
+    0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
+    0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
+    0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
+    0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
+    0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
+    0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
+    0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
+    0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
+    0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
+    0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
+    0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
+    0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
+    0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
+    0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
+    0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
+    0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
+    0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
+    0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
+    0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
+    0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
+    0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
+    0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
+    0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
+    0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
+    0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
+    0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
+    0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
+    0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
+    0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
+    0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
+    0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
+    0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
+    0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
+    0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
+    0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
+    0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
+    0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
+    0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
+    0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
+    0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
+    0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
+    0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
+    0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
+},
+{
+    0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
+    0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
+    0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
+    0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
+    0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
+    0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
+    0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
+    0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
+    0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
+    0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
+    0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
+    0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
+    0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
+    0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
+    0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
+    0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
+    0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
+    0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
+    0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
+    0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
+    0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
+    0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
+    0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
+    0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
+    0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
+    0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
+    0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
+    0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
+    0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
+    0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
+    0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
+    0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
+    0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
+    0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
+    0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
+    0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
+    0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
+    0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
+    0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
+    0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
+    0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
+    0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
+    0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
+    0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
+    0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
+    0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
+    0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
+    0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
+    0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
+    0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
+    0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
+    0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
+    0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
+    0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
+    0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
+    0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
+    0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
+    0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
+    0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
+    0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
+    0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
+    0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
+    0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
+    0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
+}
+};
+
+
+static const word32 Td[5][256] = {
+{
+    0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
+    0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
+    0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
+    0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
+    0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
+    0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
+    0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
+    0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
+    0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
+    0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
+    0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
+    0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
+    0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
+    0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
+    0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
+    0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
+    0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
+    0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
+    0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
+    0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
+    0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
+    0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
+    0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
+    0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
+    0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
+    0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
+    0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
+    0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
+    0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
+    0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
+    0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
+    0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
+    0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
+    0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
+    0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
+    0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
+    0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
+    0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
+    0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
+    0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
+    0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
+    0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
+    0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
+    0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
+    0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
+    0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
+    0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
+    0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
+    0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
+    0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
+    0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
+    0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
+    0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
+    0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
+    0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
+    0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
+    0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
+    0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
+    0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
+    0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
+    0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
+    0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
+    0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
+    0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
+},
+{
+    0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
+    0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
+    0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
+    0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
+    0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
+    0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
+    0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
+    0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
+    0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
+    0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
+    0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
+    0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
+    0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
+    0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
+    0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
+    0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
+    0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
+    0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
+    0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
+    0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
+    0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
+    0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
+    0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
+    0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
+    0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
+    0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
+    0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
+    0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
+    0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
+    0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
+    0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
+    0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
+    0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
+    0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
+    0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
+    0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
+    0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
+    0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
+    0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
+    0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
+    0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
+    0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
+    0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
+    0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
+    0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
+    0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
+    0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
+    0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
+    0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
+    0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
+    0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
+    0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
+    0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
+    0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
+    0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
+    0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
+    0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
+    0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
+    0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
+    0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
+    0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
+    0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
+    0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
+    0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
+},
+{
+    0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
+    0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
+    0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
+    0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
+    0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
+    0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
+    0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
+    0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
+    0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
+    0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
+    0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
+    0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
+    0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
+    0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
+    0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
+    0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
+    0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
+    0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
+    0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
+    0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
+
+    0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
+    0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
+    0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
+    0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
+    0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
+    0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
+    0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
+    0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
+    0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
+    0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
+    0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
+    0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
+    0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
+    0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
+    0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
+    0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
+    0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
+    0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
+    0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
+    0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
+    0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
+    0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
+    0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
+    0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
+    0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
+    0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
+    0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
+    0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
+    0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
+    0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
+    0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
+    0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
+    0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
+    0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
+    0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
+    0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
+    0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
+    0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
+    0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
+    0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
+    0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
+    0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
+    0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
+    0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
+},
+{
+    0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
+    0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
+    0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
+    0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
+    0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
+    0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
+    0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
+    0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
+    0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
+    0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
+    0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
+    0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
+    0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
+    0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
+    0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
+    0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
+    0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
+    0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
+    0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
+    0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
+    0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
+    0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
+    0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
+    0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
+    0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
+    0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
+    0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
+    0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
+    0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
+    0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
+    0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
+    0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
+    0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
+    0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
+    0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
+    0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
+    0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
+    0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
+    0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
+    0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
+    0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
+    0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
+    0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
+    0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
+    0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
+    0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
+    0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
+    0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
+    0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
+    0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
+    0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
+    0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
+    0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
+    0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
+    0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
+    0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
+    0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
+    0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
+    0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
+    0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
+    0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
+    0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
+    0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
+    0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
+},
+{
+    0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
+    0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
+    0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
+    0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
+    0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
+    0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
+    0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
+    0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
+    0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
+    0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
+    0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
+    0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
+    0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
+    0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
+    0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
+    0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
+    0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
+    0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
+    0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
+    0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
+    0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
+    0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
+    0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
+    0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
+    0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
+    0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
+    0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
+    0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
+    0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
+    0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
+    0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
+    0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
+    0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
+    0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
+    0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
+    0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
+    0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
+    0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
+    0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
+    0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
+    0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
+    0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
+    0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
+    0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
+    0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
+    0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
+    0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
+    0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
+    0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
+    0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
+    0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
+    0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
+    0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
+    0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
+    0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
+    0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
+    0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
+    0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
+    0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
+    0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
+    0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
+    0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
+    0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
+    0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
+}
+};
+
+
+
+#define GETBYTE(x, y) (word32)((byte)((x) >> (8 * (y))))
+
+
+#ifdef CYASSL_AESNI
+
+#ifndef _MSC_VER
+
+    #define cpuid(func,ax,bx,cx,dx)\
+        __asm__ __volatile__ ("cpuid":\
+                       "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
+
+#else
+
+    #define cpuid(func,ax,bx,cx,dx)\
+        __asm mov eax, func \
+        __asm cpuid \
+        __asm mov ax, eax \
+        __asm mov bx, ebx \
+        __asm mov cx, ecx \
+        __asm mov dx, edx
+
+#endif /* _MSC_VER */
+
+            
+static int Check_CPU_support_AES()
+{
+    unsigned int a,b,c,d;
+    cpuid(1,a,b,c,d);
+
+    if (c & 0x2000000)
+        return 1;
+
+    return 0;
+}
+
+static int checkAESNI = 0;
+static int haveAESNI  = 0;
+
+
+void AES_CBC_encrypt(const unsigned char* in, unsigned char* out,
+                     unsigned char* ivec, unsigned long length,
+                     const unsigned char* KS, int nr);
+
+
+void AES_CBC_decrypt(const unsigned char* in, unsigned char* out,
+                     unsigned char* ivec, unsigned long length,
+                     const unsigned char* KS, int nr);
+
+void AES_128_Key_Expansion(const unsigned char* userkey, 
+                           unsigned char* key_schedule);
+
+void AES_192_Key_Expansion(const unsigned char* userkey, 
+                           unsigned char* key_schedule);
+
+void AES_256_Key_Expansion(const unsigned char* userkey, 
+                           unsigned char* key_schedule);
+
+
+int AES_set_encrypt_key (const unsigned char *userKey, const int bits,
+                         Aes* aes)
+{ 
+    if (!userKey || !aes)
+        return BAD_FUNC_ARG;
+    
+    if (bits == 128) {
+       AES_128_Key_Expansion (userKey,(byte*)aes->key); aes->rounds = 10;
+       return 0;
+    }
+    else if (bits == 192) {
+       AES_192_Key_Expansion (userKey,(byte*)aes->key); aes->rounds = 12;
+       return 0;
+    }
+    else if (bits == 256) {
+       AES_256_Key_Expansion (userKey,(byte*)aes->key); aes->rounds = 14;
+       return 0;
+    }
+    return BAD_FUNC_ARG;
+}
+
+
+int AES_set_decrypt_key (const unsigned char* userKey, const int bits,
+                         Aes* aes)
+{
+    int nr;
+    Aes temp_key;
+    __m128i *Key_Schedule = (__m128i*)aes->key;
+    __m128i *Temp_Key_Schedule = (__m128i*)temp_key.key;
+    
+    if (!userKey || !aes)
+        return BAD_FUNC_ARG;
+
+    if (AES_set_encrypt_key(userKey,bits,&temp_key) == BAD_FUNC_ARG)
+        return BAD_FUNC_ARG;
+
+    nr = temp_key.rounds;
+    aes->rounds = nr;
+
+    Key_Schedule[nr] = Temp_Key_Schedule[0];
+    Key_Schedule[nr-1] = _mm_aesimc_si128(Temp_Key_Schedule[1]);
+    Key_Schedule[nr-2] = _mm_aesimc_si128(Temp_Key_Schedule[2]);
+    Key_Schedule[nr-3] = _mm_aesimc_si128(Temp_Key_Schedule[3]);
+    Key_Schedule[nr-4] = _mm_aesimc_si128(Temp_Key_Schedule[4]);
+    Key_Schedule[nr-5] = _mm_aesimc_si128(Temp_Key_Schedule[5]);
+    Key_Schedule[nr-6] = _mm_aesimc_si128(Temp_Key_Schedule[6]);
+    Key_Schedule[nr-7] = _mm_aesimc_si128(Temp_Key_Schedule[7]);
+    Key_Schedule[nr-8] = _mm_aesimc_si128(Temp_Key_Schedule[8]);
+    Key_Schedule[nr-9] = _mm_aesimc_si128(Temp_Key_Schedule[9]);
+    
+    if(nr>10) {
+        Key_Schedule[nr-10] = _mm_aesimc_si128(Temp_Key_Schedule[10]);
+        Key_Schedule[nr-11] = _mm_aesimc_si128(Temp_Key_Schedule[11]);
+    }
+
+    if(nr>12) {
+        Key_Schedule[nr-12] = _mm_aesimc_si128(Temp_Key_Schedule[12]);
+        Key_Schedule[nr-13] = _mm_aesimc_si128(Temp_Key_Schedule[13]);
+    }
+
+    Key_Schedule[0] = Temp_Key_Schedule[nr];
+    
+    return 0;
+}
+
+
+
+#endif /* CYASSL_AESNI */
+
+
+int AesSetIV(Aes* aes, const byte* iv)
+{
+    if (aes == NULL)
+        return BAD_FUNC_ARG;
+
+    if (iv)
+        XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
+
+    return 0;
+}
+
+
+int AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
+              int dir)
+{
+    word32 temp, *rk = aes->key;
+    unsigned int i = 0;
+
+    if (!((keylen == 16) || (keylen == 24) || (keylen == 32)))
+        return BAD_FUNC_ARG;
+
+#ifdef CYASSL_AESNI
+    if (checkAESNI == 0) {
+        haveAESNI  = Check_CPU_support_AES();
+        checkAESNI = 1;
+    }
+    if (haveAESNI) {
+        if (iv)
+            XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
+        if (dir == AES_ENCRYPTION)
+            return AES_set_encrypt_key(userKey, keylen * 8, aes);
+        else
+            return AES_set_decrypt_key(userKey, keylen * 8, aes);
+    }
+#endif /* CYASSL_AESNI */
+
+    aes->rounds = keylen/4 + 6;
+
+    XMEMCPY(rk, userKey, keylen);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords(rk, rk, keylen);
+    #endif
+
+    switch(keylen)
+    {
+    case 16:
+        while (1)
+        {
+            temp  = rk[3];
+            rk[4] = rk[0] ^
+                (Te[4][GETBYTE(temp, 2)] & 0xff000000) ^
+                (Te[4][GETBYTE(temp, 1)] & 0x00ff0000) ^
+                (Te[4][GETBYTE(temp, 0)] & 0x0000ff00) ^
+                (Te[4][GETBYTE(temp, 3)] & 0x000000ff) ^
+                rcon[i];
+            rk[5] = rk[1] ^ rk[4];
+            rk[6] = rk[2] ^ rk[5];
+            rk[7] = rk[3] ^ rk[6];
+            if (++i == 10)
+                break;
+            rk += 4;
+        }
+        break;
+
+    case 24:
+        while (1)  /* for (;;) here triggers a bug in VC60 SP4 w/ Pro Pack */
+        {
+            temp = rk[ 5];
+            rk[ 6] = rk[ 0] ^
+                (Te[4][GETBYTE(temp, 2)] & 0xff000000) ^
+                (Te[4][GETBYTE(temp, 1)] & 0x00ff0000) ^
+                (Te[4][GETBYTE(temp, 0)] & 0x0000ff00) ^
+                (Te[4][GETBYTE(temp, 3)] & 0x000000ff) ^
+                rcon[i];
+            rk[ 7] = rk[ 1] ^ rk[ 6];
+            rk[ 8] = rk[ 2] ^ rk[ 7];
+            rk[ 9] = rk[ 3] ^ rk[ 8];
+            if (++i == 8)
+                break;
+            rk[10] = rk[ 4] ^ rk[ 9];
+            rk[11] = rk[ 5] ^ rk[10];
+            rk += 6;
+        }
+        break;
+
+    case 32:
+        while (1)
+        {
+            temp = rk[ 7];
+            rk[ 8] = rk[ 0] ^
+                (Te[4][GETBYTE(temp, 2)] & 0xff000000) ^
+                (Te[4][GETBYTE(temp, 1)] & 0x00ff0000) ^
+                (Te[4][GETBYTE(temp, 0)] & 0x0000ff00) ^
+                (Te[4][GETBYTE(temp, 3)] & 0x000000ff) ^
+                rcon[i];
+            rk[ 9] = rk[ 1] ^ rk[ 8];
+            rk[10] = rk[ 2] ^ rk[ 9];
+            rk[11] = rk[ 3] ^ rk[10];
+            if (++i == 7)
+                break;
+            temp = rk[11];
+            rk[12] = rk[ 4] ^
+                (Te[4][GETBYTE(temp, 3)] & 0xff000000) ^
+                (Te[4][GETBYTE(temp, 2)] & 0x00ff0000) ^
+                (Te[4][GETBYTE(temp, 1)] & 0x0000ff00) ^
+                (Te[4][GETBYTE(temp, 0)] & 0x000000ff);
+            rk[13] = rk[ 5] ^ rk[12];
+            rk[14] = rk[ 6] ^ rk[13];
+            rk[15] = rk[ 7] ^ rk[14];
+
+            rk += 8;
+        }
+        break;
+
+    default:
+        return BAD_FUNC_ARG;
+    }
+
+    if (dir == AES_DECRYPTION)
+    {
+        unsigned int j;
+        rk = aes->key;
+
+        /* invert the order of the round keys: */
+        for (i = 0, j = 4* aes->rounds; i < j; i += 4, j -= 4) {
+            temp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;
+            temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
+            temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
+            temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
+        }
+        /* apply the inverse MixColumn transform to all round keys but the
+           first and the last: */
+        for (i = 1; i < aes->rounds; i++) {
+            rk += 4;
+            rk[0] =
+                Td[0][Te[4][GETBYTE(rk[0], 3)] & 0xff] ^
+                Td[1][Te[4][GETBYTE(rk[0], 2)] & 0xff] ^
+                Td[2][Te[4][GETBYTE(rk[0], 1)] & 0xff] ^
+                Td[3][Te[4][GETBYTE(rk[0], 0)] & 0xff];
+            rk[1] =
+                Td[0][Te[4][GETBYTE(rk[1], 3)] & 0xff] ^
+                Td[1][Te[4][GETBYTE(rk[1], 2)] & 0xff] ^
+                Td[2][Te[4][GETBYTE(rk[1], 1)] & 0xff] ^
+                Td[3][Te[4][GETBYTE(rk[1], 0)] & 0xff];
+            rk[2] =
+                Td[0][Te[4][GETBYTE(rk[2], 3)] & 0xff] ^
+                Td[1][Te[4][GETBYTE(rk[2], 2)] & 0xff] ^
+                Td[2][Te[4][GETBYTE(rk[2], 1)] & 0xff] ^
+                Td[3][Te[4][GETBYTE(rk[2], 0)] & 0xff];
+            rk[3] =
+                Td[0][Te[4][GETBYTE(rk[3], 3)] & 0xff] ^
+                Td[1][Te[4][GETBYTE(rk[3], 2)] & 0xff] ^
+                Td[2][Te[4][GETBYTE(rk[3], 1)] & 0xff] ^
+                Td[3][Te[4][GETBYTE(rk[3], 0)] & 0xff];
+        }
+    }
+
+    return AesSetIV(aes, iv);
+}
+
+
+static void AesEncrypt(Aes* aes, const byte* inBlock, byte* outBlock)
+{
+    word32 s0, s1, s2, s3;
+    word32 t0, t1, t2, t3;
+    word32 r = aes->rounds >> 1;
+
+    const word32* rk = aes->key;
+    if (r > 7 || r == 0) {
+        CYASSL_MSG("AesEncrypt encountered improper key, set it up");
+        return;  /* stop instead of segfaulting, set up your keys! */
+    }
+    /*
+     * map byte array block to cipher state
+     * and add initial round key:
+     */
+    XMEMCPY(&s0, inBlock,                  sizeof(s0));
+    XMEMCPY(&s1, inBlock + sizeof(s0),     sizeof(s1));
+    XMEMCPY(&s2, inBlock + 2 * sizeof(s0), sizeof(s2));
+    XMEMCPY(&s3, inBlock + 3 * sizeof(s0), sizeof(s3));
+
+    #ifdef LITTLE_ENDIAN_ORDER
+        s0 = ByteReverseWord32(s0);
+        s1 = ByteReverseWord32(s1);
+        s2 = ByteReverseWord32(s2);
+        s3 = ByteReverseWord32(s3);
+    #endif
+
+    s0 ^= rk[0];
+    s1 ^= rk[1];
+    s2 ^= rk[2];
+    s3 ^= rk[3];
+   
+    /*
+     * Nr - 1 full rounds:
+     */
+
+    for (;;) {
+        t0 =
+            Te[0][GETBYTE(s0, 3)]  ^
+            Te[1][GETBYTE(s1, 2)]  ^
+            Te[2][GETBYTE(s2, 1)]  ^
+            Te[3][GETBYTE(s3, 0)]  ^
+            rk[4];
+        t1 =
+            Te[0][GETBYTE(s1, 3)]  ^
+            Te[1][GETBYTE(s2, 2)]  ^
+            Te[2][GETBYTE(s3, 1)]  ^
+            Te[3][GETBYTE(s0, 0)]  ^
+            rk[5];
+        t2 =
+            Te[0][GETBYTE(s2, 3)] ^
+            Te[1][GETBYTE(s3, 2)]  ^
+            Te[2][GETBYTE(s0, 1)]  ^
+            Te[3][GETBYTE(s1, 0)]  ^
+            rk[6];
+        t3 =
+            Te[0][GETBYTE(s3, 3)] ^
+            Te[1][GETBYTE(s0, 2)]  ^
+            Te[2][GETBYTE(s1, 1)]  ^
+            Te[3][GETBYTE(s2, 0)]  ^
+            rk[7];
+
+        rk += 8;
+        if (--r == 0) {
+            break;
+        }
+        
+        s0 =
+            Te[0][GETBYTE(t0, 3)] ^
+            Te[1][GETBYTE(t1, 2)] ^
+            Te[2][GETBYTE(t2, 1)] ^
+            Te[3][GETBYTE(t3, 0)] ^
+            rk[0];
+        s1 =
+            Te[0][GETBYTE(t1, 3)] ^
+            Te[1][GETBYTE(t2, 2)] ^
+            Te[2][GETBYTE(t3, 1)] ^
+            Te[3][GETBYTE(t0, 0)] ^
+            rk[1];
+        s2 =
+            Te[0][GETBYTE(t2, 3)] ^
+            Te[1][GETBYTE(t3, 2)] ^
+            Te[2][GETBYTE(t0, 1)] ^
+            Te[3][GETBYTE(t1, 0)] ^
+            rk[2];
+        s3 =
+            Te[0][GETBYTE(t3, 3)] ^
+            Te[1][GETBYTE(t0, 2)] ^
+            Te[2][GETBYTE(t1, 1)] ^
+            Te[3][GETBYTE(t2, 0)] ^
+            rk[3];
+    }
+
+    /*
+     * apply last round and
+     * map cipher state to byte array block:
+     */
+
+    s0 =
+        (Te[4][GETBYTE(t0, 3)] & 0xff000000) ^
+        (Te[4][GETBYTE(t1, 2)] & 0x00ff0000) ^
+        (Te[4][GETBYTE(t2, 1)] & 0x0000ff00) ^
+        (Te[4][GETBYTE(t3, 0)] & 0x000000ff) ^
+        rk[0];
+    s1 =
+        (Te[4][GETBYTE(t1, 3)] & 0xff000000) ^
+        (Te[4][GETBYTE(t2, 2)] & 0x00ff0000) ^
+        (Te[4][GETBYTE(t3, 1)] & 0x0000ff00) ^
+        (Te[4][GETBYTE(t0, 0)] & 0x000000ff) ^
+        rk[1];
+    s2 =
+        (Te[4][GETBYTE(t2, 3)] & 0xff000000) ^
+        (Te[4][GETBYTE(t3, 2)] & 0x00ff0000) ^
+        (Te[4][GETBYTE(t0, 1)] & 0x0000ff00) ^
+        (Te[4][GETBYTE(t1, 0)] & 0x000000ff) ^
+        rk[2];
+    s3 =
+        (Te[4][GETBYTE(t3, 3)] & 0xff000000) ^
+        (Te[4][GETBYTE(t0, 2)] & 0x00ff0000) ^
+        (Te[4][GETBYTE(t1, 1)] & 0x0000ff00) ^
+        (Te[4][GETBYTE(t2, 0)] & 0x000000ff) ^
+        rk[3];
+
+    /* write out */
+    #ifdef LITTLE_ENDIAN_ORDER
+        s0 = ByteReverseWord32(s0);
+        s1 = ByteReverseWord32(s1);
+        s2 = ByteReverseWord32(s2);
+        s3 = ByteReverseWord32(s3);
+    #endif
+
+    XMEMCPY(outBlock,                  &s0, sizeof(s0));
+    XMEMCPY(outBlock + sizeof(s0),     &s1, sizeof(s1));
+    XMEMCPY(outBlock + 2 * sizeof(s0), &s2, sizeof(s2));
+    XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3));
+}
+
+
+static void AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock)
+{
+    word32 s0, s1, s2, s3;
+    word32 t0, t1, t2, t3;
+    word32 r = aes->rounds >> 1;
+
+    const word32* rk = aes->key;
+    if (r > 7 || r == 0) {
+        CYASSL_MSG("AesDecrypt encountered improper key, set it up");
+        return;  /* stop instead of segfaulting, set up your keys! */
+    }
+    /*
+     * map byte array block to cipher state
+     * and add initial round key:
+     */
+    XMEMCPY(&s0, inBlock,                  sizeof(s0));
+    XMEMCPY(&s1, inBlock + sizeof(s0),     sizeof(s1));
+    XMEMCPY(&s2, inBlock + 2 * sizeof(s0), sizeof(s2));
+    XMEMCPY(&s3, inBlock + 3 * sizeof(s0), sizeof(s3));
+
+    #ifdef LITTLE_ENDIAN_ORDER
+        s0 = ByteReverseWord32(s0);
+        s1 = ByteReverseWord32(s1);
+        s2 = ByteReverseWord32(s2);
+        s3 = ByteReverseWord32(s3);
+    #endif
+
+    s0 ^= rk[0];
+    s1 ^= rk[1];
+    s2 ^= rk[2];
+    s3 ^= rk[3];
+   
+    /*
+     * Nr - 1 full rounds:
+     */
+
+    for (;;) {
+        t0 =
+            Td[0][GETBYTE(s0, 3)] ^
+            Td[1][GETBYTE(s3, 2)] ^
+            Td[2][GETBYTE(s2, 1)] ^
+            Td[3][GETBYTE(s1, 0)] ^
+            rk[4];
+        t1 =
+            Td[0][GETBYTE(s1, 3)] ^
+            Td[1][GETBYTE(s0, 2)] ^
+            Td[2][GETBYTE(s3, 1)] ^
+            Td[3][GETBYTE(s2, 0)] ^
+            rk[5];
+        t2 =
+            Td[0][GETBYTE(s2, 3)] ^
+            Td[1][GETBYTE(s1, 2)] ^
+            Td[2][GETBYTE(s0, 1)] ^
+            Td[3][GETBYTE(s3, 0)] ^
+            rk[6];
+        t3 =
+            Td[0][GETBYTE(s3, 3)] ^
+            Td[1][GETBYTE(s2, 2)] ^
+            Td[2][GETBYTE(s1, 1)] ^
+            Td[3][GETBYTE(s0, 0)] ^
+            rk[7];
+
+        rk += 8;
+        if (--r == 0) {
+            break;
+        }
+
+        s0 =
+            Td[0][GETBYTE(t0, 3)] ^
+            Td[1][GETBYTE(t3, 2)] ^
+            Td[2][GETBYTE(t2, 1)] ^
+            Td[3][GETBYTE(t1, 0)] ^
+            rk[0];
+        s1 =
+            Td[0][GETBYTE(t1, 3)] ^
+            Td[1][GETBYTE(t0, 2)] ^
+            Td[2][GETBYTE(t3, 1)] ^
+            Td[3][GETBYTE(t2, 0)] ^
+            rk[1];
+        s2 =
+            Td[0][GETBYTE(t2, 3)] ^
+            Td[1][GETBYTE(t1, 2)] ^
+            Td[2][GETBYTE(t0, 1)] ^
+            Td[3][GETBYTE(t3, 0)] ^
+            rk[2];
+        s3 =
+            Td[0][GETBYTE(t3, 3)] ^
+            Td[1][GETBYTE(t2, 2)] ^
+            Td[2][GETBYTE(t1, 1)] ^
+            Td[3][GETBYTE(t0, 0)] ^
+            rk[3];
+    }
+    /*
+     * apply last round and
+     * map cipher state to byte array block:
+     */
+    s0 =
+        (Td[4][GETBYTE(t0, 3)] & 0xff000000) ^
+        (Td[4][GETBYTE(t3, 2)] & 0x00ff0000) ^
+        (Td[4][GETBYTE(t2, 1)] & 0x0000ff00) ^
+        (Td[4][GETBYTE(t1, 0)] & 0x000000ff) ^
+        rk[0];
+    s1 =
+        (Td[4][GETBYTE(t1, 3)] & 0xff000000) ^
+        (Td[4][GETBYTE(t0, 2)] & 0x00ff0000) ^
+        (Td[4][GETBYTE(t3, 1)] & 0x0000ff00) ^
+        (Td[4][GETBYTE(t2, 0)] & 0x000000ff) ^
+        rk[1];
+    s2 =
+        (Td[4][GETBYTE(t2, 3)] & 0xff000000) ^
+        (Td[4][GETBYTE(t1, 2)] & 0x00ff0000) ^
+        (Td[4][GETBYTE(t0, 1)] & 0x0000ff00) ^
+        (Td[4][GETBYTE(t3, 0)] & 0x000000ff) ^
+        rk[2];
+    s3 =
+        (Td[4][GETBYTE(t3, 3)] & 0xff000000) ^
+        (Td[4][GETBYTE(t2, 2)] & 0x00ff0000) ^
+        (Td[4][GETBYTE(t1, 1)] & 0x0000ff00) ^
+        (Td[4][GETBYTE(t0, 0)] & 0x000000ff) ^
+        rk[3];
+
+    /* write out */
+    #ifdef LITTLE_ENDIAN_ORDER
+        s0 = ByteReverseWord32(s0);
+        s1 = ByteReverseWord32(s1);
+        s2 = ByteReverseWord32(s2);
+        s3 = ByteReverseWord32(s3);
+    #endif
+
+    XMEMCPY(outBlock,                  &s0, sizeof(s0));
+    XMEMCPY(outBlock + sizeof(s0),     &s1, sizeof(s1));
+    XMEMCPY(outBlock + 2 * sizeof(s0), &s2, sizeof(s2));
+    XMEMCPY(outBlock + 3 * sizeof(s0), &s3, sizeof(s3));
+}
+
+
+void AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / AES_BLOCK_SIZE;
+
+#ifdef CYASSL_AESNI
+    if (haveAESNI) {
+        #ifdef DEBUG_AESNI
+            printf("about to aes cbc encrypt\n");
+            printf("in  = %p\n", in);
+            printf("out = %p\n", out);
+            printf("aes->key = %p\n", aes->key);
+            printf("aes->reg = %p\n", aes->reg);
+            printf("aes->rounds = %d\n", aes->rounds);
+            printf("sz = %d\n", sz);
+        #endif
+        AES_CBC_encrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key,
+                        aes->rounds);
+        /* store iv for next call */
+        XMEMCPY(aes->reg, out + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
+        return;
+    }
+#endif
+
+    while (blocks--) {
+        xorbuf((byte*)aes->reg, in, AES_BLOCK_SIZE);
+        AesEncrypt(aes, (byte*)aes->reg, (byte*)aes->reg);
+        XMEMCPY(out, aes->reg, AES_BLOCK_SIZE);
+
+        out += AES_BLOCK_SIZE;
+        in  += AES_BLOCK_SIZE; 
+    }
+}
+
+
+void AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / AES_BLOCK_SIZE;
+
+#ifdef CYASSL_AESNI
+    if (haveAESNI) {
+        #ifdef DEBUG_AESNI
+            printf("about to aes cbc decrypt\n");
+            printf("in  = %p\n", in);
+            printf("out = %p\n", out);
+            printf("aes->key = %p\n", aes->key);
+            printf("aes->reg = %p\n", aes->reg);
+            printf("aes->rounds = %d\n", aes->rounds);
+            printf("sz = %d\n", sz);
+        #endif
+
+        /* if input and output same will overwrite input iv */
+        XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
+        AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key,
+                        aes->rounds);
+        /* store iv for next call */
+        XMEMCPY(aes->reg, aes->tmp, AES_BLOCK_SIZE);
+        return;
+    }
+#endif
+
+    while (blocks--) {
+        XMEMCPY(aes->tmp, in, AES_BLOCK_SIZE);
+        AesDecrypt(aes, (byte*)aes->tmp, out);
+        xorbuf(out, (byte*)aes->reg, AES_BLOCK_SIZE);
+        XMEMCPY(aes->reg, aes->tmp, AES_BLOCK_SIZE);
+
+        out += AES_BLOCK_SIZE;
+        in  += AES_BLOCK_SIZE; 
+    }
+}
+
+
+#ifdef CYASSL_AES_DIRECT
+
+/* Allow direct access to one block encrypt */
+void AesEncryptDirect(Aes* aes, byte* out, const byte* in)
+{
+    return AesEncrypt(aes, in, out);
+}
+
+
+/* Allow direct access to one block decrypt */
+void AesDecryptDirect(Aes* aes, byte* out, const byte* in)
+{
+    return AesDecrypt(aes, in, out);
+}
+
+
+#endif /* CYASSL_AES_DIRECT */
+
+
+#ifdef CYASSL_AES_COUNTER
+
+/* Increment AES counter */
+static INLINE void IncrementAesCounter(byte* inOutCtr)
+{
+    int i;
+
+    /* in network byte order so start at end and work back */
+    for (i = AES_BLOCK_SIZE - 1; i >= 0; i--) {
+        if (++inOutCtr[i])  /* we're done unless we overflow */
+            return;
+    }
+}
+  
+
+void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / AES_BLOCK_SIZE;
+
+    while (blocks--) {
+        AesEncrypt(aes, (byte*)aes->reg, out);
+        IncrementAesCounter((byte*)aes->reg);
+        xorbuf(out, in, AES_BLOCK_SIZE);
+
+        out += AES_BLOCK_SIZE;
+        in  += AES_BLOCK_SIZE; 
+    }
+}
+
+#endif /* CYASSL_AES_COUNTER */
+
+
+#ifdef HAVE_AESGCM
+
+/*
+ * The IV for AES GCM, stored in struct Aes's member reg, is comprised of
+ * three parts in order:
+ *   1. The implicit IV. This is generated from the PRF using the shared
+ *      secrets between endpoints. It is 4 bytes long.
+ *   2. The explicit IV. This is set by the user of the AES. It needs to be
+ *      unique for each call to encrypt. The explicit IV is shared with the
+ *      other end of the transaction in the clear.
+ *   3. The counter. Each block of data is encrypted with its own sequence
+ *      number counter.
+ */
+
+enum {
+    IMPLICIT_IV_SZ = 4,
+    EXPLICIT_IV_SZ = 8,
+    CTR_SZ = 4
+};
+
+
+static INLINE void InitGcmCounter(byte* inOutCtr)
+{
+    inOutCtr[AES_BLOCK_SIZE - 4] = 0;
+    inOutCtr[AES_BLOCK_SIZE - 3] = 0;
+    inOutCtr[AES_BLOCK_SIZE - 2] = 0;
+    inOutCtr[AES_BLOCK_SIZE - 1] = 1;
+}
+
+
+static INLINE void IncrementGcmCounter(byte* inOutCtr)
+{
+    int i;
+
+    /* in network byte order so start at end and work back */
+    for (i = AES_BLOCK_SIZE - 1; i >= AES_BLOCK_SIZE - CTR_SZ; i--) {
+        if (++inOutCtr[i])  /* we're done unless we overflow */
+            return;
+    }
+}
+
+
+/*
+ * The explicit IV is set by the caller. A common practice is to treat it as
+ * a sequence number seeded with a random number. The caller manages
+ * incrementing the explicit IV when appropriate.
+ */
+
+void AesGcmSetExpIV(Aes* aes, const byte* iv)
+{
+    XMEMCPY((byte*)aes->reg + IMPLICIT_IV_SZ, iv, EXPLICIT_IV_SZ);
+}
+
+
+void AesGcmGetExpIV(Aes* aes, byte* iv)
+{
+    XMEMCPY(iv, (byte*)aes->reg + IMPLICIT_IV_SZ, EXPLICIT_IV_SZ);
+}
+
+
+void AesGcmIncExpIV(Aes* aes)
+{
+    int i;
+    byte* iv = (byte*)aes->reg + IMPLICIT_IV_SZ;
+
+    for (i = EXPLICIT_IV_SZ - 1; i >= 0; i--) {
+        if (++iv[i])
+            return;
+    }
+}
+
+
+#if defined(GCM_SMALL) || defined(GCM_TABLE)
+
+static INLINE void FlattenSzInBits(byte* buf, word32 sz)
+{
+    /* Multiply the sz by 8 */
+    word32 szHi = (sz >> (8*sizeof(sz) - 3));
+    sz <<= 3;
+
+    /* copy over the words of the sz into the destination buffer */
+    buf[0] = (szHi >> 24) & 0xff;
+    buf[1] = (szHi >> 16) & 0xff;
+    buf[2] = (szHi >>  8) & 0xff;
+    buf[3] = szHi & 0xff;
+    buf[4] = (sz >> 24) & 0xff;
+    buf[5] = (sz >> 16) & 0xff;
+    buf[6] = (sz >>  8) & 0xff;
+    buf[7] = sz & 0xff;
+}
+
+
+static INLINE void RIGHTSHIFTX(byte* x)
+{
+    int i;
+    int carryOut = 0;
+    int carryIn = 0;
+    int borrow = x[15] & 0x01;
+
+    for (i = 0; i < AES_BLOCK_SIZE; i++) {
+        carryOut = x[i] & 0x01;
+        x[i] = (x[i] >> 1) | (carryIn ? 0x80 : 0);
+        carryIn = carryOut;
+    }
+    if (borrow) x[0] ^= 0xE1;
+}
+
+#endif /* defined(GCM_SMALL) || defined(GCM_TABLE) */
+
+
+#ifdef GCM_TABLE
+
+static void GenerateM0(Aes* aes)
+{
+    int i, j;
+    byte (*m)[AES_BLOCK_SIZE] = aes->M0;
+
+    XMEMCPY(m[128], aes->H, AES_BLOCK_SIZE);
+
+    for (i = 64; i > 0; i /= 2) {
+        XMEMCPY(m[i], m[i*2], AES_BLOCK_SIZE);
+        RIGHTSHIFTX(m[i]);
+    }
+
+    for (i = 2; i < 256; i *= 2) {
+        for (j = 1; j < i; j++) {
+            XMEMCPY(m[i+j], m[i], AES_BLOCK_SIZE);
+            xorbuf(m[i+j], m[j], AES_BLOCK_SIZE);
+        }
+    }
+
+    XMEMSET(m[0], 0, AES_BLOCK_SIZE);
+}
+
+#endif /* GCM_TABLE */
+
+
+void AesGcmSetKey(Aes* aes, const byte* key, word32 len,
+                                                    const byte* implicitIV)
+{
+    byte fullIV[AES_BLOCK_SIZE];
+
+    XMEMSET(fullIV, 0, AES_BLOCK_SIZE);
+    XMEMCPY(fullIV, implicitIV, IMPLICIT_IV_SZ);
+    AesSetKey(aes, key, len, fullIV, AES_ENCRYPTION);
+
+    XMEMSET(fullIV, 0, AES_BLOCK_SIZE);
+    AesEncrypt(aes, fullIV, aes->H);
+#ifdef GCM_TABLE
+    GenerateM0(aes);
+#endif /* GCM_TABLE */
+}
+
+
+#if defined(GCM_SMALL)
+
+static void GMULT(byte* X, byte* Y)
+{
+    byte Z[AES_BLOCK_SIZE];
+    byte V[AES_BLOCK_SIZE];
+    int i, j;
+
+    XMEMSET(Z, 0, AES_BLOCK_SIZE);
+    XMEMCPY(V, X, AES_BLOCK_SIZE);
+    for (i = 0; i < AES_BLOCK_SIZE; i++)
+    {
+        byte y = Y[i];
+        for (j = 0; j < 8; j++)
+        {
+            if (y & 0x80) {
+                xorbuf(Z, V, AES_BLOCK_SIZE);
+            }
+
+            RIGHTSHIFTX(V);
+            y = y << 1;
+        }
+    }
+    XMEMCPY(X, Z, AES_BLOCK_SIZE);
+}
+
+
+static void GHASH(Aes* aes, const byte* a, word32 aSz,
+                                const byte* c, word32 cSz, byte* s, word32 sSz)
+{
+    byte x[AES_BLOCK_SIZE];
+    byte scratch[AES_BLOCK_SIZE];
+    word32 blocks, partial;
+    byte* h = aes->H;
+
+    XMEMSET(x, 0, AES_BLOCK_SIZE);
+
+    /* Hash in A, the Additional Authentication Data */
+    if (aSz != 0 && a != NULL) {
+        blocks = aSz / AES_BLOCK_SIZE;
+        partial = aSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            xorbuf(x, a, AES_BLOCK_SIZE);
+            GMULT(x, h);
+            a += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(scratch, 0, AES_BLOCK_SIZE);
+            XMEMCPY(scratch, a, partial);
+            xorbuf(x, scratch, AES_BLOCK_SIZE);
+            GMULT(x, h);
+        }
+    }
+
+    /* Hash in C, the Ciphertext */
+    if (cSz != 0 && c != NULL) {
+        blocks = cSz / AES_BLOCK_SIZE;
+        partial = cSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            xorbuf(x, c, AES_BLOCK_SIZE);
+            GMULT(x, h);
+            c += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(scratch, 0, AES_BLOCK_SIZE);
+            XMEMCPY(scratch, c, partial);
+            xorbuf(x, scratch, AES_BLOCK_SIZE);
+            GMULT(x, h);
+        }
+    }
+
+    /* Hash in the lengths of A and C in bits */
+    FlattenSzInBits(&scratch[0], aSz);
+    FlattenSzInBits(&scratch[8], cSz);
+    xorbuf(x, scratch, AES_BLOCK_SIZE);
+    GMULT(x, h);
+
+    /* Copy the result into s. */
+    XMEMCPY(s, x, sSz);
+}
+
+/* end GCM_SMALL */
+#elif defined(GCM_TABLE)
+
+static const byte R[256][2] = {
+    {0x00, 0x00}, {0x01, 0xc2}, {0x03, 0x84}, {0x02, 0x46},
+    {0x07, 0x08}, {0x06, 0xca}, {0x04, 0x8c}, {0x05, 0x4e},
+    {0x0e, 0x10}, {0x0f, 0xd2}, {0x0d, 0x94}, {0x0c, 0x56},
+    {0x09, 0x18}, {0x08, 0xda}, {0x0a, 0x9c}, {0x0b, 0x5e},
+    {0x1c, 0x20}, {0x1d, 0xe2}, {0x1f, 0xa4}, {0x1e, 0x66},
+    {0x1b, 0x28}, {0x1a, 0xea}, {0x18, 0xac}, {0x19, 0x6e},
+    {0x12, 0x30}, {0x13, 0xf2}, {0x11, 0xb4}, {0x10, 0x76},
+    {0x15, 0x38}, {0x14, 0xfa}, {0x16, 0xbc}, {0x17, 0x7e},
+    {0x38, 0x40}, {0x39, 0x82}, {0x3b, 0xc4}, {0x3a, 0x06},
+    {0x3f, 0x48}, {0x3e, 0x8a}, {0x3c, 0xcc}, {0x3d, 0x0e},
+    {0x36, 0x50}, {0x37, 0x92}, {0x35, 0xd4}, {0x34, 0x16},
+    {0x31, 0x58}, {0x30, 0x9a}, {0x32, 0xdc}, {0x33, 0x1e},
+    {0x24, 0x60}, {0x25, 0xa2}, {0x27, 0xe4}, {0x26, 0x26},
+    {0x23, 0x68}, {0x22, 0xaa}, {0x20, 0xec}, {0x21, 0x2e},
+    {0x2a, 0x70}, {0x2b, 0xb2}, {0x29, 0xf4}, {0x28, 0x36},
+    {0x2d, 0x78}, {0x2c, 0xba}, {0x2e, 0xfc}, {0x2f, 0x3e},
+    {0x70, 0x80}, {0x71, 0x42}, {0x73, 0x04}, {0x72, 0xc6},
+    {0x77, 0x88}, {0x76, 0x4a}, {0x74, 0x0c}, {0x75, 0xce},
+    {0x7e, 0x90}, {0x7f, 0x52}, {0x7d, 0x14}, {0x7c, 0xd6},
+    {0x79, 0x98}, {0x78, 0x5a}, {0x7a, 0x1c}, {0x7b, 0xde},
+    {0x6c, 0xa0}, {0x6d, 0x62}, {0x6f, 0x24}, {0x6e, 0xe6},
+    {0x6b, 0xa8}, {0x6a, 0x6a}, {0x68, 0x2c}, {0x69, 0xee},
+    {0x62, 0xb0}, {0x63, 0x72}, {0x61, 0x34}, {0x60, 0xf6},
+    {0x65, 0xb8}, {0x64, 0x7a}, {0x66, 0x3c}, {0x67, 0xfe},
+    {0x48, 0xc0}, {0x49, 0x02}, {0x4b, 0x44}, {0x4a, 0x86},
+    {0x4f, 0xc8}, {0x4e, 0x0a}, {0x4c, 0x4c}, {0x4d, 0x8e},
+    {0x46, 0xd0}, {0x47, 0x12}, {0x45, 0x54}, {0x44, 0x96},
+    {0x41, 0xd8}, {0x40, 0x1a}, {0x42, 0x5c}, {0x43, 0x9e},
+    {0x54, 0xe0}, {0x55, 0x22}, {0x57, 0x64}, {0x56, 0xa6},
+    {0x53, 0xe8}, {0x52, 0x2a}, {0x50, 0x6c}, {0x51, 0xae},
+    {0x5a, 0xf0}, {0x5b, 0x32}, {0x59, 0x74}, {0x58, 0xb6},
+    {0x5d, 0xf8}, {0x5c, 0x3a}, {0x5e, 0x7c}, {0x5f, 0xbe},
+    {0xe1, 0x00}, {0xe0, 0xc2}, {0xe2, 0x84}, {0xe3, 0x46},
+    {0xe6, 0x08}, {0xe7, 0xca}, {0xe5, 0x8c}, {0xe4, 0x4e},
+    {0xef, 0x10}, {0xee, 0xd2}, {0xec, 0x94}, {0xed, 0x56},
+    {0xe8, 0x18}, {0xe9, 0xda}, {0xeb, 0x9c}, {0xea, 0x5e},
+    {0xfd, 0x20}, {0xfc, 0xe2}, {0xfe, 0xa4}, {0xff, 0x66},
+    {0xfa, 0x28}, {0xfb, 0xea}, {0xf9, 0xac}, {0xf8, 0x6e},
+    {0xf3, 0x30}, {0xf2, 0xf2}, {0xf0, 0xb4}, {0xf1, 0x76},
+    {0xf4, 0x38}, {0xf5, 0xfa}, {0xf7, 0xbc}, {0xf6, 0x7e},
+    {0xd9, 0x40}, {0xd8, 0x82}, {0xda, 0xc4}, {0xdb, 0x06},
+    {0xde, 0x48}, {0xdf, 0x8a}, {0xdd, 0xcc}, {0xdc, 0x0e},
+    {0xd7, 0x50}, {0xd6, 0x92}, {0xd4, 0xd4}, {0xd5, 0x16},
+    {0xd0, 0x58}, {0xd1, 0x9a}, {0xd3, 0xdc}, {0xd2, 0x1e},
+    {0xc5, 0x60}, {0xc4, 0xa2}, {0xc6, 0xe4}, {0xc7, 0x26},
+    {0xc2, 0x68}, {0xc3, 0xaa}, {0xc1, 0xec}, {0xc0, 0x2e},
+    {0xcb, 0x70}, {0xca, 0xb2}, {0xc8, 0xf4}, {0xc9, 0x36},
+    {0xcc, 0x78}, {0xcd, 0xba}, {0xcf, 0xfc}, {0xce, 0x3e},
+    {0x91, 0x80}, {0x90, 0x42}, {0x92, 0x04}, {0x93, 0xc6},
+    {0x96, 0x88}, {0x97, 0x4a}, {0x95, 0x0c}, {0x94, 0xce},
+    {0x9f, 0x90}, {0x9e, 0x52}, {0x9c, 0x14}, {0x9d, 0xd6},
+    {0x98, 0x98}, {0x99, 0x5a}, {0x9b, 0x1c}, {0x9a, 0xde},
+    {0x8d, 0xa0}, {0x8c, 0x62}, {0x8e, 0x24}, {0x8f, 0xe6},
+    {0x8a, 0xa8}, {0x8b, 0x6a}, {0x89, 0x2c}, {0x88, 0xee},
+    {0x83, 0xb0}, {0x82, 0x72}, {0x80, 0x34}, {0x81, 0xf6},
+    {0x84, 0xb8}, {0x85, 0x7a}, {0x87, 0x3c}, {0x86, 0xfe},
+    {0xa9, 0xc0}, {0xa8, 0x02}, {0xaa, 0x44}, {0xab, 0x86},
+    {0xae, 0xc8}, {0xaf, 0x0a}, {0xad, 0x4c}, {0xac, 0x8e},
+    {0xa7, 0xd0}, {0xa6, 0x12}, {0xa4, 0x54}, {0xa5, 0x96},
+    {0xa0, 0xd8}, {0xa1, 0x1a}, {0xa3, 0x5c}, {0xa2, 0x9e},
+    {0xb5, 0xe0}, {0xb4, 0x22}, {0xb6, 0x64}, {0xb7, 0xa6},
+    {0xb2, 0xe8}, {0xb3, 0x2a}, {0xb1, 0x6c}, {0xb0, 0xae},
+    {0xbb, 0xf0}, {0xba, 0x32}, {0xb8, 0x74}, {0xb9, 0xb6},
+    {0xbc, 0xf8}, {0xbd, 0x3a}, {0xbf, 0x7c}, {0xbe, 0xbe} };
+
+
+static void GMULT(byte *x, byte m[256][AES_BLOCK_SIZE])
+{
+    int i, j;
+    byte Z[AES_BLOCK_SIZE];
+    byte a;
+
+    XMEMSET(Z, 0, sizeof(Z));
+
+    for (i = 15; i > 0; i--) {
+        xorbuf(Z, m[x[i]], AES_BLOCK_SIZE);
+        a = Z[15];
+
+        for (j = 15; j > 0; j--) {
+            Z[j] = Z[j-1];
+        }
+
+        Z[0] = R[a][0];
+        Z[1] ^= R[a][1];
+    }
+    xorbuf(Z, m[x[0]], AES_BLOCK_SIZE);
+
+    XMEMCPY(x, Z, AES_BLOCK_SIZE);
+}
+
+
+static void GHASH(Aes* aes, const byte* a, word32 aSz,
+                                const byte* c, word32 cSz, byte* s, word32 sSz)
+{
+    byte x[AES_BLOCK_SIZE];
+    byte scratch[AES_BLOCK_SIZE];
+    word32 blocks, partial;
+
+    XMEMSET(x, 0, AES_BLOCK_SIZE);
+
+    /* Hash in A, the Additional Authentication Data */
+    if (aSz != 0 && a != NULL) {
+        blocks = aSz / AES_BLOCK_SIZE;
+        partial = aSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            xorbuf(x, a, AES_BLOCK_SIZE);
+            GMULT(x, aes->M0);
+            a += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(scratch, 0, AES_BLOCK_SIZE);
+            XMEMCPY(scratch, a, partial);
+            xorbuf(x, scratch, AES_BLOCK_SIZE);
+            GMULT(x, aes->M0);
+        }
+    }
+
+    /* Hash in C, the Ciphertext */
+    if (cSz != 0 && c != NULL) {
+        blocks = cSz / AES_BLOCK_SIZE;
+        partial = cSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            xorbuf(x, c, AES_BLOCK_SIZE);
+            GMULT(x, aes->M0);
+            c += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(scratch, 0, AES_BLOCK_SIZE);
+            XMEMCPY(scratch, c, partial);
+            xorbuf(x, scratch, AES_BLOCK_SIZE);
+            GMULT(x, aes->M0);
+        }
+    }
+
+    /* Hash in the lengths of A and C in bits */
+    FlattenSzInBits(&scratch[0], aSz);
+    FlattenSzInBits(&scratch[8], cSz);
+    xorbuf(x, scratch, AES_BLOCK_SIZE);
+    GMULT(x, aes->M0);
+
+    /* Copy the result into s. */
+    XMEMCPY(s, x, sSz);
+}
+
+/* end GCM_TABLE */
+#elif defined(WORD64_AVAILABLE) && !defined(GCM_WORD32)
+
+static void GMULT(word64* X, word64* Y)
+{
+    word64 Z[2] = {0,0};
+    word64 V[2] = {X[0], X[1]};
+    int i, j;
+
+    for (i = 0; i < 2; i++)
+    {
+        word64 y = Y[i];
+        for (j = 0; j < 64; j++)
+        {
+            if (y & 0x8000000000000000) {
+                Z[0] ^= V[0];
+                Z[1] ^= V[1];
+            }
+
+            if (V[1] & 0x0000000000000001) {
+                V[1] >>= 1;
+                V[1] |= ((V[0] & 0x0000000000000001) ? 0x8000000000000000 : 0);
+                V[0] >>= 1;
+                V[0] ^= 0xE100000000000000;
+            }
+            else {
+                V[1] >>= 1;
+                V[1] |= ((V[0] & 0x0000000000000001) ? 0x8000000000000000 : 0);
+                V[0] >>= 1;
+            }
+            y <<= 1;
+        }
+    }
+    X[0] = Z[0];
+    X[1] = Z[1];
+}
+
+
+static void GHASH(Aes* aes, const byte* a, word32 aSz,
+                                const byte* c, word32 cSz, byte* s, word32 sSz)
+{
+    word64 x[2] = {0,0};
+    word32 blocks, partial;
+    word64 bigH[2];
+
+    XMEMCPY(bigH, aes->H, AES_BLOCK_SIZE);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(bigH, bigH, AES_BLOCK_SIZE); 
+    #endif
+
+    /* Hash in A, the Additional Authentication Data */
+    if (aSz != 0 && a != NULL) {
+        word64 bigA[2];
+        blocks = aSz / AES_BLOCK_SIZE;
+        partial = aSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            XMEMCPY(bigA, a, AES_BLOCK_SIZE);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(bigA, bigA, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigA[0];
+            x[1] ^= bigA[1];
+            GMULT(x, bigH);
+            a += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(bigA, 0, AES_BLOCK_SIZE);
+            XMEMCPY(bigA, a, partial);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(bigA, bigA, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigA[0];
+            x[1] ^= bigA[1];
+            GMULT(x, bigH);
+        }
+    }
+
+    /* Hash in C, the Ciphertext */
+    if (cSz != 0 && c != NULL) {
+        word64 bigC[2];
+        blocks = cSz / AES_BLOCK_SIZE;
+        partial = cSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            XMEMCPY(bigC, c, AES_BLOCK_SIZE);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(bigC, bigC, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigC[0];
+            x[1] ^= bigC[1];
+            GMULT(x, bigH);
+            c += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(bigC, 0, AES_BLOCK_SIZE);
+            XMEMCPY(bigC, c, partial);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(bigC, bigC, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigC[0];
+            x[1] ^= bigC[1];
+            GMULT(x, bigH);
+        }
+    }
+
+    /* Hash in the lengths in bits of A and C */
+    {
+        word64 len[2] = {aSz, cSz};
+
+        /* Lengths are in bytes. Convert to bits. */
+        len[0] *= 8;
+        len[1] *= 8;
+
+        x[0] ^= len[0];
+        x[1] ^= len[1];
+        GMULT(x, bigH);
+    }
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(x, x, AES_BLOCK_SIZE);
+    #endif
+    XMEMCPY(s, x, sSz);
+}
+
+/* end defined(WORD64_AVAILABLE) && !defined(GCM_WORD32) */
+#else /* GCM_WORD32 */
+
+static void GMULT(word32* X, word32* Y)
+{
+    word32 Z[4] = {0,0,0,0};
+    word32 V[4] = {X[0], X[1], X[2], X[3]};
+    int i, j;
+
+    for (i = 0; i < 4; i++)
+    {
+        word32 y = Y[i];
+        for (j = 0; j < 32; j++)
+        {
+            if (y & 0x80000000) {
+                Z[0] ^= V[0];
+                Z[1] ^= V[1];
+                Z[2] ^= V[2];
+                Z[3] ^= V[3];
+            }
+
+            if (V[3] & 0x00000001) {
+                V[3] >>= 1;
+                V[3] |= ((V[2] & 0x00000001) ? 0x80000000 : 0);
+                V[2] >>= 1;
+                V[2] |= ((V[1] & 0x00000001) ? 0x80000000 : 0);
+                V[1] >>= 1;
+                V[1] |= ((V[0] & 0x00000001) ? 0x80000000 : 0);
+                V[0] >>= 1;
+                V[0] ^= 0xE1000000;
+            } else {
+                V[3] >>= 1;
+                V[3] |= ((V[2] & 0x00000001) ? 0x80000000 : 0);
+                V[2] >>= 1;
+                V[2] |= ((V[1] & 0x00000001) ? 0x80000000 : 0);
+                V[1] >>= 1;
+                V[1] |= ((V[0] & 0x00000001) ? 0x80000000 : 0);
+                V[0] >>= 1;
+            }
+            y <<= 1;
+        }
+    }
+    X[0] = Z[0];
+    X[1] = Z[1];
+    X[2] = Z[2];
+    X[3] = Z[3];
+}
+
+
+static void GHASH(Aes* aes, const byte* a, word32 aSz,
+                                const byte* c, word32 cSz, byte* s, word32 sSz)
+{
+    word32 x[4] = {0,0,0,0};
+    word32 blocks, partial;
+    word32 bigH[4];
+
+    XMEMCPY(bigH, aes->H, AES_BLOCK_SIZE);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords(bigH, bigH, AES_BLOCK_SIZE); 
+    #endif
+
+    /* Hash in A, the Additional Authentication Data */
+    if (aSz != 0 && a != NULL) {
+        word32 bigA[4];
+        blocks = aSz / AES_BLOCK_SIZE;
+        partial = aSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            XMEMCPY(bigA, a, AES_BLOCK_SIZE);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords(bigA, bigA, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigA[0];
+            x[1] ^= bigA[1];
+            x[2] ^= bigA[2];
+            x[3] ^= bigA[3];
+            GMULT(x, bigH);
+            a += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(bigA, 0, AES_BLOCK_SIZE);
+            XMEMCPY(bigA, a, partial);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords(bigA, bigA, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigA[0];
+            x[1] ^= bigA[1];
+            x[2] ^= bigA[2];
+            x[3] ^= bigA[3];
+            GMULT(x, bigH);
+        }
+    }
+
+    /* Hash in C, the Ciphertext */
+    if (cSz != 0 && c != NULL) {
+        word32 bigC[4];
+        blocks = cSz / AES_BLOCK_SIZE;
+        partial = cSz % AES_BLOCK_SIZE;
+        while (blocks--) {
+            XMEMCPY(bigC, c, AES_BLOCK_SIZE);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords(bigC, bigC, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigC[0];
+            x[1] ^= bigC[1];
+            x[2] ^= bigC[2];
+            x[3] ^= bigC[3];
+            GMULT(x, bigH);
+            c += AES_BLOCK_SIZE;
+        }
+        if (partial != 0) {
+            XMEMSET(bigC, 0, AES_BLOCK_SIZE);
+            XMEMCPY(bigC, c, partial);
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords(bigC, bigC, AES_BLOCK_SIZE);
+            #endif
+            x[0] ^= bigC[0];
+            x[1] ^= bigC[1];
+            x[2] ^= bigC[2];
+            x[3] ^= bigC[3];
+            GMULT(x, bigH);
+        }
+    }
+
+    /* Hash in the lengths in bits of A and C */
+    {
+        word32 len[4];
+
+        /* Lengths are in bytes. Convert to bits. */
+        len[0] = (aSz >> (8*sizeof(aSz) - 3));
+        len[1] = aSz << 3;
+        len[2] = (cSz >> (8*sizeof(cSz) - 3));
+        len[3] = cSz << 3;
+
+        x[0] ^= len[0];
+        x[1] ^= len[1];
+        x[2] ^= len[2];
+        x[3] ^= len[3];
+        GMULT(x, bigH);
+    }
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords(x, x, AES_BLOCK_SIZE);
+    #endif
+    XMEMCPY(s, x, sSz);
+}
+
+#endif /* end GCM_WORD32 */
+
+
+void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
+                   byte* authTag, word32 authTagSz,
+                   const byte* authIn, word32 authInSz)
+{
+    word32 blocks = sz / AES_BLOCK_SIZE;
+    word32 partial = sz % AES_BLOCK_SIZE;
+    const byte* p = in;
+    byte* c = out;
+    byte ctr[AES_BLOCK_SIZE];
+    byte scratch[AES_BLOCK_SIZE];
+
+    CYASSL_ENTER("AesGcmEncrypt");
+
+    /* Initialize the counter with the MS 96 bits of IV, and the counter
+     * portion set to "1". */
+    XMEMCPY(ctr, aes->reg, AES_BLOCK_SIZE);
+    InitGcmCounter(ctr);
+
+    while (blocks--) {
+        IncrementGcmCounter(ctr);
+        AesEncrypt(aes, ctr, scratch);
+        xorbuf(scratch, p, AES_BLOCK_SIZE);
+        XMEMCPY(c, scratch, AES_BLOCK_SIZE);
+
+        p += AES_BLOCK_SIZE;
+        c += AES_BLOCK_SIZE;
+    }
+    if (partial != 0) {
+        IncrementGcmCounter(ctr);
+        AesEncrypt(aes, ctr, scratch);
+        xorbuf(scratch, p, partial);
+        XMEMCPY(c, scratch, partial);
+    }
+    GHASH(aes, authIn, authInSz, out, sz, authTag, authTagSz);
+    InitGcmCounter(ctr);
+    AesEncrypt(aes, ctr, scratch);
+    xorbuf(authTag, scratch, authTagSz);
+}
+
+
+int  AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
+                   const byte* authTag, word32 authTagSz,
+                   const byte* authIn, word32 authInSz)
+{
+    word32 blocks = sz / AES_BLOCK_SIZE;
+    word32 partial = sz % AES_BLOCK_SIZE;
+    const byte* c = in;
+    byte* p = out;
+    byte ctr[AES_BLOCK_SIZE];
+    byte scratch[AES_BLOCK_SIZE];
+
+    CYASSL_ENTER("AesGcmDecrypt");
+
+    /* Initialize the counter with the MS 96 bits of IV, and the counter
+     * portion set to "1". */
+    XMEMCPY(ctr, aes->reg, AES_BLOCK_SIZE);
+    InitGcmCounter(ctr);
+
+    /* Calculate the authTag again using the received auth data and the
+     * cipher text. */
+    {
+        byte Tprime[AES_BLOCK_SIZE];
+        byte EKY0[AES_BLOCK_SIZE];
+
+        GHASH(aes, authIn, authInSz, in, sz, Tprime, sizeof(Tprime));
+        AesEncrypt(aes, ctr, EKY0);
+        xorbuf(Tprime, EKY0, sizeof(Tprime));
+        if (XMEMCMP(authTag, Tprime, authTagSz) != 0) {
+            return AES_GCM_AUTH_E;
+        }
+    }
+
+    while (blocks--) {
+        IncrementGcmCounter(ctr);
+        AesEncrypt(aes, ctr, scratch);
+        xorbuf(scratch, c, AES_BLOCK_SIZE);
+        XMEMCPY(p, scratch, AES_BLOCK_SIZE);
+
+        p += AES_BLOCK_SIZE;
+        c += AES_BLOCK_SIZE;
+    }
+    if (partial != 0) {
+        IncrementGcmCounter(ctr);
+        AesEncrypt(aes, ctr, scratch);
+        xorbuf(scratch, c, partial);
+        XMEMCPY(p, scratch, partial);
+    }
+
+    return 0;
+}
+
+#endif /* HAVE_AESGCM */
+
+
+#endif /* NO_AES */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes_asm.s b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/aes_asm.s
new file mode 100644 (file)
index 0000000..4aa3586
--- /dev/null
@@ -0,0 +1,484 @@
+/* aes_asm.s
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* See Intel® Advanced Encryption Standard (AES) Instructions Set White Paper
+ * by Intel Mobility Group, Israel Development Center, Israel Shay Gueron
+ */
+
+
+//AES_CBC_encrypt (const unsigned char *in,
+//     unsigned char *out,
+//     unsigned char ivec[16],
+//     unsigned long length,
+//     const unsigned char *KS,
+//     int nr)
+.globl AES_CBC_encrypt
+AES_CBC_encrypt:
+# parameter 1: %rdi
+# parameter 2: %rsi
+# parameter 3: %rdx
+# parameter 4: %rcx
+# parameter 5: %r8
+# parameter 6: %r9d
+movq   %rcx, %r10
+shrq   $4, %rcx
+shlq   $60, %r10
+je     NO_PARTS
+addq   $1, %rcx
+NO_PARTS:
+subq   $16, %rsi
+movdqa (%rdx), %xmm1
+LOOP:
+pxor   (%rdi), %xmm1
+pxor   (%r8), %xmm1
+addq   $16,%rsi
+addq   $16,%rdi
+cmpl   $12, %r9d
+aesenc 16(%r8),%xmm1
+aesenc 32(%r8),%xmm1
+aesenc 48(%r8),%xmm1
+aesenc 64(%r8),%xmm1
+aesenc 80(%r8),%xmm1
+aesenc 96(%r8),%xmm1
+aesenc 112(%r8),%xmm1
+aesenc 128(%r8),%xmm1
+aesenc 144(%r8),%xmm1
+movdqa 160(%r8),%xmm2
+jb     LAST
+cmpl   $14, %r9d
+
+aesenc 160(%r8),%xmm1
+aesenc 176(%r8),%xmm1
+movdqa 192(%r8),%xmm2
+jb     LAST
+aesenc 192(%r8),%xmm1
+aesenc 208(%r8),%xmm1
+movdqa 224(%r8),%xmm2
+LAST:
+decq   %rcx
+aesenclast %xmm2,%xmm1
+movdqu %xmm1,(%rsi)
+jne    LOOP
+ret
+
+
+
+//AES_CBC_decrypt (const unsigned char *in,
+//  unsigned char *out,
+//  unsigned char ivec[16],
+//  unsigned long length,
+//  const unsigned char *KS,
+// int nr)
+.globl AES_CBC_decrypt
+AES_CBC_decrypt:
+# parameter 1: %rdi
+# parameter 2: %rsi
+# parameter 3: %rdx
+# parameter 4: %rcx
+# parameter 5: %r8
+# parameter 6: %r9d
+
+movq    %rcx, %r10
+shrq $4, %rcx
+shlq   $60, %r10
+je    DNO_PARTS_4
+addq    $1, %rcx
+DNO_PARTS_4:
+movq   %rcx, %r10
+shlq    $62, %r10
+shrq  $62, %r10
+shrq  $2, %rcx
+movdqu (%rdx),%xmm5
+je DREMAINDER_4
+subq   $64, %rsi
+DLOOP_4:
+movdqu (%rdi), %xmm1
+movdqu  16(%rdi), %xmm2
+movdqu  32(%rdi), %xmm3
+movdqu  48(%rdi), %xmm4
+movdqa  %xmm1, %xmm6
+movdqa %xmm2, %xmm7
+movdqa %xmm3, %xmm8
+movdqa %xmm4, %xmm15
+movdqa    (%r8), %xmm9
+movdqa 16(%r8), %xmm10
+movdqa  32(%r8), %xmm11
+movdqa  48(%r8), %xmm12
+pxor    %xmm9, %xmm1
+pxor   %xmm9, %xmm2
+pxor   %xmm9, %xmm3
+
+pxor    %xmm9, %xmm4
+aesdec %xmm10, %xmm1
+aesdec    %xmm10, %xmm2
+aesdec    %xmm10, %xmm3
+aesdec    %xmm10, %xmm4
+aesdec    %xmm11, %xmm1
+aesdec    %xmm11, %xmm2
+aesdec    %xmm11, %xmm3
+aesdec    %xmm11, %xmm4
+aesdec    %xmm12, %xmm1
+aesdec    %xmm12, %xmm2
+aesdec    %xmm12, %xmm3
+aesdec    %xmm12, %xmm4
+movdqa    64(%r8), %xmm9
+movdqa   80(%r8), %xmm10
+movdqa  96(%r8), %xmm11
+movdqa  112(%r8), %xmm12
+aesdec %xmm9, %xmm1
+aesdec %xmm9, %xmm2
+aesdec %xmm9, %xmm3
+aesdec %xmm9, %xmm4
+aesdec %xmm10, %xmm1
+aesdec    %xmm10, %xmm2
+aesdec    %xmm10, %xmm3
+aesdec    %xmm10, %xmm4
+aesdec    %xmm11, %xmm1
+aesdec    %xmm11, %xmm2
+aesdec    %xmm11, %xmm3
+aesdec    %xmm11, %xmm4
+aesdec    %xmm12, %xmm1
+aesdec    %xmm12, %xmm2
+aesdec    %xmm12, %xmm3
+aesdec    %xmm12, %xmm4
+movdqa    128(%r8), %xmm9
+movdqa  144(%r8), %xmm10
+movdqa 160(%r8), %xmm11
+cmpl   $12, %r9d
+aesdec  %xmm9, %xmm1
+aesdec %xmm9, %xmm2
+aesdec %xmm9, %xmm3
+aesdec %xmm9, %xmm4
+aesdec %xmm10, %xmm1
+aesdec    %xmm10, %xmm2
+aesdec    %xmm10, %xmm3
+aesdec    %xmm10, %xmm4
+jb    DLAST_4
+movdqa  160(%r8), %xmm9
+movdqa  176(%r8), %xmm10
+movdqa 192(%r8), %xmm11
+cmpl   $14, %r9d
+aesdec  %xmm9, %xmm1
+aesdec %xmm9, %xmm2
+aesdec %xmm9, %xmm3
+aesdec %xmm9, %xmm4
+aesdec %xmm10, %xmm1
+aesdec    %xmm10, %xmm2
+aesdec    %xmm10, %xmm3
+aesdec    %xmm10, %xmm4
+jb    DLAST_4
+
+movdqa  192(%r8), %xmm9
+movdqa  208(%r8), %xmm10
+movdqa 224(%r8), %xmm11
+aesdec %xmm9, %xmm1
+aesdec %xmm9, %xmm2
+aesdec %xmm9, %xmm3
+aesdec %xmm9, %xmm4
+aesdec %xmm10, %xmm1
+aesdec    %xmm10, %xmm2
+aesdec    %xmm10, %xmm3
+aesdec    %xmm10, %xmm4
+DLAST_4:
+addq   $64, %rdi
+addq    $64, %rsi
+decq  %rcx
+aesdeclast %xmm11, %xmm1
+aesdeclast %xmm11, %xmm2
+aesdeclast %xmm11, %xmm3
+aesdeclast %xmm11, %xmm4
+pxor   %xmm5 ,%xmm1
+pxor    %xmm6 ,%xmm2
+pxor   %xmm7 ,%xmm3
+pxor   %xmm8 ,%xmm4
+movdqu %xmm1, (%rsi)
+movdqu    %xmm2, 16(%rsi)
+movdqu  %xmm3, 32(%rsi)
+movdqu  %xmm4, 48(%rsi)
+movdqa  %xmm15,%xmm5
+jne    DLOOP_4
+addq    $64, %rsi
+DREMAINDER_4:
+cmpq    $0, %r10
+je  DEND_4
+DLOOP_4_2:
+movdqu  (%rdi), %xmm1
+movdqa    %xmm1 ,%xmm15
+addq  $16, %rdi
+pxor  (%r8), %xmm1
+movdqu 160(%r8), %xmm2
+cmpl    $12, %r9d
+aesdec    16(%r8), %xmm1
+aesdec   32(%r8), %xmm1
+aesdec   48(%r8), %xmm1
+aesdec   64(%r8), %xmm1
+aesdec   80(%r8), %xmm1
+aesdec   96(%r8), %xmm1
+aesdec   112(%r8), %xmm1
+aesdec  128(%r8), %xmm1
+aesdec  144(%r8), %xmm1
+jb  DLAST_4_2
+movdqu    192(%r8), %xmm2
+cmpl    $14, %r9d
+aesdec    160(%r8), %xmm1
+aesdec  176(%r8), %xmm1
+jb  DLAST_4_2
+movdqu    224(%r8), %xmm2
+aesdec  192(%r8), %xmm1
+aesdec  208(%r8), %xmm1
+DLAST_4_2:
+aesdeclast %xmm2, %xmm1
+pxor    %xmm5, %xmm1
+movdqa %xmm15, %xmm5
+movdqu    %xmm1, (%rsi)
+
+addq    $16, %rsi
+decq    %r10
+jne DLOOP_4_2
+DEND_4:
+ret
+
+
+
+
+//void AES_128_Key_Expansion(const unsigned char* userkey,
+//   unsigned char* key_schedule);
+.align  16,0x90
+.globl AES_128_Key_Expansion
+AES_128_Key_Expansion:
+# parameter 1: %rdi
+# parameter 2: %rsi
+movl    $10, 240(%rsi)
+
+movdqu  (%rdi), %xmm1
+movdqa    %xmm1, (%rsi)
+
+
+ASSISTS:
+aeskeygenassist $1, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 16(%rsi)
+aeskeygenassist $2, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 32(%rsi)
+aeskeygenassist $4, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 48(%rsi)
+aeskeygenassist $8, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 64(%rsi)
+aeskeygenassist $16, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 80(%rsi)
+aeskeygenassist $32, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 96(%rsi)
+aeskeygenassist $64, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 112(%rsi)
+aeskeygenassist $0x80, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 128(%rsi)
+aeskeygenassist $0x1b, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 144(%rsi)
+aeskeygenassist $0x36, %xmm1, %xmm2
+call PREPARE_ROUNDKEY_128
+movdqa %xmm1, 160(%rsi)
+ret
+
+PREPARE_ROUNDKEY_128:
+pshufd $255, %xmm2, %xmm2
+movdqa %xmm1, %xmm3
+pslldq $4, %xmm3
+pxor %xmm3, %xmm1
+pslldq $4, %xmm3
+pxor %xmm3, %xmm1
+pslldq $4, %xmm3
+pxor %xmm3, %xmm1
+pxor %xmm2, %xmm1
+ret
+
+
+//void AES_192_Key_Expansion (const unsigned char *userkey,
+//  unsigned char *key)
+.globl AES_192_Key_Expansion
+AES_192_Key_Expansion:
+# parameter 1: %rdi
+# parameter 2: %rsi
+
+movdqu (%rdi), %xmm1
+movdqu 16(%rdi), %xmm3
+movdqa %xmm1, (%rsi)
+movdqa %xmm3, %xmm5
+
+aeskeygenassist $0x1, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+shufpd $0, %xmm1, %xmm5
+movdqa %xmm5, 16(%rsi)
+movdqa %xmm1, %xmm6
+shufpd $1, %xmm3, %xmm6
+movdqa %xmm6, 32(%rsi)
+
+aeskeygenassist $0x2, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+movdqa %xmm1, 48(%rsi)
+movdqa %xmm3, %xmm5
+
+aeskeygenassist $0x4, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+shufpd $0, %xmm1, %xmm5
+movdqa %xmm5, 64(%rsi)
+movdqa %xmm1, %xmm6
+shufpd $1, %xmm3, %xmm6
+movdqa %xmm6, 80(%rsi)
+
+aeskeygenassist $0x8, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+movdqa %xmm1, 96(%rsi)
+movdqa %xmm3, %xmm5
+
+aeskeygenassist $0x10, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+shufpd $0, %xmm1, %xmm5
+movdqa %xmm5, 112(%rsi)
+movdqa %xmm1, %xmm6
+shufpd $1, %xmm3, %xmm6
+movdqa %xmm6, 128(%rsi)
+
+aeskeygenassist $0x20, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+movdqa %xmm1, 144(%rsi)
+movdqa %xmm3, %xmm5
+
+aeskeygenassist $0x40, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+shufpd $0, %xmm1, %xmm5
+movdqa %xmm5, 160(%rsi)
+movdqa %xmm1, %xmm6
+shufpd $1, %xmm3, %xmm6
+movdqa %xmm6, 176(%rsi)
+
+aeskeygenassist $0x80, %xmm3, %xmm2
+call PREPARE_ROUNDKEY_192
+movdqa %xmm1, 192(%rsi)
+movdqa %xmm3, 208(%rsi)
+ret
+
+PREPARE_ROUNDKEY_192:
+pshufd $0x55, %xmm2, %xmm2
+movdqu %xmm1, %xmm4
+pslldq $4, %xmm4
+pxor   %xmm4, %xmm1
+
+pslldq $4, %xmm4
+pxor   %xmm4, %xmm1
+pslldq $4, %xmm4
+pxor  %xmm4, %xmm1
+pxor   %xmm2, %xmm1
+pshufd $0xff, %xmm1, %xmm2
+movdqu %xmm3, %xmm4
+pslldq $4, %xmm4
+pxor   %xmm4, %xmm3
+pxor   %xmm2, %xmm3
+ret
+
+//void AES_256_Key_Expansion (const unsigned char *userkey,
+//  unsigned char *key)
+.globl AES_256_Key_Expansion
+AES_256_Key_Expansion:
+# parameter 1: %rdi
+# parameter 2: %rsi
+
+movdqu (%rdi), %xmm1
+movdqu 16(%rdi), %xmm3
+movdqa %xmm1, (%rsi)
+movdqa %xmm3, 16(%rsi)
+
+aeskeygenassist $0x1, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 32(%rsi)
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 48(%rsi)
+aeskeygenassist $0x2, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 64(%rsi)
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 80(%rsi)
+aeskeygenassist $0x4, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 96(%rsi)
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 112(%rsi)
+aeskeygenassist $0x8, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 128(%rsi)
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 144(%rsi)
+aeskeygenassist $0x10, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 160(%rsi)
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 176(%rsi)
+aeskeygenassist $0x20, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 192(%rsi)
+
+aeskeygenassist $0x0, %xmm1, %xmm2
+call MAKE_RK256_b
+movdqa %xmm3, 208(%rsi)
+aeskeygenassist $0x40, %xmm3, %xmm2
+call MAKE_RK256_a
+movdqa %xmm1, 224(%rsi)
+
+ret
+
+MAKE_RK256_a:
+pshufd $0xff, %xmm2, %xmm2
+movdqa %xmm1, %xmm4
+pslldq $4, %xmm4
+pxor   %xmm4, %xmm1
+pslldq $4, %xmm4
+pxor  %xmm4, %xmm1
+pslldq $4, %xmm4
+pxor  %xmm4, %xmm1
+pxor   %xmm2, %xmm1
+ret
+
+MAKE_RK256_b:
+pshufd $0xaa, %xmm2, %xmm2
+movdqa %xmm3, %xmm4
+pslldq $4, %xmm4
+pxor   %xmm4, %xmm3
+pslldq $4, %xmm4
+pxor  %xmm4, %xmm3
+pslldq $4, %xmm4
+pxor  %xmm4, %xmm3
+pxor   %xmm2, %xmm3
+ret
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/arc4.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/arc4.c
new file mode 100644 (file)
index 0000000..cbb132d
--- /dev/null
@@ -0,0 +1,78 @@
+/* arc4.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/arc4.h>
+
+
+void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
+{
+    word32 i;
+    word32 keyIndex = 0, stateIndex = 0;
+
+    arc4->x = 1;
+    arc4->y = 0;
+
+    for (i = 0; i < ARC4_STATE_SIZE; i++)
+        arc4->state[i] = (byte)i;
+
+    for (i = 0; i < ARC4_STATE_SIZE; i++) {
+        word32 a = arc4->state[i];
+        stateIndex += key[keyIndex] + a;
+        stateIndex &= 0xFF;
+        arc4->state[i] = arc4->state[stateIndex];
+        arc4->state[stateIndex] = (byte)a;
+
+        if (++keyIndex >= length)
+            keyIndex = 0;
+    }
+}
+
+
+static INLINE byte MakeByte(word32* x, word32* y, byte* s)
+{
+    word32 a = s[*x], b;
+    *y = (*y+a) & 0xff;
+
+    b = s[*y];
+    s[*x] = (byte)b;
+    s[*y] = (byte)a;
+    *x = (*x+1) & 0xff;
+
+    return s[(a+b) & 0xff];
+}
+
+
+void Arc4Process(Arc4* arc4, byte* out, const byte* in, word32 length)
+{
+    word32 x = arc4->x;
+    word32 y = arc4->y;
+
+    while(length--)
+        *out++ = *in++ ^ MakeByte(&x, &y, arc4->state);
+
+    arc4->x = (byte)x;
+    arc4->y = (byte)y;
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asm.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asm.c
new file mode 100644 (file)
index 0000000..008322e
--- /dev/null
@@ -0,0 +1,1305 @@
+/* asm.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/*
+ * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
+ * http://math.libtomcrypt.com
+ */
+
+
+/******************************************************************/
+/* fp_montgomery_reduce.c asm or generic */
+#if defined(TFM_X86) && !defined(TFM_SSE2) 
+/* x86-32 code */
+
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                                          \
+asm(                                                      \
+   "movl %5,%%eax \n\t"                                   \
+   "mull %4       \n\t"                                   \
+   "addl %1,%%eax \n\t"                                   \
+   "adcl $0,%%edx \n\t"                                   \
+   "addl %%eax,%0 \n\t"                                   \
+   "adcl $0,%%edx \n\t"                                   \
+   "movl %%edx,%1 \n\t"                                   \
+:"=g"(_c[LO]), "=r"(cy)                                   \
+:"0"(_c[LO]), "1"(cy), "g"(mu), "g"(*tmpm++)              \
+: "%eax", "%edx", "%cc")
+
+#define PROPCARRY                           \
+asm(                                        \
+   "addl   %1,%0    \n\t"                   \
+   "setb   %%al     \n\t"                   \
+   "movzbl %%al,%1 \n\t"                    \
+:"=g"(_c[LO]), "=r"(cy)                     \
+:"0"(_c[LO]), "1"(cy)                       \
+: "%eax", "%cc")
+
+/******************************************************************/
+#elif defined(TFM_X86_64)
+/* x86-64 code */
+
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                                          \
+asm(                                                      \
+   "movq %5,%%rax \n\t"                                   \
+   "mulq %4       \n\t"                                   \
+   "addq %1,%%rax \n\t"                                   \
+   "adcq $0,%%rdx \n\t"                                   \
+   "addq %%rax,%0 \n\t"                                   \
+   "adcq $0,%%rdx \n\t"                                   \
+   "movq %%rdx,%1 \n\t"                                   \
+:"=g"(_c[LO]), "=r"(cy)                                   \
+:"0"(_c[LO]), "1"(cy), "r"(mu), "r"(*tmpm++)              \
+: "%rax", "%rdx", "%cc")
+
+#define INNERMUL8 \
+ asm(                  \
+ "movq 0(%5),%%rax    \n\t"  \
+ "movq 0(%2),%%r10    \n\t"  \
+ "movq 0x8(%5),%%r11  \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x8(%2),%%r10  \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0(%0)    \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x10(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x10(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x8(%0)  \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x18(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x18(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x10(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x20(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x20(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x18(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x28(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x28(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x20(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x30(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x30(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x28(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "movq 0x38(%5),%%r11 \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq 0x38(%2),%%r10 \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x30(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+ "movq %%r11,%%rax    \n\t"  \
+ "mulq %4             \n\t"  \
+ "addq %%r10,%%rax    \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "addq %3,%%rax       \n\t"  \
+ "adcq $0,%%rdx       \n\t"  \
+ "movq %%rax,0x38(%0) \n\t"  \
+ "movq %%rdx,%1       \n\t"  \
+ \
+:"=r"(_c), "=r"(cy)                    \
+: "0"(_c),  "1"(cy), "g"(mu), "r"(tmpm)\
+: "%rax", "%rdx", "%r10", "%r11", "%cc")
+
+
+#define PROPCARRY                           \
+asm(                                        \
+   "addq   %1,%0    \n\t"                   \
+   "setb   %%al     \n\t"                   \
+   "movzbq %%al,%1 \n\t"                    \
+:"=g"(_c[LO]), "=r"(cy)                     \
+:"0"(_c[LO]), "1"(cy)                       \
+: "%rax", "%cc")
+
+/******************************************************************/
+#elif defined(TFM_SSE2)  
+/* SSE2 code (assumes 32-bit fp_digits) */
+/* XMM register assignments:
+ * xmm0  *tmpm++, then Mu * (*tmpm++)
+ * xmm1  c[x], then Mu
+ * xmm2  mp
+ * xmm3  cy
+ * xmm4  _c[LO]
+ */
+
+#define MONT_START \
+   asm("movd %0,%%mm2"::"g"(mp))
+
+#define MONT_FINI \
+   asm("emms")
+
+#define LOOP_START          \
+asm(                        \
+"movd %0,%%mm1        \n\t" \
+"pxor %%mm3,%%mm3     \n\t" \
+"pmuludq %%mm2,%%mm1  \n\t" \
+:: "g"(c[x]))
+
+/* pmuludq on mmx registers does a 32x32->64 multiply. */
+#define INNERMUL               \
+asm(                           \
+   "movd %1,%%mm4        \n\t" \
+   "movd %2,%%mm0        \n\t" \
+   "paddq %%mm4,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm0  \n\t" \
+   "paddq %%mm0,%%mm3    \n\t" \
+   "movd %%mm3,%0        \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+:"=g"(_c[LO]) : "0"(_c[LO]), "g"(*tmpm++) );
+
+#define INNERMUL8 \
+asm(                           \
+   "movd 0(%1),%%mm4     \n\t" \
+   "movd 0(%2),%%mm0     \n\t" \
+   "paddq %%mm4,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm0  \n\t" \
+   "movd 4(%2),%%mm5     \n\t" \
+   "paddq %%mm0,%%mm3    \n\t" \
+   "movd 4(%1),%%mm6     \n\t" \
+   "movd %%mm3,0(%0)     \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm6,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm5  \n\t" \
+   "movd 8(%2),%%mm6     \n\t" \
+   "paddq %%mm5,%%mm3    \n\t" \
+   "movd 8(%1),%%mm7     \n\t" \
+   "movd %%mm3,4(%0)     \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm7,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm6  \n\t" \
+   "movd 12(%2),%%mm7    \n\t" \
+   "paddq %%mm6,%%mm3    \n\t" \
+   "movd 12(%1),%%mm5     \n\t" \
+   "movd %%mm3,8(%0)     \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm5,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm7  \n\t" \
+   "movd 16(%2),%%mm5    \n\t" \
+   "paddq %%mm7,%%mm3    \n\t" \
+   "movd 16(%1),%%mm6    \n\t" \
+   "movd %%mm3,12(%0)    \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm6,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm5  \n\t" \
+   "movd 20(%2),%%mm6    \n\t" \
+   "paddq %%mm5,%%mm3    \n\t" \
+   "movd 20(%1),%%mm7    \n\t" \
+   "movd %%mm3,16(%0)    \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm7,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm6  \n\t" \
+   "movd 24(%2),%%mm7    \n\t" \
+   "paddq %%mm6,%%mm3    \n\t" \
+   "movd 24(%1),%%mm5     \n\t" \
+   "movd %%mm3,20(%0)    \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm5,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm7  \n\t" \
+   "movd 28(%2),%%mm5    \n\t" \
+   "paddq %%mm7,%%mm3    \n\t" \
+   "movd 28(%1),%%mm6    \n\t" \
+   "movd %%mm3,24(%0)    \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+\
+   "paddq %%mm6,%%mm3    \n\t" \
+   "pmuludq %%mm1,%%mm5  \n\t" \
+   "paddq %%mm5,%%mm3    \n\t" \
+   "movd %%mm3,28(%0)    \n\t" \
+   "psrlq $32, %%mm3     \n\t" \
+:"=r"(_c) : "0"(_c), "r"(tmpm) );
+
+/* TAO switched tmpm from "g" to "r" after gcc tried to index the indexed stack
+   pointer */
+
+#define LOOP_END \
+asm( "movd %%mm3,%0  \n" :"=r"(cy))
+
+#define PROPCARRY                           \
+asm(                                        \
+   "addl   %1,%0    \n\t"                   \
+   "setb   %%al     \n\t"                   \
+   "movzbl %%al,%1 \n\t"                    \
+:"=g"(_c[LO]), "=r"(cy)                     \
+:"0"(_c[LO]), "1"(cy)                       \
+: "%eax", "%cc")
+
+/******************************************************************/
+#elif defined(TFM_ARM)
+   /* ARMv4 code */
+
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                    \
+asm(                                \
+    " LDR    r0,%1            \n\t" \
+    " ADDS   r0,r0,%0         \n\t" \
+    " MOVCS  %0,#1            \n\t" \
+    " MOVCC  %0,#0            \n\t" \
+    " UMLAL  r0,%0,%3,%4      \n\t" \
+    " STR    r0,%1            \n\t" \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c[0]):"r0","%cc");
+
+#define PROPCARRY                  \
+asm(                               \
+    " LDR   r0,%1            \n\t" \
+    " ADDS  r0,r0,%0         \n\t" \
+    " STR   r0,%1            \n\t" \
+    " MOVCS %0,#1            \n\t" \
+    " MOVCC %0,#0            \n\t" \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"r0","%cc");
+
+#elif defined(TFM_PPC32)
+
+/* PPC32 */
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                     \
+asm(                                 \
+   " mullw    16,%3,%4       \n\t"   \
+   " mulhwu   17,%3,%4       \n\t"   \
+   " addc     16,16,%0       \n\t"   \
+   " addze    17,17          \n\t"   \
+   " lwz      18,%1          \n\t"   \
+   " addc     16,16,18       \n\t"   \
+   " addze    %0,17          \n\t"   \
+   " stw      16,%1          \n\t"   \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
+
+#define PROPCARRY                    \
+asm(                                 \
+   " lwz      16,%1         \n\t"    \
+   " addc     16,16,%0      \n\t"    \
+   " stw      16,%1         \n\t"    \
+   " xor      %0,%0,%0      \n\t"    \
+   " addze    %0,%0         \n\t"    \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
+
+#elif defined(TFM_PPC64)
+
+/* PPC64 */
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                     \
+asm(                                 \
+   " mulld    16,%3,%4       \n\t"   \
+   " mulhdu   17,%3,%4       \n\t"   \
+   " addc     16,16,%0       \n\t"   \
+   " addze    17,17          \n\t"   \
+   " ldx      18,0,%1        \n\t"   \
+   " addc     16,16,18       \n\t"   \
+   " addze    %0,17          \n\t"   \
+   " sdx      16,0,%1        \n\t"   \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","%cc"); ++tmpm;
+
+#define PROPCARRY                    \
+asm(                                 \
+   " ldx      16,0,%1       \n\t"    \
+   " addc     16,16,%0      \n\t"    \
+   " sdx      16,0,%1       \n\t"    \
+   " xor      %0,%0,%0      \n\t"    \
+   " addze    %0,%0         \n\t"    \
+:"=r"(cy),"=m"(_c[0]):"0"(cy),"1"(_c[0]):"16","%cc");
+
+/******************************************************************/
+
+#elif defined(TFM_AVR32)
+
+/* AVR32 */
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                    \
+asm(                                \
+    " ld.w   r2,%1            \n\t" \
+    " add    r2,%0            \n\t" \
+    " eor    r3,r3            \n\t" \
+    " acr    r3               \n\t" \
+    " macu.d r2,%3,%4         \n\t" \
+    " st.w   %1,r2            \n\t" \
+    " mov    %0,r3            \n\t" \
+:"=r"(cy),"=r"(_c):"0"(cy),"r"(mu),"r"(*tmpm++),"1"(_c):"r2","r3");
+
+#define PROPCARRY                    \
+asm(                                 \
+   " ld.w     r2,%1         \n\t"    \
+   " add      r2,%0         \n\t"    \
+   " st.w     %1,r2         \n\t"    \
+   " eor      %0,%0         \n\t"    \
+   " acr      %0            \n\t"    \
+:"=r"(cy),"=r"(&_c[0]):"0"(cy),"1"(&_c[0]):"r2","%cc");
+
+#else
+
+/* ISO C code */
+#define MONT_START 
+#define MONT_FINI
+#define LOOP_END
+#define LOOP_START \
+   mu = c[x] * mp
+
+#define INNERMUL                                      \
+   do { fp_word t;                                    \
+   _c[0] = t  = ((fp_word)_c[0] + (fp_word)cy) +      \
+                (((fp_word)mu) * ((fp_word)*tmpm++)); \
+   cy = (t >> DIGIT_BIT);                             \
+   } while (0)
+
+#define PROPCARRY \
+   do { fp_digit t = _c[0] += cy; cy = (t < cy); } while (0)
+
+#endif
+/******************************************************************/
+
+
+#define LO  0
+/* end fp_montogomery_reduce.c asm */
+
+
+/* start fp_sqr_comba.c asm */
+#if defined(TFM_X86)
+
+/* x86-32 optimized */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+#define SQRADD(i, j)                                      \
+asm(                                            \
+     "movl  %6,%%eax     \n\t"                            \
+     "mull  %%eax        \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
+
+#define SQRADD2(i, j)                                     \
+asm(                                            \
+     "movl  %6,%%eax     \n\t"                            \
+     "mull  %7           \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx", "%cc");
+
+#define SQRADDSC(i, j)                                    \
+asm(                                                     \
+     "movl  %3,%%eax     \n\t"                            \
+     "mull  %4           \n\t"                            \
+     "movl  %%eax,%0     \n\t"                            \
+     "movl  %%edx,%1     \n\t"                            \
+     "xorl  %2,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","%cc");
+
+/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
+
+#define SQRADDAC(i, j)                                    \
+asm(                                                     \
+     "movl  %6,%%eax     \n\t"                            \
+     "mull  %7           \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","%cc");
+
+#define SQRADDDB                                          \
+asm(                                                     \
+     "addl %6,%0         \n\t"                            \
+     "adcl %7,%1         \n\t"                            \
+     "adcl %8,%2         \n\t"                            \
+     "addl %6,%0         \n\t"                            \
+     "adcl %7,%1         \n\t"                            \
+     "adcl %8,%2         \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
+
+#elif defined(TFM_X86_64)
+/* x86-64 optimized */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+#define SQRADD(i, j)                                      \
+asm(                                                     \
+     "movq  %6,%%rax     \n\t"                            \
+     "mulq  %%rax        \n\t"                            \
+     "addq  %%rax,%0     \n\t"                            \
+     "adcq  %%rdx,%1     \n\t"                            \
+     "adcq  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i) :"%rax","%rdx","%cc");
+
+#define SQRADD2(i, j)                                     \
+asm(                                                     \
+     "movq  %6,%%rax     \n\t"                            \
+     "mulq  %7           \n\t"                            \
+     "addq  %%rax,%0     \n\t"                            \
+     "adcq  %%rdx,%1     \n\t"                            \
+     "adcq  $0,%2        \n\t"                            \
+     "addq  %%rax,%0     \n\t"                            \
+     "adcq  %%rdx,%1     \n\t"                            \
+     "adcq  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
+
+#define SQRADDSC(i, j)                                    \
+asm(                                                     \
+     "movq  %3,%%rax     \n\t"                            \
+     "mulq  %4           \n\t"                            \
+     "movq  %%rax,%0     \n\t"                            \
+     "movq  %%rdx,%1     \n\t"                            \
+     "xorq  %2,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%rax","%rdx","%cc");
+
+/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
+
+#define SQRADDAC(i, j)                                                         \
+asm(                                                     \
+     "movq  %6,%%rax     \n\t"                            \
+     "mulq  %7           \n\t"                            \
+     "addq  %%rax,%0     \n\t"                            \
+     "adcq  %%rdx,%1     \n\t"                            \
+     "adcq  $0,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%rax","%rdx","%cc");
+
+#define SQRADDDB                                          \
+asm(                                                     \
+     "addq %6,%0         \n\t"                            \
+     "adcq %7,%1         \n\t"                            \
+     "adcq %8,%2         \n\t"                            \
+     "addq %6,%0         \n\t"                            \
+     "adcq %7,%1         \n\t"                            \
+     "adcq %8,%2         \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
+
+#elif defined(TFM_SSE2)
+
+/* SSE2 Optimized */
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI \
+   asm("emms");
+
+#define SQRADD(i, j)                                      \
+asm(                                            \
+     "movd  %6,%%mm0     \n\t"                            \
+     "pmuludq %%mm0,%%mm0\n\t"                            \
+     "movd  %%mm0,%%eax  \n\t"                            \
+     "psrlq $32,%%mm0    \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "movd  %%mm0,%%eax  \n\t"                            \
+     "adcl  %%eax,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%cc");
+
+#define SQRADD2(i, j)                                     \
+asm(                                            \
+     "movd  %6,%%mm0     \n\t"                            \
+     "movd  %7,%%mm1     \n\t"                            \
+     "pmuludq %%mm1,%%mm0\n\t"                            \
+     "movd  %%mm0,%%eax  \n\t"                            \
+     "psrlq $32,%%mm0    \n\t"                            \
+     "movd  %%mm0,%%edx  \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
+
+#define SQRADDSC(i, j)                                                         \
+asm(                                            \
+     "movd  %3,%%mm0     \n\t"                            \
+     "movd  %4,%%mm1     \n\t"                            \
+     "pmuludq %%mm1,%%mm0\n\t"                            \
+     "movd  %%mm0,%0     \n\t"                            \
+     "psrlq $32,%%mm0    \n\t"                            \
+     "movd  %%mm0,%1     \n\t"                            \
+     "xorl  %2,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "m"(i), "m"(j));
+
+/* TAO removed sc0,1,2 as input to remove warning so %6,%7 become %3,%4 */
+
+#define SQRADDAC(i, j)                                                         \
+asm(                                            \
+     "movd  %6,%%mm0     \n\t"                            \
+     "movd  %7,%%mm1     \n\t"                            \
+     "pmuludq %%mm1,%%mm0\n\t"                            \
+     "movd  %%mm0,%%eax  \n\t"                            \
+     "psrlq $32,%%mm0    \n\t"                            \
+     "movd  %%mm0,%%edx  \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
+
+#define SQRADDDB                                          \
+asm(                                                     \
+     "addl %6,%0         \n\t"                            \
+     "adcl %7,%1         \n\t"                            \
+     "adcl %8,%2         \n\t"                            \
+     "addl %6,%0         \n\t"                            \
+     "adcl %7,%1         \n\t"                            \
+     "adcl %8,%2         \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "%cc");
+
+#elif defined(TFM_ARM)
+
+/* ARM code */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+/* multiplies point i and j, updates carry "c1" and digit c2 */
+#define SQRADD(i, j)                                             \
+asm(                                                             \
+"  UMULL  r0,r1,%6,%6              \n\t"                         \
+"  ADDS   %0,%0,r0                 \n\t"                         \
+"  ADCS   %1,%1,r1                 \n\t"                         \
+"  ADC    %2,%2,#0                 \n\t"                         \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i) : "r0", "r1", "%cc");
+       
+/* for squaring some of the terms are doubled... */
+#define SQRADD2(i, j)                                            \
+asm(                                                             \
+"  UMULL  r0,r1,%6,%7              \n\t"                         \
+"  ADDS   %0,%0,r0                 \n\t"                         \
+"  ADCS   %1,%1,r1                 \n\t"                         \
+"  ADC    %2,%2,#0                 \n\t"                         \
+"  ADDS   %0,%0,r0                 \n\t"                         \
+"  ADCS   %1,%1,r1                 \n\t"                         \
+"  ADC    %2,%2,#0                 \n\t"                         \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
+
+#define SQRADDSC(i, j)                                           \
+asm(                                                             \
+"  UMULL  %0,%1,%6,%7              \n\t"                         \
+"  SUB    %2,%2,%2                 \n\t"                         \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "%cc");
+
+#define SQRADDAC(i, j)                                           \
+asm(                                                             \
+"  UMULL  r0,r1,%6,%7              \n\t"                         \
+"  ADDS   %0,%0,r0                 \n\t"                         \
+"  ADCS   %1,%1,r1                 \n\t"                         \
+"  ADC    %2,%2,#0                 \n\t"                         \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2) : "0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j) : "r0", "r1", "%cc");
+
+#define SQRADDDB                                                 \
+asm(                                                             \
+"  ADDS  %0,%0,%3                     \n\t"                      \
+"  ADCS  %1,%1,%4                     \n\t"                      \
+"  ADC   %2,%2,%5                     \n\t"                      \
+"  ADDS  %0,%0,%3                     \n\t"                      \
+"  ADCS  %1,%1,%4                     \n\t"                      \
+"  ADC   %2,%2,%5                     \n\t"                      \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
+
+#elif defined(TFM_PPC32)
+
+/* PPC32 */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+/* multiplies point i and j, updates carry "c1" and digit c2 */
+#define SQRADD(i, j)             \
+asm(                             \
+   " mullw  16,%6,%6       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhwu 16,%6,%6       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
+
+/* for squaring some of the terms are doubled... */
+#define SQRADD2(i, j)            \
+asm(                             \
+   " mullw  16,%6,%7       \n\t" \
+   " mulhwu 17,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " adde   %1,%1,17       \n\t" \
+   " addze  %2,%2          \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " adde   %1,%1,17       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
+
+#define SQRADDSC(i, j)            \
+asm(                              \
+   " mullw  %0,%6,%7        \n\t" \
+   " mulhwu %1,%6,%7        \n\t" \
+   " xor    %2,%2,%2        \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
+
+#define SQRADDAC(i, j)           \
+asm(                             \
+   " mullw  16,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhwu 16,%6,%7       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
+
+#define SQRADDDB                  \
+asm(                              \
+   " addc   %0,%0,%3        \n\t" \
+   " adde   %1,%1,%4        \n\t" \
+   " adde   %2,%2,%5        \n\t" \
+   " addc   %0,%0,%3        \n\t" \
+   " adde   %1,%1,%4        \n\t" \
+   " adde   %2,%2,%5        \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
+
+#elif defined(TFM_PPC64)
+/* PPC64 */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+/* multiplies point i and j, updates carry "c1" and digit c2 */
+#define SQRADD(i, j)             \
+asm(                             \
+   " mulld  16,%6,%6       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhdu 16,%6,%6       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"16","%cc");
+
+/* for squaring some of the terms are doubled... */
+#define SQRADD2(i, j)            \
+asm(                             \
+   " mulld  16,%6,%7       \n\t" \
+   " mulhdu 17,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " adde   %1,%1,17       \n\t" \
+   " addze  %2,%2          \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " adde   %1,%1,17       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16", "17","%cc");
+
+#define SQRADDSC(i, j)            \
+asm(                              \
+   " mulld  %0,%6,%7        \n\t" \
+   " mulhdu %1,%6,%7        \n\t" \
+   " xor    %2,%2,%2        \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "%cc");
+
+#define SQRADDAC(i, j)           \
+asm(                             \
+   " mulld  16,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhdu 16,%6,%7       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"16", "%cc");
+
+#define SQRADDDB                  \
+asm(                              \
+   " addc   %0,%0,%3        \n\t" \
+   " adde   %1,%1,%4        \n\t" \
+   " adde   %2,%2,%5        \n\t" \
+   " addc   %0,%0,%3        \n\t" \
+   " adde   %1,%1,%4        \n\t" \
+   " adde   %2,%2,%5        \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
+
+
+#elif defined(TFM_AVR32)
+
+/* AVR32 */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+/* multiplies point i and j, updates carry "c1" and digit c2 */
+#define SQRADD(i, j)             \
+asm(                             \
+   " mulu.d r2,%6,%6       \n\t" \
+   " add    %0,%0,r2       \n\t" \
+   " adc    %1,%1,r3       \n\t" \
+   " acr    %2             \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i):"r2","r3");
+
+/* for squaring some of the terms are doubled... */
+#define SQRADD2(i, j)            \
+asm(                             \
+   " mulu.d r2,%6,%7       \n\t" \
+   " add    %0,%0,r2       \n\t" \
+   " adc    %1,%1,r3       \n\t" \
+   " acr    %2,            \n\t" \
+   " add    %0,%0,r2       \n\t" \
+   " adc    %1,%1,r3       \n\t" \
+   " acr    %2,            \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"r2", "r3");
+
+#define SQRADDSC(i, j)            \
+asm(                              \
+   " mulu.d r2,%6,%7        \n\t" \
+   " mov    %0,r2           \n\t" \
+   " mov    %1,r3           \n\t" \
+   " eor    %2,%2           \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i),"r"(j) : "r2", "r3");
+
+#define SQRADDAC(i, j)           \
+asm(                             \
+   " mulu.d r2,%6,%7       \n\t" \
+   " add    %0,%0,r2       \n\t" \
+   " adc    %1,%1,r3       \n\t" \
+   " acr    %2             \n\t" \
+:"=r"(sc0), "=r"(sc1), "=r"(sc2):"0"(sc0), "1"(sc1), "2"(sc2), "r"(i), "r"(j):"r2", "r3");
+
+#define SQRADDDB                  \
+asm(                              \
+   " add    %0,%0,%3        \n\t" \
+   " adc    %1,%1,%4        \n\t" \
+   " adc    %2,%2,%5        \n\t" \
+   " add    %0,%0,%3        \n\t" \
+   " adc    %1,%1,%4        \n\t" \
+   " adc    %2,%2,%5        \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "r"(sc0), "r"(sc1), "r"(sc2), "0"(c0), "1"(c1), "2"(c2) : "%cc");
+
+
+#else
+
+#define TFM_ISO
+
+/* ISO C portable code */
+
+#define COMBA_START
+
+#define CLEAR_CARRY \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define CARRY_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_FINI
+
+/* multiplies point i and j, updates carry "c1" and digit c2 */
+#define SQRADD(i, j)                                 \
+   do { fp_word t;                                   \
+   t = c0 + ((fp_word)i) * ((fp_word)j);  c0 = t;    \
+   t = c1 + (t >> DIGIT_BIT);             c1 = t; c2 += t >> DIGIT_BIT; \
+   } while (0);
+  
+
+/* for squaring some of the terms are doubled... */
+#define SQRADD2(i, j)                                                 \
+   do { fp_word t;                                                    \
+   t  = ((fp_word)i) * ((fp_word)j);                                  \
+   tt = (fp_word)c0 + t;                 c0 = tt;                              \
+   tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT;       \
+   tt = (fp_word)c0 + t;                 c0 = tt;                              \
+   tt = (fp_word)c1 + (tt >> DIGIT_BIT); c1 = tt; c2 += tt >> DIGIT_BIT;       \
+   } while (0);
+
+#define SQRADDSC(i, j)                                                         \
+   do { fp_word t;                                                             \
+      t =  ((fp_word)i) * ((fp_word)j);                                        \
+      sc0 = (fp_digit)t; sc1 = (t >> DIGIT_BIT); sc2 = 0;                      \
+   } while (0);
+
+#define SQRADDAC(i, j)                                                         \
+   do { fp_word t;                                                             \
+   t = sc0 + ((fp_word)i) * ((fp_word)j);  sc0 = t;                            \
+   t = sc1 + (t >> DIGIT_BIT);             sc1 = t; sc2 += t >> DIGIT_BIT;     \
+   } while (0);
+
+#define SQRADDDB                                                               \
+   do { fp_word t;                                                             \
+   t = ((fp_word)sc0) + ((fp_word)sc0) + c0; c0 = t;                                                 \
+   t = ((fp_word)sc1) + ((fp_word)sc1) + c1 + (t >> DIGIT_BIT); c1 = t;                              \
+   c2 = c2 + ((fp_word)sc2) + ((fp_word)sc2) + (t >> DIGIT_BIT);                                     \
+   } while (0);
+
+#endif
+
+#ifdef TFM_SMALL_SET
+#include "fp_sqr_comba_small_set.i"
+#include "fp_sqr_comba_3.i"
+#include "fp_sqr_comba_4.i"
+#include "fp_sqr_comba_6.i"
+#include "fp_sqr_comba_7.i"
+#include "fp_sqr_comba_8.i"
+#include "fp_sqr_comba_9.i"
+#include "fp_sqr_comba_12.i"
+#include "fp_sqr_comba_17.i"
+#include "fp_sqr_comba_20.i"
+#include "fp_sqr_comba_24.i"
+#include "fp_sqr_comba_28.i"
+#include "fp_sqr_comba_32.i"
+#include "fp_sqr_comba_48.i"
+#include "fp_sqr_comba_64.i"
+#endif
+/* end fp_sqr_comba.c asm */
+
+/* start fp_mul_comba.c asm */
+/* these are the combas.  Worship them. */
+#if defined(TFM_X86)
+/* Generic x86 optimized code */
+
+/* anything you need at the start */
+#define COMBA_START
+
+/* clear the chaining variables */
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+/* forward the carry to the next digit */
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+/* store the first sum */
+#define COMBA_STORE(x) \
+   x = c0;
+
+/* store the second sum [carry] */
+#define COMBA_STORE2(x) \
+   x = c1;
+
+/* anything you need at the end */
+#define COMBA_FINI
+
+/* this should multiply i and j  */
+#define MULADD(i, j)                                      \
+asm(                                                      \
+     "movl  %6,%%eax     \n\t"                            \
+     "mull  %7           \n\t"                            \
+     "addl  %%eax,%0     \n\t"                            \
+     "adcl  %%edx,%1     \n\t"                            \
+     "adcl  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","%cc");
+
+#elif defined(TFM_X86_64)
+/* x86-64 optimized */
+
+/* anything you need at the start */
+#define COMBA_START
+
+/* clear the chaining variables */
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+/* forward the carry to the next digit */
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+/* store the first sum */
+#define COMBA_STORE(x) \
+   x = c0;
+
+/* store the second sum [carry] */
+#define COMBA_STORE2(x) \
+   x = c1;
+
+/* anything you need at the end */
+#define COMBA_FINI
+
+/* this should multiply i and j  */
+#define MULADD(i, j)                                      \
+asm  (                                                    \
+     "movq  %6,%%rax     \n\t"                            \
+     "mulq  %7           \n\t"                            \
+     "addq  %%rax,%0     \n\t"                            \
+     "adcq  %%rdx,%1     \n\t"                            \
+     "adcq  $0,%2        \n\t"                            \
+     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j)  :"%rax","%rdx","%cc");
+
+#elif defined(TFM_SSE2)
+/* use SSE2 optimizations */
+
+/* anything you need at the start */
+#define COMBA_START
+
+/* clear the chaining variables */
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+/* forward the carry to the next digit */
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+/* store the first sum */
+#define COMBA_STORE(x) \
+   x = c0;
+
+/* store the second sum [carry] */
+#define COMBA_STORE2(x) \
+   x = c1;
+
+/* anything you need at the end */
+#define COMBA_FINI \
+   asm("emms");
+
+/* this should multiply i and j  */
+#define MULADD(i, j)                                     \
+asm(                                                     \
+    "movd  %6,%%mm0     \n\t"                            \
+    "movd  %7,%%mm1     \n\t"                            \
+    "pmuludq %%mm1,%%mm0\n\t"                            \
+    "movd  %%mm0,%%eax  \n\t"                            \
+    "psrlq $32,%%mm0    \n\t"                            \
+    "addl  %%eax,%0     \n\t"                            \
+    "movd  %%mm0,%%eax  \n\t"                            \
+    "adcl  %%eax,%1     \n\t"                            \
+    "adcl  $0,%2        \n\t"                            \
+    :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%cc");
+
+#elif defined(TFM_ARM)
+/* ARM code */
+
+#define COMBA_START 
+
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define COMBA_FINI
+
+#define MULADD(i, j)                                          \
+asm(                                                          \
+"  UMULL  r0,r1,%6,%7           \n\t"                         \
+"  ADDS   %0,%0,r0              \n\t"                         \
+"  ADCS   %1,%1,r1              \n\t"                         \
+"  ADC    %2,%2,#0              \n\t"                         \
+:"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j) : "r0", "r1", "%cc");
+
+#elif defined(TFM_PPC32)
+/* For 32-bit PPC */
+
+#define COMBA_START
+
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define COMBA_FINI 
+   
+/* untested: will mulhwu change the flags?  Docs say no */
+#define MULADD(i, j)              \
+asm(                              \
+   " mullw  16,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhwu 16,%6,%7       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16");
+
+#elif defined(TFM_PPC64)
+/* For 64-bit PPC */
+
+#define COMBA_START
+
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define COMBA_FINI 
+   
+/* untested: will mulhwu change the flags?  Docs say no */
+#define MULADD(i, j)              \
+asm(                              \
+   " mulld  16,%6,%7       \n\t" \
+   " addc   %0,%0,16       \n\t" \
+   " mulhdu 16,%6,%7       \n\t" \
+   " adde   %1,%1,16       \n\t" \
+   " addze  %2,%2          \n\t" \
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"16");
+
+#elif defined(TFM_AVR32)
+
+/* ISO C code */
+
+#define COMBA_START
+
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define COMBA_FINI 
+   
+#define MULADD(i, j)             \
+asm(                             \
+   " mulu.d r2,%6,%7        \n\t"\
+   " add    %0,r2           \n\t"\
+   " adc    %1,%1,r3        \n\t"\
+   " acr    %2              \n\t"\
+:"=r"(c0), "=r"(c1), "=r"(c2):"0"(c0), "1"(c1), "2"(c2), "r"(i), "r"(j):"r2","r3");
+
+#else
+/* ISO C code */
+
+#define COMBA_START
+
+#define COMBA_CLEAR \
+   c0 = c1 = c2 = 0;
+
+#define COMBA_FORWARD \
+   do { c0 = c1; c1 = c2; c2 = 0; } while (0);
+
+#define COMBA_STORE(x) \
+   x = c0;
+
+#define COMBA_STORE2(x) \
+   x = c1;
+
+#define COMBA_FINI 
+   
+#define MULADD(i, j)                                                              \
+   do { fp_word t;                                                                \
+   t = (fp_word)c0 + ((fp_word)i) * ((fp_word)j); c0 = t;                         \
+   t = (fp_word)c1 + (t >> DIGIT_BIT);            c1 = t; c2 += t >> DIGIT_BIT;   \
+   } while (0);
+
+#endif
+
+
+#ifdef TFM_SMALL_SET
+#include "fp_mul_comba_small_set.i"
+#include "fp_mul_comba_3.i"
+#include "fp_mul_comba_4.i"
+#include "fp_mul_comba_6.i"
+#include "fp_mul_comba_7.i"
+#include "fp_mul_comba_8.i"
+#include "fp_mul_comba_9.i"
+#include "fp_mul_comba_12.i"
+#include "fp_mul_comba_17.i"
+#include "fp_mul_comba_20.i"
+#include "fp_mul_comba_24.i"
+#include "fp_mul_comba_28.i"
+#include "fp_mul_comba_32.i"
+#include "fp_mul_comba_48.i"
+#include "fp_mul_comba_64.i"
+#endif
+
+/* end fp_mul_comba.c asm */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asn.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/asn.c
new file mode 100644 (file)
index 0000000..87ece4b
--- /dev/null
@@ -0,0 +1,5126 @@
+/* asn.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef THREADX
+    #include "os.h"           /* dc_rtc_api needs    */
+    #include "dc_rtc_api.h"   /* to get current time */
+#endif
+
+#include <cyassl/ctaocrypt/asn.h>
+#include <cyassl/ctaocrypt/coding.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/md2.h>
+#include <cyassl/ctaocrypt/error.h>
+#include <cyassl/ctaocrypt/pwdbased.h>
+#include <cyassl/ctaocrypt/des3.h>
+#include <cyassl/ctaocrypt/sha256.h>
+#include <cyassl/ctaocrypt/sha512.h>
+#include <cyassl/ctaocrypt/logging.h>
+#include <cyassl/ctaocrypt/random.h>
+
+#ifdef HAVE_NTRU
+    #include "crypto_ntru.h"
+#endif
+
+#ifdef HAVE_ECC
+    #include <cyassl/ctaocrypt/ecc.h>
+#endif
+
+
+#ifdef _MSC_VER
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */
+    #pragma warning(disable: 4996)
+#endif
+
+
+#ifndef TRUE
+enum {
+    FALSE = 0,
+    TRUE  = 1
+};
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+#ifdef THREADX
+    /* uses parital <time.h> structures */
+    #define XTIME(tl)  (0)
+    #define XGMTIME(c) my_gmtime((c))
+    #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
+#elif defined(MICRIUM)
+    #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+        #define XVALIDATE_DATE(d,f,t) NetSecure_ValidateDateHandler((d),(f),(t))
+    #else
+        #define XVALIDATE_DATE(d, f, t) (0)
+    #endif
+    #define NO_TIME_H
+    /* since Micrium not defining XTIME or XGMTIME, CERT_GEN not available */
+#elif defined(USER_TIME)
+    /* no <time.h> structures used */
+    #define NO_TIME_H
+    /* user time, and gmtime compatible functions, there is a gmtime 
+       implementation here that WINCE uses, so really just need some ticks
+       since the EPOCH 
+    */
+#else
+    /* default */
+    /* uses complete <time.h> facility */
+    #include <time.h> 
+    #define XTIME(tl)  time((tl))
+    #define XGMTIME(c) gmtime((c))
+    #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
+#endif
+
+
+#ifdef _WIN32_WCE
+/* no time() or gmtime() even though in time.h header?? */
+
+#include <windows.h>
+
+
+time_t time(time_t* timer)
+{
+    SYSTEMTIME     sysTime;
+    FILETIME       fTime;
+    ULARGE_INTEGER intTime;
+    time_t         localTime;
+
+    if (timer == NULL)
+        timer = &localTime;
+
+    GetSystemTime(&sysTime);
+    SystemTimeToFileTime(&sysTime, &fTime);
+    
+    XMEMCPY(&intTime, &fTime, sizeof(FILETIME));
+    /* subtract EPOCH */
+    intTime.QuadPart -= 0x19db1ded53e8000;
+    /* to secs */
+    intTime.QuadPart /= 10000000;
+    *timer = (time_t)intTime.QuadPart;
+
+    return *timer;
+}
+
+
+
+struct tm* gmtime(const time_t* timer)
+{
+    #define YEAR0          1900
+    #define EPOCH_YEAR     1970
+    #define SECS_DAY       (24L * 60L * 60L)
+    #define LEAPYEAR(year) (!((year) % 4) && (((year) % 100) || !((year) %400)))
+    #define YEARSIZE(year) (LEAPYEAR(year) ? 366 : 365)
+
+    static const int _ytab[2][12] =
+    {
+        {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+        {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
+    };
+
+    static struct tm st_time;
+    struct tm* ret = &st_time;
+    time_t time = *timer;
+    unsigned long dayclock, dayno;
+    int year = EPOCH_YEAR;
+
+    dayclock = (unsigned long)time % SECS_DAY;
+    dayno    = (unsigned long)time / SECS_DAY;
+
+    ret->tm_sec  =  dayclock % 60;
+    ret->tm_min  = (dayclock % 3600) / 60;
+    ret->tm_hour =  dayclock / 3600;
+    ret->tm_wday = (dayno + 4) % 7;        /* day 0 a Thursday */
+
+    while(dayno >= (unsigned long)YEARSIZE(year)) {
+        dayno -= YEARSIZE(year);
+        year++;
+    }
+
+    ret->tm_year = year - YEAR0;
+    ret->tm_yday = dayno;
+    ret->tm_mon  = 0;
+
+    while(dayno >= (unsigned long)_ytab[LEAPYEAR(year)][ret->tm_mon]) {
+        dayno -= _ytab[LEAPYEAR(year)][ret->tm_mon];
+        ret->tm_mon++;
+    }
+
+    ret->tm_mday  = ++dayno;
+    ret->tm_isdst = 0;
+
+    return ret;
+}
+
+#endif /* _WIN32_WCE */
+
+
+#ifdef  THREADX
+
+#define YEAR0          1900
+
+struct tm* my_gmtime(const time_t* timer)       /* has a gmtime() but hangs */
+{
+    static struct tm st_time;
+    struct tm* ret = &st_time;
+
+    DC_RTC_CALENDAR cal;
+    dc_rtc_time_get(&cal, TRUE);
+
+    ret->tm_year  = cal.year - YEAR0;       /* gm starts at 1900 */
+    ret->tm_mon   = cal.month - 1;          /* gm starts at 0 */
+    ret->tm_mday  = cal.day;
+    ret->tm_hour  = cal.hour;
+    ret->tm_min   = cal.minute;
+    ret->tm_sec   = cal.second;
+
+    return ret;
+}
+
+#endif /* THREADX */
+
+
+static INLINE word32 btoi(byte b)
+{
+    return b - 0x30;
+}
+
+
+/* two byte date/time, add to value */
+static INLINE void GetTime(int* value, const byte* date, int* idx)
+{
+    int i = *idx;
+
+    *value += btoi(date[i++]) * 10;
+    *value += btoi(date[i++]);
+
+    *idx = i;
+}
+
+
+#if defined(MICRIUM)
+
+CPU_INT32S NetSecure_ValidateDateHandler(CPU_INT08U *date, CPU_INT08U format,
+                                         CPU_INT08U dateType)
+{
+    CPU_BOOLEAN  rtn_code;
+    CPU_INT32S   i;
+    CPU_INT32S   val;    
+    CPU_INT16U   year;
+    CPU_INT08U   month;
+    CPU_INT16U   day;
+    CPU_INT08U   hour;
+    CPU_INT08U   min;
+    CPU_INT08U   sec;
+
+    i    = 0;
+    year = 0u;
+
+    if (format == ASN_UTC_TIME) {
+        if (btoi(date[0]) >= 5)
+            year = 1900;
+        else
+            year = 2000;
+    }
+    else  { /* format == GENERALIZED_TIME */
+        year += btoi(date[i++]) * 1000;
+        year += btoi(date[i++]) * 100;
+    }    
+
+    val = year;
+    GetTime(&val, date, &i);
+    year = (CPU_INT16U)val;
+
+    val = 0;
+    GetTime(&val, date, &i);   
+    month = (CPU_INT08U)val;   
+
+    val = 0;
+    GetTime(&val, date, &i);  
+    day = (CPU_INT16U)val;
+
+    val = 0;
+    GetTime(&val, date, &i);  
+    hour = (CPU_INT08U)val;
+
+    val = 0;
+    GetTime(&val, date, &i);  
+    min = (CPU_INT08U)val;
+
+    val = 0;
+    GetTime(&val, date, &i);  
+    sec = (CPU_INT08U)val;
+
+    return NetSecure_ValidateDate(year, month, day, hour, min, sec, dateType); 
+}
+
+#endif /* MICRIUM */
+
+
+static int GetLength(const byte* input, word32* inOutIdx, int* len,
+                     word32 maxIdx)
+{
+    int     length = 0;
+    word32  i = *inOutIdx;
+    byte    b;
+
+    if ( (i+1) > maxIdx) {   /* for first read */
+        CYASSL_MSG("GetLength bad index on input");
+        return BUFFER_E;
+    }
+
+    b = input[i++];
+    if (b >= ASN_LONG_LENGTH) {        
+        word32 bytes = b & 0x7F;
+
+        if ( (i+bytes) > maxIdx) {   /* for reading bytes */
+            CYASSL_MSG("GetLength bad long length");
+            return BUFFER_E;
+        }
+
+        while (bytes--) {
+            b = input[i++];
+            length = (length << 8) | b;
+        }
+    }
+    else
+        length = b;
+    
+    if ( (i+length) > maxIdx) {   /* for user of length */
+        CYASSL_MSG("GetLength value exceeds buffer length");
+        return BUFFER_E;
+    }
+
+    *inOutIdx = i;
+    *len      = length;
+
+    return length;
+}
+
+
+static int GetSequence(const byte* input, word32* inOutIdx, int* len,
+                       word32 maxIdx)
+{
+    int    length = -1;
+    word32 idx    = *inOutIdx;
+
+    if (input[idx++] != (ASN_SEQUENCE | ASN_CONSTRUCTED) ||
+            GetLength(input, &idx, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    *len      = length;
+    *inOutIdx = idx;
+
+    return length;
+}
+
+
+static int GetSet(const byte* input, word32* inOutIdx, int* len, word32 maxIdx)
+{
+    int    length = -1;
+    word32 idx    = *inOutIdx;
+
+    if (input[idx++] != (ASN_SET | ASN_CONSTRUCTED) ||
+            GetLength(input, &idx, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    *len      = length;
+    *inOutIdx = idx;
+
+    return length;
+}
+
+
+/* winodws header clash for WinCE using GetVersion */
+static int GetMyVersion(const byte* input, word32* inOutIdx, int* version)
+{
+    word32 idx = *inOutIdx;
+
+    CYASSL_ENTER("GetMyVersion");
+
+    if (input[idx++] != ASN_INTEGER)
+        return ASN_PARSE_E;
+
+    if (input[idx++] != 0x01)
+        return ASN_VERSION_E;
+
+    *version  = input[idx++];
+    *inOutIdx = idx;
+
+    return *version;
+}
+
+
+/* Get small count integer, 32 bits or less */
+static int GetShortInt(const byte* input, word32* inOutIdx, int* number)
+{
+    word32 idx = *inOutIdx;
+    word32 len;
+
+    *number = 0;
+
+    if (input[idx++] != ASN_INTEGER)
+        return ASN_PARSE_E;
+
+    len = input[idx++];
+    if (len > 4)
+        return ASN_PARSE_E;
+
+    while (len--) {
+        *number  = *number << 8 | input[idx++];
+    }
+
+    *inOutIdx = idx;
+
+    return *number;
+}
+
+
+/* May not have one, not an error */
+static int GetExplicitVersion(const byte* input, word32* inOutIdx, int* version)
+{
+    word32 idx = *inOutIdx;
+
+    CYASSL_ENTER("GetExplicitVersion");
+    if (input[idx++] == (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED)) {
+        *inOutIdx = ++idx;  /* eat header */
+        return GetMyVersion(input, inOutIdx, version);
+    }
+
+    /* go back as is */
+    *version = 0;
+
+    return 0;
+}
+
+
+static int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
+                  word32 maxIdx)
+{
+    word32 i = *inOutIdx;
+    byte   b = input[i++];
+    int    length;
+
+    if (b != ASN_INTEGER)
+        return ASN_PARSE_E;
+
+    if (GetLength(input, &i, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if ( (b = input[i++]) == 0x00)
+        length--;
+    else
+        i--;
+
+    mp_init(mpi); 
+    if (mp_read_unsigned_bin(mpi, (byte*)input + i, length) != 0) {
+        mp_clear(mpi);
+        return ASN_GETINT_E;
+    }
+
+    *inOutIdx = i + length;
+    return 0;
+}
+
+
+static int GetObjectId(const byte* input, word32* inOutIdx, word32* oid,
+                     word32 maxIdx)
+{
+    int    length;
+    word32 i = *inOutIdx;
+    byte   b;
+    *oid = 0;
+    
+    b = input[i++];
+    if (b != ASN_OBJECT_ID) 
+        return ASN_OBJECT_ID_E;
+    
+    if (GetLength(input, &i, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+    
+    while(length--)
+        *oid += input[i++];
+    /* just sum it up for now */
+    
+    *inOutIdx = i;
+    
+    return 0;
+}
+
+
+static int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid,
+                     word32 maxIdx)
+{
+    int    length;
+    word32 i = *inOutIdx;
+    byte   b;
+    *oid = 0;
+   
+    CYASSL_ENTER("GetAlgoId");
+
+    if (GetSequence(input, &i, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+    
+    b = input[i++];
+    if (b != ASN_OBJECT_ID) 
+        return ASN_OBJECT_ID_E;
+    
+    if (GetLength(input, &i, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+    
+    while(length--)
+        *oid += input[i++];
+    /* just sum it up for now */
+    
+    /* could have NULL tag and 0 terminator, but may not */
+    b = input[i++];
+    
+    if (b == ASN_TAG_NULL) {
+        b = input[i++];
+        if (b != 0) 
+            return ASN_EXPECT_0_E;
+    }
+    else
+    /* go back, didn't have it */
+        i--;
+    
+    *inOutIdx = i;
+    
+    return 0;
+}
+
+
+int RsaPrivateKeyDecode(const byte* input, word32* inOutIdx, RsaKey* key,
+                        word32 inSz)
+{
+    int    version, length;
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetMyVersion(input, inOutIdx, &version) < 0)
+        return ASN_PARSE_E;
+
+    key->type = RSA_PRIVATE;
+
+    if (GetInt(&key->n,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->e,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->d,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->p,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->q,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->dP, input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->dQ, input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->u,  input, inOutIdx, inSz) < 0 )  return ASN_RSA_KEY_E;
+
+    return 0;
+}
+
+
+/* Remove PKCS8 header, move beginning of traditional to beginning of input */
+int ToTraditional(byte* input, word32 sz)
+{
+    word32 inOutIdx = 0, oid;
+    int    version, length;
+
+    if (GetSequence(input, &inOutIdx, &length, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetMyVersion(input, &inOutIdx, &version) < 0)
+        return ASN_PARSE_E;
+    
+    if (GetAlgoId(input, &inOutIdx, &oid, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (input[inOutIdx] == ASN_OBJECT_ID) {
+        /* pkcs8 ecc uses slightly different format */
+        inOutIdx++;  /* past id */
+        if (GetLength(input, &inOutIdx, &length, sz) < 0)
+            return ASN_PARSE_E;
+        inOutIdx += length;  /* over sub id, key input will verify */
+    }
+    
+    if (input[inOutIdx++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+    
+    if (GetLength(input, &inOutIdx, &length, sz) < 0)
+        return ASN_PARSE_E;
+    
+    XMEMMOVE(input, input + inOutIdx, length);
+
+    return 0;
+}
+
+
+#ifndef NO_PWDBASED
+
+/* Check To see if PKCS version algo is supported, set id if it is return 0
+   < 0 on error */
+static int CheckAlgo(int first, int second, int* id, int* version)
+{
+    *id      = ALGO_ID_E;
+    *version = PKCS5;   /* default */
+
+    if (first == 1) {
+        switch (second) {
+        case 1:
+            *id = PBE_SHA1_RC4_128;
+            *version = PKCS12;
+            return 0;
+        case 3:
+            *id = PBE_SHA1_DES3;
+            *version = PKCS12;
+            return 0;
+        default:
+            return ALGO_ID_E;
+        }
+    }
+
+    if (first != PKCS5)
+        return ASN_INPUT_E;  /* VERSION ERROR */
+
+    if (second == PBES2) {
+        *version = PKCS5v2;
+        return 0;
+    }
+
+    switch (second) {
+    case 3:                   /* see RFC 2898 for ids */
+        *id = PBE_MD5_DES;
+        return 0;
+    case 10:
+        *id = PBE_SHA1_DES;
+        return 0;
+    default:
+        return ALGO_ID_E;
+
+    }
+}
+
+
+/* Check To see if PKCS v2 algo is supported, set id if it is return 0
+   < 0 on error */
+static int CheckAlgoV2(int oid, int* id)
+{
+    switch (oid) {
+    case 69:
+        *id = PBE_SHA1_DES;
+        return 0;
+    case 652:
+        *id = PBE_SHA1_DES3;
+        return 0;
+    default:
+        return ALGO_ID_E;
+
+    }
+}
+
+
+/* Decrypt intput in place from parameters based on id */
+static int DecryptKey(const char* password, int passwordSz, byte* salt,
+                      int saltSz, int iterations, int id, byte* input,
+                      int length, int version, byte* cbcIv)
+{
+    byte   key[MAX_KEY_SIZE];
+    int    typeH;
+    int    derivedLen;
+    int    decryptionType;
+    int    ret = 0; 
+
+    switch (id) {
+        case PBE_MD5_DES:
+            typeH = MD5;
+            derivedLen = 16;           /* may need iv for v1.5 */
+            decryptionType = DES_TYPE;
+            break;
+
+        case PBE_SHA1_DES:
+            typeH = SHA;
+            derivedLen = 16;           /* may need iv for v1.5 */
+            decryptionType = DES_TYPE;
+            break;
+
+        case PBE_SHA1_DES3:
+            typeH = SHA;
+            derivedLen = 32;           /* may need iv for v1.5 */
+            decryptionType = DES3_TYPE;
+            break;
+
+        case PBE_SHA1_RC4_128:
+            typeH = SHA;
+            derivedLen = 16;
+            decryptionType = RC4_TYPE;
+            break;
+
+        default:
+            return ALGO_ID_E;
+    }
+
+    if (version == PKCS5v2)
+        ret = PBKDF2(key, (byte*)password, passwordSz, salt, saltSz, iterations,
+               derivedLen, typeH);
+    else if (version == PKCS5)
+        ret = PBKDF1(key, (byte*)password, passwordSz, salt, saltSz, iterations,
+               derivedLen, typeH);
+    else if (version == PKCS12) {
+        int  i, idx = 0;
+        byte unicodePasswd[MAX_UNICODE_SZ];
+
+        if ( (passwordSz * 2 + 2) > (int)sizeof(unicodePasswd))
+            return UNICODE_SIZE_E; 
+
+        for (i = 0; i < passwordSz; i++) {
+            unicodePasswd[idx++] = 0x00;
+            unicodePasswd[idx++] = (byte)password[i];
+        }
+        /* add trailing NULL */
+        unicodePasswd[idx++] = 0x00;
+        unicodePasswd[idx++] = 0x00;
+
+        ret =  PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz,
+                            iterations, derivedLen, typeH, 1);
+        if (decryptionType != RC4_TYPE)
+            ret += PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, saltSz,
+                                iterations, 8, typeH, 2);
+    }
+
+    if (ret != 0)
+        return ret;
+
+    switch (decryptionType) {
+#ifndef NO_DES3
+        case DES_TYPE:
+        {
+            Des    dec;
+            byte*  desIv = key + 8;
+
+            if (version == PKCS5v2 || version == PKCS12)
+                desIv = cbcIv;
+            Des_SetKey(&dec, key, desIv, DES_DECRYPTION);
+            Des_CbcDecrypt(&dec, input, input, length);
+            break;
+        }
+
+        case DES3_TYPE:
+        {
+            Des3   dec;
+            byte*  desIv = key + 24;
+
+            if (version == PKCS5v2 || version == PKCS12)
+                desIv = cbcIv;
+            Des3_SetKey(&dec, key, desIv, DES_DECRYPTION);
+            Des3_CbcDecrypt(&dec, input, input, length);
+            break;
+        }
+#endif
+        case RC4_TYPE:
+        {
+            Arc4    dec;
+
+            Arc4SetKey(&dec, key, derivedLen);
+            Arc4Process(&dec, input, input, length);
+            break;
+        }
+
+        default:
+            return ALGO_ID_E; 
+    }
+
+    return 0;
+}
+
+
+/* Remove Encrypted PKCS8 header, move beginning of traditional to beginning
+   of input */
+int ToTraditionalEnc(byte* input, word32 sz,const char* password,int passwordSz)
+{
+    word32 inOutIdx = 0, oid;
+    int    first, second, length, iterations, saltSz, id;
+    int    version;
+    byte   salt[MAX_SALT_SIZE];
+    byte   cbcIv[MAX_IV_SIZE];
+    
+    if (GetSequence(input, &inOutIdx, &length, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetAlgoId(input, &inOutIdx, &oid, sz) < 0)
+        return ASN_PARSE_E;
+    
+    first  = input[inOutIdx - 2];   /* PKCS version alwyas 2nd to last byte */
+    second = input[inOutIdx - 1];   /* version.algo, algo id last byte */
+
+    if (CheckAlgo(first, second, &id, &version) < 0)
+        return ASN_INPUT_E;  /* Algo ID error */
+
+    if (version == PKCS5v2) {
+
+        if (GetSequence(input, &inOutIdx, &length, sz) < 0)
+            return ASN_PARSE_E;
+
+        if (GetAlgoId(input, &inOutIdx, &oid, sz) < 0)
+            return ASN_PARSE_E;
+
+        if (oid != PBKDF2_OID)
+            return ASN_PARSE_E;
+    }
+
+    if (GetSequence(input, &inOutIdx, &length, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (input[inOutIdx++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+    
+    if (GetLength(input, &inOutIdx, &saltSz, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (saltSz > MAX_SALT_SIZE)
+        return ASN_PARSE_E;
+     
+    XMEMCPY(salt, &input[inOutIdx], saltSz);
+    inOutIdx += saltSz;
+
+    if (GetShortInt(input, &inOutIdx, &iterations) < 0)
+        return ASN_PARSE_E;
+
+    if (version == PKCS5v2) {
+        /* get encryption algo */
+        if (GetAlgoId(input, &inOutIdx, &oid, sz) < 0)
+            return ASN_PARSE_E;
+
+        if (CheckAlgoV2(oid, &id) < 0)
+            return ASN_PARSE_E;  /* PKCS v2 algo id error */
+
+        if (input[inOutIdx++] != ASN_OCTET_STRING)
+            return ASN_PARSE_E;
+    
+        if (GetLength(input, &inOutIdx, &length, sz) < 0)
+            return ASN_PARSE_E;
+
+        XMEMCPY(cbcIv, &input[inOutIdx], length);
+        inOutIdx += length;
+    }
+
+    if (input[inOutIdx++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+    
+    if (GetLength(input, &inOutIdx, &length, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (DecryptKey(password, passwordSz, salt, saltSz, iterations, id,
+                   input + inOutIdx, length, version, cbcIv) < 0)
+        return ASN_INPUT_E;  /* decrypt failure */
+
+    XMEMMOVE(input, input + inOutIdx, length);
+    return ToTraditional(input, length);
+}
+
+#endif /* NO_PWDBASED */
+
+
+int RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey* key,
+                       word32 inSz)
+{
+    int    length;
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    key->type = RSA_PUBLIC;
+
+#ifdef OPENSSL_EXTRA
+    {
+    byte b = input[*inOutIdx];
+    if (b != ASN_INTEGER) {
+        /* not from decoded cert, will have algo id, skip past */
+        if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+        
+        b = input[(*inOutIdx)++];
+        if (b != ASN_OBJECT_ID) 
+            return ASN_OBJECT_ID_E;
+        
+        if (GetLength(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+        
+        *inOutIdx += length;   /* skip past */
+        
+        /* could have NULL tag and 0 terminator, but may not */
+        b = input[(*inOutIdx)++];
+        
+        if (b == ASN_TAG_NULL) {
+            b = input[(*inOutIdx)++];
+            if (b != 0) 
+                return ASN_EXPECT_0_E;
+        }
+        else
+        /* go back, didn't have it */
+            (*inOutIdx)--;
+        
+        /* should have bit tag length and seq next */
+        b = input[(*inOutIdx)++];
+        if (b != ASN_BIT_STRING)
+            return ASN_BITSTR_E;
+        
+        if (GetLength(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+        
+        /* could have 0 */
+        b = input[(*inOutIdx)++];
+        if (b != 0)
+            (*inOutIdx)--;
+        
+        if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+    }  /* end if */
+    }  /* openssl var block */
+#endif /* OPENSSL_EXTRA */
+
+    if (GetInt(&key->n,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->e,  input, inOutIdx, inSz) < 0 )  return ASN_RSA_KEY_E;
+
+    return 0;
+}
+
+
+#ifndef NO_DH
+
+int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
+{
+    int    length;
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetInt(&key->p,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->g,  input, inOutIdx, inSz) < 0 )  return ASN_DH_KEY_E;
+
+    return 0;
+}
+
+int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz)
+{
+    /* may have leading 0 */
+    if (p[0] == 0) {
+        pSz--; p++;
+    }
+
+    if (g[0] == 0) {
+        gSz--; g++;
+    }
+
+    mp_init(&key->p);
+    if (mp_read_unsigned_bin(&key->p, p, pSz) != 0) {
+        mp_clear(&key->p);
+        return ASN_DH_KEY_E;
+    }
+
+    mp_init(&key->g);
+    if (mp_read_unsigned_bin(&key->g, g, gSz) != 0) {
+        mp_clear(&key->p);
+        return ASN_DH_KEY_E;
+    }
+
+    return 0;
+}
+
+
+#ifdef OPENSSL_EXTRA
+
+int DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz,
+                 byte* g, word32* gInOutSz)
+{
+    word32 i = 0;
+    byte   b;
+    int    length;
+
+    if (GetSequence(input, &i, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    b = input[i++];
+    if (b != ASN_INTEGER)
+        return ASN_PARSE_E;
+
+    if (GetLength(input, &i, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if ( (b = input[i++]) == 0x00)
+        length--;
+    else
+        i--;
+
+    if (length <= (int)*pInOutSz) {
+        XMEMCPY(p, &input[i], length);
+        *pInOutSz = length;
+    }
+    else
+        return BUFFER_E;
+
+    i += length;
+
+    b = input[i++];
+    if (b != ASN_INTEGER)
+        return ASN_PARSE_E;
+
+    if (GetLength(input, &i, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (length <= (int)*gInOutSz) {
+        XMEMCPY(g, &input[i], length);
+        *gInOutSz = length;
+    }
+    else
+        return BUFFER_E;
+
+    return 0;
+}
+
+#endif /* OPENSSL_EXTRA */
+#endif /* NO_DH */
+
+
+#ifndef NO_DSA
+
+int DsaPublicKeyDecode(const byte* input, word32* inOutIdx, DsaKey* key,
+                        word32 inSz)
+{
+    int    length;
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetInt(&key->p,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->q,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->g,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->y,  input, inOutIdx, inSz) < 0 )  return ASN_DH_KEY_E;
+
+    key->type = DSA_PUBLIC;
+    return 0;
+}
+
+
+int DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey* key,
+                        word32 inSz)
+{
+    int    length, version;
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetMyVersion(input, inOutIdx, &version) < 0)
+        return ASN_PARSE_E;
+
+    if (GetInt(&key->p,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->q,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->g,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->y,  input, inOutIdx, inSz) < 0 ||
+        GetInt(&key->x,  input, inOutIdx, inSz) < 0 )  return ASN_DH_KEY_E;
+
+    key->type = DSA_PRIVATE;
+    return 0;
+}
+
+#endif /* NO_DSA */
+
+
+void InitDecodedCert(DecodedCert* cert, byte* source, word32 inSz, void* heap)
+{
+    cert->publicKey       = 0;
+    cert->pubKeyStored    = 0;
+    cert->signature       = 0;
+    cert->subjectCN       = 0;
+    cert->subjectCNLen    = 0;
+    cert->subjectCNStored = 0;
+    cert->altNames        = NULL;
+    cert->issuer[0]       = '\0';
+    cert->subject[0]      = '\0';
+    cert->source          = source;  /* don't own */
+    cert->srcIdx          = 0;
+    cert->maxIdx          = inSz;    /* can't go over this index */
+    cert->heap            = heap;
+    XMEMSET(cert->serial, 0, EXTERNAL_SERIAL_SIZE);
+    cert->serialSz        = 0;
+    cert->extensions      = 0;
+    cert->extensionsSz    = 0;
+    cert->extensionsIdx   = 0;
+    cert->extAuthInfo     = NULL;
+    cert->extAuthInfoSz   = 0;
+    cert->extCrlInfo      = NULL;
+    cert->extCrlInfoSz    = 0;
+    cert->isCA            = 0;
+#ifdef CYASSL_CERT_GEN
+    cert->subjectSN       = 0;
+    cert->subjectSNLen    = 0;
+    cert->subjectC        = 0;
+    cert->subjectCLen     = 0;
+    cert->subjectL        = 0;
+    cert->subjectLLen     = 0;
+    cert->subjectST       = 0;
+    cert->subjectSTLen    = 0;
+    cert->subjectO        = 0;
+    cert->subjectOLen     = 0;
+    cert->subjectOU       = 0;
+    cert->subjectOULen    = 0;
+    cert->subjectEmail    = 0;
+    cert->subjectEmailLen = 0;
+    cert->beforeDate      = 0;
+    cert->beforeDateLen   = 0;
+    cert->afterDate       = 0;
+    cert->afterDateLen    = 0;
+#endif /* CYASSL_CERT_GEN */
+}
+
+
+void FreeAltNames(DNS_entry* altNames, void* heap)
+{
+    (void)heap;
+
+    while (altNames) {
+        DNS_entry* tmp = altNames->next;
+
+        XFREE(altNames->name, heap, DYNAMIC_TYPE_ALTNAME);
+        XFREE(altNames,       heap, DYNAMIC_TYPE_ALTNAME);
+        altNames = tmp;
+    }
+}
+
+
+void FreeDecodedCert(DecodedCert* cert)
+{
+    if (cert->subjectCNStored == 1)
+        XFREE(cert->subjectCN, cert->heap, DYNAMIC_TYPE_SUBJECT_CN);
+    if (cert->pubKeyStored == 1)
+        XFREE(cert->publicKey, cert->heap, DYNAMIC_TYPE_PUBLIC_KEY);
+    if (cert->altNames)
+        FreeAltNames(cert->altNames, cert->heap);
+}
+
+
+static int GetCertHeader(DecodedCert* cert)
+{
+    int    ret = 0, version, len;
+    byte   serialTmp[EXTERNAL_SERIAL_SIZE];
+    mp_int mpi;
+
+    if (GetSequence(cert->source, &cert->srcIdx, &len, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    cert->certBegin = cert->srcIdx;
+
+    if (GetSequence(cert->source, &cert->srcIdx, &len, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+    cert->sigIndex = len + cert->srcIdx;
+
+    if (GetExplicitVersion(cert->source, &cert->srcIdx, &version) < 0)
+        return ASN_PARSE_E;
+
+    if (GetInt(&mpi, cert->source, &cert->srcIdx, cert->maxIdx) < 0) 
+        return ASN_PARSE_E;
+
+    len = mp_unsigned_bin_size(&mpi);
+    if (len < (int)sizeof(serialTmp)) {
+        if (mp_to_unsigned_bin(&mpi, serialTmp) == MP_OKAY) {
+            if (len > EXTERNAL_SERIAL_SIZE)
+                len = EXTERNAL_SERIAL_SIZE;
+            XMEMCPY(cert->serial, serialTmp, len);
+            cert->serialSz = len;
+        }
+    }
+    mp_clear(&mpi);
+    return ret;
+}
+
+
+/* Store Rsa Key, may save later, Dsa could use in future */
+static int StoreRsaKey(DecodedCert* cert)
+{
+    int    length;
+    word32 read = cert->srcIdx;
+
+    if (GetSequence(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+   
+    read = cert->srcIdx - read;
+    length += read;
+
+    while (read--)
+       cert->srcIdx--;
+
+    cert->pubKeySize = length;
+    cert->publicKey = cert->source + cert->srcIdx;
+    cert->srcIdx += length;
+
+    return 0;
+}
+
+
+#ifdef HAVE_ECC
+
+    /* return 0 on sucess if the ECC curve oid sum is supported */
+    static int CheckCurve(word32 oid)
+    {
+        if (oid != ECC_256R1 && oid != ECC_384R1 && oid != ECC_521R1 && oid !=
+                   ECC_160R1 && oid != ECC_192R1 && oid != ECC_224R1)
+            return ALGO_ID_E; 
+
+        return 0;
+    }
+
+#endif /* HAVE_ECC */
+
+
+static int GetKey(DecodedCert* cert)
+{
+    int length;
+#ifdef HAVE_NTRU
+    int tmpIdx = cert->srcIdx;
+#endif
+
+    if (GetSequence(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+    
+    if (GetAlgoId(cert->source, &cert->srcIdx, &cert->keyOID, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if (cert->keyOID == RSAk) {
+        byte b = cert->source[cert->srcIdx++];
+        if (b != ASN_BIT_STRING)
+            return ASN_BITSTR_E;
+
+        if (GetLength(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+        b = cert->source[cert->srcIdx++];
+        if (b != 0x00)
+            return ASN_EXPECT_0_E;
+    }
+    else if (cert->keyOID == DSAk )
+        ;   /* do nothing */
+#ifdef HAVE_NTRU
+    else if (cert->keyOID == NTRUk ) {
+        const byte* key = &cert->source[tmpIdx];
+        byte*       next = (byte*)key;
+        word16      keyLen;
+        byte        keyBlob[MAX_NTRU_KEY_SZ];
+
+        word32 rc = crypto_ntru_encrypt_subjectPublicKeyInfo2PublicKey(key,
+                            &keyLen, NULL, &next);
+
+        if (rc != NTRU_OK)
+            return ASN_NTRU_KEY_E;
+        if (keyLen > sizeof(keyBlob))
+            return ASN_NTRU_KEY_E;
+
+        rc = crypto_ntru_encrypt_subjectPublicKeyInfo2PublicKey(key, &keyLen,
+                                                                keyBlob, &next);
+        if (rc != NTRU_OK)
+            return ASN_NTRU_KEY_E;
+
+        if ( (next - key) < 0)
+            return ASN_NTRU_KEY_E;
+
+        cert->srcIdx = tmpIdx + (next - key);
+
+        cert->publicKey = (byte*) XMALLOC(keyLen, cert->heap,
+                                          DYNAMIC_TYPE_PUBLIC_KEY);
+        if (cert->publicKey == NULL)
+            return MEMORY_E;
+        XMEMCPY(cert->publicKey, keyBlob, keyLen);
+        cert->pubKeyStored = 1;
+        cert->pubKeySize   = keyLen;
+    }
+#endif /* HAVE_NTRU */
+#ifdef HAVE_ECC
+    else if (cert->keyOID == ECDSAk ) {
+        word32 oid = 0;
+        int    oidSz = 0;
+        byte   b = cert->source[cert->srcIdx++];
+    
+        if (b != ASN_OBJECT_ID) 
+            return ASN_OBJECT_ID_E;
+
+        if (GetLength(cert->source, &cert->srcIdx, &oidSz, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+
+        while(oidSz--)
+            oid += cert->source[cert->srcIdx++];
+        if (CheckCurve(oid) < 0)
+            return ECC_CURVE_OID_E;
+
+        /* key header */
+        b = cert->source[cert->srcIdx++];
+        if (b != ASN_BIT_STRING)
+            return ASN_BITSTR_E;
+
+        if (GetLength(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+        b = cert->source[cert->srcIdx++];
+        if (b != 0x00)
+            return ASN_EXPECT_0_E;
+
+        /* actual key, use length - 1 since ate preceding 0 */
+        length -= 1;
+
+        cert->publicKey = (byte*) XMALLOC(length, cert->heap,
+                                          DYNAMIC_TYPE_PUBLIC_KEY);
+        if (cert->publicKey == NULL)
+            return MEMORY_E;
+        XMEMCPY(cert->publicKey, &cert->source[cert->srcIdx], length);
+        cert->pubKeyStored = 1;
+        cert->pubKeySize   = length;
+
+        cert->srcIdx += length;
+    }
+#endif /* HAVE_ECC */
+    else
+        return ASN_UNKNOWN_OID_E;
+   
+    if (cert->keyOID == RSAk) 
+        return StoreRsaKey(cert);
+    return 0;
+}
+
+
+/* process NAME, either issuer or subject */
+static int GetName(DecodedCert* cert, int nameType)
+{
+    Sha    sha;
+    int    length;  /* length of all distinguished names */
+    int    dummy;
+    char* full = (nameType == ISSUER) ? cert->issuer : cert->subject;
+    word32 idx;
+
+    if (cert->source[cert->srcIdx] == ASN_OBJECT_ID) {
+        CYASSL_MSG("Trying optional prefix...");
+
+        if (GetLength(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+
+        cert->srcIdx += length;
+        CYASSL_MSG("Got optional prefix");
+    }
+
+    /* For OCSP, RFC2560 section 4.1.1 states the issuer hash should be
+     * calculated over the entire DER encoding of the Name field, including
+     * the tag and length. */
+    idx = cert->srcIdx;
+    if (GetSequence(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    InitSha(&sha);
+    ShaUpdate(&sha, &cert->source[idx], length + cert->srcIdx - idx);
+    if (nameType == ISSUER)
+        ShaFinal(&sha, cert->issuerHash);
+    else
+        ShaFinal(&sha, cert->subjectHash);
+
+    length += cert->srcIdx;
+    idx = 0;
+
+    while (cert->srcIdx < (word32)length) {
+        byte   b;
+        byte   joint[2];
+        int    oidSz;
+
+        if (GetSet(cert->source, &cert->srcIdx, &dummy, cert->maxIdx) < 0) {
+            (void)b;  /* empty body warning w/o messages enabled */
+            CYASSL_MSG("Cert name lacks set header, trying sequence");
+        }
+
+        if (GetSequence(cert->source, &cert->srcIdx, &dummy, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+
+        b = cert->source[cert->srcIdx++];
+        if (b != ASN_OBJECT_ID) 
+            return ASN_OBJECT_ID_E;
+
+        if (GetLength(cert->source, &cert->srcIdx, &oidSz, cert->maxIdx) < 0)
+            return ASN_PARSE_E;
+
+        XMEMCPY(joint, &cert->source[cert->srcIdx], sizeof(joint));
+
+        /* v1 name types */
+        if (joint[0] == 0x55 && joint[1] == 0x04) {
+            byte   id;
+            byte   copy = FALSE;
+            int    strLen;
+
+            cert->srcIdx += 2;
+            id = cert->source[cert->srcIdx++]; 
+            b  = cert->source[cert->srcIdx++];    /* strType */
+
+            if (GetLength(cert->source, &cert->srcIdx, &strLen,
+                          cert->maxIdx) < 0)
+                return ASN_PARSE_E;
+
+            if (strLen > (int)(ASN_NAME_MAX - idx))
+                return ASN_PARSE_E; 
+
+            if (4  > (ASN_NAME_MAX - idx))  /* make sure room for biggest */
+                return ASN_PARSE_E;         /* pre fix header too "/CN=" */
+
+            if (id == ASN_COMMON_NAME) {
+                if (nameType == SUBJECT) {
+                    cert->subjectCN = (char *)&cert->source[cert->srcIdx];
+                    cert->subjectCNLen = strLen;
+                }
+
+                XMEMCPY(&full[idx], "/CN=", 4);
+                idx += 4;
+                copy = TRUE;
+            }
+            else if (id == ASN_SUR_NAME) {
+                XMEMCPY(&full[idx], "/SN=", 4);
+                idx += 4;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectSN = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectSNLen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+            else if (id == ASN_COUNTRY_NAME) {
+                XMEMCPY(&full[idx], "/C=", 3);
+                idx += 3;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectC = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectCLen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+            else if (id == ASN_LOCALITY_NAME) {
+                XMEMCPY(&full[idx], "/L=", 3);
+                idx += 3;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectL = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectLLen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+            else if (id == ASN_STATE_NAME) {
+                XMEMCPY(&full[idx], "/ST=", 4);
+                idx += 4;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectST = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectSTLen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+            else if (id == ASN_ORG_NAME) {
+                XMEMCPY(&full[idx], "/O=", 3);
+                idx += 3;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectO = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectOLen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+            else if (id == ASN_ORGUNIT_NAME) {
+                XMEMCPY(&full[idx], "/OU=", 4);
+                idx += 4;
+                copy = TRUE;
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectOU = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectOULen = strLen;
+                }
+#endif /* CYASSL_CERT_GEN */
+            }
+
+            if (copy) {
+                XMEMCPY(&full[idx], &cert->source[cert->srcIdx], strLen);
+                idx += strLen;
+            }
+
+            cert->srcIdx += strLen;
+        }
+        else {
+            /* skip */
+            byte email = FALSE;
+            byte uid   = FALSE;
+            int  adv;
+
+            if (joint[0] == 0x2a && joint[1] == 0x86)  /* email id hdr */
+                email = TRUE;
+
+            if (joint[0] == 0x9  && joint[1] == 0x92)  /* uid id hdr */
+                uid = TRUE;
+
+            cert->srcIdx += oidSz + 1;
+
+            if (GetLength(cert->source, &cert->srcIdx, &adv, cert->maxIdx) < 0)
+                return ASN_PARSE_E;
+
+            if (adv > (int)(ASN_NAME_MAX - idx))
+                return ASN_PARSE_E; 
+
+            if (email) {
+                if (14 > (ASN_NAME_MAX - idx))
+                    return ASN_PARSE_E; 
+                XMEMCPY(&full[idx], "/emailAddress=", 14);
+                idx += 14;
+
+#ifdef CYASSL_CERT_GEN
+                if (nameType == SUBJECT) {
+                    cert->subjectEmail = (char*)&cert->source[cert->srcIdx];
+                    cert->subjectEmailLen = adv;
+                }
+#endif /* CYASSL_CERT_GEN */
+
+                XMEMCPY(&full[idx], &cert->source[cert->srcIdx], adv);
+                idx += adv;
+            }
+
+            if (uid) {
+                if (5 > (ASN_NAME_MAX - idx))
+                    return ASN_PARSE_E; 
+                XMEMCPY(&full[idx], "/UID=", 5);
+                idx += 5;
+
+                XMEMCPY(&full[idx], &cert->source[cert->srcIdx], adv);
+                idx += adv;
+            }
+
+            cert->srcIdx += adv;
+        }
+    }
+    full[idx++] = 0;
+
+    return 0;
+}
+
+
+#ifndef NO_TIME_H
+
+/* to the second */
+static int DateGreaterThan(const struct tm* a, const struct tm* b)
+{
+    if (a->tm_year > b->tm_year)
+        return 1;
+
+    if (a->tm_year == b->tm_year && a->tm_mon > b->tm_mon)
+        return 1;
+    
+    if (a->tm_year == b->tm_year && a->tm_mon == b->tm_mon &&
+           a->tm_mday > b->tm_mday)
+        return 1;
+
+    if (a->tm_year == b->tm_year && a->tm_mon == b->tm_mon &&
+        a->tm_mday == b->tm_mday && a->tm_hour > b->tm_hour)
+        return 1;
+
+    if (a->tm_year == b->tm_year && a->tm_mon == b->tm_mon &&
+        a->tm_mday == b->tm_mday && a->tm_hour == b->tm_hour &&
+        a->tm_min > b->tm_min)
+        return 1;
+
+    if (a->tm_year == b->tm_year && a->tm_mon == b->tm_mon &&
+        a->tm_mday == b->tm_mday && a->tm_hour == b->tm_hour &&
+        a->tm_min  == b->tm_min  && a->tm_sec > b->tm_sec)
+        return 1;
+
+    return 0; /* false */
+}
+
+
+static INLINE int DateLessThan(const struct tm* a, const struct tm* b)
+{
+    return !DateGreaterThan(a,b);
+}
+
+
+/* like atoi but only use first byte */
+/* Make sure before and after dates are valid */
+int ValidateDate(const byte* date, byte format, int dateType)
+{
+    time_t ltime;
+    struct tm  certTime;
+    struct tm* localTime;
+    int    i = 0;
+
+    ltime = XTIME(0);
+    XMEMSET(&certTime, 0, sizeof(certTime));
+
+    if (format == ASN_UTC_TIME) {
+        if (btoi(date[0]) >= 5)
+            certTime.tm_year = 1900;
+        else
+            certTime.tm_year = 2000;
+    }
+    else  { /* format == GENERALIZED_TIME */
+        certTime.tm_year += btoi(date[i++]) * 1000;
+        certTime.tm_year += btoi(date[i++]) * 100;
+    }
+
+    GetTime(&certTime.tm_year, date, &i); certTime.tm_year -= 1900; /* adjust */
+    GetTime(&certTime.tm_mon,  date, &i); certTime.tm_mon  -= 1;    /* adjust */
+    GetTime(&certTime.tm_mday, date, &i);
+    GetTime(&certTime.tm_hour, date, &i); 
+    GetTime(&certTime.tm_min,  date, &i); 
+    GetTime(&certTime.tm_sec,  date, &i); 
+
+    if (date[i] != 'Z') {     /* only Zulu supported for this profile */
+        CYASSL_MSG("Only Zulu time supported for this profile"); 
+        return 0;
+    }
+
+    localTime = XGMTIME(&ltime);
+
+    if (dateType == BEFORE) {
+        if (DateLessThan(localTime, &certTime))
+            return 0;
+    }
+    else
+        if (DateGreaterThan(localTime, &certTime))
+            return 0;
+
+    return 1;
+}
+
+#endif /* NO_TIME_H */
+
+
+static int GetDate(DecodedCert* cert, int dateType)
+{
+    int    length;
+    byte   date[MAX_DATE_SIZE];
+    byte   b;
+
+#ifdef CYASSL_CERT_GEN
+    word32 startIdx = 0;
+    if (dateType == BEFORE)
+        cert->beforeDate = &cert->source[cert->srcIdx];
+    else
+        cert->afterDate = &cert->source[cert->srcIdx];
+    startIdx = cert->srcIdx;
+#endif
+
+    b = cert->source[cert->srcIdx++];
+    if (b != ASN_UTC_TIME && b != ASN_GENERALIZED_TIME)
+        return ASN_TIME_E;
+
+    if (GetLength(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if (length > MAX_DATE_SIZE || length < MIN_DATE_SIZE)
+        return ASN_DATE_SZ_E;
+
+    XMEMCPY(date, &cert->source[cert->srcIdx], length);
+    cert->srcIdx += length;
+
+#ifdef CYASSL_CERT_GEN
+    if (dateType == BEFORE)
+        cert->beforeDateLen = cert->srcIdx - startIdx;
+    else
+        cert->afterDateLen  = cert->srcIdx - startIdx;
+#endif
+
+    if (!XVALIDATE_DATE(date, b, dateType)) {
+        if (dateType == BEFORE)
+            return ASN_BEFORE_DATE_E;
+        else
+            return ASN_AFTER_DATE_E;
+    }
+
+    return 0;
+}
+
+
+static int GetValidity(DecodedCert* cert, int verify)
+{
+    int length;
+    int badDate = 0;
+
+    if (GetSequence(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if (GetDate(cert, BEFORE) < 0 && verify)
+        badDate = ASN_BEFORE_DATE_E;           /* continue parsing */
+    
+    if (GetDate(cert, AFTER) < 0 && verify)
+        return ASN_AFTER_DATE_E;
+   
+    if (badDate != 0)
+        return badDate;
+
+    return 0;
+}
+
+
+int DecodeToKey(DecodedCert* cert, int verify)
+{
+    int badDate = 0;
+    int ret;
+
+    if ( (ret = GetCertHeader(cert)) < 0)
+        return ret;
+
+    if ( (ret = GetAlgoId(cert->source, &cert->srcIdx, &cert->signatureOID,
+                          cert->maxIdx)) < 0)
+        return ret;
+
+    if ( (ret = GetName(cert, ISSUER)) < 0)
+        return ret;
+
+    if ( (ret = GetValidity(cert, verify)) < 0)
+        badDate = ret;
+
+    if ( (ret = GetName(cert, SUBJECT)) < 0)
+        return ret;
+
+    if ( (ret = GetKey(cert)) < 0)
+        return ret;
+
+    if (badDate != 0)
+        return badDate;
+
+    return ret;
+}
+
+
+static int GetSignature(DecodedCert* cert)
+{
+    int    length;
+    byte   b = cert->source[cert->srcIdx++];
+
+    if (b != ASN_BIT_STRING)
+        return ASN_BITSTR_E;
+
+    if (GetLength(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    cert->sigLength = length;
+
+    b = cert->source[cert->srcIdx++];
+    if (b != 0x00)
+        return ASN_EXPECT_0_E;
+
+    cert->sigLength--;
+    cert->signature = &cert->source[cert->srcIdx];
+    cert->srcIdx += cert->sigLength;
+
+    return 0;
+}
+
+
+static word32 SetDigest(const byte* digest, word32 digSz, byte* output)
+{
+    output[0] = ASN_OCTET_STRING;
+    output[1] = (byte)digSz;
+    XMEMCPY(&output[2], digest, digSz);
+
+    return digSz + 2;
+} 
+
+
+static word32 BytePrecision(word32 value)
+{
+    word32 i;
+    for (i = sizeof(value); i; --i)
+        if (value >> (i - 1) * 8)
+            break;
+
+    return i;
+}
+
+
+static word32 SetLength(word32 length, byte* output)
+{
+    word32 i = 0, j;
+
+    if (length < ASN_LONG_LENGTH)
+        output[i++] = (byte)length;
+    else {
+        output[i++] = (byte)(BytePrecision(length) | ASN_LONG_LENGTH);
+      
+        for (j = BytePrecision(length); j; --j) {
+            output[i] = (byte)(length >> (j - 1) * 8);
+            i++;
+        }
+    }
+
+    return i;
+}
+
+
+static word32 SetSequence(word32 len, byte* output)
+{
+    output[0] = ASN_SEQUENCE | ASN_CONSTRUCTED;
+    return SetLength(len, output + 1) + 1;
+}
+
+
+static word32 SetAlgoID(int algoOID, byte* output, int type)
+{
+    /* adding TAG_NULL and 0 to end */
+    
+    /* hashTypes */
+    static const byte shaAlgoID[]    = { 0x2b, 0x0e, 0x03, 0x02, 0x1a,
+                                         0x05, 0x00 };
+    static const byte sha256AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
+                                         0x04, 0x02, 0x01, 0x05, 0x00 };
+    static const byte sha384AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
+                                         0x04, 0x02, 0x02, 0x05, 0x00 };
+    static const byte sha512AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
+                                         0x04, 0x02, 0x03, 0x05, 0x00 };
+    static const byte md5AlgoID[]    = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                         0x02, 0x05, 0x05, 0x00  };
+    static const byte md2AlgoID[]    = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                         0x02, 0x02, 0x05, 0x00};
+    /* sigTypes */
+    static const byte md5wRSA_AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                           0x01, 0x01, 0x04, 0x05, 0x00};
+    static const byte shawRSA_AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                           0x01, 0x01, 0x05, 0x05, 0x00};
+    static const byte sha256wRSA_AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7,
+                                            0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00};
+    static const byte sha384wRSA_AlgoID[] = {0x2a, 0x86, 0x48, 0x86, 0xf7,
+                                            0x0d, 0x01, 0x01, 0x0c, 0x05, 0x00};
+    static const byte sha512wRSA_AlgoID[] = {0x2a, 0x86, 0x48, 0x86, 0xf7,
+                                            0x0d, 0x01, 0x01, 0x0d, 0x05, 0x00};
+    /* keyTypes */
+    static const byte RSA_AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                      0x01, 0x01, 0x01, 0x05, 0x00};
+    int    algoSz = 0;
+    word32 idSz, seqSz;
+    const  byte* algoName = 0;
+    byte ID_Length[MAX_LENGTH_SZ];
+    byte seqArray[MAX_SEQ_SZ + 1];  /* add object_id to end */
+
+    if (type == hashType) {
+        switch (algoOID) {
+        case SHAh:
+            algoSz = sizeof(shaAlgoID);
+            algoName = shaAlgoID;
+            break;
+
+        case SHA256h:
+            algoSz = sizeof(sha256AlgoID);
+            algoName = sha256AlgoID;
+            break;
+
+        case SHA384h:
+            algoSz = sizeof(sha384AlgoID);
+            algoName = sha384AlgoID;
+            break;
+
+        case SHA512h:
+            algoSz = sizeof(sha512AlgoID);
+            algoName = sha512AlgoID;
+            break;
+
+        case MD2h:
+            algoSz = sizeof(md2AlgoID);
+            algoName = md2AlgoID;
+            break;
+
+        case MD5h:
+            algoSz = sizeof(md5AlgoID);
+            algoName = md5AlgoID;
+            break;
+
+        default:
+            CYASSL_MSG("Unknown Hash Algo");
+            return 0;  /* UNKOWN_HASH_E; */
+        }
+    }
+    else if (type == sigType) {    /* sigType */
+        switch (algoOID) {
+        case CTC_MD5wRSA:
+            algoSz = sizeof(md5wRSA_AlgoID);
+            algoName = md5wRSA_AlgoID;
+            break;
+
+        case CTC_SHAwRSA:
+            algoSz = sizeof(shawRSA_AlgoID);
+            algoName = shawRSA_AlgoID;
+            break;
+
+        case CTC_SHA256wRSA:
+            algoSz = sizeof(sha256wRSA_AlgoID);
+            algoName = sha256wRSA_AlgoID;
+            break;
+
+        case CTC_SHA384wRSA:
+            algoSz = sizeof(sha384wRSA_AlgoID);
+            algoName = sha384wRSA_AlgoID;
+            break;
+
+        case CTC_SHA512wRSA:
+            algoSz = sizeof(sha512wRSA_AlgoID);
+            algoName = sha512wRSA_AlgoID;
+            break;
+
+        default:
+            CYASSL_MSG("Unknown Signature Algo");
+            return 0;
+        }
+    }
+    else if (type == keyType) {    /* keyType */
+        switch (algoOID) {
+        case RSAk:
+            algoSz = sizeof(RSA_AlgoID);
+            algoName = RSA_AlgoID;
+            break;
+
+        default:
+            CYASSL_MSG("Unknown Key Algo");
+            return 0;
+        }
+    }
+    else {
+        CYASSL_MSG("Unknown Algo type");
+        return 0;
+    }
+
+    idSz  = SetLength(algoSz - 2, ID_Length); /* don't include TAG_NULL/0 */
+    seqSz = SetSequence(idSz + algoSz + 1, seqArray);
+    seqArray[seqSz++] = ASN_OBJECT_ID;
+
+    XMEMCPY(output, seqArray, seqSz);
+    XMEMCPY(output + seqSz, ID_Length, idSz);
+    XMEMCPY(output + seqSz + idSz, algoName, algoSz);
+
+    return seqSz + idSz + algoSz;
+
+}
+
+
+word32 EncodeSignature(byte* out, const byte* digest, word32 digSz, int hashOID)
+{
+    byte digArray[MAX_ENCODED_DIG_SZ];
+    byte algoArray[MAX_ALGO_SZ];
+    byte seqArray[MAX_SEQ_SZ];
+    word32 encDigSz, algoSz, seqSz; 
+
+    encDigSz = SetDigest(digest, digSz, digArray);
+    algoSz   = SetAlgoID(hashOID, algoArray, hashType);
+    seqSz    = SetSequence(encDigSz + algoSz, seqArray);
+
+    XMEMCPY(out, seqArray, seqSz);
+    XMEMCPY(out + seqSz, algoArray, algoSz);
+    XMEMCPY(out + seqSz + algoSz, digArray, encDigSz);
+
+    return encDigSz + algoSz + seqSz;
+}
+                           
+#include <stdio.h>
+/* return true (1) for Confirmation */
+static int ConfirmSignature(const byte* buf, word32 bufSz,
+    const byte* key, word32 keySz, word32 keyOID,
+    const byte* sig, word32 sigSz, word32 sigOID,
+    void* heap)
+{
+#ifdef CYASSL_SHA512
+    byte digest[SHA512_DIGEST_SIZE]; /* max size */
+#elif !defined(NO_SHA256)
+    byte digest[SHA256_DIGEST_SIZE]; /* max size */
+#else
+    byte digest[SHA_DIGEST_SIZE];    /* max size */
+#endif
+    int  typeH, digestSz, ret;
+
+    if (sigOID == CTC_MD5wRSA) {
+        Md5 md5;
+        InitMd5(&md5);
+        Md5Update(&md5, buf, bufSz);
+        Md5Final(&md5, digest);
+        typeH    = MD5h;
+        digestSz = MD5_DIGEST_SIZE;
+    }
+#ifdef CYASSL_MD2
+    else if (sigOID == CTC_MD2wRSA) {
+        Md2 md2;
+        InitMd2(&md2);
+        Md2Update(&md2, buf, bufSz);
+        Md2Final(&md2, digest);
+        typeH    = MD2h;
+        digestSz = MD2_DIGEST_SIZE;
+    }
+#endif
+    else if (sigOID == CTC_SHAwRSA ||
+             sigOID == CTC_SHAwDSA ||
+             sigOID == CTC_SHAwECDSA) {
+        Sha sha;
+        InitSha(&sha);
+        ShaUpdate(&sha, buf, bufSz);
+        ShaFinal(&sha, digest);
+        typeH    = SHAh;
+        digestSz = SHA_DIGEST_SIZE;
+    }
+#ifndef NO_SHA256
+    else if (sigOID == CTC_SHA256wRSA ||
+             sigOID == CTC_SHA256wECDSA) {
+        Sha256 sha256;
+        InitSha256(&sha256);
+        Sha256Update(&sha256, buf, bufSz);
+        Sha256Final(&sha256, digest);
+        typeH    = SHA256h;
+        digestSz = SHA256_DIGEST_SIZE;
+    }
+#endif
+#ifdef CYASSL_SHA512
+    else if (sigOID == CTC_SHA512wRSA ||
+             sigOID == CTC_SHA512wECDSA) {
+        Sha512 sha512;
+        InitSha512(&sha512);
+        Sha512Update(&sha512, buf, bufSz);
+        Sha512Final(&sha512, digest);
+        typeH    = SHA512h;
+        digestSz = SHA512_DIGEST_SIZE;
+    }
+#endif
+#ifdef CYASSL_SHA384
+    else if (sigOID == CTC_SHA384wRSA ||
+             sigOID == CTC_SHA384wECDSA) {
+        Sha384 sha384;
+        InitSha384(&sha384);
+        Sha384Update(&sha384, buf, bufSz);
+        Sha384Final(&sha384, digest);
+        typeH    = SHA384h;
+        digestSz = SHA384_DIGEST_SIZE;
+    }
+#endif
+    else {
+        CYASSL_MSG("Verify Signautre has unsupported type");
+        return 0;
+    }
+
+    if (keyOID == RSAk) {
+        RsaKey pubKey;
+        byte   encodedSig[MAX_ENCODED_SIG_SZ];
+        byte   plain[MAX_ENCODED_SIG_SZ];
+        word32 idx = 0;
+        int    encodedSigSz, verifySz;
+        byte*  out;
+
+        if (sigSz > MAX_ENCODED_SIG_SZ) {
+            CYASSL_MSG("Verify Signautre is too big");
+            return 0;
+        }
+            
+        InitRsaKey(&pubKey, heap);
+        if (RsaPublicKeyDecode(key, &idx, &pubKey, keySz) < 0) {
+            CYASSL_MSG("ASN Key decode error RSA");
+            ret = 0;
+        }
+        else {
+            XMEMCPY(plain, sig, sigSz);
+            if ( (verifySz = RsaSSL_VerifyInline(plain, sigSz, &out,
+                                           &pubKey)) < 0) {
+                CYASSL_MSG("Rsa SSL verify error");
+                ret = 0;
+            }
+            else {
+                /* make sure we're right justified */
+                encodedSigSz =
+                        EncodeSignature(encodedSig, digest, digestSz, typeH);
+                if (encodedSigSz != verifySz ||
+                                XMEMCMP(out, encodedSig, encodedSigSz) != 0) {
+                    CYASSL_MSG("Rsa SSL verify match encode error");
+                    ret = 0;
+                }
+                else
+                    ret = 1; /* match */
+
+#ifdef CYASSL_DEBUG_ENCODING
+                {
+                int x;
+                printf("cyassl encodedSig:\n");
+                for (x = 0; x < encodedSigSz; x++) {
+                    printf("%02x ", encodedSig[x]);
+                    if ( (x % 16) == 15)
+                        printf("\n");
+                }
+                printf("\n");
+                printf("actual digest:\n");
+                for (x = 0; x < verifySz; x++) {
+                    printf("%02x ", out[x]);
+                    if ( (x % 16) == 15)
+                        printf("\n");
+                }
+                printf("\n");
+                }
+#endif /* CYASSL_DEBUG_ENCODING */
+            }
+        }
+        FreeRsaKey(&pubKey);
+        return ret;
+    }
+#ifdef HAVE_ECC
+    else if (keyOID == ECDSAk) {
+        ecc_key pubKey;
+        int     verify = 0;
+        
+        if (ecc_import_x963(key, keySz, &pubKey) < 0) {
+            CYASSL_MSG("ASN Key import error ECC");
+            return 0;
+        }
+    
+        ret = ecc_verify_hash(sig, sigSz, digest, digestSz, &verify, &pubKey);
+        ecc_free(&pubKey);
+        if (ret == 0 && verify == 1)
+            return 1;  /* match */
+
+        CYASSL_MSG("ECC Verify didn't match");
+        return 0;
+    }
+#endif /* HAVE_ECC */
+    else {
+        CYASSL_MSG("Verify Key type unknown");
+        return 0;
+    }
+}
+
+
+static void DecodeAltNames(byte* input, int sz, DecodedCert* cert)
+{
+    word32 idx = 0;
+    int length = 0;
+
+    CYASSL_ENTER("DecodeAltNames");
+
+    if (GetSequence(input, &idx, &length, sz) < 0) {
+        CYASSL_MSG("\tBad Sequence");
+        return;
+    }
+
+    while (length > 0) {
+        DNS_entry* entry;
+        int        strLen;
+        byte       b = input[idx++];
+
+        length--;
+
+        if (b != (ASN_CONTEXT_SPECIFIC | ASN_DNS_TYPE)) {
+            CYASSL_MSG("\tNot DNS type");
+            return;
+        }
+
+        if (GetLength(input, &idx, &strLen, sz) < 0) {
+            CYASSL_MSG("\tfail: str length");
+            return;
+        }
+
+        entry = (DNS_entry*)XMALLOC(sizeof(DNS_entry), cert->heap,
+                                    DYNAMIC_TYPE_ALTNAME);
+        if (entry == NULL) {
+            CYASSL_MSG("\tOut of Memory");
+            return;
+        }
+
+        entry->name = (char*)XMALLOC(strLen + 1, cert->heap,
+                                     DYNAMIC_TYPE_ALTNAME);
+        if (entry->name == NULL) {
+            CYASSL_MSG("\tOut of Memory");
+            XFREE(entry, cert->heap, DYNAMIC_TYPE_ALTNAME);
+            return;
+        }
+
+        XMEMCPY(entry->name, &input[idx], strLen);
+        entry->name[strLen] = '\0';
+
+        entry->next    = cert->altNames;
+        cert->altNames = entry;
+
+        length -= strLen;
+        idx    += strLen;
+    }   
+}
+
+
+static void DecodeBasicCaConstraint(byte* input, int sz, DecodedCert* cert)
+{
+    word32 idx = 0;
+    int length = 0;
+
+    CYASSL_ENTER("DecodeBasicCaConstraint");
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+
+    if (length == 0) return;
+    /* If the basic ca constraint is false, this extension may be named, but
+     * left empty. So, if the length is 0, just return. */
+
+    if (input[idx++] != ASN_BOOLEAN)
+    {
+        CYASSL_MSG("\tfail: constraint not BOOLEAN");
+        return;
+    }
+
+    if (GetLength(input, &idx, &length, sz) < 0)
+    {
+        CYASSL_MSG("\tfail: length");
+        return;
+    }
+
+    if (input[idx])
+        cert->isCA = 1;
+}
+
+
+#define CRLDP_FULL_NAME 0
+    /* From RFC3280 SS4.2.1.14, Distribution Point Name*/
+#define GENERALNAME_URI 6
+    /* From RFC3280 SS4.2.1.7, GeneralName */
+
+static void DecodeCrlDist(byte* input, int sz, DecodedCert* cert)
+{
+    word32 idx = 0;
+    int length = 0;
+
+    CYASSL_ENTER("DecodeCrlDist");
+
+    /* Unwrap the list of Distribution Points*/
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+
+    /* Unwrap a single Distribution Point */
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+
+    /* The Distribution Point has three explicit optional members
+     *  First check for a DistributionPointName
+     */
+    if (input[idx] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 0))
+    {
+        idx++;
+        if (GetLength(input, &idx, &length, sz) < 0) return;
+
+        if (input[idx] == 
+                    (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | CRLDP_FULL_NAME))
+        {
+            idx++;
+            if (GetLength(input, &idx, &length, sz) < 0) return;
+
+            if (input[idx] == (ASN_CONTEXT_SPECIFIC | GENERALNAME_URI))
+            {
+                idx++;
+                if (GetLength(input, &idx, &length, sz) < 0) return;
+
+                cert->extCrlInfoSz = length;
+                cert->extCrlInfo = input + idx;
+                idx += length;
+            }
+            else
+                /* This isn't a URI, skip it. */
+                idx += length;
+        }
+        else
+            /* This isn't a FULLNAME, skip it. */
+            idx += length;
+    }
+
+    /* Check for reasonFlags */
+    if (idx < (word32)sz &&
+        input[idx] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1))
+    {
+        idx++;
+        if (GetLength(input, &idx, &length, sz) < 0) return;
+        idx += length;
+    }
+
+    /* Check for cRLIssuer */
+    if (idx < (word32)sz &&
+        input[idx] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 2))
+    {
+        idx++;
+        if (GetLength(input, &idx, &length, sz) < 0) return;
+        idx += length;
+    }
+
+    if (idx < (word32)sz)
+    {
+        CYASSL_MSG("\tThere are more CRL Distribution Point records, "
+                   "but we only use the first one.");
+    }
+
+    return;
+}
+
+
+static void DecodeAuthInfo(byte* input, int sz, DecodedCert* cert)
+/*
+ *  Read the first of the Authority Information Access records. If there are
+ *  any issues, return without saving the record.
+ */
+{
+    word32 idx = 0;
+    int length = 0;
+    word32 oid;
+
+    /* Unwrap the list of AIAs */
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+
+    /* Unwrap a single AIA */
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+
+    oid = 0;
+    if (GetObjectId(input, &idx, &oid, sz) < 0) return;
+
+    /* Only supporting URIs right now. */
+    if (input[idx] == (ASN_CONTEXT_SPECIFIC | GENERALNAME_URI))
+    {
+        idx++;
+        if (GetLength(input, &idx, &length, sz) < 0) return;
+
+        cert->extAuthInfoSz = length;
+        cert->extAuthInfo = input + idx;
+        idx += length;
+    }
+    else
+    {
+        /* Skip anything else. */
+        idx++;
+        if (GetLength(input, &idx, &length, sz) < 0) return;
+        idx += length;
+    }
+
+    if (idx < (word32)sz)
+    {
+        CYASSL_MSG("\tThere are more Authority Information Access records, "
+                   "but we only use first one.");
+    }
+
+    return;
+}
+
+
+static void DecodeCertExtensions(DecodedCert* cert)
+/*
+ *  Processing the Certificate Extensions. This does not modify the current
+ *  index. It is works starting with the recorded extensions pointer.
+ */
+{
+    word32 idx = 0;
+    int sz = cert->extensionsSz;
+    byte* input = cert->extensions;
+    int length;
+    word32 oid;
+
+    CYASSL_ENTER("DecodeCertExtensions");
+
+    if (input == NULL || sz == 0) return;
+
+    if (input[idx++] != ASN_EXTENSIONS) return;
+
+    if (GetLength(input, &idx, &length, sz) < 0) return;
+
+    if (GetSequence(input, &idx, &length, sz) < 0) return;
+    
+    while (idx < (word32)sz) {
+        if (GetSequence(input, &idx, &length, sz) < 0) {
+            CYASSL_MSG("\tfail: should be a SEQUENCE");
+            return;
+        }
+
+        oid = 0;
+        if (GetObjectId(input, &idx, &oid, sz) < 0) {
+            CYASSL_MSG("\tfail: OBJECT ID");
+            return;
+        }
+
+        /* check for critical flag */
+        if (input[idx] == ASN_BOOLEAN) {
+            CYASSL_MSG("\tfound optional critical flag, moving past");
+            idx += (ASN_BOOL_SIZE + 1);
+        }
+
+        /* process the extension based on the OID */
+        if (input[idx++] != ASN_OCTET_STRING) {
+            CYASSL_MSG("\tfail: should be an OCTET STRING");
+            return;
+        }
+
+        if (GetLength(input, &idx, &length, sz) < 0) {
+            CYASSL_MSG("\tfail: extension data length");
+            return;
+        }
+
+        switch (oid) {
+            case BASIC_CA_OID:
+                DecodeBasicCaConstraint(&input[idx], length, cert);
+                break;
+
+            case CRL_DIST_OID:
+                DecodeCrlDist(&input[idx], length, cert);
+                break;
+
+            case AUTH_INFO_OID:
+                DecodeAuthInfo(&input[idx], length, cert);
+                break;
+
+            case ALT_NAMES_OID:
+                DecodeAltNames(&input[idx], length, cert);
+
+            default:
+                CYASSL_MSG("\tExtension type not handled, skipping");
+                break;
+        }
+        idx += length;
+    }
+
+    return;
+}
+
+
+int ParseCert(DecodedCert* cert, int type, int verify, void* cm)
+{
+    int   ret;
+    char* ptr;
+
+    ret = ParseCertRelative(cert, type, verify, cm);
+    if (ret < 0)
+        return ret;
+
+    if (cert->subjectCNLen > 0) {
+        ptr = (char*) XMALLOC(cert->subjectCNLen + 1, cert->heap,
+                              DYNAMIC_TYPE_SUBJECT_CN);
+        if (ptr == NULL)
+            return MEMORY_E;
+        XMEMCPY(ptr, cert->subjectCN, cert->subjectCNLen);
+        ptr[cert->subjectCNLen] = '\0';
+        cert->subjectCN = ptr;
+        cert->subjectCNStored = 1;
+    }
+
+    if (cert->keyOID == RSAk && cert->pubKeySize > 0) {
+        ptr = (char*) XMALLOC(cert->pubKeySize, cert->heap,
+                              DYNAMIC_TYPE_PUBLIC_KEY);
+        if (ptr == NULL)
+            return MEMORY_E;
+        XMEMCPY(ptr, cert->publicKey, cert->pubKeySize);
+        cert->publicKey = (byte *)ptr;
+        cert->pubKeyStored = 1;
+    }
+
+    return ret;
+}
+
+
+/* from SSL proper, for locking can't do find here anymore */
+#ifdef __cplusplus
+    extern "C" {
+#endif
+    CYASSL_LOCAL Signer* GetCA(void* signers, byte* hash);
+#ifdef __cplusplus
+    } 
+#endif
+
+
+int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
+{
+    word32 confirmOID;
+    int    ret;
+    int    badDate = 0;
+
+    if ((ret = DecodeToKey(cert, verify)) < 0) {
+        if (ret == ASN_BEFORE_DATE_E || ret == ASN_AFTER_DATE_E)
+            badDate = ret;
+        else
+            return ret;
+    }
+
+    if (cert->srcIdx != cert->sigIndex) {
+        if (cert->srcIdx < cert->sigIndex) {
+            /* save extensions */
+            cert->extensions    = &cert->source[cert->srcIdx];
+            cert->extensionsSz  =  cert->sigIndex - cert->srcIdx;
+            cert->extensionsIdx = cert->srcIdx;   /* for potential later use */
+        }
+        DecodeCertExtensions(cert);
+        /* advance past extensions */
+        cert->srcIdx =  cert->sigIndex;
+    }
+
+    if ((ret = GetAlgoId(cert->source, &cert->srcIdx, &confirmOID,
+                         cert->maxIdx)) < 0)
+        return ret;
+
+    if ((ret = GetSignature(cert)) < 0)
+        return ret;
+
+    if (confirmOID != cert->signatureOID)
+        return ASN_SIG_OID_E;
+
+    if (verify && type != CA_TYPE) {
+        Signer* ca = GetCA(cm, cert->issuerHash);
+        CYASSL_MSG("About to verify certificate signature");
+        if (ca) {
+#ifdef HAVE_OCSP
+            /* Need the ca's public key hash for OCSP */
+            {
+                Sha sha;
+                InitSha(&sha);
+                ShaUpdate(&sha, ca->publicKey, ca->pubKeySize);
+                ShaFinal(&sha, cert->issuerKeyHash);
+            }
+#endif /* HAVE_OCSP */
+            /* try to confirm/verify signature */
+            if (!ConfirmSignature(cert->source + cert->certBegin,
+                        cert->sigIndex - cert->certBegin,
+                    ca->publicKey, ca->pubKeySize, ca->keyOID,
+                    cert->signature, cert->sigLength, cert->signatureOID,
+                    cert->heap)) {
+                CYASSL_MSG("Confirm signature failed");
+                return ASN_SIG_CONFIRM_E;
+            }
+        }
+        else {
+            /* no signer */
+            CYASSL_MSG("No CA signer to verify with");
+            return ASN_SIG_CONFIRM_E;
+        }
+    }
+
+    if (badDate != 0)
+        return badDate;
+
+    return 0;
+}
+
+
+Signer* MakeSigner(void* heap)
+{
+    Signer* signer = (Signer*) XMALLOC(sizeof(Signer), heap,
+                                       DYNAMIC_TYPE_SIGNER);
+    if (signer) {
+        signer->name      = 0;
+        signer->publicKey = 0;
+        signer->next      = 0;
+    }
+    (void)heap;
+
+    return signer;
+}
+
+
+void FreeSigners(Signer* signer, void* heap)
+{
+    while (signer) {
+        Signer* next = signer->next;
+
+        XFREE(signer->name, heap, DYNAMIC_TYPE_SUBJECT_CN);
+        XFREE(signer->publicKey, heap, DYNAMIC_TYPE_PUBLIC_KEY);
+        XFREE(signer, heap, DYNAMIC_TYPE_SIGNER);
+
+        signer = next;
+    }
+    (void)heap;
+}
+
+
+void CTaoCryptErrorString(int error, char* buffer)
+{
+    const int max = MAX_ERROR_SZ;   /* shorthand */
+
+#ifdef NO_ERROR_STRINGS
+
+    XSTRNCPY(buffer, "no support for error strings built in", max);
+
+#else
+
+    switch (error) {
+
+    case OPEN_RAN_E :        
+        XSTRNCPY(buffer, "opening random device error", max);
+        break;
+
+    case READ_RAN_E :
+        XSTRNCPY(buffer, "reading random device error", max);
+        break;
+
+    case WINCRYPT_E :
+        XSTRNCPY(buffer, "windows crypt init error", max);
+        break;
+
+    case CRYPTGEN_E : 
+        XSTRNCPY(buffer, "windows crypt generation error", max);
+        break;
+
+    case RAN_BLOCK_E : 
+        XSTRNCPY(buffer, "random device read would block error", max);
+        break;
+
+    case MP_INIT_E :
+        XSTRNCPY(buffer, "mp_init error state", max);
+        break;
+
+    case MP_READ_E :
+        XSTRNCPY(buffer, "mp_read error state", max);
+        break;
+
+    case MP_EXPTMOD_E :
+        XSTRNCPY(buffer, "mp_exptmod error state", max);
+        break;
+
+    case MP_TO_E :
+        XSTRNCPY(buffer, "mp_to_xxx error state, can't convert", max);
+        break;
+
+    case MP_SUB_E :
+        XSTRNCPY(buffer, "mp_sub error state, can't subtract", max);
+        break;
+
+    case MP_ADD_E :
+        XSTRNCPY(buffer, "mp_add error state, can't add", max);
+        break;
+
+    case MP_MUL_E :
+        XSTRNCPY(buffer, "mp_mul error state, can't multiply", max);
+        break;
+
+    case MP_MULMOD_E :
+        XSTRNCPY(buffer, "mp_mulmod error state, can't multiply mod", max);
+        break;
+
+    case MP_MOD_E :
+        XSTRNCPY(buffer, "mp_mod error state, can't mod", max);
+        break;
+
+    case MP_INVMOD_E :
+        XSTRNCPY(buffer, "mp_invmod error state, can't inv mod", max);
+        break; 
+        
+    case MP_CMP_E :
+        XSTRNCPY(buffer, "mp_cmp error state", max);
+        break; 
+        
+    case MP_ZERO_E :
+        XSTRNCPY(buffer, "mp zero result, not expected", max);
+        break; 
+        
+    case MEMORY_E :
+        XSTRNCPY(buffer, "out of memory error", max);
+        break;
+
+    case RSA_WRONG_TYPE_E :
+        XSTRNCPY(buffer, "RSA wrong block type for RSA function", max);
+        break; 
+
+    case RSA_BUFFER_E :
+        XSTRNCPY(buffer, "RSA buffer error, output too small or input too big",
+                max);
+        break; 
+
+    case BUFFER_E :
+        XSTRNCPY(buffer, "Buffer error, output too small or input too big",max);
+        break; 
+
+    case ALGO_ID_E :
+        XSTRNCPY(buffer, "Setting Cert AlogID error", max);
+        break; 
+
+    case PUBLIC_KEY_E :
+        XSTRNCPY(buffer, "Setting Cert Public Key error", max);
+        break; 
+
+    case DATE_E :
+        XSTRNCPY(buffer, "Setting Cert Date validity error", max);
+        break; 
+
+    case SUBJECT_E :
+        XSTRNCPY(buffer, "Setting Cert Subject name error", max);
+        break; 
+
+    case ISSUER_E :
+        XSTRNCPY(buffer, "Setting Cert Issuer name error", max);
+        break; 
+
+    case CA_TRUE_E :
+        XSTRNCPY(buffer, "Setting basic constraint CA true error", max);
+        break; 
+
+    case EXTENSIONS_E :
+        XSTRNCPY(buffer, "Setting extensions error", max);
+        break; 
+
+    case ASN_PARSE_E :
+        XSTRNCPY(buffer, "ASN parsing error, invalid input", max);
+        break;
+
+    case ASN_VERSION_E :
+        XSTRNCPY(buffer, "ASN version error, invalid number", max);
+        break;
+
+    case ASN_GETINT_E :
+        XSTRNCPY(buffer, "ASN get big int error, invalid data", max);
+        break;
+
+    case ASN_RSA_KEY_E :
+        XSTRNCPY(buffer, "ASN key init error, invalid input", max);
+        break;
+
+    case ASN_OBJECT_ID_E :
+        XSTRNCPY(buffer, "ASN object id error, invalid id", max);
+        break;
+
+    case ASN_TAG_NULL_E :
+        XSTRNCPY(buffer, "ASN tag error, not null", max);
+        break;
+
+    case ASN_EXPECT_0_E :
+        XSTRNCPY(buffer, "ASN expect error, not zero", max);
+        break;
+
+    case ASN_BITSTR_E :
+        XSTRNCPY(buffer, "ASN bit string error, wrong id", max);
+        break;
+
+    case ASN_UNKNOWN_OID_E :
+        XSTRNCPY(buffer, "ASN oid error, unknown sum id", max);
+        break;
+
+    case ASN_DATE_SZ_E :
+        XSTRNCPY(buffer, "ASN date error, bad size", max);
+        break;
+
+    case ASN_BEFORE_DATE_E :
+        XSTRNCPY(buffer, "ASN date error, current date before", max);
+        break;
+
+    case ASN_AFTER_DATE_E :
+        XSTRNCPY(buffer, "ASN date error, current date after", max);
+        break;
+
+    case ASN_SIG_OID_E :
+        XSTRNCPY(buffer, "ASN signature error, mismatched oid", max);
+        break;
+
+    case ASN_TIME_E :
+        XSTRNCPY(buffer, "ASN time error, unkown time type", max);
+        break;
+
+    case ASN_INPUT_E :
+        XSTRNCPY(buffer, "ASN input error, not enough data", max);
+        break;
+
+    case ASN_SIG_CONFIRM_E :
+        XSTRNCPY(buffer, "ASN sig error, confirm failure", max);
+        break;
+
+    case ASN_SIG_HASH_E :
+        XSTRNCPY(buffer, "ASN sig error, unsupported hash type", max);
+        break;
+
+    case ASN_SIG_KEY_E :
+        XSTRNCPY(buffer, "ASN sig error, unsupported key type", max);
+        break;
+
+    case ASN_DH_KEY_E :
+        XSTRNCPY(buffer, "ASN key init error, invalid input", max);
+        break;
+
+    case ASN_NTRU_KEY_E :
+        XSTRNCPY(buffer, "ASN NTRU key decode error, invalid input", max);
+        break;
+
+    case ECC_BAD_ARG_E :
+        XSTRNCPY(buffer, "ECC input argument wrong type, invalid input", max);
+        break;
+
+    case ASN_ECC_KEY_E :
+        XSTRNCPY(buffer, "ECC ASN1 bad key data, invalid input", max);
+        break;
+
+    case ECC_CURVE_OID_E :
+        XSTRNCPY(buffer, "ECC curve sum OID unsupported, invalid input", max);
+        break;
+
+    case BAD_FUNC_ARG :
+        XSTRNCPY(buffer, "Bad function argument", max);
+        break;
+
+    case NOT_COMPILED_IN :
+        XSTRNCPY(buffer, "Feature not compiled in", max);
+        break;
+
+    case UNICODE_SIZE_E :
+        XSTRNCPY(buffer, "Unicode password too big", max);
+        break;
+
+    case NO_PASSWORD :
+        XSTRNCPY(buffer, "No password provided by user", max);
+        break;
+
+    case ALT_NAME_E :
+        XSTRNCPY(buffer, "Alt Name problem, too big", max);
+        break;
+
+    case AES_GCM_AUTH_E:
+        XSTRNCPY(buffer, "AES-GCM Authentication check fail", max);
+        break;
+
+    default:
+        XSTRNCPY(buffer, "unknown error number", max);
+
+    }
+
+#endif /* NO_ERROR_STRINGS */
+
+}
+
+
+#if defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN)
+
+static int SetMyVersion(word32 version, byte* output, int header)
+{
+    int i = 0;
+
+    if (header) {
+        output[i++] = ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED;
+        output[i++] = ASN_BIT_STRING;
+    }
+    output[i++] = ASN_INTEGER;
+    output[i++] = 0x01;
+    output[i++] = (byte)version;
+
+    return i;
+}
+
+
+int DerToPem(const byte* der, word32 derSz, byte* output, word32 outSz,
+             int type)
+{
+    char header[80];
+    char footer[80];
+
+    int headerLen;
+    int footerLen;
+    int i;
+    int err;
+    int outLen;   /* return length or error */
+
+    if (type == CERT_TYPE) {
+        XSTRNCPY(header, "-----BEGIN CERTIFICATE-----\n", sizeof(header));
+        XSTRNCPY(footer, "-----END CERTIFICATE-----\n", sizeof(footer));
+    } else {
+        XSTRNCPY(header, "-----BEGIN RSA PRIVATE KEY-----\n", sizeof(header));
+        XSTRNCPY(footer, "-----END RSA PRIVATE KEY-----\n", sizeof(footer));
+    }
+
+    headerLen = XSTRLEN(header);
+    footerLen = XSTRLEN(footer);
+
+    if (!der || !output)
+        return BAD_FUNC_ARG;
+
+    /* don't even try if outSz too short */
+    if (outSz < headerLen + footerLen + derSz)
+        return BAD_FUNC_ARG;
+
+    /* header */
+    XMEMCPY(output, header, headerLen);
+    i = headerLen;
+
+    /* body */
+    outLen = outSz;  /* input to Base64_Encode */
+    if ( (err = Base64_Encode(der, derSz, output + i, (word32*)&outLen)) < 0)
+        return err;
+    i += outLen;
+
+    /* footer */
+    if ( (i + footerLen) > (int)outSz)
+        return BAD_FUNC_ARG;
+    XMEMCPY(output + i, footer, footerLen);
+
+    return outLen + headerLen + footerLen;
+}
+
+
+#endif /* CYASSL_KEY_GEN || CYASSL_CERT_GEN */
+
+
+#ifdef CYASSL_KEY_GEN
+
+
+static mp_int* GetRsaInt(RsaKey* key, int idx)
+{
+    if (idx == 0)
+        return &key->n;
+    if (idx == 1)
+        return &key->e;
+    if (idx == 2)
+        return &key->d;
+    if (idx == 3)
+        return &key->p;
+    if (idx == 4)
+        return &key->q;
+    if (idx == 5)
+        return &key->dP;
+    if (idx == 6)
+        return &key->dQ;
+    if (idx == 7)
+        return &key->u;
+
+    return NULL;
+}
+
+
+/* Convert RsaKey key to DER format, write to output (inLen), return bytes
+   written */
+int RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
+{
+    word32 seqSz, verSz, rawLen, intTotalLen = 0;
+    word32 sizes[RSA_INTS];
+    int    i, j, outLen;
+
+    byte seq[MAX_SEQ_SZ];
+    byte ver[MAX_VERSION_SZ];
+    byte tmps[RSA_INTS][MAX_RSA_INT_SZ];
+
+    if (!key || !output)
+        return BAD_FUNC_ARG;
+
+    if (key->type != RSA_PRIVATE)
+        return BAD_FUNC_ARG;
+
+    /* write all big ints from key to DER tmps */
+    for (i = 0; i < RSA_INTS; i++) {
+        mp_int* keyInt = GetRsaInt(key, i);
+        rawLen = mp_unsigned_bin_size(keyInt);
+
+        tmps[i][0] = ASN_INTEGER;
+        sizes[i] = SetLength(rawLen, tmps[i] + 1) + 1;  /* int tag */
+
+        if ( (sizes[i] + rawLen) < sizeof(tmps[i])) {
+            int err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]);
+            if (err == MP_OKAY) {
+                sizes[i] += rawLen;
+                intTotalLen += sizes[i];
+            }
+            else
+                return err;
+        }
+        else
+            return ASN_INPUT_E; 
+    }
+
+    /* make headers */
+    verSz = SetMyVersion(0, ver, FALSE);
+    seqSz = SetSequence(verSz + intTotalLen, seq);
+
+    outLen = seqSz + verSz + intTotalLen;
+    if (outLen > (int)inLen)
+        return BAD_FUNC_ARG;
+
+    /* write to output */
+    XMEMCPY(output, seq, seqSz);
+    j = seqSz;
+    XMEMCPY(output + j, ver, verSz);
+    j += verSz;
+
+    for (i = 0; i < RSA_INTS; i++) {
+        XMEMCPY(output + j, tmps[i], sizes[i]);
+        j += sizes[i];
+    }
+
+    return outLen;
+}
+
+#endif /* CYASSL_KEY_GEN */
+
+
+#ifdef CYASSL_CERT_GEN
+
+/* Initialize and Set Certficate defaults:
+   version    = 3 (0x2)
+   serial     = 0
+   sigType    = SHA_WITH_RSA
+   issuer     = blank
+   daysValid  = 500
+   selfSigned = 1 (true) use subject as issuer
+   subject    = blank
+*/
+void InitCert(Cert* cert)
+{
+    cert->version    = 2;   /* version 3 is hex 2 */
+    cert->sigType    = CTC_SHAwRSA;
+    cert->daysValid  = 500;
+    cert->selfSigned = 1;
+    cert->isCA       = 0;
+    cert->bodySz     = 0;
+#ifdef CYASSL_ALT_NAMES
+    cert->altNamesSz   = 0;
+    cert->beforeDateSz = 0;
+    cert->afterDateSz  = 0;
+#endif
+    cert->keyType    = RSA_KEY;
+    XMEMSET(cert->serial, 0, CTC_SERIAL_SIZE);
+
+    cert->issuer.country[0] = '\0';
+    cert->issuer.state[0] = '\0';
+    cert->issuer.locality[0] = '\0';
+    cert->issuer.sur[0] = '\0';
+    cert->issuer.org[0] = '\0';
+    cert->issuer.unit[0] = '\0';
+    cert->issuer.commonName[0] = '\0';
+    cert->issuer.email[0] = '\0';
+
+    cert->subject.country[0] = '\0';
+    cert->subject.state[0] = '\0';
+    cert->subject.locality[0] = '\0';
+    cert->subject.sur[0] = '\0';
+    cert->subject.org[0] = '\0';
+    cert->subject.unit[0] = '\0';
+    cert->subject.commonName[0] = '\0';
+    cert->subject.email[0] = '\0';
+}
+
+
+/* DER encoded x509 Certificate */
+typedef struct DerCert {
+    byte size[MAX_LENGTH_SZ];          /* length encoded */
+    byte version[MAX_VERSION_SZ];      /* version encoded */
+    byte serial[CTC_SERIAL_SIZE + MAX_LENGTH_SZ]; /* serial number encoded */
+    byte sigAlgo[MAX_ALGO_SZ];         /* signature algo encoded */
+    byte issuer[ASN_NAME_MAX];         /* issuer  encoded */
+    byte subject[ASN_NAME_MAX];        /* subject encoded */
+    byte validity[MAX_DATE_SIZE*2 + MAX_SEQ_SZ*2];  /* before and after dates */
+    byte publicKey[MAX_PUBLIC_KEY_SZ]; /* rsa / ntru public key encoded */
+    byte ca[MAX_CA_SZ];                /* basic constraint CA true size */
+    byte extensions[MAX_EXTENSIONS_SZ];  /* all extensions */
+    int  sizeSz;                       /* encoded size length */
+    int  versionSz;                    /* encoded version length */
+    int  serialSz;                     /* encoded serial length */
+    int  sigAlgoSz;                    /* enocded sig alog length */
+    int  issuerSz;                     /* encoded issuer length */
+    int  subjectSz;                    /* encoded subject length */
+    int  validitySz;                   /* encoded validity length */
+    int  publicKeySz;                  /* encoded public key length */
+    int  caSz;                         /* encoded CA extension length */
+    int  extensionsSz;                 /* encoded extensions total length */
+    int  total;                        /* total encoded lengths */
+} DerCert;
+
+
+/* Write a set header to output */
+static word32 SetSet(word32 len, byte* output)
+{
+    output[0] = ASN_SET | ASN_CONSTRUCTED;
+    return SetLength(len, output + 1) + 1;
+}
+
+
+/* Write a serial number to output */
+static int SetSerial(const byte* serial, byte* output)
+{
+    int length = 0;
+
+    output[length++] = ASN_INTEGER;
+    length += SetLength(CTC_SERIAL_SIZE, &output[length]);
+    XMEMCPY(&output[length], serial, CTC_SERIAL_SIZE);
+
+    return length + CTC_SERIAL_SIZE;
+}
+
+
+/* Write a public RSA key to output */
+static int SetPublicKey(byte* output, RsaKey* key)
+{
+    byte n[MAX_RSA_INT_SZ];
+    byte e[MAX_RSA_E_SZ];
+    byte algo[MAX_ALGO_SZ];
+    byte seq[MAX_SEQ_SZ];
+    byte len[MAX_LENGTH_SZ + 1];  /* trailing 0 */
+    int  nSz;
+    int  eSz;
+    int  algoSz;
+    int  seqSz;
+    int  lenSz;
+    int  idx;
+    int  rawLen;
+
+    /* n */
+    rawLen = mp_unsigned_bin_size(&key->n);
+    n[0] = ASN_INTEGER;
+    nSz  = SetLength(rawLen, n + 1) + 1;  /* int tag */
+
+    if ( (nSz + rawLen) < (int)sizeof(n)) {
+        int err = mp_to_unsigned_bin(&key->n, n + nSz);
+        if (err == MP_OKAY)
+            nSz += rawLen;
+        else
+            return MP_TO_E;
+    }
+    else
+        return BUFFER_E;
+
+    /* e */
+    rawLen = mp_unsigned_bin_size(&key->e);
+    e[0] = ASN_INTEGER;
+    eSz  = SetLength(rawLen, e + 1) + 1;  /* int tag */
+
+    if ( (eSz + rawLen) < (int)sizeof(e)) {
+        int err = mp_to_unsigned_bin(&key->e, e + eSz);
+        if (err == MP_OKAY)
+            eSz += rawLen;
+        else
+            return MP_TO_E;
+    }
+    else
+        return BUFFER_E;
+
+    /* headers */
+    algoSz = SetAlgoID(RSAk, algo, keyType);
+    seqSz  = SetSequence(nSz + eSz, seq);
+    lenSz  = SetLength(seqSz + nSz + eSz + 1, len);
+    len[lenSz++] = 0;   /* trailing 0 */
+
+    /* write */
+    idx = SetSequence(nSz + eSz + seqSz + lenSz + 1 + algoSz, output);
+        /* 1 is for ASN_BIT_STRING */
+    /* algo */
+    XMEMCPY(output + idx, algo, algoSz);
+    idx += algoSz;
+    /* bit string */
+    output[idx++] = ASN_BIT_STRING;
+    /* length */
+    XMEMCPY(output + idx, len, lenSz);
+    idx += lenSz;
+    /* seq */
+    XMEMCPY(output + idx, seq, seqSz);
+    idx += seqSz;
+    /* n */
+    XMEMCPY(output + idx, n, nSz);
+    idx += nSz;
+    /* e */
+    XMEMCPY(output + idx, e, eSz);
+    idx += eSz;
+
+    return idx;
+}
+
+
+static INLINE byte itob(int number)
+{
+    return (byte)number + 0x30;
+}
+
+
+/* write time to output, format */
+static void SetTime(struct tm* date, byte* output)
+{
+    int i = 0;
+
+    output[i++] = itob((date->tm_year % 10000) / 1000);
+    output[i++] = itob((date->tm_year % 1000)  /  100);
+    output[i++] = itob((date->tm_year % 100)   /   10);
+    output[i++] = itob( date->tm_year % 10);
+
+    output[i++] = itob(date->tm_mon / 10);
+    output[i++] = itob(date->tm_mon % 10);
+
+    output[i++] = itob(date->tm_mday / 10);
+    output[i++] = itob(date->tm_mday % 10);
+
+    output[i++] = itob(date->tm_hour / 10);
+    output[i++] = itob(date->tm_hour % 10);
+
+    output[i++] = itob(date->tm_min / 10);
+    output[i++] = itob(date->tm_min % 10);
+
+    output[i++] = itob(date->tm_sec / 10);
+    output[i++] = itob(date->tm_sec % 10);
+    
+    output[i] = 'Z';  /* Zulu profile */
+}
+
+
+#ifdef CYASSL_ALT_NAMES
+
+/* Copy Dates from cert, return bytes written */
+static int CopyValidity(byte* output, Cert* cert)
+{
+    int seqSz;
+
+    CYASSL_ENTER("CopyValidity");
+
+    /* headers and output */
+    seqSz = SetSequence(cert->beforeDateSz + cert->afterDateSz, output);
+    XMEMCPY(output + seqSz, cert->beforeDate, cert->beforeDateSz);
+    XMEMCPY(output + seqSz + cert->beforeDateSz, cert->afterDate,
+                                                 cert->afterDateSz);
+    return seqSz + cert->beforeDateSz + cert->afterDateSz;
+}
+
+#endif
+
+
+/* Set Date validity from now until now + daysValid */
+static int SetValidity(byte* output, int daysValid)
+{
+    byte before[MAX_DATE_SIZE];
+    byte  after[MAX_DATE_SIZE];
+
+    int beforeSz;
+    int afterSz;
+    int seqSz;
+
+    time_t     ticks;
+    struct tm* now;
+    struct tm  local;
+
+    ticks = XTIME(0);
+    now   = XGMTIME(&ticks);
+
+    /* before now */
+    local = *now;
+    before[0] = ASN_GENERALIZED_TIME;
+    beforeSz  = SetLength(ASN_GEN_TIME_SZ, before + 1) + 1;  /* gen tag */
+
+    /* subtract 1 day for more compliance */
+    local.tm_mday -= 1;
+    mktime(&local);
+
+    /* adjust */
+    local.tm_year += 1900;
+    local.tm_mon  +=    1;
+
+    SetTime(&local, before + beforeSz);
+    beforeSz += ASN_GEN_TIME_SZ;
+    
+    /* after now + daysValid */
+    local = *now;
+    after[0] = ASN_GENERALIZED_TIME;
+    afterSz  = SetLength(ASN_GEN_TIME_SZ, after + 1) + 1;  /* gen tag */
+
+    /* add daysValid */
+    local.tm_mday += daysValid;
+    mktime(&local);
+
+    /* adjust */
+    local.tm_year += 1900;
+    local.tm_mon  +=    1;
+
+    SetTime(&local, after + afterSz);
+    afterSz += ASN_GEN_TIME_SZ;
+
+    /* headers and output */
+    seqSz = SetSequence(beforeSz + afterSz, output);
+    XMEMCPY(output + seqSz, before, beforeSz);
+    XMEMCPY(output + seqSz + beforeSz, after, afterSz);
+
+    return seqSz + beforeSz + afterSz;
+}
+
+
+/* ASN Encoded Name field */
+typedef struct EncodedName {
+    int  nameLen;                /* actual string value length */
+    int  totalLen;               /* total encoded length */
+    int  type;                   /* type of name */
+    int  used;                   /* are we actually using this one */
+    byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
+} EncodedName;
+
+
+/* Get Which Name from index */
+static const char* GetOneName(CertName* name, int idx)
+{
+    switch (idx) {
+    case 0:
+       return name->country;
+       break;
+    case 1:
+       return name->state;
+       break;
+    case 2:
+       return name->locality;
+       break;
+    case 3:
+       return name->sur;
+       break;
+    case 4:
+       return name->org;
+       break;
+    case 5:
+       return name->unit;
+       break;
+    case 6:
+       return name->commonName;
+       break;
+    case 7:
+       return name->email;
+       break;
+    default:
+       return 0;
+    }
+}
+
+
+/* Get ASN Name from index */
+static byte GetNameId(int idx)
+{
+    switch (idx) {
+    case 0:
+       return ASN_COUNTRY_NAME;
+       break;
+    case 1:
+       return ASN_STATE_NAME;
+       break;
+    case 2:
+       return ASN_LOCALITY_NAME;
+       break;
+    case 3:
+       return ASN_SUR_NAME;
+       break;
+    case 4:
+       return ASN_ORG_NAME;
+       break;
+    case 5:
+       return ASN_ORGUNIT_NAME;
+       break;
+    case 6:
+       return ASN_COMMON_NAME;
+       break;
+    case 7:
+       /* email uses different id type */
+       return 0;
+       break;
+    default:
+       return 0;
+    }
+}
+
+
+/* encode all extensions, return total bytes written */
+static int SetExtensions(byte* output, const byte* ext, int extSz)
+{
+    byte sequence[MAX_SEQ_SZ];
+    byte len[MAX_LENGTH_SZ];
+
+    int sz = 0;
+    int seqSz = SetSequence(extSz, sequence);
+    int lenSz = SetLength(seqSz + extSz, len);
+
+    output[0] = ASN_EXTENSIONS; /* extensions id */
+    sz++;
+    XMEMCPY(&output[sz], len, lenSz);  /* length */
+    sz += lenSz; 
+    XMEMCPY(&output[sz], sequence, seqSz);  /* sequence */
+    sz += seqSz;
+    XMEMCPY(&output[sz], ext, extSz);  /* extensions */
+    sz += extSz;
+
+    return sz;
+}
+
+
+/* encode CA basic constraint true, return total bytes written */
+static int SetCa(byte* output)
+{
+    static const byte ca[] = { 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04,
+                               0x05, 0x30, 0x03, 0x01, 0x01, 0xff };
+    
+    XMEMCPY(output, ca, sizeof(ca));
+
+    return (int)sizeof(ca);
+}
+
+
+/* encode CertName into output, return total bytes written */
+static int SetName(byte* output, CertName* name)
+{
+    int         totalBytes = 0, i, idx;
+    EncodedName names[NAME_ENTRIES];
+
+    for (i = 0; i < NAME_ENTRIES; i++) {
+        const char* nameStr = GetOneName(name, i);
+        if (nameStr) {
+            /* bottom up */
+            byte firstLen[MAX_LENGTH_SZ];
+            byte secondLen[MAX_LENGTH_SZ];
+            byte sequence[MAX_SEQ_SZ];
+            byte set[MAX_SET_SZ];
+
+            int email = i == (NAME_ENTRIES - 1) ? 1 : 0;
+            int strLen  = XSTRLEN(nameStr);
+            int thisLen = strLen;
+            int firstSz, secondSz, seqSz, setSz;
+
+            if (strLen == 0) { /* no user data for this item */
+                names[i].used = 0;
+                continue;
+            }
+
+            secondSz = SetLength(strLen, secondLen);
+            thisLen += secondSz;
+            if (email) {
+                thisLen += EMAIL_JOINT_LEN;
+                thisLen ++;                               /* id type */
+                firstSz  = SetLength(EMAIL_JOINT_LEN, firstLen);
+            }
+            else {
+                thisLen++;                                 /* str type */
+                thisLen++;                                 /* id  type */
+                thisLen += JOINT_LEN;    
+                firstSz = SetLength(JOINT_LEN + 1, firstLen);
+            }
+            thisLen += firstSz;
+            thisLen++;                                /* object id */
+
+            seqSz = SetSequence(thisLen, sequence);
+            thisLen += seqSz;
+            setSz = SetSet(thisLen, set);
+            thisLen += setSz;
+
+            if (thisLen > (int)sizeof(names[i].encoded))
+                return BUFFER_E;
+
+            /* store it */
+            idx = 0;
+            /* set */
+            XMEMCPY(names[i].encoded, set, setSz);
+            idx += setSz;
+            /* seq */
+            XMEMCPY(names[i].encoded + idx, sequence, seqSz);
+            idx += seqSz;
+            /* asn object id */
+            names[i].encoded[idx++] = ASN_OBJECT_ID;
+            /* first length */
+            XMEMCPY(names[i].encoded + idx, firstLen, firstSz);
+            idx += firstSz;
+            if (email) {
+                const byte EMAIL_OID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+                                           0x01, 0x09, 0x01, 0x16 };
+                /* email joint id */
+                XMEMCPY(names[i].encoded + idx, EMAIL_OID, sizeof(EMAIL_OID));
+                idx += sizeof(EMAIL_OID);
+            }
+            else {
+                /* joint id */
+                names[i].encoded[idx++] = 0x55;
+                names[i].encoded[idx++] = 0x04;
+                /* id type */
+                names[i].encoded[idx++] = GetNameId(i);
+                /* str type */
+                names[i].encoded[idx++] = 0x13;
+            }
+            /* second length */
+            XMEMCPY(names[i].encoded + idx, secondLen, secondSz);
+            idx += secondSz;
+            /* str value */
+            XMEMCPY(names[i].encoded + idx, nameStr, strLen);
+            idx += strLen;
+
+            totalBytes += idx;
+            names[i].totalLen = idx;
+            names[i].used = 1;
+        }
+        else
+            names[i].used = 0;
+    }
+
+    /* header */
+    idx = SetSequence(totalBytes, output);
+    totalBytes += idx;
+    if (totalBytes > ASN_NAME_MAX)
+        return BUFFER_E;
+
+    for (i = 0; i < NAME_ENTRIES; i++) {
+        if (names[i].used) {
+            XMEMCPY(output + idx, names[i].encoded, names[i].totalLen);
+            idx += names[i].totalLen;
+        }
+    }
+    return totalBytes;
+}
+
+
+/* encode info from cert into DER enocder format */
+static int EncodeCert(Cert* cert, DerCert* der, RsaKey* rsaKey, RNG* rng,
+                      const byte* ntruKey, word16 ntruSz)
+{
+    (void)ntruKey;
+    (void)ntruSz;
+    /* version */
+    der->versionSz = SetMyVersion(cert->version, der->version, TRUE);
+
+    /* serial number */
+    RNG_GenerateBlock(rng, cert->serial, CTC_SERIAL_SIZE);
+    cert->serial[0] = 0x01;   /* ensure positive */
+    der->serialSz  = SetSerial(cert->serial, der->serial);
+
+    /* signature algo */
+    der->sigAlgoSz = SetAlgoID(cert->sigType, der->sigAlgo, sigType);
+    if (der->sigAlgoSz == 0)
+        return ALGO_ID_E;
+
+    /* public key */
+    if (cert->keyType == RSA_KEY) {
+        der->publicKeySz = SetPublicKey(der->publicKey, rsaKey);
+        if (der->publicKeySz == 0)
+            return PUBLIC_KEY_E;
+    }
+    else {
+#ifdef HAVE_NTRU
+        word32 rc;
+        word16 encodedSz;
+
+        rc  = crypto_ntru_encrypt_publicKey2SubjectPublicKeyInfo( ntruSz,
+                                              ntruKey, &encodedSz, NULL);
+        if (rc != NTRU_OK)
+            return PUBLIC_KEY_E;
+        if (encodedSz > MAX_PUBLIC_KEY_SZ)
+            return PUBLIC_KEY_E;
+
+        rc  = crypto_ntru_encrypt_publicKey2SubjectPublicKeyInfo( ntruSz,
+                              ntruKey, &encodedSz, der->publicKey);
+        if (rc != NTRU_OK)
+            return PUBLIC_KEY_E;
+
+        der->publicKeySz = encodedSz;
+#endif
+    }
+
+    der->validitySz = 0;
+#ifdef CYASSL_ALT_NAMES
+    /* date validity copy ? */
+    if (cert->beforeDateSz && cert->afterDateSz) {
+        der->validitySz = CopyValidity(der->validity, cert);
+        if (der->validitySz == 0)
+            return DATE_E;
+    }
+#endif
+
+    /* date validity */
+    if (der->validitySz == 0) {
+        der->validitySz = SetValidity(der->validity, cert->daysValid);
+        if (der->validitySz == 0)
+            return DATE_E;
+    }
+
+    /* subject name */
+    der->subjectSz = SetName(der->subject, &cert->subject);
+    if (der->subjectSz == 0)
+        return SUBJECT_E;
+
+    /* issuer name */
+    der->issuerSz = SetName(der->issuer, cert->selfSigned ?
+             &cert->subject : &cert->issuer);
+    if (der->issuerSz == 0)
+        return ISSUER_E;
+
+    /* CA */
+    if (cert->isCA) {
+        der->caSz = SetCa(der->ca);
+        if (der->caSz == 0)
+            return CA_TRUE_E;
+    }
+    else
+        der->caSz = 0;
+
+    /* extensions, just CA now */
+    if (cert->isCA) {
+        der->extensionsSz = SetExtensions(der->extensions, der->ca, der->caSz);
+        if (der->extensionsSz == 0)
+            return EXTENSIONS_E;
+    }
+    else
+        der->extensionsSz = 0;
+
+#ifdef CYASSL_ALT_NAMES
+    if (der->extensionsSz == 0 && cert->altNamesSz) {
+        der->extensionsSz = SetExtensions(der->extensions, cert->altNames,
+                                          cert->altNamesSz);
+        if (der->extensionsSz == 0)
+            return EXTENSIONS_E;
+    }
+#endif
+
+    der->total = der->versionSz + der->serialSz + der->sigAlgoSz +
+        der->publicKeySz + der->validitySz + der->subjectSz + der->issuerSz +
+        der->extensionsSz;
+
+    return 0;
+}
+
+
+/* write DER encoded cert to buffer, size already checked */
+static int WriteCertBody(DerCert* der, byte* buffer)
+{
+    int idx;
+
+    /* signed part header */
+    idx = SetSequence(der->total, buffer);
+    /* version */
+    XMEMCPY(buffer + idx, der->version, der->versionSz);
+    idx += der->versionSz;
+    /* serial */
+    XMEMCPY(buffer + idx, der->serial, der->serialSz);
+    idx += der->serialSz;
+    /* sig algo */
+    XMEMCPY(buffer + idx, der->sigAlgo, der->sigAlgoSz);
+    idx += der->sigAlgoSz;
+    /* issuer */
+    XMEMCPY(buffer + idx, der->issuer, der->issuerSz);
+    idx += der->issuerSz;
+    /* validity */
+    XMEMCPY(buffer + idx, der->validity, der->validitySz);
+    idx += der->validitySz;
+    /* subject */
+    XMEMCPY(buffer + idx, der->subject, der->subjectSz);
+    idx += der->subjectSz;
+    /* public key */
+    XMEMCPY(buffer + idx, der->publicKey, der->publicKeySz);
+    idx += der->publicKeySz;
+    if (der->extensionsSz) {
+        /* extensions */
+        XMEMCPY(buffer + idx, der->extensions, min(der->extensionsSz,
+                                                   sizeof(der->extensions)));
+        idx += der->extensionsSz;
+    }
+
+    return idx;
+}
+
+
+/* Make RSA signature from buffer (sz), write to sig (sigSz) */
+static int MakeSignature(const byte* buffer, int sz, byte* sig, int sigSz,
+                         RsaKey* key, RNG* rng, int sigAlgoType)
+{
+    byte    digest[SHA256_DIGEST_SIZE];     /* max size */
+    byte    encSig[MAX_ENCODED_DIG_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ];
+    int     encSigSz, digestSz, typeH;
+
+    if (sigAlgoType == CTC_MD5wRSA) {
+        Md5     md5;
+        InitMd5(&md5);
+        Md5Update(&md5, buffer, sz);
+        Md5Final(&md5, digest);
+        digestSz = MD5_DIGEST_SIZE;
+        typeH    = MD5h;
+    }
+    else if (sigAlgoType == CTC_SHAwRSA) {
+        Sha     sha;
+        InitSha(&sha);
+        ShaUpdate(&sha, buffer, sz);
+        ShaFinal(&sha, digest);
+        digestSz = SHA_DIGEST_SIZE;
+        typeH    = SHAh;
+    }
+    else if (sigAlgoType == CTC_SHA256wRSA) {
+        Sha256     sha256;
+        InitSha256(&sha256);
+        Sha256Update(&sha256, buffer, sz);
+        Sha256Final(&sha256, digest);
+        digestSz = SHA256_DIGEST_SIZE;
+        typeH    = SHA256h;
+    }
+    else
+        return ALGO_ID_E;
+
+    /* signature */
+    encSigSz = EncodeSignature(encSig, digest, digestSz, typeH);
+    return RsaSSL_Sign(encSig, encSigSz, sig, sigSz, key, rng);
+}
+
+
+/* add signature to end of buffer, size of buffer assumed checked, return
+   new length */
+static int AddSignature(byte* buffer, int bodySz, const byte* sig, int sigSz,
+                        int sigAlgoType)
+{
+    byte seq[MAX_SEQ_SZ];
+    int  idx = bodySz, seqSz;
+
+    /* algo */
+    idx += SetAlgoID(sigAlgoType, buffer + idx, sigType);
+    /* bit string */
+    buffer[idx++] = ASN_BIT_STRING;
+    /* length */
+    idx += SetLength(sigSz + 1, buffer + idx);
+    buffer[idx++] = 0;   /* trailing 0 */
+    /* signature */
+    XMEMCPY(buffer + idx, sig, sigSz);
+    idx += sigSz;
+
+    /* make room for overall header */
+    seqSz = SetSequence(idx, seq);
+    XMEMMOVE(buffer + seqSz, buffer, idx);
+    XMEMCPY(buffer, seq, seqSz);
+
+    return idx + seqSz;
+}
+
+
+/* Make an x509 Certificate v3 any key type from cert input, write to buffer */
+static int MakeAnyCert(Cert* cert, byte* derBuffer, word32 derSz,
+                   RsaKey* rsaKey, RNG* rng, const byte* ntruKey, word16 ntruSz)
+{
+    DerCert der;
+    int     ret;
+
+    cert->keyType = rsaKey ? RSA_KEY : NTRU_KEY;
+    ret = EncodeCert(cert, &der, rsaKey, rng, ntruKey, ntruSz);
+    if (ret != 0)
+        return ret;
+
+    if (der.total + MAX_SEQ_SZ * 2 > (int)derSz)
+        return BUFFER_E;
+
+    return cert->bodySz = WriteCertBody(&der, derBuffer);
+}
+
+
+/* Make an x509 Certificate v3 RSA from cert input, write to buffer */
+int MakeCert(Cert* cert, byte* derBuffer, word32 derSz, RsaKey* rsaKey,RNG* rng)
+{
+    return MakeAnyCert(cert, derBuffer, derSz, rsaKey, rng, NULL, 0);
+}
+
+
+#ifdef HAVE_NTRU
+
+int  MakeNtruCert(Cert* cert, byte* derBuffer, word32 derSz,
+                  const byte* ntruKey, word16 keySz, RNG* rng)
+{
+    return MakeAnyCert(cert, derBuffer, derSz, NULL, rng, ntruKey, keySz);
+}
+
+#endif /* HAVE_NTRU */
+
+
+int SignCert(Cert* cert, byte* buffer, word32 buffSz, RsaKey* key, RNG* rng)
+{
+    byte    sig[MAX_ENCODED_SIG_SZ];
+    int     sigSz;
+    int     bodySz = cert->bodySz;
+
+    if (bodySz < 0)
+        return bodySz;
+
+    sigSz  = MakeSignature(buffer, bodySz, sig, sizeof(sig), key, rng,
+                           cert->sigType);
+    if (sigSz < 0)
+        return sigSz; 
+
+    if (bodySz + MAX_SEQ_SZ * 2 + sigSz > (int)buffSz)
+        return BUFFER_E; 
+
+    return AddSignature(buffer, bodySz, sig, sigSz, cert->sigType);
+}
+
+
+int MakeSelfCert(Cert* cert, byte* buffer, word32 buffSz, RsaKey* key, RNG* rng)
+{
+    int ret = MakeCert(cert, buffer, buffSz, key, rng);
+
+    if (ret < 0)
+        return ret;
+
+    return SignCert(cert, buffer, buffSz, key, rng);
+}
+
+
+#ifdef CYASSL_ALT_NAMES 
+
+/* Set Alt Names from der cert, return 0 on success */
+static int SetAltNamesFromCert(Cert* cert, const byte* der, int derSz)
+{
+    DecodedCert decoded;
+    int         ret;
+
+    if (derSz < 0)
+        return derSz;
+
+    InitDecodedCert(&decoded, (byte*)der, derSz, 0);
+    ret = ParseCertRelative(&decoded, CA_TYPE, NO_VERIFY, 0);
+
+    if (ret < 0) {
+        FreeDecodedCert(&decoded);
+        return ret;
+    }
+
+    if (decoded.extensions) {
+        byte   b;
+        int    length;
+        word32 maxExtensionsIdx;
+
+        decoded.srcIdx = decoded.extensionsIdx;
+        b = decoded.source[decoded.srcIdx++];
+        if (b != ASN_EXTENSIONS) {
+            FreeDecodedCert(&decoded);
+            return ASN_PARSE_E;
+        }
+
+        if (GetLength(decoded.source, &decoded.srcIdx, &length,
+                      decoded.maxIdx) < 0) {
+            FreeDecodedCert(&decoded);
+            return ASN_PARSE_E;
+        }
+
+        if (GetSequence(decoded.source, &decoded.srcIdx, &length,
+                        decoded.maxIdx) < 0) {
+            FreeDecodedCert(&decoded);
+            return ASN_PARSE_E;
+        }
+
+        maxExtensionsIdx = decoded.srcIdx + length;
+
+        while (decoded.srcIdx < maxExtensionsIdx) {
+            word32 oid;
+            word32 startIdx = decoded.srcIdx;
+            word32 tmpIdx;
+
+            if (GetSequence(decoded.source, &decoded.srcIdx, &length,
+                        decoded.maxIdx) < 0) {
+                FreeDecodedCert(&decoded);
+                return ASN_PARSE_E;
+            }
+
+            tmpIdx = decoded.srcIdx;
+            decoded.srcIdx = startIdx;
+
+            if (GetAlgoId(decoded.source, &decoded.srcIdx, &oid,
+                          decoded.maxIdx) < 0) {
+                FreeDecodedCert(&decoded);
+                return ASN_PARSE_E;
+            }
+
+            if (oid == ALT_NAMES_OID) {
+                cert->altNamesSz = length + (tmpIdx - startIdx);
+
+                if (cert->altNamesSz < (int)sizeof(cert->altNames))
+                    XMEMCPY(cert->altNames, &decoded.source[startIdx],
+                        cert->altNamesSz);
+                else {
+                    cert->altNamesSz = 0;
+                    CYASSL_MSG("AltNames extensions too big");
+                    FreeDecodedCert(&decoded);
+                    return ALT_NAME_E;
+                }
+            }
+            decoded.srcIdx = tmpIdx + length;
+        }
+    }
+    FreeDecodedCert(&decoded);
+
+    return 0;
+}
+
+
+/* Set Dates from der cert, return 0 on success */
+static int SetDatesFromCert(Cert* cert, const byte* der, int derSz)
+{
+    DecodedCert decoded;
+    int         ret;
+
+    CYASSL_ENTER("SetDatesFromCert");
+    if (derSz < 0)
+        return derSz;
+
+    InitDecodedCert(&decoded, (byte*)der, derSz, 0);
+    ret = ParseCertRelative(&decoded, CA_TYPE, NO_VERIFY, 0);
+
+    if (ret < 0) {
+        CYASSL_MSG("ParseCertRelative error");
+        FreeDecodedCert(&decoded);
+        return ret;
+    }
+
+    if (decoded.beforeDate == NULL || decoded.afterDate == NULL) {
+        CYASSL_MSG("Couldn't extract dates");
+        FreeDecodedCert(&decoded);
+        return -1;
+    }
+
+    if (decoded.beforeDateLen > MAX_DATE_SIZE || decoded.afterDateLen >
+                                                 MAX_DATE_SIZE) {
+        CYASSL_MSG("Bad date size");
+        FreeDecodedCert(&decoded);
+        return -1;
+    }
+
+    XMEMCPY(cert->beforeDate, decoded.beforeDate, decoded.beforeDateLen);
+    XMEMCPY(cert->afterDate,  decoded.afterDate,  decoded.afterDateLen);
+
+    cert->beforeDateSz = decoded.beforeDateLen;
+    cert->afterDateSz  = decoded.afterDateLen;
+
+    return 0;
+}
+
+
+#endif /* CYASSL_ALT_NAMES */
+
+
+/* Set cn name from der buffer, return 0 on success */
+static int SetNameFromCert(CertName* cn, const byte* der, int derSz)
+{
+    DecodedCert decoded;
+    int         ret;
+    int         sz;
+
+    if (derSz < 0)
+        return derSz;
+
+    InitDecodedCert(&decoded, (byte*)der, derSz, 0);
+    ret = ParseCertRelative(&decoded, CA_TYPE, NO_VERIFY, 0);
+
+    if (ret < 0)
+        return ret;
+
+    if (decoded.subjectCN) {
+        sz = (decoded.subjectCNLen < CTC_NAME_SIZE) ? decoded.subjectCNLen :
+                                                  CTC_NAME_SIZE - 1;
+        strncpy(cn->commonName, decoded.subjectCN, CTC_NAME_SIZE);
+        cn->commonName[sz] = 0;
+    }
+    if (decoded.subjectC) {
+        sz = (decoded.subjectCLen < CTC_NAME_SIZE) ? decoded.subjectCLen :
+                                                 CTC_NAME_SIZE - 1;
+        strncpy(cn->country, decoded.subjectC, CTC_NAME_SIZE);
+        cn->country[sz] = 0;
+    }
+    if (decoded.subjectST) {
+        sz = (decoded.subjectSTLen < CTC_NAME_SIZE) ? decoded.subjectSTLen :
+                                                  CTC_NAME_SIZE - 1;
+        strncpy(cn->state, decoded.subjectST, CTC_NAME_SIZE);
+        cn->state[sz] = 0;
+    }
+    if (decoded.subjectL) {
+        sz = (decoded.subjectLLen < CTC_NAME_SIZE) ? decoded.subjectLLen :
+                                                 CTC_NAME_SIZE - 1;
+        strncpy(cn->locality, decoded.subjectL, CTC_NAME_SIZE);
+        cn->locality[sz] = 0;
+    }
+    if (decoded.subjectO) {
+        sz = (decoded.subjectOLen < CTC_NAME_SIZE) ? decoded.subjectOLen :
+                                                 CTC_NAME_SIZE - 1;
+        strncpy(cn->org, decoded.subjectO, CTC_NAME_SIZE);
+        cn->org[sz] = 0;
+    }
+    if (decoded.subjectOU) {
+        sz = (decoded.subjectOULen < CTC_NAME_SIZE) ? decoded.subjectOULen :
+                                                  CTC_NAME_SIZE - 1;
+        strncpy(cn->unit, decoded.subjectOU, CTC_NAME_SIZE);
+        cn->unit[sz] = 0;
+    }
+    if (decoded.subjectSN) {
+        sz = (decoded.subjectSNLen < CTC_NAME_SIZE) ? decoded.subjectSNLen :
+                                                  CTC_NAME_SIZE - 1;
+        strncpy(cn->sur, decoded.subjectSN, CTC_NAME_SIZE);
+        cn->sur[sz] = 0;
+    }
+    if (decoded.subjectEmail) {
+        sz = (decoded.subjectEmailLen < CTC_NAME_SIZE) ?
+                              decoded.subjectEmailLen : CTC_NAME_SIZE - 1;
+        strncpy(cn->email, decoded.subjectEmail, CTC_NAME_SIZE);
+        cn->email[sz] = 0;
+    }
+
+    FreeDecodedCert(&decoded);
+
+    return 0;
+}
+
+
+#ifndef NO_FILESYSTEM
+
+/* forward from CyaSSL */
+int CyaSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz);
+
+/* Set cert issuer from issuerFile in PEM */
+int SetIssuer(Cert* cert, const char* issuerFile)
+{
+    byte        der[8192];
+    int         derSz = CyaSSL_PemCertToDer(issuerFile, der, sizeof(der));
+
+    cert->selfSigned = 0;
+    return SetNameFromCert(&cert->issuer, der, derSz);
+}
+
+
+/* Set cert subject from subjectFile in PEM */
+int SetSubject(Cert* cert, const char* subjectFile)
+{
+    byte        der[8192];
+    int         derSz = CyaSSL_PemCertToDer(subjectFile, der, sizeof(der));
+
+    return SetNameFromCert(&cert->subject, der, derSz);
+}
+
+
+#ifdef CYASSL_ALT_NAMES
+
+/* Set atl names from file in PEM */
+int SetAltNames(Cert* cert, const char* file)
+{
+    byte        der[8192];
+    int         derSz = CyaSSL_PemCertToDer(file, der, sizeof(der));
+
+    return SetAltNamesFromCert(cert, der, derSz);
+}
+
+#endif /* CYASSL_ALT_NAMES */
+
+#endif /* NO_FILESYSTEM */
+
+/* Set cert issuer from DER buffer */
+int SetIssuerBuffer(Cert* cert, const byte* der, int derSz)
+{
+    cert->selfSigned = 0;
+    return SetNameFromCert(&cert->issuer, der, derSz);
+}
+
+
+/* Set cert subject from DER buffer */
+int SetSubjectBuffer(Cert* cert, const byte* der, int derSz)
+{
+    return SetNameFromCert(&cert->subject, der, derSz);
+}
+
+
+#ifdef CYASSL_ALT_NAMES
+
+/* Set cert alt names from DER buffer */
+int SetAltNamesBuffer(Cert* cert, const byte* der, int derSz)
+{
+    return SetAltNamesFromCert(cert, der, derSz);
+}
+
+/* Set cert dates from DER buffer */
+int SetDatesBuffer(Cert* cert, const byte* der, int derSz)
+{
+    return SetDatesFromCert(cert, der, derSz);
+}
+
+#endif /* CYASSL_ALT_NAMES */
+
+#endif /* CYASSL_CERT_GEN */
+
+
+#ifdef HAVE_ECC
+
+/* Der Encode r & s ints into out, outLen is (in/out) size */
+int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r, mp_int* s)
+{
+    word32 idx = 0;
+    word32 rSz;                           /* encoding size */
+    word32 sSz;
+    word32 headerSz = 4;   /* 2*ASN_TAG + 2*LEN(ENUM) */
+
+    int rLen = mp_unsigned_bin_size(r);   /* big int size */
+    int sLen = mp_unsigned_bin_size(s);
+    int err;
+
+    if (*outLen < (rLen + sLen + headerSz + 2))  /* SEQ_TAG + LEN(ENUM) */
+        return BAD_FUNC_ARG;
+
+    idx = SetSequence(rLen + sLen + headerSz, out);
+
+    /* store r */
+    out[idx++] = ASN_INTEGER;
+    rSz = SetLength(rLen, &out[idx]);
+    idx += rSz;
+    err = mp_to_unsigned_bin(r, &out[idx]);
+    if (err != MP_OKAY) return err;
+    idx += rLen;
+
+    /* store s */
+    out[idx++] = ASN_INTEGER;
+    sSz = SetLength(sLen, &out[idx]);
+    idx += sSz;
+    err = mp_to_unsigned_bin(s, &out[idx]);
+    if (err != MP_OKAY) return err;
+    idx += sLen;
+
+    *outLen = idx;
+
+    return 0;
+}
+
+
+/* Der Decode ECC-DSA Signautre, r & s stored as big ints */
+int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen, mp_int* r, mp_int* s)
+{
+    word32 idx = 0;
+    int    len = 0;
+
+    if (GetSequence(sig, &idx, &len, sigLen) < 0)
+        return ASN_ECC_KEY_E;
+
+    if ((word32)len > (sigLen - idx))
+        return ASN_ECC_KEY_E;
+
+    if (GetInt(r, sig, &idx, sigLen) < 0)
+        return ASN_ECC_KEY_E;
+
+    if (GetInt(s, sig, &idx, sigLen) < 0)
+        return ASN_ECC_KEY_E;
+
+    return 0;
+}
+
+
+int EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key,
+                        word32 inSz)
+{
+    word32 oid = 0;
+    int    version, length;
+    int    privSz, pubSz;
+    byte   b;
+    byte   priv[ECC_MAXSIZE];
+    byte   pub[ECC_MAXSIZE * 2 + 1]; /* public key has two parts plus header */
+
+    if (GetSequence(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetMyVersion(input, inOutIdx, &version) < 0)
+        return ASN_PARSE_E;
+
+    b = input[*inOutIdx];
+    *inOutIdx += 1;
+
+    /* priv type */
+    if (b != 4 && b != 6 && b != 7) 
+        return ASN_PARSE_E;
+
+    if (GetLength(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    /* priv key */
+    privSz = length;
+    XMEMCPY(priv, &input[*inOutIdx], privSz);
+    *inOutIdx += length;
+
+    /* prefix 0, may have */
+    b = input[*inOutIdx];
+    if (b == ECC_PREFIX_0) {
+        *inOutIdx += 1;
+
+        if (GetLength(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+
+        /* object id */
+        b = input[*inOutIdx];
+        *inOutIdx += 1;
+    
+        if (b != ASN_OBJECT_ID) 
+            return ASN_OBJECT_ID_E;
+
+        if (GetLength(input, inOutIdx, &length, inSz) < 0)
+            return ASN_PARSE_E;
+
+        while(length--) {
+            oid += input[*inOutIdx];
+            *inOutIdx += 1;
+        }
+        if (CheckCurve(oid) < 0)
+            return ECC_CURVE_OID_E;
+    }
+    
+    /* prefix 1 */
+    b = input[*inOutIdx];
+    *inOutIdx += 1;
+    if (b != ECC_PREFIX_1)
+        return ASN_ECC_KEY_E;
+
+    if (GetLength(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+
+    /* key header */
+    b = input[*inOutIdx];
+    *inOutIdx += 1;
+    if (b != ASN_BIT_STRING)
+        return ASN_BITSTR_E;
+
+    if (GetLength(input, inOutIdx, &length, inSz) < 0)
+        return ASN_PARSE_E;
+    b = input[*inOutIdx];
+    *inOutIdx += 1;
+    if (b != 0x00)
+        return ASN_EXPECT_0_E;
+
+    pubSz = length - 1;  /* null prefix */
+    XMEMCPY(pub, &input[*inOutIdx], pubSz);
+
+    *inOutIdx += length;
+    
+    return ecc_import_private_key(priv, privSz, pub, pubSz, key);
+}
+
+#endif  /* HAVE_ECC */
+
+
+#if defined(HAVE_OCSP) || defined(HAVE_CRL)
+
+/* Get raw Date only, no processing, 0 on success */
+static int GetBasicDate(const byte* source, word32* idx, byte* date,
+                        byte* format, int maxIdx)
+{
+    int    length;
+
+    CYASSL_ENTER("GetBasicDate");
+
+    *format = source[*idx];
+    *idx += 1;
+    if (*format != ASN_UTC_TIME && *format != ASN_GENERALIZED_TIME)
+        return ASN_TIME_E;
+
+    if (GetLength(source, idx, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if (length > MAX_DATE_SIZE || length < MIN_DATE_SIZE)
+        return ASN_DATE_SZ_E;
+
+    XMEMCPY(date, &source[*idx], length);
+    *idx += length;
+
+    return 0;
+}
+
+#endif
+
+
+#ifdef HAVE_OCSP
+
+static int GetEnumerated(const byte* input, word32* inOutIdx, int *value)
+{
+    word32 idx = *inOutIdx;
+    word32 len;
+
+    CYASSL_ENTER("GetEnumerated");
+
+    *value = 0;
+
+    if (input[idx++] != ASN_ENUMERATED)
+        return ASN_PARSE_E;
+
+    len = input[idx++];
+    if (len > 4)
+        return ASN_PARSE_E;
+
+    while (len--) {
+        *value  = *value << 8 | input[idx++];
+    }
+
+    *inOutIdx = idx;
+
+    return *value;
+}
+
+
+static int DecodeSingleResponse(byte* source,
+                            word32* ioIndex, OcspResponse* resp, word32 size)
+{
+    word32 index = *ioIndex, prevIndex, oid;
+    int length, wrapperSz;
+    CertStatus* cs = resp->status;
+
+    CYASSL_ENTER("DecodeSingleResponse");
+
+    /* Outer wrapper of the SEQUENCE OF Single Responses. */
+    if (GetSequence(source, &index, &wrapperSz, size) < 0)
+        return ASN_PARSE_E;
+
+    prevIndex = index;
+
+    /* When making a request, we only request one status on one certificate
+     * at a time. There should only be one SingleResponse */
+
+    /* Wrapper around the Single Response */
+    if (GetSequence(source, &index, &length, size) < 0)
+        return ASN_PARSE_E;
+
+    /* Wrapper around the CertID */
+    if (GetSequence(source, &index, &length, size) < 0)
+        return ASN_PARSE_E;
+    /* Skip the hash algorithm */
+    if (GetAlgoId(source, &index, &oid, size) < 0)
+        return ASN_PARSE_E;
+    /* Save reference to the hash of CN */
+    if (source[index++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+    if (GetLength(source, &index, &length, size) < 0)
+        return ASN_PARSE_E;
+    resp->issuerHash = source + index;
+    index += length;
+    /* Save reference to the hash of the issuer public key */
+    if (source[index++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+    if (GetLength(source, &index, &length, size) < 0)
+        return ASN_PARSE_E;
+    resp->issuerKeyHash = source + index;
+    index += length;
+
+    /* Read the serial number, it is handled as a string, not as a 
+     * proper number. Just XMEMCPY the data over, rather than load it
+     * as an mp_int. */
+    if (source[index++] != ASN_INTEGER)
+        return ASN_PARSE_E;
+    if (GetLength(source, &index, &length, size) < 0)
+        return ASN_PARSE_E;
+    if (length <= EXTERNAL_SERIAL_SIZE)
+    {
+        if (source[index] == 0)
+        {
+            index++;
+            length--;
+        }
+        XMEMCPY(cs->serial, source + index, length);
+        cs->serialSz = length;
+    }
+    else
+    {
+        return ASN_GETINT_E;
+    }
+    index += length;
+
+    /* CertStatus */
+    switch (source[index++])
+    {
+        case (ASN_CONTEXT_SPECIFIC | CERT_GOOD):
+            cs->status = CERT_GOOD;
+            index++;
+            break;
+        case (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | CERT_REVOKED):
+            cs->status = CERT_REVOKED;
+            GetLength(source, &index, &length, size);
+            index += length;
+            break;
+        case (ASN_CONTEXT_SPECIFIC | CERT_UNKNOWN):
+            cs->status = CERT_UNKNOWN;
+            index++;
+            break;
+        default:
+            return ASN_PARSE_E;
+    }
+
+    if (GetBasicDate(source, &index, cs->thisDate,
+                                                &cs->thisDateFormat, size) < 0)
+        return ASN_PARSE_E;
+    if (!ValidateDate(cs->thisDate, cs->thisDateFormat, BEFORE))
+        return ASN_BEFORE_DATE_E;
+    
+    /* The following items are optional. Only check for them if there is more
+     * unprocessed data in the singleResponse wrapper. */
+    
+    if ((index - prevIndex < wrapperSz) &&
+        (source[index] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 0)))
+    {
+        index++;
+        if (GetLength(source, &index, &length, size) < 0)
+            return ASN_PARSE_E;
+        if (GetBasicDate(source, &index, cs->nextDate,
+                                                &cs->nextDateFormat, size) < 0)
+            return ASN_PARSE_E;
+    }
+    if ((index - prevIndex < wrapperSz) &&
+        (source[index] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1)))
+    {
+        index++;
+        if (GetLength(source, &index, &length, size) < 0)
+            return ASN_PARSE_E;
+        index += length;
+    }
+
+    *ioIndex = index;
+
+    return 0;
+}
+
+static int DecodeOcspRespExtensions(byte* source,
+                            word32* ioIndex, OcspResponse* resp, word32 sz)
+{
+    word32 idx = *ioIndex;
+    int length;
+    int ext_bound; /* boundary index for the sequence of extensions */
+    word32 oid;
+
+    CYASSL_ENTER("DecodeOcspRespExtensions");
+
+    if (source[idx++] != (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1))
+        return ASN_PARSE_E;
+
+    if (GetLength(source, &idx, &length, sz) < 0) return ASN_PARSE_E;
+
+    if (GetSequence(source, &idx, &length, sz) < 0) return ASN_PARSE_E;
+   
+    ext_bound = idx + length;
+
+    while (idx < (word32)ext_bound) {
+        if (GetSequence(source, &idx, &length, sz) < 0) {
+            CYASSL_MSG("\tfail: should be a SEQUENCE");
+            return ASN_PARSE_E;
+        }
+
+        oid = 0;
+        if (GetObjectId(source, &idx, &oid, sz) < 0) {
+            CYASSL_MSG("\tfail: OBJECT ID");
+            return ASN_PARSE_E;
+        }
+
+        /* check for critical flag */
+        if (source[idx] == ASN_BOOLEAN) {
+            CYASSL_MSG("\tfound optional critical flag, moving past");
+            idx += (ASN_BOOL_SIZE + 1);
+        }
+
+        /* process the extension based on the OID */
+        if (source[idx++] != ASN_OCTET_STRING) {
+            CYASSL_MSG("\tfail: should be an OCTET STRING");
+            return ASN_PARSE_E;
+        }
+
+        if (GetLength(source, &idx, &length, sz) < 0) {
+            CYASSL_MSG("\tfail: extension data length");
+            return ASN_PARSE_E;
+        }
+
+        if (oid == OCSP_NONCE_OID) {
+            resp->nonce = source + idx;
+            resp->nonceSz = length;
+        }
+
+        idx += length;
+    }
+
+    *ioIndex = idx;
+    return 0;
+}
+
+
+static int DecodeResponseData(byte* source,
+                            word32* ioIndex, OcspResponse* resp, word32 size)
+{
+    word32 idx = *ioIndex, prev_idx;
+    int length;
+    int version;
+    word32 responderId = 0;
+
+    CYASSL_ENTER("DecodeResponseData");
+
+    resp->response = source + idx;
+    prev_idx = idx;
+    if (GetSequence(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+    resp->responseSz = length + idx - prev_idx;
+
+    /* Get version. It is an EXPLICIT[0] DEFAULT(0) value. If this
+     * item isn't an EXPLICIT[0], then set version to zero and move
+     * onto the next item.
+     */
+    if (source[idx] == (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED))
+    {    
+        idx += 2; /* Eat the value and length */
+        if (GetMyVersion(source, &idx, &version) < 0)
+            return ASN_PARSE_E;
+    } else
+        version = 0;
+
+    responderId = source[idx++];
+    if ((responderId == (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | 1)) ||
+        (responderId == (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | 2)))
+    {
+        if (GetLength(source, &idx, &length, size) < 0)
+            return ASN_PARSE_E;
+        idx += length;
+    }
+    else
+        return ASN_PARSE_E;
+    
+    /* save pointer to the producedAt time */
+    if (GetBasicDate(source, &idx, resp->producedDate,
+                                        &resp->producedDateFormat, size) < 0)
+        return ASN_PARSE_E;
+    if (!ValidateDate(resp->producedDate, resp->producedDateFormat, BEFORE))
+        return ASN_BEFORE_DATE_E;
+    idx += length;
+
+    if (DecodeSingleResponse(source, &idx, resp, size) < 0)
+        return ASN_PARSE_E;
+
+    if (DecodeOcspRespExtensions(source, &idx, resp, size) < 0)
+        return ASN_PARSE_E;
+
+    *ioIndex = idx;
+    return 0;
+}
+
+
+static int DecodeCerts(byte* source,
+                            word32* ioIndex, OcspResponse* resp, word32 size)
+{
+    word32 idx = *ioIndex;
+
+    CYASSL_ENTER("DecodeCerts");
+
+    if (source[idx++] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC))
+    {
+        int length;
+
+        if (GetLength(source, &idx, &length, size) < 0)
+            return ASN_PARSE_E;
+
+        if (GetSequence(source, &idx, &length, size) < 0)
+            return ASN_PARSE_E;
+
+        resp->cert = source + idx;
+        resp->certSz = length;
+
+        idx += length;
+    }
+    *ioIndex = idx;
+    return 0;
+}
+
+static int DecodeBasicOcspResponse(byte* source,
+                            word32* ioIndex, OcspResponse* resp, word32 size)
+{
+    int length;
+    word32 idx = *ioIndex;
+    word32 end_index;
+
+    CYASSL_ENTER("DecodeBasicOcspResponse");
+
+    if (GetSequence(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+
+    if (idx + length > size)
+        return ASN_INPUT_E;
+    end_index = idx + length;
+
+    if (DecodeResponseData(source, &idx, resp, size) < 0)
+        return ASN_PARSE_E;
+    
+    /* Get the signature algorithm */
+    if (GetAlgoId(source, &idx, &resp->sigOID, size) < 0)
+        return ASN_PARSE_E;
+
+    /* Obtain pointer to the start of the signature, and save the size */
+    if (source[idx++] == ASN_BIT_STRING)
+    {
+        int sigLength = 0;
+        if (GetLength(source, &idx, &sigLength, size) < 0)
+            return ASN_PARSE_E;
+        resp->sigSz = sigLength;
+        resp->sig = source + idx;
+        idx += sigLength;
+    }
+
+    /*
+     * Check the length of the BasicOcspResponse against the current index to
+     * see if there are certificates, they are optional.
+     */
+    if (idx < end_index)
+    {
+        DecodedCert cert;
+        int ret;
+
+        if (DecodeCerts(source, &idx, resp, size) < 0)
+            return ASN_PARSE_E;
+
+        InitDecodedCert(&cert, resp->cert, resp->certSz, 0);
+        ret = ParseCertRelative(&cert, CA_TYPE, NO_VERIFY, 0);
+        if (ret < 0)
+            return ret;
+
+        ret = ConfirmSignature(resp->response, resp->responseSz,
+                            cert.publicKey, cert.pubKeySize, cert.keyOID,
+                            resp->sig, resp->sigSz, resp->sigOID, NULL);
+        FreeDecodedCert(&cert);
+
+        if (ret == 0)
+        {
+            CYASSL_MSG("\tConfirm signature failed");
+            return ASN_SIG_CONFIRM_E;
+        }
+    }
+
+    *ioIndex = idx;
+    return 0;
+}
+
+
+void InitOcspResponse(OcspResponse* resp, CertStatus* status,
+                                                    byte* source, word32 inSz)
+{
+    CYASSL_ENTER("InitOcspResponse");
+
+    resp->responseStatus = -1;
+    resp->response = NULL;
+    resp->responseSz = 0;
+    resp->producedDateFormat = 0;
+    resp->issuerHash = NULL;
+    resp->issuerKeyHash = NULL;
+    resp->sig = NULL;
+    resp->sigSz = 0;
+    resp->sigOID = 0;
+    resp->status = status;
+    resp->nonce = NULL;
+    resp->nonceSz = 0;
+    resp->source = source;
+    resp->maxIdx = inSz;
+}
+
+
+int OcspResponseDecode(OcspResponse* resp)
+{
+    int length = 0;
+    word32 idx = 0;
+    byte* source = resp->source;
+    word32 size = resp->maxIdx;
+    word32 oid;
+
+    CYASSL_ENTER("OcspResponseDecode");
+
+    /* peel the outer SEQUENCE wrapper */
+    if (GetSequence(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+    
+    /* First get the responseStatus, an ENUMERATED */
+    if (GetEnumerated(source, &idx, &resp->responseStatus) < 0)
+        return ASN_PARSE_E;
+
+    if (resp->responseStatus != OCSP_SUCCESSFUL)
+        return 0;
+
+    /* Next is an EXPLICIT record called ResponseBytes, OPTIONAL */
+    if (idx >= size)
+        return ASN_INPUT_E;
+    if (source[idx++] != (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC))
+        return ASN_PARSE_E;
+    if (GetLength(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+
+    /* Get the responseBytes SEQUENCE */
+    if (GetSequence(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+
+    /* Check ObjectID for the resposeBytes */
+    if (GetObjectId(source, &idx, &oid, size) < 0)
+        return ASN_PARSE_E;
+    if (oid != OCSP_BASIC_OID)
+        return ASN_PARSE_E;
+    if (source[idx++] != ASN_OCTET_STRING)
+        return ASN_PARSE_E;
+
+    if (GetLength(source, &idx, &length, size) < 0)
+        return ASN_PARSE_E;
+
+    if (DecodeBasicOcspResponse(source, &idx, resp, size) < 0)
+        return ASN_PARSE_E;
+    
+    return 0;
+}
+
+
+static int SetSerialNumber(const byte* sn, word32 snSz, byte* output)
+{
+    int result = 0;
+
+    CYASSL_ENTER("SetSerialNumber");
+
+    if (snSz <= EXTERNAL_SERIAL_SIZE) {
+        output[0] = ASN_INTEGER;
+        output[1] = snSz + 1;
+        output[2] = 0;
+        XMEMCPY(&output[3], sn, snSz);
+        result = snSz + 3;
+    }
+    return result;
+}
+
+
+static word32 SetOcspReqExtensions(word32 extSz, byte* output,
+                                            const byte* nonce, word32 nonceSz)
+{
+    static const byte NonceObjId[] = { 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
+                                       0x30, 0x01, 0x02 };
+    byte seqArray[5][MAX_SEQ_SZ];
+    word32 seqSz[5], totalSz;
+
+    CYASSL_ENTER("SetOcspReqExtensions");
+
+    if (nonce == NULL || nonceSz == 0) return 0;
+    
+    seqArray[0][0] = ASN_OCTET_STRING;
+    seqSz[0] = 1 + SetLength(nonceSz, &seqArray[0][1]);
+
+    seqArray[1][0] = ASN_OBJECT_ID;
+    seqSz[1] = 1 + SetLength(sizeof(NonceObjId), &seqArray[1][1]);
+
+    totalSz = seqSz[0] + seqSz[1] + nonceSz + sizeof(NonceObjId);
+
+    seqSz[2] = SetSequence(totalSz, seqArray[2]);
+    totalSz += seqSz[2];
+
+    seqSz[3] = SetSequence(totalSz, seqArray[3]);
+    totalSz += seqSz[3];
+
+    seqArray[4][0] = (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 2);
+    seqSz[4] = 1 + SetLength(totalSz, &seqArray[4][1]);
+    totalSz += seqSz[4];
+
+    if (totalSz < extSz)
+    {
+        totalSz = 0;
+        XMEMCPY(output + totalSz, seqArray[4], seqSz[4]);
+        totalSz += seqSz[4];
+        XMEMCPY(output + totalSz, seqArray[3], seqSz[3]);
+        totalSz += seqSz[3];
+        XMEMCPY(output + totalSz, seqArray[2], seqSz[2]);
+        totalSz += seqSz[2];
+        XMEMCPY(output + totalSz, seqArray[1], seqSz[1]);
+        totalSz += seqSz[1];
+        XMEMCPY(output + totalSz, NonceObjId, sizeof(NonceObjId));
+        totalSz += sizeof(NonceObjId);
+        XMEMCPY(output + totalSz, seqArray[0], seqSz[0]);
+        totalSz += seqSz[0];
+        XMEMCPY(output + totalSz, nonce, nonceSz);
+        totalSz += nonceSz;
+    }
+
+    return totalSz;
+}
+
+
+int EncodeOcspRequest(OcspRequest* req)
+{
+    byte seqArray[5][MAX_SEQ_SZ];
+    /* The ASN.1 of the OCSP Request is an onion of sequences */
+    byte algoArray[MAX_ALGO_SZ];
+    byte issuerArray[MAX_ENCODED_DIG_SZ];
+    byte issuerKeyArray[MAX_ENCODED_DIG_SZ];
+    byte snArray[MAX_SN_SZ];
+    byte extArray[MAX_OCSP_EXT_SZ];
+    byte* output = req->dest;
+    word32 outputSz = req->destSz;
+    RNG rng;
+    word32 seqSz[5], algoSz, issuerSz, issuerKeySz, snSz, extSz, totalSz;
+    int i;
+
+    CYASSL_ENTER("EncodeOcspRequest");
+
+    algoSz = SetAlgoID(SHAh, algoArray, hashType);
+
+    req->issuerHash = req->cert->issuerHash;
+    issuerSz = SetDigest(req->cert->issuerHash, SHA_SIZE, issuerArray);
+    
+    req->issuerKeyHash = req->cert->issuerKeyHash;
+    issuerKeySz = SetDigest(req->cert->issuerKeyHash, SHA_SIZE, issuerKeyArray);
+
+    req->serial = req->cert->serial;
+    req->serialSz = req->cert->serialSz;
+    snSz = SetSerialNumber(req->cert->serial, req->cert->serialSz, snArray);
+
+    if (InitRng(&rng) != 0) {
+        CYASSL_MSG("\tCannot initialize RNG. Skipping the OSCP Nonce.");
+        extSz = 0;
+    } else {
+        req->nonceSz = MAX_OCSP_NONCE_SZ;
+        RNG_GenerateBlock(&rng, req->nonce, req->nonceSz);
+        extSz = SetOcspReqExtensions(MAX_OCSP_EXT_SZ, extArray,
+                                                    req->nonce, req->nonceSz);
+    }
+
+    totalSz = algoSz + issuerSz + issuerKeySz + snSz;
+
+    for (i = 4; i >= 0; i--) {
+        seqSz[i] = SetSequence(totalSz, seqArray[i]);
+        totalSz += seqSz[i];
+        if (i == 2) totalSz += extSz;
+    }
+    totalSz = 0;
+    for (i = 0; i < 5; i++) {
+        XMEMCPY(output + totalSz, seqArray[i], seqSz[i]);
+        totalSz += seqSz[i];
+    }
+    XMEMCPY(output + totalSz, algoArray, algoSz);
+    totalSz += algoSz;
+    XMEMCPY(output + totalSz, issuerArray, issuerSz);
+    totalSz += issuerSz;
+    XMEMCPY(output + totalSz, issuerKeyArray, issuerKeySz);
+    totalSz += issuerKeySz;
+    XMEMCPY(output + totalSz, snArray, snSz);
+    totalSz += snSz;
+    if (extSz != 0) {
+        XMEMCPY(output + totalSz, extArray, extSz);
+        totalSz += extSz;
+    }
+
+    return totalSz;
+}
+
+
+void InitOcspRequest(OcspRequest* req, DecodedCert* cert,
+                                                    byte* dest, word32 destSz)
+{
+    CYASSL_ENTER("InitOcspRequest");
+
+    req->cert = cert;
+    req->nonceSz = 0;
+    req->issuerHash = NULL;
+    req->issuerKeyHash = NULL;
+    req->serial = NULL;
+    req->dest = dest;
+    req->destSz = destSz;
+}
+
+
+int CompareOcspReqResp(OcspRequest* req, OcspResponse* resp)
+{
+    int cmp;
+
+    CYASSL_ENTER("CompareOcspReqResp");
+
+    if (req == NULL)
+    {
+        CYASSL_MSG("\tReq missing");
+        return -1;
+    }
+
+    if (resp == NULL)
+    {
+        CYASSL_MSG("\tResp missing");
+        return 1;
+    }
+
+    cmp = req->nonceSz - resp->nonceSz;
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tnonceSz mismatch");
+        return cmp;
+    }
+
+    cmp = XMEMCMP(req->nonce, resp->nonce, req->nonceSz);
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tnonce mismatch");
+        return cmp;
+    }
+
+    cmp = XMEMCMP(req->issuerHash, resp->issuerHash, SHA_DIGEST_SIZE);
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tissuerHash mismatch");
+        return cmp;
+    }
+
+    cmp = XMEMCMP(req->issuerKeyHash, resp->issuerKeyHash, SHA_DIGEST_SIZE);
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tissuerKeyHash mismatch");
+        return cmp;
+    }
+
+    cmp = req->serialSz - resp->status->serialSz;
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tserialSz mismatch");
+        return cmp;
+    }
+
+    cmp = XMEMCMP(req->serial, resp->status->serial, req->serialSz);
+    if (cmp != 0)
+    {
+        CYASSL_MSG("\tserial mismatch");
+        return cmp;
+    }
+
+    return 0;
+}
+
+#endif
+
+
+#ifdef HAVE_CRL
+
+/* initialize decoded CRL */
+void InitDecodedCRL(DecodedCRL* dcrl)
+{
+    CYASSL_MSG("InitDecodedCRL");
+
+    dcrl->certBegin    = 0;
+    dcrl->sigIndex     = 0;
+    dcrl->sigLength    = 0;
+    dcrl->signatureOID = 0;
+    dcrl->certs        = NULL;
+    dcrl->totalCerts   = 0;
+}
+
+
+/* free decoded CRL resources */
+void FreeDecodedCRL(DecodedCRL* dcrl)
+{
+    RevokedCert* tmp = dcrl->certs;
+
+    CYASSL_MSG("FreeDecodedCRL");
+
+    while(tmp) {
+        RevokedCert* next = tmp->next;
+        XFREE(tmp, NULL, DYNAMIC_TYPE_REVOKED);
+        tmp = next;
+    }
+}
+
+
+/* store SHA1 hash of NAME */
+static int GetNameHash(const byte* source, word32* idx, byte* hash, int maxIdx)
+{
+    Sha    sha;
+    int    length;  /* length of all distinguished names */
+    word32 dummy;
+
+    CYASSL_ENTER("GetNameHash");
+
+    if (source[*idx] == ASN_OBJECT_ID) {
+        CYASSL_MSG("Trying optional prefix...");
+
+        if (GetLength(source, idx, &length, maxIdx) < 0)
+            return ASN_PARSE_E;
+
+        *idx += length;
+        CYASSL_MSG("Got optional prefix");
+    }
+
+    /* For OCSP, RFC2560 section 4.1.1 states the issuer hash should be
+     * calculated over the entire DER encoding of the Name field, including
+     * the tag and length. */
+    dummy = *idx;
+    if (GetSequence(source, idx, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    InitSha(&sha);
+    ShaUpdate(&sha, source + dummy, length + *idx - dummy);
+    ShaFinal(&sha, hash);
+
+    *idx += length;
+
+    return 0;
+}
+
+
+/* Get Revoked Cert list, 0 on success */
+static int GetRevoked(const byte* buff, word32* idx, DecodedCRL* dcrl,
+                      int maxIdx)
+{
+    int    len;
+    word32 end;
+    byte   b;
+    RevokedCert* rc;
+
+    CYASSL_ENTER("GetRevoked");
+
+    if (GetSequence(buff, idx, &len, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    end = *idx + len;
+
+    /* get serial number */
+    b = buff[*idx];
+    *idx += 1;
+
+    if (b != ASN_INTEGER) {
+        CYASSL_MSG("Expecting Integer");
+        return ASN_PARSE_E;
+    }
+
+    if (GetLength(buff, idx, &len, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    if (len > EXTERNAL_SERIAL_SIZE) {
+        CYASSL_MSG("Serial Size too big");
+        return ASN_PARSE_E;
+    }
+
+    rc = (RevokedCert*)XMALLOC(sizeof(RevokedCert), NULL, DYNAMIC_TYPE_CRL);
+    if (rc == NULL) {
+        CYASSL_MSG("Alloc Revoked Cert failed");
+        return MEMORY_E;
+    }
+
+    XMEMCPY(rc->serialNumber, &buff[*idx], len);
+    rc->serialSz = len;
+
+    /* add to list */
+    rc->next = dcrl->certs;
+    dcrl->certs = rc;
+    dcrl->totalCerts++;
+
+    *idx += len;
+
+    /* get date */
+    b = buff[*idx];
+    *idx += 1;
+
+    if (b != ASN_UTC_TIME && b != ASN_GENERALIZED_TIME) {
+        CYASSL_MSG("Expecting Date");
+        return ASN_PARSE_E;
+    }
+
+    if (GetLength(buff, idx, &len, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    /* skip for now */
+    *idx += len;
+
+    if (*idx != end)  /* skip extensions */
+        *idx = end;
+
+    return 0;
+}
+
+
+/* Get CRL Signature, 0 on success */
+static int GetCRL_Signature(const byte* source, word32* idx, DecodedCRL* dcrl,
+                            int maxIdx)
+{
+    int    length;
+    byte   b;
+
+    CYASSL_ENTER("GetCRL_Signature");
+
+    b = source[*idx];
+    *idx += 1;
+    if (b != ASN_BIT_STRING)
+        return ASN_BITSTR_E;
+
+    if (GetLength(source, idx, &length, maxIdx) < 0)
+        return ASN_PARSE_E;
+
+    dcrl->sigLength = length;
+
+    b = source[*idx];
+    *idx += 1;
+    if (b != 0x00)
+        return ASN_EXPECT_0_E;
+
+    dcrl->sigLength--;
+    dcrl->signature = (byte*)&source[*idx];
+
+    *idx += dcrl->sigLength;
+
+    return 0;
+}
+
+
+/* prase crl buffer into decoded state, 0 on success */
+int ParseCRL(DecodedCRL* dcrl, const byte* buff, long sz, void* cm)
+{
+    int     version, len;
+    word32  oid, idx = 0;
+    Md5     md5;
+    Signer* ca;
+
+    CYASSL_MSG("ParseCRL");
+
+    /* raw crl hash */
+    InitMd5(&md5);
+    Md5Update(&md5, buff, sz);
+    Md5Final(&md5, dcrl->crlHash);
+
+    if (GetSequence(buff, &idx, &len, sz) < 0)
+        return ASN_PARSE_E;
+
+    dcrl->certBegin = idx;
+
+    if (GetSequence(buff, &idx, &len, sz) < 0)
+        return ASN_PARSE_E;
+    dcrl->sigIndex = len + idx;
+
+    /* may have version */
+    if (buff[idx] == ASN_INTEGER) {
+        if (GetMyVersion(buff, &idx, &version) < 0)
+            return ASN_PARSE_E;
+    }
+
+    if (GetAlgoId(buff, &idx, &oid, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetNameHash(buff, &idx, dcrl->issuerHash, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetBasicDate(buff, &idx, dcrl->lastDate, &dcrl->lastDateFormat, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetBasicDate(buff, &idx, dcrl->nextDate, &dcrl->nextDateFormat, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (!XVALIDATE_DATE(dcrl->nextDate, dcrl->nextDateFormat, AFTER)) {
+        CYASSL_MSG("CRL after date is no longer valid");
+        return ASN_AFTER_DATE_E;
+    }
+
+    if (idx != dcrl->sigIndex && buff[idx] != CRL_EXTENSIONS) {
+        if (GetSequence(buff, &idx, &len, sz) < 0)
+            return ASN_PARSE_E;
+
+        len += idx;
+
+        while (idx < (word32)len) {
+            if (GetRevoked(buff, &idx, dcrl, sz) < 0)
+                return ASN_PARSE_E;
+        }
+    }
+
+    if (idx != dcrl->sigIndex)
+        idx = dcrl->sigIndex;   /* skip extensions */
+
+    if (GetAlgoId(buff, &idx, &dcrl->signatureOID, sz) < 0)
+        return ASN_PARSE_E;
+
+    if (GetCRL_Signature(buff, &idx, dcrl, sz) < 0)
+        return ASN_PARSE_E;
+
+    ca = GetCA(cm, dcrl->issuerHash);
+    CYASSL_MSG("About to verify CRL signature");
+
+    if (ca) {
+        CYASSL_MSG("Found CRL issuer CA");
+        /* try to confirm/verify signature */
+        if (!ConfirmSignature(buff + dcrl->certBegin,
+                dcrl->sigIndex - dcrl->certBegin,
+                ca->publicKey, ca->pubKeySize, ca->keyOID,
+                dcrl->signature, dcrl->sigLength, dcrl->signatureOID, NULL)) {
+            CYASSL_MSG("CRL Confirm signature failed");
+            return ASN_SIG_CONFIRM_E;
+        }
+    }
+    else {
+        CYASSL_MSG("Did NOT find CRL issuer CA");
+        return ASN_SIG_CONFIRM_E;
+    }
+
+    return 0;
+}
+
+#endif /* HAVE_CRL */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/coding.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/coding.c
new file mode 100644 (file)
index 0000000..63edc6a
--- /dev/null
@@ -0,0 +1,265 @@
+/* coding.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/coding.h>
+#include <cyassl/ctaocrypt/error.h>
+#include <cyassl/ctaocrypt/logging.h>
+
+
+enum {
+    BAD         = 0xFF,  /* invalid encoding */
+    PAD         = '=',
+    PEM_LINE_SZ = 64
+};
+
+
+static
+const byte base64Decode[] = { 62, BAD, BAD, BAD, 63,   /* + starts at 0x2B */
+                              52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+                              BAD, BAD, BAD, BAD, BAD, BAD, BAD,
+                              0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+                              10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+                              20, 21, 22, 23, 24, 25,
+                              BAD, BAD, BAD, BAD, BAD, BAD,
+                              26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+                              36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+                              46, 47, 48, 49, 50, 51
+                            };
+
+
+int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
+{
+    word32 i = 0;
+    word32 j = 0;
+    word32 plainSz = inLen - ((inLen + (PEM_LINE_SZ - 1)) / PEM_LINE_SZ );
+    const byte maxIdx = (byte)sizeof(base64Decode) + 0x2B - 1;
+
+    plainSz = (plainSz * 3 + 3) / 4;
+    if (plainSz > *outLen) return BAD_FUNC_ARG;
+
+    while (inLen > 3) {
+        byte b1, b2, b3;
+        byte e1 = in[j++];
+        byte e2 = in[j++];
+        byte e3 = in[j++];
+        byte e4 = in[j++];
+
+        int pad3 = 0;
+        int pad4 = 0;
+
+        if (e1 == 0)            /* end file 0's */
+            break;
+        if (e3 == PAD)
+            pad3 = 1;
+        if (e4 == PAD)
+            pad4 = 1;
+
+        if (e1 < 0x2B || e2 < 0x2B || e3 < 0x2B || e4 < 0x2B) {
+            CYASSL_MSG("Bad Base64 Decode data, too small");
+            return ASN_INPUT_E;
+        }
+
+        if (e1 > maxIdx || e2 > maxIdx || e3 > maxIdx || e4 > maxIdx) {
+            CYASSL_MSG("Bad Base64 Decode data, too big");
+            return ASN_INPUT_E;
+        }
+
+        e1 = base64Decode[e1 - 0x2B];
+        e2 = base64Decode[e2 - 0x2B];
+        e3 = (e3 == PAD) ? 0 : base64Decode[e3 - 0x2B];
+        e4 = (e4 == PAD) ? 0 : base64Decode[e4 - 0x2B];
+
+        b1 = (e1 << 2) | (e2 >> 4);
+        b2 = ((e2 & 0xF) << 4) | (e3 >> 2);
+        b3 = ((e3 & 0x3) << 6) | e4;
+
+        out[i++] = b1;
+        if (!pad3)
+            out[i++] = b2;
+        if (!pad4)
+            out[i++] = b3;
+        else
+            break;
+        
+        inLen -= 4;
+        if (in[j] == ' ' || in[j] == '\r' || in[j] == '\n') {
+            byte endLine = in[j++];
+            inLen--;
+            while (endLine == ' ') {   /* allow trailing whitespace */
+                endLine = in[j++];
+                inLen--;
+            }
+            if (endLine == '\r') {
+                endLine = in[j++];
+                inLen--;
+            }
+            if (endLine != '\n') {
+                CYASSL_MSG("Bad end of line in Base64 Decode");
+                return ASN_INPUT_E;
+            }
+        }
+    }
+    *outLen = i;
+
+    return 0;
+}
+
+
+#if defined(OPENSSL_EXTRA) || defined (SESSION_CERTS) || defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER)
+
+static
+const byte base64Encode[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
+                              'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
+                              'U', 'V', 'W', 'X', 'Y', 'Z',
+                              'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+                              'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
+                              'u', 'v', 'w', 'x', 'y', 'z',
+                              '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+                              '+', '/'
+                            };
+
+
+/* porting assistance from yaSSL by Raphael HUCK */
+int Base64_Encode(const byte* in, word32 inLen, byte* out, word32* outLen)
+{
+    word32 i = 0,
+           j = 0,
+           n = 0;   /* new line counter */
+
+    word32 outSz = (inLen + 3 - 1) / 3 * 4;
+    outSz += (outSz + PEM_LINE_SZ - 1) / PEM_LINE_SZ;  /* new lines */
+
+    if (outSz > *outLen) return BAD_FUNC_ARG;
+    
+    while (inLen > 2) {
+        byte b1 = in[j++];
+        byte b2 = in[j++];
+        byte b3 = in[j++];
+
+        /* encoded idx */
+        byte e1 = b1 >> 2;
+        byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
+        byte e3 = ((b2 & 0xF) << 2) | (b3 >> 6);
+        byte e4 = b3 & 0x3F;
+
+        /* store */
+        out[i++] = base64Encode[e1];
+        out[i++] = base64Encode[e2];
+        out[i++] = base64Encode[e3];
+        out[i++] = base64Encode[e4];
+
+        inLen -= 3;
+
+        if ((++n % (PEM_LINE_SZ / 4)) == 0 && inLen)
+            out[i++] = '\n';
+    }
+
+    /* last integral */
+    if (inLen) {
+        int twoBytes = (inLen == 2);
+
+        byte b1 = in[j++];
+        byte b2 = (twoBytes) ? in[j++] : 0;
+
+        byte e1 = b1 >> 2;
+        byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
+        byte e3 =  (b2 & 0xF) << 2;
+
+        out[i++] = base64Encode[e1];
+        out[i++] = base64Encode[e2];
+        out[i++] = (twoBytes) ? base64Encode[e3] : PAD;
+        out[i++] = PAD;
+    } 
+
+    out[i++] = '\n';
+    if (i != outSz)
+        return ASN_INPUT_E; 
+    *outLen = outSz;
+
+    return 0; 
+}
+
+
+static
+const byte hexDecode[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+                           BAD, BAD, BAD, BAD, BAD, BAD, BAD,
+                           10, 11, 12, 13, 14, 15 
+                         };  /* A starts at 0x41 not 0x3A */
+
+int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
+{
+    word32 inIdx  = 0;
+    word32 outIdx = 0;
+
+    if (inLen == 1 && *outLen && in) {
+        byte b = in[inIdx++] - 0x30;  /* 0 starts at 0x30 */
+
+        /* sanity check */
+        if (b >=  sizeof(hexDecode)/sizeof(hexDecode[0]))
+            return ASN_INPUT_E;
+
+        b  = hexDecode[b];
+
+        if (b == BAD)
+            return ASN_INPUT_E;
+        
+        out[outIdx++] = b;
+
+        *outLen = outIdx;
+        return 0;
+    }
+
+    if (inLen % 2)
+        return BAD_FUNC_ARG;
+
+    if (*outLen < (inLen / 2))
+        return BAD_FUNC_ARG;
+
+    while (inLen) {
+        byte b  = in[inIdx++] - 0x30;  /* 0 starts at 0x30 */
+        byte b2 = in[inIdx++] - 0x30;
+
+        /* sanity checks */
+        if (b >=  sizeof(hexDecode)/sizeof(hexDecode[0]))
+            return ASN_INPUT_E;
+        if (b2 >= sizeof(hexDecode)/sizeof(hexDecode[0]))
+            return ASN_INPUT_E;
+
+        b  = hexDecode[b];
+        b2 = hexDecode[b2];
+
+        if (b == BAD || b2 == BAD)
+            return ASN_INPUT_E;
+        
+        out[outIdx++] = (b << 4) | b2;
+        inLen -= 2;
+    }
+
+    *outLen = outIdx;
+    return 0;
+}
+
+
+#endif  /* OPENSSL_EXTRA */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/des3.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/des3.c
new file mode 100644 (file)
index 0000000..77a20b0
--- /dev/null
@@ -0,0 +1,528 @@
+/* des3.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_DES3
+
+#include <cyassl/ctaocrypt/des3.h>
+
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+/* permuted choice table (key) */
+static const byte pc1[] = {
+       57, 49, 41, 33, 25, 17,  9,
+        1, 58, 50, 42, 34, 26, 18,
+       10,  2, 59, 51, 43, 35, 27,
+       19, 11,  3, 60, 52, 44, 36,
+
+       63, 55, 47, 39, 31, 23, 15,
+        7, 62, 54, 46, 38, 30, 22,
+       14,  6, 61, 53, 45, 37, 29,
+       21, 13,  5, 28, 20, 12,  4
+};
+
+/* number left rotations of pc1 */
+static const byte totrot[] = {
+       1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
+};
+
+/* permuted choice key (table) */
+static const byte pc2[] = {
+       14, 17, 11, 24,  1,  5,
+        3, 28, 15,  6, 21, 10,
+       23, 19, 12,  4, 26,  8,
+       16,  7, 27, 20, 13,  2,
+       41, 52, 31, 37, 47, 55,
+       30, 40, 51, 45, 33, 48,
+       44, 49, 39, 56, 34, 53,
+       46, 42, 50, 36, 29, 32
+};
+
+/* End of DES-defined tables */
+
+/* bit 0 is left-most in byte */
+static const int bytebit[] = {
+       0200,0100,040,020,010,04,02,01
+};
+
+const word32 Spbox[8][64] = {
+{
+0x01010400,0x00000000,0x00010000,0x01010404,
+0x01010004,0x00010404,0x00000004,0x00010000,
+0x00000400,0x01010400,0x01010404,0x00000400,
+0x01000404,0x01010004,0x01000000,0x00000004,
+0x00000404,0x01000400,0x01000400,0x00010400,
+0x00010400,0x01010000,0x01010000,0x01000404,
+0x00010004,0x01000004,0x01000004,0x00010004,
+0x00000000,0x00000404,0x00010404,0x01000000,
+0x00010000,0x01010404,0x00000004,0x01010000,
+0x01010400,0x01000000,0x01000000,0x00000400,
+0x01010004,0x00010000,0x00010400,0x01000004,
+0x00000400,0x00000004,0x01000404,0x00010404,
+0x01010404,0x00010004,0x01010000,0x01000404,
+0x01000004,0x00000404,0x00010404,0x01010400,
+0x00000404,0x01000400,0x01000400,0x00000000,
+0x00010004,0x00010400,0x00000000,0x01010004},
+{
+0x80108020,0x80008000,0x00008000,0x00108020,
+0x00100000,0x00000020,0x80100020,0x80008020,
+0x80000020,0x80108020,0x80108000,0x80000000,
+0x80008000,0x00100000,0x00000020,0x80100020,
+0x00108000,0x00100020,0x80008020,0x00000000,
+0x80000000,0x00008000,0x00108020,0x80100000,
+0x00100020,0x80000020,0x00000000,0x00108000,
+0x00008020,0x80108000,0x80100000,0x00008020,
+0x00000000,0x00108020,0x80100020,0x00100000,
+0x80008020,0x80100000,0x80108000,0x00008000,
+0x80100000,0x80008000,0x00000020,0x80108020,
+0x00108020,0x00000020,0x00008000,0x80000000,
+0x00008020,0x80108000,0x00100000,0x80000020,
+0x00100020,0x80008020,0x80000020,0x00100020,
+0x00108000,0x00000000,0x80008000,0x00008020,
+0x80000000,0x80100020,0x80108020,0x00108000},
+{
+0x00000208,0x08020200,0x00000000,0x08020008,
+0x08000200,0x00000000,0x00020208,0x08000200,
+0x00020008,0x08000008,0x08000008,0x00020000,
+0x08020208,0x00020008,0x08020000,0x00000208,
+0x08000000,0x00000008,0x08020200,0x00000200,
+0x00020200,0x08020000,0x08020008,0x00020208,
+0x08000208,0x00020200,0x00020000,0x08000208,
+0x00000008,0x08020208,0x00000200,0x08000000,
+0x08020200,0x08000000,0x00020008,0x00000208,
+0x00020000,0x08020200,0x08000200,0x00000000,
+0x00000200,0x00020008,0x08020208,0x08000200,
+0x08000008,0x00000200,0x00000000,0x08020008,
+0x08000208,0x00020000,0x08000000,0x08020208,
+0x00000008,0x00020208,0x00020200,0x08000008,
+0x08020000,0x08000208,0x00000208,0x08020000,
+0x00020208,0x00000008,0x08020008,0x00020200},
+{
+0x00802001,0x00002081,0x00002081,0x00000080,
+0x00802080,0x00800081,0x00800001,0x00002001,
+0x00000000,0x00802000,0x00802000,0x00802081,
+0x00000081,0x00000000,0x00800080,0x00800001,
+0x00000001,0x00002000,0x00800000,0x00802001,
+0x00000080,0x00800000,0x00002001,0x00002080,
+0x00800081,0x00000001,0x00002080,0x00800080,
+0x00002000,0x00802080,0x00802081,0x00000081,
+0x00800080,0x00800001,0x00802000,0x00802081,
+0x00000081,0x00000000,0x00000000,0x00802000,
+0x00002080,0x00800080,0x00800081,0x00000001,
+0x00802001,0x00002081,0x00002081,0x00000080,
+0x00802081,0x00000081,0x00000001,0x00002000,
+0x00800001,0x00002001,0x00802080,0x00800081,
+0x00002001,0x00002080,0x00800000,0x00802001,
+0x00000080,0x00800000,0x00002000,0x00802080},
+{
+0x00000100,0x02080100,0x02080000,0x42000100,
+0x00080000,0x00000100,0x40000000,0x02080000,
+0x40080100,0x00080000,0x02000100,0x40080100,
+0x42000100,0x42080000,0x00080100,0x40000000,
+0x02000000,0x40080000,0x40080000,0x00000000,
+0x40000100,0x42080100,0x42080100,0x02000100,
+0x42080000,0x40000100,0x00000000,0x42000000,
+0x02080100,0x02000000,0x42000000,0x00080100,
+0x00080000,0x42000100,0x00000100,0x02000000,
+0x40000000,0x02080000,0x42000100,0x40080100,
+0x02000100,0x40000000,0x42080000,0x02080100,
+0x40080100,0x00000100,0x02000000,0x42080000,
+0x42080100,0x00080100,0x42000000,0x42080100,
+0x02080000,0x00000000,0x40080000,0x42000000,
+0x00080100,0x02000100,0x40000100,0x00080000,
+0x00000000,0x40080000,0x02080100,0x40000100},
+{
+0x20000010,0x20400000,0x00004000,0x20404010,
+0x20400000,0x00000010,0x20404010,0x00400000,
+0x20004000,0x00404010,0x00400000,0x20000010,
+0x00400010,0x20004000,0x20000000,0x00004010,
+0x00000000,0x00400010,0x20004010,0x00004000,
+0x00404000,0x20004010,0x00000010,0x20400010,
+0x20400010,0x00000000,0x00404010,0x20404000,
+0x00004010,0x00404000,0x20404000,0x20000000,
+0x20004000,0x00000010,0x20400010,0x00404000,
+0x20404010,0x00400000,0x00004010,0x20000010,
+0x00400000,0x20004000,0x20000000,0x00004010,
+0x20000010,0x20404010,0x00404000,0x20400000,
+0x00404010,0x20404000,0x00000000,0x20400010,
+0x00000010,0x00004000,0x20400000,0x00404010,
+0x00004000,0x00400010,0x20004010,0x00000000,
+0x20404000,0x20000000,0x00400010,0x20004010},
+{
+0x00200000,0x04200002,0x04000802,0x00000000,
+0x00000800,0x04000802,0x00200802,0x04200800,
+0x04200802,0x00200000,0x00000000,0x04000002,
+0x00000002,0x04000000,0x04200002,0x00000802,
+0x04000800,0x00200802,0x00200002,0x04000800,
+0x04000002,0x04200000,0x04200800,0x00200002,
+0x04200000,0x00000800,0x00000802,0x04200802,
+0x00200800,0x00000002,0x04000000,0x00200800,
+0x04000000,0x00200800,0x00200000,0x04000802,
+0x04000802,0x04200002,0x04200002,0x00000002,
+0x00200002,0x04000000,0x04000800,0x00200000,
+0x04200800,0x00000802,0x00200802,0x04200800,
+0x00000802,0x04000002,0x04200802,0x04200000,
+0x00200800,0x00000000,0x00000002,0x04200802,
+0x00000000,0x00200802,0x04200000,0x00000800,
+0x04000002,0x04000800,0x00000800,0x00200002},
+{
+0x10001040,0x00001000,0x00040000,0x10041040,
+0x10000000,0x10001040,0x00000040,0x10000000,
+0x00040040,0x10040000,0x10041040,0x00041000,
+0x10041000,0x00041040,0x00001000,0x00000040,
+0x10040000,0x10000040,0x10001000,0x00001040,
+0x00041000,0x00040040,0x10040040,0x10041000,
+0x00001040,0x00000000,0x00000000,0x10040040,
+0x10000040,0x10001000,0x00041040,0x00040000,
+0x00041040,0x00040000,0x10041000,0x00001000,
+0x00000040,0x10040040,0x00001000,0x00041040,
+0x10001000,0x00000040,0x10000040,0x10040000,
+0x10040040,0x10000000,0x00040000,0x10001040,
+0x00000000,0x10041040,0x00040040,0x10000040,
+0x10040000,0x10001000,0x10001040,0x00000000,
+0x10041040,0x00041000,0x00041000,0x00001040,
+0x00001040,0x00040040,0x10000000,0x10041000}
+};
+
+
+static INLINE void IPERM(word32* left, word32* right)
+{
+    word32 work;
+
+    *right = rotlFixed(*right, 4U);
+    work = (*left ^ *right) & 0xf0f0f0f0;
+    *left ^= work;
+
+    *right = rotrFixed(*right^work, 20U);
+    work = (*left ^ *right) & 0xffff0000;
+    *left ^= work;
+
+    *right = rotrFixed(*right^work, 18U);
+    work = (*left ^ *right) & 0x33333333;
+    *left ^= work;
+
+    *right = rotrFixed(*right^work, 6U);
+    work = (*left ^ *right) & 0x00ff00ff;
+    *left ^= work;
+
+    *right = rotlFixed(*right^work, 9U);
+    work = (*left ^ *right) & 0xaaaaaaaa;
+    *left = rotlFixed(*left^work, 1U);
+    *right ^= work;
+}
+
+
+static INLINE void FPERM(word32* left, word32* right)
+{
+    word32 work;
+
+    *right = rotrFixed(*right, 1U);
+    work = (*left ^ *right) & 0xaaaaaaaa;
+    *right ^= work;
+
+    *left = rotrFixed(*left^work, 9U);
+    work = (*left ^ *right) & 0x00ff00ff;
+    *right ^= work;
+
+    *left = rotlFixed(*left^work, 6U);
+    work = (*left ^ *right) & 0x33333333;
+    *right ^= work;
+
+    *left = rotlFixed(*left^work, 18U);
+    work = (*left ^ *right) & 0xffff0000;
+    *right ^= work;
+
+    *left = rotlFixed(*left^work, 20U);
+    work = (*left ^ *right) & 0xf0f0f0f0;
+    *right ^= work;
+
+    *left = rotrFixed(*left^work, 4U);
+}
+
+
+static void DesSetKey(const byte* key, int dir, word32* out)
+{
+    byte buffer[56+56+8];
+    byte *const pc1m = buffer;                 /* place to modify pc1 into */
+    byte *const pcr = pc1m + 56;               /* place to rotate pc1 into */
+    byte *const ks = pcr + 56;
+    register int i,j,l;
+    int m;
+
+    for (j = 0; j < 56; j++) {          /* convert pc1 to bits of key */
+        l = pc1[j] - 1;                 /* integer bit location  */
+        m = l & 07;                     /* find bit              */
+        pc1m[j] = (key[l >> 3] &        /* find which key byte l is in */
+            bytebit[m])                 /* and which bit of that byte */
+            ? 1 : 0;                    /* and store 1-bit result */
+    }
+    for (i = 0; i < 16; i++) {          /* key chunk for each iteration */
+        XMEMSET(ks, 0, 8);               /* Clear key schedule */
+        for (j = 0; j < 56; j++)        /* rotate pc1 the right amount */
+            pcr[j] = pc1m[(l = j + totrot[i]) < (j < 28 ? 28 : 56) ? l: l-28];
+        /* rotate left and right halves independently */
+        for (j = 0; j < 48; j++){   /* select bits individually */
+            /* check bit that goes to ks[j] */
+            if (pcr[pc2[j] - 1]){
+                /* mask it in if it's there */
+                l= j % 6;
+                ks[j/6] |= bytebit[l] >> 2;
+            }
+        }
+        /* Now convert to odd/even interleaved form for use in F */
+        out[2*i] = ((word32)ks[0] << 24)
+            | ((word32)ks[2] << 16)
+            | ((word32)ks[4] << 8)
+            | ((word32)ks[6]);
+        out[2*i + 1] = ((word32)ks[1] << 24)
+            | ((word32)ks[3] << 16)
+            | ((word32)ks[5] << 8)
+            | ((word32)ks[7]);
+    }
+    
+    /* reverse key schedule order */
+    if (dir == DES_DECRYPTION)
+        for (i = 0; i < 16; i += 2) {
+            word32 swap = out[i];
+            out[i] = out[DES_KS_SIZE - 2 - i];
+            out[DES_KS_SIZE - 2 - i] = swap;
+
+            swap = out[i + 1];
+            out[i + 1] = out[DES_KS_SIZE - 1 - i];
+            out[DES_KS_SIZE - 1 - i] = swap;
+        }
+   
+}
+
+
+static INLINE int Reverse(int dir)
+{
+    return !dir;
+}
+
+
+void Des_SetIV(Des* des, const byte* iv)
+{
+    if (des && iv)
+        XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
+}
+
+
+void Des3_SetIV(Des3* des, const byte* iv)
+{
+    if (des && iv)
+        XMEMCPY(des->reg, iv, DES_BLOCK_SIZE);
+}
+
+
+void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir)
+{
+    DesSetKey(key, dir, des->key);
+
+    Des_SetIV(des, iv);
+}
+
+
+void Des3_SetKey(Des3* des, const byte* key, const byte* iv, int dir)
+{
+    DesSetKey(key + (dir == DES_ENCRYPTION ? 0 : 16), dir, des->key[0]);
+    DesSetKey(key + 8, Reverse(dir), des->key[1]);
+    DesSetKey(key + (dir == DES_DECRYPTION ? 0 : 16), dir, des->key[2]);
+
+    Des3_SetIV(des, iv);  
+}
+
+
+static void DesRawProcessBlock(word32* lIn, word32* rIn, const word32* kptr)
+{
+    word32 l = *lIn, r = *rIn, i;
+
+    for (i=0; i<8; i++)
+    {
+        word32 work = rotrFixed(r, 4U) ^ kptr[4*i+0];
+        l ^= Spbox[6][(work) & 0x3f]
+          ^  Spbox[4][(work >> 8) & 0x3f]
+          ^  Spbox[2][(work >> 16) & 0x3f]
+          ^  Spbox[0][(work >> 24) & 0x3f];
+        work = r ^ kptr[4*i+1];
+        l ^= Spbox[7][(work) & 0x3f]
+          ^  Spbox[5][(work >> 8) & 0x3f]
+          ^  Spbox[3][(work >> 16) & 0x3f]
+          ^  Spbox[1][(work >> 24) & 0x3f];
+
+        work = rotrFixed(l, 4U) ^ kptr[4*i+2];
+        r ^= Spbox[6][(work) & 0x3f]
+          ^  Spbox[4][(work >> 8) & 0x3f]
+          ^  Spbox[2][(work >> 16) & 0x3f]
+          ^  Spbox[0][(work >> 24) & 0x3f];
+        work = l ^ kptr[4*i+3];
+        r ^= Spbox[7][(work) & 0x3f]
+          ^  Spbox[5][(work >> 8) & 0x3f]
+          ^  Spbox[3][(work >> 16) & 0x3f]
+          ^  Spbox[1][(work >> 24) & 0x3f];
+    }
+
+    *lIn = l; *rIn = r;
+}
+
+
+static void DesProcessBlock(Des* des, const byte* in, byte* out)
+{
+    word32 l, r;
+
+    XMEMCPY(&l, in, sizeof(l));
+    XMEMCPY(&r, in + sizeof(l), sizeof(r));
+    #ifdef LITTLE_ENDIAN_ORDER
+        l = ByteReverseWord32(l);
+        r = ByteReverseWord32(r);
+    #endif
+    IPERM(&l,&r);
+    
+    DesRawProcessBlock(&l, &r, des->key);   
+
+    FPERM(&l,&r);
+    #ifdef LITTLE_ENDIAN_ORDER
+        l = ByteReverseWord32(l);
+        r = ByteReverseWord32(r);
+    #endif
+    XMEMCPY(out, &r, sizeof(r));
+    XMEMCPY(out + sizeof(r), &l, sizeof(l));
+}
+
+
+static void Des3ProcessBlock(Des3* des, const byte* in, byte* out)
+{
+    word32 l, r;
+
+    XMEMCPY(&l, in, sizeof(l));
+    XMEMCPY(&r, in + sizeof(l), sizeof(r));
+    #ifdef LITTLE_ENDIAN_ORDER
+        l = ByteReverseWord32(l);
+        r = ByteReverseWord32(r);
+    #endif
+    IPERM(&l,&r);
+    
+    DesRawProcessBlock(&l, &r, des->key[0]);   
+    DesRawProcessBlock(&r, &l, des->key[1]);   
+    DesRawProcessBlock(&l, &r, des->key[2]);   
+
+    FPERM(&l,&r);
+    #ifdef LITTLE_ENDIAN_ORDER
+        l = ByteReverseWord32(l);
+        r = ByteReverseWord32(r);
+    #endif
+    XMEMCPY(out, &r, sizeof(r));
+    XMEMCPY(out + sizeof(r), &l, sizeof(l));
+}
+
+
+void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / DES_BLOCK_SIZE;
+
+    while (blocks--) {
+        xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
+        DesProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
+        XMEMCPY(out, des->reg, DES_BLOCK_SIZE);
+
+        out += DES_BLOCK_SIZE;
+        in  += DES_BLOCK_SIZE; 
+    }
+}
+
+
+void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / DES_BLOCK_SIZE;
+    byte   hold[16];
+
+    while (blocks--) {
+        XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
+        DesProcessBlock(des, (byte*)des->tmp, out);
+        xorbuf(out, (byte*)des->reg, DES_BLOCK_SIZE);
+
+        XMEMCPY(hold, des->reg, DES_BLOCK_SIZE);
+        XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
+        XMEMCPY(des->tmp, hold, DES_BLOCK_SIZE);
+
+        out += DES_BLOCK_SIZE;
+        in  += DES_BLOCK_SIZE; 
+    }
+}
+
+
+void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / DES_BLOCK_SIZE;
+
+    while (blocks--) {
+        xorbuf((byte*)des->reg, in, DES_BLOCK_SIZE);
+        Des3ProcessBlock(des, (byte*)des->reg, (byte*)des->reg);
+        XMEMCPY(out, des->reg, DES_BLOCK_SIZE);
+
+        out += DES_BLOCK_SIZE;
+        in  += DES_BLOCK_SIZE; 
+    }
+}
+
+
+void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / DES_BLOCK_SIZE;
+
+    while (blocks--) {
+        XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
+        Des3ProcessBlock(des, (byte*)des->tmp, out);
+        xorbuf(out, (byte*)des->reg, DES_BLOCK_SIZE);
+        XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
+
+        out += DES_BLOCK_SIZE;
+        in  += DES_BLOCK_SIZE; 
+    }
+}
+
+#ifdef CYASSL_DES_ECB
+
+/* One block, compatibility only */
+void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz)
+{
+    word32 blocks = sz / DES_BLOCK_SIZE;
+
+    while (blocks--) {
+        DesProcessBlock(des, in, out);
+
+        out += DES_BLOCK_SIZE;
+        in  += DES_BLOCK_SIZE; 
+    }
+}
+
+#endif /* CYASSL_DES_ECB */
+
+
+#endif /* NO_DES3 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dh.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dh.c
new file mode 100644 (file)
index 0000000..e7c6faa
--- /dev/null
@@ -0,0 +1,169 @@
+/* dh.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_DH
+
+#include <cyassl/ctaocrypt/dh.h>
+#include <cyassl/ctaocrypt/error.h>
+
+#ifndef USER_MATH_LIB
+    #include <math.h>
+    #define XPOW(x,y) pow((x),(y))
+    #define XLOG(x)   log((x))
+#else
+    /* user's own math lib */
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitDhKey(DhKey* key)
+{
+    (void)key;
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    key->p.dp = 0;
+    key->g.dp = 0;
+#endif
+}
+
+
+void FreeDhKey(DhKey* key)
+{
+    (void)key;
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    mp_clear(&key->p);
+    mp_clear(&key->g);
+#endif
+}
+
+
+static word32 DiscreteLogWorkFactor(word32 n)
+{
+    /* assuming discrete log takes about the same time as factoring */
+    if (n<5)
+        return 0;
+    else
+        return (word32)(2.4 * XPOW((double)n, 1.0/3.0) *
+                XPOW(XLOG((double)n), 2.0/3.0) - 5);
+}
+
+
+static void GeneratePrivate(DhKey* key, RNG* rng, byte* priv, word32* privSz)
+{
+    word32 sz = mp_unsigned_bin_size(&key->p);
+    sz = min(sz, 2 * DiscreteLogWorkFactor(sz * BIT_SIZE) / BIT_SIZE + 1);
+
+    RNG_GenerateBlock(rng, priv, sz);
+    priv[0] |= 0x0C;
+
+    *privSz = sz;
+}
+
+
+static int GeneratePublic(DhKey* key, const byte* priv, word32 privSz,
+                          byte* pub, word32* pubSz)
+{
+    int ret = 0;
+
+    mp_int x; 
+    mp_int y;
+
+    if (mp_init_multi(&x, &y, 0, 0, 0, 0) != MP_OKAY)
+        return MP_INIT_E;
+
+    if (mp_read_unsigned_bin(&x, priv, privSz) != MP_OKAY)
+        ret = MP_READ_E;
+
+    if (ret == 0 && mp_exptmod(&key->g, &x, &key->p, &y) != MP_OKAY)
+        ret = MP_EXPTMOD_E;
+
+    if (ret == 0 && mp_to_unsigned_bin(&y, pub) != MP_OKAY)
+        ret = MP_TO_E;
+
+    if (ret == 0)
+        *pubSz = mp_unsigned_bin_size(&y);
+
+    mp_clear(&y);
+    mp_clear(&x);
+
+    return ret;
+}
+
+
+int DhGenerateKeyPair(DhKey* key, RNG* rng, byte* priv, word32* privSz,
+                      byte* pub, word32* pubSz)
+{
+    GeneratePrivate(key, rng, priv, privSz);
+    return GeneratePublic(key, priv, *privSz, pub, pubSz);
+
+}
+
+int DhAgree(DhKey* key, byte* agree, word32* agreeSz, const byte* priv,
+            word32 privSz, const byte* otherPub, word32 pubSz)
+{
+    int ret = 0;
+
+    mp_int x; 
+    mp_int y;
+    mp_int z;
+
+    if (mp_init_multi(&x, &y, &z, 0, 0, 0) != MP_OKAY)
+        return MP_INIT_E;
+
+    if (mp_read_unsigned_bin(&x, priv, privSz) != MP_OKAY)
+        ret = MP_READ_E;
+
+    if (ret == 0 && mp_read_unsigned_bin(&y, otherPub, pubSz) != MP_OKAY)
+        ret = MP_READ_E;
+
+    if (ret == 0 && mp_exptmod(&y, &x, &key->p, &z) != MP_OKAY)
+        ret = MP_EXPTMOD_E;
+
+    if (ret == 0 && mp_to_unsigned_bin(&z, agree) != MP_OKAY)
+        ret = MP_TO_E;
+
+    if (ret == 0)
+        *agreeSz = mp_unsigned_bin_size(&z);
+
+    mp_clear(&z);
+    mp_clear(&y);
+    mp_clear(&x);
+
+    return ret;
+}
+
+
+#endif /* NO_DH */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dsa.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/dsa.c
new file mode 100644 (file)
index 0000000..6aded3e
--- /dev/null
@@ -0,0 +1,221 @@
+/* dsa.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_DSA
+
+#include <cyassl/ctaocrypt/dsa.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/random.h>
+#include <cyassl/ctaocrypt/error.h>
+
+
+enum {
+    DSA_HALF_SIZE = 20,   /* r and s size  */
+    DSA_SIG_SIZE  = 40    /* signature size */
+};
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitDsaKey(DsaKey* key)
+{
+    key->type = -1;  /* haven't decided yet */
+
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    key->p.dp = 0;   /* public  alloc parts */
+    key->q.dp = 0;    
+    key->g.dp = 0;    
+    key->y.dp = 0;    
+
+    key->x.dp = 0;   /* private alloc parts */
+#endif
+}
+
+
+void FreeDsaKey(DsaKey* key)
+{
+    (void)key;
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    if (key->type == DSA_PRIVATE)
+        mp_clear(&key->x);
+    mp_clear(&key->y);
+    mp_clear(&key->g);
+    mp_clear(&key->q);
+    mp_clear(&key->p);
+#endif
+}
+
+
+int DsaSign(const byte* digest, byte* out, DsaKey* key, RNG* rng)
+{
+    mp_int k, kInv, r, s, H;
+    int    ret = 0, sz;
+    byte   buffer[DSA_HALF_SIZE];
+
+    if (mp_init_multi(&k, &kInv, &r, &s, &H, 0) != MP_OKAY)
+        return MP_INIT_E;
+
+    sz = min(sizeof(buffer), mp_unsigned_bin_size(&key->q)); 
+
+    /* generate k */
+    RNG_GenerateBlock(rng, buffer, sz);
+    buffer[0] |= 0x0C;
+
+    if (mp_read_unsigned_bin(&k, buffer, sz) != MP_OKAY)
+        ret = MP_READ_E;
+
+    if (mp_cmp_d(&k, 1) != MP_GT)
+        ret = MP_CMP_E;
+
+    /* inverse k mod q */
+    if (ret == 0 && mp_invmod(&k, &key->q, &kInv) != MP_OKAY)
+        ret = MP_INVMOD_E;
+
+    /* generate r, r = (g exp k mod p) mod q */
+    if (ret == 0 && mp_exptmod(&key->g, &k, &key->p, &r) != MP_OKAY)
+        ret = MP_EXPTMOD_E;
+
+    if (ret == 0 && mp_mod(&r, &key->q, &r) != MP_OKAY)
+        ret = MP_MOD_E;
+
+    /* generate H from sha digest */
+    if (ret == 0 && mp_read_unsigned_bin(&H, digest,SHA_DIGEST_SIZE) != MP_OKAY)
+        ret = MP_READ_E;
+
+    /* generate s, s = (kInv * (H + x*r)) % q */
+    if (ret == 0 && mp_mul(&key->x, &r, &s) != MP_OKAY)
+        ret = MP_MUL_E;
+
+    if (ret == 0 && mp_add(&s, &H, &s) != MP_OKAY)
+        ret = MP_ADD_E;
+
+    if (ret == 0 && mp_mulmod(&s, &kInv, &key->q, &s) != MP_OKAY)
+        ret = MP_MULMOD_E;
+
+    /* write out */
+    if (ret == 0)  {
+        int rSz = mp_unsigned_bin_size(&r);
+        int sSz = mp_unsigned_bin_size(&s);
+
+        if (rSz == DSA_HALF_SIZE - 1) {
+            out[0] = 0;
+            out++;
+        }
+
+        if (mp_to_unsigned_bin(&r, out) != MP_OKAY)
+            ret = MP_TO_E;
+        else {
+            if (sSz == DSA_HALF_SIZE - 1) {
+                out[rSz] = 0;
+                out++;
+            }    
+            ret = mp_to_unsigned_bin(&s, out + rSz);
+        }
+    }
+
+    mp_clear(&H);
+    mp_clear(&s);
+    mp_clear(&r);
+    mp_clear(&kInv);
+    mp_clear(&k);
+
+    return ret;
+}
+
+
+int DsaVerify(const byte* digest, const byte* sig, DsaKey* key, int* answer)
+{
+    mp_int w, u1, u2, v, r, s;
+    int    ret = 0;
+
+    if (mp_init_multi(&w, &u1, &u2, &v, &r, &s) != MP_OKAY)
+        return MP_INIT_E;
+
+    /* set r and s from signature */
+    if (mp_read_unsigned_bin(&r, sig, DSA_HALF_SIZE) != MP_OKAY ||
+        mp_read_unsigned_bin(&s, sig + DSA_HALF_SIZE, DSA_HALF_SIZE) != MP_OKAY)
+        ret = MP_READ_E;
+
+    /* sanity checks */
+
+
+    /* put H into u1 from sha digest */
+    if (ret == 0 && mp_read_unsigned_bin(&u1,digest,SHA_DIGEST_SIZE) != MP_OKAY)
+        ret = MP_READ_E;
+
+    /* w = s invmod q */
+    if (ret == 0 && mp_invmod(&s, &key->q, &w) != MP_OKAY)
+        ret = MP_INVMOD_E;
+
+    /* u1 = (H * w) % q */
+    if (ret == 0 && mp_mulmod(&u1, &w, &key->q, &u1) != MP_OKAY)
+        ret = MP_MULMOD_E;
+
+    /* u2 = (r * w) % q */
+    if (ret == 0 && mp_mulmod(&r, &w, &key->q, &u2) != MP_OKAY)
+        ret = MP_MULMOD_E;
+
+    /* verify v = ((g^u1 * y^u2) mod p) mod q */
+    if (ret == 0 && mp_exptmod(&key->g, &u1, &key->p, &u1) != MP_OKAY)
+        ret = MP_EXPTMOD_E;
+
+    if (ret == 0 && mp_exptmod(&key->y, &u2, &key->p, &u2) != MP_OKAY)
+        ret = MP_EXPTMOD_E;
+
+    if (ret == 0 && mp_mulmod(&u1, &u2, &key->p, &v) != MP_OKAY)
+        ret = MP_MULMOD_E;
+
+    if (ret == 0 && mp_mod(&v, &key->q, &v) != MP_OKAY)
+        ret = MP_MULMOD_E;
+
+    /* do they match */
+    if (ret == 0 && mp_cmp(&r, &v) == MP_EQ)
+        *answer = 1;
+    else
+        *answer = 0;
+
+    mp_clear(&s);
+    mp_clear(&r);
+    mp_clear(&u1);
+    mp_clear(&u2);
+    mp_clear(&w);
+    mp_clear(&v);
+
+    return ret;
+}
+
+
+#endif /* NO_DSA */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc.c
new file mode 100644 (file)
index 0000000..9f03ed2
--- /dev/null
@@ -0,0 +1 @@
+/* dummy ecc.c for dist */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc_fp.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ecc_fp.c
new file mode 100644 (file)
index 0000000..c8acf93
--- /dev/null
@@ -0,0 +1 @@
+/* dummy ecc_fp.c for dist */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mont_small.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mont_small.i
new file mode 100644 (file)
index 0000000..3b50d6b
--- /dev/null
@@ -0,0 +1,3860 @@
+/* fp_mont_small.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SMALL_MONT_SET
+/* computes x/R == x (mod N) via Montgomery Reduction */
+void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp)
+{
+   fp_digit c[FP_SIZE], *_c, *tmpm, mu, cy;
+   int      oldused, x, y, pa;
+
+#if defined(USE_MEMSET)
+   /* now zero the buff */
+   memset(c, 0, sizeof c);
+#endif
+   pa = m->used;
+
+   /* copy the input */
+   oldused = a->used;
+   for (x = 0; x < oldused; x++) {
+       c[x] = a->dp[x];
+   }
+#if !defined(USE_MEMSET)
+   for (; x < 2*pa+3; x++) {
+       c[x] = 0;
+   }
+#endif
+   MONT_START;
+
+   switch (pa) {
+      case 1:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 2:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 3:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 4:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 5:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 6:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 7:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 8:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 9:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 10:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 11:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 12:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 11; cy   = 0;
+            LOOP_START;
+            _c   = c + 11;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 13:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 11; cy   = 0;
+            LOOP_START;
+            _c   = c + 11;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 12; cy   = 0;
+            LOOP_START;
+            _c   = c + 12;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 14:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 11; cy   = 0;
+            LOOP_START;
+            _c   = c + 11;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 12; cy   = 0;
+            LOOP_START;
+            _c   = c + 12;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 13; cy   = 0;
+            LOOP_START;
+            _c   = c + 13;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 15:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 11; cy   = 0;
+            LOOP_START;
+            _c   = c + 11;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 12; cy   = 0;
+            LOOP_START;
+            _c   = c + 12;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 13; cy   = 0;
+            LOOP_START;
+            _c   = c + 13;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 14; cy   = 0;
+            LOOP_START;
+            _c   = c + 14;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+      case 16:
+            x = 0; cy   = 0;
+            LOOP_START;
+            _c   = c + 0;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 1; cy   = 0;
+            LOOP_START;
+            _c   = c + 1;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 2; cy   = 0;
+            LOOP_START;
+            _c   = c + 2;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 3; cy   = 0;
+            LOOP_START;
+            _c   = c + 3;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 4; cy   = 0;
+            LOOP_START;
+            _c   = c + 4;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 5; cy   = 0;
+            LOOP_START;
+            _c   = c + 5;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 6; cy   = 0;
+            LOOP_START;
+            _c   = c + 6;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 7; cy   = 0;
+            LOOP_START;
+            _c   = c + 7;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 8; cy   = 0;
+            LOOP_START;
+            _c   = c + 8;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 9; cy   = 0;
+            LOOP_START;
+            _c   = c + 9;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 10; cy   = 0;
+            LOOP_START;
+            _c   = c + 10;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 11; cy   = 0;
+            LOOP_START;
+            _c   = c + 11;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 12; cy   = 0;
+            LOOP_START;
+            _c   = c + 12;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 13; cy   = 0;
+            LOOP_START;
+            _c   = c + 13;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 14; cy   = 0;
+            LOOP_START;
+            _c   = c + 14;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+            x = 15; cy   = 0;
+            LOOP_START;
+            _c   = c + 15;
+            tmpm = m->dp;
+#ifdef INNERMUL8
+            INNERMUL8; _c += 8; tmpm += 8;
+            INNERMUL8; _c += 8; tmpm += 8;
+#else
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+            INNERMUL; ++_c;
+#endif
+            LOOP_END;
+            while (cy) {
+               PROPCARRY;
+               ++_c;
+            }
+         break;
+  }
+  /* now copy out */
+  _c   = c + pa;
+  tmpm = a->dp;
+  for (x = 0; x < pa+1; x++) {
+     *tmpm++ = *_c++;
+  }
+
+  for (; x < oldused; x++)   {
+     *tmpm++ = 0;
+  }
+
+  MONT_FINI;
+
+  a->used = pa+1;
+  fp_clamp(a);
+
+  /* if A >= m then A = A - m */
+  if (fp_cmp_mag (a, m) != FP_LT) {
+    s_fp_sub (a, m, a);
+  }
+}
+
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_12.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_12.i
new file mode 100644 (file)
index 0000000..a7c5871
--- /dev/null
@@ -0,0 +1,130 @@
+/* fp_mul_comba_12.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL12
+void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[24];
+
+   memcpy(at, A->dp, 12 * sizeof(fp_digit));
+   memcpy(at+12, B->dp, 12 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[12]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[13]);    MULADD(at[1], at[12]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[14]);    MULADD(at[1], at[13]);    MULADD(at[2], at[12]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[15]);    MULADD(at[1], at[14]);    MULADD(at[2], at[13]);    MULADD(at[3], at[12]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[16]);    MULADD(at[1], at[15]);    MULADD(at[2], at[14]);    MULADD(at[3], at[13]);    MULADD(at[4], at[12]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[17]);    MULADD(at[1], at[16]);    MULADD(at[2], at[15]);    MULADD(at[3], at[14]);    MULADD(at[4], at[13]);    MULADD(at[5], at[12]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[18]);    MULADD(at[1], at[17]);    MULADD(at[2], at[16]);    MULADD(at[3], at[15]);    MULADD(at[4], at[14]);    MULADD(at[5], at[13]);    MULADD(at[6], at[12]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[19]);    MULADD(at[1], at[18]);    MULADD(at[2], at[17]);    MULADD(at[3], at[16]);    MULADD(at[4], at[15]);    MULADD(at[5], at[14]);    MULADD(at[6], at[13]);    MULADD(at[7], at[12]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[20]);    MULADD(at[1], at[19]);    MULADD(at[2], at[18]);    MULADD(at[3], at[17]);    MULADD(at[4], at[16]);    MULADD(at[5], at[15]);    MULADD(at[6], at[14]);    MULADD(at[7], at[13]);    MULADD(at[8], at[12]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[21]);    MULADD(at[1], at[20]);    MULADD(at[2], at[19]);    MULADD(at[3], at[18]);    MULADD(at[4], at[17]);    MULADD(at[5], at[16]);    MULADD(at[6], at[15]);    MULADD(at[7], at[14]);    MULADD(at[8], at[13]);    MULADD(at[9], at[12]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[22]);    MULADD(at[1], at[21]);    MULADD(at[2], at[20]);    MULADD(at[3], at[19]);    MULADD(at[4], at[18]);    MULADD(at[5], at[17]);    MULADD(at[6], at[16]);    MULADD(at[7], at[15]);    MULADD(at[8], at[14]);    MULADD(at[9], at[13]);    MULADD(at[10], at[12]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[23]);    MULADD(at[1], at[22]);    MULADD(at[2], at[21]);    MULADD(at[3], at[20]);    MULADD(at[4], at[19]);    MULADD(at[5], at[18]);    MULADD(at[6], at[17]);    MULADD(at[7], at[16]);    MULADD(at[8], at[15]);    MULADD(at[9], at[14]);    MULADD(at[10], at[13]);    MULADD(at[11], at[12]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[23]);    MULADD(at[2], at[22]);    MULADD(at[3], at[21]);    MULADD(at[4], at[20]);    MULADD(at[5], at[19]);    MULADD(at[6], at[18]);    MULADD(at[7], at[17]);    MULADD(at[8], at[16]);    MULADD(at[9], at[15]);    MULADD(at[10], at[14]);    MULADD(at[11], at[13]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[23]);    MULADD(at[3], at[22]);    MULADD(at[4], at[21]);    MULADD(at[5], at[20]);    MULADD(at[6], at[19]);    MULADD(at[7], at[18]);    MULADD(at[8], at[17]);    MULADD(at[9], at[16]);    MULADD(at[10], at[15]);    MULADD(at[11], at[14]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[23]);    MULADD(at[4], at[22]);    MULADD(at[5], at[21]);    MULADD(at[6], at[20]);    MULADD(at[7], at[19]);    MULADD(at[8], at[18]);    MULADD(at[9], at[17]);    MULADD(at[10], at[16]);    MULADD(at[11], at[15]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[23]);    MULADD(at[5], at[22]);    MULADD(at[6], at[21]);    MULADD(at[7], at[20]);    MULADD(at[8], at[19]);    MULADD(at[9], at[18]);    MULADD(at[10], at[17]);    MULADD(at[11], at[16]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[23]);    MULADD(at[6], at[22]);    MULADD(at[7], at[21]);    MULADD(at[8], at[20]);    MULADD(at[9], at[19]);    MULADD(at[10], at[18]);    MULADD(at[11], at[17]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[23]);    MULADD(at[7], at[22]);    MULADD(at[8], at[21]);    MULADD(at[9], at[20]);    MULADD(at[10], at[19]);    MULADD(at[11], at[18]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[23]);    MULADD(at[8], at[22]);    MULADD(at[9], at[21]);    MULADD(at[10], at[20]);    MULADD(at[11], at[19]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[23]);    MULADD(at[9], at[22]);    MULADD(at[10], at[21]);    MULADD(at[11], at[20]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[23]);    MULADD(at[10], at[22]);    MULADD(at[11], at[21]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[23]);    MULADD(at[11], at[22]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[23]); 
+   COMBA_STORE(C->dp[22]);
+   COMBA_STORE2(C->dp[23]);
+   C->used = 24;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_17.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_17.i
new file mode 100644 (file)
index 0000000..3ad0716
--- /dev/null
@@ -0,0 +1,170 @@
+/* fp_mul_comba_17.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL17
+void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[34];
+
+   memcpy(at, A->dp, 17 * sizeof(fp_digit));
+   memcpy(at+17, B->dp, 17 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[17]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[18]);    MULADD(at[1], at[17]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[19]);    MULADD(at[1], at[18]);    MULADD(at[2], at[17]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[20]);    MULADD(at[1], at[19]);    MULADD(at[2], at[18]);    MULADD(at[3], at[17]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[21]);    MULADD(at[1], at[20]);    MULADD(at[2], at[19]);    MULADD(at[3], at[18]);    MULADD(at[4], at[17]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[22]);    MULADD(at[1], at[21]);    MULADD(at[2], at[20]);    MULADD(at[3], at[19]);    MULADD(at[4], at[18]);    MULADD(at[5], at[17]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[23]);    MULADD(at[1], at[22]);    MULADD(at[2], at[21]);    MULADD(at[3], at[20]);    MULADD(at[4], at[19]);    MULADD(at[5], at[18]);    MULADD(at[6], at[17]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[24]);    MULADD(at[1], at[23]);    MULADD(at[2], at[22]);    MULADD(at[3], at[21]);    MULADD(at[4], at[20]);    MULADD(at[5], at[19]);    MULADD(at[6], at[18]);    MULADD(at[7], at[17]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[25]);    MULADD(at[1], at[24]);    MULADD(at[2], at[23]);    MULADD(at[3], at[22]);    MULADD(at[4], at[21]);    MULADD(at[5], at[20]);    MULADD(at[6], at[19]);    MULADD(at[7], at[18]);    MULADD(at[8], at[17]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[26]);    MULADD(at[1], at[25]);    MULADD(at[2], at[24]);    MULADD(at[3], at[23]);    MULADD(at[4], at[22]);    MULADD(at[5], at[21]);    MULADD(at[6], at[20]);    MULADD(at[7], at[19]);    MULADD(at[8], at[18]);    MULADD(at[9], at[17]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[27]);    MULADD(at[1], at[26]);    MULADD(at[2], at[25]);    MULADD(at[3], at[24]);    MULADD(at[4], at[23]);    MULADD(at[5], at[22]);    MULADD(at[6], at[21]);    MULADD(at[7], at[20]);    MULADD(at[8], at[19]);    MULADD(at[9], at[18]);    MULADD(at[10], at[17]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[28]);    MULADD(at[1], at[27]);    MULADD(at[2], at[26]);    MULADD(at[3], at[25]);    MULADD(at[4], at[24]);    MULADD(at[5], at[23]);    MULADD(at[6], at[22]);    MULADD(at[7], at[21]);    MULADD(at[8], at[20]);    MULADD(at[9], at[19]);    MULADD(at[10], at[18]);    MULADD(at[11], at[17]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[29]);    MULADD(at[1], at[28]);    MULADD(at[2], at[27]);    MULADD(at[3], at[26]);    MULADD(at[4], at[25]);    MULADD(at[5], at[24]);    MULADD(at[6], at[23]);    MULADD(at[7], at[22]);    MULADD(at[8], at[21]);    MULADD(at[9], at[20]);    MULADD(at[10], at[19]);    MULADD(at[11], at[18]);    MULADD(at[12], at[17]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[30]);    MULADD(at[1], at[29]);    MULADD(at[2], at[28]);    MULADD(at[3], at[27]);    MULADD(at[4], at[26]);    MULADD(at[5], at[25]);    MULADD(at[6], at[24]);    MULADD(at[7], at[23]);    MULADD(at[8], at[22]);    MULADD(at[9], at[21]);    MULADD(at[10], at[20]);    MULADD(at[11], at[19]);    MULADD(at[12], at[18]);    MULADD(at[13], at[17]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[31]);    MULADD(at[1], at[30]);    MULADD(at[2], at[29]);    MULADD(at[3], at[28]);    MULADD(at[4], at[27]);    MULADD(at[5], at[26]);    MULADD(at[6], at[25]);    MULADD(at[7], at[24]);    MULADD(at[8], at[23]);    MULADD(at[9], at[22]);    MULADD(at[10], at[21]);    MULADD(at[11], at[20]);    MULADD(at[12], at[19]);    MULADD(at[13], at[18]);    MULADD(at[14], at[17]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[32]);    MULADD(at[1], at[31]);    MULADD(at[2], at[30]);    MULADD(at[3], at[29]);    MULADD(at[4], at[28]);    MULADD(at[5], at[27]);    MULADD(at[6], at[26]);    MULADD(at[7], at[25]);    MULADD(at[8], at[24]);    MULADD(at[9], at[23]);    MULADD(at[10], at[22]);    MULADD(at[11], at[21]);    MULADD(at[12], at[20]);    MULADD(at[13], at[19]);    MULADD(at[14], at[18]);    MULADD(at[15], at[17]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[33]);    MULADD(at[1], at[32]);    MULADD(at[2], at[31]);    MULADD(at[3], at[30]);    MULADD(at[4], at[29]);    MULADD(at[5], at[28]);    MULADD(at[6], at[27]);    MULADD(at[7], at[26]);    MULADD(at[8], at[25]);    MULADD(at[9], at[24]);    MULADD(at[10], at[23]);    MULADD(at[11], at[22]);    MULADD(at[12], at[21]);    MULADD(at[13], at[20]);    MULADD(at[14], at[19]);    MULADD(at[15], at[18]);    MULADD(at[16], at[17]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[33]);    MULADD(at[2], at[32]);    MULADD(at[3], at[31]);    MULADD(at[4], at[30]);    MULADD(at[5], at[29]);    MULADD(at[6], at[28]);    MULADD(at[7], at[27]);    MULADD(at[8], at[26]);    MULADD(at[9], at[25]);    MULADD(at[10], at[24]);    MULADD(at[11], at[23]);    MULADD(at[12], at[22]);    MULADD(at[13], at[21]);    MULADD(at[14], at[20]);    MULADD(at[15], at[19]);    MULADD(at[16], at[18]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[33]);    MULADD(at[3], at[32]);    MULADD(at[4], at[31]);    MULADD(at[5], at[30]);    MULADD(at[6], at[29]);    MULADD(at[7], at[28]);    MULADD(at[8], at[27]);    MULADD(at[9], at[26]);    MULADD(at[10], at[25]);    MULADD(at[11], at[24]);    MULADD(at[12], at[23]);    MULADD(at[13], at[22]);    MULADD(at[14], at[21]);    MULADD(at[15], at[20]);    MULADD(at[16], at[19]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[33]);    MULADD(at[4], at[32]);    MULADD(at[5], at[31]);    MULADD(at[6], at[30]);    MULADD(at[7], at[29]);    MULADD(at[8], at[28]);    MULADD(at[9], at[27]);    MULADD(at[10], at[26]);    MULADD(at[11], at[25]);    MULADD(at[12], at[24]);    MULADD(at[13], at[23]);    MULADD(at[14], at[22]);    MULADD(at[15], at[21]);    MULADD(at[16], at[20]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[33]);    MULADD(at[5], at[32]);    MULADD(at[6], at[31]);    MULADD(at[7], at[30]);    MULADD(at[8], at[29]);    MULADD(at[9], at[28]);    MULADD(at[10], at[27]);    MULADD(at[11], at[26]);    MULADD(at[12], at[25]);    MULADD(at[13], at[24]);    MULADD(at[14], at[23]);    MULADD(at[15], at[22]);    MULADD(at[16], at[21]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[33]);    MULADD(at[6], at[32]);    MULADD(at[7], at[31]);    MULADD(at[8], at[30]);    MULADD(at[9], at[29]);    MULADD(at[10], at[28]);    MULADD(at[11], at[27]);    MULADD(at[12], at[26]);    MULADD(at[13], at[25]);    MULADD(at[14], at[24]);    MULADD(at[15], at[23]);    MULADD(at[16], at[22]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[33]);    MULADD(at[7], at[32]);    MULADD(at[8], at[31]);    MULADD(at[9], at[30]);    MULADD(at[10], at[29]);    MULADD(at[11], at[28]);    MULADD(at[12], at[27]);    MULADD(at[13], at[26]);    MULADD(at[14], at[25]);    MULADD(at[15], at[24]);    MULADD(at[16], at[23]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[33]);    MULADD(at[8], at[32]);    MULADD(at[9], at[31]);    MULADD(at[10], at[30]);    MULADD(at[11], at[29]);    MULADD(at[12], at[28]);    MULADD(at[13], at[27]);    MULADD(at[14], at[26]);    MULADD(at[15], at[25]);    MULADD(at[16], at[24]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[33]);    MULADD(at[9], at[32]);    MULADD(at[10], at[31]);    MULADD(at[11], at[30]);    MULADD(at[12], at[29]);    MULADD(at[13], at[28]);    MULADD(at[14], at[27]);    MULADD(at[15], at[26]);    MULADD(at[16], at[25]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[33]);    MULADD(at[10], at[32]);    MULADD(at[11], at[31]);    MULADD(at[12], at[30]);    MULADD(at[13], at[29]);    MULADD(at[14], at[28]);    MULADD(at[15], at[27]);    MULADD(at[16], at[26]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[33]);    MULADD(at[11], at[32]);    MULADD(at[12], at[31]);    MULADD(at[13], at[30]);    MULADD(at[14], at[29]);    MULADD(at[15], at[28]);    MULADD(at[16], at[27]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[33]);    MULADD(at[12], at[32]);    MULADD(at[13], at[31]);    MULADD(at[14], at[30]);    MULADD(at[15], at[29]);    MULADD(at[16], at[28]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[33]);    MULADD(at[13], at[32]);    MULADD(at[14], at[31]);    MULADD(at[15], at[30]);    MULADD(at[16], at[29]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[33]);    MULADD(at[14], at[32]);    MULADD(at[15], at[31]);    MULADD(at[16], at[30]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[33]);    MULADD(at[15], at[32]);    MULADD(at[16], at[31]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[33]);    MULADD(at[16], at[32]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[33]); 
+   COMBA_STORE(C->dp[32]);
+   COMBA_STORE2(C->dp[33]);
+   C->used = 34;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_20.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_20.i
new file mode 100644 (file)
index 0000000..b82e779
--- /dev/null
@@ -0,0 +1,193 @@
+/* fp_mul_comba_20.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef TFM_MUL20
+void fp_mul_comba20(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[40];
+   
+   memcpy(at, A->dp, 20 * sizeof(fp_digit));
+   memcpy(at+20, B->dp, 20 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[20]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[21]);    MULADD(at[1], at[20]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[22]);    MULADD(at[1], at[21]);    MULADD(at[2], at[20]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[23]);    MULADD(at[1], at[22]);    MULADD(at[2], at[21]);    MULADD(at[3], at[20]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[24]);    MULADD(at[1], at[23]);    MULADD(at[2], at[22]);    MULADD(at[3], at[21]);    MULADD(at[4], at[20]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[25]);    MULADD(at[1], at[24]);    MULADD(at[2], at[23]);    MULADD(at[3], at[22]);    MULADD(at[4], at[21]);    MULADD(at[5], at[20]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[26]);    MULADD(at[1], at[25]);    MULADD(at[2], at[24]);    MULADD(at[3], at[23]);    MULADD(at[4], at[22]);    MULADD(at[5], at[21]);    MULADD(at[6], at[20]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[27]);    MULADD(at[1], at[26]);    MULADD(at[2], at[25]);    MULADD(at[3], at[24]);    MULADD(at[4], at[23]);    MULADD(at[5], at[22]);    MULADD(at[6], at[21]);    MULADD(at[7], at[20]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[28]);    MULADD(at[1], at[27]);    MULADD(at[2], at[26]);    MULADD(at[3], at[25]);    MULADD(at[4], at[24]);    MULADD(at[5], at[23]);    MULADD(at[6], at[22]);    MULADD(at[7], at[21]);    MULADD(at[8], at[20]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[29]);    MULADD(at[1], at[28]);    MULADD(at[2], at[27]);    MULADD(at[3], at[26]);    MULADD(at[4], at[25]);    MULADD(at[5], at[24]);    MULADD(at[6], at[23]);    MULADD(at[7], at[22]);    MULADD(at[8], at[21]);    MULADD(at[9], at[20]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[30]);    MULADD(at[1], at[29]);    MULADD(at[2], at[28]);    MULADD(at[3], at[27]);    MULADD(at[4], at[26]);    MULADD(at[5], at[25]);    MULADD(at[6], at[24]);    MULADD(at[7], at[23]);    MULADD(at[8], at[22]);    MULADD(at[9], at[21]);    MULADD(at[10], at[20]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[31]);    MULADD(at[1], at[30]);    MULADD(at[2], at[29]);    MULADD(at[3], at[28]);    MULADD(at[4], at[27]);    MULADD(at[5], at[26]);    MULADD(at[6], at[25]);    MULADD(at[7], at[24]);    MULADD(at[8], at[23]);    MULADD(at[9], at[22]);    MULADD(at[10], at[21]);    MULADD(at[11], at[20]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[32]);    MULADD(at[1], at[31]);    MULADD(at[2], at[30]);    MULADD(at[3], at[29]);    MULADD(at[4], at[28]);    MULADD(at[5], at[27]);    MULADD(at[6], at[26]);    MULADD(at[7], at[25]);    MULADD(at[8], at[24]);    MULADD(at[9], at[23]);    MULADD(at[10], at[22]);    MULADD(at[11], at[21]);    MULADD(at[12], at[20]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[33]);    MULADD(at[1], at[32]);    MULADD(at[2], at[31]);    MULADD(at[3], at[30]);    MULADD(at[4], at[29]);    MULADD(at[5], at[28]);    MULADD(at[6], at[27]);    MULADD(at[7], at[26]);    MULADD(at[8], at[25]);    MULADD(at[9], at[24]);    MULADD(at[10], at[23]);    MULADD(at[11], at[22]);    MULADD(at[12], at[21]);    MULADD(at[13], at[20]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[34]);    MULADD(at[1], at[33]);    MULADD(at[2], at[32]);    MULADD(at[3], at[31]);    MULADD(at[4], at[30]);    MULADD(at[5], at[29]);    MULADD(at[6], at[28]);    MULADD(at[7], at[27]);    MULADD(at[8], at[26]);    MULADD(at[9], at[25]);    MULADD(at[10], at[24]);    MULADD(at[11], at[23]);    MULADD(at[12], at[22]);    MULADD(at[13], at[21]);    MULADD(at[14], at[20]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[35]);    MULADD(at[1], at[34]);    MULADD(at[2], at[33]);    MULADD(at[3], at[32]);    MULADD(at[4], at[31]);    MULADD(at[5], at[30]);    MULADD(at[6], at[29]);    MULADD(at[7], at[28]);    MULADD(at[8], at[27]);    MULADD(at[9], at[26]);    MULADD(at[10], at[25]);    MULADD(at[11], at[24]);    MULADD(at[12], at[23]);    MULADD(at[13], at[22]);    MULADD(at[14], at[21]);    MULADD(at[15], at[20]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[36]);    MULADD(at[1], at[35]);    MULADD(at[2], at[34]);    MULADD(at[3], at[33]);    MULADD(at[4], at[32]);    MULADD(at[5], at[31]);    MULADD(at[6], at[30]);    MULADD(at[7], at[29]);    MULADD(at[8], at[28]);    MULADD(at[9], at[27]);    MULADD(at[10], at[26]);    MULADD(at[11], at[25]);    MULADD(at[12], at[24]);    MULADD(at[13], at[23]);    MULADD(at[14], at[22]);    MULADD(at[15], at[21]);    MULADD(at[16], at[20]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[37]);    MULADD(at[1], at[36]);    MULADD(at[2], at[35]);    MULADD(at[3], at[34]);    MULADD(at[4], at[33]);    MULADD(at[5], at[32]);    MULADD(at[6], at[31]);    MULADD(at[7], at[30]);    MULADD(at[8], at[29]);    MULADD(at[9], at[28]);    MULADD(at[10], at[27]);    MULADD(at[11], at[26]);    MULADD(at[12], at[25]);    MULADD(at[13], at[24]);    MULADD(at[14], at[23]);    MULADD(at[15], at[22]);    MULADD(at[16], at[21]);    MULADD(at[17], at[20]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[38]);    MULADD(at[1], at[37]);    MULADD(at[2], at[36]);    MULADD(at[3], at[35]);    MULADD(at[4], at[34]);    MULADD(at[5], at[33]);    MULADD(at[6], at[32]);    MULADD(at[7], at[31]);    MULADD(at[8], at[30]);    MULADD(at[9], at[29]);    MULADD(at[10], at[28]);    MULADD(at[11], at[27]);    MULADD(at[12], at[26]);    MULADD(at[13], at[25]);    MULADD(at[14], at[24]);    MULADD(at[15], at[23]);    MULADD(at[16], at[22]);    MULADD(at[17], at[21]);    MULADD(at[18], at[20]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[39]);    MULADD(at[1], at[38]);    MULADD(at[2], at[37]);    MULADD(at[3], at[36]);    MULADD(at[4], at[35]);    MULADD(at[5], at[34]);    MULADD(at[6], at[33]);    MULADD(at[7], at[32]);    MULADD(at[8], at[31]);    MULADD(at[9], at[30]);    MULADD(at[10], at[29]);    MULADD(at[11], at[28]);    MULADD(at[12], at[27]);    MULADD(at[13], at[26]);    MULADD(at[14], at[25]);    MULADD(at[15], at[24]);    MULADD(at[16], at[23]);    MULADD(at[17], at[22]);    MULADD(at[18], at[21]);    MULADD(at[19], at[20]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[39]);    MULADD(at[2], at[38]);    MULADD(at[3], at[37]);    MULADD(at[4], at[36]);    MULADD(at[5], at[35]);    MULADD(at[6], at[34]);    MULADD(at[7], at[33]);    MULADD(at[8], at[32]);    MULADD(at[9], at[31]);    MULADD(at[10], at[30]);    MULADD(at[11], at[29]);    MULADD(at[12], at[28]);    MULADD(at[13], at[27]);    MULADD(at[14], at[26]);    MULADD(at[15], at[25]);    MULADD(at[16], at[24]);    MULADD(at[17], at[23]);    MULADD(at[18], at[22]);    MULADD(at[19], at[21]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[39]);    MULADD(at[3], at[38]);    MULADD(at[4], at[37]);    MULADD(at[5], at[36]);    MULADD(at[6], at[35]);    MULADD(at[7], at[34]);    MULADD(at[8], at[33]);    MULADD(at[9], at[32]);    MULADD(at[10], at[31]);    MULADD(at[11], at[30]);    MULADD(at[12], at[29]);    MULADD(at[13], at[28]);    MULADD(at[14], at[27]);    MULADD(at[15], at[26]);    MULADD(at[16], at[25]);    MULADD(at[17], at[24]);    MULADD(at[18], at[23]);    MULADD(at[19], at[22]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[39]);    MULADD(at[4], at[38]);    MULADD(at[5], at[37]);    MULADD(at[6], at[36]);    MULADD(at[7], at[35]);    MULADD(at[8], at[34]);    MULADD(at[9], at[33]);    MULADD(at[10], at[32]);    MULADD(at[11], at[31]);    MULADD(at[12], at[30]);    MULADD(at[13], at[29]);    MULADD(at[14], at[28]);    MULADD(at[15], at[27]);    MULADD(at[16], at[26]);    MULADD(at[17], at[25]);    MULADD(at[18], at[24]);    MULADD(at[19], at[23]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[39]);    MULADD(at[5], at[38]);    MULADD(at[6], at[37]);    MULADD(at[7], at[36]);    MULADD(at[8], at[35]);    MULADD(at[9], at[34]);    MULADD(at[10], at[33]);    MULADD(at[11], at[32]);    MULADD(at[12], at[31]);    MULADD(at[13], at[30]);    MULADD(at[14], at[29]);    MULADD(at[15], at[28]);    MULADD(at[16], at[27]);    MULADD(at[17], at[26]);    MULADD(at[18], at[25]);    MULADD(at[19], at[24]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[39]);    MULADD(at[6], at[38]);    MULADD(at[7], at[37]);    MULADD(at[8], at[36]);    MULADD(at[9], at[35]);    MULADD(at[10], at[34]);    MULADD(at[11], at[33]);    MULADD(at[12], at[32]);    MULADD(at[13], at[31]);    MULADD(at[14], at[30]);    MULADD(at[15], at[29]);    MULADD(at[16], at[28]);    MULADD(at[17], at[27]);    MULADD(at[18], at[26]);    MULADD(at[19], at[25]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[39]);    MULADD(at[7], at[38]);    MULADD(at[8], at[37]);    MULADD(at[9], at[36]);    MULADD(at[10], at[35]);    MULADD(at[11], at[34]);    MULADD(at[12], at[33]);    MULADD(at[13], at[32]);    MULADD(at[14], at[31]);    MULADD(at[15], at[30]);    MULADD(at[16], at[29]);    MULADD(at[17], at[28]);    MULADD(at[18], at[27]);    MULADD(at[19], at[26]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[39]);    MULADD(at[8], at[38]);    MULADD(at[9], at[37]);    MULADD(at[10], at[36]);    MULADD(at[11], at[35]);    MULADD(at[12], at[34]);    MULADD(at[13], at[33]);    MULADD(at[14], at[32]);    MULADD(at[15], at[31]);    MULADD(at[16], at[30]);    MULADD(at[17], at[29]);    MULADD(at[18], at[28]);    MULADD(at[19], at[27]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[39]);    MULADD(at[9], at[38]);    MULADD(at[10], at[37]);    MULADD(at[11], at[36]);    MULADD(at[12], at[35]);    MULADD(at[13], at[34]);    MULADD(at[14], at[33]);    MULADD(at[15], at[32]);    MULADD(at[16], at[31]);    MULADD(at[17], at[30]);    MULADD(at[18], at[29]);    MULADD(at[19], at[28]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[39]);    MULADD(at[10], at[38]);    MULADD(at[11], at[37]);    MULADD(at[12], at[36]);    MULADD(at[13], at[35]);    MULADD(at[14], at[34]);    MULADD(at[15], at[33]);    MULADD(at[16], at[32]);    MULADD(at[17], at[31]);    MULADD(at[18], at[30]);    MULADD(at[19], at[29]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[39]);    MULADD(at[11], at[38]);    MULADD(at[12], at[37]);    MULADD(at[13], at[36]);    MULADD(at[14], at[35]);    MULADD(at[15], at[34]);    MULADD(at[16], at[33]);    MULADD(at[17], at[32]);    MULADD(at[18], at[31]);    MULADD(at[19], at[30]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[39]);    MULADD(at[12], at[38]);    MULADD(at[13], at[37]);    MULADD(at[14], at[36]);    MULADD(at[15], at[35]);    MULADD(at[16], at[34]);    MULADD(at[17], at[33]);    MULADD(at[18], at[32]);    MULADD(at[19], at[31]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[39]);    MULADD(at[13], at[38]);    MULADD(at[14], at[37]);    MULADD(at[15], at[36]);    MULADD(at[16], at[35]);    MULADD(at[17], at[34]);    MULADD(at[18], at[33]);    MULADD(at[19], at[32]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[39]);    MULADD(at[14], at[38]);    MULADD(at[15], at[37]);    MULADD(at[16], at[36]);    MULADD(at[17], at[35]);    MULADD(at[18], at[34]);    MULADD(at[19], at[33]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[39]);    MULADD(at[15], at[38]);    MULADD(at[16], at[37]);    MULADD(at[17], at[36]);    MULADD(at[18], at[35]);    MULADD(at[19], at[34]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[39]);    MULADD(at[16], at[38]);    MULADD(at[17], at[37]);    MULADD(at[18], at[36]);    MULADD(at[19], at[35]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[39]);    MULADD(at[17], at[38]);    MULADD(at[18], at[37]);    MULADD(at[19], at[36]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[39]);    MULADD(at[18], at[38]);    MULADD(at[19], at[37]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[39]);    MULADD(at[19], at[38]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[39]); 
+   COMBA_STORE(C->dp[38]);
+   COMBA_STORE2(C->dp[39]);
+   C->used = 40;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_24.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_24.i
new file mode 100644 (file)
index 0000000..42f44b6
--- /dev/null
@@ -0,0 +1,226 @@
+/* fp_mul_comba_24.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL24
+void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[48];
+
+   memcpy(at, A->dp, 24 * sizeof(fp_digit));
+   memcpy(at+24, B->dp, 24 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[24]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[25]);    MULADD(at[1], at[24]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[26]);    MULADD(at[1], at[25]);    MULADD(at[2], at[24]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[27]);    MULADD(at[1], at[26]);    MULADD(at[2], at[25]);    MULADD(at[3], at[24]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[28]);    MULADD(at[1], at[27]);    MULADD(at[2], at[26]);    MULADD(at[3], at[25]);    MULADD(at[4], at[24]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[29]);    MULADD(at[1], at[28]);    MULADD(at[2], at[27]);    MULADD(at[3], at[26]);    MULADD(at[4], at[25]);    MULADD(at[5], at[24]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[30]);    MULADD(at[1], at[29]);    MULADD(at[2], at[28]);    MULADD(at[3], at[27]);    MULADD(at[4], at[26]);    MULADD(at[5], at[25]);    MULADD(at[6], at[24]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[31]);    MULADD(at[1], at[30]);    MULADD(at[2], at[29]);    MULADD(at[3], at[28]);    MULADD(at[4], at[27]);    MULADD(at[5], at[26]);    MULADD(at[6], at[25]);    MULADD(at[7], at[24]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[32]);    MULADD(at[1], at[31]);    MULADD(at[2], at[30]);    MULADD(at[3], at[29]);    MULADD(at[4], at[28]);    MULADD(at[5], at[27]);    MULADD(at[6], at[26]);    MULADD(at[7], at[25]);    MULADD(at[8], at[24]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[33]);    MULADD(at[1], at[32]);    MULADD(at[2], at[31]);    MULADD(at[3], at[30]);    MULADD(at[4], at[29]);    MULADD(at[5], at[28]);    MULADD(at[6], at[27]);    MULADD(at[7], at[26]);    MULADD(at[8], at[25]);    MULADD(at[9], at[24]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[34]);    MULADD(at[1], at[33]);    MULADD(at[2], at[32]);    MULADD(at[3], at[31]);    MULADD(at[4], at[30]);    MULADD(at[5], at[29]);    MULADD(at[6], at[28]);    MULADD(at[7], at[27]);    MULADD(at[8], at[26]);    MULADD(at[9], at[25]);    MULADD(at[10], at[24]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[35]);    MULADD(at[1], at[34]);    MULADD(at[2], at[33]);    MULADD(at[3], at[32]);    MULADD(at[4], at[31]);    MULADD(at[5], at[30]);    MULADD(at[6], at[29]);    MULADD(at[7], at[28]);    MULADD(at[8], at[27]);    MULADD(at[9], at[26]);    MULADD(at[10], at[25]);    MULADD(at[11], at[24]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[36]);    MULADD(at[1], at[35]);    MULADD(at[2], at[34]);    MULADD(at[3], at[33]);    MULADD(at[4], at[32]);    MULADD(at[5], at[31]);    MULADD(at[6], at[30]);    MULADD(at[7], at[29]);    MULADD(at[8], at[28]);    MULADD(at[9], at[27]);    MULADD(at[10], at[26]);    MULADD(at[11], at[25]);    MULADD(at[12], at[24]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[37]);    MULADD(at[1], at[36]);    MULADD(at[2], at[35]);    MULADD(at[3], at[34]);    MULADD(at[4], at[33]);    MULADD(at[5], at[32]);    MULADD(at[6], at[31]);    MULADD(at[7], at[30]);    MULADD(at[8], at[29]);    MULADD(at[9], at[28]);    MULADD(at[10], at[27]);    MULADD(at[11], at[26]);    MULADD(at[12], at[25]);    MULADD(at[13], at[24]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[38]);    MULADD(at[1], at[37]);    MULADD(at[2], at[36]);    MULADD(at[3], at[35]);    MULADD(at[4], at[34]);    MULADD(at[5], at[33]);    MULADD(at[6], at[32]);    MULADD(at[7], at[31]);    MULADD(at[8], at[30]);    MULADD(at[9], at[29]);    MULADD(at[10], at[28]);    MULADD(at[11], at[27]);    MULADD(at[12], at[26]);    MULADD(at[13], at[25]);    MULADD(at[14], at[24]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[39]);    MULADD(at[1], at[38]);    MULADD(at[2], at[37]);    MULADD(at[3], at[36]);    MULADD(at[4], at[35]);    MULADD(at[5], at[34]);    MULADD(at[6], at[33]);    MULADD(at[7], at[32]);    MULADD(at[8], at[31]);    MULADD(at[9], at[30]);    MULADD(at[10], at[29]);    MULADD(at[11], at[28]);    MULADD(at[12], at[27]);    MULADD(at[13], at[26]);    MULADD(at[14], at[25]);    MULADD(at[15], at[24]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[40]);    MULADD(at[1], at[39]);    MULADD(at[2], at[38]);    MULADD(at[3], at[37]);    MULADD(at[4], at[36]);    MULADD(at[5], at[35]);    MULADD(at[6], at[34]);    MULADD(at[7], at[33]);    MULADD(at[8], at[32]);    MULADD(at[9], at[31]);    MULADD(at[10], at[30]);    MULADD(at[11], at[29]);    MULADD(at[12], at[28]);    MULADD(at[13], at[27]);    MULADD(at[14], at[26]);    MULADD(at[15], at[25]);    MULADD(at[16], at[24]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[41]);    MULADD(at[1], at[40]);    MULADD(at[2], at[39]);    MULADD(at[3], at[38]);    MULADD(at[4], at[37]);    MULADD(at[5], at[36]);    MULADD(at[6], at[35]);    MULADD(at[7], at[34]);    MULADD(at[8], at[33]);    MULADD(at[9], at[32]);    MULADD(at[10], at[31]);    MULADD(at[11], at[30]);    MULADD(at[12], at[29]);    MULADD(at[13], at[28]);    MULADD(at[14], at[27]);    MULADD(at[15], at[26]);    MULADD(at[16], at[25]);    MULADD(at[17], at[24]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[42]);    MULADD(at[1], at[41]);    MULADD(at[2], at[40]);    MULADD(at[3], at[39]);    MULADD(at[4], at[38]);    MULADD(at[5], at[37]);    MULADD(at[6], at[36]);    MULADD(at[7], at[35]);    MULADD(at[8], at[34]);    MULADD(at[9], at[33]);    MULADD(at[10], at[32]);    MULADD(at[11], at[31]);    MULADD(at[12], at[30]);    MULADD(at[13], at[29]);    MULADD(at[14], at[28]);    MULADD(at[15], at[27]);    MULADD(at[16], at[26]);    MULADD(at[17], at[25]);    MULADD(at[18], at[24]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[43]);    MULADD(at[1], at[42]);    MULADD(at[2], at[41]);    MULADD(at[3], at[40]);    MULADD(at[4], at[39]);    MULADD(at[5], at[38]);    MULADD(at[6], at[37]);    MULADD(at[7], at[36]);    MULADD(at[8], at[35]);    MULADD(at[9], at[34]);    MULADD(at[10], at[33]);    MULADD(at[11], at[32]);    MULADD(at[12], at[31]);    MULADD(at[13], at[30]);    MULADD(at[14], at[29]);    MULADD(at[15], at[28]);    MULADD(at[16], at[27]);    MULADD(at[17], at[26]);    MULADD(at[18], at[25]);    MULADD(at[19], at[24]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[44]);    MULADD(at[1], at[43]);    MULADD(at[2], at[42]);    MULADD(at[3], at[41]);    MULADD(at[4], at[40]);    MULADD(at[5], at[39]);    MULADD(at[6], at[38]);    MULADD(at[7], at[37]);    MULADD(at[8], at[36]);    MULADD(at[9], at[35]);    MULADD(at[10], at[34]);    MULADD(at[11], at[33]);    MULADD(at[12], at[32]);    MULADD(at[13], at[31]);    MULADD(at[14], at[30]);    MULADD(at[15], at[29]);    MULADD(at[16], at[28]);    MULADD(at[17], at[27]);    MULADD(at[18], at[26]);    MULADD(at[19], at[25]);    MULADD(at[20], at[24]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[45]);    MULADD(at[1], at[44]);    MULADD(at[2], at[43]);    MULADD(at[3], at[42]);    MULADD(at[4], at[41]);    MULADD(at[5], at[40]);    MULADD(at[6], at[39]);    MULADD(at[7], at[38]);    MULADD(at[8], at[37]);    MULADD(at[9], at[36]);    MULADD(at[10], at[35]);    MULADD(at[11], at[34]);    MULADD(at[12], at[33]);    MULADD(at[13], at[32]);    MULADD(at[14], at[31]);    MULADD(at[15], at[30]);    MULADD(at[16], at[29]);    MULADD(at[17], at[28]);    MULADD(at[18], at[27]);    MULADD(at[19], at[26]);    MULADD(at[20], at[25]);    MULADD(at[21], at[24]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[46]);    MULADD(at[1], at[45]);    MULADD(at[2], at[44]);    MULADD(at[3], at[43]);    MULADD(at[4], at[42]);    MULADD(at[5], at[41]);    MULADD(at[6], at[40]);    MULADD(at[7], at[39]);    MULADD(at[8], at[38]);    MULADD(at[9], at[37]);    MULADD(at[10], at[36]);    MULADD(at[11], at[35]);    MULADD(at[12], at[34]);    MULADD(at[13], at[33]);    MULADD(at[14], at[32]);    MULADD(at[15], at[31]);    MULADD(at[16], at[30]);    MULADD(at[17], at[29]);    MULADD(at[18], at[28]);    MULADD(at[19], at[27]);    MULADD(at[20], at[26]);    MULADD(at[21], at[25]);    MULADD(at[22], at[24]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[47]);    MULADD(at[1], at[46]);    MULADD(at[2], at[45]);    MULADD(at[3], at[44]);    MULADD(at[4], at[43]);    MULADD(at[5], at[42]);    MULADD(at[6], at[41]);    MULADD(at[7], at[40]);    MULADD(at[8], at[39]);    MULADD(at[9], at[38]);    MULADD(at[10], at[37]);    MULADD(at[11], at[36]);    MULADD(at[12], at[35]);    MULADD(at[13], at[34]);    MULADD(at[14], at[33]);    MULADD(at[15], at[32]);    MULADD(at[16], at[31]);    MULADD(at[17], at[30]);    MULADD(at[18], at[29]);    MULADD(at[19], at[28]);    MULADD(at[20], at[27]);    MULADD(at[21], at[26]);    MULADD(at[22], at[25]);    MULADD(at[23], at[24]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[47]);    MULADD(at[2], at[46]);    MULADD(at[3], at[45]);    MULADD(at[4], at[44]);    MULADD(at[5], at[43]);    MULADD(at[6], at[42]);    MULADD(at[7], at[41]);    MULADD(at[8], at[40]);    MULADD(at[9], at[39]);    MULADD(at[10], at[38]);    MULADD(at[11], at[37]);    MULADD(at[12], at[36]);    MULADD(at[13], at[35]);    MULADD(at[14], at[34]);    MULADD(at[15], at[33]);    MULADD(at[16], at[32]);    MULADD(at[17], at[31]);    MULADD(at[18], at[30]);    MULADD(at[19], at[29]);    MULADD(at[20], at[28]);    MULADD(at[21], at[27]);    MULADD(at[22], at[26]);    MULADD(at[23], at[25]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[47]);    MULADD(at[3], at[46]);    MULADD(at[4], at[45]);    MULADD(at[5], at[44]);    MULADD(at[6], at[43]);    MULADD(at[7], at[42]);    MULADD(at[8], at[41]);    MULADD(at[9], at[40]);    MULADD(at[10], at[39]);    MULADD(at[11], at[38]);    MULADD(at[12], at[37]);    MULADD(at[13], at[36]);    MULADD(at[14], at[35]);    MULADD(at[15], at[34]);    MULADD(at[16], at[33]);    MULADD(at[17], at[32]);    MULADD(at[18], at[31]);    MULADD(at[19], at[30]);    MULADD(at[20], at[29]);    MULADD(at[21], at[28]);    MULADD(at[22], at[27]);    MULADD(at[23], at[26]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[47]);    MULADD(at[4], at[46]);    MULADD(at[5], at[45]);    MULADD(at[6], at[44]);    MULADD(at[7], at[43]);    MULADD(at[8], at[42]);    MULADD(at[9], at[41]);    MULADD(at[10], at[40]);    MULADD(at[11], at[39]);    MULADD(at[12], at[38]);    MULADD(at[13], at[37]);    MULADD(at[14], at[36]);    MULADD(at[15], at[35]);    MULADD(at[16], at[34]);    MULADD(at[17], at[33]);    MULADD(at[18], at[32]);    MULADD(at[19], at[31]);    MULADD(at[20], at[30]);    MULADD(at[21], at[29]);    MULADD(at[22], at[28]);    MULADD(at[23], at[27]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[47]);    MULADD(at[5], at[46]);    MULADD(at[6], at[45]);    MULADD(at[7], at[44]);    MULADD(at[8], at[43]);    MULADD(at[9], at[42]);    MULADD(at[10], at[41]);    MULADD(at[11], at[40]);    MULADD(at[12], at[39]);    MULADD(at[13], at[38]);    MULADD(at[14], at[37]);    MULADD(at[15], at[36]);    MULADD(at[16], at[35]);    MULADD(at[17], at[34]);    MULADD(at[18], at[33]);    MULADD(at[19], at[32]);    MULADD(at[20], at[31]);    MULADD(at[21], at[30]);    MULADD(at[22], at[29]);    MULADD(at[23], at[28]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[47]);    MULADD(at[6], at[46]);    MULADD(at[7], at[45]);    MULADD(at[8], at[44]);    MULADD(at[9], at[43]);    MULADD(at[10], at[42]);    MULADD(at[11], at[41]);    MULADD(at[12], at[40]);    MULADD(at[13], at[39]);    MULADD(at[14], at[38]);    MULADD(at[15], at[37]);    MULADD(at[16], at[36]);    MULADD(at[17], at[35]);    MULADD(at[18], at[34]);    MULADD(at[19], at[33]);    MULADD(at[20], at[32]);    MULADD(at[21], at[31]);    MULADD(at[22], at[30]);    MULADD(at[23], at[29]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[47]);    MULADD(at[7], at[46]);    MULADD(at[8], at[45]);    MULADD(at[9], at[44]);    MULADD(at[10], at[43]);    MULADD(at[11], at[42]);    MULADD(at[12], at[41]);    MULADD(at[13], at[40]);    MULADD(at[14], at[39]);    MULADD(at[15], at[38]);    MULADD(at[16], at[37]);    MULADD(at[17], at[36]);    MULADD(at[18], at[35]);    MULADD(at[19], at[34]);    MULADD(at[20], at[33]);    MULADD(at[21], at[32]);    MULADD(at[22], at[31]);    MULADD(at[23], at[30]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[47]);    MULADD(at[8], at[46]);    MULADD(at[9], at[45]);    MULADD(at[10], at[44]);    MULADD(at[11], at[43]);    MULADD(at[12], at[42]);    MULADD(at[13], at[41]);    MULADD(at[14], at[40]);    MULADD(at[15], at[39]);    MULADD(at[16], at[38]);    MULADD(at[17], at[37]);    MULADD(at[18], at[36]);    MULADD(at[19], at[35]);    MULADD(at[20], at[34]);    MULADD(at[21], at[33]);    MULADD(at[22], at[32]);    MULADD(at[23], at[31]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[47]);    MULADD(at[9], at[46]);    MULADD(at[10], at[45]);    MULADD(at[11], at[44]);    MULADD(at[12], at[43]);    MULADD(at[13], at[42]);    MULADD(at[14], at[41]);    MULADD(at[15], at[40]);    MULADD(at[16], at[39]);    MULADD(at[17], at[38]);    MULADD(at[18], at[37]);    MULADD(at[19], at[36]);    MULADD(at[20], at[35]);    MULADD(at[21], at[34]);    MULADD(at[22], at[33]);    MULADD(at[23], at[32]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[47]);    MULADD(at[10], at[46]);    MULADD(at[11], at[45]);    MULADD(at[12], at[44]);    MULADD(at[13], at[43]);    MULADD(at[14], at[42]);    MULADD(at[15], at[41]);    MULADD(at[16], at[40]);    MULADD(at[17], at[39]);    MULADD(at[18], at[38]);    MULADD(at[19], at[37]);    MULADD(at[20], at[36]);    MULADD(at[21], at[35]);    MULADD(at[22], at[34]);    MULADD(at[23], at[33]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[47]);    MULADD(at[11], at[46]);    MULADD(at[12], at[45]);    MULADD(at[13], at[44]);    MULADD(at[14], at[43]);    MULADD(at[15], at[42]);    MULADD(at[16], at[41]);    MULADD(at[17], at[40]);    MULADD(at[18], at[39]);    MULADD(at[19], at[38]);    MULADD(at[20], at[37]);    MULADD(at[21], at[36]);    MULADD(at[22], at[35]);    MULADD(at[23], at[34]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[47]);    MULADD(at[12], at[46]);    MULADD(at[13], at[45]);    MULADD(at[14], at[44]);    MULADD(at[15], at[43]);    MULADD(at[16], at[42]);    MULADD(at[17], at[41]);    MULADD(at[18], at[40]);    MULADD(at[19], at[39]);    MULADD(at[20], at[38]);    MULADD(at[21], at[37]);    MULADD(at[22], at[36]);    MULADD(at[23], at[35]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[47]);    MULADD(at[13], at[46]);    MULADD(at[14], at[45]);    MULADD(at[15], at[44]);    MULADD(at[16], at[43]);    MULADD(at[17], at[42]);    MULADD(at[18], at[41]);    MULADD(at[19], at[40]);    MULADD(at[20], at[39]);    MULADD(at[21], at[38]);    MULADD(at[22], at[37]);    MULADD(at[23], at[36]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[47]);    MULADD(at[14], at[46]);    MULADD(at[15], at[45]);    MULADD(at[16], at[44]);    MULADD(at[17], at[43]);    MULADD(at[18], at[42]);    MULADD(at[19], at[41]);    MULADD(at[20], at[40]);    MULADD(at[21], at[39]);    MULADD(at[22], at[38]);    MULADD(at[23], at[37]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[47]);    MULADD(at[15], at[46]);    MULADD(at[16], at[45]);    MULADD(at[17], at[44]);    MULADD(at[18], at[43]);    MULADD(at[19], at[42]);    MULADD(at[20], at[41]);    MULADD(at[21], at[40]);    MULADD(at[22], at[39]);    MULADD(at[23], at[38]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[47]);    MULADD(at[16], at[46]);    MULADD(at[17], at[45]);    MULADD(at[18], at[44]);    MULADD(at[19], at[43]);    MULADD(at[20], at[42]);    MULADD(at[21], at[41]);    MULADD(at[22], at[40]);    MULADD(at[23], at[39]); 
+   COMBA_STORE(C->dp[38]);
+   /* 39 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[47]);    MULADD(at[17], at[46]);    MULADD(at[18], at[45]);    MULADD(at[19], at[44]);    MULADD(at[20], at[43]);    MULADD(at[21], at[42]);    MULADD(at[22], at[41]);    MULADD(at[23], at[40]); 
+   COMBA_STORE(C->dp[39]);
+   /* 40 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[47]);    MULADD(at[18], at[46]);    MULADD(at[19], at[45]);    MULADD(at[20], at[44]);    MULADD(at[21], at[43]);    MULADD(at[22], at[42]);    MULADD(at[23], at[41]); 
+   COMBA_STORE(C->dp[40]);
+   /* 41 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[47]);    MULADD(at[19], at[46]);    MULADD(at[20], at[45]);    MULADD(at[21], at[44]);    MULADD(at[22], at[43]);    MULADD(at[23], at[42]); 
+   COMBA_STORE(C->dp[41]);
+   /* 42 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[47]);    MULADD(at[20], at[46]);    MULADD(at[21], at[45]);    MULADD(at[22], at[44]);    MULADD(at[23], at[43]); 
+   COMBA_STORE(C->dp[42]);
+   /* 43 */
+   COMBA_FORWARD;
+   MULADD(at[20], at[47]);    MULADD(at[21], at[46]);    MULADD(at[22], at[45]);    MULADD(at[23], at[44]); 
+   COMBA_STORE(C->dp[43]);
+   /* 44 */
+   COMBA_FORWARD;
+   MULADD(at[21], at[47]);    MULADD(at[22], at[46]);    MULADD(at[23], at[45]); 
+   COMBA_STORE(C->dp[44]);
+   /* 45 */
+   COMBA_FORWARD;
+   MULADD(at[22], at[47]);    MULADD(at[23], at[46]); 
+   COMBA_STORE(C->dp[45]);
+   /* 46 */
+   COMBA_FORWARD;
+   MULADD(at[23], at[47]); 
+   COMBA_STORE(C->dp[46]);
+   COMBA_STORE2(C->dp[47]);
+   C->used = 48;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_28.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_28.i
new file mode 100644 (file)
index 0000000..060bb8a
--- /dev/null
@@ -0,0 +1,258 @@
+/* fp_mul_comba_28.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL28
+void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[56];
+
+   memcpy(at, A->dp, 28 * sizeof(fp_digit));
+   memcpy(at+28, B->dp, 28 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[28]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[29]);    MULADD(at[1], at[28]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[30]);    MULADD(at[1], at[29]);    MULADD(at[2], at[28]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[31]);    MULADD(at[1], at[30]);    MULADD(at[2], at[29]);    MULADD(at[3], at[28]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[32]);    MULADD(at[1], at[31]);    MULADD(at[2], at[30]);    MULADD(at[3], at[29]);    MULADD(at[4], at[28]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[33]);    MULADD(at[1], at[32]);    MULADD(at[2], at[31]);    MULADD(at[3], at[30]);    MULADD(at[4], at[29]);    MULADD(at[5], at[28]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[34]);    MULADD(at[1], at[33]);    MULADD(at[2], at[32]);    MULADD(at[3], at[31]);    MULADD(at[4], at[30]);    MULADD(at[5], at[29]);    MULADD(at[6], at[28]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[35]);    MULADD(at[1], at[34]);    MULADD(at[2], at[33]);    MULADD(at[3], at[32]);    MULADD(at[4], at[31]);    MULADD(at[5], at[30]);    MULADD(at[6], at[29]);    MULADD(at[7], at[28]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[36]);    MULADD(at[1], at[35]);    MULADD(at[2], at[34]);    MULADD(at[3], at[33]);    MULADD(at[4], at[32]);    MULADD(at[5], at[31]);    MULADD(at[6], at[30]);    MULADD(at[7], at[29]);    MULADD(at[8], at[28]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[37]);    MULADD(at[1], at[36]);    MULADD(at[2], at[35]);    MULADD(at[3], at[34]);    MULADD(at[4], at[33]);    MULADD(at[5], at[32]);    MULADD(at[6], at[31]);    MULADD(at[7], at[30]);    MULADD(at[8], at[29]);    MULADD(at[9], at[28]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[38]);    MULADD(at[1], at[37]);    MULADD(at[2], at[36]);    MULADD(at[3], at[35]);    MULADD(at[4], at[34]);    MULADD(at[5], at[33]);    MULADD(at[6], at[32]);    MULADD(at[7], at[31]);    MULADD(at[8], at[30]);    MULADD(at[9], at[29]);    MULADD(at[10], at[28]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[39]);    MULADD(at[1], at[38]);    MULADD(at[2], at[37]);    MULADD(at[3], at[36]);    MULADD(at[4], at[35]);    MULADD(at[5], at[34]);    MULADD(at[6], at[33]);    MULADD(at[7], at[32]);    MULADD(at[8], at[31]);    MULADD(at[9], at[30]);    MULADD(at[10], at[29]);    MULADD(at[11], at[28]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[40]);    MULADD(at[1], at[39]);    MULADD(at[2], at[38]);    MULADD(at[3], at[37]);    MULADD(at[4], at[36]);    MULADD(at[5], at[35]);    MULADD(at[6], at[34]);    MULADD(at[7], at[33]);    MULADD(at[8], at[32]);    MULADD(at[9], at[31]);    MULADD(at[10], at[30]);    MULADD(at[11], at[29]);    MULADD(at[12], at[28]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[41]);    MULADD(at[1], at[40]);    MULADD(at[2], at[39]);    MULADD(at[3], at[38]);    MULADD(at[4], at[37]);    MULADD(at[5], at[36]);    MULADD(at[6], at[35]);    MULADD(at[7], at[34]);    MULADD(at[8], at[33]);    MULADD(at[9], at[32]);    MULADD(at[10], at[31]);    MULADD(at[11], at[30]);    MULADD(at[12], at[29]);    MULADD(at[13], at[28]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[42]);    MULADD(at[1], at[41]);    MULADD(at[2], at[40]);    MULADD(at[3], at[39]);    MULADD(at[4], at[38]);    MULADD(at[5], at[37]);    MULADD(at[6], at[36]);    MULADD(at[7], at[35]);    MULADD(at[8], at[34]);    MULADD(at[9], at[33]);    MULADD(at[10], at[32]);    MULADD(at[11], at[31]);    MULADD(at[12], at[30]);    MULADD(at[13], at[29]);    MULADD(at[14], at[28]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[43]);    MULADD(at[1], at[42]);    MULADD(at[2], at[41]);    MULADD(at[3], at[40]);    MULADD(at[4], at[39]);    MULADD(at[5], at[38]);    MULADD(at[6], at[37]);    MULADD(at[7], at[36]);    MULADD(at[8], at[35]);    MULADD(at[9], at[34]);    MULADD(at[10], at[33]);    MULADD(at[11], at[32]);    MULADD(at[12], at[31]);    MULADD(at[13], at[30]);    MULADD(at[14], at[29]);    MULADD(at[15], at[28]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[44]);    MULADD(at[1], at[43]);    MULADD(at[2], at[42]);    MULADD(at[3], at[41]);    MULADD(at[4], at[40]);    MULADD(at[5], at[39]);    MULADD(at[6], at[38]);    MULADD(at[7], at[37]);    MULADD(at[8], at[36]);    MULADD(at[9], at[35]);    MULADD(at[10], at[34]);    MULADD(at[11], at[33]);    MULADD(at[12], at[32]);    MULADD(at[13], at[31]);    MULADD(at[14], at[30]);    MULADD(at[15], at[29]);    MULADD(at[16], at[28]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[45]);    MULADD(at[1], at[44]);    MULADD(at[2], at[43]);    MULADD(at[3], at[42]);    MULADD(at[4], at[41]);    MULADD(at[5], at[40]);    MULADD(at[6], at[39]);    MULADD(at[7], at[38]);    MULADD(at[8], at[37]);    MULADD(at[9], at[36]);    MULADD(at[10], at[35]);    MULADD(at[11], at[34]);    MULADD(at[12], at[33]);    MULADD(at[13], at[32]);    MULADD(at[14], at[31]);    MULADD(at[15], at[30]);    MULADD(at[16], at[29]);    MULADD(at[17], at[28]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[46]);    MULADD(at[1], at[45]);    MULADD(at[2], at[44]);    MULADD(at[3], at[43]);    MULADD(at[4], at[42]);    MULADD(at[5], at[41]);    MULADD(at[6], at[40]);    MULADD(at[7], at[39]);    MULADD(at[8], at[38]);    MULADD(at[9], at[37]);    MULADD(at[10], at[36]);    MULADD(at[11], at[35]);    MULADD(at[12], at[34]);    MULADD(at[13], at[33]);    MULADD(at[14], at[32]);    MULADD(at[15], at[31]);    MULADD(at[16], at[30]);    MULADD(at[17], at[29]);    MULADD(at[18], at[28]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[47]);    MULADD(at[1], at[46]);    MULADD(at[2], at[45]);    MULADD(at[3], at[44]);    MULADD(at[4], at[43]);    MULADD(at[5], at[42]);    MULADD(at[6], at[41]);    MULADD(at[7], at[40]);    MULADD(at[8], at[39]);    MULADD(at[9], at[38]);    MULADD(at[10], at[37]);    MULADD(at[11], at[36]);    MULADD(at[12], at[35]);    MULADD(at[13], at[34]);    MULADD(at[14], at[33]);    MULADD(at[15], at[32]);    MULADD(at[16], at[31]);    MULADD(at[17], at[30]);    MULADD(at[18], at[29]);    MULADD(at[19], at[28]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[48]);    MULADD(at[1], at[47]);    MULADD(at[2], at[46]);    MULADD(at[3], at[45]);    MULADD(at[4], at[44]);    MULADD(at[5], at[43]);    MULADD(at[6], at[42]);    MULADD(at[7], at[41]);    MULADD(at[8], at[40]);    MULADD(at[9], at[39]);    MULADD(at[10], at[38]);    MULADD(at[11], at[37]);    MULADD(at[12], at[36]);    MULADD(at[13], at[35]);    MULADD(at[14], at[34]);    MULADD(at[15], at[33]);    MULADD(at[16], at[32]);    MULADD(at[17], at[31]);    MULADD(at[18], at[30]);    MULADD(at[19], at[29]);    MULADD(at[20], at[28]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[49]);    MULADD(at[1], at[48]);    MULADD(at[2], at[47]);    MULADD(at[3], at[46]);    MULADD(at[4], at[45]);    MULADD(at[5], at[44]);    MULADD(at[6], at[43]);    MULADD(at[7], at[42]);    MULADD(at[8], at[41]);    MULADD(at[9], at[40]);    MULADD(at[10], at[39]);    MULADD(at[11], at[38]);    MULADD(at[12], at[37]);    MULADD(at[13], at[36]);    MULADD(at[14], at[35]);    MULADD(at[15], at[34]);    MULADD(at[16], at[33]);    MULADD(at[17], at[32]);    MULADD(at[18], at[31]);    MULADD(at[19], at[30]);    MULADD(at[20], at[29]);    MULADD(at[21], at[28]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[50]);    MULADD(at[1], at[49]);    MULADD(at[2], at[48]);    MULADD(at[3], at[47]);    MULADD(at[4], at[46]);    MULADD(at[5], at[45]);    MULADD(at[6], at[44]);    MULADD(at[7], at[43]);    MULADD(at[8], at[42]);    MULADD(at[9], at[41]);    MULADD(at[10], at[40]);    MULADD(at[11], at[39]);    MULADD(at[12], at[38]);    MULADD(at[13], at[37]);    MULADD(at[14], at[36]);    MULADD(at[15], at[35]);    MULADD(at[16], at[34]);    MULADD(at[17], at[33]);    MULADD(at[18], at[32]);    MULADD(at[19], at[31]);    MULADD(at[20], at[30]);    MULADD(at[21], at[29]);    MULADD(at[22], at[28]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[51]);    MULADD(at[1], at[50]);    MULADD(at[2], at[49]);    MULADD(at[3], at[48]);    MULADD(at[4], at[47]);    MULADD(at[5], at[46]);    MULADD(at[6], at[45]);    MULADD(at[7], at[44]);    MULADD(at[8], at[43]);    MULADD(at[9], at[42]);    MULADD(at[10], at[41]);    MULADD(at[11], at[40]);    MULADD(at[12], at[39]);    MULADD(at[13], at[38]);    MULADD(at[14], at[37]);    MULADD(at[15], at[36]);    MULADD(at[16], at[35]);    MULADD(at[17], at[34]);    MULADD(at[18], at[33]);    MULADD(at[19], at[32]);    MULADD(at[20], at[31]);    MULADD(at[21], at[30]);    MULADD(at[22], at[29]);    MULADD(at[23], at[28]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[52]);    MULADD(at[1], at[51]);    MULADD(at[2], at[50]);    MULADD(at[3], at[49]);    MULADD(at[4], at[48]);    MULADD(at[5], at[47]);    MULADD(at[6], at[46]);    MULADD(at[7], at[45]);    MULADD(at[8], at[44]);    MULADD(at[9], at[43]);    MULADD(at[10], at[42]);    MULADD(at[11], at[41]);    MULADD(at[12], at[40]);    MULADD(at[13], at[39]);    MULADD(at[14], at[38]);    MULADD(at[15], at[37]);    MULADD(at[16], at[36]);    MULADD(at[17], at[35]);    MULADD(at[18], at[34]);    MULADD(at[19], at[33]);    MULADD(at[20], at[32]);    MULADD(at[21], at[31]);    MULADD(at[22], at[30]);    MULADD(at[23], at[29]);    MULADD(at[24], at[28]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[53]);    MULADD(at[1], at[52]);    MULADD(at[2], at[51]);    MULADD(at[3], at[50]);    MULADD(at[4], at[49]);    MULADD(at[5], at[48]);    MULADD(at[6], at[47]);    MULADD(at[7], at[46]);    MULADD(at[8], at[45]);    MULADD(at[9], at[44]);    MULADD(at[10], at[43]);    MULADD(at[11], at[42]);    MULADD(at[12], at[41]);    MULADD(at[13], at[40]);    MULADD(at[14], at[39]);    MULADD(at[15], at[38]);    MULADD(at[16], at[37]);    MULADD(at[17], at[36]);    MULADD(at[18], at[35]);    MULADD(at[19], at[34]);    MULADD(at[20], at[33]);    MULADD(at[21], at[32]);    MULADD(at[22], at[31]);    MULADD(at[23], at[30]);    MULADD(at[24], at[29]);    MULADD(at[25], at[28]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[54]);    MULADD(at[1], at[53]);    MULADD(at[2], at[52]);    MULADD(at[3], at[51]);    MULADD(at[4], at[50]);    MULADD(at[5], at[49]);    MULADD(at[6], at[48]);    MULADD(at[7], at[47]);    MULADD(at[8], at[46]);    MULADD(at[9], at[45]);    MULADD(at[10], at[44]);    MULADD(at[11], at[43]);    MULADD(at[12], at[42]);    MULADD(at[13], at[41]);    MULADD(at[14], at[40]);    MULADD(at[15], at[39]);    MULADD(at[16], at[38]);    MULADD(at[17], at[37]);    MULADD(at[18], at[36]);    MULADD(at[19], at[35]);    MULADD(at[20], at[34]);    MULADD(at[21], at[33]);    MULADD(at[22], at[32]);    MULADD(at[23], at[31]);    MULADD(at[24], at[30]);    MULADD(at[25], at[29]);    MULADD(at[26], at[28]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[55]);    MULADD(at[1], at[54]);    MULADD(at[2], at[53]);    MULADD(at[3], at[52]);    MULADD(at[4], at[51]);    MULADD(at[5], at[50]);    MULADD(at[6], at[49]);    MULADD(at[7], at[48]);    MULADD(at[8], at[47]);    MULADD(at[9], at[46]);    MULADD(at[10], at[45]);    MULADD(at[11], at[44]);    MULADD(at[12], at[43]);    MULADD(at[13], at[42]);    MULADD(at[14], at[41]);    MULADD(at[15], at[40]);    MULADD(at[16], at[39]);    MULADD(at[17], at[38]);    MULADD(at[18], at[37]);    MULADD(at[19], at[36]);    MULADD(at[20], at[35]);    MULADD(at[21], at[34]);    MULADD(at[22], at[33]);    MULADD(at[23], at[32]);    MULADD(at[24], at[31]);    MULADD(at[25], at[30]);    MULADD(at[26], at[29]);    MULADD(at[27], at[28]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[55]);    MULADD(at[2], at[54]);    MULADD(at[3], at[53]);    MULADD(at[4], at[52]);    MULADD(at[5], at[51]);    MULADD(at[6], at[50]);    MULADD(at[7], at[49]);    MULADD(at[8], at[48]);    MULADD(at[9], at[47]);    MULADD(at[10], at[46]);    MULADD(at[11], at[45]);    MULADD(at[12], at[44]);    MULADD(at[13], at[43]);    MULADD(at[14], at[42]);    MULADD(at[15], at[41]);    MULADD(at[16], at[40]);    MULADD(at[17], at[39]);    MULADD(at[18], at[38]);    MULADD(at[19], at[37]);    MULADD(at[20], at[36]);    MULADD(at[21], at[35]);    MULADD(at[22], at[34]);    MULADD(at[23], at[33]);    MULADD(at[24], at[32]);    MULADD(at[25], at[31]);    MULADD(at[26], at[30]);    MULADD(at[27], at[29]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[55]);    MULADD(at[3], at[54]);    MULADD(at[4], at[53]);    MULADD(at[5], at[52]);    MULADD(at[6], at[51]);    MULADD(at[7], at[50]);    MULADD(at[8], at[49]);    MULADD(at[9], at[48]);    MULADD(at[10], at[47]);    MULADD(at[11], at[46]);    MULADD(at[12], at[45]);    MULADD(at[13], at[44]);    MULADD(at[14], at[43]);    MULADD(at[15], at[42]);    MULADD(at[16], at[41]);    MULADD(at[17], at[40]);    MULADD(at[18], at[39]);    MULADD(at[19], at[38]);    MULADD(at[20], at[37]);    MULADD(at[21], at[36]);    MULADD(at[22], at[35]);    MULADD(at[23], at[34]);    MULADD(at[24], at[33]);    MULADD(at[25], at[32]);    MULADD(at[26], at[31]);    MULADD(at[27], at[30]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[55]);    MULADD(at[4], at[54]);    MULADD(at[5], at[53]);    MULADD(at[6], at[52]);    MULADD(at[7], at[51]);    MULADD(at[8], at[50]);    MULADD(at[9], at[49]);    MULADD(at[10], at[48]);    MULADD(at[11], at[47]);    MULADD(at[12], at[46]);    MULADD(at[13], at[45]);    MULADD(at[14], at[44]);    MULADD(at[15], at[43]);    MULADD(at[16], at[42]);    MULADD(at[17], at[41]);    MULADD(at[18], at[40]);    MULADD(at[19], at[39]);    MULADD(at[20], at[38]);    MULADD(at[21], at[37]);    MULADD(at[22], at[36]);    MULADD(at[23], at[35]);    MULADD(at[24], at[34]);    MULADD(at[25], at[33]);    MULADD(at[26], at[32]);    MULADD(at[27], at[31]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[55]);    MULADD(at[5], at[54]);    MULADD(at[6], at[53]);    MULADD(at[7], at[52]);    MULADD(at[8], at[51]);    MULADD(at[9], at[50]);    MULADD(at[10], at[49]);    MULADD(at[11], at[48]);    MULADD(at[12], at[47]);    MULADD(at[13], at[46]);    MULADD(at[14], at[45]);    MULADD(at[15], at[44]);    MULADD(at[16], at[43]);    MULADD(at[17], at[42]);    MULADD(at[18], at[41]);    MULADD(at[19], at[40]);    MULADD(at[20], at[39]);    MULADD(at[21], at[38]);    MULADD(at[22], at[37]);    MULADD(at[23], at[36]);    MULADD(at[24], at[35]);    MULADD(at[25], at[34]);    MULADD(at[26], at[33]);    MULADD(at[27], at[32]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[55]);    MULADD(at[6], at[54]);    MULADD(at[7], at[53]);    MULADD(at[8], at[52]);    MULADD(at[9], at[51]);    MULADD(at[10], at[50]);    MULADD(at[11], at[49]);    MULADD(at[12], at[48]);    MULADD(at[13], at[47]);    MULADD(at[14], at[46]);    MULADD(at[15], at[45]);    MULADD(at[16], at[44]);    MULADD(at[17], at[43]);    MULADD(at[18], at[42]);    MULADD(at[19], at[41]);    MULADD(at[20], at[40]);    MULADD(at[21], at[39]);    MULADD(at[22], at[38]);    MULADD(at[23], at[37]);    MULADD(at[24], at[36]);    MULADD(at[25], at[35]);    MULADD(at[26], at[34]);    MULADD(at[27], at[33]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[55]);    MULADD(at[7], at[54]);    MULADD(at[8], at[53]);    MULADD(at[9], at[52]);    MULADD(at[10], at[51]);    MULADD(at[11], at[50]);    MULADD(at[12], at[49]);    MULADD(at[13], at[48]);    MULADD(at[14], at[47]);    MULADD(at[15], at[46]);    MULADD(at[16], at[45]);    MULADD(at[17], at[44]);    MULADD(at[18], at[43]);    MULADD(at[19], at[42]);    MULADD(at[20], at[41]);    MULADD(at[21], at[40]);    MULADD(at[22], at[39]);    MULADD(at[23], at[38]);    MULADD(at[24], at[37]);    MULADD(at[25], at[36]);    MULADD(at[26], at[35]);    MULADD(at[27], at[34]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[55]);    MULADD(at[8], at[54]);    MULADD(at[9], at[53]);    MULADD(at[10], at[52]);    MULADD(at[11], at[51]);    MULADD(at[12], at[50]);    MULADD(at[13], at[49]);    MULADD(at[14], at[48]);    MULADD(at[15], at[47]);    MULADD(at[16], at[46]);    MULADD(at[17], at[45]);    MULADD(at[18], at[44]);    MULADD(at[19], at[43]);    MULADD(at[20], at[42]);    MULADD(at[21], at[41]);    MULADD(at[22], at[40]);    MULADD(at[23], at[39]);    MULADD(at[24], at[38]);    MULADD(at[25], at[37]);    MULADD(at[26], at[36]);    MULADD(at[27], at[35]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[55]);    MULADD(at[9], at[54]);    MULADD(at[10], at[53]);    MULADD(at[11], at[52]);    MULADD(at[12], at[51]);    MULADD(at[13], at[50]);    MULADD(at[14], at[49]);    MULADD(at[15], at[48]);    MULADD(at[16], at[47]);    MULADD(at[17], at[46]);    MULADD(at[18], at[45]);    MULADD(at[19], at[44]);    MULADD(at[20], at[43]);    MULADD(at[21], at[42]);    MULADD(at[22], at[41]);    MULADD(at[23], at[40]);    MULADD(at[24], at[39]);    MULADD(at[25], at[38]);    MULADD(at[26], at[37]);    MULADD(at[27], at[36]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[55]);    MULADD(at[10], at[54]);    MULADD(at[11], at[53]);    MULADD(at[12], at[52]);    MULADD(at[13], at[51]);    MULADD(at[14], at[50]);    MULADD(at[15], at[49]);    MULADD(at[16], at[48]);    MULADD(at[17], at[47]);    MULADD(at[18], at[46]);    MULADD(at[19], at[45]);    MULADD(at[20], at[44]);    MULADD(at[21], at[43]);    MULADD(at[22], at[42]);    MULADD(at[23], at[41]);    MULADD(at[24], at[40]);    MULADD(at[25], at[39]);    MULADD(at[26], at[38]);    MULADD(at[27], at[37]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[55]);    MULADD(at[11], at[54]);    MULADD(at[12], at[53]);    MULADD(at[13], at[52]);    MULADD(at[14], at[51]);    MULADD(at[15], at[50]);    MULADD(at[16], at[49]);    MULADD(at[17], at[48]);    MULADD(at[18], at[47]);    MULADD(at[19], at[46]);    MULADD(at[20], at[45]);    MULADD(at[21], at[44]);    MULADD(at[22], at[43]);    MULADD(at[23], at[42]);    MULADD(at[24], at[41]);    MULADD(at[25], at[40]);    MULADD(at[26], at[39]);    MULADD(at[27], at[38]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[55]);    MULADD(at[12], at[54]);    MULADD(at[13], at[53]);    MULADD(at[14], at[52]);    MULADD(at[15], at[51]);    MULADD(at[16], at[50]);    MULADD(at[17], at[49]);    MULADD(at[18], at[48]);    MULADD(at[19], at[47]);    MULADD(at[20], at[46]);    MULADD(at[21], at[45]);    MULADD(at[22], at[44]);    MULADD(at[23], at[43]);    MULADD(at[24], at[42]);    MULADD(at[25], at[41]);    MULADD(at[26], at[40]);    MULADD(at[27], at[39]); 
+   COMBA_STORE(C->dp[38]);
+   /* 39 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[55]);    MULADD(at[13], at[54]);    MULADD(at[14], at[53]);    MULADD(at[15], at[52]);    MULADD(at[16], at[51]);    MULADD(at[17], at[50]);    MULADD(at[18], at[49]);    MULADD(at[19], at[48]);    MULADD(at[20], at[47]);    MULADD(at[21], at[46]);    MULADD(at[22], at[45]);    MULADD(at[23], at[44]);    MULADD(at[24], at[43]);    MULADD(at[25], at[42]);    MULADD(at[26], at[41]);    MULADD(at[27], at[40]); 
+   COMBA_STORE(C->dp[39]);
+   /* 40 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[55]);    MULADD(at[14], at[54]);    MULADD(at[15], at[53]);    MULADD(at[16], at[52]);    MULADD(at[17], at[51]);    MULADD(at[18], at[50]);    MULADD(at[19], at[49]);    MULADD(at[20], at[48]);    MULADD(at[21], at[47]);    MULADD(at[22], at[46]);    MULADD(at[23], at[45]);    MULADD(at[24], at[44]);    MULADD(at[25], at[43]);    MULADD(at[26], at[42]);    MULADD(at[27], at[41]); 
+   COMBA_STORE(C->dp[40]);
+   /* 41 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[55]);    MULADD(at[15], at[54]);    MULADD(at[16], at[53]);    MULADD(at[17], at[52]);    MULADD(at[18], at[51]);    MULADD(at[19], at[50]);    MULADD(at[20], at[49]);    MULADD(at[21], at[48]);    MULADD(at[22], at[47]);    MULADD(at[23], at[46]);    MULADD(at[24], at[45]);    MULADD(at[25], at[44]);    MULADD(at[26], at[43]);    MULADD(at[27], at[42]); 
+   COMBA_STORE(C->dp[41]);
+   /* 42 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[55]);    MULADD(at[16], at[54]);    MULADD(at[17], at[53]);    MULADD(at[18], at[52]);    MULADD(at[19], at[51]);    MULADD(at[20], at[50]);    MULADD(at[21], at[49]);    MULADD(at[22], at[48]);    MULADD(at[23], at[47]);    MULADD(at[24], at[46]);    MULADD(at[25], at[45]);    MULADD(at[26], at[44]);    MULADD(at[27], at[43]); 
+   COMBA_STORE(C->dp[42]);
+   /* 43 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[55]);    MULADD(at[17], at[54]);    MULADD(at[18], at[53]);    MULADD(at[19], at[52]);    MULADD(at[20], at[51]);    MULADD(at[21], at[50]);    MULADD(at[22], at[49]);    MULADD(at[23], at[48]);    MULADD(at[24], at[47]);    MULADD(at[25], at[46]);    MULADD(at[26], at[45]);    MULADD(at[27], at[44]); 
+   COMBA_STORE(C->dp[43]);
+   /* 44 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[55]);    MULADD(at[18], at[54]);    MULADD(at[19], at[53]);    MULADD(at[20], at[52]);    MULADD(at[21], at[51]);    MULADD(at[22], at[50]);    MULADD(at[23], at[49]);    MULADD(at[24], at[48]);    MULADD(at[25], at[47]);    MULADD(at[26], at[46]);    MULADD(at[27], at[45]); 
+   COMBA_STORE(C->dp[44]);
+   /* 45 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[55]);    MULADD(at[19], at[54]);    MULADD(at[20], at[53]);    MULADD(at[21], at[52]);    MULADD(at[22], at[51]);    MULADD(at[23], at[50]);    MULADD(at[24], at[49]);    MULADD(at[25], at[48]);    MULADD(at[26], at[47]);    MULADD(at[27], at[46]); 
+   COMBA_STORE(C->dp[45]);
+   /* 46 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[55]);    MULADD(at[20], at[54]);    MULADD(at[21], at[53]);    MULADD(at[22], at[52]);    MULADD(at[23], at[51]);    MULADD(at[24], at[50]);    MULADD(at[25], at[49]);    MULADD(at[26], at[48]);    MULADD(at[27], at[47]); 
+   COMBA_STORE(C->dp[46]);
+   /* 47 */
+   COMBA_FORWARD;
+   MULADD(at[20], at[55]);    MULADD(at[21], at[54]);    MULADD(at[22], at[53]);    MULADD(at[23], at[52]);    MULADD(at[24], at[51]);    MULADD(at[25], at[50]);    MULADD(at[26], at[49]);    MULADD(at[27], at[48]); 
+   COMBA_STORE(C->dp[47]);
+   /* 48 */
+   COMBA_FORWARD;
+   MULADD(at[21], at[55]);    MULADD(at[22], at[54]);    MULADD(at[23], at[53]);    MULADD(at[24], at[52]);    MULADD(at[25], at[51]);    MULADD(at[26], at[50]);    MULADD(at[27], at[49]); 
+   COMBA_STORE(C->dp[48]);
+   /* 49 */
+   COMBA_FORWARD;
+   MULADD(at[22], at[55]);    MULADD(at[23], at[54]);    MULADD(at[24], at[53]);    MULADD(at[25], at[52]);    MULADD(at[26], at[51]);    MULADD(at[27], at[50]); 
+   COMBA_STORE(C->dp[49]);
+   /* 50 */
+   COMBA_FORWARD;
+   MULADD(at[23], at[55]);    MULADD(at[24], at[54]);    MULADD(at[25], at[53]);    MULADD(at[26], at[52]);    MULADD(at[27], at[51]); 
+   COMBA_STORE(C->dp[50]);
+   /* 51 */
+   COMBA_FORWARD;
+   MULADD(at[24], at[55]);    MULADD(at[25], at[54]);    MULADD(at[26], at[53]);    MULADD(at[27], at[52]); 
+   COMBA_STORE(C->dp[51]);
+   /* 52 */
+   COMBA_FORWARD;
+   MULADD(at[25], at[55]);    MULADD(at[26], at[54]);    MULADD(at[27], at[53]); 
+   COMBA_STORE(C->dp[52]);
+   /* 53 */
+   COMBA_FORWARD;
+   MULADD(at[26], at[55]);    MULADD(at[27], at[54]); 
+   COMBA_STORE(C->dp[53]);
+   /* 54 */
+   COMBA_FORWARD;
+   MULADD(at[27], at[55]); 
+   COMBA_STORE(C->dp[54]);
+   COMBA_STORE2(C->dp[55]);
+   C->used = 56;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_3.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_3.i
new file mode 100644 (file)
index 0000000..03499c9
--- /dev/null
@@ -0,0 +1,58 @@
+/* fp_mul_comba_3.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL3
+void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[6];
+
+   memcpy(at, A->dp, 3 * sizeof(fp_digit));
+   memcpy(at+3, B->dp, 3 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[3]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[4]);    MULADD(at[1], at[3]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[5]);    MULADD(at[1], at[4]);    MULADD(at[2], at[3]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[5]);    MULADD(at[2], at[4]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[5]); 
+   COMBA_STORE(C->dp[4]);
+   COMBA_STORE2(C->dp[5]);
+   C->used = 6;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_32.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_32.i
new file mode 100644 (file)
index 0000000..3ca1fdb
--- /dev/null
@@ -0,0 +1,304 @@
+/* fp_mul_comba_32.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL32
+void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[64];
+   int out_size;
+
+   out_size = A->used + B->used;
+   memcpy(at, A->dp, 32 * sizeof(fp_digit));
+   memcpy(at+32, B->dp, 32 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[32]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[33]);    MULADD(at[1], at[32]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[34]);    MULADD(at[1], at[33]);    MULADD(at[2], at[32]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[35]);    MULADD(at[1], at[34]);    MULADD(at[2], at[33]);    MULADD(at[3], at[32]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[36]);    MULADD(at[1], at[35]);    MULADD(at[2], at[34]);    MULADD(at[3], at[33]);    MULADD(at[4], at[32]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[37]);    MULADD(at[1], at[36]);    MULADD(at[2], at[35]);    MULADD(at[3], at[34]);    MULADD(at[4], at[33]);    MULADD(at[5], at[32]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[38]);    MULADD(at[1], at[37]);    MULADD(at[2], at[36]);    MULADD(at[3], at[35]);    MULADD(at[4], at[34]);    MULADD(at[5], at[33]);    MULADD(at[6], at[32]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[39]);    MULADD(at[1], at[38]);    MULADD(at[2], at[37]);    MULADD(at[3], at[36]);    MULADD(at[4], at[35]);    MULADD(at[5], at[34]);    MULADD(at[6], at[33]);    MULADD(at[7], at[32]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[40]);    MULADD(at[1], at[39]);    MULADD(at[2], at[38]);    MULADD(at[3], at[37]);    MULADD(at[4], at[36]);    MULADD(at[5], at[35]);    MULADD(at[6], at[34]);    MULADD(at[7], at[33]);    MULADD(at[8], at[32]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[41]);    MULADD(at[1], at[40]);    MULADD(at[2], at[39]);    MULADD(at[3], at[38]);    MULADD(at[4], at[37]);    MULADD(at[5], at[36]);    MULADD(at[6], at[35]);    MULADD(at[7], at[34]);    MULADD(at[8], at[33]);    MULADD(at[9], at[32]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[42]);    MULADD(at[1], at[41]);    MULADD(at[2], at[40]);    MULADD(at[3], at[39]);    MULADD(at[4], at[38]);    MULADD(at[5], at[37]);    MULADD(at[6], at[36]);    MULADD(at[7], at[35]);    MULADD(at[8], at[34]);    MULADD(at[9], at[33]);    MULADD(at[10], at[32]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[43]);    MULADD(at[1], at[42]);    MULADD(at[2], at[41]);    MULADD(at[3], at[40]);    MULADD(at[4], at[39]);    MULADD(at[5], at[38]);    MULADD(at[6], at[37]);    MULADD(at[7], at[36]);    MULADD(at[8], at[35]);    MULADD(at[9], at[34]);    MULADD(at[10], at[33]);    MULADD(at[11], at[32]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[44]);    MULADD(at[1], at[43]);    MULADD(at[2], at[42]);    MULADD(at[3], at[41]);    MULADD(at[4], at[40]);    MULADD(at[5], at[39]);    MULADD(at[6], at[38]);    MULADD(at[7], at[37]);    MULADD(at[8], at[36]);    MULADD(at[9], at[35]);    MULADD(at[10], at[34]);    MULADD(at[11], at[33]);    MULADD(at[12], at[32]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[45]);    MULADD(at[1], at[44]);    MULADD(at[2], at[43]);    MULADD(at[3], at[42]);    MULADD(at[4], at[41]);    MULADD(at[5], at[40]);    MULADD(at[6], at[39]);    MULADD(at[7], at[38]);    MULADD(at[8], at[37]);    MULADD(at[9], at[36]);    MULADD(at[10], at[35]);    MULADD(at[11], at[34]);    MULADD(at[12], at[33]);    MULADD(at[13], at[32]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[46]);    MULADD(at[1], at[45]);    MULADD(at[2], at[44]);    MULADD(at[3], at[43]);    MULADD(at[4], at[42]);    MULADD(at[5], at[41]);    MULADD(at[6], at[40]);    MULADD(at[7], at[39]);    MULADD(at[8], at[38]);    MULADD(at[9], at[37]);    MULADD(at[10], at[36]);    MULADD(at[11], at[35]);    MULADD(at[12], at[34]);    MULADD(at[13], at[33]);    MULADD(at[14], at[32]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[47]);    MULADD(at[1], at[46]);    MULADD(at[2], at[45]);    MULADD(at[3], at[44]);    MULADD(at[4], at[43]);    MULADD(at[5], at[42]);    MULADD(at[6], at[41]);    MULADD(at[7], at[40]);    MULADD(at[8], at[39]);    MULADD(at[9], at[38]);    MULADD(at[10], at[37]);    MULADD(at[11], at[36]);    MULADD(at[12], at[35]);    MULADD(at[13], at[34]);    MULADD(at[14], at[33]);    MULADD(at[15], at[32]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[48]);    MULADD(at[1], at[47]);    MULADD(at[2], at[46]);    MULADD(at[3], at[45]);    MULADD(at[4], at[44]);    MULADD(at[5], at[43]);    MULADD(at[6], at[42]);    MULADD(at[7], at[41]);    MULADD(at[8], at[40]);    MULADD(at[9], at[39]);    MULADD(at[10], at[38]);    MULADD(at[11], at[37]);    MULADD(at[12], at[36]);    MULADD(at[13], at[35]);    MULADD(at[14], at[34]);    MULADD(at[15], at[33]);    MULADD(at[16], at[32]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[49]);    MULADD(at[1], at[48]);    MULADD(at[2], at[47]);    MULADD(at[3], at[46]);    MULADD(at[4], at[45]);    MULADD(at[5], at[44]);    MULADD(at[6], at[43]);    MULADD(at[7], at[42]);    MULADD(at[8], at[41]);    MULADD(at[9], at[40]);    MULADD(at[10], at[39]);    MULADD(at[11], at[38]);    MULADD(at[12], at[37]);    MULADD(at[13], at[36]);    MULADD(at[14], at[35]);    MULADD(at[15], at[34]);    MULADD(at[16], at[33]);    MULADD(at[17], at[32]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[50]);    MULADD(at[1], at[49]);    MULADD(at[2], at[48]);    MULADD(at[3], at[47]);    MULADD(at[4], at[46]);    MULADD(at[5], at[45]);    MULADD(at[6], at[44]);    MULADD(at[7], at[43]);    MULADD(at[8], at[42]);    MULADD(at[9], at[41]);    MULADD(at[10], at[40]);    MULADD(at[11], at[39]);    MULADD(at[12], at[38]);    MULADD(at[13], at[37]);    MULADD(at[14], at[36]);    MULADD(at[15], at[35]);    MULADD(at[16], at[34]);    MULADD(at[17], at[33]);    MULADD(at[18], at[32]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[51]);    MULADD(at[1], at[50]);    MULADD(at[2], at[49]);    MULADD(at[3], at[48]);    MULADD(at[4], at[47]);    MULADD(at[5], at[46]);    MULADD(at[6], at[45]);    MULADD(at[7], at[44]);    MULADD(at[8], at[43]);    MULADD(at[9], at[42]);    MULADD(at[10], at[41]);    MULADD(at[11], at[40]);    MULADD(at[12], at[39]);    MULADD(at[13], at[38]);    MULADD(at[14], at[37]);    MULADD(at[15], at[36]);    MULADD(at[16], at[35]);    MULADD(at[17], at[34]);    MULADD(at[18], at[33]);    MULADD(at[19], at[32]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[52]);    MULADD(at[1], at[51]);    MULADD(at[2], at[50]);    MULADD(at[3], at[49]);    MULADD(at[4], at[48]);    MULADD(at[5], at[47]);    MULADD(at[6], at[46]);    MULADD(at[7], at[45]);    MULADD(at[8], at[44]);    MULADD(at[9], at[43]);    MULADD(at[10], at[42]);    MULADD(at[11], at[41]);    MULADD(at[12], at[40]);    MULADD(at[13], at[39]);    MULADD(at[14], at[38]);    MULADD(at[15], at[37]);    MULADD(at[16], at[36]);    MULADD(at[17], at[35]);    MULADD(at[18], at[34]);    MULADD(at[19], at[33]);    MULADD(at[20], at[32]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[53]);    MULADD(at[1], at[52]);    MULADD(at[2], at[51]);    MULADD(at[3], at[50]);    MULADD(at[4], at[49]);    MULADD(at[5], at[48]);    MULADD(at[6], at[47]);    MULADD(at[7], at[46]);    MULADD(at[8], at[45]);    MULADD(at[9], at[44]);    MULADD(at[10], at[43]);    MULADD(at[11], at[42]);    MULADD(at[12], at[41]);    MULADD(at[13], at[40]);    MULADD(at[14], at[39]);    MULADD(at[15], at[38]);    MULADD(at[16], at[37]);    MULADD(at[17], at[36]);    MULADD(at[18], at[35]);    MULADD(at[19], at[34]);    MULADD(at[20], at[33]);    MULADD(at[21], at[32]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[54]);    MULADD(at[1], at[53]);    MULADD(at[2], at[52]);    MULADD(at[3], at[51]);    MULADD(at[4], at[50]);    MULADD(at[5], at[49]);    MULADD(at[6], at[48]);    MULADD(at[7], at[47]);    MULADD(at[8], at[46]);    MULADD(at[9], at[45]);    MULADD(at[10], at[44]);    MULADD(at[11], at[43]);    MULADD(at[12], at[42]);    MULADD(at[13], at[41]);    MULADD(at[14], at[40]);    MULADD(at[15], at[39]);    MULADD(at[16], at[38]);    MULADD(at[17], at[37]);    MULADD(at[18], at[36]);    MULADD(at[19], at[35]);    MULADD(at[20], at[34]);    MULADD(at[21], at[33]);    MULADD(at[22], at[32]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[55]);    MULADD(at[1], at[54]);    MULADD(at[2], at[53]);    MULADD(at[3], at[52]);    MULADD(at[4], at[51]);    MULADD(at[5], at[50]);    MULADD(at[6], at[49]);    MULADD(at[7], at[48]);    MULADD(at[8], at[47]);    MULADD(at[9], at[46]);    MULADD(at[10], at[45]);    MULADD(at[11], at[44]);    MULADD(at[12], at[43]);    MULADD(at[13], at[42]);    MULADD(at[14], at[41]);    MULADD(at[15], at[40]);    MULADD(at[16], at[39]);    MULADD(at[17], at[38]);    MULADD(at[18], at[37]);    MULADD(at[19], at[36]);    MULADD(at[20], at[35]);    MULADD(at[21], at[34]);    MULADD(at[22], at[33]);    MULADD(at[23], at[32]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[56]);    MULADD(at[1], at[55]);    MULADD(at[2], at[54]);    MULADD(at[3], at[53]);    MULADD(at[4], at[52]);    MULADD(at[5], at[51]);    MULADD(at[6], at[50]);    MULADD(at[7], at[49]);    MULADD(at[8], at[48]);    MULADD(at[9], at[47]);    MULADD(at[10], at[46]);    MULADD(at[11], at[45]);    MULADD(at[12], at[44]);    MULADD(at[13], at[43]);    MULADD(at[14], at[42]);    MULADD(at[15], at[41]);    MULADD(at[16], at[40]);    MULADD(at[17], at[39]);    MULADD(at[18], at[38]);    MULADD(at[19], at[37]);    MULADD(at[20], at[36]);    MULADD(at[21], at[35]);    MULADD(at[22], at[34]);    MULADD(at[23], at[33]);    MULADD(at[24], at[32]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[57]);    MULADD(at[1], at[56]);    MULADD(at[2], at[55]);    MULADD(at[3], at[54]);    MULADD(at[4], at[53]);    MULADD(at[5], at[52]);    MULADD(at[6], at[51]);    MULADD(at[7], at[50]);    MULADD(at[8], at[49]);    MULADD(at[9], at[48]);    MULADD(at[10], at[47]);    MULADD(at[11], at[46]);    MULADD(at[12], at[45]);    MULADD(at[13], at[44]);    MULADD(at[14], at[43]);    MULADD(at[15], at[42]);    MULADD(at[16], at[41]);    MULADD(at[17], at[40]);    MULADD(at[18], at[39]);    MULADD(at[19], at[38]);    MULADD(at[20], at[37]);    MULADD(at[21], at[36]);    MULADD(at[22], at[35]);    MULADD(at[23], at[34]);    MULADD(at[24], at[33]);    MULADD(at[25], at[32]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[58]);    MULADD(at[1], at[57]);    MULADD(at[2], at[56]);    MULADD(at[3], at[55]);    MULADD(at[4], at[54]);    MULADD(at[5], at[53]);    MULADD(at[6], at[52]);    MULADD(at[7], at[51]);    MULADD(at[8], at[50]);    MULADD(at[9], at[49]);    MULADD(at[10], at[48]);    MULADD(at[11], at[47]);    MULADD(at[12], at[46]);    MULADD(at[13], at[45]);    MULADD(at[14], at[44]);    MULADD(at[15], at[43]);    MULADD(at[16], at[42]);    MULADD(at[17], at[41]);    MULADD(at[18], at[40]);    MULADD(at[19], at[39]);    MULADD(at[20], at[38]);    MULADD(at[21], at[37]);    MULADD(at[22], at[36]);    MULADD(at[23], at[35]);    MULADD(at[24], at[34]);    MULADD(at[25], at[33]);    MULADD(at[26], at[32]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[59]);    MULADD(at[1], at[58]);    MULADD(at[2], at[57]);    MULADD(at[3], at[56]);    MULADD(at[4], at[55]);    MULADD(at[5], at[54]);    MULADD(at[6], at[53]);    MULADD(at[7], at[52]);    MULADD(at[8], at[51]);    MULADD(at[9], at[50]);    MULADD(at[10], at[49]);    MULADD(at[11], at[48]);    MULADD(at[12], at[47]);    MULADD(at[13], at[46]);    MULADD(at[14], at[45]);    MULADD(at[15], at[44]);    MULADD(at[16], at[43]);    MULADD(at[17], at[42]);    MULADD(at[18], at[41]);    MULADD(at[19], at[40]);    MULADD(at[20], at[39]);    MULADD(at[21], at[38]);    MULADD(at[22], at[37]);    MULADD(at[23], at[36]);    MULADD(at[24], at[35]);    MULADD(at[25], at[34]);    MULADD(at[26], at[33]);    MULADD(at[27], at[32]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[60]);    MULADD(at[1], at[59]);    MULADD(at[2], at[58]);    MULADD(at[3], at[57]);    MULADD(at[4], at[56]);    MULADD(at[5], at[55]);    MULADD(at[6], at[54]);    MULADD(at[7], at[53]);    MULADD(at[8], at[52]);    MULADD(at[9], at[51]);    MULADD(at[10], at[50]);    MULADD(at[11], at[49]);    MULADD(at[12], at[48]);    MULADD(at[13], at[47]);    MULADD(at[14], at[46]);    MULADD(at[15], at[45]);    MULADD(at[16], at[44]);    MULADD(at[17], at[43]);    MULADD(at[18], at[42]);    MULADD(at[19], at[41]);    MULADD(at[20], at[40]);    MULADD(at[21], at[39]);    MULADD(at[22], at[38]);    MULADD(at[23], at[37]);    MULADD(at[24], at[36]);    MULADD(at[25], at[35]);    MULADD(at[26], at[34]);    MULADD(at[27], at[33]);    MULADD(at[28], at[32]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[61]);    MULADD(at[1], at[60]);    MULADD(at[2], at[59]);    MULADD(at[3], at[58]);    MULADD(at[4], at[57]);    MULADD(at[5], at[56]);    MULADD(at[6], at[55]);    MULADD(at[7], at[54]);    MULADD(at[8], at[53]);    MULADD(at[9], at[52]);    MULADD(at[10], at[51]);    MULADD(at[11], at[50]);    MULADD(at[12], at[49]);    MULADD(at[13], at[48]);    MULADD(at[14], at[47]);    MULADD(at[15], at[46]);    MULADD(at[16], at[45]);    MULADD(at[17], at[44]);    MULADD(at[18], at[43]);    MULADD(at[19], at[42]);    MULADD(at[20], at[41]);    MULADD(at[21], at[40]);    MULADD(at[22], at[39]);    MULADD(at[23], at[38]);    MULADD(at[24], at[37]);    MULADD(at[25], at[36]);    MULADD(at[26], at[35]);    MULADD(at[27], at[34]);    MULADD(at[28], at[33]);    MULADD(at[29], at[32]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[62]);    MULADD(at[1], at[61]);    MULADD(at[2], at[60]);    MULADD(at[3], at[59]);    MULADD(at[4], at[58]);    MULADD(at[5], at[57]);    MULADD(at[6], at[56]);    MULADD(at[7], at[55]);    MULADD(at[8], at[54]);    MULADD(at[9], at[53]);    MULADD(at[10], at[52]);    MULADD(at[11], at[51]);    MULADD(at[12], at[50]);    MULADD(at[13], at[49]);    MULADD(at[14], at[48]);    MULADD(at[15], at[47]);    MULADD(at[16], at[46]);    MULADD(at[17], at[45]);    MULADD(at[18], at[44]);    MULADD(at[19], at[43]);    MULADD(at[20], at[42]);    MULADD(at[21], at[41]);    MULADD(at[22], at[40]);    MULADD(at[23], at[39]);    MULADD(at[24], at[38]);    MULADD(at[25], at[37]);    MULADD(at[26], at[36]);    MULADD(at[27], at[35]);    MULADD(at[28], at[34]);    MULADD(at[29], at[33]);    MULADD(at[30], at[32]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[63]);    MULADD(at[1], at[62]);    MULADD(at[2], at[61]);    MULADD(at[3], at[60]);    MULADD(at[4], at[59]);    MULADD(at[5], at[58]);    MULADD(at[6], at[57]);    MULADD(at[7], at[56]);    MULADD(at[8], at[55]);    MULADD(at[9], at[54]);    MULADD(at[10], at[53]);    MULADD(at[11], at[52]);    MULADD(at[12], at[51]);    MULADD(at[13], at[50]);    MULADD(at[14], at[49]);    MULADD(at[15], at[48]);    MULADD(at[16], at[47]);    MULADD(at[17], at[46]);    MULADD(at[18], at[45]);    MULADD(at[19], at[44]);    MULADD(at[20], at[43]);    MULADD(at[21], at[42]);    MULADD(at[22], at[41]);    MULADD(at[23], at[40]);    MULADD(at[24], at[39]);    MULADD(at[25], at[38]);    MULADD(at[26], at[37]);    MULADD(at[27], at[36]);    MULADD(at[28], at[35]);    MULADD(at[29], at[34]);    MULADD(at[30], at[33]);    MULADD(at[31], at[32]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[63]);    MULADD(at[2], at[62]);    MULADD(at[3], at[61]);    MULADD(at[4], at[60]);    MULADD(at[5], at[59]);    MULADD(at[6], at[58]);    MULADD(at[7], at[57]);    MULADD(at[8], at[56]);    MULADD(at[9], at[55]);    MULADD(at[10], at[54]);    MULADD(at[11], at[53]);    MULADD(at[12], at[52]);    MULADD(at[13], at[51]);    MULADD(at[14], at[50]);    MULADD(at[15], at[49]);    MULADD(at[16], at[48]);    MULADD(at[17], at[47]);    MULADD(at[18], at[46]);    MULADD(at[19], at[45]);    MULADD(at[20], at[44]);    MULADD(at[21], at[43]);    MULADD(at[22], at[42]);    MULADD(at[23], at[41]);    MULADD(at[24], at[40]);    MULADD(at[25], at[39]);    MULADD(at[26], at[38]);    MULADD(at[27], at[37]);    MULADD(at[28], at[36]);    MULADD(at[29], at[35]);    MULADD(at[30], at[34]);    MULADD(at[31], at[33]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[63]);    MULADD(at[3], at[62]);    MULADD(at[4], at[61]);    MULADD(at[5], at[60]);    MULADD(at[6], at[59]);    MULADD(at[7], at[58]);    MULADD(at[8], at[57]);    MULADD(at[9], at[56]);    MULADD(at[10], at[55]);    MULADD(at[11], at[54]);    MULADD(at[12], at[53]);    MULADD(at[13], at[52]);    MULADD(at[14], at[51]);    MULADD(at[15], at[50]);    MULADD(at[16], at[49]);    MULADD(at[17], at[48]);    MULADD(at[18], at[47]);    MULADD(at[19], at[46]);    MULADD(at[20], at[45]);    MULADD(at[21], at[44]);    MULADD(at[22], at[43]);    MULADD(at[23], at[42]);    MULADD(at[24], at[41]);    MULADD(at[25], at[40]);    MULADD(at[26], at[39]);    MULADD(at[27], at[38]);    MULADD(at[28], at[37]);    MULADD(at[29], at[36]);    MULADD(at[30], at[35]);    MULADD(at[31], at[34]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[63]);    MULADD(at[4], at[62]);    MULADD(at[5], at[61]);    MULADD(at[6], at[60]);    MULADD(at[7], at[59]);    MULADD(at[8], at[58]);    MULADD(at[9], at[57]);    MULADD(at[10], at[56]);    MULADD(at[11], at[55]);    MULADD(at[12], at[54]);    MULADD(at[13], at[53]);    MULADD(at[14], at[52]);    MULADD(at[15], at[51]);    MULADD(at[16], at[50]);    MULADD(at[17], at[49]);    MULADD(at[18], at[48]);    MULADD(at[19], at[47]);    MULADD(at[20], at[46]);    MULADD(at[21], at[45]);    MULADD(at[22], at[44]);    MULADD(at[23], at[43]);    MULADD(at[24], at[42]);    MULADD(at[25], at[41]);    MULADD(at[26], at[40]);    MULADD(at[27], at[39]);    MULADD(at[28], at[38]);    MULADD(at[29], at[37]);    MULADD(at[30], at[36]);    MULADD(at[31], at[35]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[63]);    MULADD(at[5], at[62]);    MULADD(at[6], at[61]);    MULADD(at[7], at[60]);    MULADD(at[8], at[59]);    MULADD(at[9], at[58]);    MULADD(at[10], at[57]);    MULADD(at[11], at[56]);    MULADD(at[12], at[55]);    MULADD(at[13], at[54]);    MULADD(at[14], at[53]);    MULADD(at[15], at[52]);    MULADD(at[16], at[51]);    MULADD(at[17], at[50]);    MULADD(at[18], at[49]);    MULADD(at[19], at[48]);    MULADD(at[20], at[47]);    MULADD(at[21], at[46]);    MULADD(at[22], at[45]);    MULADD(at[23], at[44]);    MULADD(at[24], at[43]);    MULADD(at[25], at[42]);    MULADD(at[26], at[41]);    MULADD(at[27], at[40]);    MULADD(at[28], at[39]);    MULADD(at[29], at[38]);    MULADD(at[30], at[37]);    MULADD(at[31], at[36]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[63]);    MULADD(at[6], at[62]);    MULADD(at[7], at[61]);    MULADD(at[8], at[60]);    MULADD(at[9], at[59]);    MULADD(at[10], at[58]);    MULADD(at[11], at[57]);    MULADD(at[12], at[56]);    MULADD(at[13], at[55]);    MULADD(at[14], at[54]);    MULADD(at[15], at[53]);    MULADD(at[16], at[52]);    MULADD(at[17], at[51]);    MULADD(at[18], at[50]);    MULADD(at[19], at[49]);    MULADD(at[20], at[48]);    MULADD(at[21], at[47]);    MULADD(at[22], at[46]);    MULADD(at[23], at[45]);    MULADD(at[24], at[44]);    MULADD(at[25], at[43]);    MULADD(at[26], at[42]);    MULADD(at[27], at[41]);    MULADD(at[28], at[40]);    MULADD(at[29], at[39]);    MULADD(at[30], at[38]);    MULADD(at[31], at[37]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[63]);    MULADD(at[7], at[62]);    MULADD(at[8], at[61]);    MULADD(at[9], at[60]);    MULADD(at[10], at[59]);    MULADD(at[11], at[58]);    MULADD(at[12], at[57]);    MULADD(at[13], at[56]);    MULADD(at[14], at[55]);    MULADD(at[15], at[54]);    MULADD(at[16], at[53]);    MULADD(at[17], at[52]);    MULADD(at[18], at[51]);    MULADD(at[19], at[50]);    MULADD(at[20], at[49]);    MULADD(at[21], at[48]);    MULADD(at[22], at[47]);    MULADD(at[23], at[46]);    MULADD(at[24], at[45]);    MULADD(at[25], at[44]);    MULADD(at[26], at[43]);    MULADD(at[27], at[42]);    MULADD(at[28], at[41]);    MULADD(at[29], at[40]);    MULADD(at[30], at[39]);    MULADD(at[31], at[38]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[63]);    MULADD(at[8], at[62]);    MULADD(at[9], at[61]);    MULADD(at[10], at[60]);    MULADD(at[11], at[59]);    MULADD(at[12], at[58]);    MULADD(at[13], at[57]);    MULADD(at[14], at[56]);    MULADD(at[15], at[55]);    MULADD(at[16], at[54]);    MULADD(at[17], at[53]);    MULADD(at[18], at[52]);    MULADD(at[19], at[51]);    MULADD(at[20], at[50]);    MULADD(at[21], at[49]);    MULADD(at[22], at[48]);    MULADD(at[23], at[47]);    MULADD(at[24], at[46]);    MULADD(at[25], at[45]);    MULADD(at[26], at[44]);    MULADD(at[27], at[43]);    MULADD(at[28], at[42]);    MULADD(at[29], at[41]);    MULADD(at[30], at[40]);    MULADD(at[31], at[39]); 
+   COMBA_STORE(C->dp[38]);
+
+   /* early out at 40 digits, 40*32==1280, or two 640 bit operands */
+   if (out_size <= 40) { COMBA_STORE2(C->dp[39]); C->used = 40; C->sign = A->sign ^ B->sign; fp_clamp(C); COMBA_FINI; return; }
+
+   /* 39 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[63]);    MULADD(at[9], at[62]);    MULADD(at[10], at[61]);    MULADD(at[11], at[60]);    MULADD(at[12], at[59]);    MULADD(at[13], at[58]);    MULADD(at[14], at[57]);    MULADD(at[15], at[56]);    MULADD(at[16], at[55]);    MULADD(at[17], at[54]);    MULADD(at[18], at[53]);    MULADD(at[19], at[52]);    MULADD(at[20], at[51]);    MULADD(at[21], at[50]);    MULADD(at[22], at[49]);    MULADD(at[23], at[48]);    MULADD(at[24], at[47]);    MULADD(at[25], at[46]);    MULADD(at[26], at[45]);    MULADD(at[27], at[44]);    MULADD(at[28], at[43]);    MULADD(at[29], at[42]);    MULADD(at[30], at[41]);    MULADD(at[31], at[40]); 
+   COMBA_STORE(C->dp[39]);
+   /* 40 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[63]);    MULADD(at[10], at[62]);    MULADD(at[11], at[61]);    MULADD(at[12], at[60]);    MULADD(at[13], at[59]);    MULADD(at[14], at[58]);    MULADD(at[15], at[57]);    MULADD(at[16], at[56]);    MULADD(at[17], at[55]);    MULADD(at[18], at[54]);    MULADD(at[19], at[53]);    MULADD(at[20], at[52]);    MULADD(at[21], at[51]);    MULADD(at[22], at[50]);    MULADD(at[23], at[49]);    MULADD(at[24], at[48]);    MULADD(at[25], at[47]);    MULADD(at[26], at[46]);    MULADD(at[27], at[45]);    MULADD(at[28], at[44]);    MULADD(at[29], at[43]);    MULADD(at[30], at[42]);    MULADD(at[31], at[41]); 
+   COMBA_STORE(C->dp[40]);
+   /* 41 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[63]);    MULADD(at[11], at[62]);    MULADD(at[12], at[61]);    MULADD(at[13], at[60]);    MULADD(at[14], at[59]);    MULADD(at[15], at[58]);    MULADD(at[16], at[57]);    MULADD(at[17], at[56]);    MULADD(at[18], at[55]);    MULADD(at[19], at[54]);    MULADD(at[20], at[53]);    MULADD(at[21], at[52]);    MULADD(at[22], at[51]);    MULADD(at[23], at[50]);    MULADD(at[24], at[49]);    MULADD(at[25], at[48]);    MULADD(at[26], at[47]);    MULADD(at[27], at[46]);    MULADD(at[28], at[45]);    MULADD(at[29], at[44]);    MULADD(at[30], at[43]);    MULADD(at[31], at[42]); 
+   COMBA_STORE(C->dp[41]);
+   /* 42 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[63]);    MULADD(at[12], at[62]);    MULADD(at[13], at[61]);    MULADD(at[14], at[60]);    MULADD(at[15], at[59]);    MULADD(at[16], at[58]);    MULADD(at[17], at[57]);    MULADD(at[18], at[56]);    MULADD(at[19], at[55]);    MULADD(at[20], at[54]);    MULADD(at[21], at[53]);    MULADD(at[22], at[52]);    MULADD(at[23], at[51]);    MULADD(at[24], at[50]);    MULADD(at[25], at[49]);    MULADD(at[26], at[48]);    MULADD(at[27], at[47]);    MULADD(at[28], at[46]);    MULADD(at[29], at[45]);    MULADD(at[30], at[44]);    MULADD(at[31], at[43]); 
+   COMBA_STORE(C->dp[42]);
+   /* 43 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[63]);    MULADD(at[13], at[62]);    MULADD(at[14], at[61]);    MULADD(at[15], at[60]);    MULADD(at[16], at[59]);    MULADD(at[17], at[58]);    MULADD(at[18], at[57]);    MULADD(at[19], at[56]);    MULADD(at[20], at[55]);    MULADD(at[21], at[54]);    MULADD(at[22], at[53]);    MULADD(at[23], at[52]);    MULADD(at[24], at[51]);    MULADD(at[25], at[50]);    MULADD(at[26], at[49]);    MULADD(at[27], at[48]);    MULADD(at[28], at[47]);    MULADD(at[29], at[46]);    MULADD(at[30], at[45]);    MULADD(at[31], at[44]); 
+   COMBA_STORE(C->dp[43]);
+   /* 44 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[63]);    MULADD(at[14], at[62]);    MULADD(at[15], at[61]);    MULADD(at[16], at[60]);    MULADD(at[17], at[59]);    MULADD(at[18], at[58]);    MULADD(at[19], at[57]);    MULADD(at[20], at[56]);    MULADD(at[21], at[55]);    MULADD(at[22], at[54]);    MULADD(at[23], at[53]);    MULADD(at[24], at[52]);    MULADD(at[25], at[51]);    MULADD(at[26], at[50]);    MULADD(at[27], at[49]);    MULADD(at[28], at[48]);    MULADD(at[29], at[47]);    MULADD(at[30], at[46]);    MULADD(at[31], at[45]); 
+   COMBA_STORE(C->dp[44]);
+   /* 45 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[63]);    MULADD(at[15], at[62]);    MULADD(at[16], at[61]);    MULADD(at[17], at[60]);    MULADD(at[18], at[59]);    MULADD(at[19], at[58]);    MULADD(at[20], at[57]);    MULADD(at[21], at[56]);    MULADD(at[22], at[55]);    MULADD(at[23], at[54]);    MULADD(at[24], at[53]);    MULADD(at[25], at[52]);    MULADD(at[26], at[51]);    MULADD(at[27], at[50]);    MULADD(at[28], at[49]);    MULADD(at[29], at[48]);    MULADD(at[30], at[47]);    MULADD(at[31], at[46]); 
+   COMBA_STORE(C->dp[45]);
+   /* 46 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[63]);    MULADD(at[16], at[62]);    MULADD(at[17], at[61]);    MULADD(at[18], at[60]);    MULADD(at[19], at[59]);    MULADD(at[20], at[58]);    MULADD(at[21], at[57]);    MULADD(at[22], at[56]);    MULADD(at[23], at[55]);    MULADD(at[24], at[54]);    MULADD(at[25], at[53]);    MULADD(at[26], at[52]);    MULADD(at[27], at[51]);    MULADD(at[28], at[50]);    MULADD(at[29], at[49]);    MULADD(at[30], at[48]);    MULADD(at[31], at[47]); 
+   COMBA_STORE(C->dp[46]);
+
+   /* early out at 48 digits, 48*32==1536, or two 768 bit operands */
+   if (out_size <= 48) { COMBA_STORE2(C->dp[47]); C->used = 48; C->sign = A->sign ^ B->sign; fp_clamp(C); COMBA_FINI; return; }
+
+   /* 47 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[63]);    MULADD(at[17], at[62]);    MULADD(at[18], at[61]);    MULADD(at[19], at[60]);    MULADD(at[20], at[59]);    MULADD(at[21], at[58]);    MULADD(at[22], at[57]);    MULADD(at[23], at[56]);    MULADD(at[24], at[55]);    MULADD(at[25], at[54]);    MULADD(at[26], at[53]);    MULADD(at[27], at[52]);    MULADD(at[28], at[51]);    MULADD(at[29], at[50]);    MULADD(at[30], at[49]);    MULADD(at[31], at[48]); 
+   COMBA_STORE(C->dp[47]);
+   /* 48 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[63]);    MULADD(at[18], at[62]);    MULADD(at[19], at[61]);    MULADD(at[20], at[60]);    MULADD(at[21], at[59]);    MULADD(at[22], at[58]);    MULADD(at[23], at[57]);    MULADD(at[24], at[56]);    MULADD(at[25], at[55]);    MULADD(at[26], at[54]);    MULADD(at[27], at[53]);    MULADD(at[28], at[52]);    MULADD(at[29], at[51]);    MULADD(at[30], at[50]);    MULADD(at[31], at[49]); 
+   COMBA_STORE(C->dp[48]);
+   /* 49 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[63]);    MULADD(at[19], at[62]);    MULADD(at[20], at[61]);    MULADD(at[21], at[60]);    MULADD(at[22], at[59]);    MULADD(at[23], at[58]);    MULADD(at[24], at[57]);    MULADD(at[25], at[56]);    MULADD(at[26], at[55]);    MULADD(at[27], at[54]);    MULADD(at[28], at[53]);    MULADD(at[29], at[52]);    MULADD(at[30], at[51]);    MULADD(at[31], at[50]); 
+   COMBA_STORE(C->dp[49]);
+   /* 50 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[63]);    MULADD(at[20], at[62]);    MULADD(at[21], at[61]);    MULADD(at[22], at[60]);    MULADD(at[23], at[59]);    MULADD(at[24], at[58]);    MULADD(at[25], at[57]);    MULADD(at[26], at[56]);    MULADD(at[27], at[55]);    MULADD(at[28], at[54]);    MULADD(at[29], at[53]);    MULADD(at[30], at[52]);    MULADD(at[31], at[51]); 
+   COMBA_STORE(C->dp[50]);
+   /* 51 */
+   COMBA_FORWARD;
+   MULADD(at[20], at[63]);    MULADD(at[21], at[62]);    MULADD(at[22], at[61]);    MULADD(at[23], at[60]);    MULADD(at[24], at[59]);    MULADD(at[25], at[58]);    MULADD(at[26], at[57]);    MULADD(at[27], at[56]);    MULADD(at[28], at[55]);    MULADD(at[29], at[54]);    MULADD(at[30], at[53]);    MULADD(at[31], at[52]); 
+   COMBA_STORE(C->dp[51]);
+   /* 52 */
+   COMBA_FORWARD;
+   MULADD(at[21], at[63]);    MULADD(at[22], at[62]);    MULADD(at[23], at[61]);    MULADD(at[24], at[60]);    MULADD(at[25], at[59]);    MULADD(at[26], at[58]);    MULADD(at[27], at[57]);    MULADD(at[28], at[56]);    MULADD(at[29], at[55]);    MULADD(at[30], at[54]);    MULADD(at[31], at[53]); 
+   COMBA_STORE(C->dp[52]);
+   /* 53 */
+   COMBA_FORWARD;
+   MULADD(at[22], at[63]);    MULADD(at[23], at[62]);    MULADD(at[24], at[61]);    MULADD(at[25], at[60]);    MULADD(at[26], at[59]);    MULADD(at[27], at[58]);    MULADD(at[28], at[57]);    MULADD(at[29], at[56]);    MULADD(at[30], at[55]);    MULADD(at[31], at[54]); 
+   COMBA_STORE(C->dp[53]);
+   /* 54 */
+   COMBA_FORWARD;
+   MULADD(at[23], at[63]);    MULADD(at[24], at[62]);    MULADD(at[25], at[61]);    MULADD(at[26], at[60]);    MULADD(at[27], at[59]);    MULADD(at[28], at[58]);    MULADD(at[29], at[57]);    MULADD(at[30], at[56]);    MULADD(at[31], at[55]); 
+   COMBA_STORE(C->dp[54]);
+
+   /* early out at 56 digits, 56*32==1792, or two 896 bit operands */
+   if (out_size <= 56) { COMBA_STORE2(C->dp[55]); C->used = 56; C->sign = A->sign ^ B->sign; fp_clamp(C); COMBA_FINI; return; }
+
+   /* 55 */
+   COMBA_FORWARD;
+   MULADD(at[24], at[63]);    MULADD(at[25], at[62]);    MULADD(at[26], at[61]);    MULADD(at[27], at[60]);    MULADD(at[28], at[59]);    MULADD(at[29], at[58]);    MULADD(at[30], at[57]);    MULADD(at[31], at[56]); 
+   COMBA_STORE(C->dp[55]);
+   /* 56 */
+   COMBA_FORWARD;
+   MULADD(at[25], at[63]);    MULADD(at[26], at[62]);    MULADD(at[27], at[61]);    MULADD(at[28], at[60]);    MULADD(at[29], at[59]);    MULADD(at[30], at[58]);    MULADD(at[31], at[57]); 
+   COMBA_STORE(C->dp[56]);
+   /* 57 */
+   COMBA_FORWARD;
+   MULADD(at[26], at[63]);    MULADD(at[27], at[62]);    MULADD(at[28], at[61]);    MULADD(at[29], at[60]);    MULADD(at[30], at[59]);    MULADD(at[31], at[58]); 
+   COMBA_STORE(C->dp[57]);
+   /* 58 */
+   COMBA_FORWARD;
+   MULADD(at[27], at[63]);    MULADD(at[28], at[62]);    MULADD(at[29], at[61]);    MULADD(at[30], at[60]);    MULADD(at[31], at[59]); 
+   COMBA_STORE(C->dp[58]);
+   /* 59 */
+   COMBA_FORWARD;
+   MULADD(at[28], at[63]);    MULADD(at[29], at[62]);    MULADD(at[30], at[61]);    MULADD(at[31], at[60]); 
+   COMBA_STORE(C->dp[59]);
+   /* 60 */
+   COMBA_FORWARD;
+   MULADD(at[29], at[63]);    MULADD(at[30], at[62]);    MULADD(at[31], at[61]); 
+   COMBA_STORE(C->dp[60]);
+   /* 61 */
+   COMBA_FORWARD;
+   MULADD(at[30], at[63]);    MULADD(at[31], at[62]); 
+   COMBA_STORE(C->dp[61]);
+   /* 62 */
+   COMBA_FORWARD;
+   MULADD(at[31], at[63]); 
+   COMBA_STORE(C->dp[62]);
+   COMBA_STORE2(C->dp[63]);
+   C->used = 64;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_4.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_4.i
new file mode 100644 (file)
index 0000000..d715937
--- /dev/null
@@ -0,0 +1,66 @@
+/* fp_mul_comba_4.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL4
+void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[8];
+
+   memcpy(at, A->dp, 4 * sizeof(fp_digit));
+   memcpy(at+4, B->dp, 4 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[4]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[5]);    MULADD(at[1], at[4]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[6]);    MULADD(at[1], at[5]);    MULADD(at[2], at[4]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[7]);    MULADD(at[1], at[6]);    MULADD(at[2], at[5]);    MULADD(at[3], at[4]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[7]);    MULADD(at[2], at[6]);    MULADD(at[3], at[5]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[7]);    MULADD(at[3], at[6]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[7]); 
+   COMBA_STORE(C->dp[6]);
+   COMBA_STORE2(C->dp[7]);
+   C->used = 8;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_48.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_48.i
new file mode 100644 (file)
index 0000000..4c18569
--- /dev/null
@@ -0,0 +1,418 @@
+/* fp_mul_comba_48.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL48
+void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[96];
+
+   memcpy(at, A->dp, 48 * sizeof(fp_digit));
+   memcpy(at+48, B->dp, 48 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[48]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[49]);    MULADD(at[1], at[48]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[50]);    MULADD(at[1], at[49]);    MULADD(at[2], at[48]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[51]);    MULADD(at[1], at[50]);    MULADD(at[2], at[49]);    MULADD(at[3], at[48]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[52]);    MULADD(at[1], at[51]);    MULADD(at[2], at[50]);    MULADD(at[3], at[49]);    MULADD(at[4], at[48]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[53]);    MULADD(at[1], at[52]);    MULADD(at[2], at[51]);    MULADD(at[3], at[50]);    MULADD(at[4], at[49]);    MULADD(at[5], at[48]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[54]);    MULADD(at[1], at[53]);    MULADD(at[2], at[52]);    MULADD(at[3], at[51]);    MULADD(at[4], at[50]);    MULADD(at[5], at[49]);    MULADD(at[6], at[48]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[55]);    MULADD(at[1], at[54]);    MULADD(at[2], at[53]);    MULADD(at[3], at[52]);    MULADD(at[4], at[51]);    MULADD(at[5], at[50]);    MULADD(at[6], at[49]);    MULADD(at[7], at[48]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[56]);    MULADD(at[1], at[55]);    MULADD(at[2], at[54]);    MULADD(at[3], at[53]);    MULADD(at[4], at[52]);    MULADD(at[5], at[51]);    MULADD(at[6], at[50]);    MULADD(at[7], at[49]);    MULADD(at[8], at[48]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[57]);    MULADD(at[1], at[56]);    MULADD(at[2], at[55]);    MULADD(at[3], at[54]);    MULADD(at[4], at[53]);    MULADD(at[5], at[52]);    MULADD(at[6], at[51]);    MULADD(at[7], at[50]);    MULADD(at[8], at[49]);    MULADD(at[9], at[48]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[58]);    MULADD(at[1], at[57]);    MULADD(at[2], at[56]);    MULADD(at[3], at[55]);    MULADD(at[4], at[54]);    MULADD(at[5], at[53]);    MULADD(at[6], at[52]);    MULADD(at[7], at[51]);    MULADD(at[8], at[50]);    MULADD(at[9], at[49]);    MULADD(at[10], at[48]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[59]);    MULADD(at[1], at[58]);    MULADD(at[2], at[57]);    MULADD(at[3], at[56]);    MULADD(at[4], at[55]);    MULADD(at[5], at[54]);    MULADD(at[6], at[53]);    MULADD(at[7], at[52]);    MULADD(at[8], at[51]);    MULADD(at[9], at[50]);    MULADD(at[10], at[49]);    MULADD(at[11], at[48]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[60]);    MULADD(at[1], at[59]);    MULADD(at[2], at[58]);    MULADD(at[3], at[57]);    MULADD(at[4], at[56]);    MULADD(at[5], at[55]);    MULADD(at[6], at[54]);    MULADD(at[7], at[53]);    MULADD(at[8], at[52]);    MULADD(at[9], at[51]);    MULADD(at[10], at[50]);    MULADD(at[11], at[49]);    MULADD(at[12], at[48]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[61]);    MULADD(at[1], at[60]);    MULADD(at[2], at[59]);    MULADD(at[3], at[58]);    MULADD(at[4], at[57]);    MULADD(at[5], at[56]);    MULADD(at[6], at[55]);    MULADD(at[7], at[54]);    MULADD(at[8], at[53]);    MULADD(at[9], at[52]);    MULADD(at[10], at[51]);    MULADD(at[11], at[50]);    MULADD(at[12], at[49]);    MULADD(at[13], at[48]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[62]);    MULADD(at[1], at[61]);    MULADD(at[2], at[60]);    MULADD(at[3], at[59]);    MULADD(at[4], at[58]);    MULADD(at[5], at[57]);    MULADD(at[6], at[56]);    MULADD(at[7], at[55]);    MULADD(at[8], at[54]);    MULADD(at[9], at[53]);    MULADD(at[10], at[52]);    MULADD(at[11], at[51]);    MULADD(at[12], at[50]);    MULADD(at[13], at[49]);    MULADD(at[14], at[48]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[63]);    MULADD(at[1], at[62]);    MULADD(at[2], at[61]);    MULADD(at[3], at[60]);    MULADD(at[4], at[59]);    MULADD(at[5], at[58]);    MULADD(at[6], at[57]);    MULADD(at[7], at[56]);    MULADD(at[8], at[55]);    MULADD(at[9], at[54]);    MULADD(at[10], at[53]);    MULADD(at[11], at[52]);    MULADD(at[12], at[51]);    MULADD(at[13], at[50]);    MULADD(at[14], at[49]);    MULADD(at[15], at[48]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[64]);    MULADD(at[1], at[63]);    MULADD(at[2], at[62]);    MULADD(at[3], at[61]);    MULADD(at[4], at[60]);    MULADD(at[5], at[59]);    MULADD(at[6], at[58]);    MULADD(at[7], at[57]);    MULADD(at[8], at[56]);    MULADD(at[9], at[55]);    MULADD(at[10], at[54]);    MULADD(at[11], at[53]);    MULADD(at[12], at[52]);    MULADD(at[13], at[51]);    MULADD(at[14], at[50]);    MULADD(at[15], at[49]);    MULADD(at[16], at[48]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[65]);    MULADD(at[1], at[64]);    MULADD(at[2], at[63]);    MULADD(at[3], at[62]);    MULADD(at[4], at[61]);    MULADD(at[5], at[60]);    MULADD(at[6], at[59]);    MULADD(at[7], at[58]);    MULADD(at[8], at[57]);    MULADD(at[9], at[56]);    MULADD(at[10], at[55]);    MULADD(at[11], at[54]);    MULADD(at[12], at[53]);    MULADD(at[13], at[52]);    MULADD(at[14], at[51]);    MULADD(at[15], at[50]);    MULADD(at[16], at[49]);    MULADD(at[17], at[48]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[66]);    MULADD(at[1], at[65]);    MULADD(at[2], at[64]);    MULADD(at[3], at[63]);    MULADD(at[4], at[62]);    MULADD(at[5], at[61]);    MULADD(at[6], at[60]);    MULADD(at[7], at[59]);    MULADD(at[8], at[58]);    MULADD(at[9], at[57]);    MULADD(at[10], at[56]);    MULADD(at[11], at[55]);    MULADD(at[12], at[54]);    MULADD(at[13], at[53]);    MULADD(at[14], at[52]);    MULADD(at[15], at[51]);    MULADD(at[16], at[50]);    MULADD(at[17], at[49]);    MULADD(at[18], at[48]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[67]);    MULADD(at[1], at[66]);    MULADD(at[2], at[65]);    MULADD(at[3], at[64]);    MULADD(at[4], at[63]);    MULADD(at[5], at[62]);    MULADD(at[6], at[61]);    MULADD(at[7], at[60]);    MULADD(at[8], at[59]);    MULADD(at[9], at[58]);    MULADD(at[10], at[57]);    MULADD(at[11], at[56]);    MULADD(at[12], at[55]);    MULADD(at[13], at[54]);    MULADD(at[14], at[53]);    MULADD(at[15], at[52]);    MULADD(at[16], at[51]);    MULADD(at[17], at[50]);    MULADD(at[18], at[49]);    MULADD(at[19], at[48]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[68]);    MULADD(at[1], at[67]);    MULADD(at[2], at[66]);    MULADD(at[3], at[65]);    MULADD(at[4], at[64]);    MULADD(at[5], at[63]);    MULADD(at[6], at[62]);    MULADD(at[7], at[61]);    MULADD(at[8], at[60]);    MULADD(at[9], at[59]);    MULADD(at[10], at[58]);    MULADD(at[11], at[57]);    MULADD(at[12], at[56]);    MULADD(at[13], at[55]);    MULADD(at[14], at[54]);    MULADD(at[15], at[53]);    MULADD(at[16], at[52]);    MULADD(at[17], at[51]);    MULADD(at[18], at[50]);    MULADD(at[19], at[49]);    MULADD(at[20], at[48]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[69]);    MULADD(at[1], at[68]);    MULADD(at[2], at[67]);    MULADD(at[3], at[66]);    MULADD(at[4], at[65]);    MULADD(at[5], at[64]);    MULADD(at[6], at[63]);    MULADD(at[7], at[62]);    MULADD(at[8], at[61]);    MULADD(at[9], at[60]);    MULADD(at[10], at[59]);    MULADD(at[11], at[58]);    MULADD(at[12], at[57]);    MULADD(at[13], at[56]);    MULADD(at[14], at[55]);    MULADD(at[15], at[54]);    MULADD(at[16], at[53]);    MULADD(at[17], at[52]);    MULADD(at[18], at[51]);    MULADD(at[19], at[50]);    MULADD(at[20], at[49]);    MULADD(at[21], at[48]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[70]);    MULADD(at[1], at[69]);    MULADD(at[2], at[68]);    MULADD(at[3], at[67]);    MULADD(at[4], at[66]);    MULADD(at[5], at[65]);    MULADD(at[6], at[64]);    MULADD(at[7], at[63]);    MULADD(at[8], at[62]);    MULADD(at[9], at[61]);    MULADD(at[10], at[60]);    MULADD(at[11], at[59]);    MULADD(at[12], at[58]);    MULADD(at[13], at[57]);    MULADD(at[14], at[56]);    MULADD(at[15], at[55]);    MULADD(at[16], at[54]);    MULADD(at[17], at[53]);    MULADD(at[18], at[52]);    MULADD(at[19], at[51]);    MULADD(at[20], at[50]);    MULADD(at[21], at[49]);    MULADD(at[22], at[48]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[71]);    MULADD(at[1], at[70]);    MULADD(at[2], at[69]);    MULADD(at[3], at[68]);    MULADD(at[4], at[67]);    MULADD(at[5], at[66]);    MULADD(at[6], at[65]);    MULADD(at[7], at[64]);    MULADD(at[8], at[63]);    MULADD(at[9], at[62]);    MULADD(at[10], at[61]);    MULADD(at[11], at[60]);    MULADD(at[12], at[59]);    MULADD(at[13], at[58]);    MULADD(at[14], at[57]);    MULADD(at[15], at[56]);    MULADD(at[16], at[55]);    MULADD(at[17], at[54]);    MULADD(at[18], at[53]);    MULADD(at[19], at[52]);    MULADD(at[20], at[51]);    MULADD(at[21], at[50]);    MULADD(at[22], at[49]);    MULADD(at[23], at[48]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[72]);    MULADD(at[1], at[71]);    MULADD(at[2], at[70]);    MULADD(at[3], at[69]);    MULADD(at[4], at[68]);    MULADD(at[5], at[67]);    MULADD(at[6], at[66]);    MULADD(at[7], at[65]);    MULADD(at[8], at[64]);    MULADD(at[9], at[63]);    MULADD(at[10], at[62]);    MULADD(at[11], at[61]);    MULADD(at[12], at[60]);    MULADD(at[13], at[59]);    MULADD(at[14], at[58]);    MULADD(at[15], at[57]);    MULADD(at[16], at[56]);    MULADD(at[17], at[55]);    MULADD(at[18], at[54]);    MULADD(at[19], at[53]);    MULADD(at[20], at[52]);    MULADD(at[21], at[51]);    MULADD(at[22], at[50]);    MULADD(at[23], at[49]);    MULADD(at[24], at[48]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[73]);    MULADD(at[1], at[72]);    MULADD(at[2], at[71]);    MULADD(at[3], at[70]);    MULADD(at[4], at[69]);    MULADD(at[5], at[68]);    MULADD(at[6], at[67]);    MULADD(at[7], at[66]);    MULADD(at[8], at[65]);    MULADD(at[9], at[64]);    MULADD(at[10], at[63]);    MULADD(at[11], at[62]);    MULADD(at[12], at[61]);    MULADD(at[13], at[60]);    MULADD(at[14], at[59]);    MULADD(at[15], at[58]);    MULADD(at[16], at[57]);    MULADD(at[17], at[56]);    MULADD(at[18], at[55]);    MULADD(at[19], at[54]);    MULADD(at[20], at[53]);    MULADD(at[21], at[52]);    MULADD(at[22], at[51]);    MULADD(at[23], at[50]);    MULADD(at[24], at[49]);    MULADD(at[25], at[48]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[74]);    MULADD(at[1], at[73]);    MULADD(at[2], at[72]);    MULADD(at[3], at[71]);    MULADD(at[4], at[70]);    MULADD(at[5], at[69]);    MULADD(at[6], at[68]);    MULADD(at[7], at[67]);    MULADD(at[8], at[66]);    MULADD(at[9], at[65]);    MULADD(at[10], at[64]);    MULADD(at[11], at[63]);    MULADD(at[12], at[62]);    MULADD(at[13], at[61]);    MULADD(at[14], at[60]);    MULADD(at[15], at[59]);    MULADD(at[16], at[58]);    MULADD(at[17], at[57]);    MULADD(at[18], at[56]);    MULADD(at[19], at[55]);    MULADD(at[20], at[54]);    MULADD(at[21], at[53]);    MULADD(at[22], at[52]);    MULADD(at[23], at[51]);    MULADD(at[24], at[50]);    MULADD(at[25], at[49]);    MULADD(at[26], at[48]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[75]);    MULADD(at[1], at[74]);    MULADD(at[2], at[73]);    MULADD(at[3], at[72]);    MULADD(at[4], at[71]);    MULADD(at[5], at[70]);    MULADD(at[6], at[69]);    MULADD(at[7], at[68]);    MULADD(at[8], at[67]);    MULADD(at[9], at[66]);    MULADD(at[10], at[65]);    MULADD(at[11], at[64]);    MULADD(at[12], at[63]);    MULADD(at[13], at[62]);    MULADD(at[14], at[61]);    MULADD(at[15], at[60]);    MULADD(at[16], at[59]);    MULADD(at[17], at[58]);    MULADD(at[18], at[57]);    MULADD(at[19], at[56]);    MULADD(at[20], at[55]);    MULADD(at[21], at[54]);    MULADD(at[22], at[53]);    MULADD(at[23], at[52]);    MULADD(at[24], at[51]);    MULADD(at[25], at[50]);    MULADD(at[26], at[49]);    MULADD(at[27], at[48]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[76]);    MULADD(at[1], at[75]);    MULADD(at[2], at[74]);    MULADD(at[3], at[73]);    MULADD(at[4], at[72]);    MULADD(at[5], at[71]);    MULADD(at[6], at[70]);    MULADD(at[7], at[69]);    MULADD(at[8], at[68]);    MULADD(at[9], at[67]);    MULADD(at[10], at[66]);    MULADD(at[11], at[65]);    MULADD(at[12], at[64]);    MULADD(at[13], at[63]);    MULADD(at[14], at[62]);    MULADD(at[15], at[61]);    MULADD(at[16], at[60]);    MULADD(at[17], at[59]);    MULADD(at[18], at[58]);    MULADD(at[19], at[57]);    MULADD(at[20], at[56]);    MULADD(at[21], at[55]);    MULADD(at[22], at[54]);    MULADD(at[23], at[53]);    MULADD(at[24], at[52]);    MULADD(at[25], at[51]);    MULADD(at[26], at[50]);    MULADD(at[27], at[49]);    MULADD(at[28], at[48]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[77]);    MULADD(at[1], at[76]);    MULADD(at[2], at[75]);    MULADD(at[3], at[74]);    MULADD(at[4], at[73]);    MULADD(at[5], at[72]);    MULADD(at[6], at[71]);    MULADD(at[7], at[70]);    MULADD(at[8], at[69]);    MULADD(at[9], at[68]);    MULADD(at[10], at[67]);    MULADD(at[11], at[66]);    MULADD(at[12], at[65]);    MULADD(at[13], at[64]);    MULADD(at[14], at[63]);    MULADD(at[15], at[62]);    MULADD(at[16], at[61]);    MULADD(at[17], at[60]);    MULADD(at[18], at[59]);    MULADD(at[19], at[58]);    MULADD(at[20], at[57]);    MULADD(at[21], at[56]);    MULADD(at[22], at[55]);    MULADD(at[23], at[54]);    MULADD(at[24], at[53]);    MULADD(at[25], at[52]);    MULADD(at[26], at[51]);    MULADD(at[27], at[50]);    MULADD(at[28], at[49]);    MULADD(at[29], at[48]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[78]);    MULADD(at[1], at[77]);    MULADD(at[2], at[76]);    MULADD(at[3], at[75]);    MULADD(at[4], at[74]);    MULADD(at[5], at[73]);    MULADD(at[6], at[72]);    MULADD(at[7], at[71]);    MULADD(at[8], at[70]);    MULADD(at[9], at[69]);    MULADD(at[10], at[68]);    MULADD(at[11], at[67]);    MULADD(at[12], at[66]);    MULADD(at[13], at[65]);    MULADD(at[14], at[64]);    MULADD(at[15], at[63]);    MULADD(at[16], at[62]);    MULADD(at[17], at[61]);    MULADD(at[18], at[60]);    MULADD(at[19], at[59]);    MULADD(at[20], at[58]);    MULADD(at[21], at[57]);    MULADD(at[22], at[56]);    MULADD(at[23], at[55]);    MULADD(at[24], at[54]);    MULADD(at[25], at[53]);    MULADD(at[26], at[52]);    MULADD(at[27], at[51]);    MULADD(at[28], at[50]);    MULADD(at[29], at[49]);    MULADD(at[30], at[48]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[79]);    MULADD(at[1], at[78]);    MULADD(at[2], at[77]);    MULADD(at[3], at[76]);    MULADD(at[4], at[75]);    MULADD(at[5], at[74]);    MULADD(at[6], at[73]);    MULADD(at[7], at[72]);    MULADD(at[8], at[71]);    MULADD(at[9], at[70]);    MULADD(at[10], at[69]);    MULADD(at[11], at[68]);    MULADD(at[12], at[67]);    MULADD(at[13], at[66]);    MULADD(at[14], at[65]);    MULADD(at[15], at[64]);    MULADD(at[16], at[63]);    MULADD(at[17], at[62]);    MULADD(at[18], at[61]);    MULADD(at[19], at[60]);    MULADD(at[20], at[59]);    MULADD(at[21], at[58]);    MULADD(at[22], at[57]);    MULADD(at[23], at[56]);    MULADD(at[24], at[55]);    MULADD(at[25], at[54]);    MULADD(at[26], at[53]);    MULADD(at[27], at[52]);    MULADD(at[28], at[51]);    MULADD(at[29], at[50]);    MULADD(at[30], at[49]);    MULADD(at[31], at[48]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[80]);    MULADD(at[1], at[79]);    MULADD(at[2], at[78]);    MULADD(at[3], at[77]);    MULADD(at[4], at[76]);    MULADD(at[5], at[75]);    MULADD(at[6], at[74]);    MULADD(at[7], at[73]);    MULADD(at[8], at[72]);    MULADD(at[9], at[71]);    MULADD(at[10], at[70]);    MULADD(at[11], at[69]);    MULADD(at[12], at[68]);    MULADD(at[13], at[67]);    MULADD(at[14], at[66]);    MULADD(at[15], at[65]);    MULADD(at[16], at[64]);    MULADD(at[17], at[63]);    MULADD(at[18], at[62]);    MULADD(at[19], at[61]);    MULADD(at[20], at[60]);    MULADD(at[21], at[59]);    MULADD(at[22], at[58]);    MULADD(at[23], at[57]);    MULADD(at[24], at[56]);    MULADD(at[25], at[55]);    MULADD(at[26], at[54]);    MULADD(at[27], at[53]);    MULADD(at[28], at[52]);    MULADD(at[29], at[51]);    MULADD(at[30], at[50]);    MULADD(at[31], at[49]);    MULADD(at[32], at[48]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[81]);    MULADD(at[1], at[80]);    MULADD(at[2], at[79]);    MULADD(at[3], at[78]);    MULADD(at[4], at[77]);    MULADD(at[5], at[76]);    MULADD(at[6], at[75]);    MULADD(at[7], at[74]);    MULADD(at[8], at[73]);    MULADD(at[9], at[72]);    MULADD(at[10], at[71]);    MULADD(at[11], at[70]);    MULADD(at[12], at[69]);    MULADD(at[13], at[68]);    MULADD(at[14], at[67]);    MULADD(at[15], at[66]);    MULADD(at[16], at[65]);    MULADD(at[17], at[64]);    MULADD(at[18], at[63]);    MULADD(at[19], at[62]);    MULADD(at[20], at[61]);    MULADD(at[21], at[60]);    MULADD(at[22], at[59]);    MULADD(at[23], at[58]);    MULADD(at[24], at[57]);    MULADD(at[25], at[56]);    MULADD(at[26], at[55]);    MULADD(at[27], at[54]);    MULADD(at[28], at[53]);    MULADD(at[29], at[52]);    MULADD(at[30], at[51]);    MULADD(at[31], at[50]);    MULADD(at[32], at[49]);    MULADD(at[33], at[48]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[82]);    MULADD(at[1], at[81]);    MULADD(at[2], at[80]);    MULADD(at[3], at[79]);    MULADD(at[4], at[78]);    MULADD(at[5], at[77]);    MULADD(at[6], at[76]);    MULADD(at[7], at[75]);    MULADD(at[8], at[74]);    MULADD(at[9], at[73]);    MULADD(at[10], at[72]);    MULADD(at[11], at[71]);    MULADD(at[12], at[70]);    MULADD(at[13], at[69]);    MULADD(at[14], at[68]);    MULADD(at[15], at[67]);    MULADD(at[16], at[66]);    MULADD(at[17], at[65]);    MULADD(at[18], at[64]);    MULADD(at[19], at[63]);    MULADD(at[20], at[62]);    MULADD(at[21], at[61]);    MULADD(at[22], at[60]);    MULADD(at[23], at[59]);    MULADD(at[24], at[58]);    MULADD(at[25], at[57]);    MULADD(at[26], at[56]);    MULADD(at[27], at[55]);    MULADD(at[28], at[54]);    MULADD(at[29], at[53]);    MULADD(at[30], at[52]);    MULADD(at[31], at[51]);    MULADD(at[32], at[50]);    MULADD(at[33], at[49]);    MULADD(at[34], at[48]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[83]);    MULADD(at[1], at[82]);    MULADD(at[2], at[81]);    MULADD(at[3], at[80]);    MULADD(at[4], at[79]);    MULADD(at[5], at[78]);    MULADD(at[6], at[77]);    MULADD(at[7], at[76]);    MULADD(at[8], at[75]);    MULADD(at[9], at[74]);    MULADD(at[10], at[73]);    MULADD(at[11], at[72]);    MULADD(at[12], at[71]);    MULADD(at[13], at[70]);    MULADD(at[14], at[69]);    MULADD(at[15], at[68]);    MULADD(at[16], at[67]);    MULADD(at[17], at[66]);    MULADD(at[18], at[65]);    MULADD(at[19], at[64]);    MULADD(at[20], at[63]);    MULADD(at[21], at[62]);    MULADD(at[22], at[61]);    MULADD(at[23], at[60]);    MULADD(at[24], at[59]);    MULADD(at[25], at[58]);    MULADD(at[26], at[57]);    MULADD(at[27], at[56]);    MULADD(at[28], at[55]);    MULADD(at[29], at[54]);    MULADD(at[30], at[53]);    MULADD(at[31], at[52]);    MULADD(at[32], at[51]);    MULADD(at[33], at[50]);    MULADD(at[34], at[49]);    MULADD(at[35], at[48]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[84]);    MULADD(at[1], at[83]);    MULADD(at[2], at[82]);    MULADD(at[3], at[81]);    MULADD(at[4], at[80]);    MULADD(at[5], at[79]);    MULADD(at[6], at[78]);    MULADD(at[7], at[77]);    MULADD(at[8], at[76]);    MULADD(at[9], at[75]);    MULADD(at[10], at[74]);    MULADD(at[11], at[73]);    MULADD(at[12], at[72]);    MULADD(at[13], at[71]);    MULADD(at[14], at[70]);    MULADD(at[15], at[69]);    MULADD(at[16], at[68]);    MULADD(at[17], at[67]);    MULADD(at[18], at[66]);    MULADD(at[19], at[65]);    MULADD(at[20], at[64]);    MULADD(at[21], at[63]);    MULADD(at[22], at[62]);    MULADD(at[23], at[61]);    MULADD(at[24], at[60]);    MULADD(at[25], at[59]);    MULADD(at[26], at[58]);    MULADD(at[27], at[57]);    MULADD(at[28], at[56]);    MULADD(at[29], at[55]);    MULADD(at[30], at[54]);    MULADD(at[31], at[53]);    MULADD(at[32], at[52]);    MULADD(at[33], at[51]);    MULADD(at[34], at[50]);    MULADD(at[35], at[49]);    MULADD(at[36], at[48]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[85]);    MULADD(at[1], at[84]);    MULADD(at[2], at[83]);    MULADD(at[3], at[82]);    MULADD(at[4], at[81]);    MULADD(at[5], at[80]);    MULADD(at[6], at[79]);    MULADD(at[7], at[78]);    MULADD(at[8], at[77]);    MULADD(at[9], at[76]);    MULADD(at[10], at[75]);    MULADD(at[11], at[74]);    MULADD(at[12], at[73]);    MULADD(at[13], at[72]);    MULADD(at[14], at[71]);    MULADD(at[15], at[70]);    MULADD(at[16], at[69]);    MULADD(at[17], at[68]);    MULADD(at[18], at[67]);    MULADD(at[19], at[66]);    MULADD(at[20], at[65]);    MULADD(at[21], at[64]);    MULADD(at[22], at[63]);    MULADD(at[23], at[62]);    MULADD(at[24], at[61]);    MULADD(at[25], at[60]);    MULADD(at[26], at[59]);    MULADD(at[27], at[58]);    MULADD(at[28], at[57]);    MULADD(at[29], at[56]);    MULADD(at[30], at[55]);    MULADD(at[31], at[54]);    MULADD(at[32], at[53]);    MULADD(at[33], at[52]);    MULADD(at[34], at[51]);    MULADD(at[35], at[50]);    MULADD(at[36], at[49]);    MULADD(at[37], at[48]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[86]);    MULADD(at[1], at[85]);    MULADD(at[2], at[84]);    MULADD(at[3], at[83]);    MULADD(at[4], at[82]);    MULADD(at[5], at[81]);    MULADD(at[6], at[80]);    MULADD(at[7], at[79]);    MULADD(at[8], at[78]);    MULADD(at[9], at[77]);    MULADD(at[10], at[76]);    MULADD(at[11], at[75]);    MULADD(at[12], at[74]);    MULADD(at[13], at[73]);    MULADD(at[14], at[72]);    MULADD(at[15], at[71]);    MULADD(at[16], at[70]);    MULADD(at[17], at[69]);    MULADD(at[18], at[68]);    MULADD(at[19], at[67]);    MULADD(at[20], at[66]);    MULADD(at[21], at[65]);    MULADD(at[22], at[64]);    MULADD(at[23], at[63]);    MULADD(at[24], at[62]);    MULADD(at[25], at[61]);    MULADD(at[26], at[60]);    MULADD(at[27], at[59]);    MULADD(at[28], at[58]);    MULADD(at[29], at[57]);    MULADD(at[30], at[56]);    MULADD(at[31], at[55]);    MULADD(at[32], at[54]);    MULADD(at[33], at[53]);    MULADD(at[34], at[52]);    MULADD(at[35], at[51]);    MULADD(at[36], at[50]);    MULADD(at[37], at[49]);    MULADD(at[38], at[48]); 
+   COMBA_STORE(C->dp[38]);
+   /* 39 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[87]);    MULADD(at[1], at[86]);    MULADD(at[2], at[85]);    MULADD(at[3], at[84]);    MULADD(at[4], at[83]);    MULADD(at[5], at[82]);    MULADD(at[6], at[81]);    MULADD(at[7], at[80]);    MULADD(at[8], at[79]);    MULADD(at[9], at[78]);    MULADD(at[10], at[77]);    MULADD(at[11], at[76]);    MULADD(at[12], at[75]);    MULADD(at[13], at[74]);    MULADD(at[14], at[73]);    MULADD(at[15], at[72]);    MULADD(at[16], at[71]);    MULADD(at[17], at[70]);    MULADD(at[18], at[69]);    MULADD(at[19], at[68]);    MULADD(at[20], at[67]);    MULADD(at[21], at[66]);    MULADD(at[22], at[65]);    MULADD(at[23], at[64]);    MULADD(at[24], at[63]);    MULADD(at[25], at[62]);    MULADD(at[26], at[61]);    MULADD(at[27], at[60]);    MULADD(at[28], at[59]);    MULADD(at[29], at[58]);    MULADD(at[30], at[57]);    MULADD(at[31], at[56]);    MULADD(at[32], at[55]);    MULADD(at[33], at[54]);    MULADD(at[34], at[53]);    MULADD(at[35], at[52]);    MULADD(at[36], at[51]);    MULADD(at[37], at[50]);    MULADD(at[38], at[49]);    MULADD(at[39], at[48]); 
+   COMBA_STORE(C->dp[39]);
+   /* 40 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[88]);    MULADD(at[1], at[87]);    MULADD(at[2], at[86]);    MULADD(at[3], at[85]);    MULADD(at[4], at[84]);    MULADD(at[5], at[83]);    MULADD(at[6], at[82]);    MULADD(at[7], at[81]);    MULADD(at[8], at[80]);    MULADD(at[9], at[79]);    MULADD(at[10], at[78]);    MULADD(at[11], at[77]);    MULADD(at[12], at[76]);    MULADD(at[13], at[75]);    MULADD(at[14], at[74]);    MULADD(at[15], at[73]);    MULADD(at[16], at[72]);    MULADD(at[17], at[71]);    MULADD(at[18], at[70]);    MULADD(at[19], at[69]);    MULADD(at[20], at[68]);    MULADD(at[21], at[67]);    MULADD(at[22], at[66]);    MULADD(at[23], at[65]);    MULADD(at[24], at[64]);    MULADD(at[25], at[63]);    MULADD(at[26], at[62]);    MULADD(at[27], at[61]);    MULADD(at[28], at[60]);    MULADD(at[29], at[59]);    MULADD(at[30], at[58]);    MULADD(at[31], at[57]);    MULADD(at[32], at[56]);    MULADD(at[33], at[55]);    MULADD(at[34], at[54]);    MULADD(at[35], at[53]);    MULADD(at[36], at[52]);    MULADD(at[37], at[51]);    MULADD(at[38], at[50]);    MULADD(at[39], at[49]);    MULADD(at[40], at[48]); 
+   COMBA_STORE(C->dp[40]);
+   /* 41 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[89]);    MULADD(at[1], at[88]);    MULADD(at[2], at[87]);    MULADD(at[3], at[86]);    MULADD(at[4], at[85]);    MULADD(at[5], at[84]);    MULADD(at[6], at[83]);    MULADD(at[7], at[82]);    MULADD(at[8], at[81]);    MULADD(at[9], at[80]);    MULADD(at[10], at[79]);    MULADD(at[11], at[78]);    MULADD(at[12], at[77]);    MULADD(at[13], at[76]);    MULADD(at[14], at[75]);    MULADD(at[15], at[74]);    MULADD(at[16], at[73]);    MULADD(at[17], at[72]);    MULADD(at[18], at[71]);    MULADD(at[19], at[70]);    MULADD(at[20], at[69]);    MULADD(at[21], at[68]);    MULADD(at[22], at[67]);    MULADD(at[23], at[66]);    MULADD(at[24], at[65]);    MULADD(at[25], at[64]);    MULADD(at[26], at[63]);    MULADD(at[27], at[62]);    MULADD(at[28], at[61]);    MULADD(at[29], at[60]);    MULADD(at[30], at[59]);    MULADD(at[31], at[58]);    MULADD(at[32], at[57]);    MULADD(at[33], at[56]);    MULADD(at[34], at[55]);    MULADD(at[35], at[54]);    MULADD(at[36], at[53]);    MULADD(at[37], at[52]);    MULADD(at[38], at[51]);    MULADD(at[39], at[50]);    MULADD(at[40], at[49]);    MULADD(at[41], at[48]); 
+   COMBA_STORE(C->dp[41]);
+   /* 42 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[90]);    MULADD(at[1], at[89]);    MULADD(at[2], at[88]);    MULADD(at[3], at[87]);    MULADD(at[4], at[86]);    MULADD(at[5], at[85]);    MULADD(at[6], at[84]);    MULADD(at[7], at[83]);    MULADD(at[8], at[82]);    MULADD(at[9], at[81]);    MULADD(at[10], at[80]);    MULADD(at[11], at[79]);    MULADD(at[12], at[78]);    MULADD(at[13], at[77]);    MULADD(at[14], at[76]);    MULADD(at[15], at[75]);    MULADD(at[16], at[74]);    MULADD(at[17], at[73]);    MULADD(at[18], at[72]);    MULADD(at[19], at[71]);    MULADD(at[20], at[70]);    MULADD(at[21], at[69]);    MULADD(at[22], at[68]);    MULADD(at[23], at[67]);    MULADD(at[24], at[66]);    MULADD(at[25], at[65]);    MULADD(at[26], at[64]);    MULADD(at[27], at[63]);    MULADD(at[28], at[62]);    MULADD(at[29], at[61]);    MULADD(at[30], at[60]);    MULADD(at[31], at[59]);    MULADD(at[32], at[58]);    MULADD(at[33], at[57]);    MULADD(at[34], at[56]);    MULADD(at[35], at[55]);    MULADD(at[36], at[54]);    MULADD(at[37], at[53]);    MULADD(at[38], at[52]);    MULADD(at[39], at[51]);    MULADD(at[40], at[50]);    MULADD(at[41], at[49]);    MULADD(at[42], at[48]); 
+   COMBA_STORE(C->dp[42]);
+   /* 43 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[91]);    MULADD(at[1], at[90]);    MULADD(at[2], at[89]);    MULADD(at[3], at[88]);    MULADD(at[4], at[87]);    MULADD(at[5], at[86]);    MULADD(at[6], at[85]);    MULADD(at[7], at[84]);    MULADD(at[8], at[83]);    MULADD(at[9], at[82]);    MULADD(at[10], at[81]);    MULADD(at[11], at[80]);    MULADD(at[12], at[79]);    MULADD(at[13], at[78]);    MULADD(at[14], at[77]);    MULADD(at[15], at[76]);    MULADD(at[16], at[75]);    MULADD(at[17], at[74]);    MULADD(at[18], at[73]);    MULADD(at[19], at[72]);    MULADD(at[20], at[71]);    MULADD(at[21], at[70]);    MULADD(at[22], at[69]);    MULADD(at[23], at[68]);    MULADD(at[24], at[67]);    MULADD(at[25], at[66]);    MULADD(at[26], at[65]);    MULADD(at[27], at[64]);    MULADD(at[28], at[63]);    MULADD(at[29], at[62]);    MULADD(at[30], at[61]);    MULADD(at[31], at[60]);    MULADD(at[32], at[59]);    MULADD(at[33], at[58]);    MULADD(at[34], at[57]);    MULADD(at[35], at[56]);    MULADD(at[36], at[55]);    MULADD(at[37], at[54]);    MULADD(at[38], at[53]);    MULADD(at[39], at[52]);    MULADD(at[40], at[51]);    MULADD(at[41], at[50]);    MULADD(at[42], at[49]);    MULADD(at[43], at[48]); 
+   COMBA_STORE(C->dp[43]);
+   /* 44 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[92]);    MULADD(at[1], at[91]);    MULADD(at[2], at[90]);    MULADD(at[3], at[89]);    MULADD(at[4], at[88]);    MULADD(at[5], at[87]);    MULADD(at[6], at[86]);    MULADD(at[7], at[85]);    MULADD(at[8], at[84]);    MULADD(at[9], at[83]);    MULADD(at[10], at[82]);    MULADD(at[11], at[81]);    MULADD(at[12], at[80]);    MULADD(at[13], at[79]);    MULADD(at[14], at[78]);    MULADD(at[15], at[77]);    MULADD(at[16], at[76]);    MULADD(at[17], at[75]);    MULADD(at[18], at[74]);    MULADD(at[19], at[73]);    MULADD(at[20], at[72]);    MULADD(at[21], at[71]);    MULADD(at[22], at[70]);    MULADD(at[23], at[69]);    MULADD(at[24], at[68]);    MULADD(at[25], at[67]);    MULADD(at[26], at[66]);    MULADD(at[27], at[65]);    MULADD(at[28], at[64]);    MULADD(at[29], at[63]);    MULADD(at[30], at[62]);    MULADD(at[31], at[61]);    MULADD(at[32], at[60]);    MULADD(at[33], at[59]);    MULADD(at[34], at[58]);    MULADD(at[35], at[57]);    MULADD(at[36], at[56]);    MULADD(at[37], at[55]);    MULADD(at[38], at[54]);    MULADD(at[39], at[53]);    MULADD(at[40], at[52]);    MULADD(at[41], at[51]);    MULADD(at[42], at[50]);    MULADD(at[43], at[49]);    MULADD(at[44], at[48]); 
+   COMBA_STORE(C->dp[44]);
+   /* 45 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[93]);    MULADD(at[1], at[92]);    MULADD(at[2], at[91]);    MULADD(at[3], at[90]);    MULADD(at[4], at[89]);    MULADD(at[5], at[88]);    MULADD(at[6], at[87]);    MULADD(at[7], at[86]);    MULADD(at[8], at[85]);    MULADD(at[9], at[84]);    MULADD(at[10], at[83]);    MULADD(at[11], at[82]);    MULADD(at[12], at[81]);    MULADD(at[13], at[80]);    MULADD(at[14], at[79]);    MULADD(at[15], at[78]);    MULADD(at[16], at[77]);    MULADD(at[17], at[76]);    MULADD(at[18], at[75]);    MULADD(at[19], at[74]);    MULADD(at[20], at[73]);    MULADD(at[21], at[72]);    MULADD(at[22], at[71]);    MULADD(at[23], at[70]);    MULADD(at[24], at[69]);    MULADD(at[25], at[68]);    MULADD(at[26], at[67]);    MULADD(at[27], at[66]);    MULADD(at[28], at[65]);    MULADD(at[29], at[64]);    MULADD(at[30], at[63]);    MULADD(at[31], at[62]);    MULADD(at[32], at[61]);    MULADD(at[33], at[60]);    MULADD(at[34], at[59]);    MULADD(at[35], at[58]);    MULADD(at[36], at[57]);    MULADD(at[37], at[56]);    MULADD(at[38], at[55]);    MULADD(at[39], at[54]);    MULADD(at[40], at[53]);    MULADD(at[41], at[52]);    MULADD(at[42], at[51]);    MULADD(at[43], at[50]);    MULADD(at[44], at[49]);    MULADD(at[45], at[48]); 
+   COMBA_STORE(C->dp[45]);
+   /* 46 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[94]);    MULADD(at[1], at[93]);    MULADD(at[2], at[92]);    MULADD(at[3], at[91]);    MULADD(at[4], at[90]);    MULADD(at[5], at[89]);    MULADD(at[6], at[88]);    MULADD(at[7], at[87]);    MULADD(at[8], at[86]);    MULADD(at[9], at[85]);    MULADD(at[10], at[84]);    MULADD(at[11], at[83]);    MULADD(at[12], at[82]);    MULADD(at[13], at[81]);    MULADD(at[14], at[80]);    MULADD(at[15], at[79]);    MULADD(at[16], at[78]);    MULADD(at[17], at[77]);    MULADD(at[18], at[76]);    MULADD(at[19], at[75]);    MULADD(at[20], at[74]);    MULADD(at[21], at[73]);    MULADD(at[22], at[72]);    MULADD(at[23], at[71]);    MULADD(at[24], at[70]);    MULADD(at[25], at[69]);    MULADD(at[26], at[68]);    MULADD(at[27], at[67]);    MULADD(at[28], at[66]);    MULADD(at[29], at[65]);    MULADD(at[30], at[64]);    MULADD(at[31], at[63]);    MULADD(at[32], at[62]);    MULADD(at[33], at[61]);    MULADD(at[34], at[60]);    MULADD(at[35], at[59]);    MULADD(at[36], at[58]);    MULADD(at[37], at[57]);    MULADD(at[38], at[56]);    MULADD(at[39], at[55]);    MULADD(at[40], at[54]);    MULADD(at[41], at[53]);    MULADD(at[42], at[52]);    MULADD(at[43], at[51]);    MULADD(at[44], at[50]);    MULADD(at[45], at[49]);    MULADD(at[46], at[48]); 
+   COMBA_STORE(C->dp[46]);
+   /* 47 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[95]);    MULADD(at[1], at[94]);    MULADD(at[2], at[93]);    MULADD(at[3], at[92]);    MULADD(at[4], at[91]);    MULADD(at[5], at[90]);    MULADD(at[6], at[89]);    MULADD(at[7], at[88]);    MULADD(at[8], at[87]);    MULADD(at[9], at[86]);    MULADD(at[10], at[85]);    MULADD(at[11], at[84]);    MULADD(at[12], at[83]);    MULADD(at[13], at[82]);    MULADD(at[14], at[81]);    MULADD(at[15], at[80]);    MULADD(at[16], at[79]);    MULADD(at[17], at[78]);    MULADD(at[18], at[77]);    MULADD(at[19], at[76]);    MULADD(at[20], at[75]);    MULADD(at[21], at[74]);    MULADD(at[22], at[73]);    MULADD(at[23], at[72]);    MULADD(at[24], at[71]);    MULADD(at[25], at[70]);    MULADD(at[26], at[69]);    MULADD(at[27], at[68]);    MULADD(at[28], at[67]);    MULADD(at[29], at[66]);    MULADD(at[30], at[65]);    MULADD(at[31], at[64]);    MULADD(at[32], at[63]);    MULADD(at[33], at[62]);    MULADD(at[34], at[61]);    MULADD(at[35], at[60]);    MULADD(at[36], at[59]);    MULADD(at[37], at[58]);    MULADD(at[38], at[57]);    MULADD(at[39], at[56]);    MULADD(at[40], at[55]);    MULADD(at[41], at[54]);    MULADD(at[42], at[53]);    MULADD(at[43], at[52]);    MULADD(at[44], at[51]);    MULADD(at[45], at[50]);    MULADD(at[46], at[49]);    MULADD(at[47], at[48]); 
+   COMBA_STORE(C->dp[47]);
+   /* 48 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[95]);    MULADD(at[2], at[94]);    MULADD(at[3], at[93]);    MULADD(at[4], at[92]);    MULADD(at[5], at[91]);    MULADD(at[6], at[90]);    MULADD(at[7], at[89]);    MULADD(at[8], at[88]);    MULADD(at[9], at[87]);    MULADD(at[10], at[86]);    MULADD(at[11], at[85]);    MULADD(at[12], at[84]);    MULADD(at[13], at[83]);    MULADD(at[14], at[82]);    MULADD(at[15], at[81]);    MULADD(at[16], at[80]);    MULADD(at[17], at[79]);    MULADD(at[18], at[78]);    MULADD(at[19], at[77]);    MULADD(at[20], at[76]);    MULADD(at[21], at[75]);    MULADD(at[22], at[74]);    MULADD(at[23], at[73]);    MULADD(at[24], at[72]);    MULADD(at[25], at[71]);    MULADD(at[26], at[70]);    MULADD(at[27], at[69]);    MULADD(at[28], at[68]);    MULADD(at[29], at[67]);    MULADD(at[30], at[66]);    MULADD(at[31], at[65]);    MULADD(at[32], at[64]);    MULADD(at[33], at[63]);    MULADD(at[34], at[62]);    MULADD(at[35], at[61]);    MULADD(at[36], at[60]);    MULADD(at[37], at[59]);    MULADD(at[38], at[58]);    MULADD(at[39], at[57]);    MULADD(at[40], at[56]);    MULADD(at[41], at[55]);    MULADD(at[42], at[54]);    MULADD(at[43], at[53]);    MULADD(at[44], at[52]);    MULADD(at[45], at[51]);    MULADD(at[46], at[50]);    MULADD(at[47], at[49]); 
+   COMBA_STORE(C->dp[48]);
+   /* 49 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[95]);    MULADD(at[3], at[94]);    MULADD(at[4], at[93]);    MULADD(at[5], at[92]);    MULADD(at[6], at[91]);    MULADD(at[7], at[90]);    MULADD(at[8], at[89]);    MULADD(at[9], at[88]);    MULADD(at[10], at[87]);    MULADD(at[11], at[86]);    MULADD(at[12], at[85]);    MULADD(at[13], at[84]);    MULADD(at[14], at[83]);    MULADD(at[15], at[82]);    MULADD(at[16], at[81]);    MULADD(at[17], at[80]);    MULADD(at[18], at[79]);    MULADD(at[19], at[78]);    MULADD(at[20], at[77]);    MULADD(at[21], at[76]);    MULADD(at[22], at[75]);    MULADD(at[23], at[74]);    MULADD(at[24], at[73]);    MULADD(at[25], at[72]);    MULADD(at[26], at[71]);    MULADD(at[27], at[70]);    MULADD(at[28], at[69]);    MULADD(at[29], at[68]);    MULADD(at[30], at[67]);    MULADD(at[31], at[66]);    MULADD(at[32], at[65]);    MULADD(at[33], at[64]);    MULADD(at[34], at[63]);    MULADD(at[35], at[62]);    MULADD(at[36], at[61]);    MULADD(at[37], at[60]);    MULADD(at[38], at[59]);    MULADD(at[39], at[58]);    MULADD(at[40], at[57]);    MULADD(at[41], at[56]);    MULADD(at[42], at[55]);    MULADD(at[43], at[54]);    MULADD(at[44], at[53]);    MULADD(at[45], at[52]);    MULADD(at[46], at[51]);    MULADD(at[47], at[50]); 
+   COMBA_STORE(C->dp[49]);
+   /* 50 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[95]);    MULADD(at[4], at[94]);    MULADD(at[5], at[93]);    MULADD(at[6], at[92]);    MULADD(at[7], at[91]);    MULADD(at[8], at[90]);    MULADD(at[9], at[89]);    MULADD(at[10], at[88]);    MULADD(at[11], at[87]);    MULADD(at[12], at[86]);    MULADD(at[13], at[85]);    MULADD(at[14], at[84]);    MULADD(at[15], at[83]);    MULADD(at[16], at[82]);    MULADD(at[17], at[81]);    MULADD(at[18], at[80]);    MULADD(at[19], at[79]);    MULADD(at[20], at[78]);    MULADD(at[21], at[77]);    MULADD(at[22], at[76]);    MULADD(at[23], at[75]);    MULADD(at[24], at[74]);    MULADD(at[25], at[73]);    MULADD(at[26], at[72]);    MULADD(at[27], at[71]);    MULADD(at[28], at[70]);    MULADD(at[29], at[69]);    MULADD(at[30], at[68]);    MULADD(at[31], at[67]);    MULADD(at[32], at[66]);    MULADD(at[33], at[65]);    MULADD(at[34], at[64]);    MULADD(at[35], at[63]);    MULADD(at[36], at[62]);    MULADD(at[37], at[61]);    MULADD(at[38], at[60]);    MULADD(at[39], at[59]);    MULADD(at[40], at[58]);    MULADD(at[41], at[57]);    MULADD(at[42], at[56]);    MULADD(at[43], at[55]);    MULADD(at[44], at[54]);    MULADD(at[45], at[53]);    MULADD(at[46], at[52]);    MULADD(at[47], at[51]); 
+   COMBA_STORE(C->dp[50]);
+   /* 51 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[95]);    MULADD(at[5], at[94]);    MULADD(at[6], at[93]);    MULADD(at[7], at[92]);    MULADD(at[8], at[91]);    MULADD(at[9], at[90]);    MULADD(at[10], at[89]);    MULADD(at[11], at[88]);    MULADD(at[12], at[87]);    MULADD(at[13], at[86]);    MULADD(at[14], at[85]);    MULADD(at[15], at[84]);    MULADD(at[16], at[83]);    MULADD(at[17], at[82]);    MULADD(at[18], at[81]);    MULADD(at[19], at[80]);    MULADD(at[20], at[79]);    MULADD(at[21], at[78]);    MULADD(at[22], at[77]);    MULADD(at[23], at[76]);    MULADD(at[24], at[75]);    MULADD(at[25], at[74]);    MULADD(at[26], at[73]);    MULADD(at[27], at[72]);    MULADD(at[28], at[71]);    MULADD(at[29], at[70]);    MULADD(at[30], at[69]);    MULADD(at[31], at[68]);    MULADD(at[32], at[67]);    MULADD(at[33], at[66]);    MULADD(at[34], at[65]);    MULADD(at[35], at[64]);    MULADD(at[36], at[63]);    MULADD(at[37], at[62]);    MULADD(at[38], at[61]);    MULADD(at[39], at[60]);    MULADD(at[40], at[59]);    MULADD(at[41], at[58]);    MULADD(at[42], at[57]);    MULADD(at[43], at[56]);    MULADD(at[44], at[55]);    MULADD(at[45], at[54]);    MULADD(at[46], at[53]);    MULADD(at[47], at[52]); 
+   COMBA_STORE(C->dp[51]);
+   /* 52 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[95]);    MULADD(at[6], at[94]);    MULADD(at[7], at[93]);    MULADD(at[8], at[92]);    MULADD(at[9], at[91]);    MULADD(at[10], at[90]);    MULADD(at[11], at[89]);    MULADD(at[12], at[88]);    MULADD(at[13], at[87]);    MULADD(at[14], at[86]);    MULADD(at[15], at[85]);    MULADD(at[16], at[84]);    MULADD(at[17], at[83]);    MULADD(at[18], at[82]);    MULADD(at[19], at[81]);    MULADD(at[20], at[80]);    MULADD(at[21], at[79]);    MULADD(at[22], at[78]);    MULADD(at[23], at[77]);    MULADD(at[24], at[76]);    MULADD(at[25], at[75]);    MULADD(at[26], at[74]);    MULADD(at[27], at[73]);    MULADD(at[28], at[72]);    MULADD(at[29], at[71]);    MULADD(at[30], at[70]);    MULADD(at[31], at[69]);    MULADD(at[32], at[68]);    MULADD(at[33], at[67]);    MULADD(at[34], at[66]);    MULADD(at[35], at[65]);    MULADD(at[36], at[64]);    MULADD(at[37], at[63]);    MULADD(at[38], at[62]);    MULADD(at[39], at[61]);    MULADD(at[40], at[60]);    MULADD(at[41], at[59]);    MULADD(at[42], at[58]);    MULADD(at[43], at[57]);    MULADD(at[44], at[56]);    MULADD(at[45], at[55]);    MULADD(at[46], at[54]);    MULADD(at[47], at[53]); 
+   COMBA_STORE(C->dp[52]);
+   /* 53 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[95]);    MULADD(at[7], at[94]);    MULADD(at[8], at[93]);    MULADD(at[9], at[92]);    MULADD(at[10], at[91]);    MULADD(at[11], at[90]);    MULADD(at[12], at[89]);    MULADD(at[13], at[88]);    MULADD(at[14], at[87]);    MULADD(at[15], at[86]);    MULADD(at[16], at[85]);    MULADD(at[17], at[84]);    MULADD(at[18], at[83]);    MULADD(at[19], at[82]);    MULADD(at[20], at[81]);    MULADD(at[21], at[80]);    MULADD(at[22], at[79]);    MULADD(at[23], at[78]);    MULADD(at[24], at[77]);    MULADD(at[25], at[76]);    MULADD(at[26], at[75]);    MULADD(at[27], at[74]);    MULADD(at[28], at[73]);    MULADD(at[29], at[72]);    MULADD(at[30], at[71]);    MULADD(at[31], at[70]);    MULADD(at[32], at[69]);    MULADD(at[33], at[68]);    MULADD(at[34], at[67]);    MULADD(at[35], at[66]);    MULADD(at[36], at[65]);    MULADD(at[37], at[64]);    MULADD(at[38], at[63]);    MULADD(at[39], at[62]);    MULADD(at[40], at[61]);    MULADD(at[41], at[60]);    MULADD(at[42], at[59]);    MULADD(at[43], at[58]);    MULADD(at[44], at[57]);    MULADD(at[45], at[56]);    MULADD(at[46], at[55]);    MULADD(at[47], at[54]); 
+   COMBA_STORE(C->dp[53]);
+   /* 54 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[95]);    MULADD(at[8], at[94]);    MULADD(at[9], at[93]);    MULADD(at[10], at[92]);    MULADD(at[11], at[91]);    MULADD(at[12], at[90]);    MULADD(at[13], at[89]);    MULADD(at[14], at[88]);    MULADD(at[15], at[87]);    MULADD(at[16], at[86]);    MULADD(at[17], at[85]);    MULADD(at[18], at[84]);    MULADD(at[19], at[83]);    MULADD(at[20], at[82]);    MULADD(at[21], at[81]);    MULADD(at[22], at[80]);    MULADD(at[23], at[79]);    MULADD(at[24], at[78]);    MULADD(at[25], at[77]);    MULADD(at[26], at[76]);    MULADD(at[27], at[75]);    MULADD(at[28], at[74]);    MULADD(at[29], at[73]);    MULADD(at[30], at[72]);    MULADD(at[31], at[71]);    MULADD(at[32], at[70]);    MULADD(at[33], at[69]);    MULADD(at[34], at[68]);    MULADD(at[35], at[67]);    MULADD(at[36], at[66]);    MULADD(at[37], at[65]);    MULADD(at[38], at[64]);    MULADD(at[39], at[63]);    MULADD(at[40], at[62]);    MULADD(at[41], at[61]);    MULADD(at[42], at[60]);    MULADD(at[43], at[59]);    MULADD(at[44], at[58]);    MULADD(at[45], at[57]);    MULADD(at[46], at[56]);    MULADD(at[47], at[55]); 
+   COMBA_STORE(C->dp[54]);
+   /* 55 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[95]);    MULADD(at[9], at[94]);    MULADD(at[10], at[93]);    MULADD(at[11], at[92]);    MULADD(at[12], at[91]);    MULADD(at[13], at[90]);    MULADD(at[14], at[89]);    MULADD(at[15], at[88]);    MULADD(at[16], at[87]);    MULADD(at[17], at[86]);    MULADD(at[18], at[85]);    MULADD(at[19], at[84]);    MULADD(at[20], at[83]);    MULADD(at[21], at[82]);    MULADD(at[22], at[81]);    MULADD(at[23], at[80]);    MULADD(at[24], at[79]);    MULADD(at[25], at[78]);    MULADD(at[26], at[77]);    MULADD(at[27], at[76]);    MULADD(at[28], at[75]);    MULADD(at[29], at[74]);    MULADD(at[30], at[73]);    MULADD(at[31], at[72]);    MULADD(at[32], at[71]);    MULADD(at[33], at[70]);    MULADD(at[34], at[69]);    MULADD(at[35], at[68]);    MULADD(at[36], at[67]);    MULADD(at[37], at[66]);    MULADD(at[38], at[65]);    MULADD(at[39], at[64]);    MULADD(at[40], at[63]);    MULADD(at[41], at[62]);    MULADD(at[42], at[61]);    MULADD(at[43], at[60]);    MULADD(at[44], at[59]);    MULADD(at[45], at[58]);    MULADD(at[46], at[57]);    MULADD(at[47], at[56]); 
+   COMBA_STORE(C->dp[55]);
+   /* 56 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[95]);    MULADD(at[10], at[94]);    MULADD(at[11], at[93]);    MULADD(at[12], at[92]);    MULADD(at[13], at[91]);    MULADD(at[14], at[90]);    MULADD(at[15], at[89]);    MULADD(at[16], at[88]);    MULADD(at[17], at[87]);    MULADD(at[18], at[86]);    MULADD(at[19], at[85]);    MULADD(at[20], at[84]);    MULADD(at[21], at[83]);    MULADD(at[22], at[82]);    MULADD(at[23], at[81]);    MULADD(at[24], at[80]);    MULADD(at[25], at[79]);    MULADD(at[26], at[78]);    MULADD(at[27], at[77]);    MULADD(at[28], at[76]);    MULADD(at[29], at[75]);    MULADD(at[30], at[74]);    MULADD(at[31], at[73]);    MULADD(at[32], at[72]);    MULADD(at[33], at[71]);    MULADD(at[34], at[70]);    MULADD(at[35], at[69]);    MULADD(at[36], at[68]);    MULADD(at[37], at[67]);    MULADD(at[38], at[66]);    MULADD(at[39], at[65]);    MULADD(at[40], at[64]);    MULADD(at[41], at[63]);    MULADD(at[42], at[62]);    MULADD(at[43], at[61]);    MULADD(at[44], at[60]);    MULADD(at[45], at[59]);    MULADD(at[46], at[58]);    MULADD(at[47], at[57]); 
+   COMBA_STORE(C->dp[56]);
+   /* 57 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[95]);    MULADD(at[11], at[94]);    MULADD(at[12], at[93]);    MULADD(at[13], at[92]);    MULADD(at[14], at[91]);    MULADD(at[15], at[90]);    MULADD(at[16], at[89]);    MULADD(at[17], at[88]);    MULADD(at[18], at[87]);    MULADD(at[19], at[86]);    MULADD(at[20], at[85]);    MULADD(at[21], at[84]);    MULADD(at[22], at[83]);    MULADD(at[23], at[82]);    MULADD(at[24], at[81]);    MULADD(at[25], at[80]);    MULADD(at[26], at[79]);    MULADD(at[27], at[78]);    MULADD(at[28], at[77]);    MULADD(at[29], at[76]);    MULADD(at[30], at[75]);    MULADD(at[31], at[74]);    MULADD(at[32], at[73]);    MULADD(at[33], at[72]);    MULADD(at[34], at[71]);    MULADD(at[35], at[70]);    MULADD(at[36], at[69]);    MULADD(at[37], at[68]);    MULADD(at[38], at[67]);    MULADD(at[39], at[66]);    MULADD(at[40], at[65]);    MULADD(at[41], at[64]);    MULADD(at[42], at[63]);    MULADD(at[43], at[62]);    MULADD(at[44], at[61]);    MULADD(at[45], at[60]);    MULADD(at[46], at[59]);    MULADD(at[47], at[58]); 
+   COMBA_STORE(C->dp[57]);
+   /* 58 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[95]);    MULADD(at[12], at[94]);    MULADD(at[13], at[93]);    MULADD(at[14], at[92]);    MULADD(at[15], at[91]);    MULADD(at[16], at[90]);    MULADD(at[17], at[89]);    MULADD(at[18], at[88]);    MULADD(at[19], at[87]);    MULADD(at[20], at[86]);    MULADD(at[21], at[85]);    MULADD(at[22], at[84]);    MULADD(at[23], at[83]);    MULADD(at[24], at[82]);    MULADD(at[25], at[81]);    MULADD(at[26], at[80]);    MULADD(at[27], at[79]);    MULADD(at[28], at[78]);    MULADD(at[29], at[77]);    MULADD(at[30], at[76]);    MULADD(at[31], at[75]);    MULADD(at[32], at[74]);    MULADD(at[33], at[73]);    MULADD(at[34], at[72]);    MULADD(at[35], at[71]);    MULADD(at[36], at[70]);    MULADD(at[37], at[69]);    MULADD(at[38], at[68]);    MULADD(at[39], at[67]);    MULADD(at[40], at[66]);    MULADD(at[41], at[65]);    MULADD(at[42], at[64]);    MULADD(at[43], at[63]);    MULADD(at[44], at[62]);    MULADD(at[45], at[61]);    MULADD(at[46], at[60]);    MULADD(at[47], at[59]); 
+   COMBA_STORE(C->dp[58]);
+   /* 59 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[95]);    MULADD(at[13], at[94]);    MULADD(at[14], at[93]);    MULADD(at[15], at[92]);    MULADD(at[16], at[91]);    MULADD(at[17], at[90]);    MULADD(at[18], at[89]);    MULADD(at[19], at[88]);    MULADD(at[20], at[87]);    MULADD(at[21], at[86]);    MULADD(at[22], at[85]);    MULADD(at[23], at[84]);    MULADD(at[24], at[83]);    MULADD(at[25], at[82]);    MULADD(at[26], at[81]);    MULADD(at[27], at[80]);    MULADD(at[28], at[79]);    MULADD(at[29], at[78]);    MULADD(at[30], at[77]);    MULADD(at[31], at[76]);    MULADD(at[32], at[75]);    MULADD(at[33], at[74]);    MULADD(at[34], at[73]);    MULADD(at[35], at[72]);    MULADD(at[36], at[71]);    MULADD(at[37], at[70]);    MULADD(at[38], at[69]);    MULADD(at[39], at[68]);    MULADD(at[40], at[67]);    MULADD(at[41], at[66]);    MULADD(at[42], at[65]);    MULADD(at[43], at[64]);    MULADD(at[44], at[63]);    MULADD(at[45], at[62]);    MULADD(at[46], at[61]);    MULADD(at[47], at[60]); 
+   COMBA_STORE(C->dp[59]);
+   /* 60 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[95]);    MULADD(at[14], at[94]);    MULADD(at[15], at[93]);    MULADD(at[16], at[92]);    MULADD(at[17], at[91]);    MULADD(at[18], at[90]);    MULADD(at[19], at[89]);    MULADD(at[20], at[88]);    MULADD(at[21], at[87]);    MULADD(at[22], at[86]);    MULADD(at[23], at[85]);    MULADD(at[24], at[84]);    MULADD(at[25], at[83]);    MULADD(at[26], at[82]);    MULADD(at[27], at[81]);    MULADD(at[28], at[80]);    MULADD(at[29], at[79]);    MULADD(at[30], at[78]);    MULADD(at[31], at[77]);    MULADD(at[32], at[76]);    MULADD(at[33], at[75]);    MULADD(at[34], at[74]);    MULADD(at[35], at[73]);    MULADD(at[36], at[72]);    MULADD(at[37], at[71]);    MULADD(at[38], at[70]);    MULADD(at[39], at[69]);    MULADD(at[40], at[68]);    MULADD(at[41], at[67]);    MULADD(at[42], at[66]);    MULADD(at[43], at[65]);    MULADD(at[44], at[64]);    MULADD(at[45], at[63]);    MULADD(at[46], at[62]);    MULADD(at[47], at[61]); 
+   COMBA_STORE(C->dp[60]);
+   /* 61 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[95]);    MULADD(at[15], at[94]);    MULADD(at[16], at[93]);    MULADD(at[17], at[92]);    MULADD(at[18], at[91]);    MULADD(at[19], at[90]);    MULADD(at[20], at[89]);    MULADD(at[21], at[88]);    MULADD(at[22], at[87]);    MULADD(at[23], at[86]);    MULADD(at[24], at[85]);    MULADD(at[25], at[84]);    MULADD(at[26], at[83]);    MULADD(at[27], at[82]);    MULADD(at[28], at[81]);    MULADD(at[29], at[80]);    MULADD(at[30], at[79]);    MULADD(at[31], at[78]);    MULADD(at[32], at[77]);    MULADD(at[33], at[76]);    MULADD(at[34], at[75]);    MULADD(at[35], at[74]);    MULADD(at[36], at[73]);    MULADD(at[37], at[72]);    MULADD(at[38], at[71]);    MULADD(at[39], at[70]);    MULADD(at[40], at[69]);    MULADD(at[41], at[68]);    MULADD(at[42], at[67]);    MULADD(at[43], at[66]);    MULADD(at[44], at[65]);    MULADD(at[45], at[64]);    MULADD(at[46], at[63]);    MULADD(at[47], at[62]); 
+   COMBA_STORE(C->dp[61]);
+   /* 62 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[95]);    MULADD(at[16], at[94]);    MULADD(at[17], at[93]);    MULADD(at[18], at[92]);    MULADD(at[19], at[91]);    MULADD(at[20], at[90]);    MULADD(at[21], at[89]);    MULADD(at[22], at[88]);    MULADD(at[23], at[87]);    MULADD(at[24], at[86]);    MULADD(at[25], at[85]);    MULADD(at[26], at[84]);    MULADD(at[27], at[83]);    MULADD(at[28], at[82]);    MULADD(at[29], at[81]);    MULADD(at[30], at[80]);    MULADD(at[31], at[79]);    MULADD(at[32], at[78]);    MULADD(at[33], at[77]);    MULADD(at[34], at[76]);    MULADD(at[35], at[75]);    MULADD(at[36], at[74]);    MULADD(at[37], at[73]);    MULADD(at[38], at[72]);    MULADD(at[39], at[71]);    MULADD(at[40], at[70]);    MULADD(at[41], at[69]);    MULADD(at[42], at[68]);    MULADD(at[43], at[67]);    MULADD(at[44], at[66]);    MULADD(at[45], at[65]);    MULADD(at[46], at[64]);    MULADD(at[47], at[63]); 
+   COMBA_STORE(C->dp[62]);
+   /* 63 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[95]);    MULADD(at[17], at[94]);    MULADD(at[18], at[93]);    MULADD(at[19], at[92]);    MULADD(at[20], at[91]);    MULADD(at[21], at[90]);    MULADD(at[22], at[89]);    MULADD(at[23], at[88]);    MULADD(at[24], at[87]);    MULADD(at[25], at[86]);    MULADD(at[26], at[85]);    MULADD(at[27], at[84]);    MULADD(at[28], at[83]);    MULADD(at[29], at[82]);    MULADD(at[30], at[81]);    MULADD(at[31], at[80]);    MULADD(at[32], at[79]);    MULADD(at[33], at[78]);    MULADD(at[34], at[77]);    MULADD(at[35], at[76]);    MULADD(at[36], at[75]);    MULADD(at[37], at[74]);    MULADD(at[38], at[73]);    MULADD(at[39], at[72]);    MULADD(at[40], at[71]);    MULADD(at[41], at[70]);    MULADD(at[42], at[69]);    MULADD(at[43], at[68]);    MULADD(at[44], at[67]);    MULADD(at[45], at[66]);    MULADD(at[46], at[65]);    MULADD(at[47], at[64]); 
+   COMBA_STORE(C->dp[63]);
+   /* 64 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[95]);    MULADD(at[18], at[94]);    MULADD(at[19], at[93]);    MULADD(at[20], at[92]);    MULADD(at[21], at[91]);    MULADD(at[22], at[90]);    MULADD(at[23], at[89]);    MULADD(at[24], at[88]);    MULADD(at[25], at[87]);    MULADD(at[26], at[86]);    MULADD(at[27], at[85]);    MULADD(at[28], at[84]);    MULADD(at[29], at[83]);    MULADD(at[30], at[82]);    MULADD(at[31], at[81]);    MULADD(at[32], at[80]);    MULADD(at[33], at[79]);    MULADD(at[34], at[78]);    MULADD(at[35], at[77]);    MULADD(at[36], at[76]);    MULADD(at[37], at[75]);    MULADD(at[38], at[74]);    MULADD(at[39], at[73]);    MULADD(at[40], at[72]);    MULADD(at[41], at[71]);    MULADD(at[42], at[70]);    MULADD(at[43], at[69]);    MULADD(at[44], at[68]);    MULADD(at[45], at[67]);    MULADD(at[46], at[66]);    MULADD(at[47], at[65]); 
+   COMBA_STORE(C->dp[64]);
+   /* 65 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[95]);    MULADD(at[19], at[94]);    MULADD(at[20], at[93]);    MULADD(at[21], at[92]);    MULADD(at[22], at[91]);    MULADD(at[23], at[90]);    MULADD(at[24], at[89]);    MULADD(at[25], at[88]);    MULADD(at[26], at[87]);    MULADD(at[27], at[86]);    MULADD(at[28], at[85]);    MULADD(at[29], at[84]);    MULADD(at[30], at[83]);    MULADD(at[31], at[82]);    MULADD(at[32], at[81]);    MULADD(at[33], at[80]);    MULADD(at[34], at[79]);    MULADD(at[35], at[78]);    MULADD(at[36], at[77]);    MULADD(at[37], at[76]);    MULADD(at[38], at[75]);    MULADD(at[39], at[74]);    MULADD(at[40], at[73]);    MULADD(at[41], at[72]);    MULADD(at[42], at[71]);    MULADD(at[43], at[70]);    MULADD(at[44], at[69]);    MULADD(at[45], at[68]);    MULADD(at[46], at[67]);    MULADD(at[47], at[66]); 
+   COMBA_STORE(C->dp[65]);
+   /* 66 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[95]);    MULADD(at[20], at[94]);    MULADD(at[21], at[93]);    MULADD(at[22], at[92]);    MULADD(at[23], at[91]);    MULADD(at[24], at[90]);    MULADD(at[25], at[89]);    MULADD(at[26], at[88]);    MULADD(at[27], at[87]);    MULADD(at[28], at[86]);    MULADD(at[29], at[85]);    MULADD(at[30], at[84]);    MULADD(at[31], at[83]);    MULADD(at[32], at[82]);    MULADD(at[33], at[81]);    MULADD(at[34], at[80]);    MULADD(at[35], at[79]);    MULADD(at[36], at[78]);    MULADD(at[37], at[77]);    MULADD(at[38], at[76]);    MULADD(at[39], at[75]);    MULADD(at[40], at[74]);    MULADD(at[41], at[73]);    MULADD(at[42], at[72]);    MULADD(at[43], at[71]);    MULADD(at[44], at[70]);    MULADD(at[45], at[69]);    MULADD(at[46], at[68]);    MULADD(at[47], at[67]); 
+   COMBA_STORE(C->dp[66]);
+   /* 67 */
+   COMBA_FORWARD;
+   MULADD(at[20], at[95]);    MULADD(at[21], at[94]);    MULADD(at[22], at[93]);    MULADD(at[23], at[92]);    MULADD(at[24], at[91]);    MULADD(at[25], at[90]);    MULADD(at[26], at[89]);    MULADD(at[27], at[88]);    MULADD(at[28], at[87]);    MULADD(at[29], at[86]);    MULADD(at[30], at[85]);    MULADD(at[31], at[84]);    MULADD(at[32], at[83]);    MULADD(at[33], at[82]);    MULADD(at[34], at[81]);    MULADD(at[35], at[80]);    MULADD(at[36], at[79]);    MULADD(at[37], at[78]);    MULADD(at[38], at[77]);    MULADD(at[39], at[76]);    MULADD(at[40], at[75]);    MULADD(at[41], at[74]);    MULADD(at[42], at[73]);    MULADD(at[43], at[72]);    MULADD(at[44], at[71]);    MULADD(at[45], at[70]);    MULADD(at[46], at[69]);    MULADD(at[47], at[68]); 
+   COMBA_STORE(C->dp[67]);
+   /* 68 */
+   COMBA_FORWARD;
+   MULADD(at[21], at[95]);    MULADD(at[22], at[94]);    MULADD(at[23], at[93]);    MULADD(at[24], at[92]);    MULADD(at[25], at[91]);    MULADD(at[26], at[90]);    MULADD(at[27], at[89]);    MULADD(at[28], at[88]);    MULADD(at[29], at[87]);    MULADD(at[30], at[86]);    MULADD(at[31], at[85]);    MULADD(at[32], at[84]);    MULADD(at[33], at[83]);    MULADD(at[34], at[82]);    MULADD(at[35], at[81]);    MULADD(at[36], at[80]);    MULADD(at[37], at[79]);    MULADD(at[38], at[78]);    MULADD(at[39], at[77]);    MULADD(at[40], at[76]);    MULADD(at[41], at[75]);    MULADD(at[42], at[74]);    MULADD(at[43], at[73]);    MULADD(at[44], at[72]);    MULADD(at[45], at[71]);    MULADD(at[46], at[70]);    MULADD(at[47], at[69]); 
+   COMBA_STORE(C->dp[68]);
+   /* 69 */
+   COMBA_FORWARD;
+   MULADD(at[22], at[95]);    MULADD(at[23], at[94]);    MULADD(at[24], at[93]);    MULADD(at[25], at[92]);    MULADD(at[26], at[91]);    MULADD(at[27], at[90]);    MULADD(at[28], at[89]);    MULADD(at[29], at[88]);    MULADD(at[30], at[87]);    MULADD(at[31], at[86]);    MULADD(at[32], at[85]);    MULADD(at[33], at[84]);    MULADD(at[34], at[83]);    MULADD(at[35], at[82]);    MULADD(at[36], at[81]);    MULADD(at[37], at[80]);    MULADD(at[38], at[79]);    MULADD(at[39], at[78]);    MULADD(at[40], at[77]);    MULADD(at[41], at[76]);    MULADD(at[42], at[75]);    MULADD(at[43], at[74]);    MULADD(at[44], at[73]);    MULADD(at[45], at[72]);    MULADD(at[46], at[71]);    MULADD(at[47], at[70]); 
+   COMBA_STORE(C->dp[69]);
+   /* 70 */
+   COMBA_FORWARD;
+   MULADD(at[23], at[95]);    MULADD(at[24], at[94]);    MULADD(at[25], at[93]);    MULADD(at[26], at[92]);    MULADD(at[27], at[91]);    MULADD(at[28], at[90]);    MULADD(at[29], at[89]);    MULADD(at[30], at[88]);    MULADD(at[31], at[87]);    MULADD(at[32], at[86]);    MULADD(at[33], at[85]);    MULADD(at[34], at[84]);    MULADD(at[35], at[83]);    MULADD(at[36], at[82]);    MULADD(at[37], at[81]);    MULADD(at[38], at[80]);    MULADD(at[39], at[79]);    MULADD(at[40], at[78]);    MULADD(at[41], at[77]);    MULADD(at[42], at[76]);    MULADD(at[43], at[75]);    MULADD(at[44], at[74]);    MULADD(at[45], at[73]);    MULADD(at[46], at[72]);    MULADD(at[47], at[71]); 
+   COMBA_STORE(C->dp[70]);
+   /* 71 */
+   COMBA_FORWARD;
+   MULADD(at[24], at[95]);    MULADD(at[25], at[94]);    MULADD(at[26], at[93]);    MULADD(at[27], at[92]);    MULADD(at[28], at[91]);    MULADD(at[29], at[90]);    MULADD(at[30], at[89]);    MULADD(at[31], at[88]);    MULADD(at[32], at[87]);    MULADD(at[33], at[86]);    MULADD(at[34], at[85]);    MULADD(at[35], at[84]);    MULADD(at[36], at[83]);    MULADD(at[37], at[82]);    MULADD(at[38], at[81]);    MULADD(at[39], at[80]);    MULADD(at[40], at[79]);    MULADD(at[41], at[78]);    MULADD(at[42], at[77]);    MULADD(at[43], at[76]);    MULADD(at[44], at[75]);    MULADD(at[45], at[74]);    MULADD(at[46], at[73]);    MULADD(at[47], at[72]); 
+   COMBA_STORE(C->dp[71]);
+   /* 72 */
+   COMBA_FORWARD;
+   MULADD(at[25], at[95]);    MULADD(at[26], at[94]);    MULADD(at[27], at[93]);    MULADD(at[28], at[92]);    MULADD(at[29], at[91]);    MULADD(at[30], at[90]);    MULADD(at[31], at[89]);    MULADD(at[32], at[88]);    MULADD(at[33], at[87]);    MULADD(at[34], at[86]);    MULADD(at[35], at[85]);    MULADD(at[36], at[84]);    MULADD(at[37], at[83]);    MULADD(at[38], at[82]);    MULADD(at[39], at[81]);    MULADD(at[40], at[80]);    MULADD(at[41], at[79]);    MULADD(at[42], at[78]);    MULADD(at[43], at[77]);    MULADD(at[44], at[76]);    MULADD(at[45], at[75]);    MULADD(at[46], at[74]);    MULADD(at[47], at[73]); 
+   COMBA_STORE(C->dp[72]);
+   /* 73 */
+   COMBA_FORWARD;
+   MULADD(at[26], at[95]);    MULADD(at[27], at[94]);    MULADD(at[28], at[93]);    MULADD(at[29], at[92]);    MULADD(at[30], at[91]);    MULADD(at[31], at[90]);    MULADD(at[32], at[89]);    MULADD(at[33], at[88]);    MULADD(at[34], at[87]);    MULADD(at[35], at[86]);    MULADD(at[36], at[85]);    MULADD(at[37], at[84]);    MULADD(at[38], at[83]);    MULADD(at[39], at[82]);    MULADD(at[40], at[81]);    MULADD(at[41], at[80]);    MULADD(at[42], at[79]);    MULADD(at[43], at[78]);    MULADD(at[44], at[77]);    MULADD(at[45], at[76]);    MULADD(at[46], at[75]);    MULADD(at[47], at[74]); 
+   COMBA_STORE(C->dp[73]);
+   /* 74 */
+   COMBA_FORWARD;
+   MULADD(at[27], at[95]);    MULADD(at[28], at[94]);    MULADD(at[29], at[93]);    MULADD(at[30], at[92]);    MULADD(at[31], at[91]);    MULADD(at[32], at[90]);    MULADD(at[33], at[89]);    MULADD(at[34], at[88]);    MULADD(at[35], at[87]);    MULADD(at[36], at[86]);    MULADD(at[37], at[85]);    MULADD(at[38], at[84]);    MULADD(at[39], at[83]);    MULADD(at[40], at[82]);    MULADD(at[41], at[81]);    MULADD(at[42], at[80]);    MULADD(at[43], at[79]);    MULADD(at[44], at[78]);    MULADD(at[45], at[77]);    MULADD(at[46], at[76]);    MULADD(at[47], at[75]); 
+   COMBA_STORE(C->dp[74]);
+   /* 75 */
+   COMBA_FORWARD;
+   MULADD(at[28], at[95]);    MULADD(at[29], at[94]);    MULADD(at[30], at[93]);    MULADD(at[31], at[92]);    MULADD(at[32], at[91]);    MULADD(at[33], at[90]);    MULADD(at[34], at[89]);    MULADD(at[35], at[88]);    MULADD(at[36], at[87]);    MULADD(at[37], at[86]);    MULADD(at[38], at[85]);    MULADD(at[39], at[84]);    MULADD(at[40], at[83]);    MULADD(at[41], at[82]);    MULADD(at[42], at[81]);    MULADD(at[43], at[80]);    MULADD(at[44], at[79]);    MULADD(at[45], at[78]);    MULADD(at[46], at[77]);    MULADD(at[47], at[76]); 
+   COMBA_STORE(C->dp[75]);
+   /* 76 */
+   COMBA_FORWARD;
+   MULADD(at[29], at[95]);    MULADD(at[30], at[94]);    MULADD(at[31], at[93]);    MULADD(at[32], at[92]);    MULADD(at[33], at[91]);    MULADD(at[34], at[90]);    MULADD(at[35], at[89]);    MULADD(at[36], at[88]);    MULADD(at[37], at[87]);    MULADD(at[38], at[86]);    MULADD(at[39], at[85]);    MULADD(at[40], at[84]);    MULADD(at[41], at[83]);    MULADD(at[42], at[82]);    MULADD(at[43], at[81]);    MULADD(at[44], at[80]);    MULADD(at[45], at[79]);    MULADD(at[46], at[78]);    MULADD(at[47], at[77]); 
+   COMBA_STORE(C->dp[76]);
+   /* 77 */
+   COMBA_FORWARD;
+   MULADD(at[30], at[95]);    MULADD(at[31], at[94]);    MULADD(at[32], at[93]);    MULADD(at[33], at[92]);    MULADD(at[34], at[91]);    MULADD(at[35], at[90]);    MULADD(at[36], at[89]);    MULADD(at[37], at[88]);    MULADD(at[38], at[87]);    MULADD(at[39], at[86]);    MULADD(at[40], at[85]);    MULADD(at[41], at[84]);    MULADD(at[42], at[83]);    MULADD(at[43], at[82]);    MULADD(at[44], at[81]);    MULADD(at[45], at[80]);    MULADD(at[46], at[79]);    MULADD(at[47], at[78]); 
+   COMBA_STORE(C->dp[77]);
+   /* 78 */
+   COMBA_FORWARD;
+   MULADD(at[31], at[95]);    MULADD(at[32], at[94]);    MULADD(at[33], at[93]);    MULADD(at[34], at[92]);    MULADD(at[35], at[91]);    MULADD(at[36], at[90]);    MULADD(at[37], at[89]);    MULADD(at[38], at[88]);    MULADD(at[39], at[87]);    MULADD(at[40], at[86]);    MULADD(at[41], at[85]);    MULADD(at[42], at[84]);    MULADD(at[43], at[83]);    MULADD(at[44], at[82]);    MULADD(at[45], at[81]);    MULADD(at[46], at[80]);    MULADD(at[47], at[79]); 
+   COMBA_STORE(C->dp[78]);
+   /* 79 */
+   COMBA_FORWARD;
+   MULADD(at[32], at[95]);    MULADD(at[33], at[94]);    MULADD(at[34], at[93]);    MULADD(at[35], at[92]);    MULADD(at[36], at[91]);    MULADD(at[37], at[90]);    MULADD(at[38], at[89]);    MULADD(at[39], at[88]);    MULADD(at[40], at[87]);    MULADD(at[41], at[86]);    MULADD(at[42], at[85]);    MULADD(at[43], at[84]);    MULADD(at[44], at[83]);    MULADD(at[45], at[82]);    MULADD(at[46], at[81]);    MULADD(at[47], at[80]); 
+   COMBA_STORE(C->dp[79]);
+   /* 80 */
+   COMBA_FORWARD;
+   MULADD(at[33], at[95]);    MULADD(at[34], at[94]);    MULADD(at[35], at[93]);    MULADD(at[36], at[92]);    MULADD(at[37], at[91]);    MULADD(at[38], at[90]);    MULADD(at[39], at[89]);    MULADD(at[40], at[88]);    MULADD(at[41], at[87]);    MULADD(at[42], at[86]);    MULADD(at[43], at[85]);    MULADD(at[44], at[84]);    MULADD(at[45], at[83]);    MULADD(at[46], at[82]);    MULADD(at[47], at[81]); 
+   COMBA_STORE(C->dp[80]);
+   /* 81 */
+   COMBA_FORWARD;
+   MULADD(at[34], at[95]);    MULADD(at[35], at[94]);    MULADD(at[36], at[93]);    MULADD(at[37], at[92]);    MULADD(at[38], at[91]);    MULADD(at[39], at[90]);    MULADD(at[40], at[89]);    MULADD(at[41], at[88]);    MULADD(at[42], at[87]);    MULADD(at[43], at[86]);    MULADD(at[44], at[85]);    MULADD(at[45], at[84]);    MULADD(at[46], at[83]);    MULADD(at[47], at[82]); 
+   COMBA_STORE(C->dp[81]);
+   /* 82 */
+   COMBA_FORWARD;
+   MULADD(at[35], at[95]);    MULADD(at[36], at[94]);    MULADD(at[37], at[93]);    MULADD(at[38], at[92]);    MULADD(at[39], at[91]);    MULADD(at[40], at[90]);    MULADD(at[41], at[89]);    MULADD(at[42], at[88]);    MULADD(at[43], at[87]);    MULADD(at[44], at[86]);    MULADD(at[45], at[85]);    MULADD(at[46], at[84]);    MULADD(at[47], at[83]); 
+   COMBA_STORE(C->dp[82]);
+   /* 83 */
+   COMBA_FORWARD;
+   MULADD(at[36], at[95]);    MULADD(at[37], at[94]);    MULADD(at[38], at[93]);    MULADD(at[39], at[92]);    MULADD(at[40], at[91]);    MULADD(at[41], at[90]);    MULADD(at[42], at[89]);    MULADD(at[43], at[88]);    MULADD(at[44], at[87]);    MULADD(at[45], at[86]);    MULADD(at[46], at[85]);    MULADD(at[47], at[84]); 
+   COMBA_STORE(C->dp[83]);
+   /* 84 */
+   COMBA_FORWARD;
+   MULADD(at[37], at[95]);    MULADD(at[38], at[94]);    MULADD(at[39], at[93]);    MULADD(at[40], at[92]);    MULADD(at[41], at[91]);    MULADD(at[42], at[90]);    MULADD(at[43], at[89]);    MULADD(at[44], at[88]);    MULADD(at[45], at[87]);    MULADD(at[46], at[86]);    MULADD(at[47], at[85]); 
+   COMBA_STORE(C->dp[84]);
+   /* 85 */
+   COMBA_FORWARD;
+   MULADD(at[38], at[95]);    MULADD(at[39], at[94]);    MULADD(at[40], at[93]);    MULADD(at[41], at[92]);    MULADD(at[42], at[91]);    MULADD(at[43], at[90]);    MULADD(at[44], at[89]);    MULADD(at[45], at[88]);    MULADD(at[46], at[87]);    MULADD(at[47], at[86]); 
+   COMBA_STORE(C->dp[85]);
+   /* 86 */
+   COMBA_FORWARD;
+   MULADD(at[39], at[95]);    MULADD(at[40], at[94]);    MULADD(at[41], at[93]);    MULADD(at[42], at[92]);    MULADD(at[43], at[91]);    MULADD(at[44], at[90]);    MULADD(at[45], at[89]);    MULADD(at[46], at[88]);    MULADD(at[47], at[87]); 
+   COMBA_STORE(C->dp[86]);
+   /* 87 */
+   COMBA_FORWARD;
+   MULADD(at[40], at[95]);    MULADD(at[41], at[94]);    MULADD(at[42], at[93]);    MULADD(at[43], at[92]);    MULADD(at[44], at[91]);    MULADD(at[45], at[90]);    MULADD(at[46], at[89]);    MULADD(at[47], at[88]); 
+   COMBA_STORE(C->dp[87]);
+   /* 88 */
+   COMBA_FORWARD;
+   MULADD(at[41], at[95]);    MULADD(at[42], at[94]);    MULADD(at[43], at[93]);    MULADD(at[44], at[92]);    MULADD(at[45], at[91]);    MULADD(at[46], at[90]);    MULADD(at[47], at[89]); 
+   COMBA_STORE(C->dp[88]);
+   /* 89 */
+   COMBA_FORWARD;
+   MULADD(at[42], at[95]);    MULADD(at[43], at[94]);    MULADD(at[44], at[93]);    MULADD(at[45], at[92]);    MULADD(at[46], at[91]);    MULADD(at[47], at[90]); 
+   COMBA_STORE(C->dp[89]);
+   /* 90 */
+   COMBA_FORWARD;
+   MULADD(at[43], at[95]);    MULADD(at[44], at[94]);    MULADD(at[45], at[93]);    MULADD(at[46], at[92]);    MULADD(at[47], at[91]); 
+   COMBA_STORE(C->dp[90]);
+   /* 91 */
+   COMBA_FORWARD;
+   MULADD(at[44], at[95]);    MULADD(at[45], at[94]);    MULADD(at[46], at[93]);    MULADD(at[47], at[92]); 
+   COMBA_STORE(C->dp[91]);
+   /* 92 */
+   COMBA_FORWARD;
+   MULADD(at[45], at[95]);    MULADD(at[46], at[94]);    MULADD(at[47], at[93]); 
+   COMBA_STORE(C->dp[92]);
+   /* 93 */
+   COMBA_FORWARD;
+   MULADD(at[46], at[95]);    MULADD(at[47], at[94]); 
+   COMBA_STORE(C->dp[93]);
+   /* 94 */
+   COMBA_FORWARD;
+   MULADD(at[47], at[95]); 
+   COMBA_STORE(C->dp[94]);
+   COMBA_STORE2(C->dp[95]);
+   C->used = 96;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_6.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_6.i
new file mode 100644 (file)
index 0000000..e691e98
--- /dev/null
@@ -0,0 +1,82 @@
+/* fp_mul_comba_6.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL6
+void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[12];
+
+   memcpy(at, A->dp, 6 * sizeof(fp_digit));
+   memcpy(at+6, B->dp, 6 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[6]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[7]);    MULADD(at[1], at[6]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[8]);    MULADD(at[1], at[7]);    MULADD(at[2], at[6]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[9]);    MULADD(at[1], at[8]);    MULADD(at[2], at[7]);    MULADD(at[3], at[6]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[10]);    MULADD(at[1], at[9]);    MULADD(at[2], at[8]);    MULADD(at[3], at[7]);    MULADD(at[4], at[6]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[11]);    MULADD(at[1], at[10]);    MULADD(at[2], at[9]);    MULADD(at[3], at[8]);    MULADD(at[4], at[7]);    MULADD(at[5], at[6]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[11]);    MULADD(at[2], at[10]);    MULADD(at[3], at[9]);    MULADD(at[4], at[8]);    MULADD(at[5], at[7]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[11]);    MULADD(at[3], at[10]);    MULADD(at[4], at[9]);    MULADD(at[5], at[8]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[11]);    MULADD(at[4], at[10]);    MULADD(at[5], at[9]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[11]);    MULADD(at[5], at[10]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[11]); 
+   COMBA_STORE(C->dp[10]);
+   COMBA_STORE2(C->dp[11]);
+   C->used = 12;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_64.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_64.i
new file mode 100644 (file)
index 0000000..ba0517b
--- /dev/null
@@ -0,0 +1,546 @@
+/* fp_mul_comba_64.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL64
+void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[128];
+
+   memcpy(at, A->dp, 64 * sizeof(fp_digit));
+   memcpy(at+64, B->dp, 64 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[64]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[65]);    MULADD(at[1], at[64]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[66]);    MULADD(at[1], at[65]);    MULADD(at[2], at[64]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[67]);    MULADD(at[1], at[66]);    MULADD(at[2], at[65]);    MULADD(at[3], at[64]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[68]);    MULADD(at[1], at[67]);    MULADD(at[2], at[66]);    MULADD(at[3], at[65]);    MULADD(at[4], at[64]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[69]);    MULADD(at[1], at[68]);    MULADD(at[2], at[67]);    MULADD(at[3], at[66]);    MULADD(at[4], at[65]);    MULADD(at[5], at[64]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[70]);    MULADD(at[1], at[69]);    MULADD(at[2], at[68]);    MULADD(at[3], at[67]);    MULADD(at[4], at[66]);    MULADD(at[5], at[65]);    MULADD(at[6], at[64]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[71]);    MULADD(at[1], at[70]);    MULADD(at[2], at[69]);    MULADD(at[3], at[68]);    MULADD(at[4], at[67]);    MULADD(at[5], at[66]);    MULADD(at[6], at[65]);    MULADD(at[7], at[64]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[72]);    MULADD(at[1], at[71]);    MULADD(at[2], at[70]);    MULADD(at[3], at[69]);    MULADD(at[4], at[68]);    MULADD(at[5], at[67]);    MULADD(at[6], at[66]);    MULADD(at[7], at[65]);    MULADD(at[8], at[64]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[73]);    MULADD(at[1], at[72]);    MULADD(at[2], at[71]);    MULADD(at[3], at[70]);    MULADD(at[4], at[69]);    MULADD(at[5], at[68]);    MULADD(at[6], at[67]);    MULADD(at[7], at[66]);    MULADD(at[8], at[65]);    MULADD(at[9], at[64]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[74]);    MULADD(at[1], at[73]);    MULADD(at[2], at[72]);    MULADD(at[3], at[71]);    MULADD(at[4], at[70]);    MULADD(at[5], at[69]);    MULADD(at[6], at[68]);    MULADD(at[7], at[67]);    MULADD(at[8], at[66]);    MULADD(at[9], at[65]);    MULADD(at[10], at[64]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[75]);    MULADD(at[1], at[74]);    MULADD(at[2], at[73]);    MULADD(at[3], at[72]);    MULADD(at[4], at[71]);    MULADD(at[5], at[70]);    MULADD(at[6], at[69]);    MULADD(at[7], at[68]);    MULADD(at[8], at[67]);    MULADD(at[9], at[66]);    MULADD(at[10], at[65]);    MULADD(at[11], at[64]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[76]);    MULADD(at[1], at[75]);    MULADD(at[2], at[74]);    MULADD(at[3], at[73]);    MULADD(at[4], at[72]);    MULADD(at[5], at[71]);    MULADD(at[6], at[70]);    MULADD(at[7], at[69]);    MULADD(at[8], at[68]);    MULADD(at[9], at[67]);    MULADD(at[10], at[66]);    MULADD(at[11], at[65]);    MULADD(at[12], at[64]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[77]);    MULADD(at[1], at[76]);    MULADD(at[2], at[75]);    MULADD(at[3], at[74]);    MULADD(at[4], at[73]);    MULADD(at[5], at[72]);    MULADD(at[6], at[71]);    MULADD(at[7], at[70]);    MULADD(at[8], at[69]);    MULADD(at[9], at[68]);    MULADD(at[10], at[67]);    MULADD(at[11], at[66]);    MULADD(at[12], at[65]);    MULADD(at[13], at[64]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[78]);    MULADD(at[1], at[77]);    MULADD(at[2], at[76]);    MULADD(at[3], at[75]);    MULADD(at[4], at[74]);    MULADD(at[5], at[73]);    MULADD(at[6], at[72]);    MULADD(at[7], at[71]);    MULADD(at[8], at[70]);    MULADD(at[9], at[69]);    MULADD(at[10], at[68]);    MULADD(at[11], at[67]);    MULADD(at[12], at[66]);    MULADD(at[13], at[65]);    MULADD(at[14], at[64]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[79]);    MULADD(at[1], at[78]);    MULADD(at[2], at[77]);    MULADD(at[3], at[76]);    MULADD(at[4], at[75]);    MULADD(at[5], at[74]);    MULADD(at[6], at[73]);    MULADD(at[7], at[72]);    MULADD(at[8], at[71]);    MULADD(at[9], at[70]);    MULADD(at[10], at[69]);    MULADD(at[11], at[68]);    MULADD(at[12], at[67]);    MULADD(at[13], at[66]);    MULADD(at[14], at[65]);    MULADD(at[15], at[64]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[80]);    MULADD(at[1], at[79]);    MULADD(at[2], at[78]);    MULADD(at[3], at[77]);    MULADD(at[4], at[76]);    MULADD(at[5], at[75]);    MULADD(at[6], at[74]);    MULADD(at[7], at[73]);    MULADD(at[8], at[72]);    MULADD(at[9], at[71]);    MULADD(at[10], at[70]);    MULADD(at[11], at[69]);    MULADD(at[12], at[68]);    MULADD(at[13], at[67]);    MULADD(at[14], at[66]);    MULADD(at[15], at[65]);    MULADD(at[16], at[64]); 
+   COMBA_STORE(C->dp[16]);
+   /* 17 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[81]);    MULADD(at[1], at[80]);    MULADD(at[2], at[79]);    MULADD(at[3], at[78]);    MULADD(at[4], at[77]);    MULADD(at[5], at[76]);    MULADD(at[6], at[75]);    MULADD(at[7], at[74]);    MULADD(at[8], at[73]);    MULADD(at[9], at[72]);    MULADD(at[10], at[71]);    MULADD(at[11], at[70]);    MULADD(at[12], at[69]);    MULADD(at[13], at[68]);    MULADD(at[14], at[67]);    MULADD(at[15], at[66]);    MULADD(at[16], at[65]);    MULADD(at[17], at[64]); 
+   COMBA_STORE(C->dp[17]);
+   /* 18 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[82]);    MULADD(at[1], at[81]);    MULADD(at[2], at[80]);    MULADD(at[3], at[79]);    MULADD(at[4], at[78]);    MULADD(at[5], at[77]);    MULADD(at[6], at[76]);    MULADD(at[7], at[75]);    MULADD(at[8], at[74]);    MULADD(at[9], at[73]);    MULADD(at[10], at[72]);    MULADD(at[11], at[71]);    MULADD(at[12], at[70]);    MULADD(at[13], at[69]);    MULADD(at[14], at[68]);    MULADD(at[15], at[67]);    MULADD(at[16], at[66]);    MULADD(at[17], at[65]);    MULADD(at[18], at[64]); 
+   COMBA_STORE(C->dp[18]);
+   /* 19 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[83]);    MULADD(at[1], at[82]);    MULADD(at[2], at[81]);    MULADD(at[3], at[80]);    MULADD(at[4], at[79]);    MULADD(at[5], at[78]);    MULADD(at[6], at[77]);    MULADD(at[7], at[76]);    MULADD(at[8], at[75]);    MULADD(at[9], at[74]);    MULADD(at[10], at[73]);    MULADD(at[11], at[72]);    MULADD(at[12], at[71]);    MULADD(at[13], at[70]);    MULADD(at[14], at[69]);    MULADD(at[15], at[68]);    MULADD(at[16], at[67]);    MULADD(at[17], at[66]);    MULADD(at[18], at[65]);    MULADD(at[19], at[64]); 
+   COMBA_STORE(C->dp[19]);
+   /* 20 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[84]);    MULADD(at[1], at[83]);    MULADD(at[2], at[82]);    MULADD(at[3], at[81]);    MULADD(at[4], at[80]);    MULADD(at[5], at[79]);    MULADD(at[6], at[78]);    MULADD(at[7], at[77]);    MULADD(at[8], at[76]);    MULADD(at[9], at[75]);    MULADD(at[10], at[74]);    MULADD(at[11], at[73]);    MULADD(at[12], at[72]);    MULADD(at[13], at[71]);    MULADD(at[14], at[70]);    MULADD(at[15], at[69]);    MULADD(at[16], at[68]);    MULADD(at[17], at[67]);    MULADD(at[18], at[66]);    MULADD(at[19], at[65]);    MULADD(at[20], at[64]); 
+   COMBA_STORE(C->dp[20]);
+   /* 21 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[85]);    MULADD(at[1], at[84]);    MULADD(at[2], at[83]);    MULADD(at[3], at[82]);    MULADD(at[4], at[81]);    MULADD(at[5], at[80]);    MULADD(at[6], at[79]);    MULADD(at[7], at[78]);    MULADD(at[8], at[77]);    MULADD(at[9], at[76]);    MULADD(at[10], at[75]);    MULADD(at[11], at[74]);    MULADD(at[12], at[73]);    MULADD(at[13], at[72]);    MULADD(at[14], at[71]);    MULADD(at[15], at[70]);    MULADD(at[16], at[69]);    MULADD(at[17], at[68]);    MULADD(at[18], at[67]);    MULADD(at[19], at[66]);    MULADD(at[20], at[65]);    MULADD(at[21], at[64]); 
+   COMBA_STORE(C->dp[21]);
+   /* 22 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[86]);    MULADD(at[1], at[85]);    MULADD(at[2], at[84]);    MULADD(at[3], at[83]);    MULADD(at[4], at[82]);    MULADD(at[5], at[81]);    MULADD(at[6], at[80]);    MULADD(at[7], at[79]);    MULADD(at[8], at[78]);    MULADD(at[9], at[77]);    MULADD(at[10], at[76]);    MULADD(at[11], at[75]);    MULADD(at[12], at[74]);    MULADD(at[13], at[73]);    MULADD(at[14], at[72]);    MULADD(at[15], at[71]);    MULADD(at[16], at[70]);    MULADD(at[17], at[69]);    MULADD(at[18], at[68]);    MULADD(at[19], at[67]);    MULADD(at[20], at[66]);    MULADD(at[21], at[65]);    MULADD(at[22], at[64]); 
+   COMBA_STORE(C->dp[22]);
+   /* 23 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[87]);    MULADD(at[1], at[86]);    MULADD(at[2], at[85]);    MULADD(at[3], at[84]);    MULADD(at[4], at[83]);    MULADD(at[5], at[82]);    MULADD(at[6], at[81]);    MULADD(at[7], at[80]);    MULADD(at[8], at[79]);    MULADD(at[9], at[78]);    MULADD(at[10], at[77]);    MULADD(at[11], at[76]);    MULADD(at[12], at[75]);    MULADD(at[13], at[74]);    MULADD(at[14], at[73]);    MULADD(at[15], at[72]);    MULADD(at[16], at[71]);    MULADD(at[17], at[70]);    MULADD(at[18], at[69]);    MULADD(at[19], at[68]);    MULADD(at[20], at[67]);    MULADD(at[21], at[66]);    MULADD(at[22], at[65]);    MULADD(at[23], at[64]); 
+   COMBA_STORE(C->dp[23]);
+   /* 24 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[88]);    MULADD(at[1], at[87]);    MULADD(at[2], at[86]);    MULADD(at[3], at[85]);    MULADD(at[4], at[84]);    MULADD(at[5], at[83]);    MULADD(at[6], at[82]);    MULADD(at[7], at[81]);    MULADD(at[8], at[80]);    MULADD(at[9], at[79]);    MULADD(at[10], at[78]);    MULADD(at[11], at[77]);    MULADD(at[12], at[76]);    MULADD(at[13], at[75]);    MULADD(at[14], at[74]);    MULADD(at[15], at[73]);    MULADD(at[16], at[72]);    MULADD(at[17], at[71]);    MULADD(at[18], at[70]);    MULADD(at[19], at[69]);    MULADD(at[20], at[68]);    MULADD(at[21], at[67]);    MULADD(at[22], at[66]);    MULADD(at[23], at[65]);    MULADD(at[24], at[64]); 
+   COMBA_STORE(C->dp[24]);
+   /* 25 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[89]);    MULADD(at[1], at[88]);    MULADD(at[2], at[87]);    MULADD(at[3], at[86]);    MULADD(at[4], at[85]);    MULADD(at[5], at[84]);    MULADD(at[6], at[83]);    MULADD(at[7], at[82]);    MULADD(at[8], at[81]);    MULADD(at[9], at[80]);    MULADD(at[10], at[79]);    MULADD(at[11], at[78]);    MULADD(at[12], at[77]);    MULADD(at[13], at[76]);    MULADD(at[14], at[75]);    MULADD(at[15], at[74]);    MULADD(at[16], at[73]);    MULADD(at[17], at[72]);    MULADD(at[18], at[71]);    MULADD(at[19], at[70]);    MULADD(at[20], at[69]);    MULADD(at[21], at[68]);    MULADD(at[22], at[67]);    MULADD(at[23], at[66]);    MULADD(at[24], at[65]);    MULADD(at[25], at[64]); 
+   COMBA_STORE(C->dp[25]);
+   /* 26 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[90]);    MULADD(at[1], at[89]);    MULADD(at[2], at[88]);    MULADD(at[3], at[87]);    MULADD(at[4], at[86]);    MULADD(at[5], at[85]);    MULADD(at[6], at[84]);    MULADD(at[7], at[83]);    MULADD(at[8], at[82]);    MULADD(at[9], at[81]);    MULADD(at[10], at[80]);    MULADD(at[11], at[79]);    MULADD(at[12], at[78]);    MULADD(at[13], at[77]);    MULADD(at[14], at[76]);    MULADD(at[15], at[75]);    MULADD(at[16], at[74]);    MULADD(at[17], at[73]);    MULADD(at[18], at[72]);    MULADD(at[19], at[71]);    MULADD(at[20], at[70]);    MULADD(at[21], at[69]);    MULADD(at[22], at[68]);    MULADD(at[23], at[67]);    MULADD(at[24], at[66]);    MULADD(at[25], at[65]);    MULADD(at[26], at[64]); 
+   COMBA_STORE(C->dp[26]);
+   /* 27 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[91]);    MULADD(at[1], at[90]);    MULADD(at[2], at[89]);    MULADD(at[3], at[88]);    MULADD(at[4], at[87]);    MULADD(at[5], at[86]);    MULADD(at[6], at[85]);    MULADD(at[7], at[84]);    MULADD(at[8], at[83]);    MULADD(at[9], at[82]);    MULADD(at[10], at[81]);    MULADD(at[11], at[80]);    MULADD(at[12], at[79]);    MULADD(at[13], at[78]);    MULADD(at[14], at[77]);    MULADD(at[15], at[76]);    MULADD(at[16], at[75]);    MULADD(at[17], at[74]);    MULADD(at[18], at[73]);    MULADD(at[19], at[72]);    MULADD(at[20], at[71]);    MULADD(at[21], at[70]);    MULADD(at[22], at[69]);    MULADD(at[23], at[68]);    MULADD(at[24], at[67]);    MULADD(at[25], at[66]);    MULADD(at[26], at[65]);    MULADD(at[27], at[64]); 
+   COMBA_STORE(C->dp[27]);
+   /* 28 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[92]);    MULADD(at[1], at[91]);    MULADD(at[2], at[90]);    MULADD(at[3], at[89]);    MULADD(at[4], at[88]);    MULADD(at[5], at[87]);    MULADD(at[6], at[86]);    MULADD(at[7], at[85]);    MULADD(at[8], at[84]);    MULADD(at[9], at[83]);    MULADD(at[10], at[82]);    MULADD(at[11], at[81]);    MULADD(at[12], at[80]);    MULADD(at[13], at[79]);    MULADD(at[14], at[78]);    MULADD(at[15], at[77]);    MULADD(at[16], at[76]);    MULADD(at[17], at[75]);    MULADD(at[18], at[74]);    MULADD(at[19], at[73]);    MULADD(at[20], at[72]);    MULADD(at[21], at[71]);    MULADD(at[22], at[70]);    MULADD(at[23], at[69]);    MULADD(at[24], at[68]);    MULADD(at[25], at[67]);    MULADD(at[26], at[66]);    MULADD(at[27], at[65]);    MULADD(at[28], at[64]); 
+   COMBA_STORE(C->dp[28]);
+   /* 29 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[93]);    MULADD(at[1], at[92]);    MULADD(at[2], at[91]);    MULADD(at[3], at[90]);    MULADD(at[4], at[89]);    MULADD(at[5], at[88]);    MULADD(at[6], at[87]);    MULADD(at[7], at[86]);    MULADD(at[8], at[85]);    MULADD(at[9], at[84]);    MULADD(at[10], at[83]);    MULADD(at[11], at[82]);    MULADD(at[12], at[81]);    MULADD(at[13], at[80]);    MULADD(at[14], at[79]);    MULADD(at[15], at[78]);    MULADD(at[16], at[77]);    MULADD(at[17], at[76]);    MULADD(at[18], at[75]);    MULADD(at[19], at[74]);    MULADD(at[20], at[73]);    MULADD(at[21], at[72]);    MULADD(at[22], at[71]);    MULADD(at[23], at[70]);    MULADD(at[24], at[69]);    MULADD(at[25], at[68]);    MULADD(at[26], at[67]);    MULADD(at[27], at[66]);    MULADD(at[28], at[65]);    MULADD(at[29], at[64]); 
+   COMBA_STORE(C->dp[29]);
+   /* 30 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[94]);    MULADD(at[1], at[93]);    MULADD(at[2], at[92]);    MULADD(at[3], at[91]);    MULADD(at[4], at[90]);    MULADD(at[5], at[89]);    MULADD(at[6], at[88]);    MULADD(at[7], at[87]);    MULADD(at[8], at[86]);    MULADD(at[9], at[85]);    MULADD(at[10], at[84]);    MULADD(at[11], at[83]);    MULADD(at[12], at[82]);    MULADD(at[13], at[81]);    MULADD(at[14], at[80]);    MULADD(at[15], at[79]);    MULADD(at[16], at[78]);    MULADD(at[17], at[77]);    MULADD(at[18], at[76]);    MULADD(at[19], at[75]);    MULADD(at[20], at[74]);    MULADD(at[21], at[73]);    MULADD(at[22], at[72]);    MULADD(at[23], at[71]);    MULADD(at[24], at[70]);    MULADD(at[25], at[69]);    MULADD(at[26], at[68]);    MULADD(at[27], at[67]);    MULADD(at[28], at[66]);    MULADD(at[29], at[65]);    MULADD(at[30], at[64]); 
+   COMBA_STORE(C->dp[30]);
+   /* 31 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[95]);    MULADD(at[1], at[94]);    MULADD(at[2], at[93]);    MULADD(at[3], at[92]);    MULADD(at[4], at[91]);    MULADD(at[5], at[90]);    MULADD(at[6], at[89]);    MULADD(at[7], at[88]);    MULADD(at[8], at[87]);    MULADD(at[9], at[86]);    MULADD(at[10], at[85]);    MULADD(at[11], at[84]);    MULADD(at[12], at[83]);    MULADD(at[13], at[82]);    MULADD(at[14], at[81]);    MULADD(at[15], at[80]);    MULADD(at[16], at[79]);    MULADD(at[17], at[78]);    MULADD(at[18], at[77]);    MULADD(at[19], at[76]);    MULADD(at[20], at[75]);    MULADD(at[21], at[74]);    MULADD(at[22], at[73]);    MULADD(at[23], at[72]);    MULADD(at[24], at[71]);    MULADD(at[25], at[70]);    MULADD(at[26], at[69]);    MULADD(at[27], at[68]);    MULADD(at[28], at[67]);    MULADD(at[29], at[66]);    MULADD(at[30], at[65]);    MULADD(at[31], at[64]); 
+   COMBA_STORE(C->dp[31]);
+   /* 32 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[96]);    MULADD(at[1], at[95]);    MULADD(at[2], at[94]);    MULADD(at[3], at[93]);    MULADD(at[4], at[92]);    MULADD(at[5], at[91]);    MULADD(at[6], at[90]);    MULADD(at[7], at[89]);    MULADD(at[8], at[88]);    MULADD(at[9], at[87]);    MULADD(at[10], at[86]);    MULADD(at[11], at[85]);    MULADD(at[12], at[84]);    MULADD(at[13], at[83]);    MULADD(at[14], at[82]);    MULADD(at[15], at[81]);    MULADD(at[16], at[80]);    MULADD(at[17], at[79]);    MULADD(at[18], at[78]);    MULADD(at[19], at[77]);    MULADD(at[20], at[76]);    MULADD(at[21], at[75]);    MULADD(at[22], at[74]);    MULADD(at[23], at[73]);    MULADD(at[24], at[72]);    MULADD(at[25], at[71]);    MULADD(at[26], at[70]);    MULADD(at[27], at[69]);    MULADD(at[28], at[68]);    MULADD(at[29], at[67]);    MULADD(at[30], at[66]);    MULADD(at[31], at[65]);    MULADD(at[32], at[64]); 
+   COMBA_STORE(C->dp[32]);
+   /* 33 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[97]);    MULADD(at[1], at[96]);    MULADD(at[2], at[95]);    MULADD(at[3], at[94]);    MULADD(at[4], at[93]);    MULADD(at[5], at[92]);    MULADD(at[6], at[91]);    MULADD(at[7], at[90]);    MULADD(at[8], at[89]);    MULADD(at[9], at[88]);    MULADD(at[10], at[87]);    MULADD(at[11], at[86]);    MULADD(at[12], at[85]);    MULADD(at[13], at[84]);    MULADD(at[14], at[83]);    MULADD(at[15], at[82]);    MULADD(at[16], at[81]);    MULADD(at[17], at[80]);    MULADD(at[18], at[79]);    MULADD(at[19], at[78]);    MULADD(at[20], at[77]);    MULADD(at[21], at[76]);    MULADD(at[22], at[75]);    MULADD(at[23], at[74]);    MULADD(at[24], at[73]);    MULADD(at[25], at[72]);    MULADD(at[26], at[71]);    MULADD(at[27], at[70]);    MULADD(at[28], at[69]);    MULADD(at[29], at[68]);    MULADD(at[30], at[67]);    MULADD(at[31], at[66]);    MULADD(at[32], at[65]);    MULADD(at[33], at[64]); 
+   COMBA_STORE(C->dp[33]);
+   /* 34 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[98]);    MULADD(at[1], at[97]);    MULADD(at[2], at[96]);    MULADD(at[3], at[95]);    MULADD(at[4], at[94]);    MULADD(at[5], at[93]);    MULADD(at[6], at[92]);    MULADD(at[7], at[91]);    MULADD(at[8], at[90]);    MULADD(at[9], at[89]);    MULADD(at[10], at[88]);    MULADD(at[11], at[87]);    MULADD(at[12], at[86]);    MULADD(at[13], at[85]);    MULADD(at[14], at[84]);    MULADD(at[15], at[83]);    MULADD(at[16], at[82]);    MULADD(at[17], at[81]);    MULADD(at[18], at[80]);    MULADD(at[19], at[79]);    MULADD(at[20], at[78]);    MULADD(at[21], at[77]);    MULADD(at[22], at[76]);    MULADD(at[23], at[75]);    MULADD(at[24], at[74]);    MULADD(at[25], at[73]);    MULADD(at[26], at[72]);    MULADD(at[27], at[71]);    MULADD(at[28], at[70]);    MULADD(at[29], at[69]);    MULADD(at[30], at[68]);    MULADD(at[31], at[67]);    MULADD(at[32], at[66]);    MULADD(at[33], at[65]);    MULADD(at[34], at[64]); 
+   COMBA_STORE(C->dp[34]);
+   /* 35 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[99]);    MULADD(at[1], at[98]);    MULADD(at[2], at[97]);    MULADD(at[3], at[96]);    MULADD(at[4], at[95]);    MULADD(at[5], at[94]);    MULADD(at[6], at[93]);    MULADD(at[7], at[92]);    MULADD(at[8], at[91]);    MULADD(at[9], at[90]);    MULADD(at[10], at[89]);    MULADD(at[11], at[88]);    MULADD(at[12], at[87]);    MULADD(at[13], at[86]);    MULADD(at[14], at[85]);    MULADD(at[15], at[84]);    MULADD(at[16], at[83]);    MULADD(at[17], at[82]);    MULADD(at[18], at[81]);    MULADD(at[19], at[80]);    MULADD(at[20], at[79]);    MULADD(at[21], at[78]);    MULADD(at[22], at[77]);    MULADD(at[23], at[76]);    MULADD(at[24], at[75]);    MULADD(at[25], at[74]);    MULADD(at[26], at[73]);    MULADD(at[27], at[72]);    MULADD(at[28], at[71]);    MULADD(at[29], at[70]);    MULADD(at[30], at[69]);    MULADD(at[31], at[68]);    MULADD(at[32], at[67]);    MULADD(at[33], at[66]);    MULADD(at[34], at[65]);    MULADD(at[35], at[64]); 
+   COMBA_STORE(C->dp[35]);
+   /* 36 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[100]);    MULADD(at[1], at[99]);    MULADD(at[2], at[98]);    MULADD(at[3], at[97]);    MULADD(at[4], at[96]);    MULADD(at[5], at[95]);    MULADD(at[6], at[94]);    MULADD(at[7], at[93]);    MULADD(at[8], at[92]);    MULADD(at[9], at[91]);    MULADD(at[10], at[90]);    MULADD(at[11], at[89]);    MULADD(at[12], at[88]);    MULADD(at[13], at[87]);    MULADD(at[14], at[86]);    MULADD(at[15], at[85]);    MULADD(at[16], at[84]);    MULADD(at[17], at[83]);    MULADD(at[18], at[82]);    MULADD(at[19], at[81]);    MULADD(at[20], at[80]);    MULADD(at[21], at[79]);    MULADD(at[22], at[78]);    MULADD(at[23], at[77]);    MULADD(at[24], at[76]);    MULADD(at[25], at[75]);    MULADD(at[26], at[74]);    MULADD(at[27], at[73]);    MULADD(at[28], at[72]);    MULADD(at[29], at[71]);    MULADD(at[30], at[70]);    MULADD(at[31], at[69]);    MULADD(at[32], at[68]);    MULADD(at[33], at[67]);    MULADD(at[34], at[66]);    MULADD(at[35], at[65]);    MULADD(at[36], at[64]); 
+   COMBA_STORE(C->dp[36]);
+   /* 37 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[101]);    MULADD(at[1], at[100]);    MULADD(at[2], at[99]);    MULADD(at[3], at[98]);    MULADD(at[4], at[97]);    MULADD(at[5], at[96]);    MULADD(at[6], at[95]);    MULADD(at[7], at[94]);    MULADD(at[8], at[93]);    MULADD(at[9], at[92]);    MULADD(at[10], at[91]);    MULADD(at[11], at[90]);    MULADD(at[12], at[89]);    MULADD(at[13], at[88]);    MULADD(at[14], at[87]);    MULADD(at[15], at[86]);    MULADD(at[16], at[85]);    MULADD(at[17], at[84]);    MULADD(at[18], at[83]);    MULADD(at[19], at[82]);    MULADD(at[20], at[81]);    MULADD(at[21], at[80]);    MULADD(at[22], at[79]);    MULADD(at[23], at[78]);    MULADD(at[24], at[77]);    MULADD(at[25], at[76]);    MULADD(at[26], at[75]);    MULADD(at[27], at[74]);    MULADD(at[28], at[73]);    MULADD(at[29], at[72]);    MULADD(at[30], at[71]);    MULADD(at[31], at[70]);    MULADD(at[32], at[69]);    MULADD(at[33], at[68]);    MULADD(at[34], at[67]);    MULADD(at[35], at[66]);    MULADD(at[36], at[65]);    MULADD(at[37], at[64]); 
+   COMBA_STORE(C->dp[37]);
+   /* 38 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[102]);    MULADD(at[1], at[101]);    MULADD(at[2], at[100]);    MULADD(at[3], at[99]);    MULADD(at[4], at[98]);    MULADD(at[5], at[97]);    MULADD(at[6], at[96]);    MULADD(at[7], at[95]);    MULADD(at[8], at[94]);    MULADD(at[9], at[93]);    MULADD(at[10], at[92]);    MULADD(at[11], at[91]);    MULADD(at[12], at[90]);    MULADD(at[13], at[89]);    MULADD(at[14], at[88]);    MULADD(at[15], at[87]);    MULADD(at[16], at[86]);    MULADD(at[17], at[85]);    MULADD(at[18], at[84]);    MULADD(at[19], at[83]);    MULADD(at[20], at[82]);    MULADD(at[21], at[81]);    MULADD(at[22], at[80]);    MULADD(at[23], at[79]);    MULADD(at[24], at[78]);    MULADD(at[25], at[77]);    MULADD(at[26], at[76]);    MULADD(at[27], at[75]);    MULADD(at[28], at[74]);    MULADD(at[29], at[73]);    MULADD(at[30], at[72]);    MULADD(at[31], at[71]);    MULADD(at[32], at[70]);    MULADD(at[33], at[69]);    MULADD(at[34], at[68]);    MULADD(at[35], at[67]);    MULADD(at[36], at[66]);    MULADD(at[37], at[65]);    MULADD(at[38], at[64]); 
+   COMBA_STORE(C->dp[38]);
+   /* 39 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[103]);    MULADD(at[1], at[102]);    MULADD(at[2], at[101]);    MULADD(at[3], at[100]);    MULADD(at[4], at[99]);    MULADD(at[5], at[98]);    MULADD(at[6], at[97]);    MULADD(at[7], at[96]);    MULADD(at[8], at[95]);    MULADD(at[9], at[94]);    MULADD(at[10], at[93]);    MULADD(at[11], at[92]);    MULADD(at[12], at[91]);    MULADD(at[13], at[90]);    MULADD(at[14], at[89]);    MULADD(at[15], at[88]);    MULADD(at[16], at[87]);    MULADD(at[17], at[86]);    MULADD(at[18], at[85]);    MULADD(at[19], at[84]);    MULADD(at[20], at[83]);    MULADD(at[21], at[82]);    MULADD(at[22], at[81]);    MULADD(at[23], at[80]);    MULADD(at[24], at[79]);    MULADD(at[25], at[78]);    MULADD(at[26], at[77]);    MULADD(at[27], at[76]);    MULADD(at[28], at[75]);    MULADD(at[29], at[74]);    MULADD(at[30], at[73]);    MULADD(at[31], at[72]);    MULADD(at[32], at[71]);    MULADD(at[33], at[70]);    MULADD(at[34], at[69]);    MULADD(at[35], at[68]);    MULADD(at[36], at[67]);    MULADD(at[37], at[66]);    MULADD(at[38], at[65]);    MULADD(at[39], at[64]); 
+   COMBA_STORE(C->dp[39]);
+   /* 40 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[104]);    MULADD(at[1], at[103]);    MULADD(at[2], at[102]);    MULADD(at[3], at[101]);    MULADD(at[4], at[100]);    MULADD(at[5], at[99]);    MULADD(at[6], at[98]);    MULADD(at[7], at[97]);    MULADD(at[8], at[96]);    MULADD(at[9], at[95]);    MULADD(at[10], at[94]);    MULADD(at[11], at[93]);    MULADD(at[12], at[92]);    MULADD(at[13], at[91]);    MULADD(at[14], at[90]);    MULADD(at[15], at[89]);    MULADD(at[16], at[88]);    MULADD(at[17], at[87]);    MULADD(at[18], at[86]);    MULADD(at[19], at[85]);    MULADD(at[20], at[84]);    MULADD(at[21], at[83]);    MULADD(at[22], at[82]);    MULADD(at[23], at[81]);    MULADD(at[24], at[80]);    MULADD(at[25], at[79]);    MULADD(at[26], at[78]);    MULADD(at[27], at[77]);    MULADD(at[28], at[76]);    MULADD(at[29], at[75]);    MULADD(at[30], at[74]);    MULADD(at[31], at[73]);    MULADD(at[32], at[72]);    MULADD(at[33], at[71]);    MULADD(at[34], at[70]);    MULADD(at[35], at[69]);    MULADD(at[36], at[68]);    MULADD(at[37], at[67]);    MULADD(at[38], at[66]);    MULADD(at[39], at[65]);    MULADD(at[40], at[64]); 
+   COMBA_STORE(C->dp[40]);
+   /* 41 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[105]);    MULADD(at[1], at[104]);    MULADD(at[2], at[103]);    MULADD(at[3], at[102]);    MULADD(at[4], at[101]);    MULADD(at[5], at[100]);    MULADD(at[6], at[99]);    MULADD(at[7], at[98]);    MULADD(at[8], at[97]);    MULADD(at[9], at[96]);    MULADD(at[10], at[95]);    MULADD(at[11], at[94]);    MULADD(at[12], at[93]);    MULADD(at[13], at[92]);    MULADD(at[14], at[91]);    MULADD(at[15], at[90]);    MULADD(at[16], at[89]);    MULADD(at[17], at[88]);    MULADD(at[18], at[87]);    MULADD(at[19], at[86]);    MULADD(at[20], at[85]);    MULADD(at[21], at[84]);    MULADD(at[22], at[83]);    MULADD(at[23], at[82]);    MULADD(at[24], at[81]);    MULADD(at[25], at[80]);    MULADD(at[26], at[79]);    MULADD(at[27], at[78]);    MULADD(at[28], at[77]);    MULADD(at[29], at[76]);    MULADD(at[30], at[75]);    MULADD(at[31], at[74]);    MULADD(at[32], at[73]);    MULADD(at[33], at[72]);    MULADD(at[34], at[71]);    MULADD(at[35], at[70]);    MULADD(at[36], at[69]);    MULADD(at[37], at[68]);    MULADD(at[38], at[67]);    MULADD(at[39], at[66]);    MULADD(at[40], at[65]);    MULADD(at[41], at[64]); 
+   COMBA_STORE(C->dp[41]);
+   /* 42 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[106]);    MULADD(at[1], at[105]);    MULADD(at[2], at[104]);    MULADD(at[3], at[103]);    MULADD(at[4], at[102]);    MULADD(at[5], at[101]);    MULADD(at[6], at[100]);    MULADD(at[7], at[99]);    MULADD(at[8], at[98]);    MULADD(at[9], at[97]);    MULADD(at[10], at[96]);    MULADD(at[11], at[95]);    MULADD(at[12], at[94]);    MULADD(at[13], at[93]);    MULADD(at[14], at[92]);    MULADD(at[15], at[91]);    MULADD(at[16], at[90]);    MULADD(at[17], at[89]);    MULADD(at[18], at[88]);    MULADD(at[19], at[87]);    MULADD(at[20], at[86]);    MULADD(at[21], at[85]);    MULADD(at[22], at[84]);    MULADD(at[23], at[83]);    MULADD(at[24], at[82]);    MULADD(at[25], at[81]);    MULADD(at[26], at[80]);    MULADD(at[27], at[79]);    MULADD(at[28], at[78]);    MULADD(at[29], at[77]);    MULADD(at[30], at[76]);    MULADD(at[31], at[75]);    MULADD(at[32], at[74]);    MULADD(at[33], at[73]);    MULADD(at[34], at[72]);    MULADD(at[35], at[71]);    MULADD(at[36], at[70]);    MULADD(at[37], at[69]);    MULADD(at[38], at[68]);    MULADD(at[39], at[67]);    MULADD(at[40], at[66]);    MULADD(at[41], at[65]);    MULADD(at[42], at[64]); 
+   COMBA_STORE(C->dp[42]);
+   /* 43 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[107]);    MULADD(at[1], at[106]);    MULADD(at[2], at[105]);    MULADD(at[3], at[104]);    MULADD(at[4], at[103]);    MULADD(at[5], at[102]);    MULADD(at[6], at[101]);    MULADD(at[7], at[100]);    MULADD(at[8], at[99]);    MULADD(at[9], at[98]);    MULADD(at[10], at[97]);    MULADD(at[11], at[96]);    MULADD(at[12], at[95]);    MULADD(at[13], at[94]);    MULADD(at[14], at[93]);    MULADD(at[15], at[92]);    MULADD(at[16], at[91]);    MULADD(at[17], at[90]);    MULADD(at[18], at[89]);    MULADD(at[19], at[88]);    MULADD(at[20], at[87]);    MULADD(at[21], at[86]);    MULADD(at[22], at[85]);    MULADD(at[23], at[84]);    MULADD(at[24], at[83]);    MULADD(at[25], at[82]);    MULADD(at[26], at[81]);    MULADD(at[27], at[80]);    MULADD(at[28], at[79]);    MULADD(at[29], at[78]);    MULADD(at[30], at[77]);    MULADD(at[31], at[76]);    MULADD(at[32], at[75]);    MULADD(at[33], at[74]);    MULADD(at[34], at[73]);    MULADD(at[35], at[72]);    MULADD(at[36], at[71]);    MULADD(at[37], at[70]);    MULADD(at[38], at[69]);    MULADD(at[39], at[68]);    MULADD(at[40], at[67]);    MULADD(at[41], at[66]);    MULADD(at[42], at[65]);    MULADD(at[43], at[64]); 
+   COMBA_STORE(C->dp[43]);
+   /* 44 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[108]);    MULADD(at[1], at[107]);    MULADD(at[2], at[106]);    MULADD(at[3], at[105]);    MULADD(at[4], at[104]);    MULADD(at[5], at[103]);    MULADD(at[6], at[102]);    MULADD(at[7], at[101]);    MULADD(at[8], at[100]);    MULADD(at[9], at[99]);    MULADD(at[10], at[98]);    MULADD(at[11], at[97]);    MULADD(at[12], at[96]);    MULADD(at[13], at[95]);    MULADD(at[14], at[94]);    MULADD(at[15], at[93]);    MULADD(at[16], at[92]);    MULADD(at[17], at[91]);    MULADD(at[18], at[90]);    MULADD(at[19], at[89]);    MULADD(at[20], at[88]);    MULADD(at[21], at[87]);    MULADD(at[22], at[86]);    MULADD(at[23], at[85]);    MULADD(at[24], at[84]);    MULADD(at[25], at[83]);    MULADD(at[26], at[82]);    MULADD(at[27], at[81]);    MULADD(at[28], at[80]);    MULADD(at[29], at[79]);    MULADD(at[30], at[78]);    MULADD(at[31], at[77]);    MULADD(at[32], at[76]);    MULADD(at[33], at[75]);    MULADD(at[34], at[74]);    MULADD(at[35], at[73]);    MULADD(at[36], at[72]);    MULADD(at[37], at[71]);    MULADD(at[38], at[70]);    MULADD(at[39], at[69]);    MULADD(at[40], at[68]);    MULADD(at[41], at[67]);    MULADD(at[42], at[66]);    MULADD(at[43], at[65]);    MULADD(at[44], at[64]); 
+   COMBA_STORE(C->dp[44]);
+   /* 45 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[109]);    MULADD(at[1], at[108]);    MULADD(at[2], at[107]);    MULADD(at[3], at[106]);    MULADD(at[4], at[105]);    MULADD(at[5], at[104]);    MULADD(at[6], at[103]);    MULADD(at[7], at[102]);    MULADD(at[8], at[101]);    MULADD(at[9], at[100]);    MULADD(at[10], at[99]);    MULADD(at[11], at[98]);    MULADD(at[12], at[97]);    MULADD(at[13], at[96]);    MULADD(at[14], at[95]);    MULADD(at[15], at[94]);    MULADD(at[16], at[93]);    MULADD(at[17], at[92]);    MULADD(at[18], at[91]);    MULADD(at[19], at[90]);    MULADD(at[20], at[89]);    MULADD(at[21], at[88]);    MULADD(at[22], at[87]);    MULADD(at[23], at[86]);    MULADD(at[24], at[85]);    MULADD(at[25], at[84]);    MULADD(at[26], at[83]);    MULADD(at[27], at[82]);    MULADD(at[28], at[81]);    MULADD(at[29], at[80]);    MULADD(at[30], at[79]);    MULADD(at[31], at[78]);    MULADD(at[32], at[77]);    MULADD(at[33], at[76]);    MULADD(at[34], at[75]);    MULADD(at[35], at[74]);    MULADD(at[36], at[73]);    MULADD(at[37], at[72]);    MULADD(at[38], at[71]);    MULADD(at[39], at[70]);    MULADD(at[40], at[69]);    MULADD(at[41], at[68]);    MULADD(at[42], at[67]);    MULADD(at[43], at[66]);    MULADD(at[44], at[65]);    MULADD(at[45], at[64]); 
+   COMBA_STORE(C->dp[45]);
+   /* 46 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[110]);    MULADD(at[1], at[109]);    MULADD(at[2], at[108]);    MULADD(at[3], at[107]);    MULADD(at[4], at[106]);    MULADD(at[5], at[105]);    MULADD(at[6], at[104]);    MULADD(at[7], at[103]);    MULADD(at[8], at[102]);    MULADD(at[9], at[101]);    MULADD(at[10], at[100]);    MULADD(at[11], at[99]);    MULADD(at[12], at[98]);    MULADD(at[13], at[97]);    MULADD(at[14], at[96]);    MULADD(at[15], at[95]);    MULADD(at[16], at[94]);    MULADD(at[17], at[93]);    MULADD(at[18], at[92]);    MULADD(at[19], at[91]);    MULADD(at[20], at[90]);    MULADD(at[21], at[89]);    MULADD(at[22], at[88]);    MULADD(at[23], at[87]);    MULADD(at[24], at[86]);    MULADD(at[25], at[85]);    MULADD(at[26], at[84]);    MULADD(at[27], at[83]);    MULADD(at[28], at[82]);    MULADD(at[29], at[81]);    MULADD(at[30], at[80]);    MULADD(at[31], at[79]);    MULADD(at[32], at[78]);    MULADD(at[33], at[77]);    MULADD(at[34], at[76]);    MULADD(at[35], at[75]);    MULADD(at[36], at[74]);    MULADD(at[37], at[73]);    MULADD(at[38], at[72]);    MULADD(at[39], at[71]);    MULADD(at[40], at[70]);    MULADD(at[41], at[69]);    MULADD(at[42], at[68]);    MULADD(at[43], at[67]);    MULADD(at[44], at[66]);    MULADD(at[45], at[65]);    MULADD(at[46], at[64]); 
+   COMBA_STORE(C->dp[46]);
+   /* 47 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[111]);    MULADD(at[1], at[110]);    MULADD(at[2], at[109]);    MULADD(at[3], at[108]);    MULADD(at[4], at[107]);    MULADD(at[5], at[106]);    MULADD(at[6], at[105]);    MULADD(at[7], at[104]);    MULADD(at[8], at[103]);    MULADD(at[9], at[102]);    MULADD(at[10], at[101]);    MULADD(at[11], at[100]);    MULADD(at[12], at[99]);    MULADD(at[13], at[98]);    MULADD(at[14], at[97]);    MULADD(at[15], at[96]);    MULADD(at[16], at[95]);    MULADD(at[17], at[94]);    MULADD(at[18], at[93]);    MULADD(at[19], at[92]);    MULADD(at[20], at[91]);    MULADD(at[21], at[90]);    MULADD(at[22], at[89]);    MULADD(at[23], at[88]);    MULADD(at[24], at[87]);    MULADD(at[25], at[86]);    MULADD(at[26], at[85]);    MULADD(at[27], at[84]);    MULADD(at[28], at[83]);    MULADD(at[29], at[82]);    MULADD(at[30], at[81]);    MULADD(at[31], at[80]);    MULADD(at[32], at[79]);    MULADD(at[33], at[78]);    MULADD(at[34], at[77]);    MULADD(at[35], at[76]);    MULADD(at[36], at[75]);    MULADD(at[37], at[74]);    MULADD(at[38], at[73]);    MULADD(at[39], at[72]);    MULADD(at[40], at[71]);    MULADD(at[41], at[70]);    MULADD(at[42], at[69]);    MULADD(at[43], at[68]);    MULADD(at[44], at[67]);    MULADD(at[45], at[66]);    MULADD(at[46], at[65]);    MULADD(at[47], at[64]); 
+   COMBA_STORE(C->dp[47]);
+   /* 48 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[112]);    MULADD(at[1], at[111]);    MULADD(at[2], at[110]);    MULADD(at[3], at[109]);    MULADD(at[4], at[108]);    MULADD(at[5], at[107]);    MULADD(at[6], at[106]);    MULADD(at[7], at[105]);    MULADD(at[8], at[104]);    MULADD(at[9], at[103]);    MULADD(at[10], at[102]);    MULADD(at[11], at[101]);    MULADD(at[12], at[100]);    MULADD(at[13], at[99]);    MULADD(at[14], at[98]);    MULADD(at[15], at[97]);    MULADD(at[16], at[96]);    MULADD(at[17], at[95]);    MULADD(at[18], at[94]);    MULADD(at[19], at[93]);    MULADD(at[20], at[92]);    MULADD(at[21], at[91]);    MULADD(at[22], at[90]);    MULADD(at[23], at[89]);    MULADD(at[24], at[88]);    MULADD(at[25], at[87]);    MULADD(at[26], at[86]);    MULADD(at[27], at[85]);    MULADD(at[28], at[84]);    MULADD(at[29], at[83]);    MULADD(at[30], at[82]);    MULADD(at[31], at[81]);    MULADD(at[32], at[80]);    MULADD(at[33], at[79]);    MULADD(at[34], at[78]);    MULADD(at[35], at[77]);    MULADD(at[36], at[76]);    MULADD(at[37], at[75]);    MULADD(at[38], at[74]);    MULADD(at[39], at[73]);    MULADD(at[40], at[72]);    MULADD(at[41], at[71]);    MULADD(at[42], at[70]);    MULADD(at[43], at[69]);    MULADD(at[44], at[68]);    MULADD(at[45], at[67]);    MULADD(at[46], at[66]);    MULADD(at[47], at[65]);    MULADD(at[48], at[64]); 
+   COMBA_STORE(C->dp[48]);
+   /* 49 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[113]);    MULADD(at[1], at[112]);    MULADD(at[2], at[111]);    MULADD(at[3], at[110]);    MULADD(at[4], at[109]);    MULADD(at[5], at[108]);    MULADD(at[6], at[107]);    MULADD(at[7], at[106]);    MULADD(at[8], at[105]);    MULADD(at[9], at[104]);    MULADD(at[10], at[103]);    MULADD(at[11], at[102]);    MULADD(at[12], at[101]);    MULADD(at[13], at[100]);    MULADD(at[14], at[99]);    MULADD(at[15], at[98]);    MULADD(at[16], at[97]);    MULADD(at[17], at[96]);    MULADD(at[18], at[95]);    MULADD(at[19], at[94]);    MULADD(at[20], at[93]);    MULADD(at[21], at[92]);    MULADD(at[22], at[91]);    MULADD(at[23], at[90]);    MULADD(at[24], at[89]);    MULADD(at[25], at[88]);    MULADD(at[26], at[87]);    MULADD(at[27], at[86]);    MULADD(at[28], at[85]);    MULADD(at[29], at[84]);    MULADD(at[30], at[83]);    MULADD(at[31], at[82]);    MULADD(at[32], at[81]);    MULADD(at[33], at[80]);    MULADD(at[34], at[79]);    MULADD(at[35], at[78]);    MULADD(at[36], at[77]);    MULADD(at[37], at[76]);    MULADD(at[38], at[75]);    MULADD(at[39], at[74]);    MULADD(at[40], at[73]);    MULADD(at[41], at[72]);    MULADD(at[42], at[71]);    MULADD(at[43], at[70]);    MULADD(at[44], at[69]);    MULADD(at[45], at[68]);    MULADD(at[46], at[67]);    MULADD(at[47], at[66]);    MULADD(at[48], at[65]);    MULADD(at[49], at[64]); 
+   COMBA_STORE(C->dp[49]);
+   /* 50 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[114]);    MULADD(at[1], at[113]);    MULADD(at[2], at[112]);    MULADD(at[3], at[111]);    MULADD(at[4], at[110]);    MULADD(at[5], at[109]);    MULADD(at[6], at[108]);    MULADD(at[7], at[107]);    MULADD(at[8], at[106]);    MULADD(at[9], at[105]);    MULADD(at[10], at[104]);    MULADD(at[11], at[103]);    MULADD(at[12], at[102]);    MULADD(at[13], at[101]);    MULADD(at[14], at[100]);    MULADD(at[15], at[99]);    MULADD(at[16], at[98]);    MULADD(at[17], at[97]);    MULADD(at[18], at[96]);    MULADD(at[19], at[95]);    MULADD(at[20], at[94]);    MULADD(at[21], at[93]);    MULADD(at[22], at[92]);    MULADD(at[23], at[91]);    MULADD(at[24], at[90]);    MULADD(at[25], at[89]);    MULADD(at[26], at[88]);    MULADD(at[27], at[87]);    MULADD(at[28], at[86]);    MULADD(at[29], at[85]);    MULADD(at[30], at[84]);    MULADD(at[31], at[83]);    MULADD(at[32], at[82]);    MULADD(at[33], at[81]);    MULADD(at[34], at[80]);    MULADD(at[35], at[79]);    MULADD(at[36], at[78]);    MULADD(at[37], at[77]);    MULADD(at[38], at[76]);    MULADD(at[39], at[75]);    MULADD(at[40], at[74]);    MULADD(at[41], at[73]);    MULADD(at[42], at[72]);    MULADD(at[43], at[71]);    MULADD(at[44], at[70]);    MULADD(at[45], at[69]);    MULADD(at[46], at[68]);    MULADD(at[47], at[67]);    MULADD(at[48], at[66]);    MULADD(at[49], at[65]);    MULADD(at[50], at[64]); 
+   COMBA_STORE(C->dp[50]);
+   /* 51 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[115]);    MULADD(at[1], at[114]);    MULADD(at[2], at[113]);    MULADD(at[3], at[112]);    MULADD(at[4], at[111]);    MULADD(at[5], at[110]);    MULADD(at[6], at[109]);    MULADD(at[7], at[108]);    MULADD(at[8], at[107]);    MULADD(at[9], at[106]);    MULADD(at[10], at[105]);    MULADD(at[11], at[104]);    MULADD(at[12], at[103]);    MULADD(at[13], at[102]);    MULADD(at[14], at[101]);    MULADD(at[15], at[100]);    MULADD(at[16], at[99]);    MULADD(at[17], at[98]);    MULADD(at[18], at[97]);    MULADD(at[19], at[96]);    MULADD(at[20], at[95]);    MULADD(at[21], at[94]);    MULADD(at[22], at[93]);    MULADD(at[23], at[92]);    MULADD(at[24], at[91]);    MULADD(at[25], at[90]);    MULADD(at[26], at[89]);    MULADD(at[27], at[88]);    MULADD(at[28], at[87]);    MULADD(at[29], at[86]);    MULADD(at[30], at[85]);    MULADD(at[31], at[84]);    MULADD(at[32], at[83]);    MULADD(at[33], at[82]);    MULADD(at[34], at[81]);    MULADD(at[35], at[80]);    MULADD(at[36], at[79]);    MULADD(at[37], at[78]);    MULADD(at[38], at[77]);    MULADD(at[39], at[76]);    MULADD(at[40], at[75]);    MULADD(at[41], at[74]);    MULADD(at[42], at[73]);    MULADD(at[43], at[72]);    MULADD(at[44], at[71]);    MULADD(at[45], at[70]);    MULADD(at[46], at[69]);    MULADD(at[47], at[68]);    MULADD(at[48], at[67]);    MULADD(at[49], at[66]);    MULADD(at[50], at[65]);    MULADD(at[51], at[64]); 
+   COMBA_STORE(C->dp[51]);
+   /* 52 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[116]);    MULADD(at[1], at[115]);    MULADD(at[2], at[114]);    MULADD(at[3], at[113]);    MULADD(at[4], at[112]);    MULADD(at[5], at[111]);    MULADD(at[6], at[110]);    MULADD(at[7], at[109]);    MULADD(at[8], at[108]);    MULADD(at[9], at[107]);    MULADD(at[10], at[106]);    MULADD(at[11], at[105]);    MULADD(at[12], at[104]);    MULADD(at[13], at[103]);    MULADD(at[14], at[102]);    MULADD(at[15], at[101]);    MULADD(at[16], at[100]);    MULADD(at[17], at[99]);    MULADD(at[18], at[98]);    MULADD(at[19], at[97]);    MULADD(at[20], at[96]);    MULADD(at[21], at[95]);    MULADD(at[22], at[94]);    MULADD(at[23], at[93]);    MULADD(at[24], at[92]);    MULADD(at[25], at[91]);    MULADD(at[26], at[90]);    MULADD(at[27], at[89]);    MULADD(at[28], at[88]);    MULADD(at[29], at[87]);    MULADD(at[30], at[86]);    MULADD(at[31], at[85]);    MULADD(at[32], at[84]);    MULADD(at[33], at[83]);    MULADD(at[34], at[82]);    MULADD(at[35], at[81]);    MULADD(at[36], at[80]);    MULADD(at[37], at[79]);    MULADD(at[38], at[78]);    MULADD(at[39], at[77]);    MULADD(at[40], at[76]);    MULADD(at[41], at[75]);    MULADD(at[42], at[74]);    MULADD(at[43], at[73]);    MULADD(at[44], at[72]);    MULADD(at[45], at[71]);    MULADD(at[46], at[70]);    MULADD(at[47], at[69]);    MULADD(at[48], at[68]);    MULADD(at[49], at[67]);    MULADD(at[50], at[66]);    MULADD(at[51], at[65]);    MULADD(at[52], at[64]); 
+   COMBA_STORE(C->dp[52]);
+   /* 53 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[117]);    MULADD(at[1], at[116]);    MULADD(at[2], at[115]);    MULADD(at[3], at[114]);    MULADD(at[4], at[113]);    MULADD(at[5], at[112]);    MULADD(at[6], at[111]);    MULADD(at[7], at[110]);    MULADD(at[8], at[109]);    MULADD(at[9], at[108]);    MULADD(at[10], at[107]);    MULADD(at[11], at[106]);    MULADD(at[12], at[105]);    MULADD(at[13], at[104]);    MULADD(at[14], at[103]);    MULADD(at[15], at[102]);    MULADD(at[16], at[101]);    MULADD(at[17], at[100]);    MULADD(at[18], at[99]);    MULADD(at[19], at[98]);    MULADD(at[20], at[97]);    MULADD(at[21], at[96]);    MULADD(at[22], at[95]);    MULADD(at[23], at[94]);    MULADD(at[24], at[93]);    MULADD(at[25], at[92]);    MULADD(at[26], at[91]);    MULADD(at[27], at[90]);    MULADD(at[28], at[89]);    MULADD(at[29], at[88]);    MULADD(at[30], at[87]);    MULADD(at[31], at[86]);    MULADD(at[32], at[85]);    MULADD(at[33], at[84]);    MULADD(at[34], at[83]);    MULADD(at[35], at[82]);    MULADD(at[36], at[81]);    MULADD(at[37], at[80]);    MULADD(at[38], at[79]);    MULADD(at[39], at[78]);    MULADD(at[40], at[77]);    MULADD(at[41], at[76]);    MULADD(at[42], at[75]);    MULADD(at[43], at[74]);    MULADD(at[44], at[73]);    MULADD(at[45], at[72]);    MULADD(at[46], at[71]);    MULADD(at[47], at[70]);    MULADD(at[48], at[69]);    MULADD(at[49], at[68]);    MULADD(at[50], at[67]);    MULADD(at[51], at[66]);    MULADD(at[52], at[65]);    MULADD(at[53], at[64]); 
+   COMBA_STORE(C->dp[53]);
+   /* 54 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[118]);    MULADD(at[1], at[117]);    MULADD(at[2], at[116]);    MULADD(at[3], at[115]);    MULADD(at[4], at[114]);    MULADD(at[5], at[113]);    MULADD(at[6], at[112]);    MULADD(at[7], at[111]);    MULADD(at[8], at[110]);    MULADD(at[9], at[109]);    MULADD(at[10], at[108]);    MULADD(at[11], at[107]);    MULADD(at[12], at[106]);    MULADD(at[13], at[105]);    MULADD(at[14], at[104]);    MULADD(at[15], at[103]);    MULADD(at[16], at[102]);    MULADD(at[17], at[101]);    MULADD(at[18], at[100]);    MULADD(at[19], at[99]);    MULADD(at[20], at[98]);    MULADD(at[21], at[97]);    MULADD(at[22], at[96]);    MULADD(at[23], at[95]);    MULADD(at[24], at[94]);    MULADD(at[25], at[93]);    MULADD(at[26], at[92]);    MULADD(at[27], at[91]);    MULADD(at[28], at[90]);    MULADD(at[29], at[89]);    MULADD(at[30], at[88]);    MULADD(at[31], at[87]);    MULADD(at[32], at[86]);    MULADD(at[33], at[85]);    MULADD(at[34], at[84]);    MULADD(at[35], at[83]);    MULADD(at[36], at[82]);    MULADD(at[37], at[81]);    MULADD(at[38], at[80]);    MULADD(at[39], at[79]);    MULADD(at[40], at[78]);    MULADD(at[41], at[77]);    MULADD(at[42], at[76]);    MULADD(at[43], at[75]);    MULADD(at[44], at[74]);    MULADD(at[45], at[73]);    MULADD(at[46], at[72]);    MULADD(at[47], at[71]);    MULADD(at[48], at[70]);    MULADD(at[49], at[69]);    MULADD(at[50], at[68]);    MULADD(at[51], at[67]);    MULADD(at[52], at[66]);    MULADD(at[53], at[65]);    MULADD(at[54], at[64]); 
+   COMBA_STORE(C->dp[54]);
+   /* 55 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[119]);    MULADD(at[1], at[118]);    MULADD(at[2], at[117]);    MULADD(at[3], at[116]);    MULADD(at[4], at[115]);    MULADD(at[5], at[114]);    MULADD(at[6], at[113]);    MULADD(at[7], at[112]);    MULADD(at[8], at[111]);    MULADD(at[9], at[110]);    MULADD(at[10], at[109]);    MULADD(at[11], at[108]);    MULADD(at[12], at[107]);    MULADD(at[13], at[106]);    MULADD(at[14], at[105]);    MULADD(at[15], at[104]);    MULADD(at[16], at[103]);    MULADD(at[17], at[102]);    MULADD(at[18], at[101]);    MULADD(at[19], at[100]);    MULADD(at[20], at[99]);    MULADD(at[21], at[98]);    MULADD(at[22], at[97]);    MULADD(at[23], at[96]);    MULADD(at[24], at[95]);    MULADD(at[25], at[94]);    MULADD(at[26], at[93]);    MULADD(at[27], at[92]);    MULADD(at[28], at[91]);    MULADD(at[29], at[90]);    MULADD(at[30], at[89]);    MULADD(at[31], at[88]);    MULADD(at[32], at[87]);    MULADD(at[33], at[86]);    MULADD(at[34], at[85]);    MULADD(at[35], at[84]);    MULADD(at[36], at[83]);    MULADD(at[37], at[82]);    MULADD(at[38], at[81]);    MULADD(at[39], at[80]);    MULADD(at[40], at[79]);    MULADD(at[41], at[78]);    MULADD(at[42], at[77]);    MULADD(at[43], at[76]);    MULADD(at[44], at[75]);    MULADD(at[45], at[74]);    MULADD(at[46], at[73]);    MULADD(at[47], at[72]);    MULADD(at[48], at[71]);    MULADD(at[49], at[70]);    MULADD(at[50], at[69]);    MULADD(at[51], at[68]);    MULADD(at[52], at[67]);    MULADD(at[53], at[66]);    MULADD(at[54], at[65]);    MULADD(at[55], at[64]); 
+   COMBA_STORE(C->dp[55]);
+   /* 56 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[120]);    MULADD(at[1], at[119]);    MULADD(at[2], at[118]);    MULADD(at[3], at[117]);    MULADD(at[4], at[116]);    MULADD(at[5], at[115]);    MULADD(at[6], at[114]);    MULADD(at[7], at[113]);    MULADD(at[8], at[112]);    MULADD(at[9], at[111]);    MULADD(at[10], at[110]);    MULADD(at[11], at[109]);    MULADD(at[12], at[108]);    MULADD(at[13], at[107]);    MULADD(at[14], at[106]);    MULADD(at[15], at[105]);    MULADD(at[16], at[104]);    MULADD(at[17], at[103]);    MULADD(at[18], at[102]);    MULADD(at[19], at[101]);    MULADD(at[20], at[100]);    MULADD(at[21], at[99]);    MULADD(at[22], at[98]);    MULADD(at[23], at[97]);    MULADD(at[24], at[96]);    MULADD(at[25], at[95]);    MULADD(at[26], at[94]);    MULADD(at[27], at[93]);    MULADD(at[28], at[92]);    MULADD(at[29], at[91]);    MULADD(at[30], at[90]);    MULADD(at[31], at[89]);    MULADD(at[32], at[88]);    MULADD(at[33], at[87]);    MULADD(at[34], at[86]);    MULADD(at[35], at[85]);    MULADD(at[36], at[84]);    MULADD(at[37], at[83]);    MULADD(at[38], at[82]);    MULADD(at[39], at[81]);    MULADD(at[40], at[80]);    MULADD(at[41], at[79]);    MULADD(at[42], at[78]);    MULADD(at[43], at[77]);    MULADD(at[44], at[76]);    MULADD(at[45], at[75]);    MULADD(at[46], at[74]);    MULADD(at[47], at[73]);    MULADD(at[48], at[72]);    MULADD(at[49], at[71]);    MULADD(at[50], at[70]);    MULADD(at[51], at[69]);    MULADD(at[52], at[68]);    MULADD(at[53], at[67]);    MULADD(at[54], at[66]);    MULADD(at[55], at[65]);    MULADD(at[56], at[64]); 
+   COMBA_STORE(C->dp[56]);
+   /* 57 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[121]);    MULADD(at[1], at[120]);    MULADD(at[2], at[119]);    MULADD(at[3], at[118]);    MULADD(at[4], at[117]);    MULADD(at[5], at[116]);    MULADD(at[6], at[115]);    MULADD(at[7], at[114]);    MULADD(at[8], at[113]);    MULADD(at[9], at[112]);    MULADD(at[10], at[111]);    MULADD(at[11], at[110]);    MULADD(at[12], at[109]);    MULADD(at[13], at[108]);    MULADD(at[14], at[107]);    MULADD(at[15], at[106]);    MULADD(at[16], at[105]);    MULADD(at[17], at[104]);    MULADD(at[18], at[103]);    MULADD(at[19], at[102]);    MULADD(at[20], at[101]);    MULADD(at[21], at[100]);    MULADD(at[22], at[99]);    MULADD(at[23], at[98]);    MULADD(at[24], at[97]);    MULADD(at[25], at[96]);    MULADD(at[26], at[95]);    MULADD(at[27], at[94]);    MULADD(at[28], at[93]);    MULADD(at[29], at[92]);    MULADD(at[30], at[91]);    MULADD(at[31], at[90]);    MULADD(at[32], at[89]);    MULADD(at[33], at[88]);    MULADD(at[34], at[87]);    MULADD(at[35], at[86]);    MULADD(at[36], at[85]);    MULADD(at[37], at[84]);    MULADD(at[38], at[83]);    MULADD(at[39], at[82]);    MULADD(at[40], at[81]);    MULADD(at[41], at[80]);    MULADD(at[42], at[79]);    MULADD(at[43], at[78]);    MULADD(at[44], at[77]);    MULADD(at[45], at[76]);    MULADD(at[46], at[75]);    MULADD(at[47], at[74]);    MULADD(at[48], at[73]);    MULADD(at[49], at[72]);    MULADD(at[50], at[71]);    MULADD(at[51], at[70]);    MULADD(at[52], at[69]);    MULADD(at[53], at[68]);    MULADD(at[54], at[67]);    MULADD(at[55], at[66]);    MULADD(at[56], at[65]);    MULADD(at[57], at[64]); 
+   COMBA_STORE(C->dp[57]);
+   /* 58 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[122]);    MULADD(at[1], at[121]);    MULADD(at[2], at[120]);    MULADD(at[3], at[119]);    MULADD(at[4], at[118]);    MULADD(at[5], at[117]);    MULADD(at[6], at[116]);    MULADD(at[7], at[115]);    MULADD(at[8], at[114]);    MULADD(at[9], at[113]);    MULADD(at[10], at[112]);    MULADD(at[11], at[111]);    MULADD(at[12], at[110]);    MULADD(at[13], at[109]);    MULADD(at[14], at[108]);    MULADD(at[15], at[107]);    MULADD(at[16], at[106]);    MULADD(at[17], at[105]);    MULADD(at[18], at[104]);    MULADD(at[19], at[103]);    MULADD(at[20], at[102]);    MULADD(at[21], at[101]);    MULADD(at[22], at[100]);    MULADD(at[23], at[99]);    MULADD(at[24], at[98]);    MULADD(at[25], at[97]);    MULADD(at[26], at[96]);    MULADD(at[27], at[95]);    MULADD(at[28], at[94]);    MULADD(at[29], at[93]);    MULADD(at[30], at[92]);    MULADD(at[31], at[91]);    MULADD(at[32], at[90]);    MULADD(at[33], at[89]);    MULADD(at[34], at[88]);    MULADD(at[35], at[87]);    MULADD(at[36], at[86]);    MULADD(at[37], at[85]);    MULADD(at[38], at[84]);    MULADD(at[39], at[83]);    MULADD(at[40], at[82]);    MULADD(at[41], at[81]);    MULADD(at[42], at[80]);    MULADD(at[43], at[79]);    MULADD(at[44], at[78]);    MULADD(at[45], at[77]);    MULADD(at[46], at[76]);    MULADD(at[47], at[75]);    MULADD(at[48], at[74]);    MULADD(at[49], at[73]);    MULADD(at[50], at[72]);    MULADD(at[51], at[71]);    MULADD(at[52], at[70]);    MULADD(at[53], at[69]);    MULADD(at[54], at[68]);    MULADD(at[55], at[67]);    MULADD(at[56], at[66]);    MULADD(at[57], at[65]);    MULADD(at[58], at[64]); 
+   COMBA_STORE(C->dp[58]);
+   /* 59 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[123]);    MULADD(at[1], at[122]);    MULADD(at[2], at[121]);    MULADD(at[3], at[120]);    MULADD(at[4], at[119]);    MULADD(at[5], at[118]);    MULADD(at[6], at[117]);    MULADD(at[7], at[116]);    MULADD(at[8], at[115]);    MULADD(at[9], at[114]);    MULADD(at[10], at[113]);    MULADD(at[11], at[112]);    MULADD(at[12], at[111]);    MULADD(at[13], at[110]);    MULADD(at[14], at[109]);    MULADD(at[15], at[108]);    MULADD(at[16], at[107]);    MULADD(at[17], at[106]);    MULADD(at[18], at[105]);    MULADD(at[19], at[104]);    MULADD(at[20], at[103]);    MULADD(at[21], at[102]);    MULADD(at[22], at[101]);    MULADD(at[23], at[100]);    MULADD(at[24], at[99]);    MULADD(at[25], at[98]);    MULADD(at[26], at[97]);    MULADD(at[27], at[96]);    MULADD(at[28], at[95]);    MULADD(at[29], at[94]);    MULADD(at[30], at[93]);    MULADD(at[31], at[92]);    MULADD(at[32], at[91]);    MULADD(at[33], at[90]);    MULADD(at[34], at[89]);    MULADD(at[35], at[88]);    MULADD(at[36], at[87]);    MULADD(at[37], at[86]);    MULADD(at[38], at[85]);    MULADD(at[39], at[84]);    MULADD(at[40], at[83]);    MULADD(at[41], at[82]);    MULADD(at[42], at[81]);    MULADD(at[43], at[80]);    MULADD(at[44], at[79]);    MULADD(at[45], at[78]);    MULADD(at[46], at[77]);    MULADD(at[47], at[76]);    MULADD(at[48], at[75]);    MULADD(at[49], at[74]);    MULADD(at[50], at[73]);    MULADD(at[51], at[72]);    MULADD(at[52], at[71]);    MULADD(at[53], at[70]);    MULADD(at[54], at[69]);    MULADD(at[55], at[68]);    MULADD(at[56], at[67]);    MULADD(at[57], at[66]);    MULADD(at[58], at[65]);    MULADD(at[59], at[64]); 
+   COMBA_STORE(C->dp[59]);
+   /* 60 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[124]);    MULADD(at[1], at[123]);    MULADD(at[2], at[122]);    MULADD(at[3], at[121]);    MULADD(at[4], at[120]);    MULADD(at[5], at[119]);    MULADD(at[6], at[118]);    MULADD(at[7], at[117]);    MULADD(at[8], at[116]);    MULADD(at[9], at[115]);    MULADD(at[10], at[114]);    MULADD(at[11], at[113]);    MULADD(at[12], at[112]);    MULADD(at[13], at[111]);    MULADD(at[14], at[110]);    MULADD(at[15], at[109]);    MULADD(at[16], at[108]);    MULADD(at[17], at[107]);    MULADD(at[18], at[106]);    MULADD(at[19], at[105]);    MULADD(at[20], at[104]);    MULADD(at[21], at[103]);    MULADD(at[22], at[102]);    MULADD(at[23], at[101]);    MULADD(at[24], at[100]);    MULADD(at[25], at[99]);    MULADD(at[26], at[98]);    MULADD(at[27], at[97]);    MULADD(at[28], at[96]);    MULADD(at[29], at[95]);    MULADD(at[30], at[94]);    MULADD(at[31], at[93]);    MULADD(at[32], at[92]);    MULADD(at[33], at[91]);    MULADD(at[34], at[90]);    MULADD(at[35], at[89]);    MULADD(at[36], at[88]);    MULADD(at[37], at[87]);    MULADD(at[38], at[86]);    MULADD(at[39], at[85]);    MULADD(at[40], at[84]);    MULADD(at[41], at[83]);    MULADD(at[42], at[82]);    MULADD(at[43], at[81]);    MULADD(at[44], at[80]);    MULADD(at[45], at[79]);    MULADD(at[46], at[78]);    MULADD(at[47], at[77]);    MULADD(at[48], at[76]);    MULADD(at[49], at[75]);    MULADD(at[50], at[74]);    MULADD(at[51], at[73]);    MULADD(at[52], at[72]);    MULADD(at[53], at[71]);    MULADD(at[54], at[70]);    MULADD(at[55], at[69]);    MULADD(at[56], at[68]);    MULADD(at[57], at[67]);    MULADD(at[58], at[66]);    MULADD(at[59], at[65]);    MULADD(at[60], at[64]); 
+   COMBA_STORE(C->dp[60]);
+   /* 61 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[125]);    MULADD(at[1], at[124]);    MULADD(at[2], at[123]);    MULADD(at[3], at[122]);    MULADD(at[4], at[121]);    MULADD(at[5], at[120]);    MULADD(at[6], at[119]);    MULADD(at[7], at[118]);    MULADD(at[8], at[117]);    MULADD(at[9], at[116]);    MULADD(at[10], at[115]);    MULADD(at[11], at[114]);    MULADD(at[12], at[113]);    MULADD(at[13], at[112]);    MULADD(at[14], at[111]);    MULADD(at[15], at[110]);    MULADD(at[16], at[109]);    MULADD(at[17], at[108]);    MULADD(at[18], at[107]);    MULADD(at[19], at[106]);    MULADD(at[20], at[105]);    MULADD(at[21], at[104]);    MULADD(at[22], at[103]);    MULADD(at[23], at[102]);    MULADD(at[24], at[101]);    MULADD(at[25], at[100]);    MULADD(at[26], at[99]);    MULADD(at[27], at[98]);    MULADD(at[28], at[97]);    MULADD(at[29], at[96]);    MULADD(at[30], at[95]);    MULADD(at[31], at[94]);    MULADD(at[32], at[93]);    MULADD(at[33], at[92]);    MULADD(at[34], at[91]);    MULADD(at[35], at[90]);    MULADD(at[36], at[89]);    MULADD(at[37], at[88]);    MULADD(at[38], at[87]);    MULADD(at[39], at[86]);    MULADD(at[40], at[85]);    MULADD(at[41], at[84]);    MULADD(at[42], at[83]);    MULADD(at[43], at[82]);    MULADD(at[44], at[81]);    MULADD(at[45], at[80]);    MULADD(at[46], at[79]);    MULADD(at[47], at[78]);    MULADD(at[48], at[77]);    MULADD(at[49], at[76]);    MULADD(at[50], at[75]);    MULADD(at[51], at[74]);    MULADD(at[52], at[73]);    MULADD(at[53], at[72]);    MULADD(at[54], at[71]);    MULADD(at[55], at[70]);    MULADD(at[56], at[69]);    MULADD(at[57], at[68]);    MULADD(at[58], at[67]);    MULADD(at[59], at[66]);    MULADD(at[60], at[65]);    MULADD(at[61], at[64]); 
+   COMBA_STORE(C->dp[61]);
+   /* 62 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[126]);    MULADD(at[1], at[125]);    MULADD(at[2], at[124]);    MULADD(at[3], at[123]);    MULADD(at[4], at[122]);    MULADD(at[5], at[121]);    MULADD(at[6], at[120]);    MULADD(at[7], at[119]);    MULADD(at[8], at[118]);    MULADD(at[9], at[117]);    MULADD(at[10], at[116]);    MULADD(at[11], at[115]);    MULADD(at[12], at[114]);    MULADD(at[13], at[113]);    MULADD(at[14], at[112]);    MULADD(at[15], at[111]);    MULADD(at[16], at[110]);    MULADD(at[17], at[109]);    MULADD(at[18], at[108]);    MULADD(at[19], at[107]);    MULADD(at[20], at[106]);    MULADD(at[21], at[105]);    MULADD(at[22], at[104]);    MULADD(at[23], at[103]);    MULADD(at[24], at[102]);    MULADD(at[25], at[101]);    MULADD(at[26], at[100]);    MULADD(at[27], at[99]);    MULADD(at[28], at[98]);    MULADD(at[29], at[97]);    MULADD(at[30], at[96]);    MULADD(at[31], at[95]);    MULADD(at[32], at[94]);    MULADD(at[33], at[93]);    MULADD(at[34], at[92]);    MULADD(at[35], at[91]);    MULADD(at[36], at[90]);    MULADD(at[37], at[89]);    MULADD(at[38], at[88]);    MULADD(at[39], at[87]);    MULADD(at[40], at[86]);    MULADD(at[41], at[85]);    MULADD(at[42], at[84]);    MULADD(at[43], at[83]);    MULADD(at[44], at[82]);    MULADD(at[45], at[81]);    MULADD(at[46], at[80]);    MULADD(at[47], at[79]);    MULADD(at[48], at[78]);    MULADD(at[49], at[77]);    MULADD(at[50], at[76]);    MULADD(at[51], at[75]);    MULADD(at[52], at[74]);    MULADD(at[53], at[73]);    MULADD(at[54], at[72]);    MULADD(at[55], at[71]);    MULADD(at[56], at[70]);    MULADD(at[57], at[69]);    MULADD(at[58], at[68]);    MULADD(at[59], at[67]);    MULADD(at[60], at[66]);    MULADD(at[61], at[65]);    MULADD(at[62], at[64]); 
+   COMBA_STORE(C->dp[62]);
+   /* 63 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[127]);    MULADD(at[1], at[126]);    MULADD(at[2], at[125]);    MULADD(at[3], at[124]);    MULADD(at[4], at[123]);    MULADD(at[5], at[122]);    MULADD(at[6], at[121]);    MULADD(at[7], at[120]);    MULADD(at[8], at[119]);    MULADD(at[9], at[118]);    MULADD(at[10], at[117]);    MULADD(at[11], at[116]);    MULADD(at[12], at[115]);    MULADD(at[13], at[114]);    MULADD(at[14], at[113]);    MULADD(at[15], at[112]);    MULADD(at[16], at[111]);    MULADD(at[17], at[110]);    MULADD(at[18], at[109]);    MULADD(at[19], at[108]);    MULADD(at[20], at[107]);    MULADD(at[21], at[106]);    MULADD(at[22], at[105]);    MULADD(at[23], at[104]);    MULADD(at[24], at[103]);    MULADD(at[25], at[102]);    MULADD(at[26], at[101]);    MULADD(at[27], at[100]);    MULADD(at[28], at[99]);    MULADD(at[29], at[98]);    MULADD(at[30], at[97]);    MULADD(at[31], at[96]);    MULADD(at[32], at[95]);    MULADD(at[33], at[94]);    MULADD(at[34], at[93]);    MULADD(at[35], at[92]);    MULADD(at[36], at[91]);    MULADD(at[37], at[90]);    MULADD(at[38], at[89]);    MULADD(at[39], at[88]);    MULADD(at[40], at[87]);    MULADD(at[41], at[86]);    MULADD(at[42], at[85]);    MULADD(at[43], at[84]);    MULADD(at[44], at[83]);    MULADD(at[45], at[82]);    MULADD(at[46], at[81]);    MULADD(at[47], at[80]);    MULADD(at[48], at[79]);    MULADD(at[49], at[78]);    MULADD(at[50], at[77]);    MULADD(at[51], at[76]);    MULADD(at[52], at[75]);    MULADD(at[53], at[74]);    MULADD(at[54], at[73]);    MULADD(at[55], at[72]);    MULADD(at[56], at[71]);    MULADD(at[57], at[70]);    MULADD(at[58], at[69]);    MULADD(at[59], at[68]);    MULADD(at[60], at[67]);    MULADD(at[61], at[66]);    MULADD(at[62], at[65]);    MULADD(at[63], at[64]); 
+   COMBA_STORE(C->dp[63]);
+   /* 64 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[127]);    MULADD(at[2], at[126]);    MULADD(at[3], at[125]);    MULADD(at[4], at[124]);    MULADD(at[5], at[123]);    MULADD(at[6], at[122]);    MULADD(at[7], at[121]);    MULADD(at[8], at[120]);    MULADD(at[9], at[119]);    MULADD(at[10], at[118]);    MULADD(at[11], at[117]);    MULADD(at[12], at[116]);    MULADD(at[13], at[115]);    MULADD(at[14], at[114]);    MULADD(at[15], at[113]);    MULADD(at[16], at[112]);    MULADD(at[17], at[111]);    MULADD(at[18], at[110]);    MULADD(at[19], at[109]);    MULADD(at[20], at[108]);    MULADD(at[21], at[107]);    MULADD(at[22], at[106]);    MULADD(at[23], at[105]);    MULADD(at[24], at[104]);    MULADD(at[25], at[103]);    MULADD(at[26], at[102]);    MULADD(at[27], at[101]);    MULADD(at[28], at[100]);    MULADD(at[29], at[99]);    MULADD(at[30], at[98]);    MULADD(at[31], at[97]);    MULADD(at[32], at[96]);    MULADD(at[33], at[95]);    MULADD(at[34], at[94]);    MULADD(at[35], at[93]);    MULADD(at[36], at[92]);    MULADD(at[37], at[91]);    MULADD(at[38], at[90]);    MULADD(at[39], at[89]);    MULADD(at[40], at[88]);    MULADD(at[41], at[87]);    MULADD(at[42], at[86]);    MULADD(at[43], at[85]);    MULADD(at[44], at[84]);    MULADD(at[45], at[83]);    MULADD(at[46], at[82]);    MULADD(at[47], at[81]);    MULADD(at[48], at[80]);    MULADD(at[49], at[79]);    MULADD(at[50], at[78]);    MULADD(at[51], at[77]);    MULADD(at[52], at[76]);    MULADD(at[53], at[75]);    MULADD(at[54], at[74]);    MULADD(at[55], at[73]);    MULADD(at[56], at[72]);    MULADD(at[57], at[71]);    MULADD(at[58], at[70]);    MULADD(at[59], at[69]);    MULADD(at[60], at[68]);    MULADD(at[61], at[67]);    MULADD(at[62], at[66]);    MULADD(at[63], at[65]); 
+   COMBA_STORE(C->dp[64]);
+   /* 65 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[127]);    MULADD(at[3], at[126]);    MULADD(at[4], at[125]);    MULADD(at[5], at[124]);    MULADD(at[6], at[123]);    MULADD(at[7], at[122]);    MULADD(at[8], at[121]);    MULADD(at[9], at[120]);    MULADD(at[10], at[119]);    MULADD(at[11], at[118]);    MULADD(at[12], at[117]);    MULADD(at[13], at[116]);    MULADD(at[14], at[115]);    MULADD(at[15], at[114]);    MULADD(at[16], at[113]);    MULADD(at[17], at[112]);    MULADD(at[18], at[111]);    MULADD(at[19], at[110]);    MULADD(at[20], at[109]);    MULADD(at[21], at[108]);    MULADD(at[22], at[107]);    MULADD(at[23], at[106]);    MULADD(at[24], at[105]);    MULADD(at[25], at[104]);    MULADD(at[26], at[103]);    MULADD(at[27], at[102]);    MULADD(at[28], at[101]);    MULADD(at[29], at[100]);    MULADD(at[30], at[99]);    MULADD(at[31], at[98]);    MULADD(at[32], at[97]);    MULADD(at[33], at[96]);    MULADD(at[34], at[95]);    MULADD(at[35], at[94]);    MULADD(at[36], at[93]);    MULADD(at[37], at[92]);    MULADD(at[38], at[91]);    MULADD(at[39], at[90]);    MULADD(at[40], at[89]);    MULADD(at[41], at[88]);    MULADD(at[42], at[87]);    MULADD(at[43], at[86]);    MULADD(at[44], at[85]);    MULADD(at[45], at[84]);    MULADD(at[46], at[83]);    MULADD(at[47], at[82]);    MULADD(at[48], at[81]);    MULADD(at[49], at[80]);    MULADD(at[50], at[79]);    MULADD(at[51], at[78]);    MULADD(at[52], at[77]);    MULADD(at[53], at[76]);    MULADD(at[54], at[75]);    MULADD(at[55], at[74]);    MULADD(at[56], at[73]);    MULADD(at[57], at[72]);    MULADD(at[58], at[71]);    MULADD(at[59], at[70]);    MULADD(at[60], at[69]);    MULADD(at[61], at[68]);    MULADD(at[62], at[67]);    MULADD(at[63], at[66]); 
+   COMBA_STORE(C->dp[65]);
+   /* 66 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[127]);    MULADD(at[4], at[126]);    MULADD(at[5], at[125]);    MULADD(at[6], at[124]);    MULADD(at[7], at[123]);    MULADD(at[8], at[122]);    MULADD(at[9], at[121]);    MULADD(at[10], at[120]);    MULADD(at[11], at[119]);    MULADD(at[12], at[118]);    MULADD(at[13], at[117]);    MULADD(at[14], at[116]);    MULADD(at[15], at[115]);    MULADD(at[16], at[114]);    MULADD(at[17], at[113]);    MULADD(at[18], at[112]);    MULADD(at[19], at[111]);    MULADD(at[20], at[110]);    MULADD(at[21], at[109]);    MULADD(at[22], at[108]);    MULADD(at[23], at[107]);    MULADD(at[24], at[106]);    MULADD(at[25], at[105]);    MULADD(at[26], at[104]);    MULADD(at[27], at[103]);    MULADD(at[28], at[102]);    MULADD(at[29], at[101]);    MULADD(at[30], at[100]);    MULADD(at[31], at[99]);    MULADD(at[32], at[98]);    MULADD(at[33], at[97]);    MULADD(at[34], at[96]);    MULADD(at[35], at[95]);    MULADD(at[36], at[94]);    MULADD(at[37], at[93]);    MULADD(at[38], at[92]);    MULADD(at[39], at[91]);    MULADD(at[40], at[90]);    MULADD(at[41], at[89]);    MULADD(at[42], at[88]);    MULADD(at[43], at[87]);    MULADD(at[44], at[86]);    MULADD(at[45], at[85]);    MULADD(at[46], at[84]);    MULADD(at[47], at[83]);    MULADD(at[48], at[82]);    MULADD(at[49], at[81]);    MULADD(at[50], at[80]);    MULADD(at[51], at[79]);    MULADD(at[52], at[78]);    MULADD(at[53], at[77]);    MULADD(at[54], at[76]);    MULADD(at[55], at[75]);    MULADD(at[56], at[74]);    MULADD(at[57], at[73]);    MULADD(at[58], at[72]);    MULADD(at[59], at[71]);    MULADD(at[60], at[70]);    MULADD(at[61], at[69]);    MULADD(at[62], at[68]);    MULADD(at[63], at[67]); 
+   COMBA_STORE(C->dp[66]);
+   /* 67 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[127]);    MULADD(at[5], at[126]);    MULADD(at[6], at[125]);    MULADD(at[7], at[124]);    MULADD(at[8], at[123]);    MULADD(at[9], at[122]);    MULADD(at[10], at[121]);    MULADD(at[11], at[120]);    MULADD(at[12], at[119]);    MULADD(at[13], at[118]);    MULADD(at[14], at[117]);    MULADD(at[15], at[116]);    MULADD(at[16], at[115]);    MULADD(at[17], at[114]);    MULADD(at[18], at[113]);    MULADD(at[19], at[112]);    MULADD(at[20], at[111]);    MULADD(at[21], at[110]);    MULADD(at[22], at[109]);    MULADD(at[23], at[108]);    MULADD(at[24], at[107]);    MULADD(at[25], at[106]);    MULADD(at[26], at[105]);    MULADD(at[27], at[104]);    MULADD(at[28], at[103]);    MULADD(at[29], at[102]);    MULADD(at[30], at[101]);    MULADD(at[31], at[100]);    MULADD(at[32], at[99]);    MULADD(at[33], at[98]);    MULADD(at[34], at[97]);    MULADD(at[35], at[96]);    MULADD(at[36], at[95]);    MULADD(at[37], at[94]);    MULADD(at[38], at[93]);    MULADD(at[39], at[92]);    MULADD(at[40], at[91]);    MULADD(at[41], at[90]);    MULADD(at[42], at[89]);    MULADD(at[43], at[88]);    MULADD(at[44], at[87]);    MULADD(at[45], at[86]);    MULADD(at[46], at[85]);    MULADD(at[47], at[84]);    MULADD(at[48], at[83]);    MULADD(at[49], at[82]);    MULADD(at[50], at[81]);    MULADD(at[51], at[80]);    MULADD(at[52], at[79]);    MULADD(at[53], at[78]);    MULADD(at[54], at[77]);    MULADD(at[55], at[76]);    MULADD(at[56], at[75]);    MULADD(at[57], at[74]);    MULADD(at[58], at[73]);    MULADD(at[59], at[72]);    MULADD(at[60], at[71]);    MULADD(at[61], at[70]);    MULADD(at[62], at[69]);    MULADD(at[63], at[68]); 
+   COMBA_STORE(C->dp[67]);
+   /* 68 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[127]);    MULADD(at[6], at[126]);    MULADD(at[7], at[125]);    MULADD(at[8], at[124]);    MULADD(at[9], at[123]);    MULADD(at[10], at[122]);    MULADD(at[11], at[121]);    MULADD(at[12], at[120]);    MULADD(at[13], at[119]);    MULADD(at[14], at[118]);    MULADD(at[15], at[117]);    MULADD(at[16], at[116]);    MULADD(at[17], at[115]);    MULADD(at[18], at[114]);    MULADD(at[19], at[113]);    MULADD(at[20], at[112]);    MULADD(at[21], at[111]);    MULADD(at[22], at[110]);    MULADD(at[23], at[109]);    MULADD(at[24], at[108]);    MULADD(at[25], at[107]);    MULADD(at[26], at[106]);    MULADD(at[27], at[105]);    MULADD(at[28], at[104]);    MULADD(at[29], at[103]);    MULADD(at[30], at[102]);    MULADD(at[31], at[101]);    MULADD(at[32], at[100]);    MULADD(at[33], at[99]);    MULADD(at[34], at[98]);    MULADD(at[35], at[97]);    MULADD(at[36], at[96]);    MULADD(at[37], at[95]);    MULADD(at[38], at[94]);    MULADD(at[39], at[93]);    MULADD(at[40], at[92]);    MULADD(at[41], at[91]);    MULADD(at[42], at[90]);    MULADD(at[43], at[89]);    MULADD(at[44], at[88]);    MULADD(at[45], at[87]);    MULADD(at[46], at[86]);    MULADD(at[47], at[85]);    MULADD(at[48], at[84]);    MULADD(at[49], at[83]);    MULADD(at[50], at[82]);    MULADD(at[51], at[81]);    MULADD(at[52], at[80]);    MULADD(at[53], at[79]);    MULADD(at[54], at[78]);    MULADD(at[55], at[77]);    MULADD(at[56], at[76]);    MULADD(at[57], at[75]);    MULADD(at[58], at[74]);    MULADD(at[59], at[73]);    MULADD(at[60], at[72]);    MULADD(at[61], at[71]);    MULADD(at[62], at[70]);    MULADD(at[63], at[69]); 
+   COMBA_STORE(C->dp[68]);
+   /* 69 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[127]);    MULADD(at[7], at[126]);    MULADD(at[8], at[125]);    MULADD(at[9], at[124]);    MULADD(at[10], at[123]);    MULADD(at[11], at[122]);    MULADD(at[12], at[121]);    MULADD(at[13], at[120]);    MULADD(at[14], at[119]);    MULADD(at[15], at[118]);    MULADD(at[16], at[117]);    MULADD(at[17], at[116]);    MULADD(at[18], at[115]);    MULADD(at[19], at[114]);    MULADD(at[20], at[113]);    MULADD(at[21], at[112]);    MULADD(at[22], at[111]);    MULADD(at[23], at[110]);    MULADD(at[24], at[109]);    MULADD(at[25], at[108]);    MULADD(at[26], at[107]);    MULADD(at[27], at[106]);    MULADD(at[28], at[105]);    MULADD(at[29], at[104]);    MULADD(at[30], at[103]);    MULADD(at[31], at[102]);    MULADD(at[32], at[101]);    MULADD(at[33], at[100]);    MULADD(at[34], at[99]);    MULADD(at[35], at[98]);    MULADD(at[36], at[97]);    MULADD(at[37], at[96]);    MULADD(at[38], at[95]);    MULADD(at[39], at[94]);    MULADD(at[40], at[93]);    MULADD(at[41], at[92]);    MULADD(at[42], at[91]);    MULADD(at[43], at[90]);    MULADD(at[44], at[89]);    MULADD(at[45], at[88]);    MULADD(at[46], at[87]);    MULADD(at[47], at[86]);    MULADD(at[48], at[85]);    MULADD(at[49], at[84]);    MULADD(at[50], at[83]);    MULADD(at[51], at[82]);    MULADD(at[52], at[81]);    MULADD(at[53], at[80]);    MULADD(at[54], at[79]);    MULADD(at[55], at[78]);    MULADD(at[56], at[77]);    MULADD(at[57], at[76]);    MULADD(at[58], at[75]);    MULADD(at[59], at[74]);    MULADD(at[60], at[73]);    MULADD(at[61], at[72]);    MULADD(at[62], at[71]);    MULADD(at[63], at[70]); 
+   COMBA_STORE(C->dp[69]);
+   /* 70 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[127]);    MULADD(at[8], at[126]);    MULADD(at[9], at[125]);    MULADD(at[10], at[124]);    MULADD(at[11], at[123]);    MULADD(at[12], at[122]);    MULADD(at[13], at[121]);    MULADD(at[14], at[120]);    MULADD(at[15], at[119]);    MULADD(at[16], at[118]);    MULADD(at[17], at[117]);    MULADD(at[18], at[116]);    MULADD(at[19], at[115]);    MULADD(at[20], at[114]);    MULADD(at[21], at[113]);    MULADD(at[22], at[112]);    MULADD(at[23], at[111]);    MULADD(at[24], at[110]);    MULADD(at[25], at[109]);    MULADD(at[26], at[108]);    MULADD(at[27], at[107]);    MULADD(at[28], at[106]);    MULADD(at[29], at[105]);    MULADD(at[30], at[104]);    MULADD(at[31], at[103]);    MULADD(at[32], at[102]);    MULADD(at[33], at[101]);    MULADD(at[34], at[100]);    MULADD(at[35], at[99]);    MULADD(at[36], at[98]);    MULADD(at[37], at[97]);    MULADD(at[38], at[96]);    MULADD(at[39], at[95]);    MULADD(at[40], at[94]);    MULADD(at[41], at[93]);    MULADD(at[42], at[92]);    MULADD(at[43], at[91]);    MULADD(at[44], at[90]);    MULADD(at[45], at[89]);    MULADD(at[46], at[88]);    MULADD(at[47], at[87]);    MULADD(at[48], at[86]);    MULADD(at[49], at[85]);    MULADD(at[50], at[84]);    MULADD(at[51], at[83]);    MULADD(at[52], at[82]);    MULADD(at[53], at[81]);    MULADD(at[54], at[80]);    MULADD(at[55], at[79]);    MULADD(at[56], at[78]);    MULADD(at[57], at[77]);    MULADD(at[58], at[76]);    MULADD(at[59], at[75]);    MULADD(at[60], at[74]);    MULADD(at[61], at[73]);    MULADD(at[62], at[72]);    MULADD(at[63], at[71]); 
+   COMBA_STORE(C->dp[70]);
+   /* 71 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[127]);    MULADD(at[9], at[126]);    MULADD(at[10], at[125]);    MULADD(at[11], at[124]);    MULADD(at[12], at[123]);    MULADD(at[13], at[122]);    MULADD(at[14], at[121]);    MULADD(at[15], at[120]);    MULADD(at[16], at[119]);    MULADD(at[17], at[118]);    MULADD(at[18], at[117]);    MULADD(at[19], at[116]);    MULADD(at[20], at[115]);    MULADD(at[21], at[114]);    MULADD(at[22], at[113]);    MULADD(at[23], at[112]);    MULADD(at[24], at[111]);    MULADD(at[25], at[110]);    MULADD(at[26], at[109]);    MULADD(at[27], at[108]);    MULADD(at[28], at[107]);    MULADD(at[29], at[106]);    MULADD(at[30], at[105]);    MULADD(at[31], at[104]);    MULADD(at[32], at[103]);    MULADD(at[33], at[102]);    MULADD(at[34], at[101]);    MULADD(at[35], at[100]);    MULADD(at[36], at[99]);    MULADD(at[37], at[98]);    MULADD(at[38], at[97]);    MULADD(at[39], at[96]);    MULADD(at[40], at[95]);    MULADD(at[41], at[94]);    MULADD(at[42], at[93]);    MULADD(at[43], at[92]);    MULADD(at[44], at[91]);    MULADD(at[45], at[90]);    MULADD(at[46], at[89]);    MULADD(at[47], at[88]);    MULADD(at[48], at[87]);    MULADD(at[49], at[86]);    MULADD(at[50], at[85]);    MULADD(at[51], at[84]);    MULADD(at[52], at[83]);    MULADD(at[53], at[82]);    MULADD(at[54], at[81]);    MULADD(at[55], at[80]);    MULADD(at[56], at[79]);    MULADD(at[57], at[78]);    MULADD(at[58], at[77]);    MULADD(at[59], at[76]);    MULADD(at[60], at[75]);    MULADD(at[61], at[74]);    MULADD(at[62], at[73]);    MULADD(at[63], at[72]); 
+   COMBA_STORE(C->dp[71]);
+   /* 72 */
+   COMBA_FORWARD;
+   MULADD(at[9], at[127]);    MULADD(at[10], at[126]);    MULADD(at[11], at[125]);    MULADD(at[12], at[124]);    MULADD(at[13], at[123]);    MULADD(at[14], at[122]);    MULADD(at[15], at[121]);    MULADD(at[16], at[120]);    MULADD(at[17], at[119]);    MULADD(at[18], at[118]);    MULADD(at[19], at[117]);    MULADD(at[20], at[116]);    MULADD(at[21], at[115]);    MULADD(at[22], at[114]);    MULADD(at[23], at[113]);    MULADD(at[24], at[112]);    MULADD(at[25], at[111]);    MULADD(at[26], at[110]);    MULADD(at[27], at[109]);    MULADD(at[28], at[108]);    MULADD(at[29], at[107]);    MULADD(at[30], at[106]);    MULADD(at[31], at[105]);    MULADD(at[32], at[104]);    MULADD(at[33], at[103]);    MULADD(at[34], at[102]);    MULADD(at[35], at[101]);    MULADD(at[36], at[100]);    MULADD(at[37], at[99]);    MULADD(at[38], at[98]);    MULADD(at[39], at[97]);    MULADD(at[40], at[96]);    MULADD(at[41], at[95]);    MULADD(at[42], at[94]);    MULADD(at[43], at[93]);    MULADD(at[44], at[92]);    MULADD(at[45], at[91]);    MULADD(at[46], at[90]);    MULADD(at[47], at[89]);    MULADD(at[48], at[88]);    MULADD(at[49], at[87]);    MULADD(at[50], at[86]);    MULADD(at[51], at[85]);    MULADD(at[52], at[84]);    MULADD(at[53], at[83]);    MULADD(at[54], at[82]);    MULADD(at[55], at[81]);    MULADD(at[56], at[80]);    MULADD(at[57], at[79]);    MULADD(at[58], at[78]);    MULADD(at[59], at[77]);    MULADD(at[60], at[76]);    MULADD(at[61], at[75]);    MULADD(at[62], at[74]);    MULADD(at[63], at[73]); 
+   COMBA_STORE(C->dp[72]);
+   /* 73 */
+   COMBA_FORWARD;
+   MULADD(at[10], at[127]);    MULADD(at[11], at[126]);    MULADD(at[12], at[125]);    MULADD(at[13], at[124]);    MULADD(at[14], at[123]);    MULADD(at[15], at[122]);    MULADD(at[16], at[121]);    MULADD(at[17], at[120]);    MULADD(at[18], at[119]);    MULADD(at[19], at[118]);    MULADD(at[20], at[117]);    MULADD(at[21], at[116]);    MULADD(at[22], at[115]);    MULADD(at[23], at[114]);    MULADD(at[24], at[113]);    MULADD(at[25], at[112]);    MULADD(at[26], at[111]);    MULADD(at[27], at[110]);    MULADD(at[28], at[109]);    MULADD(at[29], at[108]);    MULADD(at[30], at[107]);    MULADD(at[31], at[106]);    MULADD(at[32], at[105]);    MULADD(at[33], at[104]);    MULADD(at[34], at[103]);    MULADD(at[35], at[102]);    MULADD(at[36], at[101]);    MULADD(at[37], at[100]);    MULADD(at[38], at[99]);    MULADD(at[39], at[98]);    MULADD(at[40], at[97]);    MULADD(at[41], at[96]);    MULADD(at[42], at[95]);    MULADD(at[43], at[94]);    MULADD(at[44], at[93]);    MULADD(at[45], at[92]);    MULADD(at[46], at[91]);    MULADD(at[47], at[90]);    MULADD(at[48], at[89]);    MULADD(at[49], at[88]);    MULADD(at[50], at[87]);    MULADD(at[51], at[86]);    MULADD(at[52], at[85]);    MULADD(at[53], at[84]);    MULADD(at[54], at[83]);    MULADD(at[55], at[82]);    MULADD(at[56], at[81]);    MULADD(at[57], at[80]);    MULADD(at[58], at[79]);    MULADD(at[59], at[78]);    MULADD(at[60], at[77]);    MULADD(at[61], at[76]);    MULADD(at[62], at[75]);    MULADD(at[63], at[74]); 
+   COMBA_STORE(C->dp[73]);
+   /* 74 */
+   COMBA_FORWARD;
+   MULADD(at[11], at[127]);    MULADD(at[12], at[126]);    MULADD(at[13], at[125]);    MULADD(at[14], at[124]);    MULADD(at[15], at[123]);    MULADD(at[16], at[122]);    MULADD(at[17], at[121]);    MULADD(at[18], at[120]);    MULADD(at[19], at[119]);    MULADD(at[20], at[118]);    MULADD(at[21], at[117]);    MULADD(at[22], at[116]);    MULADD(at[23], at[115]);    MULADD(at[24], at[114]);    MULADD(at[25], at[113]);    MULADD(at[26], at[112]);    MULADD(at[27], at[111]);    MULADD(at[28], at[110]);    MULADD(at[29], at[109]);    MULADD(at[30], at[108]);    MULADD(at[31], at[107]);    MULADD(at[32], at[106]);    MULADD(at[33], at[105]);    MULADD(at[34], at[104]);    MULADD(at[35], at[103]);    MULADD(at[36], at[102]);    MULADD(at[37], at[101]);    MULADD(at[38], at[100]);    MULADD(at[39], at[99]);    MULADD(at[40], at[98]);    MULADD(at[41], at[97]);    MULADD(at[42], at[96]);    MULADD(at[43], at[95]);    MULADD(at[44], at[94]);    MULADD(at[45], at[93]);    MULADD(at[46], at[92]);    MULADD(at[47], at[91]);    MULADD(at[48], at[90]);    MULADD(at[49], at[89]);    MULADD(at[50], at[88]);    MULADD(at[51], at[87]);    MULADD(at[52], at[86]);    MULADD(at[53], at[85]);    MULADD(at[54], at[84]);    MULADD(at[55], at[83]);    MULADD(at[56], at[82]);    MULADD(at[57], at[81]);    MULADD(at[58], at[80]);    MULADD(at[59], at[79]);    MULADD(at[60], at[78]);    MULADD(at[61], at[77]);    MULADD(at[62], at[76]);    MULADD(at[63], at[75]); 
+   COMBA_STORE(C->dp[74]);
+   /* 75 */
+   COMBA_FORWARD;
+   MULADD(at[12], at[127]);    MULADD(at[13], at[126]);    MULADD(at[14], at[125]);    MULADD(at[15], at[124]);    MULADD(at[16], at[123]);    MULADD(at[17], at[122]);    MULADD(at[18], at[121]);    MULADD(at[19], at[120]);    MULADD(at[20], at[119]);    MULADD(at[21], at[118]);    MULADD(at[22], at[117]);    MULADD(at[23], at[116]);    MULADD(at[24], at[115]);    MULADD(at[25], at[114]);    MULADD(at[26], at[113]);    MULADD(at[27], at[112]);    MULADD(at[28], at[111]);    MULADD(at[29], at[110]);    MULADD(at[30], at[109]);    MULADD(at[31], at[108]);    MULADD(at[32], at[107]);    MULADD(at[33], at[106]);    MULADD(at[34], at[105]);    MULADD(at[35], at[104]);    MULADD(at[36], at[103]);    MULADD(at[37], at[102]);    MULADD(at[38], at[101]);    MULADD(at[39], at[100]);    MULADD(at[40], at[99]);    MULADD(at[41], at[98]);    MULADD(at[42], at[97]);    MULADD(at[43], at[96]);    MULADD(at[44], at[95]);    MULADD(at[45], at[94]);    MULADD(at[46], at[93]);    MULADD(at[47], at[92]);    MULADD(at[48], at[91]);    MULADD(at[49], at[90]);    MULADD(at[50], at[89]);    MULADD(at[51], at[88]);    MULADD(at[52], at[87]);    MULADD(at[53], at[86]);    MULADD(at[54], at[85]);    MULADD(at[55], at[84]);    MULADD(at[56], at[83]);    MULADD(at[57], at[82]);    MULADD(at[58], at[81]);    MULADD(at[59], at[80]);    MULADD(at[60], at[79]);    MULADD(at[61], at[78]);    MULADD(at[62], at[77]);    MULADD(at[63], at[76]); 
+   COMBA_STORE(C->dp[75]);
+   /* 76 */
+   COMBA_FORWARD;
+   MULADD(at[13], at[127]);    MULADD(at[14], at[126]);    MULADD(at[15], at[125]);    MULADD(at[16], at[124]);    MULADD(at[17], at[123]);    MULADD(at[18], at[122]);    MULADD(at[19], at[121]);    MULADD(at[20], at[120]);    MULADD(at[21], at[119]);    MULADD(at[22], at[118]);    MULADD(at[23], at[117]);    MULADD(at[24], at[116]);    MULADD(at[25], at[115]);    MULADD(at[26], at[114]);    MULADD(at[27], at[113]);    MULADD(at[28], at[112]);    MULADD(at[29], at[111]);    MULADD(at[30], at[110]);    MULADD(at[31], at[109]);    MULADD(at[32], at[108]);    MULADD(at[33], at[107]);    MULADD(at[34], at[106]);    MULADD(at[35], at[105]);    MULADD(at[36], at[104]);    MULADD(at[37], at[103]);    MULADD(at[38], at[102]);    MULADD(at[39], at[101]);    MULADD(at[40], at[100]);    MULADD(at[41], at[99]);    MULADD(at[42], at[98]);    MULADD(at[43], at[97]);    MULADD(at[44], at[96]);    MULADD(at[45], at[95]);    MULADD(at[46], at[94]);    MULADD(at[47], at[93]);    MULADD(at[48], at[92]);    MULADD(at[49], at[91]);    MULADD(at[50], at[90]);    MULADD(at[51], at[89]);    MULADD(at[52], at[88]);    MULADD(at[53], at[87]);    MULADD(at[54], at[86]);    MULADD(at[55], at[85]);    MULADD(at[56], at[84]);    MULADD(at[57], at[83]);    MULADD(at[58], at[82]);    MULADD(at[59], at[81]);    MULADD(at[60], at[80]);    MULADD(at[61], at[79]);    MULADD(at[62], at[78]);    MULADD(at[63], at[77]); 
+   COMBA_STORE(C->dp[76]);
+   /* 77 */
+   COMBA_FORWARD;
+   MULADD(at[14], at[127]);    MULADD(at[15], at[126]);    MULADD(at[16], at[125]);    MULADD(at[17], at[124]);    MULADD(at[18], at[123]);    MULADD(at[19], at[122]);    MULADD(at[20], at[121]);    MULADD(at[21], at[120]);    MULADD(at[22], at[119]);    MULADD(at[23], at[118]);    MULADD(at[24], at[117]);    MULADD(at[25], at[116]);    MULADD(at[26], at[115]);    MULADD(at[27], at[114]);    MULADD(at[28], at[113]);    MULADD(at[29], at[112]);    MULADD(at[30], at[111]);    MULADD(at[31], at[110]);    MULADD(at[32], at[109]);    MULADD(at[33], at[108]);    MULADD(at[34], at[107]);    MULADD(at[35], at[106]);    MULADD(at[36], at[105]);    MULADD(at[37], at[104]);    MULADD(at[38], at[103]);    MULADD(at[39], at[102]);    MULADD(at[40], at[101]);    MULADD(at[41], at[100]);    MULADD(at[42], at[99]);    MULADD(at[43], at[98]);    MULADD(at[44], at[97]);    MULADD(at[45], at[96]);    MULADD(at[46], at[95]);    MULADD(at[47], at[94]);    MULADD(at[48], at[93]);    MULADD(at[49], at[92]);    MULADD(at[50], at[91]);    MULADD(at[51], at[90]);    MULADD(at[52], at[89]);    MULADD(at[53], at[88]);    MULADD(at[54], at[87]);    MULADD(at[55], at[86]);    MULADD(at[56], at[85]);    MULADD(at[57], at[84]);    MULADD(at[58], at[83]);    MULADD(at[59], at[82]);    MULADD(at[60], at[81]);    MULADD(at[61], at[80]);    MULADD(at[62], at[79]);    MULADD(at[63], at[78]); 
+   COMBA_STORE(C->dp[77]);
+   /* 78 */
+   COMBA_FORWARD;
+   MULADD(at[15], at[127]);    MULADD(at[16], at[126]);    MULADD(at[17], at[125]);    MULADD(at[18], at[124]);    MULADD(at[19], at[123]);    MULADD(at[20], at[122]);    MULADD(at[21], at[121]);    MULADD(at[22], at[120]);    MULADD(at[23], at[119]);    MULADD(at[24], at[118]);    MULADD(at[25], at[117]);    MULADD(at[26], at[116]);    MULADD(at[27], at[115]);    MULADD(at[28], at[114]);    MULADD(at[29], at[113]);    MULADD(at[30], at[112]);    MULADD(at[31], at[111]);    MULADD(at[32], at[110]);    MULADD(at[33], at[109]);    MULADD(at[34], at[108]);    MULADD(at[35], at[107]);    MULADD(at[36], at[106]);    MULADD(at[37], at[105]);    MULADD(at[38], at[104]);    MULADD(at[39], at[103]);    MULADD(at[40], at[102]);    MULADD(at[41], at[101]);    MULADD(at[42], at[100]);    MULADD(at[43], at[99]);    MULADD(at[44], at[98]);    MULADD(at[45], at[97]);    MULADD(at[46], at[96]);    MULADD(at[47], at[95]);    MULADD(at[48], at[94]);    MULADD(at[49], at[93]);    MULADD(at[50], at[92]);    MULADD(at[51], at[91]);    MULADD(at[52], at[90]);    MULADD(at[53], at[89]);    MULADD(at[54], at[88]);    MULADD(at[55], at[87]);    MULADD(at[56], at[86]);    MULADD(at[57], at[85]);    MULADD(at[58], at[84]);    MULADD(at[59], at[83]);    MULADD(at[60], at[82]);    MULADD(at[61], at[81]);    MULADD(at[62], at[80]);    MULADD(at[63], at[79]); 
+   COMBA_STORE(C->dp[78]);
+   /* 79 */
+   COMBA_FORWARD;
+   MULADD(at[16], at[127]);    MULADD(at[17], at[126]);    MULADD(at[18], at[125]);    MULADD(at[19], at[124]);    MULADD(at[20], at[123]);    MULADD(at[21], at[122]);    MULADD(at[22], at[121]);    MULADD(at[23], at[120]);    MULADD(at[24], at[119]);    MULADD(at[25], at[118]);    MULADD(at[26], at[117]);    MULADD(at[27], at[116]);    MULADD(at[28], at[115]);    MULADD(at[29], at[114]);    MULADD(at[30], at[113]);    MULADD(at[31], at[112]);    MULADD(at[32], at[111]);    MULADD(at[33], at[110]);    MULADD(at[34], at[109]);    MULADD(at[35], at[108]);    MULADD(at[36], at[107]);    MULADD(at[37], at[106]);    MULADD(at[38], at[105]);    MULADD(at[39], at[104]);    MULADD(at[40], at[103]);    MULADD(at[41], at[102]);    MULADD(at[42], at[101]);    MULADD(at[43], at[100]);    MULADD(at[44], at[99]);    MULADD(at[45], at[98]);    MULADD(at[46], at[97]);    MULADD(at[47], at[96]);    MULADD(at[48], at[95]);    MULADD(at[49], at[94]);    MULADD(at[50], at[93]);    MULADD(at[51], at[92]);    MULADD(at[52], at[91]);    MULADD(at[53], at[90]);    MULADD(at[54], at[89]);    MULADD(at[55], at[88]);    MULADD(at[56], at[87]);    MULADD(at[57], at[86]);    MULADD(at[58], at[85]);    MULADD(at[59], at[84]);    MULADD(at[60], at[83]);    MULADD(at[61], at[82]);    MULADD(at[62], at[81]);    MULADD(at[63], at[80]); 
+   COMBA_STORE(C->dp[79]);
+   /* 80 */
+   COMBA_FORWARD;
+   MULADD(at[17], at[127]);    MULADD(at[18], at[126]);    MULADD(at[19], at[125]);    MULADD(at[20], at[124]);    MULADD(at[21], at[123]);    MULADD(at[22], at[122]);    MULADD(at[23], at[121]);    MULADD(at[24], at[120]);    MULADD(at[25], at[119]);    MULADD(at[26], at[118]);    MULADD(at[27], at[117]);    MULADD(at[28], at[116]);    MULADD(at[29], at[115]);    MULADD(at[30], at[114]);    MULADD(at[31], at[113]);    MULADD(at[32], at[112]);    MULADD(at[33], at[111]);    MULADD(at[34], at[110]);    MULADD(at[35], at[109]);    MULADD(at[36], at[108]);    MULADD(at[37], at[107]);    MULADD(at[38], at[106]);    MULADD(at[39], at[105]);    MULADD(at[40], at[104]);    MULADD(at[41], at[103]);    MULADD(at[42], at[102]);    MULADD(at[43], at[101]);    MULADD(at[44], at[100]);    MULADD(at[45], at[99]);    MULADD(at[46], at[98]);    MULADD(at[47], at[97]);    MULADD(at[48], at[96]);    MULADD(at[49], at[95]);    MULADD(at[50], at[94]);    MULADD(at[51], at[93]);    MULADD(at[52], at[92]);    MULADD(at[53], at[91]);    MULADD(at[54], at[90]);    MULADD(at[55], at[89]);    MULADD(at[56], at[88]);    MULADD(at[57], at[87]);    MULADD(at[58], at[86]);    MULADD(at[59], at[85]);    MULADD(at[60], at[84]);    MULADD(at[61], at[83]);    MULADD(at[62], at[82]);    MULADD(at[63], at[81]); 
+   COMBA_STORE(C->dp[80]);
+   /* 81 */
+   COMBA_FORWARD;
+   MULADD(at[18], at[127]);    MULADD(at[19], at[126]);    MULADD(at[20], at[125]);    MULADD(at[21], at[124]);    MULADD(at[22], at[123]);    MULADD(at[23], at[122]);    MULADD(at[24], at[121]);    MULADD(at[25], at[120]);    MULADD(at[26], at[119]);    MULADD(at[27], at[118]);    MULADD(at[28], at[117]);    MULADD(at[29], at[116]);    MULADD(at[30], at[115]);    MULADD(at[31], at[114]);    MULADD(at[32], at[113]);    MULADD(at[33], at[112]);    MULADD(at[34], at[111]);    MULADD(at[35], at[110]);    MULADD(at[36], at[109]);    MULADD(at[37], at[108]);    MULADD(at[38], at[107]);    MULADD(at[39], at[106]);    MULADD(at[40], at[105]);    MULADD(at[41], at[104]);    MULADD(at[42], at[103]);    MULADD(at[43], at[102]);    MULADD(at[44], at[101]);    MULADD(at[45], at[100]);    MULADD(at[46], at[99]);    MULADD(at[47], at[98]);    MULADD(at[48], at[97]);    MULADD(at[49], at[96]);    MULADD(at[50], at[95]);    MULADD(at[51], at[94]);    MULADD(at[52], at[93]);    MULADD(at[53], at[92]);    MULADD(at[54], at[91]);    MULADD(at[55], at[90]);    MULADD(at[56], at[89]);    MULADD(at[57], at[88]);    MULADD(at[58], at[87]);    MULADD(at[59], at[86]);    MULADD(at[60], at[85]);    MULADD(at[61], at[84]);    MULADD(at[62], at[83]);    MULADD(at[63], at[82]); 
+   COMBA_STORE(C->dp[81]);
+   /* 82 */
+   COMBA_FORWARD;
+   MULADD(at[19], at[127]);    MULADD(at[20], at[126]);    MULADD(at[21], at[125]);    MULADD(at[22], at[124]);    MULADD(at[23], at[123]);    MULADD(at[24], at[122]);    MULADD(at[25], at[121]);    MULADD(at[26], at[120]);    MULADD(at[27], at[119]);    MULADD(at[28], at[118]);    MULADD(at[29], at[117]);    MULADD(at[30], at[116]);    MULADD(at[31], at[115]);    MULADD(at[32], at[114]);    MULADD(at[33], at[113]);    MULADD(at[34], at[112]);    MULADD(at[35], at[111]);    MULADD(at[36], at[110]);    MULADD(at[37], at[109]);    MULADD(at[38], at[108]);    MULADD(at[39], at[107]);    MULADD(at[40], at[106]);    MULADD(at[41], at[105]);    MULADD(at[42], at[104]);    MULADD(at[43], at[103]);    MULADD(at[44], at[102]);    MULADD(at[45], at[101]);    MULADD(at[46], at[100]);    MULADD(at[47], at[99]);    MULADD(at[48], at[98]);    MULADD(at[49], at[97]);    MULADD(at[50], at[96]);    MULADD(at[51], at[95]);    MULADD(at[52], at[94]);    MULADD(at[53], at[93]);    MULADD(at[54], at[92]);    MULADD(at[55], at[91]);    MULADD(at[56], at[90]);    MULADD(at[57], at[89]);    MULADD(at[58], at[88]);    MULADD(at[59], at[87]);    MULADD(at[60], at[86]);    MULADD(at[61], at[85]);    MULADD(at[62], at[84]);    MULADD(at[63], at[83]); 
+   COMBA_STORE(C->dp[82]);
+   /* 83 */
+   COMBA_FORWARD;
+   MULADD(at[20], at[127]);    MULADD(at[21], at[126]);    MULADD(at[22], at[125]);    MULADD(at[23], at[124]);    MULADD(at[24], at[123]);    MULADD(at[25], at[122]);    MULADD(at[26], at[121]);    MULADD(at[27], at[120]);    MULADD(at[28], at[119]);    MULADD(at[29], at[118]);    MULADD(at[30], at[117]);    MULADD(at[31], at[116]);    MULADD(at[32], at[115]);    MULADD(at[33], at[114]);    MULADD(at[34], at[113]);    MULADD(at[35], at[112]);    MULADD(at[36], at[111]);    MULADD(at[37], at[110]);    MULADD(at[38], at[109]);    MULADD(at[39], at[108]);    MULADD(at[40], at[107]);    MULADD(at[41], at[106]);    MULADD(at[42], at[105]);    MULADD(at[43], at[104]);    MULADD(at[44], at[103]);    MULADD(at[45], at[102]);    MULADD(at[46], at[101]);    MULADD(at[47], at[100]);    MULADD(at[48], at[99]);    MULADD(at[49], at[98]);    MULADD(at[50], at[97]);    MULADD(at[51], at[96]);    MULADD(at[52], at[95]);    MULADD(at[53], at[94]);    MULADD(at[54], at[93]);    MULADD(at[55], at[92]);    MULADD(at[56], at[91]);    MULADD(at[57], at[90]);    MULADD(at[58], at[89]);    MULADD(at[59], at[88]);    MULADD(at[60], at[87]);    MULADD(at[61], at[86]);    MULADD(at[62], at[85]);    MULADD(at[63], at[84]); 
+   COMBA_STORE(C->dp[83]);
+   /* 84 */
+   COMBA_FORWARD;
+   MULADD(at[21], at[127]);    MULADD(at[22], at[126]);    MULADD(at[23], at[125]);    MULADD(at[24], at[124]);    MULADD(at[25], at[123]);    MULADD(at[26], at[122]);    MULADD(at[27], at[121]);    MULADD(at[28], at[120]);    MULADD(at[29], at[119]);    MULADD(at[30], at[118]);    MULADD(at[31], at[117]);    MULADD(at[32], at[116]);    MULADD(at[33], at[115]);    MULADD(at[34], at[114]);    MULADD(at[35], at[113]);    MULADD(at[36], at[112]);    MULADD(at[37], at[111]);    MULADD(at[38], at[110]);    MULADD(at[39], at[109]);    MULADD(at[40], at[108]);    MULADD(at[41], at[107]);    MULADD(at[42], at[106]);    MULADD(at[43], at[105]);    MULADD(at[44], at[104]);    MULADD(at[45], at[103]);    MULADD(at[46], at[102]);    MULADD(at[47], at[101]);    MULADD(at[48], at[100]);    MULADD(at[49], at[99]);    MULADD(at[50], at[98]);    MULADD(at[51], at[97]);    MULADD(at[52], at[96]);    MULADD(at[53], at[95]);    MULADD(at[54], at[94]);    MULADD(at[55], at[93]);    MULADD(at[56], at[92]);    MULADD(at[57], at[91]);    MULADD(at[58], at[90]);    MULADD(at[59], at[89]);    MULADD(at[60], at[88]);    MULADD(at[61], at[87]);    MULADD(at[62], at[86]);    MULADD(at[63], at[85]); 
+   COMBA_STORE(C->dp[84]);
+   /* 85 */
+   COMBA_FORWARD;
+   MULADD(at[22], at[127]);    MULADD(at[23], at[126]);    MULADD(at[24], at[125]);    MULADD(at[25], at[124]);    MULADD(at[26], at[123]);    MULADD(at[27], at[122]);    MULADD(at[28], at[121]);    MULADD(at[29], at[120]);    MULADD(at[30], at[119]);    MULADD(at[31], at[118]);    MULADD(at[32], at[117]);    MULADD(at[33], at[116]);    MULADD(at[34], at[115]);    MULADD(at[35], at[114]);    MULADD(at[36], at[113]);    MULADD(at[37], at[112]);    MULADD(at[38], at[111]);    MULADD(at[39], at[110]);    MULADD(at[40], at[109]);    MULADD(at[41], at[108]);    MULADD(at[42], at[107]);    MULADD(at[43], at[106]);    MULADD(at[44], at[105]);    MULADD(at[45], at[104]);    MULADD(at[46], at[103]);    MULADD(at[47], at[102]);    MULADD(at[48], at[101]);    MULADD(at[49], at[100]);    MULADD(at[50], at[99]);    MULADD(at[51], at[98]);    MULADD(at[52], at[97]);    MULADD(at[53], at[96]);    MULADD(at[54], at[95]);    MULADD(at[55], at[94]);    MULADD(at[56], at[93]);    MULADD(at[57], at[92]);    MULADD(at[58], at[91]);    MULADD(at[59], at[90]);    MULADD(at[60], at[89]);    MULADD(at[61], at[88]);    MULADD(at[62], at[87]);    MULADD(at[63], at[86]); 
+   COMBA_STORE(C->dp[85]);
+   /* 86 */
+   COMBA_FORWARD;
+   MULADD(at[23], at[127]);    MULADD(at[24], at[126]);    MULADD(at[25], at[125]);    MULADD(at[26], at[124]);    MULADD(at[27], at[123]);    MULADD(at[28], at[122]);    MULADD(at[29], at[121]);    MULADD(at[30], at[120]);    MULADD(at[31], at[119]);    MULADD(at[32], at[118]);    MULADD(at[33], at[117]);    MULADD(at[34], at[116]);    MULADD(at[35], at[115]);    MULADD(at[36], at[114]);    MULADD(at[37], at[113]);    MULADD(at[38], at[112]);    MULADD(at[39], at[111]);    MULADD(at[40], at[110]);    MULADD(at[41], at[109]);    MULADD(at[42], at[108]);    MULADD(at[43], at[107]);    MULADD(at[44], at[106]);    MULADD(at[45], at[105]);    MULADD(at[46], at[104]);    MULADD(at[47], at[103]);    MULADD(at[48], at[102]);    MULADD(at[49], at[101]);    MULADD(at[50], at[100]);    MULADD(at[51], at[99]);    MULADD(at[52], at[98]);    MULADD(at[53], at[97]);    MULADD(at[54], at[96]);    MULADD(at[55], at[95]);    MULADD(at[56], at[94]);    MULADD(at[57], at[93]);    MULADD(at[58], at[92]);    MULADD(at[59], at[91]);    MULADD(at[60], at[90]);    MULADD(at[61], at[89]);    MULADD(at[62], at[88]);    MULADD(at[63], at[87]); 
+   COMBA_STORE(C->dp[86]);
+   /* 87 */
+   COMBA_FORWARD;
+   MULADD(at[24], at[127]);    MULADD(at[25], at[126]);    MULADD(at[26], at[125]);    MULADD(at[27], at[124]);    MULADD(at[28], at[123]);    MULADD(at[29], at[122]);    MULADD(at[30], at[121]);    MULADD(at[31], at[120]);    MULADD(at[32], at[119]);    MULADD(at[33], at[118]);    MULADD(at[34], at[117]);    MULADD(at[35], at[116]);    MULADD(at[36], at[115]);    MULADD(at[37], at[114]);    MULADD(at[38], at[113]);    MULADD(at[39], at[112]);    MULADD(at[40], at[111]);    MULADD(at[41], at[110]);    MULADD(at[42], at[109]);    MULADD(at[43], at[108]);    MULADD(at[44], at[107]);    MULADD(at[45], at[106]);    MULADD(at[46], at[105]);    MULADD(at[47], at[104]);    MULADD(at[48], at[103]);    MULADD(at[49], at[102]);    MULADD(at[50], at[101]);    MULADD(at[51], at[100]);    MULADD(at[52], at[99]);    MULADD(at[53], at[98]);    MULADD(at[54], at[97]);    MULADD(at[55], at[96]);    MULADD(at[56], at[95]);    MULADD(at[57], at[94]);    MULADD(at[58], at[93]);    MULADD(at[59], at[92]);    MULADD(at[60], at[91]);    MULADD(at[61], at[90]);    MULADD(at[62], at[89]);    MULADD(at[63], at[88]); 
+   COMBA_STORE(C->dp[87]);
+   /* 88 */
+   COMBA_FORWARD;
+   MULADD(at[25], at[127]);    MULADD(at[26], at[126]);    MULADD(at[27], at[125]);    MULADD(at[28], at[124]);    MULADD(at[29], at[123]);    MULADD(at[30], at[122]);    MULADD(at[31], at[121]);    MULADD(at[32], at[120]);    MULADD(at[33], at[119]);    MULADD(at[34], at[118]);    MULADD(at[35], at[117]);    MULADD(at[36], at[116]);    MULADD(at[37], at[115]);    MULADD(at[38], at[114]);    MULADD(at[39], at[113]);    MULADD(at[40], at[112]);    MULADD(at[41], at[111]);    MULADD(at[42], at[110]);    MULADD(at[43], at[109]);    MULADD(at[44], at[108]);    MULADD(at[45], at[107]);    MULADD(at[46], at[106]);    MULADD(at[47], at[105]);    MULADD(at[48], at[104]);    MULADD(at[49], at[103]);    MULADD(at[50], at[102]);    MULADD(at[51], at[101]);    MULADD(at[52], at[100]);    MULADD(at[53], at[99]);    MULADD(at[54], at[98]);    MULADD(at[55], at[97]);    MULADD(at[56], at[96]);    MULADD(at[57], at[95]);    MULADD(at[58], at[94]);    MULADD(at[59], at[93]);    MULADD(at[60], at[92]);    MULADD(at[61], at[91]);    MULADD(at[62], at[90]);    MULADD(at[63], at[89]); 
+   COMBA_STORE(C->dp[88]);
+   /* 89 */
+   COMBA_FORWARD;
+   MULADD(at[26], at[127]);    MULADD(at[27], at[126]);    MULADD(at[28], at[125]);    MULADD(at[29], at[124]);    MULADD(at[30], at[123]);    MULADD(at[31], at[122]);    MULADD(at[32], at[121]);    MULADD(at[33], at[120]);    MULADD(at[34], at[119]);    MULADD(at[35], at[118]);    MULADD(at[36], at[117]);    MULADD(at[37], at[116]);    MULADD(at[38], at[115]);    MULADD(at[39], at[114]);    MULADD(at[40], at[113]);    MULADD(at[41], at[112]);    MULADD(at[42], at[111]);    MULADD(at[43], at[110]);    MULADD(at[44], at[109]);    MULADD(at[45], at[108]);    MULADD(at[46], at[107]);    MULADD(at[47], at[106]);    MULADD(at[48], at[105]);    MULADD(at[49], at[104]);    MULADD(at[50], at[103]);    MULADD(at[51], at[102]);    MULADD(at[52], at[101]);    MULADD(at[53], at[100]);    MULADD(at[54], at[99]);    MULADD(at[55], at[98]);    MULADD(at[56], at[97]);    MULADD(at[57], at[96]);    MULADD(at[58], at[95]);    MULADD(at[59], at[94]);    MULADD(at[60], at[93]);    MULADD(at[61], at[92]);    MULADD(at[62], at[91]);    MULADD(at[63], at[90]); 
+   COMBA_STORE(C->dp[89]);
+   /* 90 */
+   COMBA_FORWARD;
+   MULADD(at[27], at[127]);    MULADD(at[28], at[126]);    MULADD(at[29], at[125]);    MULADD(at[30], at[124]);    MULADD(at[31], at[123]);    MULADD(at[32], at[122]);    MULADD(at[33], at[121]);    MULADD(at[34], at[120]);    MULADD(at[35], at[119]);    MULADD(at[36], at[118]);    MULADD(at[37], at[117]);    MULADD(at[38], at[116]);    MULADD(at[39], at[115]);    MULADD(at[40], at[114]);    MULADD(at[41], at[113]);    MULADD(at[42], at[112]);    MULADD(at[43], at[111]);    MULADD(at[44], at[110]);    MULADD(at[45], at[109]);    MULADD(at[46], at[108]);    MULADD(at[47], at[107]);    MULADD(at[48], at[106]);    MULADD(at[49], at[105]);    MULADD(at[50], at[104]);    MULADD(at[51], at[103]);    MULADD(at[52], at[102]);    MULADD(at[53], at[101]);    MULADD(at[54], at[100]);    MULADD(at[55], at[99]);    MULADD(at[56], at[98]);    MULADD(at[57], at[97]);    MULADD(at[58], at[96]);    MULADD(at[59], at[95]);    MULADD(at[60], at[94]);    MULADD(at[61], at[93]);    MULADD(at[62], at[92]);    MULADD(at[63], at[91]); 
+   COMBA_STORE(C->dp[90]);
+   /* 91 */
+   COMBA_FORWARD;
+   MULADD(at[28], at[127]);    MULADD(at[29], at[126]);    MULADD(at[30], at[125]);    MULADD(at[31], at[124]);    MULADD(at[32], at[123]);    MULADD(at[33], at[122]);    MULADD(at[34], at[121]);    MULADD(at[35], at[120]);    MULADD(at[36], at[119]);    MULADD(at[37], at[118]);    MULADD(at[38], at[117]);    MULADD(at[39], at[116]);    MULADD(at[40], at[115]);    MULADD(at[41], at[114]);    MULADD(at[42], at[113]);    MULADD(at[43], at[112]);    MULADD(at[44], at[111]);    MULADD(at[45], at[110]);    MULADD(at[46], at[109]);    MULADD(at[47], at[108]);    MULADD(at[48], at[107]);    MULADD(at[49], at[106]);    MULADD(at[50], at[105]);    MULADD(at[51], at[104]);    MULADD(at[52], at[103]);    MULADD(at[53], at[102]);    MULADD(at[54], at[101]);    MULADD(at[55], at[100]);    MULADD(at[56], at[99]);    MULADD(at[57], at[98]);    MULADD(at[58], at[97]);    MULADD(at[59], at[96]);    MULADD(at[60], at[95]);    MULADD(at[61], at[94]);    MULADD(at[62], at[93]);    MULADD(at[63], at[92]); 
+   COMBA_STORE(C->dp[91]);
+   /* 92 */
+   COMBA_FORWARD;
+   MULADD(at[29], at[127]);    MULADD(at[30], at[126]);    MULADD(at[31], at[125]);    MULADD(at[32], at[124]);    MULADD(at[33], at[123]);    MULADD(at[34], at[122]);    MULADD(at[35], at[121]);    MULADD(at[36], at[120]);    MULADD(at[37], at[119]);    MULADD(at[38], at[118]);    MULADD(at[39], at[117]);    MULADD(at[40], at[116]);    MULADD(at[41], at[115]);    MULADD(at[42], at[114]);    MULADD(at[43], at[113]);    MULADD(at[44], at[112]);    MULADD(at[45], at[111]);    MULADD(at[46], at[110]);    MULADD(at[47], at[109]);    MULADD(at[48], at[108]);    MULADD(at[49], at[107]);    MULADD(at[50], at[106]);    MULADD(at[51], at[105]);    MULADD(at[52], at[104]);    MULADD(at[53], at[103]);    MULADD(at[54], at[102]);    MULADD(at[55], at[101]);    MULADD(at[56], at[100]);    MULADD(at[57], at[99]);    MULADD(at[58], at[98]);    MULADD(at[59], at[97]);    MULADD(at[60], at[96]);    MULADD(at[61], at[95]);    MULADD(at[62], at[94]);    MULADD(at[63], at[93]); 
+   COMBA_STORE(C->dp[92]);
+   /* 93 */
+   COMBA_FORWARD;
+   MULADD(at[30], at[127]);    MULADD(at[31], at[126]);    MULADD(at[32], at[125]);    MULADD(at[33], at[124]);    MULADD(at[34], at[123]);    MULADD(at[35], at[122]);    MULADD(at[36], at[121]);    MULADD(at[37], at[120]);    MULADD(at[38], at[119]);    MULADD(at[39], at[118]);    MULADD(at[40], at[117]);    MULADD(at[41], at[116]);    MULADD(at[42], at[115]);    MULADD(at[43], at[114]);    MULADD(at[44], at[113]);    MULADD(at[45], at[112]);    MULADD(at[46], at[111]);    MULADD(at[47], at[110]);    MULADD(at[48], at[109]);    MULADD(at[49], at[108]);    MULADD(at[50], at[107]);    MULADD(at[51], at[106]);    MULADD(at[52], at[105]);    MULADD(at[53], at[104]);    MULADD(at[54], at[103]);    MULADD(at[55], at[102]);    MULADD(at[56], at[101]);    MULADD(at[57], at[100]);    MULADD(at[58], at[99]);    MULADD(at[59], at[98]);    MULADD(at[60], at[97]);    MULADD(at[61], at[96]);    MULADD(at[62], at[95]);    MULADD(at[63], at[94]); 
+   COMBA_STORE(C->dp[93]);
+   /* 94 */
+   COMBA_FORWARD;
+   MULADD(at[31], at[127]);    MULADD(at[32], at[126]);    MULADD(at[33], at[125]);    MULADD(at[34], at[124]);    MULADD(at[35], at[123]);    MULADD(at[36], at[122]);    MULADD(at[37], at[121]);    MULADD(at[38], at[120]);    MULADD(at[39], at[119]);    MULADD(at[40], at[118]);    MULADD(at[41], at[117]);    MULADD(at[42], at[116]);    MULADD(at[43], at[115]);    MULADD(at[44], at[114]);    MULADD(at[45], at[113]);    MULADD(at[46], at[112]);    MULADD(at[47], at[111]);    MULADD(at[48], at[110]);    MULADD(at[49], at[109]);    MULADD(at[50], at[108]);    MULADD(at[51], at[107]);    MULADD(at[52], at[106]);    MULADD(at[53], at[105]);    MULADD(at[54], at[104]);    MULADD(at[55], at[103]);    MULADD(at[56], at[102]);    MULADD(at[57], at[101]);    MULADD(at[58], at[100]);    MULADD(at[59], at[99]);    MULADD(at[60], at[98]);    MULADD(at[61], at[97]);    MULADD(at[62], at[96]);    MULADD(at[63], at[95]); 
+   COMBA_STORE(C->dp[94]);
+   /* 95 */
+   COMBA_FORWARD;
+   MULADD(at[32], at[127]);    MULADD(at[33], at[126]);    MULADD(at[34], at[125]);    MULADD(at[35], at[124]);    MULADD(at[36], at[123]);    MULADD(at[37], at[122]);    MULADD(at[38], at[121]);    MULADD(at[39], at[120]);    MULADD(at[40], at[119]);    MULADD(at[41], at[118]);    MULADD(at[42], at[117]);    MULADD(at[43], at[116]);    MULADD(at[44], at[115]);    MULADD(at[45], at[114]);    MULADD(at[46], at[113]);    MULADD(at[47], at[112]);    MULADD(at[48], at[111]);    MULADD(at[49], at[110]);    MULADD(at[50], at[109]);    MULADD(at[51], at[108]);    MULADD(at[52], at[107]);    MULADD(at[53], at[106]);    MULADD(at[54], at[105]);    MULADD(at[55], at[104]);    MULADD(at[56], at[103]);    MULADD(at[57], at[102]);    MULADD(at[58], at[101]);    MULADD(at[59], at[100]);    MULADD(at[60], at[99]);    MULADD(at[61], at[98]);    MULADD(at[62], at[97]);    MULADD(at[63], at[96]); 
+   COMBA_STORE(C->dp[95]);
+   /* 96 */
+   COMBA_FORWARD;
+   MULADD(at[33], at[127]);    MULADD(at[34], at[126]);    MULADD(at[35], at[125]);    MULADD(at[36], at[124]);    MULADD(at[37], at[123]);    MULADD(at[38], at[122]);    MULADD(at[39], at[121]);    MULADD(at[40], at[120]);    MULADD(at[41], at[119]);    MULADD(at[42], at[118]);    MULADD(at[43], at[117]);    MULADD(at[44], at[116]);    MULADD(at[45], at[115]);    MULADD(at[46], at[114]);    MULADD(at[47], at[113]);    MULADD(at[48], at[112]);    MULADD(at[49], at[111]);    MULADD(at[50], at[110]);    MULADD(at[51], at[109]);    MULADD(at[52], at[108]);    MULADD(at[53], at[107]);    MULADD(at[54], at[106]);    MULADD(at[55], at[105]);    MULADD(at[56], at[104]);    MULADD(at[57], at[103]);    MULADD(at[58], at[102]);    MULADD(at[59], at[101]);    MULADD(at[60], at[100]);    MULADD(at[61], at[99]);    MULADD(at[62], at[98]);    MULADD(at[63], at[97]); 
+   COMBA_STORE(C->dp[96]);
+   /* 97 */
+   COMBA_FORWARD;
+   MULADD(at[34], at[127]);    MULADD(at[35], at[126]);    MULADD(at[36], at[125]);    MULADD(at[37], at[124]);    MULADD(at[38], at[123]);    MULADD(at[39], at[122]);    MULADD(at[40], at[121]);    MULADD(at[41], at[120]);    MULADD(at[42], at[119]);    MULADD(at[43], at[118]);    MULADD(at[44], at[117]);    MULADD(at[45], at[116]);    MULADD(at[46], at[115]);    MULADD(at[47], at[114]);    MULADD(at[48], at[113]);    MULADD(at[49], at[112]);    MULADD(at[50], at[111]);    MULADD(at[51], at[110]);    MULADD(at[52], at[109]);    MULADD(at[53], at[108]);    MULADD(at[54], at[107]);    MULADD(at[55], at[106]);    MULADD(at[56], at[105]);    MULADD(at[57], at[104]);    MULADD(at[58], at[103]);    MULADD(at[59], at[102]);    MULADD(at[60], at[101]);    MULADD(at[61], at[100]);    MULADD(at[62], at[99]);    MULADD(at[63], at[98]); 
+   COMBA_STORE(C->dp[97]);
+   /* 98 */
+   COMBA_FORWARD;
+   MULADD(at[35], at[127]);    MULADD(at[36], at[126]);    MULADD(at[37], at[125]);    MULADD(at[38], at[124]);    MULADD(at[39], at[123]);    MULADD(at[40], at[122]);    MULADD(at[41], at[121]);    MULADD(at[42], at[120]);    MULADD(at[43], at[119]);    MULADD(at[44], at[118]);    MULADD(at[45], at[117]);    MULADD(at[46], at[116]);    MULADD(at[47], at[115]);    MULADD(at[48], at[114]);    MULADD(at[49], at[113]);    MULADD(at[50], at[112]);    MULADD(at[51], at[111]);    MULADD(at[52], at[110]);    MULADD(at[53], at[109]);    MULADD(at[54], at[108]);    MULADD(at[55], at[107]);    MULADD(at[56], at[106]);    MULADD(at[57], at[105]);    MULADD(at[58], at[104]);    MULADD(at[59], at[103]);    MULADD(at[60], at[102]);    MULADD(at[61], at[101]);    MULADD(at[62], at[100]);    MULADD(at[63], at[99]); 
+   COMBA_STORE(C->dp[98]);
+   /* 99 */
+   COMBA_FORWARD;
+   MULADD(at[36], at[127]);    MULADD(at[37], at[126]);    MULADD(at[38], at[125]);    MULADD(at[39], at[124]);    MULADD(at[40], at[123]);    MULADD(at[41], at[122]);    MULADD(at[42], at[121]);    MULADD(at[43], at[120]);    MULADD(at[44], at[119]);    MULADD(at[45], at[118]);    MULADD(at[46], at[117]);    MULADD(at[47], at[116]);    MULADD(at[48], at[115]);    MULADD(at[49], at[114]);    MULADD(at[50], at[113]);    MULADD(at[51], at[112]);    MULADD(at[52], at[111]);    MULADD(at[53], at[110]);    MULADD(at[54], at[109]);    MULADD(at[55], at[108]);    MULADD(at[56], at[107]);    MULADD(at[57], at[106]);    MULADD(at[58], at[105]);    MULADD(at[59], at[104]);    MULADD(at[60], at[103]);    MULADD(at[61], at[102]);    MULADD(at[62], at[101]);    MULADD(at[63], at[100]); 
+   COMBA_STORE(C->dp[99]);
+   /* 100 */
+   COMBA_FORWARD;
+   MULADD(at[37], at[127]);    MULADD(at[38], at[126]);    MULADD(at[39], at[125]);    MULADD(at[40], at[124]);    MULADD(at[41], at[123]);    MULADD(at[42], at[122]);    MULADD(at[43], at[121]);    MULADD(at[44], at[120]);    MULADD(at[45], at[119]);    MULADD(at[46], at[118]);    MULADD(at[47], at[117]);    MULADD(at[48], at[116]);    MULADD(at[49], at[115]);    MULADD(at[50], at[114]);    MULADD(at[51], at[113]);    MULADD(at[52], at[112]);    MULADD(at[53], at[111]);    MULADD(at[54], at[110]);    MULADD(at[55], at[109]);    MULADD(at[56], at[108]);    MULADD(at[57], at[107]);    MULADD(at[58], at[106]);    MULADD(at[59], at[105]);    MULADD(at[60], at[104]);    MULADD(at[61], at[103]);    MULADD(at[62], at[102]);    MULADD(at[63], at[101]); 
+   COMBA_STORE(C->dp[100]);
+   /* 101 */
+   COMBA_FORWARD;
+   MULADD(at[38], at[127]);    MULADD(at[39], at[126]);    MULADD(at[40], at[125]);    MULADD(at[41], at[124]);    MULADD(at[42], at[123]);    MULADD(at[43], at[122]);    MULADD(at[44], at[121]);    MULADD(at[45], at[120]);    MULADD(at[46], at[119]);    MULADD(at[47], at[118]);    MULADD(at[48], at[117]);    MULADD(at[49], at[116]);    MULADD(at[50], at[115]);    MULADD(at[51], at[114]);    MULADD(at[52], at[113]);    MULADD(at[53], at[112]);    MULADD(at[54], at[111]);    MULADD(at[55], at[110]);    MULADD(at[56], at[109]);    MULADD(at[57], at[108]);    MULADD(at[58], at[107]);    MULADD(at[59], at[106]);    MULADD(at[60], at[105]);    MULADD(at[61], at[104]);    MULADD(at[62], at[103]);    MULADD(at[63], at[102]); 
+   COMBA_STORE(C->dp[101]);
+   /* 102 */
+   COMBA_FORWARD;
+   MULADD(at[39], at[127]);    MULADD(at[40], at[126]);    MULADD(at[41], at[125]);    MULADD(at[42], at[124]);    MULADD(at[43], at[123]);    MULADD(at[44], at[122]);    MULADD(at[45], at[121]);    MULADD(at[46], at[120]);    MULADD(at[47], at[119]);    MULADD(at[48], at[118]);    MULADD(at[49], at[117]);    MULADD(at[50], at[116]);    MULADD(at[51], at[115]);    MULADD(at[52], at[114]);    MULADD(at[53], at[113]);    MULADD(at[54], at[112]);    MULADD(at[55], at[111]);    MULADD(at[56], at[110]);    MULADD(at[57], at[109]);    MULADD(at[58], at[108]);    MULADD(at[59], at[107]);    MULADD(at[60], at[106]);    MULADD(at[61], at[105]);    MULADD(at[62], at[104]);    MULADD(at[63], at[103]); 
+   COMBA_STORE(C->dp[102]);
+   /* 103 */
+   COMBA_FORWARD;
+   MULADD(at[40], at[127]);    MULADD(at[41], at[126]);    MULADD(at[42], at[125]);    MULADD(at[43], at[124]);    MULADD(at[44], at[123]);    MULADD(at[45], at[122]);    MULADD(at[46], at[121]);    MULADD(at[47], at[120]);    MULADD(at[48], at[119]);    MULADD(at[49], at[118]);    MULADD(at[50], at[117]);    MULADD(at[51], at[116]);    MULADD(at[52], at[115]);    MULADD(at[53], at[114]);    MULADD(at[54], at[113]);    MULADD(at[55], at[112]);    MULADD(at[56], at[111]);    MULADD(at[57], at[110]);    MULADD(at[58], at[109]);    MULADD(at[59], at[108]);    MULADD(at[60], at[107]);    MULADD(at[61], at[106]);    MULADD(at[62], at[105]);    MULADD(at[63], at[104]); 
+   COMBA_STORE(C->dp[103]);
+   /* 104 */
+   COMBA_FORWARD;
+   MULADD(at[41], at[127]);    MULADD(at[42], at[126]);    MULADD(at[43], at[125]);    MULADD(at[44], at[124]);    MULADD(at[45], at[123]);    MULADD(at[46], at[122]);    MULADD(at[47], at[121]);    MULADD(at[48], at[120]);    MULADD(at[49], at[119]);    MULADD(at[50], at[118]);    MULADD(at[51], at[117]);    MULADD(at[52], at[116]);    MULADD(at[53], at[115]);    MULADD(at[54], at[114]);    MULADD(at[55], at[113]);    MULADD(at[56], at[112]);    MULADD(at[57], at[111]);    MULADD(at[58], at[110]);    MULADD(at[59], at[109]);    MULADD(at[60], at[108]);    MULADD(at[61], at[107]);    MULADD(at[62], at[106]);    MULADD(at[63], at[105]); 
+   COMBA_STORE(C->dp[104]);
+   /* 105 */
+   COMBA_FORWARD;
+   MULADD(at[42], at[127]);    MULADD(at[43], at[126]);    MULADD(at[44], at[125]);    MULADD(at[45], at[124]);    MULADD(at[46], at[123]);    MULADD(at[47], at[122]);    MULADD(at[48], at[121]);    MULADD(at[49], at[120]);    MULADD(at[50], at[119]);    MULADD(at[51], at[118]);    MULADD(at[52], at[117]);    MULADD(at[53], at[116]);    MULADD(at[54], at[115]);    MULADD(at[55], at[114]);    MULADD(at[56], at[113]);    MULADD(at[57], at[112]);    MULADD(at[58], at[111]);    MULADD(at[59], at[110]);    MULADD(at[60], at[109]);    MULADD(at[61], at[108]);    MULADD(at[62], at[107]);    MULADD(at[63], at[106]); 
+   COMBA_STORE(C->dp[105]);
+   /* 106 */
+   COMBA_FORWARD;
+   MULADD(at[43], at[127]);    MULADD(at[44], at[126]);    MULADD(at[45], at[125]);    MULADD(at[46], at[124]);    MULADD(at[47], at[123]);    MULADD(at[48], at[122]);    MULADD(at[49], at[121]);    MULADD(at[50], at[120]);    MULADD(at[51], at[119]);    MULADD(at[52], at[118]);    MULADD(at[53], at[117]);    MULADD(at[54], at[116]);    MULADD(at[55], at[115]);    MULADD(at[56], at[114]);    MULADD(at[57], at[113]);    MULADD(at[58], at[112]);    MULADD(at[59], at[111]);    MULADD(at[60], at[110]);    MULADD(at[61], at[109]);    MULADD(at[62], at[108]);    MULADD(at[63], at[107]); 
+   COMBA_STORE(C->dp[106]);
+   /* 107 */
+   COMBA_FORWARD;
+   MULADD(at[44], at[127]);    MULADD(at[45], at[126]);    MULADD(at[46], at[125]);    MULADD(at[47], at[124]);    MULADD(at[48], at[123]);    MULADD(at[49], at[122]);    MULADD(at[50], at[121]);    MULADD(at[51], at[120]);    MULADD(at[52], at[119]);    MULADD(at[53], at[118]);    MULADD(at[54], at[117]);    MULADD(at[55], at[116]);    MULADD(at[56], at[115]);    MULADD(at[57], at[114]);    MULADD(at[58], at[113]);    MULADD(at[59], at[112]);    MULADD(at[60], at[111]);    MULADD(at[61], at[110]);    MULADD(at[62], at[109]);    MULADD(at[63], at[108]); 
+   COMBA_STORE(C->dp[107]);
+   /* 108 */
+   COMBA_FORWARD;
+   MULADD(at[45], at[127]);    MULADD(at[46], at[126]);    MULADD(at[47], at[125]);    MULADD(at[48], at[124]);    MULADD(at[49], at[123]);    MULADD(at[50], at[122]);    MULADD(at[51], at[121]);    MULADD(at[52], at[120]);    MULADD(at[53], at[119]);    MULADD(at[54], at[118]);    MULADD(at[55], at[117]);    MULADD(at[56], at[116]);    MULADD(at[57], at[115]);    MULADD(at[58], at[114]);    MULADD(at[59], at[113]);    MULADD(at[60], at[112]);    MULADD(at[61], at[111]);    MULADD(at[62], at[110]);    MULADD(at[63], at[109]); 
+   COMBA_STORE(C->dp[108]);
+   /* 109 */
+   COMBA_FORWARD;
+   MULADD(at[46], at[127]);    MULADD(at[47], at[126]);    MULADD(at[48], at[125]);    MULADD(at[49], at[124]);    MULADD(at[50], at[123]);    MULADD(at[51], at[122]);    MULADD(at[52], at[121]);    MULADD(at[53], at[120]);    MULADD(at[54], at[119]);    MULADD(at[55], at[118]);    MULADD(at[56], at[117]);    MULADD(at[57], at[116]);    MULADD(at[58], at[115]);    MULADD(at[59], at[114]);    MULADD(at[60], at[113]);    MULADD(at[61], at[112]);    MULADD(at[62], at[111]);    MULADD(at[63], at[110]); 
+   COMBA_STORE(C->dp[109]);
+   /* 110 */
+   COMBA_FORWARD;
+   MULADD(at[47], at[127]);    MULADD(at[48], at[126]);    MULADD(at[49], at[125]);    MULADD(at[50], at[124]);    MULADD(at[51], at[123]);    MULADD(at[52], at[122]);    MULADD(at[53], at[121]);    MULADD(at[54], at[120]);    MULADD(at[55], at[119]);    MULADD(at[56], at[118]);    MULADD(at[57], at[117]);    MULADD(at[58], at[116]);    MULADD(at[59], at[115]);    MULADD(at[60], at[114]);    MULADD(at[61], at[113]);    MULADD(at[62], at[112]);    MULADD(at[63], at[111]); 
+   COMBA_STORE(C->dp[110]);
+   /* 111 */
+   COMBA_FORWARD;
+   MULADD(at[48], at[127]);    MULADD(at[49], at[126]);    MULADD(at[50], at[125]);    MULADD(at[51], at[124]);    MULADD(at[52], at[123]);    MULADD(at[53], at[122]);    MULADD(at[54], at[121]);    MULADD(at[55], at[120]);    MULADD(at[56], at[119]);    MULADD(at[57], at[118]);    MULADD(at[58], at[117]);    MULADD(at[59], at[116]);    MULADD(at[60], at[115]);    MULADD(at[61], at[114]);    MULADD(at[62], at[113]);    MULADD(at[63], at[112]); 
+   COMBA_STORE(C->dp[111]);
+   /* 112 */
+   COMBA_FORWARD;
+   MULADD(at[49], at[127]);    MULADD(at[50], at[126]);    MULADD(at[51], at[125]);    MULADD(at[52], at[124]);    MULADD(at[53], at[123]);    MULADD(at[54], at[122]);    MULADD(at[55], at[121]);    MULADD(at[56], at[120]);    MULADD(at[57], at[119]);    MULADD(at[58], at[118]);    MULADD(at[59], at[117]);    MULADD(at[60], at[116]);    MULADD(at[61], at[115]);    MULADD(at[62], at[114]);    MULADD(at[63], at[113]); 
+   COMBA_STORE(C->dp[112]);
+   /* 113 */
+   COMBA_FORWARD;
+   MULADD(at[50], at[127]);    MULADD(at[51], at[126]);    MULADD(at[52], at[125]);    MULADD(at[53], at[124]);    MULADD(at[54], at[123]);    MULADD(at[55], at[122]);    MULADD(at[56], at[121]);    MULADD(at[57], at[120]);    MULADD(at[58], at[119]);    MULADD(at[59], at[118]);    MULADD(at[60], at[117]);    MULADD(at[61], at[116]);    MULADD(at[62], at[115]);    MULADD(at[63], at[114]); 
+   COMBA_STORE(C->dp[113]);
+   /* 114 */
+   COMBA_FORWARD;
+   MULADD(at[51], at[127]);    MULADD(at[52], at[126]);    MULADD(at[53], at[125]);    MULADD(at[54], at[124]);    MULADD(at[55], at[123]);    MULADD(at[56], at[122]);    MULADD(at[57], at[121]);    MULADD(at[58], at[120]);    MULADD(at[59], at[119]);    MULADD(at[60], at[118]);    MULADD(at[61], at[117]);    MULADD(at[62], at[116]);    MULADD(at[63], at[115]); 
+   COMBA_STORE(C->dp[114]);
+   /* 115 */
+   COMBA_FORWARD;
+   MULADD(at[52], at[127]);    MULADD(at[53], at[126]);    MULADD(at[54], at[125]);    MULADD(at[55], at[124]);    MULADD(at[56], at[123]);    MULADD(at[57], at[122]);    MULADD(at[58], at[121]);    MULADD(at[59], at[120]);    MULADD(at[60], at[119]);    MULADD(at[61], at[118]);    MULADD(at[62], at[117]);    MULADD(at[63], at[116]); 
+   COMBA_STORE(C->dp[115]);
+   /* 116 */
+   COMBA_FORWARD;
+   MULADD(at[53], at[127]);    MULADD(at[54], at[126]);    MULADD(at[55], at[125]);    MULADD(at[56], at[124]);    MULADD(at[57], at[123]);    MULADD(at[58], at[122]);    MULADD(at[59], at[121]);    MULADD(at[60], at[120]);    MULADD(at[61], at[119]);    MULADD(at[62], at[118]);    MULADD(at[63], at[117]); 
+   COMBA_STORE(C->dp[116]);
+   /* 117 */
+   COMBA_FORWARD;
+   MULADD(at[54], at[127]);    MULADD(at[55], at[126]);    MULADD(at[56], at[125]);    MULADD(at[57], at[124]);    MULADD(at[58], at[123]);    MULADD(at[59], at[122]);    MULADD(at[60], at[121]);    MULADD(at[61], at[120]);    MULADD(at[62], at[119]);    MULADD(at[63], at[118]); 
+   COMBA_STORE(C->dp[117]);
+   /* 118 */
+   COMBA_FORWARD;
+   MULADD(at[55], at[127]);    MULADD(at[56], at[126]);    MULADD(at[57], at[125]);    MULADD(at[58], at[124]);    MULADD(at[59], at[123]);    MULADD(at[60], at[122]);    MULADD(at[61], at[121]);    MULADD(at[62], at[120]);    MULADD(at[63], at[119]); 
+   COMBA_STORE(C->dp[118]);
+   /* 119 */
+   COMBA_FORWARD;
+   MULADD(at[56], at[127]);    MULADD(at[57], at[126]);    MULADD(at[58], at[125]);    MULADD(at[59], at[124]);    MULADD(at[60], at[123]);    MULADD(at[61], at[122]);    MULADD(at[62], at[121]);    MULADD(at[63], at[120]); 
+   COMBA_STORE(C->dp[119]);
+   /* 120 */
+   COMBA_FORWARD;
+   MULADD(at[57], at[127]);    MULADD(at[58], at[126]);    MULADD(at[59], at[125]);    MULADD(at[60], at[124]);    MULADD(at[61], at[123]);    MULADD(at[62], at[122]);    MULADD(at[63], at[121]); 
+   COMBA_STORE(C->dp[120]);
+   /* 121 */
+   COMBA_FORWARD;
+   MULADD(at[58], at[127]);    MULADD(at[59], at[126]);    MULADD(at[60], at[125]);    MULADD(at[61], at[124]);    MULADD(at[62], at[123]);    MULADD(at[63], at[122]); 
+   COMBA_STORE(C->dp[121]);
+   /* 122 */
+   COMBA_FORWARD;
+   MULADD(at[59], at[127]);    MULADD(at[60], at[126]);    MULADD(at[61], at[125]);    MULADD(at[62], at[124]);    MULADD(at[63], at[123]); 
+   COMBA_STORE(C->dp[122]);
+   /* 123 */
+   COMBA_FORWARD;
+   MULADD(at[60], at[127]);    MULADD(at[61], at[126]);    MULADD(at[62], at[125]);    MULADD(at[63], at[124]); 
+   COMBA_STORE(C->dp[123]);
+   /* 124 */
+   COMBA_FORWARD;
+   MULADD(at[61], at[127]);    MULADD(at[62], at[126]);    MULADD(at[63], at[125]); 
+   COMBA_STORE(C->dp[124]);
+   /* 125 */
+   COMBA_FORWARD;
+   MULADD(at[62], at[127]);    MULADD(at[63], at[126]); 
+   COMBA_STORE(C->dp[125]);
+   /* 126 */
+   COMBA_FORWARD;
+   MULADD(at[63], at[127]); 
+   COMBA_STORE(C->dp[126]);
+   COMBA_STORE2(C->dp[127]);
+   C->used = 128;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_7.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_7.i
new file mode 100644 (file)
index 0000000..46fb970
--- /dev/null
@@ -0,0 +1,90 @@
+/* fp_mul_comba_7.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL7
+void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[14];
+
+   memcpy(at, A->dp, 7 * sizeof(fp_digit));
+   memcpy(at+7, B->dp, 7 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[7]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[8]);    MULADD(at[1], at[7]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[9]);    MULADD(at[1], at[8]);    MULADD(at[2], at[7]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[10]);    MULADD(at[1], at[9]);    MULADD(at[2], at[8]);    MULADD(at[3], at[7]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[11]);    MULADD(at[1], at[10]);    MULADD(at[2], at[9]);    MULADD(at[3], at[8]);    MULADD(at[4], at[7]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[12]);    MULADD(at[1], at[11]);    MULADD(at[2], at[10]);    MULADD(at[3], at[9]);    MULADD(at[4], at[8]);    MULADD(at[5], at[7]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[13]);    MULADD(at[1], at[12]);    MULADD(at[2], at[11]);    MULADD(at[3], at[10]);    MULADD(at[4], at[9]);    MULADD(at[5], at[8]);    MULADD(at[6], at[7]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[13]);    MULADD(at[2], at[12]);    MULADD(at[3], at[11]);    MULADD(at[4], at[10]);    MULADD(at[5], at[9]);    MULADD(at[6], at[8]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[13]);    MULADD(at[3], at[12]);    MULADD(at[4], at[11]);    MULADD(at[5], at[10]);    MULADD(at[6], at[9]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[13]);    MULADD(at[4], at[12]);    MULADD(at[5], at[11]);    MULADD(at[6], at[10]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[13]);    MULADD(at[5], at[12]);    MULADD(at[6], at[11]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[13]);    MULADD(at[6], at[12]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[13]); 
+   COMBA_STORE(C->dp[12]);
+   COMBA_STORE2(C->dp[13]);
+   C->used = 14;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_8.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_8.i
new file mode 100644 (file)
index 0000000..987d13e
--- /dev/null
@@ -0,0 +1,98 @@
+/* fp_mul_comba_8.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL8
+void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[16];
+
+   memcpy(at, A->dp, 8 * sizeof(fp_digit));
+   memcpy(at+8, B->dp, 8 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[8]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[9]);    MULADD(at[1], at[8]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[10]);    MULADD(at[1], at[9]);    MULADD(at[2], at[8]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[11]);    MULADD(at[1], at[10]);    MULADD(at[2], at[9]);    MULADD(at[3], at[8]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[12]);    MULADD(at[1], at[11]);    MULADD(at[2], at[10]);    MULADD(at[3], at[9]);    MULADD(at[4], at[8]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[13]);    MULADD(at[1], at[12]);    MULADD(at[2], at[11]);    MULADD(at[3], at[10]);    MULADD(at[4], at[9]);    MULADD(at[5], at[8]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[14]);    MULADD(at[1], at[13]);    MULADD(at[2], at[12]);    MULADD(at[3], at[11]);    MULADD(at[4], at[10]);    MULADD(at[5], at[9]);    MULADD(at[6], at[8]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[15]);    MULADD(at[1], at[14]);    MULADD(at[2], at[13]);    MULADD(at[3], at[12]);    MULADD(at[4], at[11]);    MULADD(at[5], at[10]);    MULADD(at[6], at[9]);    MULADD(at[7], at[8]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[15]);    MULADD(at[2], at[14]);    MULADD(at[3], at[13]);    MULADD(at[4], at[12]);    MULADD(at[5], at[11]);    MULADD(at[6], at[10]);    MULADD(at[7], at[9]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[15]);    MULADD(at[3], at[14]);    MULADD(at[4], at[13]);    MULADD(at[5], at[12]);    MULADD(at[6], at[11]);    MULADD(at[7], at[10]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[15]);    MULADD(at[4], at[14]);    MULADD(at[5], at[13]);    MULADD(at[6], at[12]);    MULADD(at[7], at[11]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[15]);    MULADD(at[5], at[14]);    MULADD(at[6], at[13]);    MULADD(at[7], at[12]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[15]);    MULADD(at[6], at[14]);    MULADD(at[7], at[13]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[15]);    MULADD(at[7], at[14]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[15]); 
+   COMBA_STORE(C->dp[14]);
+   COMBA_STORE2(C->dp[15]);
+   C->used = 16;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_9.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_9.i
new file mode 100644 (file)
index 0000000..5b1b3c7
--- /dev/null
@@ -0,0 +1,106 @@
+/* fp_mul_comba_9.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_MUL9
+void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[18];
+
+   memcpy(at, A->dp, 9 * sizeof(fp_digit));
+   memcpy(at+9, B->dp, 9 * sizeof(fp_digit));
+   COMBA_START;
+
+   COMBA_CLEAR;
+   /* 0 */
+   MULADD(at[0], at[9]); 
+   COMBA_STORE(C->dp[0]);
+   /* 1 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[10]);    MULADD(at[1], at[9]); 
+   COMBA_STORE(C->dp[1]);
+   /* 2 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[11]);    MULADD(at[1], at[10]);    MULADD(at[2], at[9]); 
+   COMBA_STORE(C->dp[2]);
+   /* 3 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[12]);    MULADD(at[1], at[11]);    MULADD(at[2], at[10]);    MULADD(at[3], at[9]); 
+   COMBA_STORE(C->dp[3]);
+   /* 4 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[13]);    MULADD(at[1], at[12]);    MULADD(at[2], at[11]);    MULADD(at[3], at[10]);    MULADD(at[4], at[9]); 
+   COMBA_STORE(C->dp[4]);
+   /* 5 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[14]);    MULADD(at[1], at[13]);    MULADD(at[2], at[12]);    MULADD(at[3], at[11]);    MULADD(at[4], at[10]);    MULADD(at[5], at[9]); 
+   COMBA_STORE(C->dp[5]);
+   /* 6 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[15]);    MULADD(at[1], at[14]);    MULADD(at[2], at[13]);    MULADD(at[3], at[12]);    MULADD(at[4], at[11]);    MULADD(at[5], at[10]);    MULADD(at[6], at[9]); 
+   COMBA_STORE(C->dp[6]);
+   /* 7 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[16]);    MULADD(at[1], at[15]);    MULADD(at[2], at[14]);    MULADD(at[3], at[13]);    MULADD(at[4], at[12]);    MULADD(at[5], at[11]);    MULADD(at[6], at[10]);    MULADD(at[7], at[9]); 
+   COMBA_STORE(C->dp[7]);
+   /* 8 */
+   COMBA_FORWARD;
+   MULADD(at[0], at[17]);    MULADD(at[1], at[16]);    MULADD(at[2], at[15]);    MULADD(at[3], at[14]);    MULADD(at[4], at[13]);    MULADD(at[5], at[12]);    MULADD(at[6], at[11]);    MULADD(at[7], at[10]);    MULADD(at[8], at[9]); 
+   COMBA_STORE(C->dp[8]);
+   /* 9 */
+   COMBA_FORWARD;
+   MULADD(at[1], at[17]);    MULADD(at[2], at[16]);    MULADD(at[3], at[15]);    MULADD(at[4], at[14]);    MULADD(at[5], at[13]);    MULADD(at[6], at[12]);    MULADD(at[7], at[11]);    MULADD(at[8], at[10]); 
+   COMBA_STORE(C->dp[9]);
+   /* 10 */
+   COMBA_FORWARD;
+   MULADD(at[2], at[17]);    MULADD(at[3], at[16]);    MULADD(at[4], at[15]);    MULADD(at[5], at[14]);    MULADD(at[6], at[13]);    MULADD(at[7], at[12]);    MULADD(at[8], at[11]); 
+   COMBA_STORE(C->dp[10]);
+   /* 11 */
+   COMBA_FORWARD;
+   MULADD(at[3], at[17]);    MULADD(at[4], at[16]);    MULADD(at[5], at[15]);    MULADD(at[6], at[14]);    MULADD(at[7], at[13]);    MULADD(at[8], at[12]); 
+   COMBA_STORE(C->dp[11]);
+   /* 12 */
+   COMBA_FORWARD;
+   MULADD(at[4], at[17]);    MULADD(at[5], at[16]);    MULADD(at[6], at[15]);    MULADD(at[7], at[14]);    MULADD(at[8], at[13]); 
+   COMBA_STORE(C->dp[12]);
+   /* 13 */
+   COMBA_FORWARD;
+   MULADD(at[5], at[17]);    MULADD(at[6], at[16]);    MULADD(at[7], at[15]);    MULADD(at[8], at[14]); 
+   COMBA_STORE(C->dp[13]);
+   /* 14 */
+   COMBA_FORWARD;
+   MULADD(at[6], at[17]);    MULADD(at[7], at[16]);    MULADD(at[8], at[15]); 
+   COMBA_STORE(C->dp[14]);
+   /* 15 */
+   COMBA_FORWARD;
+   MULADD(at[7], at[17]);    MULADD(at[8], at[16]); 
+   COMBA_STORE(C->dp[15]);
+   /* 16 */
+   COMBA_FORWARD;
+   MULADD(at[8], at[17]); 
+   COMBA_STORE(C->dp[16]);
+   COMBA_STORE2(C->dp[17]);
+   C->used = 18;
+   C->sign = A->sign ^ B->sign;
+   fp_clamp(C);
+   COMBA_FINI;
+}
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_small_set.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_mul_comba_small_set.i
new file mode 100644 (file)
index 0000000..db40da7
--- /dev/null
@@ -0,0 +1,1250 @@
+/* fp_mul_comba_small_set.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#if defined(TFM_SMALL_SET)
+void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
+{
+   fp_digit c0, c1, c2, at[32];
+   switch (MAX(A->used, B->used)) { 
+
+   case 1:
+      memcpy(at, A->dp, 1 * sizeof(fp_digit));
+      memcpy(at+1, B->dp, 1 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[1]); 
+      COMBA_STORE(C->dp[0]);
+      COMBA_STORE2(C->dp[1]);
+      C->used = 2;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 2:
+      memcpy(at, A->dp, 2 * sizeof(fp_digit));
+      memcpy(at+2, B->dp, 2 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[2]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[3]);       MULADD(at[1], at[2]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[3]); 
+      COMBA_STORE(C->dp[2]);
+      COMBA_STORE2(C->dp[3]);
+      C->used = 4;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 3:
+      memcpy(at, A->dp, 3 * sizeof(fp_digit));
+      memcpy(at+3, B->dp, 3 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[3]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[4]);       MULADD(at[1], at[3]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[5]);       MULADD(at[1], at[4]);       MULADD(at[2], at[3]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[5]);       MULADD(at[2], at[4]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[5]); 
+      COMBA_STORE(C->dp[4]);
+      COMBA_STORE2(C->dp[5]);
+      C->used = 6;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 4:
+      memcpy(at, A->dp, 4 * sizeof(fp_digit));
+      memcpy(at+4, B->dp, 4 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[4]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[5]);       MULADD(at[1], at[4]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[6]);       MULADD(at[1], at[5]);       MULADD(at[2], at[4]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[7]);       MULADD(at[1], at[6]);       MULADD(at[2], at[5]);       MULADD(at[3], at[4]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[7]);       MULADD(at[2], at[6]);       MULADD(at[3], at[5]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[7]);       MULADD(at[3], at[6]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[7]); 
+      COMBA_STORE(C->dp[6]);
+      COMBA_STORE2(C->dp[7]);
+      C->used = 8;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 5:
+      memcpy(at, A->dp, 5 * sizeof(fp_digit));
+      memcpy(at+5, B->dp, 5 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[5]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[6]);       MULADD(at[1], at[5]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[7]);       MULADD(at[1], at[6]);       MULADD(at[2], at[5]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[8]);       MULADD(at[1], at[7]);       MULADD(at[2], at[6]);       MULADD(at[3], at[5]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[9]);       MULADD(at[1], at[8]);       MULADD(at[2], at[7]);       MULADD(at[3], at[6]);       MULADD(at[4], at[5]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[9]);       MULADD(at[2], at[8]);       MULADD(at[3], at[7]);       MULADD(at[4], at[6]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[9]);       MULADD(at[3], at[8]);       MULADD(at[4], at[7]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[9]);       MULADD(at[4], at[8]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[9]); 
+      COMBA_STORE(C->dp[8]);
+      COMBA_STORE2(C->dp[9]);
+      C->used = 10;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 6:
+      memcpy(at, A->dp, 6 * sizeof(fp_digit));
+      memcpy(at+6, B->dp, 6 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[6]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[7]);       MULADD(at[1], at[6]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[8]);       MULADD(at[1], at[7]);       MULADD(at[2], at[6]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[9]);       MULADD(at[1], at[8]);       MULADD(at[2], at[7]);       MULADD(at[3], at[6]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[10]);       MULADD(at[1], at[9]);       MULADD(at[2], at[8]);       MULADD(at[3], at[7]);       MULADD(at[4], at[6]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[11]);       MULADD(at[1], at[10]);       MULADD(at[2], at[9]);       MULADD(at[3], at[8]);       MULADD(at[4], at[7]);       MULADD(at[5], at[6]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[11]);       MULADD(at[2], at[10]);       MULADD(at[3], at[9]);       MULADD(at[4], at[8]);       MULADD(at[5], at[7]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[11]);       MULADD(at[3], at[10]);       MULADD(at[4], at[9]);       MULADD(at[5], at[8]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[11]);       MULADD(at[4], at[10]);       MULADD(at[5], at[9]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[11]);       MULADD(at[5], at[10]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      COMBA_STORE2(C->dp[11]);
+      C->used = 12;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 7:
+      memcpy(at, A->dp, 7 * sizeof(fp_digit));
+      memcpy(at+7, B->dp, 7 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[7]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[8]);       MULADD(at[1], at[7]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[9]);       MULADD(at[1], at[8]);       MULADD(at[2], at[7]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[10]);       MULADD(at[1], at[9]);       MULADD(at[2], at[8]);       MULADD(at[3], at[7]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[11]);       MULADD(at[1], at[10]);       MULADD(at[2], at[9]);       MULADD(at[3], at[8]);       MULADD(at[4], at[7]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[12]);       MULADD(at[1], at[11]);       MULADD(at[2], at[10]);       MULADD(at[3], at[9]);       MULADD(at[4], at[8]);       MULADD(at[5], at[7]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]);       MULADD(at[2], at[11]);       MULADD(at[3], at[10]);       MULADD(at[4], at[9]);       MULADD(at[5], at[8]);       MULADD(at[6], at[7]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[13]);       MULADD(at[2], at[12]);       MULADD(at[3], at[11]);       MULADD(at[4], at[10]);       MULADD(at[5], at[9]);       MULADD(at[6], at[8]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[13]);       MULADD(at[3], at[12]);       MULADD(at[4], at[11]);       MULADD(at[5], at[10]);       MULADD(at[6], at[9]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[13]);       MULADD(at[4], at[12]);       MULADD(at[5], at[11]);       MULADD(at[6], at[10]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[13]);       MULADD(at[5], at[12]);       MULADD(at[6], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[13]);       MULADD(at[6], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      COMBA_STORE2(C->dp[13]);
+      C->used = 14;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 8:
+      memcpy(at, A->dp, 8 * sizeof(fp_digit));
+      memcpy(at+8, B->dp, 8 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[8]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[9]);       MULADD(at[1], at[8]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[10]);       MULADD(at[1], at[9]);       MULADD(at[2], at[8]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[11]);       MULADD(at[1], at[10]);       MULADD(at[2], at[9]);       MULADD(at[3], at[8]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[12]);       MULADD(at[1], at[11]);       MULADD(at[2], at[10]);       MULADD(at[3], at[9]);       MULADD(at[4], at[8]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]);       MULADD(at[2], at[11]);       MULADD(at[3], at[10]);       MULADD(at[4], at[9]);       MULADD(at[5], at[8]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]);       MULADD(at[2], at[12]);       MULADD(at[3], at[11]);       MULADD(at[4], at[10]);       MULADD(at[5], at[9]);       MULADD(at[6], at[8]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]);       MULADD(at[3], at[12]);       MULADD(at[4], at[11]);       MULADD(at[5], at[10]);       MULADD(at[6], at[9]);       MULADD(at[7], at[8]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]);       MULADD(at[4], at[12]);       MULADD(at[5], at[11]);       MULADD(at[6], at[10]);       MULADD(at[7], at[9]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]);       MULADD(at[5], at[12]);       MULADD(at[6], at[11]);       MULADD(at[7], at[10]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]);       MULADD(at[6], at[12]);       MULADD(at[7], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]);       MULADD(at[7], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[15]);       MULADD(at[7], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      COMBA_STORE2(C->dp[15]);
+      C->used = 16;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 9:
+      memcpy(at, A->dp, 9 * sizeof(fp_digit));
+      memcpy(at+9, B->dp, 9 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[9]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[10]);       MULADD(at[1], at[9]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[11]);       MULADD(at[1], at[10]);       MULADD(at[2], at[9]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[12]);       MULADD(at[1], at[11]);       MULADD(at[2], at[10]);       MULADD(at[3], at[9]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]);       MULADD(at[2], at[11]);       MULADD(at[3], at[10]);       MULADD(at[4], at[9]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]);       MULADD(at[2], at[12]);       MULADD(at[3], at[11]);       MULADD(at[4], at[10]);       MULADD(at[5], at[9]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]);       MULADD(at[3], at[12]);       MULADD(at[4], at[11]);       MULADD(at[5], at[10]);       MULADD(at[6], at[9]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]);       MULADD(at[4], at[12]);       MULADD(at[5], at[11]);       MULADD(at[6], at[10]);       MULADD(at[7], at[9]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]);       MULADD(at[5], at[12]);       MULADD(at[6], at[11]);       MULADD(at[7], at[10]);       MULADD(at[8], at[9]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]);       MULADD(at[6], at[12]);       MULADD(at[7], at[11]);       MULADD(at[8], at[10]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]);       MULADD(at[7], at[12]);       MULADD(at[8], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]);       MULADD(at[8], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]);       MULADD(at[8], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[17]);       MULADD(at[8], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      COMBA_STORE2(C->dp[17]);
+      C->used = 18;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 10:
+      memcpy(at, A->dp, 10 * sizeof(fp_digit));
+      memcpy(at+10, B->dp, 10 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[10]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[11]);       MULADD(at[1], at[10]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[12]);       MULADD(at[1], at[11]);       MULADD(at[2], at[10]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]);       MULADD(at[2], at[11]);       MULADD(at[3], at[10]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]);       MULADD(at[2], at[12]);       MULADD(at[3], at[11]);       MULADD(at[4], at[10]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]);       MULADD(at[3], at[12]);       MULADD(at[4], at[11]);       MULADD(at[5], at[10]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]);       MULADD(at[4], at[12]);       MULADD(at[5], at[11]);       MULADD(at[6], at[10]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]);       MULADD(at[5], at[12]);       MULADD(at[6], at[11]);       MULADD(at[7], at[10]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]);       MULADD(at[6], at[12]);       MULADD(at[7], at[11]);       MULADD(at[8], at[10]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]);       MULADD(at[7], at[12]);       MULADD(at[8], at[11]);       MULADD(at[9], at[10]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]);       MULADD(at[8], at[12]);       MULADD(at[9], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]);       MULADD(at[8], at[13]);       MULADD(at[9], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]);       MULADD(at[9], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]);       MULADD(at[9], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[19]);       MULADD(at[9], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      COMBA_STORE2(C->dp[19]);
+      C->used = 20;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 11:
+      memcpy(at, A->dp, 11 * sizeof(fp_digit));
+      memcpy(at+11, B->dp, 11 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[11]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[12]);       MULADD(at[1], at[11]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]);       MULADD(at[2], at[11]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]);       MULADD(at[2], at[12]);       MULADD(at[3], at[11]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]);       MULADD(at[3], at[12]);       MULADD(at[4], at[11]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]);       MULADD(at[4], at[12]);       MULADD(at[5], at[11]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]);       MULADD(at[5], at[12]);       MULADD(at[6], at[11]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]);       MULADD(at[6], at[12]);       MULADD(at[7], at[11]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]);       MULADD(at[7], at[12]);       MULADD(at[8], at[11]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]);       MULADD(at[8], at[12]);       MULADD(at[9], at[11]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]);       MULADD(at[8], at[13]);       MULADD(at[9], at[12]);       MULADD(at[10], at[11]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]);       MULADD(at[9], at[13]);       MULADD(at[10], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]);       MULADD(at[9], at[14]);       MULADD(at[10], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]);       MULADD(at[10], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]);       MULADD(at[10], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[21]);       MULADD(at[10], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      COMBA_STORE2(C->dp[21]);
+      C->used = 22;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 12:
+      memcpy(at, A->dp, 12 * sizeof(fp_digit));
+      memcpy(at+12, B->dp, 12 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[12]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[13]);       MULADD(at[1], at[12]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]);       MULADD(at[2], at[12]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]);       MULADD(at[3], at[12]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]);       MULADD(at[4], at[12]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]);       MULADD(at[5], at[12]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]);       MULADD(at[6], at[12]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]);       MULADD(at[7], at[12]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]);       MULADD(at[8], at[12]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]);       MULADD(at[8], at[13]);       MULADD(at[9], at[12]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[22]);       MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]);       MULADD(at[9], at[13]);       MULADD(at[10], at[12]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[23]);       MULADD(at[1], at[22]);       MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]);       MULADD(at[9], at[14]);       MULADD(at[10], at[13]);       MULADD(at[11], at[12]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[23]);       MULADD(at[2], at[22]);       MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]);       MULADD(at[10], at[14]);       MULADD(at[11], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[23]);       MULADD(at[3], at[22]);       MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]);       MULADD(at[10], at[15]);       MULADD(at[11], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[23]);       MULADD(at[4], at[22]);       MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]);       MULADD(at[11], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[23]);       MULADD(at[5], at[22]);       MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]);       MULADD(at[11], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[23]);       MULADD(at[6], at[22]);       MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]);       MULADD(at[11], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[23]);       MULADD(at[7], at[22]);       MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]);       MULADD(at[11], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[23]);       MULADD(at[8], at[22]);       MULADD(at[9], at[21]);       MULADD(at[10], at[20]);       MULADD(at[11], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[23]);       MULADD(at[9], at[22]);       MULADD(at[10], at[21]);       MULADD(at[11], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[23]);       MULADD(at[10], at[22]);       MULADD(at[11], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      /* 21 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[23]);       MULADD(at[11], at[22]); 
+      COMBA_STORE(C->dp[21]);
+      /* 22 */
+      COMBA_FORWARD;
+      MULADD(at[11], at[23]); 
+      COMBA_STORE(C->dp[22]);
+      COMBA_STORE2(C->dp[23]);
+      C->used = 24;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 13:
+      memcpy(at, A->dp, 13 * sizeof(fp_digit));
+      memcpy(at+13, B->dp, 13 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[13]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[14]);       MULADD(at[1], at[13]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]);       MULADD(at[2], at[13]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]);       MULADD(at[3], at[13]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]);       MULADD(at[4], at[13]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]);       MULADD(at[5], at[13]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]);       MULADD(at[6], at[13]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]);       MULADD(at[7], at[13]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]);       MULADD(at[8], at[13]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[22]);       MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]);       MULADD(at[9], at[13]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[23]);       MULADD(at[1], at[22]);       MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]);       MULADD(at[9], at[14]);       MULADD(at[10], at[13]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[24]);       MULADD(at[1], at[23]);       MULADD(at[2], at[22]);       MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]);       MULADD(at[10], at[14]);       MULADD(at[11], at[13]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[25]);       MULADD(at[1], at[24]);       MULADD(at[2], at[23]);       MULADD(at[3], at[22]);       MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]);       MULADD(at[10], at[15]);       MULADD(at[11], at[14]);       MULADD(at[12], at[13]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[25]);       MULADD(at[2], at[24]);       MULADD(at[3], at[23]);       MULADD(at[4], at[22]);       MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]);       MULADD(at[11], at[15]);       MULADD(at[12], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[25]);       MULADD(at[3], at[24]);       MULADD(at[4], at[23]);       MULADD(at[5], at[22]);       MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]);       MULADD(at[11], at[16]);       MULADD(at[12], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[25]);       MULADD(at[4], at[24]);       MULADD(at[5], at[23]);       MULADD(at[6], at[22]);       MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]);       MULADD(at[11], at[17]);       MULADD(at[12], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[25]);       MULADD(at[5], at[24]);       MULADD(at[6], at[23]);       MULADD(at[7], at[22]);       MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]);       MULADD(at[11], at[18]);       MULADD(at[12], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[25]);       MULADD(at[6], at[24]);       MULADD(at[7], at[23]);       MULADD(at[8], at[22]);       MULADD(at[9], at[21]);       MULADD(at[10], at[20]);       MULADD(at[11], at[19]);       MULADD(at[12], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[25]);       MULADD(at[7], at[24]);       MULADD(at[8], at[23]);       MULADD(at[9], at[22]);       MULADD(at[10], at[21]);       MULADD(at[11], at[20]);       MULADD(at[12], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[25]);       MULADD(at[8], at[24]);       MULADD(at[9], at[23]);       MULADD(at[10], at[22]);       MULADD(at[11], at[21]);       MULADD(at[12], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[25]);       MULADD(at[9], at[24]);       MULADD(at[10], at[23]);       MULADD(at[11], at[22]);       MULADD(at[12], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      /* 21 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[25]);       MULADD(at[10], at[24]);       MULADD(at[11], at[23]);       MULADD(at[12], at[22]); 
+      COMBA_STORE(C->dp[21]);
+      /* 22 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[25]);       MULADD(at[11], at[24]);       MULADD(at[12], at[23]); 
+      COMBA_STORE(C->dp[22]);
+      /* 23 */
+      COMBA_FORWARD;
+      MULADD(at[11], at[25]);       MULADD(at[12], at[24]); 
+      COMBA_STORE(C->dp[23]);
+      /* 24 */
+      COMBA_FORWARD;
+      MULADD(at[12], at[25]); 
+      COMBA_STORE(C->dp[24]);
+      COMBA_STORE2(C->dp[25]);
+      C->used = 26;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 14:
+      memcpy(at, A->dp, 14 * sizeof(fp_digit));
+      memcpy(at+14, B->dp, 14 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[14]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[15]);       MULADD(at[1], at[14]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]);       MULADD(at[2], at[14]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]);       MULADD(at[3], at[14]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]);       MULADD(at[4], at[14]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]);       MULADD(at[5], at[14]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]);       MULADD(at[6], at[14]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]);       MULADD(at[7], at[14]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[22]);       MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]);       MULADD(at[8], at[14]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[23]);       MULADD(at[1], at[22]);       MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]);       MULADD(at[9], at[14]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[24]);       MULADD(at[1], at[23]);       MULADD(at[2], at[22]);       MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]);       MULADD(at[10], at[14]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[25]);       MULADD(at[1], at[24]);       MULADD(at[2], at[23]);       MULADD(at[3], at[22]);       MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]);       MULADD(at[10], at[15]);       MULADD(at[11], at[14]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[26]);       MULADD(at[1], at[25]);       MULADD(at[2], at[24]);       MULADD(at[3], at[23]);       MULADD(at[4], at[22]);       MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]);       MULADD(at[11], at[15]);       MULADD(at[12], at[14]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[27]);       MULADD(at[1], at[26]);       MULADD(at[2], at[25]);       MULADD(at[3], at[24]);       MULADD(at[4], at[23]);       MULADD(at[5], at[22]);       MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]);       MULADD(at[11], at[16]);       MULADD(at[12], at[15]);       MULADD(at[13], at[14]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[27]);       MULADD(at[2], at[26]);       MULADD(at[3], at[25]);       MULADD(at[4], at[24]);       MULADD(at[5], at[23]);       MULADD(at[6], at[22]);       MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]);       MULADD(at[11], at[17]);       MULADD(at[12], at[16]);       MULADD(at[13], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[27]);       MULADD(at[3], at[26]);       MULADD(at[4], at[25]);       MULADD(at[5], at[24]);       MULADD(at[6], at[23]);       MULADD(at[7], at[22]);       MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]);       MULADD(at[11], at[18]);       MULADD(at[12], at[17]);       MULADD(at[13], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[27]);       MULADD(at[4], at[26]);       MULADD(at[5], at[25]);       MULADD(at[6], at[24]);       MULADD(at[7], at[23]);       MULADD(at[8], at[22]);       MULADD(at[9], at[21]);       MULADD(at[10], at[20]);       MULADD(at[11], at[19]);       MULADD(at[12], at[18]);       MULADD(at[13], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[27]);       MULADD(at[5], at[26]);       MULADD(at[6], at[25]);       MULADD(at[7], at[24]);       MULADD(at[8], at[23]);       MULADD(at[9], at[22]);       MULADD(at[10], at[21]);       MULADD(at[11], at[20]);       MULADD(at[12], at[19]);       MULADD(at[13], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[27]);       MULADD(at[6], at[26]);       MULADD(at[7], at[25]);       MULADD(at[8], at[24]);       MULADD(at[9], at[23]);       MULADD(at[10], at[22]);       MULADD(at[11], at[21]);       MULADD(at[12], at[20]);       MULADD(at[13], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[27]);       MULADD(at[7], at[26]);       MULADD(at[8], at[25]);       MULADD(at[9], at[24]);       MULADD(at[10], at[23]);       MULADD(at[11], at[22]);       MULADD(at[12], at[21]);       MULADD(at[13], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[27]);       MULADD(at[8], at[26]);       MULADD(at[9], at[25]);       MULADD(at[10], at[24]);       MULADD(at[11], at[23]);       MULADD(at[12], at[22]);       MULADD(at[13], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      /* 21 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[27]);       MULADD(at[9], at[26]);       MULADD(at[10], at[25]);       MULADD(at[11], at[24]);       MULADD(at[12], at[23]);       MULADD(at[13], at[22]); 
+      COMBA_STORE(C->dp[21]);
+      /* 22 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[27]);       MULADD(at[10], at[26]);       MULADD(at[11], at[25]);       MULADD(at[12], at[24]);       MULADD(at[13], at[23]); 
+      COMBA_STORE(C->dp[22]);
+      /* 23 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[27]);       MULADD(at[11], at[26]);       MULADD(at[12], at[25]);       MULADD(at[13], at[24]); 
+      COMBA_STORE(C->dp[23]);
+      /* 24 */
+      COMBA_FORWARD;
+      MULADD(at[11], at[27]);       MULADD(at[12], at[26]);       MULADD(at[13], at[25]); 
+      COMBA_STORE(C->dp[24]);
+      /* 25 */
+      COMBA_FORWARD;
+      MULADD(at[12], at[27]);       MULADD(at[13], at[26]); 
+      COMBA_STORE(C->dp[25]);
+      /* 26 */
+      COMBA_FORWARD;
+      MULADD(at[13], at[27]); 
+      COMBA_STORE(C->dp[26]);
+      COMBA_STORE2(C->dp[27]);
+      C->used = 28;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 15:
+      memcpy(at, A->dp, 15 * sizeof(fp_digit));
+      memcpy(at+15, B->dp, 15 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[15]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[16]);       MULADD(at[1], at[15]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]);       MULADD(at[2], at[15]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]);       MULADD(at[3], at[15]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]);       MULADD(at[4], at[15]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]);       MULADD(at[5], at[15]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]);       MULADD(at[6], at[15]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[22]);       MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]);       MULADD(at[7], at[15]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[23]);       MULADD(at[1], at[22]);       MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]);       MULADD(at[8], at[15]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[24]);       MULADD(at[1], at[23]);       MULADD(at[2], at[22]);       MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]);       MULADD(at[9], at[15]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[25]);       MULADD(at[1], at[24]);       MULADD(at[2], at[23]);       MULADD(at[3], at[22]);       MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]);       MULADD(at[10], at[15]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[26]);       MULADD(at[1], at[25]);       MULADD(at[2], at[24]);       MULADD(at[3], at[23]);       MULADD(at[4], at[22]);       MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]);       MULADD(at[11], at[15]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[27]);       MULADD(at[1], at[26]);       MULADD(at[2], at[25]);       MULADD(at[3], at[24]);       MULADD(at[4], at[23]);       MULADD(at[5], at[22]);       MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]);       MULADD(at[11], at[16]);       MULADD(at[12], at[15]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[28]);       MULADD(at[1], at[27]);       MULADD(at[2], at[26]);       MULADD(at[3], at[25]);       MULADD(at[4], at[24]);       MULADD(at[5], at[23]);       MULADD(at[6], at[22]);       MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]);       MULADD(at[11], at[17]);       MULADD(at[12], at[16]);       MULADD(at[13], at[15]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[29]);       MULADD(at[1], at[28]);       MULADD(at[2], at[27]);       MULADD(at[3], at[26]);       MULADD(at[4], at[25]);       MULADD(at[5], at[24]);       MULADD(at[6], at[23]);       MULADD(at[7], at[22]);       MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]);       MULADD(at[11], at[18]);       MULADD(at[12], at[17]);       MULADD(at[13], at[16]);       MULADD(at[14], at[15]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[29]);       MULADD(at[2], at[28]);       MULADD(at[3], at[27]);       MULADD(at[4], at[26]);       MULADD(at[5], at[25]);       MULADD(at[6], at[24]);       MULADD(at[7], at[23]);       MULADD(at[8], at[22]);       MULADD(at[9], at[21]);       MULADD(at[10], at[20]);       MULADD(at[11], at[19]);       MULADD(at[12], at[18]);       MULADD(at[13], at[17]);       MULADD(at[14], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[29]);       MULADD(at[3], at[28]);       MULADD(at[4], at[27]);       MULADD(at[5], at[26]);       MULADD(at[6], at[25]);       MULADD(at[7], at[24]);       MULADD(at[8], at[23]);       MULADD(at[9], at[22]);       MULADD(at[10], at[21]);       MULADD(at[11], at[20]);       MULADD(at[12], at[19]);       MULADD(at[13], at[18]);       MULADD(at[14], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[29]);       MULADD(at[4], at[28]);       MULADD(at[5], at[27]);       MULADD(at[6], at[26]);       MULADD(at[7], at[25]);       MULADD(at[8], at[24]);       MULADD(at[9], at[23]);       MULADD(at[10], at[22]);       MULADD(at[11], at[21]);       MULADD(at[12], at[20]);       MULADD(at[13], at[19]);       MULADD(at[14], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[29]);       MULADD(at[5], at[28]);       MULADD(at[6], at[27]);       MULADD(at[7], at[26]);       MULADD(at[8], at[25]);       MULADD(at[9], at[24]);       MULADD(at[10], at[23]);       MULADD(at[11], at[22]);       MULADD(at[12], at[21]);       MULADD(at[13], at[20]);       MULADD(at[14], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[29]);       MULADD(at[6], at[28]);       MULADD(at[7], at[27]);       MULADD(at[8], at[26]);       MULADD(at[9], at[25]);       MULADD(at[10], at[24]);       MULADD(at[11], at[23]);       MULADD(at[12], at[22]);       MULADD(at[13], at[21]);       MULADD(at[14], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[29]);       MULADD(at[7], at[28]);       MULADD(at[8], at[27]);       MULADD(at[9], at[26]);       MULADD(at[10], at[25]);       MULADD(at[11], at[24]);       MULADD(at[12], at[23]);       MULADD(at[13], at[22]);       MULADD(at[14], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      /* 21 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[29]);       MULADD(at[8], at[28]);       MULADD(at[9], at[27]);       MULADD(at[10], at[26]);       MULADD(at[11], at[25]);       MULADD(at[12], at[24]);       MULADD(at[13], at[23]);       MULADD(at[14], at[22]); 
+      COMBA_STORE(C->dp[21]);
+      /* 22 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[29]);       MULADD(at[9], at[28]);       MULADD(at[10], at[27]);       MULADD(at[11], at[26]);       MULADD(at[12], at[25]);       MULADD(at[13], at[24]);       MULADD(at[14], at[23]); 
+      COMBA_STORE(C->dp[22]);
+      /* 23 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[29]);       MULADD(at[10], at[28]);       MULADD(at[11], at[27]);       MULADD(at[12], at[26]);       MULADD(at[13], at[25]);       MULADD(at[14], at[24]); 
+      COMBA_STORE(C->dp[23]);
+      /* 24 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[29]);       MULADD(at[11], at[28]);       MULADD(at[12], at[27]);       MULADD(at[13], at[26]);       MULADD(at[14], at[25]); 
+      COMBA_STORE(C->dp[24]);
+      /* 25 */
+      COMBA_FORWARD;
+      MULADD(at[11], at[29]);       MULADD(at[12], at[28]);       MULADD(at[13], at[27]);       MULADD(at[14], at[26]); 
+      COMBA_STORE(C->dp[25]);
+      /* 26 */
+      COMBA_FORWARD;
+      MULADD(at[12], at[29]);       MULADD(at[13], at[28]);       MULADD(at[14], at[27]); 
+      COMBA_STORE(C->dp[26]);
+      /* 27 */
+      COMBA_FORWARD;
+      MULADD(at[13], at[29]);       MULADD(at[14], at[28]); 
+      COMBA_STORE(C->dp[27]);
+      /* 28 */
+      COMBA_FORWARD;
+      MULADD(at[14], at[29]); 
+      COMBA_STORE(C->dp[28]);
+      COMBA_STORE2(C->dp[29]);
+      C->used = 30;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   case 16:
+      memcpy(at, A->dp, 16 * sizeof(fp_digit));
+      memcpy(at+16, B->dp, 16 * sizeof(fp_digit));
+      COMBA_START;
+
+      COMBA_CLEAR;
+      /* 0 */
+      MULADD(at[0], at[16]); 
+      COMBA_STORE(C->dp[0]);
+      /* 1 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[17]);       MULADD(at[1], at[16]); 
+      COMBA_STORE(C->dp[1]);
+      /* 2 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[18]);       MULADD(at[1], at[17]);       MULADD(at[2], at[16]); 
+      COMBA_STORE(C->dp[2]);
+      /* 3 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[19]);       MULADD(at[1], at[18]);       MULADD(at[2], at[17]);       MULADD(at[3], at[16]); 
+      COMBA_STORE(C->dp[3]);
+      /* 4 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[20]);       MULADD(at[1], at[19]);       MULADD(at[2], at[18]);       MULADD(at[3], at[17]);       MULADD(at[4], at[16]); 
+      COMBA_STORE(C->dp[4]);
+      /* 5 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[21]);       MULADD(at[1], at[20]);       MULADD(at[2], at[19]);       MULADD(at[3], at[18]);       MULADD(at[4], at[17]);       MULADD(at[5], at[16]); 
+      COMBA_STORE(C->dp[5]);
+      /* 6 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[22]);       MULADD(at[1], at[21]);       MULADD(at[2], at[20]);       MULADD(at[3], at[19]);       MULADD(at[4], at[18]);       MULADD(at[5], at[17]);       MULADD(at[6], at[16]); 
+      COMBA_STORE(C->dp[6]);
+      /* 7 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[23]);       MULADD(at[1], at[22]);       MULADD(at[2], at[21]);       MULADD(at[3], at[20]);       MULADD(at[4], at[19]);       MULADD(at[5], at[18]);       MULADD(at[6], at[17]);       MULADD(at[7], at[16]); 
+      COMBA_STORE(C->dp[7]);
+      /* 8 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[24]);       MULADD(at[1], at[23]);       MULADD(at[2], at[22]);       MULADD(at[3], at[21]);       MULADD(at[4], at[20]);       MULADD(at[5], at[19]);       MULADD(at[6], at[18]);       MULADD(at[7], at[17]);       MULADD(at[8], at[16]); 
+      COMBA_STORE(C->dp[8]);
+      /* 9 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[25]);       MULADD(at[1], at[24]);       MULADD(at[2], at[23]);       MULADD(at[3], at[22]);       MULADD(at[4], at[21]);       MULADD(at[5], at[20]);       MULADD(at[6], at[19]);       MULADD(at[7], at[18]);       MULADD(at[8], at[17]);       MULADD(at[9], at[16]); 
+      COMBA_STORE(C->dp[9]);
+      /* 10 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[26]);       MULADD(at[1], at[25]);       MULADD(at[2], at[24]);       MULADD(at[3], at[23]);       MULADD(at[4], at[22]);       MULADD(at[5], at[21]);       MULADD(at[6], at[20]);       MULADD(at[7], at[19]);       MULADD(at[8], at[18]);       MULADD(at[9], at[17]);       MULADD(at[10], at[16]); 
+      COMBA_STORE(C->dp[10]);
+      /* 11 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[27]);       MULADD(at[1], at[26]);       MULADD(at[2], at[25]);       MULADD(at[3], at[24]);       MULADD(at[4], at[23]);       MULADD(at[5], at[22]);       MULADD(at[6], at[21]);       MULADD(at[7], at[20]);       MULADD(at[8], at[19]);       MULADD(at[9], at[18]);       MULADD(at[10], at[17]);       MULADD(at[11], at[16]); 
+      COMBA_STORE(C->dp[11]);
+      /* 12 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[28]);       MULADD(at[1], at[27]);       MULADD(at[2], at[26]);       MULADD(at[3], at[25]);       MULADD(at[4], at[24]);       MULADD(at[5], at[23]);       MULADD(at[6], at[22]);       MULADD(at[7], at[21]);       MULADD(at[8], at[20]);       MULADD(at[9], at[19]);       MULADD(at[10], at[18]);       MULADD(at[11], at[17]);       MULADD(at[12], at[16]); 
+      COMBA_STORE(C->dp[12]);
+      /* 13 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[29]);       MULADD(at[1], at[28]);       MULADD(at[2], at[27]);       MULADD(at[3], at[26]);       MULADD(at[4], at[25]);       MULADD(at[5], at[24]);       MULADD(at[6], at[23]);       MULADD(at[7], at[22]);       MULADD(at[8], at[21]);       MULADD(at[9], at[20]);       MULADD(at[10], at[19]);       MULADD(at[11], at[18]);       MULADD(at[12], at[17]);       MULADD(at[13], at[16]); 
+      COMBA_STORE(C->dp[13]);
+      /* 14 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[30]);       MULADD(at[1], at[29]);       MULADD(at[2], at[28]);       MULADD(at[3], at[27]);       MULADD(at[4], at[26]);       MULADD(at[5], at[25]);       MULADD(at[6], at[24]);       MULADD(at[7], at[23]);       MULADD(at[8], at[22]);       MULADD(at[9], at[21]);       MULADD(at[10], at[20]);       MULADD(at[11], at[19]);       MULADD(at[12], at[18]);       MULADD(at[13], at[17]);       MULADD(at[14], at[16]); 
+      COMBA_STORE(C->dp[14]);
+      /* 15 */
+      COMBA_FORWARD;
+      MULADD(at[0], at[31]);       MULADD(at[1], at[30]);       MULADD(at[2], at[29]);       MULADD(at[3], at[28]);       MULADD(at[4], at[27]);       MULADD(at[5], at[26]);       MULADD(at[6], at[25]);       MULADD(at[7], at[24]);       MULADD(at[8], at[23]);       MULADD(at[9], at[22]);       MULADD(at[10], at[21]);       MULADD(at[11], at[20]);       MULADD(at[12], at[19]);       MULADD(at[13], at[18]);       MULADD(at[14], at[17]);       MULADD(at[15], at[16]); 
+      COMBA_STORE(C->dp[15]);
+      /* 16 */
+      COMBA_FORWARD;
+      MULADD(at[1], at[31]);       MULADD(at[2], at[30]);       MULADD(at[3], at[29]);       MULADD(at[4], at[28]);       MULADD(at[5], at[27]);       MULADD(at[6], at[26]);       MULADD(at[7], at[25]);       MULADD(at[8], at[24]);       MULADD(at[9], at[23]);       MULADD(at[10], at[22]);       MULADD(at[11], at[21]);       MULADD(at[12], at[20]);       MULADD(at[13], at[19]);       MULADD(at[14], at[18]);       MULADD(at[15], at[17]); 
+      COMBA_STORE(C->dp[16]);
+      /* 17 */
+      COMBA_FORWARD;
+      MULADD(at[2], at[31]);       MULADD(at[3], at[30]);       MULADD(at[4], at[29]);       MULADD(at[5], at[28]);       MULADD(at[6], at[27]);       MULADD(at[7], at[26]);       MULADD(at[8], at[25]);       MULADD(at[9], at[24]);       MULADD(at[10], at[23]);       MULADD(at[11], at[22]);       MULADD(at[12], at[21]);       MULADD(at[13], at[20]);       MULADD(at[14], at[19]);       MULADD(at[15], at[18]); 
+      COMBA_STORE(C->dp[17]);
+      /* 18 */
+      COMBA_FORWARD;
+      MULADD(at[3], at[31]);       MULADD(at[4], at[30]);       MULADD(at[5], at[29]);       MULADD(at[6], at[28]);       MULADD(at[7], at[27]);       MULADD(at[8], at[26]);       MULADD(at[9], at[25]);       MULADD(at[10], at[24]);       MULADD(at[11], at[23]);       MULADD(at[12], at[22]);       MULADD(at[13], at[21]);       MULADD(at[14], at[20]);       MULADD(at[15], at[19]); 
+      COMBA_STORE(C->dp[18]);
+      /* 19 */
+      COMBA_FORWARD;
+      MULADD(at[4], at[31]);       MULADD(at[5], at[30]);       MULADD(at[6], at[29]);       MULADD(at[7], at[28]);       MULADD(at[8], at[27]);       MULADD(at[9], at[26]);       MULADD(at[10], at[25]);       MULADD(at[11], at[24]);       MULADD(at[12], at[23]);       MULADD(at[13], at[22]);       MULADD(at[14], at[21]);       MULADD(at[15], at[20]); 
+      COMBA_STORE(C->dp[19]);
+      /* 20 */
+      COMBA_FORWARD;
+      MULADD(at[5], at[31]);       MULADD(at[6], at[30]);       MULADD(at[7], at[29]);       MULADD(at[8], at[28]);       MULADD(at[9], at[27]);       MULADD(at[10], at[26]);       MULADD(at[11], at[25]);       MULADD(at[12], at[24]);       MULADD(at[13], at[23]);       MULADD(at[14], at[22]);       MULADD(at[15], at[21]); 
+      COMBA_STORE(C->dp[20]);
+      /* 21 */
+      COMBA_FORWARD;
+      MULADD(at[6], at[31]);       MULADD(at[7], at[30]);       MULADD(at[8], at[29]);       MULADD(at[9], at[28]);       MULADD(at[10], at[27]);       MULADD(at[11], at[26]);       MULADD(at[12], at[25]);       MULADD(at[13], at[24]);       MULADD(at[14], at[23]);       MULADD(at[15], at[22]); 
+      COMBA_STORE(C->dp[21]);
+      /* 22 */
+      COMBA_FORWARD;
+      MULADD(at[7], at[31]);       MULADD(at[8], at[30]);       MULADD(at[9], at[29]);       MULADD(at[10], at[28]);       MULADD(at[11], at[27]);       MULADD(at[12], at[26]);       MULADD(at[13], at[25]);       MULADD(at[14], at[24]);       MULADD(at[15], at[23]); 
+      COMBA_STORE(C->dp[22]);
+      /* 23 */
+      COMBA_FORWARD;
+      MULADD(at[8], at[31]);       MULADD(at[9], at[30]);       MULADD(at[10], at[29]);       MULADD(at[11], at[28]);       MULADD(at[12], at[27]);       MULADD(at[13], at[26]);       MULADD(at[14], at[25]);       MULADD(at[15], at[24]); 
+      COMBA_STORE(C->dp[23]);
+      /* 24 */
+      COMBA_FORWARD;
+      MULADD(at[9], at[31]);       MULADD(at[10], at[30]);       MULADD(at[11], at[29]);       MULADD(at[12], at[28]);       MULADD(at[13], at[27]);       MULADD(at[14], at[26]);       MULADD(at[15], at[25]); 
+      COMBA_STORE(C->dp[24]);
+      /* 25 */
+      COMBA_FORWARD;
+      MULADD(at[10], at[31]);       MULADD(at[11], at[30]);       MULADD(at[12], at[29]);       MULADD(at[13], at[28]);       MULADD(at[14], at[27]);       MULADD(at[15], at[26]); 
+      COMBA_STORE(C->dp[25]);
+      /* 26 */
+      COMBA_FORWARD;
+      MULADD(at[11], at[31]);       MULADD(at[12], at[30]);       MULADD(at[13], at[29]);       MULADD(at[14], at[28]);       MULADD(at[15], at[27]); 
+      COMBA_STORE(C->dp[26]);
+      /* 27 */
+      COMBA_FORWARD;
+      MULADD(at[12], at[31]);       MULADD(at[13], at[30]);       MULADD(at[14], at[29]);       MULADD(at[15], at[28]); 
+      COMBA_STORE(C->dp[27]);
+      /* 28 */
+      COMBA_FORWARD;
+      MULADD(at[13], at[31]);       MULADD(at[14], at[30]);       MULADD(at[15], at[29]); 
+      COMBA_STORE(C->dp[28]);
+      /* 29 */
+      COMBA_FORWARD;
+      MULADD(at[14], at[31]);       MULADD(at[15], at[30]); 
+      COMBA_STORE(C->dp[29]);
+      /* 30 */
+      COMBA_FORWARD;
+      MULADD(at[15], at[31]); 
+      COMBA_STORE(C->dp[30]);
+      COMBA_STORE2(C->dp[31]);
+      C->used = 32;
+      C->sign = A->sign ^ B->sign;
+      fp_clamp(C);
+      COMBA_FINI;
+      break;
+
+   default:
+      break;
+   }
+}
+
+#endif
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_12.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_12.i
new file mode 100644 (file)
index 0000000..382ebe2
--- /dev/null
@@ -0,0 +1,157 @@
+/* fp_sqr_comba_12.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR12
+void fp_sqr_comba12(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[24], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADD2(a[7], a[11]); SQRADD2(a[8], a[10]); SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADD2(a[8], a[11]); SQRADD2(a[9], a[10]); 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADD2(a[9], a[11]); SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADD2(a[10], a[11]); 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+   COMBA_STORE2(b[23]);
+   COMBA_FINI;
+
+   B->used = 24;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 24 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_17.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_17.i
new file mode 100644 (file)
index 0000000..153ce87
--- /dev/null
@@ -0,0 +1,207 @@
+/* fp_sqr_comba_17.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR17
+void fp_sqr_comba17(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[34], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADD2(a[12], a[16]); SQRADD2(a[13], a[15]); SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADD2(a[13], a[16]); SQRADD2(a[14], a[15]); 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADD2(a[14], a[16]); SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADD2(a[15], a[16]); 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+   COMBA_STORE2(b[33]);
+   COMBA_FINI;
+
+   B->used = 34;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 34 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_20.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_20.i
new file mode 100644 (file)
index 0000000..34d6593
--- /dev/null
@@ -0,0 +1,240 @@
+/* fp_sqr_comba_20.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR20
+void fp_sqr_comba20(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[40], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADD2(a[15], a[19]); SQRADD2(a[16], a[18]); SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADD2(a[16], a[19]); SQRADD2(a[17], a[18]); 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADD2(a[17], a[19]); SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADD2(a[18], a[19]); 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+   COMBA_STORE2(b[39]);
+   COMBA_FINI;
+
+   B->used = 40;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 40 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_24.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_24.i
new file mode 100644 (file)
index 0000000..35092de
--- /dev/null
@@ -0,0 +1,280 @@
+/* fp_sqr_comba_24.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR24
+void fp_sqr_comba24(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[48], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB; 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB; 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADDSC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+
+   /* output 39 */
+   CARRY_FORWARD;
+   SQRADDSC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB; 
+   COMBA_STORE(b[39]);
+
+   /* output 40 */
+   CARRY_FORWARD;
+   SQRADDSC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]); 
+   COMBA_STORE(b[40]);
+
+   /* output 41 */
+   CARRY_FORWARD;
+   SQRADDSC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB; 
+   COMBA_STORE(b[41]);
+
+   /* output 42 */
+   CARRY_FORWARD;
+   SQRADD2(a[19], a[23]); SQRADD2(a[20], a[22]); SQRADD(a[21], a[21]); 
+   COMBA_STORE(b[42]);
+
+   /* output 43 */
+   CARRY_FORWARD;
+   SQRADD2(a[20], a[23]); SQRADD2(a[21], a[22]); 
+   COMBA_STORE(b[43]);
+
+   /* output 44 */
+   CARRY_FORWARD;
+   SQRADD2(a[21], a[23]); SQRADD(a[22], a[22]); 
+   COMBA_STORE(b[44]);
+
+   /* output 45 */
+   CARRY_FORWARD;
+   SQRADD2(a[22], a[23]); 
+   COMBA_STORE(b[45]);
+
+   /* output 46 */
+   CARRY_FORWARD;
+   SQRADD(a[23], a[23]); 
+   COMBA_STORE(b[46]);
+   COMBA_STORE2(b[47]);
+   COMBA_FINI;
+
+   B->used = 48;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 48 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_28.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_28.i
new file mode 100644 (file)
index 0000000..7164f39
--- /dev/null
@@ -0,0 +1,320 @@
+/* fp_sqr_comba_28.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR28
+void fp_sqr_comba28(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[56], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB; 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB; 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+
+   /* output 39 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB; 
+   COMBA_STORE(b[39]);
+
+   /* output 40 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]); 
+   COMBA_STORE(b[40]);
+
+   /* output 41 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB; 
+   COMBA_STORE(b[41]);
+
+   /* output 42 */
+   CARRY_FORWARD;
+   SQRADDSC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]); 
+   COMBA_STORE(b[42]);
+
+   /* output 43 */
+   CARRY_FORWARD;
+   SQRADDSC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB; 
+   COMBA_STORE(b[43]);
+
+   /* output 44 */
+   CARRY_FORWARD;
+   SQRADDSC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]); 
+   COMBA_STORE(b[44]);
+
+   /* output 45 */
+   CARRY_FORWARD;
+   SQRADDSC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB; 
+   COMBA_STORE(b[45]);
+
+   /* output 46 */
+   CARRY_FORWARD;
+   SQRADDSC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]); 
+   COMBA_STORE(b[46]);
+
+   /* output 47 */
+   CARRY_FORWARD;
+   SQRADDSC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB; 
+   COMBA_STORE(b[47]);
+
+   /* output 48 */
+   CARRY_FORWARD;
+   SQRADDSC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]); 
+   COMBA_STORE(b[48]);
+
+   /* output 49 */
+   CARRY_FORWARD;
+   SQRADDSC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB; 
+   COMBA_STORE(b[49]);
+
+   /* output 50 */
+   CARRY_FORWARD;
+   SQRADD2(a[23], a[27]); SQRADD2(a[24], a[26]); SQRADD(a[25], a[25]); 
+   COMBA_STORE(b[50]);
+
+   /* output 51 */
+   CARRY_FORWARD;
+   SQRADD2(a[24], a[27]); SQRADD2(a[25], a[26]); 
+   COMBA_STORE(b[51]);
+
+   /* output 52 */
+   CARRY_FORWARD;
+   SQRADD2(a[25], a[27]); SQRADD(a[26], a[26]); 
+   COMBA_STORE(b[52]);
+
+   /* output 53 */
+   CARRY_FORWARD;
+   SQRADD2(a[26], a[27]); 
+   COMBA_STORE(b[53]);
+
+   /* output 54 */
+   CARRY_FORWARD;
+   SQRADD(a[27], a[27]); 
+   COMBA_STORE(b[54]);
+   COMBA_STORE2(b[55]);
+   COMBA_FINI;
+
+   B->used = 56;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 56 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_3.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_3.i
new file mode 100644 (file)
index 0000000..6ff9d15
--- /dev/null
@@ -0,0 +1,67 @@
+/* fp_sqr_comba_3.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR3
+void fp_sqr_comba3(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[6], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+   COMBA_STORE2(b[5]);
+   COMBA_FINI;
+
+   B->used = 6;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 6 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_32.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_32.i
new file mode 100644 (file)
index 0000000..ada0007
--- /dev/null
@@ -0,0 +1,360 @@
+/* fp_sqr_comba_32.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR32
+void fp_sqr_comba32(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[64], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[28]); SQRADDAC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[29]); SQRADDAC(a[1], a[28]); SQRADDAC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[30]); SQRADDAC(a[1], a[29]); SQRADDAC(a[2], a[28]); SQRADDAC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[31]); SQRADDAC(a[1], a[30]); SQRADDAC(a[2], a[29]); SQRADDAC(a[3], a[28]); SQRADDAC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[31]); SQRADDAC(a[2], a[30]); SQRADDAC(a[3], a[29]); SQRADDAC(a[4], a[28]); SQRADDAC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[31]); SQRADDAC(a[3], a[30]); SQRADDAC(a[4], a[29]); SQRADDAC(a[5], a[28]); SQRADDAC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[31]); SQRADDAC(a[4], a[30]); SQRADDAC(a[5], a[29]); SQRADDAC(a[6], a[28]); SQRADDAC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[31]); SQRADDAC(a[5], a[30]); SQRADDAC(a[6], a[29]); SQRADDAC(a[7], a[28]); SQRADDAC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB; 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[31]); SQRADDAC(a[6], a[30]); SQRADDAC(a[7], a[29]); SQRADDAC(a[8], a[28]); SQRADDAC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[31]); SQRADDAC(a[7], a[30]); SQRADDAC(a[8], a[29]); SQRADDAC(a[9], a[28]); SQRADDAC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB; 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[31]); SQRADDAC(a[8], a[30]); SQRADDAC(a[9], a[29]); SQRADDAC(a[10], a[28]); SQRADDAC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+
+   /* output 39 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[31]); SQRADDAC(a[9], a[30]); SQRADDAC(a[10], a[29]); SQRADDAC(a[11], a[28]); SQRADDAC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB; 
+   COMBA_STORE(b[39]);
+
+   /* output 40 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[31]); SQRADDAC(a[10], a[30]); SQRADDAC(a[11], a[29]); SQRADDAC(a[12], a[28]); SQRADDAC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]); 
+   COMBA_STORE(b[40]);
+
+   /* output 41 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[31]); SQRADDAC(a[11], a[30]); SQRADDAC(a[12], a[29]); SQRADDAC(a[13], a[28]); SQRADDAC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB; 
+   COMBA_STORE(b[41]);
+
+   /* output 42 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[31]); SQRADDAC(a[12], a[30]); SQRADDAC(a[13], a[29]); SQRADDAC(a[14], a[28]); SQRADDAC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]); 
+   COMBA_STORE(b[42]);
+
+   /* output 43 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[31]); SQRADDAC(a[13], a[30]); SQRADDAC(a[14], a[29]); SQRADDAC(a[15], a[28]); SQRADDAC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB; 
+   COMBA_STORE(b[43]);
+
+   /* output 44 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[31]); SQRADDAC(a[14], a[30]); SQRADDAC(a[15], a[29]); SQRADDAC(a[16], a[28]); SQRADDAC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]); 
+   COMBA_STORE(b[44]);
+
+   /* output 45 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[31]); SQRADDAC(a[15], a[30]); SQRADDAC(a[16], a[29]); SQRADDAC(a[17], a[28]); SQRADDAC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB; 
+   COMBA_STORE(b[45]);
+
+   /* output 46 */
+   CARRY_FORWARD;
+   SQRADDSC(a[15], a[31]); SQRADDAC(a[16], a[30]); SQRADDAC(a[17], a[29]); SQRADDAC(a[18], a[28]); SQRADDAC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]); 
+   COMBA_STORE(b[46]);
+
+   /* output 47 */
+   CARRY_FORWARD;
+   SQRADDSC(a[16], a[31]); SQRADDAC(a[17], a[30]); SQRADDAC(a[18], a[29]); SQRADDAC(a[19], a[28]); SQRADDAC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB; 
+   COMBA_STORE(b[47]);
+
+   /* output 48 */
+   CARRY_FORWARD;
+   SQRADDSC(a[17], a[31]); SQRADDAC(a[18], a[30]); SQRADDAC(a[19], a[29]); SQRADDAC(a[20], a[28]); SQRADDAC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]); 
+   COMBA_STORE(b[48]);
+
+   /* output 49 */
+   CARRY_FORWARD;
+   SQRADDSC(a[18], a[31]); SQRADDAC(a[19], a[30]); SQRADDAC(a[20], a[29]); SQRADDAC(a[21], a[28]); SQRADDAC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB; 
+   COMBA_STORE(b[49]);
+
+   /* output 50 */
+   CARRY_FORWARD;
+   SQRADDSC(a[19], a[31]); SQRADDAC(a[20], a[30]); SQRADDAC(a[21], a[29]); SQRADDAC(a[22], a[28]); SQRADDAC(a[23], a[27]); SQRADDAC(a[24], a[26]); SQRADDDB; SQRADD(a[25], a[25]); 
+   COMBA_STORE(b[50]);
+
+   /* output 51 */
+   CARRY_FORWARD;
+   SQRADDSC(a[20], a[31]); SQRADDAC(a[21], a[30]); SQRADDAC(a[22], a[29]); SQRADDAC(a[23], a[28]); SQRADDAC(a[24], a[27]); SQRADDAC(a[25], a[26]); SQRADDDB; 
+   COMBA_STORE(b[51]);
+
+   /* output 52 */
+   CARRY_FORWARD;
+   SQRADDSC(a[21], a[31]); SQRADDAC(a[22], a[30]); SQRADDAC(a[23], a[29]); SQRADDAC(a[24], a[28]); SQRADDAC(a[25], a[27]); SQRADDDB; SQRADD(a[26], a[26]); 
+   COMBA_STORE(b[52]);
+
+   /* output 53 */
+   CARRY_FORWARD;
+   SQRADDSC(a[22], a[31]); SQRADDAC(a[23], a[30]); SQRADDAC(a[24], a[29]); SQRADDAC(a[25], a[28]); SQRADDAC(a[26], a[27]); SQRADDDB; 
+   COMBA_STORE(b[53]);
+
+   /* output 54 */
+   CARRY_FORWARD;
+   SQRADDSC(a[23], a[31]); SQRADDAC(a[24], a[30]); SQRADDAC(a[25], a[29]); SQRADDAC(a[26], a[28]); SQRADDDB; SQRADD(a[27], a[27]); 
+   COMBA_STORE(b[54]);
+
+   /* output 55 */
+   CARRY_FORWARD;
+   SQRADDSC(a[24], a[31]); SQRADDAC(a[25], a[30]); SQRADDAC(a[26], a[29]); SQRADDAC(a[27], a[28]); SQRADDDB; 
+   COMBA_STORE(b[55]);
+
+   /* output 56 */
+   CARRY_FORWARD;
+   SQRADDSC(a[25], a[31]); SQRADDAC(a[26], a[30]); SQRADDAC(a[27], a[29]); SQRADDDB; SQRADD(a[28], a[28]); 
+   COMBA_STORE(b[56]);
+
+   /* output 57 */
+   CARRY_FORWARD;
+   SQRADDSC(a[26], a[31]); SQRADDAC(a[27], a[30]); SQRADDAC(a[28], a[29]); SQRADDDB; 
+   COMBA_STORE(b[57]);
+
+   /* output 58 */
+   CARRY_FORWARD;
+   SQRADD2(a[27], a[31]); SQRADD2(a[28], a[30]); SQRADD(a[29], a[29]); 
+   COMBA_STORE(b[58]);
+
+   /* output 59 */
+   CARRY_FORWARD;
+   SQRADD2(a[28], a[31]); SQRADD2(a[29], a[30]); 
+   COMBA_STORE(b[59]);
+
+   /* output 60 */
+   CARRY_FORWARD;
+   SQRADD2(a[29], a[31]); SQRADD(a[30], a[30]); 
+   COMBA_STORE(b[60]);
+
+   /* output 61 */
+   CARRY_FORWARD;
+   SQRADD2(a[30], a[31]); 
+   COMBA_STORE(b[61]);
+
+   /* output 62 */
+   CARRY_FORWARD;
+   SQRADD(a[31], a[31]); 
+   COMBA_STORE(b[62]);
+   COMBA_STORE2(b[63]);
+   COMBA_FINI;
+
+   B->used = 64;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 64 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_4.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_4.i
new file mode 100644 (file)
index 0000000..cd19f76
--- /dev/null
@@ -0,0 +1,77 @@
+/* fp_sqr_comba_4.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR4
+void fp_sqr_comba4(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[8], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADD2(a[2], a[3]); 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+   COMBA_STORE2(b[7]);
+   COMBA_FINI;
+
+   B->used = 8;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 8 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_48.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_48.i
new file mode 100644 (file)
index 0000000..27dddfe
--- /dev/null
@@ -0,0 +1,520 @@
+/* fp_sqr_comba_48.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR48
+void fp_sqr_comba48(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[96], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[28]); SQRADDAC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[29]); SQRADDAC(a[1], a[28]); SQRADDAC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[30]); SQRADDAC(a[1], a[29]); SQRADDAC(a[2], a[28]); SQRADDAC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[31]); SQRADDAC(a[1], a[30]); SQRADDAC(a[2], a[29]); SQRADDAC(a[3], a[28]); SQRADDAC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[32]); SQRADDAC(a[1], a[31]); SQRADDAC(a[2], a[30]); SQRADDAC(a[3], a[29]); SQRADDAC(a[4], a[28]); SQRADDAC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[33]); SQRADDAC(a[1], a[32]); SQRADDAC(a[2], a[31]); SQRADDAC(a[3], a[30]); SQRADDAC(a[4], a[29]); SQRADDAC(a[5], a[28]); SQRADDAC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[34]); SQRADDAC(a[1], a[33]); SQRADDAC(a[2], a[32]); SQRADDAC(a[3], a[31]); SQRADDAC(a[4], a[30]); SQRADDAC(a[5], a[29]); SQRADDAC(a[6], a[28]); SQRADDAC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[35]); SQRADDAC(a[1], a[34]); SQRADDAC(a[2], a[33]); SQRADDAC(a[3], a[32]); SQRADDAC(a[4], a[31]); SQRADDAC(a[5], a[30]); SQRADDAC(a[6], a[29]); SQRADDAC(a[7], a[28]); SQRADDAC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB; 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[36]); SQRADDAC(a[1], a[35]); SQRADDAC(a[2], a[34]); SQRADDAC(a[3], a[33]); SQRADDAC(a[4], a[32]); SQRADDAC(a[5], a[31]); SQRADDAC(a[6], a[30]); SQRADDAC(a[7], a[29]); SQRADDAC(a[8], a[28]); SQRADDAC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[37]); SQRADDAC(a[1], a[36]); SQRADDAC(a[2], a[35]); SQRADDAC(a[3], a[34]); SQRADDAC(a[4], a[33]); SQRADDAC(a[5], a[32]); SQRADDAC(a[6], a[31]); SQRADDAC(a[7], a[30]); SQRADDAC(a[8], a[29]); SQRADDAC(a[9], a[28]); SQRADDAC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB; 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[38]); SQRADDAC(a[1], a[37]); SQRADDAC(a[2], a[36]); SQRADDAC(a[3], a[35]); SQRADDAC(a[4], a[34]); SQRADDAC(a[5], a[33]); SQRADDAC(a[6], a[32]); SQRADDAC(a[7], a[31]); SQRADDAC(a[8], a[30]); SQRADDAC(a[9], a[29]); SQRADDAC(a[10], a[28]); SQRADDAC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+
+   /* output 39 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[39]); SQRADDAC(a[1], a[38]); SQRADDAC(a[2], a[37]); SQRADDAC(a[3], a[36]); SQRADDAC(a[4], a[35]); SQRADDAC(a[5], a[34]); SQRADDAC(a[6], a[33]); SQRADDAC(a[7], a[32]); SQRADDAC(a[8], a[31]); SQRADDAC(a[9], a[30]); SQRADDAC(a[10], a[29]); SQRADDAC(a[11], a[28]); SQRADDAC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB; 
+   COMBA_STORE(b[39]);
+
+   /* output 40 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[40]); SQRADDAC(a[1], a[39]); SQRADDAC(a[2], a[38]); SQRADDAC(a[3], a[37]); SQRADDAC(a[4], a[36]); SQRADDAC(a[5], a[35]); SQRADDAC(a[6], a[34]); SQRADDAC(a[7], a[33]); SQRADDAC(a[8], a[32]); SQRADDAC(a[9], a[31]); SQRADDAC(a[10], a[30]); SQRADDAC(a[11], a[29]); SQRADDAC(a[12], a[28]); SQRADDAC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]); 
+   COMBA_STORE(b[40]);
+
+   /* output 41 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[41]); SQRADDAC(a[1], a[40]); SQRADDAC(a[2], a[39]); SQRADDAC(a[3], a[38]); SQRADDAC(a[4], a[37]); SQRADDAC(a[5], a[36]); SQRADDAC(a[6], a[35]); SQRADDAC(a[7], a[34]); SQRADDAC(a[8], a[33]); SQRADDAC(a[9], a[32]); SQRADDAC(a[10], a[31]); SQRADDAC(a[11], a[30]); SQRADDAC(a[12], a[29]); SQRADDAC(a[13], a[28]); SQRADDAC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB; 
+   COMBA_STORE(b[41]);
+
+   /* output 42 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[42]); SQRADDAC(a[1], a[41]); SQRADDAC(a[2], a[40]); SQRADDAC(a[3], a[39]); SQRADDAC(a[4], a[38]); SQRADDAC(a[5], a[37]); SQRADDAC(a[6], a[36]); SQRADDAC(a[7], a[35]); SQRADDAC(a[8], a[34]); SQRADDAC(a[9], a[33]); SQRADDAC(a[10], a[32]); SQRADDAC(a[11], a[31]); SQRADDAC(a[12], a[30]); SQRADDAC(a[13], a[29]); SQRADDAC(a[14], a[28]); SQRADDAC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]); 
+   COMBA_STORE(b[42]);
+
+   /* output 43 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[43]); SQRADDAC(a[1], a[42]); SQRADDAC(a[2], a[41]); SQRADDAC(a[3], a[40]); SQRADDAC(a[4], a[39]); SQRADDAC(a[5], a[38]); SQRADDAC(a[6], a[37]); SQRADDAC(a[7], a[36]); SQRADDAC(a[8], a[35]); SQRADDAC(a[9], a[34]); SQRADDAC(a[10], a[33]); SQRADDAC(a[11], a[32]); SQRADDAC(a[12], a[31]); SQRADDAC(a[13], a[30]); SQRADDAC(a[14], a[29]); SQRADDAC(a[15], a[28]); SQRADDAC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB; 
+   COMBA_STORE(b[43]);
+
+   /* output 44 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[44]); SQRADDAC(a[1], a[43]); SQRADDAC(a[2], a[42]); SQRADDAC(a[3], a[41]); SQRADDAC(a[4], a[40]); SQRADDAC(a[5], a[39]); SQRADDAC(a[6], a[38]); SQRADDAC(a[7], a[37]); SQRADDAC(a[8], a[36]); SQRADDAC(a[9], a[35]); SQRADDAC(a[10], a[34]); SQRADDAC(a[11], a[33]); SQRADDAC(a[12], a[32]); SQRADDAC(a[13], a[31]); SQRADDAC(a[14], a[30]); SQRADDAC(a[15], a[29]); SQRADDAC(a[16], a[28]); SQRADDAC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]); 
+   COMBA_STORE(b[44]);
+
+   /* output 45 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[45]); SQRADDAC(a[1], a[44]); SQRADDAC(a[2], a[43]); SQRADDAC(a[3], a[42]); SQRADDAC(a[4], a[41]); SQRADDAC(a[5], a[40]); SQRADDAC(a[6], a[39]); SQRADDAC(a[7], a[38]); SQRADDAC(a[8], a[37]); SQRADDAC(a[9], a[36]); SQRADDAC(a[10], a[35]); SQRADDAC(a[11], a[34]); SQRADDAC(a[12], a[33]); SQRADDAC(a[13], a[32]); SQRADDAC(a[14], a[31]); SQRADDAC(a[15], a[30]); SQRADDAC(a[16], a[29]); SQRADDAC(a[17], a[28]); SQRADDAC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB; 
+   COMBA_STORE(b[45]);
+
+   /* output 46 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[46]); SQRADDAC(a[1], a[45]); SQRADDAC(a[2], a[44]); SQRADDAC(a[3], a[43]); SQRADDAC(a[4], a[42]); SQRADDAC(a[5], a[41]); SQRADDAC(a[6], a[40]); SQRADDAC(a[7], a[39]); SQRADDAC(a[8], a[38]); SQRADDAC(a[9], a[37]); SQRADDAC(a[10], a[36]); SQRADDAC(a[11], a[35]); SQRADDAC(a[12], a[34]); SQRADDAC(a[13], a[33]); SQRADDAC(a[14], a[32]); SQRADDAC(a[15], a[31]); SQRADDAC(a[16], a[30]); SQRADDAC(a[17], a[29]); SQRADDAC(a[18], a[28]); SQRADDAC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]); 
+   COMBA_STORE(b[46]);
+
+   /* output 47 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[47]); SQRADDAC(a[1], a[46]); SQRADDAC(a[2], a[45]); SQRADDAC(a[3], a[44]); SQRADDAC(a[4], a[43]); SQRADDAC(a[5], a[42]); SQRADDAC(a[6], a[41]); SQRADDAC(a[7], a[40]); SQRADDAC(a[8], a[39]); SQRADDAC(a[9], a[38]); SQRADDAC(a[10], a[37]); SQRADDAC(a[11], a[36]); SQRADDAC(a[12], a[35]); SQRADDAC(a[13], a[34]); SQRADDAC(a[14], a[33]); SQRADDAC(a[15], a[32]); SQRADDAC(a[16], a[31]); SQRADDAC(a[17], a[30]); SQRADDAC(a[18], a[29]); SQRADDAC(a[19], a[28]); SQRADDAC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB; 
+   COMBA_STORE(b[47]);
+
+   /* output 48 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[47]); SQRADDAC(a[2], a[46]); SQRADDAC(a[3], a[45]); SQRADDAC(a[4], a[44]); SQRADDAC(a[5], a[43]); SQRADDAC(a[6], a[42]); SQRADDAC(a[7], a[41]); SQRADDAC(a[8], a[40]); SQRADDAC(a[9], a[39]); SQRADDAC(a[10], a[38]); SQRADDAC(a[11], a[37]); SQRADDAC(a[12], a[36]); SQRADDAC(a[13], a[35]); SQRADDAC(a[14], a[34]); SQRADDAC(a[15], a[33]); SQRADDAC(a[16], a[32]); SQRADDAC(a[17], a[31]); SQRADDAC(a[18], a[30]); SQRADDAC(a[19], a[29]); SQRADDAC(a[20], a[28]); SQRADDAC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]); 
+   COMBA_STORE(b[48]);
+
+   /* output 49 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[47]); SQRADDAC(a[3], a[46]); SQRADDAC(a[4], a[45]); SQRADDAC(a[5], a[44]); SQRADDAC(a[6], a[43]); SQRADDAC(a[7], a[42]); SQRADDAC(a[8], a[41]); SQRADDAC(a[9], a[40]); SQRADDAC(a[10], a[39]); SQRADDAC(a[11], a[38]); SQRADDAC(a[12], a[37]); SQRADDAC(a[13], a[36]); SQRADDAC(a[14], a[35]); SQRADDAC(a[15], a[34]); SQRADDAC(a[16], a[33]); SQRADDAC(a[17], a[32]); SQRADDAC(a[18], a[31]); SQRADDAC(a[19], a[30]); SQRADDAC(a[20], a[29]); SQRADDAC(a[21], a[28]); SQRADDAC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB; 
+   COMBA_STORE(b[49]);
+
+   /* output 50 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[47]); SQRADDAC(a[4], a[46]); SQRADDAC(a[5], a[45]); SQRADDAC(a[6], a[44]); SQRADDAC(a[7], a[43]); SQRADDAC(a[8], a[42]); SQRADDAC(a[9], a[41]); SQRADDAC(a[10], a[40]); SQRADDAC(a[11], a[39]); SQRADDAC(a[12], a[38]); SQRADDAC(a[13], a[37]); SQRADDAC(a[14], a[36]); SQRADDAC(a[15], a[35]); SQRADDAC(a[16], a[34]); SQRADDAC(a[17], a[33]); SQRADDAC(a[18], a[32]); SQRADDAC(a[19], a[31]); SQRADDAC(a[20], a[30]); SQRADDAC(a[21], a[29]); SQRADDAC(a[22], a[28]); SQRADDAC(a[23], a[27]); SQRADDAC(a[24], a[26]); SQRADDDB; SQRADD(a[25], a[25]); 
+   COMBA_STORE(b[50]);
+
+   /* output 51 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[47]); SQRADDAC(a[5], a[46]); SQRADDAC(a[6], a[45]); SQRADDAC(a[7], a[44]); SQRADDAC(a[8], a[43]); SQRADDAC(a[9], a[42]); SQRADDAC(a[10], a[41]); SQRADDAC(a[11], a[40]); SQRADDAC(a[12], a[39]); SQRADDAC(a[13], a[38]); SQRADDAC(a[14], a[37]); SQRADDAC(a[15], a[36]); SQRADDAC(a[16], a[35]); SQRADDAC(a[17], a[34]); SQRADDAC(a[18], a[33]); SQRADDAC(a[19], a[32]); SQRADDAC(a[20], a[31]); SQRADDAC(a[21], a[30]); SQRADDAC(a[22], a[29]); SQRADDAC(a[23], a[28]); SQRADDAC(a[24], a[27]); SQRADDAC(a[25], a[26]); SQRADDDB; 
+   COMBA_STORE(b[51]);
+
+   /* output 52 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[47]); SQRADDAC(a[6], a[46]); SQRADDAC(a[7], a[45]); SQRADDAC(a[8], a[44]); SQRADDAC(a[9], a[43]); SQRADDAC(a[10], a[42]); SQRADDAC(a[11], a[41]); SQRADDAC(a[12], a[40]); SQRADDAC(a[13], a[39]); SQRADDAC(a[14], a[38]); SQRADDAC(a[15], a[37]); SQRADDAC(a[16], a[36]); SQRADDAC(a[17], a[35]); SQRADDAC(a[18], a[34]); SQRADDAC(a[19], a[33]); SQRADDAC(a[20], a[32]); SQRADDAC(a[21], a[31]); SQRADDAC(a[22], a[30]); SQRADDAC(a[23], a[29]); SQRADDAC(a[24], a[28]); SQRADDAC(a[25], a[27]); SQRADDDB; SQRADD(a[26], a[26]); 
+   COMBA_STORE(b[52]);
+
+   /* output 53 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[47]); SQRADDAC(a[7], a[46]); SQRADDAC(a[8], a[45]); SQRADDAC(a[9], a[44]); SQRADDAC(a[10], a[43]); SQRADDAC(a[11], a[42]); SQRADDAC(a[12], a[41]); SQRADDAC(a[13], a[40]); SQRADDAC(a[14], a[39]); SQRADDAC(a[15], a[38]); SQRADDAC(a[16], a[37]); SQRADDAC(a[17], a[36]); SQRADDAC(a[18], a[35]); SQRADDAC(a[19], a[34]); SQRADDAC(a[20], a[33]); SQRADDAC(a[21], a[32]); SQRADDAC(a[22], a[31]); SQRADDAC(a[23], a[30]); SQRADDAC(a[24], a[29]); SQRADDAC(a[25], a[28]); SQRADDAC(a[26], a[27]); SQRADDDB; 
+   COMBA_STORE(b[53]);
+
+   /* output 54 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[47]); SQRADDAC(a[8], a[46]); SQRADDAC(a[9], a[45]); SQRADDAC(a[10], a[44]); SQRADDAC(a[11], a[43]); SQRADDAC(a[12], a[42]); SQRADDAC(a[13], a[41]); SQRADDAC(a[14], a[40]); SQRADDAC(a[15], a[39]); SQRADDAC(a[16], a[38]); SQRADDAC(a[17], a[37]); SQRADDAC(a[18], a[36]); SQRADDAC(a[19], a[35]); SQRADDAC(a[20], a[34]); SQRADDAC(a[21], a[33]); SQRADDAC(a[22], a[32]); SQRADDAC(a[23], a[31]); SQRADDAC(a[24], a[30]); SQRADDAC(a[25], a[29]); SQRADDAC(a[26], a[28]); SQRADDDB; SQRADD(a[27], a[27]); 
+   COMBA_STORE(b[54]);
+
+   /* output 55 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[47]); SQRADDAC(a[9], a[46]); SQRADDAC(a[10], a[45]); SQRADDAC(a[11], a[44]); SQRADDAC(a[12], a[43]); SQRADDAC(a[13], a[42]); SQRADDAC(a[14], a[41]); SQRADDAC(a[15], a[40]); SQRADDAC(a[16], a[39]); SQRADDAC(a[17], a[38]); SQRADDAC(a[18], a[37]); SQRADDAC(a[19], a[36]); SQRADDAC(a[20], a[35]); SQRADDAC(a[21], a[34]); SQRADDAC(a[22], a[33]); SQRADDAC(a[23], a[32]); SQRADDAC(a[24], a[31]); SQRADDAC(a[25], a[30]); SQRADDAC(a[26], a[29]); SQRADDAC(a[27], a[28]); SQRADDDB; 
+   COMBA_STORE(b[55]);
+
+   /* output 56 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[47]); SQRADDAC(a[10], a[46]); SQRADDAC(a[11], a[45]); SQRADDAC(a[12], a[44]); SQRADDAC(a[13], a[43]); SQRADDAC(a[14], a[42]); SQRADDAC(a[15], a[41]); SQRADDAC(a[16], a[40]); SQRADDAC(a[17], a[39]); SQRADDAC(a[18], a[38]); SQRADDAC(a[19], a[37]); SQRADDAC(a[20], a[36]); SQRADDAC(a[21], a[35]); SQRADDAC(a[22], a[34]); SQRADDAC(a[23], a[33]); SQRADDAC(a[24], a[32]); SQRADDAC(a[25], a[31]); SQRADDAC(a[26], a[30]); SQRADDAC(a[27], a[29]); SQRADDDB; SQRADD(a[28], a[28]); 
+   COMBA_STORE(b[56]);
+
+   /* output 57 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[47]); SQRADDAC(a[11], a[46]); SQRADDAC(a[12], a[45]); SQRADDAC(a[13], a[44]); SQRADDAC(a[14], a[43]); SQRADDAC(a[15], a[42]); SQRADDAC(a[16], a[41]); SQRADDAC(a[17], a[40]); SQRADDAC(a[18], a[39]); SQRADDAC(a[19], a[38]); SQRADDAC(a[20], a[37]); SQRADDAC(a[21], a[36]); SQRADDAC(a[22], a[35]); SQRADDAC(a[23], a[34]); SQRADDAC(a[24], a[33]); SQRADDAC(a[25], a[32]); SQRADDAC(a[26], a[31]); SQRADDAC(a[27], a[30]); SQRADDAC(a[28], a[29]); SQRADDDB; 
+   COMBA_STORE(b[57]);
+
+   /* output 58 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[47]); SQRADDAC(a[12], a[46]); SQRADDAC(a[13], a[45]); SQRADDAC(a[14], a[44]); SQRADDAC(a[15], a[43]); SQRADDAC(a[16], a[42]); SQRADDAC(a[17], a[41]); SQRADDAC(a[18], a[40]); SQRADDAC(a[19], a[39]); SQRADDAC(a[20], a[38]); SQRADDAC(a[21], a[37]); SQRADDAC(a[22], a[36]); SQRADDAC(a[23], a[35]); SQRADDAC(a[24], a[34]); SQRADDAC(a[25], a[33]); SQRADDAC(a[26], a[32]); SQRADDAC(a[27], a[31]); SQRADDAC(a[28], a[30]); SQRADDDB; SQRADD(a[29], a[29]); 
+   COMBA_STORE(b[58]);
+
+   /* output 59 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[47]); SQRADDAC(a[13], a[46]); SQRADDAC(a[14], a[45]); SQRADDAC(a[15], a[44]); SQRADDAC(a[16], a[43]); SQRADDAC(a[17], a[42]); SQRADDAC(a[18], a[41]); SQRADDAC(a[19], a[40]); SQRADDAC(a[20], a[39]); SQRADDAC(a[21], a[38]); SQRADDAC(a[22], a[37]); SQRADDAC(a[23], a[36]); SQRADDAC(a[24], a[35]); SQRADDAC(a[25], a[34]); SQRADDAC(a[26], a[33]); SQRADDAC(a[27], a[32]); SQRADDAC(a[28], a[31]); SQRADDAC(a[29], a[30]); SQRADDDB; 
+   COMBA_STORE(b[59]);
+
+   /* output 60 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[47]); SQRADDAC(a[14], a[46]); SQRADDAC(a[15], a[45]); SQRADDAC(a[16], a[44]); SQRADDAC(a[17], a[43]); SQRADDAC(a[18], a[42]); SQRADDAC(a[19], a[41]); SQRADDAC(a[20], a[40]); SQRADDAC(a[21], a[39]); SQRADDAC(a[22], a[38]); SQRADDAC(a[23], a[37]); SQRADDAC(a[24], a[36]); SQRADDAC(a[25], a[35]); SQRADDAC(a[26], a[34]); SQRADDAC(a[27], a[33]); SQRADDAC(a[28], a[32]); SQRADDAC(a[29], a[31]); SQRADDDB; SQRADD(a[30], a[30]); 
+   COMBA_STORE(b[60]);
+
+   /* output 61 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[47]); SQRADDAC(a[15], a[46]); SQRADDAC(a[16], a[45]); SQRADDAC(a[17], a[44]); SQRADDAC(a[18], a[43]); SQRADDAC(a[19], a[42]); SQRADDAC(a[20], a[41]); SQRADDAC(a[21], a[40]); SQRADDAC(a[22], a[39]); SQRADDAC(a[23], a[38]); SQRADDAC(a[24], a[37]); SQRADDAC(a[25], a[36]); SQRADDAC(a[26], a[35]); SQRADDAC(a[27], a[34]); SQRADDAC(a[28], a[33]); SQRADDAC(a[29], a[32]); SQRADDAC(a[30], a[31]); SQRADDDB; 
+   COMBA_STORE(b[61]);
+
+   /* output 62 */
+   CARRY_FORWARD;
+   SQRADDSC(a[15], a[47]); SQRADDAC(a[16], a[46]); SQRADDAC(a[17], a[45]); SQRADDAC(a[18], a[44]); SQRADDAC(a[19], a[43]); SQRADDAC(a[20], a[42]); SQRADDAC(a[21], a[41]); SQRADDAC(a[22], a[40]); SQRADDAC(a[23], a[39]); SQRADDAC(a[24], a[38]); SQRADDAC(a[25], a[37]); SQRADDAC(a[26], a[36]); SQRADDAC(a[27], a[35]); SQRADDAC(a[28], a[34]); SQRADDAC(a[29], a[33]); SQRADDAC(a[30], a[32]); SQRADDDB; SQRADD(a[31], a[31]); 
+   COMBA_STORE(b[62]);
+
+   /* output 63 */
+   CARRY_FORWARD;
+   SQRADDSC(a[16], a[47]); SQRADDAC(a[17], a[46]); SQRADDAC(a[18], a[45]); SQRADDAC(a[19], a[44]); SQRADDAC(a[20], a[43]); SQRADDAC(a[21], a[42]); SQRADDAC(a[22], a[41]); SQRADDAC(a[23], a[40]); SQRADDAC(a[24], a[39]); SQRADDAC(a[25], a[38]); SQRADDAC(a[26], a[37]); SQRADDAC(a[27], a[36]); SQRADDAC(a[28], a[35]); SQRADDAC(a[29], a[34]); SQRADDAC(a[30], a[33]); SQRADDAC(a[31], a[32]); SQRADDDB; 
+   COMBA_STORE(b[63]);
+
+   /* output 64 */
+   CARRY_FORWARD;
+   SQRADDSC(a[17], a[47]); SQRADDAC(a[18], a[46]); SQRADDAC(a[19], a[45]); SQRADDAC(a[20], a[44]); SQRADDAC(a[21], a[43]); SQRADDAC(a[22], a[42]); SQRADDAC(a[23], a[41]); SQRADDAC(a[24], a[40]); SQRADDAC(a[25], a[39]); SQRADDAC(a[26], a[38]); SQRADDAC(a[27], a[37]); SQRADDAC(a[28], a[36]); SQRADDAC(a[29], a[35]); SQRADDAC(a[30], a[34]); SQRADDAC(a[31], a[33]); SQRADDDB; SQRADD(a[32], a[32]); 
+   COMBA_STORE(b[64]);
+
+   /* output 65 */
+   CARRY_FORWARD;
+   SQRADDSC(a[18], a[47]); SQRADDAC(a[19], a[46]); SQRADDAC(a[20], a[45]); SQRADDAC(a[21], a[44]); SQRADDAC(a[22], a[43]); SQRADDAC(a[23], a[42]); SQRADDAC(a[24], a[41]); SQRADDAC(a[25], a[40]); SQRADDAC(a[26], a[39]); SQRADDAC(a[27], a[38]); SQRADDAC(a[28], a[37]); SQRADDAC(a[29], a[36]); SQRADDAC(a[30], a[35]); SQRADDAC(a[31], a[34]); SQRADDAC(a[32], a[33]); SQRADDDB; 
+   COMBA_STORE(b[65]);
+
+   /* output 66 */
+   CARRY_FORWARD;
+   SQRADDSC(a[19], a[47]); SQRADDAC(a[20], a[46]); SQRADDAC(a[21], a[45]); SQRADDAC(a[22], a[44]); SQRADDAC(a[23], a[43]); SQRADDAC(a[24], a[42]); SQRADDAC(a[25], a[41]); SQRADDAC(a[26], a[40]); SQRADDAC(a[27], a[39]); SQRADDAC(a[28], a[38]); SQRADDAC(a[29], a[37]); SQRADDAC(a[30], a[36]); SQRADDAC(a[31], a[35]); SQRADDAC(a[32], a[34]); SQRADDDB; SQRADD(a[33], a[33]); 
+   COMBA_STORE(b[66]);
+
+   /* output 67 */
+   CARRY_FORWARD;
+   SQRADDSC(a[20], a[47]); SQRADDAC(a[21], a[46]); SQRADDAC(a[22], a[45]); SQRADDAC(a[23], a[44]); SQRADDAC(a[24], a[43]); SQRADDAC(a[25], a[42]); SQRADDAC(a[26], a[41]); SQRADDAC(a[27], a[40]); SQRADDAC(a[28], a[39]); SQRADDAC(a[29], a[38]); SQRADDAC(a[30], a[37]); SQRADDAC(a[31], a[36]); SQRADDAC(a[32], a[35]); SQRADDAC(a[33], a[34]); SQRADDDB; 
+   COMBA_STORE(b[67]);
+
+   /* output 68 */
+   CARRY_FORWARD;
+   SQRADDSC(a[21], a[47]); SQRADDAC(a[22], a[46]); SQRADDAC(a[23], a[45]); SQRADDAC(a[24], a[44]); SQRADDAC(a[25], a[43]); SQRADDAC(a[26], a[42]); SQRADDAC(a[27], a[41]); SQRADDAC(a[28], a[40]); SQRADDAC(a[29], a[39]); SQRADDAC(a[30], a[38]); SQRADDAC(a[31], a[37]); SQRADDAC(a[32], a[36]); SQRADDAC(a[33], a[35]); SQRADDDB; SQRADD(a[34], a[34]); 
+   COMBA_STORE(b[68]);
+
+   /* output 69 */
+   CARRY_FORWARD;
+   SQRADDSC(a[22], a[47]); SQRADDAC(a[23], a[46]); SQRADDAC(a[24], a[45]); SQRADDAC(a[25], a[44]); SQRADDAC(a[26], a[43]); SQRADDAC(a[27], a[42]); SQRADDAC(a[28], a[41]); SQRADDAC(a[29], a[40]); SQRADDAC(a[30], a[39]); SQRADDAC(a[31], a[38]); SQRADDAC(a[32], a[37]); SQRADDAC(a[33], a[36]); SQRADDAC(a[34], a[35]); SQRADDDB; 
+   COMBA_STORE(b[69]);
+
+   /* output 70 */
+   CARRY_FORWARD;
+   SQRADDSC(a[23], a[47]); SQRADDAC(a[24], a[46]); SQRADDAC(a[25], a[45]); SQRADDAC(a[26], a[44]); SQRADDAC(a[27], a[43]); SQRADDAC(a[28], a[42]); SQRADDAC(a[29], a[41]); SQRADDAC(a[30], a[40]); SQRADDAC(a[31], a[39]); SQRADDAC(a[32], a[38]); SQRADDAC(a[33], a[37]); SQRADDAC(a[34], a[36]); SQRADDDB; SQRADD(a[35], a[35]); 
+   COMBA_STORE(b[70]);
+
+   /* output 71 */
+   CARRY_FORWARD;
+   SQRADDSC(a[24], a[47]); SQRADDAC(a[25], a[46]); SQRADDAC(a[26], a[45]); SQRADDAC(a[27], a[44]); SQRADDAC(a[28], a[43]); SQRADDAC(a[29], a[42]); SQRADDAC(a[30], a[41]); SQRADDAC(a[31], a[40]); SQRADDAC(a[32], a[39]); SQRADDAC(a[33], a[38]); SQRADDAC(a[34], a[37]); SQRADDAC(a[35], a[36]); SQRADDDB; 
+   COMBA_STORE(b[71]);
+
+   /* output 72 */
+   CARRY_FORWARD;
+   SQRADDSC(a[25], a[47]); SQRADDAC(a[26], a[46]); SQRADDAC(a[27], a[45]); SQRADDAC(a[28], a[44]); SQRADDAC(a[29], a[43]); SQRADDAC(a[30], a[42]); SQRADDAC(a[31], a[41]); SQRADDAC(a[32], a[40]); SQRADDAC(a[33], a[39]); SQRADDAC(a[34], a[38]); SQRADDAC(a[35], a[37]); SQRADDDB; SQRADD(a[36], a[36]); 
+   COMBA_STORE(b[72]);
+
+   /* output 73 */
+   CARRY_FORWARD;
+   SQRADDSC(a[26], a[47]); SQRADDAC(a[27], a[46]); SQRADDAC(a[28], a[45]); SQRADDAC(a[29], a[44]); SQRADDAC(a[30], a[43]); SQRADDAC(a[31], a[42]); SQRADDAC(a[32], a[41]); SQRADDAC(a[33], a[40]); SQRADDAC(a[34], a[39]); SQRADDAC(a[35], a[38]); SQRADDAC(a[36], a[37]); SQRADDDB; 
+   COMBA_STORE(b[73]);
+
+   /* output 74 */
+   CARRY_FORWARD;
+   SQRADDSC(a[27], a[47]); SQRADDAC(a[28], a[46]); SQRADDAC(a[29], a[45]); SQRADDAC(a[30], a[44]); SQRADDAC(a[31], a[43]); SQRADDAC(a[32], a[42]); SQRADDAC(a[33], a[41]); SQRADDAC(a[34], a[40]); SQRADDAC(a[35], a[39]); SQRADDAC(a[36], a[38]); SQRADDDB; SQRADD(a[37], a[37]); 
+   COMBA_STORE(b[74]);
+
+   /* output 75 */
+   CARRY_FORWARD;
+   SQRADDSC(a[28], a[47]); SQRADDAC(a[29], a[46]); SQRADDAC(a[30], a[45]); SQRADDAC(a[31], a[44]); SQRADDAC(a[32], a[43]); SQRADDAC(a[33], a[42]); SQRADDAC(a[34], a[41]); SQRADDAC(a[35], a[40]); SQRADDAC(a[36], a[39]); SQRADDAC(a[37], a[38]); SQRADDDB; 
+   COMBA_STORE(b[75]);
+
+   /* output 76 */
+   CARRY_FORWARD;
+   SQRADDSC(a[29], a[47]); SQRADDAC(a[30], a[46]); SQRADDAC(a[31], a[45]); SQRADDAC(a[32], a[44]); SQRADDAC(a[33], a[43]); SQRADDAC(a[34], a[42]); SQRADDAC(a[35], a[41]); SQRADDAC(a[36], a[40]); SQRADDAC(a[37], a[39]); SQRADDDB; SQRADD(a[38], a[38]); 
+   COMBA_STORE(b[76]);
+
+   /* output 77 */
+   CARRY_FORWARD;
+   SQRADDSC(a[30], a[47]); SQRADDAC(a[31], a[46]); SQRADDAC(a[32], a[45]); SQRADDAC(a[33], a[44]); SQRADDAC(a[34], a[43]); SQRADDAC(a[35], a[42]); SQRADDAC(a[36], a[41]); SQRADDAC(a[37], a[40]); SQRADDAC(a[38], a[39]); SQRADDDB; 
+   COMBA_STORE(b[77]);
+
+   /* output 78 */
+   CARRY_FORWARD;
+   SQRADDSC(a[31], a[47]); SQRADDAC(a[32], a[46]); SQRADDAC(a[33], a[45]); SQRADDAC(a[34], a[44]); SQRADDAC(a[35], a[43]); SQRADDAC(a[36], a[42]); SQRADDAC(a[37], a[41]); SQRADDAC(a[38], a[40]); SQRADDDB; SQRADD(a[39], a[39]); 
+   COMBA_STORE(b[78]);
+
+   /* output 79 */
+   CARRY_FORWARD;
+   SQRADDSC(a[32], a[47]); SQRADDAC(a[33], a[46]); SQRADDAC(a[34], a[45]); SQRADDAC(a[35], a[44]); SQRADDAC(a[36], a[43]); SQRADDAC(a[37], a[42]); SQRADDAC(a[38], a[41]); SQRADDAC(a[39], a[40]); SQRADDDB; 
+   COMBA_STORE(b[79]);
+
+   /* output 80 */
+   CARRY_FORWARD;
+   SQRADDSC(a[33], a[47]); SQRADDAC(a[34], a[46]); SQRADDAC(a[35], a[45]); SQRADDAC(a[36], a[44]); SQRADDAC(a[37], a[43]); SQRADDAC(a[38], a[42]); SQRADDAC(a[39], a[41]); SQRADDDB; SQRADD(a[40], a[40]); 
+   COMBA_STORE(b[80]);
+
+   /* output 81 */
+   CARRY_FORWARD;
+   SQRADDSC(a[34], a[47]); SQRADDAC(a[35], a[46]); SQRADDAC(a[36], a[45]); SQRADDAC(a[37], a[44]); SQRADDAC(a[38], a[43]); SQRADDAC(a[39], a[42]); SQRADDAC(a[40], a[41]); SQRADDDB; 
+   COMBA_STORE(b[81]);
+
+   /* output 82 */
+   CARRY_FORWARD;
+   SQRADDSC(a[35], a[47]); SQRADDAC(a[36], a[46]); SQRADDAC(a[37], a[45]); SQRADDAC(a[38], a[44]); SQRADDAC(a[39], a[43]); SQRADDAC(a[40], a[42]); SQRADDDB; SQRADD(a[41], a[41]); 
+   COMBA_STORE(b[82]);
+
+   /* output 83 */
+   CARRY_FORWARD;
+   SQRADDSC(a[36], a[47]); SQRADDAC(a[37], a[46]); SQRADDAC(a[38], a[45]); SQRADDAC(a[39], a[44]); SQRADDAC(a[40], a[43]); SQRADDAC(a[41], a[42]); SQRADDDB; 
+   COMBA_STORE(b[83]);
+
+   /* output 84 */
+   CARRY_FORWARD;
+   SQRADDSC(a[37], a[47]); SQRADDAC(a[38], a[46]); SQRADDAC(a[39], a[45]); SQRADDAC(a[40], a[44]); SQRADDAC(a[41], a[43]); SQRADDDB; SQRADD(a[42], a[42]); 
+   COMBA_STORE(b[84]);
+
+   /* output 85 */
+   CARRY_FORWARD;
+   SQRADDSC(a[38], a[47]); SQRADDAC(a[39], a[46]); SQRADDAC(a[40], a[45]); SQRADDAC(a[41], a[44]); SQRADDAC(a[42], a[43]); SQRADDDB; 
+   COMBA_STORE(b[85]);
+
+   /* output 86 */
+   CARRY_FORWARD;
+   SQRADDSC(a[39], a[47]); SQRADDAC(a[40], a[46]); SQRADDAC(a[41], a[45]); SQRADDAC(a[42], a[44]); SQRADDDB; SQRADD(a[43], a[43]); 
+   COMBA_STORE(b[86]);
+
+   /* output 87 */
+   CARRY_FORWARD;
+   SQRADDSC(a[40], a[47]); SQRADDAC(a[41], a[46]); SQRADDAC(a[42], a[45]); SQRADDAC(a[43], a[44]); SQRADDDB; 
+   COMBA_STORE(b[87]);
+
+   /* output 88 */
+   CARRY_FORWARD;
+   SQRADDSC(a[41], a[47]); SQRADDAC(a[42], a[46]); SQRADDAC(a[43], a[45]); SQRADDDB; SQRADD(a[44], a[44]); 
+   COMBA_STORE(b[88]);
+
+   /* output 89 */
+   CARRY_FORWARD;
+   SQRADDSC(a[42], a[47]); SQRADDAC(a[43], a[46]); SQRADDAC(a[44], a[45]); SQRADDDB; 
+   COMBA_STORE(b[89]);
+
+   /* output 90 */
+   CARRY_FORWARD;
+   SQRADD2(a[43], a[47]); SQRADD2(a[44], a[46]); SQRADD(a[45], a[45]); 
+   COMBA_STORE(b[90]);
+
+   /* output 91 */
+   CARRY_FORWARD;
+   SQRADD2(a[44], a[47]); SQRADD2(a[45], a[46]); 
+   COMBA_STORE(b[91]);
+
+   /* output 92 */
+   CARRY_FORWARD;
+   SQRADD2(a[45], a[47]); SQRADD(a[46], a[46]); 
+   COMBA_STORE(b[92]);
+
+   /* output 93 */
+   CARRY_FORWARD;
+   SQRADD2(a[46], a[47]); 
+   COMBA_STORE(b[93]);
+
+   /* output 94 */
+   CARRY_FORWARD;
+   SQRADD(a[47], a[47]); 
+   COMBA_STORE(b[94]);
+   COMBA_STORE2(b[95]);
+   COMBA_FINI;
+
+   B->used = 96;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 96 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_6.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_6.i
new file mode 100644 (file)
index 0000000..695e6d3
--- /dev/null
@@ -0,0 +1,97 @@
+/* fp_sqr_comba_6.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR6
+void fp_sqr_comba6(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[12], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADD2(a[1], a[5]); SQRADD2(a[2], a[4]); SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADD2(a[2], a[5]); SQRADD2(a[3], a[4]); 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADD2(a[3], a[5]); SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADD2(a[4], a[5]); 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+   COMBA_STORE2(b[11]);
+   COMBA_FINI;
+
+   B->used = 12;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 12 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_64.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_64.i
new file mode 100644 (file)
index 0000000..a2fedc8
--- /dev/null
@@ -0,0 +1,680 @@
+/* fp_sqr_comba_64.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR64
+void fp_sqr_comba64(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[128], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[16]); SQRADDAC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+
+   /* output 17 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[17]); SQRADDAC(a[1], a[16]); SQRADDAC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+   COMBA_STORE(b[17]);
+
+   /* output 18 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[18]); SQRADDAC(a[1], a[17]); SQRADDAC(a[2], a[16]); SQRADDAC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+   COMBA_STORE(b[18]);
+
+   /* output 19 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[19]); SQRADDAC(a[1], a[18]); SQRADDAC(a[2], a[17]); SQRADDAC(a[3], a[16]); SQRADDAC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+   COMBA_STORE(b[19]);
+
+   /* output 20 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[20]); SQRADDAC(a[1], a[19]); SQRADDAC(a[2], a[18]); SQRADDAC(a[3], a[17]); SQRADDAC(a[4], a[16]); SQRADDAC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+   COMBA_STORE(b[20]);
+
+   /* output 21 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[21]); SQRADDAC(a[1], a[20]); SQRADDAC(a[2], a[19]); SQRADDAC(a[3], a[18]); SQRADDAC(a[4], a[17]); SQRADDAC(a[5], a[16]); SQRADDAC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+   COMBA_STORE(b[21]);
+
+   /* output 22 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[22]); SQRADDAC(a[1], a[21]); SQRADDAC(a[2], a[20]); SQRADDAC(a[3], a[19]); SQRADDAC(a[4], a[18]); SQRADDAC(a[5], a[17]); SQRADDAC(a[6], a[16]); SQRADDAC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+   COMBA_STORE(b[22]);
+
+   /* output 23 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[23]); SQRADDAC(a[1], a[22]); SQRADDAC(a[2], a[21]); SQRADDAC(a[3], a[20]); SQRADDAC(a[4], a[19]); SQRADDAC(a[5], a[18]); SQRADDAC(a[6], a[17]); SQRADDAC(a[7], a[16]); SQRADDAC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+   COMBA_STORE(b[23]);
+
+   /* output 24 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[24]); SQRADDAC(a[1], a[23]); SQRADDAC(a[2], a[22]); SQRADDAC(a[3], a[21]); SQRADDAC(a[4], a[20]); SQRADDAC(a[5], a[19]); SQRADDAC(a[6], a[18]); SQRADDAC(a[7], a[17]); SQRADDAC(a[8], a[16]); SQRADDAC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+   COMBA_STORE(b[24]);
+
+   /* output 25 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[25]); SQRADDAC(a[1], a[24]); SQRADDAC(a[2], a[23]); SQRADDAC(a[3], a[22]); SQRADDAC(a[4], a[21]); SQRADDAC(a[5], a[20]); SQRADDAC(a[6], a[19]); SQRADDAC(a[7], a[18]); SQRADDAC(a[8], a[17]); SQRADDAC(a[9], a[16]); SQRADDAC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+   COMBA_STORE(b[25]);
+
+   /* output 26 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[26]); SQRADDAC(a[1], a[25]); SQRADDAC(a[2], a[24]); SQRADDAC(a[3], a[23]); SQRADDAC(a[4], a[22]); SQRADDAC(a[5], a[21]); SQRADDAC(a[6], a[20]); SQRADDAC(a[7], a[19]); SQRADDAC(a[8], a[18]); SQRADDAC(a[9], a[17]); SQRADDAC(a[10], a[16]); SQRADDAC(a[11], a[15]); SQRADDAC(a[12], a[14]); SQRADDDB; SQRADD(a[13], a[13]); 
+   COMBA_STORE(b[26]);
+
+   /* output 27 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[27]); SQRADDAC(a[1], a[26]); SQRADDAC(a[2], a[25]); SQRADDAC(a[3], a[24]); SQRADDAC(a[4], a[23]); SQRADDAC(a[5], a[22]); SQRADDAC(a[6], a[21]); SQRADDAC(a[7], a[20]); SQRADDAC(a[8], a[19]); SQRADDAC(a[9], a[18]); SQRADDAC(a[10], a[17]); SQRADDAC(a[11], a[16]); SQRADDAC(a[12], a[15]); SQRADDAC(a[13], a[14]); SQRADDDB; 
+   COMBA_STORE(b[27]);
+
+   /* output 28 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[28]); SQRADDAC(a[1], a[27]); SQRADDAC(a[2], a[26]); SQRADDAC(a[3], a[25]); SQRADDAC(a[4], a[24]); SQRADDAC(a[5], a[23]); SQRADDAC(a[6], a[22]); SQRADDAC(a[7], a[21]); SQRADDAC(a[8], a[20]); SQRADDAC(a[9], a[19]); SQRADDAC(a[10], a[18]); SQRADDAC(a[11], a[17]); SQRADDAC(a[12], a[16]); SQRADDAC(a[13], a[15]); SQRADDDB; SQRADD(a[14], a[14]); 
+   COMBA_STORE(b[28]);
+
+   /* output 29 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[29]); SQRADDAC(a[1], a[28]); SQRADDAC(a[2], a[27]); SQRADDAC(a[3], a[26]); SQRADDAC(a[4], a[25]); SQRADDAC(a[5], a[24]); SQRADDAC(a[6], a[23]); SQRADDAC(a[7], a[22]); SQRADDAC(a[8], a[21]); SQRADDAC(a[9], a[20]); SQRADDAC(a[10], a[19]); SQRADDAC(a[11], a[18]); SQRADDAC(a[12], a[17]); SQRADDAC(a[13], a[16]); SQRADDAC(a[14], a[15]); SQRADDDB; 
+   COMBA_STORE(b[29]);
+
+   /* output 30 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[30]); SQRADDAC(a[1], a[29]); SQRADDAC(a[2], a[28]); SQRADDAC(a[3], a[27]); SQRADDAC(a[4], a[26]); SQRADDAC(a[5], a[25]); SQRADDAC(a[6], a[24]); SQRADDAC(a[7], a[23]); SQRADDAC(a[8], a[22]); SQRADDAC(a[9], a[21]); SQRADDAC(a[10], a[20]); SQRADDAC(a[11], a[19]); SQRADDAC(a[12], a[18]); SQRADDAC(a[13], a[17]); SQRADDAC(a[14], a[16]); SQRADDDB; SQRADD(a[15], a[15]); 
+   COMBA_STORE(b[30]);
+
+   /* output 31 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[31]); SQRADDAC(a[1], a[30]); SQRADDAC(a[2], a[29]); SQRADDAC(a[3], a[28]); SQRADDAC(a[4], a[27]); SQRADDAC(a[5], a[26]); SQRADDAC(a[6], a[25]); SQRADDAC(a[7], a[24]); SQRADDAC(a[8], a[23]); SQRADDAC(a[9], a[22]); SQRADDAC(a[10], a[21]); SQRADDAC(a[11], a[20]); SQRADDAC(a[12], a[19]); SQRADDAC(a[13], a[18]); SQRADDAC(a[14], a[17]); SQRADDAC(a[15], a[16]); SQRADDDB; 
+   COMBA_STORE(b[31]);
+
+   /* output 32 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[32]); SQRADDAC(a[1], a[31]); SQRADDAC(a[2], a[30]); SQRADDAC(a[3], a[29]); SQRADDAC(a[4], a[28]); SQRADDAC(a[5], a[27]); SQRADDAC(a[6], a[26]); SQRADDAC(a[7], a[25]); SQRADDAC(a[8], a[24]); SQRADDAC(a[9], a[23]); SQRADDAC(a[10], a[22]); SQRADDAC(a[11], a[21]); SQRADDAC(a[12], a[20]); SQRADDAC(a[13], a[19]); SQRADDAC(a[14], a[18]); SQRADDAC(a[15], a[17]); SQRADDDB; SQRADD(a[16], a[16]); 
+   COMBA_STORE(b[32]);
+
+   /* output 33 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[33]); SQRADDAC(a[1], a[32]); SQRADDAC(a[2], a[31]); SQRADDAC(a[3], a[30]); SQRADDAC(a[4], a[29]); SQRADDAC(a[5], a[28]); SQRADDAC(a[6], a[27]); SQRADDAC(a[7], a[26]); SQRADDAC(a[8], a[25]); SQRADDAC(a[9], a[24]); SQRADDAC(a[10], a[23]); SQRADDAC(a[11], a[22]); SQRADDAC(a[12], a[21]); SQRADDAC(a[13], a[20]); SQRADDAC(a[14], a[19]); SQRADDAC(a[15], a[18]); SQRADDAC(a[16], a[17]); SQRADDDB; 
+   COMBA_STORE(b[33]);
+
+   /* output 34 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[34]); SQRADDAC(a[1], a[33]); SQRADDAC(a[2], a[32]); SQRADDAC(a[3], a[31]); SQRADDAC(a[4], a[30]); SQRADDAC(a[5], a[29]); SQRADDAC(a[6], a[28]); SQRADDAC(a[7], a[27]); SQRADDAC(a[8], a[26]); SQRADDAC(a[9], a[25]); SQRADDAC(a[10], a[24]); SQRADDAC(a[11], a[23]); SQRADDAC(a[12], a[22]); SQRADDAC(a[13], a[21]); SQRADDAC(a[14], a[20]); SQRADDAC(a[15], a[19]); SQRADDAC(a[16], a[18]); SQRADDDB; SQRADD(a[17], a[17]); 
+   COMBA_STORE(b[34]);
+
+   /* output 35 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[35]); SQRADDAC(a[1], a[34]); SQRADDAC(a[2], a[33]); SQRADDAC(a[3], a[32]); SQRADDAC(a[4], a[31]); SQRADDAC(a[5], a[30]); SQRADDAC(a[6], a[29]); SQRADDAC(a[7], a[28]); SQRADDAC(a[8], a[27]); SQRADDAC(a[9], a[26]); SQRADDAC(a[10], a[25]); SQRADDAC(a[11], a[24]); SQRADDAC(a[12], a[23]); SQRADDAC(a[13], a[22]); SQRADDAC(a[14], a[21]); SQRADDAC(a[15], a[20]); SQRADDAC(a[16], a[19]); SQRADDAC(a[17], a[18]); SQRADDDB; 
+   COMBA_STORE(b[35]);
+
+   /* output 36 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[36]); SQRADDAC(a[1], a[35]); SQRADDAC(a[2], a[34]); SQRADDAC(a[3], a[33]); SQRADDAC(a[4], a[32]); SQRADDAC(a[5], a[31]); SQRADDAC(a[6], a[30]); SQRADDAC(a[7], a[29]); SQRADDAC(a[8], a[28]); SQRADDAC(a[9], a[27]); SQRADDAC(a[10], a[26]); SQRADDAC(a[11], a[25]); SQRADDAC(a[12], a[24]); SQRADDAC(a[13], a[23]); SQRADDAC(a[14], a[22]); SQRADDAC(a[15], a[21]); SQRADDAC(a[16], a[20]); SQRADDAC(a[17], a[19]); SQRADDDB; SQRADD(a[18], a[18]); 
+   COMBA_STORE(b[36]);
+
+   /* output 37 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[37]); SQRADDAC(a[1], a[36]); SQRADDAC(a[2], a[35]); SQRADDAC(a[3], a[34]); SQRADDAC(a[4], a[33]); SQRADDAC(a[5], a[32]); SQRADDAC(a[6], a[31]); SQRADDAC(a[7], a[30]); SQRADDAC(a[8], a[29]); SQRADDAC(a[9], a[28]); SQRADDAC(a[10], a[27]); SQRADDAC(a[11], a[26]); SQRADDAC(a[12], a[25]); SQRADDAC(a[13], a[24]); SQRADDAC(a[14], a[23]); SQRADDAC(a[15], a[22]); SQRADDAC(a[16], a[21]); SQRADDAC(a[17], a[20]); SQRADDAC(a[18], a[19]); SQRADDDB; 
+   COMBA_STORE(b[37]);
+
+   /* output 38 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[38]); SQRADDAC(a[1], a[37]); SQRADDAC(a[2], a[36]); SQRADDAC(a[3], a[35]); SQRADDAC(a[4], a[34]); SQRADDAC(a[5], a[33]); SQRADDAC(a[6], a[32]); SQRADDAC(a[7], a[31]); SQRADDAC(a[8], a[30]); SQRADDAC(a[9], a[29]); SQRADDAC(a[10], a[28]); SQRADDAC(a[11], a[27]); SQRADDAC(a[12], a[26]); SQRADDAC(a[13], a[25]); SQRADDAC(a[14], a[24]); SQRADDAC(a[15], a[23]); SQRADDAC(a[16], a[22]); SQRADDAC(a[17], a[21]); SQRADDAC(a[18], a[20]); SQRADDDB; SQRADD(a[19], a[19]); 
+   COMBA_STORE(b[38]);
+
+   /* output 39 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[39]); SQRADDAC(a[1], a[38]); SQRADDAC(a[2], a[37]); SQRADDAC(a[3], a[36]); SQRADDAC(a[4], a[35]); SQRADDAC(a[5], a[34]); SQRADDAC(a[6], a[33]); SQRADDAC(a[7], a[32]); SQRADDAC(a[8], a[31]); SQRADDAC(a[9], a[30]); SQRADDAC(a[10], a[29]); SQRADDAC(a[11], a[28]); SQRADDAC(a[12], a[27]); SQRADDAC(a[13], a[26]); SQRADDAC(a[14], a[25]); SQRADDAC(a[15], a[24]); SQRADDAC(a[16], a[23]); SQRADDAC(a[17], a[22]); SQRADDAC(a[18], a[21]); SQRADDAC(a[19], a[20]); SQRADDDB; 
+   COMBA_STORE(b[39]);
+
+   /* output 40 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[40]); SQRADDAC(a[1], a[39]); SQRADDAC(a[2], a[38]); SQRADDAC(a[3], a[37]); SQRADDAC(a[4], a[36]); SQRADDAC(a[5], a[35]); SQRADDAC(a[6], a[34]); SQRADDAC(a[7], a[33]); SQRADDAC(a[8], a[32]); SQRADDAC(a[9], a[31]); SQRADDAC(a[10], a[30]); SQRADDAC(a[11], a[29]); SQRADDAC(a[12], a[28]); SQRADDAC(a[13], a[27]); SQRADDAC(a[14], a[26]); SQRADDAC(a[15], a[25]); SQRADDAC(a[16], a[24]); SQRADDAC(a[17], a[23]); SQRADDAC(a[18], a[22]); SQRADDAC(a[19], a[21]); SQRADDDB; SQRADD(a[20], a[20]); 
+   COMBA_STORE(b[40]);
+
+   /* output 41 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[41]); SQRADDAC(a[1], a[40]); SQRADDAC(a[2], a[39]); SQRADDAC(a[3], a[38]); SQRADDAC(a[4], a[37]); SQRADDAC(a[5], a[36]); SQRADDAC(a[6], a[35]); SQRADDAC(a[7], a[34]); SQRADDAC(a[8], a[33]); SQRADDAC(a[9], a[32]); SQRADDAC(a[10], a[31]); SQRADDAC(a[11], a[30]); SQRADDAC(a[12], a[29]); SQRADDAC(a[13], a[28]); SQRADDAC(a[14], a[27]); SQRADDAC(a[15], a[26]); SQRADDAC(a[16], a[25]); SQRADDAC(a[17], a[24]); SQRADDAC(a[18], a[23]); SQRADDAC(a[19], a[22]); SQRADDAC(a[20], a[21]); SQRADDDB; 
+   COMBA_STORE(b[41]);
+
+   /* output 42 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[42]); SQRADDAC(a[1], a[41]); SQRADDAC(a[2], a[40]); SQRADDAC(a[3], a[39]); SQRADDAC(a[4], a[38]); SQRADDAC(a[5], a[37]); SQRADDAC(a[6], a[36]); SQRADDAC(a[7], a[35]); SQRADDAC(a[8], a[34]); SQRADDAC(a[9], a[33]); SQRADDAC(a[10], a[32]); SQRADDAC(a[11], a[31]); SQRADDAC(a[12], a[30]); SQRADDAC(a[13], a[29]); SQRADDAC(a[14], a[28]); SQRADDAC(a[15], a[27]); SQRADDAC(a[16], a[26]); SQRADDAC(a[17], a[25]); SQRADDAC(a[18], a[24]); SQRADDAC(a[19], a[23]); SQRADDAC(a[20], a[22]); SQRADDDB; SQRADD(a[21], a[21]); 
+   COMBA_STORE(b[42]);
+
+   /* output 43 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[43]); SQRADDAC(a[1], a[42]); SQRADDAC(a[2], a[41]); SQRADDAC(a[3], a[40]); SQRADDAC(a[4], a[39]); SQRADDAC(a[5], a[38]); SQRADDAC(a[6], a[37]); SQRADDAC(a[7], a[36]); SQRADDAC(a[8], a[35]); SQRADDAC(a[9], a[34]); SQRADDAC(a[10], a[33]); SQRADDAC(a[11], a[32]); SQRADDAC(a[12], a[31]); SQRADDAC(a[13], a[30]); SQRADDAC(a[14], a[29]); SQRADDAC(a[15], a[28]); SQRADDAC(a[16], a[27]); SQRADDAC(a[17], a[26]); SQRADDAC(a[18], a[25]); SQRADDAC(a[19], a[24]); SQRADDAC(a[20], a[23]); SQRADDAC(a[21], a[22]); SQRADDDB; 
+   COMBA_STORE(b[43]);
+
+   /* output 44 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[44]); SQRADDAC(a[1], a[43]); SQRADDAC(a[2], a[42]); SQRADDAC(a[3], a[41]); SQRADDAC(a[4], a[40]); SQRADDAC(a[5], a[39]); SQRADDAC(a[6], a[38]); SQRADDAC(a[7], a[37]); SQRADDAC(a[8], a[36]); SQRADDAC(a[9], a[35]); SQRADDAC(a[10], a[34]); SQRADDAC(a[11], a[33]); SQRADDAC(a[12], a[32]); SQRADDAC(a[13], a[31]); SQRADDAC(a[14], a[30]); SQRADDAC(a[15], a[29]); SQRADDAC(a[16], a[28]); SQRADDAC(a[17], a[27]); SQRADDAC(a[18], a[26]); SQRADDAC(a[19], a[25]); SQRADDAC(a[20], a[24]); SQRADDAC(a[21], a[23]); SQRADDDB; SQRADD(a[22], a[22]); 
+   COMBA_STORE(b[44]);
+
+   /* output 45 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[45]); SQRADDAC(a[1], a[44]); SQRADDAC(a[2], a[43]); SQRADDAC(a[3], a[42]); SQRADDAC(a[4], a[41]); SQRADDAC(a[5], a[40]); SQRADDAC(a[6], a[39]); SQRADDAC(a[7], a[38]); SQRADDAC(a[8], a[37]); SQRADDAC(a[9], a[36]); SQRADDAC(a[10], a[35]); SQRADDAC(a[11], a[34]); SQRADDAC(a[12], a[33]); SQRADDAC(a[13], a[32]); SQRADDAC(a[14], a[31]); SQRADDAC(a[15], a[30]); SQRADDAC(a[16], a[29]); SQRADDAC(a[17], a[28]); SQRADDAC(a[18], a[27]); SQRADDAC(a[19], a[26]); SQRADDAC(a[20], a[25]); SQRADDAC(a[21], a[24]); SQRADDAC(a[22], a[23]); SQRADDDB; 
+   COMBA_STORE(b[45]);
+
+   /* output 46 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[46]); SQRADDAC(a[1], a[45]); SQRADDAC(a[2], a[44]); SQRADDAC(a[3], a[43]); SQRADDAC(a[4], a[42]); SQRADDAC(a[5], a[41]); SQRADDAC(a[6], a[40]); SQRADDAC(a[7], a[39]); SQRADDAC(a[8], a[38]); SQRADDAC(a[9], a[37]); SQRADDAC(a[10], a[36]); SQRADDAC(a[11], a[35]); SQRADDAC(a[12], a[34]); SQRADDAC(a[13], a[33]); SQRADDAC(a[14], a[32]); SQRADDAC(a[15], a[31]); SQRADDAC(a[16], a[30]); SQRADDAC(a[17], a[29]); SQRADDAC(a[18], a[28]); SQRADDAC(a[19], a[27]); SQRADDAC(a[20], a[26]); SQRADDAC(a[21], a[25]); SQRADDAC(a[22], a[24]); SQRADDDB; SQRADD(a[23], a[23]); 
+   COMBA_STORE(b[46]);
+
+   /* output 47 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[47]); SQRADDAC(a[1], a[46]); SQRADDAC(a[2], a[45]); SQRADDAC(a[3], a[44]); SQRADDAC(a[4], a[43]); SQRADDAC(a[5], a[42]); SQRADDAC(a[6], a[41]); SQRADDAC(a[7], a[40]); SQRADDAC(a[8], a[39]); SQRADDAC(a[9], a[38]); SQRADDAC(a[10], a[37]); SQRADDAC(a[11], a[36]); SQRADDAC(a[12], a[35]); SQRADDAC(a[13], a[34]); SQRADDAC(a[14], a[33]); SQRADDAC(a[15], a[32]); SQRADDAC(a[16], a[31]); SQRADDAC(a[17], a[30]); SQRADDAC(a[18], a[29]); SQRADDAC(a[19], a[28]); SQRADDAC(a[20], a[27]); SQRADDAC(a[21], a[26]); SQRADDAC(a[22], a[25]); SQRADDAC(a[23], a[24]); SQRADDDB; 
+   COMBA_STORE(b[47]);
+
+   /* output 48 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[48]); SQRADDAC(a[1], a[47]); SQRADDAC(a[2], a[46]); SQRADDAC(a[3], a[45]); SQRADDAC(a[4], a[44]); SQRADDAC(a[5], a[43]); SQRADDAC(a[6], a[42]); SQRADDAC(a[7], a[41]); SQRADDAC(a[8], a[40]); SQRADDAC(a[9], a[39]); SQRADDAC(a[10], a[38]); SQRADDAC(a[11], a[37]); SQRADDAC(a[12], a[36]); SQRADDAC(a[13], a[35]); SQRADDAC(a[14], a[34]); SQRADDAC(a[15], a[33]); SQRADDAC(a[16], a[32]); SQRADDAC(a[17], a[31]); SQRADDAC(a[18], a[30]); SQRADDAC(a[19], a[29]); SQRADDAC(a[20], a[28]); SQRADDAC(a[21], a[27]); SQRADDAC(a[22], a[26]); SQRADDAC(a[23], a[25]); SQRADDDB; SQRADD(a[24], a[24]); 
+   COMBA_STORE(b[48]);
+
+   /* output 49 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[49]); SQRADDAC(a[1], a[48]); SQRADDAC(a[2], a[47]); SQRADDAC(a[3], a[46]); SQRADDAC(a[4], a[45]); SQRADDAC(a[5], a[44]); SQRADDAC(a[6], a[43]); SQRADDAC(a[7], a[42]); SQRADDAC(a[8], a[41]); SQRADDAC(a[9], a[40]); SQRADDAC(a[10], a[39]); SQRADDAC(a[11], a[38]); SQRADDAC(a[12], a[37]); SQRADDAC(a[13], a[36]); SQRADDAC(a[14], a[35]); SQRADDAC(a[15], a[34]); SQRADDAC(a[16], a[33]); SQRADDAC(a[17], a[32]); SQRADDAC(a[18], a[31]); SQRADDAC(a[19], a[30]); SQRADDAC(a[20], a[29]); SQRADDAC(a[21], a[28]); SQRADDAC(a[22], a[27]); SQRADDAC(a[23], a[26]); SQRADDAC(a[24], a[25]); SQRADDDB; 
+   COMBA_STORE(b[49]);
+
+   /* output 50 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[50]); SQRADDAC(a[1], a[49]); SQRADDAC(a[2], a[48]); SQRADDAC(a[3], a[47]); SQRADDAC(a[4], a[46]); SQRADDAC(a[5], a[45]); SQRADDAC(a[6], a[44]); SQRADDAC(a[7], a[43]); SQRADDAC(a[8], a[42]); SQRADDAC(a[9], a[41]); SQRADDAC(a[10], a[40]); SQRADDAC(a[11], a[39]); SQRADDAC(a[12], a[38]); SQRADDAC(a[13], a[37]); SQRADDAC(a[14], a[36]); SQRADDAC(a[15], a[35]); SQRADDAC(a[16], a[34]); SQRADDAC(a[17], a[33]); SQRADDAC(a[18], a[32]); SQRADDAC(a[19], a[31]); SQRADDAC(a[20], a[30]); SQRADDAC(a[21], a[29]); SQRADDAC(a[22], a[28]); SQRADDAC(a[23], a[27]); SQRADDAC(a[24], a[26]); SQRADDDB; SQRADD(a[25], a[25]); 
+   COMBA_STORE(b[50]);
+
+   /* output 51 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[51]); SQRADDAC(a[1], a[50]); SQRADDAC(a[2], a[49]); SQRADDAC(a[3], a[48]); SQRADDAC(a[4], a[47]); SQRADDAC(a[5], a[46]); SQRADDAC(a[6], a[45]); SQRADDAC(a[7], a[44]); SQRADDAC(a[8], a[43]); SQRADDAC(a[9], a[42]); SQRADDAC(a[10], a[41]); SQRADDAC(a[11], a[40]); SQRADDAC(a[12], a[39]); SQRADDAC(a[13], a[38]); SQRADDAC(a[14], a[37]); SQRADDAC(a[15], a[36]); SQRADDAC(a[16], a[35]); SQRADDAC(a[17], a[34]); SQRADDAC(a[18], a[33]); SQRADDAC(a[19], a[32]); SQRADDAC(a[20], a[31]); SQRADDAC(a[21], a[30]); SQRADDAC(a[22], a[29]); SQRADDAC(a[23], a[28]); SQRADDAC(a[24], a[27]); SQRADDAC(a[25], a[26]); SQRADDDB; 
+   COMBA_STORE(b[51]);
+
+   /* output 52 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[52]); SQRADDAC(a[1], a[51]); SQRADDAC(a[2], a[50]); SQRADDAC(a[3], a[49]); SQRADDAC(a[4], a[48]); SQRADDAC(a[5], a[47]); SQRADDAC(a[6], a[46]); SQRADDAC(a[7], a[45]); SQRADDAC(a[8], a[44]); SQRADDAC(a[9], a[43]); SQRADDAC(a[10], a[42]); SQRADDAC(a[11], a[41]); SQRADDAC(a[12], a[40]); SQRADDAC(a[13], a[39]); SQRADDAC(a[14], a[38]); SQRADDAC(a[15], a[37]); SQRADDAC(a[16], a[36]); SQRADDAC(a[17], a[35]); SQRADDAC(a[18], a[34]); SQRADDAC(a[19], a[33]); SQRADDAC(a[20], a[32]); SQRADDAC(a[21], a[31]); SQRADDAC(a[22], a[30]); SQRADDAC(a[23], a[29]); SQRADDAC(a[24], a[28]); SQRADDAC(a[25], a[27]); SQRADDDB; SQRADD(a[26], a[26]); 
+   COMBA_STORE(b[52]);
+
+   /* output 53 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[53]); SQRADDAC(a[1], a[52]); SQRADDAC(a[2], a[51]); SQRADDAC(a[3], a[50]); SQRADDAC(a[4], a[49]); SQRADDAC(a[5], a[48]); SQRADDAC(a[6], a[47]); SQRADDAC(a[7], a[46]); SQRADDAC(a[8], a[45]); SQRADDAC(a[9], a[44]); SQRADDAC(a[10], a[43]); SQRADDAC(a[11], a[42]); SQRADDAC(a[12], a[41]); SQRADDAC(a[13], a[40]); SQRADDAC(a[14], a[39]); SQRADDAC(a[15], a[38]); SQRADDAC(a[16], a[37]); SQRADDAC(a[17], a[36]); SQRADDAC(a[18], a[35]); SQRADDAC(a[19], a[34]); SQRADDAC(a[20], a[33]); SQRADDAC(a[21], a[32]); SQRADDAC(a[22], a[31]); SQRADDAC(a[23], a[30]); SQRADDAC(a[24], a[29]); SQRADDAC(a[25], a[28]); SQRADDAC(a[26], a[27]); SQRADDDB; 
+   COMBA_STORE(b[53]);
+
+   /* output 54 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[54]); SQRADDAC(a[1], a[53]); SQRADDAC(a[2], a[52]); SQRADDAC(a[3], a[51]); SQRADDAC(a[4], a[50]); SQRADDAC(a[5], a[49]); SQRADDAC(a[6], a[48]); SQRADDAC(a[7], a[47]); SQRADDAC(a[8], a[46]); SQRADDAC(a[9], a[45]); SQRADDAC(a[10], a[44]); SQRADDAC(a[11], a[43]); SQRADDAC(a[12], a[42]); SQRADDAC(a[13], a[41]); SQRADDAC(a[14], a[40]); SQRADDAC(a[15], a[39]); SQRADDAC(a[16], a[38]); SQRADDAC(a[17], a[37]); SQRADDAC(a[18], a[36]); SQRADDAC(a[19], a[35]); SQRADDAC(a[20], a[34]); SQRADDAC(a[21], a[33]); SQRADDAC(a[22], a[32]); SQRADDAC(a[23], a[31]); SQRADDAC(a[24], a[30]); SQRADDAC(a[25], a[29]); SQRADDAC(a[26], a[28]); SQRADDDB; SQRADD(a[27], a[27]); 
+   COMBA_STORE(b[54]);
+
+   /* output 55 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[55]); SQRADDAC(a[1], a[54]); SQRADDAC(a[2], a[53]); SQRADDAC(a[3], a[52]); SQRADDAC(a[4], a[51]); SQRADDAC(a[5], a[50]); SQRADDAC(a[6], a[49]); SQRADDAC(a[7], a[48]); SQRADDAC(a[8], a[47]); SQRADDAC(a[9], a[46]); SQRADDAC(a[10], a[45]); SQRADDAC(a[11], a[44]); SQRADDAC(a[12], a[43]); SQRADDAC(a[13], a[42]); SQRADDAC(a[14], a[41]); SQRADDAC(a[15], a[40]); SQRADDAC(a[16], a[39]); SQRADDAC(a[17], a[38]); SQRADDAC(a[18], a[37]); SQRADDAC(a[19], a[36]); SQRADDAC(a[20], a[35]); SQRADDAC(a[21], a[34]); SQRADDAC(a[22], a[33]); SQRADDAC(a[23], a[32]); SQRADDAC(a[24], a[31]); SQRADDAC(a[25], a[30]); SQRADDAC(a[26], a[29]); SQRADDAC(a[27], a[28]); SQRADDDB; 
+   COMBA_STORE(b[55]);
+
+   /* output 56 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[56]); SQRADDAC(a[1], a[55]); SQRADDAC(a[2], a[54]); SQRADDAC(a[3], a[53]); SQRADDAC(a[4], a[52]); SQRADDAC(a[5], a[51]); SQRADDAC(a[6], a[50]); SQRADDAC(a[7], a[49]); SQRADDAC(a[8], a[48]); SQRADDAC(a[9], a[47]); SQRADDAC(a[10], a[46]); SQRADDAC(a[11], a[45]); SQRADDAC(a[12], a[44]); SQRADDAC(a[13], a[43]); SQRADDAC(a[14], a[42]); SQRADDAC(a[15], a[41]); SQRADDAC(a[16], a[40]); SQRADDAC(a[17], a[39]); SQRADDAC(a[18], a[38]); SQRADDAC(a[19], a[37]); SQRADDAC(a[20], a[36]); SQRADDAC(a[21], a[35]); SQRADDAC(a[22], a[34]); SQRADDAC(a[23], a[33]); SQRADDAC(a[24], a[32]); SQRADDAC(a[25], a[31]); SQRADDAC(a[26], a[30]); SQRADDAC(a[27], a[29]); SQRADDDB; SQRADD(a[28], a[28]); 
+   COMBA_STORE(b[56]);
+
+   /* output 57 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[57]); SQRADDAC(a[1], a[56]); SQRADDAC(a[2], a[55]); SQRADDAC(a[3], a[54]); SQRADDAC(a[4], a[53]); SQRADDAC(a[5], a[52]); SQRADDAC(a[6], a[51]); SQRADDAC(a[7], a[50]); SQRADDAC(a[8], a[49]); SQRADDAC(a[9], a[48]); SQRADDAC(a[10], a[47]); SQRADDAC(a[11], a[46]); SQRADDAC(a[12], a[45]); SQRADDAC(a[13], a[44]); SQRADDAC(a[14], a[43]); SQRADDAC(a[15], a[42]); SQRADDAC(a[16], a[41]); SQRADDAC(a[17], a[40]); SQRADDAC(a[18], a[39]); SQRADDAC(a[19], a[38]); SQRADDAC(a[20], a[37]); SQRADDAC(a[21], a[36]); SQRADDAC(a[22], a[35]); SQRADDAC(a[23], a[34]); SQRADDAC(a[24], a[33]); SQRADDAC(a[25], a[32]); SQRADDAC(a[26], a[31]); SQRADDAC(a[27], a[30]); SQRADDAC(a[28], a[29]); SQRADDDB; 
+   COMBA_STORE(b[57]);
+
+   /* output 58 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[58]); SQRADDAC(a[1], a[57]); SQRADDAC(a[2], a[56]); SQRADDAC(a[3], a[55]); SQRADDAC(a[4], a[54]); SQRADDAC(a[5], a[53]); SQRADDAC(a[6], a[52]); SQRADDAC(a[7], a[51]); SQRADDAC(a[8], a[50]); SQRADDAC(a[9], a[49]); SQRADDAC(a[10], a[48]); SQRADDAC(a[11], a[47]); SQRADDAC(a[12], a[46]); SQRADDAC(a[13], a[45]); SQRADDAC(a[14], a[44]); SQRADDAC(a[15], a[43]); SQRADDAC(a[16], a[42]); SQRADDAC(a[17], a[41]); SQRADDAC(a[18], a[40]); SQRADDAC(a[19], a[39]); SQRADDAC(a[20], a[38]); SQRADDAC(a[21], a[37]); SQRADDAC(a[22], a[36]); SQRADDAC(a[23], a[35]); SQRADDAC(a[24], a[34]); SQRADDAC(a[25], a[33]); SQRADDAC(a[26], a[32]); SQRADDAC(a[27], a[31]); SQRADDAC(a[28], a[30]); SQRADDDB; SQRADD(a[29], a[29]); 
+   COMBA_STORE(b[58]);
+
+   /* output 59 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[59]); SQRADDAC(a[1], a[58]); SQRADDAC(a[2], a[57]); SQRADDAC(a[3], a[56]); SQRADDAC(a[4], a[55]); SQRADDAC(a[5], a[54]); SQRADDAC(a[6], a[53]); SQRADDAC(a[7], a[52]); SQRADDAC(a[8], a[51]); SQRADDAC(a[9], a[50]); SQRADDAC(a[10], a[49]); SQRADDAC(a[11], a[48]); SQRADDAC(a[12], a[47]); SQRADDAC(a[13], a[46]); SQRADDAC(a[14], a[45]); SQRADDAC(a[15], a[44]); SQRADDAC(a[16], a[43]); SQRADDAC(a[17], a[42]); SQRADDAC(a[18], a[41]); SQRADDAC(a[19], a[40]); SQRADDAC(a[20], a[39]); SQRADDAC(a[21], a[38]); SQRADDAC(a[22], a[37]); SQRADDAC(a[23], a[36]); SQRADDAC(a[24], a[35]); SQRADDAC(a[25], a[34]); SQRADDAC(a[26], a[33]); SQRADDAC(a[27], a[32]); SQRADDAC(a[28], a[31]); SQRADDAC(a[29], a[30]); SQRADDDB; 
+   COMBA_STORE(b[59]);
+
+   /* output 60 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[60]); SQRADDAC(a[1], a[59]); SQRADDAC(a[2], a[58]); SQRADDAC(a[3], a[57]); SQRADDAC(a[4], a[56]); SQRADDAC(a[5], a[55]); SQRADDAC(a[6], a[54]); SQRADDAC(a[7], a[53]); SQRADDAC(a[8], a[52]); SQRADDAC(a[9], a[51]); SQRADDAC(a[10], a[50]); SQRADDAC(a[11], a[49]); SQRADDAC(a[12], a[48]); SQRADDAC(a[13], a[47]); SQRADDAC(a[14], a[46]); SQRADDAC(a[15], a[45]); SQRADDAC(a[16], a[44]); SQRADDAC(a[17], a[43]); SQRADDAC(a[18], a[42]); SQRADDAC(a[19], a[41]); SQRADDAC(a[20], a[40]); SQRADDAC(a[21], a[39]); SQRADDAC(a[22], a[38]); SQRADDAC(a[23], a[37]); SQRADDAC(a[24], a[36]); SQRADDAC(a[25], a[35]); SQRADDAC(a[26], a[34]); SQRADDAC(a[27], a[33]); SQRADDAC(a[28], a[32]); SQRADDAC(a[29], a[31]); SQRADDDB; SQRADD(a[30], a[30]); 
+   COMBA_STORE(b[60]);
+
+   /* output 61 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[61]); SQRADDAC(a[1], a[60]); SQRADDAC(a[2], a[59]); SQRADDAC(a[3], a[58]); SQRADDAC(a[4], a[57]); SQRADDAC(a[5], a[56]); SQRADDAC(a[6], a[55]); SQRADDAC(a[7], a[54]); SQRADDAC(a[8], a[53]); SQRADDAC(a[9], a[52]); SQRADDAC(a[10], a[51]); SQRADDAC(a[11], a[50]); SQRADDAC(a[12], a[49]); SQRADDAC(a[13], a[48]); SQRADDAC(a[14], a[47]); SQRADDAC(a[15], a[46]); SQRADDAC(a[16], a[45]); SQRADDAC(a[17], a[44]); SQRADDAC(a[18], a[43]); SQRADDAC(a[19], a[42]); SQRADDAC(a[20], a[41]); SQRADDAC(a[21], a[40]); SQRADDAC(a[22], a[39]); SQRADDAC(a[23], a[38]); SQRADDAC(a[24], a[37]); SQRADDAC(a[25], a[36]); SQRADDAC(a[26], a[35]); SQRADDAC(a[27], a[34]); SQRADDAC(a[28], a[33]); SQRADDAC(a[29], a[32]); SQRADDAC(a[30], a[31]); SQRADDDB; 
+   COMBA_STORE(b[61]);
+
+   /* output 62 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[62]); SQRADDAC(a[1], a[61]); SQRADDAC(a[2], a[60]); SQRADDAC(a[3], a[59]); SQRADDAC(a[4], a[58]); SQRADDAC(a[5], a[57]); SQRADDAC(a[6], a[56]); SQRADDAC(a[7], a[55]); SQRADDAC(a[8], a[54]); SQRADDAC(a[9], a[53]); SQRADDAC(a[10], a[52]); SQRADDAC(a[11], a[51]); SQRADDAC(a[12], a[50]); SQRADDAC(a[13], a[49]); SQRADDAC(a[14], a[48]); SQRADDAC(a[15], a[47]); SQRADDAC(a[16], a[46]); SQRADDAC(a[17], a[45]); SQRADDAC(a[18], a[44]); SQRADDAC(a[19], a[43]); SQRADDAC(a[20], a[42]); SQRADDAC(a[21], a[41]); SQRADDAC(a[22], a[40]); SQRADDAC(a[23], a[39]); SQRADDAC(a[24], a[38]); SQRADDAC(a[25], a[37]); SQRADDAC(a[26], a[36]); SQRADDAC(a[27], a[35]); SQRADDAC(a[28], a[34]); SQRADDAC(a[29], a[33]); SQRADDAC(a[30], a[32]); SQRADDDB; SQRADD(a[31], a[31]); 
+   COMBA_STORE(b[62]);
+
+   /* output 63 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[63]); SQRADDAC(a[1], a[62]); SQRADDAC(a[2], a[61]); SQRADDAC(a[3], a[60]); SQRADDAC(a[4], a[59]); SQRADDAC(a[5], a[58]); SQRADDAC(a[6], a[57]); SQRADDAC(a[7], a[56]); SQRADDAC(a[8], a[55]); SQRADDAC(a[9], a[54]); SQRADDAC(a[10], a[53]); SQRADDAC(a[11], a[52]); SQRADDAC(a[12], a[51]); SQRADDAC(a[13], a[50]); SQRADDAC(a[14], a[49]); SQRADDAC(a[15], a[48]); SQRADDAC(a[16], a[47]); SQRADDAC(a[17], a[46]); SQRADDAC(a[18], a[45]); SQRADDAC(a[19], a[44]); SQRADDAC(a[20], a[43]); SQRADDAC(a[21], a[42]); SQRADDAC(a[22], a[41]); SQRADDAC(a[23], a[40]); SQRADDAC(a[24], a[39]); SQRADDAC(a[25], a[38]); SQRADDAC(a[26], a[37]); SQRADDAC(a[27], a[36]); SQRADDAC(a[28], a[35]); SQRADDAC(a[29], a[34]); SQRADDAC(a[30], a[33]); SQRADDAC(a[31], a[32]); SQRADDDB; 
+   COMBA_STORE(b[63]);
+
+   /* output 64 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[63]); SQRADDAC(a[2], a[62]); SQRADDAC(a[3], a[61]); SQRADDAC(a[4], a[60]); SQRADDAC(a[5], a[59]); SQRADDAC(a[6], a[58]); SQRADDAC(a[7], a[57]); SQRADDAC(a[8], a[56]); SQRADDAC(a[9], a[55]); SQRADDAC(a[10], a[54]); SQRADDAC(a[11], a[53]); SQRADDAC(a[12], a[52]); SQRADDAC(a[13], a[51]); SQRADDAC(a[14], a[50]); SQRADDAC(a[15], a[49]); SQRADDAC(a[16], a[48]); SQRADDAC(a[17], a[47]); SQRADDAC(a[18], a[46]); SQRADDAC(a[19], a[45]); SQRADDAC(a[20], a[44]); SQRADDAC(a[21], a[43]); SQRADDAC(a[22], a[42]); SQRADDAC(a[23], a[41]); SQRADDAC(a[24], a[40]); SQRADDAC(a[25], a[39]); SQRADDAC(a[26], a[38]); SQRADDAC(a[27], a[37]); SQRADDAC(a[28], a[36]); SQRADDAC(a[29], a[35]); SQRADDAC(a[30], a[34]); SQRADDAC(a[31], a[33]); SQRADDDB; SQRADD(a[32], a[32]); 
+   COMBA_STORE(b[64]);
+
+   /* output 65 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[63]); SQRADDAC(a[3], a[62]); SQRADDAC(a[4], a[61]); SQRADDAC(a[5], a[60]); SQRADDAC(a[6], a[59]); SQRADDAC(a[7], a[58]); SQRADDAC(a[8], a[57]); SQRADDAC(a[9], a[56]); SQRADDAC(a[10], a[55]); SQRADDAC(a[11], a[54]); SQRADDAC(a[12], a[53]); SQRADDAC(a[13], a[52]); SQRADDAC(a[14], a[51]); SQRADDAC(a[15], a[50]); SQRADDAC(a[16], a[49]); SQRADDAC(a[17], a[48]); SQRADDAC(a[18], a[47]); SQRADDAC(a[19], a[46]); SQRADDAC(a[20], a[45]); SQRADDAC(a[21], a[44]); SQRADDAC(a[22], a[43]); SQRADDAC(a[23], a[42]); SQRADDAC(a[24], a[41]); SQRADDAC(a[25], a[40]); SQRADDAC(a[26], a[39]); SQRADDAC(a[27], a[38]); SQRADDAC(a[28], a[37]); SQRADDAC(a[29], a[36]); SQRADDAC(a[30], a[35]); SQRADDAC(a[31], a[34]); SQRADDAC(a[32], a[33]); SQRADDDB; 
+   COMBA_STORE(b[65]);
+
+   /* output 66 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[63]); SQRADDAC(a[4], a[62]); SQRADDAC(a[5], a[61]); SQRADDAC(a[6], a[60]); SQRADDAC(a[7], a[59]); SQRADDAC(a[8], a[58]); SQRADDAC(a[9], a[57]); SQRADDAC(a[10], a[56]); SQRADDAC(a[11], a[55]); SQRADDAC(a[12], a[54]); SQRADDAC(a[13], a[53]); SQRADDAC(a[14], a[52]); SQRADDAC(a[15], a[51]); SQRADDAC(a[16], a[50]); SQRADDAC(a[17], a[49]); SQRADDAC(a[18], a[48]); SQRADDAC(a[19], a[47]); SQRADDAC(a[20], a[46]); SQRADDAC(a[21], a[45]); SQRADDAC(a[22], a[44]); SQRADDAC(a[23], a[43]); SQRADDAC(a[24], a[42]); SQRADDAC(a[25], a[41]); SQRADDAC(a[26], a[40]); SQRADDAC(a[27], a[39]); SQRADDAC(a[28], a[38]); SQRADDAC(a[29], a[37]); SQRADDAC(a[30], a[36]); SQRADDAC(a[31], a[35]); SQRADDAC(a[32], a[34]); SQRADDDB; SQRADD(a[33], a[33]); 
+   COMBA_STORE(b[66]);
+
+   /* output 67 */
+   CARRY_FORWARD;
+   SQRADDSC(a[4], a[63]); SQRADDAC(a[5], a[62]); SQRADDAC(a[6], a[61]); SQRADDAC(a[7], a[60]); SQRADDAC(a[8], a[59]); SQRADDAC(a[9], a[58]); SQRADDAC(a[10], a[57]); SQRADDAC(a[11], a[56]); SQRADDAC(a[12], a[55]); SQRADDAC(a[13], a[54]); SQRADDAC(a[14], a[53]); SQRADDAC(a[15], a[52]); SQRADDAC(a[16], a[51]); SQRADDAC(a[17], a[50]); SQRADDAC(a[18], a[49]); SQRADDAC(a[19], a[48]); SQRADDAC(a[20], a[47]); SQRADDAC(a[21], a[46]); SQRADDAC(a[22], a[45]); SQRADDAC(a[23], a[44]); SQRADDAC(a[24], a[43]); SQRADDAC(a[25], a[42]); SQRADDAC(a[26], a[41]); SQRADDAC(a[27], a[40]); SQRADDAC(a[28], a[39]); SQRADDAC(a[29], a[38]); SQRADDAC(a[30], a[37]); SQRADDAC(a[31], a[36]); SQRADDAC(a[32], a[35]); SQRADDAC(a[33], a[34]); SQRADDDB; 
+   COMBA_STORE(b[67]);
+
+   /* output 68 */
+   CARRY_FORWARD;
+   SQRADDSC(a[5], a[63]); SQRADDAC(a[6], a[62]); SQRADDAC(a[7], a[61]); SQRADDAC(a[8], a[60]); SQRADDAC(a[9], a[59]); SQRADDAC(a[10], a[58]); SQRADDAC(a[11], a[57]); SQRADDAC(a[12], a[56]); SQRADDAC(a[13], a[55]); SQRADDAC(a[14], a[54]); SQRADDAC(a[15], a[53]); SQRADDAC(a[16], a[52]); SQRADDAC(a[17], a[51]); SQRADDAC(a[18], a[50]); SQRADDAC(a[19], a[49]); SQRADDAC(a[20], a[48]); SQRADDAC(a[21], a[47]); SQRADDAC(a[22], a[46]); SQRADDAC(a[23], a[45]); SQRADDAC(a[24], a[44]); SQRADDAC(a[25], a[43]); SQRADDAC(a[26], a[42]); SQRADDAC(a[27], a[41]); SQRADDAC(a[28], a[40]); SQRADDAC(a[29], a[39]); SQRADDAC(a[30], a[38]); SQRADDAC(a[31], a[37]); SQRADDAC(a[32], a[36]); SQRADDAC(a[33], a[35]); SQRADDDB; SQRADD(a[34], a[34]); 
+   COMBA_STORE(b[68]);
+
+   /* output 69 */
+   CARRY_FORWARD;
+   SQRADDSC(a[6], a[63]); SQRADDAC(a[7], a[62]); SQRADDAC(a[8], a[61]); SQRADDAC(a[9], a[60]); SQRADDAC(a[10], a[59]); SQRADDAC(a[11], a[58]); SQRADDAC(a[12], a[57]); SQRADDAC(a[13], a[56]); SQRADDAC(a[14], a[55]); SQRADDAC(a[15], a[54]); SQRADDAC(a[16], a[53]); SQRADDAC(a[17], a[52]); SQRADDAC(a[18], a[51]); SQRADDAC(a[19], a[50]); SQRADDAC(a[20], a[49]); SQRADDAC(a[21], a[48]); SQRADDAC(a[22], a[47]); SQRADDAC(a[23], a[46]); SQRADDAC(a[24], a[45]); SQRADDAC(a[25], a[44]); SQRADDAC(a[26], a[43]); SQRADDAC(a[27], a[42]); SQRADDAC(a[28], a[41]); SQRADDAC(a[29], a[40]); SQRADDAC(a[30], a[39]); SQRADDAC(a[31], a[38]); SQRADDAC(a[32], a[37]); SQRADDAC(a[33], a[36]); SQRADDAC(a[34], a[35]); SQRADDDB; 
+   COMBA_STORE(b[69]);
+
+   /* output 70 */
+   CARRY_FORWARD;
+   SQRADDSC(a[7], a[63]); SQRADDAC(a[8], a[62]); SQRADDAC(a[9], a[61]); SQRADDAC(a[10], a[60]); SQRADDAC(a[11], a[59]); SQRADDAC(a[12], a[58]); SQRADDAC(a[13], a[57]); SQRADDAC(a[14], a[56]); SQRADDAC(a[15], a[55]); SQRADDAC(a[16], a[54]); SQRADDAC(a[17], a[53]); SQRADDAC(a[18], a[52]); SQRADDAC(a[19], a[51]); SQRADDAC(a[20], a[50]); SQRADDAC(a[21], a[49]); SQRADDAC(a[22], a[48]); SQRADDAC(a[23], a[47]); SQRADDAC(a[24], a[46]); SQRADDAC(a[25], a[45]); SQRADDAC(a[26], a[44]); SQRADDAC(a[27], a[43]); SQRADDAC(a[28], a[42]); SQRADDAC(a[29], a[41]); SQRADDAC(a[30], a[40]); SQRADDAC(a[31], a[39]); SQRADDAC(a[32], a[38]); SQRADDAC(a[33], a[37]); SQRADDAC(a[34], a[36]); SQRADDDB; SQRADD(a[35], a[35]); 
+   COMBA_STORE(b[70]);
+
+   /* output 71 */
+   CARRY_FORWARD;
+   SQRADDSC(a[8], a[63]); SQRADDAC(a[9], a[62]); SQRADDAC(a[10], a[61]); SQRADDAC(a[11], a[60]); SQRADDAC(a[12], a[59]); SQRADDAC(a[13], a[58]); SQRADDAC(a[14], a[57]); SQRADDAC(a[15], a[56]); SQRADDAC(a[16], a[55]); SQRADDAC(a[17], a[54]); SQRADDAC(a[18], a[53]); SQRADDAC(a[19], a[52]); SQRADDAC(a[20], a[51]); SQRADDAC(a[21], a[50]); SQRADDAC(a[22], a[49]); SQRADDAC(a[23], a[48]); SQRADDAC(a[24], a[47]); SQRADDAC(a[25], a[46]); SQRADDAC(a[26], a[45]); SQRADDAC(a[27], a[44]); SQRADDAC(a[28], a[43]); SQRADDAC(a[29], a[42]); SQRADDAC(a[30], a[41]); SQRADDAC(a[31], a[40]); SQRADDAC(a[32], a[39]); SQRADDAC(a[33], a[38]); SQRADDAC(a[34], a[37]); SQRADDAC(a[35], a[36]); SQRADDDB; 
+   COMBA_STORE(b[71]);
+
+   /* output 72 */
+   CARRY_FORWARD;
+   SQRADDSC(a[9], a[63]); SQRADDAC(a[10], a[62]); SQRADDAC(a[11], a[61]); SQRADDAC(a[12], a[60]); SQRADDAC(a[13], a[59]); SQRADDAC(a[14], a[58]); SQRADDAC(a[15], a[57]); SQRADDAC(a[16], a[56]); SQRADDAC(a[17], a[55]); SQRADDAC(a[18], a[54]); SQRADDAC(a[19], a[53]); SQRADDAC(a[20], a[52]); SQRADDAC(a[21], a[51]); SQRADDAC(a[22], a[50]); SQRADDAC(a[23], a[49]); SQRADDAC(a[24], a[48]); SQRADDAC(a[25], a[47]); SQRADDAC(a[26], a[46]); SQRADDAC(a[27], a[45]); SQRADDAC(a[28], a[44]); SQRADDAC(a[29], a[43]); SQRADDAC(a[30], a[42]); SQRADDAC(a[31], a[41]); SQRADDAC(a[32], a[40]); SQRADDAC(a[33], a[39]); SQRADDAC(a[34], a[38]); SQRADDAC(a[35], a[37]); SQRADDDB; SQRADD(a[36], a[36]); 
+   COMBA_STORE(b[72]);
+
+   /* output 73 */
+   CARRY_FORWARD;
+   SQRADDSC(a[10], a[63]); SQRADDAC(a[11], a[62]); SQRADDAC(a[12], a[61]); SQRADDAC(a[13], a[60]); SQRADDAC(a[14], a[59]); SQRADDAC(a[15], a[58]); SQRADDAC(a[16], a[57]); SQRADDAC(a[17], a[56]); SQRADDAC(a[18], a[55]); SQRADDAC(a[19], a[54]); SQRADDAC(a[20], a[53]); SQRADDAC(a[21], a[52]); SQRADDAC(a[22], a[51]); SQRADDAC(a[23], a[50]); SQRADDAC(a[24], a[49]); SQRADDAC(a[25], a[48]); SQRADDAC(a[26], a[47]); SQRADDAC(a[27], a[46]); SQRADDAC(a[28], a[45]); SQRADDAC(a[29], a[44]); SQRADDAC(a[30], a[43]); SQRADDAC(a[31], a[42]); SQRADDAC(a[32], a[41]); SQRADDAC(a[33], a[40]); SQRADDAC(a[34], a[39]); SQRADDAC(a[35], a[38]); SQRADDAC(a[36], a[37]); SQRADDDB; 
+   COMBA_STORE(b[73]);
+
+   /* output 74 */
+   CARRY_FORWARD;
+   SQRADDSC(a[11], a[63]); SQRADDAC(a[12], a[62]); SQRADDAC(a[13], a[61]); SQRADDAC(a[14], a[60]); SQRADDAC(a[15], a[59]); SQRADDAC(a[16], a[58]); SQRADDAC(a[17], a[57]); SQRADDAC(a[18], a[56]); SQRADDAC(a[19], a[55]); SQRADDAC(a[20], a[54]); SQRADDAC(a[21], a[53]); SQRADDAC(a[22], a[52]); SQRADDAC(a[23], a[51]); SQRADDAC(a[24], a[50]); SQRADDAC(a[25], a[49]); SQRADDAC(a[26], a[48]); SQRADDAC(a[27], a[47]); SQRADDAC(a[28], a[46]); SQRADDAC(a[29], a[45]); SQRADDAC(a[30], a[44]); SQRADDAC(a[31], a[43]); SQRADDAC(a[32], a[42]); SQRADDAC(a[33], a[41]); SQRADDAC(a[34], a[40]); SQRADDAC(a[35], a[39]); SQRADDAC(a[36], a[38]); SQRADDDB; SQRADD(a[37], a[37]); 
+   COMBA_STORE(b[74]);
+
+   /* output 75 */
+   CARRY_FORWARD;
+   SQRADDSC(a[12], a[63]); SQRADDAC(a[13], a[62]); SQRADDAC(a[14], a[61]); SQRADDAC(a[15], a[60]); SQRADDAC(a[16], a[59]); SQRADDAC(a[17], a[58]); SQRADDAC(a[18], a[57]); SQRADDAC(a[19], a[56]); SQRADDAC(a[20], a[55]); SQRADDAC(a[21], a[54]); SQRADDAC(a[22], a[53]); SQRADDAC(a[23], a[52]); SQRADDAC(a[24], a[51]); SQRADDAC(a[25], a[50]); SQRADDAC(a[26], a[49]); SQRADDAC(a[27], a[48]); SQRADDAC(a[28], a[47]); SQRADDAC(a[29], a[46]); SQRADDAC(a[30], a[45]); SQRADDAC(a[31], a[44]); SQRADDAC(a[32], a[43]); SQRADDAC(a[33], a[42]); SQRADDAC(a[34], a[41]); SQRADDAC(a[35], a[40]); SQRADDAC(a[36], a[39]); SQRADDAC(a[37], a[38]); SQRADDDB; 
+   COMBA_STORE(b[75]);
+
+   /* output 76 */
+   CARRY_FORWARD;
+   SQRADDSC(a[13], a[63]); SQRADDAC(a[14], a[62]); SQRADDAC(a[15], a[61]); SQRADDAC(a[16], a[60]); SQRADDAC(a[17], a[59]); SQRADDAC(a[18], a[58]); SQRADDAC(a[19], a[57]); SQRADDAC(a[20], a[56]); SQRADDAC(a[21], a[55]); SQRADDAC(a[22], a[54]); SQRADDAC(a[23], a[53]); SQRADDAC(a[24], a[52]); SQRADDAC(a[25], a[51]); SQRADDAC(a[26], a[50]); SQRADDAC(a[27], a[49]); SQRADDAC(a[28], a[48]); SQRADDAC(a[29], a[47]); SQRADDAC(a[30], a[46]); SQRADDAC(a[31], a[45]); SQRADDAC(a[32], a[44]); SQRADDAC(a[33], a[43]); SQRADDAC(a[34], a[42]); SQRADDAC(a[35], a[41]); SQRADDAC(a[36], a[40]); SQRADDAC(a[37], a[39]); SQRADDDB; SQRADD(a[38], a[38]); 
+   COMBA_STORE(b[76]);
+
+   /* output 77 */
+   CARRY_FORWARD;
+   SQRADDSC(a[14], a[63]); SQRADDAC(a[15], a[62]); SQRADDAC(a[16], a[61]); SQRADDAC(a[17], a[60]); SQRADDAC(a[18], a[59]); SQRADDAC(a[19], a[58]); SQRADDAC(a[20], a[57]); SQRADDAC(a[21], a[56]); SQRADDAC(a[22], a[55]); SQRADDAC(a[23], a[54]); SQRADDAC(a[24], a[53]); SQRADDAC(a[25], a[52]); SQRADDAC(a[26], a[51]); SQRADDAC(a[27], a[50]); SQRADDAC(a[28], a[49]); SQRADDAC(a[29], a[48]); SQRADDAC(a[30], a[47]); SQRADDAC(a[31], a[46]); SQRADDAC(a[32], a[45]); SQRADDAC(a[33], a[44]); SQRADDAC(a[34], a[43]); SQRADDAC(a[35], a[42]); SQRADDAC(a[36], a[41]); SQRADDAC(a[37], a[40]); SQRADDAC(a[38], a[39]); SQRADDDB; 
+   COMBA_STORE(b[77]);
+
+   /* output 78 */
+   CARRY_FORWARD;
+   SQRADDSC(a[15], a[63]); SQRADDAC(a[16], a[62]); SQRADDAC(a[17], a[61]); SQRADDAC(a[18], a[60]); SQRADDAC(a[19], a[59]); SQRADDAC(a[20], a[58]); SQRADDAC(a[21], a[57]); SQRADDAC(a[22], a[56]); SQRADDAC(a[23], a[55]); SQRADDAC(a[24], a[54]); SQRADDAC(a[25], a[53]); SQRADDAC(a[26], a[52]); SQRADDAC(a[27], a[51]); SQRADDAC(a[28], a[50]); SQRADDAC(a[29], a[49]); SQRADDAC(a[30], a[48]); SQRADDAC(a[31], a[47]); SQRADDAC(a[32], a[46]); SQRADDAC(a[33], a[45]); SQRADDAC(a[34], a[44]); SQRADDAC(a[35], a[43]); SQRADDAC(a[36], a[42]); SQRADDAC(a[37], a[41]); SQRADDAC(a[38], a[40]); SQRADDDB; SQRADD(a[39], a[39]); 
+   COMBA_STORE(b[78]);
+
+   /* output 79 */
+   CARRY_FORWARD;
+   SQRADDSC(a[16], a[63]); SQRADDAC(a[17], a[62]); SQRADDAC(a[18], a[61]); SQRADDAC(a[19], a[60]); SQRADDAC(a[20], a[59]); SQRADDAC(a[21], a[58]); SQRADDAC(a[22], a[57]); SQRADDAC(a[23], a[56]); SQRADDAC(a[24], a[55]); SQRADDAC(a[25], a[54]); SQRADDAC(a[26], a[53]); SQRADDAC(a[27], a[52]); SQRADDAC(a[28], a[51]); SQRADDAC(a[29], a[50]); SQRADDAC(a[30], a[49]); SQRADDAC(a[31], a[48]); SQRADDAC(a[32], a[47]); SQRADDAC(a[33], a[46]); SQRADDAC(a[34], a[45]); SQRADDAC(a[35], a[44]); SQRADDAC(a[36], a[43]); SQRADDAC(a[37], a[42]); SQRADDAC(a[38], a[41]); SQRADDAC(a[39], a[40]); SQRADDDB; 
+   COMBA_STORE(b[79]);
+
+   /* output 80 */
+   CARRY_FORWARD;
+   SQRADDSC(a[17], a[63]); SQRADDAC(a[18], a[62]); SQRADDAC(a[19], a[61]); SQRADDAC(a[20], a[60]); SQRADDAC(a[21], a[59]); SQRADDAC(a[22], a[58]); SQRADDAC(a[23], a[57]); SQRADDAC(a[24], a[56]); SQRADDAC(a[25], a[55]); SQRADDAC(a[26], a[54]); SQRADDAC(a[27], a[53]); SQRADDAC(a[28], a[52]); SQRADDAC(a[29], a[51]); SQRADDAC(a[30], a[50]); SQRADDAC(a[31], a[49]); SQRADDAC(a[32], a[48]); SQRADDAC(a[33], a[47]); SQRADDAC(a[34], a[46]); SQRADDAC(a[35], a[45]); SQRADDAC(a[36], a[44]); SQRADDAC(a[37], a[43]); SQRADDAC(a[38], a[42]); SQRADDAC(a[39], a[41]); SQRADDDB; SQRADD(a[40], a[40]); 
+   COMBA_STORE(b[80]);
+
+   /* output 81 */
+   CARRY_FORWARD;
+   SQRADDSC(a[18], a[63]); SQRADDAC(a[19], a[62]); SQRADDAC(a[20], a[61]); SQRADDAC(a[21], a[60]); SQRADDAC(a[22], a[59]); SQRADDAC(a[23], a[58]); SQRADDAC(a[24], a[57]); SQRADDAC(a[25], a[56]); SQRADDAC(a[26], a[55]); SQRADDAC(a[27], a[54]); SQRADDAC(a[28], a[53]); SQRADDAC(a[29], a[52]); SQRADDAC(a[30], a[51]); SQRADDAC(a[31], a[50]); SQRADDAC(a[32], a[49]); SQRADDAC(a[33], a[48]); SQRADDAC(a[34], a[47]); SQRADDAC(a[35], a[46]); SQRADDAC(a[36], a[45]); SQRADDAC(a[37], a[44]); SQRADDAC(a[38], a[43]); SQRADDAC(a[39], a[42]); SQRADDAC(a[40], a[41]); SQRADDDB; 
+   COMBA_STORE(b[81]);
+
+   /* output 82 */
+   CARRY_FORWARD;
+   SQRADDSC(a[19], a[63]); SQRADDAC(a[20], a[62]); SQRADDAC(a[21], a[61]); SQRADDAC(a[22], a[60]); SQRADDAC(a[23], a[59]); SQRADDAC(a[24], a[58]); SQRADDAC(a[25], a[57]); SQRADDAC(a[26], a[56]); SQRADDAC(a[27], a[55]); SQRADDAC(a[28], a[54]); SQRADDAC(a[29], a[53]); SQRADDAC(a[30], a[52]); SQRADDAC(a[31], a[51]); SQRADDAC(a[32], a[50]); SQRADDAC(a[33], a[49]); SQRADDAC(a[34], a[48]); SQRADDAC(a[35], a[47]); SQRADDAC(a[36], a[46]); SQRADDAC(a[37], a[45]); SQRADDAC(a[38], a[44]); SQRADDAC(a[39], a[43]); SQRADDAC(a[40], a[42]); SQRADDDB; SQRADD(a[41], a[41]); 
+   COMBA_STORE(b[82]);
+
+   /* output 83 */
+   CARRY_FORWARD;
+   SQRADDSC(a[20], a[63]); SQRADDAC(a[21], a[62]); SQRADDAC(a[22], a[61]); SQRADDAC(a[23], a[60]); SQRADDAC(a[24], a[59]); SQRADDAC(a[25], a[58]); SQRADDAC(a[26], a[57]); SQRADDAC(a[27], a[56]); SQRADDAC(a[28], a[55]); SQRADDAC(a[29], a[54]); SQRADDAC(a[30], a[53]); SQRADDAC(a[31], a[52]); SQRADDAC(a[32], a[51]); SQRADDAC(a[33], a[50]); SQRADDAC(a[34], a[49]); SQRADDAC(a[35], a[48]); SQRADDAC(a[36], a[47]); SQRADDAC(a[37], a[46]); SQRADDAC(a[38], a[45]); SQRADDAC(a[39], a[44]); SQRADDAC(a[40], a[43]); SQRADDAC(a[41], a[42]); SQRADDDB; 
+   COMBA_STORE(b[83]);
+
+   /* output 84 */
+   CARRY_FORWARD;
+   SQRADDSC(a[21], a[63]); SQRADDAC(a[22], a[62]); SQRADDAC(a[23], a[61]); SQRADDAC(a[24], a[60]); SQRADDAC(a[25], a[59]); SQRADDAC(a[26], a[58]); SQRADDAC(a[27], a[57]); SQRADDAC(a[28], a[56]); SQRADDAC(a[29], a[55]); SQRADDAC(a[30], a[54]); SQRADDAC(a[31], a[53]); SQRADDAC(a[32], a[52]); SQRADDAC(a[33], a[51]); SQRADDAC(a[34], a[50]); SQRADDAC(a[35], a[49]); SQRADDAC(a[36], a[48]); SQRADDAC(a[37], a[47]); SQRADDAC(a[38], a[46]); SQRADDAC(a[39], a[45]); SQRADDAC(a[40], a[44]); SQRADDAC(a[41], a[43]); SQRADDDB; SQRADD(a[42], a[42]); 
+   COMBA_STORE(b[84]);
+
+   /* output 85 */
+   CARRY_FORWARD;
+   SQRADDSC(a[22], a[63]); SQRADDAC(a[23], a[62]); SQRADDAC(a[24], a[61]); SQRADDAC(a[25], a[60]); SQRADDAC(a[26], a[59]); SQRADDAC(a[27], a[58]); SQRADDAC(a[28], a[57]); SQRADDAC(a[29], a[56]); SQRADDAC(a[30], a[55]); SQRADDAC(a[31], a[54]); SQRADDAC(a[32], a[53]); SQRADDAC(a[33], a[52]); SQRADDAC(a[34], a[51]); SQRADDAC(a[35], a[50]); SQRADDAC(a[36], a[49]); SQRADDAC(a[37], a[48]); SQRADDAC(a[38], a[47]); SQRADDAC(a[39], a[46]); SQRADDAC(a[40], a[45]); SQRADDAC(a[41], a[44]); SQRADDAC(a[42], a[43]); SQRADDDB; 
+   COMBA_STORE(b[85]);
+
+   /* output 86 */
+   CARRY_FORWARD;
+   SQRADDSC(a[23], a[63]); SQRADDAC(a[24], a[62]); SQRADDAC(a[25], a[61]); SQRADDAC(a[26], a[60]); SQRADDAC(a[27], a[59]); SQRADDAC(a[28], a[58]); SQRADDAC(a[29], a[57]); SQRADDAC(a[30], a[56]); SQRADDAC(a[31], a[55]); SQRADDAC(a[32], a[54]); SQRADDAC(a[33], a[53]); SQRADDAC(a[34], a[52]); SQRADDAC(a[35], a[51]); SQRADDAC(a[36], a[50]); SQRADDAC(a[37], a[49]); SQRADDAC(a[38], a[48]); SQRADDAC(a[39], a[47]); SQRADDAC(a[40], a[46]); SQRADDAC(a[41], a[45]); SQRADDAC(a[42], a[44]); SQRADDDB; SQRADD(a[43], a[43]); 
+   COMBA_STORE(b[86]);
+
+   /* output 87 */
+   CARRY_FORWARD;
+   SQRADDSC(a[24], a[63]); SQRADDAC(a[25], a[62]); SQRADDAC(a[26], a[61]); SQRADDAC(a[27], a[60]); SQRADDAC(a[28], a[59]); SQRADDAC(a[29], a[58]); SQRADDAC(a[30], a[57]); SQRADDAC(a[31], a[56]); SQRADDAC(a[32], a[55]); SQRADDAC(a[33], a[54]); SQRADDAC(a[34], a[53]); SQRADDAC(a[35], a[52]); SQRADDAC(a[36], a[51]); SQRADDAC(a[37], a[50]); SQRADDAC(a[38], a[49]); SQRADDAC(a[39], a[48]); SQRADDAC(a[40], a[47]); SQRADDAC(a[41], a[46]); SQRADDAC(a[42], a[45]); SQRADDAC(a[43], a[44]); SQRADDDB; 
+   COMBA_STORE(b[87]);
+
+   /* output 88 */
+   CARRY_FORWARD;
+   SQRADDSC(a[25], a[63]); SQRADDAC(a[26], a[62]); SQRADDAC(a[27], a[61]); SQRADDAC(a[28], a[60]); SQRADDAC(a[29], a[59]); SQRADDAC(a[30], a[58]); SQRADDAC(a[31], a[57]); SQRADDAC(a[32], a[56]); SQRADDAC(a[33], a[55]); SQRADDAC(a[34], a[54]); SQRADDAC(a[35], a[53]); SQRADDAC(a[36], a[52]); SQRADDAC(a[37], a[51]); SQRADDAC(a[38], a[50]); SQRADDAC(a[39], a[49]); SQRADDAC(a[40], a[48]); SQRADDAC(a[41], a[47]); SQRADDAC(a[42], a[46]); SQRADDAC(a[43], a[45]); SQRADDDB; SQRADD(a[44], a[44]); 
+   COMBA_STORE(b[88]);
+
+   /* output 89 */
+   CARRY_FORWARD;
+   SQRADDSC(a[26], a[63]); SQRADDAC(a[27], a[62]); SQRADDAC(a[28], a[61]); SQRADDAC(a[29], a[60]); SQRADDAC(a[30], a[59]); SQRADDAC(a[31], a[58]); SQRADDAC(a[32], a[57]); SQRADDAC(a[33], a[56]); SQRADDAC(a[34], a[55]); SQRADDAC(a[35], a[54]); SQRADDAC(a[36], a[53]); SQRADDAC(a[37], a[52]); SQRADDAC(a[38], a[51]); SQRADDAC(a[39], a[50]); SQRADDAC(a[40], a[49]); SQRADDAC(a[41], a[48]); SQRADDAC(a[42], a[47]); SQRADDAC(a[43], a[46]); SQRADDAC(a[44], a[45]); SQRADDDB; 
+   COMBA_STORE(b[89]);
+
+   /* output 90 */
+   CARRY_FORWARD;
+   SQRADDSC(a[27], a[63]); SQRADDAC(a[28], a[62]); SQRADDAC(a[29], a[61]); SQRADDAC(a[30], a[60]); SQRADDAC(a[31], a[59]); SQRADDAC(a[32], a[58]); SQRADDAC(a[33], a[57]); SQRADDAC(a[34], a[56]); SQRADDAC(a[35], a[55]); SQRADDAC(a[36], a[54]); SQRADDAC(a[37], a[53]); SQRADDAC(a[38], a[52]); SQRADDAC(a[39], a[51]); SQRADDAC(a[40], a[50]); SQRADDAC(a[41], a[49]); SQRADDAC(a[42], a[48]); SQRADDAC(a[43], a[47]); SQRADDAC(a[44], a[46]); SQRADDDB; SQRADD(a[45], a[45]); 
+   COMBA_STORE(b[90]);
+
+   /* output 91 */
+   CARRY_FORWARD;
+   SQRADDSC(a[28], a[63]); SQRADDAC(a[29], a[62]); SQRADDAC(a[30], a[61]); SQRADDAC(a[31], a[60]); SQRADDAC(a[32], a[59]); SQRADDAC(a[33], a[58]); SQRADDAC(a[34], a[57]); SQRADDAC(a[35], a[56]); SQRADDAC(a[36], a[55]); SQRADDAC(a[37], a[54]); SQRADDAC(a[38], a[53]); SQRADDAC(a[39], a[52]); SQRADDAC(a[40], a[51]); SQRADDAC(a[41], a[50]); SQRADDAC(a[42], a[49]); SQRADDAC(a[43], a[48]); SQRADDAC(a[44], a[47]); SQRADDAC(a[45], a[46]); SQRADDDB; 
+   COMBA_STORE(b[91]);
+
+   /* output 92 */
+   CARRY_FORWARD;
+   SQRADDSC(a[29], a[63]); SQRADDAC(a[30], a[62]); SQRADDAC(a[31], a[61]); SQRADDAC(a[32], a[60]); SQRADDAC(a[33], a[59]); SQRADDAC(a[34], a[58]); SQRADDAC(a[35], a[57]); SQRADDAC(a[36], a[56]); SQRADDAC(a[37], a[55]); SQRADDAC(a[38], a[54]); SQRADDAC(a[39], a[53]); SQRADDAC(a[40], a[52]); SQRADDAC(a[41], a[51]); SQRADDAC(a[42], a[50]); SQRADDAC(a[43], a[49]); SQRADDAC(a[44], a[48]); SQRADDAC(a[45], a[47]); SQRADDDB; SQRADD(a[46], a[46]); 
+   COMBA_STORE(b[92]);
+
+   /* output 93 */
+   CARRY_FORWARD;
+   SQRADDSC(a[30], a[63]); SQRADDAC(a[31], a[62]); SQRADDAC(a[32], a[61]); SQRADDAC(a[33], a[60]); SQRADDAC(a[34], a[59]); SQRADDAC(a[35], a[58]); SQRADDAC(a[36], a[57]); SQRADDAC(a[37], a[56]); SQRADDAC(a[38], a[55]); SQRADDAC(a[39], a[54]); SQRADDAC(a[40], a[53]); SQRADDAC(a[41], a[52]); SQRADDAC(a[42], a[51]); SQRADDAC(a[43], a[50]); SQRADDAC(a[44], a[49]); SQRADDAC(a[45], a[48]); SQRADDAC(a[46], a[47]); SQRADDDB; 
+   COMBA_STORE(b[93]);
+
+   /* output 94 */
+   CARRY_FORWARD;
+   SQRADDSC(a[31], a[63]); SQRADDAC(a[32], a[62]); SQRADDAC(a[33], a[61]); SQRADDAC(a[34], a[60]); SQRADDAC(a[35], a[59]); SQRADDAC(a[36], a[58]); SQRADDAC(a[37], a[57]); SQRADDAC(a[38], a[56]); SQRADDAC(a[39], a[55]); SQRADDAC(a[40], a[54]); SQRADDAC(a[41], a[53]); SQRADDAC(a[42], a[52]); SQRADDAC(a[43], a[51]); SQRADDAC(a[44], a[50]); SQRADDAC(a[45], a[49]); SQRADDAC(a[46], a[48]); SQRADDDB; SQRADD(a[47], a[47]); 
+   COMBA_STORE(b[94]);
+
+   /* output 95 */
+   CARRY_FORWARD;
+   SQRADDSC(a[32], a[63]); SQRADDAC(a[33], a[62]); SQRADDAC(a[34], a[61]); SQRADDAC(a[35], a[60]); SQRADDAC(a[36], a[59]); SQRADDAC(a[37], a[58]); SQRADDAC(a[38], a[57]); SQRADDAC(a[39], a[56]); SQRADDAC(a[40], a[55]); SQRADDAC(a[41], a[54]); SQRADDAC(a[42], a[53]); SQRADDAC(a[43], a[52]); SQRADDAC(a[44], a[51]); SQRADDAC(a[45], a[50]); SQRADDAC(a[46], a[49]); SQRADDAC(a[47], a[48]); SQRADDDB; 
+   COMBA_STORE(b[95]);
+
+   /* output 96 */
+   CARRY_FORWARD;
+   SQRADDSC(a[33], a[63]); SQRADDAC(a[34], a[62]); SQRADDAC(a[35], a[61]); SQRADDAC(a[36], a[60]); SQRADDAC(a[37], a[59]); SQRADDAC(a[38], a[58]); SQRADDAC(a[39], a[57]); SQRADDAC(a[40], a[56]); SQRADDAC(a[41], a[55]); SQRADDAC(a[42], a[54]); SQRADDAC(a[43], a[53]); SQRADDAC(a[44], a[52]); SQRADDAC(a[45], a[51]); SQRADDAC(a[46], a[50]); SQRADDAC(a[47], a[49]); SQRADDDB; SQRADD(a[48], a[48]); 
+   COMBA_STORE(b[96]);
+
+   /* output 97 */
+   CARRY_FORWARD;
+   SQRADDSC(a[34], a[63]); SQRADDAC(a[35], a[62]); SQRADDAC(a[36], a[61]); SQRADDAC(a[37], a[60]); SQRADDAC(a[38], a[59]); SQRADDAC(a[39], a[58]); SQRADDAC(a[40], a[57]); SQRADDAC(a[41], a[56]); SQRADDAC(a[42], a[55]); SQRADDAC(a[43], a[54]); SQRADDAC(a[44], a[53]); SQRADDAC(a[45], a[52]); SQRADDAC(a[46], a[51]); SQRADDAC(a[47], a[50]); SQRADDAC(a[48], a[49]); SQRADDDB; 
+   COMBA_STORE(b[97]);
+
+   /* output 98 */
+   CARRY_FORWARD;
+   SQRADDSC(a[35], a[63]); SQRADDAC(a[36], a[62]); SQRADDAC(a[37], a[61]); SQRADDAC(a[38], a[60]); SQRADDAC(a[39], a[59]); SQRADDAC(a[40], a[58]); SQRADDAC(a[41], a[57]); SQRADDAC(a[42], a[56]); SQRADDAC(a[43], a[55]); SQRADDAC(a[44], a[54]); SQRADDAC(a[45], a[53]); SQRADDAC(a[46], a[52]); SQRADDAC(a[47], a[51]); SQRADDAC(a[48], a[50]); SQRADDDB; SQRADD(a[49], a[49]); 
+   COMBA_STORE(b[98]);
+
+   /* output 99 */
+   CARRY_FORWARD;
+   SQRADDSC(a[36], a[63]); SQRADDAC(a[37], a[62]); SQRADDAC(a[38], a[61]); SQRADDAC(a[39], a[60]); SQRADDAC(a[40], a[59]); SQRADDAC(a[41], a[58]); SQRADDAC(a[42], a[57]); SQRADDAC(a[43], a[56]); SQRADDAC(a[44], a[55]); SQRADDAC(a[45], a[54]); SQRADDAC(a[46], a[53]); SQRADDAC(a[47], a[52]); SQRADDAC(a[48], a[51]); SQRADDAC(a[49], a[50]); SQRADDDB; 
+   COMBA_STORE(b[99]);
+
+   /* output 100 */
+   CARRY_FORWARD;
+   SQRADDSC(a[37], a[63]); SQRADDAC(a[38], a[62]); SQRADDAC(a[39], a[61]); SQRADDAC(a[40], a[60]); SQRADDAC(a[41], a[59]); SQRADDAC(a[42], a[58]); SQRADDAC(a[43], a[57]); SQRADDAC(a[44], a[56]); SQRADDAC(a[45], a[55]); SQRADDAC(a[46], a[54]); SQRADDAC(a[47], a[53]); SQRADDAC(a[48], a[52]); SQRADDAC(a[49], a[51]); SQRADDDB; SQRADD(a[50], a[50]); 
+   COMBA_STORE(b[100]);
+
+   /* output 101 */
+   CARRY_FORWARD;
+   SQRADDSC(a[38], a[63]); SQRADDAC(a[39], a[62]); SQRADDAC(a[40], a[61]); SQRADDAC(a[41], a[60]); SQRADDAC(a[42], a[59]); SQRADDAC(a[43], a[58]); SQRADDAC(a[44], a[57]); SQRADDAC(a[45], a[56]); SQRADDAC(a[46], a[55]); SQRADDAC(a[47], a[54]); SQRADDAC(a[48], a[53]); SQRADDAC(a[49], a[52]); SQRADDAC(a[50], a[51]); SQRADDDB; 
+   COMBA_STORE(b[101]);
+
+   /* output 102 */
+   CARRY_FORWARD;
+   SQRADDSC(a[39], a[63]); SQRADDAC(a[40], a[62]); SQRADDAC(a[41], a[61]); SQRADDAC(a[42], a[60]); SQRADDAC(a[43], a[59]); SQRADDAC(a[44], a[58]); SQRADDAC(a[45], a[57]); SQRADDAC(a[46], a[56]); SQRADDAC(a[47], a[55]); SQRADDAC(a[48], a[54]); SQRADDAC(a[49], a[53]); SQRADDAC(a[50], a[52]); SQRADDDB; SQRADD(a[51], a[51]); 
+   COMBA_STORE(b[102]);
+
+   /* output 103 */
+   CARRY_FORWARD;
+   SQRADDSC(a[40], a[63]); SQRADDAC(a[41], a[62]); SQRADDAC(a[42], a[61]); SQRADDAC(a[43], a[60]); SQRADDAC(a[44], a[59]); SQRADDAC(a[45], a[58]); SQRADDAC(a[46], a[57]); SQRADDAC(a[47], a[56]); SQRADDAC(a[48], a[55]); SQRADDAC(a[49], a[54]); SQRADDAC(a[50], a[53]); SQRADDAC(a[51], a[52]); SQRADDDB; 
+   COMBA_STORE(b[103]);
+
+   /* output 104 */
+   CARRY_FORWARD;
+   SQRADDSC(a[41], a[63]); SQRADDAC(a[42], a[62]); SQRADDAC(a[43], a[61]); SQRADDAC(a[44], a[60]); SQRADDAC(a[45], a[59]); SQRADDAC(a[46], a[58]); SQRADDAC(a[47], a[57]); SQRADDAC(a[48], a[56]); SQRADDAC(a[49], a[55]); SQRADDAC(a[50], a[54]); SQRADDAC(a[51], a[53]); SQRADDDB; SQRADD(a[52], a[52]); 
+   COMBA_STORE(b[104]);
+
+   /* output 105 */
+   CARRY_FORWARD;
+   SQRADDSC(a[42], a[63]); SQRADDAC(a[43], a[62]); SQRADDAC(a[44], a[61]); SQRADDAC(a[45], a[60]); SQRADDAC(a[46], a[59]); SQRADDAC(a[47], a[58]); SQRADDAC(a[48], a[57]); SQRADDAC(a[49], a[56]); SQRADDAC(a[50], a[55]); SQRADDAC(a[51], a[54]); SQRADDAC(a[52], a[53]); SQRADDDB; 
+   COMBA_STORE(b[105]);
+
+   /* output 106 */
+   CARRY_FORWARD;
+   SQRADDSC(a[43], a[63]); SQRADDAC(a[44], a[62]); SQRADDAC(a[45], a[61]); SQRADDAC(a[46], a[60]); SQRADDAC(a[47], a[59]); SQRADDAC(a[48], a[58]); SQRADDAC(a[49], a[57]); SQRADDAC(a[50], a[56]); SQRADDAC(a[51], a[55]); SQRADDAC(a[52], a[54]); SQRADDDB; SQRADD(a[53], a[53]); 
+   COMBA_STORE(b[106]);
+
+   /* output 107 */
+   CARRY_FORWARD;
+   SQRADDSC(a[44], a[63]); SQRADDAC(a[45], a[62]); SQRADDAC(a[46], a[61]); SQRADDAC(a[47], a[60]); SQRADDAC(a[48], a[59]); SQRADDAC(a[49], a[58]); SQRADDAC(a[50], a[57]); SQRADDAC(a[51], a[56]); SQRADDAC(a[52], a[55]); SQRADDAC(a[53], a[54]); SQRADDDB; 
+   COMBA_STORE(b[107]);
+
+   /* output 108 */
+   CARRY_FORWARD;
+   SQRADDSC(a[45], a[63]); SQRADDAC(a[46], a[62]); SQRADDAC(a[47], a[61]); SQRADDAC(a[48], a[60]); SQRADDAC(a[49], a[59]); SQRADDAC(a[50], a[58]); SQRADDAC(a[51], a[57]); SQRADDAC(a[52], a[56]); SQRADDAC(a[53], a[55]); SQRADDDB; SQRADD(a[54], a[54]); 
+   COMBA_STORE(b[108]);
+
+   /* output 109 */
+   CARRY_FORWARD;
+   SQRADDSC(a[46], a[63]); SQRADDAC(a[47], a[62]); SQRADDAC(a[48], a[61]); SQRADDAC(a[49], a[60]); SQRADDAC(a[50], a[59]); SQRADDAC(a[51], a[58]); SQRADDAC(a[52], a[57]); SQRADDAC(a[53], a[56]); SQRADDAC(a[54], a[55]); SQRADDDB; 
+   COMBA_STORE(b[109]);
+
+   /* output 110 */
+   CARRY_FORWARD;
+   SQRADDSC(a[47], a[63]); SQRADDAC(a[48], a[62]); SQRADDAC(a[49], a[61]); SQRADDAC(a[50], a[60]); SQRADDAC(a[51], a[59]); SQRADDAC(a[52], a[58]); SQRADDAC(a[53], a[57]); SQRADDAC(a[54], a[56]); SQRADDDB; SQRADD(a[55], a[55]); 
+   COMBA_STORE(b[110]);
+
+   /* output 111 */
+   CARRY_FORWARD;
+   SQRADDSC(a[48], a[63]); SQRADDAC(a[49], a[62]); SQRADDAC(a[50], a[61]); SQRADDAC(a[51], a[60]); SQRADDAC(a[52], a[59]); SQRADDAC(a[53], a[58]); SQRADDAC(a[54], a[57]); SQRADDAC(a[55], a[56]); SQRADDDB; 
+   COMBA_STORE(b[111]);
+
+   /* output 112 */
+   CARRY_FORWARD;
+   SQRADDSC(a[49], a[63]); SQRADDAC(a[50], a[62]); SQRADDAC(a[51], a[61]); SQRADDAC(a[52], a[60]); SQRADDAC(a[53], a[59]); SQRADDAC(a[54], a[58]); SQRADDAC(a[55], a[57]); SQRADDDB; SQRADD(a[56], a[56]); 
+   COMBA_STORE(b[112]);
+
+   /* output 113 */
+   CARRY_FORWARD;
+   SQRADDSC(a[50], a[63]); SQRADDAC(a[51], a[62]); SQRADDAC(a[52], a[61]); SQRADDAC(a[53], a[60]); SQRADDAC(a[54], a[59]); SQRADDAC(a[55], a[58]); SQRADDAC(a[56], a[57]); SQRADDDB; 
+   COMBA_STORE(b[113]);
+
+   /* output 114 */
+   CARRY_FORWARD;
+   SQRADDSC(a[51], a[63]); SQRADDAC(a[52], a[62]); SQRADDAC(a[53], a[61]); SQRADDAC(a[54], a[60]); SQRADDAC(a[55], a[59]); SQRADDAC(a[56], a[58]); SQRADDDB; SQRADD(a[57], a[57]); 
+   COMBA_STORE(b[114]);
+
+   /* output 115 */
+   CARRY_FORWARD;
+   SQRADDSC(a[52], a[63]); SQRADDAC(a[53], a[62]); SQRADDAC(a[54], a[61]); SQRADDAC(a[55], a[60]); SQRADDAC(a[56], a[59]); SQRADDAC(a[57], a[58]); SQRADDDB; 
+   COMBA_STORE(b[115]);
+
+   /* output 116 */
+   CARRY_FORWARD;
+   SQRADDSC(a[53], a[63]); SQRADDAC(a[54], a[62]); SQRADDAC(a[55], a[61]); SQRADDAC(a[56], a[60]); SQRADDAC(a[57], a[59]); SQRADDDB; SQRADD(a[58], a[58]); 
+   COMBA_STORE(b[116]);
+
+   /* output 117 */
+   CARRY_FORWARD;
+   SQRADDSC(a[54], a[63]); SQRADDAC(a[55], a[62]); SQRADDAC(a[56], a[61]); SQRADDAC(a[57], a[60]); SQRADDAC(a[58], a[59]); SQRADDDB; 
+   COMBA_STORE(b[117]);
+
+   /* output 118 */
+   CARRY_FORWARD;
+   SQRADDSC(a[55], a[63]); SQRADDAC(a[56], a[62]); SQRADDAC(a[57], a[61]); SQRADDAC(a[58], a[60]); SQRADDDB; SQRADD(a[59], a[59]); 
+   COMBA_STORE(b[118]);
+
+   /* output 119 */
+   CARRY_FORWARD;
+   SQRADDSC(a[56], a[63]); SQRADDAC(a[57], a[62]); SQRADDAC(a[58], a[61]); SQRADDAC(a[59], a[60]); SQRADDDB; 
+   COMBA_STORE(b[119]);
+
+   /* output 120 */
+   CARRY_FORWARD;
+   SQRADDSC(a[57], a[63]); SQRADDAC(a[58], a[62]); SQRADDAC(a[59], a[61]); SQRADDDB; SQRADD(a[60], a[60]); 
+   COMBA_STORE(b[120]);
+
+   /* output 121 */
+   CARRY_FORWARD;
+   SQRADDSC(a[58], a[63]); SQRADDAC(a[59], a[62]); SQRADDAC(a[60], a[61]); SQRADDDB; 
+   COMBA_STORE(b[121]);
+
+   /* output 122 */
+   CARRY_FORWARD;
+   SQRADD2(a[59], a[63]); SQRADD2(a[60], a[62]); SQRADD(a[61], a[61]); 
+   COMBA_STORE(b[122]);
+
+   /* output 123 */
+   CARRY_FORWARD;
+   SQRADD2(a[60], a[63]); SQRADD2(a[61], a[62]); 
+   COMBA_STORE(b[123]);
+
+   /* output 124 */
+   CARRY_FORWARD;
+   SQRADD2(a[61], a[63]); SQRADD(a[62], a[62]); 
+   COMBA_STORE(b[124]);
+
+   /* output 125 */
+   CARRY_FORWARD;
+   SQRADD2(a[62], a[63]); 
+   COMBA_STORE(b[125]);
+
+   /* output 126 */
+   CARRY_FORWARD;
+   SQRADD(a[63], a[63]); 
+   COMBA_STORE(b[126]);
+   COMBA_STORE2(b[127]);
+   COMBA_FINI;
+
+   B->used = 128;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 128 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_7.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_7.i
new file mode 100644 (file)
index 0000000..1d620fc
--- /dev/null
@@ -0,0 +1,107 @@
+/* fp_sqr_comba_7.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR7
+void fp_sqr_comba7(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[14], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADD2(a[2], a[6]); SQRADD2(a[3], a[5]); SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADD2(a[3], a[6]); SQRADD2(a[4], a[5]); 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADD2(a[4], a[6]); SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADD2(a[5], a[6]); 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+   COMBA_STORE2(b[13]);
+   COMBA_FINI;
+
+   B->used = 14;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 14 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_8.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_8.i
new file mode 100644 (file)
index 0000000..7d7e58f
--- /dev/null
@@ -0,0 +1,117 @@
+/* fp_sqr_comba_8.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR8
+void fp_sqr_comba8(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADD2(a[3], a[7]); SQRADD2(a[4], a[6]); SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADD2(a[4], a[7]); SQRADD2(a[5], a[6]); 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADD2(a[5], a[7]); SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADD2(a[6], a[7]); 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+   COMBA_STORE2(b[15]);
+   COMBA_FINI;
+
+   B->used = 16;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 16 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_9.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_9.i
new file mode 100644 (file)
index 0000000..f0b04b6
--- /dev/null
@@ -0,0 +1,127 @@
+/* fp_sqr_comba_9.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef TFM_SQR9
+void fp_sqr_comba9(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[18], c0, c1, c2, sc0, sc1, sc2;
+
+   a = A->dp;
+   COMBA_START; 
+
+   /* clear carries */
+   CLEAR_CARRY;
+
+   /* output 0 */
+   SQRADD(a[0],a[0]);
+   COMBA_STORE(b[0]);
+
+   /* output 1 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[1]); 
+   COMBA_STORE(b[1]);
+
+   /* output 2 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[2]); SQRADD(a[1], a[1]); 
+   COMBA_STORE(b[2]);
+
+   /* output 3 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[3]); SQRADD2(a[1], a[2]); 
+   COMBA_STORE(b[3]);
+
+   /* output 4 */
+   CARRY_FORWARD;
+   SQRADD2(a[0], a[4]); SQRADD2(a[1], a[3]); SQRADD(a[2], a[2]); 
+   COMBA_STORE(b[4]);
+
+   /* output 5 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+   COMBA_STORE(b[5]);
+
+   /* output 6 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+   COMBA_STORE(b[6]);
+
+   /* output 7 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+   COMBA_STORE(b[7]);
+
+   /* output 8 */
+   CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+   COMBA_STORE(b[8]);
+
+   /* output 9 */
+   CARRY_FORWARD;
+   SQRADDSC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+   COMBA_STORE(b[9]);
+
+   /* output 10 */
+   CARRY_FORWARD;
+   SQRADDSC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+   COMBA_STORE(b[10]);
+
+   /* output 11 */
+   CARRY_FORWARD;
+   SQRADDSC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+   COMBA_STORE(b[11]);
+
+   /* output 12 */
+   CARRY_FORWARD;
+   SQRADD2(a[4], a[8]); SQRADD2(a[5], a[7]); SQRADD(a[6], a[6]); 
+   COMBA_STORE(b[12]);
+
+   /* output 13 */
+   CARRY_FORWARD;
+   SQRADD2(a[5], a[8]); SQRADD2(a[6], a[7]); 
+   COMBA_STORE(b[13]);
+
+   /* output 14 */
+   CARRY_FORWARD;
+   SQRADD2(a[6], a[8]); SQRADD(a[7], a[7]); 
+   COMBA_STORE(b[14]);
+
+   /* output 15 */
+   CARRY_FORWARD;
+   SQRADD2(a[7], a[8]); 
+   COMBA_STORE(b[15]);
+
+   /* output 16 */
+   CARRY_FORWARD;
+   SQRADD(a[8], a[8]); 
+   COMBA_STORE(b[16]);
+   COMBA_STORE2(b[17]);
+   COMBA_FINI;
+
+   B->used = 18;
+   B->sign = FP_ZPOS;
+   memcpy(B->dp, b, 18 * sizeof(fp_digit));
+   fp_clamp(B);
+}
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_small_set.i b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/fp_sqr_comba_small_set.i
new file mode 100644 (file)
index 0000000..140c436
--- /dev/null
@@ -0,0 +1,1540 @@
+/* fp_sqr_comba_small_set.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#if defined(TFM_SMALL_SET)
+void fp_sqr_comba_small(fp_int *A, fp_int *B)
+{
+   fp_digit *a, b[32], c0, c1, c2, sc0, sc1, sc2;
+#ifdef TFM_ISO
+   fp_word   tt;   
+#endif   
+   switch (A->used) { 
+   case 1:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+      COMBA_STORE2(b[1]);
+      COMBA_FINI;
+
+      B->used = 2;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 2 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 2:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+      COMBA_STORE2(b[3]);
+      COMBA_FINI;
+
+      B->used = 4;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 4 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 3:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+      COMBA_STORE2(b[5]);
+      COMBA_FINI;
+
+      B->used = 6;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 6 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 4:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+      SQRADD2(a[2], a[3]); 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+      SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+      COMBA_STORE2(b[7]);
+      COMBA_FINI;
+
+      B->used = 8;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 8 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 5:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+      SQRADD2(a[1], a[4]);    SQRADD2(a[2], a[3]); 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+      SQRADD2(a[2], a[4]);    SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+      SQRADD2(a[3], a[4]); 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+      SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+      COMBA_STORE2(b[9]);
+      COMBA_FINI;
+
+      B->used = 10;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 10 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 6:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+      SQRADD2(a[1], a[5]);    SQRADD2(a[2], a[4]);    SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+      SQRADD2(a[2], a[5]);    SQRADD2(a[3], a[4]); 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+      SQRADD2(a[3], a[5]);    SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+      SQRADD2(a[4], a[5]); 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+      SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+      COMBA_STORE2(b[11]);
+      COMBA_FINI;
+
+      B->used = 12;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 12 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 7:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+      SQRADD2(a[2], a[6]);    SQRADD2(a[3], a[5]);    SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+      SQRADD2(a[3], a[6]);    SQRADD2(a[4], a[5]); 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+      SQRADD2(a[4], a[6]);    SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+      SQRADD2(a[5], a[6]); 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+      SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+      COMBA_STORE2(b[13]);
+      COMBA_FINI;
+
+      B->used = 14;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 14 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 8:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+      SQRADD2(a[3], a[7]);    SQRADD2(a[4], a[6]);    SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+      SQRADD2(a[4], a[7]);    SQRADD2(a[5], a[6]); 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+      SQRADD2(a[5], a[7]);    SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+      SQRADD2(a[6], a[7]); 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+      SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+      COMBA_STORE2(b[15]);
+      COMBA_FINI;
+
+      B->used = 16;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 16 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 9:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+      SQRADD2(a[4], a[8]);    SQRADD2(a[5], a[7]);    SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+      SQRADD2(a[5], a[8]);    SQRADD2(a[6], a[7]); 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+      SQRADD2(a[6], a[8]);    SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+      SQRADD2(a[7], a[8]); 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+      SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+      COMBA_STORE2(b[17]);
+      COMBA_FINI;
+
+      B->used = 18;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 18 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 10:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+      SQRADD2(a[5], a[9]);    SQRADD2(a[6], a[8]);    SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+      SQRADD2(a[6], a[9]);    SQRADD2(a[7], a[8]); 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+      SQRADD2(a[7], a[9]);    SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+      SQRADD2(a[8], a[9]); 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+      SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+      COMBA_STORE2(b[19]);
+      COMBA_FINI;
+
+      B->used = 20;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 20 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 11:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+      SQRADD2(a[6], a[10]);    SQRADD2(a[7], a[9]);    SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+      SQRADD2(a[7], a[10]);    SQRADD2(a[8], a[9]); 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+      SQRADD2(a[8], a[10]);    SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+      SQRADD2(a[9], a[10]); 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+      SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+      COMBA_STORE2(b[21]);
+      COMBA_FINI;
+
+      B->used = 22;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 22 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 12:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+   SQRADDSC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+      SQRADD2(a[7], a[11]);    SQRADD2(a[8], a[10]);    SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+      SQRADD2(a[8], a[11]);    SQRADD2(a[9], a[10]); 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+      SQRADD2(a[9], a[11]);    SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+
+      /* output 21 */
+      CARRY_FORWARD;
+      SQRADD2(a[10], a[11]); 
+      COMBA_STORE(b[21]);
+
+      /* output 22 */
+      CARRY_FORWARD;
+      SQRADD(a[11], a[11]); 
+      COMBA_STORE(b[22]);
+      COMBA_STORE2(b[23]);
+      COMBA_FINI;
+
+      B->used = 24;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 24 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 13:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+   SQRADDSC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+   SQRADDSC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+      SQRADD2(a[8], a[12]);    SQRADD2(a[9], a[11]);    SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+
+      /* output 21 */
+      CARRY_FORWARD;
+      SQRADD2(a[9], a[12]);    SQRADD2(a[10], a[11]); 
+      COMBA_STORE(b[21]);
+
+      /* output 22 */
+      CARRY_FORWARD;
+      SQRADD2(a[10], a[12]);    SQRADD(a[11], a[11]); 
+      COMBA_STORE(b[22]);
+
+      /* output 23 */
+      CARRY_FORWARD;
+      SQRADD2(a[11], a[12]); 
+      COMBA_STORE(b[23]);
+
+      /* output 24 */
+      CARRY_FORWARD;
+      SQRADD(a[12], a[12]); 
+      COMBA_STORE(b[24]);
+      COMBA_STORE2(b[25]);
+      COMBA_FINI;
+
+      B->used = 26;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 26 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 14:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+   SQRADDSC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+   SQRADDSC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+
+      /* output 21 */
+      CARRY_FORWARD;
+   SQRADDSC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+      COMBA_STORE(b[21]);
+
+      /* output 22 */
+      CARRY_FORWARD;
+      SQRADD2(a[9], a[13]);    SQRADD2(a[10], a[12]);    SQRADD(a[11], a[11]); 
+      COMBA_STORE(b[22]);
+
+      /* output 23 */
+      CARRY_FORWARD;
+      SQRADD2(a[10], a[13]);    SQRADD2(a[11], a[12]); 
+      COMBA_STORE(b[23]);
+
+      /* output 24 */
+      CARRY_FORWARD;
+      SQRADD2(a[11], a[13]);    SQRADD(a[12], a[12]); 
+      COMBA_STORE(b[24]);
+
+      /* output 25 */
+      CARRY_FORWARD;
+      SQRADD2(a[12], a[13]); 
+      COMBA_STORE(b[25]);
+
+      /* output 26 */
+      CARRY_FORWARD;
+      SQRADD(a[13], a[13]); 
+      COMBA_STORE(b[26]);
+      COMBA_STORE2(b[27]);
+      COMBA_FINI;
+
+      B->used = 28;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 28 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 15:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+   SQRADDSC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+
+      /* output 21 */
+      CARRY_FORWARD;
+   SQRADDSC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+      COMBA_STORE(b[21]);
+
+      /* output 22 */
+      CARRY_FORWARD;
+   SQRADDSC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+      COMBA_STORE(b[22]);
+
+      /* output 23 */
+      CARRY_FORWARD;
+   SQRADDSC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+      COMBA_STORE(b[23]);
+
+      /* output 24 */
+      CARRY_FORWARD;
+      SQRADD2(a[10], a[14]);    SQRADD2(a[11], a[13]);    SQRADD(a[12], a[12]); 
+      COMBA_STORE(b[24]);
+
+      /* output 25 */
+      CARRY_FORWARD;
+      SQRADD2(a[11], a[14]);    SQRADD2(a[12], a[13]); 
+      COMBA_STORE(b[25]);
+
+      /* output 26 */
+      CARRY_FORWARD;
+      SQRADD2(a[12], a[14]);    SQRADD(a[13], a[13]); 
+      COMBA_STORE(b[26]);
+
+      /* output 27 */
+      CARRY_FORWARD;
+      SQRADD2(a[13], a[14]); 
+      COMBA_STORE(b[27]);
+
+      /* output 28 */
+      CARRY_FORWARD;
+      SQRADD(a[14], a[14]); 
+      COMBA_STORE(b[28]);
+      COMBA_STORE2(b[29]);
+      COMBA_FINI;
+
+      B->used = 30;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 30 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   case 16:
+      a = A->dp;
+      COMBA_START; 
+
+      /* clear carries */
+      CLEAR_CARRY;
+
+      /* output 0 */
+      SQRADD(a[0],a[0]);
+      COMBA_STORE(b[0]);
+
+      /* output 1 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[1]); 
+      COMBA_STORE(b[1]);
+
+      /* output 2 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[2]);    SQRADD(a[1], a[1]); 
+      COMBA_STORE(b[2]);
+
+      /* output 3 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[3]);    SQRADD2(a[1], a[2]); 
+      COMBA_STORE(b[3]);
+
+      /* output 4 */
+      CARRY_FORWARD;
+      SQRADD2(a[0], a[4]);    SQRADD2(a[1], a[3]);    SQRADD(a[2], a[2]); 
+      COMBA_STORE(b[4]);
+
+      /* output 5 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[5]); SQRADDAC(a[1], a[4]); SQRADDAC(a[2], a[3]); SQRADDDB; 
+      COMBA_STORE(b[5]);
+
+      /* output 6 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[6]); SQRADDAC(a[1], a[5]); SQRADDAC(a[2], a[4]); SQRADDDB; SQRADD(a[3], a[3]); 
+      COMBA_STORE(b[6]);
+
+      /* output 7 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[7]); SQRADDAC(a[1], a[6]); SQRADDAC(a[2], a[5]); SQRADDAC(a[3], a[4]); SQRADDDB; 
+      COMBA_STORE(b[7]);
+
+      /* output 8 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[8]); SQRADDAC(a[1], a[7]); SQRADDAC(a[2], a[6]); SQRADDAC(a[3], a[5]); SQRADDDB; SQRADD(a[4], a[4]); 
+      COMBA_STORE(b[8]);
+
+      /* output 9 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[9]); SQRADDAC(a[1], a[8]); SQRADDAC(a[2], a[7]); SQRADDAC(a[3], a[6]); SQRADDAC(a[4], a[5]); SQRADDDB; 
+      COMBA_STORE(b[9]);
+
+      /* output 10 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[10]); SQRADDAC(a[1], a[9]); SQRADDAC(a[2], a[8]); SQRADDAC(a[3], a[7]); SQRADDAC(a[4], a[6]); SQRADDDB; SQRADD(a[5], a[5]); 
+      COMBA_STORE(b[10]);
+
+      /* output 11 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[11]); SQRADDAC(a[1], a[10]); SQRADDAC(a[2], a[9]); SQRADDAC(a[3], a[8]); SQRADDAC(a[4], a[7]); SQRADDAC(a[5], a[6]); SQRADDDB; 
+      COMBA_STORE(b[11]);
+
+      /* output 12 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[12]); SQRADDAC(a[1], a[11]); SQRADDAC(a[2], a[10]); SQRADDAC(a[3], a[9]); SQRADDAC(a[4], a[8]); SQRADDAC(a[5], a[7]); SQRADDDB; SQRADD(a[6], a[6]); 
+      COMBA_STORE(b[12]);
+
+      /* output 13 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[13]); SQRADDAC(a[1], a[12]); SQRADDAC(a[2], a[11]); SQRADDAC(a[3], a[10]); SQRADDAC(a[4], a[9]); SQRADDAC(a[5], a[8]); SQRADDAC(a[6], a[7]); SQRADDDB; 
+      COMBA_STORE(b[13]);
+
+      /* output 14 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[14]); SQRADDAC(a[1], a[13]); SQRADDAC(a[2], a[12]); SQRADDAC(a[3], a[11]); SQRADDAC(a[4], a[10]); SQRADDAC(a[5], a[9]); SQRADDAC(a[6], a[8]); SQRADDDB; SQRADD(a[7], a[7]); 
+      COMBA_STORE(b[14]);
+
+      /* output 15 */
+      CARRY_FORWARD;
+   SQRADDSC(a[0], a[15]); SQRADDAC(a[1], a[14]); SQRADDAC(a[2], a[13]); SQRADDAC(a[3], a[12]); SQRADDAC(a[4], a[11]); SQRADDAC(a[5], a[10]); SQRADDAC(a[6], a[9]); SQRADDAC(a[7], a[8]); SQRADDDB; 
+      COMBA_STORE(b[15]);
+
+      /* output 16 */
+      CARRY_FORWARD;
+   SQRADDSC(a[1], a[15]); SQRADDAC(a[2], a[14]); SQRADDAC(a[3], a[13]); SQRADDAC(a[4], a[12]); SQRADDAC(a[5], a[11]); SQRADDAC(a[6], a[10]); SQRADDAC(a[7], a[9]); SQRADDDB; SQRADD(a[8], a[8]); 
+      COMBA_STORE(b[16]);
+
+      /* output 17 */
+      CARRY_FORWARD;
+   SQRADDSC(a[2], a[15]); SQRADDAC(a[3], a[14]); SQRADDAC(a[4], a[13]); SQRADDAC(a[5], a[12]); SQRADDAC(a[6], a[11]); SQRADDAC(a[7], a[10]); SQRADDAC(a[8], a[9]); SQRADDDB; 
+      COMBA_STORE(b[17]);
+
+      /* output 18 */
+      CARRY_FORWARD;
+   SQRADDSC(a[3], a[15]); SQRADDAC(a[4], a[14]); SQRADDAC(a[5], a[13]); SQRADDAC(a[6], a[12]); SQRADDAC(a[7], a[11]); SQRADDAC(a[8], a[10]); SQRADDDB; SQRADD(a[9], a[9]); 
+      COMBA_STORE(b[18]);
+
+      /* output 19 */
+      CARRY_FORWARD;
+   SQRADDSC(a[4], a[15]); SQRADDAC(a[5], a[14]); SQRADDAC(a[6], a[13]); SQRADDAC(a[7], a[12]); SQRADDAC(a[8], a[11]); SQRADDAC(a[9], a[10]); SQRADDDB; 
+      COMBA_STORE(b[19]);
+
+      /* output 20 */
+      CARRY_FORWARD;
+   SQRADDSC(a[5], a[15]); SQRADDAC(a[6], a[14]); SQRADDAC(a[7], a[13]); SQRADDAC(a[8], a[12]); SQRADDAC(a[9], a[11]); SQRADDDB; SQRADD(a[10], a[10]); 
+      COMBA_STORE(b[20]);
+
+      /* output 21 */
+      CARRY_FORWARD;
+   SQRADDSC(a[6], a[15]); SQRADDAC(a[7], a[14]); SQRADDAC(a[8], a[13]); SQRADDAC(a[9], a[12]); SQRADDAC(a[10], a[11]); SQRADDDB; 
+      COMBA_STORE(b[21]);
+
+      /* output 22 */
+      CARRY_FORWARD;
+   SQRADDSC(a[7], a[15]); SQRADDAC(a[8], a[14]); SQRADDAC(a[9], a[13]); SQRADDAC(a[10], a[12]); SQRADDDB; SQRADD(a[11], a[11]); 
+      COMBA_STORE(b[22]);
+
+      /* output 23 */
+      CARRY_FORWARD;
+   SQRADDSC(a[8], a[15]); SQRADDAC(a[9], a[14]); SQRADDAC(a[10], a[13]); SQRADDAC(a[11], a[12]); SQRADDDB; 
+      COMBA_STORE(b[23]);
+
+      /* output 24 */
+      CARRY_FORWARD;
+   SQRADDSC(a[9], a[15]); SQRADDAC(a[10], a[14]); SQRADDAC(a[11], a[13]); SQRADDDB; SQRADD(a[12], a[12]); 
+      COMBA_STORE(b[24]);
+
+      /* output 25 */
+      CARRY_FORWARD;
+   SQRADDSC(a[10], a[15]); SQRADDAC(a[11], a[14]); SQRADDAC(a[12], a[13]); SQRADDDB; 
+      COMBA_STORE(b[25]);
+
+      /* output 26 */
+      CARRY_FORWARD;
+      SQRADD2(a[11], a[15]);    SQRADD2(a[12], a[14]);    SQRADD(a[13], a[13]); 
+      COMBA_STORE(b[26]);
+
+      /* output 27 */
+      CARRY_FORWARD;
+      SQRADD2(a[12], a[15]);    SQRADD2(a[13], a[14]); 
+      COMBA_STORE(b[27]);
+
+      /* output 28 */
+      CARRY_FORWARD;
+      SQRADD2(a[13], a[15]);    SQRADD(a[14], a[14]); 
+      COMBA_STORE(b[28]);
+
+      /* output 29 */
+      CARRY_FORWARD;
+      SQRADD2(a[14], a[15]); 
+      COMBA_STORE(b[29]);
+
+      /* output 30 */
+      CARRY_FORWARD;
+      SQRADD(a[15], a[15]); 
+      COMBA_STORE(b[30]);
+      COMBA_STORE2(b[31]);
+      COMBA_FINI;
+
+      B->used = 32;
+      B->sign = FP_ZPOS;
+      memcpy(B->dp, b, 32 * sizeof(fp_digit));
+      fp_clamp(B);
+      break;
+
+   default:
+      break;
+}
+}
+
+#endif /* TFM_SMALL_SET */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hc128.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hc128.c
new file mode 100644 (file)
index 0000000..20081fc
--- /dev/null
@@ -0,0 +1,333 @@
+/* hc128.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef HAVE_HC128
+
+#include <cyassl/ctaocrypt/hc128.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/hc128.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifdef BIG_ENDIAN_ORDER
+    #define LITTLE32(x) ByteReverseWord32(x)
+#else
+    #define LITTLE32(x) (x)
+#endif
+
+
+/*h1 function*/
+#define h1(ctx, x, y) {                         \
+     byte a,c;                                  \
+     a = (byte) (x);                            \
+     c = (byte) ((x) >> 16);                    \
+     y = (ctx->T[512+a])+(ctx->T[512+256+c]);   \
+}
+
+/*h2 function*/
+#define h2(ctx, x, y) {                         \
+     byte a,c;                                  \
+     a = (byte) (x);                            \
+     c = (byte) ((x) >> 16);                    \
+     y = (ctx->T[a])+(ctx->T[256+c]);           \
+}
+
+/*one step of HC-128, update P and generate 32 bits keystream*/
+#define step_P(ctx,u,v,a,b,c,d,n){              \
+     word32 tem0,tem1,tem2,tem3;                \
+     h1((ctx),(ctx->X[(d)]),tem3);              \
+     tem0 = rotrFixed((ctx->T[(v)]),23);        \
+     tem1 = rotrFixed((ctx->X[(c)]),10);        \
+     tem2 = rotrFixed((ctx->X[(b)]),8);         \
+     (ctx->T[(u)]) += tem2+(tem0 ^ tem1);       \
+     (ctx->X[(a)]) = (ctx->T[(u)]);             \
+     (n) = tem3 ^ (ctx->T[(u)]) ;               \
+}       
+
+/*one step of HC-128, update Q and generate 32 bits keystream*/
+#define step_Q(ctx,u,v,a,b,c,d,n){              \
+     word32 tem0,tem1,tem2,tem3;                \
+     h2((ctx),(ctx->Y[(d)]),tem3);              \
+     tem0 = rotrFixed((ctx->T[(v)]),(32-23));   \
+     tem1 = rotrFixed((ctx->Y[(c)]),(32-10));   \
+     tem2 = rotrFixed((ctx->Y[(b)]),(32-8));    \
+     (ctx->T[(u)]) += tem2 + (tem0 ^ tem1);     \
+     (ctx->Y[(a)]) = (ctx->T[(u)]);             \
+     (n) = tem3 ^ (ctx->T[(u)]) ;               \
+}   
+
+/*16 steps of HC-128, generate 512 bits keystream*/
+static void generate_keystream(HC128* ctx, word32* keystream)  
+{
+   word32 cc,dd;
+   cc = ctx->counter1024 & 0x1ff;
+   dd = (cc+16)&0x1ff;
+
+   if (ctx->counter1024 < 512) 
+   {                   
+      ctx->counter1024 = (ctx->counter1024 + 16) & 0x3ff;
+      step_P(ctx, cc+0, cc+1, 0, 6, 13,4, keystream[0]);
+      step_P(ctx, cc+1, cc+2, 1, 7, 14,5, keystream[1]);
+      step_P(ctx, cc+2, cc+3, 2, 8, 15,6, keystream[2]);
+      step_P(ctx, cc+3, cc+4, 3, 9, 0, 7, keystream[3]);
+      step_P(ctx, cc+4, cc+5, 4, 10,1, 8, keystream[4]);
+      step_P(ctx, cc+5, cc+6, 5, 11,2, 9, keystream[5]);
+      step_P(ctx, cc+6, cc+7, 6, 12,3, 10,keystream[6]);
+      step_P(ctx, cc+7, cc+8, 7, 13,4, 11,keystream[7]);
+      step_P(ctx, cc+8, cc+9, 8, 14,5, 12,keystream[8]);
+      step_P(ctx, cc+9, cc+10,9, 15,6, 13,keystream[9]);
+      step_P(ctx, cc+10,cc+11,10,0, 7, 14,keystream[10]);
+      step_P(ctx, cc+11,cc+12,11,1, 8, 15,keystream[11]);
+      step_P(ctx, cc+12,cc+13,12,2, 9, 0, keystream[12]);
+      step_P(ctx, cc+13,cc+14,13,3, 10,1, keystream[13]);
+      step_P(ctx, cc+14,cc+15,14,4, 11,2, keystream[14]);
+      step_P(ctx, cc+15,dd+0, 15,5, 12,3, keystream[15]);
+   }
+   else                                    
+   {
+         ctx->counter1024 = (ctx->counter1024 + 16) & 0x3ff;
+      step_Q(ctx, 512+cc+0, 512+cc+1, 0, 6, 13,4, keystream[0]);
+      step_Q(ctx, 512+cc+1, 512+cc+2, 1, 7, 14,5, keystream[1]);
+      step_Q(ctx, 512+cc+2, 512+cc+3, 2, 8, 15,6, keystream[2]);
+      step_Q(ctx, 512+cc+3, 512+cc+4, 3, 9, 0, 7, keystream[3]);
+      step_Q(ctx, 512+cc+4, 512+cc+5, 4, 10,1, 8, keystream[4]);
+      step_Q(ctx, 512+cc+5, 512+cc+6, 5, 11,2, 9, keystream[5]);
+      step_Q(ctx, 512+cc+6, 512+cc+7, 6, 12,3, 10,keystream[6]);
+      step_Q(ctx, 512+cc+7, 512+cc+8, 7, 13,4, 11,keystream[7]);
+      step_Q(ctx, 512+cc+8, 512+cc+9, 8, 14,5, 12,keystream[8]);
+      step_Q(ctx, 512+cc+9, 512+cc+10,9, 15,6, 13,keystream[9]);
+      step_Q(ctx, 512+cc+10,512+cc+11,10,0, 7, 14,keystream[10]);
+      step_Q(ctx, 512+cc+11,512+cc+12,11,1, 8, 15,keystream[11]);
+      step_Q(ctx, 512+cc+12,512+cc+13,12,2, 9, 0, keystream[12]);
+      step_Q(ctx, 512+cc+13,512+cc+14,13,3, 10,1, keystream[13]);
+      step_Q(ctx, 512+cc+14,512+cc+15,14,4, 11,2, keystream[14]);
+      step_Q(ctx, 512+cc+15,512+dd+0, 15,5, 12,3, keystream[15]);
+   }
+}
+
+
+/* The following defines the initialization functions */
+#define f1(x)  (rotrFixed((x),7)  ^ rotrFixed((x),18) ^ ((x) >> 3))
+#define f2(x)  (rotrFixed((x),17) ^ rotrFixed((x),19) ^ ((x) >> 10))
+
+/*update table P*/
+#define update_P(ctx,u,v,a,b,c,d){                  \
+     word32 tem0,tem1,tem2,tem3;                    \
+     tem0 = rotrFixed((ctx->T[(v)]),23);            \
+     tem1 = rotrFixed((ctx->X[(c)]),10);            \
+     tem2 = rotrFixed((ctx->X[(b)]),8);             \
+     h1((ctx),(ctx->X[(d)]),tem3);                  \
+     (ctx->T[(u)]) = ((ctx->T[(u)]) + tem2+(tem0^tem1)) ^ tem3;     \
+     (ctx->X[(a)]) = (ctx->T[(u)]);                 \
+}  
+
+/*update table Q*/
+#define update_Q(ctx,u,v,a,b,c,d){                  \
+     word32 tem0,tem1,tem2,tem3;                    \
+     tem0 = rotrFixed((ctx->T[(v)]),(32-23));       \
+     tem1 = rotrFixed((ctx->Y[(c)]),(32-10));       \
+     tem2 = rotrFixed((ctx->Y[(b)]),(32-8));        \
+     h2((ctx),(ctx->Y[(d)]),tem3);                  \
+     (ctx->T[(u)]) = ((ctx->T[(u)]) + tem2+(tem0^tem1)) ^ tem3;     \
+     (ctx->Y[(a)]) = (ctx->T[(u)]);                 \
+}     
+
+/*16 steps of HC-128, without generating keystream, */
+/*but use the outputs to update P and Q*/
+static void setup_update(HC128* ctx)  /*each time 16 steps*/
+{
+   word32 cc,dd;
+   cc = ctx->counter1024 & 0x1ff;
+   dd = (cc+16)&0x1ff;
+
+   if (ctx->counter1024 < 512) 
+   {                   
+      ctx->counter1024 = (ctx->counter1024 + 16) & 0x3ff;
+      update_P(ctx, cc+0, cc+1, 0, 6, 13, 4);
+      update_P(ctx, cc+1, cc+2, 1, 7, 14, 5);
+      update_P(ctx, cc+2, cc+3, 2, 8, 15, 6);
+      update_P(ctx, cc+3, cc+4, 3, 9, 0,  7);
+      update_P(ctx, cc+4, cc+5, 4, 10,1,  8);
+      update_P(ctx, cc+5, cc+6, 5, 11,2,  9);
+      update_P(ctx, cc+6, cc+7, 6, 12,3,  10);
+      update_P(ctx, cc+7, cc+8, 7, 13,4,  11);
+      update_P(ctx, cc+8, cc+9, 8, 14,5,  12);
+      update_P(ctx, cc+9, cc+10,9, 15,6,  13);
+      update_P(ctx, cc+10,cc+11,10,0, 7,  14);
+      update_P(ctx, cc+11,cc+12,11,1, 8,  15);
+      update_P(ctx, cc+12,cc+13,12,2, 9,  0);
+      update_P(ctx, cc+13,cc+14,13,3, 10, 1);
+      update_P(ctx, cc+14,cc+15,14,4, 11, 2);
+      update_P(ctx, cc+15,dd+0, 15,5, 12, 3);   
+   }
+   else                                    
+   {
+      ctx->counter1024 = (ctx->counter1024 + 16) & 0x3ff;
+      update_Q(ctx, 512+cc+0, 512+cc+1, 0, 6, 13, 4);
+      update_Q(ctx, 512+cc+1, 512+cc+2, 1, 7, 14, 5);
+      update_Q(ctx, 512+cc+2, 512+cc+3, 2, 8, 15, 6);
+      update_Q(ctx, 512+cc+3, 512+cc+4, 3, 9, 0,  7);
+      update_Q(ctx, 512+cc+4, 512+cc+5, 4, 10,1,  8);
+      update_Q(ctx, 512+cc+5, 512+cc+6, 5, 11,2,  9);
+      update_Q(ctx, 512+cc+6, 512+cc+7, 6, 12,3,  10);
+      update_Q(ctx, 512+cc+7, 512+cc+8, 7, 13,4,  11);
+      update_Q(ctx, 512+cc+8, 512+cc+9, 8, 14,5,  12);
+      update_Q(ctx, 512+cc+9, 512+cc+10,9, 15,6,  13);
+      update_Q(ctx, 512+cc+10,512+cc+11,10,0, 7,  14);
+      update_Q(ctx, 512+cc+11,512+cc+12,11,1, 8,  15);
+      update_Q(ctx, 512+cc+12,512+cc+13,12,2, 9,  0);
+      update_Q(ctx, 512+cc+13,512+cc+14,13,3, 10, 1);
+      update_Q(ctx, 512+cc+14,512+cc+15,14,4, 11, 2);
+      update_Q(ctx, 512+cc+15,512+dd+0, 15,5, 12, 3); 
+   }       
+}
+
+
+/* for the 128-bit key:  key[0]...key[15]
+*  key[0] is the least significant byte of ctx->key[0] (K_0);
+*  key[3] is the most significant byte of ctx->key[0]  (K_0);
+*  ...
+*  key[12] is the least significant byte of ctx->key[3] (K_3)
+*  key[15] is the most significant byte of ctx->key[3]  (K_3)
+*
+*  for the 128-bit iv:  iv[0]...iv[15]
+*  iv[0] is the least significant byte of ctx->iv[0] (IV_0);
+*  iv[3] is the most significant byte of ctx->iv[0]  (IV_0);
+*  ...
+*  iv[12] is the least significant byte of ctx->iv[3] (IV_3)
+*  iv[15] is the most significant byte of ctx->iv[3]  (IV_3)
+*/
+
+
+
+static void Hc128_SetIV(HC128* ctx, const byte* iv)
+{ 
+    word32 i;
+       
+       for (i = 0; i < (128 >> 5); i++)
+        ctx->iv[i] = LITTLE32(((word32*)iv)[i]);
+       
+    for (; i < 8; i++) ctx->iv[i] = ctx->iv[i-4];
+  
+    /* expand the key and IV into the table T */ 
+    /* (expand the key and IV into the table P and Q) */ 
+       
+       for (i = 0; i < 8;  i++)   ctx->T[i] = ctx->key[i];
+       for (i = 8; i < 16; i++)   ctx->T[i] = ctx->iv[i-8];
+
+    for (i = 16; i < (256+16); i++) 
+               ctx->T[i] = f2(ctx->T[i-2]) + ctx->T[i-7] + f1(ctx->T[i-15]) +
+                                                       ctx->T[i-16]+i;
+    
+       for (i = 0; i < 16;  i++)  ctx->T[i] = ctx->T[256+i];
+
+       for (i = 16; i < 1024; i++) 
+               ctx->T[i] = f2(ctx->T[i-2]) + ctx->T[i-7] + f1(ctx->T[i-15]) +
+                                                       ctx->T[i-16]+256+i;
+    
+    /* initialize counter1024, X and Y */
+       ctx->counter1024 = 0;
+       for (i = 0; i < 16; i++) ctx->X[i] = ctx->T[512-16+i];
+    for (i = 0; i < 16; i++) ctx->Y[i] = ctx->T[512+512-16+i];
+    
+    /* run the cipher 1024 steps before generating the output */
+       for (i = 0; i < 64; i++)  setup_update(ctx);  
+}
+
+
+void Hc128_SetKey(HC128* ctx, const byte* key, const byte* iv)
+{ 
+  word32 i;  
+
+  /* Key size in bits 128 */ 
+  for (i = 0; i < (128 >> 5); i++)
+      ctx->key[i] = LITTLE32(((word32*)key)[i]);
+  for ( ; i < 8 ; i++) ctx->key[i] = ctx->key[i-4];
+
+  Hc128_SetIV(ctx, iv);
+}
+
+
+/* The following defines the encryption of data stream */
+void Hc128_Process(HC128* ctx, byte* output, const byte* input, word32 msglen)
+{
+  word32 i, keystream[16];
+
+  for ( ; msglen >= 64; msglen -= 64, input += 64, output += 64)
+  {
+         generate_keystream(ctx, keystream);
+
+      /* unroll loop */
+         ((word32*)output)[0]  = ((word32*)input)[0]  ^ LITTLE32(keystream[0]);
+         ((word32*)output)[1]  = ((word32*)input)[1]  ^ LITTLE32(keystream[1]);
+         ((word32*)output)[2]  = ((word32*)input)[2]  ^ LITTLE32(keystream[2]);
+         ((word32*)output)[3]  = ((word32*)input)[3]  ^ LITTLE32(keystream[3]);
+         ((word32*)output)[4]  = ((word32*)input)[4]  ^ LITTLE32(keystream[4]);
+         ((word32*)output)[5]  = ((word32*)input)[5]  ^ LITTLE32(keystream[5]);
+         ((word32*)output)[6]  = ((word32*)input)[6]  ^ LITTLE32(keystream[6]);
+         ((word32*)output)[7]  = ((word32*)input)[7]  ^ LITTLE32(keystream[7]);
+         ((word32*)output)[8]  = ((word32*)input)[8]  ^ LITTLE32(keystream[8]);
+         ((word32*)output)[9]  = ((word32*)input)[9]  ^ LITTLE32(keystream[9]);
+         ((word32*)output)[10] = ((word32*)input)[10] ^ LITTLE32(keystream[10]);
+         ((word32*)output)[11] = ((word32*)input)[11] ^ LITTLE32(keystream[11]);
+         ((word32*)output)[12] = ((word32*)input)[12] ^ LITTLE32(keystream[12]);
+         ((word32*)output)[13] = ((word32*)input)[13] ^ LITTLE32(keystream[13]);
+         ((word32*)output)[14] = ((word32*)input)[14] ^ LITTLE32(keystream[14]);
+         ((word32*)output)[15] = ((word32*)input)[15] ^ LITTLE32(keystream[15]);
+  }
+
+  if (msglen > 0)
+  {
+      generate_keystream(ctx, keystream);
+
+#ifdef BIG_ENDIAN_ORDER
+      {
+          word32 wordsLeft = msglen / sizeof(word32);
+          if (msglen % sizeof(word32)) wordsLeft++;
+          
+          ByteReverseWords(keystream, keystream, wordsLeft * sizeof(word32));
+      }
+#endif
+
+      for (i = 0; i < msglen; i++)
+             output[i] = input[i] ^ ((byte*)keystream)[i];
+  }
+
+}
+
+
+#else  /* HAVE_HC128 */
+
+
+#ifdef _MSC_VER
+    /* 4206 warning for blank file */
+    #pragma warning(disable: 4206)
+#endif
+
+
+#endif /* HAVE_HC128 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hmac.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/hmac.c
new file mode 100644 (file)
index 0000000..880581e
--- /dev/null
@@ -0,0 +1,210 @@
+/* hmac.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_HMAC
+
+#include <cyassl/ctaocrypt/hmac.h>
+#include <cyassl/ctaocrypt/error.h>
+
+
+static int InitHmac(Hmac* hmac, int type)
+{
+    hmac->innerHashKeyed = 0;
+    hmac->macType = (byte)type;
+
+    if (!(type == MD5 || type == SHA || type == SHA256 || type == SHA384))
+        return BAD_FUNC_ARG;
+
+    if (type == MD5)
+        InitMd5(&hmac->hash.md5);
+    else if (type == SHA)
+        InitSha(&hmac->hash.sha);
+#ifndef NO_SHA256
+    else if (type == SHA256)
+        InitSha256(&hmac->hash.sha256);
+#endif
+#ifdef CYASSL_SHA384
+    else if (type == SHA384)
+        InitSha384(&hmac->hash.sha384);
+#endif
+
+    return 0;
+}
+
+
+void HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
+{
+    byte*  ip = (byte*) hmac->ipad;
+    byte*  op = (byte*) hmac->opad;
+    word32 i, hmac_block_size = MD5_BLOCK_SIZE;
+
+    InitHmac(hmac, type);
+
+    if (hmac->macType == MD5) {
+        if (length <= MD5_BLOCK_SIZE) {
+            XMEMCPY(ip, key, length);
+        }
+        else {
+            Md5Update(&hmac->hash.md5, key, length);
+            Md5Final(&hmac->hash.md5, ip);
+            length = MD5_DIGEST_SIZE;
+        }
+    }
+    else if (hmac->macType == SHA) {
+               hmac_block_size = SHA_BLOCK_SIZE;
+        if (length <= SHA_BLOCK_SIZE) {
+            XMEMCPY(ip, key, length);
+        }
+        else {
+            ShaUpdate(&hmac->hash.sha, key, length);
+            ShaFinal(&hmac->hash.sha, ip);
+            length = SHA_DIGEST_SIZE;
+        }
+    }
+#ifndef NO_SHA256
+    else if (hmac->macType == SHA256) {
+               hmac_block_size = SHA256_BLOCK_SIZE;
+        if (length <= SHA256_BLOCK_SIZE) {
+            XMEMCPY(ip, key, length);
+        }
+        else {
+            Sha256Update(&hmac->hash.sha256, key, length);
+            Sha256Final(&hmac->hash.sha256, ip);
+            length = SHA256_DIGEST_SIZE;
+        }
+    }
+#endif
+#ifdef CYASSL_SHA384
+    else if (hmac->macType == SHA384) {
+        hmac_block_size = SHA384_BLOCK_SIZE;
+        if (length <= SHA384_BLOCK_SIZE) {
+            XMEMCPY(ip, key, length);
+        }
+        else {
+            Sha384Update(&hmac->hash.sha384, key, length);
+            Sha384Final(&hmac->hash.sha384, ip);
+            length = SHA384_DIGEST_SIZE;
+        }
+    }
+#endif
+    XMEMSET(ip + length, 0, hmac_block_size - length);
+
+    for(i = 0; i < hmac_block_size; i++) {
+        op[i] = ip[i] ^ OPAD;
+        ip[i] ^= IPAD;
+    }
+}
+
+
+static void HmacKeyInnerHash(Hmac* hmac)
+{
+    if (hmac->macType == MD5)
+        Md5Update(&hmac->hash.md5, (byte*) hmac->ipad, MD5_BLOCK_SIZE);
+    else if (hmac->macType == SHA)
+        ShaUpdate(&hmac->hash.sha, (byte*) hmac->ipad, SHA_BLOCK_SIZE);
+#ifndef NO_SHA256
+    else if (hmac->macType == SHA256)
+        Sha256Update(&hmac->hash.sha256, (byte*) hmac->ipad, SHA256_BLOCK_SIZE);
+#endif
+#ifdef CYASSL_SHA384
+    else if (hmac->macType == SHA384)
+        Sha384Update(&hmac->hash.sha384, (byte*) hmac->ipad, SHA384_BLOCK_SIZE);
+#endif
+
+    hmac->innerHashKeyed = 1;
+}
+
+
+void HmacUpdate(Hmac* hmac, const byte* msg, word32 length)
+{
+    if (!hmac->innerHashKeyed)
+        HmacKeyInnerHash(hmac);
+
+    if (hmac->macType == MD5)
+        Md5Update(&hmac->hash.md5, msg, length);
+    else if (hmac->macType == SHA)
+        ShaUpdate(&hmac->hash.sha, msg, length);
+#ifndef NO_SHA256
+    else if (hmac->macType == SHA256)
+        Sha256Update(&hmac->hash.sha256, msg, length);
+#endif
+#ifdef CYASSL_SHA384
+    else if (hmac->macType == SHA384)
+        Sha384Update(&hmac->hash.sha384, msg, length);
+#endif
+
+}
+
+
+void HmacFinal(Hmac* hmac, byte* hash)
+{
+    if (!hmac->innerHashKeyed)
+        HmacKeyInnerHash(hmac);
+
+    if (hmac->macType == MD5) {
+        Md5Final(&hmac->hash.md5, (byte*) hmac->innerHash);
+
+        Md5Update(&hmac->hash.md5, (byte*) hmac->opad, MD5_BLOCK_SIZE);
+        Md5Update(&hmac->hash.md5, (byte*) hmac->innerHash, MD5_DIGEST_SIZE);
+
+        Md5Final(&hmac->hash.md5, hash);
+    }
+    else if (hmac->macType == SHA) {
+        ShaFinal(&hmac->hash.sha, (byte*) hmac->innerHash);
+
+        ShaUpdate(&hmac->hash.sha, (byte*) hmac->opad, SHA_BLOCK_SIZE);
+        ShaUpdate(&hmac->hash.sha, (byte*) hmac->innerHash, SHA_DIGEST_SIZE);
+
+        ShaFinal(&hmac->hash.sha, hash);
+    }
+#ifndef NO_SHA256
+    else if (hmac->macType == SHA256) {
+        Sha256Final(&hmac->hash.sha256, (byte*) hmac->innerHash);
+
+        Sha256Update(&hmac->hash.sha256, (byte*) hmac->opad, SHA256_BLOCK_SIZE);
+        Sha256Update(&hmac->hash.sha256, (byte*) hmac->innerHash,
+                     SHA256_DIGEST_SIZE);
+
+        Sha256Final(&hmac->hash.sha256, hash);
+    }
+#endif
+#ifdef CYASSL_SHA384
+    else if (hmac->macType == SHA384) {
+        Sha384Final(&hmac->hash.sha384, (byte*) hmac->innerHash);
+
+        Sha384Update(&hmac->hash.sha384, (byte*) hmac->opad, SHA384_BLOCK_SIZE);
+        Sha384Update(&hmac->hash.sha384, (byte*) hmac->innerHash,
+                     SHA384_DIGEST_SIZE);
+
+        Sha384Final(&hmac->hash.sha384, hash);
+    }
+#endif
+
+    hmac->innerHashKeyed = 0;
+}
+
+
+#endif /* NO_HMAC */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/include.am b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/include.am
new file mode 100644 (file)
index 0000000..580d3f5
--- /dev/null
@@ -0,0 +1,39 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+EXTRA_DIST += ctaocrypt/src/misc.c
+EXTRA_DIST += ctaocrypt/src/asm.c 
+
+EXTRA_DIST += \
+              ctaocrypt/src/ecc_fp.c \
+              ctaocrypt/src/fp_mont_small.i \
+              ctaocrypt/src/fp_mul_comba_12.i \
+              ctaocrypt/src/fp_mul_comba_17.i \
+              ctaocrypt/src/fp_mul_comba_20.i \
+              ctaocrypt/src/fp_mul_comba_24.i \
+              ctaocrypt/src/fp_mul_comba_28.i \
+              ctaocrypt/src/fp_mul_comba_32.i \
+              ctaocrypt/src/fp_mul_comba_3.i \
+              ctaocrypt/src/fp_mul_comba_48.i \
+              ctaocrypt/src/fp_mul_comba_4.i \
+              ctaocrypt/src/fp_mul_comba_64.i \
+              ctaocrypt/src/fp_mul_comba_6.i \
+              ctaocrypt/src/fp_mul_comba_7.i \
+              ctaocrypt/src/fp_mul_comba_8.i \
+              ctaocrypt/src/fp_mul_comba_9.i \
+              ctaocrypt/src/fp_mul_comba_small_set.i \
+              ctaocrypt/src/fp_sqr_comba_12.i \
+              ctaocrypt/src/fp_sqr_comba_17.i \
+              ctaocrypt/src/fp_sqr_comba_20.i \
+              ctaocrypt/src/fp_sqr_comba_24.i \
+              ctaocrypt/src/fp_sqr_comba_28.i \
+              ctaocrypt/src/fp_sqr_comba_32.i \
+              ctaocrypt/src/fp_sqr_comba_3.i \
+              ctaocrypt/src/fp_sqr_comba_48.i \
+              ctaocrypt/src/fp_sqr_comba_4.i \
+              ctaocrypt/src/fp_sqr_comba_64.i \
+              ctaocrypt/src/fp_sqr_comba_6.i \
+              ctaocrypt/src/fp_sqr_comba_7.i \
+              ctaocrypt/src/fp_sqr_comba_8.i \
+              ctaocrypt/src/fp_sqr_comba_9.i \
+              ctaocrypt/src/fp_sqr_comba_small_set.i
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/integer.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/integer.c
new file mode 100644 (file)
index 0000000..72f443f
--- /dev/null
@@ -0,0 +1,4444 @@
+/* integer.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*
+ * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca,
+ * http://math.libtomcrypt.com
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/* in case user set USE_FAST_MATH there */
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifndef USE_FAST_MATH
+
+#include <cyassl/ctaocrypt/integer.h>
+
+
+/* math settings check */
+word32 CheckRunTimeSettings(void)
+{
+    return CTC_SETTINGS;
+}
+
+
+/* handle up to 6 inits */
+int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
+                  mp_int* f)
+{
+    int res = MP_OKAY;
+
+    if (a && ((res = mp_init(a)) != MP_OKAY))
+        return res;
+
+    if (b && ((res = mp_init(b)) != MP_OKAY)) {
+        mp_clear(a);
+        return res;
+    }
+
+    if (c && ((res = mp_init(c)) != MP_OKAY)) {
+        mp_clear(a); mp_clear(b);
+        return res;
+    }
+
+    if (d && ((res = mp_init(d)) != MP_OKAY)) {
+        mp_clear(a); mp_clear(b); mp_clear(c);
+        return res;
+    }
+
+    if (e && ((res = mp_init(e)) != MP_OKAY)) {
+        mp_clear(a); mp_clear(b); mp_clear(c); mp_clear(d);
+        return res;
+    }
+
+    if (f && ((res = mp_init(f)) != MP_OKAY)) {
+        mp_clear(a); mp_clear(b); mp_clear(c); mp_clear(d); mp_clear(e);
+        return res;
+    }
+
+    return res;
+}
+
+
+/* init a new mp_int */
+int mp_init (mp_int * a)
+{
+  int i;
+
+  /* allocate memory required and clear it */
+  a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC, 0,
+                                      DYNAMIC_TYPE_BIGINT);
+  if (a->dp == NULL) {
+    return MP_MEM;
+  }
+
+  /* set the digits to zero */
+  for (i = 0; i < MP_PREC; i++) {
+      a->dp[i] = 0;
+  }
+
+  /* set the used to zero, allocated digits to the default precision
+   * and sign to positive */
+  a->used  = 0;
+  a->alloc = MP_PREC;
+  a->sign  = MP_ZPOS;
+
+  return MP_OKAY;
+}
+
+
+/* clear one (frees)  */
+void
+mp_clear (mp_int * a)
+{
+  int i;
+
+  /* only do anything if a hasn't been freed previously */
+  if (a->dp != NULL) {
+    /* first zero the digits */
+    for (i = 0; i < a->used; i++) {
+        a->dp[i] = 0;
+    }
+
+    /* free ram */
+    XFREE(a->dp, 0, DYNAMIC_TYPE_BIGINT);
+
+    /* reset members to make debugging easier */
+    a->dp    = NULL;
+    a->alloc = a->used = 0;
+    a->sign  = MP_ZPOS;
+  }
+}
+
+
+/* get the size for an unsigned equivalent */
+int mp_unsigned_bin_size (mp_int * a)
+{
+  int     size = mp_count_bits (a);
+  return (size / 8 + ((size & 7) != 0 ? 1 : 0));
+}
+
+
+/* returns the number of bits in an int */
+int
+mp_count_bits (mp_int * a)
+{
+  int     r;
+  mp_digit q;
+
+  /* shortcut */
+  if (a->used == 0) {
+    return 0;
+  }
+
+  /* get number of digits and add that */
+  r = (a->used - 1) * DIGIT_BIT;
+  
+  /* take the last digit and count the bits in it */
+  q = a->dp[a->used - 1];
+  while (q > ((mp_digit) 0)) {
+    ++r;
+    q >>= ((mp_digit) 1);
+  }
+  return r;
+}
+
+
+/* store in unsigned [big endian] format */
+int mp_to_unsigned_bin (mp_int * a, unsigned char *b)
+{
+  int     x, res;
+  mp_int  t;
+
+  if ((res = mp_init_copy (&t, a)) != MP_OKAY) {
+    return res;
+  }
+
+  x = 0;
+  while (mp_iszero (&t) == 0) {
+#ifndef MP_8BIT
+      b[x++] = (unsigned char) (t.dp[0] & 255);
+#else
+      b[x++] = (unsigned char) (t.dp[0] | ((t.dp[1] & 0x01) << 7));
+#endif
+    if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) {
+      mp_clear (&t);
+      return res;
+    }
+  }
+  bn_reverse (b, x);
+  mp_clear (&t);
+  return MP_OKAY;
+}
+
+
+/* creates "a" then copies b into it */
+int mp_init_copy (mp_int * a, mp_int * b)
+{
+  int     res;
+
+  if ((res = mp_init (a)) != MP_OKAY) {
+    return res;
+  }
+  return mp_copy (b, a);
+}
+
+
+/* copy, b = a */
+int
+mp_copy (mp_int * a, mp_int * b)
+{
+  int     res, n;
+
+  /* if dst == src do nothing */
+  if (a == b) {
+    return MP_OKAY;
+  }
+
+  /* grow dest */
+  if (b->alloc < a->used) {
+     if ((res = mp_grow (b, a->used)) != MP_OKAY) {
+        return res;
+     }
+  }
+
+  /* zero b and copy the parameters over */
+  {
+    register mp_digit *tmpa, *tmpb;
+
+    /* pointer aliases */
+
+    /* source */
+    tmpa = a->dp;
+
+    /* destination */
+    tmpb = b->dp;
+
+    /* copy all the digits */
+    for (n = 0; n < a->used; n++) {
+      *tmpb++ = *tmpa++;
+    }
+
+    /* clear high digits */
+    for (; n < b->used; n++) {
+      *tmpb++ = 0;
+    }
+  }
+
+  /* copy used count and sign */
+  b->used = a->used;
+  b->sign = a->sign;
+  return MP_OKAY;
+}
+
+
+/* grow as required */
+int mp_grow (mp_int * a, int size)
+{
+  int     i;
+  mp_digit *tmp;
+
+  /* if the alloc size is smaller alloc more ram */
+  if (a->alloc < size) {
+    /* ensure there are always at least MP_PREC digits extra on top */
+    size += (MP_PREC * 2) - (size % MP_PREC);
+
+    /* reallocate the array a->dp
+     *
+     * We store the return in a temporary variable
+     * in case the operation failed we don't want
+     * to overwrite the dp member of a.
+     */
+    tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * size, 0,
+                                       DYNAMIC_TYPE_BIGINT);
+    if (tmp == NULL) {
+      /* reallocation failed but "a" is still valid [can be freed] */
+      return MP_MEM;
+    }
+
+    /* reallocation succeeded so set a->dp */
+    a->dp = tmp;
+
+    /* zero excess digits */
+    i        = a->alloc;
+    a->alloc = size;
+    for (; i < a->alloc; i++) {
+      a->dp[i] = 0;
+    }
+  }
+  return MP_OKAY;
+}
+
+
+/* reverse an array, used for radix code */
+void
+bn_reverse (unsigned char *s, int len)
+{
+  int     ix, iy;
+  unsigned char t;
+
+  ix = 0;
+  iy = len - 1;
+  while (ix < iy) {
+    t     = s[ix];
+    s[ix] = s[iy];
+    s[iy] = t;
+    ++ix;
+    --iy;
+  }
+}
+
+
+/* shift right by a certain bit count (store quotient in c, optional
+   remainder in d) */
+int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
+{
+  mp_digit D, r, rr;
+  int     x, res;
+  mp_int  t;
+
+
+  /* if the shift count is <= 0 then we do no work */
+  if (b <= 0) {
+    res = mp_copy (a, c);
+    if (d != NULL) {
+      mp_zero (d);
+    }
+    return res;
+  }
+
+  if ((res = mp_init (&t)) != MP_OKAY) {
+    return res;
+  }
+
+  /* get the remainder */
+  if (d != NULL) {
+    if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) {
+      mp_clear (&t);
+      return res;
+    }
+  }
+
+  /* copy */
+  if ((res = mp_copy (a, c)) != MP_OKAY) {
+    mp_clear (&t);
+    return res;
+  }
+
+  /* shift by as many digits in the bit count */
+  if (b >= (int)DIGIT_BIT) {
+    mp_rshd (c, b / DIGIT_BIT);
+  }
+
+  /* shift any bit count < DIGIT_BIT */
+  D = (mp_digit) (b % DIGIT_BIT);
+  if (D != 0) {
+    register mp_digit *tmpc, mask, shift;
+
+    /* mask */
+    mask = (((mp_digit)1) << D) - 1;
+
+    /* shift for lsb */
+    shift = DIGIT_BIT - D;
+
+    /* alias */
+    tmpc = c->dp + (c->used - 1);
+
+    /* carry */
+    r = 0;
+    for (x = c->used - 1; x >= 0; x--) {
+      /* get the lower  bits of this word in a temp */
+      rr = *tmpc & mask;
+
+      /* shift the current word and mix in the carry bits from the previous
+         word */
+      *tmpc = (*tmpc >> D) | (r << shift);
+      --tmpc;
+
+      /* set the carry to the carry bits of the current word found above */
+      r = rr;
+    }
+  }
+  mp_clamp (c);
+  if (d != NULL) {
+    mp_exch (&t, d);
+  }
+  mp_clear (&t);
+  return MP_OKAY;
+}
+
+
+/* set to zero */
+void mp_zero (mp_int * a)
+{
+  int       n;
+  mp_digit *tmp;
+
+  a->sign = MP_ZPOS;
+  a->used = 0;
+
+  tmp = a->dp;
+  for (n = 0; n < a->alloc; n++) {
+     *tmp++ = 0;
+  }
+}
+
+
+/* trim unused digits 
+ *
+ * This is used to ensure that leading zero digits are
+ * trimed and the leading "used" digit will be non-zero
+ * Typically very fast.  Also fixes the sign if there
+ * are no more leading digits
+ */
+void
+mp_clamp (mp_int * a)
+{
+  /* decrease used while the most significant digit is
+   * zero.
+   */
+  while (a->used > 0 && a->dp[a->used - 1] == 0) {
+    --(a->used);
+  }
+
+  /* reset the sign flag if used == 0 */
+  if (a->used == 0) {
+    a->sign = MP_ZPOS;
+  }
+}
+
+
+/* swap the elements of two integers, for cases where you can't simply swap the 
+ * mp_int pointers around
+ */
+void
+mp_exch (mp_int * a, mp_int * b)
+{
+  mp_int  t;
+
+  t  = *a;
+  *a = *b;
+  *b = t;
+}
+
+
+/* shift right a certain amount of digits */
+void mp_rshd (mp_int * a, int b)
+{
+  int     x;
+
+  /* if b <= 0 then ignore it */
+  if (b <= 0) {
+    return;
+  }
+
+  /* if b > used then simply zero it and return */
+  if (a->used <= b) {
+    mp_zero (a);
+    return;
+  }
+
+  {
+    register mp_digit *bottom, *top;
+
+    /* shift the digits down */
+
+    /* bottom */
+    bottom = a->dp;
+
+    /* top [offset into digits] */
+    top = a->dp + b;
+
+    /* this is implemented as a sliding window where 
+     * the window is b-digits long and digits from 
+     * the top of the window are copied to the bottom
+     *
+     * e.g.
+
+     b-2 | b-1 | b0 | b1 | b2 | ... | bb |   ---->
+                 /\                   |      ---->
+                  \-------------------/      ---->
+     */
+    for (x = 0; x < (a->used - b); x++) {
+      *bottom++ = *top++;
+    }
+
+    /* zero the top digits */
+    for (; x < a->used; x++) {
+      *bottom++ = 0;
+    }
+  }
+  
+  /* remove excess digits */
+  a->used -= b;
+}
+
+
+/* calc a value mod 2**b */
+int
+mp_mod_2d (mp_int * a, int b, mp_int * c)
+{
+  int     x, res;
+
+  /* if b is <= 0 then zero the int */
+  if (b <= 0) {
+    mp_zero (c);
+    return MP_OKAY;
+  }
+
+  /* if the modulus is larger than the value than return */
+  if (b >= (int) (a->used * DIGIT_BIT)) {
+    res = mp_copy (a, c);
+    return res;
+  }
+
+  /* copy */
+  if ((res = mp_copy (a, c)) != MP_OKAY) {
+    return res;
+  }
+
+  /* zero digits above the last digit of the modulus */
+  for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
+    c->dp[x] = 0;
+  }
+  /* clear the digit that is not completely outside/inside the modulus */
+  c->dp[b / DIGIT_BIT] &= (mp_digit) ((((mp_digit) 1) <<
+              (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1));
+  mp_clamp (c);
+  return MP_OKAY;
+}
+
+
+/* reads a unsigned char array, assumes the msb is stored first [big endian] */
+int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c)
+{
+  int     res;
+
+  /* make sure there are at least two digits */
+  if (a->alloc < 2) {
+     if ((res = mp_grow(a, 2)) != MP_OKAY) {
+        return res;
+     }
+  }
+
+  /* zero the int */
+  mp_zero (a);
+
+  /* read the bytes in */
+  while (c-- > 0) {
+    if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) {
+      return res;
+    }
+
+#ifndef MP_8BIT
+      a->dp[0] |= *b++;
+      a->used += 1;
+#else
+      a->dp[0] = (*b & MP_MASK);
+      a->dp[1] |= ((*b++ >> 7U) & 1);
+      a->used += 2;
+#endif
+  }
+  mp_clamp (a);
+  return MP_OKAY;
+}
+
+
+/* shift left by a certain bit count */
+int mp_mul_2d (mp_int * a, int b, mp_int * c)
+{
+  mp_digit d;
+  int      res;
+
+  /* copy */
+  if (a != c) {
+     if ((res = mp_copy (a, c)) != MP_OKAY) {
+       return res;
+     }
+  }
+
+  if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) {
+     if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
+       return res;
+     }
+  }
+
+  /* shift by as many digits in the bit count */
+  if (b >= (int)DIGIT_BIT) {
+    if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  /* shift any bit count < DIGIT_BIT */
+  d = (mp_digit) (b % DIGIT_BIT);
+  if (d != 0) {
+    register mp_digit *tmpc, shift, mask, r, rr;
+    register int x;
+
+    /* bitmask for carries */
+    mask = (((mp_digit)1) << d) - 1;
+
+    /* shift for msbs */
+    shift = DIGIT_BIT - d;
+
+    /* alias */
+    tmpc = c->dp;
+
+    /* carry */
+    r    = 0;
+    for (x = 0; x < c->used; x++) {
+      /* get the higher bits of the current word */
+      rr = (*tmpc >> shift) & mask;
+
+      /* shift the current word and OR in the carry */
+      *tmpc = ((*tmpc << d) | r) & MP_MASK;
+      ++tmpc;
+
+      /* set the carry to the carry bits of the current word */
+      r = rr;
+    }
+    
+    /* set final carry */
+    if (r != 0) {
+       c->dp[(c->used)++] = r;
+    }
+  }
+  mp_clamp (c);
+  return MP_OKAY;
+}
+
+
+/* shift left a certain amount of digits */
+int mp_lshd (mp_int * a, int b)
+{
+  int     x, res;
+
+  /* if its less than zero return */
+  if (b <= 0) {
+    return MP_OKAY;
+  }
+
+  /* grow to fit the new digits */
+  if (a->alloc < a->used + b) {
+     if ((res = mp_grow (a, a->used + b)) != MP_OKAY) {
+       return res;
+     }
+  }
+
+  {
+    register mp_digit *top, *bottom;
+
+    /* increment the used by the shift amount then copy upwards */
+    a->used += b;
+
+    /* top */
+    top = a->dp + a->used - 1;
+
+    /* base */
+    bottom = a->dp + a->used - 1 - b;
+
+    /* much like mp_rshd this is implemented using a sliding window
+     * except the window goes the otherway around.  Copying from
+     * the bottom to the top.  see bn_mp_rshd.c for more info.
+     */
+    for (x = a->used - 1; x >= b; x--) {
+      *top-- = *bottom--;
+    }
+
+    /* zero the lower digits */
+    top = a->dp;
+    for (x = 0; x < b; x++) {
+      *top++ = 0;
+    }
+  }
+  return MP_OKAY;
+}
+
+
+/* this is a shell function that calls either the normal or Montgomery
+ * exptmod functions.  Originally the call to the montgomery code was
+ * embedded in the normal function but that wasted alot of stack space
+ * for nothing (since 99% of the time the Montgomery code would be called)
+ */
+int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y)
+{
+  int dr;
+
+  /* modulus P must be positive */
+  if (P->sign == MP_NEG) {
+     return MP_VAL;
+  }
+
+  /* if exponent X is negative we have to recurse */
+  if (X->sign == MP_NEG) {
+#ifdef BN_MP_INVMOD_C
+     mp_int tmpG, tmpX;
+     int err;
+
+     /* first compute 1/G mod P */
+     if ((err = mp_init(&tmpG)) != MP_OKAY) {
+        return err;
+     }
+     if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) {
+        mp_clear(&tmpG);
+        return err;
+     }
+
+     /* now get |X| */
+     if ((err = mp_init(&tmpX)) != MP_OKAY) {
+        mp_clear(&tmpG);
+        return err;
+     }
+     if ((err = mp_abs(X, &tmpX)) != MP_OKAY) {
+        mp_clear(&tmpG);
+        mp_clear(&tmpX);
+        return err;
+     }
+
+     /* and now compute (1/G)**|X| instead of G**X [X < 0] */
+     err = mp_exptmod(&tmpG, &tmpX, P, Y);
+     mp_clear(&tmpG);
+     mp_clear(&tmpX);
+     return err;
+#else 
+     /* no invmod */
+     return MP_VAL;
+#endif
+  }
+
+/* modified diminished radix reduction */
+#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C) && \
+  defined(BN_S_MP_EXPTMOD_C)
+  if (mp_reduce_is_2k_l(P) == MP_YES) {
+     return s_mp_exptmod(G, X, P, Y, 1);
+  }
+#endif
+
+#ifdef BN_MP_DR_IS_MODULUS_C
+  /* is it a DR modulus? */
+  dr = mp_dr_is_modulus(P);
+#else
+  /* default to no */
+  dr = 0;
+#endif
+
+#ifdef BN_MP_REDUCE_IS_2K_C
+  /* if not, is it a unrestricted DR modulus? */
+  if (dr == 0) {
+     dr = mp_reduce_is_2k(P) << 1;
+  }
+#endif
+    
+  /* if the modulus is odd or dr != 0 use the montgomery method */
+#ifdef BN_MP_EXPTMOD_FAST_C
+  if (mp_isodd (P) == 1 || dr !=  0) {
+    return mp_exptmod_fast (G, X, P, Y, dr);
+  } else {
+#endif
+#ifdef BN_S_MP_EXPTMOD_C
+    /* otherwise use the generic Barrett reduction technique */
+    return s_mp_exptmod (G, X, P, Y, 0);
+#else
+    /* no exptmod for evens */
+    return MP_VAL;
+#endif
+#ifdef BN_MP_EXPTMOD_FAST_C
+  }
+#endif
+}
+
+
+/* b = |a| 
+ *
+ * Simple function copies the input and fixes the sign to positive
+ */
+int
+mp_abs (mp_int * a, mp_int * b)
+{
+  int     res;
+
+  /* copy a to b */
+  if (a != b) {
+     if ((res = mp_copy (a, b)) != MP_OKAY) {
+       return res;
+     }
+  }
+
+  /* force the sign of b to positive */
+  b->sign = MP_ZPOS;
+
+  return MP_OKAY;
+}
+
+
+/* hac 14.61, pp608 */
+int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
+{
+  /* b cannot be negative */
+  if (b->sign == MP_NEG || mp_iszero(b) == 1) {
+    return MP_VAL;
+  }
+
+#ifdef BN_FAST_MP_INVMOD_C
+  /* if the modulus is odd we can use a faster routine instead */
+  if (mp_isodd (b) == 1) {
+    return fast_mp_invmod (a, b, c);
+  }
+#endif
+
+#ifdef BN_MP_INVMOD_SLOW_C
+  return mp_invmod_slow(a, b, c);
+#endif
+}
+
+
+/* computes the modular inverse via binary extended euclidean algorithm, 
+ * that is c = 1/a mod b 
+ *
+ * Based on slow invmod except this is optimized for the case where b is 
+ * odd as per HAC Note 14.64 on pp. 610
+ */
+int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c)
+{
+  mp_int  x, y, u, v, B, D;
+  int     res, neg;
+
+  /* 2. [modified] b must be odd   */
+  if (mp_iseven (b) == 1) {
+    return MP_VAL;
+  }
+
+  /* init all our temps */
+  if ((res = mp_init_multi(&x, &y, &u, &v, &B, &D)) != MP_OKAY) {
+     return res;
+  }
+
+  /* x == modulus, y == value to invert */
+  if ((res = mp_copy (b, &x)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+
+  /* we need y = |a| */
+  if ((res = mp_mod (a, b, &y)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+
+  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
+  if ((res = mp_copy (&x, &u)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+  if ((res = mp_copy (&y, &v)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+  mp_set (&D, 1);
+
+top:
+  /* 4.  while u is even do */
+  while (mp_iseven (&u) == 1) {
+    /* 4.1 u = u/2 */
+    if ((res = mp_div_2 (&u, &u)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    /* 4.2 if B is odd then */
+    if (mp_isodd (&B) == 1) {
+      if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) {
+        goto LBL_ERR;
+      }
+    }
+    /* B = B/2 */
+    if ((res = mp_div_2 (&B, &B)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* 5.  while v is even do */
+  while (mp_iseven (&v) == 1) {
+    /* 5.1 v = v/2 */
+    if ((res = mp_div_2 (&v, &v)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    /* 5.2 if D is odd then */
+    if (mp_isodd (&D) == 1) {
+      /* D = (D-x)/2 */
+      if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) {
+        goto LBL_ERR;
+      }
+    }
+    /* D = D/2 */
+    if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* 6.  if u >= v then */
+  if (mp_cmp (&u, &v) != MP_LT) {
+    /* u = u - v, B = B - D */
+    if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  } else {
+    /* v - v - u, D = D - B */
+    if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* if not zero goto step 4 */
+  if (mp_iszero (&u) == 0) {
+    goto top;
+  }
+
+  /* now a = C, b = D, gcd == g*v */
+
+  /* if v != 1 then there is no inverse */
+  if (mp_cmp_d (&v, 1) != MP_EQ) {
+    res = MP_VAL;
+    goto LBL_ERR;
+  }
+
+  /* b is now the inverse */
+  neg = a->sign;
+  while (D.sign == MP_NEG) {
+    if ((res = mp_add (&D, b, &D)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+  mp_exch (&D, c);
+  c->sign = neg;
+  res = MP_OKAY;
+
+LBL_ERR:mp_clear(&x);
+        mp_clear(&y);
+        mp_clear(&u);
+        mp_clear(&v);
+        mp_clear(&B);
+        mp_clear(&D);
+  return res;
+}
+
+
+/* hac 14.61, pp608 */
+int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c)
+{
+  mp_int  x, y, u, v, A, B, C, D;
+  int     res;
+
+  /* b cannot be negative */
+  if (b->sign == MP_NEG || mp_iszero(b) == 1) {
+    return MP_VAL;
+  }
+
+  /* init temps */
+  if ((res = mp_init_multi(&x, &y, &u, &v, 
+                           &A, &B)) != MP_OKAY) {
+     return res;
+  }
+
+  /* init rest of tmps temps */
+  if ((res = mp_init_multi(&C, &D, 0, 0, 0, 0)) != MP_OKAY) {
+     return res;
+  }
+
+  /* x = a, y = b */
+  if ((res = mp_mod(a, b, &x)) != MP_OKAY) {
+      goto LBL_ERR;
+  }
+  if ((res = mp_copy (b, &y)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+
+  /* 2. [modified] if x,y are both even then return an error! */
+  if (mp_iseven (&x) == 1 && mp_iseven (&y) == 1) {
+    res = MP_VAL;
+    goto LBL_ERR;
+  }
+
+  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
+  if ((res = mp_copy (&x, &u)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+  if ((res = mp_copy (&y, &v)) != MP_OKAY) {
+    goto LBL_ERR;
+  }
+  mp_set (&A, 1);
+  mp_set (&D, 1);
+
+top:
+  /* 4.  while u is even do */
+  while (mp_iseven (&u) == 1) {
+    /* 4.1 u = u/2 */
+    if ((res = mp_div_2 (&u, &u)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    /* 4.2 if A or B is odd then */
+    if (mp_isodd (&A) == 1 || mp_isodd (&B) == 1) {
+      /* A = (A+y)/2, B = (B-x)/2 */
+      if ((res = mp_add (&A, &y, &A)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+      if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+    }
+    /* A = A/2, B = B/2 */
+    if ((res = mp_div_2 (&A, &A)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    if ((res = mp_div_2 (&B, &B)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* 5.  while v is even do */
+  while (mp_iseven (&v) == 1) {
+    /* 5.1 v = v/2 */
+    if ((res = mp_div_2 (&v, &v)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    /* 5.2 if C or D is odd then */
+    if (mp_isodd (&C) == 1 || mp_isodd (&D) == 1) {
+      /* C = (C+y)/2, D = (D-x)/2 */
+      if ((res = mp_add (&C, &y, &C)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+      if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+    }
+    /* C = C/2, D = D/2 */
+    if ((res = mp_div_2 (&C, &C)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+    if ((res = mp_div_2 (&D, &D)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* 6.  if u >= v then */
+  if (mp_cmp (&u, &v) != MP_LT) {
+    /* u = u - v, A = A - C, B = B - D */
+    if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  } else {
+    /* v - v - u, C = C - A, D = D - B */
+    if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+
+    if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) {
+      goto LBL_ERR;
+    }
+  }
+
+  /* if not zero goto step 4 */
+  if (mp_iszero (&u) == 0)
+    goto top;
+
+  /* now a = C, b = D, gcd == g*v */
+
+  /* if v != 1 then there is no inverse */
+  if (mp_cmp_d (&v, 1) != MP_EQ) {
+    res = MP_VAL;
+    goto LBL_ERR;
+  }
+
+  /* if its too low */
+  while (mp_cmp_d(&C, 0) == MP_LT) {
+      if ((res = mp_add(&C, b, &C)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+  }
+  
+  /* too big */
+  while (mp_cmp_mag(&C, b) != MP_LT) {
+      if ((res = mp_sub(&C, b, &C)) != MP_OKAY) {
+         goto LBL_ERR;
+      }
+  }
+  
+  /* C is now the inverse */
+  mp_exch (&C, c);
+  res = MP_OKAY;
+LBL_ERR:mp_clear(&x);
+        mp_clear(&y);
+        mp_clear(&u);
+        mp_clear(&v);
+        mp_clear(&A);
+        mp_clear(&B);
+        mp_clear(&C);
+        mp_clear(&D);
+  return res;
+}
+
+
+/* compare maginitude of two ints (unsigned) */
+int mp_cmp_mag (mp_int * a, mp_int * b)
+{
+  int     n;
+  mp_digit *tmpa, *tmpb;
+
+  /* compare based on # of non-zero digits */
+  if (a->used > b->used) {
+    return MP_GT;
+  }
+  
+  if (a->used < b->used) {
+    return MP_LT;
+  }
+
+  /* alias for a */
+  tmpa = a->dp + (a->used - 1);
+
+  /* alias for b */
+  tmpb = b->dp + (a->used - 1);
+
+  /* compare based on digits  */
+  for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
+    if (*tmpa > *tmpb) {
+      return MP_GT;
+    }
+
+    if (*tmpa < *tmpb) {
+      return MP_LT;
+    }
+  }
+  return MP_EQ;
+}
+
+
+/* compare two ints (signed)*/
+int
+mp_cmp (mp_int * a, mp_int * b)
+{
+  /* compare based on sign */
+  if (a->sign != b->sign) {
+     if (a->sign == MP_NEG) {
+        return MP_LT;
+     } else {
+        return MP_GT;
+     }
+  }
+  
+  /* compare digits */
+  if (a->sign == MP_NEG) {
+     /* if negative compare opposite direction */
+     return mp_cmp_mag(b, a);
+  } else {
+     return mp_cmp_mag(a, b);
+  }
+}
+
+
+/* compare a digit */
+int mp_cmp_d(mp_int * a, mp_digit b)
+{
+  /* compare based on sign */
+  if (a->sign == MP_NEG) {
+    return MP_LT;
+  }
+
+  /* compare based on magnitude */
+  if (a->used > 1) {
+    return MP_GT;
+  }
+
+  /* compare the only digit of a to b */
+  if (a->dp[0] > b) {
+    return MP_GT;
+  } else if (a->dp[0] < b) {
+    return MP_LT;
+  } else {
+    return MP_EQ;
+  }
+}
+
+
+/* set to a digit */
+void mp_set (mp_int * a, mp_digit b)
+{
+  mp_zero (a);
+  a->dp[0] = b & MP_MASK;
+  a->used  = (a->dp[0] != 0) ? 1 : 0;
+}
+
+
+/* c = a mod b, 0 <= c < b */
+int
+mp_mod (mp_int * a, mp_int * b, mp_int * c)
+{
+  mp_int  t;
+  int     res;
+
+  if ((res = mp_init (&t)) != MP_OKAY) {
+    return res;
+  }
+
+  if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) {
+    mp_clear (&t);
+    return res;
+  }
+
+  if (t.sign != b->sign) {
+    res = mp_add (b, &t, c);
+  } else {
+    res = MP_OKAY;
+    mp_exch (&t, c);
+  }
+
+  mp_clear (&t);
+  return res;
+}
+
+
+/* slower bit-bang division... also smaller */
+int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d)
+{
+   mp_int ta, tb, tq, q;
+   int    res, n, n2;
+
+  /* is divisor zero ? */
+  if (mp_iszero (b) == 1) {
+    return MP_VAL;
+  }
+
+  /* if a < b then q=0, r = a */
+  if (mp_cmp_mag (a, b) == MP_LT) {
+    if (d != NULL) {
+      res = mp_copy (a, d);
+    } else {
+      res = MP_OKAY;
+    }
+    if (c != NULL) {
+      mp_zero (c);
+    }
+    return res;
+  }
+       
+  /* init our temps */
+  if ((res = mp_init_multi(&ta, &tb, &tq, &q, 0, 0)) != MP_OKAY) {
+     return res;
+  }
+
+
+  mp_set(&tq, 1);
+  n = mp_count_bits(a) - mp_count_bits(b);
+  if (((res = mp_abs(a, &ta)) != MP_OKAY) ||
+      ((res = mp_abs(b, &tb)) != MP_OKAY) || 
+      ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) ||
+      ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) {
+      goto LBL_ERR;
+  }
+
+  while (n-- >= 0) {
+     if (mp_cmp(&tb, &ta) != MP_GT) {
+        if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) ||
+            ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) {
+           goto LBL_ERR;
+        }
+     }
+     if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) ||
+         ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) {
+           goto LBL_ERR;
+     }
+  }
+
+  /* now q == quotient and ta == remainder */
+  n  = a->sign;
+  n2 = (a->sign == b->sign ? MP_ZPOS : MP_NEG);
+  if (c != NULL) {
+     mp_exch(c, &q);
+     c->sign  = (mp_iszero(c) == MP_YES) ? MP_ZPOS : n2;
+  }
+  if (d != NULL) {
+     mp_exch(d, &ta);
+     d->sign = (mp_iszero(d) == MP_YES) ? MP_ZPOS : n;
+  }
+LBL_ERR:
+   mp_clear(&ta);
+   mp_clear(&tb);
+   mp_clear(&tq);
+   mp_clear(&q);
+   return res;
+}
+
+
+/* b = a/2 */
+int mp_div_2(mp_int * a, mp_int * b)
+{
+  int     x, res, oldused;
+
+  /* copy */
+  if (b->alloc < a->used) {
+    if ((res = mp_grow (b, a->used)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  oldused = b->used;
+  b->used = a->used;
+  {
+    register mp_digit r, rr, *tmpa, *tmpb;
+
+    /* source alias */
+    tmpa = a->dp + b->used - 1;
+
+    /* dest alias */
+    tmpb = b->dp + b->used - 1;
+
+    /* carry */
+    r = 0;
+    for (x = b->used - 1; x >= 0; x--) {
+      /* get the carry for the next iteration */
+      rr = *tmpa & 1;
+
+      /* shift the current digit, add in carry and store */
+      *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1));
+
+      /* forward carry to next iteration */
+      r = rr;
+    }
+
+    /* zero excess digits */
+    tmpb = b->dp + b->used;
+    for (x = b->used; x < oldused; x++) {
+      *tmpb++ = 0;
+    }
+  }
+  b->sign = a->sign;
+  mp_clamp (b);
+  return MP_OKAY;
+}
+
+
+/* high level addition (handles signs) */
+int mp_add (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     sa, sb, res;
+
+  /* get sign of both inputs */
+  sa = a->sign;
+  sb = b->sign;
+
+  /* handle two cases, not four */
+  if (sa == sb) {
+    /* both positive or both negative */
+    /* add their magnitudes, copy the sign */
+    c->sign = sa;
+    res = s_mp_add (a, b, c);
+  } else {
+    /* one positive, the other negative */
+    /* subtract the one with the greater magnitude from */
+    /* the one of the lesser magnitude.  The result gets */
+    /* the sign of the one with the greater magnitude. */
+    if (mp_cmp_mag (a, b) == MP_LT) {
+      c->sign = sb;
+      res = s_mp_sub (b, a, c);
+    } else {
+      c->sign = sa;
+      res = s_mp_sub (a, b, c);
+    }
+  }
+  return res;
+}
+
+
+/* low level addition, based on HAC pp.594, Algorithm 14.7 */
+int
+s_mp_add (mp_int * a, mp_int * b, mp_int * c)
+{
+  mp_int *x;
+  int     olduse, res, min, max;
+
+  /* find sizes, we let |a| <= |b| which means we have to sort
+   * them.  "x" will point to the input with the most digits
+   */
+  if (a->used > b->used) {
+    min = b->used;
+    max = a->used;
+    x = a;
+  } else {
+    min = a->used;
+    max = b->used;
+    x = b;
+  }
+
+  /* init result */
+  if (c->alloc < max + 1) {
+    if ((res = mp_grow (c, max + 1)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  /* get old used digit count and set new one */
+  olduse = c->used;
+  c->used = max + 1;
+
+  {
+    register mp_digit u, *tmpa, *tmpb, *tmpc;
+    register int i;
+
+    /* alias for digit pointers */
+
+    /* first input */
+    tmpa = a->dp;
+
+    /* second input */
+    tmpb = b->dp;
+
+    /* destination */
+    tmpc = c->dp;
+
+    /* zero the carry */
+    u = 0;
+    for (i = 0; i < min; i++) {
+      /* Compute the sum at one digit, T[i] = A[i] + B[i] + U */
+      *tmpc = *tmpa++ + *tmpb++ + u;
+
+      /* U = carry bit of T[i] */
+      u = *tmpc >> ((mp_digit)DIGIT_BIT);
+
+      /* take away carry bit from T[i] */
+      *tmpc++ &= MP_MASK;
+    }
+
+    /* now copy higher words if any, that is in A+B 
+     * if A or B has more digits add those in 
+     */
+    if (min != max) {
+      for (; i < max; i++) {
+        /* T[i] = X[i] + U */
+        *tmpc = x->dp[i] + u;
+
+        /* U = carry bit of T[i] */
+        u = *tmpc >> ((mp_digit)DIGIT_BIT);
+
+        /* take away carry bit from T[i] */
+        *tmpc++ &= MP_MASK;
+      }
+    }
+
+    /* add carry */
+    *tmpc++ = u;
+
+    /* clear digits above oldused */
+    for (i = c->used; i < olduse; i++) {
+      *tmpc++ = 0;
+    }
+  }
+
+  mp_clamp (c);
+  return MP_OKAY;
+}
+
+
+/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */
+int
+s_mp_sub (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     olduse, res, min, max;
+
+  /* find sizes */
+  min = b->used;
+  max = a->used;
+
+  /* init result */
+  if (c->alloc < max) {
+    if ((res = mp_grow (c, max)) != MP_OKAY) {
+      return res;
+    }
+  }
+  olduse = c->used;
+  c->used = max;
+
+  {
+    register mp_digit u, *tmpa, *tmpb, *tmpc;
+    register int i;
+
+    /* alias for digit pointers */
+    tmpa = a->dp;
+    tmpb = b->dp;
+    tmpc = c->dp;
+
+    /* set carry to zero */
+    u = 0;
+    for (i = 0; i < min; i++) {
+      /* T[i] = A[i] - B[i] - U */
+      *tmpc = *tmpa++ - *tmpb++ - u;
+
+      /* U = carry bit of T[i]
+       * Note this saves performing an AND operation since
+       * if a carry does occur it will propagate all the way to the
+       * MSB.  As a result a single shift is enough to get the carry
+       */
+      u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1));
+
+      /* Clear carry from T[i] */
+      *tmpc++ &= MP_MASK;
+    }
+
+    /* now copy higher words if any, e.g. if A has more digits than B  */
+    for (; i < max; i++) {
+      /* T[i] = A[i] - U */
+      *tmpc = *tmpa++ - u;
+
+      /* U = carry bit of T[i] */
+      u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1));
+
+      /* Clear carry from T[i] */
+      *tmpc++ &= MP_MASK;
+    }
+
+    /* clear digits above used (since we may not have grown result above) */
+    for (i = c->used; i < olduse; i++) {
+      *tmpc++ = 0;
+    }
+  }
+
+  mp_clamp (c);
+  return MP_OKAY;
+}
+
+
+/* high level subtraction (handles signs) */
+int
+mp_sub (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     sa, sb, res;
+
+  sa = a->sign;
+  sb = b->sign;
+
+  if (sa != sb) {
+    /* subtract a negative from a positive, OR */
+    /* subtract a positive from a negative. */
+    /* In either case, ADD their magnitudes, */
+    /* and use the sign of the first number. */
+    c->sign = sa;
+    res = s_mp_add (a, b, c);
+  } else {
+    /* subtract a positive from a positive, OR */
+    /* subtract a negative from a negative. */
+    /* First, take the difference between their */
+    /* magnitudes, then... */
+    if (mp_cmp_mag (a, b) != MP_LT) {
+      /* Copy the sign from the first */
+      c->sign = sa;
+      /* The first has a larger or equal magnitude */
+      res = s_mp_sub (a, b, c);
+    } else {
+      /* The result has the *opposite* sign from */
+      /* the first number. */
+      c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS;
+      /* The second has a larger magnitude */
+      res = s_mp_sub (b, a, c);
+    }
+  }
+  return res;
+}
+
+
+/* determines if reduce_2k_l can be used */
+int mp_reduce_is_2k_l(mp_int *a)
+{
+   int ix, iy;
+   
+   if (a->used == 0) {
+      return MP_NO;
+   } else if (a->used == 1) {
+      return MP_YES;
+   } else if (a->used > 1) {
+      /* if more than half of the digits are -1 we're sold */
+      for (iy = ix = 0; ix < a->used; ix++) {
+          if (a->dp[ix] == MP_MASK) {
+              ++iy;
+          }
+      }
+      return (iy >= (a->used/2)) ? MP_YES : MP_NO;
+      
+   }
+   return MP_NO;
+}
+
+
+/* determines if mp_reduce_2k can be used */
+int mp_reduce_is_2k(mp_int *a)
+{
+   int ix, iy, iw;
+   mp_digit iz;
+   
+   if (a->used == 0) {
+      return MP_NO;
+   } else if (a->used == 1) {
+      return MP_YES;
+   } else if (a->used > 1) {
+      iy = mp_count_bits(a);
+      iz = 1;
+      iw = 1;
+    
+      /* Test every bit from the second digit up, must be 1 */
+      for (ix = DIGIT_BIT; ix < iy; ix++) {
+          if ((a->dp[iw] & iz) == 0) {
+             return MP_NO;
+          }
+          iz <<= 1;
+          if (iz > (mp_digit)MP_MASK) {
+             ++iw;
+             iz = 1;
+          }
+      }
+   }
+   return MP_YES;
+}
+
+
+/* determines if a number is a valid DR modulus */
+int mp_dr_is_modulus(mp_int *a)
+{
+   int ix;
+
+   /* must be at least two digits */
+   if (a->used < 2) {
+      return 0;
+   }
+
+   /* must be of the form b**k - a [a <= b] so all
+    * but the first digit must be equal to -1 (mod b).
+    */
+   for (ix = 1; ix < a->used; ix++) {
+       if (a->dp[ix] != MP_MASK) {
+          return 0;
+       }
+   }
+   return 1;
+}
+
+
+/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85
+ *
+ * Uses a left-to-right k-ary sliding window to compute the modular
+ * exponentiation.
+ * The value of k changes based on the size of the exponent.
+ *
+ * Uses Montgomery or Diminished Radix reduction [whichever appropriate]
+ */
+
+#ifdef MP_LOW_MEM
+   #define TAB_SIZE 32
+#else
+   #define TAB_SIZE 256
+#endif
+
+int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y,
+                     int redmode)
+{
+  mp_int  M[TAB_SIZE], res;
+  mp_digit buf, mp;
+  int     err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
+
+  /* use a pointer to the reduction algorithm.  This allows us to use
+   * one of many reduction algorithms without modding the guts of
+   * the code with if statements everywhere.
+   */
+  int     (*redux)(mp_int*,mp_int*,mp_digit);
+
+  /* find window size */
+  x = mp_count_bits (X);
+  if (x <= 7) {
+    winsize = 2;
+  } else if (x <= 36) {
+    winsize = 3;
+  } else if (x <= 140) {
+    winsize = 4;
+  } else if (x <= 450) {
+    winsize = 5;
+  } else if (x <= 1303) {
+    winsize = 6;
+  } else if (x <= 3529) {
+    winsize = 7;
+  } else {
+    winsize = 8;
+  }
+
+#ifdef MP_LOW_MEM
+  if (winsize > 5) {
+     winsize = 5;
+  }
+#endif
+
+  /* init M array */
+  /* init first cell */
+  if ((err = mp_init(&M[1])) != MP_OKAY) {
+     return err;
+  }
+
+  /* now init the second half of the array */
+  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
+    if ((err = mp_init(&M[x])) != MP_OKAY) {
+      for (y = 1<<(winsize-1); y < x; y++) {
+        mp_clear (&M[y]);
+      }
+      mp_clear(&M[1]);
+      return err;
+    }
+  }
+
+  /* determine and setup reduction code */
+  if (redmode == 0) {
+#ifdef BN_MP_MONTGOMERY_SETUP_C     
+     /* now setup montgomery  */
+     if ((err = mp_montgomery_setup (P, &mp)) != MP_OKAY) {
+        goto LBL_M;
+     }
+#else
+     err = MP_VAL;
+     goto LBL_M;
+#endif
+
+     /* automatically pick the comba one if available (saves quite a few
+        calls/ifs) */
+#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
+     if (((P->used * 2 + 1) < MP_WARRAY) &&
+          P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
+        redux = fast_mp_montgomery_reduce;
+     } else 
+#endif
+     {
+#ifdef BN_MP_MONTGOMERY_REDUCE_C
+        /* use slower baseline Montgomery method */
+        redux = mp_montgomery_reduce;
+#else
+        err = MP_VAL;
+        goto LBL_M;
+#endif
+     }
+  } else if (redmode == 1) {
+#if defined(BN_MP_DR_SETUP_C) && defined(BN_MP_DR_REDUCE_C)
+     /* setup DR reduction for moduli of the form B**k - b */
+     mp_dr_setup(P, &mp);
+     redux = mp_dr_reduce;
+#else
+     err = MP_VAL;
+     goto LBL_M;
+#endif
+  } else {
+#if defined(BN_MP_REDUCE_2K_SETUP_C) && defined(BN_MP_REDUCE_2K_C)
+     /* setup DR reduction for moduli of the form 2**k - b */
+     if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) {
+        goto LBL_M;
+     }
+     redux = mp_reduce_2k;
+#else
+     err = MP_VAL;
+     goto LBL_M;
+#endif
+  }
+
+  /* setup result */
+  if ((err = mp_init (&res)) != MP_OKAY) {
+    goto LBL_M;
+  }
+
+  /* create M table
+   *
+
+   *
+   * The first half of the table is not computed though accept for M[0] and M[1]
+   */
+
+  if (redmode == 0) {
+#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
+     /* now we need R mod m */
+     if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) {
+       goto LBL_RES;
+     }
+#else 
+     err = MP_VAL;
+     goto LBL_RES;
+#endif
+
+     /* now set M[1] to G * R mod m */
+     if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) {
+       goto LBL_RES;
+     }
+  } else {
+     mp_set(&res, 1);
+     if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
+        goto LBL_RES;
+     }
+  }
+
+  /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times*/
+  if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
+    goto LBL_RES;
+  }
+
+  for (x = 0; x < (winsize - 1); x++) {
+    if ((err = mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {
+      goto LBL_RES;
+    }
+    if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) {
+      goto LBL_RES;
+    }
+  }
+
+  /* create upper table */
+  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
+    if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
+      goto LBL_RES;
+    }
+    if ((err = redux (&M[x], P, mp)) != MP_OKAY) {
+      goto LBL_RES;
+    }
+  }
+
+  /* set initial mode and bit cnt */
+  mode   = 0;
+  bitcnt = 1;
+  buf    = 0;
+  digidx = X->used - 1;
+  bitcpy = 0;
+  bitbuf = 0;
+
+  for (;;) {
+    /* grab next digit as required */
+    if (--bitcnt == 0) {
+      /* if digidx == -1 we are out of digits so break */
+      if (digidx == -1) {
+        break;
+      }
+      /* read next digit and reset bitcnt */
+      buf    = X->dp[digidx--];
+      bitcnt = (int)DIGIT_BIT;
+    }
+
+    /* grab the next msb from the exponent */
+    y     = (mp_digit)(buf >> (DIGIT_BIT - 1)) & 1;
+    buf <<= (mp_digit)1;
+
+    /* if the bit is zero and mode == 0 then we ignore it
+     * These represent the leading zero bits before the first 1 bit
+     * in the exponent.  Technically this opt is not required but it
+     * does lower the # of trivial squaring/reductions used
+     */
+    if (mode == 0 && y == 0) {
+      continue;
+    }
+
+    /* if the bit is zero and mode == 1 then we square */
+    if (mode == 1 && y == 0) {
+      if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, mp)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      continue;
+    }
+
+    /* else we add it to the window */
+    bitbuf |= (y << (winsize - ++bitcpy));
+    mode    = 2;
+
+    if (bitcpy == winsize) {
+      /* ok window is filled so square as required and multiply  */
+      /* square first */
+      for (x = 0; x < winsize; x++) {
+        if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+        if ((err = redux (&res, P, mp)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+      }
+
+      /* then multiply */
+      if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, mp)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+
+      /* empty window and reset */
+      bitcpy = 0;
+      bitbuf = 0;
+      mode   = 1;
+    }
+  }
+
+  /* if bits remain then square/multiply */
+  if (mode == 2 && bitcpy > 0) {
+    /* square then multiply if the bit is set */
+    for (x = 0; x < bitcpy; x++) {
+      if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, mp)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+
+      /* get next bit of the window */
+      bitbuf <<= 1;
+      if ((bitbuf & (1 << winsize)) != 0) {
+        /* then multiply */
+        if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+        if ((err = redux (&res, P, mp)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+      }
+    }
+  }
+
+  if (redmode == 0) {
+     /* fixup result if Montgomery reduction is used
+      * recall that any value in a Montgomery system is
+      * actually multiplied by R mod n.  So we have
+      * to reduce one more time to cancel out the factor
+      * of R.
+      */
+     if ((err = redux(&res, P, mp)) != MP_OKAY) {
+       goto LBL_RES;
+     }
+  }
+
+  /* swap res with Y */
+  mp_exch (&res, Y);
+  err = MP_OKAY;
+LBL_RES:mp_clear (&res);
+LBL_M:
+  mp_clear(&M[1]);
+  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
+    mp_clear (&M[x]);
+  }
+  return err;
+}
+
+
+/* setups the montgomery reduction stuff */
+int
+mp_montgomery_setup (mp_int * n, mp_digit * rho)
+{
+  mp_digit x, b;
+
+/* fast inversion mod 2**k
+ *
+ * Based on the fact that
+ *
+ * XA = 1 (mod 2**n)  =>  (X(2-XA)) A = 1 (mod 2**2n)
+ *                    =>  2*X*A - X*X*A*A = 1
+ *                    =>  2*(1) - (1)     = 1
+ */
+  b = n->dp[0];
+
+  if ((b & 1) == 0) {
+    return MP_VAL;
+  }
+
+  x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */
+  x *= 2 - b * x;               /* here x*a==1 mod 2**8 */
+#if !defined(MP_8BIT)
+  x *= 2 - b * x;               /* here x*a==1 mod 2**16 */
+#endif
+#if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT))
+  x *= 2 - b * x;               /* here x*a==1 mod 2**32 */
+#endif
+#ifdef MP_64BIT
+  x *= 2 - b * x;               /* here x*a==1 mod 2**64 */
+#endif
+
+  /* rho = -1/m mod b */
+  /* TAO, switched mp_word casts to mp_digit to shut up compiler */
+  *rho = (((mp_digit)1 << ((mp_digit) DIGIT_BIT)) - x) & MP_MASK;
+
+  return MP_OKAY;
+}
+
+
+/* computes xR**-1 == x (mod N) via Montgomery Reduction
+ *
+ * This is an optimized implementation of montgomery_reduce
+ * which uses the comba method to quickly calculate the columns of the
+ * reduction.
+ *
+ * Based on Algorithm 14.32 on pp.601 of HAC.
+*/
+int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
+{
+  int     ix, res, olduse;
+#ifdef CYASSL_SMALL_STACK
+  mp_word* W;    /* uses dynamic memory and slower */
+#else
+  mp_word W[MP_WARRAY];
+#endif
+
+  /* get old used count */
+  olduse = x->used;
+
+  /* grow a as required */
+  if (x->alloc < n->used + 1) {
+    if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+#ifdef CYASSL_SMALL_STACK
+  W = (mp_word*)XMALLOC(sizeof(mp_word) * MP_WARRAY, 0, DYNAMIC_TYPE_BIGINT);
+  if (W == NULL)    
+    return MP_MEM;
+#endif
+
+  /* first we have to get the digits of the input into
+   * an array of double precision words W[...]
+   */
+  {
+    register mp_word *_W;
+    register mp_digit *tmpx;
+
+    /* alias for the W[] array */
+    _W   = W;
+
+    /* alias for the digits of  x*/
+    tmpx = x->dp;
+
+    /* copy the digits of a into W[0..a->used-1] */
+    for (ix = 0; ix < x->used; ix++) {
+      *_W++ = *tmpx++;
+    }
+
+    /* zero the high words of W[a->used..m->used*2] */
+    for (; ix < n->used * 2 + 1; ix++) {
+      *_W++ = 0;
+    }
+  }
+
+  /* now we proceed to zero successive digits
+   * from the least significant upwards
+   */
+  for (ix = 0; ix < n->used; ix++) {
+    /* mu = ai * m' mod b
+     *
+     * We avoid a double precision multiplication (which isn't required)
+     * by casting the value down to a mp_digit.  Note this requires
+     * that W[ix-1] have  the carry cleared (see after the inner loop)
+     */
+    register mp_digit mu;
+    mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK);
+
+    /* a = a + mu * m * b**i
+     *
+     * This is computed in place and on the fly.  The multiplication
+     * by b**i is handled by offseting which columns the results
+     * are added to.
+     *
+     * Note the comba method normally doesn't handle carries in the
+     * inner loop In this case we fix the carry from the previous
+     * column since the Montgomery reduction requires digits of the
+     * result (so far) [see above] to work.  This is
+     * handled by fixing up one carry after the inner loop.  The
+     * carry fixups are done in order so after these loops the
+     * first m->used words of W[] have the carries fixed
+     */
+    {
+      register int iy;
+      register mp_digit *tmpn;
+      register mp_word *_W;
+
+      /* alias for the digits of the modulus */
+      tmpn = n->dp;
+
+      /* Alias for the columns set by an offset of ix */
+      _W = W + ix;
+
+      /* inner loop */
+      for (iy = 0; iy < n->used; iy++) {
+          *_W++ += ((mp_word)mu) * ((mp_word)*tmpn++);
+      }
+    }
+
+    /* now fix carry for next digit, W[ix+1] */
+    W[ix + 1] += W[ix] >> ((mp_word) DIGIT_BIT);
+  }
+
+  /* now we have to propagate the carries and
+   * shift the words downward [all those least
+   * significant digits we zeroed].
+   */
+  {
+    register mp_digit *tmpx;
+    register mp_word *_W, *_W1;
+
+    /* nox fix rest of carries */
+
+    /* alias for current word */
+    _W1 = W + ix;
+
+    /* alias for next word, where the carry goes */
+    _W = W + ++ix;
+
+    for (; ix <= n->used * 2 + 1; ix++) {
+      *_W++ += *_W1++ >> ((mp_word) DIGIT_BIT);
+    }
+
+    /* copy out, A = A/b**n
+     *
+     * The result is A/b**n but instead of converting from an
+     * array of mp_word to mp_digit than calling mp_rshd
+     * we just copy them in the right order
+     */
+
+    /* alias for destination word */
+    tmpx = x->dp;
+
+    /* alias for shifted double precision result */
+    _W = W + n->used;
+
+    for (ix = 0; ix < n->used + 1; ix++) {
+      *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK));
+    }
+
+    /* zero oldused digits, if the input a was larger than
+     * m->used+1 we'll have to clear the digits
+     */
+    for (; ix < olduse; ix++) {
+      *tmpx++ = 0;
+    }
+  }
+
+  /* set the max used and clamp */
+  x->used = n->used + 1;
+  mp_clamp (x);
+
+#ifdef CYASSL_SMALL_STACK
+  XFREE(W, 0, DYNAMIC_TYPE_BIGINT);
+#endif
+
+  /* if A >= m then A = A - m */
+  if (mp_cmp_mag (x, n) != MP_LT) {
+    return s_mp_sub (x, n, x);
+  }
+  return MP_OKAY;
+}
+
+
+/* computes xR**-1 == x (mod N) via Montgomery Reduction */
+int
+mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
+{
+  int     ix, res, digs;
+  mp_digit mu;
+
+  /* can the fast reduction [comba] method be used?
+   *
+   * Note that unlike in mul you're safely allowed *less*
+   * than the available columns [255 per default] since carries
+   * are fixed up in the inner loop.
+   */
+  digs = n->used * 2 + 1;
+  if ((digs < MP_WARRAY) &&
+      n->used <
+      (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
+    return fast_mp_montgomery_reduce (x, n, rho);
+  }
+
+  /* grow the input as required */
+  if (x->alloc < digs) {
+    if ((res = mp_grow (x, digs)) != MP_OKAY) {
+      return res;
+    }
+  }
+  x->used = digs;
+
+  for (ix = 0; ix < n->used; ix++) {
+    /* mu = ai * rho mod b
+     *
+     * The value of rho must be precalculated via
+     * montgomery_setup() such that
+     * it equals -1/n0 mod b this allows the
+     * following inner loop to reduce the
+     * input one digit at a time
+     */
+    mu = (mp_digit) (((mp_word)x->dp[ix]) * ((mp_word)rho) & MP_MASK);
+
+    /* a = a + mu * m * b**i */
+    {
+      register int iy;
+      register mp_digit *tmpn, *tmpx, u;
+      register mp_word r;
+
+      /* alias for digits of the modulus */
+      tmpn = n->dp;
+
+      /* alias for the digits of x [the input] */
+      tmpx = x->dp + ix;
+
+      /* set the carry to zero */
+      u = 0;
+
+      /* Multiply and add in place */
+      for (iy = 0; iy < n->used; iy++) {
+        /* compute product and sum */
+        r       = ((mp_word)mu) * ((mp_word)*tmpn++) +
+                  ((mp_word) u) + ((mp_word) * tmpx);
+
+        /* get carry */
+        u       = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
+
+        /* fix digit */
+        *tmpx++ = (mp_digit)(r & ((mp_word) MP_MASK));
+      }
+      /* At this point the ix'th digit of x should be zero */
+
+
+      /* propagate carries upwards as required*/
+      while (u) {
+        *tmpx   += u;
+        u        = *tmpx >> DIGIT_BIT;
+        *tmpx++ &= MP_MASK;
+      }
+    }
+  }
+
+  /* at this point the n.used'th least
+   * significant digits of x are all zero
+   * which means we can shift x to the
+   * right by n.used digits and the
+   * residue is unchanged.
+   */
+
+  /* x = x/b**n.used */
+  mp_clamp(x);
+  mp_rshd (x, n->used);
+
+  /* if x >= n then x = x - n */
+  if (mp_cmp_mag (x, n) != MP_LT) {
+    return s_mp_sub (x, n, x);
+  }
+
+  return MP_OKAY;
+}
+
+
+/* determines the setup value */
+void mp_dr_setup(mp_int *a, mp_digit *d)
+{
+   /* the casts are required if DIGIT_BIT is one less than
+    * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
+    */
+   *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) - 
+        ((mp_word)a->dp[0]));
+}
+
+
+/* reduce "x" in place modulo "n" using the Diminished Radix algorithm.
+ *
+ * Based on algorithm from the paper
+ *
+ * "Generating Efficient Primes for Discrete Log Cryptosystems"
+ *                 Chae Hoon Lim, Pil Joong Lee,
+ *          POSTECH Information Research Laboratories
+ *
+ * The modulus must be of a special format [see manual]
+ *
+ * Has been modified to use algorithm 7.10 from the LTM book instead
+ *
+ * Input x must be in the range 0 <= x <= (n-1)**2
+ */
+int
+mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k)
+{
+  int      err, i, m;
+  mp_word  r;
+  mp_digit mu, *tmpx1, *tmpx2;
+
+  /* m = digits in modulus */
+  m = n->used;
+
+  /* ensure that "x" has at least 2m digits */
+  if (x->alloc < m + m) {
+    if ((err = mp_grow (x, m + m)) != MP_OKAY) {
+      return err;
+    }
+  }
+
+/* top of loop, this is where the code resumes if
+ * another reduction pass is required.
+ */
+top:
+  /* aliases for digits */
+  /* alias for lower half of x */
+  tmpx1 = x->dp;
+
+  /* alias for upper half of x, or x/B**m */
+  tmpx2 = x->dp + m;
+
+  /* set carry to zero */
+  mu = 0;
+
+  /* compute (x mod B**m) + k * [x/B**m] inline and inplace */
+  for (i = 0; i < m; i++) {
+      r         = ((mp_word)*tmpx2++) * ((mp_word)k) + *tmpx1 + mu;
+      *tmpx1++  = (mp_digit)(r & MP_MASK);
+      mu        = (mp_digit)(r >> ((mp_word)DIGIT_BIT));
+  }
+
+  /* set final carry */
+  *tmpx1++ = mu;
+
+  /* zero words above m */
+  for (i = m + 1; i < x->used; i++) {
+      *tmpx1++ = 0;
+  }
+
+  /* clamp, sub and return */
+  mp_clamp (x);
+
+  /* if x >= n then subtract and reduce again
+   * Each successive "recursion" makes the input smaller and smaller.
+   */
+  if (mp_cmp_mag (x, n) != MP_LT) {
+    s_mp_sub(x, n, x);
+    goto top;
+  }
+  return MP_OKAY;
+}
+
+
+/* reduces a modulo n where n is of the form 2**p - d */
+int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d)
+{
+   mp_int q;
+   int    p, res;
+   
+   if ((res = mp_init(&q)) != MP_OKAY) {
+      return res;
+   }
+   
+   p = mp_count_bits(n);    
+top:
+   /* q = a/2**p, a = a mod 2**p */
+   if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) {
+      goto ERR;
+   }
+   
+   if (d != 1) {
+      /* q = q * d */
+      if ((res = mp_mul_d(&q, d, &q)) != MP_OKAY) { 
+         goto ERR;
+      }
+   }
+   
+   /* a = a + q */
+   if ((res = s_mp_add(a, &q, a)) != MP_OKAY) {
+      goto ERR;
+   }
+   
+   if (mp_cmp_mag(a, n) != MP_LT) {
+      s_mp_sub(a, n, a);
+      goto top;
+   }
+   
+ERR:
+   mp_clear(&q);
+   return res;
+}
+
+
+/* determines the setup value */
+int mp_reduce_2k_setup(mp_int *a, mp_digit *d)
+{
+   int res, p;
+   mp_int tmp;
+   
+   if ((res = mp_init(&tmp)) != MP_OKAY) {
+      return res;
+   }
+   
+   p = mp_count_bits(a);
+   if ((res = mp_2expt(&tmp, p)) != MP_OKAY) {
+      mp_clear(&tmp);
+      return res;
+   }
+   
+   if ((res = s_mp_sub(&tmp, a, &tmp)) != MP_OKAY) {
+      mp_clear(&tmp);
+      return res;
+   }
+   
+   *d = tmp.dp[0];
+   mp_clear(&tmp);
+   return MP_OKAY;
+}
+
+
+/* computes a = 2**b 
+ *
+ * Simple algorithm which zeroes the int, grows it then just sets one bit
+ * as required.
+ */
+int
+mp_2expt (mp_int * a, int b)
+{
+  int     res;
+
+  /* zero a as per default */
+  mp_zero (a);
+
+  /* grow a to accomodate the single bit */
+  if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) {
+    return res;
+  }
+
+  /* set the used count of where the bit will go */
+  a->used = b / DIGIT_BIT + 1;
+
+  /* put the single bit in its place */
+  a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT);
+
+  return MP_OKAY;
+}
+
+
+/* multiply by a digit */
+int
+mp_mul_d (mp_int * a, mp_digit b, mp_int * c)
+{
+  mp_digit u, *tmpa, *tmpc;
+  mp_word  r;
+  int      ix, res, olduse;
+
+  /* make sure c is big enough to hold a*b */
+  if (c->alloc < a->used + 1) {
+    if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  /* get the original destinations used count */
+  olduse = c->used;
+
+  /* set the sign */
+  c->sign = a->sign;
+
+  /* alias for a->dp [source] */
+  tmpa = a->dp;
+
+  /* alias for c->dp [dest] */
+  tmpc = c->dp;
+
+  /* zero carry */
+  u = 0;
+
+  /* compute columns */
+  for (ix = 0; ix < a->used; ix++) {
+    /* compute product and carry sum for this term */
+    r       = ((mp_word) u) + ((mp_word)*tmpa++) * ((mp_word)b);
+
+    /* mask off higher bits to get a single digit */
+    *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK));
+
+    /* send carry into next iteration */
+    u       = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
+  }
+
+  /* store final carry [if any] and increment ix offset  */
+  *tmpc++ = u;
+  ++ix;
+
+  /* now zero digits above the top */
+  while (ix++ < olduse) {
+     *tmpc++ = 0;
+  }
+
+  /* set used count */
+  c->used = a->used + 1;
+  mp_clamp(c);
+
+  return MP_OKAY;
+}
+
+
+/* d = a * b (mod c) */
+int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
+{
+  int     res;
+  mp_int  t;
+
+  if ((res = mp_init (&t)) != MP_OKAY) {
+    return res;
+  }
+
+  if ((res = mp_mul (a, b, &t)) != MP_OKAY) {
+    mp_clear (&t);
+    return res;
+  }
+  res = mp_mod (&t, c, d);
+  mp_clear (&t);
+  return res;
+}
+
+
+/* computes b = a*a */
+int
+mp_sqr (mp_int * a, mp_int * b)
+{
+  int     res;
+
+  {
+#ifdef BN_FAST_S_MP_SQR_C
+    /* can we use the fast comba multiplier? */
+    if ((a->used * 2 + 1) < MP_WARRAY && 
+         a->used < 
+         (1 << (sizeof(mp_word) * CHAR_BIT - 2*DIGIT_BIT - 1))) {
+      res = fast_s_mp_sqr (a, b);
+    } else
+#endif
+#ifdef BN_S_MP_SQR_C
+      res = s_mp_sqr (a, b);
+#else
+      res = MP_VAL;
+#endif
+  }
+  b->sign = MP_ZPOS;
+  return res;
+}
+
+
+/* high level multiplication (handles sign) */
+int mp_mul (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     res, neg;
+  neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
+
+  {
+    /* can we use the fast multiplier?
+     *
+     * The fast multiplier can be used if the output will 
+     * have less than MP_WARRAY digits and the number of 
+     * digits won't affect carry propagation
+     */
+    int     digs = a->used + b->used + 1;
+
+#ifdef BN_FAST_S_MP_MUL_DIGS_C
+    if ((digs < MP_WARRAY) &&
+        MIN(a->used, b->used) <= 
+        (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
+      res = fast_s_mp_mul_digs (a, b, c, digs);
+    } else 
+#endif
+#ifdef BN_S_MP_MUL_DIGS_C
+      res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */
+#else
+      res = MP_VAL;
+#endif
+
+  }
+  c->sign = (c->used > 0) ? neg : MP_ZPOS;
+  return res;
+}
+
+
+/* b = a*2 */
+int mp_mul_2(mp_int * a, mp_int * b)
+{
+  int     x, res, oldused;
+
+  /* grow to accomodate result */
+  if (b->alloc < a->used + 1) {
+    if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  oldused = b->used;
+  b->used = a->used;
+
+  {
+    register mp_digit r, rr, *tmpa, *tmpb;
+
+    /* alias for source */
+    tmpa = a->dp;
+    
+    /* alias for dest */
+    tmpb = b->dp;
+
+    /* carry */
+    r = 0;
+    for (x = 0; x < a->used; x++) {
+    
+      /* get what will be the *next* carry bit from the 
+       * MSB of the current digit 
+       */
+      rr = *tmpa >> ((mp_digit)(DIGIT_BIT - 1));
+      
+      /* now shift up this digit, add in the carry [from the previous] */
+      *tmpb++ = ((*tmpa++ << ((mp_digit)1)) | r) & MP_MASK;
+      
+      /* copy the carry that would be from the source 
+       * digit into the next iteration 
+       */
+      r = rr;
+    }
+
+    /* new leading digit? */
+    if (r != 0) {
+      /* add a MSB which is always 1 at this point */
+      *tmpb = 1;
+      ++(b->used);
+    }
+
+    /* now zero any excess digits on the destination 
+     * that we didn't write to 
+     */
+    tmpb = b->dp + b->used;
+    for (x = b->used; x < oldused; x++) {
+      *tmpb++ = 0;
+    }
+  }
+  b->sign = a->sign;
+  return MP_OKAY;
+}
+
+
+/* divide by three (based on routine from MPI and the GMP manual) */
+int
+mp_div_3 (mp_int * a, mp_int *c, mp_digit * d)
+{
+  mp_int   q;
+  mp_word  w, t;
+  mp_digit b;
+  int      res, ix;
+  
+  /* b = 2**DIGIT_BIT / 3 */
+  b = (((mp_word)1) << ((mp_word)DIGIT_BIT)) / ((mp_word)3);
+
+  if ((res = mp_init_size(&q, a->used)) != MP_OKAY) {
+     return res;
+  }
+  
+  q.used = a->used;
+  q.sign = a->sign;
+  w = 0;
+  for (ix = a->used - 1; ix >= 0; ix--) {
+     w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]);
+
+     if (w >= 3) {
+        /* multiply w by [1/3] */
+        t = (w * ((mp_word)b)) >> ((mp_word)DIGIT_BIT);
+
+        /* now subtract 3 * [w/3] from w, to get the remainder */
+        w -= t+t+t;
+
+        /* fixup the remainder as required since
+         * the optimization is not exact.
+         */
+        while (w >= 3) {
+           t += 1;
+           w -= 3;
+        }
+      } else {
+        t = 0;
+      }
+      q.dp[ix] = (mp_digit)t;
+  }
+
+  /* [optional] store the remainder */
+  if (d != NULL) {
+     *d = (mp_digit)w;
+  }
+
+  /* [optional] store the quotient */
+  if (c != NULL) {
+     mp_clamp(&q);
+     mp_exch(&q, c);
+  }
+  mp_clear(&q);
+  
+  return res;
+}
+
+
+/* init an mp_init for a given size */
+int mp_init_size (mp_int * a, int size)
+{
+  int x;
+
+  /* pad size so there are always extra digits */
+  size += (MP_PREC * 2) - (size % MP_PREC);    
+  
+  /* alloc mem */
+  a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size, 0,
+                                      DYNAMIC_TYPE_BIGINT);
+  if (a->dp == NULL) {
+    return MP_MEM;
+  }
+
+  /* set the members */
+  a->used  = 0;
+  a->alloc = size;
+  a->sign  = MP_ZPOS;
+
+  /* zero the digits */
+  for (x = 0; x < size; x++) {
+      a->dp[x] = 0;
+  }
+
+  return MP_OKAY;
+}
+
+
+/* the jist of squaring...
+ * you do like mult except the offset of the tmpx [one that 
+ * starts closer to zero] can't equal the offset of tmpy.  
+ * So basically you set up iy like before then you min it with
+ * (ty-tx) so that it never happens.  You double all those 
+ * you add in the inner loop
+
+After that loop you do the squares and add them in.
+*/
+
+int fast_s_mp_sqr (mp_int * a, mp_int * b)
+{
+  int       olduse, res, pa, ix, iz;
+#ifdef CYASSL_SMALL_STACK
+  mp_digit* W;    /* uses dynamic memory and slower */
+#else
+  mp_digit W[MP_WARRAY];
+#endif
+  mp_digit  *tmpx;
+  mp_word   W1;
+
+  /* grow the destination as required */
+  pa = a->used + a->used;
+  if (b->alloc < pa) {
+    if ((res = mp_grow (b, pa)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  if (pa > MP_WARRAY)
+    return MP_RANGE;  /* TAO range check */
+
+#ifdef CYASSL_SMALL_STACK
+  W = (mp_digit*)XMALLOC(sizeof(mp_digit) * MP_WARRAY, 0, DYNAMIC_TYPE_BIGINT);
+  if (W == NULL)    
+    return MP_MEM;
+#endif
+
+  /* number of output digits to produce */
+  W1 = 0;
+  for (ix = 0; ix < pa; ix++) { 
+      int      tx, ty, iy;
+      mp_word  _W;
+      mp_digit *tmpy;
+
+      /* clear counter */
+      _W = 0;
+
+      /* get offsets into the two bignums */
+      ty = MIN(a->used-1, ix);
+      tx = ix - ty;
+
+      /* setup temp aliases */
+      tmpx = a->dp + tx;
+      tmpy = a->dp + ty;
+
+      /* this is the number of times the loop will iterrate, essentially
+         while (tx++ < a->used && ty-- >= 0) { ... }
+       */
+      iy = MIN(a->used-tx, ty+1);
+
+      /* now for squaring tx can never equal ty 
+       * we halve the distance since they approach at a rate of 2x
+       * and we have to round because odd cases need to be executed
+       */
+      iy = MIN(iy, (ty-tx+1)>>1);
+
+      /* execute loop */
+      for (iz = 0; iz < iy; iz++) {
+         _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);
+      }
+
+      /* double the inner product and add carry */
+      _W = _W + _W + W1;
+
+      /* even columns have the square term in them */
+      if ((ix&1) == 0) {
+         _W += ((mp_word)a->dp[ix>>1])*((mp_word)a->dp[ix>>1]);
+      }
+
+      /* store it */
+      W[ix] = (mp_digit)(_W & MP_MASK);
+
+      /* make next carry */
+      W1 = _W >> ((mp_word)DIGIT_BIT);
+  }
+
+  /* setup dest */
+  olduse  = b->used;
+  b->used = a->used+a->used;
+
+  {
+    mp_digit *tmpb;
+    tmpb = b->dp;
+    for (ix = 0; ix < pa; ix++) {
+      *tmpb++ = W[ix] & MP_MASK;
+    }
+
+    /* clear unused digits [that existed in the old copy of c] */
+    for (; ix < olduse; ix++) {
+      *tmpb++ = 0;
+    }
+  }
+  mp_clamp (b);
+
+#ifdef CYASSL_SMALL_STACK
+  XFREE(W, 0, DYNAMIC_TYPE_BIGINT);
+#endif
+
+  return MP_OKAY;
+}
+
+
+/* Fast (comba) multiplier
+ *
+ * This is the fast column-array [comba] multiplier.  It is 
+ * designed to compute the columns of the product first 
+ * then handle the carries afterwards.  This has the effect 
+ * of making the nested loops that compute the columns very
+ * simple and schedulable on super-scalar processors.
+ *
+ * This has been modified to produce a variable number of 
+ * digits of output so if say only a half-product is required 
+ * you don't have to compute the upper half (a feature 
+ * required for fast Barrett reduction).
+ *
+ * Based on Algorithm 14.12 on pp.595 of HAC.
+ *
+ */
+int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
+{
+  int     olduse, res, pa, ix, iz;
+#ifdef CYASSL_SMALL_STACK
+  mp_digit* W;    /* uses dynamic memory and slower */
+#else
+  mp_digit W[MP_WARRAY];
+#endif
+  register mp_word  _W;
+
+  /* grow the destination as required */
+  if (c->alloc < digs) {
+    if ((res = mp_grow (c, digs)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  /* number of output digits to produce */
+  pa = MIN(digs, a->used + b->used);
+  if (pa > MP_WARRAY)
+    return MP_RANGE;  /* TAO range check */
+
+#ifdef CYASSL_SMALL_STACK
+  W = (mp_digit*)XMALLOC(sizeof(mp_digit) * MP_WARRAY, 0, DYNAMIC_TYPE_BIGINT);
+  if (W == NULL)    
+    return MP_MEM;
+#endif
+
+  /* clear the carry */
+  _W = 0;
+  for (ix = 0; ix < pa; ix++) { 
+      int      tx, ty;
+      int      iy;
+      mp_digit *tmpx, *tmpy;
+
+      /* get offsets into the two bignums */
+      ty = MIN(b->used-1, ix);
+      tx = ix - ty;
+
+      /* setup temp aliases */
+      tmpx = a->dp + tx;
+      tmpy = b->dp + ty;
+
+      /* this is the number of times the loop will iterrate, essentially 
+         while (tx++ < a->used && ty-- >= 0) { ... }
+       */
+      iy = MIN(a->used-tx, ty+1);
+
+      /* execute loop */
+      for (iz = 0; iz < iy; ++iz) {
+         _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);
+
+      }
+
+      /* store term */
+      W[ix] = ((mp_digit)_W) & MP_MASK;
+
+      /* make next carry */
+      _W = _W >> ((mp_word)DIGIT_BIT);
+ }
+
+  /* setup dest */
+  olduse  = c->used;
+  c->used = pa;
+
+  {
+    register mp_digit *tmpc;
+    tmpc = c->dp;
+    for (ix = 0; ix < pa+1; ix++) {
+      /* now extract the previous digit [below the carry] */
+      *tmpc++ = W[ix];
+    }
+
+    /* clear unused digits [that existed in the old copy of c] */
+    for (; ix < olduse; ix++) {
+      *tmpc++ = 0;
+    }
+  }
+  mp_clamp (c);
+
+#ifdef CYASSL_SMALL_STACK
+  XFREE(W, 0, DYNAMIC_TYPE_BIGINT);
+#endif
+
+  return MP_OKAY;
+}
+
+
+/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */
+int s_mp_sqr (mp_int * a, mp_int * b)
+{
+  mp_int  t;
+  int     res, ix, iy, pa;
+  mp_word r;
+  mp_digit u, tmpx, *tmpt;
+
+  pa = a->used;
+  if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) {
+    return res;
+  }
+
+  /* default used is maximum possible size */
+  t.used = 2*pa + 1;
+
+  for (ix = 0; ix < pa; ix++) {
+    /* first calculate the digit at 2*ix */
+    /* calculate double precision result */
+    r = ((mp_word) t.dp[2*ix]) +
+        ((mp_word)a->dp[ix])*((mp_word)a->dp[ix]);
+
+    /* store lower part in result */
+    t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK));
+
+    /* get the carry */
+    u           = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
+
+    /* left hand side of A[ix] * A[iy] */
+    tmpx        = a->dp[ix];
+
+    /* alias for where to store the results */
+    tmpt        = t.dp + (2*ix + 1);
+    
+    for (iy = ix + 1; iy < pa; iy++) {
+      /* first calculate the product */
+      r       = ((mp_word)tmpx) * ((mp_word)a->dp[iy]);
+
+      /* now calculate the double precision result, note we use
+       * addition instead of *2 since it's easier to optimize
+       */
+      r       = ((mp_word) *tmpt) + r + r + ((mp_word) u);
+
+      /* store lower part */
+      *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
+
+      /* get carry */
+      u       = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
+    }
+    /* propagate upwards */
+    while (u != ((mp_digit) 0)) {
+      r       = ((mp_word) *tmpt) + ((mp_word) u);
+      *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
+      u       = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
+    }
+  }
+
+  mp_clamp (&t);
+  mp_exch (&t, b);
+  mp_clear (&t);
+  return MP_OKAY;
+}
+
+
+/* multiplies |a| * |b| and only computes upto digs digits of result
+ * HAC pp. 595, Algorithm 14.12  Modified so you can control how 
+ * many digits of output are created.
+ */
+int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
+{
+  mp_int  t;
+  int     res, pa, pb, ix, iy;
+  mp_digit u;
+  mp_word r;
+  mp_digit tmpx, *tmpt, *tmpy;
+
+  /* can we use the fast multiplier? */
+  if (((digs) < MP_WARRAY) &&
+      MIN (a->used, b->used) < 
+          (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
+    return fast_s_mp_mul_digs (a, b, c, digs);
+  }
+
+  if ((res = mp_init_size (&t, digs)) != MP_OKAY) {
+    return res;
+  }
+  t.used = digs;
+
+  /* compute the digits of the product directly */
+  pa = a->used;
+  for (ix = 0; ix < pa; ix++) {
+    /* set the carry to zero */
+    u = 0;
+
+    /* limit ourselves to making digs digits of output */
+    pb = MIN (b->used, digs - ix);
+
+    /* setup some aliases */
+    /* copy of the digit from a used within the nested loop */
+    tmpx = a->dp[ix];
+    
+    /* an alias for the destination shifted ix places */
+    tmpt = t.dp + ix;
+    
+    /* an alias for the digits of b */
+    tmpy = b->dp;
+
+    /* compute the columns of the output and propagate the carry */
+    for (iy = 0; iy < pb; iy++) {
+      /* compute the column as a mp_word */
+      r       = ((mp_word)*tmpt) +
+                ((mp_word)tmpx) * ((mp_word)*tmpy++) +
+                ((mp_word) u);
+
+      /* the new column is the lower part of the result */
+      *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
+
+      /* get the carry word from the result */
+      u       = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
+    }
+    /* set carry if it is placed below digs */
+    if (ix + iy < digs) {
+      *tmpt = u;
+    }
+  }
+
+  mp_clamp (&t);
+  mp_exch (&t, c);
+
+  mp_clear (&t);
+  return MP_OKAY;
+}
+
+
+/*
+ * shifts with subtractions when the result is greater than b.
+ *
+ * The method is slightly modified to shift B unconditionally upto just under
+ * the leading bit of b.  This saves alot of multiple precision shifting.
+ */
+int mp_montgomery_calc_normalization (mp_int * a, mp_int * b)
+{
+  int     x, bits, res;
+
+  /* how many bits of last digit does b use */
+  bits = mp_count_bits (b) % DIGIT_BIT;
+
+  if (b->used > 1) {
+     if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
+        return res;
+     }
+  } else {
+     mp_set(a, 1);
+     bits = 1;
+  }
+
+
+  /* now compute C = A * B mod b */
+  for (x = bits - 1; x < (int)DIGIT_BIT; x++) {
+    if ((res = mp_mul_2 (a, a)) != MP_OKAY) {
+      return res;
+    }
+    if (mp_cmp_mag (a, b) != MP_LT) {
+      if ((res = s_mp_sub (a, b, a)) != MP_OKAY) {
+        return res;
+      }
+    }
+  }
+
+  return MP_OKAY;
+}
+
+
+#ifdef MP_LOW_MEM
+   #define TAB_SIZE 32
+#else
+   #define TAB_SIZE 256
+#endif
+
+int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode)
+{
+  mp_int  M[TAB_SIZE], res, mu;
+  mp_digit buf;
+  int     err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
+  int (*redux)(mp_int*,mp_int*,mp_int*);
+
+  /* find window size */
+  x = mp_count_bits (X);
+  if (x <= 7) {
+    winsize = 2;
+  } else if (x <= 36) {
+    winsize = 3;
+  } else if (x <= 140) {
+    winsize = 4;
+  } else if (x <= 450) {
+    winsize = 5;
+  } else if (x <= 1303) {
+    winsize = 6;
+  } else if (x <= 3529) {
+    winsize = 7;
+  } else {
+    winsize = 8;
+  }
+
+#ifdef MP_LOW_MEM
+    if (winsize > 5) {
+       winsize = 5;
+    }
+#endif
+
+  /* init M array */
+  /* init first cell */
+  if ((err = mp_init(&M[1])) != MP_OKAY) {
+     return err; 
+  }
+
+  /* now init the second half of the array */
+  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
+    if ((err = mp_init(&M[x])) != MP_OKAY) {
+      for (y = 1<<(winsize-1); y < x; y++) {
+        mp_clear (&M[y]);
+      }
+      mp_clear(&M[1]);
+      return err;
+    }
+  }
+
+  /* create mu, used for Barrett reduction */
+  if ((err = mp_init (&mu)) != MP_OKAY) {
+    goto LBL_M;
+  }
+  
+  if (redmode == 0) {
+     if ((err = mp_reduce_setup (&mu, P)) != MP_OKAY) {
+        goto LBL_MU;
+     }
+     redux = mp_reduce;
+  } else {
+     if ((err = mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) {
+        goto LBL_MU;
+     }
+     redux = mp_reduce_2k_l;
+  }    
+
+  /* create M table
+   *
+   * The M table contains powers of the base, 
+   * e.g. M[x] = G**x mod P
+   *
+   * The first half of the table is not 
+   * computed though accept for M[0] and M[1]
+   */
+  if ((err = mp_mod (G, P, &M[1])) != MP_OKAY) {
+    goto LBL_MU;
+  }
+
+  /* compute the value at M[1<<(winsize-1)] by squaring 
+   * M[1] (winsize-1) times 
+   */
+  if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
+    goto LBL_MU;
+  }
+
+  for (x = 0; x < (winsize - 1); x++) {
+    /* square it */
+    if ((err = mp_sqr (&M[1 << (winsize - 1)], 
+                       &M[1 << (winsize - 1)])) != MP_OKAY) {
+      goto LBL_MU;
+    }
+
+    /* reduce modulo P */
+    if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) {
+      goto LBL_MU;
+    }
+  }
+
+  /* create upper table, that is M[x] = M[x-1] * M[1] (mod P)
+   * for x = (2**(winsize - 1) + 1) to (2**winsize - 1)
+   */
+  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
+    if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
+      goto LBL_MU;
+    }
+    if ((err = redux (&M[x], P, &mu)) != MP_OKAY) {
+      goto LBL_MU;
+    }
+  }
+
+  /* setup result */
+  if ((err = mp_init (&res)) != MP_OKAY) {
+    goto LBL_MU;
+  }
+  mp_set (&res, 1);
+
+  /* set initial mode and bit cnt */
+  mode   = 0;
+  bitcnt = 1;
+  buf    = 0;
+  digidx = X->used - 1;
+  bitcpy = 0;
+  bitbuf = 0;
+
+  for (;;) {
+    /* grab next digit as required */
+    if (--bitcnt == 0) {
+      /* if digidx == -1 we are out of digits */
+      if (digidx == -1) {
+        break;
+      }
+      /* read next digit and reset the bitcnt */
+      buf    = X->dp[digidx--];
+      bitcnt = (int) DIGIT_BIT;
+    }
+
+    /* grab the next msb from the exponent */
+    y     = (buf >> (mp_digit)(DIGIT_BIT - 1)) & 1;
+    buf <<= (mp_digit)1;
+
+    /* if the bit is zero and mode == 0 then we ignore it
+     * These represent the leading zero bits before the first 1 bit
+     * in the exponent.  Technically this opt is not required but it
+     * does lower the # of trivial squaring/reductions used
+     */
+    if (mode == 0 && y == 0) {
+      continue;
+    }
+
+    /* if the bit is zero and mode == 1 then we square */
+    if (mode == 1 && y == 0) {
+      if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      continue;
+    }
+
+    /* else we add it to the window */
+    bitbuf |= (y << (winsize - ++bitcpy));
+    mode    = 2;
+
+    if (bitcpy == winsize) {
+      /* ok window is filled so square as required and multiply  */
+      /* square first */
+      for (x = 0; x < winsize; x++) {
+        if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+        if ((err = redux (&res, P, &mu)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+      }
+
+      /* then multiply */
+      if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+
+      /* empty window and reset */
+      bitcpy = 0;
+      bitbuf = 0;
+      mode   = 1;
+    }
+  }
+
+  /* if bits remain then square/multiply */
+  if (mode == 2 && bitcpy > 0) {
+    /* square then multiply if the bit is set */
+    for (x = 0; x < bitcpy; x++) {
+      if ((err = mp_sqr (&res, &res)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+      if ((err = redux (&res, P, &mu)) != MP_OKAY) {
+        goto LBL_RES;
+      }
+
+      bitbuf <<= 1;
+      if ((bitbuf & (1 << winsize)) != 0) {
+        /* then multiply */
+        if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+        if ((err = redux (&res, P, &mu)) != MP_OKAY) {
+          goto LBL_RES;
+        }
+      }
+    }
+  }
+
+  mp_exch (&res, Y);
+  err = MP_OKAY;
+LBL_RES:mp_clear (&res);
+LBL_MU:mp_clear (&mu);
+LBL_M:
+  mp_clear(&M[1]);
+  for (x = 1<<(winsize-1); x < (1 << winsize); x++) {
+    mp_clear (&M[x]);
+  }
+  return err;
+}
+
+
+/* pre-calculate the value required for Barrett reduction
+ * For a given modulus "b" it calulates the value required in "a"
+ */
+int mp_reduce_setup (mp_int * a, mp_int * b)
+{
+  int     res;
+  
+  if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
+    return res;
+  }
+  return mp_div (a, b, a, NULL);
+}
+
+
+/* reduces x mod m, assumes 0 < x < m**2, mu is 
+ * precomputed via mp_reduce_setup.
+ * From HAC pp.604 Algorithm 14.42
+ */
+int mp_reduce (mp_int * x, mp_int * m, mp_int * mu)
+{
+  mp_int  q;
+  int     res, um = m->used;
+
+  /* q = x */
+  if ((res = mp_init_copy (&q, x)) != MP_OKAY) {
+    return res;
+  }
+
+  /* q1 = x / b**(k-1)  */
+  mp_rshd (&q, um - 1);         
+
+  /* according to HAC this optimization is ok */
+  if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) {
+    if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) {
+      goto CLEANUP;
+    }
+  } else {
+#ifdef BN_S_MP_MUL_HIGH_DIGS_C
+    if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
+      goto CLEANUP;
+    }
+#elif defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C)
+    if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) {
+      goto CLEANUP;
+    }
+#else 
+    { 
+      res = MP_VAL;
+      goto CLEANUP;
+    }
+#endif
+  }
+
+  /* q3 = q2 / b**(k+1) */
+  mp_rshd (&q, um + 1);         
+
+  /* x = x mod b**(k+1), quick (no division) */
+  if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) {
+    goto CLEANUP;
+  }
+
+  /* q = q * m mod b**(k+1), quick (no division) */
+  if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) {
+    goto CLEANUP;
+  }
+
+  /* x = x - q */
+  if ((res = mp_sub (x, &q, x)) != MP_OKAY) {
+    goto CLEANUP;
+  }
+
+  /* If x < 0, add b**(k+1) to it */
+  if (mp_cmp_d (x, 0) == MP_LT) {
+    mp_set (&q, 1);
+    if ((res = mp_lshd (&q, um + 1)) != MP_OKAY)
+      goto CLEANUP;
+    if ((res = mp_add (x, &q, x)) != MP_OKAY)
+      goto CLEANUP;
+  }
+
+  /* Back off if it's too big */
+  while (mp_cmp (x, m) != MP_LT) {
+    if ((res = s_mp_sub (x, m, x)) != MP_OKAY) {
+      goto CLEANUP;
+    }
+  }
+  
+CLEANUP:
+  mp_clear (&q);
+
+  return res;
+}
+
+
+/* reduces a modulo n where n is of the form 2**p - d 
+   This differs from reduce_2k since "d" can be larger
+   than a single digit.
+*/
+int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d)
+{
+   mp_int q;
+   int    p, res;
+   
+   if ((res = mp_init(&q)) != MP_OKAY) {
+      return res;
+   }
+   
+   p = mp_count_bits(n);    
+top:
+   /* q = a/2**p, a = a mod 2**p */
+   if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) {
+      goto ERR;
+   }
+   
+   /* q = q * d */
+   if ((res = mp_mul(&q, d, &q)) != MP_OKAY) { 
+      goto ERR;
+   }
+   
+   /* a = a + q */
+   if ((res = s_mp_add(a, &q, a)) != MP_OKAY) {
+      goto ERR;
+   }
+   
+   if (mp_cmp_mag(a, n) != MP_LT) {
+      s_mp_sub(a, n, a);
+      goto top;
+   }
+   
+ERR:
+   mp_clear(&q);
+   return res;
+}
+
+
+/* determines the setup value */
+int mp_reduce_2k_setup_l(mp_int *a, mp_int *d)
+{
+   int    res;
+   mp_int tmp;
+   
+   if ((res = mp_init(&tmp)) != MP_OKAY) {
+      return res;
+   }
+   
+   if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) {
+      goto ERR;
+   }
+   
+   if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) {
+      goto ERR;
+   }
+   
+ERR:
+   mp_clear(&tmp);
+   return res;
+}
+
+
+/* multiplies |a| * |b| and does not compute the lower digs digits
+ * [meant to get the higher part of the product]
+ */
+int
+s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
+{
+  mp_int  t;
+  int     res, pa, pb, ix, iy;
+  mp_digit u;
+  mp_word r;
+  mp_digit tmpx, *tmpt, *tmpy;
+
+  /* can we use the fast multiplier? */
+#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
+  if (((a->used + b->used + 1) < MP_WARRAY)
+      && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
+    return fast_s_mp_mul_high_digs (a, b, c, digs);
+  }
+#endif
+
+  if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) {
+    return res;
+  }
+  t.used = a->used + b->used + 1;
+
+  pa = a->used;
+  pb = b->used;
+  for (ix = 0; ix < pa; ix++) {
+    /* clear the carry */
+    u = 0;
+
+    /* left hand side of A[ix] * B[iy] */
+    tmpx = a->dp[ix];
+
+    /* alias to the address of where the digits will be stored */
+    tmpt = &(t.dp[digs]);
+
+    /* alias for where to read the right hand side from */
+    tmpy = b->dp + (digs - ix);
+
+    for (iy = digs - ix; iy < pb; iy++) {
+      /* calculate the double precision result */
+      r       = ((mp_word)*tmpt) +
+                ((mp_word)tmpx) * ((mp_word)*tmpy++) +
+                ((mp_word) u);
+
+      /* get the lower part */
+      *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
+
+      /* carry the carry */
+      u       = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
+    }
+    *tmpt = u;
+  }
+  mp_clamp (&t);
+  mp_exch (&t, c);
+  mp_clear (&t);
+  return MP_OKAY;
+}
+
+
+/* this is a modified version of fast_s_mul_digs that only produces
+ * output digits *above* digs.  See the comments for fast_s_mul_digs
+ * to see how it works.
+ *
+ * This is used in the Barrett reduction since for one of the multiplications
+ * only the higher digits were needed.  This essentially halves the work.
+ *
+ * Based on Algorithm 14.12 on pp.595 of HAC.
+ */
+int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
+{
+  int     olduse, res, pa, ix, iz;
+#ifdef CYASSL_SMALL_STACK
+  mp_digit* W;    /* uses dynamic memory and slower */
+#else
+  mp_digit W[MP_WARRAY];
+#endif
+  mp_word  _W;
+
+  /* grow the destination as required */
+  pa = a->used + b->used;
+  if (c->alloc < pa) {
+    if ((res = mp_grow (c, pa)) != MP_OKAY) {
+      return res;
+    }
+  }
+
+  if (pa > MP_WARRAY)
+    return MP_RANGE;  /* TAO range check */
+  
+#ifdef CYASSL_SMALL_STACK
+  W = (mp_digit*)XMALLOC(sizeof(mp_digit) * MP_WARRAY, 0, DYNAMIC_TYPE_BIGINT);
+  if (W == NULL)    
+    return MP_MEM;
+#endif
+
+  /* number of output digits to produce */
+  pa = a->used + b->used;
+  _W = 0;
+  for (ix = digs; ix < pa; ix++) { 
+      int      tx, ty, iy;
+      mp_digit *tmpx, *tmpy;
+
+      /* get offsets into the two bignums */
+      ty = MIN(b->used-1, ix);
+      tx = ix - ty;
+
+      /* setup temp aliases */
+      tmpx = a->dp + tx;
+      tmpy = b->dp + ty;
+
+      /* this is the number of times the loop will iterrate, essentially its 
+         while (tx++ < a->used && ty-- >= 0) { ... }
+       */
+      iy = MIN(a->used-tx, ty+1);
+
+      /* execute loop */
+      for (iz = 0; iz < iy; iz++) {
+         _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--);
+      }
+
+      /* store term */
+      W[ix] = ((mp_digit)_W) & MP_MASK;
+
+      /* make next carry */
+      _W = _W >> ((mp_word)DIGIT_BIT);
+  }
+  
+  /* setup dest */
+  olduse  = c->used;
+  c->used = pa;
+
+  {
+    register mp_digit *tmpc;
+
+    tmpc = c->dp + digs;
+    for (ix = digs; ix <= pa; ix++) {
+      /* now extract the previous digit [below the carry] */
+      *tmpc++ = W[ix];
+    }
+
+    /* clear unused digits [that existed in the old copy of c] */
+    for (; ix < olduse; ix++) {
+      *tmpc++ = 0;
+    }
+  }
+  mp_clamp (c);
+
+#ifdef CYASSL_SMALL_STACK
+  XFREE(W, 0, DYNAMIC_TYPE_BIGINT);
+#endif
+
+  return MP_OKAY;
+}
+
+
+/* set a 32-bit const */
+int mp_set_int (mp_int * a, unsigned long b)
+{
+  int     x, res;
+
+  mp_zero (a);
+  
+  /* set four bits at a time */
+  for (x = 0; x < 8; x++) {
+    /* shift the number up four bits */
+    if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) {
+      return res;
+    }
+
+    /* OR in the top four bits of the source */
+    a->dp[0] |= (b >> 28) & 15;
+
+    /* shift the source up to the next four bits */
+    b <<= 4;
+
+    /* ensure that digits are not clamped off */
+    a->used += 1;
+  }
+  mp_clamp (a);
+  return MP_OKAY;
+}
+
+
+#if defined(CYASSL_KEY_GEN) || defined(HAVE_ECC)
+
+/* c = a * a (mod b) */
+int mp_sqrmod (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     res;
+  mp_int  t;
+
+  if ((res = mp_init (&t)) != MP_OKAY) {
+    return res;
+  }
+
+  if ((res = mp_sqr (a, &t)) != MP_OKAY) {
+    mp_clear (&t);
+    return res;
+  }
+  res = mp_mod (&t, b, c);
+  mp_clear (&t);
+  return res;
+}
+
+#endif
+
+
+#if defined(CYASSL_KEY_GEN) || defined(HAVE_ECC) || !defined(NO_PWDBASED)
+
+/* single digit addition */
+int mp_add_d (mp_int* a, mp_digit b, mp_int* c)
+{
+  int     res, ix, oldused;
+  mp_digit *tmpa, *tmpc, mu;
+
+  /* grow c as required */
+  if (c->alloc < a->used + 1) {
+     if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
+        return res;
+     }
+  }
+
+  /* if a is negative and |a| >= b, call c = |a| - b */
+  if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
+     /* temporarily fix sign of a */
+     a->sign = MP_ZPOS;
+
+     /* c = |a| - b */
+     res = mp_sub_d(a, b, c);
+
+     /* fix sign  */
+     a->sign = c->sign = MP_NEG;
+
+     /* clamp */
+     mp_clamp(c);
+
+     return res;
+  }
+
+  /* old number of used digits in c */
+  oldused = c->used;
+
+  /* sign always positive */
+  c->sign = MP_ZPOS;
+
+  /* source alias */
+  tmpa    = a->dp;
+
+  /* destination alias */
+  tmpc    = c->dp;
+
+  /* if a is positive */
+  if (a->sign == MP_ZPOS) {
+     /* add digit, after this we're propagating
+      * the carry.
+      */
+     *tmpc   = *tmpa++ + b;
+     mu      = *tmpc >> DIGIT_BIT;
+     *tmpc++ &= MP_MASK;
+
+     /* now handle rest of the digits */
+     for (ix = 1; ix < a->used; ix++) {
+        *tmpc   = *tmpa++ + mu;
+        mu      = *tmpc >> DIGIT_BIT;
+        *tmpc++ &= MP_MASK;
+     }
+     /* set final carry */
+     ix++;
+     *tmpc++  = mu;
+
+     /* setup size */
+     c->used = a->used + 1;
+  } else {
+     /* a was negative and |a| < b */
+     c->used  = 1;
+
+     /* the result is a single digit */
+     if (a->used == 1) {
+        *tmpc++  =  b - a->dp[0];
+     } else {
+        *tmpc++  =  b;
+     }
+
+     /* setup count so the clearing of oldused
+      * can fall through correctly
+      */
+     ix       = 1;
+  }
+
+  /* now zero to oldused */
+  while (ix++ < oldused) {
+     *tmpc++ = 0;
+  }
+  mp_clamp(c);
+
+  return MP_OKAY;
+}
+
+
+/* single digit subtraction */
+int mp_sub_d (mp_int * a, mp_digit b, mp_int * c)
+{
+  mp_digit *tmpa, *tmpc, mu;
+  int       res, ix, oldused;
+
+  /* grow c as required */
+  if (c->alloc < a->used + 1) {
+     if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
+        return res;
+     }
+  }
+
+  /* if a is negative just do an unsigned
+   * addition [with fudged signs]
+   */
+  if (a->sign == MP_NEG) {
+     a->sign = MP_ZPOS;
+     res     = mp_add_d(a, b, c);
+     a->sign = c->sign = MP_NEG;
+
+     /* clamp */
+     mp_clamp(c);
+
+     return res;
+  }
+
+  /* setup regs */
+  oldused = c->used;
+  tmpa    = a->dp;
+  tmpc    = c->dp;
+
+  /* if a <= b simply fix the single digit */
+  if ((a->used == 1 && a->dp[0] <= b) || a->used == 0) {
+     if (a->used == 1) {
+        *tmpc++ = b - *tmpa;
+     } else {
+        *tmpc++ = b;
+     }
+     ix      = 1;
+
+     /* negative/1digit */
+     c->sign = MP_NEG;
+     c->used = 1;
+  } else {
+     /* positive/size */
+     c->sign = MP_ZPOS;
+     c->used = a->used;
+
+     /* subtract first digit */
+     *tmpc    = *tmpa++ - b;
+     mu       = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1);
+     *tmpc++ &= MP_MASK;
+
+     /* handle rest of the digits */
+     for (ix = 1; ix < a->used; ix++) {
+        *tmpc    = *tmpa++ - mu;
+        mu       = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1);
+        *tmpc++ &= MP_MASK;
+     }
+  }
+
+  /* zero excess digits */
+  while (ix++ < oldused) {
+     *tmpc++ = 0;
+  }
+  mp_clamp(c);
+  return MP_OKAY;
+}
+
+#endif /* CYASSL_KEY_GEN || HAVE_ECC */
+
+
+#ifdef CYASSL_KEY_GEN
+
+int mp_cnt_lsb(mp_int *a);
+
+static int s_is_power_of_two(mp_digit b, int *p)
+{
+   int x;
+
+   /* fast return if no power of two */
+   if ((b==0) || (b & (b-1))) {
+      return 0;
+   }
+
+   for (x = 0; x < DIGIT_BIT; x++) {
+      if (b == (((mp_digit)1)<<x)) {
+         *p = x;
+         return 1;
+      }
+   }
+   return 0;
+}
+
+/* single digit division (based on routine from MPI) */
+static int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d)
+{
+  mp_int  q;
+  mp_word w;
+  mp_digit t;
+  int     res, ix;
+
+  /* cannot divide by zero */
+  if (b == 0) {
+     return MP_VAL;
+  }
+
+  /* quick outs */
+  if (b == 1 || mp_iszero(a) == 1) {
+     if (d != NULL) {
+        *d = 0;
+     }
+     if (c != NULL) {
+        return mp_copy(a, c);
+     }
+     return MP_OKAY;
+  }
+
+  /* power of two ? */
+  if (s_is_power_of_two(b, &ix) == 1) {
+     if (d != NULL) {
+        *d = a->dp[0] & ((((mp_digit)1)<<ix) - 1);
+     }
+     if (c != NULL) {
+        return mp_div_2d(a, ix, c, NULL);
+     }
+     return MP_OKAY;
+  }
+
+#ifdef BN_MP_DIV_3_C
+  /* three? */
+  if (b == 3) {
+     return mp_div_3(a, c, d);
+  }
+#endif
+
+  /* no easy answer [c'est la vie].  Just division */
+  if ((res = mp_init_size(&q, a->used)) != MP_OKAY) {
+     return res;
+  }
+  
+  q.used = a->used;
+  q.sign = a->sign;
+  w = 0;
+  for (ix = a->used - 1; ix >= 0; ix--) {
+     w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]);
+     
+     if (w >= b) {
+        t = (mp_digit)(w / b);
+        w -= ((mp_word)t) * ((mp_word)b);
+      } else {
+        t = 0;
+      }
+      q.dp[ix] = (mp_digit)t;
+  }
+  
+  if (d != NULL) {
+     *d = (mp_digit)w;
+  }
+  
+  if (c != NULL) {
+     mp_clamp(&q);
+     mp_exch(&q, c);
+  }
+  mp_clear(&q);
+  
+  return res;
+}
+
+
+static int mp_mod_d (mp_int * a, mp_digit b, mp_digit * c)
+{
+  return mp_div_d(a, b, NULL, c);
+}
+
+
+const mp_digit ltm_prime_tab[] = {
+  0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
+  0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
+  0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
+  0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F,
+#ifndef MP_8BIT
+  0x0083,
+  0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD,
+  0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF,
+  0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107,
+  0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137,
+
+  0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167,
+  0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199,
+  0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9,
+  0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7,
+  0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239,
+  0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265,
+  0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293,
+  0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF,
+
+  0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301,
+  0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B,
+  0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371,
+  0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD,
+  0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5,
+  0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419,
+  0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449,
+  0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B,
+
+  0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7,
+  0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503,
+  0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529,
+  0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F,
+  0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3,
+  0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7,
+  0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623,
+  0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653
+#endif
+};
+
+
+/* Miller-Rabin test of "a" to the base of "b" as described in 
+ * HAC pp. 139 Algorithm 4.24
+ *
+ * Sets result to 0 if definitely composite or 1 if probably prime.
+ * Randomly the chance of error is no more than 1/4 and often 
+ * very much lower.
+ */
+static int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result)
+{
+  mp_int  n1, y, r;
+  int     s, j, err;
+
+  /* default */
+  *result = MP_NO;
+
+  /* ensure b > 1 */
+  if (mp_cmp_d(b, 1) != MP_GT) {
+     return MP_VAL;
+  }     
+
+  /* get n1 = a - 1 */
+  if ((err = mp_init_copy (&n1, a)) != MP_OKAY) {
+    return err;
+  }
+  if ((err = mp_sub_d (&n1, 1, &n1)) != MP_OKAY) {
+    goto LBL_N1;
+  }
+
+  /* set 2**s * r = n1 */
+  if ((err = mp_init_copy (&r, &n1)) != MP_OKAY) {
+    goto LBL_N1;
+  }
+
+  /* count the number of least significant bits
+   * which are zero
+   */
+  s = mp_cnt_lsb(&r);
+
+  /* now divide n - 1 by 2**s */
+  if ((err = mp_div_2d (&r, s, &r, NULL)) != MP_OKAY) {
+    goto LBL_R;
+  }
+
+  /* compute y = b**r mod a */
+  if ((err = mp_init (&y)) != MP_OKAY) {
+    goto LBL_R;
+  }
+  if ((err = mp_exptmod (b, &r, a, &y)) != MP_OKAY) {
+    goto LBL_Y;
+  }
+
+  /* if y != 1 and y != n1 do */
+  if (mp_cmp_d (&y, 1) != MP_EQ && mp_cmp (&y, &n1) != MP_EQ) {
+    j = 1;
+    /* while j <= s-1 and y != n1 */
+    while ((j <= (s - 1)) && mp_cmp (&y, &n1) != MP_EQ) {
+      if ((err = mp_sqrmod (&y, a, &y)) != MP_OKAY) {
+         goto LBL_Y;
+      }
+
+      /* if y == 1 then composite */
+      if (mp_cmp_d (&y, 1) == MP_EQ) {
+         goto LBL_Y;
+      }
+
+      ++j;
+    }
+
+    /* if y != n1 then composite */
+    if (mp_cmp (&y, &n1) != MP_EQ) {
+      goto LBL_Y;
+    }
+  }
+
+  /* probably prime now */
+  *result = MP_YES;
+LBL_Y:mp_clear (&y);
+LBL_R:mp_clear (&r);
+LBL_N1:mp_clear (&n1);
+  return err;
+}
+
+
+/* determines if an integers is divisible by one 
+ * of the first PRIME_SIZE primes or not
+ *
+ * sets result to 0 if not, 1 if yes
+ */
+static int mp_prime_is_divisible (mp_int * a, int *result)
+{
+  int     err, ix;
+  mp_digit res;
+
+  /* default to not */
+  *result = MP_NO;
+
+  for (ix = 0; ix < PRIME_SIZE; ix++) {
+    /* what is a mod LBL_prime_tab[ix] */
+    if ((err = mp_mod_d (a, ltm_prime_tab[ix], &res)) != MP_OKAY) {
+      return err;
+    }
+
+    /* is the residue zero? */
+    if (res == 0) {
+      *result = MP_YES;
+      return MP_OKAY;
+    }
+  }
+
+  return MP_OKAY;
+}
+
+
+/*
+ * Sets result to 1 if probably prime, 0 otherwise
+ */
+int mp_prime_is_prime (mp_int * a, int t, int *result)
+{
+  mp_int  b;
+  int     ix, err, res;
+
+  /* default to no */
+  *result = MP_NO;
+
+  /* valid value of t? */
+  if (t <= 0 || t > PRIME_SIZE) {
+    return MP_VAL;
+  }
+
+  /* is the input equal to one of the primes in the table? */
+  for (ix = 0; ix < PRIME_SIZE; ix++) {
+      if (mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) {
+         *result = 1;
+         return MP_OKAY;
+      }
+  }
+
+  /* first perform trial division */
+  if ((err = mp_prime_is_divisible (a, &res)) != MP_OKAY) {
+    return err;
+  }
+
+  /* return if it was trivially divisible */
+  if (res == MP_YES) {
+    return MP_OKAY;
+  }
+
+  /* now perform the miller-rabin rounds */
+  if ((err = mp_init (&b)) != MP_OKAY) {
+    return err;
+  }
+
+  for (ix = 0; ix < t; ix++) {
+    /* set the prime */
+    mp_set (&b, ltm_prime_tab[ix]);
+
+    if ((err = mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) {
+      goto LBL_B;
+    }
+
+    if (res == MP_NO) {
+      goto LBL_B;
+    }
+  }
+
+  /* passed the test */
+  *result = MP_YES;
+LBL_B:mp_clear (&b);
+  return err;
+}
+
+
+/* computes least common multiple as |a*b|/(a, b) */
+int mp_lcm (mp_int * a, mp_int * b, mp_int * c)
+{
+  int     res;
+  mp_int  t1, t2;
+
+
+  if ((res = mp_init_multi (&t1, &t2, NULL, NULL, NULL, NULL)) != MP_OKAY) {
+    return res;
+  }
+
+  /* t1 = get the GCD of the two inputs */
+  if ((res = mp_gcd (a, b, &t1)) != MP_OKAY) {
+    goto LBL_T;
+  }
+
+  /* divide the smallest by the GCD */
+  if (mp_cmp_mag(a, b) == MP_LT) {
+     /* store quotient in t2 such that t2 * b is the LCM */
+     if ((res = mp_div(a, &t1, &t2, NULL)) != MP_OKAY) {
+        goto LBL_T;
+     }
+     res = mp_mul(b, &t2, c);
+  } else {
+     /* store quotient in t2 such that t2 * a is the LCM */
+     if ((res = mp_div(b, &t1, &t2, NULL)) != MP_OKAY) {
+        goto LBL_T;
+     }
+     res = mp_mul(a, &t2, c);
+  }
+
+  /* fix the sign to positive */
+  c->sign = MP_ZPOS;
+
+LBL_T:
+  mp_clear(&t1);
+  mp_clear(&t2);
+  return res;
+}
+
+
+static const int lnz[16] = { 
+   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
+};
+
+/* Counts the number of lsbs which are zero before the first zero bit */
+int mp_cnt_lsb(mp_int *a)
+{
+    int x;
+    mp_digit q, qq;
+
+    /* easy out */
+    if (mp_iszero(a) == 1) {
+        return 0;
+    }
+
+    /* scan lower digits until non-zero */
+    for (x = 0; x < a->used && a->dp[x] == 0; x++);
+    q = a->dp[x];
+    x *= DIGIT_BIT;
+
+    /* now scan this digit until a 1 is found */
+    if ((q & 1) == 0) {
+        do {
+            qq  = q & 15;
+            x  += lnz[qq];
+            q >>= 4;
+        } while (qq == 0);
+    }
+    return x;
+}
+
+
+/* Greatest Common Divisor using the binary method */
+int mp_gcd (mp_int * a, mp_int * b, mp_int * c)
+{
+    mp_int  u, v;
+    int     k, u_lsb, v_lsb, res;
+
+    /* either zero than gcd is the largest */
+    if (mp_iszero (a) == MP_YES) {
+        return mp_abs (b, c);
+    }
+    if (mp_iszero (b) == MP_YES) {
+        return mp_abs (a, c);
+    }
+
+    /* get copies of a and b we can modify */
+    if ((res = mp_init_copy (&u, a)) != MP_OKAY) {
+        return res;
+    }
+
+    if ((res = mp_init_copy (&v, b)) != MP_OKAY) {
+        goto LBL_U;
+    }
+
+    /* must be positive for the remainder of the algorithm */
+    u.sign = v.sign = MP_ZPOS;
+
+    /* B1.  Find the common power of two for u and v */
+    u_lsb = mp_cnt_lsb(&u);
+    v_lsb = mp_cnt_lsb(&v);
+    k     = MIN(u_lsb, v_lsb);
+
+    if (k > 0) {
+        /* divide the power of two out */
+        if ((res = mp_div_2d(&u, k, &u, NULL)) != MP_OKAY) {
+            goto LBL_V;
+        }
+
+        if ((res = mp_div_2d(&v, k, &v, NULL)) != MP_OKAY) {
+            goto LBL_V;
+        }
+    }
+
+    /* divide any remaining factors of two out */
+    if (u_lsb != k) {
+        if ((res = mp_div_2d(&u, u_lsb - k, &u, NULL)) != MP_OKAY) {
+            goto LBL_V;
+        }
+    }
+
+    if (v_lsb != k) {
+        if ((res = mp_div_2d(&v, v_lsb - k, &v, NULL)) != MP_OKAY) {
+            goto LBL_V;
+        }
+    }
+
+    while (mp_iszero(&v) == 0) {
+        /* make sure v is the largest */
+        if (mp_cmp_mag(&u, &v) == MP_GT) {
+            /* swap u and v to make sure v is >= u */
+            mp_exch(&u, &v);
+        }
+     
+        /* subtract smallest from largest */
+        if ((res = s_mp_sub(&v, &u, &v)) != MP_OKAY) {
+            goto LBL_V;
+        }
+     
+        /* Divide out all factors of two */
+        if ((res = mp_div_2d(&v, mp_cnt_lsb(&v), &v, NULL)) != MP_OKAY) {
+            goto LBL_V;
+        } 
+    } 
+
+    /* multiply by 2**k which we divided out at the beginning */
+    if ((res = mp_mul_2d (&u, k, c)) != MP_OKAY) {
+        goto LBL_V;
+    }
+    c->sign = MP_ZPOS;
+    res = MP_OKAY;
+LBL_V:mp_clear (&u);
+LBL_U:mp_clear (&v);
+    return res;
+}
+
+
+
+#endif /* CYASSL_KEY_GEN */
+
+
+#ifdef HAVE_ECC
+
+/* chars used in radix conversions */
+const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
+
+/* read a string [ASCII] in a given radix */
+int mp_read_radix (mp_int * a, const char *str, int radix)
+{
+  int     y, res, neg;
+  char    ch;
+
+  /* zero the digit bignum */
+  mp_zero(a);
+
+  /* make sure the radix is ok */
+  if (radix < 2 || radix > 64) {
+    return MP_VAL;
+  }
+
+  /* if the leading digit is a 
+   * minus set the sign to negative. 
+   */
+  if (*str == '-') {
+    ++str;
+    neg = MP_NEG;
+  } else {
+    neg = MP_ZPOS;
+  }
+
+  /* set the integer to the default of zero */
+  mp_zero (a);
+  
+  /* process each digit of the string */
+  while (*str) {
+    /* if the radix < 36 the conversion is case insensitive
+     * this allows numbers like 1AB and 1ab to represent the same  value
+     * [e.g. in hex]
+     */
+    ch = (char) ((radix < 36) ? XTOUPPER(*str) : *str);
+    for (y = 0; y < 64; y++) {
+      if (ch == mp_s_rmap[y]) {
+         break;
+      }
+    }
+
+    /* if the char was found in the map 
+     * and is less than the given radix add it
+     * to the number, otherwise exit the loop. 
+     */
+    if (y < radix) {
+      if ((res = mp_mul_d (a, (mp_digit) radix, a)) != MP_OKAY) {
+         return res;
+      }
+      if ((res = mp_add_d (a, (mp_digit) y, a)) != MP_OKAY) {
+         return res;
+      }
+    } else {
+      break;
+    }
+    ++str;
+  }
+  
+  /* set the sign only if a != 0 */
+  if (mp_iszero(a) != 1) {
+     a->sign = neg;
+  }
+  return MP_OKAY;
+}
+
+#endif /* HAVE_ECC */
+
+#endif /* USE_FAST_MATH */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/logging.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/logging.c
new file mode 100644 (file)
index 0000000..584d1dd
--- /dev/null
@@ -0,0 +1,153 @@
+/* logging.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/* submitted by eof */
+
+#include <cyassl/ctaocrypt/settings.h>
+#include <cyassl/ctaocrypt/logging.h>
+#include <cyassl/ctaocrypt/error.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+    CYASSL_API int  CyaSSL_Debugging_ON(void);
+    CYASSL_API void CyaSSL_Debugging_OFF(void);
+#ifdef __cplusplus
+    } 
+#endif
+
+
+#ifdef DEBUG_CYASSL
+
+/* Set these to default values initially. */
+static CyaSSL_Logging_cb log_function = 0;
+static int loggingEnabled = 0;
+
+#endif /* DEBUG_CYASSL */
+
+
+int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb f)
+{
+#ifdef DEBUG_CYASSL
+    int res = 0;
+
+    if (f)
+        log_function = f;
+    else
+        res = BAD_FUNC_ARG;
+
+    return res;
+#else
+    (void)f;
+    return NOT_COMPILED_IN;
+#endif
+}
+
+
+int CyaSSL_Debugging_ON(void)
+{
+#ifdef DEBUG_CYASSL
+    loggingEnabled = 1;
+    return 0;
+#else
+    return NOT_COMPILED_IN;
+#endif
+}
+
+
+void CyaSSL_Debugging_OFF(void)
+{
+#ifdef DEBUG_CYASSL
+    loggingEnabled = 0;
+#endif
+}
+
+
+#ifdef DEBUG_CYASSL
+
+#include <stdio.h>   /* for default printf stuff */
+
+#ifdef THREADX
+    int dc_log_printf(char*, ...);
+#endif
+
+static void cyassl_log(const int logLevel, const char *const logMessage)
+{
+    if (log_function)
+        log_function(logLevel, logMessage);
+    else {
+        if (loggingEnabled) {
+#ifdef THREADX
+            dc_log_printf("%s\n", logMessage);
+#elif defined(MICRIUM)
+        #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+            NetSecure_TraceOut((CPU_CHAR *)logMessage);
+        #endif
+#else
+            fprintf(stderr, "%s\n", logMessage);
+#endif
+        }
+    }
+}
+
+
+void CYASSL_MSG(const char* msg)
+{
+    if (loggingEnabled)
+        cyassl_log(INFO_LOG , msg);
+}
+
+
+void CYASSL_ENTER(const char* msg)
+{
+    if (loggingEnabled) {
+        char buffer[80];
+        sprintf(buffer, "CyaSSL Entering %s", msg);
+        cyassl_log(ENTER_LOG , buffer);
+    }
+}
+
+
+void CYASSL_LEAVE(const char* msg, int ret)
+{
+    if (loggingEnabled) {
+        char buffer[80];
+        sprintf(buffer, "CyaSSL Leaving %s, return %d", msg, ret);
+        cyassl_log(LEAVE_LOG , buffer);
+    }
+}
+
+
+void CYASSL_ERROR(int error)
+{
+    if (loggingEnabled) {
+        char buffer[80];
+        sprintf(buffer, "CyaSSL error occured, error = %d", error);
+        cyassl_log(ERROR_LOG , buffer);
+    }
+}
+
+#endif  /* DEBUG_CYASSL */ 
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md2.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md2.c
new file mode 100644 (file)
index 0000000..0c1bb9c
--- /dev/null
@@ -0,0 +1,129 @@
+/* md2.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef CYASSL_MD2
+
+#include <cyassl/ctaocrypt/md2.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+void InitMd2(Md2* md2)
+{
+    XMEMSET(md2->X, 0, MD2_X_SIZE);
+    XMEMSET(md2->C, 0, MD2_BLOCK_SIZE);
+    XMEMSET(md2->buffer, 0, MD2_BLOCK_SIZE);
+    md2->count = 0;
+}
+
+
+void Md2Update(Md2* md2, const byte* data, word32 len)
+{
+    static const byte S[256] = 
+    {
+        41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,
+        19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
+        76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
+        138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
+        245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
+        148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
+        39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
+        181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
+        150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
+        112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
+        96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
+        85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
+        234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
+        129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
+        8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
+        203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
+        166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
+        31, 26, 219, 153, 141, 51, 159, 17, 131, 20
+    };
+
+    while (len) {
+        word32 L = (MD2_PAD_SIZE - md2->count) < len ?
+                   (MD2_PAD_SIZE - md2->count) : len;
+        XMEMCPY(md2->buffer + md2->count, data, L);
+        md2->count += L;
+        data += L;
+        len  -= L;
+
+        if (md2->count == MD2_PAD_SIZE) {
+            int  i;
+            byte t;
+
+            md2->count = 0;
+            XMEMCPY(md2->X + MD2_PAD_SIZE, md2->buffer, MD2_PAD_SIZE);
+            t = md2->C[15];
+
+            for(i = 0; i < MD2_PAD_SIZE; i++) {
+                md2->X[32 + i] = md2->X[MD2_PAD_SIZE + i] ^ md2->X[i];
+                t = md2->C[i] ^= S[md2->buffer[i] ^ t];
+            }
+
+            t=0;
+            for(i = 0; i < 18; i++) {
+                int j;
+                for(j = 0; j < MD2_X_SIZE; j += 8) {
+                    t = md2->X[j+0] ^= S[t];
+                    t = md2->X[j+1] ^= S[t];
+                    t = md2->X[j+2] ^= S[t];
+                    t = md2->X[j+3] ^= S[t];
+                    t = md2->X[j+4] ^= S[t];
+                    t = md2->X[j+5] ^= S[t];
+                    t = md2->X[j+6] ^= S[t];
+                    t = md2->X[j+7] ^= S[t];
+                }
+                t = (t + i) & 0xFF;
+            }
+        }
+    }
+}
+
+
+void Md2Final(Md2* md2, byte* hash)
+{
+    byte   padding[MD2_BLOCK_SIZE];
+    word32 padLen = MD2_PAD_SIZE - md2->count;
+    word32 i;
+
+    for (i = 0; i < padLen; i++)
+        padding[i] = (byte)padLen;
+
+    Md2Update(md2, padding, padLen);
+    Md2Update(md2, md2->C, MD2_BLOCK_SIZE);
+
+    XMEMCPY(hash, md2->X, MD2_DIGEST_SIZE);
+
+    InitMd2(md2);
+}
+
+
+#endif /* CYASSL_MD2 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md4.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md4.c
new file mode 100644 (file)
index 0000000..e47c432
--- /dev/null
@@ -0,0 +1,218 @@
+/* md4.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+
+#ifndef NO_MD4
+
+#include <cyassl/ctaocrypt/md4.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitMd4(Md4* md4)
+{
+    md4->digest[0] = 0x67452301L;
+    md4->digest[1] = 0xefcdab89L;
+    md4->digest[2] = 0x98badcfeL;
+    md4->digest[3] = 0x10325476L;
+
+    md4->buffLen = 0;
+    md4->loLen   = 0;
+    md4->hiLen   = 0;
+}
+
+
+static void Transform(Md4* md4)
+{
+#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
+#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+
+    /* Copy context->state[] to working vars  */
+    word32 A = md4->digest[0];
+    word32 B = md4->digest[1];
+    word32 C = md4->digest[2];
+    word32 D = md4->digest[3];
+
+#define function(a,b,c,d,k,s) a=rotlFixed(a+F(b,c,d)+md4->buffer[k],s);
+    function(A,B,C,D, 0, 3);
+    function(D,A,B,C, 1, 7);
+    function(C,D,A,B, 2,11);
+    function(B,C,D,A, 3,19);
+    function(A,B,C,D, 4, 3);
+    function(D,A,B,C, 5, 7);
+    function(C,D,A,B, 6,11);
+    function(B,C,D,A, 7,19);
+    function(A,B,C,D, 8, 3);
+    function(D,A,B,C, 9, 7);
+    function(C,D,A,B,10,11);
+    function(B,C,D,A,11,19);
+    function(A,B,C,D,12, 3);
+    function(D,A,B,C,13, 7);
+    function(C,D,A,B,14,11);
+    function(B,C,D,A,15,19);
+
+#undef function          
+#define function(a,b,c,d,k,s) \
+    a=rotlFixed(a+G(b,c,d)+md4->buffer[k]+0x5a827999,s);
+
+    function(A,B,C,D, 0, 3);
+    function(D,A,B,C, 4, 5);
+    function(C,D,A,B, 8, 9);
+    function(B,C,D,A,12,13);
+    function(A,B,C,D, 1, 3);
+    function(D,A,B,C, 5, 5);
+    function(C,D,A,B, 9, 9);
+    function(B,C,D,A,13,13);
+    function(A,B,C,D, 2, 3);
+    function(D,A,B,C, 6, 5);
+    function(C,D,A,B,10, 9);
+    function(B,C,D,A,14,13);
+    function(A,B,C,D, 3, 3);
+    function(D,A,B,C, 7, 5);
+    function(C,D,A,B,11, 9);
+    function(B,C,D,A,15,13);
+
+#undef function         
+#define function(a,b,c,d,k,s) \
+    a=rotlFixed(a+H(b,c,d)+md4->buffer[k]+0x6ed9eba1,s);
+
+    function(A,B,C,D, 0, 3);
+    function(D,A,B,C, 8, 9);
+    function(C,D,A,B, 4,11);
+    function(B,C,D,A,12,15);
+    function(A,B,C,D, 2, 3);
+    function(D,A,B,C,10, 9);
+    function(C,D,A,B, 6,11);
+    function(B,C,D,A,14,15);
+    function(A,B,C,D, 1, 3);
+    function(D,A,B,C, 9, 9);
+    function(C,D,A,B, 5,11);
+    function(B,C,D,A,13,15);
+    function(A,B,C,D, 3, 3);
+    function(D,A,B,C,11, 9);
+    function(C,D,A,B, 7,11);
+    function(B,C,D,A,15,15);
+    
+    /* Add the working vars back into digest state[]  */
+    md4->digest[0] += A;
+    md4->digest[1] += B;
+    md4->digest[2] += C;
+    md4->digest[3] += D;
+}
+
+
+static INLINE void AddLength(Md4* md4, word32 len)
+{
+    word32 tmp = md4->loLen;
+    if ( (md4->loLen += len) < tmp)
+        md4->hiLen++;                       /* carry low to high */
+}
+
+
+void Md4Update(Md4* md4, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)md4->buffer;
+
+    while (len) {
+        word32 add = min(len, MD4_BLOCK_SIZE - md4->buffLen);
+        XMEMCPY(&local[md4->buffLen], data, add);
+
+        md4->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (md4->buffLen == MD4_BLOCK_SIZE) {
+            #ifdef BIG_ENDIAN_ORDER
+                ByteReverseBytes(local, local, MD4_BLOCK_SIZE);
+            #endif
+            Transform(md4);
+            AddLength(md4, MD4_BLOCK_SIZE);
+            md4->buffLen = 0;
+        }
+    }
+}
+
+
+void Md4Final(Md4* md4, byte* hash)
+{
+    byte* local = (byte*)md4->buffer;
+
+    AddLength(md4, md4->buffLen);               /* before adding pads */
+
+    local[md4->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (md4->buffLen > MD4_PAD_SIZE) {
+        XMEMSET(&local[md4->buffLen], 0, MD4_BLOCK_SIZE - md4->buffLen);
+        md4->buffLen += MD4_BLOCK_SIZE - md4->buffLen;
+
+        #ifdef BIG_ENDIAN_ORDER
+            ByteReverseBytes(local, local, MD4_BLOCK_SIZE);
+        #endif
+        Transform(md4);
+        md4->buffLen = 0;
+    }
+    XMEMSET(&local[md4->buffLen], 0, MD4_PAD_SIZE - md4->buffLen);
+   
+    /* put lengths in bits */
+    md4->hiLen = (md4->loLen >> (8*sizeof(md4->loLen) - 3)) + 
+                 (md4->hiLen << 3);
+    md4->loLen = md4->loLen << 3;
+
+    /* store lengths */
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseBytes(local, local, MD4_BLOCK_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    XMEMCPY(&local[MD4_PAD_SIZE], &md4->loLen, sizeof(word32));
+    XMEMCPY(&local[MD4_PAD_SIZE + sizeof(word32)], &md4->hiLen, sizeof(word32));
+
+    Transform(md4);
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseWords(md4->digest, md4->digest, MD4_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, md4->digest, MD4_DIGEST_SIZE);
+
+    InitMd4(md4);  /* reset state */
+}
+
+
+#endif /* NO_MD4 */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md5.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/md5.c
new file mode 100644 (file)
index 0000000..f735c74
--- /dev/null
@@ -0,0 +1,226 @@
+/* md5.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/md5.h>
+
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitMd5(Md5* md5)
+{
+    md5->digest[0] = 0x67452301L;
+    md5->digest[1] = 0xefcdab89L;
+    md5->digest[2] = 0x98badcfeL;
+    md5->digest[3] = 0x10325476L;
+
+    md5->buffLen = 0;
+    md5->loLen   = 0;
+    md5->hiLen   = 0;
+}
+
+
+static void Transform(Md5* md5)
+{
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+#define MD5STEP(f, w, x, y, z, data, s) \
+    w = rotlFixed(w + f(x, y, z) + data, s) + x
+
+    /* Copy context->state[] to working vars  */
+    word32 a = md5->digest[0];
+    word32 b = md5->digest[1];
+    word32 c = md5->digest[2];
+    word32 d = md5->digest[3];
+
+    MD5STEP(F1, a, b, c, d, md5->buffer[0]  + 0xd76aa478,  7);
+    MD5STEP(F1, d, a, b, c, md5->buffer[1]  + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, md5->buffer[2]  + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, md5->buffer[3]  + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, md5->buffer[4]  + 0xf57c0faf,  7);
+    MD5STEP(F1, d, a, b, c, md5->buffer[5]  + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, md5->buffer[6]  + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, md5->buffer[7]  + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, md5->buffer[8]  + 0x698098d8,  7);
+    MD5STEP(F1, d, a, b, c, md5->buffer[9]  + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, md5->buffer[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, md5->buffer[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, md5->buffer[12] + 0x6b901122,  7);
+    MD5STEP(F1, d, a, b, c, md5->buffer[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, md5->buffer[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, md5->buffer[15] + 0x49b40821, 22);
+
+    MD5STEP(F2, a, b, c, d, md5->buffer[1]  + 0xf61e2562,  5);
+    MD5STEP(F2, d, a, b, c, md5->buffer[6]  + 0xc040b340,  9);
+    MD5STEP(F2, c, d, a, b, md5->buffer[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, md5->buffer[0]  + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, md5->buffer[5]  + 0xd62f105d,  5);
+    MD5STEP(F2, d, a, b, c, md5->buffer[10] + 0x02441453,  9);
+    MD5STEP(F2, c, d, a, b, md5->buffer[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, md5->buffer[4]  + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, md5->buffer[9]  + 0x21e1cde6,  5);
+    MD5STEP(F2, d, a, b, c, md5->buffer[14] + 0xc33707d6,  9);
+    MD5STEP(F2, c, d, a, b, md5->buffer[3]  + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, md5->buffer[8]  + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, md5->buffer[13] + 0xa9e3e905,  5);
+    MD5STEP(F2, d, a, b, c, md5->buffer[2]  + 0xfcefa3f8,  9);
+    MD5STEP(F2, c, d, a, b, md5->buffer[7]  + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, md5->buffer[12] + 0x8d2a4c8a, 20);
+
+    MD5STEP(F3, a, b, c, d, md5->buffer[5]  + 0xfffa3942,  4);
+    MD5STEP(F3, d, a, b, c, md5->buffer[8]  + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, md5->buffer[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, md5->buffer[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, md5->buffer[1]  + 0xa4beea44,  4);
+    MD5STEP(F3, d, a, b, c, md5->buffer[4]  + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, md5->buffer[7]  + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, md5->buffer[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, md5->buffer[13] + 0x289b7ec6,  4);
+    MD5STEP(F3, d, a, b, c, md5->buffer[0]  + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, md5->buffer[3]  + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, md5->buffer[6]  + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, md5->buffer[9]  + 0xd9d4d039,  4);
+    MD5STEP(F3, d, a, b, c, md5->buffer[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, md5->buffer[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, md5->buffer[2]  + 0xc4ac5665, 23);
+
+    MD5STEP(F4, a, b, c, d, md5->buffer[0]  + 0xf4292244,  6);
+    MD5STEP(F4, d, a, b, c, md5->buffer[7]  + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, md5->buffer[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, md5->buffer[5]  + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, md5->buffer[12] + 0x655b59c3,  6);
+    MD5STEP(F4, d, a, b, c, md5->buffer[3]  + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, md5->buffer[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, md5->buffer[1]  + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, md5->buffer[8]  + 0x6fa87e4f,  6);
+    MD5STEP(F4, d, a, b, c, md5->buffer[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, md5->buffer[6]  + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, md5->buffer[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, md5->buffer[4]  + 0xf7537e82,  6);
+    MD5STEP(F4, d, a, b, c, md5->buffer[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, md5->buffer[2]  + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, md5->buffer[9]  + 0xeb86d391, 21);
+    
+    /* Add the working vars back into digest state[]  */
+    md5->digest[0] += a;
+    md5->digest[1] += b;
+    md5->digest[2] += c;
+    md5->digest[3] += d;
+}
+
+
+static INLINE void AddLength(Md5* md5, word32 len)
+{
+    word32 tmp = md5->loLen;
+    if ( (md5->loLen += len) < tmp)
+        md5->hiLen++;                       /* carry low to high */
+}
+
+
+void Md5Update(Md5* md5, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)md5->buffer;
+
+    while (len) {
+        word32 add = min(len, MD5_BLOCK_SIZE - md5->buffLen);
+        XMEMCPY(&local[md5->buffLen], data, add);
+
+        md5->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (md5->buffLen == MD5_BLOCK_SIZE) {
+            #ifdef BIG_ENDIAN_ORDER
+                ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
+            #endif
+            Transform(md5);
+            AddLength(md5, MD5_BLOCK_SIZE);
+            md5->buffLen = 0;
+        }
+    }
+}
+
+
+void Md5Final(Md5* md5, byte* hash)
+{
+    byte* local = (byte*)md5->buffer;
+
+    AddLength(md5, md5->buffLen);               /* before adding pads */
+
+    local[md5->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (md5->buffLen > MD5_PAD_SIZE) {
+        XMEMSET(&local[md5->buffLen], 0, MD5_BLOCK_SIZE - md5->buffLen);
+        md5->buffLen += MD5_BLOCK_SIZE - md5->buffLen;
+
+        #ifdef BIG_ENDIAN_ORDER
+            ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
+        #endif
+        Transform(md5);
+        md5->buffLen = 0;
+    }
+    XMEMSET(&local[md5->buffLen], 0, MD5_PAD_SIZE - md5->buffLen);
+   
+    /* put lengths in bits */
+    md5->hiLen = (md5->loLen >> (8*sizeof(md5->loLen) - 3)) + 
+                 (md5->hiLen << 3);
+    md5->loLen = md5->loLen << 3;
+
+    /* store lengths */
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseBytes(local, local, MD5_BLOCK_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    XMEMCPY(&local[MD5_PAD_SIZE], &md5->loLen, sizeof(word32));
+    XMEMCPY(&local[MD5_PAD_SIZE + sizeof(word32)], &md5->hiLen, sizeof(word32));
+
+    Transform(md5);
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseWords(md5->digest, md5->digest, MD5_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, md5->digest, MD5_DIGEST_SIZE);
+
+    InitMd5(md5);  /* reset state */
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/memory.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/memory.c
new file mode 100644 (file)
index 0000000..b98e548
--- /dev/null
@@ -0,0 +1,99 @@
+/* memory.c 
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/* submitted by eof */
+
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef USE_CYASSL_MEMORY
+
+#include <cyassl/ctaocrypt/memory.h>
+#include <cyassl/ctaocrypt/error.h>
+
+
+/* Set these to default values initially. */
+static CyaSSL_Malloc_cb  malloc_function = 0;
+static CyaSSL_Free_cb    free_function = 0;
+static CyaSSL_Realloc_cb realloc_function = 0;
+
+int CyaSSL_SetAllocators(CyaSSL_Malloc_cb  mf,
+                         CyaSSL_Free_cb    ff,
+                         CyaSSL_Realloc_cb rf)
+{
+    int res = 0;
+
+    if (mf)
+        malloc_function = mf;
+       else
+        res = BAD_FUNC_ARG;
+
+    if (ff)
+        free_function = ff;
+    else
+        res = BAD_FUNC_ARG;
+
+    if (rf)
+        realloc_function = rf;
+    else
+        res = BAD_FUNC_ARG;
+
+    return res;
+}
+
+
+void* CyaSSL_Malloc(size_t size)
+{
+    void* res = 0;
+
+    if (malloc_function)
+        res = malloc_function(size);
+    else
+        res = malloc(size);
+
+    return res;
+}
+
+void CyaSSL_Free(void *ptr)
+{
+    if (free_function)
+        free_function(ptr);
+    else
+        free(ptr);
+}
+
+void* CyaSSL_Realloc(void *ptr, size_t size)
+{
+    void* res = 0;
+
+    if (realloc_function)
+        res = realloc_function(ptr, size);
+    else
+        res = realloc(ptr, size);
+
+    return res;
+}
+
+#endif /* USE_CYASSL_MEMORY */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/misc.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/misc.c
new file mode 100644 (file)
index 0000000..b9d88b5
--- /dev/null
@@ -0,0 +1,174 @@
+/* misc.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/misc.h>
+
+/* inlining these functions is a huge speed increase and a small size decrease, 
+   because the functions are smaller than function call setup/cleanup, e.g.,
+   md5 benchmark is twice as fast with inline.  If you don't want it, then
+   define NO_INLINE and compile this file into cyassl, otherwise it's used as
+   a source header
+ */
+
+#ifdef NO_INLINE
+    #define STATIC
+#else
+    #define STATIC static
+#endif
+
+
+#ifdef INTEL_INTRINSICS
+
+    #include <stdlib.h>      /* get intrinsic definitions */
+
+    #pragma intrinsic(_lrotl, _lrotr)
+
+    STATIC INLINE word32 rotlFixed(word32 x, word32 y)
+    {
+        return y ? _lrotl(x, y) : x;
+    }
+
+    STATIC INLINE word32 rotrFixed(word32 x, word32 y)
+    {
+        return y ? _lrotr(x, y) : x;
+    }
+
+#else /* generic */
+
+    STATIC INLINE word32 rotlFixed(word32 x, word32 y)
+    {
+        return (x << y) | (x >> (sizeof(y) * 8 - y));
+    }   
+
+
+    STATIC INLINE word32 rotrFixed(word32 x, word32 y)
+    {
+        return (x >> y) | (x << (sizeof(y) * 8 - y));
+    }
+
+#endif
+
+
+STATIC INLINE word32 ByteReverseWord32(word32 value)
+{
+#ifdef PPC_INTRINSICS
+    /* PPC: load reverse indexed instruction */
+    return (word32)__lwbrx(&value,0);
+#elif defined(FAST_ROTATE)
+    /* 5 instructions with rotate instruction, 9 without */
+    return (rotrFixed(value, 8U) & 0xff00ff00) |
+           (rotlFixed(value, 8U) & 0x00ff00ff);
+#else
+    /* 6 instructions with rotate instruction, 8 without */
+    value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
+    return rotlFixed(value, 16U);
+#endif
+}
+
+
+STATIC INLINE void ByteReverseWords(word32* out, const word32* in,
+                                    word32 byteCount)
+{
+    word32 count = byteCount/sizeof(word32), i;
+
+    for (i = 0; i < count; i++)
+        out[i] = ByteReverseWord32(in[i]);
+
+}
+
+
+#ifdef WORD64_AVAILABLE
+
+
+STATIC INLINE word64 rotlFixed64(word64 x, word64 y)
+{
+    return (x << y) | (x >> (sizeof(y) * 8 - y));
+}  
+
+
+STATIC INLINE word64 rotrFixed64(word64 x, word64 y)
+{
+    return (x >> y) | (x << (sizeof(y) * 8 - y));
+}
+
+
+STATIC INLINE word64 ByteReverseWord64(word64 value)
+{
+#ifdef CTAOCRYPT_SLOW_WORD64
+       return (word64)(ByteReverseWord32((word32)value)) << 32 | 
+                    ByteReverseWord32((word32)(value>>32));
+#else
+       value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) |
+            ((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
+       value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) |
+            ((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
+       return rotlFixed64(value, 32U);
+#endif
+}
+
+
+STATIC INLINE void ByteReverseWords64(word64* out, const word64* in,
+                                      word32 byteCount)
+{
+    word32 count = byteCount/sizeof(word64), i;
+
+    for (i = 0; i < count; i++)
+        out[i] = ByteReverseWord64(in[i]);
+
+}
+
+#endif /* WORD64_AVAILABLE */
+
+
+STATIC INLINE void ByteReverseBytes(byte* out, const byte* in, word32 byteCount)
+{
+    word32* op       = (word32*)out;
+    const word32* ip = (const word32*)in;
+
+    ByteReverseWords(op, ip, byteCount);
+}
+
+
+STATIC INLINE void XorWords(word* r, const word* a, word32 n)
+{
+    word32 i;
+
+    for (i = 0; i < n; i++) r[i] ^= a[i];
+}
+
+
+STATIC INLINE void xorbuf(byte* buf, const byte* mask, word32 count)
+{
+    if (((word)buf | (word)mask | count) % WORD_SIZE == 0)
+        XorWords( (word*)buf, (const word*)mask, count / WORD_SIZE);
+    else {
+        word32 i;
+        for (i = 0; i < count; i++) buf[i] ^= mask[i];
+    }
+}
+
+
+#undef STATIC
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/pwdbased.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/pwdbased.c
new file mode 100644 (file)
index 0000000..d36f7e9
--- /dev/null
@@ -0,0 +1,319 @@
+/* pwdbased.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_PWDBASED
+
+#include <cyassl/ctaocrypt/pwdbased.h>
+#include <cyassl/ctaocrypt/hmac.h>
+#include <cyassl/ctaocrypt/integer.h>
+#include <cyassl/ctaocrypt/error.h>
+#ifdef CYASSL_SHA512
+    #include <cyassl/ctaocrypt/sha512.h>
+#endif
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+int PBKDF1(byte* output, const byte* passwd, int pLen, const byte* salt,
+           int sLen, int iterations, int kLen, int hashType)
+{
+    Md5  md5;
+    Sha  sha;
+    int  hLen = (hashType == MD5) ? MD5_DIGEST_SIZE : SHA_DIGEST_SIZE;
+    int  i;
+    byte buffer[SHA_DIGEST_SIZE];  /* max size */
+
+    if (hashType != MD5 && hashType != SHA)
+        return BAD_FUNC_ARG;
+
+    if (kLen > hLen)
+        return BAD_FUNC_ARG;
+
+    if (iterations < 1)
+        return BAD_FUNC_ARG;
+
+    if (hashType == MD5) {
+        InitMd5(&md5);
+        Md5Update(&md5, passwd, pLen);
+        Md5Update(&md5, salt,   sLen);
+        Md5Final(&md5,  buffer);
+    }
+    else {
+        InitSha(&sha);
+        ShaUpdate(&sha, passwd, pLen);
+        ShaUpdate(&sha, salt,   sLen);
+        ShaFinal(&sha,  buffer);
+    }
+
+    for (i = 1; i < iterations; i++) {
+        if (hashType == MD5) {
+            Md5Update(&md5, buffer, hLen);
+            Md5Final(&md5,  buffer);
+        }
+        else {
+            ShaUpdate(&sha, buffer, hLen);
+            ShaFinal(&sha,  buffer);
+        }
+    }
+    XMEMCPY(output, buffer, kLen);
+
+    return 0;
+}
+
+
+int PBKDF2(byte* output, const byte* passwd, int pLen, const byte* salt,
+           int sLen, int iterations, int kLen, int hashType)
+{
+    word32 i = 1;
+    int    hLen;
+    int    j;
+    Hmac   hmac;
+    byte   buffer[INNER_HASH_SIZE];  /* max size */
+
+    if (hashType == MD5) {
+        hLen = MD5_DIGEST_SIZE;
+    }
+    else if (hashType == SHA) {
+        hLen = SHA_DIGEST_SIZE;
+    }
+#ifndef NO_SHA256
+    else if (hashType == SHA256) {
+        hLen = SHA256_DIGEST_SIZE;
+    }
+#endif
+#ifdef CYASSL_SHA512
+    else if (hashType == SHA512) {
+        hLen = SHA512_DIGEST_SIZE;
+    }
+#endif
+    else
+        return BAD_FUNC_ARG;
+
+    HmacSetKey(&hmac, hashType, passwd, pLen);
+
+    while (kLen) {
+        int currentLen;
+        HmacUpdate(&hmac, salt, sLen);
+
+        /* encode i */
+        for (j = 0; j < 4; j++) {
+            byte b = (byte)(i >> ((3-j) * 8));
+            HmacUpdate(&hmac, &b, 1);
+        }
+        HmacFinal(&hmac, buffer);
+
+        currentLen = min(kLen, hLen);
+        XMEMCPY(output, buffer, currentLen);
+
+        for (j = 1; j < iterations; j++) {
+            HmacUpdate(&hmac, buffer, hLen);
+            HmacFinal(&hmac, buffer);
+            xorbuf(output, buffer, currentLen);
+        }
+
+        output += currentLen;
+        kLen   -= currentLen;
+        i++;
+    }
+
+    return 0;
+}
+
+
+int PKCS12_PBKDF(byte* output, const byte* passwd, int passLen,const byte* salt,
+                 int saltLen, int iterations, int kLen, int hashType, int id)
+{
+    /* all in bytes instead of bits */
+    word32 u, v, dLen, pLen, iLen, sLen, totalLen;
+    int    dynamic = 0;
+    int    ret = 0;
+    int    i;
+    byte   *D, *S, *P, *I;
+    byte   staticBuffer[1024];
+    byte*  buffer = staticBuffer;
+#ifdef CYASSL_SHA512
+    byte   Ai[SHA512_DIGEST_SIZE];
+    byte   B[SHA512_BLOCK_SIZE];
+#elif !defined(NO_SHA256)
+    byte   Ai[SHA256_DIGEST_SIZE];
+    byte   B[SHA256_BLOCK_SIZE];
+#else
+    byte   Ai[SHA_DIGEST_SIZE];
+    byte   B[SHA_BLOCK_SIZE];
+#endif
+
+    if (!iterations)
+        iterations = 1;
+
+    if (hashType == MD5) {
+        v = MD5_BLOCK_SIZE;
+        u = MD5_DIGEST_SIZE;
+    }
+    else if (hashType == SHA) {
+        v = SHA_BLOCK_SIZE;
+        u = SHA_DIGEST_SIZE;
+    }
+#ifndef NO_SHA256
+    else if (hashType == SHA256) {
+        v = SHA256_BLOCK_SIZE;
+        u = SHA256_DIGEST_SIZE;
+    }
+#endif
+#ifdef CYASSL_SHA512
+    else if (hashType == SHA512) {
+        v = SHA512_BLOCK_SIZE;
+        u = SHA512_DIGEST_SIZE;
+    }
+#endif
+    else
+        return BAD_FUNC_ARG; 
+
+    dLen = v;
+    sLen =  v * ((saltLen + v - 1) / v);
+    if (passLen)
+        pLen = v * ((passLen + v - 1) / v);
+    else
+        pLen = 0;
+    iLen = sLen + pLen;
+
+    totalLen = dLen + sLen + pLen;
+
+    if (totalLen > sizeof(staticBuffer)) {
+        buffer = (byte*)XMALLOC(totalLen, 0, DYNAMIC_TYPE_KEY);
+        if (buffer == NULL) return MEMORY_E;
+        dynamic = 1;
+    } 
+
+    D = buffer;
+    S = D + dLen;
+    P = S + sLen;
+    I = S;
+
+    XMEMSET(D, id, dLen);
+
+    for (i = 0; i < (int)sLen; i++)
+        S[i] = salt[i % saltLen];
+    for (i = 0; i < (int)pLen; i++)
+        P[i] = passwd[i % passLen];
+
+    while (kLen > 0) {
+        word32 currentLen;
+        mp_int B1;
+
+        if (hashType == MD5) {
+        }
+        else if (hashType == SHA) {
+            Sha sha;
+
+            InitSha(&sha);
+            ShaUpdate(&sha, buffer, totalLen);
+            ShaFinal(&sha, Ai);
+
+            for (i = 1; i < iterations; i++) {
+                ShaUpdate(&sha, Ai, u);
+                ShaFinal(&sha, Ai);
+            }
+        }
+#ifndef NO_SHA256
+        else if (hashType == SHA256) {
+        }
+#endif
+#ifdef CYASSL_SHA512
+        else if (hashType == SHA512) {
+        }
+#endif
+
+        for (i = 0; i < (int)v; i++)
+            B[i] = Ai[i % u];
+
+        mp_init(&B1);
+        if (mp_read_unsigned_bin(&B1, B, v) != MP_OKAY)
+            ret = MP_READ_E;
+        else if (mp_add_d(&B1, (mp_digit)1, &B1) != MP_OKAY) {
+            ret = MP_ADD_E;
+            mp_clear(&B1);
+            break;
+        }
+
+        for (i = 0; i < (int)iLen; i += v) {
+            int    outSz;
+            mp_int i1;
+            mp_int res;
+
+            mp_init(&i1);
+            mp_init(&res);
+
+            if (mp_read_unsigned_bin(&i1, I + i, v) != MP_OKAY)
+                ret = MP_READ_E;
+            else if (mp_add(&i1, &B1, &res) != MP_OKAY)
+                ret = MP_ADD_E;
+            else if ( (outSz = mp_unsigned_bin_size(&res)) < 0)
+                ret = MP_TO_E;
+            else {
+                if (outSz > (int)v) {
+                    /* take off MSB */
+                    byte  tmp[129];
+                    mp_to_unsigned_bin(&res, tmp);
+                    XMEMCPY(I + i, tmp + 1, v);
+                }
+                else if (outSz < (int)v) {
+                    XMEMSET(I + i, 0, v - outSz);
+                    mp_to_unsigned_bin(&res, I + i + v - outSz);
+                }
+                else
+                    mp_to_unsigned_bin(&res, I + i);
+            }
+
+            mp_clear(&i1);
+            mp_clear(&res);
+            if (ret < 0) break;
+        }
+
+        currentLen = min(kLen, (int)u);
+        XMEMCPY(output, Ai, currentLen);
+        output += currentLen;
+        kLen   -= currentLen;
+        mp_clear(&B1);
+    }
+
+    if (dynamic) XFREE(buffer, 0, DYNAMIC_TYPE_KEY);
+    return ret;
+}
+
+#endif /* NO_PWDBASED */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rabbit.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rabbit.c
new file mode 100644 (file)
index 0000000..79f5b3e
--- /dev/null
@@ -0,0 +1,246 @@
+/* rabbit.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_RABBIT
+
+#include <cyassl/ctaocrypt/rabbit.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifdef BIG_ENDIAN_ORDER
+    #define LITTLE32(x) ByteReverseWord32(x)
+#else
+    #define LITTLE32(x) (x)
+#endif
+
+#define U32V(x) (word32)(x)
+
+
+/* Square a 32-bit unsigned integer to obtain the 64-bit result and return */
+/* the upper 32 bits XOR the lower 32 bits */
+static word32 RABBIT_g_func(word32 x)
+{
+    /* Temporary variables */
+    word32 a, b, h, l;
+
+    /* Construct high and low argument for squaring */
+    a = x&0xFFFF;
+    b = x>>16;
+
+    /* Calculate high and low result of squaring */
+    h = (((U32V(a*a)>>17) + U32V(a*b))>>15) + b*b;
+    l = x*x;
+
+    /* Return high XOR low */
+    return U32V(h^l);
+}
+
+
+/* Calculate the next internal state */
+static void RABBIT_next_state(RabbitCtx* ctx)
+{
+    /* Temporary variables */
+    word32 g[8], c_old[8], i;
+
+    /* Save old counter values */
+    for (i=0; i<8; i++)
+        c_old[i] = ctx->c[i];
+
+    /* Calculate new counter values */
+    ctx->c[0] = U32V(ctx->c[0] + 0x4D34D34D + ctx->carry);
+    ctx->c[1] = U32V(ctx->c[1] + 0xD34D34D3 + (ctx->c[0] < c_old[0]));
+    ctx->c[2] = U32V(ctx->c[2] + 0x34D34D34 + (ctx->c[1] < c_old[1]));
+    ctx->c[3] = U32V(ctx->c[3] + 0x4D34D34D + (ctx->c[2] < c_old[2]));
+    ctx->c[4] = U32V(ctx->c[4] + 0xD34D34D3 + (ctx->c[3] < c_old[3]));
+    ctx->c[5] = U32V(ctx->c[5] + 0x34D34D34 + (ctx->c[4] < c_old[4]));
+    ctx->c[6] = U32V(ctx->c[6] + 0x4D34D34D + (ctx->c[5] < c_old[5]));
+    ctx->c[7] = U32V(ctx->c[7] + 0xD34D34D3 + (ctx->c[6] < c_old[6]));
+    ctx->carry = (ctx->c[7] < c_old[7]);
+   
+    /* Calculate the g-values */
+    for (i=0;i<8;i++)
+        g[i] = RABBIT_g_func(U32V(ctx->x[i] + ctx->c[i]));
+
+    /* Calculate new state values */
+    ctx->x[0] = U32V(g[0] + rotlFixed(g[7],16) + rotlFixed(g[6], 16));
+    ctx->x[1] = U32V(g[1] + rotlFixed(g[0], 8) + g[7]);
+    ctx->x[2] = U32V(g[2] + rotlFixed(g[1],16) + rotlFixed(g[0], 16));
+    ctx->x[3] = U32V(g[3] + rotlFixed(g[2], 8) + g[1]);
+    ctx->x[4] = U32V(g[4] + rotlFixed(g[3],16) + rotlFixed(g[2], 16));
+    ctx->x[5] = U32V(g[5] + rotlFixed(g[4], 8) + g[3]);
+    ctx->x[6] = U32V(g[6] + rotlFixed(g[5],16) + rotlFixed(g[4], 16));
+    ctx->x[7] = U32V(g[7] + rotlFixed(g[6], 8) + g[5]);
+}
+
+
+/* IV setup */
+static void RabbitSetIV(Rabbit* ctx, const byte* iv)
+{
+    /* Temporary variables */
+    word32 i0, i1, i2, i3, i;
+      
+    /* Generate four subvectors */
+    i0 = LITTLE32(*(word32*)(iv+0));
+    i2 = LITTLE32(*(word32*)(iv+4));
+    i1 = (i0>>16) | (i2&0xFFFF0000);
+    i3 = (i2<<16) | (i0&0x0000FFFF);
+
+    /* Modify counter values */
+    ctx->workCtx.c[0] = ctx->masterCtx.c[0] ^ i0;
+    ctx->workCtx.c[1] = ctx->masterCtx.c[1] ^ i1;
+    ctx->workCtx.c[2] = ctx->masterCtx.c[2] ^ i2;
+    ctx->workCtx.c[3] = ctx->masterCtx.c[3] ^ i3;
+    ctx->workCtx.c[4] = ctx->masterCtx.c[4] ^ i0;
+    ctx->workCtx.c[5] = ctx->masterCtx.c[5] ^ i1;
+    ctx->workCtx.c[6] = ctx->masterCtx.c[6] ^ i2;
+    ctx->workCtx.c[7] = ctx->masterCtx.c[7] ^ i3;
+
+    /* Copy state variables */
+    for (i=0; i<8; i++)
+        ctx->workCtx.x[i] = ctx->masterCtx.x[i];
+    ctx->workCtx.carry = ctx->masterCtx.carry;
+
+    /* Iterate the system four times */
+    for (i=0; i<4; i++)
+        RABBIT_next_state(&(ctx->workCtx));
+}
+
+
+/* Key setup */
+void RabbitSetKey(Rabbit* ctx, const byte* key, const byte* iv)
+{
+    /* Temporary variables */
+    word32 k0, k1, k2, k3, i;
+
+    /* Generate four subkeys */
+    k0 = LITTLE32(*(word32*)(key+ 0));
+    k1 = LITTLE32(*(word32*)(key+ 4));
+    k2 = LITTLE32(*(word32*)(key+ 8));
+    k3 = LITTLE32(*(word32*)(key+12));
+
+    /* Generate initial state variables */
+    ctx->masterCtx.x[0] = k0;
+    ctx->masterCtx.x[2] = k1;
+    ctx->masterCtx.x[4] = k2;
+    ctx->masterCtx.x[6] = k3;
+    ctx->masterCtx.x[1] = U32V(k3<<16) | (k2>>16);
+    ctx->masterCtx.x[3] = U32V(k0<<16) | (k3>>16);
+    ctx->masterCtx.x[5] = U32V(k1<<16) | (k0>>16);
+    ctx->masterCtx.x[7] = U32V(k2<<16) | (k1>>16);
+
+    /* Generate initial counter values */
+    ctx->masterCtx.c[0] = rotlFixed(k2, 16);
+    ctx->masterCtx.c[2] = rotlFixed(k3, 16);
+    ctx->masterCtx.c[4] = rotlFixed(k0, 16);
+    ctx->masterCtx.c[6] = rotlFixed(k1, 16);
+    ctx->masterCtx.c[1] = (k0&0xFFFF0000) | (k1&0xFFFF);
+    ctx->masterCtx.c[3] = (k1&0xFFFF0000) | (k2&0xFFFF);
+    ctx->masterCtx.c[5] = (k2&0xFFFF0000) | (k3&0xFFFF);
+    ctx->masterCtx.c[7] = (k3&0xFFFF0000) | (k0&0xFFFF);
+
+    /* Clear carry bit */
+    ctx->masterCtx.carry = 0;
+
+    /* Iterate the system four times */
+    for (i=0; i<4; i++)
+        RABBIT_next_state(&(ctx->masterCtx));
+
+    /* Modify the counters */
+    for (i=0; i<8; i++)
+        ctx->masterCtx.c[i] ^= ctx->masterCtx.x[(i+4)&0x7];
+
+    /* Copy master instance to work instance */
+    for (i=0; i<8; i++) {
+        ctx->workCtx.x[i] = ctx->masterCtx.x[i];
+        ctx->workCtx.c[i] = ctx->masterCtx.c[i];
+    }
+    ctx->workCtx.carry = ctx->masterCtx.carry;
+
+    if (iv) RabbitSetIV(ctx, iv);    
+}
+
+
+/* Encrypt/decrypt a message of any size */
+void RabbitProcess(Rabbit* ctx, byte* output, const byte* input, word32 msglen)
+{
+
+    /* Encrypt/decrypt all full blocks */
+    while (msglen >= 16) {
+        /* Iterate the system */
+        RABBIT_next_state(&(ctx->workCtx));
+
+        /* Encrypt/decrypt 16 bytes of data */
+        *(word32*)(output+ 0) = *(word32*)(input+ 0) ^
+                   LITTLE32(ctx->workCtx.x[0] ^ (ctx->workCtx.x[5]>>16) ^
+                   U32V(ctx->workCtx.x[3]<<16));
+        *(word32*)(output+ 4) = *(word32*)(input+ 4) ^
+                   LITTLE32(ctx->workCtx.x[2] ^ (ctx->workCtx.x[7]>>16) ^
+                   U32V(ctx->workCtx.x[5]<<16));
+        *(word32*)(output+ 8) = *(word32*)(input+ 8) ^
+                   LITTLE32(ctx->workCtx.x[4] ^ (ctx->workCtx.x[1]>>16) ^
+                   U32V(ctx->workCtx.x[7]<<16));
+        *(word32*)(output+12) = *(word32*)(input+12) ^
+                   LITTLE32(ctx->workCtx.x[6] ^ (ctx->workCtx.x[3]>>16) ^
+                   U32V(ctx->workCtx.x[1]<<16));
+
+        /* Increment pointers and decrement length */
+        input += 16;
+        output += 16;
+        msglen -= 16;
+    }
+
+    /* Encrypt/decrypt remaining data */
+    if (msglen) {
+
+        word32 i;
+        word32 tmp[4];
+        byte*  buffer = (byte*)tmp;
+
+        /* Iterate the system */
+        RABBIT_next_state(&(ctx->workCtx));
+
+        /* Generate 16 bytes of pseudo-random data */
+        tmp[0] = LITTLE32(ctx->workCtx.x[0] ^
+                  (ctx->workCtx.x[5]>>16) ^ U32V(ctx->workCtx.x[3]<<16));
+        tmp[1] = LITTLE32(ctx->workCtx.x[2] ^ 
+                  (ctx->workCtx.x[7]>>16) ^ U32V(ctx->workCtx.x[5]<<16));
+        tmp[2] = LITTLE32(ctx->workCtx.x[4] ^ 
+                  (ctx->workCtx.x[1]>>16) ^ U32V(ctx->workCtx.x[7]<<16));
+        tmp[3] = LITTLE32(ctx->workCtx.x[6] ^ 
+                  (ctx->workCtx.x[3]>>16) ^ U32V(ctx->workCtx.x[1]<<16));
+
+        /* Encrypt/decrypt the data */
+        for (i=0; i<msglen; i++)
+            output[i] = input[i] ^ buffer[i];
+    }
+}
+
+
+
+#endif /* NO_RABBIT */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/random.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/random.c
new file mode 100644 (file)
index 0000000..aeb60b5
--- /dev/null
@@ -0,0 +1,193 @@
+/* random.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/* on HPUX 11 you may need to install /dev/random see
+   http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I
+
+*/
+
+#include <cyassl/ctaocrypt/random.h>
+#include <cyassl/ctaocrypt/error.h>
+
+
+#if defined(USE_WINDOWS_API)
+    #ifndef _WIN32_WINNT
+        #define _WIN32_WINNT 0x0400
+    #endif
+    #include <windows.h>
+    #include <wincrypt.h>
+#else
+    #ifndef NO_DEV_RANDOM
+        #include <fcntl.h>
+        #include <unistd.h>
+    #else
+        /* include headers that may be needed to get good seed */
+    #endif
+#endif /* USE_WINDOWS_API */
+
+
+
+/* Get seed and key cipher */
+int InitRng(RNG* rng)
+{
+    byte key[32];
+    byte junk[256];
+
+    int  ret = GenerateSeed(&rng->seed, key, sizeof(key));
+
+    if (ret == 0) {
+        Arc4SetKey(&rng->cipher, key, sizeof(key));
+        RNG_GenerateBlock(rng, junk, sizeof(junk));  /* rid initial state */
+    }
+
+    return ret;
+}
+
+
+/* place a generated block in output */
+void RNG_GenerateBlock(RNG* rng, byte* output, word32 sz)
+{
+    XMEMSET(output, 0, sz);
+    Arc4Process(&rng->cipher, output, output, sz);
+}
+
+
+byte RNG_GenerateByte(RNG* rng)
+{
+    byte b;
+    RNG_GenerateBlock(rng, &b, 1);
+
+    return b;
+}
+
+
+#if defined(USE_WINDOWS_API)
+
+
+int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
+{
+    if(!CryptAcquireContext(&os->handle, 0, 0, PROV_RSA_FULL,
+                            CRYPT_VERIFYCONTEXT))
+        return WINCRYPT_E;
+
+    if (!CryptGenRandom(os->handle, sz, output))
+        return CRYPTGEN_E;
+
+    CryptReleaseContext(os->handle, 0);
+
+    return 0;
+}
+
+
+#elif defined(THREADX)
+
+#include "rtprand.h"   /* rtp_rand () */
+#include "rtptime.h"   /* rtp_get_system_msec() */
+
+
+int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
+{
+    int i;
+    rtp_srand(rtp_get_system_msec());
+
+    for (i = 0; i < sz; i++ ) {
+        output[i] = rtp_rand() % 256;
+        if ( (i % 8) == 7)
+            rtp_srand(rtp_get_system_msec());
+    }
+
+    return 0;
+}
+
+
+#elif defined(MICRIUM)
+
+int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
+{
+    #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+        NetSecure_InitSeed(output, sz);
+    #endif
+    return 0;
+}
+
+#elif defined(MBED)
+
+/* write a real one !!!, just for testing board */
+int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
+{
+    int i;
+    for (i = 0; i < sz; i++ )
+        output[i] = i;
+
+    return 0;
+}
+
+#elif defined(NO_DEV_RANDOM)
+
+#error "you need to write an os specific GenerateSeed() here"
+
+
+#else /* !USE_WINDOWS_API && !THREADX && !MICRIUM && !NO_DEV_RANDOM */
+
+
+/* may block */
+int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
+{
+    int ret = 0;
+
+    os->fd = open("/dev/urandom",O_RDONLY);
+    if (os->fd == -1) {
+        /* may still have /dev/random */
+        os->fd = open("/dev/random",O_RDONLY);
+        if (os->fd == -1)
+            return OPEN_RAN_E;
+    }
+
+    while (sz) {
+        int len = read(os->fd, output, sz);
+        if (len == -1) { 
+            ret = READ_RAN_E;
+            break;
+        }
+
+        sz     -= len;
+        output += len;
+
+        if (sz) {
+#ifdef BLOCKING
+            sleep(0);             /* context switch */
+#else
+            ret = RAN_BLOCK_E;
+            break;
+#endif
+        }
+    }
+    close(os->fd);
+
+    return ret;
+}
+
+#endif /* USE_WINDOWS_API */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ripemd.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/ripemd.c
new file mode 100644 (file)
index 0000000..1cb6ae8
--- /dev/null
@@ -0,0 +1,351 @@
+/* ripemd.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef CYASSL_RIPEMD
+
+#include <cyassl/ctaocrypt/ripemd.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitRipeMd(RipeMd* ripemd)
+{
+    ripemd->digest[0] = 0x67452301L;
+    ripemd->digest[1] = 0xEFCDAB89L;
+    ripemd->digest[2] = 0x98BADCFEL;
+    ripemd->digest[3] = 0x10325476L;
+    ripemd->digest[4] = 0xC3D2E1F0L;
+
+    ripemd->buffLen = 0;
+    ripemd->loLen   = 0;
+    ripemd->hiLen   = 0;
+}
+
+
+/* for all */
+#define F(x, y, z)    (x ^ y ^ z) 
+#define G(x, y, z)    (z ^ (x & (y^z)))
+#define H(x, y, z)    (z ^ (x | ~y))
+#define I(x, y, z)    (y ^ (z & (x^y)))
+#define J(x, y, z)    (x ^ (y | ~z))
+
+#define k0 0
+#define k1 0x5a827999
+#define k2 0x6ed9eba1
+#define k3 0x8f1bbcdc
+#define k4 0xa953fd4e
+#define k5 0x50a28be6
+#define k6 0x5c4dd124
+#define k7 0x6d703ef3
+#define k8 0x7a6d76e9
+#define k9 0
+
+/* for 160 and 320 */
+#define Subround(f, a, b, c, d, e, x, s, k) \
+    a += f(b, c, d) + x + k;\
+    a = rotlFixed((word32)a, s) + e;\
+    c = rotlFixed((word32)c, 10U)
+
+static void Transform(RipeMd* ripemd)
+{
+    word32 a1, b1, c1, d1, e1, a2, b2, c2, d2, e2;
+    a1 = a2 = ripemd->digest[0];
+    b1 = b2 = ripemd->digest[1];
+    c1 = c2 = ripemd->digest[2];
+    d1 = d2 = ripemd->digest[3];
+    e1 = e2 = ripemd->digest[4];
+
+    Subround(F, a1, b1, c1, d1, e1, ripemd->buffer[ 0], 11, k0);
+    Subround(F, e1, a1, b1, c1, d1, ripemd->buffer[ 1], 14, k0);
+    Subround(F, d1, e1, a1, b1, c1, ripemd->buffer[ 2], 15, k0);
+    Subround(F, c1, d1, e1, a1, b1, ripemd->buffer[ 3], 12, k0);
+    Subround(F, b1, c1, d1, e1, a1, ripemd->buffer[ 4],  5, k0);
+    Subround(F, a1, b1, c1, d1, e1, ripemd->buffer[ 5],  8, k0);
+    Subround(F, e1, a1, b1, c1, d1, ripemd->buffer[ 6],  7, k0);
+    Subround(F, d1, e1, a1, b1, c1, ripemd->buffer[ 7],  9, k0);
+    Subround(F, c1, d1, e1, a1, b1, ripemd->buffer[ 8], 11, k0);
+    Subround(F, b1, c1, d1, e1, a1, ripemd->buffer[ 9], 13, k0);
+    Subround(F, a1, b1, c1, d1, e1, ripemd->buffer[10], 14, k0);
+    Subround(F, e1, a1, b1, c1, d1, ripemd->buffer[11], 15, k0);
+    Subround(F, d1, e1, a1, b1, c1, ripemd->buffer[12],  6, k0);
+    Subround(F, c1, d1, e1, a1, b1, ripemd->buffer[13],  7, k0);
+    Subround(F, b1, c1, d1, e1, a1, ripemd->buffer[14],  9, k0);
+    Subround(F, a1, b1, c1, d1, e1, ripemd->buffer[15],  8, k0);
+
+    Subround(G, e1, a1, b1, c1, d1, ripemd->buffer[ 7],  7, k1);
+    Subround(G, d1, e1, a1, b1, c1, ripemd->buffer[ 4],  6, k1);
+    Subround(G, c1, d1, e1, a1, b1, ripemd->buffer[13],  8, k1);
+    Subround(G, b1, c1, d1, e1, a1, ripemd->buffer[ 1], 13, k1);
+    Subround(G, a1, b1, c1, d1, e1, ripemd->buffer[10], 11, k1);
+    Subround(G, e1, a1, b1, c1, d1, ripemd->buffer[ 6],  9, k1);
+    Subround(G, d1, e1, a1, b1, c1, ripemd->buffer[15],  7, k1);
+    Subround(G, c1, d1, e1, a1, b1, ripemd->buffer[ 3], 15, k1);
+    Subround(G, b1, c1, d1, e1, a1, ripemd->buffer[12],  7, k1);
+    Subround(G, a1, b1, c1, d1, e1, ripemd->buffer[ 0], 12, k1);
+    Subround(G, e1, a1, b1, c1, d1, ripemd->buffer[ 9], 15, k1);
+    Subround(G, d1, e1, a1, b1, c1, ripemd->buffer[ 5],  9, k1);
+    Subround(G, c1, d1, e1, a1, b1, ripemd->buffer[ 2], 11, k1);
+    Subround(G, b1, c1, d1, e1, a1, ripemd->buffer[14],  7, k1);
+    Subround(G, a1, b1, c1, d1, e1, ripemd->buffer[11], 13, k1);
+    Subround(G, e1, a1, b1, c1, d1, ripemd->buffer[ 8], 12, k1);
+
+    Subround(H, d1, e1, a1, b1, c1, ripemd->buffer[ 3], 11, k2);
+    Subround(H, c1, d1, e1, a1, b1, ripemd->buffer[10], 13, k2);
+    Subround(H, b1, c1, d1, e1, a1, ripemd->buffer[14],  6, k2);
+    Subround(H, a1, b1, c1, d1, e1, ripemd->buffer[ 4],  7, k2);
+    Subround(H, e1, a1, b1, c1, d1, ripemd->buffer[ 9], 14, k2);
+    Subround(H, d1, e1, a1, b1, c1, ripemd->buffer[15],  9, k2);
+    Subround(H, c1, d1, e1, a1, b1, ripemd->buffer[ 8], 13, k2);
+    Subround(H, b1, c1, d1, e1, a1, ripemd->buffer[ 1], 15, k2);
+    Subround(H, a1, b1, c1, d1, e1, ripemd->buffer[ 2], 14, k2);
+    Subround(H, e1, a1, b1, c1, d1, ripemd->buffer[ 7],  8, k2);
+    Subround(H, d1, e1, a1, b1, c1, ripemd->buffer[ 0], 13, k2);
+    Subround(H, c1, d1, e1, a1, b1, ripemd->buffer[ 6],  6, k2);
+    Subround(H, b1, c1, d1, e1, a1, ripemd->buffer[13],  5, k2);
+    Subround(H, a1, b1, c1, d1, e1, ripemd->buffer[11], 12, k2);
+    Subround(H, e1, a1, b1, c1, d1, ripemd->buffer[ 5],  7, k2);
+    Subround(H, d1, e1, a1, b1, c1, ripemd->buffer[12],  5, k2);
+
+    Subround(I, c1, d1, e1, a1, b1, ripemd->buffer[ 1], 11, k3);
+    Subround(I, b1, c1, d1, e1, a1, ripemd->buffer[ 9], 12, k3);
+    Subround(I, a1, b1, c1, d1, e1, ripemd->buffer[11], 14, k3);
+    Subround(I, e1, a1, b1, c1, d1, ripemd->buffer[10], 15, k3);
+    Subround(I, d1, e1, a1, b1, c1, ripemd->buffer[ 0], 14, k3);
+    Subround(I, c1, d1, e1, a1, b1, ripemd->buffer[ 8], 15, k3);
+    Subround(I, b1, c1, d1, e1, a1, ripemd->buffer[12],  9, k3);
+    Subround(I, a1, b1, c1, d1, e1, ripemd->buffer[ 4],  8, k3);
+    Subround(I, e1, a1, b1, c1, d1, ripemd->buffer[13],  9, k3);
+    Subround(I, d1, e1, a1, b1, c1, ripemd->buffer[ 3], 14, k3);
+    Subround(I, c1, d1, e1, a1, b1, ripemd->buffer[ 7],  5, k3);
+    Subround(I, b1, c1, d1, e1, a1, ripemd->buffer[15],  6, k3);
+    Subround(I, a1, b1, c1, d1, e1, ripemd->buffer[14],  8, k3);
+    Subround(I, e1, a1, b1, c1, d1, ripemd->buffer[ 5],  6, k3);
+    Subround(I, d1, e1, a1, b1, c1, ripemd->buffer[ 6],  5, k3);
+    Subround(I, c1, d1, e1, a1, b1, ripemd->buffer[ 2], 12, k3);
+
+    Subround(J, b1, c1, d1, e1, a1, ripemd->buffer[ 4],  9, k4);
+    Subround(J, a1, b1, c1, d1, e1, ripemd->buffer[ 0], 15, k4);
+    Subround(J, e1, a1, b1, c1, d1, ripemd->buffer[ 5],  5, k4);
+    Subround(J, d1, e1, a1, b1, c1, ripemd->buffer[ 9], 11, k4);
+    Subround(J, c1, d1, e1, a1, b1, ripemd->buffer[ 7],  6, k4);
+    Subround(J, b1, c1, d1, e1, a1, ripemd->buffer[12],  8, k4);
+    Subround(J, a1, b1, c1, d1, e1, ripemd->buffer[ 2], 13, k4);
+    Subround(J, e1, a1, b1, c1, d1, ripemd->buffer[10], 12, k4);
+    Subround(J, d1, e1, a1, b1, c1, ripemd->buffer[14],  5, k4);
+    Subround(J, c1, d1, e1, a1, b1, ripemd->buffer[ 1], 12, k4);
+    Subround(J, b1, c1, d1, e1, a1, ripemd->buffer[ 3], 13, k4);
+    Subround(J, a1, b1, c1, d1, e1, ripemd->buffer[ 8], 14, k4);
+    Subround(J, e1, a1, b1, c1, d1, ripemd->buffer[11], 11, k4);
+    Subround(J, d1, e1, a1, b1, c1, ripemd->buffer[ 6],  8, k4);
+    Subround(J, c1, d1, e1, a1, b1, ripemd->buffer[15],  5, k4);
+    Subround(J, b1, c1, d1, e1, a1, ripemd->buffer[13],  6, k4);
+
+    Subround(J, a2, b2, c2, d2, e2, ripemd->buffer[ 5],  8, k5);
+    Subround(J, e2, a2, b2, c2, d2, ripemd->buffer[14],  9, k5);
+    Subround(J, d2, e2, a2, b2, c2, ripemd->buffer[ 7],  9, k5);
+    Subround(J, c2, d2, e2, a2, b2, ripemd->buffer[ 0], 11, k5);
+    Subround(J, b2, c2, d2, e2, a2, ripemd->buffer[ 9], 13, k5);
+    Subround(J, a2, b2, c2, d2, e2, ripemd->buffer[ 2], 15, k5);
+    Subround(J, e2, a2, b2, c2, d2, ripemd->buffer[11], 15, k5);
+    Subround(J, d2, e2, a2, b2, c2, ripemd->buffer[ 4],  5, k5);
+    Subround(J, c2, d2, e2, a2, b2, ripemd->buffer[13],  7, k5);
+    Subround(J, b2, c2, d2, e2, a2, ripemd->buffer[ 6],  7, k5);
+    Subround(J, a2, b2, c2, d2, e2, ripemd->buffer[15],  8, k5);
+    Subround(J, e2, a2, b2, c2, d2, ripemd->buffer[ 8], 11, k5);
+    Subround(J, d2, e2, a2, b2, c2, ripemd->buffer[ 1], 14, k5);
+    Subround(J, c2, d2, e2, a2, b2, ripemd->buffer[10], 14, k5);
+    Subround(J, b2, c2, d2, e2, a2, ripemd->buffer[ 3], 12, k5);
+    Subround(J, a2, b2, c2, d2, e2, ripemd->buffer[12],  6, k5);
+
+    Subround(I, e2, a2, b2, c2, d2, ripemd->buffer[ 6],  9, k6); 
+    Subround(I, d2, e2, a2, b2, c2, ripemd->buffer[11], 13, k6);
+    Subround(I, c2, d2, e2, a2, b2, ripemd->buffer[ 3], 15, k6);
+    Subround(I, b2, c2, d2, e2, a2, ripemd->buffer[ 7],  7, k6);
+    Subround(I, a2, b2, c2, d2, e2, ripemd->buffer[ 0], 12, k6);
+    Subround(I, e2, a2, b2, c2, d2, ripemd->buffer[13],  8, k6);
+    Subround(I, d2, e2, a2, b2, c2, ripemd->buffer[ 5],  9, k6);
+    Subround(I, c2, d2, e2, a2, b2, ripemd->buffer[10], 11, k6);
+    Subround(I, b2, c2, d2, e2, a2, ripemd->buffer[14],  7, k6);
+    Subround(I, a2, b2, c2, d2, e2, ripemd->buffer[15],  7, k6);
+    Subround(I, e2, a2, b2, c2, d2, ripemd->buffer[ 8], 12, k6);
+    Subround(I, d2, e2, a2, b2, c2, ripemd->buffer[12],  7, k6);
+    Subround(I, c2, d2, e2, a2, b2, ripemd->buffer[ 4],  6, k6);
+    Subround(I, b2, c2, d2, e2, a2, ripemd->buffer[ 9], 15, k6);
+    Subround(I, a2, b2, c2, d2, e2, ripemd->buffer[ 1], 13, k6);
+    Subround(I, e2, a2, b2, c2, d2, ripemd->buffer[ 2], 11, k6);
+
+    Subround(H, d2, e2, a2, b2, c2, ripemd->buffer[15],  9, k7);
+    Subround(H, c2, d2, e2, a2, b2, ripemd->buffer[ 5],  7, k7);
+    Subround(H, b2, c2, d2, e2, a2, ripemd->buffer[ 1], 15, k7);
+    Subround(H, a2, b2, c2, d2, e2, ripemd->buffer[ 3], 11, k7);
+    Subround(H, e2, a2, b2, c2, d2, ripemd->buffer[ 7],  8, k7);
+    Subround(H, d2, e2, a2, b2, c2, ripemd->buffer[14],  6, k7);
+    Subround(H, c2, d2, e2, a2, b2, ripemd->buffer[ 6],  6, k7);
+    Subround(H, b2, c2, d2, e2, a2, ripemd->buffer[ 9], 14, k7);
+    Subround(H, a2, b2, c2, d2, e2, ripemd->buffer[11], 12, k7);
+    Subround(H, e2, a2, b2, c2, d2, ripemd->buffer[ 8], 13, k7);
+    Subround(H, d2, e2, a2, b2, c2, ripemd->buffer[12],  5, k7);
+    Subround(H, c2, d2, e2, a2, b2, ripemd->buffer[ 2], 14, k7);
+    Subround(H, b2, c2, d2, e2, a2, ripemd->buffer[10], 13, k7);
+    Subround(H, a2, b2, c2, d2, e2, ripemd->buffer[ 0], 13, k7);
+    Subround(H, e2, a2, b2, c2, d2, ripemd->buffer[ 4],  7, k7);
+    Subround(H, d2, e2, a2, b2, c2, ripemd->buffer[13],  5, k7);
+
+    Subround(G, c2, d2, e2, a2, b2, ripemd->buffer[ 8], 15, k8);
+    Subround(G, b2, c2, d2, e2, a2, ripemd->buffer[ 6],  5, k8);
+    Subround(G, a2, b2, c2, d2, e2, ripemd->buffer[ 4],  8, k8);
+    Subround(G, e2, a2, b2, c2, d2, ripemd->buffer[ 1], 11, k8);
+    Subround(G, d2, e2, a2, b2, c2, ripemd->buffer[ 3], 14, k8);
+    Subround(G, c2, d2, e2, a2, b2, ripemd->buffer[11], 14, k8);
+    Subround(G, b2, c2, d2, e2, a2, ripemd->buffer[15],  6, k8);
+    Subround(G, a2, b2, c2, d2, e2, ripemd->buffer[ 0], 14, k8);
+    Subround(G, e2, a2, b2, c2, d2, ripemd->buffer[ 5],  6, k8);
+    Subround(G, d2, e2, a2, b2, c2, ripemd->buffer[12],  9, k8);
+    Subround(G, c2, d2, e2, a2, b2, ripemd->buffer[ 2], 12, k8);
+    Subround(G, b2, c2, d2, e2, a2, ripemd->buffer[13],  9, k8);
+    Subround(G, a2, b2, c2, d2, e2, ripemd->buffer[ 9], 12, k8);
+    Subround(G, e2, a2, b2, c2, d2, ripemd->buffer[ 7],  5, k8);
+    Subround(G, d2, e2, a2, b2, c2, ripemd->buffer[10], 15, k8);
+    Subround(G, c2, d2, e2, a2, b2, ripemd->buffer[14],  8, k8);
+
+    Subround(F, b2, c2, d2, e2, a2, ripemd->buffer[12],  8, k9);
+    Subround(F, a2, b2, c2, d2, e2, ripemd->buffer[15],  5, k9);
+    Subround(F, e2, a2, b2, c2, d2, ripemd->buffer[10], 12, k9);
+    Subround(F, d2, e2, a2, b2, c2, ripemd->buffer[ 4],  9, k9);
+    Subround(F, c2, d2, e2, a2, b2, ripemd->buffer[ 1], 12, k9);
+    Subround(F, b2, c2, d2, e2, a2, ripemd->buffer[ 5],  5, k9);
+    Subround(F, a2, b2, c2, d2, e2, ripemd->buffer[ 8], 14, k9);
+    Subround(F, e2, a2, b2, c2, d2, ripemd->buffer[ 7],  6, k9);
+    Subround(F, d2, e2, a2, b2, c2, ripemd->buffer[ 6],  8, k9);
+    Subround(F, c2, d2, e2, a2, b2, ripemd->buffer[ 2], 13, k9);
+    Subround(F, b2, c2, d2, e2, a2, ripemd->buffer[13],  6, k9);
+    Subround(F, a2, b2, c2, d2, e2, ripemd->buffer[14],  5, k9);
+    Subround(F, e2, a2, b2, c2, d2, ripemd->buffer[ 0], 15, k9);
+    Subround(F, d2, e2, a2, b2, c2, ripemd->buffer[ 3], 13, k9);
+    Subround(F, c2, d2, e2, a2, b2, ripemd->buffer[ 9], 11, k9);
+    Subround(F, b2, c2, d2, e2, a2, ripemd->buffer[11], 11, k9);
+
+    c1                = ripemd->digest[1] + c1 + d2;
+    ripemd->digest[1] = ripemd->digest[2] + d1 + e2;
+    ripemd->digest[2] = ripemd->digest[3] + e1 + a2;
+    ripemd->digest[3] = ripemd->digest[4] + a1 + b2;
+    ripemd->digest[4] = ripemd->digest[0] + b1 + c2;
+    ripemd->digest[0] = c1;
+}
+
+
+static INLINE void AddLength(RipeMd* ripemd, word32 len)
+{
+    word32 tmp = ripemd->loLen;
+    if ( (ripemd->loLen += len) < tmp)
+        ripemd->hiLen++;                       /* carry low to high */
+}
+
+
+void RipeMdUpdate(RipeMd* ripemd, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)ripemd->buffer;
+
+    while (len) {
+        word32 add = min(len, RIPEMD_BLOCK_SIZE - ripemd->buffLen);
+        XMEMCPY(&local[ripemd->buffLen], data, add);
+
+        ripemd->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (ripemd->buffLen == RIPEMD_BLOCK_SIZE) {
+            #ifdef BIG_ENDIAN_ORDER
+                ByteReverseBytes(local, local, RIPEMD_BLOCK_SIZE);
+            #endif
+            Transform(ripemd);
+            AddLength(ripemd, RIPEMD_BLOCK_SIZE);
+            ripemd->buffLen = 0;
+        }
+    }
+}
+
+
+void RipeMdFinal(RipeMd* ripemd, byte* hash)
+{
+    byte* local = (byte*)ripemd->buffer;
+
+    AddLength(ripemd, ripemd->buffLen);               /* before adding pads */
+
+    local[ripemd->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (ripemd->buffLen > RIPEMD_PAD_SIZE) {
+        XMEMSET(&local[ripemd->buffLen], 0, RIPEMD_BLOCK_SIZE - ripemd->buffLen);
+        ripemd->buffLen += RIPEMD_BLOCK_SIZE - ripemd->buffLen;
+
+        #ifdef BIG_ENDIAN_ORDER
+            ByteReverseBytes(local, local, RIPEMD_BLOCK_SIZE);
+        #endif
+        Transform(ripemd);
+        ripemd->buffLen = 0;
+    }
+    XMEMSET(&local[ripemd->buffLen], 0, RIPEMD_PAD_SIZE - ripemd->buffLen);
+   
+    /* put lengths in bits */
+    ripemd->loLen = ripemd->loLen << 3;
+    ripemd->hiLen = (ripemd->loLen >> (8*sizeof(ripemd->loLen) - 3)) + 
+                 (ripemd->hiLen << 3);
+
+    /* store lengths */
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseBytes(local, local, RIPEMD_BLOCK_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    XMEMCPY(&local[RIPEMD_PAD_SIZE], &ripemd->loLen, sizeof(word32));
+    XMEMCPY(&local[RIPEMD_PAD_SIZE + sizeof(word32)], &ripemd->hiLen, 
+           sizeof(word32));
+
+    Transform(ripemd);
+    #ifdef BIG_ENDIAN_ORDER
+        ByteReverseWords(ripemd->digest, ripemd->digest, RIPEMD_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, ripemd->digest, RIPEMD_DIGEST_SIZE);
+
+    InitRipeMd(ripemd);  /* reset state */
+}
+
+
+#endif /* CYASSL_RIPEMD */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rsa.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/rsa.c
new file mode 100644 (file)
index 0000000..7f511df
--- /dev/null
@@ -0,0 +1,557 @@
+/* rsa.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/rsa.h>
+#include <cyassl/ctaocrypt/random.h>
+#include <cyassl/ctaocrypt/error.h>
+#include <cyassl/ctaocrypt/logging.h>
+
+#ifdef SHOW_GEN
+    #include <stdio.h>
+#endif
+
+
+enum {
+    RSA_PUBLIC_ENCRYPT  = 0,
+    RSA_PUBLIC_DECRYPT  = 1,
+    RSA_PRIVATE_ENCRYPT = 2,
+    RSA_PRIVATE_DECRYPT = 3,
+
+    RSA_BLOCK_TYPE_1 = 1,
+    RSA_BLOCK_TYPE_2 = 2,
+
+    RSA_MIN_SIZE = 512,
+    RSA_MAX_SIZE = 4096,
+
+    RSA_MIN_PAD_SZ   = 11      /* seperator + 0 + pad value + 8 pads */
+};
+
+
+void InitRsaKey(RsaKey* key, void* heap)
+{
+    key->type = -1;  /* haven't decided yet */
+    key->heap = heap;
+
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    key->n.dp = key->e.dp = 0;  /* public  alloc parts */
+
+    key->d.dp = key->p.dp  = 0;  /* private alloc parts */
+    key->q.dp = key->dP.dp = 0;  
+    key->u.dp = key->dQ.dp = 0;
+#endif
+}
+
+
+void FreeRsaKey(RsaKey* key)
+{
+    (void)key;
+/* TomsFastMath doesn't use memory allocation */
+#ifndef USE_FAST_MATH
+    if (key->type == RSA_PRIVATE) {
+        mp_clear(&key->u);
+        mp_clear(&key->dQ);
+        mp_clear(&key->dP);
+        mp_clear(&key->q);
+        mp_clear(&key->p);
+        mp_clear(&key->d);
+    }
+    mp_clear(&key->e);
+    mp_clear(&key->n);
+#endif
+}
+
+static void RsaPad(const byte* input, word32 inputLen, byte* pkcsBlock,
+                   word32 pkcsBlockLen, byte padValue, RNG* rng)
+{
+    if (inputLen == 0) return;
+
+    pkcsBlock[0] = 0x0;       /* set first byte to zero and advance */
+    pkcsBlock++; pkcsBlockLen--;
+    pkcsBlock[0] = padValue;  /* insert padValue */
+
+    if (padValue == RSA_BLOCK_TYPE_1)
+        /* pad with 0xff bytes */
+        XMEMSET(&pkcsBlock[1], 0xFF, pkcsBlockLen - inputLen - 2);
+    else {
+        /* pad with non-zero random bytes */
+        word32 padLen = pkcsBlockLen - inputLen - 1, i;
+        RNG_GenerateBlock(rng, &pkcsBlock[1], padLen);
+
+        /* remove zeros */
+        for (i = 1; i < padLen; i++)
+            if (pkcsBlock[i] == 0) pkcsBlock[i] = 0x01;
+    }
+
+    pkcsBlock[pkcsBlockLen-inputLen-1] = 0;     /* separator */
+    XMEMCPY(pkcsBlock+pkcsBlockLen-inputLen, input, inputLen);
+}
+
+
+static word32 RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
+                       byte **output, byte padValue)
+{
+    word32 maxOutputLen = (pkcsBlockLen > 10) ? (pkcsBlockLen - 10) : 0,
+           invalid = 0,
+           i = 1,
+           outputLen;
+
+    if (pkcsBlock[0] != 0x0) /* skip past zero */
+        invalid = 1;
+    pkcsBlock++; pkcsBlockLen--;
+
+    /* Require block type padValue */
+    invalid = (pkcsBlock[0] != padValue) || invalid;
+
+    /* skip past the padding until we find the separator */
+    while (i<pkcsBlockLen && pkcsBlock[i++]) { /* null body */
+        }
+    if(!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) {
+        CYASSL_MSG("RsaUnPad error, bad formatting");
+        return 0;
+    }
+
+    outputLen = pkcsBlockLen - i;
+    invalid = (outputLen > maxOutputLen) || invalid;
+
+    if (invalid) {
+        CYASSL_MSG("RsaUnPad error, bad formatting");
+        return 0;
+    }
+
+    *output = (byte *)(pkcsBlock + i);
+    return outputLen;
+}
+
+
+static int RsaFunction(const byte* in, word32 inLen, byte* out, word32* outLen,
+                       int type, RsaKey* key)
+{
+    #define ERROR_OUT(x) { ret = x; goto done;}
+
+    mp_int tmp;
+    int    ret = 0;
+    word32 keyLen, len;
+
+    if (mp_init(&tmp) != MP_OKAY)
+        return MP_INIT_E;
+
+    if (mp_read_unsigned_bin(&tmp, (byte*)in, inLen) != MP_OKAY)
+        ERROR_OUT(MP_READ_E);
+
+    if (type == RSA_PRIVATE_DECRYPT || type == RSA_PRIVATE_ENCRYPT) {
+        #ifdef RSA_LOW_MEM      /* half as much memory but twice as slow */
+            if (mp_exptmod(&tmp, &key->d, &key->n, &tmp) != MP_OKAY)
+                ERROR_OUT(MP_EXPTMOD_E);
+        #else
+            #define INNER_ERROR_OUT(x) { ret = x; goto inner_done; }
+
+            mp_int tmpa, tmpb;
+
+            if (mp_init(&tmpa) != MP_OKAY)
+                ERROR_OUT(MP_INIT_E);
+
+            if (mp_init(&tmpb) != MP_OKAY) {
+                mp_clear(&tmpa);
+                ERROR_OUT(MP_INIT_E);
+            }
+
+            /* tmpa = tmp^dP mod p */
+            if (mp_exptmod(&tmp, &key->dP, &key->p, &tmpa) != MP_OKAY)
+                INNER_ERROR_OUT(MP_EXPTMOD_E);
+
+            /* tmpb = tmp^dQ mod q */
+            if (mp_exptmod(&tmp, &key->dQ, &key->q, &tmpb) != MP_OKAY)
+                INNER_ERROR_OUT(MP_EXPTMOD_E);
+
+            /* tmp = (tmpa - tmpb) * qInv (mod p) */
+            if (mp_sub(&tmpa, &tmpb, &tmp) != MP_OKAY)
+                INNER_ERROR_OUT(MP_SUB_E);
+
+            if (mp_mulmod(&tmp, &key->u, &key->p, &tmp) != MP_OKAY)
+                INNER_ERROR_OUT(MP_MULMOD_E);
+
+            /* tmp = tmpb + q * tmp */
+            if (mp_mul(&tmp, &key->q, &tmp) != MP_OKAY)
+                INNER_ERROR_OUT(MP_MUL_E);
+
+            if (mp_add(&tmp, &tmpb, &tmp) != MP_OKAY)
+                INNER_ERROR_OUT(MP_ADD_E);
+
+        inner_done:
+            mp_clear(&tmpa);
+            mp_clear(&tmpb);
+
+            if (ret != 0) return ret;
+
+        #endif   /* RSA_LOW_MEM */
+    }
+    else if (type == RSA_PUBLIC_ENCRYPT || type == RSA_PUBLIC_DECRYPT) {
+        if (mp_exptmod(&tmp, &key->e, &key->n, &tmp) != MP_OKAY)
+            ERROR_OUT(MP_EXPTMOD_E);
+    }
+    else
+        ERROR_OUT(RSA_WRONG_TYPE_E);
+
+    keyLen = mp_unsigned_bin_size(&key->n);
+    if (keyLen > *outLen)
+        ERROR_OUT(RSA_BUFFER_E);
+
+    len = mp_unsigned_bin_size(&tmp);
+
+    /* pad front w/ zeros to match key length */
+    while (len < keyLen) {
+        *out++ = 0x00;
+        len++;
+    }
+
+    *outLen = keyLen;
+
+    /* convert */
+    if (mp_to_unsigned_bin(&tmp, out) != MP_OKAY)
+        ERROR_OUT(MP_TO_E);
+   
+done: 
+    mp_clear(&tmp);
+    return ret;
+}
+
+
+int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
+                     RsaKey* key, RNG* rng)
+{
+    int sz = mp_unsigned_bin_size(&key->n), ret;
+
+    if (sz > (int)outLen)
+        return RSA_BUFFER_E;
+
+    if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
+        return RSA_BUFFER_E;
+
+    RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_2, rng);
+
+    if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PUBLIC_ENCRYPT, key)) < 0)
+        sz = ret;
+
+    return sz;
+}
+
+
+int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out, RsaKey* key)
+{
+    int plainLen, ret;
+
+    if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PRIVATE_DECRYPT, key))
+            < 0) {
+        return ret;
+    }
+    plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_2);
+
+    return plainLen;
+}
+
+
+int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
+                     RsaKey* key)
+{
+    int plainLen, ret;
+    byte*  tmp;
+    byte*  pad = 0;
+
+    tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
+    if (tmp == NULL) {
+        return MEMORY_E;
+    }
+
+    XMEMCPY(tmp, in, inLen);
+
+    if ((ret = plainLen = RsaPrivateDecryptInline(tmp, inLen, &pad, key))
+            < 0) {
+        XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
+        return ret;
+    }
+    if (plainLen > (int)outLen)
+        plainLen = BAD_FUNC_ARG;
+    else
+        XMEMCPY(out, pad, plainLen);
+    XMEMSET(tmp, 0x00, inLen); 
+
+    XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
+    return plainLen;
+}
+
+
+/* for Rsa Verify */
+int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key)
+{
+    int plainLen, ret;
+
+    if ((ret = RsaFunction(in, inLen, in, &inLen, RSA_PUBLIC_DECRYPT, key))
+            < 0) {
+        return ret;
+    }
+  
+    plainLen = RsaUnPad(in, inLen, out, RSA_BLOCK_TYPE_1);
+
+    return plainLen;
+}
+
+
+int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
+                     RsaKey* key)
+{
+    int plainLen, ret;
+    byte*  tmp;
+    byte*  pad = 0;
+
+    tmp = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_RSA);
+    if (tmp == NULL) {
+        return MEMORY_E;
+    }
+
+    XMEMCPY(tmp, in, inLen);
+
+    if ((ret = plainLen = RsaSSL_VerifyInline(tmp, inLen, &pad, key))
+            < 0) {
+        XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
+        return ret;
+    }
+
+    if (plainLen > (int)outLen)
+        plainLen = BAD_FUNC_ARG;
+    else 
+        XMEMCPY(out, pad, plainLen);
+    XMEMSET(tmp, 0x00, inLen); 
+
+    XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
+    return plainLen;
+}
+
+
+/* for Rsa Sign */
+int RsaSSL_Sign(const byte* in, word32 inLen, byte* out, word32 outLen,
+                      RsaKey* key, RNG* rng)
+{
+    int sz = mp_unsigned_bin_size(&key->n), ret;
+
+    if (sz > (int)outLen)
+        return RSA_BUFFER_E;
+
+    if (inLen > (word32)(sz - RSA_MIN_PAD_SZ))
+        return RSA_BUFFER_E;
+
+    RsaPad(in, inLen, out, sz, RSA_BLOCK_TYPE_1, rng);
+
+    if ((ret = RsaFunction(out, sz, out, &outLen, RSA_PRIVATE_ENCRYPT,key)) < 0)
+        sz = ret;
+    
+    return sz;
+}
+
+
+int RsaEncryptSize(RsaKey* key)
+{
+    return mp_unsigned_bin_size(&key->n);
+}
+
+
+#ifdef CYASSL_KEY_GEN
+
+static const int USE_BBS = 1;
+
+static int rand_prime(mp_int* N, int len, RNG* rng, void* heap)
+{
+    int   err, res, type;
+    byte* buf;
+
+    (void)heap;
+    if (N == NULL || rng == NULL)
+       return BAD_FUNC_ARG; 
+
+    /* get type */
+    if (len < 0) {
+        type = USE_BBS;
+        len = -len;
+    } else {
+        type = 0;
+    }
+
+    /* allow sizes between 2 and 512 bytes for a prime size */
+    if (len < 2 || len > 512) { 
+        return BAD_FUNC_ARG;
+    }
+   
+    /* allocate buffer to work with */
+    buf = (byte*)XMALLOC(len, heap, DYNAMIC_TYPE_RSA);
+    if (buf == NULL) {
+        return MEMORY_E;
+    }
+    XMEMSET(buf, 0, len);
+
+    do {
+#ifdef SHOW_GEN
+        printf(".");
+        fflush(stdout);
+#endif
+        /* generate value */
+        RNG_GenerateBlock(rng, buf, len);
+
+        /* munge bits */
+        buf[0]     |= 0x80 | 0x40;
+        buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00);
+        /* load value */
+        if ((err = mp_read_unsigned_bin(N, buf, len)) != MP_OKAY) {
+            XFREE(buf, heap, DYNAMIC_TYPE_RSA);
+            return err;
+        }
+
+        /* test */
+        if ((err = mp_prime_is_prime(N, 8, &res)) != MP_OKAY) {
+            XFREE(buf, heap, DYNAMIC_TYPE_RSA);
+            return err;
+        }
+    } while (res == MP_NO);
+
+#ifdef LTC_CLEAN_STACK
+    XMEMSET(buf, 0, len);
+#endif
+
+    XFREE(buf, heap, DYNAMIC_TYPE_RSA);
+    return 0;
+}
+
+
+/* Make an RSA key for size bits, with e specified, 65537 is a good e */
+int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng)
+{
+    mp_int p, q, tmp1, tmp2, tmp3;
+    int    err;
+
+    if (key == NULL || rng == NULL)
+        return BAD_FUNC_ARG;
+
+    if (size < RSA_MIN_SIZE || size > RSA_MAX_SIZE)
+        return BAD_FUNC_ARG;
+
+    if (e < 3 || (e & 1) == 0)
+        return BAD_FUNC_ARG;
+
+    if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, &tmp3, NULL)) != MP_OKAY)
+        return err;
+
+    err = mp_set_int(&tmp3, e);
+
+    /* make p */
+    if (err == MP_OKAY) {
+        do {
+            err = rand_prime(&p, size/16, rng, key->heap); /* size in bytes/2 */
+
+            if (err == MP_OKAY)
+                err = mp_sub_d(&p, 1, &tmp1);  /* tmp1 = p-1 */
+
+            if (err == MP_OKAY)
+                err = mp_gcd(&tmp1, &tmp3, &tmp2);  /* tmp2 = gcd(p-1, e) */
+        } while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0);  /* e divdes p-1 */
+    }
+
+    /* make q */
+    if (err == MP_OKAY) {
+        do {
+            err = rand_prime(&q, size/16, rng, key->heap); /* size in bytes/2 */
+
+            if (err == MP_OKAY)
+                err = mp_sub_d(&q, 1, &tmp1);  /* tmp1 = q-1 */
+
+            if (err == MP_OKAY)
+                err = mp_gcd(&tmp1, &tmp3, &tmp2);  /* tmp2 = gcd(q-1, e) */
+        } while (err == MP_OKAY && mp_cmp_d(&tmp2, 1) != 0);  /* e divdes q-1 */
+    }
+
+    if (err == MP_OKAY)
+        err = mp_init_multi(&key->n, &key->e, &key->d, &key->p, &key->q, NULL);
+
+    if (err == MP_OKAY)
+        err = mp_init_multi(&key->dP, &key->dP, &key->u, NULL, NULL, NULL);
+
+    if (err == MP_OKAY)
+        err = mp_sub_d(&p, 1, &tmp2);  /* tmp2 = p-1 */
+
+    if (err == MP_OKAY)
+        err = mp_lcm(&tmp1, &tmp2, &tmp1);  /* tmp1 = lcm(p-1, q-1),last loop */
+
+    /* make key */
+    if (err == MP_OKAY)
+        err = mp_set_int(&key->e, e);  /* key->e = e */
+
+    if (err == MP_OKAY)                /* key->d = 1/e mod lcm(p-1, q-1) */
+        err = mp_invmod(&key->e, &tmp1, &key->d);
+
+    if (err == MP_OKAY)
+        err = mp_mul(&p, &q, &key->n);  /* key->n = pq */
+
+    if (err == MP_OKAY)
+        err = mp_sub_d(&p, 1, &tmp1);
+
+    if (err == MP_OKAY)
+        err = mp_sub_d(&q, 1, &tmp2);
+
+    if (err == MP_OKAY)
+        err = mp_mod(&key->d, &tmp1, &key->dP);
+
+    if (err == MP_OKAY)
+        err = mp_mod(&key->d, &tmp2, &key->dQ);
+
+    if (err == MP_OKAY)
+        err = mp_invmod(&q, &p, &key->u);
+
+    if (err == MP_OKAY)
+        err = mp_copy(&p, &key->p);
+
+    if (err == MP_OKAY)
+        err = mp_copy(&q, &key->q);
+
+    if (err == MP_OKAY)
+        key->type = RSA_PRIVATE; 
+
+    mp_clear(&tmp3); 
+    mp_clear(&tmp2); 
+    mp_clear(&tmp1); 
+    mp_clear(&q); 
+    mp_clear(&p);
+
+    if (err != MP_OKAY) {
+        FreeRsaKey(key);        
+        return err;
+    }
+
+    return 0;
+}
+
+
+#endif /* CYASLS_KEY_GEN */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha.c
new file mode 100644 (file)
index 0000000..bad8c9f
--- /dev/null
@@ -0,0 +1,201 @@
+/* sha.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ctaocrypt/sha.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitSha(Sha* sha)
+{
+    sha->digest[0] = 0x67452301L;
+    sha->digest[1] = 0xEFCDAB89L;
+    sha->digest[2] = 0x98BADCFEL;
+    sha->digest[3] = 0x10325476L;
+    sha->digest[4] = 0xC3D2E1F0L;
+
+    sha->buffLen = 0;
+    sha->loLen   = 0;
+    sha->hiLen   = 0;
+}
+
+#define blk0(i) (W[i] = sha->buffer[i])
+#define blk1(i) (W[i&15] = \
+                   rotlFixed(W[(i+13)&15]^W[(i+8)&15]^W[(i+2)&15]^W[i&15],1))
+
+#define f1(x,y,z) (z^(x &(y^z)))
+#define f2(x,y,z) (x^y^z)
+#define f3(x,y,z) ((x&y)|(z&(x|y)))
+#define f4(x,y,z) (x^y^z)
+
+/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
+#define R0(v,w,x,y,z,i) z+= f1(w,x,y) + blk0(i) + 0x5A827999+ \
+                        rotlFixed(v,5); w = rotlFixed(w,30);
+#define R1(v,w,x,y,z,i) z+= f1(w,x,y) + blk1(i) + 0x5A827999+ \
+                        rotlFixed(v,5); w = rotlFixed(w,30);
+#define R2(v,w,x,y,z,i) z+= f2(w,x,y) + blk1(i) + 0x6ED9EBA1+ \
+                        rotlFixed(v,5); w = rotlFixed(w,30);
+#define R3(v,w,x,y,z,i) z+= f3(w,x,y) + blk1(i) + 0x8F1BBCDC+ \
+                        rotlFixed(v,5); w = rotlFixed(w,30);
+#define R4(v,w,x,y,z,i) z+= f4(w,x,y) + blk1(i) + 0xCA62C1D6+ \
+                        rotlFixed(v,5); w = rotlFixed(w,30);
+
+
+static void Transform(Sha* sha)
+{
+    word32 W[SHA_BLOCK_SIZE / sizeof(word32)];
+
+    /* Copy context->state[] to working vars */ 
+    word32 a = sha->digest[0];
+    word32 b = sha->digest[1];
+    word32 c = sha->digest[2];
+    word32 d = sha->digest[3];
+    word32 e = sha->digest[4];
+
+    /* nearly 1 K bigger in code size but 25% faster  */
+    /* 4 rounds of 20 operations each. Loop unrolled. */
+    R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+    R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+    R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+    R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+
+    R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+
+    R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+    R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+    R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+    R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+    R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+
+    R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+    R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+    R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+    R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+    R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+
+    R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+    R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+    R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+    R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+    R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+
+    /* Add the working vars back into digest state[] */
+    sha->digest[0] += a;
+    sha->digest[1] += b;
+    sha->digest[2] += c;
+    sha->digest[3] += d;
+    sha->digest[4] += e;
+}
+
+
+static INLINE void AddLength(Sha* sha, word32 len)
+{
+    word32 tmp = sha->loLen;
+    if ( (sha->loLen += len) < tmp)
+        sha->hiLen++;                       /* carry low to high */
+}
+
+
+void ShaUpdate(Sha* sha, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)sha->buffer;
+
+    while (len) {
+        word32 add = min(len, SHA_BLOCK_SIZE - sha->buffLen);
+        XMEMCPY(&local[sha->buffLen], data, add);
+
+        sha->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (sha->buffLen == SHA_BLOCK_SIZE) {
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
+            #endif
+            Transform(sha);
+            AddLength(sha, SHA_BLOCK_SIZE);
+            sha->buffLen = 0;
+        }
+    }
+}
+
+
+void ShaFinal(Sha* sha, byte* hash)
+{
+    byte* local = (byte*)sha->buffer;
+
+    AddLength(sha, sha->buffLen);               /* before adding pads */
+
+    local[sha->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (sha->buffLen > SHA_PAD_SIZE) {
+        XMEMSET(&local[sha->buffLen], 0, SHA_BLOCK_SIZE - sha->buffLen);
+        sha->buffLen += SHA_BLOCK_SIZE - sha->buffLen;
+
+        #ifdef LITTLE_ENDIAN_ORDER
+            ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
+        #endif
+        Transform(sha);
+        sha->buffLen = 0;
+    }
+    XMEMSET(&local[sha->buffLen], 0, SHA_PAD_SIZE - sha->buffLen);
+   
+    /* put lengths in bits */
+    sha->hiLen = (sha->loLen >> (8*sizeof(sha->loLen) - 3)) + 
+                 (sha->hiLen << 3);
+    sha->loLen = sha->loLen << 3;
+
+    /* store lengths */
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseBytes(local, local, SHA_BLOCK_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    XMEMCPY(&local[SHA_PAD_SIZE], &sha->hiLen, sizeof(word32));
+    XMEMCPY(&local[SHA_PAD_SIZE + sizeof(word32)], &sha->loLen, sizeof(word32));
+
+    Transform(sha);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords(sha->digest, sha->digest, SHA_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, sha->digest, SHA_DIGEST_SIZE);
+
+    InitSha(sha);  /* reset state */
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha256.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha256.c
new file mode 100644 (file)
index 0000000..9291dbc
--- /dev/null
@@ -0,0 +1,209 @@
+/* sha256.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* code submitted by raphael.huck@efixo.com */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef NO_SHA256
+
+#include <cyassl/ctaocrypt/sha256.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitSha256(Sha256* sha256)
+{
+    sha256->digest[0] = 0x6A09E667L;
+    sha256->digest[1] = 0xBB67AE85L;
+    sha256->digest[2] = 0x3C6EF372L;
+    sha256->digest[3] = 0xA54FF53AL;
+    sha256->digest[4] = 0x510E527FL;
+    sha256->digest[5] = 0x9B05688CL;
+    sha256->digest[6] = 0x1F83D9ABL;
+    sha256->digest[7] = 0x5BE0CD19L;
+
+    sha256->buffLen = 0;
+    sha256->loLen   = 0;
+    sha256->hiLen   = 0;
+}
+
+static const word32 K[64] = {
+    0x428A2F98L, 0x71374491L, 0xB5C0FBCFL, 0xE9B5DBA5L, 0x3956C25BL,
+    0x59F111F1L, 0x923F82A4L, 0xAB1C5ED5L, 0xD807AA98L, 0x12835B01L,
+    0x243185BEL, 0x550C7DC3L, 0x72BE5D74L, 0x80DEB1FEL, 0x9BDC06A7L,
+    0xC19BF174L, 0xE49B69C1L, 0xEFBE4786L, 0x0FC19DC6L, 0x240CA1CCL,
+    0x2DE92C6FL, 0x4A7484AAL, 0x5CB0A9DCL, 0x76F988DAL, 0x983E5152L,
+    0xA831C66DL, 0xB00327C8L, 0xBF597FC7L, 0xC6E00BF3L, 0xD5A79147L,
+    0x06CA6351L, 0x14292967L, 0x27B70A85L, 0x2E1B2138L, 0x4D2C6DFCL,
+    0x53380D13L, 0x650A7354L, 0x766A0ABBL, 0x81C2C92EL, 0x92722C85L,
+    0xA2BFE8A1L, 0xA81A664BL, 0xC24B8B70L, 0xC76C51A3L, 0xD192E819L,
+    0xD6990624L, 0xF40E3585L, 0x106AA070L, 0x19A4C116L, 0x1E376C08L,
+    0x2748774CL, 0x34B0BCB5L, 0x391C0CB3L, 0x4ED8AA4AL, 0x5B9CCA4FL,
+    0x682E6FF3L, 0x748F82EEL, 0x78A5636FL, 0x84C87814L, 0x8CC70208L,
+    0x90BEFFFAL, 0xA4506CEBL, 0xBEF9A3F7L, 0xC67178F2L
+};
+
+#define Ch(x,y,z)       (z ^ (x & (y ^ z)))
+#define Maj(x,y,z)      (((x | y) & z) | (x & y))
+#define S(x, n)         rotrFixed(x, n)
+#define R(x, n)         (((x)&0xFFFFFFFFL)>>(n))
+#define Sigma0(x)       (S(x, 2) ^ S(x, 13) ^ S(x, 22))
+#define Sigma1(x)       (S(x, 6) ^ S(x, 11) ^ S(x, 25))
+#define Gamma0(x)       (S(x, 7) ^ S(x, 18) ^ R(x, 3))
+#define Gamma1(x)       (S(x, 17) ^ S(x, 19) ^ R(x, 10))
+
+#define RND(a,b,c,d,e,f,g,h,i) \
+     t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
+     t1 = Sigma0(a) + Maj(a, b, c); \
+     d += t0; \
+     h  = t0 + t1;
+
+
+static void Transform(Sha256* sha256)
+{
+    word32 S[8], W[64], t0, t1;
+    int i;
+
+    /* Copy context->state[] to working vars */
+    for (i = 0; i < 8; i++)
+        S[i] = sha256->digest[i];
+
+    for (i = 0; i < 16; i++)
+        W[i] = sha256->buffer[i];
+
+    for (i = 16; i < 64; i++)
+        W[i] = Gamma1(W[i-2]) + W[i-7] + Gamma0(W[i-15]) + W[i-16];
+
+    for (i = 0; i < 64; i += 8) {
+        RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],i+0);
+        RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],i+1);
+        RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],i+2);
+        RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],i+3);
+        RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],i+4);
+        RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],i+5);
+        RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],i+6);
+        RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],i+7);
+    }
+
+    /* Add the working vars back into digest state[] */
+    for (i = 0; i < 8; i++) {
+        sha256->digest[i] += S[i];
+    }
+}
+
+
+static INLINE void AddLength(Sha256* sha256, word32 len)
+{
+    word32 tmp = sha256->loLen;
+    if ( (sha256->loLen += len) < tmp)
+        sha256->hiLen++;                       /* carry low to high */
+}
+
+
+void Sha256Update(Sha256* sha256, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)sha256->buffer;
+
+    while (len) {
+        word32 add = min(len, SHA256_BLOCK_SIZE - sha256->buffLen);
+        XMEMCPY(&local[sha256->buffLen], data, add);
+
+        sha256->buffLen += add;
+        data            += add;
+        len             -= add;
+
+        if (sha256->buffLen == SHA256_BLOCK_SIZE) {
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
+            #endif
+            Transform(sha256);
+            AddLength(sha256, SHA256_BLOCK_SIZE);
+            sha256->buffLen = 0;
+        }
+    }
+}
+
+
+void Sha256Final(Sha256* sha256, byte* hash)
+{
+    byte* local = (byte*)sha256->buffer;
+
+    AddLength(sha256, sha256->buffLen);  /* before adding pads */
+
+    local[sha256->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (sha256->buffLen > SHA256_PAD_SIZE) {
+        XMEMSET(&local[sha256->buffLen], 0, SHA256_BLOCK_SIZE - sha256->buffLen);
+        sha256->buffLen += SHA256_BLOCK_SIZE - sha256->buffLen;
+
+        #ifdef LITTLE_ENDIAN_ORDER
+            ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
+        #endif
+        Transform(sha256);
+        sha256->buffLen = 0;
+    }
+    XMEMSET(&local[sha256->buffLen], 0, SHA256_PAD_SIZE - sha256->buffLen);
+
+    /* put lengths in bits */
+    sha256->hiLen = (sha256->loLen >> (8*sizeof(sha256->loLen) - 3)) +
+                 (sha256->hiLen << 3);
+    sha256->loLen = sha256->loLen << 3;
+
+    /* store lengths */
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseBytes(local, local, SHA256_BLOCK_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    XMEMCPY(&local[SHA256_PAD_SIZE], &sha256->hiLen, sizeof(word32));
+    XMEMCPY(&local[SHA256_PAD_SIZE + sizeof(word32)], &sha256->loLen,
+            sizeof(word32));
+
+    Transform(sha256);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords(sha256->digest, sha256->digest, SHA256_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, sha256->digest, SHA256_DIGEST_SIZE);
+
+    InitSha256(sha256);  /* reset state */
+}
+
+
+#endif /* NO_SHA256 */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha512.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/sha512.c
new file mode 100644 (file)
index 0000000..f14efec
--- /dev/null
@@ -0,0 +1,386 @@
+/* sha512.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+
+#ifdef CYASSL_SHA512
+
+#include <cyassl/ctaocrypt/sha512.h>
+#ifdef NO_INLINE
+    #include <cyassl/ctaocrypt/misc.h>
+#else
+    #include <ctaocrypt/src/misc.c>
+#endif
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+void InitSha512(Sha512* sha512)
+{
+    sha512->digest[0] = W64LIT(0x6a09e667f3bcc908);
+    sha512->digest[1] = W64LIT(0xbb67ae8584caa73b);
+    sha512->digest[2] = W64LIT(0x3c6ef372fe94f82b);
+    sha512->digest[3] = W64LIT(0xa54ff53a5f1d36f1);
+    sha512->digest[4] = W64LIT(0x510e527fade682d1);
+    sha512->digest[5] = W64LIT(0x9b05688c2b3e6c1f);
+    sha512->digest[6] = W64LIT(0x1f83d9abfb41bd6b);
+    sha512->digest[7] = W64LIT(0x5be0cd19137e2179);
+
+    sha512->buffLen = 0;
+    sha512->loLen   = 0;
+    sha512->hiLen   = 0;
+}
+
+
+static const word64 K512[80] = {
+       W64LIT(0x428a2f98d728ae22), W64LIT(0x7137449123ef65cd),
+       W64LIT(0xb5c0fbcfec4d3b2f), W64LIT(0xe9b5dba58189dbbc),
+       W64LIT(0x3956c25bf348b538), W64LIT(0x59f111f1b605d019),
+       W64LIT(0x923f82a4af194f9b), W64LIT(0xab1c5ed5da6d8118),
+       W64LIT(0xd807aa98a3030242), W64LIT(0x12835b0145706fbe),
+       W64LIT(0x243185be4ee4b28c), W64LIT(0x550c7dc3d5ffb4e2),
+       W64LIT(0x72be5d74f27b896f), W64LIT(0x80deb1fe3b1696b1),
+       W64LIT(0x9bdc06a725c71235), W64LIT(0xc19bf174cf692694),
+       W64LIT(0xe49b69c19ef14ad2), W64LIT(0xefbe4786384f25e3),
+       W64LIT(0x0fc19dc68b8cd5b5), W64LIT(0x240ca1cc77ac9c65),
+       W64LIT(0x2de92c6f592b0275), W64LIT(0x4a7484aa6ea6e483),
+       W64LIT(0x5cb0a9dcbd41fbd4), W64LIT(0x76f988da831153b5),
+       W64LIT(0x983e5152ee66dfab), W64LIT(0xa831c66d2db43210),
+       W64LIT(0xb00327c898fb213f), W64LIT(0xbf597fc7beef0ee4),
+       W64LIT(0xc6e00bf33da88fc2), W64LIT(0xd5a79147930aa725),
+       W64LIT(0x06ca6351e003826f), W64LIT(0x142929670a0e6e70),
+       W64LIT(0x27b70a8546d22ffc), W64LIT(0x2e1b21385c26c926),
+       W64LIT(0x4d2c6dfc5ac42aed), W64LIT(0x53380d139d95b3df),
+       W64LIT(0x650a73548baf63de), W64LIT(0x766a0abb3c77b2a8),
+       W64LIT(0x81c2c92e47edaee6), W64LIT(0x92722c851482353b),
+       W64LIT(0xa2bfe8a14cf10364), W64LIT(0xa81a664bbc423001),
+       W64LIT(0xc24b8b70d0f89791), W64LIT(0xc76c51a30654be30),
+       W64LIT(0xd192e819d6ef5218), W64LIT(0xd69906245565a910),
+       W64LIT(0xf40e35855771202a), W64LIT(0x106aa07032bbd1b8),
+       W64LIT(0x19a4c116b8d2d0c8), W64LIT(0x1e376c085141ab53),
+       W64LIT(0x2748774cdf8eeb99), W64LIT(0x34b0bcb5e19b48a8),
+       W64LIT(0x391c0cb3c5c95a63), W64LIT(0x4ed8aa4ae3418acb),
+       W64LIT(0x5b9cca4f7763e373), W64LIT(0x682e6ff3d6b2b8a3),
+       W64LIT(0x748f82ee5defb2fc), W64LIT(0x78a5636f43172f60),
+       W64LIT(0x84c87814a1f0ab72), W64LIT(0x8cc702081a6439ec),
+       W64LIT(0x90befffa23631e28), W64LIT(0xa4506cebde82bde9),
+       W64LIT(0xbef9a3f7b2c67915), W64LIT(0xc67178f2e372532b),
+       W64LIT(0xca273eceea26619c), W64LIT(0xd186b8c721c0c207),
+       W64LIT(0xeada7dd6cde0eb1e), W64LIT(0xf57d4f7fee6ed178),
+       W64LIT(0x06f067aa72176fba), W64LIT(0x0a637dc5a2c898a6),
+       W64LIT(0x113f9804bef90dae), W64LIT(0x1b710b35131c471b),
+       W64LIT(0x28db77f523047d84), W64LIT(0x32caab7b40c72493),
+       W64LIT(0x3c9ebe0a15c9bebc), W64LIT(0x431d67c49c100d4c),
+       W64LIT(0x4cc5d4becb3e42b6), W64LIT(0x597f299cfc657e2a),
+       W64LIT(0x5fcb6fab3ad6faec), W64LIT(0x6c44198c4a475817)
+};
+
+
+#define blk0(i) (W[i] = sha512->buffer[i])
+#define blk2(i) (W[i&15]+=s1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)&15]))
+
+#define Ch(x,y,z) (z^(x&(y^z)))
+#define Maj(x,y,z) ((x&y)|(z&(x|y)))
+
+#define a(i) T[(0-i)&7]
+#define b(i) T[(1-i)&7]
+#define c(i) T[(2-i)&7]
+#define d(i) T[(3-i)&7]
+#define e(i) T[(4-i)&7]
+#define f(i) T[(5-i)&7]
+#define g(i) T[(6-i)&7]
+#define h(i) T[(7-i)&7]
+
+#define S0(x) (rotrFixed64(x,28)^rotrFixed64(x,34)^rotrFixed64(x,39))
+#define S1(x) (rotrFixed64(x,14)^rotrFixed64(x,18)^rotrFixed64(x,41))
+#define s0(x) (rotrFixed64(x,1)^rotrFixed64(x,8)^(x>>7))
+#define s1(x) (rotrFixed64(x,19)^rotrFixed64(x,61)^(x>>6))
+
+#define R(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk0(i));\
+       d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
+
+#define blk384(i) (W[i] = sha384->buffer[i])
+
+#define R2(i) h(i)+=S1(e(i))+Ch(e(i),f(i),g(i))+K[i+j]+(j?blk2(i):blk384(i));\
+       d(i)+=h(i);h(i)+=S0(a(i))+Maj(a(i),b(i),c(i))
+
+
+static void Transform(Sha512* sha512)
+{
+    const word64* K = K512;
+
+    word32 j;
+    word64 W[16];
+    word64 T[8];
+
+    /* Copy digest to working vars */
+    XMEMCPY(T, sha512->digest, sizeof(T));
+
+    /* 64 operations, partially loop unrolled */
+    for (j = 0; j < 80; j += 16) {
+        R( 0); R( 1); R( 2); R( 3);
+        R( 4); R( 5); R( 6); R( 7);
+        R( 8); R( 9); R(10); R(11);
+        R(12); R(13); R(14); R(15);
+    }
+
+    /* Add the working vars back into digest */
+
+    sha512->digest[0] += a(0);
+    sha512->digest[1] += b(0);
+    sha512->digest[2] += c(0);
+    sha512->digest[3] += d(0);
+    sha512->digest[4] += e(0);
+    sha512->digest[5] += f(0);
+    sha512->digest[6] += g(0);
+    sha512->digest[7] += h(0);
+
+    /* Wipe variables */
+    XMEMSET(W, 0, sizeof(W));
+    XMEMSET(T, 0, sizeof(T));
+}
+
+
+static INLINE void AddLength(Sha512* sha512, word32 len)
+{
+    word32 tmp = sha512->loLen;
+    if ( (sha512->loLen += len) < tmp)
+        sha512->hiLen++;                       /* carry low to high */
+}
+
+
+void Sha512Update(Sha512* sha512, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)sha512->buffer;
+
+    while (len) {
+        word32 add = min(len, SHA512_BLOCK_SIZE - sha512->buffLen);
+        XMEMCPY(&local[sha512->buffLen], data, add);
+
+        sha512->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (sha512->buffLen == SHA512_BLOCK_SIZE) {
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(sha512->buffer, sha512->buffer,
+                                   SHA512_BLOCK_SIZE);
+            #endif
+            Transform(sha512);
+            AddLength(sha512, SHA512_BLOCK_SIZE);
+            sha512->buffLen = 0;
+        }
+    }
+}
+
+
+void Sha512Final(Sha512* sha512, byte* hash)
+{
+    byte* local = (byte*)sha512->buffer;
+
+    AddLength(sha512, sha512->buffLen);               /* before adding pads */
+
+    local[sha512->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (sha512->buffLen > SHA512_PAD_SIZE) {
+        XMEMSET(&local[sha512->buffLen], 0, SHA512_BLOCK_SIZE -sha512->buffLen);
+        sha512->buffLen += SHA512_BLOCK_SIZE - sha512->buffLen;
+
+        #ifdef LITTLE_ENDIAN_ORDER
+            ByteReverseWords64(sha512->buffer,sha512->buffer,SHA512_BLOCK_SIZE);
+        #endif
+        Transform(sha512);
+        sha512->buffLen = 0;
+    }
+    XMEMSET(&local[sha512->buffLen], 0, SHA512_PAD_SIZE - sha512->buffLen);
+   
+    /* put lengths in bits */
+    sha512->hiLen = (sha512->loLen >> (8*sizeof(sha512->loLen) - 3)) + 
+                 (sha512->hiLen << 3);
+    sha512->loLen = sha512->loLen << 3;
+
+    /* store lengths */
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(sha512->buffer, sha512->buffer, SHA512_PAD_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 2] = sha512->hiLen;
+    sha512->buffer[SHA512_BLOCK_SIZE / sizeof(word64) - 1] = sha512->loLen;
+
+    Transform(sha512);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(sha512->digest, sha512->digest, SHA512_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, sha512->digest, SHA512_DIGEST_SIZE);
+
+    InitSha512(sha512);  /* reset state */
+}
+
+
+
+#ifdef CYASSL_SHA384
+
+void InitSha384(Sha384* sha384)
+{
+    sha384->digest[0] = W64LIT(0xcbbb9d5dc1059ed8);
+    sha384->digest[1] = W64LIT(0x629a292a367cd507);
+    sha384->digest[2] = W64LIT(0x9159015a3070dd17);
+    sha384->digest[3] = W64LIT(0x152fecd8f70e5939);
+    sha384->digest[4] = W64LIT(0x67332667ffc00b31);
+    sha384->digest[5] = W64LIT(0x8eb44a8768581511);
+    sha384->digest[6] = W64LIT(0xdb0c2e0d64f98fa7);
+    sha384->digest[7] = W64LIT(0x47b5481dbefa4fa4);
+
+    sha384->buffLen = 0;
+    sha384->loLen   = 0;
+    sha384->hiLen   = 0;
+}
+
+
+static void Transform384(Sha384* sha384)
+{
+    const word64* K = K512;
+
+    word32 j;
+    word64 W[16];
+    word64 T[8];
+
+    /* Copy digest to working vars */
+    XMEMCPY(T, sha384->digest, sizeof(T));
+
+    /* 64 operations, partially loop unrolled */
+    for (j = 0; j < 80; j += 16) {
+        R2( 0); R2( 1); R2( 2); R2( 3);
+        R2( 4); R2( 5); R2( 6); R2( 7);
+        R2( 8); R2( 9); R2(10); R2(11);
+        R2(12); R2(13); R2(14); R2(15);
+    }
+
+    /* Add the working vars back into digest */
+
+    sha384->digest[0] += a(0);
+    sha384->digest[1] += b(0);
+    sha384->digest[2] += c(0);
+    sha384->digest[3] += d(0);
+    sha384->digest[4] += e(0);
+    sha384->digest[5] += f(0);
+    sha384->digest[6] += g(0);
+    sha384->digest[7] += h(0);
+
+    /* Wipe variables */
+    XMEMSET(W, 0, sizeof(W));
+    XMEMSET(T, 0, sizeof(T));
+}
+
+
+static INLINE void AddLength384(Sha384* sha384, word32 len)
+{
+    word32 tmp = sha384->loLen;
+    if ( (sha384->loLen += len) < tmp)
+        sha384->hiLen++;                       /* carry low to high */
+}
+
+
+void Sha384Update(Sha384* sha384, const byte* data, word32 len)
+{
+    /* do block size increments */
+    byte* local = (byte*)sha384->buffer;
+
+    while (len) {
+        word32 add = min(len, SHA384_BLOCK_SIZE - sha384->buffLen);
+        XMEMCPY(&local[sha384->buffLen], data, add);
+
+        sha384->buffLen += add;
+        data         += add;
+        len          -= add;
+
+        if (sha384->buffLen == SHA384_BLOCK_SIZE) {
+            #ifdef LITTLE_ENDIAN_ORDER
+                ByteReverseWords64(sha384->buffer, sha384->buffer,
+                                   SHA384_BLOCK_SIZE);
+            #endif
+            Transform384(sha384);
+            AddLength384(sha384, SHA384_BLOCK_SIZE);
+            sha384->buffLen = 0;
+        }
+    }
+}
+
+
+void Sha384Final(Sha384* sha384, byte* hash)
+{
+    byte* local = (byte*)sha384->buffer;
+
+    AddLength384(sha384, sha384->buffLen);              /* before adding pads */
+
+    local[sha384->buffLen++] = 0x80;  /* add 1 */
+
+    /* pad with zeros */
+    if (sha384->buffLen > SHA384_PAD_SIZE) {
+        XMEMSET(&local[sha384->buffLen], 0, SHA384_BLOCK_SIZE -sha384->buffLen);
+        sha384->buffLen += SHA384_BLOCK_SIZE - sha384->buffLen;
+
+        #ifdef LITTLE_ENDIAN_ORDER
+            ByteReverseWords64(sha384->buffer,sha384->buffer,SHA384_BLOCK_SIZE);
+        #endif
+        Transform384(sha384);
+        sha384->buffLen = 0;
+    }
+    XMEMSET(&local[sha384->buffLen], 0, SHA384_PAD_SIZE - sha384->buffLen);
+   
+    /* put lengths in bits */
+    sha384->hiLen = (sha384->loLen >> (8*sizeof(sha384->loLen) - 3)) + 
+                 (sha384->hiLen << 3);
+    sha384->loLen = sha384->loLen << 3;
+
+    /* store lengths */
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(sha384->buffer, sha384->buffer, SHA384_PAD_SIZE);
+    #endif
+    /* ! length ordering dependent on digest endian type ! */
+    sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 2] = sha384->hiLen;
+    sha384->buffer[SHA384_BLOCK_SIZE / sizeof(word64) - 1] = sha384->loLen;
+
+    Transform384(sha384);
+    #ifdef LITTLE_ENDIAN_ORDER
+        ByteReverseWords64(sha384->digest, sha384->digest, SHA384_DIGEST_SIZE);
+    #endif
+    XMEMCPY(hash, sha384->digest, SHA384_DIGEST_SIZE);
+
+    InitSha384(sha384);  /* reset state */
+}
+
+#endif /* CYASSL_SHA384 */
+
+#endif /* CYASSL_SHA512 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/tfm.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/src/tfm.c
new file mode 100644 (file)
index 0000000..36c69f2
--- /dev/null
@@ -0,0 +1,2476 @@
+/* tfm.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*
+ * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
+ * http://math.libtomcrypt.com
+ */
+
+/**
+ *  Edited by Moisés Guimarães (moises.guimaraes@phoebus.com.br)
+ *  to fit CyaSSL's needs.
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+/* in case user set USE_FAST_MATH there */
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef USE_FAST_MATH
+
+#include <cyassl/ctaocrypt/tfm.h>
+#include <ctaocrypt/src/asm.c>  /* will define asm MACROS or C ones */
+
+
+/* math settings check */
+word32 CheckRunTimeSettings(void)
+{
+    return CTC_SETTINGS;
+}
+
+
+/* math settings size check */
+word32 CheckRunTimeFastMath(void)
+{
+    return FP_SIZE;
+}
+
+
+/* Functions */
+
+void fp_add(fp_int *a, fp_int *b, fp_int *c)
+{
+  int     sa, sb;
+
+  /* get sign of both inputs */
+  sa = a->sign;
+  sb = b->sign;
+
+  /* handle two cases, not four */
+  if (sa == sb) {
+    /* both positive or both negative */
+    /* add their magnitudes, copy the sign */
+    c->sign = sa;
+    s_fp_add (a, b, c);
+  } else {
+    /* one positive, the other negative */
+    /* subtract the one with the greater magnitude from */
+    /* the one of the lesser magnitude.  The result gets */
+    /* the sign of the one with the greater magnitude. */
+    if (fp_cmp_mag (a, b) == FP_LT) {
+      c->sign = sb;
+      s_fp_sub (b, a, c);
+    } else {
+      c->sign = sa;
+      s_fp_sub (a, b, c);
+    }
+  }
+}
+
+/* unsigned addition */
+void s_fp_add(fp_int *a, fp_int *b, fp_int *c)
+{
+  int      x, y, oldused;
+  register fp_word  t;
+
+  y       = MAX(a->used, b->used);
+  oldused = c->used;
+  c->used = y;
+  t = 0;
+  for (x = 0; x < y; x++) {
+      t         += ((fp_word)a->dp[x]) + ((fp_word)b->dp[x]);
+      c->dp[x]   = (fp_digit)t;
+      t        >>= DIGIT_BIT;
+  }
+  if (t != 0 && x < FP_SIZE) {
+     c->dp[c->used++] = (fp_digit)t;
+     ++x;
+  }
+
+  c->used = x;
+  for (; x < oldused; x++) {
+     c->dp[x] = 0;
+  }
+  fp_clamp(c);
+}
+
+/* c = a - b */
+void fp_sub(fp_int *a, fp_int *b, fp_int *c)
+{
+  int     sa, sb;
+
+  sa = a->sign;
+  sb = b->sign;
+
+  if (sa != sb) {
+    /* subtract a negative from a positive, OR */
+    /* subtract a positive from a negative. */
+    /* In either case, ADD their magnitudes, */
+    /* and use the sign of the first number. */
+    c->sign = sa;
+    s_fp_add (a, b, c);
+  } else {
+    /* subtract a positive from a positive, OR */
+    /* subtract a negative from a negative. */
+    /* First, take the difference between their */
+    /* magnitudes, then... */
+    if (fp_cmp_mag (a, b) != FP_LT) {
+      /* Copy the sign from the first */
+      c->sign = sa;
+      /* The first has a larger or equal magnitude */
+      s_fp_sub (a, b, c);
+    } else {
+      /* The result has the *opposite* sign from */
+      /* the first number. */
+      c->sign = (sa == FP_ZPOS) ? FP_NEG : FP_ZPOS;
+      /* The second has a larger magnitude */
+      s_fp_sub (b, a, c);
+    }
+  }
+}
+
+/* unsigned subtraction ||a|| >= ||b|| ALWAYS! */
+void s_fp_sub(fp_int *a, fp_int *b, fp_int *c)
+{
+  int      x, oldbused, oldused;
+  fp_word  t;
+
+  oldused  = c->used;
+  oldbused = b->used;
+  c->used  = a->used;
+  t       = 0;
+  for (x = 0; x < oldbused; x++) {
+     t         = ((fp_word)a->dp[x]) - (((fp_word)b->dp[x]) + t);
+     c->dp[x]  = (fp_digit)t;
+     t         = (t >> DIGIT_BIT)&1;
+  }
+  for (; x < a->used; x++) {
+     t         = ((fp_word)a->dp[x]) - t;
+     c->dp[x]  = (fp_digit)t;
+     t         = (t >> DIGIT_BIT);
+   }
+  for (; x < oldused; x++) {
+     c->dp[x] = 0;
+  }
+  fp_clamp(c);
+}
+
+/* c = a * b */
+void fp_mul(fp_int *A, fp_int *B, fp_int *C)
+{
+    int   y, yy;
+
+    y  = MAX(A->used, B->used);
+    yy = MIN(A->used, B->used);
+
+    /* call generic if we're out of range */
+    if (y + yy > FP_SIZE) {
+       fp_mul_comba(A, B, C);
+       return ;
+    }
+
+    /* pick a comba (unrolled 4/8/16/32 x or rolled) based on the size
+       of the largest input.  We also want to avoid doing excess mults if the 
+       inputs are not close to the next power of two.  That is, for example,
+       if say y=17 then we would do (32-17)^2 = 225 unneeded multiplications 
+    */
+
+#ifdef TFM_MUL3
+        if (y <= 3) {
+           fp_mul_comba3(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL4
+        if (y == 4) {
+           fp_mul_comba4(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL6
+        if (y <= 6) {
+           fp_mul_comba6(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL7
+        if (y == 7) {
+           fp_mul_comba7(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL8
+        if (y == 8) {
+           fp_mul_comba8(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL9
+        if (y == 9) {
+           fp_mul_comba9(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL12
+        if (y <= 12) {
+           fp_mul_comba12(A,B,C);
+           return;
+        }
+#endif
+#ifdef TFM_MUL17
+        if (y <= 17) {
+           fp_mul_comba17(A,B,C);
+           return;
+        }
+#endif
+
+#ifdef TFM_SMALL_SET
+        if (y <= 16) {
+           fp_mul_comba_small(A,B,C);
+           return;
+        }
+#endif        
+#if defined(TFM_MUL20)
+        if (y <= 20) {
+           fp_mul_comba20(A,B,C);
+           return;
+        }
+#endif
+#if defined(TFM_MUL24)
+        if (yy >= 16 && y <= 24) {
+           fp_mul_comba24(A,B,C);
+           return;
+        }
+#endif
+#if defined(TFM_MUL28)
+        if (yy >= 20 && y <= 28) {
+           fp_mul_comba28(A,B,C);
+           return;
+        }
+#endif
+#if defined(TFM_MUL32)
+        if (yy >= 24 && y <= 32) {
+           fp_mul_comba32(A,B,C);
+           return;
+        }
+#endif
+#if defined(TFM_MUL48)
+        if (yy >= 40 && y <= 48) {
+           fp_mul_comba48(A,B,C);
+           return;
+        }
+#endif        
+#if defined(TFM_MUL64)
+        if (yy >= 56 && y <= 64) {
+           fp_mul_comba64(A,B,C);
+           return;
+        }
+#endif
+        fp_mul_comba(A,B,C);
+}
+
+void fp_mul_2(fp_int * a, fp_int * b)
+{
+  int     x, oldused;
+   
+  oldused = b->used;
+  b->used = a->used;
+
+  {
+    register fp_digit r, rr, *tmpa, *tmpb;
+
+    /* alias for source */
+    tmpa = a->dp;
+    
+    /* alias for dest */
+    tmpb = b->dp;
+
+    /* carry */
+    r = 0;
+    for (x = 0; x < a->used; x++) {
+    
+      /* get what will be the *next* carry bit from the 
+       * MSB of the current digit 
+       */
+      rr = *tmpa >> ((fp_digit)(DIGIT_BIT - 1));
+      
+      /* now shift up this digit, add in the carry [from the previous] */
+      *tmpb++ = ((*tmpa++ << ((fp_digit)1)) | r);
+      
+      /* copy the carry that would be from the source 
+       * digit into the next iteration 
+       */
+      r = rr;
+    }
+
+    /* new leading digit? */
+    if (r != 0 && b->used != (FP_SIZE-1)) {
+      /* add a MSB which is always 1 at this point */
+      *tmpb = 1;
+      ++(b->used);
+    }
+
+    /* now zero any excess digits on the destination 
+     * that we didn't write to 
+     */
+    tmpb = b->dp + b->used;
+    for (x = b->used; x < oldused; x++) {
+      *tmpb++ = 0;
+    }
+  }
+  b->sign = a->sign;
+}
+
+/* c = a * b */
+void fp_mul_d(fp_int *a, fp_digit b, fp_int *c)
+{
+   fp_word  w;
+   int      x, oldused;
+
+   oldused = c->used;
+   c->used = a->used;
+   c->sign = a->sign;
+   w       = 0;
+   for (x = 0; x < a->used; x++) {
+       w         = ((fp_word)a->dp[x]) * ((fp_word)b) + w;
+       c->dp[x]  = (fp_digit)w;
+       w         = w >> DIGIT_BIT;
+   }
+   if (w != 0 && (a->used != FP_SIZE)) {
+      c->dp[c->used++] = (fp_digit) w;
+      ++x;
+   }
+   for (; x < oldused; x++) {
+      c->dp[x] = 0;
+   }
+   fp_clamp(c);
+}
+
+/* c = a * 2**d */
+void fp_mul_2d(fp_int *a, int b, fp_int *c)
+{
+   fp_digit carry, carrytmp, shift;
+   int x;
+
+   /* copy it */
+   fp_copy(a, c);
+
+   /* handle whole digits */
+   if (b >= DIGIT_BIT) {
+      fp_lshd(c, b/DIGIT_BIT);
+   }
+   b %= DIGIT_BIT;
+
+   /* shift the digits */
+   if (b != 0) {
+      carry = 0;   
+      shift = DIGIT_BIT - b;
+      for (x = 0; x < c->used; x++) {
+          carrytmp = c->dp[x] >> shift;
+          c->dp[x] = (c->dp[x] << b) + carry;
+          carry = carrytmp;
+      }
+      /* store last carry if room */
+      if (carry && x < FP_SIZE) {
+         c->dp[c->used++] = carry;
+      }
+   }
+   fp_clamp(c);
+}
+
+/* generic PxQ multiplier */
+void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C)
+{
+   int       ix, iy, iz, tx, ty, pa;
+   fp_digit  c0, c1, c2, *tmpx, *tmpy;
+   fp_int    tmp, *dst;
+
+   COMBA_START;
+   COMBA_CLEAR;
+   
+   /* get size of output and trim */
+   pa = A->used + B->used;
+   if (pa >= FP_SIZE) {
+      pa = FP_SIZE-1;
+   }
+
+   if (A == C || B == C) {
+      fp_zero(&tmp);
+      dst = &tmp;
+   } else {
+      fp_zero(C);
+      dst = C;
+   }
+
+   for (ix = 0; ix < pa; ix++) {
+      /* get offsets into the two bignums */
+      ty = MIN(ix, B->used-1);
+      tx = ix - ty;
+
+      /* setup temp aliases */
+      tmpx = A->dp + tx;
+      tmpy = B->dp + ty;
+
+      /* this is the number of times the loop will iterrate, essentially its 
+         while (tx++ < a->used && ty-- >= 0) { ... }
+       */
+      iy = MIN(A->used-tx, ty+1);
+
+      /* execute loop */
+      COMBA_FORWARD;
+      for (iz = 0; iz < iy; ++iz) {
+          /* TAO change COMBA_ADD back to MULADD */
+          MULADD(*tmpx++, *tmpy--);
+      }
+
+      /* store term */
+      COMBA_STORE(dst->dp[ix]);
+  }
+  COMBA_FINI;
+
+  dst->used = pa;
+  dst->sign = A->sign ^ B->sign;
+  fp_clamp(dst);
+  fp_copy(dst, C);
+}
+
+/* a/b => cb + d == a */
+int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
+{
+  fp_int  q, x, y, t1, t2;
+  int     n, t, i, norm, neg;
+
+  /* is divisor zero ? */
+  if (fp_iszero (b) == 1) {
+    return FP_VAL;
+  }
+
+  /* if a < b then q=0, r = a */
+  if (fp_cmp_mag (a, b) == FP_LT) {
+    if (d != NULL) {
+      fp_copy (a, d);
+    } 
+    if (c != NULL) {
+      fp_zero (c);
+    }
+    return FP_OKAY;
+  }
+
+  fp_init(&q);
+  q.used = a->used + 2;
+
+  fp_init(&t1);
+  fp_init(&t2);
+  fp_init_copy(&x, a);
+  fp_init_copy(&y, b);
+
+  /* fix the sign */
+  neg = (a->sign == b->sign) ? FP_ZPOS : FP_NEG;
+  x.sign = y.sign = FP_ZPOS;
+
+  /* normalize both x and y, ensure that y >= b/2, [b == 2**DIGIT_BIT] */
+  norm = fp_count_bits(&y) % DIGIT_BIT;
+  if (norm < (int)(DIGIT_BIT-1)) {
+     norm = (DIGIT_BIT-1) - norm;
+     fp_mul_2d (&x, norm, &x);
+     fp_mul_2d (&y, norm, &y);
+  } else {
+     norm = 0;
+  }
+
+  /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */
+  n = x.used - 1;
+  t = y.used - 1;
+
+  /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */
+  fp_lshd (&y, n - t);                                             /* y = y*b**{n-t} */
+
+  while (fp_cmp (&x, &y) != FP_LT) {
+    ++(q.dp[n - t]);
+    fp_sub (&x, &y, &x);
+  }
+
+  /* reset y by shifting it back down */
+  fp_rshd (&y, n - t);
+
+  /* step 3. for i from n down to (t + 1) */
+  for (i = n; i >= (t + 1); i--) {
+    if (i > x.used) {
+      continue;
+    }
+
+    /* step 3.1 if xi == yt then set q{i-t-1} to b-1, 
+     * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */
+    if (x.dp[i] == y.dp[t]) {
+      q.dp[i - t - 1] = ((((fp_word)1) << DIGIT_BIT) - 1);
+    } else {
+      fp_word tmp;
+      tmp = ((fp_word) x.dp[i]) << ((fp_word) DIGIT_BIT);
+      tmp |= ((fp_word) x.dp[i - 1]);
+      tmp /= ((fp_word)y.dp[t]);
+      q.dp[i - t - 1] = (fp_digit) (tmp);
+    }
+
+    /* while (q{i-t-1} * (yt * b + y{t-1})) > 
+             xi * b**2 + xi-1 * b + xi-2 
+     
+       do q{i-t-1} -= 1; 
+    */
+    q.dp[i - t - 1] = (q.dp[i - t - 1] + 1);
+    do {
+      q.dp[i - t - 1] = (q.dp[i - t - 1] - 1);
+
+      /* find left hand */
+      fp_zero (&t1);
+      t1.dp[0] = (t - 1 < 0) ? 0 : y.dp[t - 1];
+      t1.dp[1] = y.dp[t];
+      t1.used = 2;
+      fp_mul_d (&t1, q.dp[i - t - 1], &t1);
+
+      /* find right hand */
+      t2.dp[0] = (i - 2 < 0) ? 0 : x.dp[i - 2];
+      t2.dp[1] = (i - 1 < 0) ? 0 : x.dp[i - 1];
+      t2.dp[2] = x.dp[i];
+      t2.used = 3;
+    } while (fp_cmp_mag(&t1, &t2) == FP_GT);
+
+    /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */
+    fp_mul_d (&y, q.dp[i - t - 1], &t1);
+    fp_lshd  (&t1, i - t - 1);
+    fp_sub   (&x, &t1, &x);
+
+    /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */
+    if (x.sign == FP_NEG) {
+      fp_copy (&y, &t1);
+      fp_lshd (&t1, i - t - 1);
+      fp_add (&x, &t1, &x);
+      q.dp[i - t - 1] = q.dp[i - t - 1] - 1;
+    }
+  }
+
+  /* now q is the quotient and x is the remainder 
+   * [which we have to normalize] 
+   */
+  
+  /* get sign before writing to c */
+  x.sign = x.used == 0 ? FP_ZPOS : a->sign;
+
+  if (c != NULL) {
+    fp_clamp (&q);
+    fp_copy (&q, c);
+    c->sign = neg;
+  }
+
+  if (d != NULL) {
+    fp_div_2d (&x, norm, &x, NULL);
+
+/* the following is a kludge, essentially we were seeing the right remainder but 
+   with excess digits that should have been zero
+ */
+    for (i = b->used; i < x.used; i++) {
+        x.dp[i] = 0;
+    }
+    fp_clamp(&x);
+    fp_copy (&x, d);
+  }
+
+  return FP_OKAY;
+}
+
+/* b = a/2 */
+void fp_div_2(fp_int * a, fp_int * b)
+{
+  int     x, oldused;
+
+  oldused = b->used;
+  b->used = a->used;
+  {
+    register fp_digit r, rr, *tmpa, *tmpb;
+
+    /* source alias */
+    tmpa = a->dp + b->used - 1;
+
+    /* dest alias */
+    tmpb = b->dp + b->used - 1;
+
+    /* carry */
+    r = 0;
+    for (x = b->used - 1; x >= 0; x--) {
+      /* get the carry for the next iteration */
+      rr = *tmpa & 1;
+
+      /* shift the current digit, add in carry and store */
+      *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1));
+
+      /* forward carry to next iteration */
+      r = rr;
+    }
+
+    /* zero excess digits */
+    tmpb = b->dp + b->used;
+    for (x = b->used; x < oldused; x++) {
+      *tmpb++ = 0;
+    }
+  }
+  b->sign = a->sign;
+  fp_clamp (b);
+}
+
+/* c = a / 2**b */
+void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d)
+{
+  fp_digit D, r, rr;
+  int      x;
+  fp_int   t;
+
+  /* if the shift count is <= 0 then we do no work */
+  if (b <= 0) {
+    fp_copy (a, c);
+    if (d != NULL) {
+      fp_zero (d);
+    }
+    return;
+  }
+
+  fp_init(&t);
+
+  /* get the remainder */
+  if (d != NULL) {
+    fp_mod_2d (a, b, &t);
+  }
+
+  /* copy */
+  fp_copy(a, c);
+
+  /* shift by as many digits in the bit count */
+  if (b >= (int)DIGIT_BIT) {
+    fp_rshd (c, b / DIGIT_BIT);
+  }
+
+  /* shift any bit count < DIGIT_BIT */
+  D = (fp_digit) (b % DIGIT_BIT);
+  if (D != 0) {
+    register fp_digit *tmpc, mask, shift;
+
+    /* mask */
+    mask = (((fp_digit)1) << D) - 1;
+
+    /* shift for lsb */
+    shift = DIGIT_BIT - D;
+
+    /* alias */
+    tmpc = c->dp + (c->used - 1);
+
+    /* carry */
+    r = 0;
+    for (x = c->used - 1; x >= 0; x--) {
+      /* get the lower  bits of this word in a temp */
+      rr = *tmpc & mask;
+
+      /* shift the current word and mix in the carry bits from the previous word */
+      *tmpc = (*tmpc >> D) | (r << shift);
+      --tmpc;
+
+      /* set the carry to the carry bits of the current word found above */
+      r = rr;
+    }
+  }
+  fp_clamp (c);
+  if (d != NULL) {
+    fp_copy (&t, d);
+  }
+}
+
+/* c = a mod b, 0 <= c < b  */
+int fp_mod(fp_int *a, fp_int *b, fp_int *c)
+{
+   fp_int t;
+   int    err;
+
+   fp_zero(&t);
+   if ((err = fp_div(a, b, NULL, &t)) != FP_OKAY) {
+      return err;
+   }
+   if (t.sign != b->sign) {
+      fp_add(&t, b, c);
+   } else {
+      fp_copy(&t, c);
+  }
+  return FP_OKAY;
+}
+
+/* c = a mod 2**d */
+void fp_mod_2d(fp_int *a, int b, fp_int *c)
+{
+   int x;
+
+   /* zero if count less than or equal to zero */
+   if (b <= 0) {
+      fp_zero(c);
+      return;
+   }
+
+   /* get copy of input */
+   fp_copy(a, c);
+   /* if 2**d is larger than we just return */
+   if (b >= (DIGIT_BIT * a->used)) {
+      return;
+   }
+
+  /* zero digits above the last digit of the modulus */
+  for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
+    c->dp[x] = 0;
+  }
+  /* clear the digit that is not completely outside/inside the modulus */
+  c->dp[b / DIGIT_BIT] &= ~((fp_digit)0) >> (DIGIT_BIT - b);
+  fp_clamp (c);
+}
+
+static int fp_invmod_slow (fp_int * a, fp_int * b, fp_int * c)
+{
+  fp_int  x, y, u, v, A, B, C, D;
+  int     res;
+
+  /* b cannot be negative */
+  if (b->sign == FP_NEG || fp_iszero(b) == 1) {
+    return FP_VAL;
+  }
+
+  /* init temps */
+  fp_init(&x);    fp_init(&y);
+  fp_init(&u);    fp_init(&v);
+  fp_init(&A);    fp_init(&B);
+  fp_init(&C);    fp_init(&D);
+
+  /* x = a, y = b */
+  if ((res = fp_mod(a, b, &x)) != FP_OKAY) {
+      return res;
+  }
+  fp_copy(b, &y);
+
+  /* 2. [modified] if x,y are both even then return an error! */
+  if (fp_iseven (&x) == 1 && fp_iseven (&y) == 1) {
+    return FP_VAL;
+  }
+
+  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
+  fp_copy (&x, &u);
+  fp_copy (&y, &v);
+  fp_set (&A, 1);
+  fp_set (&D, 1);
+
+top:
+  /* 4.  while u is even do */
+  while (fp_iseven (&u) == 1) {
+    /* 4.1 u = u/2 */
+    fp_div_2 (&u, &u);
+
+    /* 4.2 if A or B is odd then */
+    if (fp_isodd (&A) == 1 || fp_isodd (&B) == 1) {
+      /* A = (A+y)/2, B = (B-x)/2 */
+      fp_add (&A, &y, &A);
+      fp_sub (&B, &x, &B);
+    }
+    /* A = A/2, B = B/2 */
+    fp_div_2 (&A, &A);
+    fp_div_2 (&B, &B);
+  }
+
+  /* 5.  while v is even do */
+  while (fp_iseven (&v) == 1) {
+    /* 5.1 v = v/2 */
+    fp_div_2 (&v, &v);
+
+    /* 5.2 if C or D is odd then */
+    if (fp_isodd (&C) == 1 || fp_isodd (&D) == 1) {
+      /* C = (C+y)/2, D = (D-x)/2 */
+      fp_add (&C, &y, &C);
+      fp_sub (&D, &x, &D);
+    }
+    /* C = C/2, D = D/2 */
+    fp_div_2 (&C, &C);
+    fp_div_2 (&D, &D);
+  }
+
+  /* 6.  if u >= v then */
+  if (fp_cmp (&u, &v) != FP_LT) {
+    /* u = u - v, A = A - C, B = B - D */
+    fp_sub (&u, &v, &u);
+    fp_sub (&A, &C, &A);
+    fp_sub (&B, &D, &B);
+  } else {
+    /* v - v - u, C = C - A, D = D - B */
+    fp_sub (&v, &u, &v);
+    fp_sub (&C, &A, &C);
+    fp_sub (&D, &B, &D);
+  }
+
+  /* if not zero goto step 4 */
+  if (fp_iszero (&u) == 0)
+    goto top;
+
+  /* now a = C, b = D, gcd == g*v */
+
+  /* if v != 1 then there is no inverse */
+  if (fp_cmp_d (&v, 1) != FP_EQ) {
+    return FP_VAL;
+  }
+
+  /* if its too low */
+  while (fp_cmp_d(&C, 0) == FP_LT) {
+      fp_add(&C, b, &C);
+  }
+  
+  /* too big */
+  while (fp_cmp_mag(&C, b) != FP_LT) {
+      fp_sub(&C, b, &C);
+  }
+  
+  /* C is now the inverse */
+  fp_copy(&C, c);
+  return FP_OKAY;
+}
+
+/* c = 1/a (mod b) for odd b only */
+int fp_invmod(fp_int *a, fp_int *b, fp_int *c)
+{
+  fp_int  x, y, u, v, B, D;
+  int     neg;
+
+  /* 2. [modified] b must be odd   */
+  if (fp_iseven (b) == FP_YES) {
+    return fp_invmod_slow(a,b,c);
+  }
+
+  /* init all our temps */
+  fp_init(&x);  fp_init(&y);
+  fp_init(&u);  fp_init(&v);
+  fp_init(&B);  fp_init(&D);
+
+  /* x == modulus, y == value to invert */
+  fp_copy(b, &x);
+
+  /* we need y = |a| */
+  fp_abs(a, &y);
+
+  /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */
+  fp_copy(&x, &u);
+  fp_copy(&y, &v);
+  fp_set (&D, 1);
+
+top:
+  /* 4.  while u is even do */
+  while (fp_iseven (&u) == FP_YES) {
+    /* 4.1 u = u/2 */
+    fp_div_2 (&u, &u);
+
+    /* 4.2 if B is odd then */
+    if (fp_isodd (&B) == FP_YES) {
+      fp_sub (&B, &x, &B);
+    }
+    /* B = B/2 */
+    fp_div_2 (&B, &B);
+  }
+
+  /* 5.  while v is even do */
+  while (fp_iseven (&v) == FP_YES) {
+    /* 5.1 v = v/2 */
+    fp_div_2 (&v, &v);
+
+    /* 5.2 if D is odd then */
+    if (fp_isodd (&D) == FP_YES) {
+      /* D = (D-x)/2 */
+      fp_sub (&D, &x, &D);
+    }
+    /* D = D/2 */
+    fp_div_2 (&D, &D);
+  }
+
+  /* 6.  if u >= v then */
+  if (fp_cmp (&u, &v) != FP_LT) {
+    /* u = u - v, B = B - D */
+    fp_sub (&u, &v, &u);
+    fp_sub (&B, &D, &B);
+  } else {
+    /* v - v - u, D = D - B */
+    fp_sub (&v, &u, &v);
+    fp_sub (&D, &B, &D);
+  }
+
+  /* if not zero goto step 4 */
+  if (fp_iszero (&u) == FP_NO) {
+    goto top;
+  }
+
+  /* now a = C, b = D, gcd == g*v */
+
+  /* if v != 1 then there is no inverse */
+  if (fp_cmp_d (&v, 1) != FP_EQ) {
+    return FP_VAL;
+  }
+
+  /* b is now the inverse */
+  neg = a->sign;
+  while (D.sign == FP_NEG) {
+    fp_add (&D, b, &D);
+  }
+  fp_copy (&D, c);
+  c->sign = neg;
+  return FP_OKAY;
+}
+
+/* d = a * b (mod c) */
+int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
+{
+  fp_int tmp;
+  fp_zero(&tmp);
+  fp_mul(a, b, &tmp);
+  return fp_mod(&tmp, c, d);
+}
+
+#ifdef TFM_TIMING_RESISTANT
+
+/* timing resistant montgomery ladder based exptmod 
+
+   Based on work by Marc Joye, Sung-Ming Yen, "The Montgomery Powering Ladder", Cryptographic Hardware and Embedded Systems, CHES 2002
+*/
+static int _fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
+{
+  fp_int   R[2];
+  fp_digit buf, mp;
+  int      err, bitcnt, digidx, y;
+
+  /* now setup montgomery  */
+  if ((err = fp_montgomery_setup (P, &mp)) != FP_OKAY) {
+     return err;
+  }
+
+  fp_init(&R[0]);   
+  fp_init(&R[1]);   
+   
+  /* now we need R mod m */
+  fp_montgomery_calc_normalization (&R[0], P);
+
+  /* now set R[0][1] to G * R mod m */
+  if (fp_cmp_mag(P, G) != FP_GT) {
+     /* G > P so we reduce it first */
+     fp_mod(G, P, &R[1]);
+  } else {
+     fp_copy(G, &R[1]);
+  }
+  fp_mulmod (&R[1], &R[0], P, &R[1]);
+
+  /* for j = t-1 downto 0 do
+        r_!k = R0*R1; r_k = r_k^2
+  */
+  
+  /* set initial mode and bit cnt */
+  bitcnt = 1;
+  buf    = 0;
+  digidx = X->used - 1;
+
+  for (;;) {
+    /* grab next digit as required */
+    if (--bitcnt == 0) {
+      /* if digidx == -1 we are out of digits so break */
+      if (digidx == -1) {
+        break;
+      }
+      /* read next digit and reset bitcnt */
+      buf    = X->dp[digidx--];
+      bitcnt = (int)DIGIT_BIT;
+    }
+
+    /* grab the next msb from the exponent */
+    y     = (fp_digit)(buf >> (DIGIT_BIT - 1)) & 1;
+    buf <<= (fp_digit)1;
+
+    /* do ops */
+    fp_mul(&R[0], &R[1], &R[y^1]); fp_montgomery_reduce(&R[y^1], P, mp);
+    fp_sqr(&R[y], &R[y]);          fp_montgomery_reduce(&R[y], P, mp);
+  }
+
+   fp_montgomery_reduce(&R[0], P, mp);
+   fp_copy(&R[0], Y);
+   return FP_OKAY;
+}   
+
+#else
+
+/* y = g**x (mod b) 
+ * Some restrictions... x must be positive and < b
+ */
+static int _fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
+{
+  fp_int   M[64], res;
+  fp_digit buf, mp;
+  int      err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize;
+
+  /* find window size */
+  x = fp_count_bits (X);
+  if (x <= 21) {
+    winsize = 1;
+  } else if (x <= 36) {
+    winsize = 3;
+  } else if (x <= 140) {
+    winsize = 4;
+  } else if (x <= 450) {
+    winsize = 5;
+  } else {
+    winsize = 6;
+  } 
+
+  /* init M array */
+  XMEMSET(M, 0, sizeof(M)); 
+
+  /* now setup montgomery  */
+  if ((err = fp_montgomery_setup (P, &mp)) != FP_OKAY) {
+     return err;
+  }
+
+  /* setup result */
+  fp_init(&res);
+
+  /* create M table
+   *
+   * The M table contains powers of the input base, e.g. M[x] = G^x mod P
+   *
+   * The first half of the table is not computed though accept for M[0] and M[1]
+   */
+
+   /* now we need R mod m */
+   fp_montgomery_calc_normalization (&res, P);
+
+   /* now set M[1] to G * R mod m */
+   if (fp_cmp_mag(P, G) != FP_GT) {
+      /* G > P so we reduce it first */
+      fp_mod(G, P, &M[1]);
+   } else {
+      fp_copy(G, &M[1]);
+   }
+   fp_mulmod (&M[1], &res, P, &M[1]);
+
+  /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */
+  fp_copy (&M[1], &M[1 << (winsize - 1)]);
+  for (x = 0; x < (winsize - 1); x++) {
+    fp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)]);
+    fp_montgomery_reduce (&M[1 << (winsize - 1)], P, mp);
+  }
+
+  /* create upper table */
+  for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
+    fp_mul(&M[x - 1], &M[1], &M[x]);
+    fp_montgomery_reduce(&M[x], P, mp);
+  }
+
+  /* set initial mode and bit cnt */
+  mode   = 0;
+  bitcnt = 1;
+  buf    = 0;
+  digidx = X->used - 1;
+  bitcpy = 0;
+  bitbuf = 0;
+
+  for (;;) {
+    /* grab next digit as required */
+    if (--bitcnt == 0) {
+      /* if digidx == -1 we are out of digits so break */
+      if (digidx == -1) {
+        break;
+      }
+      /* read next digit and reset bitcnt */
+      buf    = X->dp[digidx--];
+      bitcnt = (int)DIGIT_BIT;
+    }
+
+    /* grab the next msb from the exponent */
+    y     = (fp_digit)(buf >> (DIGIT_BIT - 1)) & 1;
+    buf <<= (fp_digit)1;
+
+    /* if the bit is zero and mode == 0 then we ignore it
+     * These represent the leading zero bits before the first 1 bit
+     * in the exponent.  Technically this opt is not required but it
+     * does lower the # of trivial squaring/reductions used
+     */
+    if (mode == 0 && y == 0) {
+      continue;
+    }
+
+    /* if the bit is zero and mode == 1 then we square */
+    if (mode == 1 && y == 0) {
+      fp_sqr(&res, &res);
+      fp_montgomery_reduce(&res, P, mp);
+      continue;
+    }
+
+    /* else we add it to the window */
+    bitbuf |= (y << (winsize - ++bitcpy));
+    mode    = 2;
+
+    if (bitcpy == winsize) {
+      /* ok window is filled so square as required and multiply  */
+      /* square first */
+      for (x = 0; x < winsize; x++) {
+        fp_sqr(&res, &res);
+        fp_montgomery_reduce(&res, P, mp);
+      }
+
+      /* then multiply */
+      fp_mul(&res, &M[bitbuf], &res);
+      fp_montgomery_reduce(&res, P, mp);
+
+      /* empty window and reset */
+      bitcpy = 0;
+      bitbuf = 0;
+      mode   = 1;
+    }
+  }
+
+  /* if bits remain then square/multiply */
+  if (mode == 2 && bitcpy > 0) {
+    /* square then multiply if the bit is set */
+    for (x = 0; x < bitcpy; x++) {
+      fp_sqr(&res, &res);
+      fp_montgomery_reduce(&res, P, mp);
+
+      /* get next bit of the window */
+      bitbuf <<= 1;
+      if ((bitbuf & (1 << winsize)) != 0) {
+        /* then multiply */
+        fp_mul(&res, &M[1], &res);
+        fp_montgomery_reduce(&res, P, mp);
+      }
+    }
+  }
+
+  /* fixup result if Montgomery reduction is used
+   * recall that any value in a Montgomery system is
+   * actually multiplied by R mod n.  So we have
+   * to reduce one more time to cancel out the factor
+   * of R.
+   */
+  fp_montgomery_reduce(&res, P, mp);
+
+  /* swap res with Y */
+  fp_copy (&res, Y);
+  return FP_OKAY;
+}
+
+#endif
+
+int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
+{
+   fp_int tmp;
+   int    err;
+  
+   /* prevent overflows */
+   if (P->used > (FP_SIZE/2)) {
+      return FP_VAL;
+   }
+
+   /* is X negative?  */
+   if (X->sign == FP_NEG) {
+      /* yes, copy G and invmod it */
+      fp_copy(G, &tmp);
+      if ((err = fp_invmod(&tmp, P, &tmp)) != FP_OKAY) {
+         return err;
+      }
+      X->sign = FP_ZPOS;
+      err =  _fp_exptmod(&tmp, X, P, Y);
+      if (X != Y) {
+         X->sign = FP_NEG;
+      }
+      return err;
+   } else {
+      /* Positive exponent so just exptmod */
+      return _fp_exptmod(G, X, P, Y);
+   }
+}
+
+/* computes a = 2**b */
+void fp_2expt(fp_int *a, int b)
+{
+   int     z;
+
+   /* zero a as per default */
+   fp_zero (a);
+
+   if (b < 0) { 
+      return;
+   }
+
+   z = b / DIGIT_BIT;
+   if (z >= FP_SIZE) {
+      return; 
+   }
+
+  /* set the used count of where the bit will go */
+  a->used = z + 1;
+
+  /* put the single bit in its place */
+  a->dp[z] = ((fp_digit)1) << (b % DIGIT_BIT);
+}
+
+/* b = a*a  */
+void fp_sqr(fp_int *A, fp_int *B)
+{
+    int y = A->used;
+
+    /* call generic if we're out of range */
+    if (y + y > FP_SIZE) {
+       fp_sqr_comba(A, B);
+       return ;
+    }
+
+#if defined(TFM_SQR3)
+        if (y <= 3) {
+           fp_sqr_comba3(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR4)
+        if (y == 4) {
+           fp_sqr_comba4(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR6)
+        if (y <= 6) {
+           fp_sqr_comba6(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR7)
+        if (y == 7) {
+           fp_sqr_comba7(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR8)
+        if (y == 8) {
+           fp_sqr_comba8(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR9)
+        if (y == 9) {
+           fp_sqr_comba9(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR12)
+        if (y <= 12) {
+           fp_sqr_comba12(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR17)
+        if (y <= 17) {
+           fp_sqr_comba17(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SMALL_SET)
+        if (y <= 16) {
+           fp_sqr_comba_small(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR20)
+        if (y <= 20) {
+           fp_sqr_comba20(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR24)
+        if (y <= 24) {
+           fp_sqr_comba24(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR28)
+        if (y <= 28) {
+           fp_sqr_comba28(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR32)
+        if (y <= 32) {
+           fp_sqr_comba32(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR48)
+        if (y <= 48) {
+           fp_sqr_comba48(A,B);
+           return;
+        }
+#endif
+#if defined(TFM_SQR64)
+        if (y <= 64) {
+           fp_sqr_comba64(A,B);
+           return;
+        }
+#endif
+       fp_sqr_comba(A, B);
+}
+
+/* generic comba squarer */
+void fp_sqr_comba(fp_int *A, fp_int *B)
+{
+  int       pa, ix, iz;
+  fp_digit  c0, c1, c2;
+  fp_int    tmp, *dst;
+#ifdef TFM_ISO
+  fp_word   tt;
+#endif    
+
+  /* get size of output and trim */
+  pa = A->used + A->used;
+  if (pa >= FP_SIZE) {
+     pa = FP_SIZE-1;
+  }
+
+  /* number of output digits to produce */
+  COMBA_START;
+  COMBA_CLEAR;
+
+  if (A == B) {
+     fp_zero(&tmp);
+     dst = &tmp;
+  } else {
+     fp_zero(B);
+     dst = B;
+  }
+
+  for (ix = 0; ix < pa; ix++) { 
+      int      tx, ty, iy;
+      fp_digit *tmpy, *tmpx;
+
+      /* get offsets into the two bignums */
+      ty = MIN(A->used-1, ix);
+      tx = ix - ty;
+
+      /* setup temp aliases */
+      tmpx = A->dp + tx;
+      tmpy = A->dp + ty;
+
+      /* this is the number of times the loop will iterrate,
+         while (tx++ < a->used && ty-- >= 0) { ... }
+       */
+      iy = MIN(A->used-tx, ty+1);
+
+      /* now for squaring tx can never equal ty 
+       * we halve the distance since they approach 
+       * at a rate of 2x and we have to round because 
+       * odd cases need to be executed
+       */
+      iy = MIN(iy, (ty-tx+1)>>1);
+
+      /* forward carries */
+      COMBA_FORWARD;
+
+      /* execute loop */
+      for (iz = 0; iz < iy; iz++) {
+          SQRADD2(*tmpx++, *tmpy--);
+      }
+
+      /* even columns have the square term in them */
+      if ((ix&1) == 0) {
+          /* TAO change COMBA_ADD back to SQRADD */
+          SQRADD(A->dp[ix>>1], A->dp[ix>>1]);
+      }
+
+      /* store it */
+      COMBA_STORE(dst->dp[ix]);
+  }
+
+  COMBA_FINI;
+
+  /* setup dest */
+  dst->used = pa;
+  fp_clamp (dst);
+  if (dst != B) {
+     fp_copy(dst, B);
+  }
+}
+
+int fp_cmp(fp_int *a, fp_int *b)
+{
+   if (a->sign == FP_NEG && b->sign == FP_ZPOS) {
+      return FP_LT;
+   } else if (a->sign == FP_ZPOS && b->sign == FP_NEG) {
+      return FP_GT;
+   } else {
+      /* compare digits */
+      if (a->sign == FP_NEG) {
+         /* if negative compare opposite direction */
+         return fp_cmp_mag(b, a);
+      } else {
+         return fp_cmp_mag(a, b);
+      }
+   }
+}
+
+/* compare against a single digit */
+int fp_cmp_d(fp_int *a, fp_digit b)
+{
+  /* compare based on sign */
+  if ((b && a->used == 0) || a->sign == FP_NEG) {
+    return FP_LT;
+  }
+
+  /* compare based on magnitude */
+  if (a->used > 1) {
+    return FP_GT;
+  }
+
+  /* compare the only digit of a to b */
+  if (a->dp[0] > b) {
+    return FP_GT;
+  } else if (a->dp[0] < b) {
+    return FP_LT;
+  } else {
+    return FP_EQ;
+  }
+
+}
+
+int fp_cmp_mag(fp_int *a, fp_int *b)
+{
+   int x;
+
+   if (a->used > b->used) {
+      return FP_GT;
+   } else if (a->used < b->used) {
+      return FP_LT;
+   } else {
+      for (x = a->used - 1; x >= 0; x--) {
+          if (a->dp[x] > b->dp[x]) {
+             return FP_GT;
+          } else if (a->dp[x] < b->dp[x]) {
+             return FP_LT;
+          }
+      }
+   }
+   return FP_EQ;
+}
+
+/* setups the montgomery reduction */
+int fp_montgomery_setup(fp_int *a, fp_digit *rho)
+{
+  fp_digit x, b;
+
+/* fast inversion mod 2**k
+ *
+ * Based on the fact that
+ *
+ * XA = 1 (mod 2**n)  =>  (X(2-XA)) A = 1 (mod 2**2n)
+ *                    =>  2*X*A - X*X*A*A = 1
+ *                    =>  2*(1) - (1)     = 1
+ */
+  b = a->dp[0];
+
+  if ((b & 1) == 0) {
+    return FP_VAL;
+  }
+
+  x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */
+  x *= 2 - b * x;               /* here x*a==1 mod 2**8 */
+  x *= 2 - b * x;               /* here x*a==1 mod 2**16 */
+  x *= 2 - b * x;               /* here x*a==1 mod 2**32 */
+#ifdef FP_64BIT
+  x *= 2 - b * x;               /* here x*a==1 mod 2**64 */
+#endif
+
+  /* rho = -1/m mod b */
+  *rho = (fp_digit) (((fp_word) 1 << ((fp_word) DIGIT_BIT)) - ((fp_word)x));
+
+  return FP_OKAY;
+}
+
+/* computes a = B**n mod b without division or multiplication useful for
+ * normalizing numbers in a Montgomery system.
+ */
+void fp_montgomery_calc_normalization(fp_int *a, fp_int *b)
+{
+  int     x, bits;
+
+  /* how many bits of last digit does b use */
+  bits = fp_count_bits (b) % DIGIT_BIT;
+  if (!bits) bits = DIGIT_BIT;
+
+  /* compute A = B^(n-1) * 2^(bits-1) */
+  if (b->used > 1) {
+     fp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1);
+  } else {
+     fp_set(a, 1);
+     bits = 1;
+  }
+
+  /* now compute C = A * B mod b */
+  for (x = bits - 1; x < (int)DIGIT_BIT; x++) {
+    fp_mul_2 (a, a);
+    if (fp_cmp_mag (a, b) != FP_LT) {
+      s_fp_sub (a, b, a);
+    }
+  }
+}
+
+
+#ifdef TFM_SMALL_MONT_SET
+    #include "fp_mont_small.i"
+#endif
+
+/* computes x/R == x (mod N) via Montgomery Reduction */
+void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp)
+{
+   fp_digit c[FP_SIZE], *_c, *tmpm, mu;
+   int      oldused, x, y, pa;
+
+   /* bail if too large */
+   if (m->used > (FP_SIZE/2)) {
+      (void)mu;                     /* shut up compiler */
+      return;
+   }
+
+#ifdef TFM_SMALL_MONT_SET
+   if (m->used <= 16) {
+      fp_montgomery_reduce_small(a, m, mp);
+      return;
+   }
+#endif
+
+
+#if defined(USE_MEMSET)
+   /* now zero the buff */
+   XMEMSET(c, 0, sizeof c);
+#endif
+   pa = m->used;
+
+   /* copy the input */
+   oldused = a->used;
+   for (x = 0; x < oldused; x++) {
+       c[x] = a->dp[x];
+   }
+#if !defined(USE_MEMSET)
+   for (; x < 2*pa+1; x++) {
+       c[x] = 0;
+   }
+#endif
+   MONT_START;
+
+   for (x = 0; x < pa; x++) {
+       fp_digit cy = 0;
+       /* get Mu for this round */
+       LOOP_START;
+       _c   = c + x;
+       tmpm = m->dp;
+       y = 0;
+       #if (defined(TFM_SSE2) || defined(TFM_X86_64))
+        for (; y < (pa & ~7); y += 8) {
+              INNERMUL8;
+              _c   += 8;
+              tmpm += 8;
+           }
+       #endif
+
+       for (; y < pa; y++) {
+          INNERMUL;
+          ++_c;
+       }
+       LOOP_END;
+       while (cy) {
+           PROPCARRY;
+           ++_c;
+       }
+  }         
+
+  /* now copy out */
+  _c   = c + pa;
+  tmpm = a->dp;
+  for (x = 0; x < pa+1; x++) {
+     *tmpm++ = *_c++;
+  }
+
+  for (; x < oldused; x++)   {
+     *tmpm++ = 0;
+  }
+
+  MONT_FINI;
+
+  a->used = pa+1;
+  fp_clamp(a);
+  
+  /* if A >= m then A = A - m */
+  if (fp_cmp_mag (a, m) != FP_LT) {
+    s_fp_sub (a, m, a);
+  }
+}
+
+void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c)
+{
+  /* zero the int */
+  fp_zero (a);
+
+  /* If we know the endianness of this architecture, and we're using
+     32-bit fp_digits, we can optimize this */
+#if (defined(ENDIAN_LITTLE) || defined(ENDIAN_BIG)) && !defined(FP_64BIT)
+  /* But not for both simultaneously */
+#if defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG)
+#error Both ENDIAN_LITTLE and ENDIAN_BIG defined.
+#endif
+  {
+     unsigned char *pd = (unsigned char *)a->dp;
+
+     if ((unsigned)c > (FP_SIZE * sizeof(fp_digit))) {
+        int excess = c - (FP_SIZE * sizeof(fp_digit));
+        c -= excess;
+        b += excess;
+     }
+     a->used = (c + sizeof(fp_digit) - 1)/sizeof(fp_digit);
+     /* read the bytes in */
+#ifdef ENDIAN_BIG
+     {
+       /* Use Duff's device to unroll the loop. */
+       int idx = (c - 1) & ~3;
+       switch (c % 4) {
+       case 0: do { pd[idx+0] = *b++;
+       case 3:      pd[idx+1] = *b++;
+       case 2:      pd[idx+2] = *b++;
+       case 1:      pd[idx+3] = *b++;
+                     idx -= 4;
+                       } while ((c -= 4) > 0);
+       }
+     }
+#else
+     for (c -= 1; c >= 0; c -= 1) {
+       pd[c] = *b++;
+     }
+#endif
+  }
+#else
+  /* read the bytes in */
+  for (; c > 0; c--) {
+     fp_mul_2d (a, 8, a);
+     a->dp[0] |= *b++;
+     a->used += 1;
+  }
+#endif
+  fp_clamp (a);
+}
+
+void fp_to_unsigned_bin(fp_int *a, unsigned char *b)
+{
+  int     x;
+  fp_int  t;
+
+  fp_init_copy(&t, a);
+
+  x = 0;
+  while (fp_iszero (&t) == FP_NO) {
+      b[x++] = (unsigned char) (t.dp[0] & 255);
+      fp_div_2d (&t, 8, &t, NULL);
+  }
+  fp_reverse (b, x);
+}
+
+int fp_unsigned_bin_size(fp_int *a)
+{
+  int     size = fp_count_bits (a);
+  return (size / 8 + ((size & 7) != 0 ? 1 : 0));
+}
+
+void fp_set(fp_int *a, fp_digit b)
+{
+   fp_zero(a);
+   a->dp[0] = b;
+   a->used  = a->dp[0] ? 1 : 0;
+}
+
+int fp_count_bits (fp_int * a)
+{
+  int     r;
+  fp_digit q;
+
+  /* shortcut */
+  if (a->used == 0) {
+    return 0;
+  }
+
+  /* get number of digits and add that */
+  r = (a->used - 1) * DIGIT_BIT;
+
+  /* take the last digit and count the bits in it */
+  q = a->dp[a->used - 1];
+  while (q > ((fp_digit) 0)) {
+    ++r;
+    q >>= ((fp_digit) 1);
+  }
+  return r;
+}
+
+void fp_lshd(fp_int *a, int x)
+{
+   int y;
+
+   /* move up and truncate as required */
+   y = MIN(a->used + x - 1, (int)(FP_SIZE-1));
+
+   /* store new size */
+   a->used = y + 1;
+
+   /* move digits */
+   for (; y >= x; y--) {
+       a->dp[y] = a->dp[y-x];
+   }
+   /* zero lower digits */
+   for (; y >= 0; y--) {
+       a->dp[y] = 0;
+   }
+
+   /* clamp digits */
+   fp_clamp(a);
+}
+
+void fp_rshd(fp_int *a, int x)
+{
+  int y;
+
+  /* too many digits just zero and return */
+  if (x >= a->used) {
+     fp_zero(a);
+     return;
+  }
+
+   /* shift */
+   for (y = 0; y < a->used - x; y++) {
+      a->dp[y] = a->dp[y+x];
+   }
+
+   /* zero rest */
+   for (; y < a->used; y++) {
+      a->dp[y] = 0;
+   }
+   
+   /* decrement count */
+   a->used -= x;
+   fp_clamp(a);
+}
+
+/* reverse an array, used for radix code */
+void fp_reverse (unsigned char *s, int len)
+{
+  int     ix, iy;
+  unsigned char t;
+
+  ix = 0;
+  iy = len - 1;
+  while (ix < iy) {
+    t     = s[ix];
+    s[ix] = s[iy];
+    s[iy] = t;
+    ++ix;
+    --iy;
+  }
+}
+
+
+/* c = a - b */
+void fp_sub_d(fp_int *a, fp_digit b, fp_int *c)
+{
+   fp_int tmp;
+   fp_set(&tmp, b);
+   fp_sub(a, &tmp, c);
+}
+
+
+/* CyaSSL callers from normal lib */
+
+/* init a new mp_int */
+int mp_init (mp_int * a)
+{
+  if (a)
+    fp_init(a);
+  return MP_OKAY;
+}
+
+/* clear one (frees)  */
+void mp_clear (mp_int * a)
+{
+  fp_zero(a);
+}
+
+/* handle up to 6 inits */
+int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, mp_int* f)
+{
+    if (a)
+        fp_init(a);
+    if (b)
+        fp_init(b);
+    if (c)
+        fp_init(c);
+    if (d)
+        fp_init(d);
+    if (e)
+        fp_init(e);
+    if (f)
+        fp_init(f);
+
+    return MP_OKAY;
+}
+
+/* high level addition (handles signs) */
+int mp_add (mp_int * a, mp_int * b, mp_int * c)
+{
+  fp_add(a, b, c);
+  return MP_OKAY;
+}
+
+/* high level subtraction (handles signs) */
+int mp_sub (mp_int * a, mp_int * b, mp_int * c)
+{
+  fp_sub(a, b, c);
+  return MP_OKAY;
+}
+
+/* high level multiplication (handles sign) */
+int mp_mul (mp_int * a, mp_int * b, mp_int * c)
+{
+  fp_mul(a, b, c);
+  return MP_OKAY;
+}
+
+/* d = a * b (mod c) */
+int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d)
+{
+  return fp_mulmod(a, b, c, d);
+}
+
+/* c = a mod b, 0 <= c < b */
+int mp_mod (mp_int * a, mp_int * b, mp_int * c)
+{
+  return fp_mod (a, b, c);
+}
+
+/* hac 14.61, pp608 */
+int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
+{
+  return fp_invmod(a, b, c);
+}
+
+/* this is a shell function that calls either the normal or Montgomery
+ * exptmod functions.  Originally the call to the montgomery code was
+ * embedded in the normal function but that wasted alot of stack space
+ * for nothing (since 99% of the time the Montgomery code would be called)
+ */
+int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y)
+{
+  return fp_exptmod(G, X, P, Y);
+}
+
+/* compare two ints (signed)*/
+int mp_cmp (mp_int * a, mp_int * b)
+{
+  return fp_cmp(a, b);
+}
+
+/* compare a digit */
+int mp_cmp_d(mp_int * a, mp_digit b)
+{
+  return fp_cmp_d(a, b);
+}
+
+/* get the size for an unsigned equivalent */
+int mp_unsigned_bin_size (mp_int * a)
+{
+  return fp_unsigned_bin_size(a);
+}
+
+/* store in unsigned [big endian] format */
+int mp_to_unsigned_bin (mp_int * a, unsigned char *b)
+{
+  fp_to_unsigned_bin(a,b);
+  return MP_OKAY;
+}
+
+/* reads a unsigned char array, assumes the msb is stored first [big endian] */
+int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c)
+{
+  fp_read_unsigned_bin(a, (unsigned char *)b, c);
+  return MP_OKAY;
+}
+
+
+int mp_sub_d(fp_int *a, fp_digit b, fp_int *c)
+{
+    fp_sub_d(a, b, c);
+    return MP_OKAY;
+}
+
+
+/* fast math conversion */
+int mp_copy(fp_int* a, fp_int* b)
+{
+    fp_copy(a, b);
+    return MP_OKAY;
+}
+
+
+/* fast math conversion */
+int mp_isodd(mp_int* a)
+{
+    return fp_isodd(a);
+}
+
+
+/* fast math conversion */
+int mp_iszero(mp_int* a)
+{
+    return fp_iszero(a);
+}
+
+
+/* fast math conversion */
+int mp_count_bits (mp_int* a)
+{
+    return fp_count_bits(a);
+}
+
+
+/* fast math wrappers */
+int mp_set_int(fp_int *a, fp_digit b)
+{
+    fp_set(a, b);
+    return MP_OKAY;
+}
+
+
+#if defined(CYASSL_KEY_GEN) || defined (HAVE_ECC)
+
+/* c = a * a (mod b) */
+int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c)
+{
+  fp_int tmp;
+  fp_zero(&tmp);
+  fp_sqr(a, &tmp);
+  return fp_mod(&tmp, b, c);
+}
+
+/* fast math conversion */
+int mp_sqrmod(mp_int *a, mp_int *b, mp_int *c)
+{
+    return fp_sqrmod(a, b, c);
+}
+
+/* fast math conversion */
+int mp_montgomery_calc_normalization(mp_int *a, mp_int *b)
+{
+    fp_montgomery_calc_normalization(a, b);
+    return MP_OKAY;
+}
+
+#endif /* CYASSL_KEYGEN || HAVE_ECC */
+
+
+#ifdef CYASSL_KEY_GEN
+
+void fp_gcd(fp_int *a, fp_int *b, fp_int *c);
+void fp_lcm(fp_int *a, fp_int *b, fp_int *c);
+int  fp_isprime(fp_int *a);
+int  fp_cnt_lsb(fp_int *a);
+
+int mp_gcd(fp_int *a, fp_int *b, fp_int *c)
+{
+    fp_gcd(a, b, c);
+    return MP_OKAY;
+}
+
+
+int mp_lcm(fp_int *a, fp_int *b, fp_int *c)
+{
+    fp_lcm(a, b, c);
+    return MP_OKAY;
+}
+
+
+int mp_prime_is_prime(mp_int* a, int t, int* result)
+{
+    (void)t;
+    *result = fp_isprime(a);
+    return MP_OKAY;
+}
+
+
+
+static int s_is_power_of_two(fp_digit b, int *p)
+{
+   int x;
+
+   /* fast return if no power of two */
+   if ((b==0) || (b & (b-1))) {
+      return 0;
+   }
+
+   for (x = 0; x < DIGIT_BIT; x++) {
+      if (b == (((fp_digit)1)<<x)) {
+         *p = x;
+         return 1;
+      }
+   }
+   return 0;
+}
+
+/* a/b => cb + d == a */
+static int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d)
+{
+  fp_int   q;
+  fp_word  w;
+  fp_digit t;
+  int      ix;
+
+  /* cannot divide by zero */
+  if (b == 0) {
+     return FP_VAL;
+  }
+
+  /* quick outs */
+  if (b == 1 || fp_iszero(a) == 1) {
+     if (d != NULL) {
+        *d = 0;
+     }
+     if (c != NULL) {
+        fp_copy(a, c);
+     }
+     return FP_OKAY;
+  }
+
+  /* power of two ? */
+  if (s_is_power_of_two(b, &ix) == 1) {
+     if (d != NULL) {
+        *d = a->dp[0] & ((((fp_digit)1)<<ix) - 1);
+     }
+     if (c != NULL) {
+        fp_div_2d(a, ix, c, NULL);
+     }
+     return FP_OKAY;
+  }
+
+  /* no easy answer [c'est la vie].  Just division */
+  fp_init(&q);
+  
+  q.used = a->used;
+  q.sign = a->sign;
+  w = 0;
+  for (ix = a->used - 1; ix >= 0; ix--) {
+     w = (w << ((fp_word)DIGIT_BIT)) | ((fp_word)a->dp[ix]);
+     
+     if (w >= b) {
+        t = (fp_digit)(w / b);
+        w -= ((fp_word)t) * ((fp_word)b);
+      } else {
+        t = 0;
+      }
+      q.dp[ix] = (fp_digit)t;
+  }
+  
+  if (d != NULL) {
+     *d = (fp_digit)w;
+  }
+  
+  if (c != NULL) {
+     fp_clamp(&q);
+     fp_copy(&q, c);
+  }
+  return FP_OKAY;
+}
+
+
+/* c = a mod b, 0 <= c < b  */
+static int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c)
+{
+   return fp_div_d(a, b, NULL, c);
+}
+
+
+/* Miller-Rabin test of "a" to the base of "b" as described in 
+ * HAC pp. 139 Algorithm 4.24
+ *
+ * Sets result to 0 if definitely composite or 1 if probably prime.
+ * Randomly the chance of error is no more than 1/4 and often 
+ * very much lower.
+ */
+static void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result)
+{
+  fp_int  n1, y, r;
+  int     s, j;
+
+  /* default */
+  *result = FP_NO;
+
+  /* ensure b > 1 */
+  if (fp_cmp_d(b, 1) != FP_GT) {
+     return;
+  }     
+
+  /* get n1 = a - 1 */
+  fp_init_copy(&n1, a);
+  fp_sub_d(&n1, 1, &n1);
+
+  /* set 2**s * r = n1 */
+  fp_init_copy(&r, &n1);
+
+  /* count the number of least significant bits
+   * which are zero
+   */
+  s = fp_cnt_lsb(&r);
+
+  /* now divide n - 1 by 2**s */
+  fp_div_2d (&r, s, &r, NULL);
+
+  /* compute y = b**r mod a */
+  fp_init(&y);
+  fp_exptmod(b, &r, a, &y);
+
+  /* if y != 1 and y != n1 do */
+  if (fp_cmp_d (&y, 1) != FP_EQ && fp_cmp (&y, &n1) != FP_EQ) {
+    j = 1;
+    /* while j <= s-1 and y != n1 */
+    while ((j <= (s - 1)) && fp_cmp (&y, &n1) != FP_EQ) {
+      fp_sqrmod (&y, a, &y);
+
+      /* if y == 1 then composite */
+      if (fp_cmp_d (&y, 1) == FP_EQ) {
+         return;
+      }
+      ++j;
+    }
+
+    /* if y != n1 then composite */
+    if (fp_cmp (&y, &n1) != FP_EQ) {
+       return;
+    }
+  }
+
+  /* probably prime now */
+  *result = FP_YES;
+}
+
+
+/* a few primes */
+static const fp_digit primes[256] = {
+  0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
+  0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
+  0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
+  0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F, 0x0083,
+  0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD,
+  0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF,
+  0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107,
+  0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137,
+
+  0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167,
+  0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199,
+  0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9,
+  0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7,
+  0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239,
+  0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265,
+  0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293,
+  0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF,
+
+  0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301,
+  0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B,
+  0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371,
+  0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD,
+  0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5,
+  0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419,
+  0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449,
+  0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B,
+
+  0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7,
+  0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503,
+  0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529,
+  0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F,
+  0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3,
+  0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7,
+  0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623,
+  0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653
+};
+
+int fp_isprime(fp_int *a)
+{
+   fp_int   b;
+   fp_digit d = 0;
+   int      r, res;
+
+   /* do trial division */
+   for (r = 0; r < 256; r++) {
+       fp_mod_d(a, primes[r], &d);
+       if (d == 0) {
+          return FP_NO;
+       }
+   }
+
+   /* now do 8 miller rabins */
+   fp_init(&b);
+   for (r = 0; r < 8; r++) {
+       fp_set(&b, primes[r]);
+       fp_prime_miller_rabin(a, &b, &res);
+       if (res == FP_NO) {
+          return FP_NO;
+       }
+   }
+   return FP_YES;
+}
+
+
+/* c = [a, b] */
+void fp_lcm(fp_int *a, fp_int *b, fp_int *c)
+{
+   fp_int  t1, t2;
+
+   fp_init(&t1);
+   fp_init(&t2);
+   fp_gcd(a, b, &t1);
+   if (fp_cmp_mag(a, b) == FP_GT) {
+      fp_div(a, &t1, &t2, NULL);
+      fp_mul(b, &t2, c);
+   } else {
+      fp_div(b, &t1, &t2, NULL);
+      fp_mul(a, &t2, c);
+   }   
+}
+
+
+static const int lnz[16] = {
+   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
+};
+
+/* Counts the number of lsbs which are zero before the first zero bit */
+int fp_cnt_lsb(fp_int *a)
+{
+   int x;
+   fp_digit q, qq;
+
+   /* easy out */
+   if (fp_iszero(a) == 1) {
+      return 0;
+   }
+
+   /* scan lower digits until non-zero */
+   for (x = 0; x < a->used && a->dp[x] == 0; x++);
+   q = a->dp[x];
+   x *= DIGIT_BIT;
+
+   /* now scan this digit until a 1 is found */
+   if ((q & 1) == 0) {
+      do {
+         qq  = q & 15;
+         x  += lnz[qq];
+         q >>= 4;
+      } while (qq == 0);
+   }
+   return x;
+}
+
+
+/* c = (a, b) */
+void fp_gcd(fp_int *a, fp_int *b, fp_int *c)
+{
+   fp_int u, v, r;
+
+   /* either zero than gcd is the largest */
+   if (fp_iszero (a) == 1 && fp_iszero (b) == 0) {
+     fp_abs (b, c);
+     return;
+   }
+   if (fp_iszero (a) == 0 && fp_iszero (b) == 1) {
+     fp_abs (a, c);
+     return;
+   }
+
+   /* optimized.  At this point if a == 0 then
+    * b must equal zero too
+    */
+   if (fp_iszero (a) == 1) {
+     fp_zero(c);
+     return;
+   }
+
+   /* sort inputs */
+   if (fp_cmp_mag(a, b) != FP_LT) {
+      fp_init_copy(&u, a);
+      fp_init_copy(&v, b);
+   } else {
+      fp_init_copy(&u, b);
+      fp_init_copy(&v, a);
+   }
+   fp_zero(&r);
+   while (fp_iszero(&v) == FP_NO) {
+      fp_mod(&u, &v, &r);
+      fp_copy(&v, &u);
+      fp_copy(&r, &v);
+   }
+   fp_copy(&u, c);
+}
+
+#endif /* CYASSL_KEY_GEN */
+
+
+#if defined(HAVE_ECC) || !defined(NO_PWDBASED)
+/* c = a + b */
+void fp_add_d(fp_int *a, fp_digit b, fp_int *c)
+{
+   fp_int tmp;
+   fp_set(&tmp, b);
+   fp_add(a,&tmp,c);
+}
+
+/* external compatibility */
+int mp_add_d(fp_int *a, fp_digit b, fp_int *c)
+{
+    fp_add_d(a, b, c);
+    return MP_OKAY;
+}
+
+#endif  /* HAVE_ECC || !NO_PWDBASED */
+
+
+#ifdef HAVE_ECC
+
+/* chars used in radix conversions */
+const char *fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
+
+static int fp_read_radix(fp_int *a, const char *str, int radix)
+{
+  int     y, neg;
+  char    ch;
+
+  /* make sure the radix is ok */
+  if (radix < 2 || radix > 64) {
+    return FP_VAL;
+  }
+
+  /* if the leading digit is a
+   * minus set the sign to negative.
+   */
+  if (*str == '-') {
+    ++str;
+    neg = FP_NEG;
+  } else {
+    neg = FP_ZPOS;
+  }
+
+  /* set the integer to the default of zero */
+  fp_zero (a);
+
+  /* process each digit of the string */
+  while (*str) {
+    /* if the radix < 36 the conversion is case insensitive
+     * this allows numbers like 1AB and 1ab to represent the same  value
+     * [e.g. in hex]
+     */
+    ch = (char) ((radix < 36) ? XTOUPPER(*str) : *str);
+    for (y = 0; y < 64; y++) {
+      if (ch == fp_s_rmap[y]) {
+         break;
+      }
+    }
+
+    /* if the char was found in the map
+     * and is less than the given radix add it
+     * to the number, otherwise exit the loop.
+     */
+    if (y < radix) {
+      fp_mul_d (a, (fp_digit) radix, a);
+      fp_add_d (a, (fp_digit) y, a);
+    } else {
+      break;
+    }
+    ++str;
+  }
+
+  /* set the sign only if a != 0 */
+  if (fp_iszero(a) != FP_YES) {
+     a->sign = neg;
+  }
+  return FP_OKAY;
+}
+
+/* fast math conversion */
+int mp_read_radix(mp_int *a, const char *str, int radix)
+{
+    return fp_read_radix(a, str, radix);
+}
+
+/* fast math conversion */
+int mp_set(fp_int *a, fp_digit b)
+{
+    fp_set(a,b);
+    return MP_OKAY;
+}
+
+/* fast math conversion */
+int mp_sqr(fp_int *A, fp_int *B)
+{
+    fp_sqr(A, B);
+    return MP_OKAY;
+}
+  
+/* fast math conversion */
+int mp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp)
+{
+    fp_montgomery_reduce(a, m, mp);
+    return MP_OKAY;
+}
+
+
+/* fast math conversion */
+int mp_montgomery_setup(fp_int *a, fp_digit *rho)
+{
+    return fp_montgomery_setup(a, rho);
+}
+
+int mp_div_2(fp_int * a, fp_int * b)
+{
+    fp_div_2(a, b);
+    return MP_OKAY;
+}
+
+
+int mp_init_copy(fp_int * a, fp_int * b)
+{
+    fp_init_copy(a, b);
+    return MP_OKAY;
+}
+
+
+
+#endif /* HAVE_ECC */
+
+#endif /* USE_FAST_MATH */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/include.am b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/include.am
new file mode 100644 (file)
index 0000000..9c876c9
--- /dev/null
@@ -0,0 +1,9 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+noinst_PROGRAMS+= ctaocrypt/test/testctaocrypt
+ctaocrypt_test_testctaocrypt_SOURCES      = ctaocrypt/test/test.c
+ctaocrypt_test_testctaocrypt_LDADD        = src/libcyassl.la
+ctaocrypt_test_testctaocrypt_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += ctaocrypt/test/test.sln
+EXTRA_DIST += ctaocrypt/test/test.vcproj
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.c b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.c
new file mode 100644 (file)
index 0000000..ddb3e01
--- /dev/null
@@ -0,0 +1,2276 @@
+/* test.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef CYASSL_TEST_CERT
+    #include <cyassl/ctaocrypt/asn.h>
+#else
+    #include <cyassl/ctaocrypt/asn_public.h>
+#endif
+#include <cyassl/ctaocrypt/md2.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/md4.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/sha256.h>
+#include <cyassl/ctaocrypt/sha512.h>
+#include <cyassl/ctaocrypt/arc4.h>
+#include <cyassl/ctaocrypt/random.h>
+#include <cyassl/ctaocrypt/coding.h>
+#include <cyassl/ctaocrypt/rsa.h>
+#include <cyassl/ctaocrypt/des3.h>
+#include <cyassl/ctaocrypt/aes.h>
+#include <cyassl/ctaocrypt/hmac.h>
+#include <cyassl/ctaocrypt/dh.h>
+#include <cyassl/ctaocrypt/dsa.h>
+#include <cyassl/ctaocrypt/hc128.h>
+#include <cyassl/ctaocrypt/rabbit.h>
+#include <cyassl/ctaocrypt/pwdbased.h>
+#include <cyassl/ctaocrypt/ripemd.h>
+#ifdef HAVE_ECC
+    #include <cyassl/ctaocrypt/ecc.h>
+#endif    
+
+#ifdef _MSC_VER
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
+    #pragma warning(disable: 4996)
+#endif
+
+#ifdef OPENSSL_EXTRA
+    #include <cyassl/openssl/evp.h>
+    #include <cyassl/openssl/rand.h>
+    #include <cyassl/openssl/hmac.h>
+    #include <cyassl/openssl/des.h>
+#endif
+
+#ifdef HAVE_NTRU
+    #include "crypto_ntru.h"
+#endif
+
+
+#ifdef THREADX
+    /* since just testing, use THREADX log printf instead */
+    int dc_log_printf(char*, ...);
+        #undef printf
+        #define printf dc_log_printf
+#endif
+
+
+typedef struct testVector {
+    char*  input;
+    char*  output; 
+    size_t inLen;
+    size_t outLen;
+} testVector;
+
+int  md2_test();
+int  md5_test();
+int  md4_test();
+int  sha_test();
+int  sha256_test();
+int  sha512_test();
+int  sha384_test();
+int  hmac_test();
+int  arc4_test();
+int  hc128_test();
+int  rabbit_test();
+int  des_test();
+int  des3_test();
+int  aes_test();
+int  aesgcm_test();
+int  rsa_test();
+int  dh_test();
+int  dsa_test();
+int  random_test();
+int  pwdbased_test();
+int  ripemd_test();
+int  openssl_test();   /* test mini api */
+#ifdef HAVE_ECC
+    int  ecc_test();
+#endif
+
+int PemToDer(const char* inName, const char* outName);
+
+
+void err_sys(const char* msg, int es)
+{
+    printf("%s error = %d\n", msg, es);
+#ifndef THREADX
+    exit(es);
+#endif
+}
+
+/* func_args from test.h, so don't have to pull in other junk */
+typedef struct func_args {
+    int    argc;
+    char** argv;
+    int    return_code;
+} func_args;
+
+
+void ctaocrypt_test(void* args)
+{
+    int ret = 0;
+
+    ((func_args*)args)->return_code = -1; /* error state */
+
+    if (CheckCtcSettings() != 1)
+        err_sys("Build vs runtime math mismatch\n", -1234);
+
+#ifdef USE_FAST_MATH
+    if (CheckFastMathSettings() != 1)
+        err_sys("Build vs runtime fastmath FP_MAX_BITS mismatch\n", -1235);
+#endif
+    
+    if ( (ret = md5_test()) ) 
+        err_sys("MD5      test failed!\n", ret);
+    else
+        printf( "MD5      test passed!\n");
+
+#ifdef CYASSL_MD2
+    if ( (ret = md2_test()) ) 
+        err_sys("MD2      test failed!\n", ret);
+    else
+        printf( "MD2      test passed!\n");
+#endif
+
+#ifndef NO_MD4
+    if ( (ret = md4_test()) ) 
+        err_sys("MD4      test failed!\n", ret);
+    else
+        printf( "MD4      test passed!\n");
+#endif
+
+    if ( (ret = sha_test()) ) 
+        err_sys("SHA      test failed!\n", ret);
+    else
+        printf( "SHA      test passed!\n");
+
+#ifndef NO_SHA256
+    if ( (ret = sha256_test()) ) 
+        err_sys("SHA-256  test failed!\n", ret);
+    else
+        printf( "SHA-256  test passed!\n");
+#endif
+
+#ifdef CYASSL_SHA384
+    if ( (ret = sha384_test()) ) 
+        err_sys("SHA-384  test failed!\n", ret);
+    else
+        printf( "SHA-384  test passed!\n");
+#endif
+
+#ifdef CYASSL_SHA512
+    if ( (ret = sha512_test()) ) 
+        err_sys("SHA-512  test failed!\n", ret);
+    else
+        printf( "SHA-512  test passed!\n");
+#endif
+
+#ifdef CYASSL_RIPEMD
+    if ( (ret = ripemd_test()) ) 
+        err_sys("RIPEMD   test failed!\n", ret);
+    else
+        printf( "RIPEMD   test passed!\n");
+#endif
+
+#ifndef NO_HMAC
+    if ( (ret = hmac_test()) ) 
+        err_sys("HMAC     test failed!\n", ret);
+    else
+        printf( "HMAC     test passed!\n");
+#endif
+
+    if ( (ret = arc4_test()) )
+        err_sys("ARC4     test failed!\n", ret);
+    else
+        printf( "ARC4     test passed!\n");
+
+#ifndef NO_HC128
+    if ( (ret = hc128_test()) )
+        err_sys("HC-128   test failed!\n", ret);
+    else
+        printf( "HC-128   test passed!\n");
+#endif
+
+#ifndef NO_RABBIT
+    if ( (ret = rabbit_test()) )
+        err_sys("Rabbit   test failed!\n", ret);
+    else
+        printf( "Rabbit   test passed!\n");
+#endif
+
+#ifndef NO_DES3
+    if ( (ret = des_test()) )
+        err_sys("DES      test failed!\n", ret);
+    else
+        printf( "DES      test passed!\n");
+#endif
+
+#ifndef NO_DES3
+    if ( (ret = des3_test()) )
+        err_sys("DES3     test failed!\n", ret);
+    else
+        printf( "DES3     test passed!\n");
+#endif
+
+#ifndef NO_AES
+    if ( (ret = aes_test()) )
+        err_sys("AES      test failed!\n", ret);
+    else
+        printf( "AES      test passed!\n");
+
+#ifdef HAVE_AESGCM
+    if ( (ret = aesgcm_test()) )
+        err_sys("AES-GCM  test failed!\n", ret);
+    else
+        printf( "AES-GCM  test passed!\n");
+#endif
+#endif
+
+    if ( (ret = random_test()) )
+        err_sys("RANDOM   test failed!\n", ret);
+    else
+        printf( "RANDOM   test passed!\n");
+
+    if ( (ret = rsa_test()) ) 
+        err_sys("RSA      test failed!\n", ret);
+    else
+        printf( "RSA      test passed!\n");
+
+#ifndef NO_DH
+    if ( (ret = dh_test()) ) 
+        err_sys("DH       test failed!\n", ret);
+    else
+        printf( "DH       test passed!\n");
+#endif
+
+#ifndef NO_DSA
+    if ( (ret = dsa_test()) ) 
+        err_sys("DSA      test failed!\n", ret);
+    else
+        printf( "DSA      test passed!\n");
+#endif
+    
+#ifndef NO_PWDBASED
+    if ( (ret = pwdbased_test()) ) 
+        err_sys("PWDBASED test failed!\n", ret);
+    else
+        printf( "PWDBASED test passed!\n");
+#endif
+    
+#ifdef OPENSSL_EXTRA
+    if ( (ret = openssl_test()) ) 
+        err_sys("OPENSSL  test failed!\n", ret);
+    else
+        printf( "OPENSSL  test passed!\n");
+#endif
+
+#ifdef HAVE_ECC
+    if ( (ret = ecc_test()) ) 
+        err_sys("ECC      test failed!\n", ret);
+    else
+        printf( "ECC      test passed!\n");
+#endif
+
+    ((func_args*)args)->return_code = ret;
+}
+
+
+/* so overall tests can pull in test function */
+#ifndef NO_MAIN_DRIVER
+
+    int main(int argc, char** argv)
+    {
+        func_args args;
+
+        args.argc = argc;
+        args.argv = argv;
+
+        ctaocrypt_test(&args);
+        return args.return_code;
+    }
+
+#endif /* NO_MAIN_DRIVER */
+
+
+#ifdef CYASSL_MD2
+int md2_test()
+{
+    Md2  md2;
+    byte hash[MD2_DIGEST_SIZE];
+
+    testVector a, b, c, d, e, f, g;
+    testVector test_md2[7];
+    int times = sizeof(test_md2) / sizeof(testVector), i;
+
+    a.input  = "";
+    a.output = "\x83\x50\xe5\xa3\xe2\x4c\x15\x3d\xf2\x27\x5c\x9f\x80\x69"
+               "\x27\x73";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "a";
+    b.output = "\x32\xec\x01\xec\x4a\x6d\xac\x72\xc0\xab\x96\xfb\x34\xc0"
+               "\xb5\xd1";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abc";
+    c.output = "\xda\x85\x3b\x0d\x3f\x88\xd9\x9b\x30\x28\x3a\x69\xe6\xde"
+               "\xd6\xbb";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "message digest";
+    d.output = "\xab\x4f\x49\x6b\xfb\x2a\x53\x0b\x21\x9f\xf3\x30\x31\xfe"
+               "\x06\xb0";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    e.input  = "abcdefghijklmnopqrstuvwxyz";
+    e.output = "\x4e\x8d\xdf\xf3\x65\x02\x92\xab\x5a\x41\x08\xc3\xaa\x47"
+               "\x94\x0b";
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    f.input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345"
+               "6789";
+    f.output = "\xda\x33\xde\xf2\xa4\x2d\xf1\x39\x75\x35\x28\x46\xc3\x03"
+               "\x38\xcd";
+    f.inLen  = strlen(f.input);
+    f.outLen = strlen(f.output);
+
+    g.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    g.output = "\xd5\x97\x6f\x79\xd8\x3d\x3a\x0d\xc9\x80\x6c\x3c\x66\xf3"
+               "\xef\xd8";
+    g.inLen  = strlen(g.input);
+    g.outLen = strlen(g.output);
+
+    test_md2[0] = a;
+    test_md2[1] = b;
+    test_md2[2] = c;
+    test_md2[3] = d;
+    test_md2[4] = e;
+    test_md2[5] = f;
+    test_md2[6] = g;
+
+    InitMd2(&md2);
+
+    for (i = 0; i < times; ++i) {
+        Md2Update(&md2, (byte*)test_md2[i].input, (word32)test_md2[i].inLen);
+        Md2Final(&md2, hash);
+
+        if (memcmp(hash, test_md2[i].output, MD2_DIGEST_SIZE) != 0)
+            return -155 - i;
+    }
+
+    return 0;
+}
+#endif 
+
+
+int md5_test()
+{
+    Md5  md5;
+    byte hash[MD5_DIGEST_SIZE];
+
+    testVector a, b, c, d, e;
+    testVector test_md5[5];
+    int times = sizeof(test_md5) / sizeof(testVector), i;
+
+    a.input  = "abc";
+    a.output = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f"
+               "\x72";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "message digest";
+    b.output = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d\x52\x5a\x2f\x31\xaa\xf1\x61"
+               "\xd0";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abcdefghijklmnopqrstuvwxyz";
+    c.output = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1"
+               "\x3b";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345"
+               "6789";
+    d.output = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d"
+               "\x9f";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    e.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    e.output = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6"
+               "\x7a";
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    test_md5[0] = a;
+    test_md5[1] = b;
+    test_md5[2] = c;
+    test_md5[3] = d;
+    test_md5[4] = e;
+
+    InitMd5(&md5);
+
+    for (i = 0; i < times; ++i) {
+        Md5Update(&md5, (byte*)test_md5[i].input, (word32)test_md5[i].inLen);
+        Md5Final(&md5, hash);
+
+        if (memcmp(hash, test_md5[i].output, MD5_DIGEST_SIZE) != 0)
+            return -5 - i;
+    }
+
+    return 0;
+}
+
+
+#ifndef NO_MD4
+
+int md4_test()
+{
+    Md4  md4;
+    byte hash[MD4_DIGEST_SIZE];
+
+    testVector a, b, c, d, e, f, g;
+    testVector test_md4[7];
+    int times = sizeof(test_md4) / sizeof(testVector), i;
+
+    a.input  = "";
+    a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" 
+               "\xc0";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "a";
+    b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" 
+               "\x24";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abc";
+    c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" 
+               "\x9d";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "message digest";
+    d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" 
+               "\x4b";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    e.input  = "abcdefghijklmnopqrstuvwxyz";
+    e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" 
+               "\xa9";
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    f.input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345"
+               "6789";
+    f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" 
+               "\xe4";
+    f.inLen  = strlen(f.input);
+    f.outLen = strlen(f.output);
+
+    g.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" 
+               "\x36";
+    g.inLen  = strlen(g.input);
+    g.outLen = strlen(g.output);
+
+    test_md4[0] = a;
+    test_md4[1] = b;
+    test_md4[2] = c;
+    test_md4[3] = d;
+    test_md4[4] = e;
+    test_md4[5] = f;
+    test_md4[6] = g;
+
+    InitMd4(&md4);
+
+    for (i = 0; i < times; ++i) {
+        Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
+        Md4Final(&md4, hash);
+
+        if (memcmp(hash, test_md4[i].output, MD4_DIGEST_SIZE) != 0)
+            return -205 - i;
+    }
+
+    return 0;
+}
+
+#endif /* NO_MD4 */
+
+int sha_test()
+{
+    Sha  sha;
+    byte hash[SHA_DIGEST_SIZE];
+
+    testVector a, b, c, d;
+    testVector test_sha[4];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2"
+               "\x6C\x9C\xD0\xD8\x9D";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+    b.output = "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29"
+               "\xE5\xE5\x46\x70\xF1";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaa";
+    c.output = "\x00\x98\xBA\x82\x4B\x5C\x16\x42\x7B\xD7\xA1\x12\x2A\x5A\x44"
+               "\x2A\x25\xEC\x64\x4D";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaa";
+    d.output = "\xAD\x5B\x3F\xDB\xCB\x52\x67\x78\xC2\x83\x9D\x2F\x15\x1E\xA7"
+               "\x53\x99\x5E\x26\xA0";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+    test_sha[2] = c;
+    test_sha[3] = d;
+
+    InitSha(&sha);
+
+    for (i = 0; i < times; ++i) {
+        ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen);
+        ShaFinal(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+
+
+#ifdef CYASSL_RIPEMD
+int ripemd_test()
+{
+    RipeMd  ripemd;
+    byte hash[RIPEMD_DIGEST_SIZE];
+
+    testVector a, b, c, d;
+    testVector test_ripemd[4];
+    int times = sizeof(test_ripemd) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04\x4a\x8e\x98\xc6"
+               "\xb0\x87\xf1\x5a\x0b\xfc";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "message digest";
+    b.output = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8\x81\xb1\x23\xa8"
+               "\x5f\xfa\x21\x59\x5f\x36";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; 
+    c.output = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05\xa0\x6c\x27\xdc"
+               "\xf4\x9a\xda\x62\xeb\x2b";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "12345678901234567890123456789012345678901234567890123456"
+               "789012345678901234567890";
+    d.output = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb\xd3\x32\x3c\xab"
+               "\x82\xbf\x63\x32\x6b\xfb"; 
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_ripemd[0] = a;
+    test_ripemd[1] = b;
+    test_ripemd[2] = c;
+    test_ripemd[3] = d;
+
+    InitRipeMd(&ripemd);
+
+    for (i = 0; i < times; ++i) {
+        RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
+                     (word32)test_ripemd[i].inLen);
+        RipeMdFinal(&ripemd, hash);
+
+        if (memcmp(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif /* CYASSL_RIPEMD */
+
+
+#ifndef NO_SHA256
+int sha256_test()
+{
+    Sha256 sha;
+    byte   hash[SHA256_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xBA\x78\x16\xBF\x8F\x01\xCF\xEA\x41\x41\x40\xDE\x5D\xAE\x22"
+               "\x23\xB0\x03\x61\xA3\x96\x17\x7A\x9C\xB4\x10\xFF\x61\xF2\x00"
+               "\x15\xAD";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+    b.output = "\x24\x8D\x6A\x61\xD2\x06\x38\xB8\xE5\xC0\x26\x93\x0C\x3E\x60"
+               "\x39\xA3\x3C\xE4\x59\x64\xFF\x21\x67\xF6\xEC\xED\xD4\x19\xDB"
+               "\x06\xC1";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha256(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha256Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA256_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif
+
+
+#ifdef CYASSL_SHA512
+int sha512_test()
+{
+    Sha512 sha;
+    byte   hash[SHA512_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41"
+               "\x31\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55"
+               "\xd3\x9a\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3"
+               "\xfe\xeb\xbd\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f"
+               "\xa5\x4c\xa4\x9f";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    b.output = "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14"
+               "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88"
+               "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4"
+               "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b"
+               "\x87\x4b\xe9\x09"; 
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha512(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha512Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA512_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif
+
+
+#ifdef CYASSL_SHA384
+int sha384_test()
+{
+    Sha384 sha;
+    byte   hash[SHA384_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b\xb5\xa0\x3d\x69\x9a\xc6\x50"
+               "\x07\x27\x2c\x32\xab\x0e\xde\xd1\x63\x1a\x8b\x60\x5a\x43\xff"
+               "\x5b\xed\x80\x86\x07\x2b\xa1\xe7\xcc\x23\x58\xba\xec\xa1\x34"
+               "\xc8\x25\xa7";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    b.output = "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b"
+               "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0"
+               "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91"
+               "\x74\x60\x39";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha384(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha384Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA384_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif /* CYASSL_SHA384 */
+
+
+#ifndef NO_HMAC
+int hmac_test()
+{
+    Hmac hmac;
+    byte hash[MD5_DIGEST_SIZE];
+
+    const char* keys[]=
+    {
+        "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+        "Jefe",
+        "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
+    };
+
+    testVector a, b, c;
+    testVector test_hmac[3];
+
+    int times = sizeof(test_hmac) / sizeof(testVector), i;
+
+    a.input  = "Hi There";
+    a.output = "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc"
+               "\x9d";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "what do ya want for nothing?";
+    b.output = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7"
+               "\x38";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD";
+    c.output = "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3"
+               "\xf6";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    test_hmac[0] = a;
+    test_hmac[1] = b;
+    test_hmac[2] = c;
+
+    for (i = 0; i < times; ++i) {
+        HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i]));
+        HmacUpdate(&hmac, (byte*)test_hmac[i].input,
+                   (word32)test_hmac[i].inLen);
+        HmacFinal(&hmac, hash);
+
+        if (memcmp(hash, test_hmac[i].output, MD5_DIGEST_SIZE) != 0)
+            return -20 - i;
+    }
+
+    return 0;
+}
+#endif
+
+
+int arc4_test()
+{
+    byte cipher[16];
+    byte plain[16];
+
+    const char* keys[] = 
+    {           
+        "\x01\x23\x45\x67\x89\xab\xcd\xef",
+        "\x01\x23\x45\x67\x89\xab\xcd\xef",
+        "\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\xef\x01\x23\x45"
+    };
+
+    testVector a, b, c, d;
+    testVector test_arc4[4];
+
+    int times = sizeof(test_arc4) / sizeof(testVector), i;
+
+    a.input  = "\x01\x23\x45\x67\x89\xab\xcd\xef";
+    a.output = "\x75\xb7\x87\x80\x99\xe0\xc5\x96";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    b.output = "\x74\x94\xc2\xe7\x10\x4b\x08\x79";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    c.output = "\xde\x18\x89\x41\xa3\x37\x5d\x3a";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
+    d.output = "\xd6\xa1\x41\xa7\xec\x3c\x38\xdf\xbd\x61";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_arc4[0] = a;
+    test_arc4[1] = b;
+    test_arc4[2] = c;
+    test_arc4[3] = d;
+
+    for (i = 0; i < times; ++i) {
+        Arc4 enc;
+        Arc4 dec;
+
+        Arc4SetKey(&enc, (byte*)keys[i], (word32)strlen(keys[i]));
+        Arc4SetKey(&dec, (byte*)keys[i], (word32)strlen(keys[i]));
+
+        Arc4Process(&enc, cipher, (byte*)test_arc4[i].input,
+                    (word32)test_arc4[i].outLen);
+        Arc4Process(&dec, plain,  cipher, (word32)test_arc4[i].outLen);
+
+        if (memcmp(plain, test_arc4[i].input, test_arc4[i].outLen))
+            return -20 - i;
+
+        if (memcmp(cipher, test_arc4[i].output, test_arc4[i].outLen))
+            return -20 - 5 - i;
+    }
+
+    return 0;
+}
+
+
+int hc128_test()
+{
+#ifdef HAVE_HC128
+    byte cipher[16];
+    byte plain[16];
+
+    const char* keys[] = 
+    {           
+        "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD",
+        "\x0F\x62\xB5\x08\x5B\xAE\x01\x54\xA7\xFA\x4D\xA0\xF3\x46\x99\xEC"
+    };
+
+    const char* ivs[] =
+    {
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x0D\x74\xDB\x42\xA9\x10\x77\xDE\x45\xAC\x13\x7A\xE1\x48\xAF\x16",
+        "\x28\x8F\xF6\x5D\xC4\x2B\x92\xF9\x60\xC7\x2E\x95\xFC\x63\xCA\x31"
+    };
+
+
+    testVector a, b, c, d;
+    testVector test_hc128[4];
+
+    int times = sizeof(test_hc128) / sizeof(testVector), i;
+
+    a.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    a.output = "\x37\x86\x02\xB9\x8F\x32\xA7\x48";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    b.output = "\x33\x7F\x86\x11\xC6\xED\x61\x5F";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    c.output = "\x2E\x1E\xD1\x2A\x85\x51\xC0\x5A";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
+    d.output = "\x1C\xD8\xAE\xDD\xFE\x52\xE2\x17\xE8\x35\xD0\xB7\xE8\x4E\x29";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_hc128[0] = a;
+    test_hc128[1] = b;
+    test_hc128[2] = c;
+    test_hc128[3] = d;
+
+    for (i = 0; i < times; ++i) {
+        HC128 enc;
+        HC128 dec;
+
+        Hc128_SetKey(&enc, (byte*)keys[i], (byte*)ivs[i]);
+        Hc128_SetKey(&dec, (byte*)keys[i], (byte*)ivs[i]);
+
+        Hc128_Process(&enc, cipher, (byte*)test_hc128[i].input,
+                    (word32)test_hc128[i].outLen);
+        Hc128_Process(&dec, plain,  cipher, (word32)test_hc128[i].outLen);
+
+        if (memcmp(plain, test_hc128[i].input, test_hc128[i].outLen))
+            return -120 - i;
+
+        if (memcmp(cipher, test_hc128[i].output, test_hc128[i].outLen))
+            return -120 - 5 - i;
+    }
+
+#endif /* HAVE_HC128 */
+    return 0;
+}
+
+
+#ifndef NO_RABBIT
+int rabbit_test()
+{
+    byte cipher[16];
+    byte plain[16];
+
+    const char* keys[] = 
+    {           
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\xAC\xC3\x51\xDC\xF1\x62\xFC\x3B\xFE\x36\x3D\x2E\x29\x13\x28\x91"
+    };
+
+    const char* ivs[] =
+    {
+        "\x00\x00\x00\x00\x00\x00\x00\x00",
+        "\x59\x7E\x26\xC1\x75\xF5\x73\xC3",
+        0
+    };
+
+
+    testVector a, b, c;
+    testVector test_rabbit[3];
+
+    int times = sizeof(test_rabbit) / sizeof(testVector), i;
+
+    a.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    a.output = "\xED\xB7\x05\x67\x37\x5D\xCD\x7C";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    b.output = "\x6D\x7D\x01\x22\x92\xCC\xDC\xE0";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "\x00\x00\x00\x00\x00\x00\x00\x00";
+    c.output = "\x9C\x51\xE2\x87\x84\xC3\x7F\xE9";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    test_rabbit[0] = a;
+    test_rabbit[1] = b;
+    test_rabbit[2] = c;
+
+    for (i = 0; i < times; ++i) {
+        Rabbit enc;
+        Rabbit dec;
+
+        RabbitSetKey(&enc, (byte*)keys[i], (byte*)ivs[i]);
+        RabbitSetKey(&dec, (byte*)keys[i], (byte*)ivs[i]);
+
+        RabbitProcess(&enc, cipher, (byte*)test_rabbit[i].input,
+                    (word32)test_rabbit[i].outLen);
+        RabbitProcess(&dec, plain,  cipher, (word32)test_rabbit[i].outLen);
+
+        if (memcmp(plain, test_rabbit[i].input, test_rabbit[i].outLen))
+            return -130 - i;
+
+        if (memcmp(cipher, test_rabbit[i].output, test_rabbit[i].outLen))
+            return -130 - 5 - i;
+    }
+
+    return 0;
+}
+#endif /* NO_RABBIT */
+
+
+#ifndef NO_DES3
+int des_test()
+{
+    const byte vector[] = { /* "now is the time for all " w/o trailing 0 */
+        0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,
+        0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20,
+        0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
+    };
+
+    byte plain[24];
+    byte cipher[24];
+
+    Des enc;
+    Des dec;
+
+    const byte key[] = 
+    {
+        0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef
+    };
+
+    const byte iv[] = 
+    {
+        0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef
+    };
+
+    const byte verify[] = 
+    {
+        0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8,
+        0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73,
+        0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b
+    };
+
+
+    Des_SetKey(&enc, key, iv, DES_ENCRYPTION);
+    Des_CbcEncrypt(&enc, cipher, vector, sizeof(vector));
+    Des_SetKey(&dec, key, iv, DES_DECRYPTION);
+    Des_CbcDecrypt(&dec, plain, cipher, sizeof(cipher));
+
+    if (memcmp(plain, vector, sizeof(plain)))
+        return -31;
+
+    if (memcmp(cipher, verify, sizeof(cipher)))
+        return -32;
+
+    return 0;
+}
+#endif /* NO_DES3 */
+
+
+#ifndef NO_DES3
+int des3_test()
+{
+    const byte vector[] = { /* "Now is the time for all " w/o trailing 0 */
+        0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,
+        0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20,
+        0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
+    };
+
+    byte plain[24];
+    byte cipher[24];
+
+    Des3 enc;
+    Des3 dec;
+
+    const byte key3[] = 
+    {
+        0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
+        0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10,
+        0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67
+    };
+    const byte iv3[] = 
+    {
+        0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef,
+        0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
+        0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81
+        
+    };
+
+    const byte verify3[] = 
+    {
+        0x43,0xa0,0x29,0x7e,0xd1,0x84,0xf8,0x0e,
+        0x89,0x64,0x84,0x32,0x12,0xd5,0x08,0x98,
+        0x18,0x94,0x15,0x74,0x87,0x12,0x7d,0xb0
+    };
+
+
+    Des3_SetKey(&enc, key3, iv3, DES_ENCRYPTION);
+    Des3_CbcEncrypt(&enc, cipher, vector, sizeof(vector));
+    Des3_SetKey(&dec, key3, iv3, DES_DECRYPTION);
+    Des3_CbcDecrypt(&dec, plain, cipher, sizeof(cipher));
+
+    if (memcmp(plain, vector, sizeof(plain)))
+        return -33;
+
+    if (memcmp(cipher, verify3, sizeof(cipher)))
+        return -34;
+
+    return 0;
+}
+#endif /* NO_DES */
+
+
+#ifndef NO_AES
+int aes_test()
+{
+    Aes enc;
+    Aes dec;
+
+    const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */
+        0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,
+        0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20,
+        0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
+    };
+
+    const byte verify[] = 
+    {
+        0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53,
+        0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb
+    };
+
+    byte key[] = "0123456789abcdef   ";  /* align */
+    byte iv[]  = "1234567890abcdef   ";  /* align */
+
+    byte cipher[AES_BLOCK_SIZE * 4];
+    byte plain [AES_BLOCK_SIZE * 4];
+
+    AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION);
+    AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION);
+
+    AesCbcEncrypt(&enc, cipher, msg,   AES_BLOCK_SIZE);
+    AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE);
+
+    if (memcmp(plain, msg, AES_BLOCK_SIZE))
+        return -60;
+
+    if (memcmp(cipher, verify, AES_BLOCK_SIZE))
+        return -61;
+
+#ifdef CYASSL_AES_COUNTER
+    {
+        const byte ctrKey[] = 
+        {
+            0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6,
+            0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c
+        };
+
+        const byte ctrIv[] =
+        {
+            0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,
+            0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
+        };
+
+
+        const byte ctrPlain[] =
+        {
+            0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96,
+            0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a,
+            0xae,0x2d,0x8a,0x57,0x1e,0x03,0xac,0x9c,
+            0x9e,0xb7,0x6f,0xac,0x45,0xaf,0x8e,0x51,
+            0x30,0xc8,0x1c,0x46,0xa3,0x5c,0xe4,0x11,
+            0xe5,0xfb,0xc1,0x19,0x1a,0x0a,0x52,0xef,
+            0xf6,0x9f,0x24,0x45,0xdf,0x4f,0x9b,0x17,
+            0xad,0x2b,0x41,0x7b,0xe6,0x6c,0x37,0x10
+        };
+
+        const byte ctrCipher[] =
+        {
+            0x87,0x4d,0x61,0x91,0xb6,0x20,0xe3,0x26,
+            0x1b,0xef,0x68,0x64,0x99,0x0d,0xb6,0xce,
+            0x98,0x06,0xf6,0x6b,0x79,0x70,0xfd,0xff,
+            0x86,0x17,0x18,0x7b,0xb9,0xff,0xfd,0xff,
+            0x5a,0xe4,0xdf,0x3e,0xdb,0xd5,0xd3,0x5e,
+            0x5b,0x4f,0x09,0x02,0x0d,0xb0,0x3e,0xab,
+            0x1e,0x03,0x1d,0xda,0x2f,0xbe,0x03,0xd1,
+            0x79,0x21,0x70,0xa0,0xf3,0x00,0x9c,0xee
+        };
+
+        AesSetKey(&enc, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION);
+        /* Ctr only uses encrypt, even on key setup */
+        AesSetKey(&dec, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION);
+
+        AesCtrEncrypt(&enc, cipher, ctrPlain, AES_BLOCK_SIZE*4);
+        AesCtrEncrypt(&dec, plain, cipher, AES_BLOCK_SIZE*4);
+
+        if (memcmp(plain, ctrPlain, AES_BLOCK_SIZE*4))
+            return -66;
+
+        if (memcmp(cipher, ctrCipher, AES_BLOCK_SIZE*4))
+            return -67;
+    }
+#endif /* CYASSL_AES_COUNTER */
+
+    return 0;
+}
+
+#ifdef HAVE_AESGCM
+int aesgcm_test()
+{
+    Aes enc;
+
+    /*
+     * This is Test Case 16 from the document Galois/
+     * Counter Mode of Operation (GCM) by McGrew and
+     * Viega.
+     */
+    const byte k[] =
+    {
+        0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+        0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
+        0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
+        0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
+    };
+
+    const byte iv[] =
+    {
+        0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
+        0xde, 0xca, 0xf8, 0x88, 0x00, 0x00, 0x00, 0x00
+    };
+    
+    const byte p[] =
+    {
+        0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
+        0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
+        0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
+        0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
+        0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
+        0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
+        0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
+        0xba, 0x63, 0x7b, 0x39
+    };
+    
+    const byte a[] =
+    {
+        0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+        0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
+        0xab, 0xad, 0xda, 0xd2
+    };
+    
+    const byte c[] =
+    {
+        0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07,
+        0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d,
+        0x64, 0x3a, 0x8c, 0xdc, 0xbf, 0xe5, 0xc0, 0xc9,
+        0x75, 0x98, 0xa2, 0xbd, 0x25, 0x55, 0xd1, 0xaa,
+        0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d,
+        0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38,
+        0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a,
+        0xbc, 0xc9, 0xf6, 0x62
+    };
+
+    const byte t[] =
+    {
+        0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68,
+        0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b
+    };
+
+    byte t2[16];
+    byte p2[60];
+    byte c2[60];
+
+    int result;
+
+    memset(t2, 0, 16);
+    memset(c2, 0, 60);
+    memset(p2, 0, 60);
+
+    AesGcmSetKey(&enc, k, sizeof(k), iv);
+    AesGcmSetExpIV(&enc, iv + /*AES_GCM_IMP_IV_SZ*/ 4);
+    /* AES-GCM encrypt and decrypt both use AES encrypt internally */
+    AesGcmEncrypt(&enc, c2, p, sizeof(c2), t2, sizeof(t2), a, sizeof(a));
+    if (memcmp(c, c2, sizeof(c2)))
+        return -68;
+    if (memcmp(t, t2, sizeof(t2)))
+        return -69;
+
+    result = AesGcmDecrypt(&enc,
+                        p2, c2, sizeof(p2), t2, sizeof(t2), a, sizeof(a));
+    if (result != 0)
+        return -70;
+    if (memcmp(p, p2, sizeof(p2)))
+        return -71;
+
+    return 0;
+}
+#endif /* HAVE_AESGCM */
+
+
+#endif /* NO_AES */
+
+
+int random_test()
+{
+    RNG  rng;
+    byte block[32];
+    int ret = InitRng(&rng);
+    if (ret != 0) return -39;
+
+    RNG_GenerateBlock(&rng, block, sizeof(block));
+
+    return 0;
+}
+
+
+static const char* clientKey  = "./certs/client-key.der";
+static const char* clientCert = "./certs/client-cert.der";
+#ifdef CYASSL_CERT_GEN
+    static const char* caKeyFile  = "./certs/ca-key.der";
+    static const char* caCertFile = "./certs/ca-cert.pem";
+#endif
+
+
+#ifdef HAVE_NTRU
+
+static byte GetEntropy(ENTROPY_CMD cmd, byte* out)
+{
+    static RNG rng;
+
+    if (cmd == INIT) {
+        int ret = InitRng(&rng);
+        if (ret == 0)
+            return 1;
+        else
+            return 0;
+    }
+
+    if (out == NULL)
+        return 0;
+
+    if (cmd == GET_BYTE_OF_ENTROPY) {
+        RNG_GenerateBlock(&rng, out, 1);
+        return 1;
+    }
+
+    if (cmd == GET_NUM_BYTES_PER_BYTE_OF_ENTROPY) {
+        *out = 1;
+        return 1;
+    }
+
+    return 0;
+}
+
+#endif /* HAVE_NTRU */
+
+int rsa_test()
+{
+    byte   tmp[2048], tmp2[2048];
+    size_t bytes, bytes2;
+    RsaKey key;
+    RNG    rng;
+    word32 idx = 0;
+    int    ret;
+    byte   in[] = "Everyone gets Friday off.";
+    word32 inLen = (word32)strlen((char*)in);
+    byte   out[256];
+    byte   plain[256];
+#ifdef CYASSL_TEST_CERT
+    DecodedCert cert;
+#endif
+
+    FILE*  file = fopen(clientKey, "rb"), * file2;
+
+    if (!file)
+        err_sys("can't open ./certs/client-key.der, "
+                "Please run from CyaSSL home dir", -40);
+
+    bytes = fread(tmp, 1, sizeof(tmp), file);
+  
+    InitRsaKey(&key, 0);  
+    ret = RsaPrivateKeyDecode(tmp, &idx, &key, (word32)bytes);
+    if (ret != 0) return -41;
+
+    ret = InitRng(&rng);
+    if (ret != 0) return -42;
+
+    ret = RsaPublicEncrypt(in, inLen, out, sizeof(out), &key, &rng);
+    if (ret < 0) return -43;
+
+    ret = RsaPrivateDecrypt(out, ret, plain, sizeof(plain), &key);
+    if (ret < 0) return -44;
+
+    if (memcmp(plain, in, inLen)) return -45;
+
+    ret = RsaSSL_Sign(in, inLen, out, sizeof(out), &key, &rng);
+    if (ret < 0) return -46;
+
+    memset(plain, 0, sizeof(plain));
+    ret = RsaSSL_Verify(out, ret, plain, sizeof(plain), &key);
+    if (ret < 0) return -47;
+
+    if (memcmp(plain, in, ret)) return -48;
+
+    file2 = fopen(clientCert, "rb");
+    if (!file2)
+        return -49;
+
+    bytes2 = fread(tmp2, 1, sizeof(tmp2), file2);
+
+#ifdef CYASSL_TEST_CERT
+    InitDecodedCert(&cert, (byte*)&tmp2, (word32)bytes2, 0);
+
+    ret = ParseCert(&cert, CERT_TYPE, NO_VERIFY, 0);
+    if (ret != 0) return -491;
+
+    FreeDecodedCert(&cert);
+#endif
+
+    fclose(file2);
+    fclose(file);
+
+#ifdef CYASSL_KEY_GEN
+    {
+        byte   der[4096];
+        byte   pem[4096];
+        word32 derSz = 0;
+        word32 pemSz = 0;
+        RsaKey derIn;
+        RsaKey genKey;
+        FILE* keyFile;
+        FILE* pemFile;
+
+        InitRsaKey(&genKey, 0);
+        ret = MakeRsaKey(&genKey, 1024, 65537, &rng);
+        if (ret != 0)
+            return -301;
+
+        derSz = RsaKeyToDer(&genKey, der, sizeof(der));
+        if (derSz < 0)
+            return -302;
+
+        keyFile = fopen("./key.der", "wb");
+        if (!keyFile)
+            return -303;
+        ret = fwrite(der, derSz, 1, keyFile);
+        fclose(keyFile);
+
+        pemSz = DerToPem(der, derSz, pem, sizeof(pem), PRIVATEKEY_TYPE);
+        if (pemSz < 0)
+            return -304;
+
+        pemFile = fopen("./key.pem", "wb");
+        if (!pemFile) 
+            return -305;
+        ret = fwrite(pem, pemSz, 1, pemFile);
+        fclose(pemFile);
+
+        InitRsaKey(&derIn, 0);
+        idx = 0;
+        ret = RsaPrivateKeyDecode(der, &idx, &derIn, derSz);
+        if (ret != 0)
+            return -306;
+
+        FreeRsaKey(&derIn);
+        FreeRsaKey(&genKey);
+    }
+#endif /* CYASSL_KEY_GEN */
+
+
+#ifdef CYASSL_CERT_GEN
+    /* self signed */
+    {
+        Cert        myCert;
+        byte        derCert[4096];
+        byte        pem[4096];
+        FILE*       derFile;
+        FILE*       pemFile;
+        int         certSz;
+        int         pemSz;
+#ifdef CYASSL_TEST_CERT
+        DecodedCert decode;
+#endif
+
+        InitCert(&myCert);
+
+        strncpy(myCert.subject.country, "US", CTC_NAME_SIZE);
+        strncpy(myCert.subject.state, "OR", CTC_NAME_SIZE);
+        strncpy(myCert.subject.locality, "Portland", CTC_NAME_SIZE);
+        strncpy(myCert.subject.org, "yaSSL", CTC_NAME_SIZE);
+        strncpy(myCert.subject.unit, "Development", CTC_NAME_SIZE);
+        strncpy(myCert.subject.commonName, "www.yassl.com", CTC_NAME_SIZE);
+        strncpy(myCert.subject.email, "info@yassl.com", CTC_NAME_SIZE);
+        myCert.isCA    = 1;
+        myCert.sigType = CTC_SHA256wRSA;
+
+        certSz = MakeSelfCert(&myCert, derCert, sizeof(derCert), &key, &rng); 
+        if (certSz < 0)
+            return -401;
+
+#ifdef CYASSL_TEST_CERT
+        InitDecodedCert(&decode, derCert, certSz, 0);
+        ret = ParseCert(&decode, CERT_TYPE, NO_VERIFY, 0);
+        if (ret != 0)
+            return -402;
+        FreeDecodedCert(&decode);
+#endif
+        derFile = fopen("./cert.der", "wb");
+        if (!derFile)
+            return -403;
+        ret = fwrite(derCert, certSz, 1, derFile);
+        fclose(derFile);
+
+        pemSz = DerToPem(derCert, certSz, pem, sizeof(pem), CERT_TYPE);
+        if (pemSz < 0)
+            return -404;
+
+        pemFile = fopen("./cert.pem", "wb");
+        if (!pemFile)
+            return -405;
+        ret = fwrite(pem, pemSz, 1, pemFile);
+        fclose(pemFile);
+
+
+    }
+    /* CA style */
+    {
+        RsaKey      caKey;
+        Cert        myCert;
+        byte        derCert[4096];
+        byte        pem[4096];
+        FILE*       derFile;
+        FILE*       pemFile;
+        int         certSz;
+        int         pemSz;
+        byte        tmp[2048];
+        size_t      bytes;
+        word32      idx = 0;
+#ifdef CYASSL_TEST_CERT
+        DecodedCert decode;
+#endif
+
+        FILE*  file = fopen(caKeyFile, "rb");
+
+        if (!file)
+            return -412;
+
+        bytes = fread(tmp, 1, sizeof(tmp), file);
+  
+        InitRsaKey(&caKey, 0);  
+        ret = RsaPrivateKeyDecode(tmp, &idx, &caKey, (word32)bytes);
+        if (ret != 0) return -413;
+
+        InitCert(&myCert);
+
+        strncpy(myCert.subject.country, "US", CTC_NAME_SIZE);
+        strncpy(myCert.subject.state, "OR", CTC_NAME_SIZE);
+        strncpy(myCert.subject.locality, "Portland", CTC_NAME_SIZE);
+        strncpy(myCert.subject.org, "yaSSL", CTC_NAME_SIZE);
+        strncpy(myCert.subject.unit, "Development", CTC_NAME_SIZE);
+        strncpy(myCert.subject.commonName, "www.yassl.com", CTC_NAME_SIZE);
+        strncpy(myCert.subject.email, "info@yassl.com", CTC_NAME_SIZE);
+
+        ret = SetIssuer(&myCert, caCertFile);
+        if (ret < 0)
+            return -405;
+
+        certSz = MakeCert(&myCert, derCert, sizeof(derCert), &key, &rng); 
+        if (certSz < 0)
+            return -407;
+
+        certSz = SignCert(&myCert, derCert, sizeof(derCert), &caKey, &rng);
+        if (certSz < 0)
+            return -408;
+
+
+#ifdef CYASSL_TEST_CERT
+        InitDecodedCert(&decode, derCert, certSz, 0);
+        ret = ParseCert(&decode, CERT_TYPE, NO_VERIFY, 0);
+        if (ret != 0)
+            return -409;
+        FreeDecodedCert(&decode);
+#endif
+
+        derFile = fopen("./othercert.der", "wb");
+        if (!derFile)
+            return -410;
+        ret = fwrite(derCert, certSz, 1, derFile);
+        fclose(derFile);
+
+        pemSz = DerToPem(derCert, certSz, pem, sizeof(pem), CERT_TYPE);
+        if (pemSz < 0)
+            return -411;
+
+        pemFile = fopen("./othercert.pem", "wb");
+        if (!pemFile)
+            return -412;
+        ret = fwrite(pem, pemSz, 1, pemFile);
+        fclose(pemFile);
+    }
+#ifdef HAVE_NTRU
+    {
+        RsaKey      caKey;
+        Cert        myCert;
+        byte        derCert[4096];
+        byte        pem[4096];
+        FILE*       derFile;
+        FILE*       pemFile;
+        FILE*       caFile;
+        FILE*       ntruPrivFile;
+        int         certSz;
+        int         pemSz;
+        byte        tmp[2048];
+        size_t      bytes;
+        word32      idx = 0;
+#ifdef CYASSL_TEST_CERT
+        DecodedCert decode;
+#endif
+
+        byte   public_key[557];          /* sized for EES401EP2 */
+        word16 public_key_len;           /* no. of octets in public key */
+        byte   private_key[607];         /* sized for EES401EP2 */
+        word16 private_key_len;          /* no. of octets in private key */
+        DRBG_HANDLE drbg;
+        static uint8_t const pers_str[] = {
+                'C', 'y', 'a', 'S', 'S', 'L', ' ', 't', 'e', 's', 't'
+        };
+        word32 rc = crypto_drbg_instantiate(112, pers_str, sizeof(pers_str),
+                                            GetEntropy, &drbg);
+        if (rc != DRBG_OK)
+            return -450;
+
+        rc = crypto_ntru_encrypt_keygen(drbg, NTRU_EES401EP2, &public_key_len,
+                                        NULL, &private_key_len, NULL);
+        if (rc != NTRU_OK)
+            return -451;
+
+        rc = crypto_ntru_encrypt_keygen(drbg, NTRU_EES401EP2, &public_key_len,
+                                     public_key, &private_key_len, private_key);
+        crypto_drbg_uninstantiate(drbg);
+
+        if (rc != NTRU_OK)
+            return -452;
+
+        caFile = fopen(caKeyFile, "rb");
+
+        if (!caFile)
+            return -453;
+
+        bytes = fread(tmp, 1, sizeof(tmp), caFile);
+        fclose(caFile);
+  
+        InitRsaKey(&caKey, 0);  
+        ret = RsaPrivateKeyDecode(tmp, &idx, &caKey, (word32)bytes);
+        if (ret != 0) return -454;
+
+        InitCert(&myCert);
+
+        strncpy(myCert.subject.country, "US", CTC_NAME_SIZE);
+        strncpy(myCert.subject.state, "OR", CTC_NAME_SIZE);
+        strncpy(myCert.subject.locality, "Portland", CTC_NAME_SIZE);
+        strncpy(myCert.subject.org, "yaSSL", CTC_NAME_SIZE);
+        strncpy(myCert.subject.unit, "Development", CTC_NAME_SIZE);
+        strncpy(myCert.subject.commonName, "www.yassl.com", CTC_NAME_SIZE);
+        strncpy(myCert.subject.email, "info@yassl.com", CTC_NAME_SIZE);
+
+        ret = SetIssuer(&myCert, caCertFile);
+        if (ret < 0)
+            return -455;
+
+        certSz = MakeNtruCert(&myCert, derCert, sizeof(derCert), public_key,
+                              public_key_len, &rng); 
+        if (certSz < 0)
+            return -456;
+
+        certSz = SignCert(&myCert, derCert, sizeof(derCert), &caKey, &rng);
+        if (certSz < 0)
+            return -457;
+
+
+#ifdef CYASSL_TEST_CERT
+        InitDecodedCert(&decode, derCert, certSz, 0);
+        ret = ParseCert(&decode, CERT_TYPE, NO_VERIFY, 0);
+        if (ret != 0)
+            return -458;
+        FreeDecodedCert(&decode);
+#endif
+        derFile = fopen("./ntru-cert.der", "wb");
+        if (!derFile)
+            return -459;
+        ret = fwrite(derCert, certSz, 1, derFile);
+        fclose(derFile);
+
+        pemSz = DerToPem(derCert, certSz, pem, sizeof(pem), CERT_TYPE);
+        if (pemSz < 0)
+            return -460;
+
+        pemFile = fopen("./ntru-cert.pem", "wb");
+        if (!pemFile)
+            return -461;
+        ret = fwrite(pem, pemSz, 1, pemFile);
+        fclose(pemFile);
+
+        ntruPrivFile = fopen("./ntru-key.raw", "wb");
+        if (!ntruPrivFile)
+            return -462;
+        ret = fwrite(private_key, private_key_len, 1, ntruPrivFile);
+        fclose(ntruPrivFile);
+    }
+#endif /* HAVE_NTRU */
+#endif /* CYASSL_CERT_GEN */
+
+    FreeRsaKey(&key);
+
+    return 0;
+}
+
+
+static const char* dhKey = "./certs/dh2048.der";
+
+#ifndef NO_DH
+
+int dh_test()
+{
+    int    ret;
+    word32 bytes;
+    word32 idx = 0, privSz, pubSz, privSz2, pubSz2, agreeSz, agreeSz2;
+    byte   tmp[1024];
+    byte   priv[256];
+    byte   pub[256];
+    byte   priv2[256];
+    byte   pub2[256];
+    byte   agree[256];
+    byte   agree2[256];
+    DhKey  key;
+    DhKey  key2;
+    RNG    rng;
+    FILE*  file = fopen(dhKey, "rb");
+
+    if (!file)
+        return -50;
+
+    bytes = (word32) fread(tmp, 1, sizeof(tmp), file);
+
+    InitDhKey(&key);  
+    InitDhKey(&key2);  
+    ret = DhKeyDecode(tmp, &idx, &key, bytes);
+    if (ret != 0)
+        return -51;
+
+    idx = 0;
+    ret = DhKeyDecode(tmp, &idx, &key2, bytes);
+    if (ret != 0)
+        return -52;
+
+    ret = InitRng(&rng);
+    if (ret != 0)
+        return -53;
+    
+    ret = DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz);
+    ret = DhGenerateKeyPair(&key2, &rng, priv2, &privSz2, pub2, &pubSz2);
+    if (ret != 0)
+        return -54;
+
+    ret = DhAgree(&key, agree, &agreeSz, priv, privSz, pub2, pubSz2);
+    ret = DhAgree(&key2, agree2, &agreeSz2, priv2, privSz2, pub, pubSz);
+    if (ret != 0)
+        return -55;
+
+    if (memcmp(agree, agree2, agreeSz))
+        return -56;
+
+    FreeDhKey(&key);
+    FreeDhKey(&key2);
+    fclose(file);
+
+    return 0;
+}
+
+#endif /* NO_DH */
+
+
+static const char* dsaKey = "./certs/dsa2048.der";
+
+#ifndef NO_DSA
+
+int dsa_test()
+{
+    int    ret, answer;
+    word32 bytes;
+    word32 idx = 0;
+    byte   tmp[1024];
+    DsaKey key;
+    RNG    rng;
+    FILE*  file = fopen(dsaKey, "rb");
+    Sha    sha;
+    byte   hash[SHA_DIGEST_SIZE];
+    byte   signature[40];
+
+    if (!file)
+        return -60;
+
+    bytes = (word32) fread(tmp, 1, sizeof(tmp), file);
+  
+    InitSha(&sha);
+    ShaUpdate(&sha, tmp, bytes);
+    ShaFinal(&sha, hash);
+
+    InitDsaKey(&key);
+    ret = DsaPrivateKeyDecode(tmp, &idx, &key, bytes);
+    if (ret != 0) return -61;
+
+    ret = InitRng(&rng);
+    if (ret != 0) return -62;
+
+    ret = DsaSign(hash, signature, &key, &rng);
+    if (ret != 0) return -63;
+
+    ret = DsaVerify(hash, signature, &key, &answer);
+    if (ret != 0) return -64;
+    if (answer != 1) return -65;
+    
+    FreeDsaKey(&key);
+    fclose(file);
+    
+    return 0;
+}
+
+#endif /* NO_DSA */
+
+
+#ifdef OPENSSL_EXTRA
+
+int openssl_test()
+{
+    EVP_MD_CTX md_ctx;
+    testVector a, b, c, d, e, f;
+    byte       hash[SHA_DIGEST_SIZE*4];  /* max size */
+
+    (void)e;
+    (void)f;
+
+    a.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    a.output = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6"
+               "\x7a";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    EVP_MD_CTX_init(&md_ctx);
+    EVP_DigestInit(&md_ctx, EVP_md5());
+
+    EVP_DigestUpdate(&md_ctx, a.input, a.inLen);
+    EVP_DigestFinal(&md_ctx, hash, 0);
+
+    if (memcmp(hash, a.output, MD5_DIGEST_SIZE) != 0)
+        return -71;
+
+    b.input  = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaa";
+    b.output = "\xAD\x5B\x3F\xDB\xCB\x52\x67\x78\xC2\x83\x9D\x2F\x15\x1E\xA7"
+               "\x53\x99\x5E\x26\xA0";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    EVP_MD_CTX_init(&md_ctx);
+    EVP_DigestInit(&md_ctx, EVP_sha1());
+
+    EVP_DigestUpdate(&md_ctx, b.input, b.inLen);
+    EVP_DigestFinal(&md_ctx, hash, 0);
+
+    if (memcmp(hash, b.output, SHA_DIGEST_SIZE) != 0)
+        return -72;
+
+
+    d.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+    d.output = "\x24\x8D\x6A\x61\xD2\x06\x38\xB8\xE5\xC0\x26\x93\x0C\x3E\x60"
+               "\x39\xA3\x3C\xE4\x59\x64\xFF\x21\x67\xF6\xEC\xED\xD4\x19\xDB"
+               "\x06\xC1";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    EVP_MD_CTX_init(&md_ctx);
+    EVP_DigestInit(&md_ctx, EVP_sha256());
+
+    EVP_DigestUpdate(&md_ctx, d.input, d.inLen);
+    EVP_DigestFinal(&md_ctx, hash, 0);
+
+    if (memcmp(hash, d.output, SHA256_DIGEST_SIZE) != 0)
+        return -78;
+
+#ifdef CYASSL_SHA384
+
+    e.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    e.output = "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b"
+               "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0"
+               "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91"
+               "\x74\x60\x39";    
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    EVP_MD_CTX_init(&md_ctx);
+    EVP_DigestInit(&md_ctx, EVP_sha384());
+
+    EVP_DigestUpdate(&md_ctx, e.input, e.inLen);
+    EVP_DigestFinal(&md_ctx, hash, 0);
+
+    if (memcmp(hash, e.output, SHA384_DIGEST_SIZE) != 0)
+        return -79;
+
+#endif /* CYASSL_SHA384 */
+
+
+#ifdef CYASSL_SHA512
+
+    f.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    f.output = "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14"
+               "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88"
+               "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4"
+               "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b"
+               "\x87\x4b\xe9\x09"; 
+    f.inLen  = strlen(f.input);
+    f.outLen = strlen(f.output);
+
+    EVP_MD_CTX_init(&md_ctx);
+    EVP_DigestInit(&md_ctx, EVP_sha512());
+
+    EVP_DigestUpdate(&md_ctx, f.input, f.inLen);
+    EVP_DigestFinal(&md_ctx, hash, 0);
+
+    if (memcmp(hash, f.output, SHA512_DIGEST_SIZE) != 0)
+        return -80;
+
+#endif /* CYASSL_SHA512 */
+
+
+    if (RAND_bytes(hash, sizeof(hash)) != 1)
+        return -73;
+            
+    c.input  = "what do ya want for nothing?";
+    c.output = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7"
+               "\x38";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    HMAC(EVP_md5(), "Jefe", 4, (byte*)c.input, (int)c.inLen, hash, 0);
+
+    if (memcmp(hash, c.output, MD5_DIGEST_SIZE) != 0)
+        return -74;
+
+    { /* des test */
+    const byte vector[] = { /* "now is the time for all " w/o trailing 0 */
+        0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,
+        0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20,
+        0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
+    };
+
+    byte plain[24];
+    byte cipher[24];
+
+    const_DES_cblock key = 
+    {
+        0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef
+    };
+
+    DES_cblock iv = 
+    {
+        0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef
+    };
+
+    DES_key_schedule sched;
+
+    const byte verify[] = 
+    {
+        0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8,
+        0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73,
+        0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b
+    };
+
+    DES_key_sched(&key, &sched);
+
+    DES_cbc_encrypt(vector, cipher, sizeof(vector), &sched, &iv, DES_ENCRYPT);
+    DES_cbc_encrypt(cipher, plain, sizeof(vector), &sched, &iv, DES_DECRYPT);
+
+    if (memcmp(plain, vector, sizeof(vector)) != 0)
+        return -75;
+
+    if (memcmp(cipher, verify, sizeof(verify)) != 0)
+        return -76;
+
+        /* test changing iv */
+    DES_ncbc_encrypt(vector, cipher, 8, &sched, &iv, DES_ENCRYPT);
+    DES_ncbc_encrypt(vector + 8, cipher + 8, 16, &sched, &iv, DES_ENCRYPT);
+
+    if (memcmp(cipher, verify, sizeof(verify)) != 0)
+        return -77;
+
+    }  /* end des test */
+
+    {  /* evp_cipher test */
+        EVP_CIPHER_CTX ctx;
+
+
+        const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */
+            0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74,
+            0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20,
+            0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20
+        };
+
+        const byte verify[] = 
+        {
+            0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53,
+            0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb
+        };
+
+        byte key[] = "0123456789abcdef   ";  /* align */
+        byte iv[]  = "1234567890abcdef   ";  /* align */
+
+        byte cipher[AES_BLOCK_SIZE * 4];
+        byte plain [AES_BLOCK_SIZE * 4];
+
+        EVP_CIPHER_CTX_init(&ctx);
+        if (EVP_CipherInit(&ctx, EVP_aes_128_cbc(), key, iv, 1) == 0)
+            return -81;
+
+        if (EVP_Cipher(&ctx, cipher, (byte*)msg, 16) == 0)
+            return -82;
+
+        if (memcmp(cipher, verify, AES_BLOCK_SIZE))
+            return -83;
+
+        EVP_CIPHER_CTX_init(&ctx);
+        if (EVP_CipherInit(&ctx, EVP_aes_128_cbc(), key, iv, 0) == 0)
+            return -84;
+
+        if (EVP_Cipher(&ctx, plain, cipher, 16) == 0)
+            return -85;
+
+        if (memcmp(plain, msg, AES_BLOCK_SIZE))
+            return -86;
+
+
+    }  /* end evp_cipher test */
+
+    return 0;
+}
+
+#endif /* OPENSSL_EXTRA */
+
+
+#ifndef NO_PWDBASED
+
+int pkcs12_test()
+{
+    const byte passwd[] = { 0x00, 0x73, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x67,
+                            0x00, 0x00 }; 
+    const byte salt[] =   { 0x0a, 0x58, 0xCF, 0x64, 0x53, 0x0d, 0x82, 0x3f };
+
+    const byte passwd2[] = { 0x00, 0x71, 0x00, 0x75, 0x00, 0x65, 0x00, 0x65,
+                             0x00, 0x67, 0x00, 0x00 }; 
+    const byte salt2[] =   { 0x16, 0x82, 0xC0, 0xfC, 0x5b, 0x3f, 0x7e, 0xc5 };
+    byte  derived[64];
+
+    const byte verify[] = {
+        0x8A, 0xAA, 0xE6, 0x29, 0x7B, 0x6C, 0xB0, 0x46,
+        0x42, 0xAB, 0x5B, 0x07, 0x78, 0x51, 0x28, 0x4E,
+        0xB7, 0x12, 0x8F, 0x1A, 0x2A, 0x7F, 0xBC, 0xA3
+    };
+
+    const byte verify2[] = {
+        0x48, 0x3D, 0xD6, 0xE9, 0x19, 0xD7, 0xDE, 0x2E,
+        0x8E, 0x64, 0x8B, 0xA8, 0xF8, 0x62, 0xF3, 0xFB,
+        0xFB, 0xDC, 0x2B, 0xCB, 0x2C, 0x02, 0x95, 0x7F
+    };
+
+    int id         =  1;
+    int kLen       = 24;
+    int iterations =  1;
+    int ret = PKCS12_PBKDF(derived, passwd, sizeof(passwd), salt, 8, iterations,
+                           kLen, SHA, id);
+
+    if ( (ret = memcmp(derived, verify, kLen)) != 0)
+        return -103;
+
+    iterations = 1000;
+    ret = PKCS12_PBKDF(derived, passwd2, sizeof(passwd2), salt2, 8, iterations, 
+                       kLen, SHA, id);
+    if ( (ret = memcmp(derived, verify2, 24)) != 0)
+        return -104;
+
+    return 0;
+}
+
+
+int pbkdf2_test()
+{
+    char passwd[] = "password";
+    const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 };
+    int   iterations = 2048;
+    int   kLen = 24;
+    byte  derived[64];
+
+    const byte verify[] = {
+        0xBF, 0xDE, 0x6B, 0xE9, 0x4D, 0xF7, 0xE1, 0x1D, 0xD4, 0x09, 0xBC, 0xE2,
+        0x0A, 0x02, 0x55, 0xEC, 0x32, 0x7C, 0xB9, 0x36, 0xFF, 0xE9, 0x36, 0x43
+
+    };
+
+    PBKDF2(derived, (byte*)passwd, strlen(passwd), salt, 8, iterations, kLen,
+           SHA);
+
+    if (memcmp(derived, verify, sizeof(verify)) != 0)
+        return -102;
+
+    return 0;
+}
+
+
+int pbkdf1_test()
+{
+    char passwd[] = "password";
+    const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 };
+    int   iterations = 1000;
+    int   kLen = 16;
+    byte  derived[16];
+
+    const byte verify[] = {
+        0xDC, 0x19, 0x84, 0x7E, 0x05, 0xC6, 0x4D, 0x2F, 0xAF, 0x10, 0xEB, 0xFB,
+        0x4A, 0x3D, 0x2A, 0x20
+    };
+
+    PBKDF1(derived, (byte*)passwd, strlen(passwd), salt, 8, iterations, kLen,
+           SHA);
+
+    if (memcmp(derived, verify, sizeof(verify)) != 0)
+        return -101;
+
+    return 0;
+}
+
+
+int pwdbased_test()
+{
+   int ret =  pbkdf1_test();
+   ret += pbkdf2_test();
+
+   return ret + pkcs12_test();
+}
+
+#endif /* NO_PWDBASED */
+
+
+#ifdef HAVE_ECC
+
+int ecc_test()
+{
+    RNG     rng;
+    byte    sharedA[1024];
+    byte    sharedB[1024];
+    byte    sig[1024];
+    byte    digest[20];
+    byte    exportBuf[1024];
+    word32  x, y;
+    int     i, verify, ret;
+    ecc_key userA, userB, pubKey;
+
+    ret = InitRng(&rng);
+    if (ret != 0)
+        return -1001;
+
+    ecc_init(&userA);
+    ecc_init(&userB);
+    ecc_init(&pubKey);
+
+    ret = ecc_make_key(&rng, 32, &userA);
+    ret = ecc_make_key(&rng, 32, &userB);
+
+    if (ret != 0)
+        return -1002;
+
+    x = sizeof(sharedA);
+    ret = ecc_shared_secret(&userA, &userB, sharedA, &x);
+   
+    y = sizeof(sharedB);
+    ret = ecc_shared_secret(&userB, &userA, sharedB, &y);
+    
+    if (ret != 0)
+        return -1003;
+
+    if (y != x)
+        return -1004;
+
+    if (memcmp(sharedA, sharedB, x))
+        return -1005;
+
+    x = sizeof(exportBuf);
+    ret = ecc_export_x963(&userA, exportBuf, &x);
+    if (ret != 0)
+        return -1006;
+
+    ret = ecc_import_x963(exportBuf, x, &pubKey);
+
+    if (ret != 0) 
+        return -1007;
+
+    y = sizeof(sharedB);
+    ret = ecc_shared_secret(&userB, &pubKey, sharedB, &y);
+   
+    if (ret != 0)
+        return -1008;
+
+    if (memcmp(sharedA, sharedB, y))
+        return -1010;
+
+    /* test DSA sign hash */
+    for (i = 0; i < sizeof(digest); i++)
+        digest[i] = i;
+
+    x = sizeof(sig);
+    ret = ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA);
+    
+    verify = 0;
+    ret = ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &userA);
+
+    if (ret != 0)
+        return -1011;
+
+    if (verify != 1)
+        return -1012;
+
+    ecc_free(&pubKey);
+    ecc_free(&userB);
+    ecc_free(&userA);
+
+    return 0;
+}
+
+#endif /* HAVE_ECC */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.sln b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.sln
new file mode 100644 (file)
index 0000000..97b2e8d
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcproj", "{D04BDF66-664A-4D59-BEAC-8AB2D5809C21}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {D04BDF66-664A-4D59-BEAC-8AB2D5809C21}.Debug|Win32.ActiveCfg = Debug|Win32
+               {D04BDF66-664A-4D59-BEAC-8AB2D5809C21}.Debug|Win32.Build.0 = Debug|Win32
+               {D04BDF66-664A-4D59-BEAC-8AB2D5809C21}.Release|Win32.ActiveCfg = Release|Win32
+               {D04BDF66-664A-4D59-BEAC-8AB2D5809C21}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.vcproj b/FreeRTOS-Plus/Source/CyaSSL/ctaocrypt/test/test.vcproj
new file mode 100644 (file)
index 0000000..38c5c6b
--- /dev/null
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="8.00"
+       Name="test"
+       ProjectGUID="{D04BDF66-664A-4D59-BEAC-8AB2D5809C21}"
+       Keyword="Win32Proj"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="Debug"
+                       IntermediateDirectory="Debug"
+                       ConfigurationType="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="../include;../../include/openssl"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               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="Release"
+                       IntermediateDirectory="Release"
+                       ConfigurationType="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               AdditionalIncludeDirectories="../include;../../include/openssl"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
+                               RuntimeLibrary="2"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               LinkIncremental="2"
+                               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="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\test.c"
+                               >
+                       </File>
+               </Filter>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl-iphone.xcodeproj/project.pbxproj b/FreeRTOS-Plus/Source/CyaSSL/cyassl-iphone.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..53b74be
--- /dev/null
@@ -0,0 +1,379 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 45;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               43809E9B0FB7AD1C0050922E /* md4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43809E9A0FB7AD1C0050922E /* md4.c */; };
+               43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2790DDF984100F2D488 /* ssl.c */; };
+               439B3820136B391E004C965E /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 439B381F136B391E004C965E /* logging.c */; };
+               43B89CBD142FEB5E00284CC6 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBC142FEB5E00284CC6 /* internal.c */; };
+               43B89CBF142FEB6C00284CC6 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CBE142FEB6C00284CC6 /* io.c */; };
+               43B89CC5142FEBBD00284CC6 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC0142FEBBD00284CC6 /* memory.c */; };
+               43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC1142FEBBD00284CC6 /* tfm.c */; };
+               43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC2142FEBBD00284CC6 /* ripemd.c */; };
+               43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC3142FEBBD00284CC6 /* sha512.c */; };
+               43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B89CC4142FEBBD00284CC6 /* pwdbased.c */; };
+               43C6C27C0DDF984100F2D488 /* keys.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2780DDF984100F2D488 /* keys.c */; };
+               43C6C27E0DDF984100F2D488 /* tls.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C27A0DDF984100F2D488 /* tls.c */; };
+               43C6C2920DDF98D400F2D488 /* aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2830DDF98D400F2D488 /* aes.c */; };
+               43C6C2930DDF98D400F2D488 /* arc4.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2840DDF98D400F2D488 /* arc4.c */; };
+               43C6C2940DDF98D400F2D488 /* asn.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2850DDF98D400F2D488 /* asn.c */; };
+               43C6C2950DDF98D400F2D488 /* coding.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2860DDF98D400F2D488 /* coding.c */; };
+               43C6C2960DDF98D400F2D488 /* des3.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2870DDF98D400F2D488 /* des3.c */; };
+               43C6C2970DDF98D400F2D488 /* dh.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2880DDF98D400F2D488 /* dh.c */; };
+               43C6C2980DDF98D400F2D488 /* dsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2890DDF98D400F2D488 /* dsa.c */; };
+               43C6C2990DDF98D400F2D488 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28A0DDF98D400F2D488 /* hmac.c */; };
+               43C6C29A0DDF98D400F2D488 /* integer.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28B0DDF98D400F2D488 /* integer.c */; };
+               43C6C29B0DDF98D400F2D488 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28C0DDF98D400F2D488 /* md5.c */; };
+               43C6C29D0DDF98D400F2D488 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28E0DDF98D400F2D488 /* random.c */; };
+               43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C28F0DDF98D400F2D488 /* rsa.c */; };
+               43C6C29F0DDF98D400F2D488 /* sha.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2900DDF98D400F2D488 /* sha.c */; };
+               43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */ = {isa = PBXBuildFile; fileRef = 43C6C2910DDF98D400F2D488 /* sha256.c */; };
+               43D565650F1EC9A600550C88 /* hc128.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565640F1EC9A600550C88 /* hc128.c */; };
+               43D565670F1EC9CC00550C88 /* rabbit.c in Sources */ = {isa = PBXBuildFile; fileRef = 43D565660F1EC9CC00550C88 /* rabbit.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+               43C6C3160DDFAC6A00F2D488 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 2147483647;
+                       dstPath = "";
+                       dstSubfolderSpec = 7;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               43C6C3170DDFAC6A00F2D488 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 8;
+                       dstPath = "";
+                       dstSubfolderSpec = 7;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 1;
+               };
+               43C6C3180DDFAC6A00F2D488 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 2147483647;
+                       dstPath = "";
+                       dstSubfolderSpec = 7;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+               4368F6E40E9EA1140002A123 /* test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = test.c; path = ctaocrypt/test/test.c; sourceTree = "<group>"; };
+               43809E9A0FB7AD1C0050922E /* md4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md4.c; path = ctaocrypt/src/md4.c; sourceTree = "<group>"; };
+               439B381F136B391E004C965E /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logging.c; path = ctaocrypt/src/logging.c; sourceTree = "<group>"; };
+               43B89CBC142FEB5E00284CC6 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = internal.c; path = src/internal.c; sourceTree = "<group>"; };
+               43B89CBE142FEB6C00284CC6 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = src/io.c; sourceTree = "<group>"; };
+               43B89CC0142FEBBD00284CC6 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ctaocrypt/src/memory.c; sourceTree = "<group>"; };
+               43B89CC1142FEBBD00284CC6 /* tfm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tfm.c; path = ctaocrypt/src/tfm.c; sourceTree = "<group>"; };
+               43B89CC2142FEBBD00284CC6 /* ripemd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ripemd.c; path = ctaocrypt/src/ripemd.c; sourceTree = "<group>"; };
+               43B89CC3142FEBBD00284CC6 /* sha512.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sha512.c; path = ctaocrypt/src/sha512.c; sourceTree = "<group>"; };
+               43B89CC4142FEBBD00284CC6 /* pwdbased.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pwdbased.c; path = ctaocrypt/src/pwdbased.c; sourceTree = "<group>"; };
+               43C6C2780DDF984100F2D488 /* keys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = keys.c; path = src/keys.c; sourceTree = "<group>"; };
+               43C6C2790DDF984100F2D488 /* ssl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = ssl.c; path = src/ssl.c; sourceTree = "<group>"; };
+               43C6C27A0DDF984100F2D488 /* tls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = tls.c; path = src/tls.c; sourceTree = "<group>"; };
+               43C6C2830DDF98D400F2D488 /* aes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = aes.c; path = ctaocrypt/src/aes.c; sourceTree = "<group>"; };
+               43C6C2840DDF98D400F2D488 /* arc4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = arc4.c; path = ctaocrypt/src/arc4.c; sourceTree = "<group>"; };
+               43C6C2850DDF98D400F2D488 /* asn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = asn.c; path = ctaocrypt/src/asn.c; sourceTree = "<group>"; };
+               43C6C2860DDF98D400F2D488 /* coding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = coding.c; path = ctaocrypt/src/coding.c; sourceTree = "<group>"; };
+               43C6C2870DDF98D400F2D488 /* des3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = des3.c; path = ctaocrypt/src/des3.c; sourceTree = "<group>"; };
+               43C6C2880DDF98D400F2D488 /* dh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dh.c; path = ctaocrypt/src/dh.c; sourceTree = "<group>"; };
+               43C6C2890DDF98D400F2D488 /* dsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = dsa.c; path = ctaocrypt/src/dsa.c; sourceTree = "<group>"; };
+               43C6C28A0DDF98D400F2D488 /* hmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = hmac.c; path = ctaocrypt/src/hmac.c; sourceTree = "<group>"; };
+               43C6C28B0DDF98D400F2D488 /* integer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = integer.c; path = ctaocrypt/src/integer.c; sourceTree = "<group>"; };
+               43C6C28C0DDF98D400F2D488 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = md5.c; path = ctaocrypt/src/md5.c; sourceTree = "<group>"; };
+               43C6C28E0DDF98D400F2D488 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = random.c; path = ctaocrypt/src/random.c; sourceTree = "<group>"; };
+               43C6C28F0DDF98D400F2D488 /* rsa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rsa.c; path = ctaocrypt/src/rsa.c; sourceTree = "<group>"; };
+               43C6C2900DDF98D400F2D488 /* sha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = sha.c; path = ctaocrypt/src/sha.c; sourceTree = "<group>"; };
+               43C6C2910DDF98D400F2D488 /* sha256.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = sha256.c; path = ctaocrypt/src/sha256.c; sourceTree = "<group>"; };
+               43CB530D116E9FD5000A264B /* iphone-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iphone-Info.plist"; sourceTree = "<group>"; };
+               43D565640F1EC9A600550C88 /* hc128.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = hc128.c; path = ctaocrypt/src/hc128.c; sourceTree = "<group>"; };
+               43D565660F1EC9CC00550C88 /* rabbit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = rabbit.c; path = ctaocrypt/src/rabbit.c; sourceTree = "<group>"; };
+               D2AAC046055464E500DB518D /* libcyassl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcyassl.a; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               D289987405E68DCB004EDB86 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               08FB7794FE84155DC02AAC07 /* cyassl */ = {
+                       isa = PBXGroup;
+                       children = (
+                               08FB7795FE84155DC02AAC07 /* Source */,
+                               C6A0FF2B0290797F04C91782 /* Documentation */,
+                               1AB674ADFE9D54B511CA2CBB /* Products */,
+                               43CB530D116E9FD5000A264B /* iphone-Info.plist */,
+                       );
+                       name = cyassl;
+                       sourceTree = "<group>";
+               };
+               08FB7795FE84155DC02AAC07 /* Source */ = {
+                       isa = PBXGroup;
+                       children = (
+                               43CA25B90EA400A60011ECA2 /* headers */,
+                               43CA25720EA3F9B20011ECA2 /* src */,
+                       );
+                       name = Source;
+                       sourceTree = "<group>";
+               };
+               1AB674ADFE9D54B511CA2CBB /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               D2AAC046055464E500DB518D /* libcyassl.a */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               43CA25720EA3F9B20011ECA2 /* src */ = {
+                       isa = PBXGroup;
+                       children = (
+                               43B89CC0142FEBBD00284CC6 /* memory.c */,
+                               43B89CC1142FEBBD00284CC6 /* tfm.c */,
+                               43B89CC2142FEBBD00284CC6 /* ripemd.c */,
+                               43B89CC3142FEBBD00284CC6 /* sha512.c */,
+                               43B89CC4142FEBBD00284CC6 /* pwdbased.c */,
+                               43B89CBE142FEB6C00284CC6 /* io.c */,
+                               43B89CBC142FEB5E00284CC6 /* internal.c */,
+                               439B381F136B391E004C965E /* logging.c */,
+                               43809E9A0FB7AD1C0050922E /* md4.c */,
+                               43D565660F1EC9CC00550C88 /* rabbit.c */,
+                               43D565640F1EC9A600550C88 /* hc128.c */,
+                               43C6C2830DDF98D400F2D488 /* aes.c */,
+                               43C6C2840DDF98D400F2D488 /* arc4.c */,
+                               43C6C2850DDF98D400F2D488 /* asn.c */,
+                               43C6C2860DDF98D400F2D488 /* coding.c */,
+                               43C6C2870DDF98D400F2D488 /* des3.c */,
+                               4368F6E40E9EA1140002A123 /* test.c */,
+                               43C6C2880DDF98D400F2D488 /* dh.c */,
+                               43C6C2890DDF98D400F2D488 /* dsa.c */,
+                               43C6C28A0DDF98D400F2D488 /* hmac.c */,
+                               43C6C28B0DDF98D400F2D488 /* integer.c */,
+                               43C6C28C0DDF98D400F2D488 /* md5.c */,
+                               43C6C28E0DDF98D400F2D488 /* random.c */,
+                               43C6C28F0DDF98D400F2D488 /* rsa.c */,
+                               43C6C2900DDF98D400F2D488 /* sha.c */,
+                               43C6C2910DDF98D400F2D488 /* sha256.c */,
+                               43C6C2780DDF984100F2D488 /* keys.c */,
+                               43C6C2790DDF984100F2D488 /* ssl.c */,
+                               43C6C27A0DDF984100F2D488 /* tls.c */,
+                       );
+                       name = src;
+                       sourceTree = "<group>";
+               };
+               43CA25B90EA400A60011ECA2 /* headers */ = {
+                       isa = PBXGroup;
+                       children = (
+                       );
+                       name = headers;
+                       sourceTree = "<group>";
+               };
+               C6A0FF2B0290797F04C91782 /* Documentation */ = {
+                       isa = PBXGroup;
+                       children = (
+                       );
+                       name = Documentation;
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+               D2AAC043055464E500DB518D /* Headers */ = {
+                       isa = PBXHeadersBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+               D2AAC045055464E500DB518D /* cyassl */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */;
+                       buildPhases = (
+                               D2AAC043055464E500DB518D /* Headers */,
+                               D2AAC044055464E500DB518D /* Sources */,
+                               D289987405E68DCB004EDB86 /* Frameworks */,
+                               43C6C3160DDFAC6A00F2D488 /* CopyFiles */,
+                               43C6C3170DDFAC6A00F2D488 /* CopyFiles */,
+                               43C6C3180DDFAC6A00F2D488 /* CopyFiles */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = cyassl;
+                       productName = cyassl;
+                       productReference = D2AAC046055464E500DB518D /* libcyassl.a */;
+                       productType = "com.apple.product-type.library.static";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               08FB7793FE84155DC02AAC07 /* Project object */ = {
+                       isa = PBXProject;
+                       attributes = {
+                               BuildIndependentTargetsInParallel = YES;
+                       };
+                       buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */;
+                       compatibilityVersion = "Xcode 3.1";
+                       developmentRegion = English;
+                       hasScannedForEncodings = 1;
+                       knownRegions = (
+                               English,
+                               Japanese,
+                               French,
+                               German,
+                       );
+                       mainGroup = 08FB7794FE84155DC02AAC07 /* cyassl */;
+                       projectDirPath = "";
+                       projectRoot = "";
+                       targets = (
+                               D2AAC045055464E500DB518D /* cyassl */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+               D2AAC044055464E500DB518D /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               43C6C27C0DDF984100F2D488 /* keys.c in Sources */,
+                               43C6C27E0DDF984100F2D488 /* tls.c in Sources */,
+                               43C6C2920DDF98D400F2D488 /* aes.c in Sources */,
+                               43C6C2930DDF98D400F2D488 /* arc4.c in Sources */,
+                               43C6C2940DDF98D400F2D488 /* asn.c in Sources */,
+                               43C6C2950DDF98D400F2D488 /* coding.c in Sources */,
+                               43C6C2960DDF98D400F2D488 /* des3.c in Sources */,
+                               43C6C2970DDF98D400F2D488 /* dh.c in Sources */,
+                               43C6C2980DDF98D400F2D488 /* dsa.c in Sources */,
+                               43C6C2990DDF98D400F2D488 /* hmac.c in Sources */,
+                               43C6C29A0DDF98D400F2D488 /* integer.c in Sources */,
+                               43C6C29B0DDF98D400F2D488 /* md5.c in Sources */,
+                               43C6C29D0DDF98D400F2D488 /* random.c in Sources */,
+                               43C6C29E0DDF98D400F2D488 /* rsa.c in Sources */,
+                               43C6C29F0DDF98D400F2D488 /* sha.c in Sources */,
+                               43C6C2A00DDF98D400F2D488 /* sha256.c in Sources */,
+                               43962ADF0DE7ED48003C5E5B /* ssl.c in Sources */,
+                               43D565650F1EC9A600550C88 /* hc128.c in Sources */,
+                               43D565670F1EC9CC00550C88 /* rabbit.c in Sources */,
+                               43809E9B0FB7AD1C0050922E /* md4.c in Sources */,
+                               439B3820136B391E004C965E /* logging.c in Sources */,
+                               43B89CBD142FEB5E00284CC6 /* internal.c in Sources */,
+                               43B89CBF142FEB6C00284CC6 /* io.c in Sources */,
+                               43B89CC5142FEBBD00284CC6 /* memory.c in Sources */,
+                               43B89CC6142FEBBD00284CC6 /* tfm.c in Sources */,
+                               43B89CC7142FEBBD00284CC6 /* ripemd.c in Sources */,
+                               43B89CC8142FEBBD00284CC6 /* sha512.c in Sources */,
+                               43B89CC9142FEBBD00284CC6 /* pwdbased.c in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+               1DEB91EC08733DB70010E9CD /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+                               COPY_PHASE_STRIP = NO;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_MODEL_TUNING = G5;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
+                               HEADER_SEARCH_PATHS = $SRCROOT;
+                               INSTALL_PATH = /usr/local/lib;
+                               PRODUCT_NAME = cyassl;
+                               SDKROOT = iphoneos;
+                               USER_HEADER_SEARCH_PATHS = "";
+                               WARNING_CFLAGS = "-Wall";
+                               ZERO_LINK = YES;
+                       };
+                       name = Debug;
+               };
+               1DEB91ED08733DB70010E9CD /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               GCC_MODEL_TUNING = G5;
+                               GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
+                               HEADER_SEARCH_PATHS = $SRCROOT;
+                               INSTALL_PATH = /usr/local/lib;
+                               PRODUCT_NAME = cyassl;
+                               USER_HEADER_SEARCH_PATHS = "";
+                               WARNING_CFLAGS = "-Wall";
+                       };
+                       name = Release;
+               };
+               1DEB91F008733DB70010E9CD /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+                               GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
+                               GCC_VERSION = 4.2;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               PREBINDING = NO;
+                               SDKROOT = iphoneos;
+                               USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
+                       };
+                       name = Debug;
+               };
+               1DEB91F108733DB70010E9CD /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+                               GCC_PREPROCESSOR_DEFINITIONS = IPHONE;
+                               GCC_VERSION = 4.2;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               PREBINDING = NO;
+                               SDKROOT = iphonesimulator2.2;
+                               USER_HEADER_SEARCH_PATHS = "include ctaocrypt/include";
+                       };
+                       name = Release;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "cyassl" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               1DEB91EC08733DB70010E9CD /* Debug */,
+                               1DEB91ED08733DB70010E9CD /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cyassl-iphone" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               1DEB91F008733DB70010E9CD /* Debug */,
+                               1DEB91F108733DB70010E9CD /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.sln b/FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.sln
new file mode 100644 (file)
index 0000000..3d935ae
--- /dev/null
@@ -0,0 +1,65 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 10.00\r
+# Visual C++ Express 2008\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl-ntru.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite-ntru.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver-ntru.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient-ntru.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client-ntru.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server-ntru.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/cyassl-ntru.vcproj
new file mode 100644 (file)
index 0000000..2402504
--- /dev/null
@@ -0,0 +1,285 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="cyassl"\r
+       ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"\r
+       RootNamespace="cyassl"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="./;NTRU/include"\r
+                               PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="./;NTRU/include"\r
+                               PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;HAVE_NTRU;NO_PSK;WIN32"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\aes.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\arc4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\asm.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\asn.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\coding.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\des3.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\dh.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\dsa.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\hc128.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\hmac.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\integer.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\internal.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\io.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\keys.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\logging.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\md4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\md5.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\memory.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\misc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\pwdbased.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\rabbit.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\random.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\ripemd.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\rsa.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha256.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha512.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\ssl.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\tls.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl.sln b/FreeRTOS-Plus/Source/CyaSSL/cyassl.sln
new file mode 100644 (file)
index 0000000..fde689f
--- /dev/null
@@ -0,0 +1,74 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 10.00\r
+# Visual C++ Express 2008\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cyassl", "cyassl.vcproj", "{73973223-5EE8-41CA-8E88-1D60E89A237B}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite\testsuite.vcproj", "{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sslSniffer", "sslSniffer\sslSniffer.vcproj", "{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "examples\echoserver\echoserver.vcproj", "{07D97C48-E08F-4E34-9F67-3064039FF2CB}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "examples\echoclient\echoclient.vcproj", "{8362A816-C5DC-4E22-B5C5-9E6806387073}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "examples\client\client.vcproj", "{3ADE9549-582D-4D8E-9826-B172197A7959}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "examples\server\server.vcproj", "{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B} = {73973223-5EE8-41CA-8E88-1D60E89A237B}\r
+       EndProjectSection\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Debug|Win32.Build.0 = Debug|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.ActiveCfg = Release|Win32\r
+               {73973223-5EE8-41CA-8E88-1D60E89A237B}.Release|Win32.Build.0 = Release|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Debug|Win32.Build.0 = Debug|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.ActiveCfg = Release|Win32\r
+               {611E8971-46E0-4D0A-B5A1-632C3B00CB80}.Release|Win32.Build.0 = Release|Win32\r
+               {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Debug|Win32.Build.0 = Debug|Win32\r
+               {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.ActiveCfg = Release|Win32\r
+               {34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}.Release|Win32.Build.0 = Release|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {07D97C48-E08F-4E34-9F67-3064039FF2CB}.Release|Win32.Build.0 = Release|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Debug|Win32.Build.0 = Debug|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.ActiveCfg = Release|Win32\r
+               {8362A816-C5DC-4E22-B5C5-9E6806387073}.Release|Win32.Build.0 = Release|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Debug|Win32.Build.0 = Debug|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.ActiveCfg = Release|Win32\r
+               {3ADE9549-582D-4D8E-9826-B172197A7959}.Release|Win32.Build.0 = Release|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Debug|Win32.Build.0 = Debug|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.ActiveCfg = Release|Win32\r
+               {E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl.vcproj b/FreeRTOS-Plus/Source/CyaSSL/cyassl.vcproj
new file mode 100644 (file)
index 0000000..d21effd
--- /dev/null
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="cyassl"\r
+       ProjectGUID="{73973223-5EE8-41CA-8E88-1D60E89A237B}"\r
+       RootNamespace="cyassl"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="./"\r
+                               PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="4"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="4"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="./"\r
+                               PreprocessorDefinitions="OPENSSL_EXTRA;CYASSL_RIPEMD;CYASSL_SHA512;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLibrarianTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\aes.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\arc4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\asn.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\coding.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\des3.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\dh.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\dsa.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\hc128.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\hmac.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\integer.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\internal.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\io.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\keys.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\logging.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\md4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\md5.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\memory.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\pwdbased.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\rabbit.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\random.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\ripemd.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\rsa.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha256.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ctaocrypt\src\sha512.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\ssl.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\tls.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/callbacks.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/callbacks.h
new file mode 100644 (file)
index 0000000..f43fbdd
--- /dev/null
@@ -0,0 +1,80 @@
+/* cyassl_callbacks.h
+ *
+ * Copyright (C) 2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_CALLBACKS_H
+#define CYASSL_CALLBACKS_H
+
+#include <sys/time.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum { /* CALLBACK CONTSTANTS */
+    MAX_PACKETNAME_SZ     =  24,
+    MAX_CIPHERNAME_SZ     =  24,
+    MAX_TIMEOUT_NAME_SZ   =  24,       
+    MAX_PACKETS_HANDSHAKE =  14,       /* 12 for client auth plus 2 alerts */
+    MAX_VALUE_SZ          = 128,       /* all handshake packets but Cert should
+                                          fit here  */
+};
+
+
+typedef struct handShakeInfo_st {
+    char   cipherName[MAX_CIPHERNAME_SZ + 1];    /* negotiated cipher */
+    char   packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
+                                                 /* SSL packet names  */ 
+    int    numberPackets;                        /* actual # of packets */
+    int    negotiationError;                     /* cipher/parameter err */
+} HandShakeInfo;
+
+
+typedef struct timeval Timeval;
+
+
+typedef struct packetInfo_st {
+    char           packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
+    Timeval        timestamp;                       /* when it occured    */
+    unsigned char  value[MAX_VALUE_SZ];             /* if fits, it's here */ 
+    unsigned char* bufferValue;                     /* otherwise here (non 0) */
+    int            valueSz;                         /* sz of value or buffer */
+} PacketInfo;
+
+
+typedef struct timeoutInfo_st {
+    char       timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
+    int        flags;                              /* for future use */
+    int        numberPackets;                      /* actual # of packets */
+    PacketInfo packets[MAX_PACKETS_HANDSHAKE];     /* list of all packets  */
+    Timeval    timeoutValue;                       /* timer that caused it */
+} TimeoutInfo;
+
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+
+#endif /* CyaSSL_CALLBACKS_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/crl.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/crl.h
new file mode 100644 (file)
index 0000000..5e2fa62
--- /dev/null
@@ -0,0 +1,47 @@
+/* crl.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_CRL_H
+#define CYASSL_CRL_H
+
+#include <cyassl/ssl.h>
+#include <cyassl/ctaocrypt/asn.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+typedef struct CYASSL_CRL CYASSL_CRL;
+
+CYASSL_LOCAL int  InitCRL(CYASSL_CRL*, CYASSL_CERT_MANAGER*);
+CYASSL_LOCAL void FreeCRL(CYASSL_CRL*);
+
+CYASSL_LOCAL int  LoadCRL(CYASSL_CRL* crl, const char* path, int type, int mon);
+CYASSL_LOCAL int  BufferLoadCRL(CYASSL_CRL*, const byte*, long, int);
+CYASSL_LOCAL int  CheckCertCRL(CYASSL_CRL*, DecodedCert*);
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+#endif /* CYASSL_CRL_H */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/aes.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/aes.h
new file mode 100644 (file)
index 0000000..9ab625d
--- /dev/null
@@ -0,0 +1,113 @@
+/* aes.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_AES
+
+#ifndef CTAO_CRYPT_AES_H
+#define CTAO_CRYPT_AES_H
+
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef CYASSL_AESNI
+
+#include <wmmintrin.h>
+
+#if !defined (ALIGN16)
+    #if defined (__GNUC__)
+        #define ALIGN16 __attribute__ ( (aligned (16)))
+    #elif defined(_MSC_VER)
+        #define ALIGN16 __declspec (align (16))
+    #else
+        #define ALIGN16
+    #endif
+#endif
+
+#endif /* CYASSL_AESNI */
+
+#if !defined (ALIGN16)
+    #define ALIGN16
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    AES_ENC_TYPE   = 1,   /* cipher unique type */
+    AES_ENCRYPTION = 0,
+    AES_DECRYPTION = 1,
+    AES_BLOCK_SIZE = 16
+};
+
+
+typedef struct Aes {
+    /* AESNI needs key first, rounds 2nd, not sure why yet */
+    ALIGN16 word32 key[60];
+    word32  rounds;
+
+    ALIGN16 word32 reg[AES_BLOCK_SIZE / sizeof(word32)];      /* for CBC mode */
+    ALIGN16 word32 tmp[AES_BLOCK_SIZE / sizeof(word32)];      /* same         */
+
+#ifdef HAVE_AESGCM
+    ALIGN16 byte H[AES_BLOCK_SIZE];
+#ifdef GCM_TABLE
+    /* key-based fast multiplication table. */
+    ALIGN16 byte M0[256][AES_BLOCK_SIZE];
+#endif /* GCM_TABLE */
+#endif /* HAVE_AESGCM */
+} Aes;
+
+
+CYASSL_API int  AesSetKey(Aes* aes, const byte* key, word32 len, const byte* iv,
+                          int dir);
+CYASSL_API int  AesSetIV(Aes* aes, const byte* iv);
+CYASSL_API void AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
+CYASSL_API void AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz);
+CYASSL_API void AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz);
+CYASSL_API void AesEncryptDirect(Aes* aes, byte* out, const byte* in);
+CYASSL_API void AesDecryptDirect(Aes* aes, byte* out, const byte* in);
+
+#ifdef HAVE_AESGCM
+CYASSL_API void AesGcmSetKey(Aes* aes, const byte* key, word32 len,
+                              const byte* implicitIV);
+CYASSL_API void AesGcmSetExpIV(Aes* aes, const byte* iv);
+CYASSL_API void AesGcmGetExpIV(Aes* aes, byte* iv);
+CYASSL_API void AesGcmIncExpIV(Aes* aes);
+CYASSL_API void AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
+                              byte* authTag, word32 authTagSz,
+                              const byte* authIn, word32 authInSz);
+CYASSL_API int  AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
+                              const byte* authTag, word32 authTagSz,
+                              const byte* authIn, word32 authInSz);
+#endif /* HAVE_AESGCM */
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CTAO_CRYPT_AES_H */
+#endif /* NO_AES */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/arc4.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/arc4.h
new file mode 100644 (file)
index 0000000..b491466
--- /dev/null
@@ -0,0 +1,57 @@
+/* arc4.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_ARC4_H
+#define CTAO_CRYPT_ARC4_H
+
+
+#include <cyassl/ctaocrypt/types.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+       ARC4_ENC_TYPE   = 4,    /* cipher unique type */
+    ARC4_STATE_SIZE = 256
+};
+
+/* ARC4 encryption and decryption */
+typedef struct Arc4 {
+    byte x;
+    byte y;
+    byte state[ARC4_STATE_SIZE];
+} Arc4;
+
+CYASSL_API void Arc4Process(Arc4*, byte*, const byte*, word32);
+CYASSL_API void Arc4SetKey(Arc4*, const byte*, word32);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CTAO_CRYPT_ARC4_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn.h
new file mode 100644 (file)
index 0000000..cf2ac1c
--- /dev/null
@@ -0,0 +1,485 @@
+/* asn.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_ASN_H
+#define CTAO_CRYPT_ASN_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/rsa.h>
+#include <cyassl/ctaocrypt/dh.h>
+#include <cyassl/ctaocrypt/dsa.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/asn_public.h>   /* public interface */
+#ifdef HAVE_ECC
+    #include <cyassl/ctaocrypt/ecc.h>
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    ISSUER  = 0,
+    SUBJECT = 1,
+
+    EXTERNAL_SERIAL_SIZE = 32,
+
+    BEFORE  = 0,
+    AFTER   = 1
+};
+
+/* ASN Tags   */
+enum ASN_Tags {        
+    ASN_BOOLEAN           = 0x01,
+    ASN_INTEGER           = 0x02,
+    ASN_BIT_STRING        = 0x03,
+    ASN_OCTET_STRING      = 0x04,
+    ASN_TAG_NULL          = 0x05,
+    ASN_OBJECT_ID         = 0x06,
+    ASN_ENUMERATED        = 0x0a,
+    ASN_SEQUENCE          = 0x10,
+    ASN_SET               = 0x11,
+    ASN_UTC_TIME          = 0x17,
+    ASN_DNS_TYPE          = 0x02,
+    ASN_GENERALIZED_TIME  = 0x18,
+    CRL_EXTENSIONS        = 0xa0,
+    ASN_EXTENSIONS        = 0xa3,
+    ASN_LONG_LENGTH       = 0x80
+};
+
+enum  ASN_Flags{
+    ASN_CONSTRUCTED       = 0x20,
+    ASN_CONTEXT_SPECIFIC  = 0x80
+};
+
+enum DN_Tags {
+    ASN_COMMON_NAME   = 0x03,   /* CN */
+    ASN_SUR_NAME      = 0x04,   /* SN */
+    ASN_COUNTRY_NAME  = 0x06,   /* C  */
+    ASN_LOCALITY_NAME = 0x07,   /* L  */
+    ASN_STATE_NAME    = 0x08,   /* ST */
+    ASN_ORG_NAME      = 0x0a,   /* O  */
+    ASN_ORGUNIT_NAME  = 0x0b    /* OU */
+};
+
+enum PBES {
+    PBE_MD5_DES      = 0,
+    PBE_SHA1_DES     = 1,
+    PBE_SHA1_DES3    = 2,
+    PBE_SHA1_RC4_128 = 3,
+    PBES2            = 13       /* algo ID */
+};
+
+enum ENCRYPTION_TYPES {
+    DES_TYPE  = 0,
+    DES3_TYPE = 1,
+    RC4_TYPE  = 2
+};
+
+enum ECC_TYPES {
+    ECC_PREFIX_0 = 160,
+    ECC_PREFIX_1 = 161
+};
+
+enum Misc_ASN { 
+    ASN_NAME_MAX        = 256,
+    MAX_SALT_SIZE       =  64,     /* MAX PKCS Salt length */
+    MAX_IV_SIZE         =  64,     /* MAX PKCS Iv length */
+    MAX_KEY_SIZE        =  64,     /* MAX PKCS Key  length */
+    PKCS5               =   5,     /* PKCS oid tag */
+    PKCS5v2             =   6,     /* PKCS #5 v2.0 */
+    PKCS12              =  12,     /* PKCS #12 */
+    MAX_UNICODE_SZ      = 256,
+    ASN_BOOL_SIZE       =   2,     /* including type */
+    SHA_SIZE            =  20,
+    RSA_INTS            =   8,     /* RSA ints in private key */
+    MIN_DATE_SIZE       =  13,
+    MAX_DATE_SIZE       =  32,
+    ASN_GEN_TIME_SZ     =  15,     /* 7 numbers * 2 + Zulu tag */
+    MAX_ENCODED_SIG_SZ  = 512,
+    MAX_SIG_SZ          = 256,
+    MAX_ALGO_SZ         =  20,
+    MAX_SEQ_SZ          =   5,     /* enum(seq | con) + length(4) */  
+    MAX_SET_SZ          =   5,     /* enum(set | con) + length(4) */  
+    MAX_VERSION_SZ      =   5,     /* enum + id + version(byte) + (header(2))*/
+    MAX_ENCODED_DIG_SZ  =  73,     /* sha512 + enum(bit or octet) + legnth(4) */
+    MAX_RSA_INT_SZ      = 517,     /* RSA raw sz 4096 for bits + tag + len(4) */
+    MAX_NTRU_KEY_SZ     = 610,     /* NTRU 112 bit public key */
+    MAX_NTRU_ENC_SZ     = 628,     /* NTRU 112 bit DER public encoding */
+    MAX_LENGTH_SZ       =   4,     /* Max length size for DER encoding */
+    MAX_RSA_E_SZ        =  16,     /* Max RSA public e size */
+    MAX_CA_SZ           =  32,     /* Max encoded CA basic constraint length */
+    MAX_SN_SZ           =  35,     /* Max encoded serial number (INT) length */
+#ifdef CYASSL_CERT_GEN
+    #ifdef CYASSL_ALT_NAMES
+        MAX_EXTENSIONS_SZ   = 1 + MAX_LENGTH_SZ + CTC_MAX_ALT_SIZE,
+    #else
+        MAX_EXTENSIONS_SZ   = 1 + MAX_LENGTH_SZ + MAX_CA_SZ,
+    #endif
+                                   /* Max total extensions, id + len + others */
+#endif
+    MAX_OCSP_EXT_SZ     = 58,      /* Max OCSP Extension length */
+    MAX_OCSP_NONCE_SZ   = 18,      /* OCSP Nonce size           */
+    MAX_PUBLIC_KEY_SZ   = MAX_NTRU_ENC_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2
+                                   /* use bigger NTRU size */
+};
+
+
+enum Oid_Types {
+    hashType = 0,
+    sigType  = 1,
+    keyType  = 2
+};
+
+
+enum Hash_Sum  {
+    MD2h    = 646,
+    MD5h    = 649,
+    SHAh    =  88,
+    SHA256h = 414,
+    SHA384h = 415,
+    SHA512h = 416
+};
+
+
+enum Key_Sum {
+    DSAk   = 515,
+    RSAk   = 645,
+    NTRUk  = 364,
+    ECDSAk = 518
+};
+
+
+enum Ecc_Sum {
+    ECC_256R1 = 526,
+    ECC_384R1 = 210,
+    ECC_521R1 = 211,
+    ECC_160R1 = 184,
+    ECC_192R1 = 520,
+    ECC_224R1 = 209
+};
+
+
+enum KDF_Sum {
+    PBKDF2_OID = 660
+};
+
+
+enum Extensions_Sum {
+    BASIC_CA_OID  = 133,
+    ALT_NAMES_OID = 131,
+    CRL_DIST_OID  = 145,
+    AUTH_INFO_OID = 69,
+    CA_ISSUER_OID = 117
+};
+
+
+enum VerifyType {
+    NO_VERIFY = 0,
+    VERIFY    = 1
+};
+
+
+typedef struct DNS_entry   DNS_entry;
+
+struct DNS_entry {
+    DNS_entry* next;   /* next on DNS list */
+    char*      name;   /* actual DNS name */
+};
+
+typedef struct DecodedCert DecodedCert;
+typedef struct Signer      Signer;
+
+
+struct DecodedCert {
+    byte*   publicKey;
+    word32  pubKeySize;
+    int     pubKeyStored;
+    word32  certBegin;               /* offset to start of cert          */
+    word32  sigIndex;                /* offset to start of signature     */
+    word32  sigLength;               /* length of signature              */
+    word32  signatureOID;            /* sum of algorithm object id       */
+    word32  keyOID;                  /* sum of key algo  object id       */
+    DNS_entry* altNames;             /* alt names list of dns entries    */
+    byte    subjectHash[SHA_SIZE];   /* hash of all Names                */
+    byte    issuerHash[SHA_SIZE];    /* hash of all Names                */
+#ifdef HAVE_OCSP
+    byte    issuerKeyHash[SHA_SIZE]; /* hash of the public Key           */
+#endif /* HAVE_OCSP */
+    byte*   signature;               /* not owned, points into raw cert  */
+    char*   subjectCN;               /* CommonName                       */
+    int     subjectCNLen;
+    int     subjectCNStored;         /* have we saved a copy we own      */
+    char    issuer[ASN_NAME_MAX];    /* full name including common name  */
+    char    subject[ASN_NAME_MAX];   /* full name including common name  */
+    int     verify;                  /* Default to yes, but could be off */
+    byte*   source;                  /* byte buffer holder cert, NOT owner */
+    word32  srcIdx;                  /* current offset into buffer       */
+    word32  maxIdx;                  /* max offset based on init size    */
+    void*   heap;                    /* for user memory overrides        */
+    byte    serial[EXTERNAL_SERIAL_SIZE];  /* raw serial number          */
+    int     serialSz;                /* raw serial bytes stored */
+    byte*   extensions;              /* not owned, points into raw cert  */
+    int     extensionsSz;            /* length of cert extensions */
+    word32  extensionsIdx;           /* if want to go back and parse later */
+    byte*   extAuthInfo;             /* Authority Information Access URI */
+    int     extAuthInfoSz;           /* length of the URI                */
+    byte*   extCrlInfo;              /* CRL Distribution Points          */
+    int     extCrlInfoSz;            /* length of the URI                */
+    byte    isCA;                    /* CA basic constraint true */
+#ifdef CYASSL_CERT_GEN
+    /* easy access to subject info for other sign */
+    char*   subjectSN;
+    int     subjectSNLen;
+    char*   subjectC;
+    int     subjectCLen;
+    char*   subjectL;
+    int     subjectLLen;
+    char*   subjectST;
+    int     subjectSTLen;
+    char*   subjectO;
+    int     subjectOLen;
+    char*   subjectOU;
+    int     subjectOULen;
+    char*   subjectEmail;
+    int     subjectEmailLen;
+    byte*   beforeDate;
+    int     beforeDateLen;
+    byte*   afterDate;
+    int     afterDateLen;
+#endif /* CYASSL_CERT_GEN */
+};
+
+
+/* CA Signers */
+struct Signer {
+    byte*   publicKey;
+    word32  pubKeySize;
+    word32  keyOID;                  /* key type */
+    char*   name;                    /* common name */
+    byte    hash[SHA_DIGEST_SIZE];   /* sha hash of names in certificate */
+    Signer* next;
+};
+
+
+/* not for public consumption but may use for testing sometimes */
+#ifdef CYASSL_TEST_CERT
+    #define CYASSL_TEST_API CYASSL_API
+#else
+    #define CYASSL_TEST_API CYASSL_LOCAL
+#endif
+
+CYASSL_TEST_API void FreeAltNames(DNS_entry*, void*);
+CYASSL_TEST_API void InitDecodedCert(DecodedCert*, byte*, word32, void*);
+CYASSL_TEST_API void FreeDecodedCert(DecodedCert*);
+CYASSL_TEST_API int  ParseCert(DecodedCert*, int type, int verify, void* cm);
+
+CYASSL_LOCAL int ParseCertRelative(DecodedCert*, int type, int verify,void* cm);
+CYASSL_LOCAL int DecodeToKey(DecodedCert*, int verify);
+
+CYASSL_LOCAL word32 EncodeSignature(byte* out, const byte* digest, word32 digSz,
+                                    int hashOID);
+
+CYASSL_LOCAL Signer* MakeSigner(void*);
+CYASSL_LOCAL void    FreeSigners(Signer*, void*);
+
+
+CYASSL_LOCAL int ToTraditional(byte* buffer, word32 length);
+CYASSL_LOCAL int ToTraditionalEnc(byte* buffer, word32 length,const char*, int);
+
+CYASSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType);
+
+#ifdef HAVE_ECC
+    /* ASN sig helpers */
+    CYASSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
+                                      mp_int* s);
+    CYASSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
+                                       mp_int* r, mp_int* s);
+    /* private key helpers */
+    CYASSL_LOCAL int EccPrivateKeyDecode(const byte* input,word32* inOutIdx,
+                                         ecc_key*,word32);
+#endif
+
+#ifdef CYASSL_CERT_GEN
+
+enum cert_enums {
+    NAME_ENTRIES    =  8,
+    JOINT_LEN       =  2,
+    EMAIL_JOINT_LEN =  9,
+    RSA_KEY         = 10,
+    NTRU_KEY        = 11
+};
+
+
+#endif /* CYASSL_CERT_GEN */
+
+
+
+/* for pointer use */
+typedef struct CertStatus CertStatus;
+
+#ifdef HAVE_OCSP
+
+enum Ocsp_Response_Status {
+    OCSP_SUCCESSFUL        = 0, /* Response has valid confirmations */
+    OCSP_MALFORMED_REQUEST = 1, /* Illegal confirmation request */
+    OCSP_INTERNAL_ERROR    = 2, /* Internal error in issuer */
+    OCSP_TRY_LATER         = 3, /* Try again later */
+    OCSP_SIG_REQUIRED      = 5, /* Must sign the request (4 is skipped) */
+    OCSP_UNAUTHROIZED      = 6  /* Request unauthorized */
+};
+
+
+enum Ocsp_Cert_Status {
+    CERT_GOOD    = 0,
+    CERT_REVOKED = 1,
+    CERT_UNKNOWN = 2
+};
+
+
+enum Ocsp_Sums {
+    OCSP_BASIC_OID = 117,
+    OCSP_NONCE_OID = 118
+};
+
+
+typedef struct OcspRequest  OcspRequest;
+typedef struct OcspResponse OcspResponse;
+
+
+struct CertStatus {
+    CertStatus* next;
+
+    byte serial[EXTERNAL_SERIAL_SIZE];
+    int serialSz;
+
+    int status;
+
+    byte thisDate[MAX_DATE_SIZE];
+    byte nextDate[MAX_DATE_SIZE];
+    byte thisDateFormat;
+    byte nextDateFormat;
+};
+
+
+struct OcspResponse {
+    int     responseStatus;  /* return code from Responder */
+
+    byte*   response;        /* Pointer to beginning of OCSP Response */
+    word32  responseSz;      /* length of the OCSP Response */
+
+    byte    producedDate[MAX_DATE_SIZE];
+                                                        /* Date at which this response was signed */
+    byte    producedDateFormat; /* format of the producedDate */
+    byte*   issuerHash;
+    byte*   issuerKeyHash;
+
+    byte*   cert;
+    word32  certSz;
+
+    byte*   sig;             /* Pointer to sig in source */
+    word32  sigSz;           /* Length in octets for the sig */
+    word32  sigOID;          /* OID for hash used for sig */
+
+    CertStatus* status;      /* certificate status to fill out */
+
+    byte*   nonce;           /* pointer to nonce inside ASN.1 response */
+    int     nonceSz;         /* length of the nonce string */
+
+    byte*   source;          /* pointer to source buffer, not owned */
+    word32  maxIdx;          /* max offset based on init size */
+};
+
+
+struct OcspRequest {
+    DecodedCert* cert;
+
+    byte    nonce[MAX_OCSP_NONCE_SZ];
+    int     nonceSz;
+
+    byte*   issuerHash;      /* pointer to issuerHash in source cert */
+    byte*   issuerKeyHash;   /* pointer to issuerKeyHash in source cert */
+    byte*   serial;          /* pointer to serial number in source cert */
+    int     serialSz;        /* length of the serial number */
+
+    byte*   dest;            /* pointer to the destination ASN.1 buffer */
+    word32  destSz;          /* length of the destination buffer */
+};
+
+
+CYASSL_LOCAL void InitOcspResponse(OcspResponse*, CertStatus*, byte*, word32);
+CYASSL_LOCAL int  OcspResponseDecode(OcspResponse*);
+
+CYASSL_LOCAL void InitOcspRequest(OcspRequest*, DecodedCert*, byte*, word32);
+CYASSL_LOCAL int  EncodeOcspRequest(OcspRequest*);
+
+CYASSL_LOCAL int  CompareOcspReqResp(OcspRequest*, OcspResponse*);
+
+
+#endif /* HAVE_OCSP */
+
+
+/* for pointer use */
+typedef struct RevokedCert RevokedCert;
+
+#ifdef HAVE_CRL
+
+struct RevokedCert {
+    byte         serialNumber[EXTERNAL_SERIAL_SIZE];
+    int          serialSz;
+    RevokedCert* next;
+};
+
+typedef struct DecodedCRL DecodedCRL;
+
+struct DecodedCRL {
+    word32  certBegin;               /* offset to start of cert          */
+    word32  sigIndex;                /* offset to start of signature     */
+    word32  sigLength;               /* length of signature              */
+    word32  signatureOID;            /* sum of algorithm object id       */
+    byte*   signature;               /* pointer into raw source, not owned */
+    byte    issuerHash[SHA_DIGEST_SIZE];  /* issuer hash                 */ 
+    byte    crlHash[MD5_DIGEST_SIZE];     /* raw crl data hash           */ 
+    byte    lastDate[MAX_DATE_SIZE]; /* last date updated  */
+    byte    nextDate[MAX_DATE_SIZE]; /* next update date   */
+    byte    lastDateFormat;          /* format of last date */
+    byte    nextDateFormat;          /* format of next date */
+    RevokedCert* certs;              /* revoked cert list  */
+    int          totalCerts;         /* number on list     */
+};
+
+CYASSL_LOCAL void InitDecodedCRL(DecodedCRL*);
+CYASSL_LOCAL int  ParseCRL(DecodedCRL*, const byte* buff, long sz, void* cm);
+CYASSL_LOCAL void FreeDecodedCRL(DecodedCRL*);
+
+
+#endif /* HAVE_CRL */
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_ASN_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn_public.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/asn_public.h
new file mode 100644 (file)
index 0000000..efc21fd
--- /dev/null
@@ -0,0 +1,155 @@
+/* asn_public.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_ASN_PUBLIC_H
+#define CTAO_CRYPT_ASN_PUBLIC_H
+
+#include <cyassl/ctaocrypt/types.h>
+#ifdef CYASSL_CERT_GEN
+    #include <cyassl/ctaocrypt/rsa.h>
+#endif
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* Certificate file Type */
+enum CertType {
+    CERT_TYPE       = 0, 
+    PRIVATEKEY_TYPE,
+    DH_PARAM_TYPE,
+    CRL_TYPE,
+    CA_TYPE
+};
+
+
+/* Signature type, by OID sum */
+enum Ctc_SigType {
+    CTC_SHAwDSA      = 517,
+    CTC_MD2wRSA      = 646,
+    CTC_MD5wRSA      = 648,
+    CTC_SHAwRSA      = 649,
+    CTC_SHAwECDSA    = 520,
+    CTC_SHA256wRSA   = 655,
+    CTC_SHA256wECDSA = 524,
+    CTC_SHA384wRSA   = 656,
+    CTC_SHA384wECDSA = 525,
+    CTC_SHA512wRSA   = 657,
+    CTC_SHA512wECDSA = 526
+};
+
+
+#ifdef CYASSL_CERT_GEN
+
+enum Ctc_Misc {
+    CTC_NAME_SIZE    =   64,
+    CTC_DATE_SIZE    =   32,
+    CTC_MAX_ALT_SIZE = 8192,    /* may be huge */
+    CTC_SERIAL_SIZE  =    8
+};
+
+typedef struct CertName {
+    char country[CTC_NAME_SIZE];
+    char state[CTC_NAME_SIZE];
+    char locality[CTC_NAME_SIZE];
+    char sur[CTC_NAME_SIZE];
+    char org[CTC_NAME_SIZE];
+    char unit[CTC_NAME_SIZE];
+    char commonName[CTC_NAME_SIZE];
+    char email[CTC_NAME_SIZE];  /* !!!! email has to be last !!!! */
+} CertName;
+
+
+/* for user to fill for certificate generation */
+typedef struct Cert {
+    int      version;                   /* x509 version  */
+    byte     serial[CTC_SERIAL_SIZE];   /* serial number */
+    int      sigType;                   /* signature algo type */
+    CertName issuer;                    /* issuer info */
+    int      daysValid;                 /* validity days */
+    int      selfSigned;                /* self signed flag */
+    CertName subject;                   /* subject info */
+    int      isCA;                      /* is this going to be a CA */
+    /* internal use only */
+    int      bodySz;                    /* pre sign total size */
+    int      keyType;                   /* public key type of subject */
+#ifdef CYASSL_ALT_NAMES
+    byte     altNames[CTC_MAX_ALT_SIZE]; /* altNames copy */
+    int      altNamesSz;                 /* altNames size in bytes */
+    byte     beforeDate[CTC_DATE_SIZE];  /* before date copy */
+    int      beforeDateSz;               /* size of copy */
+    byte     afterDate[CTC_DATE_SIZE];   /* after date copy */
+    int      afterDateSz;                /* size of copy */
+#endif
+} Cert;
+
+
+
+
+/* Initialize and Set Certficate defaults:
+   version    = 3 (0x2)
+   serial     = 0 (Will be randomly generated)
+   sigType    = SHA_WITH_RSA
+   issuer     = blank
+   daysValid  = 500
+   selfSigned = 1 (true) use subject as issuer
+   subject    = blank
+   isCA       = 0 (false)
+   keyType    = RSA_KEY (default)
+*/
+CYASSL_API void InitCert(Cert*);
+CYASSL_API int  MakeCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*, RNG*);
+CYASSL_API int  SignCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*, RNG*);
+CYASSL_API int  MakeSelfCert(Cert*, byte* derBuffer, word32 derSz, RsaKey*,
+                             RNG*);
+CYASSL_API int  SetIssuer(Cert*, const char*);
+CYASSL_API int  SetSubject(Cert*, const char*);
+#ifdef CYASSL_ALT_NAMES
+    CYASSL_API int  SetAltNames(Cert*, const char*);
+#endif
+CYASSL_API int  SetIssuerBuffer(Cert*, const byte*, int);
+CYASSL_API int  SetSubjectBuffer(Cert*, const byte*, int);
+CYASSL_API int  SetAltNamesBuffer(Cert*, const byte*, int);
+CYASSL_API int  SetDatesBuffer(Cert*, const byte*, int);
+
+    #ifdef HAVE_NTRU
+        CYASSL_API int  MakeNtruCert(Cert*, byte* derBuffer, word32 derSz,
+                                     const byte* ntruKey, word16 keySz, RNG*);
+    #endif
+
+#endif /* CYASSL_CERT_GEN */
+
+
+#if defined(CYASSL_KEY_GEN) || defined(CYASSL_CERT_GEN)
+    CYASSL_API int DerToPem(const byte* der, word32 derSz, byte* output,
+                            word32 outputSz, int type);
+#endif
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_ASN_PUBLIC_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/coding.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/coding.h
new file mode 100644 (file)
index 0000000..5bed100
--- /dev/null
@@ -0,0 +1,51 @@
+/* coding.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_CODING_H
+#define CTAO_CRYPT_CODING_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* decode needed by CyaSSL */
+CYASSL_LOCAL int Base64_Decode(const byte* in, word32 inLen, byte* out,
+                               word32* outLen);
+
+#if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(CYASSL_KEY_GEN)  || defined(CYASSL_CERT_GEN) || defined(HAVE_WEBSERVER)
+    /* encode isn't */
+    CYASSL_API
+    int Base64_Encode(const byte* in, word32 inLen, byte* out,
+                                  word32* outLen);
+    CYASSL_LOCAL 
+    int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
+#endif
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_CODING_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/des3.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/des3.h
new file mode 100644 (file)
index 0000000..adae9a9
--- /dev/null
@@ -0,0 +1,81 @@
+/* des3.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_DES3
+
+#ifndef CTAO_CRYPT_DES3_H
+#define CTAO_CRYPT_DES3_H
+
+
+#include <cyassl/ctaocrypt/types.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+enum {
+    DES_ENC_TYPE    = 2,     /* cipher unique type */
+    DES3_ENC_TYPE   = 3,     /* cipher unique type */
+    DES_BLOCK_SIZE  = 8,
+    DES_KS_SIZE     = 32,
+
+    DES_ENCRYPTION  = 0,
+    DES_DECRYPTION  = 1,
+};
+
+
+/* DES encryption and decryption */
+typedef struct Des {
+    word32 key[DES_KS_SIZE];
+    word32 reg[DES_BLOCK_SIZE / sizeof(word32)];      /* for CBC mode */
+    word32 tmp[DES_BLOCK_SIZE / sizeof(word32)];      /* same         */
+} Des;
+
+
+/* DES3 encryption and decryption */
+typedef struct Des3 {
+    word32 key[3][DES_KS_SIZE];
+    word32 reg[DES_BLOCK_SIZE / sizeof(word32)];      /* for CBC mode */
+    word32 tmp[DES_BLOCK_SIZE / sizeof(word32)];      /* same         */
+} Des3;
+
+
+CYASSL_API void Des_SetKey(Des* des, const byte* key, const byte* iv, int dir);
+CYASSL_API void Des_SetIV(Des* des, const byte* iv);
+CYASSL_API void Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz);
+CYASSL_API void Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz);
+CYASSL_API void Des_EcbEncrypt(Des* des, byte* out, const byte* in, word32 sz);
+
+CYASSL_API void Des3_SetKey(Des3* des, const byte* key, const byte* iv,int dir);
+CYASSL_API void Des3_SetIV(Des3* des, const byte* iv);
+CYASSL_API void Des3_CbcEncrypt(Des3* des, byte* out, const byte* in,word32 sz);
+CYASSL_API void Des3_CbcDecrypt(Des3* des, byte* out, const byte* in,word32 sz);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* NO_DES3 */
+#endif /* CTAO_CRYPT_DES3_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dh.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dh.h
new file mode 100644 (file)
index 0000000..0b002ac
--- /dev/null
@@ -0,0 +1,67 @@
+/* dh.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_DH
+
+#ifndef CTAO_CRYPT_DH_H
+#define CTAO_CRYPT_DH_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/integer.h>
+#include <cyassl/ctaocrypt/random.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* Diffie-Hellman Key */
+typedef struct DhKey {
+    mp_int p, g;                            /* group parameters  */
+} DhKey;
+
+
+CYASSL_API void InitDhKey(DhKey* key);
+CYASSL_API void FreeDhKey(DhKey* key);
+
+CYASSL_API int DhGenerateKeyPair(DhKey* key, RNG* rng, byte* priv,
+                                 word32* privSz, byte* pub, word32* pubSz);
+CYASSL_API int DhAgree(DhKey* key, byte* agree, word32* agreeSz,
+                       const byte* priv, word32 privSz, const byte* otherPub,
+                       word32 pubSz);
+
+CYASSL_API int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
+                           word32);
+CYASSL_API int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
+                        word32 gSz);
+CYASSL_API int DhParamsLoad(const byte* input, word32 inSz, byte* p,
+                            word32* pInOutSz, byte* g, word32* gInOutSz);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_DH_H */
+
+#endif /* NO_DH */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dsa.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/dsa.h
new file mode 100644 (file)
index 0000000..2264773
--- /dev/null
@@ -0,0 +1,67 @@
+/* dsa.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_DSA
+
+#ifndef CTAO_CRYPT_DSA_H
+#define CTAO_CRYPT_DSA_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/integer.h>
+#include <cyassl/ctaocrypt/random.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    DSA_PUBLIC   = 0,
+    DSA_PRIVATE  = 1
+};
+
+/* DSA */
+typedef struct DsaKey {
+    mp_int p, q, g, y, x;
+    int type;                               /* public or private */
+} DsaKey;
+
+
+CYASSL_API void InitDsaKey(DsaKey* key);
+CYASSL_API void FreeDsaKey(DsaKey* key);
+
+CYASSL_API int DsaSign(const byte* digest, byte* out, DsaKey* key, RNG* rng);
+CYASSL_API int DsaVerify(const byte* digest, const byte* sig, DsaKey* key,
+                         int* answer);
+
+CYASSL_API int DsaPublicKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
+                                  word32);
+CYASSL_API int DsaPrivateKeyDecode(const byte* input, word32* inOutIdx, DsaKey*,
+                                   word32);
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_DSA_H */
+#endif /* NO_DSA */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ecc.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ecc.h
new file mode 100644 (file)
index 0000000..4d54c04
--- /dev/null
@@ -0,0 +1,129 @@
+/* ecc.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_ECC
+
+#ifndef CTAO_CRYPT_ECC_H
+#define CTAO_CRYPT_ECC_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/integer.h>
+#include <cyassl/ctaocrypt/random.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    ECC_PUBLICKEY  = 1,
+    ECC_PRIVATEKEY = 2,
+    ECC_MAXNAME    = 16,     /* MAX CURVE NAME LENGTH */
+    SIG_HEADER_SZ  =  6,     /* ECC signature header size */
+    ECC_BUFSIZE    = 256,    /* for exported keys temp buffer */
+    ECC_MINSIZE    = 20,     /* MIN Private Key size */
+    ECC_MAXSIZE    = 66      /* MAX Private Key size */
+};
+
+
+/* ECC set type defined a NIST GF(p) curve */
+typedef struct {
+    int size;       /* The size of the curve in octets */
+    const char* name;     /* name of this curve */
+    const char* prime;    /* prime that defines the field, curve is in (hex) */
+    const char* B;        /* fields B param (hex) */
+    const char* order;    /* order of the curve (hex) */
+    const char* Gx;       /* x coordinate of the base point on curve (hex) */
+    const char* Gy;       /* y coordinate of the base point on curve (hex) */
+} ecc_set_type;
+
+
+/* A point on an ECC curve, stored in Jacbobian format such that (x,y,z) =>
+   (x/z^2, y/z^3, 1) when interpreted as affine */
+typedef struct {
+    mp_int x;        /* The x coordinate */
+    mp_int y;        /* The y coordinate */
+    mp_int z;        /* The z coordinate */
+} ecc_point;
+
+
+/* An ECC Key */
+typedef struct {
+    int type;           /* Public or Private */
+    int idx;            /* Index into the ecc_sets[] for the parameters of
+                           this curve if -1, this key is using user supplied
+                           curve in dp */
+    const ecc_set_type* dp;     /* domain parameters, either points to NIST
+                                   curves (idx >= 0) or user supplied */
+    ecc_point pubkey;   /* public key */  
+    mp_int    k;        /* private key */
+} ecc_key;
+
+
+/* ECC predefined curve sets  */
+extern const ecc_set_type ecc_sets[];
+
+
+CYASSL_API
+int ecc_make_key(RNG* rng, int keysize, ecc_key* key);
+CYASSL_API
+int ecc_shared_secret(ecc_key* private_key, ecc_key* public_key, byte* out,
+                      word32* outlen);
+CYASSL_API
+int ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen, 
+                  RNG* rng, ecc_key* key);
+CYASSL_API
+int ecc_verify_hash(const byte* sig, word32 siglen, byte* hash, word32 hashlen, 
+                    int* stat, ecc_key* key);
+CYASSL_API
+void ecc_init(ecc_key* key);
+CYASSL_API
+void ecc_free(ecc_key* key);
+
+
+/* ASN key helpers */
+CYASSL_API
+int ecc_export_x963(ecc_key*, byte* out, word32* outLen);
+CYASSL_API
+int ecc_import_x963(const byte* in, word32 inLen, ecc_key* key);
+CYASSL_API
+int ecc_import_private_key(const byte* priv, word32 privSz, const byte* pub,
+                           word32 pubSz, ecc_key* key);
+
+/* size helper */
+CYASSL_API
+int ecc_size(ecc_key* key);
+CYASSL_API
+int ecc_sig_size(ecc_key* key);
+
+/* TODO: fix mutex types */
+#define MUTEX_GLOBAL(x) int (x);
+#define MUTEX_LOCK(x)
+#define MUTEX_UNLOCK(x)
+
+
+
+#ifdef __cplusplus
+    }    /* extern "C" */    
+#endif
+
+#endif /* CTAO_CRYPT_ECC_H */
+#endif /* HAVE_ECC */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/error.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/error.h
new file mode 100644 (file)
index 0000000..8a0d586
--- /dev/null
@@ -0,0 +1,115 @@
+/* error.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_ERROR_H
+#define CTAO_CRYPT_ERROR_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* error codes */
+enum {
+    MAX_ERROR_SZ       =  80,   /* max size of error string */
+    MAX_CODE_E         = -100,  /* errors -101 - -199 */
+    OPEN_RAN_E         = -101,  /* opening random device error */
+    READ_RAN_E         = -102,  /* reading random device error */
+    WINCRYPT_E         = -103,  /* windows crypt init error */
+    CRYPTGEN_E         = -104,  /* windows crypt generation error */
+    RAN_BLOCK_E        = -105,  /* reading random device would block */
+
+    MP_INIT_E          = -110,  /* mp_init error state */
+    MP_READ_E          = -111,  /* mp_read error state */
+    MP_EXPTMOD_E       = -112,  /* mp_exptmod error state */
+    MP_TO_E            = -113,  /* mp_to_xxx error state, can't convert */
+    MP_SUB_E           = -114,  /* mp_sub error state, can't subtract */
+    MP_ADD_E           = -115,  /* mp_add error state, can't add */
+    MP_MUL_E           = -116,  /* mp_mul error state, can't multiply */
+    MP_MULMOD_E        = -117,  /* mp_mulmod error state, can't multiply mod */
+    MP_MOD_E           = -118,  /* mp_mod error state, can't mod */
+    MP_INVMOD_E        = -119,  /* mp_invmod error state, can't inv mod */
+    MP_CMP_E           = -120,  /* mp_cmp error state */
+    MP_ZERO_E          = -121,  /* got a mp zero result, not expected */
+
+    MEMORY_E           = -125,  /* out of memory error */
+
+    RSA_WRONG_TYPE_E   = -130,  /* RSA wrong block type for RSA function */
+    RSA_BUFFER_E       = -131,  /* RSA buffer error, output too small or 
+                                   input too large */
+    BUFFER_E           = -132,  /* output buffer too small or input too large */
+    ALGO_ID_E          = -133,  /* setting algo id error */
+    PUBLIC_KEY_E       = -134,  /* setting public key error */
+    DATE_E             = -135,  /* setting date validity error */
+    SUBJECT_E          = -136,  /* setting subject name error */
+    ISSUER_E           = -137,  /* setting issuer  name error */
+    CA_TRUE_E          = -138,  /* setting CA basic constraint true error */
+    EXTENSIONS_E       = -139,  /* setting extensions error */
+
+    ASN_PARSE_E        = -140,  /* ASN parsing error, invalid input */
+    ASN_VERSION_E      = -141,  /* ASN version error, invalid number */
+    ASN_GETINT_E       = -142,  /* ASN get big int error, invalid data */
+    ASN_RSA_KEY_E      = -143,  /* ASN key init error, invalid input */
+    ASN_OBJECT_ID_E    = -144,  /* ASN object id error, invalid id */
+    ASN_TAG_NULL_E     = -145,  /* ASN tag error, not null */
+    ASN_EXPECT_0_E     = -146,  /* ASN expect error, not zero */
+    ASN_BITSTR_E       = -147,  /* ASN bit string error, wrong id */
+    ASN_UNKNOWN_OID_E  = -148,  /* ASN oid error, unknown sum id */
+    ASN_DATE_SZ_E      = -149,  /* ASN date error, bad size */
+    ASN_BEFORE_DATE_E  = -150,  /* ASN date error, current date before */
+    ASN_AFTER_DATE_E   = -151,  /* ASN date error, current date after */
+    ASN_SIG_OID_E      = -152,  /* ASN signature error, mismatched oid */
+    ASN_TIME_E         = -153,  /* ASN time error, unknown time type */
+    ASN_INPUT_E        = -154,  /* ASN input error, not enough data */
+    ASN_SIG_CONFIRM_E  = -155,  /* ASN sig error, confirm failure */
+    ASN_SIG_HASH_E     = -156,  /* ASN sig error, unsupported hash type */
+    ASN_SIG_KEY_E      = -157,  /* ASN sig error, unsupported key type */
+    ASN_DH_KEY_E       = -158,  /* ASN key init error, invalid input */
+    ASN_NTRU_KEY_E     = -159,  /* ASN ntru key decode error, invalid input */
+
+    ECC_BAD_ARG_E      = -170,  /* ECC input argument of wrong type */
+    ASN_ECC_KEY_E      = -171,  /* ASN ECC bad input */
+    ECC_CURVE_OID_E    = -172,  /* Unsupported ECC OID curve type */
+    BAD_FUNC_ARG       = -173,  /* Bad function argument provided */
+    NOT_COMPILED_IN    = -174,  /* Feature not compiled in */
+    UNICODE_SIZE_E     = -175,  /* Unicode password too big */
+    NO_PASSWORD        = -176,  /* no password provided by user */
+    ALT_NAME_E         = -177,  /* alt name size problem, too big */
+
+    AES_GCM_AUTH_E     = -180,  /* AES-GCM Authentication check failure */
+
+    MIN_CODE_E         = -200   /* errors -101 - -199 */
+};
+
+
+CYASSL_API void CTaoCryptErrorString(int error, char* buffer);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_ERROR_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hc128.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hc128.h
new file mode 100644 (file)
index 0000000..d3e5f21
--- /dev/null
@@ -0,0 +1,60 @@
+/* hc128.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_HC128
+
+#ifndef CTAO_CRYPT_HC128_H
+#define CTAO_CRYPT_HC128_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+       HC128_ENC_TYPE    =  6    /* cipher unique type */
+};
+
+/* HC-128 stream cipher */
+typedef struct HC128 {
+    word32 T[1024];             /* P[i] = T[i];  Q[i] = T[1024 + i ]; */
+    word32 X[16];
+    word32 Y[16];
+    word32 counter1024;         /* counter1024 = i mod 1024 at the ith step */
+    word32 key[8];
+    word32 iv[8];
+} HC128;
+
+
+CYASSL_API void Hc128_Process(HC128*, byte*, const byte*, word32);
+CYASSL_API void Hc128_SetKey(HC128*, const byte* key, const byte* iv);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_HC128_H */
+
+#endif /* HAVE_HC128 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hmac.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/hmac.h
new file mode 100644 (file)
index 0000000..ee11669
--- /dev/null
@@ -0,0 +1,99 @@
+/* hmac.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_HMAC
+
+#ifndef CTAO_CRYPT_HMAC_H
+#define CTAO_CRYPT_HMAC_H
+
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/sha.h>
+
+#ifndef NO_SHA256
+    #include <cyassl/ctaocrypt/sha256.h>
+#endif
+
+#ifdef CYASSL_SHA384
+    #include <cyassl/ctaocrypt/sha512.h>
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    IPAD    = 0x36,
+    OPAD    = 0x5C,
+#if defined(CYASSL_SHA384)
+    INNER_HASH_SIZE = SHA384_DIGEST_SIZE,
+    HMAC_BLOCK_SIZE = SHA384_BLOCK_SIZE
+#elif !defined(NO_SHA256)
+    INNER_HASH_SIZE = SHA256_DIGEST_SIZE,
+    HMAC_BLOCK_SIZE = SHA256_BLOCK_SIZE,
+    SHA384          = 5
+#else
+    INNER_HASH_SIZE = SHA_DIGEST_SIZE,
+    HMAC_BLOCK_SIZE = SHA_BLOCK_SIZE,
+    SHA256          = 2,                     /* hash type unique */
+    SHA384          = 5
+#endif
+};
+
+
+/* hash union */
+typedef union {
+    Md5 md5;
+    Sha sha;
+    #ifndef NO_SHA256
+        Sha256 sha256;
+    #endif
+    #ifdef CYASSL_SHA384
+        Sha384 sha384;
+    #endif
+} Hash;
+
+/* Hmac digest */
+typedef struct Hmac {
+    Hash    hash;
+    word32  ipad[HMAC_BLOCK_SIZE  / sizeof(word32)];  /* same block size all*/
+    word32  opad[HMAC_BLOCK_SIZE  / sizeof(word32)];
+    word32  innerHash[INNER_HASH_SIZE / sizeof(word32)]; /* max size */
+    byte    macType;                                     /* md5 sha or sha256 */
+    byte    innerHashKeyed;                              /* keyed flag */
+} Hmac;
+
+
+/* does init */
+CYASSL_API void HmacSetKey(Hmac*, int type, const byte* key, word32 keySz);
+CYASSL_API void HmacUpdate(Hmac*, const byte*, word32);
+CYASSL_API void HmacFinal(Hmac*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_HMAC_H */
+
+#endif /* NO_HMAC */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/include.am b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/include.am
new file mode 100644 (file)
index 0000000..6b27ff1
--- /dev/null
@@ -0,0 +1,37 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+nobase_include_HEADERS+= \
+                         cyassl/ctaocrypt/aes.h \
+                         cyassl/ctaocrypt/arc4.h \
+                         cyassl/ctaocrypt/asn.h \
+                         cyassl/ctaocrypt/asn_public.h \
+                         cyassl/ctaocrypt/coding.h \
+                         cyassl/ctaocrypt/des3.h \
+                         cyassl/ctaocrypt/dh.h \
+                         cyassl/ctaocrypt/dsa.h \
+                         cyassl/ctaocrypt/ecc.h \
+                         cyassl/ctaocrypt/error.h \
+                         cyassl/ctaocrypt/hc128.h \
+                         cyassl/ctaocrypt/hmac.h \
+                         cyassl/ctaocrypt/integer.h \
+                         cyassl/ctaocrypt/md2.h \
+                         cyassl/ctaocrypt/md4.h \
+                         cyassl/ctaocrypt/md5.h \
+                         cyassl/ctaocrypt/misc.h \
+                         cyassl/ctaocrypt/pwdbased.h \
+                         cyassl/ctaocrypt/rabbit.h \
+                         cyassl/ctaocrypt/random.h \
+                         cyassl/ctaocrypt/ripemd.h \
+                         cyassl/ctaocrypt/rsa.h \
+                         cyassl/ctaocrypt/settings.h \
+                         cyassl/ctaocrypt/sha256.h \
+                         cyassl/ctaocrypt/sha512.h \
+                         cyassl/ctaocrypt/sha.h \
+                         cyassl/ctaocrypt/tfm.h \
+                         cyassl/ctaocrypt/types.h \
+                         cyassl/ctaocrypt/visibility.h \
+                         cyassl/ctaocrypt/logging.h \
+                         cyassl/ctaocrypt/memory.h \
+                         cyassl/ctaocrypt/mpi_class.h \
+                         cyassl/ctaocrypt/mpi_superclass.h
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/integer.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/integer.h
new file mode 100644 (file)
index 0000000..ff1c591
--- /dev/null
@@ -0,0 +1,329 @@
+/* integer.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/*
+ * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca,
+ * http://math.libtomcrypt.com
+ */
+
+
+#ifndef CTAO_CRYPT_INTEGER_H
+#define CTAO_CRYPT_INTEGER_H
+
+/* may optionally use fast math instead, not yet supported on all platforms and
+   may not be faster on all
+*/
+#include <cyassl/ctaocrypt/types.h>       /* will set MP_xxBIT if not default */
+#ifdef USE_FAST_MATH
+    #include <cyassl/ctaocrypt/tfm.h>
+#else
+
+#ifndef CHAR_BIT
+    #include <limits.h>
+#endif
+
+#include <cyassl/ctaocrypt/mpi_class.h>
+
+#ifndef MIN
+   #define MIN(x,y) ((x)<(y)?(x):(y))
+#endif
+
+#ifndef MAX
+   #define MAX(x,y) ((x)>(y)?(x):(y))
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+
+/* C++ compilers don't like assigning void * to mp_digit * */
+#define  OPT_CAST(x)  (x *)
+
+#else
+
+/* C on the other hand doesn't care */
+#define  OPT_CAST(x)
+
+#endif
+
+
+/* detect 64-bit mode if possible */
+#if defined(__x86_64__) 
+   #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
+      #define MP_64BIT
+   #endif
+#endif
+
+/* some default configurations.
+ *
+ * A "mp_digit" must be able to hold DIGIT_BIT + 1 bits
+ * A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
+ *
+ * At the very least a mp_digit must be able to hold 7 bits
+ * [any size beyond that is ok provided it doesn't overflow the data type]
+ */
+#ifdef MP_8BIT
+   typedef unsigned char      mp_digit;
+   typedef unsigned short     mp_word;
+#elif defined(MP_16BIT)
+   typedef unsigned short     mp_digit;
+   typedef unsigned long      mp_word;
+#elif defined(MP_64BIT)
+   /* for GCC only on supported platforms */
+#ifndef CRYPT
+   typedef unsigned long long ulong64;
+   typedef signed long long   long64;
+#endif
+
+   typedef unsigned long      mp_digit;
+   typedef unsigned long      mp_word __attribute__ ((mode(TI)));
+
+   #define DIGIT_BIT          60
+#else
+   /* this is the default case, 28-bit digits */
+   
+   /* this is to make porting into LibTomCrypt easier :-) */
+#ifndef CRYPT
+   #if defined(_MSC_VER) || defined(__BORLANDC__) 
+      typedef unsigned __int64   ulong64;
+      typedef signed __int64     long64;
+   #else
+      typedef unsigned long long ulong64;
+      typedef signed long long   long64;
+   #endif
+#endif
+
+   typedef unsigned int       mp_digit;  /* long could be 64 now, changed TAO */
+   typedef ulong64            mp_word;
+
+#ifdef MP_31BIT   
+   /* this is an extension that uses 31-bit digits */
+   #define DIGIT_BIT          31
+#else
+   /* default case is 28-bit digits, defines MP_28BIT as a handy test macro */
+   #define DIGIT_BIT          28
+   #define MP_28BIT
+#endif   
+#endif
+
+
+/* otherwise the bits per digit is calculated automatically from the size of
+   a mp_digit */
+#ifndef DIGIT_BIT
+   #define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1)))
+      /* bits per digit */
+#endif
+
+#define MP_DIGIT_BIT     DIGIT_BIT
+#define MP_MASK          ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
+#define MP_DIGIT_MAX     MP_MASK
+
+/* equalities */
+#define MP_LT        -1   /* less than */
+#define MP_EQ         0   /* equal to */
+#define MP_GT         1   /* greater than */
+
+#define MP_ZPOS       0   /* positive integer */
+#define MP_NEG        1   /* negative */
+
+#define MP_OKAY       0   /* ok result */
+#define MP_MEM        -2  /* out of mem */
+#define MP_VAL        -3  /* invalid input */
+#define MP_RANGE      MP_VAL
+
+#define MP_YES        1   /* yes response */
+#define MP_NO         0   /* no response */
+
+/* Primality generation flags */
+#define LTM_PRIME_BBS      0x0001 /* BBS style prime */
+#define LTM_PRIME_SAFE     0x0002 /* Safe prime (p-1)/2 == prime */
+#define LTM_PRIME_2MSB_ON  0x0008 /* force 2nd MSB to 1 */
+
+typedef int           mp_err;
+
+/* define this to use lower memory usage routines (exptmods mostly) */
+#define MP_LOW_MEM
+
+/* default precision */
+#ifndef MP_PREC
+   #ifndef MP_LOW_MEM
+      #define MP_PREC                 32     /* default digits of precision */
+   #else
+      #define MP_PREC                 1      /* default digits of precision */
+   #endif   
+#endif
+
+/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - 
+   BITS_PER_DIGIT*2) */
+#define MP_WARRAY  (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
+
+/* the infamous mp_int structure */
+typedef struct  {
+    int used, alloc, sign;
+    mp_digit *dp;
+} mp_int;
+
+/* callback for mp_prime_random, should fill dst with random bytes and return
+   how many read [upto len] */
+typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
+
+
+#define USED(m)    ((m)->used)
+#define DIGIT(m,k) ((m)->dp[(k)])
+#define SIGN(m)    ((m)->sign)
+
+
+/* ---> Basic Manipulations <--- */
+#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
+#define mp_iseven(a) \
+    (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
+#define mp_isodd(a) \
+    (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
+
+
+/* number of primes */
+#ifdef MP_8BIT
+   #define PRIME_SIZE      31
+#else
+   #define PRIME_SIZE      256
+#endif
+
+#define mp_prime_random(a, t, size, bbs, cb, dat) \
+   mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat)
+
+#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len))
+#define mp_raw_size(mp)           mp_signed_bin_size(mp)
+#define mp_toraw(mp, str)         mp_to_signed_bin((mp), (str))
+#define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len))
+#define mp_mag_size(mp)           mp_unsigned_bin_size(mp)
+#define mp_tomag(mp, str)         mp_to_unsigned_bin((mp), (str))
+
+#define mp_tobinary(M, S)  mp_toradix((M), (S), 2)
+#define mp_tooctal(M, S)   mp_toradix((M), (S), 8)
+#define mp_todecimal(M, S) mp_toradix((M), (S), 10)
+#define mp_tohex(M, S)     mp_toradix((M), (S), 16)
+
+#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
+
+extern const char *mp_s_rmap;
+
+/* 6 functions needed by Rsa */
+int  mp_init (mp_int * a);
+void mp_clear (mp_int * a);
+int  mp_unsigned_bin_size(mp_int * a);
+int  mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
+int  mp_to_unsigned_bin (mp_int * a, unsigned char *b);
+int  mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
+/* end functions needed by Rsa */
+
+/* functions added to support above needed, removed TOOM and KARATSUBA */
+int  mp_count_bits (mp_int * a);
+int  mp_init_copy (mp_int * a, mp_int * b);
+int  mp_copy (mp_int * a, mp_int * b);
+int  mp_grow (mp_int * a, int size);
+void bn_reverse (unsigned char *s, int len);
+int  mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d);
+void mp_zero (mp_int * a);
+void mp_clamp (mp_int * a);
+void mp_exch (mp_int * a, mp_int * b);
+void mp_rshd (mp_int * a, int b);
+int  mp_mod_2d (mp_int * a, int b, mp_int * c);
+int  mp_mul_2d (mp_int * a, int b, mp_int * c);
+int  mp_lshd (mp_int * a, int b);
+int  mp_abs (mp_int * a, mp_int * b);
+int  mp_invmod (mp_int * a, mp_int * b, mp_int * c);
+int  fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
+int  mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
+int  mp_cmp_mag (mp_int * a, mp_int * b);
+int  mp_cmp (mp_int * a, mp_int * b);
+int  mp_cmp_d(mp_int * a, mp_digit b);
+void mp_set (mp_int * a, mp_digit b);
+int  mp_mod (mp_int * a, mp_int * b, mp_int * c);
+int  mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d);
+int  mp_div_2(mp_int * a, mp_int * b);
+int  mp_add (mp_int * a, mp_int * b, mp_int * c);
+int  s_mp_add (mp_int * a, mp_int * b, mp_int * c);
+int  s_mp_sub (mp_int * a, mp_int * b, mp_int * c);
+int  mp_sub (mp_int * a, mp_int * b, mp_int * c);
+int  mp_reduce_is_2k_l(mp_int *a);
+int  mp_reduce_is_2k(mp_int *a);
+int  mp_dr_is_modulus(mp_int *a);
+int  mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int);
+int  mp_montgomery_setup (mp_int * n, mp_digit * rho);
+int  fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
+int  mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
+void mp_dr_setup(mp_int *a, mp_digit *d);
+int  mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k);
+int  mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d);
+int  fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
+int  s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
+int  mp_reduce_2k_setup_l(mp_int *a, mp_int *d);
+int  mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d);
+int  mp_reduce (mp_int * x, mp_int * m, mp_int * mu);
+int  mp_reduce_setup (mp_int * a, mp_int * b);
+int  s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode);
+int  mp_montgomery_calc_normalization (mp_int * a, mp_int * b);
+int  s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
+int  s_mp_sqr (mp_int * a, mp_int * b);
+int  fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
+int  fast_s_mp_sqr (mp_int * a, mp_int * b);
+int  mp_init_size (mp_int * a, int size);
+int  mp_div_3 (mp_int * a, mp_int *c, mp_digit * d);
+int  mp_mul_2(mp_int * a, mp_int * b);
+int  mp_mul (mp_int * a, mp_int * b, mp_int * c);
+int  mp_sqr (mp_int * a, mp_int * b);
+int  mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
+int  mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
+int  mp_2expt (mp_int * a, int b);
+int  mp_reduce_2k_setup(mp_int *a, mp_digit *d);
+int  mp_add_d (mp_int* a, mp_digit b, mp_int* c);
+int mp_set_int (mp_int * a, unsigned long b);
+/* end support added functions */
+
+/* added */
+int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
+                  mp_int* f);
+
+#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
+    int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
+#endif
+#ifdef HAVE_ECC
+    int mp_read_radix(mp_int* a, const char* str, int radix);
+#endif
+
+#ifdef CYASSL_KEY_GEN
+    int mp_prime_is_prime (mp_int * a, int t, int *result);
+    int mp_gcd (mp_int * a, mp_int * b, mp_int * c);
+    int mp_lcm (mp_int * a, mp_int * b, mp_int * c);
+#endif
+
+#if defined(CYASSL_KEY_GEN) || defined(HAVE_ECC) || !defined(NO_PWDBASED)
+    int mp_sub_d (mp_int * a, mp_digit b, mp_int * c);
+#endif
+
+#ifdef __cplusplus
+   }
+#endif
+
+
+#endif /* USE_FAST_MATH */
+
+#endif  /* CTAO_CRYPT_INTEGER_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/logging.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/logging.h
new file mode 100644 (file)
index 0000000..efe3d3b
--- /dev/null
@@ -0,0 +1,70 @@
+/* logging.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* submitted by eof */
+
+
+#ifndef CYASSL_LOGGING_H
+#define CYASSL_LOGGING_H
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum  CYA_Log_Levels {
+    ERROR_LOG = 0,
+    INFO_LOG,
+    ENTER_LOG,
+    LEAVE_LOG,
+    OTHER_LOG
+};
+
+typedef void (*CyaSSL_Logging_cb)(const int logLevel,
+                                  const char *const logMessage);
+
+CYASSL_API int CyaSSL_SetLoggingCb(CyaSSL_Logging_cb log_function);
+
+
+#ifdef DEBUG_CYASSL
+
+    void CYASSL_ENTER(const char* msg);
+    void CYASSL_LEAVE(const char* msg, int ret);
+
+    void CYASSL_ERROR(int);
+    void CYASSL_MSG(const char* msg);
+
+#else /* DEBUG_CYASSL   */
+
+    #define CYASSL_ENTER(m)
+    #define CYASSL_LEAVE(m, r)
+
+    #define CYASSL_ERROR(e) 
+    #define CYASSL_MSG(m)
+
+#endif /* DEBUG_CYASSL  */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CYASSL_MEMORY_H */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md2.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md2.h
new file mode 100644 (file)
index 0000000..a57a92f
--- /dev/null
@@ -0,0 +1,64 @@
+/* md2.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef CYASSL_MD2
+
+#ifndef CTAO_CRYPT_MD2_H
+#define CTAO_CRYPT_MD2_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    MD2             =  6,    /* hash type unique */
+    MD2_BLOCK_SIZE  = 16,
+    MD2_DIGEST_SIZE = 16,
+    MD2_PAD_SIZE    = 16,
+    MD2_X_SIZE      = 48
+};
+
+
+/* Md2 digest */
+typedef struct Md2 {
+    word32  count;   /* bytes % PAD_SIZE  */
+    byte    X[MD2_X_SIZE];
+    byte    C[MD2_BLOCK_SIZE];
+    byte    buffer[MD2_BLOCK_SIZE];
+} Md2;
+
+
+CYASSL_API void InitMd2(Md2*);
+CYASSL_API void Md2Update(Md2*, const byte*, word32);
+CYASSL_API void Md2Final(Md2*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_MD2_H */
+#endif /* CYASSL_MD2 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md4.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md4.h
new file mode 100644 (file)
index 0000000..f6e8c7b
--- /dev/null
@@ -0,0 +1,65 @@
+/* md4.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_MD4
+
+#ifndef CTAO_CRYPT_MD4_H
+#define CTAO_CRYPT_MD4_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    MD4_BLOCK_SIZE  = 64,
+    MD4_DIGEST_SIZE = 16,
+    MD4_PAD_SIZE    = 56
+};
+
+
+/* MD4 digest */
+typedef struct Md4 {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word32  digest[MD4_DIGEST_SIZE / sizeof(word32)];
+    word32  buffer[MD4_BLOCK_SIZE  / sizeof(word32)];
+} Md4;
+
+
+CYASSL_API void InitMd4(Md4*);
+CYASSL_API void Md4Update(Md4*, const byte*, word32);
+CYASSL_API void Md4Final(Md4*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_MD4_H */
+
+#endif /* NO_MD4 */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md5.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/md5.h
new file mode 100644 (file)
index 0000000..2e6a46d
--- /dev/null
@@ -0,0 +1,62 @@
+/* md5.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_MD5_H
+#define CTAO_CRYPT_MD5_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    MD5             =  0,      /* hash type unique */
+    MD5_BLOCK_SIZE  = 64,
+    MD5_DIGEST_SIZE = 16,
+    MD5_PAD_SIZE    = 56
+};
+
+
+/* MD5 digest */
+typedef struct Md5 {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word32  digest[MD5_DIGEST_SIZE / sizeof(word32)];
+    word32  buffer[MD5_BLOCK_SIZE  / sizeof(word32)];
+} Md5;
+
+
+CYASSL_API void InitMd5(Md5*);
+CYASSL_API void Md5Update(Md5*, const byte*, word32);
+CYASSL_API void Md5Final(Md5*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_MD5_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/memory.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/memory.h
new file mode 100644 (file)
index 0000000..e1467bc
--- /dev/null
@@ -0,0 +1,55 @@
+/* memory.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* submitted by eof */
+
+
+#ifndef CYASSL_MEMORY_H
+#define CYASSL_MEMORY_H
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+typedef void *(*CyaSSL_Malloc_cb)(size_t size);
+typedef void (*CyaSSL_Free_cb)(void *ptr);
+typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size);
+
+
+/* Public set function */
+CYASSL_API int CyaSSL_SetAllocators(CyaSSL_Malloc_cb  malloc_function,
+                                    CyaSSL_Free_cb    free_function,
+                                    CyaSSL_Realloc_cb realloc_function);
+
+/* Public in case user app wants to use XMALLOC/XFREE */
+CYASSL_API void* CyaSSL_Malloc(size_t size);
+CYASSL_API void  CyaSSL_Free(void *ptr);
+CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CYASSL_MEMORY_H */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/misc.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/misc.h
new file mode 100644 (file)
index 0000000..41e2368
--- /dev/null
@@ -0,0 +1,74 @@
+/* misc.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_MISC_H
+#define CTAO_CRYPT_MISC_H
+
+
+#include <cyassl/ctaocrypt/types.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+#ifdef NO_INLINE
+CYASSL_LOCAL
+word32 rotlFixed(word32, word32);
+CYASSL_LOCAL
+word32 rotrFixed(word32, word32);
+
+CYASSL_LOCAL
+word32 ByteReverseWord32(word32);
+CYASSL_LOCAL
+void   ByteReverseWords(word32*, const word32*, word32);
+CYASSL_LOCAL
+void   ByteReverseBytes(byte*, const byte*, word32);
+
+CYASSL_LOCAL
+void XorWords(word*, const word*, word32);
+CYASSL_LOCAL
+void xorbuf(byte*, const byte*, word32);
+
+#ifdef WORD64_AVAILABLE
+CYASSL_LOCAL
+word64 rotlFixed64(word64, word64);
+CYASSL_LOCAL
+word64 rotrFixed64(word64, word64);
+
+CYASSL_LOCAL
+word64 ByteReverseWord64(word64);
+CYASSL_LOCAL
+void   ByteReverseWords64(word64*, const word64*, word32);
+#endif /* WORD64_AVAILABLE */
+
+#endif /* NO_INLINE */
+
+
+#ifdef __cplusplus
+    }   /* extern "C" */
+#endif
+
+
+#endif /* CTAO_CRYPT_MISC_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_class.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_class.h
new file mode 100644 (file)
index 0000000..1381a86
--- /dev/null
@@ -0,0 +1,1018 @@
+/* mpi_class.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
+#if defined(LTM2)
+#define LTM3
+#endif
+#if defined(LTM1)
+#define LTM2
+#endif
+#define LTM1
+
+#if defined(LTM_ALL)
+#define BN_ERROR_C
+#define BN_FAST_MP_INVMOD_C
+#define BN_FAST_MP_MONTGOMERY_REDUCE_C
+#define BN_FAST_S_MP_MUL_DIGS_C
+#define BN_FAST_S_MP_MUL_HIGH_DIGS_C
+#define BN_FAST_S_MP_SQR_C
+#define BN_MP_2EXPT_C
+#define BN_MP_ABS_C
+#define BN_MP_ADD_C
+#define BN_MP_ADD_D_C
+#define BN_MP_ADDMOD_C
+#define BN_MP_AND_C
+#define BN_MP_CLAMP_C
+#define BN_MP_CLEAR_C
+#define BN_MP_CLEAR_MULTI_C
+#define BN_MP_CMP_C
+#define BN_MP_CMP_D_C
+#define BN_MP_CMP_MAG_C
+#define BN_MP_CNT_LSB_C
+#define BN_MP_COPY_C
+#define BN_MP_COUNT_BITS_C
+#define BN_MP_DIV_C
+#define BN_MP_DIV_2_C
+#define BN_MP_DIV_2D_C
+#define BN_MP_DIV_3_C
+#define BN_MP_DIV_D_C
+#define BN_MP_DR_IS_MODULUS_C
+#define BN_MP_DR_REDUCE_C
+#define BN_MP_DR_SETUP_C
+#define BN_MP_EXCH_C
+#define BN_MP_EXPT_D_C
+#define BN_MP_EXPTMOD_C
+#define BN_MP_EXPTMOD_FAST_C
+#define BN_MP_EXTEUCLID_C
+#define BN_MP_FREAD_C
+#define BN_MP_FWRITE_C
+#define BN_MP_GCD_C
+#define BN_MP_GET_INT_C
+#define BN_MP_GROW_C
+#define BN_MP_INIT_C
+#define BN_MP_INIT_COPY_C
+#define BN_MP_INIT_MULTI_C
+#define BN_MP_INIT_SET_C
+#define BN_MP_INIT_SET_INT_C
+#define BN_MP_INIT_SIZE_C
+#define BN_MP_INVMOD_C
+#define BN_MP_INVMOD_SLOW_C
+#define BN_MP_IS_SQUARE_C
+#define BN_MP_JACOBI_C
+#define BN_MP_KARATSUBA_MUL_C
+#define BN_MP_KARATSUBA_SQR_C
+#define BN_MP_LCM_C
+#define BN_MP_LSHD_C
+#define BN_MP_MOD_C
+#define BN_MP_MOD_2D_C
+#define BN_MP_MOD_D_C
+#define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
+#define BN_MP_MONTGOMERY_REDUCE_C
+#define BN_MP_MONTGOMERY_SETUP_C
+#define BN_MP_MUL_C
+#define BN_MP_MUL_2_C
+#define BN_MP_MUL_2D_C
+#define BN_MP_MUL_D_C
+#define BN_MP_MULMOD_C
+#define BN_MP_N_ROOT_C
+#define BN_MP_NEG_C
+#define BN_MP_OR_C
+#define BN_MP_PRIME_FERMAT_C
+#define BN_MP_PRIME_IS_DIVISIBLE_C
+#define BN_MP_PRIME_IS_PRIME_C
+#define BN_MP_PRIME_MILLER_RABIN_C
+#define BN_MP_PRIME_NEXT_PRIME_C
+#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
+#define BN_MP_PRIME_RANDOM_EX_C
+#define BN_MP_RADIX_SIZE_C
+#define BN_MP_RADIX_SMAP_C
+#define BN_MP_RAND_C
+#define BN_MP_READ_RADIX_C
+#define BN_MP_READ_SIGNED_BIN_C
+#define BN_MP_READ_UNSIGNED_BIN_C
+#define BN_MP_REDUCE_C
+#define BN_MP_REDUCE_2K_C
+#define BN_MP_REDUCE_2K_L_C
+#define BN_MP_REDUCE_2K_SETUP_C
+#define BN_MP_REDUCE_2K_SETUP_L_C
+#define BN_MP_REDUCE_IS_2K_C
+#define BN_MP_REDUCE_IS_2K_L_C
+#define BN_MP_REDUCE_SETUP_C
+#define BN_MP_RSHD_C
+#define BN_MP_SET_C
+#define BN_MP_SET_INT_C
+#define BN_MP_SHRINK_C
+#define BN_MP_SIGNED_BIN_SIZE_C
+#define BN_MP_SQR_C
+#define BN_MP_SQRMOD_C
+#define BN_MP_SQRT_C
+#define BN_MP_SUB_C
+#define BN_MP_SUB_D_C
+#define BN_MP_SUBMOD_C
+#define BN_MP_TO_SIGNED_BIN_C
+#define BN_MP_TO_SIGNED_BIN_N_C
+#define BN_MP_TO_UNSIGNED_BIN_C
+#define BN_MP_TO_UNSIGNED_BIN_N_C
+#define BN_MP_TOOM_MUL_C
+#define BN_MP_TOOM_SQR_C
+#define BN_MP_TORADIX_C
+#define BN_MP_TORADIX_N_C
+#define BN_MP_UNSIGNED_BIN_SIZE_C
+#define BN_MP_XOR_C
+#define BN_MP_ZERO_C
+#define BN_PRIME_TAB_C
+#define BN_REVERSE_C
+#define BN_S_MP_ADD_C
+#define BN_S_MP_EXPTMOD_C
+#define BN_S_MP_MUL_DIGS_C
+#define BN_S_MP_MUL_HIGH_DIGS_C
+#define BN_S_MP_SQR_C
+#define BN_S_MP_SUB_C
+#define BNCORE_C
+#endif
+
+#if defined(BN_ERROR_C)
+   #define BN_MP_ERROR_TO_STRING_C
+#endif
+
+#if defined(BN_FAST_MP_INVMOD_C)
+   #define BN_MP_ISEVEN_C
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_COPY_C
+   #define BN_MP_MOD_C
+   #define BN_MP_SET_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_ISODD_C
+   #define BN_MP_SUB_C
+   #define BN_MP_CMP_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_CMP_D_C
+   #define BN_MP_ADD_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_FAST_S_MP_MUL_DIGS_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_FAST_S_MP_SQR_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_2EXPT_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_GROW_C
+#endif
+
+#if defined(BN_MP_ABS_C)
+   #define BN_MP_COPY_C
+#endif
+
+#if defined(BN_MP_ADD_C)
+   #define BN_S_MP_ADD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_ADD_D_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_SUB_D_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_ADDMOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_ADD_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MOD_C
+#endif
+
+#if defined(BN_MP_AND_C)
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_CLAMP_C)
+#endif
+
+#if defined(BN_MP_CLEAR_C)
+#endif
+
+#if defined(BN_MP_CLEAR_MULTI_C)
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_CMP_C)
+   #define BN_MP_CMP_MAG_C
+#endif
+
+#if defined(BN_MP_CMP_D_C)
+#endif
+
+#if defined(BN_MP_CMP_MAG_C)
+#endif
+
+#if defined(BN_MP_CNT_LSB_C)
+   #define BN_MP_ISZERO_C
+#endif
+
+#if defined(BN_MP_COPY_C)
+   #define BN_MP_GROW_C
+#endif
+
+#if defined(BN_MP_COUNT_BITS_C)
+#endif
+
+#if defined(BN_MP_DIV_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_COPY_C
+   #define BN_MP_ZERO_C
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_SET_C
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_ABS_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_CMP_C
+   #define BN_MP_SUB_C
+   #define BN_MP_ADD_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_MULTI_C
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_INIT_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_DIV_2_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_DIV_2D_C)
+   #define BN_MP_COPY_C
+   #define BN_MP_ZERO_C
+   #define BN_MP_INIT_C
+   #define BN_MP_MOD_2D_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+#endif
+
+#if defined(BN_MP_DIV_3_C)
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_DIV_D_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_COPY_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_DIV_3_C
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_DR_IS_MODULUS_C)
+#endif
+
+#if defined(BN_MP_DR_REDUCE_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_DR_SETUP_C)
+#endif
+
+#if defined(BN_MP_EXCH_C)
+#endif
+
+#if defined(BN_MP_EXPT_D_C)
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_SET_C
+   #define BN_MP_SQR_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MUL_C
+#endif
+
+#if defined(BN_MP_EXPTMOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_INVMOD_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_ABS_C
+   #define BN_MP_CLEAR_MULTI_C
+   #define BN_MP_REDUCE_IS_2K_L_C
+   #define BN_S_MP_EXPTMOD_C
+   #define BN_MP_DR_IS_MODULUS_C
+   #define BN_MP_REDUCE_IS_2K_C
+   #define BN_MP_ISODD_C
+   #define BN_MP_EXPTMOD_FAST_C
+#endif
+
+#if defined(BN_MP_EXPTMOD_FAST_C)
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_INIT_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MONTGOMERY_SETUP_C
+   #define BN_FAST_MP_MONTGOMERY_REDUCE_C
+   #define BN_MP_MONTGOMERY_REDUCE_C
+   #define BN_MP_DR_SETUP_C
+   #define BN_MP_DR_REDUCE_C
+   #define BN_MP_REDUCE_2K_SETUP_C
+   #define BN_MP_REDUCE_2K_C
+   #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
+   #define BN_MP_MULMOD_C
+   #define BN_MP_SET_C
+   #define BN_MP_MOD_C
+   #define BN_MP_COPY_C
+   #define BN_MP_SQR_C
+   #define BN_MP_MUL_C
+   #define BN_MP_EXCH_C
+#endif
+
+#if defined(BN_MP_EXTEUCLID_C)
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_SET_C
+   #define BN_MP_COPY_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_DIV_C
+   #define BN_MP_MUL_C
+   #define BN_MP_SUB_C
+   #define BN_MP_NEG_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_MP_FREAD_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_S_RMAP_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_ADD_D_C
+   #define BN_MP_CMP_D_C
+#endif
+
+#if defined(BN_MP_FWRITE_C)
+   #define BN_MP_RADIX_SIZE_C
+   #define BN_MP_TORADIX_C
+#endif
+
+#if defined(BN_MP_GCD_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_ABS_C
+   #define BN_MP_ZERO_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_CNT_LSB_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_EXCH_C
+   #define BN_S_MP_SUB_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_GET_INT_C)
+#endif
+
+#if defined(BN_MP_GROW_C)
+#endif
+
+#if defined(BN_MP_INIT_C)
+#endif
+
+#if defined(BN_MP_INIT_COPY_C)
+   #define BN_MP_COPY_C
+#endif
+
+#if defined(BN_MP_INIT_MULTI_C)
+   #define BN_MP_ERR_C
+   #define BN_MP_INIT_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_INIT_SET_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_SET_C
+#endif
+
+#if defined(BN_MP_INIT_SET_INT_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_SET_INT_C
+#endif
+
+#if defined(BN_MP_INIT_SIZE_C)
+   #define BN_MP_INIT_C
+#endif
+
+#if defined(BN_MP_INVMOD_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_ISODD_C
+   #define BN_FAST_MP_INVMOD_C
+   #define BN_MP_INVMOD_SLOW_C
+#endif
+
+#if defined(BN_MP_INVMOD_SLOW_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_MOD_C
+   #define BN_MP_COPY_C
+   #define BN_MP_ISEVEN_C
+   #define BN_MP_SET_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_ISODD_C
+   #define BN_MP_ADD_C
+   #define BN_MP_SUB_C
+   #define BN_MP_CMP_C
+   #define BN_MP_CMP_D_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_MP_IS_SQUARE_C)
+   #define BN_MP_MOD_D_C
+   #define BN_MP_INIT_SET_INT_C
+   #define BN_MP_MOD_C
+   #define BN_MP_GET_INT_C
+   #define BN_MP_SQRT_C
+   #define BN_MP_SQR_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_JACOBI_C)
+   #define BN_MP_CMP_D_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_CNT_LSB_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_MOD_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_KARATSUBA_MUL_C)
+   #define BN_MP_MUL_C
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_SUB_C
+   #define BN_MP_ADD_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_KARATSUBA_SQR_C)
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_SQR_C
+   #define BN_MP_SUB_C
+   #define BN_S_MP_ADD_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_ADD_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_LCM_C)
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_GCD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_DIV_C
+   #define BN_MP_MUL_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_MP_LSHD_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_RSHD_C
+#endif
+
+#if defined(BN_MP_MOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_DIV_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_ADD_C
+   #define BN_MP_EXCH_C
+#endif
+
+#if defined(BN_MP_MOD_2D_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_COPY_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_MOD_D_C)
+   #define BN_MP_DIV_D_C
+#endif
+
+#if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C)
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_2EXPT_C
+   #define BN_MP_SET_C
+   #define BN_MP_MUL_2_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_MONTGOMERY_REDUCE_C)
+   #define BN_FAST_MP_MONTGOMERY_REDUCE_C
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_MONTGOMERY_SETUP_C)
+#endif
+
+#if defined(BN_MP_MUL_C)
+   #define BN_MP_TOOM_MUL_C
+   #define BN_MP_KARATSUBA_MUL_C
+   #define BN_FAST_S_MP_MUL_DIGS_C
+   #define BN_S_MP_MUL_C
+   #define BN_S_MP_MUL_DIGS_C
+#endif
+
+#if defined(BN_MP_MUL_2_C)
+   #define BN_MP_GROW_C
+#endif
+
+#if defined(BN_MP_MUL_2D_C)
+   #define BN_MP_COPY_C
+   #define BN_MP_GROW_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_MUL_D_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_MULMOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_MUL_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MOD_C
+#endif
+
+#if defined(BN_MP_N_ROOT_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_SET_C
+   #define BN_MP_COPY_C
+   #define BN_MP_EXPT_D_C
+   #define BN_MP_MUL_C
+   #define BN_MP_SUB_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_DIV_C
+   #define BN_MP_CMP_C
+   #define BN_MP_SUB_D_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_NEG_C)
+   #define BN_MP_COPY_C
+   #define BN_MP_ISZERO_C
+#endif
+
+#if defined(BN_MP_OR_C)
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_PRIME_FERMAT_C)
+   #define BN_MP_CMP_D_C
+   #define BN_MP_INIT_C
+   #define BN_MP_EXPTMOD_C
+   #define BN_MP_CMP_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_PRIME_IS_DIVISIBLE_C)
+   #define BN_MP_MOD_D_C
+#endif
+
+#if defined(BN_MP_PRIME_IS_PRIME_C)
+   #define BN_MP_CMP_D_C
+   #define BN_MP_PRIME_IS_DIVISIBLE_C
+   #define BN_MP_INIT_C
+   #define BN_MP_SET_C
+   #define BN_MP_PRIME_MILLER_RABIN_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_PRIME_MILLER_RABIN_C)
+   #define BN_MP_CMP_D_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_SUB_D_C
+   #define BN_MP_CNT_LSB_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_EXPTMOD_C
+   #define BN_MP_CMP_C
+   #define BN_MP_SQRMOD_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_PRIME_NEXT_PRIME_C)
+   #define BN_MP_CMP_D_C
+   #define BN_MP_SET_C
+   #define BN_MP_SUB_D_C
+   #define BN_MP_ISEVEN_C
+   #define BN_MP_MOD_D_C
+   #define BN_MP_INIT_C
+   #define BN_MP_ADD_D_C
+   #define BN_MP_PRIME_MILLER_RABIN_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C)
+#endif
+
+#if defined(BN_MP_PRIME_RANDOM_EX_C)
+   #define BN_MP_READ_UNSIGNED_BIN_C
+   #define BN_MP_PRIME_IS_PRIME_C
+   #define BN_MP_SUB_D_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_MUL_2_C
+   #define BN_MP_ADD_D_C
+#endif
+
+#if defined(BN_MP_RADIX_SIZE_C)
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_DIV_D_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_RADIX_SMAP_C)
+   #define BN_MP_S_RMAP_C
+#endif
+
+#if defined(BN_MP_RAND_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_ADD_D_C
+   #define BN_MP_LSHD_C
+#endif
+
+#if defined(BN_MP_READ_RADIX_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_S_RMAP_C
+   #define BN_MP_RADIX_SMAP_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_ADD_D_C
+   #define BN_MP_ISZERO_C
+#endif
+
+#if defined(BN_MP_READ_SIGNED_BIN_C)
+   #define BN_MP_READ_UNSIGNED_BIN_C
+#endif
+
+#if defined(BN_MP_READ_UNSIGNED_BIN_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_ZERO_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_REDUCE_C)
+   #define BN_MP_REDUCE_SETUP_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_MUL_C
+   #define BN_S_MP_MUL_HIGH_DIGS_C
+   #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
+   #define BN_MP_MOD_2D_C
+   #define BN_S_MP_MUL_DIGS_C
+   #define BN_MP_SUB_C
+   #define BN_MP_CMP_D_C
+   #define BN_MP_SET_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_ADD_C
+   #define BN_MP_CMP_C
+   #define BN_S_MP_SUB_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_REDUCE_2K_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_MUL_D_C
+   #define BN_S_MP_ADD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_REDUCE_2K_L_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_MUL_C
+   #define BN_S_MP_ADD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_REDUCE_2K_SETUP_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_2EXPT_C
+   #define BN_MP_CLEAR_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_REDUCE_2K_SETUP_L_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_2EXPT_C
+   #define BN_MP_COUNT_BITS_C
+   #define BN_S_MP_SUB_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_REDUCE_IS_2K_C)
+   #define BN_MP_REDUCE_2K_C
+   #define BN_MP_COUNT_BITS_C
+#endif
+
+#if defined(BN_MP_REDUCE_IS_2K_L_C)
+#endif
+
+#if defined(BN_MP_REDUCE_SETUP_C)
+   #define BN_MP_2EXPT_C
+   #define BN_MP_DIV_C
+#endif
+
+#if defined(BN_MP_RSHD_C)
+   #define BN_MP_ZERO_C
+#endif
+
+#if defined(BN_MP_SET_C)
+   #define BN_MP_ZERO_C
+#endif
+
+#if defined(BN_MP_SET_INT_C)
+   #define BN_MP_ZERO_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_SHRINK_C)
+#endif
+
+#if defined(BN_MP_SIGNED_BIN_SIZE_C)
+   #define BN_MP_UNSIGNED_BIN_SIZE_C
+#endif
+
+#if defined(BN_MP_SQR_C)
+   #define BN_MP_TOOM_SQR_C
+   #define BN_MP_KARATSUBA_SQR_C
+   #define BN_FAST_S_MP_SQR_C
+   #define BN_S_MP_SQR_C
+#endif
+
+#if defined(BN_MP_SQRMOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_SQR_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MOD_C
+#endif
+
+#if defined(BN_MP_SQRT_C)
+   #define BN_MP_N_ROOT_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_ZERO_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_DIV_C
+   #define BN_MP_ADD_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_SUB_C)
+   #define BN_S_MP_ADD_C
+   #define BN_MP_CMP_MAG_C
+   #define BN_S_MP_SUB_C
+#endif
+
+#if defined(BN_MP_SUB_D_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_ADD_D_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_MP_SUBMOD_C)
+   #define BN_MP_INIT_C
+   #define BN_MP_SUB_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_MOD_C
+#endif
+
+#if defined(BN_MP_TO_SIGNED_BIN_C)
+   #define BN_MP_TO_UNSIGNED_BIN_C
+#endif
+
+#if defined(BN_MP_TO_SIGNED_BIN_N_C)
+   #define BN_MP_SIGNED_BIN_SIZE_C
+   #define BN_MP_TO_SIGNED_BIN_C
+#endif
+
+#if defined(BN_MP_TO_UNSIGNED_BIN_C)
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_ISZERO_C
+   #define BN_MP_DIV_2D_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_TO_UNSIGNED_BIN_N_C)
+   #define BN_MP_UNSIGNED_BIN_SIZE_C
+   #define BN_MP_TO_UNSIGNED_BIN_C
+#endif
+
+#if defined(BN_MP_TOOM_MUL_C)
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_MOD_2D_C
+   #define BN_MP_COPY_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_MUL_C
+   #define BN_MP_MUL_2_C
+   #define BN_MP_ADD_C
+   #define BN_MP_SUB_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_DIV_3_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_MP_TOOM_SQR_C)
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_MOD_2D_C
+   #define BN_MP_COPY_C
+   #define BN_MP_RSHD_C
+   #define BN_MP_SQR_C
+   #define BN_MP_MUL_2_C
+   #define BN_MP_ADD_C
+   #define BN_MP_SUB_C
+   #define BN_MP_DIV_2_C
+   #define BN_MP_MUL_2D_C
+   #define BN_MP_MUL_D_C
+   #define BN_MP_DIV_3_C
+   #define BN_MP_LSHD_C
+   #define BN_MP_CLEAR_MULTI_C
+#endif
+
+#if defined(BN_MP_TORADIX_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_DIV_D_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_S_RMAP_C
+#endif
+
+#if defined(BN_MP_TORADIX_N_C)
+   #define BN_MP_ISZERO_C
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_DIV_D_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_S_RMAP_C
+#endif
+
+#if defined(BN_MP_UNSIGNED_BIN_SIZE_C)
+   #define BN_MP_COUNT_BITS_C
+#endif
+
+#if defined(BN_MP_XOR_C)
+   #define BN_MP_INIT_COPY_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_MP_ZERO_C)
+#endif
+
+#if defined(BN_PRIME_TAB_C)
+#endif
+
+#if defined(BN_REVERSE_C)
+#endif
+
+#if defined(BN_S_MP_ADD_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BN_S_MP_EXPTMOD_C)
+   #define BN_MP_COUNT_BITS_C
+   #define BN_MP_INIT_C
+   #define BN_MP_CLEAR_C
+   #define BN_MP_REDUCE_SETUP_C
+   #define BN_MP_REDUCE_C
+   #define BN_MP_REDUCE_2K_SETUP_L_C
+   #define BN_MP_REDUCE_2K_L_C
+   #define BN_MP_MOD_C
+   #define BN_MP_COPY_C
+   #define BN_MP_SQR_C
+   #define BN_MP_MUL_C
+   #define BN_MP_SET_C
+   #define BN_MP_EXCH_C
+#endif
+
+#if defined(BN_S_MP_MUL_DIGS_C)
+   #define BN_FAST_S_MP_MUL_DIGS_C
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_S_MP_MUL_HIGH_DIGS_C)
+   #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_S_MP_SQR_C)
+   #define BN_MP_INIT_SIZE_C
+   #define BN_MP_CLAMP_C
+   #define BN_MP_EXCH_C
+   #define BN_MP_CLEAR_C
+#endif
+
+#if defined(BN_S_MP_SUB_C)
+   #define BN_MP_GROW_C
+   #define BN_MP_CLAMP_C
+#endif
+
+#if defined(BNCORE_C)
+#endif
+
+#ifdef LTM3
+#define LTM_LAST
+#endif
+#include "mpi_superclass.h"
+#include "mpi_class.h"
+#else
+#define LTM_LAST
+#endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_superclass.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/mpi_superclass.h
new file mode 100644 (file)
index 0000000..60d6e34
--- /dev/null
@@ -0,0 +1,95 @@
+/* mpi_superclass.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* super class file for PK algos */
+
+/* default ... include all MPI */
+#define LTM_ALL
+
+/* RSA only (does not support DH/DSA/ECC) */
+/* #define SC_RSA_1 */
+
+/* For reference.... On an Athlon64 optimizing for speed...
+
+   LTM's mpi.o with all functions [striped] is 142KiB in size.
+
+*/
+
+/* Works for RSA only, mpi.o is 68KiB */
+#ifdef SC_RSA_1
+   #define BN_MP_SHRINK_C
+   #define BN_MP_LCM_C
+   #define BN_MP_PRIME_RANDOM_EX_C
+   #define BN_MP_INVMOD_C
+   #define BN_MP_GCD_C
+   #define BN_MP_MOD_C
+   #define BN_MP_MULMOD_C
+   #define BN_MP_ADDMOD_C
+   #define BN_MP_EXPTMOD_C
+   #define BN_MP_SET_INT_C
+   #define BN_MP_INIT_MULTI_C
+   #define BN_MP_CLEAR_MULTI_C
+   #define BN_MP_UNSIGNED_BIN_SIZE_C
+   #define BN_MP_TO_UNSIGNED_BIN_C
+   #define BN_MP_MOD_D_C
+   #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
+   #define BN_REVERSE_C
+   #define BN_PRIME_TAB_C
+
+   /* other modifiers */
+   #define BN_MP_DIV_SMALL                    /* Slower division, not critical */
+
+   /* here we are on the last pass so we turn things off.  The functions classes are still there
+    * but we remove them specifically from the build.  This also invokes tweaks in functions
+    * like removing support for even moduli, etc...
+    */
+#ifdef LTM_LAST
+   #undef  BN_MP_TOOM_MUL_C
+   #undef  BN_MP_TOOM_SQR_C
+   #undef  BN_MP_KARATSUBA_MUL_C
+   #undef  BN_MP_KARATSUBA_SQR_C
+   #undef  BN_MP_REDUCE_C
+   #undef  BN_MP_REDUCE_SETUP_C
+   #undef  BN_MP_DR_IS_MODULUS_C
+   #undef  BN_MP_DR_SETUP_C
+   #undef  BN_MP_DR_REDUCE_C
+   #undef  BN_MP_REDUCE_IS_2K_C
+   #undef  BN_MP_REDUCE_2K_SETUP_C
+   #undef  BN_MP_REDUCE_2K_C
+   #undef  BN_S_MP_EXPTMOD_C
+   #undef  BN_MP_DIV_3_C
+   #undef  BN_S_MP_MUL_HIGH_DIGS_C
+   #undef  BN_FAST_S_MP_MUL_HIGH_DIGS_C
+   #undef  BN_FAST_MP_INVMOD_C
+
+   /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold
+    * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] 
+    * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without
+    * trouble.  
+    */
+   #undef  BN_S_MP_MUL_DIGS_C
+   #undef  BN_S_MP_SQR_C
+   #undef  BN_MP_MONTGOMERY_REDUCE_C
+#endif
+
+#endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/pwdbased.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/pwdbased.h
new file mode 100644 (file)
index 0000000..27029ea
--- /dev/null
@@ -0,0 +1,53 @@
+/* pwdbased.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_PWDBASED
+
+#ifndef CTAO_CRYPT_PWDBASED_H
+#define CTAO_CRYPT_PWDBASED_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/md5.h>       /* for hash type */
+#include <cyassl/ctaocrypt/sha.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+CYASSL_API int PBKDF1(byte* output, const byte* passwd, int pLen,
+                      const byte* salt, int sLen, int iterations, int kLen,
+                      int hashType);
+CYASSL_API int PBKDF2(byte* output, const byte* passwd, int pLen,
+                      const byte* salt, int sLen, int iterations, int kLen,
+                      int hashType);
+CYASSL_API int PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
+                            const byte* salt, int sLen, int iterations,
+                            int kLen, int hashType, int purpose);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_PWDBASED_H */
+#endif /* NO_PWDBASED */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rabbit.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rabbit.h
new file mode 100644 (file)
index 0000000..ea1ea9f
--- /dev/null
@@ -0,0 +1,65 @@
+/* rabbit.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef NO_RABBIT
+
+#ifndef CTAO_CRYPT_RABBIT_H
+#define CTAO_CRYPT_RABBIT_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+       RABBIT_ENC_TYPE  = 5     /* cipher unique type */
+};
+
+
+/* Rabbit Context */
+typedef struct RabbitCtx {
+    word32 x[8];
+    word32 c[8];
+    word32 carry;
+} RabbitCtx;
+    
+
+/* Rabbit stream cipher */
+typedef struct Rabbit {
+    RabbitCtx masterCtx;
+    RabbitCtx workCtx;
+} Rabbit;
+
+
+CYASSL_API void RabbitProcess(Rabbit*, byte*, const byte*, word32);
+CYASSL_API void RabbitSetKey(Rabbit*, const byte* key, const byte* iv);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_RABBIT_H */
+
+#endif /* NO_RABBIT */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/random.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/random.h
new file mode 100644 (file)
index 0000000..3bd911b
--- /dev/null
@@ -0,0 +1,73 @@
+/* random.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_RANDOM_H
+#define CTAO_CRYPT_RANDOM_H
+
+#include <cyassl/ctaocrypt/arc4.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+#if defined(USE_WINDOWS_API)
+    #if defined(_WIN64)
+        typedef unsigned __int64 ProviderHandle;
+        /* type HCRYPTPROV, avoid #include <windows.h> */
+    #else
+        typedef unsigned long ProviderHandle;
+    #endif
+#endif
+
+
+/* OS specific seeder */
+typedef struct OS_Seed {
+    #if defined(USE_WINDOWS_API)
+        ProviderHandle handle;
+    #else
+        int fd;
+    #endif
+} OS_Seed;
+
+CYASSL_LOCAL
+int GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
+
+
+/* secure Random Nnumber Generator */
+typedef struct RNG {
+    OS_Seed seed;
+    Arc4    cipher;
+} RNG;
+
+
+CYASSL_API int  InitRng(RNG*);
+CYASSL_API void RNG_GenerateBlock(RNG*, byte*, word32 sz);
+CYASSL_API byte RNG_GenerateByte(RNG*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_RANDOM_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ripemd.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/ripemd.h
new file mode 100644 (file)
index 0000000..5895cce
--- /dev/null
@@ -0,0 +1,64 @@
+/* ripemd.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef CYASSL_RIPEMD
+
+#ifndef CTAO_CRYPT_RIPEMD_H
+#define CTAO_CRYPT_RIPEME_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    RIPEMD             =  3,    /* hash type unique */
+    RIPEMD_BLOCK_SIZE  = 64,
+    RIPEMD_DIGEST_SIZE = 20,
+    RIPEMD_PAD_SIZE    = 56
+};
+
+
+/* RipeMd 160 digest */
+typedef struct RipeMd {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word32  digest[RIPEMD_DIGEST_SIZE / sizeof(word32)];
+    word32  buffer[RIPEMD_BLOCK_SIZE  / sizeof(word32)];
+} RipeMd;
+
+
+CYASSL_API void InitRipeMd(RipeMd*);
+CYASSL_API void RipeMdUpdate(RipeMd*, const byte*, word32);
+CYASSL_API void RipeMdFinal(RipeMd*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_RIPEMD_H */
+#endif /* CYASSL_RIPEMD */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rsa.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/rsa.h
new file mode 100644 (file)
index 0000000..70e3fcd
--- /dev/null
@@ -0,0 +1,81 @@
+/* rsa.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_RSA_H
+#define CTAO_CRYPT_RSA_H
+
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/integer.h>
+#include <cyassl/ctaocrypt/random.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum {
+    RSA_PUBLIC   = 0,
+    RSA_PRIVATE  = 1
+};
+
+/* RSA */
+typedef struct RsaKey {
+    mp_int n, e, d, p, q, dP, dQ, u;
+    int   type;                               /* public or private */
+    void* heap;                               /* for user memory overrides */
+} RsaKey;
+
+
+CYASSL_API void InitRsaKey(RsaKey* key, void*);
+CYASSL_API void FreeRsaKey(RsaKey* key);
+
+CYASSL_API int  RsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
+                                 word32 outLen, RsaKey* key, RNG* rng);
+CYASSL_API int  RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out,
+                                        RsaKey* key);
+CYASSL_API int  RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
+                                  word32 outLen, RsaKey* key);
+CYASSL_API int  RsaSSL_Sign(const byte* in, word32 inLen, byte* out,
+                            word32 outLen, RsaKey* key, RNG* rng);
+CYASSL_API int  RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out,
+                                    RsaKey* key);
+CYASSL_API int  RsaSSL_Verify(const byte* in, word32 inLen, byte* out,
+                              word32 outLen, RsaKey* key);
+CYASSL_API int  RsaEncryptSize(RsaKey* key);
+
+CYASSL_API int RsaPrivateKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
+                                   word32);
+CYASSL_API int RsaPublicKeyDecode(const byte* input, word32* inOutIdx, RsaKey*,
+                                  word32);
+#ifdef CYASSL_KEY_GEN
+    CYASSL_API int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
+    CYASSL_API int RsaKeyToDer(RsaKey*, byte* output, word32 inLen);
+#endif
+
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_RSA_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/settings.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/settings.h
new file mode 100644 (file)
index 0000000..ef60087
--- /dev/null
@@ -0,0 +1,322 @@
+/* settings.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* Place OS specific preprocessor flags, defines, includes here, will be
+   included into every file because types.h includes it */
+
+
+#ifndef CTAO_CRYPT_SETTINGS_H
+#define CTAO_CRYPT_SETTINGS_H
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+/* Uncomment next line if using IPHONE */
+/* #define IPHONE */
+
+/* Uncomment next line if using ThreadX */
+/* #define THREADX */
+
+/* Uncomment next line if using Micrium ucOS */
+/* #define MICRIUM */
+
+/* Uncomment next line if using Mbed */
+/* #define MBED */
+
+/* Uncomment next line if using Microchip PIC32 ethernet starter kit */
+/* #define MICROCHIP_PIC32 */
+
+/* Uncomment next line if using FreeRTOS */
+/* #define FREERTOS */
+
+/* Uncomment next line if using FreeRTOS Windows Simulator */
+/* #define FREERTOS_WINSIM */
+
+/* Uncomment next line if using lwip */
+/* #define CYASSL_LWIP */
+
+/* Uncomment next line if building CyaSSL for a game console */
+/* #define CYASSL_GAME_BUILD */
+
+
+#include <cyassl/ctaocrypt/visibility.h>
+
+#ifdef IPHONE
+    #define SIZEOF_LONG_LONG 8
+#endif
+
+#ifdef THREADX 
+    #define SIZEOF_LONG_LONG 8
+#endif
+
+#ifdef MICROCHIP_PIC32
+    /* use MBED plus no filesystem */
+    #define MBED
+    #define NO_FILESYSTEM
+#endif
+
+#ifdef MBED
+    #define SINGLE_THREADED
+    #define CYASSL_USER_IO
+    #define NO_WRITEV
+    #define NO_DEV_RANDOM
+    #define NO_SHA512
+    #define NO_DH
+    #define NO_DSA
+    #define NO_HC128
+#endif /* MBED */
+
+#ifdef FREERTOS_WINSIM
+    #define FREERTOS
+    #define USE_WINDOWS_API
+#endif
+
+#ifdef FREERTOS
+    #define NO_WRITEV
+    #define NO_SHA512
+    #define NO_DH
+    #define NO_DSA
+    #define NO_HC128
+
+    #ifndef SINGLE_THREADED
+        #include "FreeRTOS.h"
+        #include "semphr.h"
+    #endif
+#endif
+
+#ifdef CYASSL_GAME_BUILD
+    #define SIZEOF_LONG_LONG 8
+    #if defined(__PPU) || defined(__XENON)
+        #define BIG_ENDIAN_ORDER
+    #endif
+#endif
+
+#ifdef MICRIUM
+
+    #include "stdlib.h"
+    #include "net_cfg.h"
+    #include "ssl_cfg.h"
+    #include "net_secure_os.h"
+
+    #define CYASSL_TYPES
+
+    typedef CPU_INT08U byte;
+    typedef CPU_INT16U word16;
+    typedef CPU_INT32U word32;
+
+    #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
+        #define SIZEOF_LONG        4
+        #undef  SIZEOF_LONG_LONG
+    #else
+        #undef  SIZEOF_LONG
+        #define SIZEOF_LONG_LONG   8
+    #endif
+
+    #define STRING_USER
+
+    #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
+    #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
+                    ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
+                     (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
+    #define XSTRNCMP(pstr_1, pstr_2, len_max) \
+                    ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
+                     (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))  
+    #define XSTRSTR(pstr, pstr_srch) \
+                    ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
+                     (CPU_CHAR *)(pstr_srch)))
+    #define XMEMSET(pmem, data_val, size) \
+                    ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
+                    (CPU_SIZE_T)(size)))
+    #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
+                     (void *)(psrc), (CPU_SIZE_T)(size)))
+    #define XMEMCMP(pmem_1, pmem_2, size) \
+                   (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
+                     (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
+    #define XMEMMOVE XMEMCPY
+
+#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+    #define MICRIUM_MALLOC    
+    #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
+                                 (CPU_SIZE_T)(s), (void *)0))
+    #define XFREE(p, h, type)   (NetSecure_BlkFree((CPU_INT08U)(type), \
+                                 (p), (void *)0))
+    #define XREALLOC(p, n, h, t) realloc((p), (n))
+#endif
+
+    #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
+        #undef  NO_FILESYSTEM
+    #else
+        #define NO_FILESYSTEM
+    #endif
+
+    #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
+        #define DEBUG_CYASSL
+    #else
+        #undef  DEBUG_CYASSL
+    #endif
+
+    #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
+        #define OPENSSL_EXTRA
+    #else
+        #undef  OPENSSL_EXTRA
+    #endif
+
+    #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
+        #undef  SINGLE_THREADED
+    #else
+        #define SINGLE_THREADED
+    #endif
+
+    #if (SSL_CFG_DH_EN == DEF_ENABLED)
+        #undef  NO_DH
+    #else
+        #define NO_DH
+    #endif
+
+    #if (SSL_CFG_DSA_EN == DEF_ENABLED)
+        #undef  NO_DSA
+    #else
+        #define NO_DSA
+    #endif
+
+    #if (SSL_CFG_PSK_EN == DEF_ENABLED)
+        #undef  NO_PSK
+    #else
+        #define NO_PSK
+    #endif
+
+    #if (SSL_CFG_3DES_EN == DEF_ENABLED)
+        #undef  NO_DES
+    #else
+        #define NO_DES
+    #endif
+
+    #if (SSL_CFG_AES_EN == DEF_ENABLED)
+        #undef  NO_AES
+    #else
+        #define NO_AES
+    #endif
+
+    #if (SSL_CFG_RC4_EN == DEF_ENABLED)
+        #undef  NO_RC4
+    #else
+        #define NO_RC4
+    #endif
+
+    #if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
+        #undef  NO_RABBIT
+    #else
+        #define NO_RABBIT
+    #endif
+
+    #if (SSL_CFG_HC128_EN == DEF_ENABLED)
+        #undef  NO_HC128
+    #else
+        #define NO_HC128
+    #endif
+
+    #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
+        #define BIG_ENDIAN_ORDER
+    #else
+        #undef  BIG_ENDIAN_ORDER
+        #define LITTLE_ENDIAN_ORDER
+    #endif
+
+    #if (SSL_CFG_MD4_EN == DEF_ENABLED)
+        #undef  NO_MD4
+    #else
+        #define NO_MD4
+    #endif
+
+    #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
+        #undef  NO_WRITEV
+    #else
+        #define NO_WRITEV
+    #endif
+
+    #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
+        #define NO_DEV_RANDOM   
+    #else
+        #undef  NO_DEV_RANDOM
+    #endif
+
+    #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
+        #define CYASSL_USER_IO   
+    #else
+        #undef  CYASSL_USER_IO
+    #endif
+
+    #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
+        #undef  LARGE_STATIC_BUFFERS
+        #undef  STATIC_CHUNKS_ONLY
+    #else
+        #define LARGE_STATIC_BUFFERS
+        #define STATIC_CHUNKS_ONLY
+    #endif
+
+    #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
+        #define  CYASSL_DER_LOAD
+    #else
+        #undef   CYASSL_DER_LOAD
+    #endif
+
+    #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
+        #define  CYASSL_DTLS
+    #else
+        #undef   CYASSL_DTLS
+    #endif
+
+    #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
+         #define CYASSL_CALLBACKS
+    #else
+         #undef  CYASSL_CALLBACKS
+    #endif
+
+    #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
+         #define USE_FAST_MATH
+    #else
+         #undef  USE_FAST_MATH
+    #endif
+
+    #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
+         #define TFM_TIMING_RESISTANT
+    #else
+         #undef  TFM_TIMING_RESISTANT
+    #endif
+
+#endif /* MICRIUM */
+
+
+#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC)
+    #define USE_CYASSL_MEMORY
+#endif
+
+/* Place any other flags or defines here */
+
+
+#ifdef __cplusplus
+    }   /* extern "C" */
+#endif
+
+
+#endif /* CTAO_CRYPT_SETTINGS_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha.h
new file mode 100644 (file)
index 0000000..5c1b5aa
--- /dev/null
@@ -0,0 +1,62 @@
+/* sha.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_SHA_H
+#define CTAO_CRYPT_SHA_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    SHA              =  1,    /* hash type unique */
+    SHA_BLOCK_SIZE   = 64,
+    SHA_DIGEST_SIZE  = 20,
+    SHA_PAD_SIZE     = 56
+};
+
+
+/* Sha digest */
+typedef struct Sha {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word32  digest[SHA_DIGEST_SIZE / sizeof(word32)];
+    word32  buffer[SHA_BLOCK_SIZE  / sizeof(word32)];
+} Sha;
+
+
+CYASSL_API void InitSha(Sha*);
+CYASSL_API void ShaUpdate(Sha*, const byte*, word32);
+CYASSL_API void ShaFinal(Sha*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_SHA_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha256.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha256.h
new file mode 100644 (file)
index 0000000..179a780
--- /dev/null
@@ -0,0 +1,68 @@
+/* sha256.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* code submitted by raphael.huck@efixo.com */
+
+
+#ifndef NO_SHA256
+
+#ifndef CTAO_CRYPT_SHA256_H
+#define CTAO_CRYPT_SHA256_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    SHA256              =  2,   /* hash type unique */
+    SHA256_BLOCK_SIZE   = 64,
+    SHA256_DIGEST_SIZE  = 32,
+    SHA256_PAD_SIZE     = 56
+};
+
+
+/* Sha256 digest */
+typedef struct Sha256 {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word32  digest[SHA256_DIGEST_SIZE / sizeof(word32)];
+    word32  buffer[SHA256_BLOCK_SIZE  / sizeof(word32)];
+} Sha256;
+
+
+CYASSL_API void InitSha256(Sha256*);
+CYASSL_API void Sha256Update(Sha256*, const byte*, word32);
+CYASSL_API void Sha256Final(Sha256*, byte*);
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_SHA256_H */
+#endif /* NO_SHA256 */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha512.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/sha512.h
new file mode 100644 (file)
index 0000000..79861af
--- /dev/null
@@ -0,0 +1,91 @@
+/* sha512.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef CYASSL_SHA512
+
+#ifndef CTAO_CRYPT_SHA512_H
+#define CTAO_CRYPT_SHA512_H
+
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+/* in bytes */
+enum {
+    SHA512              =   4,   /* hash type unique */
+    SHA512_BLOCK_SIZE   = 128,
+    SHA512_DIGEST_SIZE  =  64,
+    SHA512_PAD_SIZE     = 112 
+};
+
+
+/* Sha512 digest */
+typedef struct Sha512 {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word64  digest[SHA512_DIGEST_SIZE / sizeof(word64)];
+    word64  buffer[SHA512_BLOCK_SIZE  / sizeof(word64)];
+} Sha512;
+
+
+CYASSL_API void InitSha512(Sha512*);
+CYASSL_API void Sha512Update(Sha512*, const byte*, word32);
+CYASSL_API void Sha512Final(Sha512*, byte*);
+
+
+#ifdef CYASSL_SHA384
+
+/* in bytes */
+enum {
+    SHA384              =   5,   /* hash type unique */
+    SHA384_BLOCK_SIZE   = 128,
+    SHA384_DIGEST_SIZE  =  48,
+    SHA384_PAD_SIZE     = 112 
+};
+
+
+/* Sha384 digest */
+typedef struct Sha384 {
+    word32  buffLen;   /* in bytes          */
+    word32  loLen;     /* length in bytes   */
+    word32  hiLen;     /* length in bytes   */
+    word64  digest[SHA512_DIGEST_SIZE / sizeof(word64)]; /* for transform 512 */
+    word64  buffer[SHA384_BLOCK_SIZE  / sizeof(word64)];
+} Sha384;
+
+
+CYASSL_API void InitSha384(Sha384*);
+CYASSL_API void Sha384Update(Sha384*, const byte*, word32);
+CYASSL_API void Sha384Final(Sha384*, byte*);
+
+#endif /* CYASSL_SHA384 */
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+#endif /* CTAO_CRYPT_SHA512_H */
+#endif /* CYASSL_SHA512 */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/tfm.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/tfm.h
new file mode 100644 (file)
index 0000000..af74a90
--- /dev/null
@@ -0,0 +1,686 @@
+/* tfm.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*
+ * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
+ * http://math.libtomcrypt.com
+ */
+
+
+/**
+ *  Edited by Moisés Guimarães (moises.guimaraes@phoebus.com.br)
+ *  to fit CyaSSL's needs.
+ */
+
+
+#ifndef CTAO_CRYPT_TFM_H
+#define CTAO_CRYPT_TFM_H
+
+#include <cyassl/ctaocrypt/types.h>
+#ifndef CHAR_BIT
+    #include <limits.h>
+#endif
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+#ifndef MIN
+   #define MIN(x,y) ((x)<(y)?(x):(y))
+#endif
+
+#ifndef MAX
+   #define MAX(x,y) ((x)>(y)?(x):(y))
+#endif
+
+
+/* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */
+#if defined(__x86_64__)
+   #if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) 
+       #error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid!
+   #endif
+   #if !defined(TFM_X86_64) && !defined(TFM_NO_ASM)
+      #define TFM_X86_64
+   #endif
+#endif
+#if defined(TFM_X86_64)
+    #if !defined(FP_64BIT)
+       #define FP_64BIT
+    #endif
+#endif
+/* use 64-bit digit even if not using asm on x86_64 */
+#if defined(__x86_64__) && !defined(FP_64BIT)
+    #define FP_64BIT
+#endif
+
+/* try to detect x86-32 */
+#if defined(__i386__) && !defined(TFM_SSE2)
+   #if defined(TFM_X86_64) || defined(TFM_ARM) 
+       #error x86-32 detected, x86-64/ARM optimizations are not valid!
+   #endif
+   #if !defined(TFM_X86) && !defined(TFM_NO_ASM)
+      #define TFM_X86
+   #endif
+#endif
+
+/* make sure we're 32-bit for x86-32/sse/arm/ppc32 */
+#if (defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) || defined(TFM_PPC32)) && defined(FP_64BIT)
+   #warning x86-32, SSE2 and ARM, PPC32 optimizations require 32-bit digits (undefining)
+   #undef FP_64BIT
+#endif
+
+/* multi asms? */
+#ifdef TFM_X86
+   #define TFM_ASM
+#endif
+#ifdef TFM_X86_64
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+#ifdef TFM_SSE2
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+#ifdef TFM_ARM
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+#ifdef TFM_PPC32
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+#ifdef TFM_PPC64
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+#ifdef TFM_AVR32
+   #ifdef TFM_ASM
+      #error TFM_ASM already defined!
+   #endif
+   #define TFM_ASM
+#endif
+
+/* we want no asm? */
+#ifdef TFM_NO_ASM
+   #undef TFM_X86
+   #undef TFM_X86_64
+   #undef TFM_SSE2
+   #undef TFM_ARM
+   #undef TFM_PPC32
+   #undef TFM_PPC64
+   #undef TFM_AVR32
+   #undef TFM_ASM   
+#endif
+
+/* ECC helpers */
+#ifdef TFM_ECC192
+   #ifdef FP_64BIT
+       #define TFM_MUL3
+       #define TFM_SQR3
+   #else
+       #define TFM_MUL6
+       #define TFM_SQR6
+   #endif
+#endif
+
+#ifdef TFM_ECC224
+   #ifdef FP_64BIT
+       #define TFM_MUL4
+       #define TFM_SQR4
+   #else
+       #define TFM_MUL7
+       #define TFM_SQR7
+   #endif
+#endif
+
+#ifdef TFM_ECC256
+   #ifdef FP_64BIT
+       #define TFM_MUL4
+       #define TFM_SQR4
+   #else
+       #define TFM_MUL8
+       #define TFM_SQR8
+   #endif
+#endif
+
+#ifdef TFM_ECC384
+   #ifdef FP_64BIT
+       #define TFM_MUL6
+       #define TFM_SQR6
+   #else
+       #define TFM_MUL12
+       #define TFM_SQR12
+   #endif
+#endif
+
+#ifdef TFM_ECC521
+   #ifdef FP_64BIT
+       #define TFM_MUL9
+       #define TFM_SQR9
+   #else
+       #define TFM_MUL17
+       #define TFM_SQR17
+   #endif
+#endif
+
+
+/* some default configurations.
+ */
+#if defined(FP_64BIT)
+   /* for GCC only on supported platforms */
+#ifndef CRYPT
+   typedef unsigned long ulong64;
+#endif
+   typedef ulong64            fp_digit;
+   typedef unsigned long      fp_word __attribute__ ((mode(TI)));
+#else
+   /* this is to make porting into LibTomCrypt easier :-) */
+#ifndef CRYPT
+   #if defined(_MSC_VER) || defined(__BORLANDC__) 
+      typedef unsigned __int64   ulong64;
+      typedef signed __int64     long64;
+   #else
+      typedef unsigned long long ulong64;
+      typedef signed long long   long64;
+   #endif
+#endif
+   typedef unsigned int       fp_digit;
+   typedef ulong64            fp_word;
+#endif
+
+/* # of digits this is */
+#define DIGIT_BIT  (int)((CHAR_BIT) * sizeof(fp_digit))
+
+/* Max size of any number in bits.  Basically the largest size you will be
+ * multiplying should be half [or smaller] of FP_MAX_SIZE-four_digit
+ *
+ * It defaults to 4096-bits [allowing multiplications upto 2048x2048 bits ]
+ */
+#ifndef FP_MAX_BITS
+    #define FP_MAX_BITS           4096
+#endif
+#define FP_MAX_SIZE           (FP_MAX_BITS+(8*DIGIT_BIT))
+
+/* will this lib work? */
+#if (CHAR_BIT & 7)
+   #error CHAR_BIT must be a multiple of eight.
+#endif
+#if FP_MAX_BITS % CHAR_BIT
+   #error FP_MAX_BITS must be a multiple of CHAR_BIT
+#endif
+
+#define FP_MASK    (fp_digit)(-1)
+#define FP_SIZE    (FP_MAX_SIZE/DIGIT_BIT)
+
+/* signs */
+#define FP_ZPOS     0
+#define FP_NEG      1
+
+/* return codes */
+#define FP_OKAY     0
+#define FP_VAL      1
+#define FP_MEM      2
+
+/* equalities */
+#define FP_LT        -1   /* less than */
+#define FP_EQ         0   /* equal to */
+#define FP_GT         1   /* greater than */
+
+/* replies */
+#define FP_YES        1   /* yes response */
+#define FP_NO         0   /* no response */
+
+/* a FP type */
+typedef struct {
+    fp_digit dp[FP_SIZE];
+    int      used, 
+             sign;
+} fp_int;
+
+/* externally define this symbol to ignore the default settings, useful for changing the build from the make process */
+#ifndef TFM_ALREADY_SET
+
+/* do we want the large set of small multiplications ? 
+   Enable these if you are going to be doing a lot of small (<= 16 digit) multiplications say in ECC
+   Or if you're on a 64-bit machine doing RSA as a 1024-bit integer == 16 digits ;-)
+ */
+/* need to refactor the function */
+/*#define TFM_SMALL_SET */
+
+/* do we want huge code 
+   Enable these if you are doing 20, 24, 28, 32, 48, 64 digit multiplications (useful for RSA)
+   Less important on 64-bit machines as 32 digits == 2048 bits
+ */
+#if 0
+#define TFM_MUL3
+#define TFM_MUL4
+#define TFM_MUL6
+#define TFM_MUL7
+#define TFM_MUL8
+#define TFM_MUL9
+#define TFM_MUL12
+#define TFM_MUL17
+#endif
+#ifdef TFM_SMALL_SET
+#define TFM_MUL20
+#define TFM_MUL24
+#define TFM_MUL28
+#define TFM_MUL32
+#if (FP_MAX_BITS >= 6144) && defined(FP_64BIT)
+    #define TFM_MUL48
+#endif
+#if (FP_MAX_BITS >= 8192) && defined(FP_64BIT)
+    #define TFM_MUL64
+#endif
+#endif
+
+#if 0
+#define TFM_SQR3
+#define TFM_SQR4
+#define TFM_SQR6
+#define TFM_SQR7
+#define TFM_SQR8
+#define TFM_SQR9
+#define TFM_SQR12
+#define TFM_SQR17
+#endif
+#ifdef TFM_SMALL_SET
+#define TFM_SQR20
+#define TFM_SQR24
+#define TFM_SQR28
+#define TFM_SQR32
+#define TFM_SQR48
+#define TFM_SQR64
+#endif
+
+/* do we want some overflow checks
+   Not required if you make sure your numbers are within range (e.g. by default a modulus for fp_exptmod() can only be upto 2048 bits long)
+ */
+/* #define TFM_CHECK */
+
+/* Is the target a P4 Prescott
+ */
+/* #define TFM_PRESCOTT */
+
+/* Do we want timing resistant fp_exptmod() ?
+ * This makes it slower but also timing invariant with respect to the exponent 
+ */
+/* #define TFM_TIMING_RESISTANT */
+
+#endif /* TFM_ALREADY_SET */
+
+/* functions */
+
+/* returns a TFM ident string useful for debugging... */
+/*const char *fp_ident(void);*/
+
+/* initialize [or zero] an fp int */
+#define fp_init(a)  (void)XMEMSET((a), 0, sizeof(fp_int))
+#define fp_zero(a)  fp_init(a)
+
+/* zero/even/odd ? */
+#define fp_iszero(a) (((a)->used == 0) ? FP_YES : FP_NO)
+#define fp_iseven(a) (((a)->used >= 0 && (((a)->dp[0] & 1) == 0)) ? FP_YES : FP_NO)
+#define fp_isodd(a)  (((a)->used > 0  && (((a)->dp[0] & 1) == 1)) ? FP_YES : FP_NO)
+
+/* set to a small digit */
+void fp_set(fp_int *a, fp_digit b);
+
+/* copy from a to b */
+#define fp_copy(a, b)  (void)(((a) != (b)) ? (XMEMCPY((b), (a), sizeof(fp_int))) : (void)0)
+#define fp_init_copy(a, b) fp_copy(b, a)
+
+/* clamp digits */
+#define fp_clamp(a)   { while ((a)->used && (a)->dp[(a)->used-1] == 0) --((a)->used); (a)->sign = (a)->used ? (a)->sign : FP_ZPOS; }
+
+/* negate and absolute */
+#define fp_neg(a, b)  { fp_copy(a, b); (b)->sign ^= 1; fp_clamp(b); }
+#define fp_abs(a, b)  { fp_copy(a, b); (b)->sign  = 0; }
+
+/* right shift x digits */
+void fp_rshd(fp_int *a, int x);
+
+/* left shift x digits */
+void fp_lshd(fp_int *a, int x);
+
+/* signed comparison */
+int fp_cmp(fp_int *a, fp_int *b);
+
+/* unsigned comparison */
+int fp_cmp_mag(fp_int *a, fp_int *b);
+
+/* power of 2 operations */
+void fp_div_2d(fp_int *a, int b, fp_int *c, fp_int *d);
+void fp_mod_2d(fp_int *a, int b, fp_int *c);
+void fp_mul_2d(fp_int *a, int b, fp_int *c);
+void fp_2expt (fp_int *a, int b);
+void fp_mul_2(fp_int *a, fp_int *c);
+void fp_div_2(fp_int *a, fp_int *c);
+
+/* Counts the number of lsbs which are zero before the first zero bit */
+/*int fp_cnt_lsb(fp_int *a);*/
+
+/* c = a + b */
+void fp_add(fp_int *a, fp_int *b, fp_int *c);
+
+/* c = a - b */
+void fp_sub(fp_int *a, fp_int *b, fp_int *c);
+
+/* c = a * b */
+void fp_mul(fp_int *a, fp_int *b, fp_int *c);
+
+/* b = a*a  */
+void fp_sqr(fp_int *a, fp_int *b);
+
+/* a/b => cb + d == a */
+int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
+
+/* c = a mod b, 0 <= c < b  */
+int fp_mod(fp_int *a, fp_int *b, fp_int *c);
+
+/* compare against a single digit */
+int fp_cmp_d(fp_int *a, fp_digit b);
+
+/* c = a + b */
+void fp_add_d(fp_int *a, fp_digit b, fp_int *c);
+
+/* c = a - b */
+void fp_sub_d(fp_int *a, fp_digit b, fp_int *c);
+
+/* c = a * b */
+void fp_mul_d(fp_int *a, fp_digit b, fp_int *c);
+
+/* a/b => cb + d == a */
+/*int fp_div_d(fp_int *a, fp_digit b, fp_int *c, fp_digit *d);*/
+
+/* c = a mod b, 0 <= c < b  */
+/*int fp_mod_d(fp_int *a, fp_digit b, fp_digit *c);*/
+
+/* ---> number theory <--- */
+/* d = a + b (mod c) */
+/*int fp_addmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
+
+/* d = a - b (mod c) */
+/*int fp_submod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);*/
+
+/* d = a * b (mod c) */
+int fp_mulmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
+
+/* c = a * a (mod b) */
+int fp_sqrmod(fp_int *a, fp_int *b, fp_int *c);
+
+/* c = 1/a (mod b) */
+int fp_invmod(fp_int *a, fp_int *b, fp_int *c);
+
+/* c = (a, b) */
+/*void fp_gcd(fp_int *a, fp_int *b, fp_int *c);*/
+
+/* c = [a, b] */
+/*void fp_lcm(fp_int *a, fp_int *b, fp_int *c);*/
+
+/* setups the montgomery reduction */
+int fp_montgomery_setup(fp_int *a, fp_digit *mp);
+
+/* computes a = B**n mod b without division or multiplication useful for
+ * normalizing numbers in a Montgomery system.
+ */
+void fp_montgomery_calc_normalization(fp_int *a, fp_int *b);
+
+/* computes x/R == x (mod N) via Montgomery Reduction */
+void fp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
+
+/* d = a**b (mod c) */
+int fp_exptmod(fp_int *a, fp_int *b, fp_int *c, fp_int *d);
+
+/* primality stuff */
+
+/* perform a Miller-Rabin test of a to the base b and store result in "result" */
+/*void fp_prime_miller_rabin (fp_int * a, fp_int * b, int *result);*/
+
+/* 256 trial divisions + 8 Miller-Rabins, returns FP_YES if probable prime  */
+/*int fp_isprime(fp_int *a);*/
+
+/* Primality generation flags */
+/*#define TFM_PRIME_BBS      0x0001 */ /* BBS style prime */
+/*#define TFM_PRIME_SAFE     0x0002 */ /* Safe prime (p-1)/2 == prime */
+/*#define TFM_PRIME_2MSB_OFF 0x0004 */ /* force 2nd MSB to 0 */
+/*#define TFM_PRIME_2MSB_ON  0x0008 */ /* force 2nd MSB to 1 */
+
+/* callback for fp_prime_random, should fill dst with random bytes and return how many read [upto len] */
+/*typedef int tfm_prime_callback(unsigned char *dst, int len, void *dat);*/
+
+/*#define fp_prime_random(a, t, size, bbs, cb, dat) fp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?TFM_PRIME_BBS:0, cb, dat)*/
+
+/*int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback cb, void *dat);*/
+
+/* radix conersions */
+int fp_count_bits(fp_int *a);
+
+int fp_unsigned_bin_size(fp_int *a);
+void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c);
+void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
+
+/*int fp_signed_bin_size(fp_int *a);*/
+/*void fp_read_signed_bin(fp_int *a, unsigned char *b, int c);*/
+/*void fp_to_signed_bin(fp_int *a, unsigned char *b);*/
+
+/*int fp_read_radix(fp_int *a, char *str, int radix);*/
+/*int fp_toradix(fp_int *a, char *str, int radix);*/
+/*int fp_toradix_n(fp_int * a, char *str, int radix, int maxlen);*/
+
+
+/* VARIOUS LOW LEVEL STUFFS */
+void s_fp_add(fp_int *a, fp_int *b, fp_int *c);
+void s_fp_sub(fp_int *a, fp_int *b, fp_int *c);
+void fp_reverse(unsigned char *s, int len);
+
+void fp_mul_comba(fp_int *A, fp_int *B, fp_int *C);
+
+#ifdef TFM_SMALL_SET
+void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C);
+#endif
+
+#ifdef TFM_MUL3
+void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL4
+void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL6
+void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL7
+void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL8
+void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL9
+void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL12
+void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL17
+void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C);
+#endif
+
+#ifdef TFM_MUL20
+void fp_mul_comba20(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL24
+void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL28
+void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL32
+void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL48
+void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C);
+#endif
+#ifdef TFM_MUL64
+void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C);
+#endif
+
+void fp_sqr_comba(fp_int *A, fp_int *B);
+
+#ifdef TFM_SMALL_SET
+void fp_sqr_comba_small(fp_int *A, fp_int *B);
+#endif
+
+#ifdef TFM_SQR3
+void fp_sqr_comba3(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR4
+void fp_sqr_comba4(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR6
+void fp_sqr_comba6(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR7
+void fp_sqr_comba7(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR8
+void fp_sqr_comba8(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR9
+void fp_sqr_comba9(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR12
+void fp_sqr_comba12(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR17
+void fp_sqr_comba17(fp_int *A, fp_int *B);
+#endif
+
+#ifdef TFM_SQR20
+void fp_sqr_comba20(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR24
+void fp_sqr_comba24(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR28
+void fp_sqr_comba28(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR32
+void fp_sqr_comba32(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR48
+void fp_sqr_comba48(fp_int *A, fp_int *B);
+#endif
+#ifdef TFM_SQR64
+void fp_sqr_comba64(fp_int *A, fp_int *B);
+#endif
+/*extern const char *fp_s_rmap;*/
+
+
+/**
+ * Used by CyaSSL 
+ */
+
+/* Types */
+    typedef fp_digit mp_digit;
+    typedef fp_word  mp_word;
+    typedef fp_int mp_int;
+
+/* Constants */
+    #define MP_LT   FP_LT   /* less than    */
+    #define MP_EQ   FP_EQ   /* equal to     */
+    #define MP_GT   FP_GT   /* greater than */
+    #define MP_OKAY FP_OKAY /* ok result    */
+    #define MP_NO   FP_NO   /* yes/no result */
+    #define MP_YES  FP_YES  /* yes/no result */
+
+/* Prototypes */
+int  mp_init (mp_int * a);
+void mp_clear (mp_int * a);
+int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, mp_int* f);
+
+int  mp_add (mp_int * a, mp_int * b, mp_int * c);
+int  mp_sub (mp_int * a, mp_int * b, mp_int * c);
+int  mp_add_d (mp_int * a, mp_digit b, mp_int * c);
+
+int  mp_mul (mp_int * a, mp_int * b, mp_int * c);
+int  mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
+int  mp_mod(mp_int *a, mp_int *b, mp_int *c);
+int  mp_invmod(mp_int *a, mp_int *b, mp_int *c);
+int  mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
+
+int  mp_cmp(mp_int *a, mp_int *b);
+int  mp_cmp_d(mp_int *a, mp_digit b);
+
+int  mp_unsigned_bin_size(mp_int * a);
+int  mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
+int  mp_to_unsigned_bin (mp_int * a, unsigned char *b);
+
+int  mp_sub_d(fp_int *a, fp_digit b, fp_int *c);
+int  mp_copy(fp_int* a, fp_int* b);
+int  mp_isodd(mp_int* a);
+int  mp_iszero(mp_int* a);
+int  mp_count_bits(mp_int *a);
+int  mp_set_int(fp_int *a, fp_digit b);
+
+#ifdef HAVE_ECC
+    int mp_read_radix(mp_int* a, const char* str, int radix);
+    int mp_set(fp_int *a, fp_digit b);
+    int mp_sqr(fp_int *A, fp_int *B);
+    int mp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
+    int mp_montgomery_setup(fp_int *a, fp_digit *rho);
+    int mp_div_2(fp_int * a, fp_int * b);
+    int mp_init_copy(fp_int * a, fp_int * b); 
+#endif
+
+#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN)
+    int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
+    int mp_montgomery_calc_normalization(mp_int *a, mp_int *b);
+#endif
+
+#ifdef CYASSL_KEY_GEN
+int  mp_gcd(fp_int *a, fp_int *b, fp_int *c);
+int  mp_lcm(fp_int *a, fp_int *b, fp_int *c);
+int  mp_prime_is_prime(mp_int* a, int t, int* result);
+#endif /* CYASSL_KEY_GEN */
+
+CYASSL_API word32 CheckRunTimeFastMath(void);
+
+/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math FP_SIZE
+   must match, return 1 if a match otherwise 0 */
+#define CheckFastMathSettings() (FP_SIZE == CheckRunTimeFastMath())
+#ifdef __cplusplus
+   }
+#endif
+
+
+#endif  /* CTAO_CRYPT_TFM_H */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/types.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/types.h
new file mode 100644 (file)
index 0000000..d93df71
--- /dev/null
@@ -0,0 +1,263 @@
+/* types.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CTAO_CRYPT_TYPES_H
+#define CTAO_CRYPT_TYPES_H
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+#if defined(WORDS_BIGENDIAN) || (defined(__MWERKS__) && !defined(__INTEL__))
+    #define BIG_ENDIAN_ORDER
+#endif
+
+#ifndef BIG_ENDIAN_ORDER
+    #define LITTLE_ENDIAN_ORDER
+#endif
+
+#ifndef CYASSL_TYPES
+    #ifndef byte
+        typedef unsigned char  byte;
+    #endif
+    typedef unsigned short word16;
+    typedef unsigned int   word32;
+#endif
+
+
+/* try to set SIZEOF_LONG or LONG_LONG if user didn't */
+#if !defined(_MSC_VER) && !defined(__BCPLUSPLUS__)
+    #if !defined(SIZEOF_LONG_LONG) && !defined(SIZEOF_LONG)
+        #if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) \
+                || defined(__mips64)  || defined(__x86_64__)) 
+            /* long should be 64bit */
+            #define SIZEOF_LONG 8
+        #elif (defined__i386__) 
+            /* long long should be 64bit */
+            #define SIZEOF_LONG_LONG 8
+        #endif
+    #endif
+#endif
+
+
+#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
+    #define WORD64_AVAILABLE
+    #define W64LIT(x) x##ui64
+    typedef unsigned __int64 word64;
+#elif SIZEOF_LONG == 8
+    #define WORD64_AVAILABLE
+    #define W64LIT(x) x##LL
+    typedef unsigned long word64;
+#elif SIZEOF_LONG_LONG == 8 
+    #define WORD64_AVAILABLE
+    #define W64LIT(x) x##LL
+    typedef unsigned long long word64;
+#else
+    #define MP_16BIT  /* for mp_int, mp_word needs to be twice as big as
+                         mp_digit, no 64 bit type so make mp_digit 16 bit */
+#endif
+
+
+/* These platforms have 64-bit CPU registers.  */
+#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || \
+     defined(__mips64)  || defined(__x86_64__)) 
+    typedef word64 word;
+#else
+    typedef word32 word;
+    #ifdef WORD64_AVAILABLE
+        #define CTAOCRYPT_SLOW_WORD64
+    #endif
+#endif
+
+
+enum {
+    WORD_SIZE  = sizeof(word),
+    BIT_SIZE   = 8,
+    WORD_BITS  = WORD_SIZE * BIT_SIZE
+};
+
+
+/* use inlining if compiler allows */
+#ifndef INLINE
+#ifndef NO_INLINE
+    #ifdef _MSC_VER
+        #define INLINE __inline
+    #elif defined(__GNUC__)
+        #define INLINE inline
+    #elif defined(THREADX)
+        #define INLINE _Inline
+    #else
+        #define INLINE 
+    #endif
+#else
+    #define INLINE 
+#endif
+#endif
+
+
+/* set up rotate style */
+#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
+       #define INTEL_INTRINSICS
+       #define FAST_ROTATE
+#elif defined(__MWERKS__) && TARGET_CPU_PPC
+       #define PPC_INTRINSICS
+       #define FAST_ROTATE
+#elif defined(__GNUC__) && defined(__i386__)
+        /* GCC does peephole optimizations which should result in using rotate
+           instructions  */
+       #define FAST_ROTATE
+#endif
+
+
+/* Micrium will use Visual Studio for compilation but not the Win32 API */
+#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS)
+    #define USE_WINDOWS_API
+#endif
+
+
+/* idea to add global alloc override by Moisés Guimarães  */
+/* default to libc stuff */
+/* XREALLOC is used once in normal math lib, not in fast math lib */
+/* XFREE on some embeded systems doesn't like free(0) so test  */
+#ifdef XMALLOC_USER
+    /* prototypes for user heap override functions */
+    #include <stddef.h>  /* for size_t */
+    extern void *XMALLOC(size_t n, void* heap, int type);
+    extern void *XREALLOC(void *p, size_t n, void* heap, int type);
+    extern void XFREE(void *p, void* heap, int type);
+#elif !defined(MICRIUM_MALLOC)
+    /* default C runtime, can install different routines at runtime */
+    #include <cyassl/ctaocrypt/memory.h>
+    #define XMALLOC(s, h, t)     CyaSSL_Malloc((s))
+    #define XFREE(p, h, t)       {void* xp = (p); if((xp)) CyaSSL_Free((xp));}
+    #define XREALLOC(p, n, h, t) CyaSSL_Realloc((p), (n))
+#endif
+
+#ifndef STRING_USER
+    #include <string.h>
+    char* mystrnstr(const char* s1, const char* s2, unsigned int n);
+
+    #define XMEMCPY(d,s,l)    memcpy((d),(s),(l))
+    #define XMEMSET(b,c,l)    memset((b),(c),(l))
+    #define XMEMCMP(s1,s2,n)  memcmp((s1),(s2),(n))
+    #define XMEMMOVE(d,s,l)   memmove((d),(s),(l))
+
+    #define XSTRLEN(s1)       strlen((s1))
+    #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
+    /* strstr, strncmp, and strncat only used by CyaSSL proper, not required for
+       CTaoCrypt only */
+    #define XSTRSTR(s1,s2)    strstr((s1),(s2))
+    #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
+    #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
+    #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
+#endif
+
+#ifdef HAVE_ECC
+    #ifndef CTYPE_USER
+        #include <ctype.h>
+        #define XTOUPPER(c)     toupper((c))
+    #endif
+#endif
+
+
+/* memory allocation types for user hints */
+enum {
+    DYNAMIC_TYPE_CA         = 1,
+    DYNAMIC_TYPE_CERT       = 2,
+    DYNAMIC_TYPE_KEY        = 3,
+    DYNAMIC_TYPE_FILE       = 4,
+    DYNAMIC_TYPE_SUBJECT_CN = 5,
+    DYNAMIC_TYPE_PUBLIC_KEY = 6,
+    DYNAMIC_TYPE_SIGNER     = 7,
+    DYNAMIC_TYPE_NONE       = 8,
+    DYNAMIC_TYPE_BIGINT     = 9,
+    DYNAMIC_TYPE_RSA        = 10,
+    DYNAMIC_TYPE_METHOD     = 11,
+    DYNAMIC_TYPE_OUT_BUFFER = 12,
+    DYNAMIC_TYPE_IN_BUFFER  = 13,
+    DYNAMIC_TYPE_INFO       = 14,
+    DYNAMIC_TYPE_DH         = 15,
+    DYNAMIC_TYPE_DOMAIN     = 16,
+    DYNAMIC_TYPE_SSL        = 17,
+    DYNAMIC_TYPE_CTX        = 18,
+    DYNAMIC_TYPE_WRITEV     = 19,
+    DYNAMIC_TYPE_OPENSSL    = 20,
+    DYNAMIC_TYPE_DSA        = 21,
+    DYNAMIC_TYPE_CRL        = 22,
+    DYNAMIC_TYPE_REVOKED    = 23,
+    DYNAMIC_TYPE_CRL_ENTRY  = 24,
+    DYNAMIC_TYPE_CERT_MANAGER = 25,
+    DYNAMIC_TYPE_CRL_MONITOR  = 26,
+    DYNAMIC_TYPE_OCSP_STATUS  = 27,
+    DYNAMIC_TYPE_OCSP_ENTRY   = 28,
+    DYNAMIC_TYPE_ALTNAME      = 29
+};
+
+/* stack protection */
+enum {
+    MIN_STACK_BUFFER = 8
+};
+
+
+
+/* settings detection for compile vs runtime math incombatibilities */
+enum {
+#if !defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
+    CTC_SETTINGS = 0x0
+#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
+    CTC_SETTINGS = 0x1
+#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
+    CTC_SETTINGS = 0x2
+#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
+    CTC_SETTINGS = 0x4
+#elif defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
+    CTC_SETTINGS = 0x8
+#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
+    CTC_SETTINGS = 0x10
+#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
+    CTC_SETTINGS = 0x20
+#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
+    CTC_SETTINGS = 0x40
+#else
+    #error "bad math long / long long settings"
+#endif
+};
+
+
+CYASSL_API word32 CheckRunTimeSettings(void);
+
+/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math and long
+   types need to match at compile time and run time, CheckCtcSettings will
+   return 1 if a match otherwise 0 */
+#define CheckCtcSettings() (CTC_SETTINGS == CheckRunTimeSettings())
+
+
+#ifdef __cplusplus
+    }   /* extern "C" */
+#endif
+
+
+#endif /* CTAO_CRYPT_TYPES_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/visibility.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ctaocrypt/visibility.h
new file mode 100644 (file)
index 0000000..0143f20
--- /dev/null
@@ -0,0 +1,69 @@
+/* visibility.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* Visibility control macros */
+
+
+#ifndef CTAO_CRYPT_VISIBILITY_H
+#define CTAO_CRYPT_VISIBILITY_H
+
+
+/* CYASSL_API is used for the public API symbols.
+        It either imports or exports (or does nothing for static builds)
+
+   CYASSL_LOCAL is used for non-API symbols (private).
+*/
+
+#if defined(BUILDING_CYASSL)
+    #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
+        #define CYASSL_API   __attribute__ ((visibility("default")))
+        #define CYASSL_LOCAL __attribute__ ((visibility("hidden")))
+    #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+        #define CYASSL_API   __global  
+        #define CYASSL_LOCAL __hidden
+    #elif defined(_MSC_VER)
+        #ifdef CYASSL_DLL
+            #define CYASSL_API extern __declspec(dllexport)
+        #else
+            #define CYASSL_API
+        #endif
+        #define CYASSL_LOCAL
+    #else
+        #define CYASSL_API
+        #define CYASSL_LOCAL
+    #endif /* HAVE_VISIBILITY */
+#else /* BUILDING_CYASSL */
+    #if defined(_MSC_VER)
+        #ifdef CYASSL_DLL
+            #define CYASSL_API extern __declspec(dllimport)
+        #else
+            #define CYASSL_API
+        #endif
+        #define CYASSL_LOCAL
+    #else
+        #define CYASSL_API
+        #define CYASSL_LOCAL
+    #endif
+#endif /* BUILDING_CYASSL */
+
+
+#endif /* CTAO_CRYPT_VISIBILITY_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/error.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/error.h
new file mode 100644 (file)
index 0000000..ed96361
--- /dev/null
@@ -0,0 +1,133 @@
+/* error.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_ERROR_H
+#define CYASSL_ERROR_H
+
+#include <cyassl/ctaocrypt/error.h>   /* pull in CTaoCrypt errors */
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+enum CyaSSL_ErrorCodes {
+    INPUT_CASE_ERROR       = -201,            /* process input state error */
+    PREFIX_ERROR           = -202,            /* bad index to key rounds  */
+    MEMORY_ERROR           = -203,            /* out of memory            */
+    VERIFY_FINISHED_ERROR  = -204,            /* verify problem on finished */
+    VERIFY_MAC_ERROR       = -205,            /* verify mac problem       */
+    PARSE_ERROR            = -206,            /* parse error on header    */
+    UNKNOWN_HANDSHAKE_TYPE = -207,            /* weird handshake type     */
+    SOCKET_ERROR_E         = -208,            /* error state on socket    */
+    SOCKET_NODATA          = -209,            /* expected data, not there */
+    INCOMPLETE_DATA        = -210,            /* don't have enough data to 
+                                                 complete task            */
+    UNKNOWN_RECORD_TYPE    = -211,            /* unknown type in record hdr */
+    DECRYPT_ERROR          = -212,            /* error during decryption  */
+    FATAL_ERROR            = -213,            /* recvd alert fatal error  */
+    ENCRYPT_ERROR          = -214,            /* error during encryption  */
+    FREAD_ERROR            = -215,            /* fread problem            */
+    NO_PEER_KEY            = -216,            /* need peer's key          */
+    NO_PRIVATE_KEY         = -217,            /* need the private key     */
+    RSA_PRIVATE_ERROR      = -218,            /* error during rsa priv op */
+    NO_DH_PARAMS           = -219,            /* server missing DH params */
+    BUILD_MSG_ERROR        = -220,            /* build message failure    */
+
+    BAD_HELLO              = -221,            /* client hello malformed   */
+    DOMAIN_NAME_MISMATCH   = -222,            /* peer subject name mismatch */
+    WANT_READ              = -223,            /* want read, call again    */
+    NOT_READY_ERROR        = -224,            /* handshake layer not ready */
+    PMS_VERSION_ERROR      = -225,            /* pre m secret version error */
+    VERSION_ERROR          = -226,            /* record layer version error */
+    WANT_WRITE             = -227,            /* want write, call again   */
+    BUFFER_ERROR           = -228,            /* malformed buffer input   */
+    VERIFY_CERT_ERROR      = -229,            /* verify cert error        */
+    VERIFY_SIGN_ERROR      = -230,            /* verify sign error        */
+    CLIENT_ID_ERROR        = -231,            /* psk client identity error  */
+    SERVER_HINT_ERROR      = -232,            /* psk server hint error  */
+    PSK_KEY_ERROR          = -233,            /* psk key error  */
+    ZLIB_INIT_ERROR        = -234,            /* zlib init error  */
+    ZLIB_COMPRESS_ERROR    = -235,            /* zlib compression error  */
+    ZLIB_DECOMPRESS_ERROR  = -236,            /* zlib decompression error  */
+
+    GETTIME_ERROR          = -237,            /* gettimeofday failed ??? */
+    GETITIMER_ERROR        = -238,            /* getitimer failed ??? */
+    SIGACT_ERROR           = -239,            /* sigaction failed ??? */
+    SETITIMER_ERROR        = -240,            /* setitimer failed ??? */
+    LENGTH_ERROR           = -241,            /* record layer length error */
+    PEER_KEY_ERROR         = -242,            /* can't decode peer key */
+    ZERO_RETURN            = -243,            /* peer sent close notify */
+    SIDE_ERROR             = -244,            /* wrong client/server type */
+    NO_PEER_CERT           = -245,            /* peer didn't send key */
+    NTRU_KEY_ERROR         = -246,            /* NTRU key error  */
+    NTRU_DRBG_ERROR        = -247,            /* NTRU drbg error  */
+    NTRU_ENCRYPT_ERROR     = -248,            /* NTRU encrypt error  */
+    NTRU_DECRYPT_ERROR     = -249,            /* NTRU decrypt error  */
+    ECC_CURVETYPE_ERROR    = -250,            /* Bad ECC Curve Type */
+    ECC_CURVE_ERROR        = -251,            /* Bad ECC Curve */
+    ECC_PEERKEY_ERROR      = -252,            /* Bad Peer ECC Key */
+    ECC_MAKEKEY_ERROR      = -253,            /* Bad Make ECC Key */
+    ECC_EXPORT_ERROR       = -254,            /* Bad ECC Export Key */
+    ECC_SHARED_ERROR       = -255,            /* Bad ECC Shared Secret */
+    BAD_MUTEX_ERROR        = -256,            /* Bad mutex */
+    NOT_CA_ERROR           = -257,            /* Not a CA cert error */
+    BAD_PATH_ERROR         = -258,            /* Bad path for opendir */
+    BAD_CERT_MANAGER_ERROR = -259,            /* Bad Cert Manager */
+    OCSP_CERT_REVOKED      = -260,            /* OCSP Certificate revoked */
+    CRL_CERT_REVOKED       = -261,            /* CRL Certificate revoked */
+    CRL_MISSING            = -262,            /* CRL Not loaded */
+    MONITOR_RUNNING_E      = -263,            /* CRL Monitor already running */
+    THREAD_CREATE_E        = -264,            /* Thread Create Error */
+    OCSP_NEED_URL          = -265,            /* OCSP need an URL for lookup */
+    OCSP_CERT_UNKNOWN      = -266,            /* OCSP responder doesn't know */
+    OCSP_LOOKUP_FAIL       = -267,            /* OCSP lookup not successful */
+    MAX_CHAIN_ERROR        = -268,            /* max chain depth exceeded */
+    COOKIE_ERROR           = -269,            /* dtls cookie error */
+    /* add strings to SetErrorString !!!!! */
+
+    /* begin negotiation parameter errors */
+    UNSUPPORTED_SUITE      = -290,            /* unsupported cipher suite */
+    MATCH_SUITE_ERROR      = -291             /* can't match cipher suite */
+    /* end negotiation parameter errors only 10 for now */
+    /* add strings to SetErrorString !!!!! */
+};
+
+
+#ifdef CYASSL_CALLBACKS
+    enum {
+        MIN_PARAM_ERR = UNSUPPORTED_SUITE,
+        MAX_PARAM_ERR = MIN_PARAM_ERR - 10
+    };
+#endif
+
+
+CYASSL_LOCAL
+void SetErrorString(int error, char* buffer);
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+
+#endif /* CyaSSL_ERROR_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/include.am b/FreeRTOS-Plus/Source/CyaSSL/cyassl/include.am
new file mode 100644 (file)
index 0000000..f2b07a7
--- /dev/null
@@ -0,0 +1,20 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+#
+
+include cyassl/ctaocrypt/include.am
+include cyassl/openssl/include.am
+
+EXTRA_DIST+= cyassl/sniffer_error.rc
+
+nobase_include_HEADERS+= \
+                         cyassl/error.h \
+                         cyassl/internal.h \
+                         cyassl/ssl.h \
+                         cyassl/sniffer_error.h \
+                         cyassl/sniffer.h \
+                         cyassl/callbacks.h \
+                         cyassl/test.h \
+                         cyassl/version.h \
+                         cyassl/ocsp.h \
+                         cyassl/crl.h
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/internal.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/internal.h
new file mode 100644 (file)
index 0000000..372ca4a
--- /dev/null
@@ -0,0 +1,1466 @@
+/* internal.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_INT_H
+#define CYASSL_INT_H
+
+
+#include <cyassl/ssl.h>
+#include <cyassl/crl.h>
+#include <cyassl/ctaocrypt/types.h>
+#include <cyassl/ctaocrypt/random.h>
+#include <cyassl/ctaocrypt/des3.h>
+#include <cyassl/ctaocrypt/hc128.h>
+#include <cyassl/ctaocrypt/rabbit.h>
+#include <cyassl/ctaocrypt/asn.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/aes.h>
+#include <cyassl/ctaocrypt/logging.h>
+#ifdef HAVE_ECC
+    #include <cyassl/ctaocrypt/ecc.h>
+#endif
+#ifndef NO_SHA256
+    #include <cyassl/ctaocrypt/sha256.h>
+#endif
+#ifdef HAVE_OCSP
+    #include <cyassl/ocsp.h>
+#endif
+#ifdef CYASSL_SHA512
+    #include <cyassl/ctaocrypt/sha512.h>
+#endif
+
+#ifdef CYASSL_CALLBACKS
+    #include <cyassl/openssl/cyassl_callbacks.h>
+    #include <signal.h>
+#endif
+
+#ifdef USE_WINDOWS_API 
+    #ifdef CYASSL_GAME_BUILD
+        #include "system/xtl.h"
+    #else
+        #if defined(_WIN32_WCE) || defined(WIN32_LEAN_AND_MEAN)
+            /* On WinCE winsock2.h must be included before windows.h */
+            #include <winsock2.h>
+        #endif
+        #include <windows.h>
+    #endif
+#elif defined(THREADX)
+    #ifndef SINGLE_THREADED
+        #include "tx_api.h"
+    #endif
+#elif defined(MICRIUM)
+    /* do nothing, just don't pick Unix */
+#elif defined(FREERTOS)
+    /* do nothing */
+#else
+    #ifndef SINGLE_THREADED
+        #define CYASSL_PTHREADS
+        #include <pthread.h>
+    #endif
+    #if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
+        #include <unistd.h>      /* for close of BIO */
+    #endif
+#endif
+
+#ifdef HAVE_LIBZ
+    #include "zlib.h"
+#endif
+
+#ifdef _MSC_VER
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
+    #pragma warning(disable: 4996)
+#endif
+
+#ifdef NO_AES
+    #if !defined (ALIGN16)
+        #define ALIGN16
+    #endif
+#endif
+
+#ifdef NO_SHA256
+    #define SHA256_DIGEST_SIZE 32 
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+#ifdef USE_WINDOWS_API 
+    typedef unsigned int SOCKET_T;
+#else
+    typedef int SOCKET_T;
+#endif
+
+
+typedef byte word24[3];
+
+/* used by ssl.c and cyassl_int.c */
+void c32to24(word32 in, word24 out);
+
+/* Define or comment out the cipher suites you'd like to be compiled in
+   make sure to use at least one BUILD_SSL_xxx or BUILD_TLS_xxx is defined
+
+   When adding cipher suites, add name to cipher_names, idx to cipher_name_idx
+*/
+#ifndef NO_RC4
+    #define BUILD_SSL_RSA_WITH_RC4_128_SHA
+    #define BUILD_SSL_RSA_WITH_RC4_128_MD5
+    #if !defined(NO_TLS) && defined(HAVE_NTRU)
+        #define BUILD_TLS_NTRU_RSA_WITH_RC4_128_SHA
+    #endif
+#endif
+
+#ifndef NO_DES3
+    #define BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
+    #if !defined(NO_TLS) && defined(HAVE_NTRU)
+        #define BUILD_TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA
+    #endif
+#endif
+
+#if !defined(NO_AES) && !defined(NO_TLS)
+    #define BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
+    #define BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
+    #if !defined (NO_PSK)
+        #define BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
+    #endif
+    #if defined(HAVE_NTRU)
+        #define BUILD_TLS_NTRU_RSA_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_NTRU_RSA_WITH_AES_256_CBC_SHA
+    #endif
+    #if !defined (NO_SHA256)
+        #define BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
+        #define BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
+    #endif
+    #if defined (HAVE_AESGCM)
+        #define BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
+        #define BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
+    #endif
+#endif
+
+#if !defined(NO_HC128) && !defined(NO_TLS)
+    #define BUILD_TLS_RSA_WITH_HC_128_CBC_MD5
+    #define BUILD_TLS_RSA_WITH_HC_128_CBC_SHA
+#endif
+
+#if !defined(NO_RABBIT) && !defined(NO_TLS)
+    #define BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA
+#endif
+
+#if !defined(NO_DH) && !defined(NO_AES) && !defined(NO_TLS) && defined(OPENSSL_EXTRA)
+    #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+    #define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+    #if !defined (NO_SHA256)
+        #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+        #define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+        #if defined (HAVE_AESGCM)
+            #define BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+            #define BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+        #endif
+    #endif
+#endif
+
+#if defined(HAVE_ECC) && !defined(NO_TLS)
+    #if !defined(NO_AES)
+        #define BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+        #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+
+        #define BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+        #define BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+        #define BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+
+        #if defined (HAVE_AESGCM)
+            #define BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+            #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+            #define BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+            #define BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+
+            #define BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+            #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+            #define BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+            #define BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+        #endif
+    #endif
+    #if !defined(NO_RC4)
+        #define BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
+        #define BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
+
+        #define BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA
+        #define BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
+    #endif
+    #if !defined(NO_DES3)
+        #define BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
+        #define BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
+
+        #define BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
+        #define BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
+    #endif
+#endif
+
+
+#if defined(BUILD_SSL_RSA_WITH_RC4_128_SHA) || \
+    defined(BUILD_SSL_RSA_WITH_RC4_128_MD5)
+    #define BUILD_ARC4
+#endif
+
+#if defined(BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA)
+    #define BUILD_DES3
+#endif
+
+#if defined(BUILD_TLS_RSA_WITH_AES_128_CBC_SHA) || \
+    defined(BUILD_TLS_RSA_WITH_AES_256_CBC_SHA)
+    #define BUILD_AES
+#endif
+
+#if defined(BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256)
+    #define BUILD_AESGCM
+#endif
+
+#if defined(BUILD_TLS_RSA_WITH_HC_128_CBC_SHA) || \
+    defined(BUILD_TLS_RSA_WITH_HC_128_CBC_MD5)
+    #define BUILD_HC128
+#endif
+
+#if defined(BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA)
+    #define BUILD_RABBIT
+#endif
+
+#ifdef NO_DES3
+    #define DES_BLOCK_SIZE 8
+#endif
+
+#ifdef NO_AES
+    #define AES_BLOCK_SIZE 16
+#endif
+
+
+/* actual cipher values, 2nd byte */
+enum {
+    TLS_DHE_RSA_WITH_AES_256_CBC_SHA  = 0x39,
+    TLS_DHE_RSA_WITH_AES_128_CBC_SHA  = 0x33,
+    TLS_RSA_WITH_AES_256_CBC_SHA      = 0x35,
+    TLS_RSA_WITH_AES_128_CBC_SHA      = 0x2F,
+    TLS_PSK_WITH_AES_256_CBC_SHA      = 0x8d,
+    TLS_PSK_WITH_AES_128_CBC_SHA      = 0x8c,
+    SSL_RSA_WITH_RC4_128_SHA          = 0x05,
+    SSL_RSA_WITH_RC4_128_MD5          = 0x04,
+    SSL_RSA_WITH_3DES_EDE_CBC_SHA     = 0x0A,
+
+    /* ECC suites, first byte is 0xC0 (ECC_BYTE) */
+    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA    = 0x14,
+    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA    = 0x13,
+    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA  = 0x0A,
+    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA  = 0x09,
+    TLS_ECDHE_RSA_WITH_RC4_128_SHA        = 0x11,
+    TLS_ECDHE_ECDSA_WITH_RC4_128_SHA      = 0x07,
+    TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA   = 0x12,
+    TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0x08,
+
+        /* static ECDH, first byte is 0xC0 (ECC_BYTE) */
+    TLS_ECDH_RSA_WITH_AES_256_CBC_SHA    = 0x0F,
+    TLS_ECDH_RSA_WITH_AES_128_CBC_SHA    = 0x0E,
+    TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA  = 0x05,
+    TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA  = 0x04,
+    TLS_ECDH_RSA_WITH_RC4_128_SHA        = 0x0C,
+    TLS_ECDH_ECDSA_WITH_RC4_128_SHA      = 0x02,
+    TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA   = 0x0D,
+    TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0x03,
+
+    /* CyaSSL extension - eSTREAM */
+    TLS_RSA_WITH_HC_128_CBC_MD5       = 0xFB,
+    TLS_RSA_WITH_HC_128_CBC_SHA       = 0xFC,
+    TLS_RSA_WITH_RABBIT_CBC_SHA       = 0xFD,
+
+    /* CyaSSL extension - NTRU */
+    TLS_NTRU_RSA_WITH_RC4_128_SHA      = 0xe5,
+    TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA = 0xe6,
+    TLS_NTRU_RSA_WITH_AES_128_CBC_SHA  = 0xe7,  /* clases w/ official SHA-256 */
+    TLS_NTRU_RSA_WITH_AES_256_CBC_SHA  = 0xe8,
+
+    /* SHA256 */
+    TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x6b,
+    TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x67,
+    TLS_RSA_WITH_AES_256_CBC_SHA256     = 0x3d,
+    TLS_RSA_WITH_AES_128_CBC_SHA256     = 0x3c,
+
+    /* AES-GCM */
+    TLS_RSA_WITH_AES_128_GCM_SHA256          = 0x9c,
+    TLS_RSA_WITH_AES_256_GCM_SHA384          = 0x9d,
+    TLS_DHE_RSA_WITH_AES_128_GCM_SHA256      = 0x9e,
+    TLS_DHE_RSA_WITH_AES_256_GCM_SHA384      = 0x9f,
+
+    /* ECC AES-GCM, first byte is 0xC0 (ECC_BYTE) */
+    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  = 0x2b,
+    TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  = 0x2c,
+    TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256   = 0x2d,
+    TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384   = 0x2e,
+    TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    = 0x2f,
+    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384    = 0x30,
+    TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256     = 0x31,
+    TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384     = 0x32
+};
+
+
+enum Misc {
+    SERVER_END = 0,
+    CLIENT_END,
+
+    ECC_BYTE =  0xC0,           /* ECC first cipher suite byte */
+
+    SEND_CERT       = 1,
+    SEND_BLANK_CERT = 2,
+
+    DTLS_MAJOR      = 0xfe,     /* DTLS major version number */
+    DTLS_MINOR      = 0xff,     /* DTLS minor version number */
+    SSLv3_MAJOR     = 3,        /* SSLv3 and TLSv1+  major version number */
+    SSLv3_MINOR     = 0,        /* TLSv1   minor version number */
+    TLSv1_MINOR     = 1,        /* TLSv1   minor version number */
+    TLSv1_1_MINOR   = 2,        /* TLSv1_1 minor version number */
+    TLSv1_2_MINOR   = 3,        /* TLSv1_2 minor version number */
+    NO_COMPRESSION  =  0,
+    ZLIB_COMPRESSION = 221,     /* CyaSSL zlib compression */
+    HELLO_EXT_SIG_ALGO = 13,    /* ID for the sig_algo hello extension */
+    SECRET_LEN      = 48,       /* pre RSA and all master */
+    ENCRYPT_LEN     = 512,      /* allow 4096 bit static buffer */
+    SIZEOF_SENDER   =  4,       /* clnt or srvr           */
+    FINISHED_SZ     = MD5_DIGEST_SIZE + SHA_DIGEST_SIZE,
+    MAX_RECORD_SIZE = 16384,    /* 2^14, max size by standard */
+    MAX_MSG_EXTRA   = 70,       /* max added to msg, mac + pad  from */
+                                /* RECORD_HEADER_SZ + BLOCK_SZ (pad) + SHA_256
+                                   digest sz + BLOC_SZ (iv) + pad byte (1) */
+    MAX_COMP_EXTRA  = 1024,     /* max compression extra */
+    MAX_MTU         = 1500,     /* max expected MTU */
+    MAX_UDP_SIZE    = MAX_MTU - 100,   /* don't exceed MTU w/ 100 byte header */
+    MAX_DH_SZ       = 612,      /* 2240 p, pub, g + 2 byte size for each */
+    MAX_STR_VERSION = 8,        /* string rep of protocol version */
+
+    PAD_MD5        = 48,       /* pad length for finished */
+    PAD_SHA        = 40,       /* pad length for finished */
+    PEM_LINE_LEN   = 80,       /* PEM line max + fudge */
+    LENGTH_SZ      =  2,       /* length field for HMAC, data only */
+    VERSION_SZ     =  2,       /* length of proctocol version */
+    SEQ_SZ         =  8,       /* 64 bit sequence number  */
+    BYTE3_LEN      =  3,       /* up to 24 bit byte lengths */
+    ALERT_SIZE     =  2,       /* level + description     */
+    REQUEST_HEADER =  2,       /* always use 2 bytes      */
+    VERIFY_HEADER  =  2,       /* always use 2 bytes      */
+    MAX_DH_SIZE    = 513,      /* 4096 bit plus possible leading 0 */
+
+    MAX_SUITE_SZ = 200,        /* 100 suites for now! */
+    RAN_LEN      = 32,         /* random length           */
+    SEED_LEN     = RAN_LEN * 2, /* tls prf seed length    */
+    ID_LEN       = 32,         /* session id length       */
+    MAX_COOKIE_LEN = 32,       /* max dtls cookie size    */
+    COOKIE_SZ    = 20,         /* use a 20 byte cookie    */
+    SUITE_LEN    =  2,         /* cipher suite sz length  */
+    ENUM_LEN     =  1,         /* always a byte           */
+    COMP_LEN     =  1,         /* compression length      */
+    CURVE_LEN    =  2,         /* ecc named curve length  */
+    
+    HANDSHAKE_HEADER_SZ = 4,   /* type + length(3)        */
+    RECORD_HEADER_SZ    = 5,   /* type + version + len(2) */
+    CERT_HEADER_SZ      = 3,   /* always 3 bytes          */
+    REQ_HEADER_SZ       = 2,   /* cert request header sz  */
+    HINT_LEN_SZ         = 2,   /* length of hint size field */
+    HELLO_EXT_SZ        = 14,  /* total length of the lazy hello extensions */
+    HELLO_EXT_LEN       = 12,  /* length of the lazy hello extensions */
+    HELLO_EXT_SIGALGO_SZ  = 8, /* length of signature algo extension  */
+    HELLO_EXT_SIGALGO_LEN = 6, /* number of items in the signature algo list */
+
+    DTLS_HANDSHAKE_HEADER_SZ = 12, /* normal + seq(2) + offset(3) + length(3) */
+    DTLS_RECORD_HEADER_SZ    = 13, /* normal + epoch(2) + seq_num(6) */
+    DTLS_HANDSHAKE_EXTRA     = 8,  /* diff from normal */
+    DTLS_RECORD_EXTRA        = 8,  /* diff from normal */
+
+    FINISHED_LABEL_SZ   = 15,  /* TLS finished label size */
+    TLS_FINISHED_SZ     = 12,  /* TLS has a shorter size  */
+    MASTER_LABEL_SZ     = 13,  /* TLS master secret label sz */
+    KEY_LABEL_SZ        = 13,  /* TLS key block expansion sz */
+    MAX_PRF_HALF        = 128, /* Maximum half secret len */
+    MAX_PRF_LABSEED     = 80,  /* Maximum label + seed len */
+    MAX_PRF_DIG         = 224, /* Maximum digest len      */
+    MAX_REQUEST_SZ      = 256, /* Maximum cert req len (no auth yet */
+    SESSION_FLUSH_COUNT = 256, /* Flush session cache unless user turns off */ 
+
+    RC4_KEY_SIZE        = 16,  /* always 128bit           */
+    DES_KEY_SIZE        =  8,  /* des                     */
+    DES3_KEY_SIZE       = 24,  /* 3 des ede               */
+    DES_IV_SIZE         = DES_BLOCK_SIZE,
+    AES_256_KEY_SIZE    = 32,  /* for 256 bit             */
+    AES_192_KEY_SIZE    = 24,  /* for 192 bit             */
+    AES_IV_SIZE         = 16,  /* always block size       */
+    AES_GCM_IMP_IV_SZ   = 4,   /* Implicit part of IV     */
+    AES_GCM_EXP_IV_SZ   = 8,   /* Explicit part of IV     */
+    AES_GCM_CTR_IV_SZ   = 4,   /* Counter part of IV      */
+    AES_128_KEY_SIZE    = 16,  /* for 128 bit             */
+
+    AEAD_SEQ_OFFSET     = 4,        /* Auth Data: Sequence number */
+    AEAD_TYPE_OFFSET    = 8,        /* Auth Data: Type            */
+    AEAD_VMAJ_OFFSET    = 9,        /* Auth Data: Major Version   */
+    AEAD_VMIN_OFFSET    = 10,       /* Auth Data: Minor Version   */
+    AEAD_LEN_OFFSET     = 11,       /* Auth Data: Length          */
+    AEAD_AUTH_TAG_SZ    = 16,       /* Size of the authentication tag   */
+    AEAD_AUTH_DATA_SZ   = 13,       /* Size of the data to authenticate */
+
+    HC_128_KEY_SIZE     = 16,  /* 128 bits                */
+    HC_128_IV_SIZE      = 16,  /* also 128 bits           */
+
+    RABBIT_KEY_SIZE     = 16,  /* 128 bits                */
+    RABBIT_IV_SIZE      =  8,  /* 64 bits for iv          */
+
+    EVP_SALT_SIZE       =  8,  /* evp salt size 64 bits   */
+
+    ECDHE_SIZE          = 32,  /* ECHDE server size defaults to 256 bit */
+    MAX_EXPORT_ECC_SZ   = 256, /* Export ANS X9.62 max future size */
+
+    MAX_HELLO_SZ       = 128,  /* max client or server hello */
+    MAX_CERT_VERIFY_SZ = 1024, /* max   */
+    CLIENT_HELLO_FIRST =  35,  /* Protocol + RAN_LEN + sizeof(id_len) */
+    MAX_SUITE_NAME     =  48,  /* maximum length of cipher suite string */
+    DEFAULT_TIMEOUT    = 500,  /* default resumption timeout in seconds */
+
+    MAX_PSK_ID_LEN     = 128,  /* max psk identity/hint supported */
+    MAX_PSK_KEY_LEN    =  64,  /* max psk key supported */
+
+#ifdef FORTRESS
+    MAX_EX_DATA        =   3,  /* allow for three items of ex_data */
+    MAX_CHAIN_DEPTH    =   9,  /* max cert chain peer depth, FORTRESS option */
+#else
+    MAX_CHAIN_DEPTH    =   6,  /* max cert chain peer depth */
+#endif
+    MAX_X509_SIZE      = 2048, /* max static x509 buffer size */
+    CERT_MIN_SIZE      =  256, /* min PEM cert size with header/footer */
+    MAX_FILENAME_SZ    =  256, /* max file name length */
+    FILE_BUFFER_SIZE   = 1024, /* default static file buffer size for input,
+                                  will use dynamic buffer if not big enough */
+
+    MAX_NTRU_PUB_KEY_SZ = 1027, /* NTRU max for now */
+    MAX_NTRU_ENCRYPT_SZ = 1027, /* NTRU max for now */
+    MAX_NTRU_BITS       =  256, /* max symmetric bit strength */
+    NO_SNIFF           =   0,  /* not sniffing */
+    SNIFF              =   1,  /* currently sniffing */
+
+    HASH_SIG_SIZE      =   2,  /* default SHA1 RSA */
+
+    NO_COPY            =   0,  /* should we copy static buffer for write */
+    COPY               =   1   /* should we copy static buffer for write */
+};
+
+
+/* states */
+enum states {
+    NULL_STATE = 0,
+
+    SERVER_HELLOVERIFYREQUEST_COMPLETE,
+    SERVER_HELLO_COMPLETE,
+    SERVER_CERT_COMPLETE,
+    SERVER_KEYEXCHANGE_COMPLETE,
+    SERVER_HELLODONE_COMPLETE,
+    SERVER_FINISHED_COMPLETE,
+
+    CLIENT_HELLO_COMPLETE,
+    CLIENT_KEYEXCHANGE_COMPLETE,
+    CLIENT_FINISHED_COMPLETE,
+
+    HANDSHAKE_DONE
+};
+
+
+
+/* SSL Version */
+typedef struct ProtocolVersion {
+    byte major;
+    byte minor;
+} ProtocolVersion;
+
+
+CYASSL_LOCAL ProtocolVersion MakeSSLv3(void);
+CYASSL_LOCAL ProtocolVersion MakeTLSv1(void);
+CYASSL_LOCAL ProtocolVersion MakeTLSv1_1(void);
+CYASSL_LOCAL ProtocolVersion MakeTLSv1_2(void);
+
+#ifdef CYASSL_DTLS
+    CYASSL_LOCAL ProtocolVersion MakeDTLSv1(void);
+#endif
+
+
+enum BIO_TYPE {
+    BIO_BUFFER = 1,
+    BIO_SOCKET = 2,
+    BIO_SSL    = 3,
+    BIO_MEMORY = 4
+};
+
+
+/* CyaSSL BIO_METHOD type */
+struct CYASSL_BIO_METHOD {
+    byte type;               /* method type */
+};
+
+
+/* CyaSSL BIO type */
+struct CYASSL_BIO {
+    byte        type;          /* method type */
+    byte        close;         /* close flag */
+    byte        eof;           /* eof flag */
+    CYASSL*     ssl;           /* possible associated ssl */
+    byte*       mem;           /* memory buffer */
+    int         memLen;        /* memory buffer length */
+    int         fd;            /* possible file descriptor */
+    CYASSL_BIO* prev;          /* previous in chain */
+    CYASSL_BIO* next;          /* next in chain */
+};
+
+
+/* CyaSSL method type */
+struct CYASSL_METHOD {
+    ProtocolVersion version;
+    byte            side;         /* connection side, server or client */
+    byte            downgrade;    /* whether to downgrade version, default no */
+};
+
+
+/* defautls to client */
+CYASSL_LOCAL void InitSSL_Method(CYASSL_METHOD*, ProtocolVersion);
+
+/* for sniffer */
+CYASSL_LOCAL int DoFinished(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                            int sniff);
+CYASSL_LOCAL int DoApplicationData(CYASSL* ssl, byte* input, word32* inOutIdx);
+
+
+/* CyaSSL buffer type */
+typedef struct buffer {
+    word32 length;
+    byte*  buffer;
+} buffer;
+
+
+enum {
+    FORCED_FREE = 1,
+    NO_FORCED_FREE = 0
+};
+
+
+/* only use compression extra if using compression */
+#ifdef HAVE_LIBZ
+    #define COMP_EXTRA MAX_COMP_EXTRA
+#else
+    #define COMP_EXTRA 0
+#endif
+
+/* only the sniffer needs space in the buffer for extra MTU record(s) */
+#ifdef CYASSL_SNIFFER
+    #define MTU_EXTRA MAX_MTU * 3 
+#else
+    #define MTU_EXTRA 0
+#endif
+
+/* give user option to use 16K static buffers, sniffer needs them too */
+#if defined(LARGE_STATIC_BUFFERS) || defined(CYASSL_SNIFFER)
+    #define RECORD_SIZE MAX_RECORD_SIZE
+#else
+    #ifdef CYASSL_DTLS
+        #define RECORD_SIZE MAX_MTU 
+    #else
+        #define RECORD_SIZE 128 
+    #endif
+#endif
+
+
+/* user option to turn off 16K output option */
+/* if using small static buffers (default) and SSL_write tries to write data
+   larger than the record we have, dynamically get it, unless user says only
+   write in static buffer chuncks  */
+#ifndef STATIC_CHUNKS_ONLY
+    #define OUTPUT_RECORD_SIZE MAX_RECORD_SIZE
+#else
+    #define OUTPUT_RECORD_SIZE RECORD_SIZE
+#endif
+
+/* CyaSSL input buffer
+
+   RFC 2246:
+
+   length
+       The length (in bytes) of the following TLSPlaintext.fragment.
+       The length should not exceed 2^14.
+*/
+#define STATIC_BUFFER_LEN RECORD_HEADER_SZ + RECORD_SIZE + COMP_EXTRA + \
+        MTU_EXTRA + MAX_MSG_EXTRA
+
+typedef struct {
+    word32 length;       /* total buffer length used */
+    word32 idx;          /* idx to part of length already consumed */
+    byte*  buffer;       /* place holder for static or dynamic buffer */
+    ALIGN16 byte staticBuffer[STATIC_BUFFER_LEN];
+    word32 bufferSize;   /* current buffer size */
+    byte   dynamicFlag;  /* dynamic memory currently in use */
+} bufferStatic;
+
+/* Cipher Suites holder */
+typedef struct Suites {
+    int    setSuites;               /* user set suites from default */
+    byte   suites[MAX_SUITE_SZ];  
+    word16 suiteSz;                 /* suite length in bytes        */
+} Suites;
+
+
+CYASSL_LOCAL
+void InitSuites(Suites*, ProtocolVersion, byte, byte, byte, byte, byte, int);
+CYASSL_LOCAL
+int  SetCipherList(Suites*, const char* list);
+
+#ifndef PSK_TYPES_DEFINED
+    typedef unsigned int (*psk_client_callback)(CYASSL*, const char*, char*,
+                          unsigned int, unsigned char*, unsigned int);
+    typedef unsigned int (*psk_server_callback)(CYASSL*, const char*,
+                          unsigned char*, unsigned int);
+#endif /* PSK_TYPES_DEFINED */
+
+
+#ifndef CYASSL_USER_IO
+    /* default IO callbacks */
+    CYASSL_LOCAL
+    int EmbedReceive(char *buf, int sz, void *ctx);
+    CYASSL_LOCAL 
+    int EmbedSend(char *buf, int sz, void *ctx);
+#endif
+
+#ifdef CYASSL_DTLS
+    CYASSL_LOCAL
+    int EmbedGenerateCookie(byte *buf, int sz, void *ctx);
+    CYASSL_LOCAL
+    int IsUDP(void*);
+#endif
+
+
+/* CyaSSL Cipher type just points back to SSL */
+struct CYASSL_CIPHER {
+    CYASSL* ssl;
+};
+
+
+#ifdef SINGLE_THREADED
+    typedef int CyaSSL_Mutex;
+#else /* MULTI_THREADED */
+    /* FREERTOS comes first to enable use of FreeRTOS Windows simulator only */
+    #ifdef FREERTOS
+        typedef xSemaphoreHandle CyaSSL_Mutex;
+    #elif defined(USE_WINDOWS_API)
+        typedef CRITICAL_SECTION CyaSSL_Mutex;
+    #elif defined(CYASSL_PTHREADS)
+        typedef pthread_mutex_t CyaSSL_Mutex;
+    #elif defined(THREADX)
+        typedef TX_MUTEX CyaSSL_Mutex;
+    #elif defined(MICRIUM)
+        typedef OS_MUTEX CyaSSL_Mutex;
+    #else
+        #error Need a mutex type in multithreaded mode
+    #endif /* USE_WINDOWS_API */
+#endif /* SINGLE_THREADED */
+
+CYASSL_LOCAL int InitMutex(CyaSSL_Mutex*);
+CYASSL_LOCAL int FreeMutex(CyaSSL_Mutex*);
+CYASSL_LOCAL int LockMutex(CyaSSL_Mutex*);
+CYASSL_LOCAL int UnLockMutex(CyaSSL_Mutex*);
+
+
+
+typedef struct OCSP_Entry OCSP_Entry;
+
+struct OCSP_Entry {
+    OCSP_Entry* next;                       /* next entry             */
+    byte    issuerHash[SHA_DIGEST_SIZE];    /* issuer hash            */ 
+    byte    issuerKeyHash[SHA_DIGEST_SIZE]; /* issuer public key hash */
+    CertStatus* status;                     /* OCSP response list     */
+    int         totalStatus;                /* number on list         */
+};
+
+
+/* CyaSSL OCSP controller */
+struct CYASSL_OCSP {
+    byte enabled;
+    byte useOverrideUrl;
+    char overrideName[80];
+    char overridePath[80];
+    int  overridePort;
+    OCSP_Entry* ocspList;
+};
+
+
+typedef struct CRL_Entry CRL_Entry;
+
+/* Complete CRL */
+struct CRL_Entry {
+    CRL_Entry* next;                      /* next entry */
+    byte    issuerHash[SHA_DIGEST_SIZE];  /* issuer hash                 */ 
+    byte    crlHash[MD5_DIGEST_SIZE];     /* raw crl data hash           */ 
+    byte    lastDate[MAX_DATE_SIZE]; /* last date updated  */
+    byte    nextDate[MAX_DATE_SIZE]; /* next update date   */
+    byte    lastDateFormat;          /* last date format */
+    byte    nextDateFormat;          /* next date format */
+    RevokedCert* certs;              /* revoked cert list  */
+    int          totalCerts;         /* number on list     */
+};
+
+
+typedef struct CRL_Monitor CRL_Monitor;
+
+/* CRL directory monitor */
+struct CRL_Monitor {
+    char* path;      /* full dir path, if valid pointer we're using */
+    int   type;      /* PEM or ASN1 type */
+};
+
+
+/* CyaSSL CRL controller */
+struct CYASSL_CRL {
+    CYASSL_CERT_MANAGER* cm;            /* pointer back to cert manager */
+    CRL_Entry*           crlList;       /* our CRL list */
+    CyaSSL_Mutex         crlLock;       /* CRL list lock */
+    CRL_Monitor          monitors[2];   /* PEM and DER possible */
+#ifdef HAVE_CRL_MONITOR
+    pthread_t            tid;           /* monitoring thread */
+#endif
+};
+
+
+/* CyaSSL Certificate Manager */
+struct CYASSL_CERT_MANAGER {
+    Signer*         caList;             /* the CA signer list */
+    CyaSSL_Mutex    caLock;             /* CA list lock */
+    CallbackCACache caCacheCallback;    /* CA cache addition callback */
+    void*           heap;               /* heap helper */
+    CYASSL_CRL*     crl;                /* CRL checker */
+    byte            crlEnabled;         /* is CRL on ? */
+    byte            crlCheckAll;        /* always leaf, but all ? */
+    CbMissingCRL    cbMissingCRL;       /* notify through cb of missing crl */
+};
+
+
+/* CyaSSL context type */
+struct CYASSL_CTX {
+    CYASSL_METHOD* method;
+    CyaSSL_Mutex   countMutex;    /* reference count mutex */
+    int         refCount;         /* reference count */
+    buffer      certificate;
+    buffer      certChain;
+                 /* chain after self, in DER, with leading size for each cert */
+    buffer      privateKey;
+    buffer      serverDH_P;
+    buffer      serverDH_G;
+    CYASSL_CERT_MANAGER* cm;      /* our cert manager, ctx owns SSL will use */
+    Suites      suites;
+    void*       heap;             /* for user memory overrides */
+    byte        verifyPeer;
+    byte        verifyNone;
+    byte        failNoCert;
+    byte        sessionCacheOff;
+    byte        sessionCacheFlushOff;
+    byte        sendVerify;       /* for client side */
+    byte        haveDH;           /* server DH parms set by user */
+    byte        haveNTRU;         /* server private NTRU  key loaded */
+    byte        haveECDSAsig;     /* server cert signed w/ ECDSA */
+    byte        haveStaticECC;    /* static server ECC private key */
+    byte        partialWrite;     /* only one msg per write call */
+    byte        quietShutdown;    /* don't send close notify */
+    byte        groupMessages;    /* group handshake messages before sending */
+    CallbackIORecv CBIORecv;
+    CallbackIOSend CBIOSend;
+    VerifyCallback  verifyCallback;     /* cert verification callback */
+    word32          timeout;            /* session timeout */
+#ifdef HAVE_ECC
+    word16          eccTempKeySz;       /* in octets 20 - 66 */
+#endif
+#ifndef NO_PSK
+    byte        havePSK;                /* psk key set by user */
+    psk_client_callback client_psk_cb;  /* client callback */
+    psk_server_callback server_psk_cb;  /* server callback */
+    char        server_hint[MAX_PSK_ID_LEN];
+#endif /* NO_PSK */
+#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
+    pem_password_cb passwd_cb;
+    void*            userdata;
+#endif /* OPENSSL_EXTRA */
+#ifdef HAVE_OCSP
+    CYASSL_OCSP      ocsp;
+#endif
+};
+
+
+CYASSL_LOCAL
+int InitSSL_Ctx(CYASSL_CTX*, CYASSL_METHOD*);
+CYASSL_LOCAL
+void FreeSSL_Ctx(CYASSL_CTX*);
+CYASSL_LOCAL
+void SSL_CtxResourceFree(CYASSL_CTX*);
+
+CYASSL_LOCAL
+int DeriveTlsKeys(CYASSL* ssl);
+CYASSL_LOCAL
+int ProcessOldClientHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                          word32 inSz, word16 sz);
+CYASSL_LOCAL
+int AddCA(CYASSL_CERT_MANAGER* ctx, buffer der, int type, int verify);
+CYASSL_LOCAL
+int AlreadySigner(CYASSL_CERT_MANAGER* cm, byte* hash);
+
+/* All cipher suite related info */
+typedef struct CipherSpecs {
+    byte bulk_cipher_algorithm;
+    byte cipher_type;               /* block, stream, or aead */
+    byte mac_algorithm;
+    byte kea;                       /* key exchange algo */
+    byte sig_algo;
+    byte hash_size;
+    byte pad_size;
+    byte static_ecdh;
+    word16 key_size;
+    word16 iv_size;
+    word16 block_size;
+} CipherSpecs;
+
+
+
+/* Supported Ciphers from page 43  */
+enum BulkCipherAlgorithm { 
+    cipher_null,
+    rc4,
+    rc2,
+    des,
+    triple_des,             /* leading 3 (3des) not valid identifier */
+    des40,
+    idea,
+    aes,
+    aes_gcm,
+    hc128,                  /* CyaSSL extensions */
+    rabbit
+};
+
+
+/* Supported Message Authentication Codes from page 43 */
+enum MACAlgorithm { 
+    no_mac,
+    md5_mac,
+    sha_mac,
+    sha224_mac,
+    sha256_mac,
+    sha384_mac,
+    sha512_mac,
+    rmd_mac
+};
+
+
+/* Supported Key Exchange Protocols */
+enum KeyExchangeAlgorithm { 
+    no_kea,
+    rsa_kea, 
+    diffie_hellman_kea, 
+    fortezza_kea,
+    psk_kea,
+    ntru_kea,
+    ecc_diffie_hellman_kea,
+    ecc_static_diffie_hellman_kea       /* for verify suite only */
+};
+
+
+/* Supported Authentication Schemes */
+enum SignatureAlgorithm {
+    anonymous_sa_algo,
+    rsa_sa_algo,
+    dsa_sa_algo,
+    ecc_dsa_sa_algo
+};
+
+
+/* Supprted ECC Curve Types */
+enum EccCurves {
+    named_curve = 3
+};
+
+
+/* Supprted ECC Named Curves */
+enum EccNamedCurves {
+    secp256r1 = 0x17,         /* default, OpenSSL also calls it prime256v1 */
+    secp384r1 = 0x18,
+    secp521r1 = 0x19,
+
+    secp160r1 = 0x10,
+    secp192r1 = 0x13,        /*           Openssl also call it prime192v1 */
+    secp224r1 = 0x15
+};
+
+
+/* Valid client certificate request types from page 27 */
+enum ClientCertificateType {    
+    rsa_sign            = 1, 
+    dss_sign            = 2,
+    rsa_fixed_dh        = 3,
+    dss_fixed_dh        = 4,
+    rsa_ephemeral_dh    = 5,
+    dss_ephemeral_dh    = 6,
+    fortezza_kea_cert   = 20
+};
+
+
+enum CipherType { stream, block, aead };
+
+
+/* keys and secrets */
+typedef struct Keys {
+    byte client_write_MAC_secret[SHA256_DIGEST_SIZE];   /* max sizes */
+    byte server_write_MAC_secret[SHA256_DIGEST_SIZE]; 
+    byte client_write_key[AES_256_KEY_SIZE];         /* max sizes */
+    byte server_write_key[AES_256_KEY_SIZE]; 
+    byte client_write_IV[AES_IV_SIZE];               /* max sizes */
+    byte server_write_IV[AES_IV_SIZE];
+
+    word32 peer_sequence_number;
+    word32 sequence_number;
+    
+#ifdef CYASSL_DTLS
+    word32 dtls_sequence_number;
+    word32 dtls_peer_sequence_number;
+    word16 dtls_handshake_number;
+    word16 dtls_epoch;
+    word16 dtls_peer_epoch;
+#endif
+
+    word32 encryptSz;             /* last size of encrypted data   */
+    byte   encryptionOn;          /* true after change cipher spec */
+} Keys;
+
+
+/* cipher for now */
+typedef union {
+#ifdef BUILD_ARC4
+    Arc4   arc4;
+#endif
+#ifdef BUILD_DES3
+    Des3   des3;
+#endif
+#ifdef BUILD_AES
+    Aes    aes;
+#endif
+#ifdef HAVE_HC128
+    HC128  hc128;
+#endif
+#ifdef BUILD_RABBIT
+    Rabbit rabbit;
+#endif
+} Ciphers;
+
+
+/* hashes type */
+typedef struct Hashes {
+    byte md5[MD5_DIGEST_SIZE];
+    byte sha[SHA_DIGEST_SIZE];
+} Hashes;
+
+
+/* Static x509 buffer */
+typedef struct x509_buffer {
+    int  length;                  /* actual size */
+    byte buffer[MAX_X509_SIZE];   /* max static cert size */
+} x509_buffer;
+
+
+/* CyaSSL X509_CHAIN, for no dynamic memory SESSION_CACHE */
+struct CYASSL_X509_CHAIN {
+    int         count;                    /* total number in chain */
+    x509_buffer certs[MAX_CHAIN_DEPTH];   /* only allow max depth 4 for now */
+};
+
+
+/* CyaSSL session type */
+struct CYASSL_SESSION {
+    byte         sessionID[ID_LEN];
+    byte         masterSecret[SECRET_LEN];
+    word32       bornOn;                        /* create time in seconds   */
+    word32       timeout;                       /* timeout in seconds       */
+#ifdef SESSION_CERTS
+    CYASSL_X509_CHAIN chain;                      /* peer cert chain, static  */
+    ProtocolVersion version;
+    byte            cipherSuite0;               /* first byte, normally 0 */
+    byte            cipherSuite;                /* 2nd byte, actual suite */
+#endif
+};
+
+
+CYASSL_LOCAL
+CYASSL_SESSION* GetSession(CYASSL*, byte*);
+CYASSL_LOCAL
+int          SetSession(CYASSL*, CYASSL_SESSION*);
+
+typedef void (*hmacfp) (CYASSL*, byte*, const byte*, word32, int, int);
+
+
+/* client connect state for nonblocking restart */
+enum ConnectState {
+    CONNECT_BEGIN = 0,
+    CLIENT_HELLO_SENT,
+    HELLO_AGAIN,               /* HELLO_AGAIN s for DTLS case */
+    HELLO_AGAIN_REPLY,
+    FIRST_REPLY_DONE,
+    FIRST_REPLY_FIRST,
+    FIRST_REPLY_SECOND,
+    FIRST_REPLY_THIRD,
+    FIRST_REPLY_FOURTH,
+    FINISHED_DONE,
+    SECOND_REPLY_DONE
+};
+
+
+/* server accept state for nonblocking restart */
+enum AcceptState {
+    ACCEPT_BEGIN = 0,
+    ACCEPT_CLIENT_HELLO_DONE,
+    HELLO_VERIFY_SENT,
+    ACCEPT_FIRST_REPLY_DONE,
+    SERVER_HELLO_SENT,
+    CERT_SENT,
+    KEY_EXCHANGE_SENT,
+    CERT_REQ_SENT,
+    SERVER_HELLO_DONE,
+    ACCEPT_SECOND_REPLY_DONE,
+    CHANGE_CIPHER_SENT,
+    ACCEPT_FINISHED_DONE,
+    ACCEPT_THIRD_REPLY_DONE
+};
+
+
+typedef struct Buffers {
+    buffer          certificate;            /* CYASSL_CTX owns, unless we own */
+    buffer          key;                    /* CYASSL_CTX owns, unless we own */
+    buffer          certChain;              /* CYASSL_CTX owns */
+                 /* chain after self, in DER, with leading size for each cert */
+    buffer          domainName;             /* for client check */
+    buffer          serverDH_P;             /* CYASSL_CTX owns, unless we own */
+    buffer          serverDH_G;             /* CYASSL_CTX owns, unless we own */
+    buffer          serverDH_Pub;
+    buffer          serverDH_Priv;
+    bufferStatic    inputBuffer;
+    bufferStatic    outputBuffer;
+    buffer          clearOutputBuffer;
+    int             prevSent;              /* previous plain text bytes sent
+                                              when got WANT_WRITE            */
+    int             plainSz;               /* plain text bytes in buffer to send
+                                              when got WANT_WRITE            */
+    byte            weOwnCert;             /* SSL own cert flag */
+    byte            weOwnKey;              /* SSL own key  flag */
+    byte            weOwnDH;               /* SSL own dh (p,g)  flag */
+} Buffers;
+
+
+typedef struct Options {
+    byte            sessionCacheOff;
+    byte            sessionCacheFlushOff;
+    byte            cipherSuite0;           /* first byte, normally 0 */
+    byte            cipherSuite;            /* second byte, actual suite */
+    byte            serverState;
+    byte            clientState;
+    byte            handShakeState;
+    byte            side;               /* client or server end */
+    byte            verifyPeer;
+    byte            verifyNone;
+    byte            failNoCert;
+    byte            downgrade;          /* allow downgrade of versions */
+    byte            sendVerify;         /* false = 0, true = 1, sendBlank = 2 */
+    byte            resuming;
+    byte            haveSessionId;      /* server may not send */
+    byte            tls;                /* using TLS ? */
+    byte            tls1_1;             /* using TLSv1.1+ ? */
+    byte            dtls;               /* using datagrams ? */
+    byte            connReset;          /* has the peer reset */
+    byte            isClosed;           /* if we consider conn closed */
+    byte            closeNotify;        /* we've recieved a close notify */
+    byte            sentNotify;         /* we've sent a close notify */
+    byte            connectState;       /* nonblocking resume */
+    byte            acceptState;        /* nonblocking resume */
+    byte            usingCompression;   /* are we using compression */
+    byte            haveDH;             /* server DH parms set by user */
+    byte            haveNTRU;           /* server NTRU  private key loaded */
+    byte            haveECDSAsig;       /* server ECDSA signed cert */
+    byte            haveStaticECC;      /* static server ECC private key */
+    byte            havePeerCert;       /* do we have peer's cert */
+    byte            usingPSK_cipher;    /* whether we're using psk as cipher */
+    byte            sendAlertState;     /* nonblocking resume */ 
+    byte            processReply;       /* nonblocking resume */
+    byte            partialWrite;       /* only one msg per write call */
+    byte            quietShutdown;      /* don't send close notify */
+    byte            certOnly;           /* stop once we get cert */
+    byte            groupMessages;      /* group handshake messages */
+#ifndef NO_PSK
+    byte            havePSK;            /* psk key set by user */
+    psk_client_callback client_psk_cb;
+    psk_server_callback server_psk_cb;
+#endif /* NO_PSK */
+} Options;
+
+
+typedef struct Arrays {
+    byte            clientRandom[RAN_LEN];
+    byte            serverRandom[RAN_LEN];
+    byte            sessionID[ID_LEN];
+    byte            preMasterSecret[ENCRYPT_LEN];
+    byte            masterSecret[SECRET_LEN];
+#ifdef CYASSL_DTLS
+    byte            cookie[MAX_COOKIE_LEN];
+    byte            cookieSz;
+#endif
+#ifndef NO_PSK
+    char            client_identity[MAX_PSK_ID_LEN];
+    char            server_hint[MAX_PSK_ID_LEN];
+    byte            psk_key[MAX_PSK_KEY_LEN];
+    word32          psk_keySz;          /* acutal size */
+#endif
+    word32          preMasterSz;        /* differs for DH, actual size */
+} Arrays;
+
+
+struct CYASSL_X509_NAME {
+    char  name[ASN_NAME_MAX];
+    int   sz;
+};
+
+
+struct CYASSL_X509 {
+    CYASSL_X509_NAME issuer;
+    CYASSL_X509_NAME subject;
+    int              serialSz;
+    byte             serial[EXTERNAL_SERIAL_SIZE];
+    char             subjectCN[ASN_NAME_MAX];        /* common name short cut */
+    buffer           derCert;                        /* may need  */
+    DNS_entry*       altNames;                       /* alt names list */
+    DNS_entry*       altNamesNext;                   /* hint for retrieval */
+};
+
+
+/* record layer header for PlainText, Compressed, and CipherText */
+typedef struct RecordLayerHeader {
+    byte            type;
+    ProtocolVersion version;
+    byte            length[2];
+} RecordLayerHeader;
+
+
+/* record layer header for DTLS PlainText, Compressed, and CipherText */
+typedef struct DtlsRecordLayerHeader {
+    byte            type;
+    ProtocolVersion version;
+    byte            epoch[2];             /* increment on cipher state change */
+    byte            sequence_number[6];   /* per record */
+    byte            length[2];
+} DtlsRecordLayerHeader;
+
+
+/* CyaSSL ssl type */
+struct CYASSL {
+    CYASSL_CTX*     ctx;
+    int             error;
+    ProtocolVersion version;            /* negotiated version */
+    ProtocolVersion chVersion;          /* client hello version */
+    Suites          suites;
+    Ciphers         encrypt;
+    Ciphers         decrypt;
+    CipherSpecs     specs;
+    Keys            keys;
+    int             rfd;                /* read  file descriptor */
+    int             wfd;                /* write file descriptor */
+    CYASSL_BIO*     biord;              /* socket bio read  to free/close */
+    CYASSL_BIO*     biowr;              /* socket bio write to free/close */
+    void*           IOCB_ReadCtx;
+    void*           IOCB_WriteCtx;
+    RNG             rng;
+    Md5             hashMd5;            /* md5 hash of handshake msgs */
+    Sha             hashSha;            /* sha hash of handshake msgs */
+#ifndef NO_SHA256
+    Sha256          hashSha256;         /* sha256 hash of handshake msgs */
+#endif
+#ifdef CYASSL_SHA384
+    Sha384          hashSha384;         /* sha384 hash of handshake msgs */
+#endif
+    Hashes          verifyHashes;
+    Hashes          certHashes;         /* for cert verify */
+    Buffers         buffers;
+    Options         options;
+    Arrays          arrays;
+    CYASSL_SESSION  session;
+    VerifyCallback  verifyCallback;      /* cert verification callback */
+    RsaKey          peerRsaKey;
+    byte            peerRsaKeyPresent;
+#ifdef HAVE_NTRU
+    word16          peerNtruKeyLen;
+    byte            peerNtruKey[MAX_NTRU_PUB_KEY_SZ];
+    byte            peerNtruKeyPresent;
+#endif
+#ifdef HAVE_ECC
+    ecc_key         peerEccKey;              /* peer's  ECDHE key */
+    ecc_key         peerEccDsaKey;           /* peer's  ECDSA key */
+    ecc_key         eccTempKey;              /* private ECDHE key */
+    ecc_key         eccDsaKey;               /* private ECDSA key */
+    word16          eccTempKeySz;            /* in octets 20 - 66 */
+    byte            peerEccKeyPresent;
+    byte            peerEccDsaKeyPresent;
+    byte            eccTempKeyPresent;
+    byte            eccDsaKeyPresent;
+#endif
+    hmacfp          hmac;
+    void*           heap;               /* for user overrides */
+    RecordLayerHeader curRL;
+    word16            curSize;
+    word32          timeout;            /* session timeout */
+    CYASSL_CIPHER   cipher;
+#ifdef HAVE_LIBZ
+    z_stream        c_stream;           /* compression   stream */
+    z_stream        d_stream;           /* decompression stream */
+    byte            didStreamInit;      /* for stream init and end */
+#endif
+#ifdef CYASSL_CALLBACKS
+    HandShakeInfo   handShakeInfo;      /* info saved during handshake */
+    TimeoutInfo     timeoutInfo;        /* info saved during handshake */
+    byte            hsInfoOn;           /* track handshake info        */
+    byte            toInfoOn;           /* track timeout   info        */
+#endif
+#ifdef OPENSSL_EXTRA
+    CYASSL_X509     peerCert;           /* X509 peer cert */
+#endif
+#ifdef FORTRESS
+    void*           ex_data[MAX_EX_DATA]; /* external data, for Fortress */
+#endif
+};
+
+
+CYASSL_LOCAL
+int  InitSSL(CYASSL*, CYASSL_CTX*);
+CYASSL_LOCAL
+void FreeSSL(CYASSL*);
+CYASSL_API void SSL_ResourceFree(CYASSL*);   /* Micrium uses */
+
+
+enum {
+    IV_SZ   = 32,          /* max iv sz */
+    NAME_SZ = 80,          /* max one line */
+};
+
+
+typedef struct EncryptedInfo {
+    char     name[NAME_SZ];    /* encryption name */
+    byte     iv[IV_SZ];        /* encrypted IV */
+    word32   ivSz;             /* encrypted IV size */
+    long     consumed;         /* tracks PEM bytes consumed */
+    byte     set;              /* if encryption set */
+    CYASSL_CTX* ctx;              /* CTX owner */
+} EncryptedInfo;
+
+CYASSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type,
+                          buffer* der, void* heap, EncryptedInfo* info,
+                          int* eccKey);
+
+CYASSL_LOCAL int ProcessFile(CYASSL_CTX* ctx, const char* fname, int format,
+                             int type, CYASSL* ssl, int userChain,
+                            CYASSL_CRL* crl);
+
+
+#ifdef CYASSL_CALLBACKS
+    CYASSL_LOCAL
+    void InitHandShakeInfo(HandShakeInfo*);
+    CYASSL_LOCAL 
+    void FinishHandShakeInfo(HandShakeInfo*, const CYASSL*);
+    CYASSL_LOCAL 
+    void AddPacketName(const char*, HandShakeInfo*);
+
+    CYASSL_LOCAL
+    void InitTimeoutInfo(TimeoutInfo*);
+    CYASSL_LOCAL 
+    void FreeTimeoutInfo(TimeoutInfo*, void*);
+    CYASSL_LOCAL 
+    void AddPacketInfo(const char*, TimeoutInfo*, const byte*, int, void*);
+    CYASSL_LOCAL 
+    void AddLateName(const char*, TimeoutInfo*);
+    CYASSL_LOCAL 
+    void AddLateRecordHeader(const RecordLayerHeader* rl, TimeoutInfo* info);
+#endif
+
+
+/* Record Layer Header identifier from page 12 */
+enum ContentType {
+    no_type            = 0,
+    change_cipher_spec = 20, 
+    alert              = 21, 
+    handshake          = 22, 
+    application_data   = 23 
+};
+
+
+/* handshake header, same for each message type, pgs 20/21 */
+typedef struct HandShakeHeader {
+    byte            type;
+    word24          length;
+} HandShakeHeader;
+
+
+/* DTLS handshake header, same for each message type */
+typedef struct DtlsHandShakeHeader {
+    byte            type;
+    word24          length;
+    byte            message_seq[2];    /* start at 0, restransmit gets same # */
+    word24          fragment_offset;   /* bytes in previous fragments */
+    word24          fragment_length;   /* length of this fragment */
+} DtlsHandShakeHeader;
+
+
+enum HandShakeType {
+    no_shake            = -1,
+    hello_request       = 0, 
+    client_hello        = 1, 
+    server_hello        = 2,
+    hello_verify_request = 3,       /* DTLS addition */
+    session_ticket      =  4,
+    certificate         = 11, 
+    server_key_exchange = 12,
+    certificate_request = 13, 
+    server_hello_done   = 14,
+    certificate_verify  = 15, 
+    client_key_exchange = 16,
+    finished            = 20
+};
+
+
+/* Valid Alert types from page 16/17 */
+enum AlertDescription {
+    close_notify            = 0,
+    unexpected_message      = 10,
+    bad_record_mac          = 20,
+    decompression_failure   = 30,
+    handshake_failure       = 40,
+    no_certificate          = 41,
+    bad_certificate         = 42,
+    unsupported_certificate = 43,
+    certificate_revoked     = 44,
+    certificate_expired     = 45,
+    certificate_unknown     = 46,
+    illegal_parameter       = 47,
+    decrypt_error           = 51,
+    protocol_version        = 70,
+    no_renegotiation        = 100
+};
+
+
+/* I/O Callback default errors */
+enum IOerrors {
+    IO_ERR_GENERAL    = -1,     /* general unexpected err, not in below group */
+    IO_ERR_WANT_READ  = -2,     /* need to call read  again */
+    IO_ERR_WANT_WRITE = -2,     /* need to call write again */
+    IO_ERR_CONN_RST   = -3,     /* connection reset */
+    IO_ERR_ISR        = -4,     /* interrupt */
+    IO_ERR_CONN_CLOSE = -5      /* connection closed or epipe */
+};
+
+
+enum AlertLevel { 
+    alert_warning = 1, 
+    alert_fatal = 2
+};
+
+
+static const byte client[SIZEOF_SENDER] = { 0x43, 0x4C, 0x4E, 0x54 };
+static const byte server[SIZEOF_SENDER] = { 0x53, 0x52, 0x56, 0x52 };
+
+static const byte tls_client[FINISHED_LABEL_SZ + 1] = "client finished";
+static const byte tls_server[FINISHED_LABEL_SZ + 1] = "server finished";
+
+
+/* internal functions */
+CYASSL_LOCAL int SendChangeCipher(CYASSL*);
+CYASSL_LOCAL int SendData(CYASSL*, const void*, int);
+CYASSL_LOCAL int SendCertificate(CYASSL*);
+CYASSL_LOCAL int SendCertificateRequest(CYASSL*);
+CYASSL_LOCAL int SendServerKeyExchange(CYASSL*);
+CYASSL_LOCAL int SendBuffered(CYASSL*);
+CYASSL_LOCAL int ReceiveData(CYASSL*, byte*, int);
+CYASSL_LOCAL int SendFinished(CYASSL*);
+CYASSL_LOCAL int SendAlert(CYASSL*, int, int);
+CYASSL_LOCAL int ProcessReply(CYASSL*);
+
+CYASSL_LOCAL int SetCipherSpecs(CYASSL*);
+CYASSL_LOCAL int MakeMasterSecret(CYASSL*);
+
+CYASSL_LOCAL int  AddSession(CYASSL*);
+CYASSL_LOCAL int  DeriveKeys(CYASSL* ssl);
+CYASSL_LOCAL int  StoreKeys(CYASSL* ssl, const byte* keyData);
+
+CYASSL_LOCAL int IsTLS(const CYASSL* ssl);
+CYASSL_LOCAL int IsAtLeastTLSv1_2(const CYASSL* ssl);
+
+CYASSL_LOCAL void ShrinkInputBuffer(CYASSL* ssl, int forcedFree);
+CYASSL_LOCAL void ShrinkOutputBuffer(CYASSL* ssl);
+CYASSL_LOCAL int SendHelloVerifyRequest(CYASSL* ssl);
+CYASSL_LOCAL Signer* GetCA(void* cm, byte* hash);
+CYASSL_LOCAL void BuildTlsFinished(CYASSL* ssl, Hashes* hashes,
+                                   const byte* sender);
+#ifndef NO_TLS
+    CYASSL_LOCAL int  MakeTlsMasterSecret(CYASSL*);
+    CYASSL_LOCAL void TLS_hmac(CYASSL* ssl, byte* digest, const byte* buffer,
+                               word32 sz, int content, int verify);
+#endif
+
+#ifndef NO_CYASSL_CLIENT
+    CYASSL_LOCAL int SendClientHello(CYASSL*);
+    CYASSL_LOCAL int SendClientKeyExchange(CYASSL*);
+    CYASSL_LOCAL int SendCertificateVerify(CYASSL*);
+#endif /* NO_CYASSL_CLIENT */
+
+#ifndef NO_CYASSL_SERVER
+    CYASSL_LOCAL int SendServerHello(CYASSL*);
+    CYASSL_LOCAL int SendServerHelloDone(CYASSL*);
+    #ifdef CYASSL_DTLS
+        CYASSL_LOCAL int SendHelloVerifyRequest(CYASSL*);
+    #endif
+#endif /* NO_CYASSL_SERVER */
+
+
+#ifndef NO_TLS
+    
+
+#endif /* NO_TLS */
+
+
+
+typedef double timer_d;
+
+CYASSL_LOCAL timer_d Timer(void);
+CYASSL_LOCAL word32  LowResTimer(void);
+
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+#endif /* CyaSSL_INT_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ocsp.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ocsp.h
new file mode 100644 (file)
index 0000000..2cfd46e
--- /dev/null
@@ -0,0 +1,52 @@
+/* ssl.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* CyaSSL OCSP API */
+
+#ifndef CYASSL_OCSP_H
+#define CYASSL_OCSP_H
+
+
+#include <cyassl/ssl.h>
+#include <cyassl/ctaocrypt/asn.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+typedef struct CYASSL_OCSP CYASSL_OCSP;
+
+CYASSL_LOCAL int  CyaSSL_OCSP_Init(CYASSL_OCSP*);
+CYASSL_LOCAL void CyaSSL_OCSP_Cleanup(CYASSL_OCSP*);
+
+CYASSL_LOCAL int  CyaSSL_OCSP_set_override_url(CYASSL_OCSP*, const char*);
+CYASSL_LOCAL int  CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP*, DecodedCert*);
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+
+#endif /* CYASSL_OCSP_H */
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/asn1.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/asn1.h
new file mode 100644 (file)
index 0000000..3f34d7d
--- /dev/null
@@ -0,0 +1,2 @@
+/* asn1.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bio.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bio.h
new file mode 100644 (file)
index 0000000..aba1935
--- /dev/null
@@ -0,0 +1,23 @@
+/* bio.h for openssl */
+
+
+#ifndef CYASSL_BIO_H_
+#define CYASSL_BIO_H_
+
+#include <cyassl/openssl/ssl.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL_BIO_H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bn.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/bn.h
new file mode 100644 (file)
index 0000000..0796bab
--- /dev/null
@@ -0,0 +1,115 @@
+/* bn.h for openssl */
+
+
+#ifndef CYASSL_BN_H_
+#define CYASSL_BN_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+typedef struct CYASSL_BIGNUM {
+    int   neg;              /* openssh deference */
+    void* internal;         /* our big num */
+} CYASSL_BIGNUM;        
+
+
+typedef struct CYASSL_BN_CTX CYASSL_BN_CTX;
+
+
+CYASSL_API CYASSL_BN_CTX* CyaSSL_BN_CTX_new(void);
+CYASSL_API void           CyaSSL_BN_CTX_init(CYASSL_BN_CTX*);
+CYASSL_API void           CyaSSL_BN_CTX_free(CYASSL_BN_CTX*);
+
+CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_new(void);
+CYASSL_API void           CyaSSL_BN_free(CYASSL_BIGNUM*);
+CYASSL_API void           CyaSSL_BN_clear_free(CYASSL_BIGNUM*);
+
+
+CYASSL_API int CyaSSL_BN_sub(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
+                                const CYASSL_BIGNUM*);
+CYASSL_API int CyaSSL_BN_mod(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
+                                const CYASSL_BIGNUM*, const CYASSL_BN_CTX*);
+
+CYASSL_API const CYASSL_BIGNUM* CyaSSL_BN_value_one(void);
+
+
+CYASSL_API int CyaSSL_BN_num_bytes(const CYASSL_BIGNUM*);
+CYASSL_API int CyaSSL_BN_num_bits(const CYASSL_BIGNUM*);
+
+CYASSL_API int CyaSSL_BN_is_zero(const CYASSL_BIGNUM*);
+CYASSL_API int CyaSSL_BN_is_one(const CYASSL_BIGNUM*);
+CYASSL_API int CyaSSL_BN_is_odd(const CYASSL_BIGNUM*);
+
+CYASSL_API int CyaSSL_BN_cmp(const CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
+
+CYASSL_API int CyaSSL_BN_bn2bin(const CYASSL_BIGNUM*, unsigned char*);
+CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_bin2bn(const unsigned char*, int len,
+                                   CYASSL_BIGNUM* ret);
+
+CYASSL_API int CyaSSL_mask_bits(CYASSL_BIGNUM*, int n);
+
+CYASSL_API int CyaSSL_BN_rand(CYASSL_BIGNUM*, int bits, int top, int bottom);
+CYASSL_API int CyaSSL_BN_is_bit_set(const CYASSL_BIGNUM*, int n);
+CYASSL_API int CyaSSL_BN_hex2bn(CYASSL_BIGNUM**, const char* str);
+
+CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_dup(const CYASSL_BIGNUM*);
+CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_copy(CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
+
+CYASSL_API int CyaSSL_BN_set_word(CYASSL_BIGNUM*, unsigned long w);
+
+CYASSL_API int   CyaSSL_BN_dec2bn(CYASSL_BIGNUM**, const char* str);
+CYASSL_API char* CyaSSL_BN_bn2dec(const CYASSL_BIGNUM*);
+
+
+typedef CYASSL_BIGNUM BIGNUM;
+typedef CYASSL_BN_CTX BN_CTX;
+
+#define BN_CTX_new        CyaSSL_BN_CTX_new
+#define BN_CTX_init       CyaSSL_BN_CTX_init
+#define BN_CTX_free       CyaSSL_BN_CTX_free
+
+#define BN_new        CyaSSL_BN_new
+#define BN_free       CyaSSL_BN_free
+#define BN_clear_free CyaSSL_BN_clear_free
+
+#define BN_num_bytes CyaSSL_BN_num_bytes
+#define BN_num_bits  CyaSSL_BN_num_bits
+
+#define BN_is_zero  CyaSSL_BN_is_zero
+#define BN_is_one   CyaSSL_BN_is_one
+#define BN_is_odd   CyaSSL_BN_is_odd
+
+#define BN_cmp    CyaSSL_BN_cmp
+
+#define BN_bn2bin  CyaSSL_BN_bn2bin
+#define BN_bin2bn  CyaSSL_BN_bin2bn
+
+#define BN_mod       CyaSSL_BN_mod
+#define BN_sub       CyaSSL_BN_sub
+#define BN_value_one CyaSSL_BN_value_one
+
+#define BN_mask_bits CyaSSL_mask_bits
+
+#define BN_rand       CyaSSL_BN_rand
+#define BN_is_bit_set CyaSSL_BN_is_bit_set
+#define BN_hex2bn     CyaSSL_BN_hex2bn
+
+#define BN_dup  CyaSSL_BN_dup
+#define BN_copy CyaSSL_BN_copy
+
+#define BN_set_word CyaSSL_BN_set_word
+
+#define BN_dec2bn CyaSSL_BN_dec2bn
+#define BN_bn2dec CyaSSL_BN_bn2dec
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL__H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/conf.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/conf.h
new file mode 100644 (file)
index 0000000..1e328cf
--- /dev/null
@@ -0,0 +1,2 @@
+/* conf.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/crypto.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/crypto.h
new file mode 100644 (file)
index 0000000..f7d5337
--- /dev/null
@@ -0,0 +1,26 @@
+/* crypto.h for openSSL */
+
+#ifndef CYASSL_CRYPTO_H_
+#define CYASSL_CRYPTO_H_
+
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_crypto.h"
+#endif
+
+
+CYASSL_API const char*   CyaSSLeay_version(int type);
+CYASSL_API unsigned long CyaSSLeay(void);
+
+#define SSLeay_version CyaSSLeay_version
+#define SSLeay CyaSSLeay
+
+
+#define SSLEAY_VERSION 0x0090600fL
+#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION
+
+
+#endif /* header */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/des.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/des.h
new file mode 100644 (file)
index 0000000..aacc276
--- /dev/null
@@ -0,0 +1,87 @@
+/* des.h
+ *
+ * Copyright (C) 2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*  des.h defines mini des openssl compatibility layer 
+ *
+ */
+
+
+#ifndef CYASSL_DES_H_
+#define CYASSL_DES_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_des.h"
+#endif
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+typedef unsigned char CYASSL_DES_cblock[8];
+typedef /* const */ CYASSL_DES_cblock CYASSL_const_DES_cblock;
+typedef CYASSL_DES_cblock CYASSL_DES_key_schedule;
+
+
+enum {
+    DES_ENCRYPT = 1,
+    DES_DECRYPT = 0
+};
+
+
+CYASSL_API void CyaSSL_DES_set_key_unchecked(CYASSL_const_DES_cblock*,
+                                             CYASSL_DES_key_schedule*);
+CYASSL_API int  CyaSSL_DES_key_sched(CYASSL_const_DES_cblock* key,
+                                     CYASSL_DES_key_schedule* schedule);
+CYASSL_API void CyaSSL_DES_cbc_encrypt(const unsigned char* input,
+                     unsigned char* output, long length,
+                     CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec,
+                     int enc);
+CYASSL_API void CyaSSL_DES_ncbc_encrypt(const unsigned char* input,
+                      unsigned char* output, long length,
+                      CYASSL_DES_key_schedule* schedule,
+                      CYASSL_DES_cblock* ivec, int enc);
+
+CYASSL_API void CyaSSL_DES_set_odd_parity(CYASSL_DES_cblock*);
+CYASSL_API void CyaSSL_DES_ecb_encrypt(CYASSL_DES_cblock*, CYASSL_DES_cblock*,
+                                       CYASSL_DES_key_schedule*, int);
+
+
+typedef CYASSL_DES_cblock DES_cblock;
+typedef CYASSL_const_DES_cblock const_DES_cblock;
+typedef CYASSL_DES_key_schedule DES_key_schedule;
+
+#define DES_set_key_unchecked CyaSSL_DES_set_key_unchecked
+#define DES_key_sched CyaSSL_DES_key_sched
+#define DES_cbc_encrypt CyaSSL_DES_cbc_encrypt
+#define DES_ncbc_encrypt CyaSSL_DES_ncbc_encrypt
+#define DES_set_odd_parity CyaSSL_DES_set_odd_parity
+#define DES_ecb_encrypt CyaSSL_DES_ecb_encrypt
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CYASSL_DES_H_ */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dh.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dh.h
new file mode 100644 (file)
index 0000000..2faccbc
--- /dev/null
@@ -0,0 +1,52 @@
+/* dh.h for openSSL */
+
+
+#ifndef CYASSL_DH_H_
+#define CYASSL_DH_H_
+
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/openssl/bn.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+
+
+typedef struct CYASSL_DH {
+       CYASSL_BIGNUM* p;
+       CYASSL_BIGNUM* g;
+    CYASSL_BIGNUM* pub_key;      /* openssh deference g^x */
+    CYASSL_BIGNUM* priv_key;     /* openssh deference x   */
+    void*          internal;     /* our DH */
+    char           inSet;        /* internal set from external ? */
+    char           exSet;        /* external set from internal ? */
+} CYASSL_DH;
+
+
+CYASSL_API CYASSL_DH* CyaSSL_DH_new(void);
+CYASSL_API void       CyaSSL_DH_free(CYASSL_DH*);
+
+CYASSL_API int CyaSSL_DH_size(CYASSL_DH*);
+CYASSL_API int CyaSSL_DH_generate_key(CYASSL_DH*);
+CYASSL_API int CyaSSL_DH_compute_key(unsigned char* key, CYASSL_BIGNUM* pub,
+                                     CYASSL_DH*);
+
+typedef CYASSL_DH DH;
+
+#define DH_new  CyaSSL_DH_new 
+#define DH_free CyaSSL_DH_free
+
+#define DH_size         CyaSSL_DH_size
+#define DH_generate_key CyaSSL_DH_generate_key
+#define DH_compute_key  CyaSSL_DH_compute_key
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+#endif /* header */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dsa.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/dsa.h
new file mode 100644 (file)
index 0000000..817f1fa
--- /dev/null
@@ -0,0 +1,53 @@
+/* dsa.h for openSSL */
+
+
+#ifndef CYASSL_DSA_H_
+#define CYASSL_DSA_H_
+
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/openssl/bn.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+
+struct CYASSL_DSA {
+       CYASSL_BIGNUM* p;
+       CYASSL_BIGNUM* q;
+       CYASSL_BIGNUM* g;
+       CYASSL_BIGNUM* pub_key;      /* our y */
+       CYASSL_BIGNUM* priv_key;     /* our x */
+    void*          internal;     /* our Dsa Key */
+    char           inSet;        /* internal set from external ? */
+    char           exSet;        /* external set from internal ? */
+};
+
+
+CYASSL_API CYASSL_DSA* CyaSSL_DSA_new(void);
+CYASSL_API void        CyaSSL_DSA_free(CYASSL_DSA*);
+
+CYASSL_API int CyaSSL_DSA_generate_key(CYASSL_DSA*);
+CYASSL_API int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA*, int bits,
+                   unsigned char* seed, int seedLen, int* counterRet,
+                   unsigned long* hRet, void* cb);
+
+CYASSL_API int CyaSSL_DSA_LoadDer(CYASSL_DSA*, const unsigned char*, int sz);
+CYASSL_API int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
+                                  CYASSL_DSA* dsa);
+
+#define DSA_new CyaSSL_DSA_new
+#define DSA_free CyaSSL_DSA_free
+
+#define DSA_generate_key           CyaSSL_DSA_generate_key
+#define DSA_generate_parameters_ex CyaSSL_DSA_generate_parameters_ex
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+#endif /* header */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ec.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ec.h
new file mode 100644 (file)
index 0000000..5ffdaf6
--- /dev/null
@@ -0,0 +1,2 @@
+/* ec.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ecdsa.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ecdsa.h
new file mode 100644 (file)
index 0000000..f3cf0de
--- /dev/null
@@ -0,0 +1,2 @@
+/* ecdsa.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/engine.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/engine.h
new file mode 100644 (file)
index 0000000..39952fc
--- /dev/null
@@ -0,0 +1,5 @@
+/* engine.h for libcurl */
+
+#undef HAVE_OPENSSL_ENGINE_H
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/err.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/err.h
new file mode 100644 (file)
index 0000000..7e7f1eb
--- /dev/null
@@ -0,0 +1,2 @@
+/* err.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/evp.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/evp.h
new file mode 100644 (file)
index 0000000..3bfe428
--- /dev/null
@@ -0,0 +1,239 @@
+/* evp.h
+ *
+ * Copyright (C) 2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*  evp.h defines mini evp openssl compatibility layer 
+ *
+ */
+
+
+#ifndef CYASSL_EVP_H_
+#define CYASSL_EVP_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_evp.h"
+#endif
+
+#include <cyassl/openssl/md5.h>
+#include <cyassl/openssl/sha.h>
+#include <cyassl/openssl/ripemd.h>
+#include <cyassl/openssl/rsa.h>
+#include <cyassl/openssl/dsa.h>
+
+#include <cyassl/ctaocrypt/aes.h>
+#include <cyassl/ctaocrypt/des3.h>
+#include <cyassl/ctaocrypt/arc4.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+typedef char CYASSL_EVP_MD;
+typedef char CYASSL_EVP_CIPHER;
+
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_md5(void);
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha1(void);
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha256(void);
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha384(void);
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha512(void);
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_ripemd160(void);
+
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_cbc(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_cbc(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_cbc(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_ctr(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_ctr(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_ctr(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_cbc(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_ede3_cbc(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_rc4(void);
+CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_enc_null(void);
+
+
+typedef union {
+    CYASSL_MD5_CTX    md5;
+    CYASSL_SHA_CTX    sha;
+    CYASSL_SHA256_CTX sha256;
+    #ifdef CYASSL_SHA384
+        CYASSL_SHA384_CTX sha384;
+    #endif
+    #ifdef CYASSL_SHA512
+        CYASSL_SHA512_CTX sha512;
+    #endif
+    #ifdef CYASSL_RIPEMD
+        CYASSL_RIPEMD_CTX ripemd;
+    #endif
+} CYASSL_Hasher;
+
+
+typedef struct CYASSL_EVP_MD_CTX {
+    unsigned char macType;
+    CYASSL_Hasher hash;
+} CYASSL_EVP_MD_CTX;
+
+
+typedef union {
+    Aes  aes;
+    Des  des;
+    Des3 des3;
+    Arc4 arc4;
+} CYASSL_Cipher;
+
+
+enum {
+    AES_128_CBC_TYPE  = 1,
+    AES_192_CBC_TYPE  = 2,
+    AES_256_CBC_TYPE  = 3,
+    AES_128_CTR_TYPE  = 4,
+    AES_192_CTR_TYPE  = 5,
+    AES_256_CTR_TYPE  = 6,
+    DES_CBC_TYPE      = 7,
+    DES_EDE3_CBC_TYPE = 8,
+    ARC4_TYPE         = 9,
+    NULL_CIPHER_TYPE  = 10,
+    EVP_PKEY_RSA      = 11,
+    EVP_PKEY_DSA      = 12,
+    NID_sha1          = 64,
+    NID_md5           =  4
+};
+
+
+typedef struct CYASSL_EVP_CIPHER_CTX {
+    int            keyLen;         /* user may set for variable */
+    unsigned char  enc;            /* if encrypt side, then true */
+    unsigned char  cipherType;
+    unsigned char  iv[64];         /* working iv pointer into cipher */
+    CYASSL_Cipher  cipher;
+} CYASSL_EVP_CIPHER_CTX;
+
+
+CYASSL_API int  CyaSSL_EVP_MD_size(const CYASSL_EVP_MD* md);
+CYASSL_API void CyaSSL_EVP_MD_CTX_init(CYASSL_EVP_MD_CTX* ctx);
+CYASSL_API int  CyaSSL_EVP_MD_CTX_cleanup(CYASSL_EVP_MD_CTX* ctx);
+
+CYASSL_API int CyaSSL_EVP_DigestInit(CYASSL_EVP_MD_CTX* ctx,
+                                     const CYASSL_EVP_MD* type);
+CYASSL_API int CyaSSL_EVP_DigestUpdate(CYASSL_EVP_MD_CTX* ctx, const void* data,
+                                       unsigned long sz);
+CYASSL_API int CyaSSL_EVP_DigestFinal(CYASSL_EVP_MD_CTX* ctx, unsigned char* md,
+                                      unsigned int* s);
+CYASSL_API int CyaSSL_EVP_DigestFinal_ex(CYASSL_EVP_MD_CTX* ctx,
+                                            unsigned char* md, unsigned int* s);
+CYASSL_API int CyaSSL_EVP_BytesToKey(const CYASSL_EVP_CIPHER*,
+                              const CYASSL_EVP_MD*, const unsigned char*,
+                              const unsigned char*, int, int, unsigned char*,
+                              unsigned char*);
+
+CYASSL_API void CyaSSL_EVP_CIPHER_CTX_init(CYASSL_EVP_CIPHER_CTX* ctx);
+CYASSL_API int  CyaSSL_EVP_CIPHER_CTX_cleanup(CYASSL_EVP_CIPHER_CTX* ctx);
+
+CYASSL_API int  CyaSSL_EVP_CIPHER_CTX_iv_length(const CYASSL_EVP_CIPHER_CTX*);
+
+
+CYASSL_API int  CyaSSL_EVP_CipherInit(CYASSL_EVP_CIPHER_CTX* ctx,
+                                    const CYASSL_EVP_CIPHER* type,
+                                    unsigned char* key, unsigned char* iv,
+                                    int enc);
+CYASSL_API int  CyaSSL_EVP_CIPHER_CTX_key_length(CYASSL_EVP_CIPHER_CTX* ctx);
+CYASSL_API int  CyaSSL_EVP_CIPHER_CTX_set_key_length(CYASSL_EVP_CIPHER_CTX* ctx,
+                                                     int keylen);
+CYASSL_API int  CyaSSL_EVP_Cipher(CYASSL_EVP_CIPHER_CTX* ctx,
+                          unsigned char* dst, unsigned char* src,
+                          unsigned int len);
+
+CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_get_digestbynid(int);
+
+CYASSL_API CYASSL_RSA* CyaSSL_EVP_PKEY_get1_RSA(CYASSL_EVP_PKEY*);
+CYASSL_API CYASSL_DSA* CyaSSL_EVP_PKEY_get1_DSA(CYASSL_EVP_PKEY*);
+
+/* these next ones don't need real OpenSSL type, for OpenSSH compat only */
+CYASSL_API void* CyaSSL_EVP_X_STATE(const CYASSL_EVP_CIPHER_CTX* ctx);
+CYASSL_API int   CyaSSL_EVP_X_STATE_LEN(const CYASSL_EVP_CIPHER_CTX* ctx);
+
+CYASSL_API void  CyaSSL_3des_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
+                                unsigned char* iv, int len);
+CYASSL_API void  CyaSSL_aes_ctr_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
+                                unsigned char* iv, int len);
+
+CYASSL_API int  CyaSSL_StoreExternalIV(CYASSL_EVP_CIPHER_CTX* ctx);
+CYASSL_API int  CyaSSL_SetInternalIV(CYASSL_EVP_CIPHER_CTX* ctx);
+
+
+/* end OpenSSH compat */
+
+typedef CYASSL_EVP_MD         EVP_MD;
+typedef CYASSL_EVP_CIPHER     EVP_CIPHER;
+typedef CYASSL_EVP_MD_CTX     EVP_MD_CTX;
+typedef CYASSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
+
+#define EVP_md5       CyaSSL_EVP_md5
+#define EVP_sha1      CyaSSL_EVP_sha1
+#define EVP_sha256    CyaSSL_EVP_sha256
+#define EVP_sha384    CyaSSL_EVP_sha384
+#define EVP_sha512    CyaSSL_EVP_sha512
+#define EVP_ripemd160 CyaSSL_EVP_ripemd160
+
+#define EVP_aes_128_cbc  CyaSSL_EVP_aes_128_cbc
+#define EVP_aes_192_cbc  CyaSSL_EVP_aes_192_cbc
+#define EVP_aes_256_cbc  CyaSSL_EVP_aes_256_cbc
+#define EVP_aes_128_ctr  CyaSSL_EVP_aes_128_ctr
+#define EVP_aes_192_ctr  CyaSSL_EVP_aes_192_ctr
+#define EVP_aes_256_ctr  CyaSSL_EVP_aes_256_ctr
+#define EVP_des_cbc      CyaSSL_EVP_des_cbc
+#define EVP_des_ede3_cbc CyaSSL_EVP_des_ede3_cbc
+#define EVP_rc4          CyaSSL_EVP_rc4
+#define EVP_enc_null     CyaSSL_EVP_enc_null
+
+#define EVP_MD_size        CyaSSL_EVP_MD_size
+#define EVP_MD_CTX_init    CyaSSL_EVP_MD_CTX_init
+#define EVP_MD_CTX_cleanup CyaSSL_EVP_MD_CTX_cleanup
+#define EVP_DigestInit     CyaSSL_EVP_DigestInit
+#define EVP_DigestUpdate   CyaSSL_EVP_DigestUpdate
+#define EVP_DigestFinal    CyaSSL_EVP_DigestFinal
+#define EVP_DigestFinal_ex CyaSSL_EVP_DigestFinal_ex
+#define EVP_BytesToKey     CyaSSL_EVP_BytesToKey
+
+#define EVP_CIPHER_CTX_init           CyaSSL_EVP_CIPHER_CTX_init
+#define EVP_CIPHER_CTX_cleanup        CyaSSL_EVP_CIPHER_CTX_cleanup
+#define EVP_CIPHER_CTX_iv_length      CyaSSL_EVP_CIPHER_CTX_iv_length
+#define EVP_CIPHER_CTX_key_length     CyaSSL_EVP_CIPHER_CTX_key_length
+#define EVP_CIPHER_CTX_set_key_length CyaSSL_EVP_CIPHER_CTX_set_key_length
+#define EVP_CipherInit                CyaSSL_EVP_CipherInit
+#define EVP_Cipher                    CyaSSL_EVP_Cipher
+
+#define EVP_get_digestbynid           CyaSSL_EVP_get_digestbynid
+
+#define EVP_PKEY_get1_RSA   CyaSSL_EVP_PKEY_get1_RSA
+#define EVP_PKEY_get1_DSA   CyaSSL_EVP_PKEY_get1_DSA
+
+#ifndef EVP_MAX_MD_SIZE
+    #define EVP_MAX_MD_SIZE   64     /* sha512 */
+#endif
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CYASSL_EVP_H_ */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/hmac.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/hmac.h
new file mode 100644 (file)
index 0000000..03e9bce
--- /dev/null
@@ -0,0 +1,81 @@
+/* hmac.h
+ *
+ * Copyright (C) 2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*  hmac.h defines mini hamc openssl compatibility layer 
+ *
+ */
+
+
+#ifndef CYASSL_HMAC_H_
+#define CYASSL_HMAC_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_hmac.h"
+#endif
+
+#include <cyassl/openssl/evp.h>
+#include <cyassl/ctaocrypt/hmac.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md,
+                               const void* key, int key_len,
+                               const unsigned char* d, int n, unsigned char* md,
+                               unsigned int* md_len);
+
+
+typedef struct CYASSL_HMAC_CTX {
+    Hmac hmac;
+    int  type;
+} CYASSL_HMAC_CTX;
+
+
+CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key,
+                                 int keylen, const EVP_MD* type);
+CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx,
+                                   const unsigned char* data, int len);
+CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash,
+                                  unsigned int* len);
+CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx);
+
+
+typedef struct CYASSL_HMAC_CTX HMAC_CTX;
+
+#define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
+
+#define HMAC_Init    CyaSSL_HMAC_Init
+#define HMAC_Update  CyaSSL_HMAC_Update
+#define HMAC_Final   CyaSSL_HMAC_Final
+#define HMAC_cleanup CyaSSL_HMAC_cleanup
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CYASSL_HMAC_H_ */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/include.am b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/include.am
new file mode 100644 (file)
index 0000000..e531f76
--- /dev/null
@@ -0,0 +1,36 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+nobase_include_HEADERS+= \
+                         cyassl/openssl/asn1.h \
+                         cyassl/openssl/bio.h \
+                         cyassl/openssl/bn.h \
+                         cyassl/openssl/conf.h \
+                         cyassl/openssl/crypto.h \
+                         cyassl/openssl/des.h \
+                         cyassl/openssl/dh.h \
+                         cyassl/openssl/dsa.h \
+                         cyassl/openssl/ecdsa.h \
+                         cyassl/openssl/ec.h \
+                         cyassl/openssl/engine.h \
+                         cyassl/openssl/err.h \
+                         cyassl/openssl/evp.h \
+                         cyassl/openssl/hmac.h \
+                         cyassl/openssl/lhash.h \
+                         cyassl/openssl/md4.h \
+                         cyassl/openssl/md5.h \
+                         cyassl/openssl/ripemd.h \
+                         cyassl/openssl/ocsp.h \
+                         cyassl/openssl/opensslconf.h \
+                         cyassl/openssl/opensslv.h \
+                         cyassl/openssl/ossl_typ.h \
+                         cyassl/openssl/pem.h \
+                         cyassl/openssl/pkcs12.h \
+                         cyassl/openssl/rand.h \
+                         cyassl/openssl/rsa.h \
+                         cyassl/openssl/sha.h \
+                         cyassl/openssl/ssl.h \
+                         cyassl/openssl/stack.h \
+                         cyassl/openssl/ui.h \
+                         cyassl/openssl/x509.h \
+                         cyassl/openssl/x509v3.h
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/lhash.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/lhash.h
new file mode 100644 (file)
index 0000000..01f8535
--- /dev/null
@@ -0,0 +1,2 @@
+/* lhash.h for openSSL */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md4.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md4.h
new file mode 100644 (file)
index 0000000..2e99f97
--- /dev/null
@@ -0,0 +1 @@
+/* md4.h for libcurl */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md5.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/md5.h
new file mode 100644 (file)
index 0000000..0fddb51
--- /dev/null
@@ -0,0 +1,39 @@
+/* md5.h for openssl */
+
+
+#ifndef CYASSL_MD5_H_
+#define CYASSL_MD5_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_md5.h"
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+typedef struct CYASSL_MD5_CTX {
+    int holder[24];   /* big enough to hold ctaocrypt md5, but check on init */
+} CYASSL_MD5_CTX;
+
+CYASSL_API void CyaSSL_MD5_Init(CYASSL_MD5_CTX*);
+CYASSL_API void CyaSSL_MD5_Update(CYASSL_MD5_CTX*, const void*, unsigned long);
+CYASSL_API void CyaSSL_MD5_Final(unsigned char*, CYASSL_MD5_CTX*);
+
+
+typedef CYASSL_MD5_CTX MD5_CTX;
+
+#define MD5_Init CyaSSL_MD5_Init
+#define MD5_Update CyaSSL_MD5_Update
+#define MD5_Final CyaSSL_MD5_Final
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL_MD5_H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ocsp.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ocsp.h
new file mode 100644 (file)
index 0000000..7463eec
--- /dev/null
@@ -0,0 +1 @@
+/* ocsp.h for libcurl */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslconf.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslconf.h
new file mode 100644 (file)
index 0000000..ac6b55b
--- /dev/null
@@ -0,0 +1,8 @@
+/* opensslconf.h for openSSL */
+
+
+#ifndef OPENSSL_THREADS
+    #define OPENSSL_THREADS
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslv.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/opensslv.h
new file mode 100644 (file)
index 0000000..bdcc805
--- /dev/null
@@ -0,0 +1,12 @@
+/* opensslv.h compatibility */
+
+#ifndef CYASSL_OPENSSLV_H_
+#define CYASSL_OPENSSLV_H_
+
+
+/* api version compatibility */
+#define OPENSSL_VERSION_NUMBER 0x0090410fL
+
+
+#endif /* header */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ossl_typ.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ossl_typ.h
new file mode 100644 (file)
index 0000000..65b00c7
--- /dev/null
@@ -0,0 +1,2 @@
+/* ossl_typ.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pem.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pem.h
new file mode 100644 (file)
index 0000000..b727862
--- /dev/null
@@ -0,0 +1,41 @@
+/* pem.h for openssl */
+
+
+#ifndef CYASSL_PEM_H_
+#define CYASSL_PEM_H_
+
+#include <cyassl/openssl/evp.h>
+#include <cyassl/openssl/bio.h>
+#include <cyassl/openssl/rsa.h>
+#include <cyassl/openssl/dsa.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+CYASSL_API int CyaSSL_PEM_write_bio_RSAPrivateKey(CYASSL_BIO* bio, RSA* rsa,
+                                         const EVP_CIPHER* cipher,
+                                         unsigned char* passwd, int len,
+                                         pem_password_cb cb, void* arg);
+
+CYASSL_API int CyaSSL_PEM_write_bio_DSAPrivateKey(CYASSL_BIO* bio, DSA* rsa,
+                                         const EVP_CIPHER* cipher,
+                                         unsigned char* passwd, int len,
+                                         pem_password_cb cb, void* arg);
+
+CYASSL_API CYASSL_EVP_PKEY* CyaSSL_PEM_read_bio_PrivateKey(CYASSL_BIO* bio,
+                        CYASSL_EVP_PKEY**, pem_password_cb cb, void* arg); 
+
+#define PEM_write_bio_RSAPrivateKey CyaSSL_PEM_write_bio_RSAPrivateKey
+#define PEM_write_bio_DSAPrivateKey CyaSSL_PEM_write_bio_DSAPrivateKey
+#define PEM_read_bio_PrivateKey     CyaSSL_PEM_read_bio_PrivateKey
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL_PEM_H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pkcs12.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/pkcs12.h
new file mode 100644 (file)
index 0000000..544b6f0
--- /dev/null
@@ -0,0 +1,2 @@
+/* pkcs12.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rand.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rand.h
new file mode 100644 (file)
index 0000000..a5534e1
--- /dev/null
@@ -0,0 +1,4 @@
+/* rand.h for openSSL */
+
+#include <cyassl/openssl/ssl.h>
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ripemd.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ripemd.h
new file mode 100644 (file)
index 0000000..2d4d014
--- /dev/null
@@ -0,0 +1,37 @@
+/* ripemd.h for openssl */
+
+
+#ifndef CYASSL_RIPEMD_H_
+#define CYASSL_RIPEMD_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+typedef struct CYASSL_RIPEMD_CTX {
+    int holder[32];   /* big enough to hold ctaocrypt, but check on init */
+} CYASSL_RIPEMD_CTX;
+
+CYASSL_API void CyaSSL_RIPEMD_Init(CYASSL_RIPEMD_CTX*);
+CYASSL_API void CyaSSL_RIPEMD_Update(CYASSL_RIPEMD_CTX*, const void*,
+                                     unsigned long);
+CYASSL_API void CyaSSL_RIPEMD_Final(unsigned char*, CYASSL_RIPEMD_CTX*);
+
+
+typedef CYASSL_RIPEMD_CTX RIPEMD_CTX;
+
+#define RIPEMD_Init   CyaSSL_RIPEMD_Init
+#define RIPEMD_Update CyaSSL_RIPEMD_Update
+#define RIPEMD_Final  CyaSSL_RIPEMD_Final
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL_MD5_H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rsa.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/rsa.h
new file mode 100644 (file)
index 0000000..149ad46
--- /dev/null
@@ -0,0 +1,75 @@
+/* rsa.h for openSSL */
+
+
+#ifndef CYASSL_RSA_H_
+#define CYASSL_RSA_H_
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/openssl/bn.h>
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+enum  { 
+       RSA_PKCS1_PADDING = 1
+ };
+
+struct CYASSL_RSA {
+       CYASSL_BIGNUM* n;
+       CYASSL_BIGNUM* e;
+       CYASSL_BIGNUM* d;
+       CYASSL_BIGNUM* p;
+       CYASSL_BIGNUM* q;
+       CYASSL_BIGNUM* dmp1;      /* dP */
+       CYASSL_BIGNUM* dmq1;      /* dQ */
+       CYASSL_BIGNUM* iqmp;      /* u */
+    void*          internal;  /* our RSA */
+    char           inSet;     /* internal set from external ? */
+    char           exSet;     /* external set from internal ? */
+};
+
+
+CYASSL_API CYASSL_RSA* CyaSSL_RSA_new(void);
+CYASSL_API void        CyaSSL_RSA_free(CYASSL_RSA*);
+
+CYASSL_API int CyaSSL_RSA_generate_key_ex(CYASSL_RSA*, int bits, CYASSL_BIGNUM*,
+                                          void* cb);
+
+CYASSL_API int CyaSSL_RSA_blinding_on(CYASSL_RSA*, CYASSL_BN_CTX*);
+CYASSL_API int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr,
+                                      unsigned char* to, CYASSL_RSA*, int padding);
+CYASSL_API int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr,
+                                      unsigned char* to, CYASSL_RSA*, int padding);
+
+CYASSL_API int CyaSSL_RSA_size(const CYASSL_RSA*);
+CYASSL_API int CyaSSL_RSA_sign(int type, const unsigned char* m,
+                               unsigned int mLen, unsigned char* sigRet,
+                               unsigned int* sigLen, CYASSL_RSA*);
+CYASSL_API int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from,
+                                  unsigned char* to, CYASSL_RSA*, int padding);
+CYASSL_API int CyaSSL_RSA_GenAdd(CYASSL_RSA*);
+CYASSL_API int CyaSSL_RSA_LoadDer(CYASSL_RSA*, const unsigned char*, int sz);
+
+
+#define RSA_new  CyaSSL_RSA_new
+#define RSA_free CyaSSL_RSA_free
+
+#define RSA_generate_key_ex CyaSSL_RSA_generate_key_ex
+
+#define RSA_blinding_on     CyaSSL_RSA_blinding_on
+#define RSA_public_encrypt  CyaSSL_RSA_public_encrypt
+#define RSA_private_decrypt CyaSSL_RSA_private_decrypt
+
+#define RSA_size           CyaSSL_RSA_size
+#define RSA_sign           CyaSSL_RSA_sign
+#define RSA_public_decrypt CyaSSL_RSA_public_decrypt
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+#endif /* header */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/sha.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/sha.h
new file mode 100644 (file)
index 0000000..0b37a9b
--- /dev/null
@@ -0,0 +1,125 @@
+/* sha.h for openssl */
+
+
+#ifndef CYASSL_SHA_H_
+#define CYASSL_SHA_H_
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef YASSL_PREFIX
+#include "prefix_sha.h"
+#endif
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+typedef struct CYASSL_SHA_CTX {
+    int holder[24];   /* big enough to hold ctaocrypt sha, but check on init */
+} CYASSL_SHA_CTX;
+
+CYASSL_API void CyaSSL_SHA_Init(CYASSL_SHA_CTX*);
+CYASSL_API void CyaSSL_SHA_Update(CYASSL_SHA_CTX*, const void*, unsigned long);
+CYASSL_API void CyaSSL_SHA_Final(unsigned char*, CYASSL_SHA_CTX*);
+
+/* SHA1 points to above, shouldn't use SHA0 ever */
+CYASSL_API void CyaSSL_SHA1_Init(CYASSL_SHA_CTX*);
+CYASSL_API void CyaSSL_SHA1_Update(CYASSL_SHA_CTX*, const void*, unsigned long);
+CYASSL_API void CyaSSL_SHA1_Final(unsigned char*, CYASSL_SHA_CTX*);
+
+enum {
+    SHA_DIGEST_LENGTH = 20
+};
+
+
+typedef CYASSL_SHA_CTX SHA_CTX;
+
+#define SHA_Init CyaSSL_SHA_Init
+#define SHA_Update CyaSSL_SHA_Update
+#define SHA_Final CyaSSL_SHA_Final
+
+#define SHA1_Init CyaSSL_SHA1_Init
+#define SHA1_Update CyaSSL_SHA1_Update
+#define SHA1_Final CyaSSL_SHA1_Final
+
+
+typedef struct CYASSL_SHA256_CTX {
+    int holder[28];   /* big enough to hold ctaocrypt sha, but check on init */
+} CYASSL_SHA256_CTX;
+
+CYASSL_API void CyaSSL_SHA256_Init(CYASSL_SHA256_CTX*);
+CYASSL_API void CyaSSL_SHA256_Update(CYASSL_SHA256_CTX*, const void*,
+                                        unsigned long);
+CYASSL_API void CyaSSL_SHA256_Final(unsigned char*, CYASSL_SHA256_CTX*);
+
+enum {
+    SHA256_DIGEST_LENGTH = 20
+};
+
+
+typedef CYASSL_SHA256_CTX SHA256_CTX;
+
+#define SHA256_Init   CyaSSL_SHA256_Init
+#define SHA256_Update CyaSSL_SHA256_Update
+#define SHA256_Final  CyaSSL_SHA256_Final
+
+
+#ifdef CYASSL_SHA384
+
+typedef struct CYASSL_SHA384_CTX {
+    long long holder[32];   /* big enough, but check on init */
+} CYASSL_SHA384_CTX;
+
+CYASSL_API void CyaSSL_SHA384_Init(CYASSL_SHA384_CTX*);
+CYASSL_API void CyaSSL_SHA384_Update(CYASSL_SHA384_CTX*, const void*,
+                                        unsigned long);
+CYASSL_API void CyaSSL_SHA384_Final(unsigned char*, CYASSL_SHA384_CTX*);
+
+enum {
+    SHA384_DIGEST_LENGTH = 48 
+};
+
+
+typedef CYASSL_SHA384_CTX SHA384_CTX;
+
+#define SHA384_Init   CyaSSL_SHA384_Init
+#define SHA384_Update CyaSSL_SHA384_Update
+#define SHA384_Final  CyaSSL_SHA384_Final
+
+#endif /* CYASSL_SHA384 */
+
+#ifdef CYASSL_SHA512
+
+typedef struct CYASSL_SHA512_CTX {
+    long long holder[36];   /* big enough, but check on init */
+} CYASSL_SHA512_CTX;
+
+CYASSL_API void CyaSSL_SHA512_Init(CYASSL_SHA512_CTX*);
+CYASSL_API void CyaSSL_SHA512_Update(CYASSL_SHA512_CTX*, const void*,
+                                        unsigned long);
+CYASSL_API void CyaSSL_SHA512_Final(unsigned char*, CYASSL_SHA512_CTX*);
+
+enum {
+    SHA512_DIGEST_LENGTH = 64 
+};
+
+
+typedef CYASSL_SHA512_CTX SHA512_CTX;
+
+#define SHA512_Init   CyaSSL_SHA512_Init
+#define SHA512_Update CyaSSL_SHA512_Update
+#define SHA512_Final  CyaSSL_SHA512_Final
+
+#endif /* CYASSL_SHA512 */
+
+
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */ 
+#endif
+
+
+#endif /* CYASSL_SHA_H_ */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ssl.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ssl.h
new file mode 100644 (file)
index 0000000..f268b6a
--- /dev/null
@@ -0,0 +1,377 @@
+/* ssl.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * a with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/*  ssl.h defines openssl compatibility layer 
+ *
+ */
+
+
+#ifndef CYASSL_OPENSSL_H_
+#define CYASSL_OPENSSL_H_
+
+#include <cyassl/ssl.h>
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+#ifdef _WIN32
+    /* wincrypt.h clashes */
+    #undef X509_NAME
+#endif
+
+
+typedef CYASSL          SSL;          
+typedef CYASSL_SESSION  SSL_SESSION;
+typedef CYASSL_METHOD   SSL_METHOD;
+typedef CYASSL_CTX      SSL_CTX;
+
+typedef CYASSL_X509       X509;
+typedef CYASSL_X509_NAME  X509_NAME;
+typedef CYASSL_X509_CHAIN X509_CHAIN;
+
+
+/* redeclare guard */
+#define CYASSL_TYPES_DEFINED
+
+
+typedef CYASSL_EVP_PKEY       EVP_PKEY;
+typedef CYASSL_RSA            RSA;
+typedef CYASSL_DSA            DSA;
+typedef CYASSL_BIO            BIO;
+typedef CYASSL_BIO_METHOD     BIO_METHOD;
+typedef CYASSL_CIPHER         SSL_CIPHER;
+typedef CYASSL_X509_LOOKUP    X509_LOOKUP;
+typedef CYASSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD;
+typedef CYASSL_X509_CRL       X509_CRL;
+typedef CYASSL_X509_EXTENSION X509_EXTENSION;
+typedef CYASSL_ASN1_TIME      ASN1_TIME;
+typedef CYASSL_ASN1_INTEGER   ASN1_INTEGER;
+typedef CYASSL_ASN1_OBJECT    ASN1_OBJECT;
+typedef CYASSL_ASN1_STRING    ASN1_STRING;
+typedef CYASSL_dynlock_value  CRYPTO_dynlock_value;
+
+#define ASN1_UTCTIME CYASSL_ASN1_TIME
+
+typedef CYASSL_MD4_CTX        MD4_CTX;
+typedef CYASSL_COMP_METHOD    COMP_METHOD;
+typedef CYASSL_X509_STORE     X509_STORE;
+typedef CYASSL_X509_REVOKED   X509_REVOKED;
+typedef CYASSL_X509_OBJECT    X509_OBJECT;
+typedef CYASSL_X509_STORE_CTX X509_STORE_CTX;
+
+
+#define SSLv3_server_method CyaSSLv3_server_method
+#define SSLv3_client_method CyaSSLv3_client_method
+#define TLSv1_server_method CyaTLSv1_server_method
+#define TLSv1_client_method CyaTLSv1_client_method
+#define TLSv1_1_server_method CyaTLSv1_1_server_method
+#define TLSv1_1_client_method CyaTLSv1_1_client_method
+#define TLSv1_2_server_method CyaTLSv1_2_server_method
+#define TLSv1_2_client_method CyaTLSv1_2_client_method
+
+#ifdef CYASSL_DTLS
+    #define DTLSv1_client_method CyaDTLSv1_client_method
+    #define DTLSv1_server_method CyaDTLSv1_server_method
+#endif
+
+
+#ifndef NO_FILESYSTEM
+    #define SSL_CTX_use_certificate_file CyaSSL_CTX_use_certificate_file
+    #define SSL_CTX_use_PrivateKey_file CyaSSL_CTX_use_PrivateKey_file
+    #define SSL_CTX_load_verify_locations CyaSSL_CTX_load_verify_locations
+    #define SSL_CTX_use_certificate_chain_file CyaSSL_CTX_use_certificate_chain_file
+    #define SSL_CTX_use_RSAPrivateKey_file CyaSSL_CTX_use_RSAPrivateKey_file
+    
+    #define SSL_use_certificate_file CyaSSL_use_certificate_file
+    #define SSL_use_PrivateKey_file CyaSSL_use_PrivateKey_file
+    #define SSL_use_certificate_chain_file CyaSSL_use_certificate_chain_file
+    #define SSL_use_RSAPrivateKey_file CyaSSL_use_RSAPrivateKey_file
+#endif
+
+#define SSL_CTX_new CyaSSL_CTX_new
+#define SSL_new     CyaSSL_new
+#define SSL_set_fd  CyaSSL_set_fd
+#define SSL_get_fd  CyaSSL_get_fd
+#define SSL_connect CyaSSL_connect
+
+#define SSL_write    CyaSSL_write
+#define SSL_read     CyaSSL_read
+#define SSL_accept   CyaSSL_accept
+#define SSL_CTX_free CyaSSL_CTX_free
+#define SSL_free     CyaSSL_free
+#define SSL_shutdown CyaSSL_shutdown
+
+#define SSL_CTX_set_quiet_shutdown CyaSSL_CTX_set_quiet_shutdown
+#define SSL_set_quiet_shutdown CyaSSL_set_quiet_shutdown
+#define SSL_get_error CyaSSL_get_error
+#define SSL_set_session CyaSSL_set_session
+#define SSL_get_session CyaSSL_get_session
+#define SSL_flush_sessions CyaSSL_flush_sessions
+
+#define SSL_CTX_set_verify CyaSSL_CTX_set_verify
+#define SSL_set_verify CyaSSL_set_verify
+#define SSL_pending CyaSSL_pending
+#define SSL_load_error_strings CyaSSL_load_error_strings
+#define SSL_library_init CyaSSL_library_init
+#define SSL_CTX_set_session_cache_mode CyaSSL_CTX_set_session_cache_mode 
+#define SSL_CTX_set_cipher_list CyaSSL_CTX_set_cipher_list
+#define SSL_set_cipher_list     CyaSSL_set_cipher_list
+
+#define ERR_error_string CyaSSL_ERR_error_string
+#define ERR_error_string_n CyaSSL_ERR_error_string_n
+
+#define SSL_set_ex_data CyaSSL_set_ex_data
+#define SSL_get_shutdown CyaSSL_get_shutdown
+#define SSL_set_rfd CyaSSL_set_rfd 
+#define SSL_set_wfd CyaSSL_set_wfd 
+#define SSL_set_shutdown CyaSSL_set_shutdown 
+#define SSL_set_session_id_context CyaSSL_set_session_id_context
+#define SSL_set_connect_state CyaSSL_set_connect_state
+#define SSL_set_accept_state CyaSSL_set_accept_state
+#define SSL_session_reused CyaSSL_session_reused
+#define SSL_SESSION_free CyaSSL_SESSION_free
+#define SSL_is_init_finished CyaSSL_is_init_finished
+
+#define SSL_get_version CyaSSL_get_version
+#define SSL_get_current_cipher CyaSSL_get_current_cipher
+#define SSL_get_cipher CyaSSL_get_cipher
+#define SSL_CIPHER_description CyaSSL_CIPHER_description
+#define SSL_CIPHER_get_name CyaSSL_CIPHER_get_name
+#define SSL_get1_session CyaSSL_get1_session
+
+#define SSL_get_keyblock_size CyaSSL_get_keyblock_size
+#define SSL_get_keys          CyaSSL_get_keys
+
+#define X509_free CyaSSL_X509_free
+#define OPENSSL_free CyaSSL_OPENSSL_free
+
+#define OCSP_parse_url CyaSSL_OCSP_parse_url
+#define SSLv23_client_method CyaSSLv23_client_method
+#define SSLv2_client_method CyaSSLv2_client_method
+#define SSLv2_server_method CyaSSLv2_server_method
+
+#define MD4_Init CyaSSL_MD4_Init
+#define MD4_Update  CyaSSL_MD4_Update  
+#define MD4_Final CyaSSL_MD4_Final
+
+#define BIO_new CyaSSL_BIO_new
+#define BIO_free CyaSSL_BIO_free
+#define BIO_free_all CyaSSL_BIO_free_all
+#define BIO_read CyaSSL_BIO_read
+#define BIO_write CyaSSL_BIO_write
+#define BIO_push CyaSSL_BIO_push
+#define BIO_pop CyaSSL_BIO_pop
+#define BIO_flush CyaSSL_BIO_flush
+#define BIO_pending CyaSSL_BIO_pending
+
+#define BIO_get_mem_data CyaSSL_BIO_get_mem_data
+#define BIO_new_mem_buf  CyaSSL_BIO_new_mem_buf
+
+#define BIO_f_buffer CyaSSL_BIO_f_buffer
+#define BIO_set_write_buffer_size CyaSSL_BIO_set_write_buffer_size
+#define BIO_f_ssl CyaSSL_BIO_f_ssl
+#define BIO_new_socket CyaSSL_BIO_new_socket
+#define SSL_set_bio CyaSSL_set_bio
+#define BIO_eof CyaSSL_BIO_eof
+#define BIO_set_ss CyaSSL_BIO_set_ss
+
+#define BIO_s_mem CyaSSL_BIO_s_mem
+#define BIO_f_base64 CyaSSL_BIO_f_base64
+#define BIO_set_flags CyaSSL_BIO_set_flags
+
+#define OpenSSL_add_all_algorithms CyaSSL_add_all_algorithms
+#define SSLeay_add_ssl_algorithms CyaSSL_add_all_algorithms
+#define SSLeay_add_all_algorithms CyaSSL_add_all_algorithms
+
+#define RAND_screen CyaSSL_RAND_screen
+#define RAND_file_name CyaSSL_RAND_file_name
+#define RAND_write_file CyaSSL_RAND_write_file
+#define RAND_load_file CyaSSL_RAND_load_file
+#define RAND_egd CyaSSL_RAND_egd
+#define RAND_seed CyaSSL_RAND_seed
+#define RAND_add  CyaSSL_RAND_add
+
+#define COMP_zlib CyaSSL_COMP_zlib
+#define COMP_rle CyaSSL_COMP_rle
+#define SSL_COMP_add_compression_method CyaSSL_COMP_add_compression_method
+
+#define SSL_get_ex_new_index CyaSSL_get_ex_new_index
+
+#define CRYPTO_set_id_callback CyaSSL_set_id_callback
+#define CRYPTO_set_locking_callback CyaSSL_set_locking_callback
+#define CRYPTO_set_dynlock_create_callback CyaSSL_set_dynlock_create_callback
+#define CRYPTO_set_dynlock_lock_callback CyaSSL_set_dynlock_lock_callback
+#define CRYPTO_set_dynlock_destroy_callback CyaSSL_set_dynlock_destroy_callback
+#define CRYPTO_num_locks CyaSSL_num_locks
+
+#define X509_STORE_CTX_get_current_cert CyaSSL_X509_STORE_CTX_get_current_cert
+#define X509_STORE_CTX_get_error CyaSSL_X509_STORE_CTX_get_error
+#define X509_STORE_CTX_get_error_depth CyaSSL_X509_STORE_CTX_get_error_depth
+
+#define X509_NAME_oneline CyaSSL_X509_NAME_oneline
+#define X509_get_issuer_name CyaSSL_X509_get_issuer_name
+#define X509_get_subject_name CyaSSL_X509_get_subject_name
+#define X509_verify_cert_error_string CyaSSL_X509_verify_cert_error_string
+
+#define X509_LOOKUP_add_dir CyaSSL_X509_LOOKUP_add_dir
+#define X509_LOOKUP_load_file CyaSSL_X509_LOOKUP_load_file
+#define X509_LOOKUP_hash_dir CyaSSL_X509_LOOKUP_hash_dir
+#define X509_LOOKUP_file CyaSSL_X509_LOOKUP_file
+
+#define X509_STORE_add_lookup CyaSSL_X509_STORE_add_lookup
+#define X509_STORE_new CyaSSL_X509_STORE_new
+#define X509_STORE_get_by_subject CyaSSL_X509_STORE_get_by_subject
+#define X509_STORE_CTX_init CyaSSL_X509_STORE_CTX_init
+#define X509_STORE_CTX_cleanup CyaSSL_X509_STORE_CTX_cleanup
+
+#define X509_CRL_get_lastUpdate CyaSSL_X509_CRL_get_lastUpdate
+#define X509_CRL_get_nextUpdate CyaSSL_X509_CRL_get_nextUpdate
+
+#define X509_get_pubkey CyaSSL_X509_get_pubkey
+#define X509_CRL_verify CyaSSL_X509_CRL_verify
+#define X509_STORE_CTX_set_error CyaSSL_X509_STORE_CTX_set_error
+#define X509_OBJECT_free_contents CyaSSL_X509_OBJECT_free_contents
+#define EVP_PKEY_free CyaSSL_EVP_PKEY_free
+#define X509_cmp_current_time CyaSSL_X509_cmp_current_time
+#define sk_X509_REVOKED_num CyaSSL_sk_X509_REVOKED_num
+#define X509_CRL_get_REVOKED CyaSSL_X509_CRL_get_REVOKED
+#define sk_X509_REVOKED_value CyaSSL_sk_X509_REVOKED_value 
+
+#define X509_get_serialNumber CyaSSL_X509_get_serialNumber
+
+#define ASN1_TIME_pr CyaSSL_ASN1_TIME_pr
+
+#define ASN1_INTEGER_cmp CyaSSL_ASN1_INTEGER_cmp
+#define ASN1_INTEGER_get CyaSSL_ASN1_INTEGER_get
+
+#define SSL_load_client_CA_file CyaSSL_load_client_CA_file
+
+#define SSL_CTX_set_client_CA_list CyaSSL_CTX_set_client_CA_list
+#define X509_STORE_CTX_get_ex_data CyaSSL_X509_STORE_CTX_get_ex_data 
+#define SSL_get_ex_data_X509_STORE_CTX_idx CyaSSL_get_ex_data_X509_STORE_CTX_idx
+#define SSL_get_ex_data CyaSSL_get_ex_data
+
+#define SSL_CTX_set_default_passwd_cb_userdata CyaSSL_CTX_set_default_passwd_cb_userdata
+#define SSL_CTX_set_default_passwd_cb CyaSSL_CTX_set_default_passwd_cb
+
+#define SSL_CTX_set_timeout CyaSSL_CTX_set_timeout
+#define SSL_CTX_set_info_callback CyaSSL_CTX_set_info_callback
+
+#define ERR_peek_error CyaSSL_ERR_peek_error
+#define ERR_GET_REASON CyaSSL_ERR_GET_REASON
+
+#define SSL_alert_type_string CyaSSL_alert_type_string
+#define SSL_alert_desc_string CyaSSL_alert_desc_string
+#define SSL_state_string CyaSSL_state_string
+
+#define RSA_free CyaSSL_RSA_free
+#define RSA_generate_key CyaSSL_RSA_generate_key
+#define SSL_CTX_set_tmp_rsa_callback CyaSSL_CTX_set_tmp_rsa_callback
+
+#define PEM_def_callback CyaSSL_PEM_def_callback
+
+#define SSL_CTX_sess_accept CyaSSL_CTX_sess_accept
+#define SSL_CTX_sess_connect CyaSSL_CTX_sess_connect
+#define SSL_CTX_sess_accept_good CyaSSL_CTX_sess_accept_good
+#define SSL_CTX_sess_connect_good CyaSSL_CTX_sess_connect_good
+#define SSL_CTX_sess_accept_renegotiate CyaSSL_CTX_sess_accept_renegotiate
+#define SSL_CTX_sess_connect_renegotiate CyaSSL_CTX_sess_connect_renegotiate
+#define SSL_CTX_sess_hits CyaSSL_CTX_sess_hits
+#define SSL_CTX_sess_cb_hits CyaSSL_CTX_sess_cb_hits
+#define SSL_CTX_sess_cache_full CyaSSL_CTX_sess_cache_full
+#define SSL_CTX_sess_misses CyaSSL_CTX_sess_misses
+#define SSL_CTX_sess_timeouts CyaSSL_CTX_sess_timeouts
+#define SSL_CTX_sess_number CyaSSL_CTX_sess_number
+#define SSL_CTX_sess_get_cache_size CyaSSL_CTX_sess_get_cache_size
+
+
+#define SSL_DEFAULT_CIPHER_LIST CYASSL_DEFAULT_CIPHER_LIST
+#define RSA_F4 CYASSL_RSA_F4
+
+#define SSL_CTX_set_psk_client_callback CyaSSL_CTX_set_psk_client_callback
+#define SSL_set_psk_client_callback CyaSSL_set_psk_client_callback
+
+#define SSL_get_psk_identity_hint CyaSSL_get_psk_identity_hint
+#define SSL_get_psk_identity CyaSSL_get_psk_identity
+
+#define SSL_CTX_use_psk_identity_hint CyaSSL_CTX_use_psk_identity_hint
+#define SSL_use_psk_identity_hint CyaSSL_use_psk_identity_hint
+
+#define SSL_CTX_set_psk_server_callback CyaSSL_CTX_set_psk_server_callback
+#define SSL_set_psk_server_callback CyaSSL_set_psk_server_callback
+
+#define ERR_get_error_line_data CyaSSL_ERR_get_error_line_data
+
+#define ERR_get_error CyaSSL_ERR_get_error
+#define ERR_clear_error CyaSSL_ERR_clear_error
+
+#define RAND_status CyaSSL_RAND_status
+#define RAND_bytes CyaSSL_RAND_bytes
+#define SSLv23_server_method CyaSSLv23_server_method
+#define SSL_CTX_set_options CyaSSL_CTX_set_options 
+#define SSL_CTX_check_private_key CyaSSL_CTX_check_private_key
+
+#define ERR_free_strings CyaSSL_ERR_free_strings
+#define ERR_remove_state CyaSSL_ERR_remove_state
+#define EVP_cleanup CyaSSL_EVP_cleanup
+
+#define CRYPTO_cleanup_all_ex_data CyaSSL_cleanup_all_ex_data
+#define SSL_CTX_set_mode CyaSSL_CTX_set_mode
+#define SSL_CTX_get_mode CyaSSL_CTX_get_mode
+#define SSL_CTX_set_default_read_ahead CyaSSL_CTX_set_default_read_ahead
+
+#define SSL_CTX_sess_set_cache_size CyaSSL_CTX_sess_set_cache_size
+#define SSL_CTX_set_default_verify_paths CyaSSL_CTX_set_default_verify_paths
+
+#define SSL_CTX_set_session_id_context CyaSSL_CTX_set_session_id_context
+#define SSL_get_peer_certificate CyaSSL_get_peer_certificate
+
+#define SSL_want_read CyaSSL_want_read
+#define SSL_want_write CyaSSL_want_write
+
+#define BIO_prf CyaSSL_BIO_prf
+#define ASN1_UTCTIME_pr CyaSSL_ASN1_UTCTIME_pr
+
+#define sk_num CyaSSL_sk_num
+#define sk_value CyaSSL_sk_value
+
+#define SSL_CTX_get_ex_data CyaSSL_CTX_get_ex_data
+#define SSL_CTX_set_ex_data CyaSSL_CTX_set_ex_data
+#define SSL_CTX_sess_set_get_cb CyaSSL_CTX_sess_set_get_cb
+#define SSL_CTX_sess_set_new_cb CyaSSL_CTX_sess_set_new_cb
+#define SSL_CTX_sess_set_remove_cb CyaSSL_CTX_sess_set_remove_cb
+
+#define i2d_SSL_SESSION CyaSSL_i2d_SSL_SESSION
+#define d2i_SSL_SESSION CyaSSL_d2i_SSL_SESSION
+#define SSL_SESSION_get_timeout CyaSSL_SESSION_get_timeout
+#define SSL_SESSION_get_time CyaSSL_SESSION_get_time
+#define SSL_CTX_get_ex_new_index CyaSSL_CTX_get_ex_new_index
+
+
+
+#ifdef __cplusplus
+    } /* extern "C" */
+#endif
+
+
+#endif /* CyaSSL_openssl_h__ */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/stack.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/stack.h
new file mode 100644 (file)
index 0000000..374c1fc
--- /dev/null
@@ -0,0 +1,2 @@
+/* stack.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ui.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/ui.h
new file mode 100644 (file)
index 0000000..a253930
--- /dev/null
@@ -0,0 +1,2 @@
+/* ui.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509.h
new file mode 100644 (file)
index 0000000..645b3b5
--- /dev/null
@@ -0,0 +1,3 @@
+/* x509.h for openssl */
+
+#include <cyassl/openssl/ssl.h>
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509v3.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/openssl/x509v3.h
new file mode 100644 (file)
index 0000000..77828a3
--- /dev/null
@@ -0,0 +1,2 @@
+/* x509v3.h for openssl */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer.h
new file mode 100644 (file)
index 0000000..0d14fbc
--- /dev/null
@@ -0,0 +1,74 @@
+/* sniffer.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_SNIFFER_H
+#define CYASSL_SNIFFER_H
+
+#include <cyassl/ctaocrypt/settings.h>
+
+#ifdef _WIN32
+    #ifdef SSL_SNIFFER_EXPORTS
+        #define SSL_SNIFFER_API __declspec(dllexport)
+    #else
+        #define SSL_SNIFFER_API __declspec(dllimport)
+    #endif
+#else
+    #define SSL_SNIFFER_API
+#endif /* _WIN32 */
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+CYASSL_API 
+SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
+                                      const char* keyFile, int keyType,
+                                      const char* password, char* error);
+
+CYASSL_API 
+SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length,
+                                     unsigned char* data, char* error);
+
+CYASSL_API 
+SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error);
+        
+        
+CYASSL_API void ssl_InitSniffer(void);
+        
+CYASSL_API void ssl_FreeSniffer(void);
+
+        
+/* ssl_SetPrivateKey keyTypes */
+enum {
+    FILETYPE_PEM = 1,
+    FILETYPE_DER = 2,
+};
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+#endif /* CyaSSL_SNIFFER_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.h
new file mode 100644 (file)
index 0000000..4882c7d
--- /dev/null
@@ -0,0 +1,107 @@
+/* sniffer_error.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifndef CYASSL_SNIFFER_ERROR_H
+#define CYASSL_SNIFFER_ERROR_H
+
+/* need to have errors as #defines since .rc files can't handle enums */
+/* need to start at 1 and go in order for same reason */
+
+#define MEMORY_STR 1
+#define NEW_SERVER_STR 2
+#define IP_CHECK_STR 3
+#define SERVER_NOT_REG_STR 4
+#define TCP_CHECK_STR 5
+#define SERVER_PORT_NOT_REG_STR 6
+#define RSA_DECRYPT_STR 7
+#define RSA_DECODE_STR 8
+#define BAD_CIPHER_SPEC_STR 9
+#define SERVER_HELLO_INPUT_STR 10
+
+#define BAD_SESSION_RESUME_STR 11
+#define SERVER_DID_RESUMPTION_STR 12
+#define CLIENT_HELLO_INPUT_STR 13
+#define CLIENT_RESUME_TRY_STR 14
+#define HANDSHAKE_INPUT_STR 15
+#define GOT_HELLO_VERIFY_STR 16
+#define GOT_SERVER_HELLO_STR 17
+#define GOT_CERT_REQ_STR 18
+#define GOT_SERVER_KEY_EX_STR 19
+#define GOT_CERT_STR 20
+
+#define GOT_SERVER_HELLO_DONE_STR 21
+#define GOT_FINISHED_STR 22
+#define GOT_CLIENT_HELLO_STR 23
+#define GOT_CLIENT_KEY_EX_STR 24
+#define GOT_CERT_VER_STR 25
+#define GOT_UNKNOWN_HANDSHAKE_STR 26
+#define NEW_SESSION_STR 27
+#define BAD_NEW_SSL_STR 28
+#define GOT_PACKET_STR 29
+#define NO_DATA_STR 30
+
+#define BAD_SESSION_STR 31
+#define GOT_OLD_CLIENT_HELLO_STR 32
+#define OLD_CLIENT_INPUT_STR 33
+#define OLD_CLIENT_OK_STR 34
+#define BAD_OLD_CLIENT_STR 35
+#define BAD_RECORD_HDR_STR 36
+#define RECORD_INPUT_STR 37
+#define GOT_HANDSHAKE_STR 38
+#define BAD_HANDSHAKE_STR 39
+#define GOT_CHANGE_CIPHER_STR 40
+
+#define GOT_APP_DATA_STR 41
+#define BAD_APP_DATA_STR 42
+#define GOT_ALERT_STR 43
+#define ANOTHER_MSG_STR 44
+#define REMOVE_SESSION_STR 45
+#define KEY_FILE_STR 46
+#define BAD_IPVER_STR 47
+#define BAD_PROTO_STR 48
+#define PACKET_HDR_SHORT_STR 49
+#define GOT_UNKNOWN_RECORD_STR 50
+
+#define BAD_TRACE_FILE_STR 51
+#define FATAL_ERROR_STR 52
+#define PARTIAL_INPUT_STR 53
+#define BUFFER_ERROR_STR 54
+#define PARTIAL_ADD_STR 55
+#define DUPLICATE_STR 56
+#define OUT_OF_ORDER_STR 57
+#define OVERLAP_DUPLICATE_STR 58
+#define OVERLAP_REASSEMBLY_BEGIN_STR 59
+#define OVERLAP_REASSEMBLY_END_STR 60
+
+#define MISSED_CLIENT_HELLO_STR 61
+#define GOT_HELLO_REQUEST_STR 62
+#define GOT_SESSION_TICKET_STR 63
+#define BAD_INPUT_STR 64
+#define BAD_DECRYPT_TYPE 65
+#define BAD_FINISHED_MSG 66
+#define BAD_COMPRESSION_STR 67
+
+/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
+
+
+#endif /* CyaSSL_SNIFFER_ERROR_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.rc b/FreeRTOS-Plus/Source/CyaSSL/cyassl/sniffer_error.rc
new file mode 100644 (file)
index 0000000..f4af8ee
--- /dev/null
@@ -0,0 +1,85 @@
+
+STRINGTABLE 
+{
+    1, "Out of Memory"
+    2, "New SSL Sniffer Server Registered"
+    3, "Checking IP Header"
+    4, "SSL Sniffer Server Not Registered"
+    5, "Checking TCP Header"
+
+    6, "SSL Sniffer Server Port Not Registered"
+    7, "RSA Private Decrypt Error"
+    8, "RSA Private Decode Error"
+    9, "Set Cipher Spec Error"
+    10, "Server Hello Input Malformed"
+
+    11, "Couldn't Resume Session Error"
+    12, "Server Did Resumption"
+    13, "Client Hello Input Malformed"
+    14, "Client Trying to Resume"
+    15, "Handshake Input Malformed"
+
+    16, "Got Hello Verify msg"
+    17, "Got Server Hello msg"
+    18, "Got Cert Request msg"
+    19, "Got Server Key Exchange msg"
+    20, "Got Cert msg"
+
+    21, "Got Server Hello Done msg"
+    22, "Got Finished msg"
+    23, "Got Client Hello msg"
+    24, "Got Client Key Exchange msg"
+    25, "Got Cert Verify msg"
+
+    26, "Got Unknown Handshake msg"
+    27, "New SSL Sniffer Session created"
+    28, "Couldn't create new SSL"
+    29, "Got a Packet to decode"
+    30, "No data present"
+
+    31, "Session Not Found"
+    32, "Got an Old Client Hello msg"
+    33, "Old Client Hello Input Malformed"
+    34, "Old Client Hello OK"
+    35, "Bad Old Client Hello"
+
+    36, "Bad Record Header"
+    37, "Record Header Input Malformed"
+    38, "Got a HandShake msg"
+    39, "Bad HandShake msg"
+    40, "Got a Change Cipher Spec msg"
+
+    41, "Got Application Data msg"
+    42, "Bad Application Data"
+    43, "Got an Alert msg"
+    44, "Another msg to Process"
+    45, "Removing Session From Table"
+
+    46, "Bad Key File"
+    47, "Wrong IP Version"
+    48, "Wrong Protocol type"
+    49, "Packet Short for header processing"
+    50, "Got Unknown Record Type"
+    
+    51, "Can't Open Trace File"
+    52, "Session in Fatal Error State"
+    53, "Partial SSL record received"
+    54, "Buffer Error, malformed input"
+    55, "Added to Partial Input"
+
+    56, "Received a Duplicate Packet"
+    57, "Received an Out of Order Packet"
+    58, "Received an Overlap Duplicate Packet"
+    59, "Received an Overlap Reassembly Begin Duplicate Packet"
+    60, "Received an Overlap Reassembly End Duplicate Packet"
+    
+    61, "Missed the Client Hello Entirely"
+    62, "Got Hello Request msg"
+    63, "Got Session Ticket msg"
+    64, "Bad Input"
+    65, "Bad Decrypt Type"
+
+    66, "Bad Finished Message Processing"
+    67, "Bad Compression Type"
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/ssl.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/ssl.h
new file mode 100644 (file)
index 0000000..b861813
--- /dev/null
@@ -0,0 +1,855 @@
+/* ssl.h
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+/* CyaSSL API */
+
+#ifndef CYASSL_SSL_H
+#define CYASSL_SSL_H
+
+
+/* for users not using preprocessor flags*/
+#include <cyassl/ctaocrypt/settings.h>
+#include <cyassl/version.h>
+
+
+#ifndef NO_FILESYSTEM
+    #include <stdio.h>   /* ERR_printf */
+#endif
+
+#ifdef YASSL_PREFIX
+    #include "prefix_ssl.h"
+#endif
+
+#ifdef LIBCYASSL_VERSION_STRING
+    #define CYASSL_VERSION LIBCYASSL_VERSION_STRING
+#endif
+
+#ifdef _WIN32
+    /* wincrypt.h clashes */
+    #undef OCSP_REQUEST
+    #undef OCSP_RESPONSE
+#endif
+
+
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+
+typedef struct CYASSL          CYASSL;          
+typedef struct CYASSL_SESSION  CYASSL_SESSION;
+typedef struct CYASSL_METHOD   CYASSL_METHOD;
+typedef struct CYASSL_CTX      CYASSL_CTX;
+
+typedef struct CYASSL_X509       CYASSL_X509;
+typedef struct CYASSL_X509_NAME  CYASSL_X509_NAME;
+typedef struct CYASSL_X509_CHAIN CYASSL_X509_CHAIN;
+
+typedef struct CYASSL_CERT_MANAGER CYASSL_CERT_MANAGER;
+
+/* redeclare guard */
+#define CYASSL_TYPES_DEFINED
+
+
+typedef struct CYASSL_RSA            CYASSL_RSA;
+typedef struct CYASSL_DSA            CYASSL_DSA;
+typedef struct CYASSL_CIPHER         CYASSL_CIPHER;
+typedef struct CYASSL_X509_LOOKUP    CYASSL_X509_LOOKUP;
+typedef struct CYASSL_X509_LOOKUP_METHOD CYASSL_X509_LOOKUP_METHOD;
+typedef struct CYASSL_X509_CRL       CYASSL_X509_CRL;
+typedef struct CYASSL_BIO            CYASSL_BIO;
+typedef struct CYASSL_BIO_METHOD     CYASSL_BIO_METHOD;
+typedef struct CYASSL_X509_EXTENSION CYASSL_X509_EXTENSION;
+typedef struct CYASSL_ASN1_TIME      CYASSL_ASN1_TIME;
+typedef struct CYASSL_ASN1_INTEGER   CYASSL_ASN1_INTEGER;
+typedef struct CYASSL_ASN1_OBJECT    CYASSL_ASN1_OBJECT;
+typedef struct CYASSL_ASN1_STRING    CYASSL_ASN1_STRING;
+typedef struct CYASSL_dynlock_value  CYASSL_dynlock_value;
+
+#define CYASSL_ASN1_UTCTIME CYASSL_ASN1_TIME
+
+typedef struct CYASSL_EVP_PKEY {
+    int type;         /* openssh dereference */
+    int save_type;    /* openssh dereference */
+} CYASSL_EVP_PKEY;
+
+typedef struct CYASSL_MD4_CTX {
+    int buffer[32];      /* big enough to hold, check size in Init */
+} CYASSL_MD4_CTX;
+
+
+typedef struct CYASSL_COMP_METHOD {
+    int type;            /* stunnel dereference */
+} CYASSL_COMP_METHOD;
+
+
+typedef struct CYASSL_X509_STORE {
+    int cache;          /* stunnel dereference */
+} CYASSL_X509_STORE;
+
+
+typedef struct CYASSL_X509_REVOKED {
+    CYASSL_ASN1_INTEGER* serialNumber;          /* stunnel dereference */
+} CYASSL_X509_REVOKED;
+
+
+typedef struct CYASSL_X509_OBJECT {
+    union {
+        char* ptr;
+        CYASSL_X509_CRL* crl;           /* stunnel dereference */
+    } data;
+} CYASSL_X509_OBJECT;
+
+
+/* in internal.h too, change there !! */
+typedef struct CYASSL_X509_STORE_CTX {
+    int   error;
+    int   error_depth;
+    CYASSL_X509* current_cert;   /* stunnel dereference */
+    char* domain;                /* subject CN domain name */
+    void* ex_data;               /* external data, for fortress build */
+    /* in internal.h too, change there !! */
+} CYASSL_X509_STORE_CTX;
+
+
+CYASSL_API CYASSL_METHOD *CyaSSLv3_server_method(void);
+CYASSL_API CYASSL_METHOD *CyaSSLv3_client_method(void);
+CYASSL_API CYASSL_METHOD *CyaTLSv1_server_method(void);  
+CYASSL_API CYASSL_METHOD *CyaTLSv1_client_method(void);
+CYASSL_API CYASSL_METHOD *CyaTLSv1_1_server_method(void);  
+CYASSL_API CYASSL_METHOD *CyaTLSv1_1_client_method(void);
+CYASSL_API CYASSL_METHOD *CyaTLSv1_2_server_method(void);  
+CYASSL_API CYASSL_METHOD *CyaTLSv1_2_client_method(void);
+
+#ifdef CYASSL_DTLS
+    CYASSL_API CYASSL_METHOD *CyaDTLSv1_client_method(void);
+    CYASSL_API CYASSL_METHOD *CyaDTLSv1_server_method(void);
+#endif
+
+#ifndef NO_FILESYSTEM
+
+CYASSL_API int CyaSSL_CTX_use_certificate_file(CYASSL_CTX*, const char*, int);
+CYASSL_API int CyaSSL_CTX_use_PrivateKey_file(CYASSL_CTX*, const char*, int);
+CYASSL_API int CyaSSL_CTX_load_verify_locations(CYASSL_CTX*, const char*,
+                                                const char*);
+CYASSL_API int CyaSSL_CTX_use_certificate_chain_file(CYASSL_CTX *,
+                                                     const char *file);
+CYASSL_API int CyaSSL_CTX_use_RSAPrivateKey_file(CYASSL_CTX*, const char*, int);
+
+CYASSL_API int CyaSSL_use_certificate_file(CYASSL*, const char*, int);
+CYASSL_API int CyaSSL_use_PrivateKey_file(CYASSL*, const char*, int);
+CYASSL_API int CyaSSL_use_certificate_chain_file(CYASSL*, const char *file);
+CYASSL_API int CyaSSL_use_RSAPrivateKey_file(CYASSL*, const char*, int);
+
+#ifdef CYASSL_DER_LOAD
+    CYASSL_API int CyaSSL_CTX_der_load_verify_locations(CYASSL_CTX*,
+                                                    const char*, int);
+#endif
+
+#ifdef HAVE_NTRU
+    CYASSL_API int CyaSSL_CTX_use_NTRUPrivateKey_file(CYASSL_CTX*, const char*);
+    /* load NTRU private key blob */
+#endif
+
+CYASSL_API int CyaSSL_PemCertToDer(const char*, unsigned char*, int);
+
+#endif /* NO_FILESYSTEM */
+
+CYASSL_API CYASSL_CTX* CyaSSL_CTX_new(CYASSL_METHOD*);
+CYASSL_API CYASSL* CyaSSL_new(CYASSL_CTX*);
+CYASSL_API int  CyaSSL_set_fd (CYASSL*, int);
+CYASSL_API int  CyaSSL_get_fd(const CYASSL*);
+CYASSL_API int  CyaSSL_connect(CYASSL*);     /* please see note at top of README
+                                             if you get an error from connect */
+CYASSL_API int  CyaSSL_write(CYASSL*, const void*, int);
+CYASSL_API int  CyaSSL_read(CYASSL*, void*, int);
+CYASSL_API int  CyaSSL_accept(CYASSL*);
+CYASSL_API void CyaSSL_CTX_free(CYASSL_CTX*);
+CYASSL_API void CyaSSL_free(CYASSL*);
+CYASSL_API int  CyaSSL_shutdown(CYASSL*);
+
+CYASSL_API void CyaSSL_CTX_set_quiet_shutdown(CYASSL_CTX*, int);
+CYASSL_API void CyaSSL_set_quiet_shutdown(CYASSL*, int);
+
+CYASSL_API int  CyaSSL_get_error(CYASSL*, int);
+
+CYASSL_API int          CyaSSL_set_session(CYASSL* ssl,CYASSL_SESSION* session);
+CYASSL_API CYASSL_SESSION* CyaSSL_get_session(CYASSL* ssl);
+CYASSL_API void         CyaSSL_flush_sessions(CYASSL_CTX *ctx, long tm);
+
+
+typedef int (*VerifyCallback)(int, CYASSL_X509_STORE_CTX*);
+typedef int (*pem_password_cb)(char*, int, int, void*);
+
+CYASSL_API void CyaSSL_CTX_set_verify(CYASSL_CTX*, int, 
+                                      VerifyCallback verify_callback);
+CYASSL_API void CyaSSL_set_verify(CYASSL*, int, VerifyCallback verify_callback);
+
+CYASSL_API int  CyaSSL_pending(CYASSL*);
+
+CYASSL_API void CyaSSL_load_error_strings(void);
+CYASSL_API int  CyaSSL_library_init(void);
+CYASSL_API long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX*, long);
+
+/* only supports full name from cipher_name[] delimited by : */
+CYASSL_API int  CyaSSL_CTX_set_cipher_list(CYASSL_CTX*, const char*);
+CYASSL_API int  CyaSSL_set_cipher_list(CYASSL*, const char*);
+
+CYASSL_API int   CyaSSL_ERR_GET_REASON(int err);
+CYASSL_API char* CyaSSL_ERR_error_string(unsigned long,char*);
+CYASSL_API void  CyaSSL_ERR_error_string_n(unsigned long e, char* buf,
+                                           unsigned long sz);
+
+/* extras */
+
+#define STACK_OF(x) x
+
+CYASSL_API int  CyaSSL_set_ex_data(CYASSL*, int, void*);
+CYASSL_API int  CyaSSL_get_shutdown(const CYASSL*);
+CYASSL_API int  CyaSSL_set_rfd(CYASSL*, int);
+CYASSL_API int  CyaSSL_set_wfd(CYASSL*, int);
+CYASSL_API void CyaSSL_set_shutdown(CYASSL*, int);
+CYASSL_API int  CyaSSL_set_session_id_context(CYASSL*, const unsigned char*,
+                                           unsigned int);
+CYASSL_API void CyaSSL_set_connect_state(CYASSL*);
+CYASSL_API void CyaSSL_set_accept_state(CYASSL*);
+CYASSL_API int  CyaSSL_session_reused(CYASSL*);
+CYASSL_API void CyaSSL_SESSION_free(CYASSL_SESSION* session);
+CYASSL_API int  CyaSSL_is_init_finished(CYASSL*);
+
+CYASSL_API const char*  CyaSSL_get_version(CYASSL*);
+CYASSL_API CYASSL_CIPHER*  CyaSSL_get_current_cipher(CYASSL*);
+CYASSL_API char*        CyaSSL_CIPHER_description(CYASSL_CIPHER*, char*, int);
+CYASSL_API const char*  CyaSSL_CIPHER_get_name(const CYASSL_CIPHER* cipher);
+CYASSL_API const char*  CyaSSL_get_cipher(CYASSL*);
+CYASSL_API CYASSL_SESSION* CyaSSL_get1_session(CYASSL* ssl);
+                           /* what's ref count */
+
+CYASSL_API void CyaSSL_X509_free(CYASSL_X509*);
+CYASSL_API void CyaSSL_OPENSSL_free(void*);
+
+CYASSL_API int CyaSSL_OCSP_parse_url(char* url, char** host, char** port,
+                                     char** path, int* ssl);
+
+CYASSL_API CYASSL_METHOD* CyaSSLv23_client_method(void);
+CYASSL_API CYASSL_METHOD* CyaSSLv2_client_method(void);
+CYASSL_API CYASSL_METHOD* CyaSSLv2_server_method(void);
+
+CYASSL_API void CyaSSL_MD4_Init(CYASSL_MD4_CTX*);
+CYASSL_API void CyaSSL_MD4_Update(CYASSL_MD4_CTX*, const void*, unsigned long);
+CYASSL_API void CyaSSL_MD4_Final(unsigned char*, CYASSL_MD4_CTX*);
+
+
+CYASSL_API CYASSL_BIO* CyaSSL_BIO_new(CYASSL_BIO_METHOD*);
+CYASSL_API int  CyaSSL_BIO_free(CYASSL_BIO*);
+CYASSL_API int  CyaSSL_BIO_free_all(CYASSL_BIO*);
+CYASSL_API int  CyaSSL_BIO_read(CYASSL_BIO*, void*, int);
+CYASSL_API int  CyaSSL_BIO_write(CYASSL_BIO*, const void*, int);
+CYASSL_API CYASSL_BIO* CyaSSL_BIO_push(CYASSL_BIO*, CYASSL_BIO* append);
+CYASSL_API CYASSL_BIO* CyaSSL_BIO_pop(CYASSL_BIO*);
+CYASSL_API int  CyaSSL_BIO_flush(CYASSL_BIO*);
+CYASSL_API int  CyaSSL_BIO_pending(CYASSL_BIO*);
+
+CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_buffer(void);
+CYASSL_API long CyaSSL_BIO_set_write_buffer_size(CYASSL_BIO*, long size);
+CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_ssl(void);
+CYASSL_API CYASSL_BIO*        CyaSSL_BIO_new_socket(int sfd, int flag);
+CYASSL_API int         CyaSSL_BIO_eof(CYASSL_BIO*);
+
+CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_s_mem(void);
+CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_base64(void);
+CYASSL_API void CyaSSL_BIO_set_flags(CYASSL_BIO*, int);
+
+CYASSL_API int CyaSSL_BIO_get_mem_data(CYASSL_BIO* bio,const unsigned char** p);
+CYASSL_API CYASSL_BIO* CyaSSL_BIO_new_mem_buf(void* buf, int len);
+
+
+CYASSL_API long        CyaSSL_BIO_set_ssl(CYASSL_BIO*, CYASSL*, int flag);
+CYASSL_API void        CyaSSL_set_bio(CYASSL*, CYASSL_BIO* rd, CYASSL_BIO* wr);
+
+CYASSL_API int  CyaSSL_add_all_algorithms(void);
+
+CYASSL_API void        CyaSSL_RAND_screen(void);
+CYASSL_API const char* CyaSSL_RAND_file_name(char*, unsigned long);
+CYASSL_API int         CyaSSL_RAND_write_file(const char*);
+CYASSL_API int         CyaSSL_RAND_load_file(const char*, long);
+CYASSL_API int         CyaSSL_RAND_egd(const char*);
+CYASSL_API int         CyaSSL_RAND_seed(const void*, int);
+CYASSL_API void        CyaSSL_RAND_add(const void*, int, double);
+
+CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_zlib(void);
+CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_rle(void);
+CYASSL_API int CyaSSL_COMP_add_compression_method(int, void*);
+
+CYASSL_API int CyaSSL_get_ex_new_index(long, void*, void*, void*, void*);
+
+CYASSL_API void CyaSSL_set_id_callback(unsigned long (*f)(void));
+CYASSL_API void CyaSSL_set_locking_callback(void (*f)(int, int, const char*,
+                                                      int));
+CYASSL_API void CyaSSL_set_dynlock_create_callback(CYASSL_dynlock_value* (*f)
+                                                   (const char*, int));
+CYASSL_API void CyaSSL_set_dynlock_lock_callback(void (*f)(int,
+                                      CYASSL_dynlock_value*, const char*, int));
+CYASSL_API void CyaSSL_set_dynlock_destroy_callback(void (*f)
+                                     (CYASSL_dynlock_value*, const char*, int));
+CYASSL_API int  CyaSSL_num_locks(void);
+
+CYASSL_API CYASSL_X509* CyaSSL_X509_STORE_CTX_get_current_cert(
+                                                        CYASSL_X509_STORE_CTX*);
+CYASSL_API int   CyaSSL_X509_STORE_CTX_get_error(CYASSL_X509_STORE_CTX*);
+CYASSL_API int   CyaSSL_X509_STORE_CTX_get_error_depth(CYASSL_X509_STORE_CTX*);
+
+CYASSL_API char*       CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME*, char*, int);
+CYASSL_API CYASSL_X509_NAME*  CyaSSL_X509_get_issuer_name(CYASSL_X509*);
+CYASSL_API CYASSL_X509_NAME*  CyaSSL_X509_get_subject_name(CYASSL_X509*);
+CYASSL_API const char* CyaSSL_X509_verify_cert_error_string(long);
+
+CYASSL_API int CyaSSL_X509_LOOKUP_add_dir(CYASSL_X509_LOOKUP*,const char*,long);
+CYASSL_API int CyaSSL_X509_LOOKUP_load_file(CYASSL_X509_LOOKUP*, const char*,
+                                            long);
+CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_hash_dir(void);
+CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_file(void);
+
+CYASSL_API CYASSL_X509_LOOKUP* CyaSSL_X509_STORE_add_lookup(CYASSL_X509_STORE*,
+                                                    CYASSL_X509_LOOKUP_METHOD*);
+CYASSL_API CYASSL_X509_STORE*  CyaSSL_X509_STORE_new(void);
+CYASSL_API int          CyaSSL_X509_STORE_get_by_subject(CYASSL_X509_STORE_CTX*,
+                                   int, CYASSL_X509_NAME*, CYASSL_X509_OBJECT*);
+CYASSL_API int  CyaSSL_X509_STORE_CTX_init(CYASSL_X509_STORE_CTX*,
+                      CYASSL_X509_STORE*, CYASSL_X509*, STACK_OF(CYASSL_X509)*);
+CYASSL_API void CyaSSL_X509_STORE_CTX_cleanup(CYASSL_X509_STORE_CTX*);
+
+CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_lastUpdate(CYASSL_X509_CRL*);
+CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_nextUpdate(CYASSL_X509_CRL*);
+
+CYASSL_API CYASSL_EVP_PKEY* CyaSSL_X509_get_pubkey(CYASSL_X509*);
+CYASSL_API int       CyaSSL_X509_CRL_verify(CYASSL_X509_CRL*, CYASSL_EVP_PKEY*);
+CYASSL_API void      CyaSSL_X509_STORE_CTX_set_error(CYASSL_X509_STORE_CTX*,
+                                                     int);
+CYASSL_API void      CyaSSL_X509_OBJECT_free_contents(CYASSL_X509_OBJECT*);
+CYASSL_API void      CyaSSL_EVP_PKEY_free(CYASSL_EVP_PKEY*);
+CYASSL_API int       CyaSSL_X509_cmp_current_time(const CYASSL_ASN1_TIME*);
+CYASSL_API int       CyaSSL_sk_X509_REVOKED_num(CYASSL_X509_REVOKED*);
+
+CYASSL_API CYASSL_X509_REVOKED* CyaSSL_X509_CRL_get_REVOKED(CYASSL_X509_CRL*);
+CYASSL_API CYASSL_X509_REVOKED* CyaSSL_sk_X509_REVOKED_value(
+                                                      CYASSL_X509_REVOKED*,int);
+CYASSL_API CYASSL_ASN1_INTEGER* CyaSSL_X509_get_serialNumber(CYASSL_X509*);
+
+CYASSL_API int CyaSSL_ASN1_TIME_print(CYASSL_BIO*, const CYASSL_ASN1_TIME*);
+
+CYASSL_API int  CyaSSL_ASN1_INTEGER_cmp(const CYASSL_ASN1_INTEGER*,
+                                       const CYASSL_ASN1_INTEGER*);
+CYASSL_API long CyaSSL_ASN1_INTEGER_get(const CYASSL_ASN1_INTEGER*);
+
+CYASSL_API STACK_OF(CYASSL_X509_NAME)* CyaSSL_load_client_CA_file(const char*);
+
+CYASSL_API void  CyaSSL_CTX_set_client_CA_list(CYASSL_CTX*,
+                                               STACK_OF(CYASSL_X509_NAME)*);
+CYASSL_API void* CyaSSL_X509_STORE_CTX_get_ex_data(CYASSL_X509_STORE_CTX*, int);
+CYASSL_API int   CyaSSL_get_ex_data_X509_STORE_CTX_idx(void);
+CYASSL_API void* CyaSSL_get_ex_data(const CYASSL*, int);
+
+CYASSL_API void CyaSSL_CTX_set_default_passwd_cb_userdata(CYASSL_CTX*,
+                                                          void* userdata);
+CYASSL_API void CyaSSL_CTX_set_default_passwd_cb(CYASSL_CTX*, pem_password_cb);
+
+
+CYASSL_API void CyaSSL_CTX_set_info_callback(CYASSL_CTX*, void (*)(void));
+
+CYASSL_API unsigned long CyaSSL_ERR_peek_error(void);
+CYASSL_API int           CyaSSL_GET_REASON(int);
+
+CYASSL_API char* CyaSSL_alert_type_string_long(int);
+CYASSL_API char* CyaSSL_alert_desc_string_long(int);
+CYASSL_API char* CyaSSL_state_string_long(CYASSL*);
+
+CYASSL_API CYASSL_RSA* CyaSSL_RSA_generate_key(int, unsigned long,
+                                               void(*)(int, int, void*), void*);
+CYASSL_API void CyaSSL_CTX_set_tmp_rsa_callback(CYASSL_CTX*,
+                                             CYASSL_RSA*(*)(CYASSL*, int, int));
+
+CYASSL_API int CyaSSL_PEM_def_callback(char*, int num, int w, void* key);
+
+CYASSL_API long CyaSSL_CTX_sess_accept(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_connect(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_accept_good(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_connect_good(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_accept_renegotiate(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_connect_renegotiate(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_hits(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_cb_hits(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_cache_full(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_misses(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_timeouts(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_number(CYASSL_CTX*);
+CYASSL_API long CyaSSL_CTX_sess_get_cache_size(CYASSL_CTX*);
+
+
+#define CYASSL_DEFAULT_CIPHER_LIST ""   /* default all */
+#define CYASSL_RSA_F4 0x10001L
+
+enum {
+    OCSP_NOCERTS     = 1,
+    OCSP_NOINTERN    = 2,
+    OCSP_NOSIGS      = 4,
+    OCSP_NOCHAIN     = 8,
+    OCSP_NOVERIFY    = 16,
+    OCSP_NOEXPLICIT  = 32,
+    OCSP_NOCASIGN    = 64,
+    OCSP_NODELEGATED = 128,
+    OCSP_NOCHECKS    = 256,
+    OCSP_TRUSTOTHER  = 512,
+    OCSP_RESPID_KEY  = 1024,
+    OCSP_NOTIME      = 2048,
+
+    OCSP_CERTID   = 2,
+    OCSP_REQUEST  = 4,
+    OCSP_RESPONSE = 8,
+    OCSP_BASICRESP = 16,
+
+    CYASSL_CRL_CHECKALL = 1,
+
+    ASN1_GENERALIZEDTIME = 4,
+
+    SSL_OP_MICROSOFT_SESS_ID_BUG = 1,
+    SSL_OP_NETSCAPE_CHALLENGE_BUG = 2,
+    SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 3,
+    SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 4,
+    SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 5,
+    SSL_OP_MSIE_SSLV2_RSA_PADDING = 6,
+    SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 7,
+    SSL_OP_TLS_D5_BUG = 8,
+    SSL_OP_TLS_BLOCK_PADDING_BUG = 9,
+    SSL_OP_TLS_ROLLBACK_BUG = 10,
+    SSL_OP_ALL = 11,
+    SSL_OP_EPHEMERAL_RSA = 12,
+    SSL_OP_NO_SSLv3 = 13,
+    SSL_OP_NO_TLSv1 = 14,
+    SSL_OP_PKCS1_CHECK_1 = 15,
+    SSL_OP_PKCS1_CHECK_2 = 16,
+    SSL_OP_NETSCAPE_CA_DN_BUG = 17,
+    SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 18,
+    SSL_OP_SINGLE_DH_USE = 19,
+    SSL_OP_NO_TICKET = 20,
+    SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 21,
+    SSL_OP_NO_QUERY_MTU = 22,
+    SSL_OP_COOKIE_EXCHANGE = 23,
+    SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 24,
+    SSL_OP_SINGLE_ECDH_USE = 25,
+    SSL_OP_CIPHER_SERVER_PREFERENCE = 26,
+
+    SSL_MAX_SSL_SESSION_ID_LENGTH = 32,
+
+    EVP_R_BAD_DECRYPT = 2,
+
+    SSL_CB_LOOP = 4,
+    SSL_ST_CONNECT = 5,
+    SSL_ST_ACCEPT  = 6,
+    SSL_CB_ALERT   = 7,
+    SSL_CB_READ    = 8,
+    SSL_CB_HANDSHAKE_DONE = 9,
+
+    SSL_MODE_ENABLE_PARTIAL_WRITE = 2,
+
+    BIO_FLAGS_BASE64_NO_NL = 1,
+    BIO_CLOSE   = 1,
+    BIO_NOCLOSE = 0,
+
+    NID_undef = 0,
+
+    X509_FILETYPE_PEM = 8,
+    X509_LU_X509      = 9,
+    X509_LU_CRL       = 12,
+    
+    X509_V_ERR_CRL_SIGNATURE_FAILURE = 13,
+    X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 14,
+    X509_V_ERR_CRL_HAS_EXPIRED                = 15,
+    X509_V_ERR_CERT_REVOKED                   = 16,
+    X509_V_ERR_CERT_CHAIN_TOO_LONG            = 17,
+    X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT      = 18,
+    X509_V_ERR_CERT_NOT_YET_VALID             = 19,
+    X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 20,
+    X509_V_ERR_CERT_HAS_EXPIRED               = 21,
+    X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD  = 22,
+
+    X509_V_OK = 0,
+
+    CRYPTO_LOCK = 1,
+    CRYPTO_NUM_LOCKS = 10
+};
+
+/* extras end */
+
+#ifndef NO_FILESYSTEM
+/* CyaSSL extension, provide last error from SSL_get_error
+   since not using thread storage error queue */
+CYASSL_API void  CyaSSL_ERR_print_errors_fp(FILE*, int err);
+#endif
+
+enum { /* ssl Constants */
+    SSL_ERROR_NONE      =  0,   /* for most functions */
+    SSL_FAILURE         =  0,   /* for some functions */
+    SSL_SUCCESS         =  1,
+
+    SSL_BAD_CERTTYPE    = -8,
+    SSL_BAD_STAT        = -7,
+    SSL_BAD_PATH        = -6,
+    SSL_BAD_FILETYPE    = -5,
+    SSL_BAD_FILE        = -4,
+    SSL_NOT_IMPLEMENTED = -3,
+    SSL_UNKNOWN         = -2,
+    SSL_FATAL_ERROR     = -1,
+
+    SSL_FILETYPE_ASN1    = 2,
+    SSL_FILETYPE_PEM     = 1,
+    SSL_FILETYPE_DEFAULT = 2, /* ASN1 */
+    SSL_FILETYPE_RAW     = 3, /* NTRU raw key blob */
+
+    SSL_VERIFY_NONE                 = 0,
+    SSL_VERIFY_PEER                 = 1,
+    SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2,
+    SSL_VERIFY_CLIENT_ONCE          = 4,
+
+    SSL_SESS_CACHE_OFF                = 30,
+    SSL_SESS_CACHE_CLIENT             = 31,
+    SSL_SESS_CACHE_SERVER             = 32,
+    SSL_SESS_CACHE_BOTH               = 33,
+    SSL_SESS_CACHE_NO_AUTO_CLEAR      = 34,
+    SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 35,
+
+    SSL_ERROR_WANT_READ        =  2,
+    SSL_ERROR_WANT_WRITE       =  3,
+    SSL_ERROR_WANT_CONNECT     =  7,
+    SSL_ERROR_WANT_ACCEPT      =  8,
+    SSL_ERROR_SYSCALL          =  5,
+    SSL_ERROR_WANT_X509_LOOKUP = 83,
+    SSL_ERROR_ZERO_RETURN      =  6,
+    SSL_ERROR_SSL              = 85,
+
+    SSL_SENT_SHUTDOWN     = 1,
+    SSL_RECEIVED_SHUTDOWN = 2,
+    SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 4,
+    SSL_OP_NO_SSLv2       = 8,
+
+    SSL_R_SSL_HANDSHAKE_FAILURE           = 101,
+    SSL_R_TLSV1_ALERT_UNKNOWN_CA          = 102,
+    SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 103,
+    SSL_R_SSLV3_ALERT_BAD_CERTIFICATE     = 104,
+
+    PEM_BUFSIZE = 1024
+};
+
+
+#ifndef NO_PSK
+    typedef unsigned int (*psk_client_callback)(CYASSL*, const char*, char*,
+                                    unsigned int, unsigned char*, unsigned int);
+    CYASSL_API void CyaSSL_CTX_set_psk_client_callback(CYASSL_CTX*,
+                                                    psk_client_callback);
+    CYASSL_API void CyaSSL_set_psk_client_callback(CYASSL*,psk_client_callback);
+
+    CYASSL_API const char* CyaSSL_get_psk_identity_hint(const CYASSL*);
+    CYASSL_API const char* CyaSSL_get_psk_identity(const CYASSL*);
+
+    CYASSL_API int CyaSSL_CTX_use_psk_identity_hint(CYASSL_CTX*, const char*);
+    CYASSL_API int CyaSSL_use_psk_identity_hint(CYASSL*, const char*);
+
+    typedef unsigned int (*psk_server_callback)(CYASSL*, const char*,
+                          unsigned char*, unsigned int);
+    CYASSL_API void CyaSSL_CTX_set_psk_server_callback(CYASSL_CTX*,
+                                                    psk_server_callback);
+    CYASSL_API void CyaSSL_set_psk_server_callback(CYASSL*,psk_server_callback);
+
+    #define PSK_TYPES_DEFINED
+#endif /* NO_PSK */
+
+
+/* extra begins */
+
+enum {  /* ERR Constants */
+    ERR_TXT_STRING = 1
+};
+
+CYASSL_API unsigned long CyaSSL_ERR_get_error_line_data(const char**, int*,
+                                                 const char**, int *);
+
+CYASSL_API unsigned long CyaSSL_ERR_get_error(void);
+CYASSL_API void          CyaSSL_ERR_clear_error(void);
+
+
+CYASSL_API int  CyaSSL_RAND_status(void);
+CYASSL_API int  CyaSSL_RAND_bytes(unsigned char* buf, int num);
+CYASSL_API CYASSL_METHOD *CyaSSLv23_server_method(void);
+CYASSL_API long CyaSSL_CTX_set_options(CYASSL_CTX*, long);
+CYASSL_API int  CyaSSL_CTX_check_private_key(CYASSL_CTX*);
+
+
+CYASSL_API void CyaSSL_ERR_free_strings(void);
+CYASSL_API void CyaSSL_ERR_remove_state(unsigned long);
+CYASSL_API void CyaSSL_EVP_cleanup(void);
+
+CYASSL_API void CyaSSL_cleanup_all_ex_data(void);
+CYASSL_API long CyaSSL_CTX_set_mode(CYASSL_CTX* ctx, long mode);
+CYASSL_API long CyaSSL_CTX_get_mode(CYASSL_CTX* ctx);
+CYASSL_API void CyaSSL_CTX_set_default_read_ahead(CYASSL_CTX* ctx, int m);
+
+CYASSL_API long CyaSSL_CTX_sess_set_cache_size(CYASSL_CTX*, long);
+
+CYASSL_API int  CyaSSL_CTX_set_default_verify_paths(CYASSL_CTX*);
+CYASSL_API int  CyaSSL_CTX_set_session_id_context(CYASSL_CTX*,
+                                            const unsigned char*, unsigned int);
+CYASSL_API CYASSL_X509* CyaSSL_get_peer_certificate(CYASSL* ssl);
+
+CYASSL_API int CyaSSL_want_read(CYASSL*);
+CYASSL_API int CyaSSL_want_write(CYASSL*);
+
+CYASSL_API int CyaSSL_BIO_printf(CYASSL_BIO*, const char*, ...);
+CYASSL_API int CyaSSL_ASN1_UTCTIME_print(CYASSL_BIO*,
+                                         const CYASSL_ASN1_UTCTIME*);
+CYASSL_API int   CyaSSL_sk_num(CYASSL_X509_REVOKED*);
+CYASSL_API void* CyaSSL_sk_value(CYASSL_X509_REVOKED*, int);
+
+/* stunnel 4.28 needs */
+CYASSL_API void* CyaSSL_CTX_get_ex_data(const CYASSL_CTX*, int);
+CYASSL_API int   CyaSSL_CTX_set_ex_data(CYASSL_CTX*, int, void*);
+CYASSL_API void  CyaSSL_CTX_sess_set_get_cb(CYASSL_CTX*,
+                       CYASSL_SESSION*(*f)(CYASSL*, unsigned char*, int, int*));
+CYASSL_API void  CyaSSL_CTX_sess_set_new_cb(CYASSL_CTX*,
+                                            int (*f)(CYASSL*, CYASSL_SESSION*));
+CYASSL_API void  CyaSSL_CTX_sess_set_remove_cb(CYASSL_CTX*,
+                                       void (*f)(CYASSL_CTX*, CYASSL_SESSION*));
+
+CYASSL_API int          CyaSSL_i2d_SSL_SESSION(CYASSL_SESSION*,unsigned char**);
+CYASSL_API CYASSL_SESSION* CyaSSL_d2i_SSL_SESSION(CYASSL_SESSION**,const unsigned char**,
+                                        long);
+
+CYASSL_API long CyaSSL_SESSION_get_timeout(const CYASSL_SESSION*);
+CYASSL_API long CyaSSL_SESSION_get_time(const CYASSL_SESSION*);
+CYASSL_API int  CyaSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*);
+
+/* extra ends */
+
+
+/* CyaSSL extensions */
+
+/* call before SSL_connect, if verifying will add name check to
+   date check and signature check */
+CYASSL_API int CyaSSL_check_domain_name(CYASSL* ssl, const char* dn);
+
+/* need to call once to load library (session cache) */
+CYASSL_API int CyaSSL_Init(void);
+/* call when done to cleanup/free session cache mutex / resources  */
+CYASSL_API int CyaSSL_Cleanup(void);
+
+/* turn logging on, only if compiled in */
+CYASSL_API int  CyaSSL_Debugging_ON(void);
+/* turn logging off */
+CYASSL_API void CyaSSL_Debugging_OFF(void);
+
+/* do accept or connect depedning on side */
+CYASSL_API int CyaSSL_negotiate(CYASSL* ssl);
+/* turn on CyaSSL data compression */
+CYASSL_API int CyaSSL_set_compression(CYASSL* ssl);
+
+CYASSL_API int CyaSSL_set_timeout(CYASSL*, unsigned int);
+CYASSL_API int CyaSSL_CTX_set_timeout(CYASSL_CTX*, unsigned int);
+
+/* get CyaSSL peer X509_CHAIN */
+CYASSL_API CYASSL_X509_CHAIN* CyaSSL_get_peer_chain(CYASSL* ssl);
+/* peer chain count */
+CYASSL_API int  CyaSSL_get_chain_count(CYASSL_X509_CHAIN* chain);
+/* index cert length */
+CYASSL_API int  CyaSSL_get_chain_length(CYASSL_X509_CHAIN*, int idx);
+/* index cert */
+CYASSL_API unsigned char* CyaSSL_get_chain_cert(CYASSL_X509_CHAIN*, int idx);
+/* get index cert in PEM */
+CYASSL_API int  CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN*, int idx,
+                                unsigned char* buffer, int inLen, int* outLen);
+CYASSL_API const unsigned char* CyaSSL_get_sessionID(const CYASSL_SESSION* s);
+CYASSL_API int  CyaSSL_X509_get_serial_number(CYASSL_X509*,unsigned char*,int*);
+CYASSL_API char*  CyaSSL_X509_get_subjectCN(CYASSL_X509*);
+CYASSL_API const unsigned char* CyaSSL_X509_get_der(CYASSL_X509*, int*);
+
+CYASSL_API int CyaSSL_cmp_peer_cert_to_file(CYASSL*, const char*);
+
+CYASSL_API char* CyaSSL_X509_get_next_altname(CYASSL_X509*);
+
+/* connect enough to get peer cert */
+CYASSL_API int  CyaSSL_connect_cert(CYASSL* ssl);
+
+/* server Diffie-Hellman parameters */
+CYASSL_API int  CyaSSL_SetTmpDH(CYASSL*, const unsigned char* p, int pSz,
+                                const unsigned char* g, int gSz);
+CYASSL_API int  CyaSSL_SetTmpDH_buffer(CYASSL*, const unsigned char* b, long sz,
+                                       int format);
+CYASSL_API int  CyaSSL_SetTmpEC_DHE_Sz(CYASSL*, unsigned short);
+#ifndef NO_FILESYSTEM
+    CYASSL_API int  CyaSSL_SetTmpDH_file(CYASSL*, const char* f, int format);
+#endif
+
+/* server ctx Diffie-Hellman parameters */
+CYASSL_API int  CyaSSL_CTX_SetTmpDH(CYASSL_CTX*, const unsigned char* p,
+                                    int pSz, const unsigned char* g, int gSz);
+CYASSL_API int  CyaSSL_CTX_SetTmpDH_buffer(CYASSL_CTX*, const unsigned char* b,
+                                           long sz, int format);
+CYASSL_API int  CyaSSL_CTX_SetTmpEC_DHE_Sz(CYASSL_CTX*, unsigned short);
+#ifndef NO_FILESYSTEM
+    CYASSL_API int  CyaSSL_CTX_SetTmpDH_file(CYASSL_CTX*, const char* f,
+                                             int format);
+#endif
+
+/* keyblock size in bytes or -1 */
+CYASSL_API int CyaSSL_get_keyblock_size(CYASSL*);
+CYASSL_API int CyaSSL_get_keys(CYASSL*,unsigned char** ms, unsigned int* msLen,
+                                       unsigned char** sr, unsigned int* srLen,
+                                       unsigned char** cr, unsigned int* crLen);
+
+#ifndef _WIN32
+    #ifndef NO_WRITEV
+        #ifdef __PPU
+            #include <sys/types.h>
+            #include <sys/socket.h>
+        #else
+            #include <sys/uio.h>
+        #endif
+        /* allow writev style writing */
+        CYASSL_API int CyaSSL_writev(CYASSL* ssl, const struct iovec* iov,
+                                     int iovcnt);
+    #endif
+#endif
+
+
+/* SSL_CTX versions */
+CYASSL_API int CyaSSL_CTX_load_verify_buffer(CYASSL_CTX*, const unsigned char*,
+                                             long, int);
+CYASSL_API int CyaSSL_CTX_use_certificate_buffer(CYASSL_CTX*,
+                                               const unsigned char*, long, int);
+CYASSL_API int CyaSSL_CTX_use_PrivateKey_buffer(CYASSL_CTX*,
+                                               const unsigned char*, long, int);
+CYASSL_API int CyaSSL_CTX_use_certificate_chain_buffer(CYASSL_CTX*, 
+                                                    const unsigned char*, long);
+CYASSL_API int CyaSSL_CTX_set_group_messages(CYASSL_CTX*);
+
+/* SSL versions */
+CYASSL_API int CyaSSL_use_certificate_buffer(CYASSL*, const unsigned char*,
+                                             long, int);
+CYASSL_API int CyaSSL_use_PrivateKey_buffer(CYASSL*, const unsigned char*, long,
+                                            int);
+CYASSL_API int CyaSSL_use_certificate_chain_buffer(CYASSL*, 
+                                                    const unsigned char*, long);
+CYASSL_API int CyaSSL_set_group_messages(CYASSL*);
+
+/* I/O callbacks */
+typedef int (*CallbackIORecv)(char *buf, int sz, void *ctx);
+typedef int (*CallbackIOSend)(char *buf, int sz, void *ctx);
+
+CYASSL_API void CyaSSL_SetIORecv(CYASSL_CTX*, CallbackIORecv);
+CYASSL_API void CyaSSL_SetIOSend(CYASSL_CTX*, CallbackIOSend);
+
+CYASSL_API void CyaSSL_SetIOReadCtx(CYASSL* ssl, void *ctx);
+CYASSL_API void CyaSSL_SetIOWriteCtx(CYASSL* ssl, void *ctx);
+
+/* CA cache callbacks */
+enum {
+    CYASSL_SSLV3    = 0,
+    CYASSL_TLSV1    = 1,
+    CYASSL_TLSV1_1  = 2,
+    CYASSL_TLSV1_2  = 3,
+    CYASSL_USER_CA  = 1,          /* user added as trusted */
+    CYASSL_CHAIN_CA = 2           /* added to cache from trusted chain */
+};
+
+CYASSL_API int CyaSSL_SetVersion(CYASSL* ssl, int version);
+CYASSL_API int CyaSSL_KeyPemToDer(const unsigned char*, int sz, unsigned char*,
+                                  int, const char*);
+
+typedef void (*CallbackCACache)(unsigned char* der, int sz, int type);
+typedef void (*CbMissingCRL)(const char* url);
+
+CYASSL_API void CyaSSL_CTX_SetCACb(CYASSL_CTX*, CallbackCACache);
+
+
+CYASSL_API CYASSL_CERT_MANAGER* CyaSSL_CertManagerNew(void);
+CYASSL_API void                 CyaSSL_CertManagerFree(CYASSL_CERT_MANAGER*);
+
+CYASSL_API int CyaSSL_CertManagerLoadCA(CYASSL_CERT_MANAGER*, const char* f,
+                                        const char* d);
+CYASSL_API int CyaSSL_CertManagerVerify(CYASSL_CERT_MANAGER*, const char* f,
+                                        int format);
+CYASSL_API int CyaSSL_CertManagerVerifyBuffer(CYASSL_CERT_MANAGER* cm,
+                                 const unsigned char* buff, int sz, int format);
+CYASSL_API int CyaSSL_CertManagerCheckCRL(CYASSL_CERT_MANAGER*, unsigned char*,
+                                          int sz);
+CYASSL_API int CyaSSL_CertManagerEnableCRL(CYASSL_CERT_MANAGER*, int options);
+CYASSL_API int CyaSSL_CertManagerDisableCRL(CYASSL_CERT_MANAGER*);
+CYASSL_API int CyaSSL_CertManagerLoadCRL(CYASSL_CERT_MANAGER*, const char*, int,
+                                         int);
+CYASSL_API int CyaSSL_CertManagerSetCRL_Cb(CYASSL_CERT_MANAGER*, CbMissingCRL);
+
+CYASSL_API int CyaSSL_EnableCRL(CYASSL* ssl, int options);
+CYASSL_API int CyaSSL_DisableCRL(CYASSL* ssl);
+CYASSL_API int CyaSSL_LoadCRL(CYASSL*, const char*, int, int);
+CYASSL_API int CyaSSL_SetCRL_Cb(CYASSL*, CbMissingCRL);
+
+CYASSL_API int CyaSSL_CTX_EnableCRL(CYASSL_CTX* ctx, int options);
+CYASSL_API int CyaSSL_CTX_DisableCRL(CYASSL_CTX* ctx);
+CYASSL_API int CyaSSL_CTX_LoadCRL(CYASSL_CTX*, const char*, int, int);
+CYASSL_API int CyaSSL_CTX_SetCRL_Cb(CYASSL_CTX*, CbMissingCRL);
+
+#define CYASSL_CRL_MONITOR   0x01   /* monitor this dir flag */
+#define CYASSL_CRL_START_MON 0x02   /* start monitoring flag */
+
+#ifdef CYASSL_CALLBACKS
+
+/* used internally by CyaSSL while OpenSSL types aren't */
+#include <cyassl/callbacks.h>
+
+typedef int (*HandShakeCallBack)(HandShakeInfo*);
+typedef int (*TimeoutCallBack)(TimeoutInfo*);
+
+/* CyaSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack
+   for diagnostics */
+CYASSL_API int CyaSSL_connect_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack,
+                                 Timeval);
+CYASSL_API int CyaSSL_accept_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack,
+                                Timeval);
+
+#endif /* CYASSL_CALLBACKS */
+
+
+CYASSL_API long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX*, long);
+CYASSL_API int  CyaSSL_CTX_OCSP_set_override_url(CYASSL_CTX*, const char*);
+
+/* OCSP Options */
+#define CYASSL_OCSP_ENABLE       0x0001 /* Enable OCSP lookups */
+#define CYASSL_OCSP_URL_OVERRIDE 0x0002 /* Use the override URL instead of URL
+                                         * in certificate */
+
+
+#ifdef __cplusplus
+    }  /* extern "C" */
+#endif
+
+
+#endif /* CYASSL_SSL_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/test.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/test.h
new file mode 100644 (file)
index 0000000..82cee42
--- /dev/null
@@ -0,0 +1,806 @@
+/* test.h */
+
+#ifndef CyaSSL_TEST_H
+#define CyaSSL_TEST_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
+#include <cyassl/ssl.h>
+#include <cyassl/ctaocrypt/types.h>
+
+#ifdef USE_WINDOWS_API 
+    #include <winsock2.h>
+    #include <process.h>
+    #ifdef TEST_IPV6            /* don't require newer SDK for IPV4 */
+           #include <ws2tcpip.h>
+        #include <wspiapi.h>
+    #endif
+    #define SOCKET_T int
+#else
+    #include <string.h>
+    #include <unistd.h>
+    #include <netdb.h>
+    #include <netinet/in.h>
+    #include <netinet/tcp.h>
+    #include <arpa/inet.h>
+    #include <sys/ioctl.h>
+    #include <sys/time.h>
+    #include <sys/types.h>
+    #include <sys/socket.h>
+    #include <pthread.h>
+    #ifdef NON_BLOCKING
+        #include <fcntl.h>
+    #endif
+    #ifdef TEST_IPV6
+        #include <netdb.h>
+    #endif
+    #define SOCKET_T unsigned int
+#endif /* USE_WINDOWS_API */
+
+#ifdef _MSC_VER
+    /* disable conversion warning */
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
+    #pragma warning(disable:4244 4996)
+#endif
+
+
+#if defined(__MACH__) || defined(USE_WINDOWS_API)
+    #ifndef _SOCKLEN_T
+        typedef int socklen_t;
+    #endif
+#endif
+
+
+/* HPUX doesn't use socklent_t for third parameter to accept */
+#if !defined(__hpux__)
+    typedef socklen_t* ACCEPT_THIRD_T;
+#else
+    typedef int*       ACCEPT_THIRD_T;
+#endif
+
+
+#ifdef USE_WINDOWS_API 
+    #define CloseSocket(s) closesocket(s)
+    #define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); }
+#else
+    #define CloseSocket(s) close(s)
+    #define StartTCP() 
+#endif
+
+
+#ifdef SINGLE_THREADED
+    typedef unsigned int  THREAD_RETURN;
+    typedef void*         THREAD_TYPE;
+    #define CYASSL_THREAD
+#else
+    #ifdef _POSIX_THREADS
+        typedef void*         THREAD_RETURN;
+        typedef pthread_t     THREAD_TYPE;
+        #define CYASSL_THREAD
+        #define INFINITE -1
+        #define WAIT_OBJECT_0 0L
+    #else
+        typedef unsigned int  THREAD_RETURN;
+        typedef HANDLE        THREAD_TYPE;
+        #define CYASSL_THREAD __stdcall
+    #endif
+#endif
+
+
+#ifdef TEST_IPV6
+    typedef struct sockaddr_in6 SOCKADDR_IN_T;
+    #define AF_INET_V    AF_INET6
+#else
+    typedef struct sockaddr_in  SOCKADDR_IN_T;
+    #define AF_INET_V    AF_INET
+#endif
+   
+
+#define SERVER_DEFAULT_VERSION 3
+#define CLIENT_DEFAULT_VERSION 3
+
+/* all certs relative to CyaSSL home directory now */
+#define caCert     "./certs/ca-cert.pem"
+#define eccCert    "./certs/server-ecc.pem"
+#define eccKey     "./certs/ecc-key.pem"
+#define svrCert    "./certs/server-cert.pem"
+#define svrKey     "./certs/server-key.pem"
+#define cliCert    "./certs/client-cert.pem"
+#define cliKey     "./certs/client-key.pem"
+#define ntruCert   "./certs/ntru-cert.pem"
+#define ntruKey    "./certs/ntru-key.raw"
+#define dhParam    "./certs/dh2048.pem"
+#define cliEccKey  "./certs/ecc-client-key.pem"
+#define cliEccCert "./certs/client-ecc-cert.pem"
+#define crlPemDir  "./certs/crl"
+
+typedef struct tcp_ready {
+    int ready;              /* predicate */
+#ifdef _POSIX_THREADS
+    pthread_mutex_t mutex;
+    pthread_cond_t  cond;
+#endif
+} tcp_ready;    
+
+
+void InitTcpReady(tcp_ready*);
+void FreeTcpReady(tcp_ready*);
+
+
+typedef struct func_args {
+    int    argc;
+    char** argv;
+    int    return_code;
+    tcp_ready* signal;
+} func_args;
+
+void wait_tcp_ready(func_args*);
+
+typedef THREAD_RETURN CYASSL_THREAD THREAD_FUNC(void*);
+
+void start_thread(THREAD_FUNC, func_args*, THREAD_TYPE*);
+void join_thread(THREAD_TYPE);
+
+/* yaSSL */
+static const char* const yasslIP   = "127.0.0.1";
+static const word16      yasslPort = 11111;
+
+
+static INLINE void err_sys(const char* msg)
+{
+    printf("yassl error: %s\n", msg);
+    exit(EXIT_FAILURE);
+}
+
+
+#define MY_EX_USAGE 2
+
+extern int   myoptind;
+extern char* myoptarg;
+
+static INLINE int mygetopt(int argc, char** argv, char* optstring)
+{
+    static char* next = NULL;
+
+    char  c;
+    char* cp;
+
+    if (myoptind == 0)
+        next = NULL;   /* we're starting new/over */
+
+    if (next == NULL || *next == '\0') {
+        if (myoptind == 0)
+            myoptind++;
+
+        if (myoptind >= argc || argv[myoptind][0] != '-' ||
+                                argv[myoptind][1] == '\0') {
+            myoptarg = NULL;
+            if (myoptind < argc)
+                myoptarg = argv[myoptind];
+
+            return -1;
+        }
+
+        if (strcmp(argv[myoptind], "--") == 0) {
+            myoptind++;
+            myoptarg = NULL;
+
+            if (myoptind < argc)
+                myoptarg = argv[myoptind];
+
+            return -1;
+        }
+
+        next = argv[myoptind];
+        next++;                  /* skip - */
+        myoptind++;
+    }
+
+    c  = *next++;
+    cp = strchr(optstring, c);
+
+    if (cp == NULL || c == ':') 
+        return '?';
+
+    cp++;
+
+    if (*cp == ':') {
+        if (*next != '\0') {
+            myoptarg = next;
+            next     = NULL;
+        }
+        else if (myoptind < argc) {
+            myoptarg = argv[myoptind];
+            myoptind++;
+        }
+        else 
+            return '?';
+    }
+
+    return c;
+}
+
+
+#ifdef OPENSSL_EXTRA
+
+static INLINE int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
+{
+    strncpy(passwd, "yassl123", sz);
+    return 8;
+}
+
+#endif
+
+
+static INLINE void showPeer(CYASSL* ssl)
+{
+#ifdef OPENSSL_EXTRA
+
+    CYASSL_CIPHER* cipher;
+    CYASSL_X509*   peer = CyaSSL_get_peer_certificate(ssl);
+    if (peer) {
+        char* altName;
+        char* issuer  = CyaSSL_X509_NAME_oneline(
+                                       CyaSSL_X509_get_issuer_name(peer), 0, 0);
+        char* subject = CyaSSL_X509_NAME_oneline(
+                                      CyaSSL_X509_get_subject_name(peer), 0, 0);
+        byte  serial[32];
+        int   ret;
+        int   sz = sizeof(serial);
+        
+        printf("peer's cert info:\n issuer : %s\n subject: %s\n", issuer,
+                                                                  subject);
+
+        while ( (altName = CyaSSL_X509_get_next_altname(peer)) )
+            printf(" altname = %s\n", altName);
+
+        ret = CyaSSL_X509_get_serial_number(peer, serial, &sz);
+        if (ret == 0) {
+            int  i;
+            int  strLen;
+            char serialMsg[80];
+
+            /* testsuite has multiple threads writing to stdout, get output
+               message ready to write once */
+            strLen = sprintf(serialMsg, " serial number");
+            for (i = 0; i < sz; i++)
+                sprintf(serialMsg + strLen + (i*3), ":%02x ", serial[i]);
+            printf("%s\n", serialMsg);
+        }
+
+        XFREE(subject, 0, DYNAMIC_TYPE_OPENSSL);
+        XFREE(issuer,  0, DYNAMIC_TYPE_OPENSSL);
+    }
+    else
+        printf("peer has no cert!\n");
+    printf("SSL version is %s\n", CyaSSL_get_version(ssl));
+
+    cipher = CyaSSL_get_current_cipher(ssl);
+    printf("SSL cipher suite is %s\n", CyaSSL_CIPHER_get_name(cipher));
+#endif
+
+#if defined(SESSION_CERTS) && defined(SHOW_CERTS)
+    {
+        CYASSL_X509_CHAIN* chain = CyaSSL_get_peer_chain(ssl);
+        int                count = CyaSSL_get_chain_count(chain);
+        int i;
+
+        for (i = 0; i < count; i++) {
+            int length;
+            unsigned char buffer[3072];
+
+            CyaSSL_get_chain_cert_pem(chain,i,buffer, sizeof(buffer), &length);
+            buffer[length] = 0;
+            printf("cert %d has length %d data = \n%s\n", i, length, buffer);
+        }
+    }
+#endif
+
+}
+
+
+static INLINE void tcp_socket(SOCKET_T* sockfd, SOCKADDR_IN_T* addr,
+                              const char* peer, word16 port, int udp)
+{
+#ifndef TEST_IPV6
+    const char* host = peer;
+
+    /* peer could be in human readable form */
+    if (peer != INADDR_ANY && isalpha(peer[0])) {
+        struct hostent* entry = gethostbyname(peer);
+
+        if (entry) {
+            struct sockaddr_in tmp;
+            memset(&tmp, 0, sizeof(struct sockaddr_in));
+            memcpy(&tmp.sin_addr.s_addr, entry->h_addr_list[0],
+                   entry->h_length);
+            host = inet_ntoa(tmp.sin_addr);
+        }
+        else
+            err_sys("no entry for host");
+    }
+#endif
+
+    if (udp)
+        *sockfd = socket(AF_INET_V, SOCK_DGRAM, 0);
+    else
+        *sockfd = socket(AF_INET_V, SOCK_STREAM, 0);
+    memset(addr, 0, sizeof(SOCKADDR_IN_T));
+
+#ifndef TEST_IPV6
+    addr->sin_family = AF_INET_V;
+    addr->sin_port = htons(port);
+    if (host == INADDR_ANY)
+        addr->sin_addr.s_addr = INADDR_ANY;
+    else
+        addr->sin_addr.s_addr = inet_addr(host);
+#else
+    addr->sin6_family = AF_INET_V;
+    addr->sin6_port = htons(port);
+    addr->sin6_addr = in6addr_loopback;
+#endif
+
+#ifndef USE_WINDOWS_API 
+#ifdef SO_NOSIGPIPE
+    {
+        int       on = 1;
+        socklen_t len = sizeof(on);
+        int       res = setsockopt(*sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, len);
+        if (res < 0)
+            err_sys("setsockopt SO_NOSIGPIPE failed\n");
+    }
+#endif
+
+#if defined(TCP_NODELAY)
+    if (!udp)
+    {
+        int       on = 1;
+        socklen_t len = sizeof(on);
+        int       res = setsockopt(*sockfd, IPPROTO_TCP, TCP_NODELAY, &on, len);
+        if (res < 0)
+            err_sys("setsockopt TCP_NODELAY failed\n");
+    }
+#endif
+#endif  /* USE_WINDOWS_API */
+}
+
+
+static INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port,
+                               int udp)
+{
+    SOCKADDR_IN_T addr;
+    tcp_socket(sockfd, &addr, ip, port, udp);
+
+    if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
+        err_sys("tcp connect failed");
+}
+
+
+static INLINE void tcp_listen(SOCKET_T* sockfd, int port, int useAnyAddr,
+                              int udp)
+{
+    SOCKADDR_IN_T addr;
+
+    /* don't use INADDR_ANY by default, firewall may block, make user switch
+       on */
+    if (useAnyAddr)
+        tcp_socket(sockfd, &addr, INADDR_ANY, port, udp);
+    else
+        tcp_socket(sockfd, &addr, yasslIP, port, udp);
+
+#ifndef USE_WINDOWS_API 
+    {
+        int       on  = 1;
+        socklen_t len = sizeof(on);
+        setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, &on, len);
+    }
+#endif
+
+    if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
+        err_sys("tcp bind failed");
+    if (!udp) {
+        if (listen(*sockfd, 5) != 0)
+            err_sys("tcp listen failed");
+    }
+}
+
+
+static INLINE int udp_read_connect(SOCKET_T sockfd)
+{
+    SOCKADDR_IN_T cliaddr;
+    byte          b[1500];
+    int           n;
+    socklen_t     len = sizeof(cliaddr);
+
+    n = recvfrom(sockfd, (char*)b, sizeof(b), MSG_PEEK,
+                (struct sockaddr*)&cliaddr, &len);
+    if (n > 0) {
+        if (connect(sockfd, (const struct sockaddr*)&cliaddr,
+                    sizeof(cliaddr)) != 0)
+            err_sys("udp connect failed");
+    }
+    else
+        err_sys("recvfrom failed");
+
+    return sockfd;
+}
+
+static INLINE void udp_accept(SOCKET_T* sockfd, int* clientfd, func_args* args)
+{
+    SOCKADDR_IN_T addr;
+
+    tcp_socket(sockfd, &addr, yasslIP, yasslPort, 1);
+
+
+#ifndef USE_WINDOWS_API 
+    {
+        int       on  = 1;
+        socklen_t len = sizeof(on);
+        setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, &on, len);
+    }
+#endif
+
+    if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
+        err_sys("tcp bind failed");
+
+#if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER)
+    /* signal ready to accept data */
+    {
+    tcp_ready* ready = args->signal;
+    pthread_mutex_lock(&ready->mutex);
+    ready->ready = 1;
+    pthread_cond_signal(&ready->cond);
+    pthread_mutex_unlock(&ready->mutex);
+    }
+#endif
+
+    *clientfd = udp_read_connect(*sockfd);
+}
+
+static INLINE void tcp_accept(SOCKET_T* sockfd, int* clientfd, func_args* args,
+                              int port, int useAnyAddr, int udp)
+{
+    SOCKADDR_IN_T client;
+    socklen_t client_len = sizeof(client);
+
+    if (udp) {
+        udp_accept(sockfd, clientfd, args);
+        return;
+    }
+
+    tcp_listen(sockfd, port, useAnyAddr, udp);
+
+#if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER)
+    /* signal ready to tcp_accept */
+    {
+    tcp_ready* ready = args->signal;
+    pthread_mutex_lock(&ready->mutex);
+    ready->ready = 1;
+    pthread_cond_signal(&ready->cond);
+    pthread_mutex_unlock(&ready->mutex);
+    }
+#endif
+
+    *clientfd = accept(*sockfd, (struct sockaddr*)&client,
+                      (ACCEPT_THIRD_T)&client_len);
+    if (*clientfd == -1)
+        err_sys("tcp accept failed");
+}
+
+
+static INLINE void tcp_set_nonblocking(SOCKET_T* sockfd)
+{
+#ifdef NON_BLOCKING
+    #ifdef USE_WINDOWS_API 
+        unsigned long blocking = 1;
+        int ret = ioctlsocket(*sockfd, FIONBIO, &blocking);
+    #else
+        int flags = fcntl(*sockfd, F_GETFL, 0);
+        int ret = fcntl(*sockfd, F_SETFL, flags | O_NONBLOCK);
+    #endif
+#endif
+}
+
+
+#ifndef NO_PSK
+
+static INLINE unsigned int my_psk_client_cb(CYASSL* ssl, const char* hint,
+        char* identity, unsigned int id_max_len, unsigned char* key,
+        unsigned int key_max_len)
+{
+    /* identity is OpenSSL testing default for openssl s_client, keep same */
+    strncpy(identity, "Client_identity", id_max_len);
+
+
+    /* test key in hex is 0x1a2b3c4d , in decimal 439,041,101 , we're using
+       unsigned binary */
+    key[0] = 26;
+    key[1] = 43;
+    key[2] = 60;
+    key[3] = 77;
+
+    return 4;   /* length of key in octets or 0 for error */
+}
+
+
+static INLINE unsigned int my_psk_server_cb(CYASSL* ssl, const char* identity,
+        unsigned char* key, unsigned int key_max_len)
+{
+    /* identity is OpenSSL testing default for openssl s_client, keep same */
+    if (strncmp(identity, "Client_identity", 15) != 0)
+        return 0;
+
+    /* test key in hex is 0x1a2b3c4d , in decimal 439,041,101 , we're using
+       unsigned binary */
+    key[0] = 26;
+    key[1] = 43;
+    key[2] = 60;
+    key[3] = 77;
+
+    return 4;   /* length of key in octets or 0 for error */
+}
+
+#endif /* NO_PSK */
+
+
+#ifdef USE_WINDOWS_API 
+
+    #define WIN32_LEAN_AND_MEAN
+    #include <windows.h>
+
+    static INLINE double current_time()
+    {
+        static int init = 0;
+        static LARGE_INTEGER freq;
+    
+        LARGE_INTEGER count;
+
+        if (!init) {
+            QueryPerformanceFrequency(&freq);
+            init = 1;
+        }
+
+        QueryPerformanceCounter(&count);
+
+        return (double)count.QuadPart / freq.QuadPart;
+    }
+
+#else
+
+    #include <sys/time.h>
+
+    static INLINE double current_time()
+    {
+        struct timeval tv;
+        gettimeofday(&tv, 0);
+
+        return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
+    }
+
+#endif /* USE_WINDOWS_API */
+
+
+#ifdef NO_FILESYSTEM
+
+    enum {
+        CYASSL_CA   = 1,
+        CYASSL_CERT = 2,
+        CYASSL_KEY  = 3
+    };
+
+    static INLINE void load_buffer(CYASSL_CTX* ctx, const char* fname, int type)
+    {
+        /* test buffer load */
+        long  sz = 0;
+        byte  buff[10000];
+        FILE* file = fopen(fname, "rb");
+
+        if (!file)
+            err_sys("can't open file for buffer load "
+                    "Please run from CyaSSL home directory if not");
+        fseek(file, 0, SEEK_END);
+        sz = ftell(file);
+        rewind(file);
+        fread(buff, sizeof(buff), 1, file);
+  
+        if (type == CYASSL_CA) {
+            if (CyaSSL_CTX_load_verify_buffer(ctx, buff, sz, SSL_FILETYPE_PEM)
+                                              != SSL_SUCCESS)
+                err_sys("can't load buffer ca file");
+        }
+        else if (type == CYASSL_CERT) {
+            if (CyaSSL_CTX_use_certificate_buffer(ctx, buff, sz,
+                        SSL_FILETYPE_PEM) != SSL_SUCCESS)
+                err_sys("can't load buffer cert file");
+        }
+        else if (type == CYASSL_KEY) {
+            if (CyaSSL_CTX_use_PrivateKey_buffer(ctx, buff, sz,
+                        SSL_FILETYPE_PEM) != SSL_SUCCESS)
+                err_sys("can't load buffer key file");
+        }
+    }
+
+#endif /* NO_FILESYSTEM */
+
+#ifdef VERIFY_CALLBACK
+
+static INLINE int myVerify(int preverify, CYASSL_X509_STORE_CTX* store)
+{
+    char buffer[80];
+
+    printf("In verification callback, error = %d, %s\n", store->error,
+                                 CyaSSL_ERR_error_string(store->error, buffer));
+#ifdef OPENSSL_EXTRA
+    CYASSL_X509* peer = store->current_cert;
+    if (peer) {
+        char* issuer  = CyaSSL_X509_NAME_oneline(
+                                       CyaSSL_X509_get_issuer_name(peer), 0, 0);
+        char* subject = CyaSSL_X509_NAME_oneline(
+                                      CyaSSL_X509_get_subject_name(peer), 0, 0);
+        printf("peer's cert info:\n issuer : %s\n subject: %s\n", issuer,
+                                                                  subject);
+        XFREE(subject, 0, DYNAMIC_TYPE_OPENSSL);
+        XFREE(issuer,  0, DYNAMIC_TYPE_OPENSSL);
+    }
+    else
+        printf("peer has no cert!\n");
+#endif
+    printf("Subject's domain name is %s\n", store->domain);
+
+    printf("Allowing to continue anyway (shouldn't do this, EVER!!!)\n");
+    return 1;
+}
+
+#endif /* VERIFY_CALLBACK */
+
+
+#ifdef HAVE_CRL
+
+static void INLINE CRL_CallBack(const char* url)
+{
+    printf("CRL callback url = %s\n", url);
+}
+
+#endif
+
+
+static INLINE void CaCb(unsigned char* der, int sz, int type)
+{
+    printf("Got CA cache add callback, derSz = %d, type = %d\n", sz, type);
+}
+
+
+static INLINE void SetDH(CYASSL* ssl)
+{
+    /* dh1024 p */
+    static unsigned char p[] =
+    {
+        0xE6, 0x96, 0x9D, 0x3D, 0x49, 0x5B, 0xE3, 0x2C, 0x7C, 0xF1, 0x80, 0xC3,
+        0xBD, 0xD4, 0x79, 0x8E, 0x91, 0xB7, 0x81, 0x82, 0x51, 0xBB, 0x05, 0x5E,
+        0x2A, 0x20, 0x64, 0x90, 0x4A, 0x79, 0xA7, 0x70, 0xFA, 0x15, 0xA2, 0x59,
+        0xCB, 0xD5, 0x23, 0xA6, 0xA6, 0xEF, 0x09, 0xC4, 0x30, 0x48, 0xD5, 0xA2,
+        0x2F, 0x97, 0x1F, 0x3C, 0x20, 0x12, 0x9B, 0x48, 0x00, 0x0E, 0x6E, 0xDD,
+        0x06, 0x1C, 0xBC, 0x05, 0x3E, 0x37, 0x1D, 0x79, 0x4E, 0x53, 0x27, 0xDF,
+        0x61, 0x1E, 0xBB, 0xBE, 0x1B, 0xAC, 0x9B, 0x5C, 0x60, 0x44, 0xCF, 0x02,
+        0x3D, 0x76, 0xE0, 0x5E, 0xEA, 0x9B, 0xAD, 0x99, 0x1B, 0x13, 0xA6, 0x3C,
+        0x97, 0x4E, 0x9E, 0xF1, 0x83, 0x9E, 0xB5, 0xDB, 0x12, 0x51, 0x36, 0xF7,
+        0x26, 0x2E, 0x56, 0xA8, 0x87, 0x15, 0x38, 0xDF, 0xD8, 0x23, 0xC6, 0x50,
+        0x50, 0x85, 0xE2, 0x1F, 0x0D, 0xD5, 0xC8, 0x6B,
+    };
+
+    /* dh1024 g */
+    static unsigned char g[] =
+    {
+      0x02,
+    };
+
+    CyaSSL_SetTmpDH(ssl, p, sizeof(p), g, sizeof(g));
+}
+
+static INLINE void SetDHCtx(CYASSL_CTX* ctx)
+{
+    /* dh1024 p */
+    static unsigned char p[] =
+    {
+        0xE6, 0x96, 0x9D, 0x3D, 0x49, 0x5B, 0xE3, 0x2C, 0x7C, 0xF1, 0x80, 0xC3,
+        0xBD, 0xD4, 0x79, 0x8E, 0x91, 0xB7, 0x81, 0x82, 0x51, 0xBB, 0x05, 0x5E,
+        0x2A, 0x20, 0x64, 0x90, 0x4A, 0x79, 0xA7, 0x70, 0xFA, 0x15, 0xA2, 0x59,
+        0xCB, 0xD5, 0x23, 0xA6, 0xA6, 0xEF, 0x09, 0xC4, 0x30, 0x48, 0xD5, 0xA2,
+        0x2F, 0x97, 0x1F, 0x3C, 0x20, 0x12, 0x9B, 0x48, 0x00, 0x0E, 0x6E, 0xDD,
+        0x06, 0x1C, 0xBC, 0x05, 0x3E, 0x37, 0x1D, 0x79, 0x4E, 0x53, 0x27, 0xDF,
+        0x61, 0x1E, 0xBB, 0xBE, 0x1B, 0xAC, 0x9B, 0x5C, 0x60, 0x44, 0xCF, 0x02,
+        0x3D, 0x76, 0xE0, 0x5E, 0xEA, 0x9B, 0xAD, 0x99, 0x1B, 0x13, 0xA6, 0x3C,
+        0x97, 0x4E, 0x9E, 0xF1, 0x83, 0x9E, 0xB5, 0xDB, 0x12, 0x51, 0x36, 0xF7,
+        0x26, 0x2E, 0x56, 0xA8, 0x87, 0x15, 0x38, 0xDF, 0xD8, 0x23, 0xC6, 0x50,
+        0x50, 0x85, 0xE2, 0x1F, 0x0D, 0xD5, 0xC8, 0x6B,
+    };
+
+    /* dh1024 g */
+    static unsigned char g[] =
+    {
+      0x02,
+    };
+
+    CyaSSL_CTX_SetTmpDH(ctx, p, sizeof(p), g, sizeof(g));
+}
+
+#ifdef USE_WINDOWS_API 
+
+/* do back x number of directories */
+static INLINE void ChangeDirBack(int x)
+{
+    char path[MAX_PATH];
+
+    if (x == 1)
+        strncpy(path, "..\\", MAX_PATH);
+    else if (x == 2)
+        strncpy(path, "..\\..\\", MAX_PATH);
+    else if (x == 3)
+        strncpy(path, "..\\..\\..\\", MAX_PATH);
+    else if (x == 4)
+        strncpy(path, "..\\..\\..\\..\\", MAX_PATH);
+    else
+        strncpy(path, ".\\", MAX_PATH);
+    
+    SetCurrentDirectoryA(path);
+}
+
+/* does current dir contain str */
+static INLINE int CurrentDir(const char* str)
+{
+    char path[MAX_PATH];
+
+    GetCurrentDirectoryA(sizeof(path), path);
+    if (strstr(path, str))
+        return 1;
+
+    return 0;
+}
+
+#else
+
+#ifndef MAX_PATH
+    #define MAX_PATH 256
+#endif
+
+/* do back x number of directories */
+static INLINE void ChangeDirBack(int x)
+{
+    char path[MAX_PATH];
+
+    if (x == 1)
+        strncpy(path, "../", MAX_PATH);
+    else if (x == 2)
+        strncpy(path, "../../", MAX_PATH);
+    else if (x == 3)
+        strncpy(path, "../../../", MAX_PATH);
+    else if (x == 4)
+        strncpy(path, "../../../../", MAX_PATH);
+    else
+        strncpy(path, "./", MAX_PATH);
+    
+    if (chdir(path) < 0)
+        printf("chdir to %s failed\n", path);
+}
+
+/* does current dir contain str */
+static INLINE int CurrentDir(const char* str)
+{
+    char path[MAX_PATH];
+
+    if (getcwd(path, sizeof(path)) == NULL) {
+        printf("no current dir?\n");
+        return 0;
+    }
+    if (strstr(path, str))
+        return 1;
+
+    return 0;
+}
+
+#endif /* USE_WINDOWS_API */
+
+#endif /* CyaSSL_TEST_H */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h b/FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h
new file mode 100644 (file)
index 0000000..eff5b71
--- /dev/null
@@ -0,0 +1,35 @@
+/* cyassl_version.h.in
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LIBCYASSL_VERSION_STRING "2.3.0"
+#define LIBCYASSL_VERSION_HEX 0x02003000
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h.in b/FreeRTOS-Plus/Source/CyaSSL/cyassl/version.h.in
new file mode 100644 (file)
index 0000000..6af4f0a
--- /dev/null
@@ -0,0 +1,35 @@
+/* cyassl_version.h.in
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LIBCYASSL_VERSION_STRING "@VERSION@"
+#define LIBCYASSL_VERSION_HEX @HEX_VERSION@
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/doc/README.txt b/FreeRTOS-Plus/Source/CyaSSL/doc/README.txt
new file mode 100644 (file)
index 0000000..d9b367b
--- /dev/null
@@ -0,0 +1,3 @@
+The CyaSSL manual is availalbe at:
+http://www.yassl.com/documentation/CyaSSL-Manual.pdf
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/doc/include.am b/FreeRTOS-Plus/Source/CyaSSL/doc/include.am
new file mode 100644 (file)
index 0000000..fa44fcf
--- /dev/null
@@ -0,0 +1,5 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+doc_DATA+= doc/README.txt
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/client/client-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/client/client-ntru.vcproj
new file mode 100644 (file)
index 0000000..c891003
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="client"\r
+       ProjectGUID="{3ADE9549-582D-4D8E-9826-B172197A7959}"\r
+       RootNamespace="client"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\client.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.c b/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.c
new file mode 100644 (file)
index 0000000..9559810
--- /dev/null
@@ -0,0 +1,493 @@
+/* client.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ssl.h>
+#include <cyassl/test.h>
+
+/*
+#define TEST_RESUME 
+*/
+
+
+#ifdef CYASSL_CALLBACKS
+    int handShakeCB(HandShakeInfo*);
+    int timeoutCB(TimeoutInfo*);
+    Timeval timeout;
+#endif
+
+#if defined(NON_BLOCKING) || defined(CYASSL_CALLBACKS)
+    void NonBlockingSSL_Connect(CYASSL* ssl)
+    {
+#ifndef CYASSL_CALLBACKS
+        int ret = CyaSSL_connect(ssl);
+#else
+        int ret = CyaSSL_connect_ex(ssl, handShakeCB, timeoutCB, timeout);
+#endif
+        int error = CyaSSL_get_error(ssl, 0);
+        while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
+                                      error == SSL_ERROR_WANT_WRITE)) {
+            if (error == SSL_ERROR_WANT_READ)
+                printf("... client would read block\n");
+            else
+                printf("... client would write block\n");
+            #ifdef USE_WINDOWS_API 
+                Sleep(100);
+            #else
+                sleep(1);
+            #endif
+            #ifndef CYASSL_CALLBACKS
+                ret = CyaSSL_connect(ssl);
+            #else
+                ret = CyaSSL_connect_ex(ssl, handShakeCB, timeoutCB, timeout);
+            #endif
+            error = CyaSSL_get_error(ssl, 0);
+        }
+        if (ret != SSL_SUCCESS)
+            err_sys("SSL_connect failed");
+    }
+#endif
+
+
+static void Usage(void)
+{
+    printf("client "    LIBCYASSL_VERSION_STRING
+           " NOTE: All files relative to CyaSSL home dir\n");
+    printf("-?          Help, print this usage\n");
+    printf("-h <host>   Host to connect to, default %s\n", yasslIP);
+    printf("-p <num>    Port to connect on, default %d\n", yasslPort);
+    printf("-v <num>    SSL version [0-3], SSLv3(0) - TLS1.2(3)), default %d\n",
+                                 CLIENT_DEFAULT_VERSION);
+    printf("-l <str>    Cipher list\n");
+    printf("-c <file>   Certificate file,           default %s\n", cliCert);
+    printf("-k <file>   Key file,                   default %s\n", cliKey);
+    printf("-A <file>   Certificate Authority file, default %s\n", caCert);
+    printf("-b <num>    Benchmark <num> connections and print stats\n");
+    printf("-s          Use pre Shared keys\n");
+    printf("-d          Disable peer checks\n");
+    printf("-g          Send server HTTP GET\n");
+    printf("-u          Use UDP DTLS\n");
+    printf("-m          Match domain name in cert\n");
+}
+
+
+void client_test(void* args)
+{
+    SOCKET_T sockfd = 0;
+
+    CYASSL_METHOD*  method  = 0;
+    CYASSL_CTX*     ctx     = 0;
+    CYASSL*         ssl     = 0;
+    
+#ifdef TEST_RESUME
+    CYASSL*         sslResume = 0;
+    CYASSL_SESSION* session = 0;
+    char         resumeMsg[] = "resuming cyassl!";
+    int          resumeSz    = sizeof(resumeMsg);
+#endif
+
+    char msg[64] = "hello cyassl!";
+    char reply[1024];
+    int  input;
+    int  msgSz = strlen(msg);
+
+    int   port   = yasslPort;
+    char* host   = (char*)yasslIP;
+    char* domain = "www.yassl.com";
+
+    int    ch;
+    int    version = CLIENT_DEFAULT_VERSION;
+    int    usePsk   = 0;
+    int    sendGET  = 0;
+    int    benchmark = 0;
+    int    doDTLS    = 0;
+    int    matchName = 0;
+    int    doPeerCheck = 1;
+    char*  cipherList = NULL;
+    char*  verifyCert = (char*)caCert;
+    char*  ourCert    = (char*)cliCert;
+    char*  ourKey     = (char*)cliKey;
+
+    int     argc = ((func_args*)args)->argc;
+    char**  argv = ((func_args*)args)->argv;
+
+    ((func_args*)args)->return_code = -1; /* error state */
+
+    while ((ch = mygetopt(argc, argv, "?gdusmh:p:v:l:A:c:k:b:")) != -1) {
+        switch (ch) {
+            case '?' :
+                Usage();
+                exit(EXIT_SUCCESS);
+
+            case 'g' :
+                sendGET = 1;
+                break;
+
+            case 'd' :
+                doPeerCheck = 0;
+                break;
+
+            case 'u' :
+                doDTLS  = 1;
+                version = -1;  /* DTLS flag */
+                break;
+
+            case 's' :
+                usePsk = 1;
+                break;
+
+            case 'm' :
+                matchName = 1;
+                break;
+
+            case 'h' :
+                host   = myoptarg;
+                domain = myoptarg;
+                break;
+
+            case 'p' :
+                port = atoi(myoptarg);
+                break;
+
+            case 'v' :
+                version = atoi(myoptarg);
+                if (version < 0 || version > 3) {
+                    Usage();
+                    exit(MY_EX_USAGE);
+                }
+                if (doDTLS)
+                    version = -1;   /* DTLS flag */
+                break;
+
+            case 'l' :
+                cipherList = myoptarg;
+                break;
+
+            case 'A' :
+                verifyCert = myoptarg;
+                break;
+
+            case 'c' :
+                ourCert = myoptarg;
+                break;
+
+            case 'k' :
+                ourKey = myoptarg;
+                break;
+
+            case 'b' :
+                benchmark = atoi(myoptarg);
+                if (benchmark < 0 || benchmark > 1000000) {
+                    Usage();
+                    exit(MY_EX_USAGE);
+                }
+                break;
+
+            default:
+                Usage();
+                exit(MY_EX_USAGE);
+        }
+    }
+
+    argc -= myoptind;
+    argv += myoptind;
+    myoptind = 0;      /* reset for test cases */
+
+    switch (version) {
+        case 0:
+            method = CyaSSLv3_client_method();
+            break;
+
+        case 1:
+            method = CyaTLSv1_client_method();
+            break;
+
+        case 2:
+            method = CyaTLSv1_1_client_method();
+            break;
+
+        case 3:
+            method = CyaTLSv1_2_client_method();
+            break;
+
+#ifdef CYASSL_DTLS
+        case -1:
+            method = CyaDTLSv1_client_method();
+            break;
+#endif
+
+        default:
+            err_sys("Bad SSL version");
+    }
+
+    if (method == NULL)
+        err_sys("unable to get method");
+
+    ctx = CyaSSL_CTX_new(method);
+    if (ctx == NULL)
+        err_sys("unable to get ctx");
+
+    if (cipherList)
+        if (CyaSSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS)
+            err_sys("can't set cipher list");
+
+#ifndef NO_PSK
+    if (usePsk)
+        CyaSSL_CTX_set_psk_client_callback(ctx, my_psk_client_cb);
+#endif
+
+#ifdef OPENSSL_EXTRA
+    CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+
+#if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC)
+    /* don't use EDH, can't sniff tmp keys */
+    if (cipherList == NULL)
+        if (CyaSSL_CTX_set_cipher_list(ctx, "AES256-SHA") != SSL_SUCCESS)
+            err_sys("can't set cipher list");
+#endif
+
+#ifdef USER_CA_CB
+    CyaSSL_CTX_SetCACb(ctx, CaCb);
+#endif
+
+#ifdef VERIFY_CALLBACK
+    CyaSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myVerify);
+#endif
+
+    if (CyaSSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM)
+                                     != SSL_SUCCESS)
+        err_sys("can't load client cert file, check file and run from"
+                " CyaSSL home dir");
+
+    if (CyaSSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM)
+                                     != SSL_SUCCESS)
+        err_sys("can't load client cert file, check file and run from"
+                " CyaSSL home dir");    
+
+    if (CyaSSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS)
+            err_sys("can't load ca file, Please run from CyaSSL home dir");
+
+    if (doPeerCheck == 0)
+        CyaSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
+
+    if (benchmark) {
+        /* time passed in number of connects give average */
+        int times = benchmark;
+        int i = 0;
+
+        double start = current_time(), avg;
+
+        for (i = 0; i < times; i++) {
+            tcp_connect(&sockfd, host, port, doDTLS);
+            ssl = CyaSSL_new(ctx);
+            CyaSSL_set_fd(ssl, sockfd);
+            if (CyaSSL_connect(ssl) != SSL_SUCCESS)
+                err_sys("SSL_connect failed");
+
+            CyaSSL_shutdown(ssl);
+            CyaSSL_free(ssl);
+            CloseSocket(sockfd);
+        }
+        avg = current_time() - start;
+        avg /= times;
+        avg *= 1000;   /* milliseconds */
+        printf("CyaSSL_connect avg took: %8.3f milliseconds\n", avg);
+
+        CyaSSL_CTX_free(ctx);
+        ((func_args*)args)->return_code = 0;
+
+        exit(EXIT_SUCCESS);
+    }
+
+    tcp_connect(&sockfd, host, port, doDTLS);
+    ssl = CyaSSL_new(ctx);
+    if (ssl == NULL)
+        err_sys("unable to get SSL object");
+    CyaSSL_set_fd(ssl, sockfd);
+#ifdef HAVE_CRL
+    if (CyaSSL_EnableCRL(ssl, CYASSL_CRL_CHECKALL) != SSL_SUCCESS)
+        err_sys("can't enable crl check");
+    if (CyaSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, 0) != SSL_SUCCESS)
+        err_sys("can't load crl, check crlfile and date validity");
+    if (CyaSSL_SetCRL_Cb(ssl, CRL_CallBack) != SSL_SUCCESS)
+        err_sys("can't set crl callback");
+#endif
+    if (matchName && doPeerCheck)
+        CyaSSL_check_domain_name(ssl, domain);
+#ifdef NON_BLOCKING
+    tcp_set_nonblocking(&sockfd);
+    NonBlockingSSL_Connect(ssl);
+#else
+    #ifndef CYASSL_CALLBACKS
+        if (CyaSSL_connect(ssl) != SSL_SUCCESS) {/* see note at top of README */
+            int  err = CyaSSL_get_error(ssl, 0);
+            char buffer[80];
+            printf("err = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer));
+            err_sys("SSL_connect failed");/* if you're getting an error here  */
+        }
+    #else
+        timeout.tv_sec  = 2;
+        timeout.tv_usec = 0;
+        NonBlockingSSL_Connect(ssl);  /* will keep retrying on timeout */
+    #endif
+#endif
+    showPeer(ssl);
+    
+    if (sendGET) {
+        printf("SSL connect ok, sending GET...\n");
+        msgSz = 28;
+        strncpy(msg, "GET /index.html HTTP/1.0\r\n\r\n", msgSz);
+    }
+    if (CyaSSL_write(ssl, msg, msgSz) != msgSz)
+        err_sys("SSL_write failed");
+
+    input = CyaSSL_read(ssl, reply, sizeof(reply));
+    if (input > 0) {
+        reply[input] = 0;
+        printf("Server response: %s\n", reply);
+
+        if (sendGET) {  /* get html */
+            while (1) {
+                input = CyaSSL_read(ssl, reply, sizeof(reply));
+                if (input > 0) {
+                    reply[input] = 0;
+                    printf("%s\n", reply);
+                }
+                else
+                    break;
+            }
+        }
+    }
+  
+#ifdef TEST_RESUME
+    if (doDTLS) {
+        strncpy(msg, "break", 6);
+        msgSz = (int)strlen(msg);
+        /* try to send session close */
+        CyaSSL_write(ssl, msg, msgSz);
+    }
+    session   = CyaSSL_get_session(ssl);
+    sslResume = CyaSSL_new(ctx);
+#endif
+
+    CyaSSL_shutdown(ssl);
+    CyaSSL_free(ssl);
+    CloseSocket(sockfd);
+
+#ifdef TEST_RESUME
+    if (doDTLS) {
+        #ifdef USE_WINDOWS_API 
+            Sleep(500);
+        #else
+            sleep(1);
+        #endif
+    }
+    tcp_connect(&sockfd, host, port);
+    CyaSSL_set_fd(sslResume, sockfd);
+    CyaSSL_set_session(sslResume, session);
+   
+    showPeer(sslResume); 
+    if (CyaSSL_connect(sslResume) != SSL_SUCCESS) err_sys("SSL resume failed");
+
+#ifdef OPENSSL_EXTRA
+    if (CyaSSL_session_reused(sslResume))
+        printf("reused session id\n");
+    else
+        printf("didn't reuse session id!!!\n");
+#endif
+  
+    if (CyaSSL_write(sslResume, resumeMsg, resumeSz) != resumeSz)
+        err_sys("SSL_write failed");
+
+    input = CyaSSL_read(sslResume, reply, sizeof(reply));
+    if (input > 0) {
+        reply[input] = 0;
+        printf("Server resume response: %s\n", reply);
+    }
+
+    /* try to send session break */
+    CyaSSL_write(sslResume, msg, msgSz); 
+
+    CyaSSL_shutdown(sslResume);
+    CyaSSL_free(sslResume);
+#endif /* TEST_RESUME */
+
+    CyaSSL_CTX_free(ctx);
+    CloseSocket(sockfd);
+
+    ((func_args*)args)->return_code = 0;
+}
+
+
+/* so overall tests can pull in test function */
+#ifndef NO_MAIN_DRIVER
+
+    int main(int argc, char** argv)
+    {
+        func_args args;
+
+        StartTCP();
+
+        args.argc = argc;
+        args.argv = argv;
+
+        CyaSSL_Init();
+#ifdef DEBUG_CYASSL
+        CyaSSL_Debugging_ON();
+#endif
+        if (CurrentDir("client") || CurrentDir("build"))
+            ChangeDirBack(2);
+   
+        client_test(&args);
+        CyaSSL_Cleanup();
+
+        return args.return_code;
+    }
+
+    int myoptind = 0;
+    char* myoptarg = NULL;
+
+#endif /* NO_MAIN_DRIVER */
+
+
+
+#ifdef CYASSL_CALLBACKS
+
+    int handShakeCB(HandShakeInfo* info)
+    {
+
+        return 0;
+    }
+
+
+    int timeoutCB(TimeoutInfo* info)
+    {
+
+        return 0;
+    }
+
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.sln b/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.sln
new file mode 100644 (file)
index 0000000..3c4bbb1
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client.vcproj", "{F117DD21-2672-4001-9FF8-8DBEBBFCA380}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {F117DD21-2672-4001-9FF8-8DBEBBFCA380}.Debug|Win32.ActiveCfg = Debug|Win32
+               {F117DD21-2672-4001-9FF8-8DBEBBFCA380}.Debug|Win32.Build.0 = Debug|Win32
+               {F117DD21-2672-4001-9FF8-8DBEBBFCA380}.Release|Win32.ActiveCfg = Release|Win32
+               {F117DD21-2672-4001-9FF8-8DBEBBFCA380}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/client/client.vcproj
new file mode 100644 (file)
index 0000000..a743bca
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="client"\r
+       ProjectGUID="{3ADE9549-582D-4D8E-9826-B172197A7959}"\r
+       RootNamespace="client"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\client.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/client/include.am b/FreeRTOS-Plus/Source/CyaSSL/examples/client/include.am
new file mode 100644 (file)
index 0000000..0b900c2
--- /dev/null
@@ -0,0 +1,12 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+noinst_PROGRAMS += examples/client/client
+examples_client_client_SOURCES      = examples/client/client.c
+examples_client_client_LDADD        = src/libcyassl.la
+examples_client_client_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += examples/client/client.sln
+EXTRA_DIST += examples/client/client-ntru.vcproj
+EXTRA_DIST += examples/client/client.vcproj
+
+example_DATA+= examples/client/client.c
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient-ntru.vcproj
new file mode 100644 (file)
index 0000000..3fa0caf
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="echoclient"\r
+       ProjectGUID="{8362A816-C5DC-4E22-B5C5-9E6806387073}"\r
+       RootNamespace="echoclient"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\echoclient.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.c b/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.c
new file mode 100644 (file)
index 0000000..d93ca3f
--- /dev/null
@@ -0,0 +1,191 @@
+/* echoclient.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/test.h>
+
+
+void echoclient_test(void* args)
+{
+    SOCKET_T sockfd = 0;
+
+    FILE* fin  = stdin;
+    FILE* fout = stdout;
+
+    int inCreated  = 0;
+    int outCreated = 0;
+
+    char send[1024];
+    char reply[1024];
+
+    SSL_METHOD* method = 0;
+    SSL_CTX*    ctx    = 0;
+    SSL*        ssl    = 0;
+
+    int doDTLS = 0;
+    int sendSz;
+    int argc    = 0;
+    char** argv = 0;
+
+    ((func_args*)args)->return_code = -1; /* error state */
+    argc = ((func_args*)args)->argc;
+    argv = ((func_args*)args)->argv;
+
+    if (argc >= 2) {
+        fin  = fopen(argv[1], "r"); 
+        inCreated = 1;
+    }
+    if (argc >= 3) {
+        fout = fopen(argv[2], "w");
+        outCreated = 1;
+    }
+
+    if (!fin)  err_sys("can't open input file");
+    if (!fout) err_sys("can't open output file");
+
+#ifdef CYASSL_DTLS
+    doDTLS  = 1;
+#endif
+
+    tcp_connect(&sockfd, yasslIP, yasslPort, doDTLS);
+
+#if defined(CYASSL_DTLS)
+    method  = DTLSv1_client_method();
+#elif  !defined(NO_TLS)
+    method = CyaSSLv23_client_method();
+#else
+    method = SSLv3_client_method();
+#endif
+    ctx    = SSL_CTX_new(method);
+
+#ifndef NO_FILESYSTEM
+    if (SSL_CTX_load_verify_locations(ctx, caCert, 0) != SSL_SUCCESS)
+        err_sys("can't load ca file, Please run from CyaSSL home dir");
+    #ifdef HAVE_ECC
+        if (SSL_CTX_load_verify_locations(ctx, eccCert, 0) != SSL_SUCCESS)
+            err_sys("can't load ca file, Please run from CyaSSL home dir");
+    #endif
+#else
+    load_buffer(ctx, caCert, CYASSL_CA);
+#endif
+
+#if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC)
+    /* don't use EDH, can't sniff tmp keys */
+    SSL_CTX_set_cipher_list(ctx, "AES256-SHA");
+#endif
+
+#ifdef OPENSSL_EXTRA
+    SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+    ssl = SSL_new(ctx);
+
+    SSL_set_fd(ssl, sockfd);
+#if defined(USE_WINDOWS_API) && defined(CYASSL_DTLS) && defined(NO_MAIN_DRIVER)
+    /* let echoserver bind first, TODO: add Windows signal like pthreads does */
+    Sleep(100);
+#endif
+    if (SSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed");
+
+    while (fgets(send, sizeof(send), fin)) {
+
+        sendSz = (int)strlen(send);
+
+        if (SSL_write(ssl, send, sendSz) != sendSz)
+            err_sys("SSL_write failed");
+
+        if (strncmp(send, "quit", 4) == 0) {
+            fputs("sending server shutdown command: quit!\n", fout);
+            break;
+        }
+
+        if (strncmp(send, "break", 5) == 0) {
+            fputs("sending server session close: break!\n", fout);
+            break;
+        }
+
+        while (sendSz) {
+            int got;
+            if ( (got = SSL_read(ssl, reply, sizeof(reply))) > 0) {
+                reply[got] = 0;
+                fputs(reply, fout);
+                sendSz -= got;
+            }
+            else
+                break;
+        }
+    }
+
+#ifdef CYASSL_DTLS
+    strncpy(send, "break", 6);
+    sendSz = (int)strlen(send);
+    /* try to tell server done */
+    SSL_write(ssl, send, sendSz);
+#else
+    SSL_shutdown(ssl);
+#endif
+
+    SSL_free(ssl);
+    SSL_CTX_free(ctx);
+
+    fflush(fout);
+    if (inCreated)  fclose(fin);
+    if (outCreated) fclose(fout);
+
+    CloseSocket(sockfd);
+    ((func_args*)args)->return_code = 0; 
+}
+
+
+/* so overall tests can pull in test function */
+#ifndef NO_MAIN_DRIVER
+
+    int main(int argc, char** argv)
+    {
+        func_args args;
+
+        StartTCP();
+
+        args.argc = argc;
+        args.argv = argv;
+
+        CyaSSL_Init();
+#ifdef DEBUG_CYASSL
+        CyaSSL_Debugging_ON();
+#endif
+        if (CurrentDir("echoclient") || CurrentDir("build"))
+            ChangeDirBack(2);
+        echoclient_test(&args);
+        CyaSSL_Cleanup();
+
+        return args.return_code;
+    }
+
+    int myoptind = 0;
+    char* myoptarg = NULL;
+
+#endif /* NO_MAIN_DRIVER */
+
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.sln b/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.sln
new file mode 100644 (file)
index 0000000..3fb7851
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoclient", "echoclient.vcproj", "{A7AA93AD-AFF0-4FF0-8AED-14685DE55CF3}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {A7AA93AD-AFF0-4FF0-8AED-14685DE55CF3}.Debug|Win32.ActiveCfg = Debug|Win32
+               {A7AA93AD-AFF0-4FF0-8AED-14685DE55CF3}.Debug|Win32.Build.0 = Debug|Win32
+               {A7AA93AD-AFF0-4FF0-8AED-14685DE55CF3}.Release|Win32.ActiveCfg = Release|Win32
+               {A7AA93AD-AFF0-4FF0-8AED-14685DE55CF3}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/echoclient.vcproj
new file mode 100644 (file)
index 0000000..3a2a085
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="echoclient"\r
+       ProjectGUID="{8362A816-C5DC-4E22-B5C5-9E6806387073}"\r
+       RootNamespace="echoclient"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\echoclient.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/include.am b/FreeRTOS-Plus/Source/CyaSSL/examples/echoclient/include.am
new file mode 100644 (file)
index 0000000..8f09c24
--- /dev/null
@@ -0,0 +1,14 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+noinst_PROGRAMS += examples/echoclient/echoclient
+examples_echoclient_echoclient_SOURCES      = examples/echoclient/echoclient.c
+examples_echoclient_echoclient_LDADD        = src/libcyassl.la
+examples_echoclient_echoclient_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += examples/echoclient/echoclient.sln
+EXTRA_DIST += examples/echoclient/echoclient-ntru.vcproj
+EXTRA_DIST += examples/echoclient/echoclient.vcproj
+
+example_DATA+= examples/echoclient/echoclient.c
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver-ntru.vcproj
new file mode 100644 (file)
index 0000000..539b2e7
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="echoserver"\r
+       ProjectGUID="{07D97C48-E08F-4E34-9F67-3064039FF2CB}"\r
+       RootNamespace="echoserver"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="USE_ANY_ADDR"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="USE_ANY_ADDR"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\echoserver.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.c b/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.c
new file mode 100644 (file)
index 0000000..3bf51bc
--- /dev/null
@@ -0,0 +1,293 @@
+/* echoserver.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ssl.h>
+#include <cyassl/test.h>
+
+#ifndef NO_MAIN_DRIVER
+    #define ECHO_OUT
+#endif
+
+
+#ifdef SESSION_STATS
+    CYASSL_API void PrintSessionStats(void);
+#endif
+
+
+static void SignalReady(void* args)
+{
+#if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER)
+    /* signal ready to tcp_accept */
+    func_args* server_args = (func_args*)args;
+    tcp_ready* ready = server_args->signal;
+    pthread_mutex_lock(&ready->mutex);
+    ready->ready = 1;
+    pthread_cond_signal(&ready->cond);
+    pthread_mutex_unlock(&ready->mutex);
+#endif
+}
+
+
+THREAD_RETURN CYASSL_THREAD echoserver_test(void* args)
+{
+    SOCKET_T       sockfd = 0;
+    CYASSL_METHOD* method = 0;
+    CYASSL_CTX*    ctx    = 0;
+
+    int    doDTLS = 0;
+    int    outCreated = 0;
+    int    shutdown = 0;
+    int    useAnyAddr = 0;
+    int    argc = ((func_args*)args)->argc;
+    char** argv = ((func_args*)args)->argv;
+
+#ifdef ECHO_OUT
+    FILE* fout = stdout;
+    if (argc >= 2) {
+        fout = fopen(argv[1], "w");
+        outCreated = 1;
+    }
+    if (!fout) err_sys("can't open output file");
+#endif
+
+    ((func_args*)args)->return_code = -1; /* error state */
+
+#ifdef CYASSL_DTLS
+    doDTLS  = 1;
+#endif
+
+    tcp_listen(&sockfd, yasslPort, useAnyAddr, doDTLS);
+
+#if defined(CYASSL_DTLS)
+    method  = CyaDTLSv1_server_method();
+#elif  !defined(NO_TLS)
+    method = CyaSSLv23_server_method();
+#else
+    method = CyaSSLv3_server_method();
+#endif
+    ctx    = CyaSSL_CTX_new(method);
+    /* CyaSSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); */
+
+#ifdef OPENSSL_EXTRA
+    CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+
+#ifndef NO_FILESYSTEM
+    #ifdef HAVE_NTRU
+        /* ntru */
+        if (CyaSSL_CTX_use_certificate_file(ctx, ntruCert, SSL_FILETYPE_PEM)
+                != SSL_SUCCESS)
+            err_sys("can't load ntru cert file, "
+                    "Please run from CyaSSL home dir");
+
+        if (CyaSSL_CTX_use_NTRUPrivateKey_file(ctx, ntruKey)
+                != SSL_SUCCESS)
+            err_sys("can't load ntru key file, "
+                    "Please run from CyaSSL home dir");
+    #elif HAVE_ECC
+        /* ecc */
+        if (CyaSSL_CTX_use_certificate_file(ctx, eccCert, SSL_FILETYPE_PEM)
+                != SSL_SUCCESS)
+            err_sys("can't load server cert file, "
+                    "Please run from CyaSSL home dir");
+
+        if (CyaSSL_CTX_use_PrivateKey_file(ctx, eccKey, SSL_FILETYPE_PEM)
+                != SSL_SUCCESS)
+            err_sys("can't load server key file, "
+                    "Please run from CyaSSL home dir");
+    #else
+        /* normal */
+        if (CyaSSL_CTX_use_certificate_file(ctx, svrCert, SSL_FILETYPE_PEM)
+                != SSL_SUCCESS)
+            err_sys("can't load server cert file, "
+                    "Please run from CyaSSL home dir");
+
+        if (CyaSSL_CTX_use_PrivateKey_file(ctx, svrKey, SSL_FILETYPE_PEM)
+                != SSL_SUCCESS)
+            err_sys("can't load server key file, "
+                    "Please run from CyaSSL home dir");
+    #endif
+#else
+    load_buffer(ctx, svrCert, CYASSL_CERT);
+    load_buffer(ctx, svrKey,  CYASSL_KEY);
+#endif
+
+#if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC)
+    /* don't use EDH, can't sniff tmp keys */
+    CyaSSL_CTX_set_cipher_list(ctx, "AES256-SHA");
+#endif
+
+    SignalReady(args);
+
+    while (!shutdown) {
+        CYASSL* ssl = 0;
+        char    command[1024];
+        int     echoSz = 0;
+        int     clientfd;
+        int     firstRead = 1;
+        int     gotFirstG = 0;
+                
+#ifndef CYASSL_DTLS 
+        SOCKADDR_IN_T client;
+        socklen_t     client_len = sizeof(client);
+        clientfd = accept(sockfd, (struct sockaddr*)&client,
+                         (ACCEPT_THIRD_T)&client_len);
+#else
+        clientfd = udp_read_connect(sockfd);
+#endif
+        if (clientfd == -1) err_sys("tcp accept failed");
+
+        ssl = CyaSSL_new(ctx);
+        if (ssl == NULL) err_sys("SSL_new failed");
+        CyaSSL_set_fd(ssl, clientfd);
+        #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA)
+            CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM);
+        #else
+            SetDH(ssl);  /* will repick suites with DHE, higher than PSK */
+        #endif
+        if (CyaSSL_accept(ssl) != SSL_SUCCESS) {
+            printf("SSL_accept failed\n");
+            CyaSSL_free(ssl);
+            CloseSocket(clientfd);
+            continue;
+        }
+#if defined(PEER_INFO)
+        showPeer(ssl);
+#endif
+
+        while ( (echoSz = CyaSSL_read(ssl, command, sizeof(command))) > 0) {
+
+            if (firstRead == 1) {
+                firstRead = 0;  /* browser may send 1 byte 'G' to start */
+                if (echoSz == 1 && command[0] == 'G') {
+                    gotFirstG = 1;
+                    continue;
+                }
+            }
+            else if (gotFirstG == 1 && strncmp(command, "ET /", 4) == 0) {
+                strncpy(command, "GET", 4);
+                /* fall through to normal GET */
+            }
+           
+            if ( strncmp(command, "quit", 4) == 0) {
+                printf("client sent quit command: shutting down!\n");
+                shutdown = 1;
+                break;
+            }
+            if ( strncmp(command, "break", 5) == 0) {
+                printf("client sent break command: closing session!\n");
+                break;
+            }
+#ifdef SESSION_STATS
+            if ( strncmp(command, "printstats", 10) == 0) {
+                PrintSessionStats();
+                break;
+            }
+#endif
+            if ( strncmp(command, "GET", 3) == 0) {
+                char type[]   = "HTTP/1.0 200 ok\r\nContent-type:"
+                                " text/html\r\n\r\n";
+                char header[] = "<html><body BGCOLOR=\"#ffffff\">\n<pre>\n";
+                char body[]   = "greetings from CyaSSL\n";
+                char footer[] = "</body></html>\r\n\r\n";
+            
+                strncpy(command, type, sizeof(type));
+                echoSz = sizeof(type) - 1;
+
+                strncpy(&command[echoSz], header, sizeof(header));
+                echoSz += sizeof(header) - 1;
+                strncpy(&command[echoSz], body, sizeof(body));
+                echoSz += sizeof(body) - 1;
+                strncpy(&command[echoSz], footer, sizeof(footer));
+                echoSz += sizeof(footer);
+
+                if (CyaSSL_write(ssl, command, echoSz) != echoSz)
+                    err_sys("SSL_write failed");
+                break;
+            }
+            command[echoSz] = 0;
+
+            #ifdef ECHO_OUT
+                fputs(command, fout);
+            #endif
+
+            if (CyaSSL_write(ssl, command, echoSz) != echoSz)
+                err_sys("SSL_write failed");
+        }
+#ifndef CYASSL_DTLS
+        CyaSSL_shutdown(ssl);
+#endif
+        CyaSSL_free(ssl);
+        CloseSocket(clientfd);
+#ifdef CYASSL_DTLS
+        tcp_listen(&sockfd, yasslPort, useAnyAddr, doDTLS);
+        SignalReady(args);
+#endif
+    }
+
+    CloseSocket(sockfd);
+    CyaSSL_CTX_free(ctx);
+
+#ifdef ECHO_OUT
+    if (outCreated)
+        fclose(fout);
+#endif
+
+    ((func_args*)args)->return_code = 0;
+    return 0;
+}
+
+
+/* so overall tests can pull in test function */
+#ifndef NO_MAIN_DRIVER
+
+    int main(int argc, char** argv)
+    {
+        func_args args;
+
+        StartTCP();
+
+        args.argc = argc;
+        args.argv = argv;
+
+        CyaSSL_Init();
+#ifdef DEBUG_CYASSL
+        CyaSSL_Debugging_ON();
+#endif
+        if (CurrentDir("echoserver") || CurrentDir("build"))
+            ChangeDirBack(2);
+        echoserver_test(&args);
+        CyaSSL_Cleanup();
+
+        return args.return_code;
+    }
+
+    int myoptind = 0;
+    char* myoptarg = NULL;
+
+#endif /* NO_MAIN_DRIVER */
+
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.sln b/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.sln
new file mode 100644 (file)
index 0000000..6bda354
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "echoserver", "echoserver.vcproj", "{4F3F3EF1-BB95-466A-87B2-A91C059D0197}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {4F3F3EF1-BB95-466A-87B2-A91C059D0197}.Debug|Win32.ActiveCfg = Debug|Win32
+               {4F3F3EF1-BB95-466A-87B2-A91C059D0197}.Debug|Win32.Build.0 = Debug|Win32
+               {4F3F3EF1-BB95-466A-87B2-A91C059D0197}.Release|Win32.ActiveCfg = Release|Win32
+               {4F3F3EF1-BB95-466A-87B2-A91C059D0197}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/echoserver.vcproj
new file mode 100644 (file)
index 0000000..0fc396f
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="echoserver"\r
+       ProjectGUID="{07D97C48-E08F-4E34-9F67-3064039FF2CB}"\r
+       RootNamespace="echoserver"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="USE_ANY_ADDR;OPENSSL_EXTRA;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\echoserver.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/include.am b/FreeRTOS-Plus/Source/CyaSSL/examples/echoserver/include.am
new file mode 100644 (file)
index 0000000..c998c56
--- /dev/null
@@ -0,0 +1,14 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+noinst_PROGRAMS += examples/echoserver/echoserver
+examples_echoserver_echoserver_SOURCES      = examples/echoserver/echoserver.c
+examples_echoserver_echoserver_LDADD        = src/libcyassl.la
+examples_echoserver_echoserver_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += examples/echoserver/echoserver.sln
+EXTRA_DIST += examples/echoserver/echoserver-ntru.vcproj
+EXTRA_DIST += examples/echoserver/echoserver.vcproj
+
+example_DATA+= examples/echoserver/echoserver.c
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/server/include.am b/FreeRTOS-Plus/Source/CyaSSL/examples/server/include.am
new file mode 100644 (file)
index 0000000..fab37fd
--- /dev/null
@@ -0,0 +1,14 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+noinst_PROGRAMS += examples/server/server
+examples_server_server_SOURCES      = examples/server/server.c
+examples_server_server_LDADD        = src/libcyassl.la
+examples_server_server_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += examples/server/server.sln
+EXTRA_DIST += examples/server/server-ntru.vcproj
+EXTRA_DIST += examples/server/server.vcproj
+
+example_DATA+= examples/server/server.c
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/server/server-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/server/server-ntru.vcproj
new file mode 100644 (file)
index 0000000..c6e204b
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="server"\r
+       ProjectGUID="{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"\r
+       RootNamespace="server"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="..\..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\server.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.c b/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.c
new file mode 100644 (file)
index 0000000..a33a4ef
--- /dev/null
@@ -0,0 +1,376 @@
+/* server.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/test.h>
+
+
+#ifdef CYASSL_CALLBACKS
+    int srvHandShakeCB(HandShakeInfo*);
+    int srvTimeoutCB(TimeoutInfo*);
+    Timeval srvTo;
+#endif
+
+#if defined(NON_BLOCKING) || defined(CYASSL_CALLBACKS)
+    void NonBlockingSSL_Accept(SSL* ssl)
+    {
+    #ifndef CYASSL_CALLBACKS
+        int ret = SSL_accept(ssl);
+    #else
+        int ret = CyaSSL_accept_ex(ssl, srvHandShakeCB, srvTimeoutCB, srvTo);
+    #endif
+        int error = SSL_get_error(ssl, 0);
+        while (ret != SSL_SUCCESS && (error == SSL_ERROR_WANT_READ ||
+                                      error == SSL_ERROR_WANT_WRITE)) {
+            printf("... server would block\n");
+            #ifdef USE_WINDOWS_API 
+                Sleep(1000);
+            #else
+                sleep(1);
+            #endif
+            #ifndef CYASSL_CALLBACKS
+                ret = SSL_accept(ssl);
+            #else
+                ret = CyaSSL_accept_ex(ssl, srvHandShakeCB, srvTimeoutCB,srvTo);
+            #endif
+            error = SSL_get_error(ssl, 0);
+        }
+        if (ret != SSL_SUCCESS)
+            err_sys("SSL_accept failed");
+    }
+#endif
+
+
+static void Usage(void)
+{
+    printf("server "    LIBCYASSL_VERSION_STRING
+           " NOTE: All files relative to CyaSSL home dir\n");
+    printf("-?          Help, print this usage\n");
+    printf("-p <num>    Port to listen on, default %d\n", yasslPort);
+    printf("-v <num>    SSL version [0-3], SSLv3(0) - TLS1.2(3)), default %d\n",
+                                 SERVER_DEFAULT_VERSION);
+    printf("-l <str>    Cipher list\n");
+    printf("-c <file>   Certificate file,           default %s\n", svrCert);
+    printf("-k <file>   Key file,                   default %s\n", svrKey);
+    printf("-A <file>   Certificate Authority file, default %s\n", cliCert);
+    printf("-d          Disable client cert check\n");
+    printf("-b          Bind to any interface instead of localhost only\n");
+    printf("-s          Use pre Shared keys\n");
+    printf("-u          Use UDP DTLS\n");
+}
+
+
+THREAD_RETURN CYASSL_THREAD server_test(void* args)
+{
+    SOCKET_T sockfd   = 0;
+    int      clientfd = 0;
+
+    SSL_METHOD* method = 0;
+    SSL_CTX*    ctx    = 0;
+    SSL*        ssl    = 0;
+
+    char   msg[] = "I hear you fa shizzle!";
+    char   input[1024];
+    int    idx;
+    int    ch;
+    int    version = SERVER_DEFAULT_VERSION;
+    int    doCliCertCheck = 1;
+    int    useAnyAddr = 0;
+    int    port = yasslPort;
+    int    usePsk = 0;
+    int    doDTLS = 0;
+    int    useNtruKey = 0;
+    char*  cipherList = NULL;
+    char*  verifyCert = (char*)cliCert;
+    char*  ourCert    = (char*)svrCert;
+    char*  ourKey     = (char*)svrKey;
+    int    argc = ((func_args*)args)->argc;
+    char** argv = ((func_args*)args)->argv;
+
+    ((func_args*)args)->return_code = -1; /* error state */
+
+    while ((ch = mygetopt(argc, argv, "?dbsnup:v:l:A:c:k:")) != -1) {
+        switch (ch) {
+            case '?' :
+                Usage();
+                exit(EXIT_SUCCESS);
+
+            case 'd' :
+                doCliCertCheck = 0;
+                break;
+
+            case 'b' :
+                useAnyAddr = 1;
+                break;
+
+            case 's' :
+                usePsk = 1;
+                break;
+
+            case 'n' :
+                useNtruKey = 1;
+                break;
+
+            case 'u' :
+                doDTLS  = 1;
+                version = -1;  /* DTLS flag */
+                break;
+
+            case 'p' :
+                port = atoi(myoptarg);
+                break;
+
+            case 'v' :
+                version = atoi(myoptarg);
+                if (version < 0 || version > 3) {
+                    Usage();
+                    exit(MY_EX_USAGE);
+                }
+                if (doDTLS)
+                    version = -1;  /* stay with DTLS */
+                break;
+
+            case 'l' :
+                cipherList = myoptarg;
+                break;
+
+            case 'A' :
+                verifyCert = myoptarg;
+                break;
+
+            case 'c' :
+                ourCert = myoptarg;
+                break;
+
+            case 'k' :
+                ourKey = myoptarg;
+                break;
+
+            default:
+                Usage();
+                exit(MY_EX_USAGE);
+        }
+    }
+
+    argc -= myoptind;
+    argv += myoptind;
+    myoptind = 0;      /* reset for test cases */
+
+    switch (version) {
+        case 0:
+            method = SSLv3_server_method();
+            break;
+
+        case 1:
+            method = TLSv1_server_method();
+            break;
+
+        case 2:
+            method = TLSv1_1_server_method();
+            break;
+
+        case 3:
+            method = TLSv1_2_server_method();
+            break;
+
+#ifdef CYASSL_DTLS
+        case -1:
+            method = DTLSv1_server_method();
+            break;
+#endif
+
+        default:
+            err_sys("Bad SSL version");
+    }
+
+    if (method == NULL)
+        err_sys("unable to get method");
+
+    ctx = SSL_CTX_new(method);
+    if (ctx == NULL)
+        err_sys("unable to get ctx");
+
+    if (cipherList)
+        if (SSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS)
+            err_sys("can't set cipher list");
+
+    if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM)
+                                     != SSL_SUCCESS)
+        err_sys("can't load server cert file, check file and run from"
+                " CyaSSL home dir");
+
+
+#ifdef HAVE_NTRU
+    if (useNtruKey) {
+        if (CyaSSL_CTX_use_NTRUPrivateKey_file(ctx, ourKey)
+                                               != SSL_SUCCESS)
+            err_sys("can't load ntru key file, "
+                    "Please run from CyaSSL home dir");
+    }
+#endif
+
+    if (!useNtruKey) {
+        if (SSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM)
+                                         != SSL_SUCCESS)
+            err_sys("can't load server cert file, check file and run from"
+                " CyaSSL home dir");
+    }
+
+#ifndef NO_PSK
+    if (usePsk) {
+        SSL_CTX_set_psk_server_callback(ctx, my_psk_server_cb);
+        SSL_CTX_use_psk_identity_hint(ctx, "cyassl server");
+        if (cipherList == NULL)
+            if (SSL_CTX_set_cipher_list(ctx,"PSK-AES256-CBC-SHA") !=SSL_SUCCESS)
+                err_sys("can't set cipher list");
+    }
+#endif
+
+    /* if not using PSK, verify peer with certs */
+    if (doCliCertCheck && usePsk == 0) {
+        SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER |
+                                SSL_VERIFY_FAIL_IF_NO_PEER_CERT,0);
+        if (SSL_CTX_load_verify_locations(ctx, verifyCert, 0) != SSL_SUCCESS)
+            err_sys("can't load ca file, Please run from CyaSSL home dir");
+    }
+
+#ifdef OPENSSL_EXTRA
+    SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+
+#if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC)
+    /* don't use EDH, can't sniff tmp keys */
+    if (SSL_CTX_set_cipher_list(ctx, "AES256-SHA") != SSL_SUCCESS)
+        err_sys("can't set cipher list");
+#endif
+
+    ssl = SSL_new(ctx);
+    if (ssl == NULL)
+        err_sys("unable to get SSL");
+
+#ifdef HAVE_CRL
+    CyaSSL_EnableCRL(ssl, 0);
+    CyaSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, CYASSL_CRL_MONITOR |
+                                                     CYASSL_CRL_START_MON);
+    CyaSSL_SetCRL_Cb(ssl, CRL_CallBack);
+#endif
+    tcp_accept(&sockfd, &clientfd, (func_args*)args, port, useAnyAddr, doDTLS);
+    if (!doDTLS) 
+        CloseSocket(sockfd);
+
+    SSL_set_fd(ssl, clientfd);
+#ifdef NO_PSK
+    #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA)
+        CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM);
+    #else
+        SetDH(ssl);  /* will repick suites with DHE, higher priority than PSK */
+    #endif
+#endif
+
+#ifdef NON_BLOCKING
+    tcp_set_nonblocking(&clientfd);
+    NonBlockingSSL_Accept(ssl);
+#else
+    #ifndef CYASSL_CALLBACKS
+        if (SSL_accept(ssl) != SSL_SUCCESS) {
+            int err = SSL_get_error(ssl, 0);
+            char buffer[80];
+            printf("error = %d, %s\n", err, ERR_error_string(err, buffer));
+            err_sys("SSL_accept failed");
+        }
+    #else
+        NonBlockingSSL_Accept(ssl);
+    #endif
+#endif
+    showPeer(ssl);
+
+    idx = SSL_read(ssl, input, sizeof(input));
+    if (idx > 0) {
+        input[idx] = 0;
+        printf("Client message: %s\n", input);
+    }
+    
+    if (SSL_write(ssl, msg, sizeof(msg)) != sizeof(msg))
+        err_sys("SSL_write failed");
+
+    SSL_shutdown(ssl);
+    SSL_free(ssl);
+    SSL_CTX_free(ctx);
+    
+    CloseSocket(clientfd);
+    ((func_args*)args)->return_code = 0;
+    return 0;
+}
+
+
+/* so overall tests can pull in test function */
+#ifndef NO_MAIN_DRIVER
+
+    int main(int argc, char** argv)
+    {
+        func_args args;
+
+        StartTCP();
+
+        args.argc = argc;
+        args.argv = argv;
+
+        CyaSSL_Init();
+#ifdef DEBUG_CYASSL
+        CyaSSL_Debugging_ON();
+#endif
+        if (CurrentDir("server") || CurrentDir("build"))
+            ChangeDirBack(2);
+   
+        server_test(&args);
+        CyaSSL_Cleanup();
+
+        return args.return_code;
+    }
+
+    int myoptind = 0;
+    char* myoptarg = NULL;
+
+#endif /* NO_MAIN_DRIVER */
+
+
+#ifdef CYASSL_CALLBACKS
+
+    int srvHandShakeCB(HandShakeInfo* info)
+    {
+
+        return 0;
+    }
+
+
+    int srvTimeoutCB(TimeoutInfo* info)
+    {
+
+        return 0;
+    }
+
+#endif
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.sln b/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.sln
new file mode 100644 (file)
index 0000000..7c9de30
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "server.vcproj", "{13A60276-EFB2-4D3F-AFC3-D66E4C4CC27B}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {13A60276-EFB2-4D3F-AFC3-D66E4C4CC27B}.Debug|Win32.ActiveCfg = Debug|Win32
+               {13A60276-EFB2-4D3F-AFC3-D66E4C4CC27B}.Debug|Win32.Build.0 = Debug|Win32
+               {13A60276-EFB2-4D3F-AFC3-D66E4C4CC27B}.Release|Win32.ActiveCfg = Release|Win32
+               {13A60276-EFB2-4D3F-AFC3-D66E4C4CC27B}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.vcproj b/FreeRTOS-Plus/Source/CyaSSL/examples/server/server.vcproj
new file mode 100644 (file)
index 0000000..ebb1af4
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="server"\r
+       ProjectGUID="{E9FB0BA5-BA46-4A59-A953-39C18CD1DCB1}"\r
+       RootNamespace="server"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../../"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;OPENSSL_EXTRA;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\server.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/input b/FreeRTOS-Plus/Source/CyaSSL/input
new file mode 100644 (file)
index 0000000..06dbbf0
--- /dev/null
@@ -0,0 +1,87 @@
+/* echoclient.c  */\r
+\r
+#include "openssl/ssl.h"\r
+#include "../test.h"\r
+\r
+\r
+int main(int argc, char** argv)\r
+{\r
+    SOCKET_T sockfd = 0;\r
+\r
+    FILE* fin  = stdin;\r
+    FILE* fout = stdout;\r
+\r
+    int inCreated  = 0;\r
+    int outCreated = 0;\r
+\r
+    char send[1024];\r
+    char reply[1024];\r
+\r
+    SSL_METHOD* method = 0;\r
+    SSL_CTX*    ctx    = 0;\r
+    SSL*        ssl    = 0;\r
+\r
+#ifdef _WIN32\r
+    WSADATA wsd;\r
+    WSAStartup(0x0002, &wsd);\r
+#endif\r
+\r
+    if (argc >= 2) {\r
+        fin  = fopen(argv[1], "r"); \r
+        inCreated = 1;\r
+    }\r
+    if (argc >= 3) {\r
+        fout = fopen(argv[2], "w");\r
+        outCreated = 1;\r
+    }\r
+\r
+    if (!fin)  err_sys("can't open input file");\r
+    if (!fout) err_sys("can't open output file");\r
+\r
+    tcp_connect(&sockfd);\r
+\r
+    method = SSLv3_client_method();\r
+    ctx    = SSL_CTX_new(method);\r
+\r
+    if (SSL_CTX_load_verify_locations(ctx, caCert, 0) != SSL_SUCCESS)\r
+        err_sys("can't load ca file");\r
+\r
+    ssl = SSL_new(ctx);\r
+\r
+    SSL_set_fd(ssl, sockfd);\r
+    if (SSL_connect(ssl) != SSL_SUCCESS) err_sys("SSL_connect failed");\r
+\r
+    while (fgets(send, sizeof(send), fin)) {\r
+\r
+        int  sendSz = strlen(send) + 1;\r
+\r
+        if (SSL_write(ssl, send, sendSz) != sendSz)\r
+            err_sys("SSL_write failed");\r
+\r
+        if (strncmp(send, "quit", 4) == 0) {\r
+            fputs("sending server shutdown command: quit!\n", fout);\r
+            break;\r
+        }\r
+\r
+        if (SSL_read(ssl, reply, sizeof(reply)) > 0) \r
+            fputs(reply, fout);\r
+    }\r
+\r
+    SSL_shutdown(ssl);\r
+    SSL_free(ssl);\r
+    SSL_CTX_free(ctx);\r
+\r
+    fflush(fout);\r
+    if (inCreated)  fclose(fin);\r
+    if (outCreated) fclose(fout);\r
+\r
+#ifdef _WIN32\r
+    closesocket(sockfd);\r
+#else\r
+    close(sockfd);\r
+#endif\r
+\r
+    return 0;\r
+}\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/lib/dummy b/FreeRTOS-Plus/Source/CyaSSL/lib/dummy
new file mode 100644 (file)
index 0000000..13c3b18
--- /dev/null
@@ -0,0 +1,2 @@
+// this is a dummy file
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/ax_pthread.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/ax_pthread.m4
new file mode 100644 (file)
index 0000000..a6bf596
--- /dev/null
@@ -0,0 +1,302 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also link it with them as well. e.g. you should link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threads programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+#   PTHREAD_CFLAGS.
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+#   Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 16
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+        *-darwin*)
+        ax_pthread_flags="-pthread $ax_pthread_flags"
+        ;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                pthread-config)
+                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+                if test x"$ax_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }],
+                       [pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */])],
+                [ax_pthread_ok=yes],
+                [])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        AC_MSG_CHECKING([for joinable pthread attribute])
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+                           [int attr = $attr; return attr /* ; */])],
+                [attr_name=$attr; break],
+                [])
+        done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+            ax_cv_PTHREAD_PRIO_INHERIT, [
+                AC_LINK_IFELSE([
+                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+                    [ax_cv_PTHREAD_PRIO_INHERIT=no])
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
+            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+        if test x"$GCC" != xyes; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+        fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/hexversion.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/hexversion.m4
new file mode 100644 (file)
index 0000000..8d26155
--- /dev/null
@@ -0,0 +1,6 @@
+AC_DEFUN([CREATE_HEX_VERSION],[
+
+  HEX_VERSION=`echo $VERSION | sed 's|[\-a-z0-9]*$||' | \
+    awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'`
+  AC_SUBST([HEX_VERSION])
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/lib_socket_nsl.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/lib_socket_nsl.m4
new file mode 100644 (file)
index 0000000..e786e61
--- /dev/null
@@ -0,0 +1,25 @@
+dnl @synopsis LIB_SOCKET_NSL
+dnl
+dnl This macro figures out what libraries are required on this platform
+dnl to link sockets programs.
+dnl
+dnl The common cases are not to need any extra libraries, or to need
+dnl -lsocket and -lnsl. We need to avoid linking with libnsl unless we
+dnl need it, though, since on some OSes where it isn't necessary it
+dnl will totally break networking. Unisys also includes gethostbyname()
+dnl in libsocket but needs libnsl for socket().
+dnl
+dnl @category Misc
+dnl @author Russ Allbery <rra@stanford.edu>
+dnl @author Stepan Kasal <kasal@ucw.cz>
+dnl @author Warren Young <warren@etr-usa.com>
+dnl @version 2005-09-06
+dnl @license AllPermissive
+
+AC_DEFUN([LIB_SOCKET_NSL],
+[
+       AC_SEARCH_LIBS([gethostbyname], [nsl])
+       AC_SEARCH_LIBS([socket], [socket], [], [
+               AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
+               [], [-lnsl])])
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/libtool.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/libtool.m4
new file mode 100644 (file)
index 0000000..dfd4817
--- /dev/null
@@ -0,0 +1,7437 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+                  [m4_fatal([Libtool version $1 or higher is required],
+                            63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+       [m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+       [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+          m4_quote(lt_decl_varnames),
+       m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+                                          [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+       dnl If the libtool generation code has been placed in $CONFIG_LT,
+       dnl instead of duplicating it all over again into config.status,
+       dnl then we will have config.status run $CONFIG_LT later, so it
+       dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM -f \"$cfgfile\"; exit 1" 1 2 15
+    $RM -f "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],                 [_LT_LANG(C)],
+  [C++],               [_LT_LANG(CXX)],
+  [Java],              [_LT_LANG(GCJ)],
+  [Fortran 77],                [_LT_LANG(F77)],
+  [Fortran],           [_LT_LANG(FC)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+       [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+         lt_cv_apple_cc_single_mod=yes
+       else
+         cat conftest.err >&AS_MESSAGE_LOG_FD
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+       [lt_cv_ld_exported_symbols_list=yes],
+       [lt_cv_ld_exported_symbols_list=no])
+       LDFLAGS="$save_LDFLAGS"
+    ])
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+       lt_cv_ld_force_load=yes
+      else
+       cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[[012]]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*|powerpc64-*linux*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+       if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+         LD="${LD-ld} -64"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+        [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+        [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+        [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM -r conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM -r conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+       [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM -r conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+       [], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+        [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -r -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+       [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -r -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_save_LIBS="$LIBS"
+         lt_save_CFLAGS="$CFLAGS"
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+             _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+             _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd*)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ F* | *Sun*Fortran*)
+         # Sun Fortran 8.3 passes all unrecognized flags to the linker
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+         ;;
+       *Sun\ C*)
+         # Sun C 5.9
+         _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+         _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+       [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+       [Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+       [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         _LT_TAGVAR(whole_archive_flag_spec, $1)=
+         tmp_sharedflag='--shared' ;;
+       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       xlf* | bgf* | bgxlf* | mpixlf*)
+         # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+         _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+         _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+         if test "x$supports_anon_versioning" = xyes; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         _LT_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
+         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_TAGVAR(hardcode_direct, $1)=no
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       else
+         case $host_os in
+          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+            ;;
+          *)
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+       [$RM -r conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+         _LT_TAGVAR(allow_undefined_flag, $1)=
+         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+         then
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+         else
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         fi
+         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM -r conftest*
+       ])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           _LT_TAGVAR(hardcode_direct, $1)=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           _LT_TAGVAR(hardcode_minus_L, $1)=yes
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+          esac
+          shared_flag='-shared'
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag="$shared_flag "'${wl}-G'
+         fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test "$aix_use_runtimelinking" = yes; then
+             shared_flag='${wl}-G'
+           else
+             shared_flag='${wl}-bM:SRE'
+           fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           _LT_SYS_MODULE_PATH_AIX
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+           # This is similar to how AIX traditionally builds its shared
+           # libraries.
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         _LT_TAGVAR(ld_shlibs, $1)=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           cp $export_symbols $output_objdir/$soname.def;
+          else
+           echo EXPORTS > $output_objdir/$soname.def;
+           cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test $with_gnu_ld = no; then
+               case $host_cpu in
+                 hppa*64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test "$with_gnu_ld" = no; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+             else
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+             fi
+           fi
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+           ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+               $RANLIB $oldlib'
+             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           if test "x$supports_anon_versioning" = xyes; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+               echo "local: *; };" >> $output_objdir/$libname.ver~
+               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+       ;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      openbsd*)
+       if test -f /usr/libexec/ld.so; then
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+               ;;
+             *)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                 echo "-hidden">> $lib.exp~
+                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+                 $RM $lib.exp'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+               ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+             case $host in
+               osf3*)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+               *)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+             esac
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+           case $host_os in
+             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands `-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require `-G' NOT `-shared' on this
+               # platform.
+               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+             case $host_os in
+               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+               *)
+                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We can NOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+       _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+             '"$_LT_TAGVAR(old_archive_cmds, $1)"
+           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+             '"$_LT_TAGVAR(reload_cmds, $1)"
+           ;;
+         *)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+          _LT_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+          _LT_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/ltoptions.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/ltoptions.m4
new file mode 100644 (file)
index 0000000..17cfd51
--- /dev/null
@@ -0,0 +1,369 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+                     [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+                  [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+       [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+       [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+        [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+                [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+                [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+                [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+                [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/ltsugar.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/ltsugar.m4
new file mode 100644 (file)
index 0000000..9000a05
--- /dev/null
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+            [m4_foreach([_Lt_suffix],
+               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+                [lt_append([$1], [$2], [$3])$4],
+                [$5])],
+         [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+       [$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/ltversion.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/ltversion.m4
new file mode 100644 (file)
index 0000000..93fc771
--- /dev/null
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers                      -*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3175 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.10])
+m4_define([LT_PACKAGE_REVISION], [1.3175])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.10'
+macro_revision='1.3175'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/lt~obsolete.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/lt~obsolete.m4
new file mode 100644 (file)
index 0000000..c573da9
--- /dev/null
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/m4/visibility.m4 b/FreeRTOS-Plus/Source/CyaSSL/m4/visibility.m4
new file mode 100644 (file)
index 0000000..077c476
--- /dev/null
@@ -0,0 +1,74 @@
+# visibility.m4 serial 3 (gettext-0.18)
+dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    dnl First, check whether -Werror can be added to the command line, or
+    dnl whether it leads to an error because of some other option that the
+    dnl user has put into $CC $CFLAGS $CPPFLAGS.
+    AC_MSG_CHECKING([whether the -Werror option is usable])
+    AC_CACHE_VAL([gl_cv_cc_vis_werror], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Werror"
+      AC_TRY_COMPILE([], [],
+        [gl_cv_cc_vis_werror=yes],
+        [gl_cv_cc_vis_werror=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+    dnl Now check whether visibility declarations are supported.
+    AC_MSG_CHECKING([for simple visibility declarations])
+    AC_CACHE_VAL([gl_cv_cc_visibility], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      dnl We use the option -Werror and a function dummyfunc, because on some
+      dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+      dnl "visibility attribute not supported in this configuration; ignored"
+      dnl at the first function definition in every compilation unit, and we
+      dnl don't want to use the option in this case.
+      if test $gl_cv_cc_vis_werror = yes; then
+        CFLAGS="$CFLAGS -Werror"
+      fi
+      AC_TRY_COMPILE(
+        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+         void dummyfunc (void) {}],
+        [],
+        [gl_cv_cc_visibility=yes],
+        [gl_cv_cc_visibility=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_visibility])
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+  AC_SUBST([CFLAG_VISIBILITY])
+  AC_SUBST([HAVE_VISIBILITY])
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/FreeRTOS-Plus/Source/CyaSSL/quit b/FreeRTOS-Plus/Source/CyaSSL/quit
new file mode 100644 (file)
index 0000000..3db49b3
--- /dev/null
@@ -0,0 +1,2 @@
+quit
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/crl.c b/FreeRTOS-Plus/Source/CyaSSL/src/crl.c
new file mode 100644 (file)
index 0000000..40759a4
--- /dev/null
@@ -0,0 +1,576 @@
+/* crl.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+
+#ifdef HAVE_CRL
+
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+
+#include <dirent.h>
+#include <string.h>
+
+
+/* Initialze CRL members */
+int InitCRL(CYASSL_CRL* crl, CYASSL_CERT_MANAGER* cm)
+{
+    CYASSL_ENTER("InitCRL");
+
+    crl->cm = cm;
+    crl->crlList = NULL;
+    crl->monitors[0].path = NULL;
+    crl->monitors[1].path = NULL;
+#ifdef HAVE_CRL_MONITOR
+    crl->tid = 0;
+#endif
+    if (InitMutex(&crl->crlLock) != 0)
+        return BAD_MUTEX_ERROR; 
+
+    return 0;
+}
+
+
+/* Initialze CRL Entry */
+static int InitCRL_Entry(CRL_Entry* crle, DecodedCRL* dcrl)
+{
+    CYASSL_ENTER("InitCRL_Entry");
+
+    XMEMCPY(crle->issuerHash, dcrl->issuerHash, SHA_DIGEST_SIZE);
+    XMEMCPY(crle->crlHash, dcrl->crlHash, MD5_DIGEST_SIZE);
+    XMEMCPY(crle->lastDate, dcrl->lastDate, MAX_DATE_SIZE);
+    XMEMCPY(crle->nextDate, dcrl->nextDate, MAX_DATE_SIZE);
+    crle->lastDateFormat = dcrl->lastDateFormat;
+    crle->nextDateFormat = dcrl->nextDateFormat;
+
+    crle->certs = dcrl->certs;   /* take ownsership */
+    dcrl->certs = NULL;
+    crle->totalCerts = dcrl->totalCerts;
+
+    return 0;
+}
+
+
+/* Free all CRL Entry resources */
+static void FreeCRL_Entry(CRL_Entry* crle)
+{
+    RevokedCert* tmp = crle->certs; 
+
+    CYASSL_ENTER("FreeCRL_Entry");
+
+    while(tmp) {
+        RevokedCert* next = tmp->next;
+        XFREE(tmp, NULL, DYNAMIC_TYPE_REVOKED);
+        tmp = next;
+    }
+}
+
+
+
+/* Free all CRL resources */
+void FreeCRL(CYASSL_CRL* crl)
+{
+    CRL_Entry* tmp = crl->crlList;
+
+    CYASSL_ENTER("FreeCRL");
+
+    if (crl->monitors[0].path)
+        XFREE(crl->monitors[0].path, NULL, DYNAMIC_TYPE_CRL_MONITOR);
+
+    if (crl->monitors[1].path)
+        XFREE(crl->monitors[1].path, NULL, DYNAMIC_TYPE_CRL_MONITOR);
+
+    while(tmp) {
+        CRL_Entry* next = tmp->next;
+        FreeCRL_Entry(tmp);
+        XFREE(tmp, NULL, DYNAMIC_TYPE_CRL_ENTRY);
+        tmp = next;
+    }  
+
+#ifdef HAVE_CRL_MONITOR
+    if (crl->tid != 0) {
+        CYASSL_MSG("Canceling monitor thread");
+        pthread_cancel(crl->tid);
+    }
+#endif
+    FreeMutex(&crl->crlLock);
+}
+
+
+/* Is the cert ok with CRL, return 0 on success */
+int CheckCertCRL(CYASSL_CRL* crl, DecodedCert* cert)
+{
+    CRL_Entry* crle;
+    int        foundEntry = 0;
+    int        revoked = 0;
+    int        ret = 0;
+
+    CYASSL_ENTER("CheckCertCRL");
+
+    if (LockMutex(&crl->crlLock) != 0) {
+        CYASSL_MSG("LockMutex failed");
+        return BAD_MUTEX_ERROR;
+    }
+
+    crle = crl->crlList;
+
+    while (crle) {
+        if (XMEMCMP(crle->issuerHash, cert->issuerHash, SHA_DIGEST_SIZE) == 0) {
+            CYASSL_MSG("Found CRL Entry on list");
+            CYASSL_MSG("Checking next date validity");
+
+            if (!ValidateDate(crle->nextDate, crle->nextDateFormat, AFTER)) {
+                CYASSL_MSG("CRL next date is no longer valid");
+                ret = ASN_AFTER_DATE_E;
+            }
+            else
+                foundEntry = 1;
+            break;
+        }
+        crle = crle->next;
+    }
+
+    if (foundEntry) {
+        RevokedCert* rc = crle->certs;
+
+        while (rc) {
+            if (XMEMCMP(rc->serialNumber, cert->serial, rc->serialSz) == 0) {
+                CYASSL_MSG("Cert revoked");
+                revoked = 1;
+                ret = CRL_CERT_REVOKED;
+                break;
+            }
+            rc = rc->next;     
+        }
+    }
+
+    UnLockMutex(&crl->crlLock);
+
+    if (foundEntry == 0) {
+        CYASSL_MSG("Couldn't find CRL for status check");
+        ret = CRL_MISSING;
+        if (crl->cm->cbMissingCRL) {
+            char url[256];
+
+            CYASSL_MSG("Issuing missing CRL callback");
+            url[0] = '\0';
+            if (cert->extCrlInfoSz < (int)sizeof(url) -1 ) {
+                XMEMCPY(url, cert->extCrlInfo, cert->extCrlInfoSz);
+                url[cert->extCrlInfoSz] = '\0';
+            }
+            else  {
+                CYASSL_MSG("CRL url too long");
+            }
+            crl->cm->cbMissingCRL(url);
+        }
+    }
+
+
+    return ret;        
+}
+
+
+/* Add Decoded CRL, 0 on success */
+static int AddCRL(CYASSL_CRL* crl, DecodedCRL* dcrl)
+{
+    CRL_Entry* crle;
+
+    CYASSL_ENTER("AddCRL");
+
+    crle = (CRL_Entry*)XMALLOC(sizeof(CRL_Entry), NULL, DYNAMIC_TYPE_CRL_ENTRY);
+    if (crle == NULL) {
+        CYASSL_MSG("alloc CRL Entry failed");
+        return -1;
+    }
+
+    if (InitCRL_Entry(crle, dcrl) < 0) {
+        CYASSL_MSG("Init CRL Entry failed");
+        XFREE(crle, NULL, DYNAMIC_TYPE_CRL_ENTRY);
+        return -1;
+    }
+
+    if (LockMutex(&crl->crlLock) != 0) {
+        CYASSL_MSG("LockMutex failed");
+        FreeCRL_Entry(crle);
+        XFREE(crle, NULL, DYNAMIC_TYPE_CRL_ENTRY);
+        return BAD_MUTEX_ERROR;
+    }
+    crle->next = crl->crlList;
+    crl->crlList = crle;
+    UnLockMutex(&crl->crlLock);
+
+    return 0;
+}
+
+
+/* Load CRL File of type, SSL_SUCCESS on ok */
+int BufferLoadCRL(CYASSL_CRL* crl, const byte* buff, long sz, int type)
+{
+    int          ret = SSL_SUCCESS;
+    const byte*  myBuffer = buff;    /* if DER ok, otherwise switch */
+    buffer       der;
+    DecodedCRL   dcrl;
+
+    der.buffer = NULL;
+
+    CYASSL_ENTER("BufferLoadCRL");
+
+    if (crl == NULL || buff == NULL || sz == 0)
+        return BAD_FUNC_ARG;
+
+    if (type == SSL_FILETYPE_PEM) {
+        int eccKey = 0;   /* not used */
+        EncryptedInfo info;
+        info.ctx = NULL;
+
+        ret = PemToDer(buff, sz, CRL_TYPE, &der, NULL, &info, &eccKey);
+        if (ret == 0) {
+            myBuffer = der.buffer;
+            sz = der.length;
+        }
+        else {
+            CYASSL_MSG("Pem to Der failed");
+            return -1;
+        }
+    }
+
+    InitDecodedCRL(&dcrl);
+    ret = ParseCRL(&dcrl, myBuffer, sz, crl->cm);
+    if (ret != 0) {
+        CYASSL_MSG("ParseCRL error");
+    }
+    else {
+        ret = AddCRL(crl, &dcrl);
+        if (ret != 0) {
+            CYASSL_MSG("AddCRL error");
+        }
+    }
+    FreeDecodedCRL(&dcrl);
+
+    if (der.buffer)
+        XFREE(der.buffer, NULL, DYNAMIC_TYPE_CRL);
+
+    if (ret == 0)
+        return SSL_SUCCESS;  /* convert */
+    return ret;
+}
+
+
+#ifdef HAVE_CRL_MONITOR
+
+
+/* read in new CRL entries and save new list */
+static int SwapLists(CYASSL_CRL* crl)
+{
+    int        ret;
+    CYASSL_CRL tmp;
+    CRL_Entry* newList;
+
+    if (InitCRL(&tmp, crl->cm) < 0) {
+        CYASSL_MSG("Init tmp CRL failed");
+        return -1;
+    }
+
+    if (crl->monitors[0].path) {
+        ret = LoadCRL(&tmp, crl->monitors[0].path, SSL_FILETYPE_PEM, 0);
+        if (ret != SSL_SUCCESS) {
+            CYASSL_MSG("PEM LoadCRL on dir change failed");
+            FreeCRL(&tmp);
+            return -1;
+        }
+    }
+
+    if (crl->monitors[1].path) {
+        ret = LoadCRL(&tmp, crl->monitors[1].path, SSL_FILETYPE_ASN1, 0);
+        if (ret != SSL_SUCCESS) {
+            CYASSL_MSG("DER LoadCRL on dir change failed");
+            FreeCRL(&tmp);
+            return -1;
+        }
+    }
+
+    if (LockMutex(&crl->crlLock) != 0) {
+        CYASSL_MSG("LockMutex failed");
+        FreeCRL(&tmp);
+        return -1;
+    }
+
+    newList = tmp.crlList;
+
+    /* swap lists */
+    tmp.crlList  = crl->crlList;
+    crl->crlList = newList;
+
+    UnLockMutex(&crl->crlLock);
+
+    FreeCRL(&tmp);
+
+    return 0;
+}
+
+
+#ifdef __MACH__
+
+#include <sys/event.h>
+#include <sys/time.h>
+#include <fcntl.h>
+
+/* OS X  monitoring */
+static void* DoMonitor(void* arg)
+{
+    int fPEM, fDER, kq;
+    struct kevent change;
+
+    CYASSL_CRL* crl = (CYASSL_CRL*)arg;
+
+    CYASSL_ENTER("DoMonitor");
+
+    kq = kqueue();
+    if (kq == -1) {
+        CYASSL_MSG("kqueue failed");
+        return NULL;
+    }
+
+    fPEM = -1;
+    fDER = -1;
+
+    if (crl->monitors[0].path) {
+        fPEM = open(crl->monitors[0].path, O_EVTONLY);
+        if (fPEM == -1) {
+            CYASSL_MSG("PEM event dir open failed");
+            return NULL;
+        }
+    }
+
+    if (crl->monitors[1].path) {
+        fDER = open(crl->monitors[1].path, O_EVTONLY);
+        if (fDER == -1) {
+            CYASSL_MSG("DER event dir open failed");
+            return NULL;
+        }
+    }
+
+    if (fPEM != -1)
+        EV_SET(&change, fPEM, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_ONESHOT,
+                NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB, 0, 0);
+
+    if (fDER != -1)
+        EV_SET(&change, fDER, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_ONESHOT,
+                NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB, 0, 0);
+
+    for (;;) {
+        struct kevent event;
+        int           numEvents = kevent(kq, &change, 1, &event, 1, NULL);
+       
+        CYASSL_MSG("Got kevent");
+
+        if (numEvents == -1) {
+            CYASSL_MSG("kevent problem, continue");
+            continue;
+        }
+
+        if (SwapLists(crl) < 0) {
+            CYASSL_MSG("SwapLists problem, continue");
+        }
+    }
+
+    return NULL;
+}
+
+
+#elif __linux__
+
+#include <sys/types.h>
+#include <sys/inotify.h>
+#include <unistd.h>
+
+/* linux monitoring */
+static void* DoMonitor(void* arg)
+{
+    int         notifyFd;
+    int         wd;
+    CYASSL_CRL* crl = (CYASSL_CRL*)arg;
+
+    CYASSL_ENTER("DoMonitor");
+
+    notifyFd = inotify_init();
+    if (notifyFd < 0) {
+        CYASSL_MSG("inotify failed");
+        return NULL;
+    }
+
+    if (crl->monitors[0].path) {
+        wd = inotify_add_watch(notifyFd, crl->monitors[0].path, IN_CLOSE_WRITE |
+                                                                IN_DELETE);
+        if (wd < 0) {
+            CYASSL_MSG("PEM notify add watch failed");
+            return NULL;
+        }
+    }
+
+    if (crl->monitors[1].path) {
+        wd = inotify_add_watch(notifyFd, crl->monitors[1].path, IN_CLOSE_WRITE |
+                                                                IN_DELETE);
+        if (wd < 0) {
+            CYASSL_MSG("DER notify add watch failed");
+            return NULL;
+        }
+    }
+
+    for (;;) {
+        char          buffer[8192];
+        int           length = read(notifyFd, buffer, sizeof(buffer));
+       
+        CYASSL_MSG("Got notify event");
+
+        if (length < 0) {
+            CYASSL_MSG("notify read problem, continue");
+            continue;
+        } 
+
+        if (SwapLists(crl) < 0) {
+            CYASSL_MSG("SwapLists problem, continue");
+        }
+    }
+
+    return NULL;
+}
+
+
+
+#endif /* MACH or linux */
+
+
+/* Start Monitoring the CRL path(s) in a thread */
+static int StartMonitorCRL(CYASSL_CRL* crl)
+{
+    pthread_attr_t attr;
+
+    CYASSL_ENTER("StartMonitorCRL");
+
+    if (crl == NULL) 
+        return BAD_FUNC_ARG;
+
+    if (crl->tid != 0) {
+        CYASSL_MSG("Monitor thread already running");
+        return MONITOR_RUNNING_E;
+    }
+
+    pthread_attr_init(&attr);
+
+    if (pthread_create(&crl->tid, &attr, DoMonitor, crl) != 0) {
+        CYASSL_MSG("Thread creation error");
+        return THREAD_CREATE_E;
+    }
+
+    return SSL_SUCCESS;
+}
+
+
+#else /* HAVE_CRL_MONITOR */
+
+static int StartMonitorCRL(CYASSL_CRL* crl)
+{
+    CYASSL_ENTER("StartMonitorCRL");
+    CYASSL_MSG("Not compiled in");
+
+    return NOT_COMPILED_IN;
+}
+
+#endif  /* HAVE_CRL_MONITOR */
+
+
+/* Load CRL path files of type, SSL_SUCCESS on ok */ 
+int LoadCRL(CYASSL_CRL* crl, const char* path, int type, int monitor)
+{
+    struct dirent* entry;
+    DIR*   dir;
+    int    ret = SSL_SUCCESS;
+
+    CYASSL_ENTER("LoadCRL");
+    if (crl == NULL)
+        return BAD_FUNC_ARG;
+
+    dir = opendir(path);
+    if (dir == NULL) {
+        CYASSL_MSG("opendir path crl load failed");
+        return BAD_PATH_ERROR;
+    }
+    while ( (entry = readdir(dir)) != NULL) {
+        if (entry->d_type & DT_REG) {
+            char name[MAX_FILENAME_SZ];
+
+            if (type == SSL_FILETYPE_PEM) {
+                if (strstr(entry->d_name, ".pem") == NULL) {
+                    CYASSL_MSG("not .pem file, skipping");
+                    continue;
+                }
+            }
+            else {
+                if (strstr(entry->d_name, ".der") == NULL &&
+                    strstr(entry->d_name, ".crl") == NULL) {
+
+                    CYASSL_MSG("not .der or .crl file, skipping");
+                    continue;
+                }
+            }
+
+            XMEMSET(name, 0, sizeof(name));
+            XSTRNCPY(name, path, MAX_FILENAME_SZ/2 - 2);
+            XSTRNCAT(name, "/", 1);
+            XSTRNCAT(name, entry->d_name, MAX_FILENAME_SZ/2);
+
+            if (ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl)
+                                                               != SSL_SUCCESS) {
+                CYASSL_MSG("CRL file load failed, continuing");
+            }
+        }
+    }
+
+    if (monitor & CYASSL_CRL_MONITOR) {
+        CYASSL_MSG("monitor path requested");
+
+        if (type == SSL_FILETYPE_PEM) {
+            crl->monitors[0].path = strdup(path);
+            crl->monitors[0].type = SSL_FILETYPE_PEM;
+            if (crl->monitors[0].path == NULL)
+                ret = MEMORY_E;
+        } else {
+            crl->monitors[1].path = strdup(path);
+            crl->monitors[1].type = SSL_FILETYPE_ASN1;
+            if (crl->monitors[1].path == NULL)
+                ret = MEMORY_E;
+        }
+      
+        if (monitor & CYASSL_CRL_START_MON) {
+            CYASSL_MSG("start monitoring requested");
+    
+            ret = StartMonitorCRL(crl);
+       } 
+    }
+
+    return ret;
+}
+
+#endif /* HAVE_CRL */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/include.am b/FreeRTOS-Plus/Source/CyaSSL/src/include.am
new file mode 100644 (file)
index 0000000..c6ce574
--- /dev/null
@@ -0,0 +1,85 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+lib_LTLIBRARIES+= src/libcyassl.la
+src_libcyassl_la_SOURCES = \
+                          src/internal.c \
+                          src/io.c \
+                          src/keys.c \
+                          src/ssl.c \
+                          src/tls.c  \
+                          ctaocrypt/src/asn.c \
+                          ctaocrypt/src/coding.c \
+                          ctaocrypt/src/des3.c \
+                          ctaocrypt/src/hmac.c \
+                          ctaocrypt/src/md5.c \
+                          ctaocrypt/src/md4.c \
+                          ctaocrypt/src/random.c \
+                          ctaocrypt/src/rsa.c \
+                          ctaocrypt/src/sha.c \
+                          ctaocrypt/src/aes.c \
+                          ctaocrypt/src/sha256.c \
+                          ctaocrypt/src/dh.c \
+                          ctaocrypt/src/dsa.c \
+                          ctaocrypt/src/arc4.c \
+                          ctaocrypt/src/rabbit.c \
+                          ctaocrypt/src/pwdbased.c \
+                          ctaocrypt/src/logging.c \
+                          ctaocrypt/src/memory.c
+src_libcyassl_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined -version-info ${CYASSL_LIBRARY_VERSION}
+src_libcyassl_la_LIBADD = $(LIBM)
+src_libcyassl_la_CFLAGS = -DBUILDING_CYASSL $(AM_CFLAGS)
+src_libcyassl_la_CPPFLAGS = -DBUILDING_CYASSL $(AM_CPPFLAGS)
+
+if BUILD_AESNI
+src_libcyassl_la_SOURCES += ctaocrypt/src/aes_asm.s
+endif
+
+if BUILD_MD2
+src_libcyassl_la_SOURCES += ctaocrypt/src/md2.c
+endif
+
+if BUILD_RIPEMD
+src_libcyassl_la_SOURCES += ctaocrypt/src/ripemd.c
+endif
+
+if BUILD_SHA512
+src_libcyassl_la_SOURCES += ctaocrypt/src/sha512.c
+endif
+
+if BUILD_SNIFFER
+src_libcyassl_la_SOURCES += src/sniffer.c
+endif
+
+if BUILD_HC128
+src_libcyassl_la_SOURCES += ctaocrypt/src/hc128.c
+endif
+
+if BUILD_NOINLINE
+src_libcyassl_la_SOURCES += ctaocrypt/src/misc.c
+endif
+
+if BUILD_FASTMATH
+src_libcyassl_la_SOURCES += ctaocrypt/src/tfm.c
+else
+src_libcyassl_la_SOURCES += ctaocrypt/src/integer.c
+endif
+
+if BUILD_ECC
+src_libcyassl_la_SOURCES += ctaocrypt/src/ecc.c
+endif
+
+if BUILD_OCSP
+src_libcyassl_la_SOURCES += src/ocsp.c
+endif
+
+if BUILD_CRL
+src_libcyassl_la_SOURCES += src/crl.c
+endif
+
+if BUILD_CRL_MONITOR
+src_libcyassl_la_CFLAGS += $(PTHREAD_CFLAGS)
+src_libcyassl_la_LIBADD += $(PTHREAD_LIBS)
+endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/internal.c b/FreeRTOS-Plus/Source/CyaSSL/src/internal.c
new file mode 100644 (file)
index 0000000..ff73e0b
--- /dev/null
@@ -0,0 +1,7102 @@
+/* internal.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+#include <cyassl/ctaocrypt/asn.h>
+
+#ifdef HAVE_LIBZ
+    #include "zlib.h"
+#endif
+
+#ifdef HAVE_NTRU
+    #include "crypto_ntru.h"
+#endif
+
+#if defined(DEBUG_CYASSL) || defined(SHOW_SECRETS)
+    #include <stdio.h>
+#endif
+
+#ifdef __sun
+    #include <sys/filio.h>
+#endif
+
+#define TRUE  1
+#define FALSE 0
+
+
+#if defined(OPENSSL_EXTRA) && defined(NO_DH)
+    #error OPENSSL_EXTRA needs DH, please remove NO_DH
+#endif
+
+
+#ifndef NO_CYASSL_CLIENT
+    static int DoHelloVerifyRequest(CYASSL* ssl, const byte* input, word32*);
+    static int DoServerHello(CYASSL* ssl, const byte* input, word32*, word32);
+    static int DoCertificateRequest(CYASSL* ssl, const byte* input, word32*);
+    static int DoServerKeyExchange(CYASSL* ssl, const byte* input, word32*);
+#endif
+
+
+#ifndef NO_CYASSL_SERVER
+    static int DoClientHello(CYASSL* ssl, const byte* input, word32*, word32,
+                             word32);
+    static int DoCertificateVerify(CYASSL* ssl, byte*, word32*, word32);
+    static int DoClientKeyExchange(CYASSL* ssl, byte* input, word32*);
+#endif
+
+typedef enum {
+    doProcessInit = 0,
+#ifndef NO_CYASSL_SERVER
+    runProcessOldClientHello,
+#endif
+    getRecordLayerHeader,
+    getData,
+    runProcessingOneMessage
+} processReply;
+
+static void Hmac(CYASSL* ssl, byte* digest, const byte* buffer, word32 sz,
+                 int content, int verify);
+
+static void BuildCertHashes(CYASSL* ssl, Hashes* hashes);
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+int IsTLS(const CYASSL* ssl)
+{
+    if (ssl->version.major == SSLv3_MAJOR && ssl->version.minor >=TLSv1_MINOR)
+        return 1;
+
+    return 0;
+}
+
+
+int IsAtLeastTLSv1_2(const CYASSL* ssl)
+{
+    if (ssl->version.major == SSLv3_MAJOR && ssl->version.minor >=TLSv1_2_MINOR)
+        return 1;
+
+    return 0;
+}
+
+
+#ifdef HAVE_NTRU
+
+static byte GetEntropy(ENTROPY_CMD cmd, byte* out)
+{
+    /* TODO: add locking? */
+    static RNG rng;
+
+    if (cmd == INIT) {
+        int ret = InitRng(&rng);
+        if (ret == 0)
+            return 1;
+        else
+            return 0;
+    }
+
+    if (out == NULL)
+        return 0;
+
+    if (cmd == GET_BYTE_OF_ENTROPY) {
+        RNG_GenerateBlock(&rng, out, 1);
+        return 1;
+    }
+
+    if (cmd == GET_NUM_BYTES_PER_BYTE_OF_ENTROPY) {
+        *out = 1;
+        return 1;
+    }
+
+    return 0;
+}
+
+#endif /* HAVE_NTRU */
+
+/* used by ssl.c too */
+void c32to24(word32 in, word24 out)
+{
+    out[0] = (in >> 16) & 0xff;
+    out[1] = (in >>  8) & 0xff;
+    out[2] =  in & 0xff;
+}
+
+
+#ifdef CYASSL_DTLS
+
+static INLINE void c32to48(word32 in, byte out[6])
+{
+    out[0] = 0;
+    out[1] = 0;
+    out[2] = (in >> 24) & 0xff;
+    out[3] = (in >> 16) & 0xff;
+    out[4] = (in >>  8) & 0xff;
+    out[5] =  in & 0xff;
+}
+
+#endif /* CYASSL_DTLS */
+
+
+/* convert 16 bit integer to opaque */
+static INLINE void c16toa(word16 u16, byte* c)
+{
+    c[0] = (u16 >> 8) & 0xff;
+    c[1] =  u16 & 0xff;
+}
+
+
+/* convert 32 bit integer to opaque */
+static INLINE void c32toa(word32 u32, byte* c)
+{
+    c[0] = (u32 >> 24) & 0xff;
+    c[1] = (u32 >> 16) & 0xff;
+    c[2] = (u32 >>  8) & 0xff;
+    c[3] =  u32 & 0xff;
+}
+
+
+/* convert a 24 bit integer into a 32 bit one */
+static INLINE void c24to32(const word24 u24, word32* u32)
+{
+    *u32 = 0;
+    *u32 = (u24[0] << 16) | (u24[1] << 8) | u24[2];
+}
+
+
+/* convert opaque to 16 bit integer */
+static INLINE void ato16(const byte* c, word16* u16)
+{
+    *u16 = 0;
+    *u16 = (c[0] << 8) | (c[1]);
+}
+
+
+#ifdef CYASSL_DTLS
+
+/* convert opaque to 32 bit integer */
+static INLINE void ato32(const byte* c, word32* u32)
+{
+    *u32 = 0;
+    *u32 = (c[0] << 24) | (c[1] << 16) | (c[2] << 8) | c[3];
+}
+
+#endif /* CYASSL_DTLS */
+
+
+#ifdef HAVE_LIBZ
+
+    /* alloc user allocs to work with zlib */
+    static void* myAlloc(void* opaque, unsigned int item, unsigned int size)
+    {
+        (void)opaque;
+        return XMALLOC(item * size, opaque, DYNAMIC_TYPE_LIBZ);
+    }
+
+
+    static void myFree(void* opaque, void* memory)
+    {
+        (void)opaque;
+        XFREE(memory, opaque, DYNAMIC_TYPE_LIBZ);
+    }
+
+
+    /* init zlib comp/decomp streams, 0 on success */
+    static int InitStreams(CYASSL* ssl)
+    {
+        ssl->c_stream.zalloc = (alloc_func)myAlloc;
+        ssl->c_stream.zfree  = (free_func)myFree;
+        ssl->c_stream.opaque = (voidpf)ssl->heap;
+
+        if (deflateInit(&ssl->c_stream, Z_DEFAULT_COMPRESSION) != Z_OK)
+            return ZLIB_INIT_ERROR;
+
+        ssl->didStreamInit = 1;
+
+        ssl->d_stream.zalloc = (alloc_func)myAlloc;
+        ssl->d_stream.zfree  = (free_func)myFree;
+        ssl->d_stream.opaque = (voidpf)ssl->heap;
+
+        if (inflateInit(&ssl->d_stream) != Z_OK) return ZLIB_INIT_ERROR;
+
+        return 0;
+    }
+
+
+    static void FreeStreams(CYASSL* ssl)
+    {
+        if (ssl->didStreamInit) {
+            deflateEnd(&ssl->c_stream);
+            inflateEnd(&ssl->d_stream);
+        }
+    }
+
+
+    /* compress in to out, return out size or error */
+    static int Compress(CYASSL* ssl, byte* in, int inSz, byte* out, int outSz)
+    {
+        int    err;
+        int    currTotal = ssl->c_stream.total_out;
+
+        ssl->c_stream.next_in   = in;
+        ssl->c_stream.avail_in  = inSz;
+        ssl->c_stream.next_out  = out;
+        ssl->c_stream.avail_out = outSz;
+
+        err = deflate(&ssl->c_stream, Z_SYNC_FLUSH);
+        if (err != Z_OK && err != Z_STREAM_END) return ZLIB_COMPRESS_ERROR;
+
+        return ssl->c_stream.total_out - currTotal;
+    }
+        
+
+    /* decompress in to out, returnn out size or error */
+    static int DeCompress(CYASSL* ssl, byte* in, int inSz, byte* out, int outSz)
+    {
+        int    err;
+        int    currTotal = ssl->d_stream.total_out;
+
+        ssl->d_stream.next_in   = in;
+        ssl->d_stream.avail_in  = inSz;
+        ssl->d_stream.next_out  = out;
+        ssl->d_stream.avail_out = outSz;
+
+        err = inflate(&ssl->d_stream, Z_SYNC_FLUSH);
+        if (err != Z_OK && err != Z_STREAM_END) return ZLIB_DECOMPRESS_ERROR;
+
+        return ssl->d_stream.total_out - currTotal;
+    }
+        
+#endif /* HAVE_LIBZ */
+
+
+void InitSSL_Method(CYASSL_METHOD* method, ProtocolVersion pv)
+{
+    method->version    = pv;
+    method->side       = CLIENT_END;
+    method->downgrade  = 0;
+}
+
+
+/* Initialze SSL context, return 0 on success */
+int InitSSL_Ctx(CYASSL_CTX* ctx, CYASSL_METHOD* method)
+{
+    ctx->method = method;
+    ctx->refCount = 1;          /* so either CTX_free or SSL_free can release */
+    ctx->certificate.buffer = 0;
+    ctx->certChain.buffer   = 0;
+    ctx->privateKey.buffer  = 0;
+    ctx->serverDH_P.buffer  = 0;
+    ctx->serverDH_G.buffer  = 0;
+    ctx->haveDH             = 0;
+    ctx->haveNTRU           = 0;    /* start off */
+    ctx->haveECDSAsig       = 0;    /* start off */
+    ctx->haveStaticECC      = 0;    /* start off */
+    ctx->heap               = ctx;  /* defaults to self */
+#ifndef NO_PSK
+    ctx->havePSK            = 0;
+    ctx->server_hint[0]     = 0;
+    ctx->client_psk_cb      = 0;
+    ctx->server_psk_cb      = 0;
+#endif /* NO_PSK */
+#ifdef HAVE_ECC
+    ctx->eccTempKeySz       = ECDHE_SIZE;   
+#endif
+
+#ifdef OPENSSL_EXTRA
+    ctx->passwd_cb   = 0;
+    ctx->userdata    = 0;
+#endif /* OPENSSL_EXTRA */
+
+    ctx->timeout = DEFAULT_TIMEOUT;
+
+#ifndef CYASSL_USER_IO
+    ctx->CBIORecv = EmbedReceive;
+    ctx->CBIOSend = EmbedSend;
+#else
+    /* user will set */
+    ctx->CBIORecv = NULL;
+    ctx->CBIOSend = NULL;
+#endif
+    ctx->partialWrite   = 0;
+    ctx->verifyCallback = 0;
+
+    ctx->cm = CyaSSL_CertManagerNew();
+#ifdef HAVE_NTRU
+    if (method->side == CLIENT_END)
+        ctx->haveNTRU = 1;           /* always on cliet side */
+                                     /* server can turn on by loading key */
+#endif
+#ifdef HAVE_ECC
+    if (method->side == CLIENT_END) {
+        ctx->haveECDSAsig  = 1;        /* always on cliet side */
+        ctx->haveStaticECC = 1;        /* server can turn on by loading key */
+    }
+#endif
+    ctx->suites.setSuites = 0;  /* user hasn't set yet */
+    /* remove DH later if server didn't set, add psk later */
+    InitSuites(&ctx->suites, method->version, TRUE, FALSE, ctx->haveNTRU,
+               ctx->haveECDSAsig, ctx->haveStaticECC, method->side);  
+    ctx->verifyPeer = 0;
+    ctx->verifyNone = 0;
+    ctx->failNoCert = 0;
+    ctx->sessionCacheOff      = 0;  /* initially on */
+    ctx->sessionCacheFlushOff = 0;  /* initially on */
+    ctx->sendVerify = 0;
+    ctx->quietShutdown = 0;
+    ctx->groupMessages = 0;
+#ifdef HAVE_OCSP
+    CyaSSL_OCSP_Init(&ctx->ocsp);
+#endif
+
+    if (InitMutex(&ctx->countMutex) < 0) {
+        CYASSL_MSG("Mutex error on CTX init");
+        return BAD_MUTEX_ERROR;
+    } 
+    if (ctx->cm == NULL) {
+        CYASSL_MSG("Bad Cert Manager New");
+        return BAD_CERT_MANAGER_ERROR;
+    }
+    return 0;
+}
+
+
+/* In case contexts are held in array and don't want to free actual ctx */
+void SSL_CtxResourceFree(CYASSL_CTX* ctx)
+{
+    XFREE(ctx->serverDH_G.buffer, ctx->heap, DYNAMIC_TYPE_DH);
+    XFREE(ctx->serverDH_P.buffer, ctx->heap, DYNAMIC_TYPE_DH);
+    XFREE(ctx->privateKey.buffer, ctx->heap, DYNAMIC_TYPE_KEY);
+    XFREE(ctx->certificate.buffer, ctx->heap, DYNAMIC_TYPE_CERT);
+    XFREE(ctx->certChain.buffer, ctx->heap, DYNAMIC_TYPE_CERT);
+    XFREE(ctx->method, ctx->heap, DYNAMIC_TYPE_METHOD);
+
+    CyaSSL_CertManagerFree(ctx->cm);
+
+#ifdef HAVE_OCSP
+    CyaSSL_OCSP_Cleanup(&ctx->ocsp);
+#endif
+}
+
+
+void FreeSSL_Ctx(CYASSL_CTX* ctx)
+{
+    int doFree = 0;
+
+    if (LockMutex(&ctx->countMutex) != 0) {
+        CYASSL_MSG("Couldn't lock count mutex");
+        return;
+    }
+    ctx->refCount--;
+    if (ctx->refCount == 0)
+        doFree = 1;
+    UnLockMutex(&ctx->countMutex);
+
+    if (doFree) {
+        CYASSL_MSG("CTX ref count down to 0, doing full free");
+        SSL_CtxResourceFree(ctx);
+        XFREE(ctx, ctx->heap, DYNAMIC_TYPE_CTX);
+    }
+    else {
+        (void)ctx;
+        CYASSL_MSG("CTX ref count not 0 yet, no free");
+    }
+}
+
+    
+void InitSuites(Suites* suites, ProtocolVersion pv, byte haveDH, byte havePSK,
+                byte haveNTRU, byte haveECDSAsig, byte haveStaticECC, int side)
+{
+    word16 idx = 0;
+    int    tls    = pv.major == SSLv3_MAJOR && pv.minor >= TLSv1_MINOR;
+    int    tls1_2 = pv.major == SSLv3_MAJOR && pv.minor >= TLSv1_2_MINOR;
+    int    haveRSA = 1;
+    int    haveRSAsig = 1;
+
+    (void)tls;  /* shut up compiler */
+    (void)haveDH;
+    (void)havePSK;
+    (void)haveNTRU;
+    (void)haveStaticECC;
+
+    if (suites->setSuites)
+        return;      /* trust user settings, don't override */
+
+    if (side == SERVER_END && haveStaticECC)
+        haveRSA = 0;   /* can't do RSA with ECDSA key */
+
+    if (side == SERVER_END && haveECDSAsig)
+        haveRSAsig = 0;  /* can't have RSA sig if signed by ECDSA */
+
+#ifdef CYASSL_DTLS
+    if (pv.major == DTLS_MAJOR && pv.minor == DTLS_MINOR)
+        tls = 1;
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_256_CBC_SHA
+    if (tls && haveNTRU && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_NTRU_RSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_128_CBC_SHA
+    if (tls && haveNTRU && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_NTRU_RSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_RC4_128_SHA
+    if (tls && haveNTRU && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_NTRU_RSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA
+    if (tls && haveNTRU && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+    if (tls && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+    if (tls && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+    if (tls && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+    if (tls && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
+    if (tls && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
+    if (tls && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
+    if (tls && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
+    if (tls && haveECDSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+    if (tls && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE;
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+    if (tls && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA
+    if (tls && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
+    if (tls && haveRSAsig && haveStaticECC) {
+        suites->suites[idx++] = ECC_BYTE; 
+        suites->suites[idx++] = TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveDH && haveRSA) {
+        suites->suites[idx++] = 0;
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+    if (tls1_2 && haveDH && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveDH && haveRSA) {
+        suites->suites[idx++] = 0;
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+    if (tls1_2 && haveDH && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+    if (tls && haveDH && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+    if (tls && haveDH && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = 0;
+        suites->suites[idx++] = TLS_RSA_WITH_AES_256_GCM_SHA384;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_AES_256_CBC_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = 0;
+        suites->suites[idx++] = TLS_RSA_WITH_AES_128_GCM_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
+    if (tls1_2 && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_AES_128_CBC_SHA256;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
+    if (tls && havePSK) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_PSK_WITH_AES_256_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
+    if (tls && havePSK) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_PSK_WITH_AES_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_SHA
+    if (haveRSA ) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = SSL_RSA_WITH_RC4_128_SHA;
+    }
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_MD5
+    if (haveRSA ) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = SSL_RSA_WITH_RC4_128_MD5;
+    }
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
+    if (haveRSA ) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = SSL_RSA_WITH_3DES_EDE_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5
+    if (tls && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_HC_128_CBC_MD5;
+    }
+#endif
+    
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_HC_128_CBC_SHA;
+    }
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA
+    if (tls && haveRSA) {
+        suites->suites[idx++] = 0; 
+        suites->suites[idx++] = TLS_RSA_WITH_RABBIT_CBC_SHA;
+    }
+#endif
+
+    suites->suiteSz = idx;
+}
+
+
+/* init everything to 0, NULL, default values before calling anything that may
+   fail so that desctructor has a "good" state to cleanup */
+int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
+{
+    int  ret;
+    byte havePSK = 0;
+
+    ssl->ctx     = ctx; /* only for passing to calls, options could change */
+    ssl->version = ctx->method->version;
+    ssl->suites  = ctx->suites;
+
+#ifdef HAVE_LIBZ
+    ssl->didStreamInit = 0;
+#endif
+   
+    ssl->buffers.certificate.buffer   = 0;
+    ssl->buffers.key.buffer           = 0;
+    ssl->buffers.certChain.buffer     = 0;
+    ssl->buffers.inputBuffer.length   = 0;
+    ssl->buffers.inputBuffer.idx      = 0;
+    ssl->buffers.inputBuffer.buffer = ssl->buffers.inputBuffer.staticBuffer;
+    ssl->buffers.inputBuffer.bufferSize  = STATIC_BUFFER_LEN;
+    ssl->buffers.inputBuffer.dynamicFlag = 0;
+    ssl->buffers.outputBuffer.length  = 0;
+    ssl->buffers.outputBuffer.idx     = 0;
+    ssl->buffers.outputBuffer.buffer = ssl->buffers.outputBuffer.staticBuffer;
+    ssl->buffers.outputBuffer.bufferSize  = STATIC_BUFFER_LEN;
+    ssl->buffers.outputBuffer.dynamicFlag = 0;
+    ssl->buffers.domainName.buffer    = 0;
+    ssl->buffers.serverDH_P.buffer    = 0;
+    ssl->buffers.serverDH_G.buffer    = 0;
+    ssl->buffers.serverDH_Pub.buffer  = 0;
+    ssl->buffers.serverDH_Priv.buffer = 0;
+    ssl->buffers.clearOutputBuffer.buffer  = 0;
+    ssl->buffers.clearOutputBuffer.length  = 0;
+    ssl->buffers.prevSent                  = 0;
+    ssl->buffers.plainSz                   = 0;
+
+#ifdef OPENSSL_EXTRA
+    ssl->peerCert.derCert.buffer = NULL;
+    ssl->peerCert.altNames     = NULL;
+    ssl->peerCert.altNamesNext = NULL;
+#endif
+
+#ifdef HAVE_ECC
+    ssl->eccTempKeySz = ctx->eccTempKeySz;
+    ssl->peerEccKeyPresent = 0;
+    ssl->peerEccDsaKeyPresent = 0;
+    ssl->eccDsaKeyPresent = 0;
+    ssl->eccTempKeyPresent = 0;
+    ecc_init(&ssl->peerEccKey);
+    ecc_init(&ssl->peerEccDsaKey);
+    ecc_init(&ssl->eccDsaKey);
+    ecc_init(&ssl->eccTempKey);
+#endif
+
+    ssl->timeout = ctx->timeout;
+    ssl->rfd = -1;   /* set to invalid descriptor */
+    ssl->wfd = -1;
+    ssl->biord = 0;
+    ssl->biowr = 0;
+
+    ssl->IOCB_ReadCtx  = &ssl->rfd;   /* prevent invalid pointer acess if not */
+    ssl->IOCB_WriteCtx = &ssl->wfd;   /* correctly set */
+
+    InitMd5(&ssl->hashMd5);
+    InitSha(&ssl->hashSha);
+#ifndef NO_SHA256
+    InitSha256(&ssl->hashSha256);
+#endif
+#ifdef CYASSL_SHA384
+    InitSha384(&ssl->hashSha384);
+#endif
+    InitRsaKey(&ssl->peerRsaKey, ctx->heap);
+
+    ssl->verifyCallback    = ctx->verifyCallback;
+    ssl->peerRsaKeyPresent = 0;
+    ssl->options.side      = ctx->method->side;
+    ssl->options.downgrade = ctx->method->downgrade;
+    ssl->error = 0;
+    ssl->options.connReset = 0;
+    ssl->options.isClosed  = 0;
+    ssl->options.closeNotify  = 0;
+    ssl->options.sentNotify   = 0;
+    ssl->options.usingCompression = 0;
+    if (ssl->options.side == SERVER_END)
+        ssl->options.haveDH = ctx->haveDH;
+    else
+        ssl->options.haveDH = 0;
+    ssl->options.haveNTRU      = ctx->haveNTRU;
+    ssl->options.haveECDSAsig  = ctx->haveECDSAsig;
+    ssl->options.haveStaticECC = ctx->haveStaticECC;
+    ssl->options.havePeerCert  = 0; 
+    ssl->options.usingPSK_cipher = 0;
+    ssl->options.sendAlertState = 0;
+#ifndef NO_PSK
+    havePSK = ctx->havePSK;
+    ssl->options.havePSK   = ctx->havePSK;
+    ssl->options.client_psk_cb = ctx->client_psk_cb;
+    ssl->options.server_psk_cb = ctx->server_psk_cb;
+#endif /* NO_PSK */
+
+    ssl->options.serverState = NULL_STATE;
+    ssl->options.clientState = NULL_STATE;
+    ssl->options.connectState = CONNECT_BEGIN;
+    ssl->options.acceptState  = ACCEPT_BEGIN; 
+    ssl->options.handShakeState  = NULL_STATE; 
+    ssl->options.processReply = doProcessInit;
+
+#ifdef CYASSL_DTLS
+    ssl->keys.dtls_sequence_number       = 0;
+    ssl->keys.dtls_peer_sequence_number  = 0;
+    ssl->keys.dtls_handshake_number      = 0;
+    ssl->keys.dtls_epoch      = 0;
+    ssl->keys.dtls_peer_epoch = 0;
+    ssl->arrays.cookieSz = 0;
+#endif
+    ssl->keys.encryptionOn = 0;     /* initially off */
+    ssl->options.sessionCacheOff      = ctx->sessionCacheOff;
+    ssl->options.sessionCacheFlushOff = ctx->sessionCacheFlushOff;
+
+    ssl->options.verifyPeer = ctx->verifyPeer;
+    ssl->options.verifyNone = ctx->verifyNone;
+    ssl->options.failNoCert = ctx->failNoCert;
+    ssl->options.sendVerify = ctx->sendVerify;
+    
+    ssl->options.resuming = 0;
+    ssl->options.haveSessionId = 0;
+    ssl->hmac = Hmac;         /* default to SSLv3 */
+    ssl->heap = ctx->heap;    /* defaults to self */
+    ssl->options.tls    = 0;
+    ssl->options.tls1_1 = 0;
+    ssl->options.dtls   = 0;
+    ssl->options.partialWrite  = ctx->partialWrite;
+    ssl->options.quietShutdown = ctx->quietShutdown;
+    ssl->options.certOnly = 0;
+    ssl->options.groupMessages = ctx->groupMessages;
+
+    /* ctx still owns certificate, certChain, key, dh, and cm */
+    ssl->buffers.certificate = ctx->certificate;
+    ssl->buffers.certChain = ctx->certChain;
+    ssl->buffers.key = ctx->privateKey;
+    if (ssl->options.side == SERVER_END) {
+        ssl->buffers.serverDH_P = ctx->serverDH_P;
+        ssl->buffers.serverDH_G = ctx->serverDH_G;
+    }
+    ssl->buffers.weOwnCert = 0;
+    ssl->buffers.weOwnKey  = 0;
+    ssl->buffers.weOwnDH   = 0;
+
+#ifdef OPENSSL_EXTRA
+    ssl->peerCert.issuer.sz    = 0;
+    ssl->peerCert.subject.sz   = 0;
+#endif
+  
+#ifdef SESSION_CERTS
+    ssl->session.chain.count = 0;
+#endif
+
+    ssl->cipher.ssl = ssl;
+
+#ifdef FORTRESS
+    ssl->ex_data[0] = 0;
+    ssl->ex_data[1] = 0;
+    ssl->ex_data[2] = 0;
+#endif
+
+#ifdef CYASSL_CALLBACKS
+    ssl->hsInfoOn = 0;
+    ssl->toInfoOn = 0;
+#endif
+
+#ifndef NO_PSK
+    ssl->arrays.client_identity[0] = 0;
+    if (ctx->server_hint[0]) {   /* set in CTX */
+        XSTRNCPY(ssl->arrays.server_hint, ctx->server_hint, MAX_PSK_ID_LEN);
+        ssl->arrays.server_hint[MAX_PSK_ID_LEN - 1] = '\0';
+    }
+    else
+        ssl->arrays.server_hint[0] = 0;
+#endif /* NO_PSK */
+
+    /* all done with init, now can return errors, call other stuff */
+
+    /* increment CTX reference count */
+    if (LockMutex(&ctx->countMutex) != 0) {
+        CYASSL_MSG("Couldn't lock CTX count mutex");
+        return BAD_MUTEX_ERROR;
+    }
+    ctx->refCount++;
+    UnLockMutex(&ctx->countMutex);
+
+    if ( (ret = InitRng(&ssl->rng)) != 0)
+        return ret;
+
+    /* make sure server has cert and key unless using PSK */
+    if (ssl->options.side == SERVER_END && !havePSK)
+        if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) {
+            CYASSL_MSG("Server missing certificate and/or private key"); 
+            return NO_PRIVATE_KEY;
+        }
+
+    /* make sure server has DH parms, and add PSK if there, add NTRU too */
+    if (ssl->options.side == SERVER_END) 
+        InitSuites(&ssl->suites, ssl->version,ssl->options.haveDH, havePSK,
+                   ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                   ssl->options.haveStaticECC, ssl->options.side);
+    else 
+        InitSuites(&ssl->suites, ssl->version, TRUE, havePSK,
+                   ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                   ssl->options.haveStaticECC, ssl->options.side);
+
+    return 0;
+}
+
+
+/* In case holding SSL object in array and don't want to free actual ssl */
+void SSL_ResourceFree(CYASSL* ssl)
+{
+    XFREE(ssl->buffers.serverDH_Priv.buffer, ssl->heap, DYNAMIC_TYPE_DH);
+    XFREE(ssl->buffers.serverDH_Pub.buffer, ssl->heap, DYNAMIC_TYPE_DH);
+    /* parameters (p,g) may be owned by ctx */
+    if (ssl->buffers.weOwnDH || ssl->options.side == CLIENT_END) {
+        XFREE(ssl->buffers.serverDH_G.buffer, ssl->heap, DYNAMIC_TYPE_DH);
+        XFREE(ssl->buffers.serverDH_P.buffer, ssl->heap, DYNAMIC_TYPE_DH);
+    }
+    XFREE(ssl->buffers.domainName.buffer, ssl->heap, DYNAMIC_TYPE_DOMAIN);
+
+    /* CYASSL_CTX always owns certChain */
+    if (ssl->buffers.weOwnCert)
+        XFREE(ssl->buffers.certificate.buffer, ssl->heap, DYNAMIC_TYPE_CERT);
+    if (ssl->buffers.weOwnKey)
+        XFREE(ssl->buffers.key.buffer, ssl->heap, DYNAMIC_TYPE_KEY);
+
+    FreeRsaKey(&ssl->peerRsaKey);
+    if (ssl->buffers.inputBuffer.dynamicFlag)
+        ShrinkInputBuffer(ssl, FORCED_FREE);
+    if (ssl->buffers.outputBuffer.dynamicFlag)
+        ShrinkOutputBuffer(ssl);
+#if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
+    XFREE(ssl->peerCert.derCert.buffer, ssl->heap, DYNAMIC_TYPE_CERT);
+    if (ssl->peerCert.altNames)
+        FreeAltNames(ssl->peerCert.altNames, ssl->heap);
+    CyaSSL_BIO_free(ssl->biord);
+    if (ssl->biord != ssl->biowr)        /* in case same as write */
+        CyaSSL_BIO_free(ssl->biowr);
+#endif
+#ifdef HAVE_LIBZ
+    FreeStreams(ssl);
+#endif
+#ifdef HAVE_ECC
+    ecc_free(&ssl->peerEccKey);
+    ecc_free(&ssl->peerEccDsaKey);
+    ecc_free(&ssl->eccTempKey);
+    ecc_free(&ssl->eccDsaKey);
+#endif
+}
+
+
+void FreeSSL(CYASSL* ssl)
+{
+    FreeSSL_Ctx(ssl->ctx);  /* will decrement and free underyling CTX if 0 */
+    SSL_ResourceFree(ssl);
+    XFREE(ssl, ssl->heap, DYNAMIC_TYPE_SSL);
+}
+
+
+ProtocolVersion MakeSSLv3(void)
+{
+    ProtocolVersion pv;
+    pv.major = SSLv3_MAJOR;
+    pv.minor = SSLv3_MINOR;
+
+    return pv;
+}
+
+
+#ifdef CYASSL_DTLS
+
+ProtocolVersion MakeDTLSv1(void)
+{
+    ProtocolVersion pv;
+    pv.major = DTLS_MAJOR;
+    pv.minor = DTLS_MINOR;
+
+    return pv;
+}
+
+#endif /* CYASSL_DTLS */
+
+
+
+
+#ifdef USE_WINDOWS_API 
+
+    timer_d Timer(void)
+    {
+        static int           init = 0;
+        static LARGE_INTEGER freq;
+        LARGE_INTEGER        count;
+    
+        if (!init) {
+            QueryPerformanceFrequency(&freq);
+            init = 1;
+        }
+
+        QueryPerformanceCounter(&count);
+
+        return (double)count.QuadPart / freq.QuadPart;
+    }
+
+
+    word32 LowResTimer(void)
+    {
+        return (word32)Timer();
+    }
+
+
+#elif defined(THREADX)
+
+    #include "rtptime.h"
+
+    word32 LowResTimer(void)
+    {
+        return (word32)rtp_get_system_sec();
+    }
+
+
+#elif defined(MICRIUM)
+
+    word32 LowResTimer(void)
+    {
+        NET_SECURE_OS_TICK  clk;
+
+        #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+            clk = NetSecure_OS_TimeGet();
+        #endif
+        return (word32)clk;
+    }
+
+#elif defined(USER_TICKS)
+
+    word32 LowResTimer(void)
+    {
+        /*
+        write your own clock tick function if don't want time(0)
+        needs second accuracy but doesn't have to correlated to EPOCH
+        */
+    }
+
+#else /* !USE_WINDOWS_API && !THREADX && !MICRIUM && !USER_TICKS */
+
+    #include <time.h>
+
+    word32 LowResTimer(void)
+    {
+        return time(0); 
+    }
+
+
+#endif /* USE_WINDOWS_API */
+
+
+/* add output to md5 and sha handshake hashes, exclude record header */
+static void HashOutput(CYASSL* ssl, const byte* output, int sz, int ivSz)
+{
+    const byte* adj = output + RECORD_HEADER_SZ + ivSz;
+    sz -= RECORD_HEADER_SZ;
+    
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls) {
+        adj += DTLS_RECORD_EXTRA;
+        sz  -= DTLS_RECORD_EXTRA;
+    }
+#endif
+
+    Md5Update(&ssl->hashMd5, adj, sz);
+    ShaUpdate(&ssl->hashSha, adj, sz);
+    if (IsAtLeastTLSv1_2(ssl)) {
+#ifndef NO_SHA256
+        Sha256Update(&ssl->hashSha256, adj, sz);
+#endif
+#ifdef CYASSL_SHA384
+        Sha384Update(&ssl->hashSha384, adj, sz);
+#endif
+    }
+}
+
+
+/* add input to md5 and sha handshake hashes, include handshake header */
+static void HashInput(CYASSL* ssl, const byte* input, int sz)
+{
+    const byte* adj = input - HANDSHAKE_HEADER_SZ;
+    sz += HANDSHAKE_HEADER_SZ;
+    
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls) {
+        adj -= DTLS_HANDSHAKE_EXTRA;
+        sz  += DTLS_HANDSHAKE_EXTRA;
+    }
+#endif
+
+    Md5Update(&ssl->hashMd5, adj, sz);
+    ShaUpdate(&ssl->hashSha, adj, sz);
+    if (IsAtLeastTLSv1_2(ssl)) {
+#ifndef NO_SHA256
+        Sha256Update(&ssl->hashSha256, adj, sz);
+#endif
+#ifdef CYASSL_SHA384
+        Sha384Update(&ssl->hashSha384, adj, sz);
+#endif
+    }
+}
+
+
+/* add record layer header for message */
+static void AddRecordHeader(byte* output, word32 length, byte type, CYASSL* ssl)
+{
+    RecordLayerHeader* rl;
+  
+    /* record layer header */
+    rl = (RecordLayerHeader*)output;
+    rl->type    = type;
+    rl->version = ssl->version;           /* type and version same in each */
+
+    if (!ssl->options.dtls)
+        c16toa((word16)length, rl->length);
+    else {
+#ifdef CYASSL_DTLS
+        DtlsRecordLayerHeader* dtls;
+    
+        /* dtls record layer header extensions */
+        dtls = (DtlsRecordLayerHeader*)output;
+        c16toa(ssl->keys.dtls_epoch, dtls->epoch);
+        c32to48(ssl->keys.dtls_sequence_number++, dtls->sequence_number);
+        c16toa((word16)length, dtls->length);
+#endif
+    }
+}
+
+
+/* add handshake header for message */
+static void AddHandShakeHeader(byte* output, word32 length, byte type,
+                               CYASSL* ssl)
+{
+    HandShakeHeader* hs;
+    (void)ssl;
+    /* handshake header */
+    hs = (HandShakeHeader*)output;
+    hs->type = type;
+    c32to24(length, hs->length);         /* type and length same for each */
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls) {
+        DtlsHandShakeHeader* dtls;
+    
+        /* dtls handshake header extensions */
+        dtls = (DtlsHandShakeHeader*)output;
+        c16toa(ssl->keys.dtls_handshake_number++, dtls->message_seq);
+        c32to24(0, dtls->fragment_offset);
+        c32to24(length, dtls->fragment_length);
+    }
+#endif
+}
+
+
+/* add both headers for handshake message */
+static void AddHeaders(byte* output, word32 length, byte type, CYASSL* ssl)
+{
+    if (!ssl->options.dtls) {
+        AddRecordHeader(output, length + HANDSHAKE_HEADER_SZ, handshake, ssl);
+        AddHandShakeHeader(output + RECORD_HEADER_SZ, length, type, ssl);
+    }
+#ifdef CYASSL_DTLS
+    else  {
+        AddRecordHeader(output, length+DTLS_HANDSHAKE_HEADER_SZ, handshake,ssl);
+        AddHandShakeHeader(output + DTLS_RECORD_HEADER_SZ, length, type, ssl);
+    }
+#endif
+}
+
+
+/* return bytes received, -1 on error */
+static int Receive(CYASSL* ssl, byte* buf, word32 sz)
+{
+    int recvd;
+
+retry:
+    recvd = ssl->ctx->CBIORecv((char *)buf, (int)sz, ssl->IOCB_ReadCtx);
+    if (recvd < 0)
+        switch (recvd) {
+            case IO_ERR_GENERAL:        /* general/unknown error */
+                return -1;
+
+            case IO_ERR_WANT_READ:      /* want read, would block */
+                return WANT_READ;
+
+            case IO_ERR_CONN_RST:       /* connection reset */
+                ssl->options.connReset = 1;
+                return -1;
+
+            case IO_ERR_ISR:            /* interrupt */
+                /* see if we got our timeout */
+                #ifdef CYASSL_CALLBACKS
+                    if (ssl->toInfoOn) {
+                        struct itimerval timeout;
+                        getitimer(ITIMER_REAL, &timeout);
+                        if (timeout.it_value.tv_sec == 0 && 
+                                                timeout.it_value.tv_usec == 0) {
+                            XSTRNCPY(ssl->timeoutInfo.timeoutName,
+                                    "recv() timeout", MAX_TIMEOUT_NAME_SZ);
+                            CYASSL_MSG("Got our timeout"); 
+                            return WANT_READ;
+                        }
+                    }
+                #endif
+                goto retry;
+
+            case IO_ERR_CONN_CLOSE:     /* peer closed connection */
+                ssl->options.isClosed = 1;
+                return -1;
+
+            default:
+                return recvd;
+        }
+
+    return recvd;
+}
+
+
+/* Switch dynamic output buffer back to static, buffer is assumed clear */
+void ShrinkOutputBuffer(CYASSL* ssl)
+{
+    CYASSL_MSG("Shrinking output buffer\n");
+    XFREE(ssl->buffers.outputBuffer.buffer, ssl->heap, DYNAMIC_TYPE_OUT_BUFFER);
+    ssl->buffers.outputBuffer.buffer = ssl->buffers.outputBuffer.staticBuffer;
+    ssl->buffers.outputBuffer.bufferSize  = STATIC_BUFFER_LEN;
+    ssl->buffers.outputBuffer.dynamicFlag = 0;
+}
+
+
+/* Switch dynamic input buffer back to static, keep any remaining input */
+/* forced free means cleaning up */
+void ShrinkInputBuffer(CYASSL* ssl, int forcedFree)
+{
+    int usedLength = ssl->buffers.inputBuffer.length -
+                     ssl->buffers.inputBuffer.idx;
+    if (!forcedFree && usedLength > STATIC_BUFFER_LEN)
+        return;
+
+    CYASSL_MSG("Shrinking input buffer\n");
+
+    if (!forcedFree && usedLength)
+        XMEMCPY(ssl->buffers.inputBuffer.staticBuffer,
+               ssl->buffers.inputBuffer.buffer + ssl->buffers.inputBuffer.idx,
+               usedLength);
+
+    XFREE(ssl->buffers.inputBuffer.buffer, ssl->heap, DYNAMIC_TYPE_IN_BUFFER);
+    ssl->buffers.inputBuffer.buffer = ssl->buffers.inputBuffer.staticBuffer;
+    ssl->buffers.inputBuffer.bufferSize  = STATIC_BUFFER_LEN;
+    ssl->buffers.inputBuffer.dynamicFlag = 0;
+    ssl->buffers.inputBuffer.idx = 0;
+    ssl->buffers.inputBuffer.length = usedLength;
+}
+
+
+int SendBuffered(CYASSL* ssl)
+{
+    while (ssl->buffers.outputBuffer.length > 0) {
+        int sent = ssl->ctx->CBIOSend((char*)ssl->buffers.outputBuffer.buffer +
+                                      ssl->buffers.outputBuffer.idx,
+                                      (int)ssl->buffers.outputBuffer.length,
+                                      ssl->IOCB_WriteCtx);
+        if (sent < 0) {
+            switch (sent) {
+
+                case IO_ERR_WANT_WRITE:        /* would block */
+                    return WANT_WRITE;
+
+                case IO_ERR_CONN_RST:          /* connection reset */
+                    ssl->options.connReset = 1;
+                    break;
+
+                case IO_ERR_ISR:               /* interrupt */
+                    /* see if we got our timeout */
+                    #ifdef CYASSL_CALLBACKS
+                        if (ssl->toInfoOn) {
+                            struct itimerval timeout;
+                            getitimer(ITIMER_REAL, &timeout);
+                            if (timeout.it_value.tv_sec == 0 && 
+                                                timeout.it_value.tv_usec == 0) {
+                                XSTRNCPY(ssl->timeoutInfo.timeoutName,
+                                        "send() timeout", MAX_TIMEOUT_NAME_SZ);
+                                CYASSL_MSG("Got our timeout"); 
+                                return WANT_WRITE;
+                            }
+                        }
+                    #endif
+                    continue;
+
+                case IO_ERR_CONN_CLOSE: /* epipe / conn closed, same as reset */
+                    ssl->options.connReset = 1;
+                    break;
+
+                default:
+                    return SOCKET_ERROR_E;
+            }
+
+            return SOCKET_ERROR_E;
+        }
+
+        ssl->buffers.outputBuffer.idx += sent;
+        ssl->buffers.outputBuffer.length -= sent;
+    }
+      
+    ssl->buffers.outputBuffer.idx = 0;
+
+    if (ssl->buffers.outputBuffer.dynamicFlag)
+        ShrinkOutputBuffer(ssl);
+
+    return 0;
+}
+
+
+/* Grow the output buffer */
+static INLINE int GrowOutputBuffer(CYASSL* ssl, int size)
+{
+    byte* tmp = (byte*) XMALLOC(size + ssl->buffers.outputBuffer.length,
+                                ssl->heap, DYNAMIC_TYPE_OUT_BUFFER);
+    CYASSL_MSG("growing output buffer\n");
+   
+    if (!tmp) return MEMORY_E;
+
+    if (ssl->buffers.outputBuffer.length)
+        XMEMCPY(tmp, ssl->buffers.outputBuffer.buffer,
+               ssl->buffers.outputBuffer.length);
+
+    if (ssl->buffers.outputBuffer.dynamicFlag)
+        XFREE(ssl->buffers.outputBuffer.buffer, ssl->heap,
+              DYNAMIC_TYPE_OUT_BUFFER);
+    ssl->buffers.outputBuffer.dynamicFlag = 1;
+    ssl->buffers.outputBuffer.buffer = tmp;
+    ssl->buffers.outputBuffer.bufferSize = size +
+                                           ssl->buffers.outputBuffer.length; 
+    return 0;
+}
+
+
+/* Grow the input buffer, should only be to read cert or big app data */
+static INLINE int GrowInputBuffer(CYASSL* ssl, int size, int usedLength)
+{
+    byte* tmp = (byte*) XMALLOC(size + usedLength, ssl->heap,
+                                DYNAMIC_TYPE_IN_BUFFER);
+    CYASSL_MSG("growing input buffer\n");
+   
+    if (!tmp) return MEMORY_E;
+
+    if (usedLength)
+        XMEMCPY(tmp, ssl->buffers.inputBuffer.buffer +
+                    ssl->buffers.inputBuffer.idx, usedLength);
+
+    if (ssl->buffers.inputBuffer.dynamicFlag)
+        XFREE(ssl->buffers.inputBuffer.buffer,ssl->heap,DYNAMIC_TYPE_IN_BUFFER);
+
+    ssl->buffers.inputBuffer.dynamicFlag = 1;
+    ssl->buffers.inputBuffer.buffer = tmp;
+    ssl->buffers.inputBuffer.bufferSize = size + usedLength;
+    ssl->buffers.inputBuffer.idx    = 0;
+    ssl->buffers.inputBuffer.length = usedLength;
+
+    return 0;
+}
+
+
+/* check avalaible size into output buffer, make room if needed */
+static INLINE int CheckAvalaibleSize(CYASSL *ssl, int size)
+{
+    if (ssl->buffers.outputBuffer.bufferSize - ssl->buffers.outputBuffer.length
+                                             < (word32)size) {
+        if (GrowOutputBuffer(ssl, size) < 0)
+            return MEMORY_E;
+    }
+
+    return 0;
+}
+
+/* do all verify and sanity checks on record header */
+static int GetRecordHeader(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                           RecordLayerHeader* rh, word16 *size)
+{
+    if (!ssl->options.dtls) {
+        XMEMCPY(rh, input + *inOutIdx, RECORD_HEADER_SZ);
+        *inOutIdx += RECORD_HEADER_SZ;
+        ato16(rh->length, size);
+    }
+    else {
+#ifdef CYASSL_DTLS
+        /* type and version in same sport */
+        XMEMCPY(rh, input + *inOutIdx, ENUM_LEN + VERSION_SZ);
+        *inOutIdx += ENUM_LEN + VERSION_SZ;
+        *inOutIdx += 4;  /* skip epoch and first 2 seq bytes for now */
+        ato32(input + *inOutIdx, &ssl->keys.dtls_peer_sequence_number);
+        *inOutIdx += 4;  /* advance past rest of seq */
+        ato16(input + *inOutIdx, size);
+        *inOutIdx += LENGTH_SZ;
+#endif
+    }
+
+    /* catch version mismatch */
+    if (rh->version.major != ssl->version.major || 
+        rh->version.minor != ssl->version.minor) {
+        
+        if (ssl->options.side == SERVER_END &&
+            ssl->options.acceptState == ACCEPT_BEGIN)
+            CYASSL_MSG("Client attempting to connect with different version"); 
+        else if (ssl->options.side == CLIENT_END && ssl->options.downgrade &&
+                 ssl->options.connectState < FIRST_REPLY_DONE)
+            CYASSL_MSG("Server attempting to accept with different version"); 
+        else {
+            CYASSL_MSG("SSL version error"); 
+            return VERSION_ERROR;              /* only use requested version */
+        }
+    }
+
+    /* record layer length check */
+    if (*size > (MAX_RECORD_SIZE + MAX_COMP_EXTRA + MAX_MSG_EXTRA))
+        return LENGTH_ERROR;
+
+    /* verify record type here as well */
+    switch ((enum ContentType)rh->type) {
+        case handshake:
+        case change_cipher_spec:
+        case application_data:
+        case alert:
+            break;
+        case no_type:
+        default:
+            CYASSL_MSG("Unknown Record Type"); 
+            return UNKNOWN_RECORD_TYPE;
+    }
+
+    return 0;
+}
+
+
+static int GetHandShakeHeader(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                              byte *type, word32 *size)
+{
+    const byte *ptr = input + *inOutIdx;
+    (void)ssl;
+    *inOutIdx += HANDSHAKE_HEADER_SZ;
+    
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls)
+        *inOutIdx += DTLS_HANDSHAKE_EXTRA;
+#endif
+
+    *type = ptr[0];
+    c24to32(&ptr[1], size);
+
+    return 0;
+}
+
+
+/* fill with MD5 pad size since biggest required */
+static const byte PAD1[PAD_MD5] = 
+                              { 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+                                0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+                                0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+                                0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+                                0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
+                                0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
+                              };
+static const byte PAD2[PAD_MD5] =
+                              { 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
+                                0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
+                                0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
+                                0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
+                                0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c,
+                                0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c
+                              };
+
+/* calculate MD5 hash for finished */
+static void BuildMD5(CYASSL* ssl, Hashes* hashes, const byte* sender)
+{
+    byte md5_result[MD5_DIGEST_SIZE];
+
+    /* make md5 inner */    
+    Md5Update(&ssl->hashMd5, sender, SIZEOF_SENDER);
+    Md5Update(&ssl->hashMd5, ssl->arrays.masterSecret, SECRET_LEN);
+    Md5Update(&ssl->hashMd5, PAD1, PAD_MD5);
+    Md5Final(&ssl->hashMd5, md5_result);
+
+    /* make md5 outer */
+    Md5Update(&ssl->hashMd5, ssl->arrays.masterSecret, SECRET_LEN);
+    Md5Update(&ssl->hashMd5, PAD2, PAD_MD5);
+    Md5Update(&ssl->hashMd5, md5_result, MD5_DIGEST_SIZE);
+
+    Md5Final(&ssl->hashMd5, hashes->md5);
+}
+
+
+/* calculate SHA hash for finished */
+static void BuildSHA(CYASSL* ssl, Hashes* hashes, const byte* sender)
+{
+    byte sha_result[SHA_DIGEST_SIZE];
+
+    /* make sha inner */
+    ShaUpdate(&ssl->hashSha, sender, SIZEOF_SENDER);
+    ShaUpdate(&ssl->hashSha, ssl->arrays.masterSecret, SECRET_LEN);
+    ShaUpdate(&ssl->hashSha, PAD1, PAD_SHA);
+    ShaFinal(&ssl->hashSha, sha_result);
+
+    /* make sha outer */
+    ShaUpdate(&ssl->hashSha, ssl->arrays.masterSecret, SECRET_LEN);
+    ShaUpdate(&ssl->hashSha, PAD2, PAD_SHA);
+    ShaUpdate(&ssl->hashSha, sha_result, SHA_DIGEST_SIZE);
+
+    ShaFinal(&ssl->hashSha, hashes->sha);
+}
+
+
+static void BuildFinished(CYASSL* ssl, Hashes* hashes, const byte* sender)
+{
+    /* store current states, building requires get_digest which resets state */
+    Md5 md5 = ssl->hashMd5;
+    Sha sha = ssl->hashSha;
+#ifndef NO_SHA256
+    Sha256 sha256;
+#endif
+#ifdef CYASSL_SHA384
+    Sha384 sha384;
+#endif
+
+#ifndef NO_SHA256
+    InitSha256(&sha256);
+    if (IsAtLeastTLSv1_2(ssl))
+        sha256 = ssl->hashSha256;
+#endif
+#ifdef CYASSL_SHA384
+    InitSha384(&sha384);
+    if (IsAtLeastTLSv1_2(ssl))
+        sha384 = ssl->hashSha384;
+#endif
+
+    if (ssl->options.tls)
+        BuildTlsFinished(ssl, hashes, sender);
+    else {
+        BuildMD5(ssl, hashes, sender);
+        BuildSHA(ssl, hashes, sender);
+    }
+    
+    /* restore */
+    ssl->hashMd5 = md5;
+    ssl->hashSha = sha;
+    if (IsAtLeastTLSv1_2(ssl)) {
+#ifndef NO_SHA256
+        ssl->hashSha256 = sha256;
+#endif
+#ifdef CYASSL_SHA384
+        ssl->hashSha384 = sha384;
+#endif
+    }
+}
+
+
+static int DoCertificate(CYASSL* ssl, byte* input, word32* inOutIdx)
+{
+    word32 listSz, i = *inOutIdx;
+    int    ret = 0;
+    int    anyError = 0;
+    int    totalCerts = 0;    /* number of certs in certs buffer */
+    int    count;
+    char   domain[ASN_NAME_MAX];
+    buffer certs[MAX_CHAIN_DEPTH];
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("Certificate", &ssl->handShakeInfo);
+        if (ssl->toInfoOn) AddLateName("Certificate", &ssl->timeoutInfo);
+    #endif
+    c24to32(&input[i], &listSz);
+    i += CERT_HEADER_SZ;
+
+    CYASSL_MSG("Loading peer's cert chain");
+    /* first put cert chain into buffer so can verify top down
+       we're sent bottom up */
+    while (listSz) {
+        /* cert size */
+        word32 certSz;
+
+        if (totalCerts >= MAX_CHAIN_DEPTH)
+            return MAX_CHAIN_ERROR;
+
+        c24to32(&input[i], &certSz);
+        i += CERT_HEADER_SZ;
+       
+        if (listSz > MAX_RECORD_SIZE || certSz > MAX_RECORD_SIZE)
+            return BUFFER_E;
+
+        certs[totalCerts].length = certSz;
+        certs[totalCerts].buffer = input + i;
+
+#ifdef SESSION_CERTS
+        if (ssl->session.chain.count < MAX_CHAIN_DEPTH &&
+                                       certSz < MAX_X509_SIZE) {
+            ssl->session.chain.certs[ssl->session.chain.count].length = certSz;
+            XMEMCPY(ssl->session.chain.certs[ssl->session.chain.count].buffer,
+                    input + i, certSz);
+            ssl->session.chain.count++;
+        } else {
+            CYASSL_MSG("Couldn't store chain cert for session");
+        }
+#endif
+
+        i += certSz;
+        listSz -= certSz + CERT_HEADER_SZ;
+
+        totalCerts++;
+        CYASSL_MSG("    Put another cert into chain");
+    }
+
+    count = totalCerts;
+
+    /* verify up to peer's first */
+    while (count > 1) {
+        buffer myCert = certs[count - 1];
+        DecodedCert dCert;
+
+        InitDecodedCert(&dCert, myCert.buffer, myCert.length, ssl->heap);
+        ret = ParseCertRelative(&dCert, CERT_TYPE, !ssl->options.verifyNone,
+                                ssl->ctx->cm);
+        if (ret == 0 && dCert.isCA == 0) {
+            CYASSL_MSG("Chain cert is not a CA, not adding as one");
+        }
+        else if (ret == 0 && ssl->options.verifyNone) {
+            CYASSL_MSG("Chain cert not verified by option, not adding as CA");
+        }
+        else if (ret == 0 && !AlreadySigner(ssl->ctx->cm, dCert.subjectHash)) {
+            buffer add;
+            add.length = myCert.length;
+            add.buffer = (byte*)XMALLOC(myCert.length, ssl->heap,
+                                        DYNAMIC_TYPE_CA);
+            CYASSL_MSG("Adding CA from chain");
+
+            if (add.buffer == NULL)
+                return MEMORY_E;
+            XMEMCPY(add.buffer, myCert.buffer, myCert.length);
+
+            ret = AddCA(ssl->ctx->cm, add, CYASSL_CHAIN_CA,
+                        ssl->ctx->verifyPeer);
+            if (ret == 1) ret = 0;   /* SSL_SUCCESS for external */
+        }
+        else if (ret != 0) {
+            CYASSL_MSG("Failed to verify CA from chain");
+        }
+        else {
+            CYASSL_MSG("Verified CA from chain and already had it");
+        }
+
+#ifdef HAVE_CRL
+        if (ret == 0 && ssl->ctx->cm->crlEnabled && ssl->ctx->cm->crlCheckAll) {
+            CYASSL_MSG("Doing Non Leaf CRL check");
+            ret = CheckCertCRL(ssl->ctx->cm->crl, &dCert);
+
+            if (ret != 0) {
+                CYASSL_MSG("\tCRL check not ok");
+            }
+        }
+#endif /* HAVE_CRL */
+
+        if (ret != 0 && anyError == 0)
+            anyError = ret;   /* save error from last time */
+
+        FreeDecodedCert(&dCert);
+        count--;
+    }
+
+    /* peer's, may not have one if blank client cert sent by TLSv1.2 */
+    if (count) {
+        buffer myCert = certs[0];
+        DecodedCert dCert;
+        int         fatal = 0;
+
+        CYASSL_MSG("Veriying Peer's cert");
+
+        InitDecodedCert(&dCert, myCert.buffer, myCert.length, ssl->heap);
+        ret = ParseCertRelative(&dCert, CERT_TYPE, !ssl->options.verifyNone,
+                                ssl->ctx->cm);
+        if (ret == 0) {
+            CYASSL_MSG("Verified Peer's cert");
+            fatal = 0;
+        }
+        else if (ret == ASN_PARSE_E) {
+            CYASSL_MSG("Got Peer cert ASN PARSE ERROR, fatal");
+            fatal = 1;
+        }
+        else {
+            CYASSL_MSG("Failed to verify Peer's cert");
+            if (ssl->verifyCallback) {
+                CYASSL_MSG("\tCallback override availalbe, will continue");
+                fatal = 0;
+            }
+            else {
+                CYASSL_MSG("\tNo callback override availalbe, fatal");
+                fatal = 1;
+            }
+        }
+
+#ifdef HAVE_OCSP
+        ret = CyaSSL_OCSP_Lookup_Cert(&ssl->ctx->ocsp, &dCert);
+        if (ret != 0) {
+            CYASSL_MSG("\tOCSP Lookup not ok");
+            fatal = 0;
+        }
+#endif
+
+#ifdef HAVE_CRL
+        if (fatal == 0 && ssl->ctx->cm->crlEnabled) {
+            CYASSL_MSG("Doing Leaf CRL check");
+            ret = CheckCertCRL(ssl->ctx->cm->crl, &dCert);
+
+            if (ret != 0) {
+                CYASSL_MSG("\tCRL check not ok");
+                fatal = 0;
+            }
+        }
+#endif /* HAVE_CRL */
+
+#ifdef OPENSSL_EXTRA
+        /* set X509 format for peer cert even if fatal */
+        XSTRNCPY(ssl->peerCert.issuer.name, dCert.issuer, ASN_NAME_MAX);
+        ssl->peerCert.issuer.name[ASN_NAME_MAX - 1] = '\0';
+        ssl->peerCert.issuer.sz = (int)XSTRLEN(ssl->peerCert.issuer.name) + 1;
+
+        XSTRNCPY(ssl->peerCert.subject.name, dCert.subject, ASN_NAME_MAX);
+        ssl->peerCert.subject.name[ASN_NAME_MAX - 1] = '\0';
+        ssl->peerCert.subject.sz = (int)XSTRLEN(ssl->peerCert.subject.name) + 1;
+
+        XMEMCPY(ssl->peerCert.serial, dCert.serial, EXTERNAL_SERIAL_SIZE);
+        ssl->peerCert.serialSz = dCert.serialSz;
+        if (dCert.subjectCNLen < ASN_NAME_MAX) {
+            XMEMCPY(ssl->peerCert.subjectCN,dCert.subjectCN,dCert.subjectCNLen);
+            ssl->peerCert.subjectCN[dCert.subjectCNLen] = '\0';
+        }
+        else
+            ssl->peerCert.subjectCN[0] = '\0';
+
+        /* store cert for potential retrieval */
+        ssl->peerCert.derCert.buffer = (byte*)XMALLOC(myCert.length, ssl->heap,
+                                                      DYNAMIC_TYPE_CERT);
+        if (ssl->peerCert.derCert.buffer == NULL) {
+            ret   = MEMORY_E;
+            fatal = 1;
+        }
+        else {
+            XMEMCPY(ssl->peerCert.derCert.buffer, myCert.buffer, myCert.length);
+            ssl->peerCert.derCert.length = myCert.length;
+        }
+
+        ssl->peerCert.altNames = dCert.altNames;
+        dCert.altNames = NULL;     /* takes ownership */
+        ssl->peerCert.altNamesNext = ssl->peerCert.altNames;  /* index hint */
+#endif    
+
+        if (fatal) {
+            FreeDecodedCert(&dCert);
+            ssl->error = ret;
+            return ret;
+        }
+        ssl->options.havePeerCert = 1;
+
+        /* store for callback use */
+        if (dCert.subjectCNLen < ASN_NAME_MAX) {
+            XMEMCPY(domain, dCert.subjectCN, dCert.subjectCNLen);
+            domain[dCert.subjectCNLen] = '\0';
+        }
+        else
+            domain[0] = '\0';
+
+        if (!ssl->options.verifyNone && ssl->buffers.domainName.buffer)
+            if (XSTRNCMP((char*)ssl->buffers.domainName.buffer,
+                        dCert.subjectCN,
+                        ssl->buffers.domainName.length - 1)) {
+                ret = DOMAIN_NAME_MISMATCH;   /* try to get peer key still */
+            }
+
+        /* decode peer key */
+        if (dCert.keyOID == RSAk) {
+            word32 idx = 0;
+            if (RsaPublicKeyDecode(dCert.publicKey, &idx,
+                               &ssl->peerRsaKey, dCert.pubKeySize) != 0) {
+                ret = PEER_KEY_ERROR;
+            }
+            else
+                ssl->peerRsaKeyPresent = 1;
+        }
+#ifdef HAVE_NTRU
+        else if (dCert.keyOID == NTRUk) {
+            if (dCert.pubKeySize > sizeof(ssl->peerNtruKey)) {
+                ret = PEER_KEY_ERROR;
+            }
+            else {
+                XMEMCPY(ssl->peerNtruKey, dCert.publicKey, dCert.pubKeySize);
+                ssl->peerNtruKeyLen = (word16)dCert.pubKeySize;
+                ssl->peerNtruKeyPresent = 1;
+            }
+        }
+#endif /* HAVE_NTRU */
+#ifdef HAVE_ECC
+        else if (dCert.keyOID == ECDSAk) {
+            if (ecc_import_x963(dCert.publicKey, dCert.pubKeySize,
+                                &ssl->peerEccDsaKey) != 0) {
+                ret = PEER_KEY_ERROR;
+            }
+            else
+                ssl->peerEccDsaKeyPresent = 1;
+        }
+#endif /* HAVE_ECC */
+
+        FreeDecodedCert(&dCert);
+    }
+    
+    if (anyError != 0 && ret == 0)
+        ret = anyError;
+
+    if (ret == 0 && ssl->options.side == CLIENT_END)
+        ssl->options.serverState = SERVER_CERT_COMPLETE;
+
+    if (ret != 0) {
+        if (!ssl->options.verifyNone) {
+            int why = bad_certificate;
+            if (ret == ASN_AFTER_DATE_E || ret == ASN_BEFORE_DATE_E)
+                why = certificate_expired;
+            if (ssl->verifyCallback) {
+                int            ok;
+                CYASSL_X509_STORE_CTX store;
+
+                store.error = ret;
+                store.error_depth = totalCerts;
+                store.domain = domain;
+#ifdef OPENSSL_EXTRA
+                store.current_cert = &ssl->peerCert;
+#else
+                store.current_cert = NULL;
+#endif
+#ifdef FORTRESS
+                store.ex_data = ssl;
+#endif
+                ok = ssl->verifyCallback(0, &store);
+                if (ok) {
+                    CYASSL_MSG("Verify callback overriding error!"); 
+                    ret = 0;
+                }
+            }
+            if (ret != 0) {
+                SendAlert(ssl, alert_fatal, why);   /* try to send */
+                ssl->options.isClosed = 1;
+            }
+        }
+        ssl->error = ret;
+    }
+#ifdef FORTRESS
+    else {
+        if (ssl->verifyCallback) {
+            int ok;
+            CYASSL_X509_STORE_CTX store;
+
+            store.error = ret;
+            store.error_depth = totalCerts;
+            store.domain = domain;
+            store.current_cert = &ssl->peerCert;
+            store.ex_data = ssl;
+
+            ok = ssl->verifyCallback(1, &store);
+            if (!ok) {
+                CYASSL_MSG("Verify callback overriding valid certificate!");
+                ret = -1;
+                SendAlert(ssl, alert_fatal, bad_certificate);
+                ssl->options.isClosed = 1;
+            }
+        }
+    }
+#endif
+
+    *inOutIdx = i;
+    return ret;
+}
+
+
+static int DoHelloRequest(CYASSL* ssl, const byte* input, word32* inOutIdx)
+{
+    if (ssl->keys.encryptionOn) {
+        const byte* mac;
+        int         padSz = ssl->keys.encryptSz - HANDSHAKE_HEADER_SZ - 
+                            ssl->specs.hash_size;
+        byte        verify[SHA256_DIGEST_SIZE];
+       
+        ssl->hmac(ssl, verify, input + *inOutIdx - HANDSHAKE_HEADER_SZ,
+                  HANDSHAKE_HEADER_SZ, handshake, 1);
+        /* read mac and fill */
+        mac = input + *inOutIdx;
+        *inOutIdx += ssl->specs.hash_size;
+
+        if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
+            padSz -= ssl->specs.block_size;
+
+        *inOutIdx += padSz;
+
+        /* verify */
+        if (XMEMCMP(mac, verify, ssl->specs.hash_size)) {
+            CYASSL_MSG("    hello_request verify mac error");
+            return VERIFY_MAC_ERROR;
+        }
+    }
+
+    return SendAlert(ssl, alert_warning, no_renegotiation);
+}
+
+
+int DoFinished(CYASSL* ssl, const byte* input, word32* inOutIdx, int sniff)
+{
+    byte   verifyMAC[SHA256_DIGEST_SIZE];
+    int    finishedSz = ssl->options.tls ? TLS_FINISHED_SZ : FINISHED_SZ;
+    int    headerSz = HANDSHAKE_HEADER_SZ;
+    word32 macSz = finishedSz + HANDSHAKE_HEADER_SZ,
+           idx = *inOutIdx,
+           padSz = ssl->keys.encryptSz - HANDSHAKE_HEADER_SZ - finishedSz -
+                   ssl->specs.hash_size;
+    const byte* mac;
+
+    #ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            headerSz += DTLS_HANDSHAKE_EXTRA;
+            macSz    += DTLS_HANDSHAKE_EXTRA;
+            padSz    -= DTLS_HANDSHAKE_EXTRA;
+        }
+    #endif
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("Finished", &ssl->handShakeInfo);
+        if (ssl->toInfoOn) AddLateName("Finished", &ssl->timeoutInfo);
+    #endif
+    if (sniff == NO_SNIFF) {
+        if (XMEMCMP(input + idx, &ssl->verifyHashes, finishedSz)) {
+            CYASSL_MSG("Verify finished error on hashes");
+            return VERIFY_FINISHED_ERROR;
+        }
+    }
+
+    if (ssl->specs.cipher_type != aead) {
+        ssl->hmac(ssl, verifyMAC, input + idx - headerSz, macSz,
+             handshake, 1);
+        idx += finishedSz;
+
+        /* read mac and fill */
+        mac = input + idx;
+        idx += ssl->specs.hash_size;
+
+        if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
+            padSz -= ssl->specs.block_size;
+
+        idx += padSz;
+
+        /* verify mac */
+        if (XMEMCMP(mac, verifyMAC, ssl->specs.hash_size)) {
+            CYASSL_MSG("Verify finished error on mac");
+            return VERIFY_MAC_ERROR;
+        }
+    }
+    else {
+        idx += (finishedSz + AEAD_AUTH_TAG_SZ);
+    }
+
+    if (ssl->options.side == CLIENT_END) {
+        ssl->options.serverState = SERVER_FINISHED_COMPLETE;
+        if (!ssl->options.resuming)
+            ssl->options.handShakeState = HANDSHAKE_DONE;
+    }
+    else {
+        ssl->options.clientState = CLIENT_FINISHED_COMPLETE;
+        if (ssl->options.resuming)
+            ssl->options.handShakeState = HANDSHAKE_DONE;
+    }
+
+    *inOutIdx = idx;
+    return 0;
+}
+
+
+static int DoHandShakeMsg(CYASSL* ssl, byte* input, word32* inOutIdx,
+                          word32 totalSz)
+{
+    byte type;
+    word32 size;
+    int ret = 0;
+
+    CYASSL_ENTER("DoHandShakeMsg()");
+
+    if (GetHandShakeHeader(ssl, input, inOutIdx, &type, &size) != 0)
+        return PARSE_ERROR;
+
+    if (*inOutIdx + size > totalSz)
+        return INCOMPLETE_DATA;
+    
+    HashInput(ssl, input + *inOutIdx, size);
+#ifdef CYASSL_CALLBACKS
+    /* add name later, add on record and handshake header part back on */
+    if (ssl->toInfoOn) {
+        int add = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+        AddPacketInfo(0, &ssl->timeoutInfo, input + *inOutIdx - add,
+                      size + add, ssl->heap);
+        AddLateRecordHeader(&ssl->curRL, &ssl->timeoutInfo);
+    }
+#endif
+
+    switch (type) {
+
+    case hello_request:
+        CYASSL_MSG("processing hello request");
+        ret = DoHelloRequest(ssl, input, inOutIdx);
+        break;
+
+#ifndef NO_CYASSL_CLIENT
+    case hello_verify_request:
+        CYASSL_MSG("processing hello verify request");
+        ret = DoHelloVerifyRequest(ssl, input,inOutIdx);
+        break;
+            
+    case server_hello:
+        CYASSL_MSG("processing server hello");
+        ret = DoServerHello(ssl, input, inOutIdx, size);
+        break;
+
+    case certificate_request:
+        CYASSL_MSG("processing certificate request");
+        ret = DoCertificateRequest(ssl, input, inOutIdx);
+        break;
+
+    case server_key_exchange:
+        CYASSL_MSG("processing server key exchange");
+        ret = DoServerKeyExchange(ssl, input, inOutIdx);
+        break;
+#endif
+
+    case certificate:
+        CYASSL_MSG("processing certificate");
+        ret =  DoCertificate(ssl, input, inOutIdx);
+        break;
+
+    case server_hello_done:
+        CYASSL_MSG("processing server hello done");
+        #ifdef CYASSL_CALLBACKS
+            if (ssl->hsInfoOn) 
+                AddPacketName("ServerHelloDone", &ssl->handShakeInfo);
+            if (ssl->toInfoOn)
+                AddLateName("ServerHelloDone", &ssl->timeoutInfo);
+        #endif
+        ssl->options.serverState = SERVER_HELLODONE_COMPLETE;
+        break;
+
+    case finished:
+        CYASSL_MSG("processing finished");
+        ret = DoFinished(ssl, input, inOutIdx, NO_SNIFF);
+        break;
+
+#ifndef NO_CYASSL_SERVER
+    case client_hello:
+        CYASSL_MSG("processing client hello");
+        ret = DoClientHello(ssl, input, inOutIdx, totalSz, size);
+        break;
+
+    case client_key_exchange:
+        CYASSL_MSG("processing client key exchange");
+        ret = DoClientKeyExchange(ssl, input, inOutIdx);
+        break;
+
+    case certificate_verify:
+        CYASSL_MSG("processing certificate verify");
+        ret = DoCertificateVerify(ssl, input, inOutIdx, totalSz);
+        break;
+
+#endif
+
+    default:
+        CYASSL_MSG("Unknown handshake message type");
+        ret = UNKNOWN_HANDSHAKE_TYPE;
+    }
+
+    CYASSL_LEAVE("DoHandShakeMsg()", ret);
+    return ret;
+}
+
+
+static INLINE word32 GetSEQIncrement(CYASSL* ssl, int verify)
+{
+    if (verify)
+        return ssl->keys.peer_sequence_number++; 
+    else
+        return ssl->keys.sequence_number++; 
+}
+
+
+static INLINE void Encrypt(CYASSL* ssl, byte* out, const byte* input, word32 sz)
+{
+    switch (ssl->specs.bulk_cipher_algorithm) {
+        #ifdef BUILD_ARC4
+            case rc4:
+                Arc4Process(&ssl->encrypt.arc4, out, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_DES3
+            case triple_des:
+                Des3_CbcEncrypt(&ssl->encrypt.des3, out, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_AES
+            case aes:
+            #ifdef CYASSL_AESNI
+                if ((word)input % 16) {
+                    byte buffer[MAX_RECORD_SIZE + MAX_COMP_EXTRA+MAX_MSG_EXTRA];
+                    XMEMCPY(buffer, input, sz);
+                    AesCbcEncrypt(&ssl->encrypt.aes, buffer, buffer, sz);
+                    XMEMCPY(out, buffer, sz);
+                    break;
+                }
+            #endif
+                AesCbcEncrypt(&ssl->encrypt.aes, out, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_AESGCM
+            case aes_gcm:
+                {
+                    byte additional[AES_BLOCK_SIZE];
+
+                    XMEMSET(additional, 0, AES_BLOCK_SIZE);
+
+                    /* sequence number field is 64-bits, we only use 32-bits */
+                    c32toa(GetSEQIncrement(ssl, 0),
+                                            additional + AEAD_SEQ_OFFSET);
+
+                    /* Store the type, version. Unfortunately, they are in
+                     * the input buffer ahead of the plaintext. */
+                    XMEMCPY(additional + AEAD_TYPE_OFFSET, input - 5, 3);
+
+                    /* Store the length of the plain text minus the explicit
+                     * IV length minus the authentication tag size. */
+                    c16toa(sz - AES_GCM_EXP_IV_SZ - AEAD_AUTH_TAG_SZ,
+                                                additional + AEAD_LEN_OFFSET);
+                    AesGcmEncrypt(&ssl->encrypt.aes,
+                        out + AES_GCM_EXP_IV_SZ, input + AES_GCM_EXP_IV_SZ,
+                            sz - AES_GCM_EXP_IV_SZ - AEAD_AUTH_TAG_SZ,
+                        out + sz - AEAD_AUTH_TAG_SZ, AEAD_AUTH_TAG_SZ,
+                        additional, AEAD_AUTH_DATA_SZ);
+                    AesGcmIncExpIV(&ssl->encrypt.aes);
+                }
+                break;
+        #endif
+
+        #ifdef HAVE_HC128
+            case hc128:
+                Hc128_Process(&ssl->encrypt.hc128, out, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_RABBIT
+            case rabbit:
+                RabbitProcess(&ssl->encrypt.rabbit, out, input, sz);
+                break;
+        #endif
+
+            default:
+                CYASSL_MSG("CyaSSL Encrypt programming error");
+    }
+}
+
+
+static INLINE int Decrypt(CYASSL* ssl, byte* plain, const byte* input,
+                           word32 sz)
+{
+    switch (ssl->specs.bulk_cipher_algorithm) {
+        #ifdef BUILD_ARC4
+            case rc4:
+                Arc4Process(&ssl->decrypt.arc4, plain, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_DES3
+            case triple_des:
+                Des3_CbcDecrypt(&ssl->decrypt.des3, plain, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_AES
+            case aes:
+                AesCbcDecrypt(&ssl->decrypt.aes, plain, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_AESGCM
+            case aes_gcm:
+            {
+                byte additional[AES_BLOCK_SIZE];
+
+                AesGcmSetExpIV(&ssl->decrypt.aes, input);
+                XMEMSET(additional, 0, AES_BLOCK_SIZE);
+
+                /* sequence number field is 64-bits, we only use 32-bits */
+                c32toa(GetSEQIncrement(ssl, 1), additional + AEAD_SEQ_OFFSET);
+                
+                additional[AEAD_TYPE_OFFSET] = ssl->curRL.type;
+                additional[AEAD_VMAJ_OFFSET] = ssl->curRL.version.major;
+                additional[AEAD_VMIN_OFFSET] = ssl->curRL.version.minor;
+
+                c16toa(sz - AES_GCM_EXP_IV_SZ - AEAD_AUTH_TAG_SZ,
+                                        additional + AEAD_LEN_OFFSET);
+                if (AesGcmDecrypt(&ssl->decrypt.aes,
+                            plain + AES_GCM_EXP_IV_SZ,
+                            input + AES_GCM_EXP_IV_SZ,
+                                sz - AES_GCM_EXP_IV_SZ - AEAD_AUTH_TAG_SZ,
+                            input + sz - AEAD_AUTH_TAG_SZ, AEAD_AUTH_TAG_SZ,
+                            additional, AEAD_AUTH_DATA_SZ) < 0) {
+                    SendAlert(ssl, alert_fatal, bad_record_mac);
+                    return VERIFY_MAC_ERROR;
+                }
+                break;
+            }
+        #endif
+
+        #ifdef HAVE_HC128
+            case hc128:
+                Hc128_Process(&ssl->decrypt.hc128, plain, input, sz);
+                break;
+        #endif
+
+        #ifdef BUILD_RABBIT
+            case rabbit:
+                RabbitProcess(&ssl->decrypt.rabbit, plain, input, sz);
+                break;
+        #endif
+
+            default:
+                CYASSL_MSG("CyaSSL Decrypt programming error");
+    }
+    return 0;
+}
+
+
+/* decrypt input message in place */
+static int DecryptMessage(CYASSL* ssl, byte* input, word32 sz, word32* idx)
+{
+    int decryptResult = Decrypt(ssl, input, input, sz);
+
+    if (decryptResult == 0)
+    {
+        ssl->keys.encryptSz = sz;
+        if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
+            *idx += ssl->specs.block_size;  /* go past TLSv1.1 IV */
+        if (ssl->specs.cipher_type == aead)
+            *idx += AES_GCM_EXP_IV_SZ;
+    }
+
+    return decryptResult;
+}
+
+
+int DoApplicationData(CYASSL* ssl, byte* input, word32* inOutIdx)
+{
+    word32 msgSz   = ssl->keys.encryptSz;
+    word32 pad     = 0, 
+           padByte = 0,
+           idx     = *inOutIdx,
+           digestSz = ssl->specs.hash_size;
+    int    dataSz;
+    int    ivExtra = 0;
+    byte*  rawData = input + idx;  /* keep current  for hmac */
+#ifdef HAVE_LIBZ
+    byte   decomp[MAX_RECORD_SIZE + MAX_COMP_EXTRA];
+#endif
+
+    byte        verify[SHA256_DIGEST_SIZE];
+    const byte* mac;
+
+    if (ssl->specs.cipher_type == block) {
+        if (ssl->options.tls1_1)
+            ivExtra = ssl->specs.block_size;
+        pad = *(input + idx + msgSz - ivExtra - 1);
+        padByte = 1;
+    }
+    if (ssl->specs.cipher_type == aead) {
+        ivExtra = AES_GCM_EXP_IV_SZ;
+        digestSz = AEAD_AUTH_TAG_SZ;
+    }
+
+    dataSz = msgSz - ivExtra - digestSz - pad - padByte;
+    if (dataSz < 0) {
+        CYASSL_MSG("App data buffer error, malicious input?"); 
+        return BUFFER_ERROR;
+    }
+
+    /* read data */
+    if (dataSz) {
+        int    rawSz   = dataSz;       /* keep raw size for hmac */
+
+        if (ssl->specs.cipher_type != aead)
+            ssl->hmac(ssl, verify, rawData, rawSz, application_data, 1);
+
+#ifdef HAVE_LIBZ
+        if (ssl->options.usingCompression) {
+            dataSz = DeCompress(ssl, rawData, dataSz, decomp, sizeof(decomp));
+            if (dataSz < 0) return dataSz;
+        }
+#endif
+
+        if (ssl->options.usingCompression)
+            idx += rawSz;
+        else
+            idx += dataSz;
+
+        ssl->buffers.clearOutputBuffer.buffer = rawData;
+        ssl->buffers.clearOutputBuffer.length = dataSz;
+    }
+
+    /* read mac and fill */
+    mac = input + idx;
+    idx += digestSz;
+   
+    idx += pad;
+    if (padByte)
+        idx++;
+
+    /* verify */
+    if (dataSz) {
+        if (ssl->specs.cipher_type != aead && XMEMCMP(mac, verify, digestSz)) {
+            CYASSL_MSG("App data verify mac error"); 
+            return VERIFY_MAC_ERROR;
+        }
+    }
+    else 
+        GetSEQIncrement(ssl, 1);  /* even though no data, increment verify */
+
+#ifdef HAVE_LIBZ
+    /* decompress could be bigger, overwrite after verify */
+    if (ssl->options.usingCompression)
+        XMEMMOVE(rawData, decomp, dataSz);
+#endif
+
+    *inOutIdx = idx;
+    return 0;
+}
+
+
+/* process alert, return level */
+static int DoAlert(CYASSL* ssl, byte* input, word32* inOutIdx, int* type)
+{
+    byte level;
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("Alert", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            /* add record header back on to info + 2 byte level, data */
+            AddPacketInfo("Alert", &ssl->timeoutInfo, input + *inOutIdx -
+                          RECORD_HEADER_SZ, 2 + RECORD_HEADER_SZ, ssl->heap);
+    #endif
+    level = input[(*inOutIdx)++];
+    *type  = (int)input[(*inOutIdx)++];
+
+    CYASSL_MSG("Got alert");
+    if (*type == close_notify) {
+        CYASSL_MSG("    close notify");
+        ssl->options.closeNotify = 1;
+    }
+    CYASSL_ERROR(*type);
+
+    if (ssl->keys.encryptionOn) {
+        if (ssl->specs.cipher_type != aead) {
+            int     aSz = ALERT_SIZE;
+            const byte* mac;
+            byte    verify[SHA256_DIGEST_SIZE];
+            int     padSz = ssl->keys.encryptSz - aSz - ssl->specs.hash_size;
+
+            ssl->hmac(ssl, verify, input + *inOutIdx - aSz, aSz, alert, 1);
+    
+            /* read mac and fill */
+            mac = input + *inOutIdx;
+            *inOutIdx += (ssl->specs.hash_size + padSz);
+    
+            /* verify */
+            if (XMEMCMP(mac, verify, ssl->specs.hash_size)) {
+                CYASSL_MSG("    alert verify mac error");
+                return VERIFY_MAC_ERROR;
+            }
+        }
+        else {
+            *inOutIdx += AEAD_AUTH_TAG_SZ;
+        }
+    }
+
+    return level;
+}
+
+static int GetInputData(CYASSL *ssl, word32 size)
+{
+    int in;
+    int inSz;
+    int maxLength;
+    int usedLength;
+
+    
+    /* check max input length */
+    usedLength = ssl->buffers.inputBuffer.length - ssl->buffers.inputBuffer.idx;
+    maxLength  = ssl->buffers.inputBuffer.bufferSize - usedLength;
+    inSz       = (int)(size - usedLength);      /* from last partial read */
+
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls)
+        inSz = MAX_MTU;       /* read ahead up to MTU */
+#endif
+    
+    if (inSz > maxLength) {
+        if (GrowInputBuffer(ssl, size, usedLength) < 0)
+            return MEMORY_E;
+    }
+           
+    if (inSz <= 0)
+        return BUFFER_ERROR;
+    
+    /* Put buffer data at start if not there */
+    if (usedLength > 0 && ssl->buffers.inputBuffer.idx != 0)
+        XMEMMOVE(ssl->buffers.inputBuffer.buffer,
+                ssl->buffers.inputBuffer.buffer + ssl->buffers.inputBuffer.idx,
+                usedLength);
+    
+    /* remove processed data */
+    ssl->buffers.inputBuffer.idx    = 0;
+    ssl->buffers.inputBuffer.length = usedLength;
+  
+    /* read data from network */
+    do {
+        in = Receive(ssl, 
+                     ssl->buffers.inputBuffer.buffer +
+                     ssl->buffers.inputBuffer.length, 
+                     inSz);
+        if (in == -1)
+            return SOCKET_ERROR_E;
+   
+        if (in == WANT_READ)
+            return WANT_READ;
+        
+        ssl->buffers.inputBuffer.length += in;
+        inSz -= in;
+
+    } while (ssl->buffers.inputBuffer.length < size);
+
+    return 0;
+}
+
+/* process input requests, return 0 is done, 1 is call again to complete, and
+   negative number is error */
+int ProcessReply(CYASSL* ssl)
+{
+    int    ret, type, readSz;
+    word32 startIdx = 0;
+#ifndef NO_CYASSL_SERVER
+    byte   b0, b1;
+#endif
+#ifdef CYASSL_DTLS
+    int    used;
+#endif
+
+    for (;;) {
+        switch ((processReply)ssl->options.processReply) {
+
+        /* in the CYASSL_SERVER case, get the first byte for detecting 
+         * old client hello */
+        case doProcessInit:
+            
+            readSz = RECORD_HEADER_SZ;
+            
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls)
+                    readSz = DTLS_RECORD_HEADER_SZ;
+            #endif
+
+            /* get header or return error */
+            if (!ssl->options.dtls) {
+                if ((ret = GetInputData(ssl, readSz)) < 0)
+                    return ret;
+            } else {
+            #ifdef CYASSL_DTLS
+                /* read ahead may already have header */
+                used = ssl->buffers.inputBuffer.length -
+                       ssl->buffers.inputBuffer.idx;
+                if (used < readSz)
+                    if ((ret = GetInputData(ssl, readSz)) < 0)
+                        return ret;
+            #endif
+            }
+
+#ifndef NO_CYASSL_SERVER
+
+            /* see if sending SSLv2 client hello */
+            if ( ssl->options.side == SERVER_END &&
+                 ssl->options.clientState == NULL_STATE &&
+                 ssl->buffers.inputBuffer.buffer[ssl->buffers.inputBuffer.idx]
+                         != handshake) {
+                ssl->options.processReply = runProcessOldClientHello;
+
+                /* how many bytes need ProcessOldClientHello */
+                b0 =
+                ssl->buffers.inputBuffer.buffer[ssl->buffers.inputBuffer.idx++];
+                b1 =
+                ssl->buffers.inputBuffer.buffer[ssl->buffers.inputBuffer.idx++];
+                ssl->curSize = ((b0 & 0x7f) << 8) | b1;
+            }
+            else {
+                ssl->options.processReply = getRecordLayerHeader;
+                continue;
+            }
+
+        /* in the CYASSL_SERVER case, run the old client hello */
+        case runProcessOldClientHello:     
+
+            /* get sz bytes or return error */
+            if (!ssl->options.dtls) {
+                if ((ret = GetInputData(ssl, ssl->curSize)) < 0)
+                    return ret;
+            } else {
+            #ifdef CYASSL_DTLS
+                /* read ahead may already have */
+                used = ssl->buffers.inputBuffer.length -
+                       ssl->buffers.inputBuffer.idx;
+                if (used < ssl->curSize)
+                    if ((ret = GetInputData(ssl, ssl->curSize)) < 0)
+                        return ret;
+            #endif  /* CYASSL_DTLS */
+            }
+
+            ret = ProcessOldClientHello(ssl, ssl->buffers.inputBuffer.buffer,
+                                        &ssl->buffers.inputBuffer.idx,
+                                        ssl->buffers.inputBuffer.length -
+                                        ssl->buffers.inputBuffer.idx,
+                                        ssl->curSize);
+            if (ret < 0)
+                return ret;
+
+            else if (ssl->buffers.inputBuffer.idx ==
+                     ssl->buffers.inputBuffer.length) {
+                ssl->options.processReply = doProcessInit;
+                return 0;
+            }
+
+#endif  /* NO_CYASSL_SERVER */
+
+        /* get the record layer header */
+        case getRecordLayerHeader:
+
+            ret = GetRecordHeader(ssl, ssl->buffers.inputBuffer.buffer,
+                                       &ssl->buffers.inputBuffer.idx,
+                                       &ssl->curRL, &ssl->curSize);
+            if (ret != 0)
+                return ret;
+
+            ssl->options.processReply = getData;
+
+        /* retrieve record layer data */
+        case getData:
+
+            /* get sz bytes or return error */
+            if (!ssl->options.dtls) {
+                if ((ret = GetInputData(ssl, ssl->curSize)) < 0)
+                    return ret;
+            } else {
+#ifdef CYASSL_DTLS
+                /* read ahead may already have */
+                used = ssl->buffers.inputBuffer.length -
+                       ssl->buffers.inputBuffer.idx;
+                if (used < ssl->curSize)
+                    if ((ret = GetInputData(ssl, ssl->curSize)) < 0)
+                        return ret;
+#endif
+            }
+            
+            ssl->options.processReply = runProcessingOneMessage;
+            startIdx = ssl->buffers.inputBuffer.idx;  /* in case > 1 msg per */
+
+        /* the record layer is here */
+        case runProcessingOneMessage:
+
+            if (ssl->keys.encryptionOn)
+                if (DecryptMessage(ssl, ssl->buffers.inputBuffer.buffer + 
+                                        ssl->buffers.inputBuffer.idx,
+                                        ssl->curSize,
+                                        &ssl->buffers.inputBuffer.idx) < 0)
+                    return DECRYPT_ERROR;
+
+            CYASSL_MSG("received record layer msg");
+
+            switch (ssl->curRL.type) {
+                case handshake :
+                    /* debugging in DoHandShakeMsg */
+                    if ((ret = DoHandShakeMsg(ssl, 
+                                              ssl->buffers.inputBuffer.buffer,
+                                              &ssl->buffers.inputBuffer.idx,
+                                              ssl->buffers.inputBuffer.length))
+                                                                           != 0)
+                        return ret;
+                    break;
+
+                case change_cipher_spec:
+                    CYASSL_MSG("got CHANGE CIPHER SPEC");
+                    #ifdef CYASSL_CALLBACKS
+                        if (ssl->hsInfoOn)
+                            AddPacketName("ChangeCipher", &ssl->handShakeInfo);
+                        /* add record header back on info */
+                        if (ssl->toInfoOn) {
+                            AddPacketInfo("ChangeCipher", &ssl->timeoutInfo,
+                                ssl->buffers.inputBuffer.buffer +
+                                ssl->buffers.inputBuffer.idx - RECORD_HEADER_SZ,
+                                1 + RECORD_HEADER_SZ, ssl->heap);
+                            AddLateRecordHeader(&ssl->curRL, &ssl->timeoutInfo);
+                        }
+                    #endif
+                    ssl->buffers.inputBuffer.idx++;
+                    ssl->keys.encryptionOn = 1;
+
+                    #ifdef CYASSL_DTLS
+                        if (ssl->options.dtls)
+                            ssl->keys.dtls_peer_epoch++;
+                    #endif
+
+                    #ifdef HAVE_LIBZ
+                        if (ssl->options.usingCompression)
+                            if ( (ret = InitStreams(ssl)) != 0)
+                                return ret;
+                    #endif
+                    if (ssl->options.resuming && ssl->options.side ==
+                                                                    CLIENT_END)
+                        BuildFinished(ssl, &ssl->verifyHashes, server);
+                    else if (!ssl->options.resuming && ssl->options.side ==
+                                                                    SERVER_END)
+                        BuildFinished(ssl, &ssl->verifyHashes, client);
+                    break;
+
+                case application_data:
+                    CYASSL_MSG("got app DATA");
+                    if ((ret = DoApplicationData(ssl,
+                                                ssl->buffers.inputBuffer.buffer,
+                                               &ssl->buffers.inputBuffer.idx))
+                                                                         != 0) {
+                        CYASSL_ERROR(ret);
+                        return ret;
+                    }
+                    break;
+
+                case alert:
+                    CYASSL_MSG("got ALERT!");
+                    if (DoAlert(ssl, ssl->buffers.inputBuffer.buffer,
+                           &ssl->buffers.inputBuffer.idx, &type) == alert_fatal)
+                        return FATAL_ERROR;
+
+                    /* catch warnings that are handled as errors */
+                    if (type == close_notify)
+                        return ssl->error = ZERO_RETURN;
+                           
+                    if (type == decrypt_error)
+                        return FATAL_ERROR;
+                    break;
+            
+                default:
+                    CYASSL_ERROR(UNKNOWN_RECORD_TYPE);
+                    return UNKNOWN_RECORD_TYPE;
+            }
+
+            ssl->options.processReply = doProcessInit;
+
+            /* input exhausted? */
+            if (ssl->buffers.inputBuffer.idx == ssl->buffers.inputBuffer.length)
+                return 0;
+            /* more messages per record */
+            else if ((ssl->buffers.inputBuffer.idx - startIdx) < ssl->curSize) {
+                CYASSL_MSG("More messages in record");
+                #ifdef CYASSL_DTLS
+                    /* read-ahead but dtls doesn't bundle messages per record */
+                    if (ssl->options.dtls) {
+                        ssl->options.processReply = doProcessInit;
+                        continue;
+                    }
+                #endif
+                ssl->options.processReply = runProcessingOneMessage;
+                continue;
+            }
+            /* more records */
+            else {
+                CYASSL_MSG("More records in input");
+                ssl->options.processReply = doProcessInit;
+                continue;
+            }
+        default:
+            CYASSL_MSG("Bad process input state, programming error");
+            return INPUT_CASE_ERROR;
+        }
+    }
+}
+
+
+int SendChangeCipher(CYASSL* ssl)
+{
+    byte              *output;
+    int                sendSz = RECORD_HEADER_SZ + ENUM_LEN;
+    int                idx    = RECORD_HEADER_SZ;
+    int                ret;
+
+    #ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            sendSz += DTLS_RECORD_EXTRA;
+            idx    += DTLS_RECORD_EXTRA;
+        }
+    #endif
+
+    /* check for avalaible size */
+    if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+        return ret;
+
+    /* get ouput buffer */
+    output = ssl->buffers.outputBuffer.buffer + 
+             ssl->buffers.outputBuffer.length;
+
+    AddRecordHeader(output, 1, change_cipher_spec, ssl);
+
+    output[idx] = 1;             /* turn it on */
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("ChangeCipher", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("ChangeCipher", &ssl->timeoutInfo, output, sendSz,
+                           ssl->heap);
+    #endif
+    ssl->buffers.outputBuffer.length += sendSz;
+
+    if (ssl->options.groupMessages)
+        return 0;
+    else
+        return SendBuffered(ssl);
+}
+
+
+static INLINE const byte* GetMacSecret(CYASSL* ssl, int verify)
+{
+    if ( (ssl->options.side == CLIENT_END && !verify) ||
+         (ssl->options.side == SERVER_END &&  verify) )
+        return ssl->keys.client_write_MAC_secret;
+    else
+        return ssl->keys.server_write_MAC_secret;
+}
+
+
+static void Hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
+                 int content, int verify)
+{
+    byte   result[SHA256_DIGEST_SIZE];                 /* max possible sizes */
+    word32 digestSz = ssl->specs.hash_size;            /* actual sizes */
+    word32 padSz    = ssl->specs.pad_size;
+
+    Md5 md5;
+    Sha sha;
+
+    /* data */
+    byte seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 };
+    byte conLen[ENUM_LEN + LENGTH_SZ];     /* content & length */
+    const byte* macSecret = GetMacSecret(ssl, verify);
+    
+    conLen[0] = (byte)content;
+    c16toa((word16)sz, &conLen[ENUM_LEN]);
+    c32toa(GetSEQIncrement(ssl, verify), &seq[sizeof(word32)]);
+
+    if (ssl->specs.mac_algorithm == md5_mac) {
+        InitMd5(&md5);
+        /* inner */
+        Md5Update(&md5, macSecret, digestSz);
+        Md5Update(&md5, PAD1, padSz);
+        Md5Update(&md5, seq, SEQ_SZ);
+        Md5Update(&md5, conLen, sizeof(conLen));
+        /* in buffer */
+        Md5Update(&md5, in, sz);
+        Md5Final(&md5, result);
+        /* outer */
+        Md5Update(&md5, macSecret, digestSz);
+        Md5Update(&md5, PAD2, padSz);
+        Md5Update(&md5, result, digestSz);
+        Md5Final(&md5, digest);        
+    }
+    else {
+        InitSha(&sha);
+        /* inner */
+        ShaUpdate(&sha, macSecret, digestSz);
+        ShaUpdate(&sha, PAD1, padSz);
+        ShaUpdate(&sha, seq, SEQ_SZ);
+        ShaUpdate(&sha, conLen, sizeof(conLen));
+        /* in buffer */
+        ShaUpdate(&sha, in, sz);
+        ShaFinal(&sha, result);
+        /* outer */
+        ShaUpdate(&sha, macSecret, digestSz);
+        ShaUpdate(&sha, PAD2, padSz);
+        ShaUpdate(&sha, result, digestSz);
+        ShaFinal(&sha, digest);        
+    }
+}
+
+
+static void BuildMD5_CertVerify(CYASSL* ssl, byte* digest)
+{
+    byte md5_result[MD5_DIGEST_SIZE];
+
+    /* make md5 inner */
+    Md5Update(&ssl->hashMd5, ssl->arrays.masterSecret, SECRET_LEN);
+    Md5Update(&ssl->hashMd5, PAD1, PAD_MD5);
+    Md5Final(&ssl->hashMd5, md5_result);
+
+    /* make md5 outer */
+    Md5Update(&ssl->hashMd5, ssl->arrays.masterSecret, SECRET_LEN);
+    Md5Update(&ssl->hashMd5, PAD2, PAD_MD5);
+    Md5Update(&ssl->hashMd5, md5_result, MD5_DIGEST_SIZE);
+
+    Md5Final(&ssl->hashMd5, digest);
+}
+
+
+static void BuildSHA_CertVerify(CYASSL* ssl, byte* digest)
+{
+    byte sha_result[SHA_DIGEST_SIZE];
+    
+    /* make sha inner */
+    ShaUpdate(&ssl->hashSha, ssl->arrays.masterSecret, SECRET_LEN);
+    ShaUpdate(&ssl->hashSha, PAD1, PAD_SHA);
+    ShaFinal(&ssl->hashSha, sha_result);
+
+    /* make sha outer */
+    ShaUpdate(&ssl->hashSha, ssl->arrays.masterSecret, SECRET_LEN);
+    ShaUpdate(&ssl->hashSha, PAD2, PAD_SHA);
+    ShaUpdate(&ssl->hashSha, sha_result, SHA_DIGEST_SIZE);
+
+    ShaFinal(&ssl->hashSha, digest);
+}
+
+
+static void BuildCertHashes(CYASSL* ssl, Hashes* hashes)
+{
+    /* store current states, building requires get_digest which resets state */
+    Md5 md5 = ssl->hashMd5;
+    Sha sha = ssl->hashSha;
+#ifndef NO_SHA256     /* for possible future changes */
+    Sha256 sha256;
+    InitSha256(&sha256);
+    if (IsAtLeastTLSv1_2(ssl))
+        sha256 = ssl->hashSha256;
+#endif
+
+    if (ssl->options.tls) {
+        Md5Final(&ssl->hashMd5, hashes->md5);
+        ShaFinal(&ssl->hashSha, hashes->sha);
+    }
+    else {
+        BuildMD5_CertVerify(ssl, hashes->md5);
+        BuildSHA_CertVerify(ssl, hashes->sha);
+    }
+    
+    /* restore */
+    ssl->hashMd5 = md5;
+    ssl->hashSha = sha;
+#ifndef NO_SHA256
+    if (IsAtLeastTLSv1_2(ssl))
+        ssl->hashSha256 = sha256;
+#endif
+}
+
+
+/* Build SSL Message, encrypted */
+static int BuildMessage(CYASSL* ssl, byte* output, const byte* input, int inSz,
+                        int type)
+{
+    word32 digestSz = ssl->specs.hash_size;
+    word32 sz = RECORD_HEADER_SZ + inSz + digestSz;                
+    word32 pad  = 0, i;
+    word32 idx  = RECORD_HEADER_SZ;
+    word32 ivSz = 0;      /* TLSv1.1  IV */
+    word32 headerSz = RECORD_HEADER_SZ;
+    word16 size;
+    byte               iv[AES_BLOCK_SIZE];                  /* max size */
+
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls) {
+        sz       += DTLS_RECORD_EXTRA;
+        idx      += DTLS_RECORD_EXTRA; 
+        headerSz += DTLS_RECORD_EXTRA;
+    }
+#endif
+
+    if (ssl->specs.cipher_type == block) {
+        word32 blockSz = ssl->specs.block_size;
+        if (ssl->options.tls1_1) {
+            ivSz = blockSz;
+            sz  += ivSz;
+            RNG_GenerateBlock(&ssl->rng, iv, ivSz);
+        }
+        sz += 1;       /* pad byte */
+        pad = (sz - headerSz) % blockSz;
+        pad = blockSz - pad;
+        sz += pad;
+    }
+
+#ifdef BUILD_AESGCM
+    if (ssl->specs.cipher_type == aead) {
+        ivSz = AES_GCM_EXP_IV_SZ;
+        sz += (ivSz + 16 - digestSz);
+        AesGcmGetExpIV(&ssl->encrypt.aes, iv);
+    }
+#endif
+    size = (word16)(sz - headerSz);    /* include mac and digest */
+    AddRecordHeader(output, size, (byte)type, ssl);    
+
+    /* write to output */
+    if (ivSz) {
+        XMEMCPY(output + idx, iv, min(ivSz, sizeof(iv)));
+        idx += ivSz;
+    }
+    XMEMCPY(output + idx, input, inSz);
+    idx += inSz;
+
+    if (type == handshake)
+        HashOutput(ssl, output, headerSz + inSz, ivSz);
+    if (ssl->specs.cipher_type != aead) {
+        ssl->hmac(ssl, output+idx, output + headerSz + ivSz, inSz, type, 0);
+        idx += digestSz;
+    }
+
+    if (ssl->specs.cipher_type == block)
+        for (i = 0; i <= pad; i++)
+            output[idx++] = (byte)pad; /* pad byte gets pad value too */
+
+    Encrypt(ssl, output + headerSz, output + headerSz, size);
+
+    return sz;
+}
+
+
+int SendFinished(CYASSL* ssl)
+{
+    int              sendSz,
+                     finishedSz = ssl->options.tls ? TLS_FINISHED_SZ :
+                                                     FINISHED_SZ;
+    byte             input[FINISHED_SZ + DTLS_HANDSHAKE_HEADER_SZ];  /* max */
+    byte            *output;
+    Hashes*          hashes;
+    int              ret;
+    int              headerSz = HANDSHAKE_HEADER_SZ;
+
+
+    #ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            headerSz += DTLS_HANDSHAKE_EXTRA;
+            ssl->keys.dtls_epoch++;
+            ssl->keys.dtls_sequence_number = 0;  /* reset after epoch change */
+        }
+    #endif
+    
+    /* check for avalaible size */
+    if ((ret = CheckAvalaibleSize(ssl, sizeof(input) + MAX_MSG_EXTRA)) != 0)
+        return ret;
+
+    /* get ouput buffer */
+    output = ssl->buffers.outputBuffer.buffer + 
+             ssl->buffers.outputBuffer.length;
+
+    AddHandShakeHeader(input, finishedSz, finished, ssl);
+
+    /* make finished hashes */
+    hashes = (Hashes*)&input[headerSz];
+    BuildFinished(ssl, hashes, ssl->options.side == CLIENT_END ? client :
+                  server);
+
+    if ( (sendSz = BuildMessage(ssl, output, input, headerSz +
+                                finishedSz, handshake)) < 0)
+        return BUILD_MSG_ERROR;
+
+    if (!ssl->options.resuming) {
+#ifndef NO_SESSION_CACHE
+        AddSession(ssl);    /* just try */
+#endif
+        if (ssl->options.side == CLIENT_END)
+            BuildFinished(ssl, &ssl->verifyHashes, server);
+        else
+            ssl->options.handShakeState = HANDSHAKE_DONE;
+    }
+    else {
+        if (ssl->options.side == CLIENT_END)
+            ssl->options.handShakeState = HANDSHAKE_DONE;
+        else
+            BuildFinished(ssl, &ssl->verifyHashes, client);
+    }
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("Finished", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("Finished", &ssl->timeoutInfo, output, sendSz,
+                          ssl->heap);
+    #endif
+
+    ssl->buffers.outputBuffer.length += sendSz;
+
+    return SendBuffered(ssl);
+}
+
+
+int SendCertificate(CYASSL* ssl)
+{
+    int    sendSz, length, ret = 0;
+    word32 i = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+    word32 certSz, listSz;
+    byte*  output = 0;
+
+    if (ssl->options.usingPSK_cipher) return 0;  /* not needed */
+
+    if (ssl->options.sendVerify == SEND_BLANK_CERT) {
+        certSz = 0;
+        length = CERT_HEADER_SZ;
+        listSz = 0;
+    }
+    else {
+        certSz = ssl->buffers.certificate.length;
+        /* list + cert size */
+        length = certSz + 2 * CERT_HEADER_SZ;
+        listSz = certSz + CERT_HEADER_SZ;
+
+        /* may need to send rest of chain, already has leading size(s) */
+        if (ssl->buffers.certChain.buffer) {
+            length += ssl->buffers.certChain.length;
+            listSz += ssl->buffers.certChain.length;
+        }
+    }
+    sendSz = length + RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+
+    #ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+            i      += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+        }
+    #endif
+
+    /* check for avalaible size */
+    if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+        return ret;
+
+    /* get ouput buffer */
+    output = ssl->buffers.outputBuffer.buffer +
+             ssl->buffers.outputBuffer.length;
+
+    AddHeaders(output, length, certificate, ssl);
+
+    /* list total */
+    c32to24(listSz, output + i);
+    i += CERT_HEADER_SZ;
+
+    /* member */
+    if (certSz) {
+        c32to24(certSz, output + i);
+        i += CERT_HEADER_SZ;
+        XMEMCPY(output + i, ssl->buffers.certificate.buffer, certSz);
+        i += certSz;
+
+        /* send rest of chain? */
+        if (ssl->buffers.certChain.buffer) {
+            XMEMCPY(output + i, ssl->buffers.certChain.buffer,
+                                ssl->buffers.certChain.length);
+            i += ssl->buffers.certChain.length;
+        }
+    }
+    HashOutput(ssl, output, sendSz, 0);
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("Certificate", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("Certificate", &ssl->timeoutInfo, output, sendSz,
+                           ssl->heap);
+    #endif
+
+    if (ssl->options.side == SERVER_END)
+        ssl->options.serverState = SERVER_CERT_COMPLETE;
+
+    ssl->buffers.outputBuffer.length += sendSz;
+    if (ssl->options.groupMessages)
+        return 0;
+    else
+        return SendBuffered(ssl);
+}
+
+
+int SendCertificateRequest(CYASSL* ssl)
+{
+    byte   *output;
+    int    ret;
+    int    sendSz;
+    word32 i = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+    
+    int  typeTotal = 1;  /* only rsa for now */
+    int  reqSz = ENUM_LEN + typeTotal + REQ_HEADER_SZ;  /* add auth later */
+
+    if (IsAtLeastTLSv1_2(ssl))
+        reqSz += LENGTH_SZ + HASH_SIG_SIZE;
+
+    if (ssl->options.usingPSK_cipher) return 0;  /* not needed */
+
+    sendSz = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ + reqSz;
+
+    #ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+            i      += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+        }
+    #endif
+    /* check for avalaible size */
+    if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+        return ret;
+
+    /* get ouput buffer */
+    output = ssl->buffers.outputBuffer.buffer +
+             ssl->buffers.outputBuffer.length;
+
+    AddHeaders(output, reqSz, certificate_request, ssl);
+
+    /* write to output */
+    output[i++] = (byte)typeTotal;  /* # of types */
+    output[i++] = rsa_sign;
+
+    /* supported hash/sig */
+    if (IsAtLeastTLSv1_2(ssl)) {
+        c16toa(HASH_SIG_SIZE, &output[i]);
+        i += LENGTH_SZ;
+
+        output[i++] = sha_mac;      /* hash */
+        output[i++] = rsa_sa_algo;  /* sig  */
+    }
+
+    c16toa(0, &output[i]);  /* auth's */
+    i += REQ_HEADER_SZ;
+
+    HashOutput(ssl, output, sendSz, 0);
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("CertificateRequest", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("CertificateRequest", &ssl->timeoutInfo, output,
+                          sendSz, ssl->heap);
+    #endif
+    ssl->buffers.outputBuffer.length += sendSz;
+    if (ssl->options.groupMessages)
+        return 0;
+    else
+        return SendBuffered(ssl);
+}
+
+
+int SendData(CYASSL* ssl, const void* data, int sz)
+{
+    int sent = 0,  /* plainText size */
+        sendSz,
+        ret;
+
+    if (ssl->error == WANT_WRITE)
+        ssl->error = 0;
+
+    if (ssl->options.handShakeState != HANDSHAKE_DONE) {
+        int err;
+        CYASSL_MSG("handshake not complete, trying to finish");
+        if ( (err = CyaSSL_negotiate(ssl)) != 0) 
+            return  err;
+    }
+
+    /* last time system socket output buffer was full, try again to send */
+    if (ssl->buffers.outputBuffer.length > 0) {
+        CYASSL_MSG("output buffer was full, trying to send again");
+        if ( (ssl->error = SendBuffered(ssl)) < 0) {
+            CYASSL_ERROR(ssl->error);
+            if (ssl->error == SOCKET_ERROR_E && ssl->options.connReset)
+                return 0;     /* peer reset */
+            return ssl->error;
+        }
+        else {
+            /* advance sent to previous sent + plain size just sent */
+            sent = ssl->buffers.prevSent + ssl->buffers.plainSz;
+            CYASSL_MSG("sent write buffered data");
+        }
+    }
+
+    for (;;) {
+        int   len = min(sz - sent, OUTPUT_RECORD_SIZE);
+        byte* out;
+        byte* sendBuffer = (byte*)data + sent;  /* may switch on comp */
+        int   buffSz = len;                       /* may switch on comp */
+#ifdef HAVE_LIBZ
+        byte  comp[MAX_RECORD_SIZE + MAX_COMP_EXTRA];
+#endif
+
+        if (sent == sz) break;
+
+#ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            len    = min(len, MAX_UDP_SIZE);
+            buffSz = len;
+        }
+#endif
+
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, len + COMP_EXTRA +
+                                      MAX_MSG_EXTRA)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        out = ssl->buffers.outputBuffer.buffer +
+              ssl->buffers.outputBuffer.length;
+
+#ifdef HAVE_LIBZ
+        if (ssl->options.usingCompression) {
+            buffSz = Compress(ssl, sendBuffer, buffSz, comp, sizeof(comp));
+            if (buffSz < 0) {
+                return buffSz;
+            }
+            sendBuffer = comp;
+        }
+#endif
+        sendSz = BuildMessage(ssl, out, sendBuffer, buffSz,
+                              application_data);
+
+        ssl->buffers.outputBuffer.length += sendSz;
+
+        if ( (ret = SendBuffered(ssl)) < 0) {
+            CYASSL_ERROR(ret);
+            /* store for next call if WANT_WRITE or user embedSend() that
+               doesn't present like WANT_WRITE */
+            ssl->buffers.plainSz  = len;
+            ssl->buffers.prevSent = sent;
+            if (ret == SOCKET_ERROR_E && ssl->options.connReset)
+                return 0;  /* peer reset */
+            return ssl->error = ret;
+        }
+
+        sent += len;
+
+        /* only one message per attempt */
+        if (ssl->options.partialWrite == 1) {
+            CYASSL_MSG("Paritial Write on, only sending one record");
+            break;
+        }
+    }
+    return sent;
+}
+
+/* process input data */
+int ReceiveData(CYASSL* ssl, byte* output, int sz)
+{
+    int size;
+
+    CYASSL_ENTER("ReceiveData()");
+
+    if (ssl->error == WANT_READ)
+        ssl->error = 0;
+
+    if (ssl->options.handShakeState != HANDSHAKE_DONE) {
+        int err;
+        CYASSL_MSG("Handshake not complete, trying to finish");
+        if ( (err = CyaSSL_negotiate(ssl)) != 0)
+            return  err;
+    }
+
+    while (ssl->buffers.clearOutputBuffer.length == 0)
+        if ( (ssl->error = ProcessReply(ssl)) < 0) {
+            CYASSL_ERROR(ssl->error);
+            if (ssl->error == ZERO_RETURN) {
+                CYASSL_MSG("Zero return, no more data coming");
+                ssl->options.isClosed = 1;
+                return 0;         /* no more data coming */
+            }
+            if (ssl->error == SOCKET_ERROR_E) {
+                if (ssl->options.connReset || ssl->options.isClosed) {
+                    CYASSL_MSG("Peer reset or closed, connection done");
+                    return 0;     /* peer reset or closed */
+                }
+            }
+            return ssl->error;
+        }
+
+    if (sz < (int)ssl->buffers.clearOutputBuffer.length)
+        size = sz;
+    else
+        size = ssl->buffers.clearOutputBuffer.length;
+
+    XMEMCPY(output, ssl->buffers.clearOutputBuffer.buffer, size);
+    ssl->buffers.clearOutputBuffer.length -= size;
+    ssl->buffers.clearOutputBuffer.buffer += size;
+   
+    if (ssl->buffers.clearOutputBuffer.length == 0 && 
+                                           ssl->buffers.inputBuffer.dynamicFlag)
+       ShrinkInputBuffer(ssl, NO_FORCED_FREE);
+
+    CYASSL_LEAVE("ReceiveData()", size);
+    return size;
+}
+
+
+/* send alert message */
+int SendAlert(CYASSL* ssl, int severity, int type)
+{
+    byte input[ALERT_SIZE];
+    byte *output;
+    int  sendSz;
+    int  ret;
+
+    /* if sendalert is called again for nonbloking */
+    if (ssl->options.sendAlertState != 0) {
+        ret = SendBuffered(ssl);
+        if (ret == 0)
+            ssl->options.sendAlertState = 0;
+        return ret;
+    }
+
+    /* check for avalaible size */
+    if ((ret = CheckAvalaibleSize(ssl, ALERT_SIZE + MAX_MSG_EXTRA)) != 0)
+        return ret;
+
+    /* get ouput buffer */
+    output = ssl->buffers.outputBuffer.buffer +
+             ssl->buffers.outputBuffer.length;
+
+    input[0] = (byte)severity;
+    input[1] = (byte)type;
+
+    if (ssl->keys.encryptionOn)
+        sendSz = BuildMessage(ssl, output, input, ALERT_SIZE, alert);
+    else {
+        RecordLayerHeader *const rl = (RecordLayerHeader*)output;
+        rl->type    = alert;
+        rl->version = ssl->version;
+        c16toa(ALERT_SIZE, rl->length);      
+
+        XMEMCPY(output + RECORD_HEADER_SZ, input, ALERT_SIZE);
+        sendSz = RECORD_HEADER_SZ + ALERT_SIZE;
+    }
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("Alert", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("Alert", &ssl->timeoutInfo, output, sendSz,ssl->heap);
+    #endif
+
+    ssl->buffers.outputBuffer.length += sendSz;
+    ssl->options.sendAlertState = 1;
+
+    return SendBuffered(ssl);
+}
+
+
+
+void SetErrorString(int error, char* str)
+{
+    const int max = MAX_ERROR_SZ;  /* shorthand */
+
+#ifdef NO_ERROR_STRINGS
+
+    XSTRNCPY(str, "no support for error strings built in", max);
+
+#else
+
+    /* pass to CTaoCrypt */
+    if (error < MAX_CODE_E && error > MIN_CODE_E) {
+        CTaoCryptErrorString(error, str);
+        return;
+    }
+
+    switch (error) {
+
+    case UNSUPPORTED_SUITE :
+        XSTRNCPY(str, "unsupported cipher suite", max);
+        break;
+
+    case INPUT_CASE_ERROR :
+        XSTRNCPY(str, "input state error", max);
+        break;
+
+    case PREFIX_ERROR :
+        XSTRNCPY(str, "bad index to key rounds", max);
+        break;
+
+    case MEMORY_ERROR :
+        XSTRNCPY(str, "out of memory", max);
+        break;
+
+    case VERIFY_FINISHED_ERROR :
+        XSTRNCPY(str, "verify problem on finished", max);
+        break;
+
+    case VERIFY_MAC_ERROR :
+        XSTRNCPY(str, "verify mac problem", max);
+        break;
+
+    case PARSE_ERROR :
+        XSTRNCPY(str, "parse error on header", max);
+        break;
+
+    case SIDE_ERROR :
+        XSTRNCPY(str, "wrong client/server type", max);
+        break;
+
+    case NO_PEER_CERT :
+        XSTRNCPY(str, "peer didn't send cert", max);
+        break;
+
+    case UNKNOWN_HANDSHAKE_TYPE :
+        XSTRNCPY(str, "weird handshake type", max);
+        break;
+
+    case SOCKET_ERROR_E :
+        XSTRNCPY(str, "error state on socket", max);
+        break;
+
+    case SOCKET_NODATA :
+        XSTRNCPY(str, "expected data, not there", max);
+        break;
+
+    case INCOMPLETE_DATA :
+        XSTRNCPY(str, "don't have enough data to complete task", max);
+        break;
+
+    case UNKNOWN_RECORD_TYPE :
+        XSTRNCPY(str, "unknown type in record hdr", max);
+        break;
+
+    case DECRYPT_ERROR :
+        XSTRNCPY(str, "error during decryption", max);
+        break;
+
+    case FATAL_ERROR :
+        XSTRNCPY(str, "revcd alert fatal error", max);
+        break;
+
+    case ENCRYPT_ERROR :
+        XSTRNCPY(str, "error during encryption", max);
+        break;
+
+    case FREAD_ERROR :
+        XSTRNCPY(str, "fread problem", max);
+        break;
+
+    case NO_PEER_KEY :
+        XSTRNCPY(str, "need peer's key", max);
+        break;
+
+    case NO_PRIVATE_KEY :
+        XSTRNCPY(str, "need the private key", max);
+        break;
+
+    case NO_DH_PARAMS :
+        XSTRNCPY(str, "server missing DH params", max);
+        break;
+
+    case RSA_PRIVATE_ERROR :
+        XSTRNCPY(str, "error during rsa priv op", max);
+        break;
+
+    case MATCH_SUITE_ERROR :
+        XSTRNCPY(str, "can't match cipher suite", max);
+        break;
+
+    case BUILD_MSG_ERROR :
+        XSTRNCPY(str, "build message failure", max);
+        break;
+
+    case BAD_HELLO :
+        XSTRNCPY(str, "client hello malformed", max);
+        break;
+
+    case DOMAIN_NAME_MISMATCH :
+        XSTRNCPY(str, "peer subject name mismatch", max);
+        break;
+
+    case WANT_READ :
+        XSTRNCPY(str, "non-blocking socket wants data to be read", max);
+        break;
+
+    case NOT_READY_ERROR :
+        XSTRNCPY(str, "handshake layer not ready yet, complete first", max);
+        break;
+
+    case PMS_VERSION_ERROR :
+        XSTRNCPY(str, "premaster secret version mismatch error", max);
+        break;
+
+    case VERSION_ERROR :
+        XSTRNCPY(str, "record layer version error", max);
+        break;
+
+    case WANT_WRITE :
+        XSTRNCPY(str, "non-blocking socket write buffer full", max);
+        break;
+
+    case BUFFER_ERROR :
+        XSTRNCPY(str, "malformed buffer input error", max);
+        break;
+
+    case VERIFY_CERT_ERROR :
+        XSTRNCPY(str, "verify problem on certificate", max);
+        break;
+
+    case VERIFY_SIGN_ERROR :
+        XSTRNCPY(str, "verify problem based on signature", max);
+        break;
+
+    case CLIENT_ID_ERROR :
+        XSTRNCPY(str, "psk client identity error", max);
+        break;
+
+    case SERVER_HINT_ERROR:
+        XSTRNCPY(str, "psk server hint error", max);
+        break;
+
+    case PSK_KEY_ERROR:
+        XSTRNCPY(str, "psk key callback error", max);
+        break;
+
+    case NTRU_KEY_ERROR:
+        XSTRNCPY(str, "NTRU key error", max);
+        break;
+
+    case NTRU_DRBG_ERROR:
+        XSTRNCPY(str, "NTRU drbg error", max);
+        break;
+
+    case NTRU_ENCRYPT_ERROR:
+        XSTRNCPY(str, "NTRU encrypt error", max);
+        break;
+
+    case NTRU_DECRYPT_ERROR:
+        XSTRNCPY(str, "NTRU decrypt error", max);
+        break;
+
+    case ZLIB_INIT_ERROR:
+        XSTRNCPY(str, "zlib init error", max);
+        break;
+
+    case ZLIB_COMPRESS_ERROR:
+        XSTRNCPY(str, "zlib compress error", max);
+        break;
+
+    case ZLIB_DECOMPRESS_ERROR:
+        XSTRNCPY(str, "zlib decompress error", max);
+        break;
+
+    case GETTIME_ERROR:
+        XSTRNCPY(str, "gettimeofday() error", max);
+        break;
+
+    case GETITIMER_ERROR:
+        XSTRNCPY(str, "getitimer() error", max);
+        break;
+
+    case SIGACT_ERROR:
+        XSTRNCPY(str, "sigaction() error", max);
+        break;
+
+    case SETITIMER_ERROR:
+        XSTRNCPY(str, "setitimer() error", max);
+        break;
+
+    case LENGTH_ERROR:
+        XSTRNCPY(str, "record layer length error", max);
+        break;
+
+    case PEER_KEY_ERROR:
+        XSTRNCPY(str, "cant decode peer key", max);
+        break;
+
+    case ZERO_RETURN:
+        XSTRNCPY(str, "peer sent close notify alert", max);
+        break;
+
+    case ECC_CURVETYPE_ERROR:
+        XSTRNCPY(str, "Bad ECC Curve Type or unsupported", max);
+        break;
+
+    case ECC_CURVE_ERROR:
+        XSTRNCPY(str, "Bad ECC Curve or unsupported", max);
+        break;
+
+    case ECC_PEERKEY_ERROR:
+        XSTRNCPY(str, "Bad ECC Peer Key", max);
+        break;
+
+    case ECC_MAKEKEY_ERROR:
+        XSTRNCPY(str, "ECC Make Key failure", max);
+        break;
+
+    case ECC_EXPORT_ERROR:
+        XSTRNCPY(str, "ECC Export Key failure", max);
+        break;
+
+    case ECC_SHARED_ERROR:
+        XSTRNCPY(str, "ECC DHE shared failure", max);
+        break;
+
+    case BAD_MUTEX_ERROR:
+        XSTRNCPY(str, "Bad mutex, operation failed", max);
+        break;
+
+    case NOT_CA_ERROR:
+        XSTRNCPY(str, "Not a CA by basic constraint error", max);
+        break;
+
+    case BAD_PATH_ERROR:
+        XSTRNCPY(str, "Bad path for opendir error", max);
+        break;
+
+    case BAD_CERT_MANAGER_ERROR:
+        XSTRNCPY(str, "Bad Cert Manager error", max);
+        break;
+
+    case OCSP_CERT_REVOKED:
+        XSTRNCPY(str, "OCSP Cert revoked", max);
+        break;
+
+    case CRL_CERT_REVOKED:
+        XSTRNCPY(str, "CRL Cert revoked", max);
+        break;
+
+    case CRL_MISSING:
+        XSTRNCPY(str, "CRL missing, not loaded", max);
+        break;
+
+    case MONITOR_RUNNING_E:
+        XSTRNCPY(str, "CRL monitor already running", max);
+        break;
+
+    case THREAD_CREATE_E:
+        XSTRNCPY(str, "Thread creation problem", max);
+        break;
+
+    case OCSP_NEED_URL:
+        XSTRNCPY(str, "OCSP need URL", max);
+        break;
+
+    case OCSP_CERT_UNKNOWN:
+        XSTRNCPY(str, "OCSP Cert unknown", max);
+        break;
+
+    case OCSP_LOOKUP_FAIL:
+        XSTRNCPY(str, "OCSP Responder lookup fail", max);
+        break;
+
+    case MAX_CHAIN_ERROR:
+        XSTRNCPY(str, "Maximum Chain Depth Exceeded", max);
+        break;
+
+    case COOKIE_ERROR:
+        XSTRNCPY(str, "DTLS Cookie Error", max);
+        break;
+
+    default :
+        XSTRNCPY(str, "unknown error number", max);
+    }
+
+#endif /* NO_ERROR_STRINGS */
+}
+
+
+
+/* be sure to add to cipher_name_idx too !!!! */
+const char* const cipher_names[] = 
+{
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_SHA
+    "RC4-SHA",
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_MD5
+    "RC4-MD5",
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
+    "DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
+    "AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
+    "AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+    "DHE-RSA-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+    "DHE-RSA-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
+    "PSK-AES128-CBC-SHA",
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
+    "PSK-AES256-CBC-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5
+    "HC128-MD5",
+#endif
+    
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA
+    "HC128-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA
+    "RABBIT-SHA",
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_RC4_128_SHA
+    "NTRU-RC4-SHA",
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA
+    "NTRU-DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_128_CBC_SHA
+    "NTRU-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_256_CBC_SHA
+    "NTRU-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+    "ECDHE-RSA-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+    "ECDHE-RSA-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+    "ECDHE-ECDSA-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+    "ECDHE-ECDSA-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
+    "ECDHE-RSA-RC4-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
+    "ECDHE-RSA-DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
+    "ECDHE-ECDSA-RC4-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
+    "ECDHE-ECDSA-DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
+    "AES128-SHA256",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
+    "AES256-SHA256",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+    "DHE-RSA-AES128-SHA256",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+    "DHE-RSA-AES256-SHA256",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+    "ECDH-RSA-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+    "ECDH-RSA-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+    "ECDH-ECDSA-AES128-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+    "ECDH-ECDSA-AES256-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA
+    "ECDH-RSA-RC4-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
+    "ECDH-RSA-DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
+    "ECDH-ECDSA-RC4-SHA",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
+    "ECDH-ECDSA-DES-CBC3-SHA",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
+    "AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
+    "AES256-GCM-SHA384",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+    "DHE-RSA-AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+    "DHE-RSA-AES256-GCM-SHA384",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+    "ECDHE-RSA-AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+    "ECDHE-RSA-AES256-GCM-SHA384",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+    "ECDHE-ECDSA-AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+    "ECDHE-ECDSA-AES256-GCM-SHA384",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+    "ECDH-RSA-AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+    "ECDH-RSA-AES256-GCM-SHA384",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+    "ECDH-ECDSA-AES128-GCM-SHA256",
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+    "ECDH-ECDSA-AES256-GCM-SHA384"
+#endif
+
+};
+
+
+
+/* cipher suite number that matches above name table */
+int cipher_name_idx[] =
+{
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_SHA
+    SSL_RSA_WITH_RC4_128_SHA,
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_MD5
+    SSL_RSA_WITH_RC4_128_MD5,
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
+    SSL_RSA_WITH_3DES_EDE_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
+    TLS_RSA_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
+    TLS_RSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+    TLS_DHE_RSA_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+    TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
+    TLS_PSK_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
+    TLS_PSK_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5
+    TLS_RSA_WITH_HC_128_CBC_MD5,    
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA
+    TLS_RSA_WITH_HC_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA
+    TLS_RSA_WITH_RABBIT_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_RC4_128_SHA
+    TLS_NTRU_RSA_WITH_RC4_128_SHA,
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA
+    TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_128_CBC_SHA
+    TLS_NTRU_RSA_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_256_CBC_SHA
+    TLS_NTRU_RSA_WITH_AES_256_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+    TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+    TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+    TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+    TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
+    TLS_ECDHE_RSA_WITH_RC4_128_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
+    TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
+    TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,    
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
+    TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,    
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
+    TLS_RSA_WITH_AES_128_CBC_SHA256,    
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
+    TLS_RSA_WITH_AES_256_CBC_SHA256,
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+    TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,    
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+    TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+    TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+    TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+    TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+    TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA
+    TLS_ECDH_RSA_WITH_RC4_128_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
+    TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
+    TLS_ECDH_ECDSA_WITH_RC4_128_SHA,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
+    TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
+    TLS_RSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
+    TLS_RSA_WITH_AES_256_GCM_SHA384,
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+    TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+    TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+    TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+    TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+    TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+    TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+    TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+    TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+    TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+#endif
+
+};
+
+
+/* return true if set, else false */
+/* only supports full name from cipher_name[] delimited by : */
+int SetCipherList(Suites* s, const char* list)
+{
+    int  ret = 0, i;
+    char name[MAX_SUITE_NAME];
+
+    char  needle[] = ":";
+    char* haystack = (char*)list;
+    char* prev;
+
+    const int suiteSz = sizeof(cipher_names) / sizeof(cipher_names[0]);
+    int idx = 0;
+
+    if (!list)
+        return 0;
+    
+    if (*list == 0) return 1;   /* CyaSSL default */
+
+    if (XSTRNCMP(haystack, "ALL", 3) == 0) return 1;  /* CyaSSL defualt */
+
+    for(;;) {
+        word32 len;
+        prev = haystack;
+        haystack = XSTRSTR(haystack, needle);
+
+        if (!haystack)    /* last cipher */
+            len = min(sizeof(name), XSTRLEN(prev));
+        else
+            len = min(sizeof(name), (word32)(haystack - prev));
+
+        XSTRNCPY(name, prev, len);
+        name[(len == sizeof(name)) ? len - 1 : len] = 0;
+
+        for (i = 0; i < suiteSz; i++)
+            if (XSTRNCMP(name, cipher_names[i], sizeof(name)) == 0) {
+                if (XSTRSTR(name, "EC"))
+                    s->suites[idx++] = ECC_BYTE;  /* ECC suite */
+                else
+                    s->suites[idx++] = 0x00;      /* normal */
+                s->suites[idx++] = (byte)cipher_name_idx[i];
+
+                if (!ret) ret = 1;   /* found at least one */
+                break;
+            }
+        if (!haystack) break;
+        haystack++;
+    }
+
+    if (ret) {
+        s->setSuites = 1;
+        s->suiteSz   = (word16)idx;
+    }
+
+    return ret;
+}
+
+
+#ifdef CYASSL_CALLBACKS
+
+    /* Initialisze HandShakeInfo */
+    void InitHandShakeInfo(HandShakeInfo* info)
+    {
+        int i;
+
+        info->cipherName[0] = 0;
+        for (i = 0; i < MAX_PACKETS_HANDSHAKE; i++)
+            info->packetNames[i][0] = 0;
+        info->numberPackets = 0;
+        info->negotiationError = 0;
+    }
+
+    /* Set Final HandShakeInfo parameters */
+    void FinishHandShakeInfo(HandShakeInfo* info, const CYASSL* ssl)
+    {
+        int i;
+        int sz = sizeof(cipher_name_idx)/sizeof(int); 
+
+        for (i = 0; i < sz; i++)
+            if (ssl->options.cipherSuite == (byte)cipher_name_idx[i]) {
+                if (ssl->options.cipherSuite0 == ECC_BYTE)
+                    continue;   /* ECC suites at end */
+                XSTRNCPY(info->cipherName, cipher_names[i], MAX_CIPHERNAME_SZ);
+                break;
+            }
+
+        /* error max and min are negative numbers */
+        if (ssl->error <= MIN_PARAM_ERR && ssl->error >= MAX_PARAM_ERR)
+            info->negotiationError = ssl->error;
+    }
+
+   
+    /* Add name to info packet names, increase packet name count */
+    void AddPacketName(const char* name, HandShakeInfo* info)
+    {
+        if (info->numberPackets < MAX_PACKETS_HANDSHAKE) {
+            XSTRNCPY(info->packetNames[info->numberPackets++], name,
+                    MAX_PACKETNAME_SZ);
+        }
+    } 
+
+
+    /* Initialisze TimeoutInfo */
+    void InitTimeoutInfo(TimeoutInfo* info)
+    {
+        int i;
+
+        info->timeoutName[0] = 0;
+        info->flags          = 0;
+
+        for (i = 0; i < MAX_PACKETS_HANDSHAKE; i++) {
+            info->packets[i].packetName[0]     = 0;
+            info->packets[i].timestamp.tv_sec  = 0;
+            info->packets[i].timestamp.tv_usec = 0;
+            info->packets[i].bufferValue       = 0;
+            info->packets[i].valueSz           = 0;
+        }
+        info->numberPackets        = 0;
+        info->timeoutValue.tv_sec  = 0;
+        info->timeoutValue.tv_usec = 0;
+    }
+
+
+    /* Free TimeoutInfo */
+    void FreeTimeoutInfo(TimeoutInfo* info, void* heap)
+    {
+        int i;
+        for (i = 0; i < MAX_PACKETS_HANDSHAKE; i++)
+            if (info->packets[i].bufferValue) {
+                XFREE(info->packets[i].bufferValue, heap, DYNAMIC_TYPE_INFO);
+                info->packets[i].bufferValue = 0;
+            }
+
+    }
+
+
+    /* Add PacketInfo to TimeoutInfo */
+    void AddPacketInfo(const char* name, TimeoutInfo* info, const byte* data,
+                       int sz, void* heap)
+    {
+        if (info->numberPackets < (MAX_PACKETS_HANDSHAKE - 1)) {
+            Timeval currTime;
+
+            /* may add name after */
+            if (name)
+                XSTRNCPY(info->packets[info->numberPackets].packetName, name,
+                        MAX_PACKETNAME_SZ);
+
+            /* add data, put in buffer if bigger than static buffer */
+            info->packets[info->numberPackets].valueSz = sz;
+            if (sz < MAX_VALUE_SZ)
+                XMEMCPY(info->packets[info->numberPackets].value, data, sz);
+            else {
+                info->packets[info->numberPackets].bufferValue =
+                           XMALLOC(sz, heap, DYNAMIC_TYPE_INFO);
+                if (!info->packets[info->numberPackets].bufferValue)
+                    /* let next alloc catch, just don't fill, not fatal here  */
+                    info->packets[info->numberPackets].valueSz = 0;
+                else
+                    XMEMCPY(info->packets[info->numberPackets].bufferValue,
+                           data, sz);
+            }
+            gettimeofday(&currTime, 0);
+            info->packets[info->numberPackets].timestamp.tv_sec  =
+                                                             currTime.tv_sec;
+            info->packets[info->numberPackets].timestamp.tv_usec =
+                                                             currTime.tv_usec;
+            info->numberPackets++;
+        }
+    }
+
+
+    /* Add packet name to previsouly added packet info */
+    void AddLateName(const char* name, TimeoutInfo* info)
+    {
+        /* make sure we have a valid previous one */
+        if (info->numberPackets > 0 && info->numberPackets <
+                                                        MAX_PACKETS_HANDSHAKE) {
+            XSTRNCPY(info->packets[info->numberPackets - 1].packetName, name,
+                    MAX_PACKETNAME_SZ);
+        }
+    }
+
+    /* Add record header to previsouly added packet info */
+    void AddLateRecordHeader(const RecordLayerHeader* rl, TimeoutInfo* info)
+    {
+        /* make sure we have a valid previous one */
+        if (info->numberPackets > 0 && info->numberPackets <
+                                                        MAX_PACKETS_HANDSHAKE) {
+            if (info->packets[info->numberPackets - 1].bufferValue)
+                XMEMCPY(info->packets[info->numberPackets - 1].bufferValue, rl,
+                       RECORD_HEADER_SZ);
+            else
+                XMEMCPY(info->packets[info->numberPackets - 1].value, rl,
+                       RECORD_HEADER_SZ);
+        }
+    }
+
+#endif /* CYASSL_CALLBACKS */
+
+
+
+/* client only parts */
+#ifndef NO_CYASSL_CLIENT
+
+    int SendClientHello(CYASSL* ssl)
+    {
+        byte              *output;
+        word32             length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+        int                sendSz;
+        int                idSz = ssl->options.resuming ? ID_LEN : 0;
+        int                ret;
+
+        length = sizeof(ProtocolVersion) + RAN_LEN
+               + idSz + ENUM_LEN                      
+               + ssl->suites.suiteSz + SUITE_LEN
+               + COMP_LEN + ENUM_LEN;
+
+        if (IsAtLeastTLSv1_2(ssl))
+            length += HELLO_EXT_SZ;
+
+        sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+
+#ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            length += ENUM_LEN;   /* cookie */
+            if (ssl->arrays.cookieSz != 0) length += ssl->arrays.cookieSz;
+            sendSz  = length + DTLS_HANDSHAKE_HEADER_SZ + DTLS_RECORD_HEADER_SZ;
+            idx    += DTLS_HANDSHAKE_EXTRA + DTLS_RECORD_EXTRA;
+        }
+#endif
+
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        output = ssl->buffers.outputBuffer.buffer +
+                 ssl->buffers.outputBuffer.length;
+
+        AddHeaders(output, length, client_hello, ssl);
+
+            /* client hello, first version */
+        XMEMCPY(output + idx, &ssl->version, sizeof(ProtocolVersion));
+        idx += sizeof(ProtocolVersion);
+        ssl->chVersion = ssl->version;  /* store in case changed */
+
+            /* then random */
+        if (ssl->options.connectState == CONNECT_BEGIN) {
+            RNG_GenerateBlock(&ssl->rng, output + idx, RAN_LEN);
+            
+                /* store random */
+            XMEMCPY(ssl->arrays.clientRandom, output + idx, RAN_LEN);
+        } else {
+#ifdef CYASSL_DTLS
+                /* send same random on hello again */
+            XMEMCPY(output + idx, ssl->arrays.clientRandom, RAN_LEN);
+#endif
+        }
+        idx += RAN_LEN;
+
+            /* then session id */
+        output[idx++] = (byte)idSz;
+        if (idSz) {
+            XMEMCPY(output + idx, ssl->session.sessionID, ID_LEN);
+            idx += ID_LEN;
+        }
+        
+            /* then DTLS cookie */
+#ifdef CYASSL_DTLS
+        if (ssl->options.dtls) {
+            byte cookieSz = ssl->arrays.cookieSz;
+
+            output[idx++] = cookieSz;
+            if (cookieSz) {
+                XMEMCPY(&output[idx], ssl->arrays.cookie, cookieSz);
+                idx += cookieSz;
+            }
+        }
+#endif
+            /* then cipher suites */
+        c16toa(ssl->suites.suiteSz, output + idx);
+        idx += 2;
+        XMEMCPY(output + idx, &ssl->suites.suites, ssl->suites.suiteSz);
+        idx += ssl->suites.suiteSz;
+
+            /* last, compression */
+        output[idx++] = COMP_LEN;
+        if (ssl->options.usingCompression)
+            output[idx++] = ZLIB_COMPRESSION;
+        else
+            output[idx++] = NO_COMPRESSION;
+
+        if (IsAtLeastTLSv1_2(ssl))
+        {
+            /* add in the extensions length */
+            c16toa(HELLO_EXT_LEN, output + idx);
+            idx += 2;
+
+            c16toa(HELLO_EXT_SIG_ALGO, output + idx);
+            idx += 2;
+            c16toa(HELLO_EXT_SIGALGO_SZ, output + idx);
+            idx += 2;
+            /* This is a lazy list setup. Eventually, we'll need to support
+             * using other hash types or even other extensions. */
+            c16toa(HELLO_EXT_SIGALGO_LEN, output + idx);
+            idx += 2;
+            output[idx++] = sha_mac;
+            output[idx++] = rsa_sa_algo;
+            output[idx++] = sha_mac;
+            output[idx++] = dsa_sa_algo;
+            output[idx++] = sha_mac;
+            output[idx++] = ecc_dsa_sa_algo;
+        }
+
+        HashOutput(ssl, output, sendSz, 0);
+
+        ssl->options.clientState = CLIENT_HELLO_COMPLETE;
+
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("ClientHello", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("ClientHello", &ssl->timeoutInfo, output, sendSz,
+                          ssl->heap);
+#endif
+
+        ssl->buffers.outputBuffer.length += sendSz;
+
+        return SendBuffered(ssl);
+    }
+
+
+    static int DoHelloVerifyRequest(CYASSL* ssl, const byte* input,
+                                    word32* inOutIdx)
+    {
+        ProtocolVersion pv;
+        byte            cookieSz;
+        
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("HelloVerifyRequest",
+                                         &ssl->handShakeInfo);
+        if (ssl->toInfoOn) AddLateName("HelloVerifyRequest", &ssl->timeoutInfo);
+#endif
+        XMEMCPY(&pv, input + *inOutIdx, sizeof(pv));
+        *inOutIdx += sizeof(pv);
+        
+        cookieSz = input[(*inOutIdx)++];
+        
+        if (cookieSz) {
+#ifdef CYASSL_DTLS
+            if (cookieSz < MAX_COOKIE_LEN) {
+                XMEMCPY(ssl->arrays.cookie, input + *inOutIdx, cookieSz);
+                ssl->arrays.cookieSz = cookieSz;
+            }
+#endif
+            *inOutIdx += cookieSz;
+        }
+        
+        ssl->options.serverState = SERVER_HELLOVERIFYREQUEST_COMPLETE;
+        return 0;
+    }
+
+
+    static int DoServerHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                             word32 helloSz)
+    {
+        byte b;
+        byte compression;
+        ProtocolVersion pv;
+        word32 i = *inOutIdx;
+        word32 begin = i;
+
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("ServerHello", &ssl->handShakeInfo);
+        if (ssl->toInfoOn) AddLateName("ServerHello", &ssl->timeoutInfo);
+#endif
+        XMEMCPY(&pv, input + i, sizeof(pv));
+        i += sizeof(pv);
+        if (pv.minor > ssl->version.minor) {
+            CYASSL_MSG("Server using higher version, fatal error");
+            return VERSION_ERROR;
+        }
+        else if (pv.minor < ssl->version.minor) {
+            CYASSL_MSG("server using lower version");
+            if (!ssl->options.downgrade) {
+                CYASSL_MSG("    no downgrade allowed, fatal error");
+                return VERSION_ERROR;
+            }
+            else if (pv.minor == SSLv3_MINOR) {
+                /* turn off tls */
+                CYASSL_MSG("    downgrading to SSLv3");
+                ssl->options.tls    = 0;
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = SSLv3_MINOR;
+            }
+            else if (pv.minor == TLSv1_MINOR) {
+                /* turn off tls 1.1+ */
+                CYASSL_MSG("    downgrading to TLSv1");
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = TLSv1_MINOR;
+            }
+            else if (pv.minor == TLSv1_1_MINOR) {
+                CYASSL_MSG("    downgrading to TLSv1.1");
+                ssl->version.minor  = TLSv1_1_MINOR;
+            }
+        }
+        XMEMCPY(ssl->arrays.serverRandom, input + i, RAN_LEN);
+        i += RAN_LEN;
+        b = input[i++];
+        if (b) {
+            XMEMCPY(ssl->arrays.sessionID, input + i, min(b, ID_LEN));
+            i += b;
+            ssl->options.haveSessionId = 1;
+        }
+        ssl->options.cipherSuite0 = input[i++];
+        ssl->options.cipherSuite  = input[i++];  
+        compression = input[i++];
+
+        if (compression != ZLIB_COMPRESSION && ssl->options.usingCompression) {
+            CYASSL_MSG("Server refused compression, turning off"); 
+            ssl->options.usingCompression = 0;  /* turn off if server refused */
+        }
+
+        *inOutIdx = i;
+        if ( (i - begin) < helloSz)
+            *inOutIdx = begin + helloSz;  /* skip extensions */
+
+        ssl->options.serverState = SERVER_HELLO_COMPLETE;
+
+        *inOutIdx = i;
+
+        if (ssl->options.resuming) {
+            if (ssl->options.haveSessionId && XMEMCMP(ssl->arrays.sessionID,
+                                         ssl->session.sessionID, ID_LEN) == 0) {
+                if (SetCipherSpecs(ssl) == 0) {
+                    int ret; 
+                    XMEMCPY(ssl->arrays.masterSecret, ssl->session.masterSecret,
+                           SECRET_LEN);
+                    if (ssl->options.tls)
+                        ret = DeriveTlsKeys(ssl);
+                    else
+                        ret = DeriveKeys(ssl);
+                    ssl->options.serverState = SERVER_HELLODONE_COMPLETE;
+                    return ret;
+                }
+                else {
+                    CYASSL_MSG("Unsupported cipher suite, DoServerHello");
+                    return UNSUPPORTED_SUITE;
+                }
+            }
+            else {
+                CYASSL_MSG("Server denied resumption attempt"); 
+                ssl->options.resuming = 0; /* server denied resumption try */
+            }
+        }
+
+        return SetCipherSpecs(ssl);
+    }
+
+
+    /* just read in and ignore for now TODO: */
+    static int DoCertificateRequest(CYASSL* ssl, const byte* input, word32*
+                                    inOutIdx)
+    {
+        word16 len;
+       
+        #ifdef CYASSL_CALLBACKS
+            if (ssl->hsInfoOn)
+                AddPacketName("CertificateRequest", &ssl->handShakeInfo);
+            if (ssl->toInfoOn)
+                AddLateName("CertificateRequest", &ssl->timeoutInfo);
+        #endif
+        len = input[(*inOutIdx)++];
+
+        /* types, read in here */
+        *inOutIdx += len;
+        ato16(&input[*inOutIdx], &len);
+        *inOutIdx += LENGTH_SZ;
+
+        if (IsAtLeastTLSv1_2(ssl)) {
+            /* hash sig format */
+            *inOutIdx += len;
+            ato16(&input[*inOutIdx], &len);
+            *inOutIdx += LENGTH_SZ;
+        }
+
+        /* authorities */
+        while (len) {
+            word16 dnSz;
+       
+            ato16(&input[*inOutIdx], &dnSz);
+            *inOutIdx += (REQUEST_HEADER + dnSz);
+            len -= dnSz + REQUEST_HEADER;
+        }
+
+        /* don't send client cert or cert verify if user hasn't provided
+           cert and private key */
+        if (ssl->buffers.certificate.buffer && ssl->buffers.key.buffer)
+            ssl->options.sendVerify = SEND_CERT;
+        else if (IsAtLeastTLSv1_2(ssl))
+            ssl->options.sendVerify = SEND_BLANK_CERT;
+
+        return 0;
+    }
+
+
+    static int DoServerKeyExchange(CYASSL* ssl, const byte* input,
+                                   word32* inOutIdx)
+    {
+    #if defined(OPENSSL_EXTRA) || defined(HAVE_ECC)
+        word16 length    = 0;
+        word16 sigLen    = 0;
+        word16 verifySz  = (word16)*inOutIdx;  /* keep start idx */
+        byte*  signature = 0;
+    #endif 
+
+        (void)ssl;
+        (void)input;
+        (void)inOutIdx;
+
+    #ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("ServerKeyExchange", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddLateName("ServerKeyExchange", &ssl->timeoutInfo);
+    #endif
+
+    #ifndef NO_PSK
+        if (ssl->specs.kea == psk_kea) {
+            word16 pskLen = 0;
+            ato16(&input[*inOutIdx], &pskLen);
+            *inOutIdx += LENGTH_SZ;
+            XMEMCPY(ssl->arrays.server_hint, &input[*inOutIdx],
+                   min(pskLen, MAX_PSK_ID_LEN));
+            if (pskLen < MAX_PSK_ID_LEN)
+                ssl->arrays.server_hint[pskLen] = 0;
+            else
+                ssl->arrays.server_hint[MAX_PSK_ID_LEN - 1] = 0;
+            *inOutIdx += pskLen;
+
+            return 0;
+        }
+    #endif
+    #ifdef OPENSSL_EXTRA
+        if (ssl->specs.kea == diffie_hellman_kea)
+        {
+        /* p */
+        ato16(&input[*inOutIdx], &length);
+        *inOutIdx += LENGTH_SZ;
+
+        ssl->buffers.serverDH_P.buffer = (byte*) XMALLOC(length, ssl->heap,
+                                                         DYNAMIC_TYPE_DH);
+        if (ssl->buffers.serverDH_P.buffer)
+            ssl->buffers.serverDH_P.length = length;
+        else
+            return MEMORY_ERROR;
+        XMEMCPY(ssl->buffers.serverDH_P.buffer, &input[*inOutIdx], length);
+        *inOutIdx += length;
+
+        /* g */
+        ato16(&input[*inOutIdx], &length);
+        *inOutIdx += LENGTH_SZ;
+
+        ssl->buffers.serverDH_G.buffer = (byte*) XMALLOC(length, ssl->heap,
+                                                         DYNAMIC_TYPE_DH);
+        if (ssl->buffers.serverDH_G.buffer)
+            ssl->buffers.serverDH_G.length = length;
+        else
+            return MEMORY_ERROR;
+        XMEMCPY(ssl->buffers.serverDH_G.buffer, &input[*inOutIdx], length);
+        *inOutIdx += length;
+
+        /* pub */
+        ato16(&input[*inOutIdx], &length);
+        *inOutIdx += LENGTH_SZ;
+
+        ssl->buffers.serverDH_Pub.buffer = (byte*) XMALLOC(length, ssl->heap,
+                                                           DYNAMIC_TYPE_DH);
+        if (ssl->buffers.serverDH_Pub.buffer)
+            ssl->buffers.serverDH_Pub.length = length;
+        else
+            return MEMORY_ERROR;
+        XMEMCPY(ssl->buffers.serverDH_Pub.buffer, &input[*inOutIdx], length);
+        *inOutIdx += length;
+        }  /* dh_kea */
+    #endif /* OPENSSL_EXTRA */
+
+    #ifdef HAVE_ECC
+        if (ssl->specs.kea == ecc_diffie_hellman_kea)
+        {
+        byte b = input[*inOutIdx];
+        *inOutIdx += 1;
+
+        if (b != named_curve)
+            return ECC_CURVETYPE_ERROR;
+
+        *inOutIdx += 1;   /* curve type, eat leading 0 */
+        b = input[*inOutIdx];
+        *inOutIdx += 1;
+
+        if (b != secp256r1 && b != secp384r1 && b != secp521r1 && b !=
+                 secp160r1 && b != secp192r1 && b != secp224r1)
+            return ECC_CURVE_ERROR;
+
+        length = input[*inOutIdx];
+        *inOutIdx += 1;
+
+        if (ecc_import_x963(&input[*inOutIdx], length, &ssl->peerEccKey) != 0)
+            return ECC_PEERKEY_ERROR;
+
+        *inOutIdx += length;
+        ssl->peerEccKeyPresent = 1;
+        }
+    #endif /* HAVE_ECC */
+
+    #if defined(OPENSSL_EXTRA) || defined(HAVE_ECC)
+    {
+        Md5    md5;
+        Sha    sha;
+        byte   hash[FINISHED_SZ];
+        byte   messageVerify[MAX_DH_SZ];
+
+        /* adjust from start idx */
+        verifySz = (word16)(*inOutIdx - verifySz);
+
+        /* save message for hash verify */
+        if (verifySz > sizeof(messageVerify))
+            return BUFFER_ERROR;
+        XMEMCPY(messageVerify, &input[*inOutIdx - verifySz], verifySz);
+
+        if (IsAtLeastTLSv1_2(ssl)) {
+            /* just advance for now TODO: validate hash algo params */
+            *inOutIdx += LENGTH_SZ;
+        }
+
+        /* signature */
+        ato16(&input[*inOutIdx], &length);
+        *inOutIdx += LENGTH_SZ;
+
+        signature = (byte*)&input[*inOutIdx];
+        *inOutIdx += length;
+        sigLen = length;
+
+        /* verify signature */
+
+        /* md5 */
+        InitMd5(&md5);
+        Md5Update(&md5, ssl->arrays.clientRandom, RAN_LEN);
+        Md5Update(&md5, ssl->arrays.serverRandom, RAN_LEN);
+        Md5Update(&md5, messageVerify, verifySz);
+        Md5Final(&md5, hash);
+
+        /* sha */
+        InitSha(&sha);
+        ShaUpdate(&sha, ssl->arrays.clientRandom, RAN_LEN);
+        ShaUpdate(&sha, ssl->arrays.serverRandom, RAN_LEN);
+        ShaUpdate(&sha, messageVerify, verifySz);
+        ShaFinal(&sha, &hash[MD5_DIGEST_SIZE]);
+
+        /* rsa */
+        if (ssl->specs.sig_algo == rsa_sa_algo)
+        {
+            int   ret;
+            byte* out;
+
+            if (!ssl->peerRsaKeyPresent)
+                return NO_PEER_KEY;
+
+            ret = RsaSSL_VerifyInline(signature, sigLen,&out, &ssl->peerRsaKey);
+
+            if (IsAtLeastTLSv1_2(ssl)) {
+                byte   encodedSig[MAX_ENCODED_SIG_SZ];
+                word32 encSigSz;
+                byte*  digest;
+                int    typeH;
+                int    digestSz;
+
+                /* sha1 for now */
+                digest   = &hash[MD5_DIGEST_SIZE];
+                typeH    = SHAh;
+                digestSz = SHA_DIGEST_SIZE;
+
+                encSigSz = EncodeSignature(encodedSig, digest, digestSz, typeH);
+
+                if (encSigSz != (word32)ret || XMEMCMP(out, encodedSig,
+                                        min(encSigSz, MAX_ENCODED_SIG_SZ)) != 0)
+                    return VERIFY_SIGN_ERROR;
+            }
+            else { 
+                if (ret != sizeof(hash) || XMEMCMP(out, hash, sizeof(hash)))
+                    return VERIFY_SIGN_ERROR;
+            }
+        }
+#ifdef HAVE_ECC
+        /* ecdsa */
+        else if (ssl->specs.sig_algo == ecc_dsa_sa_algo) {
+            int verify = 0, ret;
+            if (!ssl->peerEccDsaKeyPresent)
+                return NO_PEER_KEY;
+
+            ret = ecc_verify_hash(signature, sigLen, &hash[MD5_DIGEST_SIZE],
+                                 SHA_DIGEST_SIZE, &verify, &ssl->peerEccDsaKey);
+            if (ret != 0 || verify == 0)
+                return VERIFY_SIGN_ERROR;
+        }
+#endif /* HAVE_ECC */
+        else
+            return ALGO_ID_E;
+
+        ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE;
+
+        return 0;
+
+    }
+#else  /* HAVE_OPENSSL or HAVE_ECC */
+        return NOT_COMPILED_IN;  /* not supported by build */
+#endif /* HAVE_OPENSSL or HAVE_ECC */
+    }
+
+
+    int SendClientKeyExchange(CYASSL* ssl)
+    {
+        byte   encSecret[MAX_NTRU_ENCRYPT_SZ];
+        word32 encSz = 0;
+        word32 idx = 0;
+        int    ret = 0;
+
+        if (ssl->specs.kea == rsa_kea) {
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.preMasterSecret,
+                              SECRET_LEN);
+            ssl->arrays.preMasterSecret[0] = ssl->chVersion.major;
+            ssl->arrays.preMasterSecret[1] = ssl->chVersion.minor;
+            ssl->arrays.preMasterSz = SECRET_LEN;
+
+            if (ssl->peerRsaKeyPresent == 0)
+                return NO_PEER_KEY;
+
+            ret = RsaPublicEncrypt(ssl->arrays.preMasterSecret, SECRET_LEN,
+                             encSecret, sizeof(encSecret), &ssl->peerRsaKey,
+                             &ssl->rng);
+            if (ret > 0) {
+                encSz = ret;
+                ret = 0;   /* set success to 0 */
+            }
+        #ifdef OPENSSL_EXTRA
+        } else if (ssl->specs.kea == diffie_hellman_kea) {
+            buffer  serverP   = ssl->buffers.serverDH_P;
+            buffer  serverG   = ssl->buffers.serverDH_G;
+            buffer  serverPub = ssl->buffers.serverDH_Pub;
+            byte    priv[ENCRYPT_LEN];
+            word32  privSz = 0;
+            DhKey   key;
+
+            if (serverP.buffer == 0 || serverG.buffer == 0 ||
+                                       serverPub.buffer == 0)
+                return NO_PEER_KEY;
+
+            InitDhKey(&key);
+            ret = DhSetKey(&key, serverP.buffer, serverP.length,
+                           serverG.buffer, serverG.length);
+            if (ret == 0)
+                /* for DH, encSecret is Yc, agree is pre-master */
+                ret = DhGenerateKeyPair(&key, &ssl->rng, priv, &privSz,
+                                        encSecret, &encSz);
+            if (ret == 0)
+                ret = DhAgree(&key, ssl->arrays.preMasterSecret,
+                              &ssl->arrays.preMasterSz, priv, privSz,
+                              serverPub.buffer, serverPub.length);
+            FreeDhKey(&key);
+        #endif /* OPENSSL_EXTRA */
+        #ifndef NO_PSK
+        } else if (ssl->specs.kea == psk_kea) {
+            byte* pms = ssl->arrays.preMasterSecret;
+
+            ssl->arrays.psk_keySz = ssl->options.client_psk_cb(ssl,
+                ssl->arrays.server_hint, ssl->arrays.client_identity,
+                MAX_PSK_ID_LEN, ssl->arrays.psk_key, MAX_PSK_KEY_LEN);
+            if (ssl->arrays.psk_keySz == 0 || 
+                ssl->arrays.psk_keySz > MAX_PSK_KEY_LEN)
+                return PSK_KEY_ERROR;
+            encSz = (word32)XSTRLEN(ssl->arrays.client_identity);
+            if (encSz > MAX_PSK_ID_LEN) return CLIENT_ID_ERROR;
+            XMEMCPY(encSecret, ssl->arrays.client_identity, encSz);
+
+            /* make psk pre master secret */
+            /* length of key + length 0s + length of key + key */
+            c16toa((word16)ssl->arrays.psk_keySz, pms);
+            pms += 2;
+            XMEMSET(pms, 0, ssl->arrays.psk_keySz);
+            pms += ssl->arrays.psk_keySz;
+            c16toa((word16)ssl->arrays.psk_keySz, pms);
+            pms += 2;
+            XMEMCPY(pms, ssl->arrays.psk_key, ssl->arrays.psk_keySz);
+            ssl->arrays.preMasterSz = ssl->arrays.psk_keySz * 2 + 4;
+        #endif /* NO_PSK */
+        #ifdef HAVE_NTRU
+        } else if (ssl->specs.kea == ntru_kea) {
+            word32 rc;
+            word16 cipherLen = sizeof(encSecret);
+            DRBG_HANDLE drbg;
+            static uint8_t const cyasslStr[] = {
+                'C', 'y', 'a', 'S', 'S', 'L', ' ', 'N', 'T', 'R', 'U'
+            };
+
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.preMasterSecret,
+                              SECRET_LEN);
+            ssl->arrays.preMasterSz = SECRET_LEN;
+
+            if (ssl->peerNtruKeyPresent == 0)
+                return NO_PEER_KEY;
+
+            rc = crypto_drbg_instantiate(MAX_NTRU_BITS, cyasslStr,
+                                          sizeof(cyasslStr), GetEntropy, &drbg);
+            if (rc != DRBG_OK)
+                return NTRU_DRBG_ERROR; 
+
+            rc = crypto_ntru_encrypt(drbg, ssl->peerNtruKeyLen,ssl->peerNtruKey,
+                                     ssl->arrays.preMasterSz,
+                                     ssl->arrays.preMasterSecret,
+                                     &cipherLen, encSecret);
+            crypto_drbg_uninstantiate(drbg);
+            if (rc != NTRU_OK)
+                return NTRU_ENCRYPT_ERROR;
+
+            encSz = cipherLen;
+            ret = 0;
+        #endif /* HAVE_NTRU */
+        #ifdef HAVE_ECC
+        } else if (ssl->specs.kea == ecc_diffie_hellman_kea) {
+            ecc_key  myKey;
+            ecc_key* peerKey = &myKey;
+            word32   size = sizeof(encSecret);
+
+            if (ssl->specs.static_ecdh) {
+                /* TODO: EccDsa is really fixed Ecc change naming */
+                if (!ssl->peerEccDsaKeyPresent || !ssl->peerEccDsaKey.dp)
+                    return NO_PEER_KEY;
+                peerKey = &ssl->peerEccDsaKey;
+            }
+            else {
+                if (!ssl->peerEccKeyPresent || !ssl->peerEccKey.dp)
+                    return NO_PEER_KEY;
+                peerKey = &ssl->peerEccKey;
+            }
+
+            ecc_init(&myKey);
+            ret = ecc_make_key(&ssl->rng, peerKey->dp->size, &myKey);
+            if (ret != 0)
+                return ECC_MAKEKEY_ERROR;
+
+            /* precede export with 1 byte length */
+            ret = ecc_export_x963(&myKey, encSecret + 1, &size);
+            encSecret[0] = (byte)size;
+            encSz = size + 1;
+
+            if (ret != 0)
+                ret = ECC_EXPORT_ERROR;
+            else {
+                size = sizeof(ssl->arrays.preMasterSecret);
+                ret  = ecc_shared_secret(&myKey, peerKey,
+                                         ssl->arrays.preMasterSecret, &size);
+                if (ret != 0)
+                    ret = ECC_SHARED_ERROR;
+            }
+
+            ssl->arrays.preMasterSz = size;
+            ecc_free(&myKey);
+        #endif /* HAVE_ECC */
+        } else
+            return ALGO_ID_E; /* unsupported kea */
+
+        if (ret == 0) {
+            byte              *output;
+            int                sendSz;
+            word32             tlsSz = 0;
+            
+            if (ssl->options.tls || ssl->specs.kea == diffie_hellman_kea)
+                tlsSz = 2;
+
+            if (ssl->specs.kea == ecc_diffie_hellman_kea)  /* always off */
+                tlsSz = 0;
+
+            sendSz = encSz + tlsSz + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+            idx    = HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls) {
+                    sendSz += DTLS_HANDSHAKE_EXTRA + DTLS_RECORD_EXTRA;
+                    idx    += DTLS_HANDSHAKE_EXTRA + DTLS_RECORD_EXTRA;
+                }
+            #endif
+
+            /* check for avalaible size */
+            if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+                return ret;
+
+            /* get ouput buffer */
+            output = ssl->buffers.outputBuffer.buffer + 
+                     ssl->buffers.outputBuffer.length;
+
+            AddHeaders(output, encSz + tlsSz, client_key_exchange, ssl);
+
+            if (tlsSz) {
+                c16toa((word16)encSz, &output[idx]);
+                idx += 2;
+            }
+            XMEMCPY(output + idx, encSecret, encSz);
+            idx += encSz;
+
+            HashOutput(ssl, output, sendSz, 0);
+
+            #ifdef CYASSL_CALLBACKS
+                if (ssl->hsInfoOn)
+                    AddPacketName("ClientKeyExchange", &ssl->handShakeInfo);
+                if (ssl->toInfoOn)
+                    AddPacketInfo("ClientKeyExchange", &ssl->timeoutInfo,
+                                  output, sendSz, ssl->heap);
+            #endif
+
+            ssl->buffers.outputBuffer.length += sendSz;
+
+            if (ssl->options.groupMessages)
+                ret = 0;
+            else
+                ret = SendBuffered(ssl);
+        }
+    
+        if (ret == 0 || ret == WANT_WRITE) {
+            int tmpRet = MakeMasterSecret(ssl);
+            if (tmpRet != 0)
+                ret = tmpRet;   /* save WANT_WRITE unless more serious */
+            ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
+        }
+
+        return ret;
+    }
+
+    int SendCertificateVerify(CYASSL* ssl)
+    {
+        byte              *output;
+        int                sendSz = 0, length, ret;
+        word32             idx = 0;
+        word32             sigOutSz = 0;
+        RsaKey             key;
+        int                usingEcc = 0;
+#ifdef HAVE_ECC
+        ecc_key            eccKey;
+#endif
+
+        if (ssl->options.sendVerify == SEND_BLANK_CERT)
+            return 0;  /* sent blank cert, can't verify */
+
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, MAX_CERT_VERIFY_SZ)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        output = ssl->buffers.outputBuffer.buffer +
+                 ssl->buffers.outputBuffer.length;
+
+        BuildCertHashes(ssl, &ssl->certHashes);
+
+#ifdef HAVE_ECC
+        ecc_init(&eccKey);
+#endif
+        InitRsaKey(&key, ssl->heap);
+        ret = RsaPrivateKeyDecode(ssl->buffers.key.buffer, &idx, &key,
+                                  ssl->buffers.key.length);
+        if (ret == 0)
+            sigOutSz = RsaEncryptSize(&key);
+        else {
+    #ifdef HAVE_ECC
+            CYASSL_MSG("Trying ECC client cert, RSA didn't work");
+           
+            idx = 0; 
+            ret = EccPrivateKeyDecode(ssl->buffers.key.buffer, &idx, &eccKey,
+                                      ssl->buffers.key.length);
+            if (ret == 0) {
+                CYASSL_MSG("Using ECC client cert");
+                usingEcc = 1;
+                sigOutSz = ecc_sig_size(&eccKey);
+            }
+            else {
+                CYASSL_MSG("Bad client cert type");
+            }
+    #endif
+        }
+        if (ret == 0) {
+            byte*  verify = (byte*)&output[RECORD_HEADER_SZ +
+                                           HANDSHAKE_HEADER_SZ];
+            byte*  signBuffer = ssl->certHashes.md5;
+            word32 signSz = sizeof(Hashes);
+            byte   encodedSig[MAX_ENCODED_SIG_SZ];
+            word32 extraSz = 0;  /* tls 1.2 hash/sig */
+
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls)
+                    verify += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+            #endif
+            length = sigOutSz;
+            if (IsAtLeastTLSv1_2(ssl)) {
+                verify[0] = sha_mac;
+                verify[1] = usingEcc ? ecc_dsa_sa_algo : rsa_sa_algo;
+                extraSz = HASH_SIG_SIZE;
+            }
+            c16toa((word16)length, verify + extraSz); /* prepend verify header*/
+
+            if (usingEcc) {
+#ifdef HAVE_ECC
+                word32 localSz = sigOutSz;
+                ret = ecc_sign_hash(signBuffer + MD5_DIGEST_SIZE,
+                              SHA_DIGEST_SIZE, verify + extraSz + VERIFY_HEADER,
+                              &localSz, &ssl->rng, &eccKey);
+#endif
+            }
+            else {
+                if (IsAtLeastTLSv1_2(ssl)) {
+                    byte* digest;
+                    int   typeH;
+                    int   digestSz;
+
+                    /* sha1 for now */
+                    digest   = ssl->certHashes.sha;
+                    typeH    = SHAh;
+                    digestSz = SHA_DIGEST_SIZE;
+
+                    signSz = EncodeSignature(encodedSig, digest,digestSz,typeH);
+                    signBuffer = encodedSig;
+                }
+
+                ret = RsaSSL_Sign(signBuffer, signSz, verify + extraSz +
+                                  VERIFY_HEADER, ENCRYPT_LEN, &key, &ssl->rng);
+
+                if (ret > 0)
+                    ret = 0;  /* RSA reset */
+            }
+            
+            if (ret == 0) {
+                AddHeaders(output, length + extraSz + VERIFY_HEADER,
+                           certificate_verify, ssl);
+
+                sendSz = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ + length +
+                         extraSz + VERIFY_HEADER;
+                #ifdef CYASSL_DTLS
+                    if (ssl->options.dtls)
+                        sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                #endif
+                HashOutput(ssl, output, sendSz, 0);
+            }
+        }
+
+        FreeRsaKey(&key);
+#ifdef HAVE_ECC
+        ecc_free(&eccKey);
+#endif
+
+        if (ret == 0) {
+            #ifdef CYASSL_CALLBACKS
+                if (ssl->hsInfoOn)
+                    AddPacketName("CertificateVerify", &ssl->handShakeInfo);
+                if (ssl->toInfoOn)
+                    AddPacketInfo("CertificateVerify", &ssl->timeoutInfo,
+                                  output, sendSz, ssl->heap);
+            #endif
+            ssl->buffers.outputBuffer.length += sendSz;
+            if (ssl->options.groupMessages)
+                return 0;
+            else
+                return SendBuffered(ssl);
+        }
+        else
+            return ret;
+    }
+
+
+
+#endif /* NO_CYASSL_CLIENT */
+
+
+#ifndef NO_CYASSL_SERVER
+
+    int SendServerHello(CYASSL* ssl)
+    {
+        byte              *output;
+        word32             length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+        int                sendSz;
+        int                ret;
+
+        length = sizeof(ProtocolVersion) + RAN_LEN
+               + ID_LEN + ENUM_LEN                 
+               + SUITE_LEN 
+               + ENUM_LEN;
+
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, MAX_HELLO_SZ)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        output = ssl->buffers.outputBuffer.buffer + 
+                 ssl->buffers.outputBuffer.length;
+
+        sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+        AddHeaders(output, length, server_hello, ssl);
+
+        #ifdef CYASSL_DTLS
+            if (ssl->options.dtls) {
+                idx    += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+            }
+        #endif
+        /* now write to output */
+            /* first version */
+        XMEMCPY(output + idx, &ssl->version, sizeof(ProtocolVersion));
+        idx += sizeof(ProtocolVersion);
+
+            /* then random */
+        if (!ssl->options.resuming)         
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.serverRandom, RAN_LEN);
+        XMEMCPY(output + idx, ssl->arrays.serverRandom, RAN_LEN);
+        idx += RAN_LEN;
+
+#ifdef SHOW_SECRETS
+        {
+            int j;
+            printf("server random: ");
+            for (j = 0; j < RAN_LEN; j++)
+                printf("%02x", ssl->arrays.serverRandom[j]);
+            printf("\n");
+        }
+#endif
+            /* then session id */
+        output[idx++] = ID_LEN;
+        if (!ssl->options.resuming)
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.sessionID, ID_LEN);
+        XMEMCPY(output + idx, ssl->arrays.sessionID, ID_LEN);
+        idx += ID_LEN;
+
+            /* then cipher suite */
+        output[idx++] = ssl->options.cipherSuite0; 
+        output[idx++] = ssl->options.cipherSuite;
+
+            /* last, compression */
+        if (ssl->options.usingCompression)
+            output[idx++] = ZLIB_COMPRESSION;
+        else
+            output[idx++] = NO_COMPRESSION;
+            
+        ssl->buffers.outputBuffer.length += sendSz;
+        HashOutput(ssl, output, sendSz, 0);
+
+        #ifdef CYASSL_CALLBACKS
+            if (ssl->hsInfoOn)
+                AddPacketName("ServerHello", &ssl->handShakeInfo);
+            if (ssl->toInfoOn)
+                AddPacketInfo("ServerHello", &ssl->timeoutInfo, output, sendSz,
+                              ssl->heap);
+        #endif
+
+        ssl->options.serverState = SERVER_HELLO_COMPLETE;
+
+        if (ssl->options.groupMessages)
+            return 0;
+        else
+            return SendBuffered(ssl);
+    }
+
+
+#ifdef HAVE_ECC
+
+    static byte SetCurveId(int size)
+    {
+        switch(size) {
+            case 20:
+                return secp160r1;
+                break;
+            case 24:
+                return secp192r1;
+                break;
+            case 28:
+                return secp224r1;
+                break;
+            case 32:
+                return secp256r1;
+                break;
+            case 48:
+                return secp384r1;
+                break;
+            case 66:
+                return secp521r1;
+                break;
+            default:
+                return 0;
+        }        
+    }
+
+#endif /* HAVE_ECC */
+
+
+    int SendServerKeyExchange(CYASSL* ssl)
+    {
+        int ret = 0;
+        (void)ssl;
+
+        #ifndef NO_PSK
+        if (ssl->specs.kea == psk_kea)
+        {
+            byte    *output;
+            word32   length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+            int      sendSz;
+            if (ssl->arrays.server_hint[0] == 0) return 0; /* don't send */
+
+            /* include size part */
+            length = (word32)XSTRLEN(ssl->arrays.server_hint);
+            if (length > MAX_PSK_ID_LEN) return SERVER_HINT_ERROR;
+            length += HINT_LEN_SZ;
+            sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+
+            #ifdef CYASSL_DTLS 
+                if (ssl->options.dtls) {
+                    sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                    idx    += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                }
+            #endif
+            /* check for avalaible size */
+            if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+               return ret;
+
+            /* get ouput buffer */
+            output = ssl->buffers.outputBuffer.buffer + 
+                     ssl->buffers.outputBuffer.length;
+
+            AddHeaders(output, length, server_key_exchange, ssl);
+
+            /* key data */
+            c16toa((word16)(length - HINT_LEN_SZ), output + idx);
+            idx += HINT_LEN_SZ;
+            XMEMCPY(output + idx, ssl->arrays.server_hint, length -HINT_LEN_SZ);
+
+            HashOutput(ssl, output, sendSz, 0);
+
+            #ifdef CYASSL_CALLBACKS
+                if (ssl->hsInfoOn)
+                    AddPacketName("ServerKeyExchange", &ssl->handShakeInfo);
+                if (ssl->toInfoOn)
+                    AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo,
+                                  output, sendSz, ssl->heap);
+            #endif
+
+            ssl->buffers.outputBuffer.length += sendSz;
+            if (ssl->options.groupMessages)
+                ret = 0;
+            else
+                ret = SendBuffered(ssl);
+            ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE;
+        }
+        #endif /*NO_PSK */
+
+        #ifdef HAVE_ECC
+        if (ssl->specs.kea == ecc_diffie_hellman_kea)
+        {
+            byte    *output;
+            word32   length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+            int      sendSz;
+            byte     exportBuf[MAX_EXPORT_ECC_SZ];
+            word32   expSz = sizeof(exportBuf);
+            word32   sigSz;
+            word32   preSigSz, preSigIdx;
+            RsaKey   rsaKey;
+            ecc_key  dsaKey;
+
+            if (ssl->specs.static_ecdh) {
+                CYASSL_MSG("Using Static ECDH, not sending ServerKeyExchagne");
+                return 0;
+            }
+
+            /* curve type, named curve, length(1) */
+            length = ENUM_LEN + CURVE_LEN + ENUM_LEN;
+            /* pub key size */
+            CYASSL_MSG("Using ephemeral ECDH");
+            if (ecc_export_x963(&ssl->eccTempKey, exportBuf, &expSz) != 0)
+                return ECC_EXPORT_ERROR;
+            length += expSz;
+
+            preSigSz  = length;
+            preSigIdx = idx;
+
+            InitRsaKey(&rsaKey, ssl->heap);
+            ecc_init(&dsaKey);
+
+            /* sig length */
+            length += LENGTH_SZ;
+
+            if (!ssl->buffers.key.buffer) {
+                FreeRsaKey(&rsaKey);
+                ecc_free(&dsaKey);
+                return NO_PRIVATE_KEY;
+            }
+
+            if (ssl->specs.sig_algo == rsa_sa_algo) {
+                /* rsa sig size */
+                word32 i = 0;
+                ret = RsaPrivateKeyDecode(ssl->buffers.key.buffer, &i,
+                                          &rsaKey, ssl->buffers.key.length);
+                if (ret != 0) return ret;
+                sigSz = RsaEncryptSize(&rsaKey); 
+            }
+            else if (ssl->specs.sig_algo == ecc_dsa_sa_algo) {
+                /* ecdsa sig size */
+                word32 i = 0;
+                ret = EccPrivateKeyDecode(ssl->buffers.key.buffer, &i,
+                                          &dsaKey, ssl->buffers.key.length);
+                if (ret != 0) return ret;
+                sigSz = ecc_sig_size(&dsaKey);
+            }
+            else {
+                FreeRsaKey(&rsaKey);
+                ecc_free(&dsaKey);
+                return ALGO_ID_E;  /* unsupported type */
+            }
+            length += sigSz;
+
+            if (IsAtLeastTLSv1_2(ssl))
+                length += HASH_SIG_SIZE;
+
+            sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+
+            #ifdef CYASSL_DTLS 
+                if (ssl->options.dtls) {
+                    sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                    idx    += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                    preSigIdx = idx;
+                }
+            #endif
+            /* check for avalaible size */
+            if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0) {
+                FreeRsaKey(&rsaKey);
+                ecc_free(&dsaKey); 
+                return ret;
+            } 
+
+            /* get ouput buffer */
+            output = ssl->buffers.outputBuffer.buffer + 
+                     ssl->buffers.outputBuffer.length;
+
+            AddHeaders(output, length, server_key_exchange, ssl);
+
+            /* key exchange data */
+            output[idx++] = named_curve;
+            output[idx++] = 0x00;          /* leading zero */
+            output[idx++] = SetCurveId(ecc_size(&ssl->eccTempKey)); 
+            output[idx++] = (byte)expSz;
+            XMEMCPY(output + idx, exportBuf, expSz);
+            idx += expSz;
+            if (IsAtLeastTLSv1_2(ssl)) {
+                output[idx++] = sha_mac;
+                output[idx++] = ssl->specs.sig_algo;
+            }
+            c16toa((word16)sigSz, output + idx);
+            idx += LENGTH_SZ;
+
+            /* do signature */
+            {
+                Md5    md5;
+                Sha    sha;
+                byte   hash[FINISHED_SZ];
+                byte*  signBuffer = hash;
+                word32 signSz    = sizeof(hash);
+
+                /* md5 */
+                InitMd5(&md5);
+                Md5Update(&md5, ssl->arrays.clientRandom, RAN_LEN);
+                Md5Update(&md5, ssl->arrays.serverRandom, RAN_LEN);
+                Md5Update(&md5, output + preSigIdx, preSigSz);
+                Md5Final(&md5, hash);
+
+                /* sha */
+                InitSha(&sha);
+                ShaUpdate(&sha, ssl->arrays.clientRandom, RAN_LEN);
+                ShaUpdate(&sha, ssl->arrays.serverRandom, RAN_LEN);
+                ShaUpdate(&sha, output + preSigIdx, preSigSz);
+                ShaFinal(&sha, &hash[MD5_DIGEST_SIZE]);
+
+                if (ssl->specs.sig_algo == rsa_sa_algo) {
+                    byte encodedSig[MAX_ENCODED_SIG_SZ];
+                    if (IsAtLeastTLSv1_2(ssl)) {
+                        byte* digest;
+                        int   hType;
+                        int   digestSz;
+
+                        /* sha1 for now */
+                        digest   = &hash[MD5_DIGEST_SIZE];
+                        hType    = SHAh;
+                        digestSz = SHA_DIGEST_SIZE;
+
+                        signSz = EncodeSignature(encodedSig, digest, digestSz,
+                                                 hType);
+                        signBuffer = encodedSig;
+                    }
+                    ret = RsaSSL_Sign(signBuffer, signSz, output + idx, sigSz,
+                                      &rsaKey, &ssl->rng);
+                    FreeRsaKey(&rsaKey);
+                    ecc_free(&dsaKey);
+                    if (ret > 0)
+                        ret = 0;  /* reset on success */
+                    else
+                        return ret;
+                }
+                else if (ssl->specs.sig_algo == ecc_dsa_sa_algo) {
+                    word32 sz = sigSz;
+
+                    ret = ecc_sign_hash(&hash[MD5_DIGEST_SIZE], SHA_DIGEST_SIZE,
+                            output + idx, &sz, &ssl->rng, &dsaKey);
+                    FreeRsaKey(&rsaKey);
+                    ecc_free(&dsaKey);
+                    if (ret < 0) return ret;
+                }
+            }
+
+            HashOutput(ssl, output, sendSz, 0);
+
+            #ifdef CYASSL_CALLBACKS
+                if (ssl->hsInfoOn)
+                    AddPacketName("ServerKeyExchange", &ssl->handShakeInfo);
+                if (ssl->toInfoOn)
+                    AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo,
+                                  output, sendSz, ssl->heap);
+            #endif
+
+            ssl->buffers.outputBuffer.length += sendSz;
+            if (ssl->options.groupMessages)
+                ret = 0;
+            else
+                ret = SendBuffered(ssl);
+            ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE;
+        }
+        #endif /* HAVE_ECC */
+
+        #ifdef OPENSSL_EXTRA 
+        if (ssl->specs.kea == diffie_hellman_kea) {
+            byte    *output;
+            word32   length = 0, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+            int      sendSz;
+            word32   sigSz = 0, i = 0;
+            word32   preSigSz = 0, preSigIdx = 0;
+            RsaKey   rsaKey;
+            DhKey    dhKey;
+            
+            if (ssl->buffers.serverDH_P.buffer == NULL ||
+                ssl->buffers.serverDH_G.buffer == NULL)
+                return NO_DH_PARAMS;
+
+            if (ssl->buffers.serverDH_Pub.buffer == NULL) {
+                ssl->buffers.serverDH_Pub.buffer = (byte*)XMALLOC(
+                        ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap,
+                        DYNAMIC_TYPE_DH);
+                if (ssl->buffers.serverDH_Pub.buffer == NULL)
+                    return MEMORY_E;
+            } 
+
+            if (ssl->buffers.serverDH_Priv.buffer == NULL) {
+                ssl->buffers.serverDH_Priv.buffer = (byte*)XMALLOC(
+                        ssl->buffers.serverDH_P.length + 2, ssl->ctx->heap,
+                        DYNAMIC_TYPE_DH);
+                if (ssl->buffers.serverDH_Priv.buffer == NULL)
+                    return MEMORY_E;
+            } 
+
+            InitDhKey(&dhKey);
+            ret = DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer,
+                                   ssl->buffers.serverDH_P.length,
+                                   ssl->buffers.serverDH_G.buffer,
+                                   ssl->buffers.serverDH_G.length);
+            if (ret == 0)
+                ret = DhGenerateKeyPair(&dhKey, &ssl->rng,
+                                         ssl->buffers.serverDH_Priv.buffer,
+                                        &ssl->buffers.serverDH_Priv.length,
+                                         ssl->buffers.serverDH_Pub.buffer,
+                                        &ssl->buffers.serverDH_Pub.length);
+            FreeDhKey(&dhKey);
+
+            if (ret == 0) {
+                length = LENGTH_SZ * 3;  /* p, g, pub */
+                length += ssl->buffers.serverDH_P.length +
+                          ssl->buffers.serverDH_G.length + 
+                          ssl->buffers.serverDH_Pub.length;
+
+                preSigIdx = idx;
+                preSigSz  = length;
+
+                /* sig length */
+                length += LENGTH_SZ;
+
+                if (!ssl->buffers.key.buffer)
+                    return NO_PRIVATE_KEY;
+
+                InitRsaKey(&rsaKey, ssl->heap);
+                ret = RsaPrivateKeyDecode(ssl->buffers.key.buffer, &i, &rsaKey,
+                                          ssl->buffers.key.length);
+                if (ret == 0) {
+                    sigSz = RsaEncryptSize(&rsaKey);
+                    length += sigSz;
+                }
+            }
+            if (ret != 0) {
+                FreeRsaKey(&rsaKey);
+                return ret;
+            }
+                                         
+            if (IsAtLeastTLSv1_2(ssl))
+                length += HASH_SIG_SIZE;
+
+            sendSz = length + HANDSHAKE_HEADER_SZ + RECORD_HEADER_SZ;
+
+            #ifdef CYASSL_DTLS 
+                if (ssl->options.dtls) {
+                    sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                    idx    += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+                    preSigIdx = idx;
+                }
+            #endif
+            /* check for avalaible size */
+            if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0) {
+                FreeRsaKey(&rsaKey);
+                return ret;
+            } 
+
+            /* get ouput buffer */
+            output = ssl->buffers.outputBuffer.buffer + 
+                     ssl->buffers.outputBuffer.length;
+
+            AddHeaders(output, length, server_key_exchange, ssl);
+
+            /* add p, g, pub */
+            c16toa((word16)ssl->buffers.serverDH_P.length, output + idx);
+            idx += LENGTH_SZ;
+            XMEMCPY(output + idx, ssl->buffers.serverDH_P.buffer,
+                                  ssl->buffers.serverDH_P.length);
+            idx += ssl->buffers.serverDH_P.length;
+
+            /*  g */
+            c16toa((word16)ssl->buffers.serverDH_G.length, output + idx);
+            idx += LENGTH_SZ;
+            XMEMCPY(output + idx, ssl->buffers.serverDH_G.buffer,
+                                  ssl->buffers.serverDH_G.length);
+            idx += ssl->buffers.serverDH_G.length;
+
+            /*  pub */
+            c16toa((word16)ssl->buffers.serverDH_Pub.length, output + idx);
+            idx += LENGTH_SZ;
+            XMEMCPY(output + idx, ssl->buffers.serverDH_Pub.buffer,
+                                  ssl->buffers.serverDH_Pub.length);
+            idx += ssl->buffers.serverDH_Pub.length;
+
+            /* Add signature */
+            if (IsAtLeastTLSv1_2(ssl)) {
+                output[idx++] = sha_mac;
+                output[idx++] = ssl->specs.sig_algo; 
+            }
+            /*    size */
+            c16toa((word16)sigSz, output + idx);
+            idx += LENGTH_SZ;
+
+            /* do signature */
+            {
+                Md5    md5;
+                Sha    sha;
+                byte   hash[FINISHED_SZ];
+                byte*  signBuffer = hash;
+                word32 signSz    = sizeof(hash);
+
+                /* md5 */
+                InitMd5(&md5);
+                Md5Update(&md5, ssl->arrays.clientRandom, RAN_LEN);
+                Md5Update(&md5, ssl->arrays.serverRandom, RAN_LEN);
+                Md5Update(&md5, output + preSigIdx, preSigSz);
+                Md5Final(&md5, hash);
+
+                /* sha */
+                InitSha(&sha);
+                ShaUpdate(&sha, ssl->arrays.clientRandom, RAN_LEN);
+                ShaUpdate(&sha, ssl->arrays.serverRandom, RAN_LEN);
+                ShaUpdate(&sha, output + preSigIdx, preSigSz);
+                ShaFinal(&sha, &hash[MD5_DIGEST_SIZE]);
+
+                if (ssl->specs.sig_algo == rsa_sa_algo) {
+                    byte encodedSig[MAX_ENCODED_SIG_SZ];
+                    if (IsAtLeastTLSv1_2(ssl)) {
+                        byte* digest;
+                        int   typeH;
+                        int   digestSz;
+
+                        /* sha1 for now */
+                        digest   = &hash[MD5_DIGEST_SIZE];
+                        typeH    = SHAh;
+                        digestSz = SHA_DIGEST_SIZE;
+
+                        signSz = EncodeSignature(encodedSig, digest, digestSz,
+                                                 typeH);
+                        signBuffer = encodedSig;
+                    }
+                    ret = RsaSSL_Sign(signBuffer, signSz, output + idx, sigSz,
+                                      &rsaKey, &ssl->rng);
+                    FreeRsaKey(&rsaKey);
+                    if (ret > 0)
+                        ret = 0;  /* reset on success */
+                    else
+                        return ret;
+                }
+            }
+
+            HashOutput(ssl, output, sendSz, 0);
+
+            #ifdef CYASSL_CALLBACKS
+                if (ssl->hsInfoOn)
+                    AddPacketName("ServerKeyExchange", &ssl->handShakeInfo);
+                if (ssl->toInfoOn)
+                    AddPacketInfo("ServerKeyExchange", &ssl->timeoutInfo,
+                                  output, sendSz, ssl->heap);
+            #endif
+
+            ssl->buffers.outputBuffer.length += sendSz;
+            if (ssl->options.groupMessages)
+                ret = 0;
+            else
+                ret = SendBuffered(ssl);
+            ssl->options.serverState = SERVER_KEYEXCHANGE_COMPLETE;
+        }
+        #endif /* OPENSSL_EXTRA */
+
+        return ret;
+    }
+
+
+    /* cipher requirements */
+    enum {
+        REQUIRES_RSA,
+        REQUIRES_DHE,
+        REQUIRES_ECC_DSA,
+        REQUIRES_ECC_STATIC,
+        REQUIRES_PSK,
+        REQUIRES_NTRU,
+        REQUIRES_RSA_SIG
+    };
+
+
+
+    /* Does this cipher suite (first, second) have the requirement
+       an ephemeral key exchange will still require the key for signing
+       the key exchange so ECHDE_RSA requires an rsa key thus rsa_kea */
+    static int CipherRequires(byte first, byte second, int requirement)
+    {
+        /* ECC extensions */
+        if (first == ECC_BYTE) {
+        
+        switch (second) {
+
+        case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        case TLS_ECDHE_RSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_ECC_DSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            break;
+
+        case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_ECC_STATIC)
+                return 1;
+            if (requirement == REQUIRES_RSA_SIG)
+                return 1;
+            break;
+
+        default:
+            CYASSL_MSG("Unsupported cipher suite, CipherRequires ECC");
+            return 0;
+        }   /* switch */
+        }   /* if     */
+        if (first != ECC_BYTE) {   /* normal suites */
+        switch (second) {
+
+        case SSL_RSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_NTRU_RSA_WITH_RC4_128_SHA :
+            if (requirement == REQUIRES_NTRU)
+                return 1;
+            break;
+
+        case SSL_RSA_WITH_RC4_128_MD5 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case SSL_RSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA :
+            if (requirement == REQUIRES_NTRU)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_AES_128_CBC_SHA256 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_NTRU_RSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_NTRU)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_AES_256_CBC_SHA256 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_NTRU_RSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_NTRU)
+                return 1;
+            break;
+
+        case TLS_PSK_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_PSK)
+                return 1;
+            break;
+
+        case TLS_PSK_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_PSK)
+                return 1;
+            break;
+
+        case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            if (requirement == REQUIRES_DHE)
+                return 1;
+            break;
+
+        case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            if (requirement == REQUIRES_DHE)
+                return 1;
+            break;
+
+        case TLS_DHE_RSA_WITH_AES_128_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            if (requirement == REQUIRES_DHE)
+                return 1;
+            break;
+
+        case TLS_DHE_RSA_WITH_AES_256_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            if (requirement == REQUIRES_DHE)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_HC_128_CBC_MD5 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+                
+        case TLS_RSA_WITH_HC_128_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_RABBIT_CBC_SHA :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_RSA_WITH_AES_128_GCM_SHA256 :
+        case TLS_RSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            break;
+
+        case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 :
+        case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 :
+            if (requirement == REQUIRES_RSA)
+                return 1;
+            if (requirement == REQUIRES_DHE)
+                return 1;
+            break;
+
+        default:
+            CYASSL_MSG("Unsupported cipher suite, CipherRequires");
+            return 0;
+        }  /* switch */
+        }  /* if ECC / Normal suites else */
+
+        return 0;
+    }
+
+
+
+
+
+    /* Make sure cert/key are valid for this suite, true on success */
+    static int VerifySuite(CYASSL* ssl, word16 idx)
+    {
+        int  haveRSA = !ssl->options.haveStaticECC;
+        int  havePSK = 0;
+        byte first   = ssl->suites.suites[idx];
+        byte second  = ssl->suites.suites[idx+1];
+
+        CYASSL_ENTER("VerifySuite");
+
+        #ifndef NO_PSK
+            havePSK = ssl->options.havePSK;
+        #endif
+
+        if (ssl->options.haveNTRU)
+            haveRSA = 0;
+
+        if (CipherRequires(first, second, REQUIRES_RSA)) {
+            CYASSL_MSG("Requires RSA");
+            if (haveRSA == 0) {
+                CYASSL_MSG("Don't have RSA");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_DHE)) {
+            CYASSL_MSG("Requires DHE");
+            if (ssl->options.haveDH == 0) {
+                CYASSL_MSG("Don't have DHE");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_ECC_DSA)) {
+            CYASSL_MSG("Requires ECCDSA");
+            if (ssl->options.haveECDSAsig == 0) {
+                CYASSL_MSG("Don't have ECCDSA");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_ECC_STATIC)) {
+            CYASSL_MSG("Requires static ECC");
+            if (ssl->options.haveStaticECC == 0) {
+                CYASSL_MSG("Don't have static ECC");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_PSK)) {
+            CYASSL_MSG("Requires PSK");
+            if (havePSK == 0) {
+                CYASSL_MSG("Don't have PSK");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_NTRU)) {
+            CYASSL_MSG("Requires NTRU");
+            if (ssl->options.haveNTRU == 0) {
+                CYASSL_MSG("Don't have NTRU");
+                return 0;
+            }
+        }
+
+        if (CipherRequires(first, second, REQUIRES_RSA_SIG)) {
+            CYASSL_MSG("Requires RSA Signature");
+            if (ssl->options.side == SERVER_END && ssl->options.haveECDSAsig == 1) {
+                CYASSL_MSG("Don't have RSA Signature");
+                return 0;
+            }
+        }
+
+        /* ECCDHE is always supported if ECC on */
+
+        return 1;
+    }
+
+
+    static int MatchSuite(CYASSL* ssl, Suites* peerSuites)
+    {
+        word16 i, j;
+
+        CYASSL_ENTER("MatchSuite");
+
+        /* & 0x1 equivalent % 2 */
+        if (peerSuites->suiteSz == 0 || peerSuites->suiteSz & 0x1)
+            return MATCH_SUITE_ERROR;
+
+        /* start with best, if a match we are good */
+        for (i = 0; i < ssl->suites.suiteSz; i += 2)
+            for (j = 0; j < peerSuites->suiteSz; j += 2)
+                if (ssl->suites.suites[i]   == peerSuites->suites[j] &&
+                    ssl->suites.suites[i+1] == peerSuites->suites[j+1] ) {
+
+                    if (VerifySuite(ssl, i)) {
+                        CYASSL_MSG("Verified suite validity");
+                        ssl->options.cipherSuite0 = ssl->suites.suites[i];
+                        ssl->options.cipherSuite  = ssl->suites.suites[i+1];
+                        return SetCipherSpecs(ssl);
+                    }
+                    else {
+                        CYASSL_MSG("Coult not verify suite validity, continue");
+                    }
+                }
+
+        return MATCH_SUITE_ERROR;
+    }
+
+
+    /* process old style client hello, deprecate? */
+    int ProcessOldClientHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                              word32 inSz, word16 sz)
+    {
+        word32          idx = *inOutIdx;
+        word16          sessionSz;
+        word16          randomSz;
+        word16          i, j;
+        ProtocolVersion pv;
+        Suites          clSuites;
+
+        (void)inSz;
+        CYASSL_MSG("Got old format client hello");
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("ClientHello", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddLateName("ClientHello", &ssl->timeoutInfo);
+#endif
+
+        /* manually hash input since different format */
+        Md5Update(&ssl->hashMd5, input + idx, sz);
+        ShaUpdate(&ssl->hashSha, input + idx, sz);
+#ifndef NO_SHA256
+    if (IsAtLeastTLSv1_2(ssl))
+        Sha256Update(&ssl->hashSha256, input + idx, sz);
+#endif
+
+        /* does this value mean client_hello? */
+        idx++;
+
+        /* version */
+        pv.major = input[idx++];
+        pv.minor = input[idx++];
+        ssl->chVersion = pv;  /* store */
+
+        if (ssl->version.minor > pv.minor) {
+            byte havePSK = 0;
+            if (!ssl->options.downgrade) {
+                CYASSL_MSG("Client trying to connect with lesser version"); 
+                return VERSION_ERROR;
+            }
+            if (pv.minor == SSLv3_MINOR) {
+                /* turn off tls */
+                CYASSL_MSG("    downgrading to SSLv3");
+                ssl->options.tls    = 0;
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = SSLv3_MINOR;
+            }
+            else if (pv.minor == TLSv1_MINOR) {
+                CYASSL_MSG("    downgrading to TLSv1");
+                /* turn off tls 1.1+ */
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = TLSv1_MINOR;
+            }
+            else if (pv.minor == TLSv1_1_MINOR) {
+                CYASSL_MSG("    downgrading to TLSv1.1");
+                ssl->version.minor  = TLSv1_1_MINOR;
+            }
+#ifndef NO_PSK
+            havePSK = ssl->options.havePSK;
+#endif
+
+            InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, havePSK,
+                       ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                       ssl->options.haveStaticECC, ssl->options.side);
+        }
+
+        /* suite size */
+        ato16(&input[idx], &clSuites.suiteSz);
+        idx += 2;
+
+        if (clSuites.suiteSz > MAX_SUITE_SZ)
+            return BUFFER_ERROR;
+
+        /* session size */
+        ato16(&input[idx], &sessionSz);
+        idx += 2;
+
+        if (sessionSz > ID_LEN)
+            return BUFFER_ERROR;
+    
+        /* random size */
+        ato16(&input[idx], &randomSz);
+        idx += 2;
+
+        if (randomSz > RAN_LEN)
+            return BUFFER_ERROR;
+
+        /* suites */
+        for (i = 0, j = 0; i < clSuites.suiteSz; i += 3) {    
+            byte first = input[idx++];
+            if (!first) { /* implicit: skip sslv2 type */
+                XMEMCPY(&clSuites.suites[j], &input[idx], 2);
+                j += 2;
+            }
+            idx += 2;
+        }
+        clSuites.suiteSz = j;
+
+        /* session id */
+        if (sessionSz) {
+            XMEMCPY(ssl->arrays.sessionID, input + idx, sessionSz);
+            idx += sessionSz;
+            ssl->options.resuming = 1;
+        }
+
+        /* random */
+        if (randomSz < RAN_LEN)
+            XMEMSET(ssl->arrays.clientRandom, 0, RAN_LEN - randomSz);
+        XMEMCPY(&ssl->arrays.clientRandom[RAN_LEN - randomSz], input + idx,
+               randomSz);
+        idx += randomSz;
+
+        if (ssl->options.usingCompression)
+            ssl->options.usingCompression = 0;  /* turn off */
+
+        ssl->options.clientState = CLIENT_HELLO_COMPLETE;
+        *inOutIdx = idx;
+
+        ssl->options.haveSessionId = 1;
+        /* DoClientHello uses same resume code */
+        while (ssl->options.resuming) {  /* let's try */
+            int ret; 
+            CYASSL_SESSION* session = GetSession(ssl, ssl->arrays.masterSecret);
+            if (!session) {
+                ssl->options.resuming = 0;
+                break;   /* session lookup failed */
+            }
+            if (MatchSuite(ssl, &clSuites) < 0) {
+                CYASSL_MSG("Unsupported cipher suite, OldClientHello");
+                return UNSUPPORTED_SUITE;
+            }
+
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.serverRandom, RAN_LEN);
+            if (ssl->options.tls)
+                ret = DeriveTlsKeys(ssl);
+            else
+                ret = DeriveKeys(ssl);
+            ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
+
+            return ret;
+        }
+
+        return MatchSuite(ssl, &clSuites);
+    }
+
+
+    static int DoClientHello(CYASSL* ssl, const byte* input, word32* inOutIdx,
+                             word32 totalSz, word32 helloSz)
+    {
+        byte b;
+        ProtocolVersion pv;
+        Suites          clSuites;
+        word32 i = *inOutIdx;
+        word32 begin = i;
+
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn) AddPacketName("ClientHello", &ssl->handShakeInfo);
+        if (ssl->toInfoOn) AddLateName("ClientHello", &ssl->timeoutInfo);
+#endif
+        /* make sure can read up to session */
+        if (i + sizeof(pv) + RAN_LEN + ENUM_LEN > totalSz)
+            return INCOMPLETE_DATA;
+
+        XMEMCPY(&pv, input + i, sizeof(pv));
+        ssl->chVersion = pv;   /* store */
+        i += sizeof(pv);
+        if (ssl->version.minor > pv.minor) {
+            byte havePSK = 0;
+            if (!ssl->options.downgrade) {
+                CYASSL_MSG("Client trying to connect with lesser version"); 
+                return VERSION_ERROR;
+            }
+            if (pv.minor == SSLv3_MINOR) {
+                /* turn off tls */
+                CYASSL_MSG("    downgrading to SSLv3");
+                ssl->options.tls    = 0;
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = SSLv3_MINOR;
+            }
+            else if (pv.minor == TLSv1_MINOR) {
+                /* turn off tls 1.1+ */
+                CYASSL_MSG("    downgrading to TLSv1");
+                ssl->options.tls1_1 = 0;
+                ssl->version.minor  = TLSv1_MINOR;
+            }
+            else if (pv.minor == TLSv1_1_MINOR) {
+                CYASSL_MSG("    downgrading to TLSv1.1");
+                ssl->version.minor  = TLSv1_1_MINOR;
+            }
+#ifndef NO_PSK
+            havePSK = ssl->options.havePSK;
+#endif
+            InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, havePSK,
+                       ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                       ssl->options.haveStaticECC, ssl->options.side);
+        }
+        /* random */
+        XMEMCPY(ssl->arrays.clientRandom, input + i, RAN_LEN);
+        i += RAN_LEN;
+
+#ifdef SHOW_SECRETS
+        {
+            int j;
+            printf("client random: ");
+            for (j = 0; j < RAN_LEN; j++)
+                printf("%02x", ssl->arrays.clientRandom[j]);
+            printf("\n");
+        }
+#endif
+        /* session id */
+        b = input[i++];
+        if (b) {
+            if (i + ID_LEN > totalSz)
+                return INCOMPLETE_DATA;
+            XMEMCPY(ssl->arrays.sessionID, input + i, ID_LEN);
+            i += b;
+            ssl->options.resuming= 1; /* client wants to resume */
+            CYASSL_MSG("Client wants to resume session");
+        }
+        
+        #ifdef CYASSL_DTLS
+            /* cookie */
+            if (ssl->options.dtls) {
+                b = input[i++];
+                if (b) {
+                    byte cookie[MAX_COOKIE_LEN];
+                    byte cookieSz;
+
+                    if (b > MAX_COOKIE_LEN)
+                        return BUFFER_ERROR;
+                    if (i + b > totalSz)
+                        return INCOMPLETE_DATA;
+                    cookieSz = EmbedGenerateCookie(cookie, COOKIE_SZ, ssl);
+                    if ((b != cookieSz) || XMEMCMP(cookie, input + i, b) != 0)
+                        return COOKIE_ERROR;
+                    i += b;
+                }
+            }
+        #endif
+
+        if (i + LENGTH_SZ > totalSz)
+            return INCOMPLETE_DATA;
+        /* suites */
+        ato16(&input[i], &clSuites.suiteSz);
+        i += 2;
+
+        /* suites and comp len */
+        if (i + clSuites.suiteSz + ENUM_LEN > totalSz)
+            return INCOMPLETE_DATA;
+        if (clSuites.suiteSz > MAX_SUITE_SZ)
+            return BUFFER_ERROR;
+        XMEMCPY(clSuites.suites, input + i, clSuites.suiteSz);
+        i += clSuites.suiteSz;
+
+        b = input[i++];  /* comp len */
+        if (i + b > totalSz)
+            return INCOMPLETE_DATA;
+
+        if (ssl->options.usingCompression) {
+            int match = 0;
+            while (b--) {
+                byte comp = input[i++];
+                if (comp == ZLIB_COMPRESSION)
+                    match = 1;
+            }
+            if (!match) {
+                CYASSL_MSG("Not matching compression, turning off"); 
+                ssl->options.usingCompression = 0;  /* turn off */
+            }
+        }
+        else
+            i += b;  /* ignore, since we're not on */
+
+        ssl->options.clientState = CLIENT_HELLO_COMPLETE;
+
+        *inOutIdx = i;
+        if ( (i - begin) < helloSz)
+            *inOutIdx = begin + helloSz;  /* skip extensions */
+        
+        ssl->options.haveSessionId = 1;
+        /* ProcessOld uses same resume code */
+        while (ssl->options.resuming) {  /* let's try */
+            int ret;            
+            CYASSL_SESSION* session = GetSession(ssl, ssl->arrays.masterSecret);
+            if (!session) {
+                ssl->options.resuming = 0;
+                CYASSL_MSG("Session lookup for resume failed");
+                break;   /* session lookup failed */
+            }
+            if (MatchSuite(ssl, &clSuites) < 0) {
+                CYASSL_MSG("Unsupported cipher suite, ClientHello");
+                return UNSUPPORTED_SUITE;
+            }
+
+            RNG_GenerateBlock(&ssl->rng, ssl->arrays.serverRandom, RAN_LEN);
+            if (ssl->options.tls)
+                ret = DeriveTlsKeys(ssl);
+            else
+                ret = DeriveKeys(ssl);
+            ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
+
+            return ret;
+        }
+        return MatchSuite(ssl, &clSuites);
+    }
+
+
+    static int DoCertificateVerify(CYASSL* ssl, byte* input, word32* inOutsz,
+                                   word32 totalSz)
+    {
+        word16      sz = 0;
+        word32      i = *inOutsz;
+        int         ret = VERIFY_CERT_ERROR;   /* start in error state */
+        byte*       sig;
+        byte*       out;
+        int         outLen;
+
+        #ifdef CYASSL_CALLBACKS
+            if (ssl->hsInfoOn)
+                AddPacketName("CertificateVerify", &ssl->handShakeInfo);
+            if (ssl->toInfoOn)
+                AddLateName("CertificateVerify", &ssl->timeoutInfo);
+        #endif
+        if ( (i + VERIFY_HEADER) > totalSz)
+            return INCOMPLETE_DATA;
+
+        if (IsAtLeastTLSv1_2(ssl))
+           i += HASH_SIG_SIZE; 
+        ato16(&input[i], &sz);
+        i += VERIFY_HEADER;
+
+        if ( (i + sz) > totalSz)
+            return INCOMPLETE_DATA;
+
+        if (sz > ENCRYPT_LEN)
+            return BUFFER_ERROR;
+
+        sig = &input[i];
+        *inOutsz = i + sz;
+
+        /* RSA */
+        if (ssl->peerRsaKeyPresent != 0) {
+            CYASSL_MSG("Doing RSA peer cert verify");
+
+            outLen = RsaSSL_VerifyInline(sig, sz, &out, &ssl->peerRsaKey);
+
+            if (IsAtLeastTLSv1_2(ssl)) {
+                byte   encodedSig[MAX_ENCODED_SIG_SZ];
+                word32 sigSz;
+                byte*  digest;
+                int    typeH;
+                int    digestSz;
+
+                /* sha1 for now */
+                digest   = ssl->certHashes.sha;
+                typeH    = SHAh;
+                digestSz = SHA_DIGEST_SIZE;
+
+                sigSz = EncodeSignature(encodedSig, digest, digestSz, typeH);
+
+                if (outLen == (int)sigSz && XMEMCMP(out, encodedSig,
+                                           min(sigSz, MAX_ENCODED_SIG_SZ)) == 0)
+                    ret = 0;  /* verified */
+            }
+            else {
+                if (outLen == sizeof(ssl->certHashes) && XMEMCMP(out,
+                                &ssl->certHashes, sizeof(ssl->certHashes)) == 0)
+                    ret = 0;  /* verified */
+            }
+        }
+#ifdef HAVE_ECC
+        else if (ssl->peerEccDsaKeyPresent) {
+            int verify =  0;
+            int err    = -1;
+
+            CYASSL_MSG("Doing ECC peer cert verify");
+
+            err = ecc_verify_hash(sig, sz, ssl->certHashes.sha, SHA_DIGEST_SIZE,
+                                  &verify, &ssl->peerEccDsaKey);
+
+            if (err == 0 && verify == 1)
+               ret = 0;   /* verified */ 
+        }
+#endif
+        return ret;
+    }
+
+
+    int SendServerHelloDone(CYASSL* ssl)
+    {
+        byte              *output;
+        int                sendSz = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
+        int                ret;
+
+        #ifdef CYASSL_DTLS
+            if (ssl->options.dtls)
+                sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
+        #endif
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        output = ssl->buffers.outputBuffer.buffer +
+                 ssl->buffers.outputBuffer.length;
+
+        AddHeaders(output, 0, server_hello_done, ssl);
+
+        HashOutput(ssl, output, sendSz, 0);
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("ServerHelloDone", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("ServerHelloDone", &ssl->timeoutInfo, output, sendSz,
+                          ssl->heap);
+#endif
+        ssl->options.serverState = SERVER_HELLODONE_COMPLETE;
+
+        ssl->buffers.outputBuffer.length += sendSz;
+
+        return SendBuffered(ssl);
+    }
+
+#ifdef CYASSL_DTLS
+    int SendHelloVerifyRequest(CYASSL* ssl)
+    {
+        byte* output;
+        byte  cookieSz = COOKIE_SZ;
+        int   length = VERSION_SZ + ENUM_LEN + cookieSz;
+        int   idx    = DTLS_RECORD_HEADER_SZ + DTLS_HANDSHAKE_HEADER_SZ;
+        int   sendSz = length + idx;
+        int   ret;
+
+        /* check for avalaible size */
+        if ((ret = CheckAvalaibleSize(ssl, sendSz)) != 0)
+            return ret;
+
+        /* get ouput buffer */
+        output = ssl->buffers.outputBuffer.buffer +
+                 ssl->buffers.outputBuffer.length;
+
+        AddHeaders(output, length, hello_verify_request, ssl);
+
+        XMEMCPY(output + idx, &ssl->chVersion, VERSION_SZ);
+        idx += VERSION_SZ;
+
+        output[idx++] = cookieSz;
+        if ((ret = EmbedGenerateCookie(output + idx, cookieSz, ssl)) < 0)
+            return ret;
+
+        HashOutput(ssl, output, sendSz, 0);
+#ifdef CYASSL_CALLBACKS
+        if (ssl->hsInfoOn)
+            AddPacketName("HelloVerifyRequest", &ssl->handShakeInfo);
+        if (ssl->toInfoOn)
+            AddPacketInfo("HelloVerifyRequest", &ssl->timeoutInfo, output,
+                          sendSz, ssl->heap);
+#endif
+        ssl->options.serverState = SERVER_HELLOVERIFYREQUEST_COMPLETE;
+
+        ssl->buffers.outputBuffer.length += sendSz;
+
+        return SendBuffered(ssl);
+    }
+#endif
+
+    static int DoClientKeyExchange(CYASSL* ssl, byte* input,
+                                   word32* inOutIdx)
+    {
+        int    ret = 0;
+        word32 length = 0;
+        byte*  out;
+
+        if (ssl->options.verifyPeer && ssl->options.failNoCert)
+            if (!ssl->options.havePeerCert) {
+                CYASSL_MSG("client didn't present peer cert");
+                return NO_PEER_CERT;
+            }
+
+        #ifdef CYASSL_CALLBACKS
+            if (ssl->hsInfoOn)
+                AddPacketName("ClientKeyExchange", &ssl->handShakeInfo);
+            if (ssl->toInfoOn)
+                AddLateName("ClientKeyExchange", &ssl->timeoutInfo);
+        #endif
+        if (ssl->specs.kea == rsa_kea) {
+            word32 idx = 0;
+            RsaKey key;
+            byte*  tmp = 0;
+
+            InitRsaKey(&key, ssl->heap);
+
+            if (ssl->buffers.key.buffer)
+                ret = RsaPrivateKeyDecode(ssl->buffers.key.buffer, &idx, &key,
+                                          ssl->buffers.key.length);
+            else
+                return NO_PRIVATE_KEY;
+
+            if (ret == 0) {
+                length = RsaEncryptSize(&key);
+                ssl->arrays.preMasterSz = SECRET_LEN;
+
+                if (ssl->options.tls)
+                    (*inOutIdx) += 2;
+                tmp = input + *inOutIdx;
+                *inOutIdx += length;
+
+                if (RsaPrivateDecryptInline(tmp, length, &out, &key) ==
+                                                             SECRET_LEN) {
+                    XMEMCPY(ssl->arrays.preMasterSecret, out, SECRET_LEN);
+                    if (ssl->arrays.preMasterSecret[0] != ssl->chVersion.major
+                     ||
+                        ssl->arrays.preMasterSecret[1] != ssl->chVersion.minor)
+
+                        ret = PMS_VERSION_ERROR;
+                    else
+                        ret = MakeMasterSecret(ssl);
+                }
+                else
+                    ret = RSA_PRIVATE_ERROR;
+            }
+
+            FreeRsaKey(&key);
+#ifndef NO_PSK
+        } else if (ssl->specs.kea == psk_kea) {
+            byte* pms = ssl->arrays.preMasterSecret;
+            word16 ci_sz;
+
+            ato16(&input[*inOutIdx], &ci_sz);
+            *inOutIdx += LENGTH_SZ;
+            if (ci_sz > MAX_PSK_ID_LEN) return CLIENT_ID_ERROR;
+
+            XMEMCPY(ssl->arrays.client_identity, &input[*inOutIdx], ci_sz);
+            *inOutIdx += ci_sz;
+            ssl->arrays.client_identity[ci_sz] = 0;
+
+            ssl->arrays.psk_keySz = ssl->options.server_psk_cb(ssl,
+                ssl->arrays.client_identity, ssl->arrays.psk_key,
+                MAX_PSK_KEY_LEN);
+            if (ssl->arrays.psk_keySz == 0 || 
+                ssl->arrays.psk_keySz > MAX_PSK_KEY_LEN) return PSK_KEY_ERROR;
+            
+            /* make psk pre master secret */
+            /* length of key + length 0s + length of key + key */
+            c16toa((word16)ssl->arrays.psk_keySz, pms);
+            pms += 2;
+            XMEMSET(pms, 0, ssl->arrays.psk_keySz);
+            pms += ssl->arrays.psk_keySz;
+            c16toa((word16)ssl->arrays.psk_keySz, pms);
+            pms += 2;
+            XMEMCPY(pms, ssl->arrays.psk_key, ssl->arrays.psk_keySz);
+            ssl->arrays.preMasterSz = ssl->arrays.psk_keySz * 2 + 4;
+
+            ret = MakeMasterSecret(ssl);
+#endif /* NO_PSK */
+#ifdef HAVE_NTRU
+        } else if (ssl->specs.kea == ntru_kea) {
+            word32 rc;
+            word16 cipherLen;
+            word16 plainLen = sizeof(ssl->arrays.preMasterSecret);
+            byte*  tmp;
+
+            if (!ssl->buffers.key.buffer)
+                return NO_PRIVATE_KEY;
+
+            ato16(&input[*inOutIdx], &cipherLen);
+            *inOutIdx += LENGTH_SZ;
+            if (cipherLen > MAX_NTRU_ENCRYPT_SZ)
+                return NTRU_KEY_ERROR;
+
+            tmp = input + *inOutIdx;
+            rc = crypto_ntru_decrypt((word16)ssl->buffers.key.length,
+                        ssl->buffers.key.buffer, cipherLen, tmp, &plainLen,
+                        ssl->arrays.preMasterSecret);
+
+            if (rc != NTRU_OK || plainLen != SECRET_LEN)
+                return NTRU_DECRYPT_ERROR;
+            *inOutIdx += cipherLen;
+
+            ssl->arrays.preMasterSz = plainLen;
+            ret = MakeMasterSecret(ssl);
+#endif /* HAVE_NTRU */
+#ifdef HAVE_ECC
+        } else if (ssl->specs.kea == ecc_diffie_hellman_kea) {
+            word32 size;
+            word32 bLength = input[*inOutIdx];  /* one byte length */
+            *inOutIdx += 1;
+
+            ret = ecc_import_x963(&input[*inOutIdx], bLength, &ssl->peerEccKey);
+            if (ret != 0)
+                return ECC_PEERKEY_ERROR;
+            *inOutIdx += bLength;
+            ssl->peerEccKeyPresent = 1;
+
+            size = sizeof(ssl->arrays.preMasterSecret);
+            if (ssl->specs.static_ecdh) {
+                ecc_key staticKey;
+                word32 i = 0;
+
+                ecc_init(&staticKey);
+                ret = EccPrivateKeyDecode(ssl->buffers.key.buffer, &i,
+                                          &staticKey, ssl->buffers.key.length);
+                if (ret == 0)
+                    ret = ecc_shared_secret(&staticKey, &ssl->peerEccKey,
+                                            ssl->arrays.preMasterSecret, &size);
+                ecc_free(&staticKey);
+            }
+            else 
+                ret = ecc_shared_secret(&ssl->eccTempKey, &ssl->peerEccKey,
+                                    ssl->arrays.preMasterSecret, &size);
+            if (ret != 0)
+                return ECC_SHARED_ERROR;
+            ssl->arrays.preMasterSz = size;
+            ret = MakeMasterSecret(ssl);
+#endif /* HAVE_ECC */
+#ifdef OPENSSL_EXTRA 
+        } else if (ssl->specs.kea == diffie_hellman_kea) {
+            byte*  clientPub;
+            word16 clientPubSz;
+            DhKey  dhKey;
+
+            ato16(&input[*inOutIdx], &clientPubSz);
+            *inOutIdx += LENGTH_SZ;
+
+            clientPub = &input[*inOutIdx];
+            *inOutIdx += clientPubSz;
+
+            InitDhKey(&dhKey);
+            ret = DhSetKey(&dhKey, ssl->buffers.serverDH_P.buffer,
+                                   ssl->buffers.serverDH_P.length,
+                                   ssl->buffers.serverDH_G.buffer,
+                                   ssl->buffers.serverDH_G.length);
+            if (ret == 0)
+                ret = DhAgree(&dhKey, ssl->arrays.preMasterSecret,
+                                     &ssl->arrays.preMasterSz,
+                                      ssl->buffers.serverDH_Priv.buffer,
+                                      ssl->buffers.serverDH_Priv.length,
+                                      clientPub, clientPubSz);
+            FreeDhKey(&dhKey);
+            if (ret == 0)
+                ret = MakeMasterSecret(ssl);
+#endif /* OPENSSL_EXTRA */
+        }
+
+        if (ret == 0) {
+            ssl->options.clientState = CLIENT_KEYEXCHANGE_COMPLETE;
+            if (ssl->options.verifyPeer)
+                BuildCertHashes(ssl, &ssl->certHashes);
+        }
+
+        return ret;
+    }
+
+#endif /* NO_CYASSL_SERVER */
+
+
+#ifdef SINGLE_THREADED
+
+int InitMutex(CyaSSL_Mutex* m)
+{
+    return 0;
+}
+
+
+int FreeMutex(CyaSSL_Mutex* m)
+{
+    return 0;
+}
+
+
+int LockMutex(CyaSSL_Mutex* m)
+{
+    return 0;
+}
+
+
+int UnLockMutex(CyaSSL_Mutex* m)
+{
+    return 0;
+}
+
+#else /* MULTI_THREAD */
+
+    #if defined(FREERTOS)
+
+        int InitMutex(CyaSSL_Mutex* m)
+        {
+            int iReturn;
+
+            *m = ( CyaSSL_Mutex ) xSemaphoreCreateMutex();
+            if( *m != NULL )
+                iReturn = 0;
+            else
+                iReturn = BAD_MUTEX_ERROR;
+
+            return iReturn;
+        }
+
+        int FreeMutex(CyaSSL_Mutex* m)
+        {
+            vSemaphoreDelete( *m );
+            return 0;
+        }
+
+        int LockMutex(CyaSSL_Mutex* m)
+        {
+            /* Assume an infinite block, or should there be zero block? */
+            xSemaphoreTake( *m, portMAX_DELAY );
+            return 0;
+        }
+
+        int UnLockMutex(CyaSSL_Mutex* m)
+        {
+            xSemaphoreGive( *m );
+            return 0;
+        }
+
+    #elif defined(USE_WINDOWS_API)
+
+        int InitMutex(CyaSSL_Mutex* m)
+        {
+            InitializeCriticalSection(m);
+            return 0;
+        }
+
+
+        int FreeMutex(CyaSSL_Mutex* m)
+        {
+            DeleteCriticalSection(m);
+            return 0;
+        }
+
+
+        int LockMutex(CyaSSL_Mutex* m)
+        {
+            EnterCriticalSection(m);
+            return 0;
+        }
+
+
+        int UnLockMutex(CyaSSL_Mutex* m)
+        {
+            LeaveCriticalSection(m);
+            return 0;
+        }
+
+    #elif defined(CYASSL_PTHREADS)
+
+        int InitMutex(CyaSSL_Mutex* m)
+        {
+            if (pthread_mutex_init(m, 0) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int FreeMutex(CyaSSL_Mutex* m)
+        {
+            if (pthread_mutex_destroy(m) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int LockMutex(CyaSSL_Mutex* m)
+        {
+            if (pthread_mutex_lock(m) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int UnLockMutex(CyaSSL_Mutex* m)
+        {
+            if (pthread_mutex_unlock(m) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+    #elif defined(THREADX)
+
+        int InitMutex(CyaSSL_Mutex* m)
+        {
+            if (tx_mutex_create(m, "CyaSSL Mutex", TX_NO_INHERIT) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int FreeMutex(CyaSSL_Mutex* m)
+        {
+            if (tx_mutex_delete(m) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int LockMutex(CyaSSL_Mutex* m)
+        {
+            if (tx_mutex_get(m, TX_WAIT_FOREVER) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+
+        int UnLockMutex(CyaSSL_Mutex* m)
+        {
+            if (tx_mutex_put(m) == 0)
+                return 0;
+            else
+                return BAD_MUTEX_ERROR;
+        }
+
+    #elif defined(MICRIUM)
+
+        int InitMutex(CyaSSL_Mutex* m)
+        {
+            #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+                if (NetSecure_OS_MutexCreate(m) == 0)
+                    return 0;
+                else
+                    return BAD_MUTEX_ERROR;
+            #else
+                return 0;
+            #endif
+        }
+
+
+        int FreeMutex(CyaSSL_Mutex* m)
+        {
+            #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+                if (NetSecure_OS_FreeMutex(m) == 0)
+                    return 0;
+                else
+                    return BAD_MUTEX_ERROR;
+            #else
+                return 0;
+            #endif
+        }
+
+
+        int LockMutex(CyaSSL_Mutex* m)
+        {
+            #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+                if (NetSecure_OS_LockMutex(m) == 0)
+                    return 0;
+                else
+                    return BAD_MUTEX_ERROR;
+            #else
+                return 0;
+            #endif
+        }
+
+
+        int UnLockMutex(CyaSSL_Mutex* m)
+        {
+            #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
+                if (NetSecure_OS_UnLockMutex(m) == 0)
+                    return 0;
+                else
+                    return BAD_MUTEX_ERROR;
+            #else
+                return 0;
+            #endif
+
+        }
+
+    #endif /* USE_WINDOWS_API */
+#endif /* SINGLE_THREADED */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/io.c b/FreeRTOS-Plus/Source/CyaSSL/src/io.c
new file mode 100644 (file)
index 0000000..9316def
--- /dev/null
@@ -0,0 +1,273 @@
+/* io.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef _WIN32_WCE
+    /* On WinCE winsock2.h must be included before windows.h for socket stuff */
+    #include <winsock2.h>
+#endif
+
+#include <cyassl/internal.h>
+
+/* if user writes own I/O callbacks they can define CYASSL_USER_IO to remove
+   automatic setting of default I/O functions EmbedSend() and EmbedReceive()
+   but they'll still need SetCallback xxx() at end of file 
+*/
+#ifndef CYASSL_USER_IO
+
+#ifdef HAVE_LIBZ
+    #include "zlib.h"
+#endif
+
+#ifndef USE_WINDOWS_API
+    #ifdef CYASSL_LWIP
+        /* lwIP needs to be configured to use sockets API in this mode */
+        /* LWIP_SOCKET 1 && LWIP_COMPAT_SOCKETS 1 in lwip/opt.h or in build */
+        #define LWIP_PROVIDE_ERRNO 1
+        #include "sockets.h"
+    #else
+        #include <sys/types.h>
+        #include <errno.h>
+        #include <unistd.h>
+        #include <fcntl.h>
+        #if !(defined(DEVKITPRO) || defined(THREADX))
+            #include <sys/socket.h>
+            #include <arpa/inet.h>
+            #include <netinet/in.h>
+            #include <netdb.h>
+            #ifdef __PPU
+                #include <netex/errno.h>
+            #else
+                #include <sys/ioctl.h>
+            #endif
+        #endif
+        #ifdef THREADX
+            #include <socket.h>
+        #endif
+    #endif
+#endif /* USE_WINDOWS_API */
+
+#ifdef __sun
+    #include <sys/filio.h>
+#endif
+
+#ifdef USE_WINDOWS_API 
+    /* no epipe yet */
+    #ifndef WSAEPIPE
+        #define WSAEPIPE       -12345
+    #endif
+    #define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
+    #define SOCKET_EAGAIN      WSAEWOULDBLOCK
+    #define SOCKET_ECONNRESET  WSAECONNRESET
+    #define SOCKET_EINTR       WSAEINTR
+    #define SOCKET_EPIPE       WSAEPIPE
+#elif defined(__PPU)
+    #define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
+    #define SOCKET_EAGAIN      SYS_NET_EAGAIN
+    #define SOCKET_ECONNRESET  SYS_NET_ECONNRESET
+    #define SOCKET_EINTR       SYS_NET_EINTR
+    #define SOCKET_EPIPE       SYS_NET_EPIPE
+#else
+    #define SOCKET_EWOULDBLOCK EWOULDBLOCK
+    #define SOCKET_EAGAIN      EAGAIN
+    #define SOCKET_ECONNRESET  ECONNRESET
+    #define SOCKET_EINTR       EINTR
+    #define SOCKET_EPIPE       EPIPE
+#endif /* USE_WINDOWS_API */
+
+
+#ifdef DEVKITPRO
+    /* from network.h */
+    int net_send(int, const void*, int, unsigned int);
+    int net_recv(int, void*, int, unsigned int);
+    #define SEND_FUNCTION net_send
+    #define RECV_FUNCTION net_recv
+#else
+    #define SEND_FUNCTION send
+    #define RECV_FUNCTION recv
+#endif
+
+
+static INLINE int LastError(void)
+{
+#ifdef USE_WINDOWS_API 
+    return WSAGetLastError();
+#else
+    return errno;
+#endif
+}
+
+/* The receive embedded callback
+ *  return : nb bytes read, or error
+ */
+int EmbedReceive(char *buf, int sz, void *ctx)
+{
+    int recvd;
+    int err;
+    int sd = *(int*)ctx;
+
+    recvd = RECV_FUNCTION(sd, (char *)buf, sz, 0);
+
+    if (recvd < 0) {
+        err = LastError();
+        CYASSL_MSG("Embed Receive error");
+
+        if (err == SOCKET_EWOULDBLOCK || err == SOCKET_EAGAIN) {
+            CYASSL_MSG("    Would block");
+            return IO_ERR_WANT_READ;
+        }
+        else if (err == SOCKET_ECONNRESET) {
+            CYASSL_MSG("    Connection reset");
+            return IO_ERR_CONN_RST;
+        }
+        else if (err == SOCKET_EINTR) {
+            CYASSL_MSG("    Socket interrupted");
+            return IO_ERR_ISR;
+        }
+        else {
+            CYASSL_MSG("    General error");
+            return IO_ERR_GENERAL;
+        }
+    }
+    else if (recvd == 0) {
+        CYASSL_MSG("Embed receive connection closed");
+        return IO_ERR_CONN_CLOSE;
+    }
+
+    return recvd;
+}
+
+/* The send embedded callback
+ *  return : nb bytes sent, or error
+ */
+int EmbedSend(char *buf, int sz, void *ctx)
+{
+    int sd = *(int*)ctx;
+    int sent;
+    int len = sz;
+    int err;
+
+    sent = SEND_FUNCTION(sd, &buf[sz - len], len, 0);
+
+    if (sent < 0) {
+        err = LastError();
+        CYASSL_MSG("Embed Send error");
+
+        if (err == SOCKET_EWOULDBLOCK || err == SOCKET_EAGAIN) {
+            CYASSL_MSG("    Would Block");
+            return IO_ERR_WANT_WRITE;
+        }
+        else if (err == SOCKET_ECONNRESET) {
+            CYASSL_MSG("    Connection reset");
+            return IO_ERR_CONN_RST;
+        }
+        else if (err == SOCKET_EINTR) {
+            CYASSL_MSG("    Socket interrupted");
+            return IO_ERR_ISR;
+        }
+        else if (err == SOCKET_EPIPE) {
+            CYASSL_MSG("    Socket EPIPE");
+            return IO_ERR_CONN_CLOSE;
+        }
+        else {
+            CYASSL_MSG("    General error");
+            return IO_ERR_GENERAL;
+        }
+    }
+    return sent;
+}
+
+
+#ifdef CYASSL_DTLS
+
+#include <cyassl/ctaocrypt/sha.h>
+
+/* The DTLS Generate Cookie callback
+ *  return : number of bytes copied into buf, or error
+ */
+int EmbedGenerateCookie(byte *buf, int sz, void *ctx)
+{
+    CYASSL* ssl = (CYASSL*)ctx;
+    int sd = ssl->wfd;
+    struct sockaddr_storage peer;
+    socklen_t peerSz = sizeof(peer);
+    byte cookieSrc[sizeof(struct in6_addr) + sizeof(int)];
+    int cookieSrcSz = 0;
+    Sha sha;
+
+    getpeername(sd, (struct sockaddr*)&peer, &peerSz);
+    
+    if (peer.ss_family == AF_INET) {
+        struct sockaddr_in *s = (struct sockaddr_in*)&peer;
+
+        cookieSrcSz = sizeof(struct in_addr) + sizeof(s->sin_port);
+        XMEMCPY(cookieSrc, &s->sin_port, sizeof(s->sin_port));
+        XMEMCPY(cookieSrc + sizeof(s->sin_port),
+                                     &s->sin_addr, sizeof(struct in_addr));
+    }
+    else if (peer.ss_family == AF_INET6) {
+        struct sockaddr_in6 *s = (struct sockaddr_in6*)&peer;
+
+        cookieSrcSz = sizeof(struct in6_addr) + sizeof(s->sin6_port);
+        XMEMCPY(cookieSrc, &s->sin6_port, sizeof(s->sin6_port));
+        XMEMCPY(cookieSrc + sizeof(s->sin6_port),
+                                    &s->sin6_addr, sizeof(struct in6_addr));
+    }
+
+    InitSha(&sha);
+    ShaUpdate(&sha, cookieSrc, cookieSrcSz);
+    ShaFinal(&sha, buf);
+
+    return SHA_DIGEST_SIZE;
+}
+
+#endif /* CYASSL_DTLS */
+
+
+#endif /* CYASSL_USER_IO */
+
+CYASSL_API void CyaSSL_SetIORecv(CYASSL_CTX *ctx, CallbackIORecv CBIORecv)
+{
+    ctx->CBIORecv = CBIORecv;
+}
+
+
+CYASSL_API void CyaSSL_SetIOSend(CYASSL_CTX *ctx, CallbackIOSend CBIOSend)
+{
+    ctx->CBIOSend = CBIOSend;
+}
+
+
+CYASSL_API void CyaSSL_SetIOReadCtx(CYASSL* ssl, void *rctx)
+{
+       ssl->IOCB_ReadCtx = rctx;
+}
+
+
+CYASSL_API void CyaSSL_SetIOWriteCtx(CYASSL* ssl, void *wctx)
+{
+       ssl->IOCB_WriteCtx = wctx;
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/keys.c b/FreeRTOS-Plus/Source/CyaSSL/src/keys.c
new file mode 100644 (file)
index 0000000..0e4bc04
--- /dev/null
@@ -0,0 +1,1208 @@
+/* keys.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+#ifdef SHOW_SECRETS
+    #include <stdio.h>
+#endif
+
+
+int SetCipherSpecs(CYASSL* ssl)
+{
+#ifdef HAVE_ECC
+    /* ECC extensions */
+    if (ssl->options.cipherSuite0 == ECC_BYTE) {
+    
+    switch (ssl->options.cipherSuite) {
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
+    case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
+    case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
+    case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
+    case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
+    case TLS_ECDHE_RSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA
+    case TLS_ECDH_RSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
+    case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
+    case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
+    case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
+    case TLS_ECDH_ECDSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
+    case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
+    case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
+    case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
+    case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
+    case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
+    case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
+    case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
+    case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+    case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
+    case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
+    case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
+    case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
+    case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
+    case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = ecc_diffie_hellman_kea;
+        ssl->specs.sig_algo              = ecc_dsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 1;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+    default:
+        CYASSL_MSG("Unsupported cipher suite, SetCipherSpecs ECC");
+        return UNSUPPORTED_SUITE;
+    }   /* switch */
+    }   /* if     */
+#endif /* HAVE_ECC */
+    if (ssl->options.cipherSuite0 != ECC_BYTE) {   /* normal suites */
+    switch (ssl->options.cipherSuite) {
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_SHA
+    case SSL_RSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_RC4_128_SHA
+    case TLS_NTRU_RSA_WITH_RC4_128_SHA :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ntru_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_RC4_128_MD5
+    case SSL_RSA_WITH_RC4_128_MD5 :
+        ssl->specs.bulk_cipher_algorithm = rc4;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = md5_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = MD5_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_MD5;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RC4_KEY_SIZE;
+        ssl->specs.iv_size               = 0;
+        ssl->specs.block_size            = 0;
+
+        break;
+#endif
+
+#ifdef BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
+    case SSL_RSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA
+    case TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = triple_des;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ntru_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = DES3_KEY_SIZE;
+        ssl->specs.block_size            = DES_BLOCK_SIZE;
+        ssl->specs.iv_size               = DES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
+    case TLS_RSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
+    case TLS_RSA_WITH_AES_128_CBC_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_128_CBC_SHA
+    case TLS_NTRU_RSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ntru_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
+    case TLS_RSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
+    case TLS_RSA_WITH_AES_256_CBC_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_NTRU_RSA_WITH_AES_256_CBC_SHA
+    case TLS_NTRU_RSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = ntru_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
+    case TLS_PSK_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = psk_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        ssl->options.usingPSK_cipher     = 1;
+        break;
+#endif
+
+#ifdef BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
+    case TLS_PSK_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = psk_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        ssl->options.usingPSK_cipher     = 1;
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
+    case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
+    case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
+    case TLS_DHE_RSA_WITH_AES_128_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
+    case TLS_DHE_RSA_WITH_AES_256_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = aes;
+        ssl->specs.cipher_type           = block;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_MD5
+    case TLS_RSA_WITH_HC_128_CBC_MD5 :
+        ssl->specs.bulk_cipher_algorithm = hc128;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = md5_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = MD5_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_MD5;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = HC_128_KEY_SIZE;
+        ssl->specs.block_size            = 0;
+        ssl->specs.iv_size               = HC_128_IV_SIZE;
+
+        break;
+#endif
+            
+#ifdef BUILD_TLS_RSA_WITH_HC_128_CBC_SHA
+        case TLS_RSA_WITH_HC_128_CBC_SHA :
+            ssl->specs.bulk_cipher_algorithm = hc128;
+            ssl->specs.cipher_type           = stream;
+            ssl->specs.mac_algorithm         = sha_mac;
+            ssl->specs.kea                   = rsa_kea;
+            ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+            ssl->specs.pad_size              = PAD_SHA;
+            ssl->specs.static_ecdh           = 0;
+            ssl->specs.key_size              = HC_128_KEY_SIZE;
+            ssl->specs.block_size            = 0;
+            ssl->specs.iv_size               = HC_128_IV_SIZE;
+            
+            break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_RABBIT_CBC_SHA
+    case TLS_RSA_WITH_RABBIT_CBC_SHA :
+        ssl->specs.bulk_cipher_algorithm = rabbit;
+        ssl->specs.cipher_type           = stream;
+        ssl->specs.mac_algorithm         = sha_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.hash_size             = SHA_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = RABBIT_KEY_SIZE;
+        ssl->specs.block_size            = 0;
+        ssl->specs.iv_size               = RABBIT_IV_SIZE;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
+    case TLS_RSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
+    case TLS_RSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = rsa_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
+    case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha256_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA256_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_128_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+#ifdef BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
+    case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 :
+        ssl->specs.bulk_cipher_algorithm = aes_gcm;
+        ssl->specs.cipher_type           = aead;
+        ssl->specs.mac_algorithm         = sha384_mac;
+        ssl->specs.kea                   = diffie_hellman_kea;
+        ssl->specs.sig_algo              = rsa_sa_algo;
+        ssl->specs.hash_size             = SHA384_DIGEST_SIZE;
+        ssl->specs.pad_size              = PAD_SHA;
+        ssl->specs.static_ecdh           = 0;
+        ssl->specs.key_size              = AES_256_KEY_SIZE;
+        ssl->specs.block_size            = AES_BLOCK_SIZE;
+        ssl->specs.iv_size               = AES_GCM_IMP_IV_SZ;
+
+        break;
+#endif
+
+    default:
+        CYASSL_MSG("Unsupported cipher suite, SetCipherSpecs");
+        return UNSUPPORTED_SUITE;
+    }  /* switch */
+    }  /* if ECC / Normal suites else */
+
+    /* set TLS if it hasn't been turned off */
+    if (ssl->version.major == 3 && ssl->version.minor >= 1) {
+#ifndef NO_TLS
+        ssl->options.tls = 1;
+        ssl->hmac = TLS_hmac;
+        if (ssl->version.minor >= 2)
+            ssl->options.tls1_1 = 1;
+#endif
+    }
+
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls)
+        ssl->hmac = TLS_hmac;
+#endif
+
+    return 0;
+}
+
+
+enum KeyStuff {
+    MASTER_ROUNDS = 3,
+    PREFIX        = 3,     /* up to three letters for master prefix */
+    KEY_PREFIX    = 7      /* up to 7 prefix letters for key rounds */
+
+
+};
+
+
+/* true or false, zero for error */
+static int SetPrefix(byte* sha_input, int idx)
+{
+    switch (idx) {
+    case 0:
+        XMEMCPY(sha_input, "A", 1);
+        break;
+    case 1:
+        XMEMCPY(sha_input, "BB", 2);
+        break;
+    case 2:
+        XMEMCPY(sha_input, "CCC", 3);
+        break;
+    case 3:
+        XMEMCPY(sha_input, "DDDD", 4);
+        break;
+    case 4:
+        XMEMCPY(sha_input, "EEEEE", 5);
+        break;
+    case 5:
+        XMEMCPY(sha_input, "FFFFFF", 6);
+        break;
+    case 6:
+        XMEMCPY(sha_input, "GGGGGGG", 7);
+        break;
+    default:
+        CYASSL_MSG("Set Prefix error, bad input");
+        return 0; 
+    }
+    return 1;
+}
+
+
+static int SetKeys(Ciphers* enc, Ciphers* dec, Keys* keys, CipherSpecs* specs,
+                   byte side)
+{
+#ifdef BUILD_ARC4
+    word32 sz = specs->key_size;
+    if (specs->bulk_cipher_algorithm == rc4) {
+        if (side == CLIENT_END) {
+            Arc4SetKey(&enc->arc4, keys->client_write_key, sz);
+            Arc4SetKey(&dec->arc4, keys->server_write_key, sz);
+        }
+        else {
+            Arc4SetKey(&enc->arc4, keys->server_write_key, sz);
+            Arc4SetKey(&dec->arc4, keys->client_write_key, sz);
+        }
+    }
+#endif
+    
+#ifdef HAVE_HC128
+    if (specs->bulk_cipher_algorithm == hc128) {
+        if (side == CLIENT_END) {
+            Hc128_SetKey(&enc->hc128, keys->client_write_key,
+                                          keys->client_write_IV);
+            Hc128_SetKey(&dec->hc128, keys->server_write_key,
+                                          keys->server_write_IV);
+        }
+        else {
+            Hc128_SetKey(&enc->hc128, keys->server_write_key,
+                                         keys->server_write_IV);
+            Hc128_SetKey(&dec->hc128, keys->client_write_key,
+                                         keys->client_write_IV);
+        }
+    }
+#endif
+    
+#ifdef BUILD_RABBIT
+    if (specs->bulk_cipher_algorithm == rabbit) {
+        if (side == CLIENT_END) {
+            RabbitSetKey(&enc->rabbit, keys->client_write_key,
+                                           keys->client_write_IV);
+            RabbitSetKey(&dec->rabbit, keys->server_write_key,
+                                           keys->server_write_IV);
+        }
+        else {
+            RabbitSetKey(&enc->rabbit, keys->server_write_key,
+                                           keys->server_write_IV);
+            RabbitSetKey(&dec->rabbit, keys->client_write_key,
+                                           keys->client_write_IV);
+        }
+    }
+#endif
+    
+#ifdef BUILD_DES3
+    if (specs->bulk_cipher_algorithm == triple_des) {
+        if (side == CLIENT_END) {
+            Des3_SetKey(&enc->des3, keys->client_write_key,
+                        keys->client_write_IV, DES_ENCRYPTION);
+            Des3_SetKey(&dec->des3, keys->server_write_key,
+                        keys->server_write_IV, DES_DECRYPTION);
+        }
+        else {
+            Des3_SetKey(&enc->des3, keys->server_write_key,
+                        keys->server_write_IV, DES_ENCRYPTION);
+            Des3_SetKey(&dec->des3, keys->client_write_key,
+                keys->client_write_IV, DES_DECRYPTION);
+        }
+    }
+#endif
+
+#ifdef BUILD_AES
+    if (specs->bulk_cipher_algorithm == aes) {
+        if (side == CLIENT_END) {
+            AesSetKey(&enc->aes, keys->client_write_key,
+                      specs->key_size, keys->client_write_IV,
+                      AES_ENCRYPTION);
+            AesSetKey(&dec->aes, keys->server_write_key,
+                      specs->key_size, keys->server_write_IV,
+                      AES_DECRYPTION);
+        }
+        else {
+            AesSetKey(&enc->aes, keys->server_write_key,
+                      specs->key_size, keys->server_write_IV,
+                      AES_ENCRYPTION);
+            AesSetKey(&dec->aes, keys->client_write_key,
+                      specs->key_size, keys->client_write_IV,
+                      AES_DECRYPTION);
+        }
+    }
+#endif
+
+#ifdef BUILD_AESGCM
+    if (specs->bulk_cipher_algorithm == aes_gcm) {
+        if (side == CLIENT_END) {
+            AesGcmSetKey(&enc->aes, keys->client_write_key, specs->key_size,
+                        keys->client_write_IV);
+            AesGcmSetKey(&dec->aes, keys->server_write_key, specs->key_size,
+                        keys->server_write_IV);
+        }
+        else {
+            AesGcmSetKey(&enc->aes, keys->server_write_key, specs->key_size,
+                        keys->server_write_IV);
+            AesGcmSetKey(&dec->aes, keys->client_write_key, specs->key_size,
+                        keys->client_write_IV);
+        }
+    }
+#endif
+
+    keys->sequence_number      = 0;
+    keys->peer_sequence_number = 0;
+    keys->encryptionOn         = 0;
+
+    return 0;
+}
+
+
+/* TLS can call too */
+int StoreKeys(CYASSL* ssl, const byte* keyData)
+{
+    int sz, i = 0;
+
+    if (ssl->specs.cipher_type != aead) {
+        sz = ssl->specs.hash_size;
+        XMEMCPY(ssl->keys.client_write_MAC_secret,&keyData[i], sz);
+        i += sz;
+        XMEMCPY(ssl->keys.server_write_MAC_secret,&keyData[i], sz);
+        i += sz;
+    }
+#ifdef BUILD_AESGCM
+    else if (ssl->specs.bulk_cipher_algorithm == aes_gcm) {
+        byte iv[AES_GCM_EXP_IV_SZ];
+
+        /* Initialize the AES-GCM explicit IV to a random number. */
+        RNG_GenerateBlock(&ssl->rng, iv, sizeof(iv));
+        AesGcmSetExpIV(&ssl->encrypt.aes, iv);
+    }
+#endif
+
+    sz = ssl->specs.key_size;
+    XMEMCPY(ssl->keys.client_write_key, &keyData[i], sz);
+    i += sz;
+    XMEMCPY(ssl->keys.server_write_key, &keyData[i], sz);
+    i += sz;
+
+    sz = ssl->specs.iv_size;
+    XMEMCPY(ssl->keys.client_write_IV, &keyData[i], sz);
+    i += sz;
+    XMEMCPY(ssl->keys.server_write_IV, &keyData[i], sz);
+
+    return SetKeys(&ssl->encrypt, &ssl->decrypt, &ssl->keys, &ssl->specs,
+                   ssl->options.side);
+}
+
+
+int DeriveKeys(CYASSL* ssl)
+{
+    int length = 2 * ssl->specs.hash_size + 
+                 2 * ssl->specs.key_size  +
+                 2 * ssl->specs.iv_size;
+    int rounds = (length + MD5_DIGEST_SIZE - 1 ) / MD5_DIGEST_SIZE, i;
+
+    byte shaOutput[SHA_DIGEST_SIZE];
+    byte md5Input[SECRET_LEN + SHA_DIGEST_SIZE];
+    byte shaInput[KEY_PREFIX + SECRET_LEN + 2 * RAN_LEN];
+  
+    Md5 md5;
+    Sha sha;
+
+    byte keyData[KEY_PREFIX * MD5_DIGEST_SIZE];  /* max size */
+
+    InitMd5(&md5);
+    InitSha(&sha);
+
+    XMEMCPY(md5Input, ssl->arrays.masterSecret, SECRET_LEN);
+
+    for (i = 0; i < rounds; ++i) {
+        int j   = i + 1;
+        int idx = j;
+
+        if (!SetPrefix(shaInput, i)) {
+            return PREFIX_ERROR;
+        }
+
+        XMEMCPY(shaInput + idx, ssl->arrays.masterSecret, SECRET_LEN);
+        idx += SECRET_LEN;
+        XMEMCPY(shaInput + idx, ssl->arrays.serverRandom, RAN_LEN);
+        idx += RAN_LEN;
+        XMEMCPY(shaInput + idx, ssl->arrays.clientRandom, RAN_LEN);
+        idx += RAN_LEN;
+
+        ShaUpdate(&sha, shaInput, sizeof(shaInput) - KEY_PREFIX + j);
+        ShaFinal(&sha, shaOutput);
+
+        XMEMCPY(&md5Input[SECRET_LEN], shaOutput, SHA_DIGEST_SIZE);
+        Md5Update(&md5, md5Input, sizeof(md5Input));
+        Md5Final(&md5, keyData + i * MD5_DIGEST_SIZE);
+    }
+
+    return StoreKeys(ssl, keyData);
+}
+
+
+static void CleanPreMaster(CYASSL* ssl)
+{
+    int i, sz = ssl->arrays.preMasterSz;
+
+    for (i = 0; i < sz; i++)
+        ssl->arrays.preMasterSecret[i] = 0;
+
+    RNG_GenerateBlock(&ssl->rng, ssl->arrays.preMasterSecret, sz);
+
+    for (i = 0; i < sz; i++)
+        ssl->arrays.preMasterSecret[i] = 0;
+
+}
+
+
+/* Create and store the master secret see page 32, 6.1 */
+int MakeMasterSecret(CYASSL* ssl)
+{
+    byte   shaOutput[SHA_DIGEST_SIZE];
+    byte   md5Input[ENCRYPT_LEN + SHA_DIGEST_SIZE];
+    byte   shaInput[PREFIX + ENCRYPT_LEN + 2 * RAN_LEN];
+    int    i, ret;
+    word32 idx;
+    word32 pmsSz = ssl->arrays.preMasterSz;
+
+    Md5 md5;
+    Sha sha;
+
+#ifdef SHOW_SECRETS
+    {
+        int j;
+        printf("pre master secret: ");
+        for (j = 0; j < pmsSz; j++)
+            printf("%02x", ssl->arrays.preMasterSecret[j]);
+        printf("\n");
+    }
+#endif
+
+#ifndef NO_TLS
+    if (ssl->options.tls) return MakeTlsMasterSecret(ssl);
+#endif
+
+    InitMd5(&md5);
+    InitSha(&sha);
+
+    XMEMCPY(md5Input, ssl->arrays.preMasterSecret, pmsSz);
+
+    for (i = 0; i < MASTER_ROUNDS; ++i) {
+        byte prefix[PREFIX];
+        if (!SetPrefix(prefix, i)) {
+            return PREFIX_ERROR;
+        }
+
+        idx = 0;
+        XMEMCPY(shaInput, prefix, i + 1);
+        idx += i + 1;
+
+        XMEMCPY(shaInput + idx, ssl->arrays.preMasterSecret, pmsSz);
+        idx += pmsSz;
+        XMEMCPY(shaInput + idx, ssl->arrays.clientRandom, RAN_LEN);
+        idx += RAN_LEN;
+        XMEMCPY(shaInput + idx, ssl->arrays.serverRandom, RAN_LEN);
+        idx += RAN_LEN;
+        ShaUpdate(&sha, shaInput, idx);
+        ShaFinal(&sha, shaOutput);
+
+        idx = pmsSz;  /* preSz */
+        XMEMCPY(md5Input + idx, shaOutput, SHA_DIGEST_SIZE);
+        idx += SHA_DIGEST_SIZE;
+        Md5Update(&md5, md5Input, idx);
+        Md5Final(&md5, &ssl->arrays.masterSecret[i * MD5_DIGEST_SIZE]);
+    }
+
+#ifdef SHOW_SECRETS
+    {
+        int i;
+        printf("master secret: ");
+        for (i = 0; i < SECRET_LEN; i++)
+            printf("%02x", ssl->arrays.masterSecret[i]);
+        printf("\n");
+    }
+#endif
+
+    ret = DeriveKeys(ssl);
+    CleanPreMaster(ssl);
+
+    return ret;
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/ocsp.c b/FreeRTOS-Plus/Source/CyaSSL/src/ocsp.c
new file mode 100644 (file)
index 0000000..3b3dea9
--- /dev/null
@@ -0,0 +1,530 @@
+/* ocsp.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef HAVE_OCSP
+
+#include <cyassl/error.h>
+#include <cyassl/ocsp.h>
+#include <cyassl/internal.h>
+#include <ctype.h>
+
+#include <string.h>
+#include <unistd.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+
+CYASSL_API int ocsp_test(unsigned char* buf, int sz);
+#define CYASSL_OCSP_ENABLE       0x0001 /* Enable OCSP lookups */
+#define CYASSL_OCSP_URL_OVERRIDE 0x0002 /* Use the override URL instead of URL
+                                         * in certificate */
+
+typedef struct sockaddr_in  SOCKADDR_IN_T;
+#define AF_INET_V    AF_INET
+#define SOCKET_T unsigned int
+   
+
+int CyaSSL_OCSP_Init(CYASSL_OCSP* ocsp)
+{
+    if (ocsp != NULL) {
+        XMEMSET(ocsp, 0, sizeof(*ocsp));
+        return 0;
+    }
+
+    return -1;
+}
+
+
+static void FreeOCSP_Entry(OCSP_Entry* ocspe)
+{
+    CertStatus* tmp = ocspe->status;
+
+    CYASSL_ENTER("FreeOCSP_Entry");
+
+    while (tmp) {
+        CertStatus* next = tmp->next;
+        XFREE(tmp, NULL, DYNAMIC_TYPE_OCSP_STATUS);
+        tmp = next;
+    }
+}
+
+
+void CyaSSL_OCSP_Cleanup(CYASSL_OCSP* ocsp)
+{
+    OCSP_Entry* tmp = ocsp->ocspList;
+
+    ocsp->enabled = 0;
+    while (tmp) {
+        OCSP_Entry* next = tmp->next;
+        FreeOCSP_Entry(tmp);
+        XFREE(tmp, NULL, DYNAMIC_TYPE_OCSP_ENTRY);
+        tmp = next;
+    }
+}
+
+
+static int decode_url(const char* url, int urlSz,
+    char* outName, char* outPath, int* outPort)
+{
+    if (outName != NULL && outPath != NULL && outPort != NULL)
+    {
+        if (url == NULL || urlSz == 0)
+        {
+            *outName = 0;
+            *outPath = 0;
+            *outPort = 0;
+        }
+        else
+        {
+            int i, cur;
+    
+            /* need to break the url down into scheme, address, and port */
+            /* "http://example.com:8080/" */
+            if (XSTRNCMP(url, "http://", 7) == 0) {
+                cur = 7;
+            } else cur = 0;
+    
+            i = 0;
+            while (url[cur] != 0 && url[cur] != ':' && url[cur] != '/') {
+                outName[i++] = url[cur++];
+            }
+            outName[i] = 0;
+            /* Need to pick out the path after the domain name */
+    
+            if (cur < urlSz && url[cur] == ':') {
+                char port[6];
+                int j;
+                i = 0;
+                cur++;
+                while (cur < urlSz && url[cur] != 0 && url[cur] != '/' &&
+                        i < 6) {
+                    port[i++] = url[cur++];
+                }
+    
+                *outPort = 0;
+                for (j = 0; j < i; j++) {
+                    if (port[j] < '0' || port[j] > '9') return -1;
+                    *outPort = (*outPort * 10) + (port[j] - '0');
+                }
+            }
+            else
+                *outPort = 80;
+    
+            if (cur < urlSz && url[cur] == '/') {
+                i = 0;
+                while (cur < urlSz && url[cur] != 0 && i < 80) {
+                    outPath[i++] = url[cur++];
+                }
+                outPath[i] = 0;
+            }
+            else {
+                outPath[0] = '/';
+                outPath[1] = 0;
+            }
+        }
+    }
+
+    return 0;
+}
+
+
+int CyaSSL_OCSP_set_override_url(CYASSL_OCSP* ocsp, const char* url)
+{
+    if (ocsp != NULL) {
+        int urlSz = strlen(url);
+        decode_url(url, urlSz,
+            ocsp->overrideName, ocsp->overridePath, &ocsp->overridePort);
+        return 1;
+    }
+
+    return 0;
+}
+
+
+static INLINE void tcp_socket(SOCKET_T* sockfd, SOCKADDR_IN_T* addr,
+                              const char* peer, word16 port)
+{
+    const char* host = peer;
+
+    /* peer could be in human readable form */
+    if (peer != INADDR_ANY && isalpha(peer[0])) {
+        struct hostent* entry = gethostbyname(peer);
+
+        if (entry) {
+            struct sockaddr_in tmp;
+            memset(&tmp, 0, sizeof(struct sockaddr_in));
+            memcpy(&tmp.sin_addr.s_addr, entry->h_addr_list[0],
+                   entry->h_length);
+            host = inet_ntoa(tmp.sin_addr);
+        }
+        else {
+            CYASSL_MSG("no entry for host");
+        }
+    }
+
+    *sockfd = socket(AF_INET_V, SOCK_STREAM, 0);
+    memset(addr, 0, sizeof(SOCKADDR_IN_T));
+
+    addr->sin_family = AF_INET_V;
+    addr->sin_port = htons(port);
+    if (host == INADDR_ANY)
+        addr->sin_addr.s_addr = INADDR_ANY;
+    else
+        addr->sin_addr.s_addr = inet_addr(host);
+}
+
+
+static INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port)
+{
+    SOCKADDR_IN_T addr;
+    tcp_socket(sockfd, &addr, ip, port);
+
+    if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0) {
+        CYASSL_MSG("tcp connect failed");
+    }
+}
+
+
+static int build_http_request(const char* domainName, const char* path,
+                                    int ocspReqSz, byte* buf, int bufSize)
+{
+    return snprintf((char*)buf, bufSize,
+        "POST %s HTTP/1.1\r\n"
+        "Host: %s\r\n"
+        "Content-Length: %d\r\n"
+        "Content-Type: application/ocsp-request\r\n"
+        "\r\n", 
+        path, domainName, ocspReqSz);
+}
+
+
+static int decode_http_response(byte* httpBuf, int httpBufSz, byte** dst)
+{
+    int idx = 0;
+    int stop = 0;
+    int len = 0;
+    byte* contentType = NULL;
+    byte* contentLength = NULL;
+    char* buf = (char*)httpBuf; /* kludge so I'm not constantly casting */
+
+    if (strncasecmp(buf, "HTTP/1", 6) != 0)
+        return 0;
+    
+    idx = 9; /* sets to the first byte after "HTTP/1.X ", which should be the
+              * HTTP result code */
+
+     if (strncasecmp(&buf[idx], "200 OK", 6) != 0)
+        return 0;
+    
+    idx += 8;
+
+    while (idx < httpBufSz && !stop) {
+        if (buf[idx] == '\r' && buf[idx+1] == '\n') {
+            stop = 1;
+            idx += 2;
+        }
+        else {
+            if (contentType == NULL &&
+                strncasecmp(&buf[idx], "Content-Type:", 13) == 0) {
+                idx += 13;
+                if (buf[idx] == ' ') idx++;
+                if (strncasecmp(&buf[idx], "application/ocsp-response", 25) != 0)
+                    return 0;
+                idx += 27;
+            } else if (contentLength == NULL &&
+                strncasecmp(&buf[idx], "Content-Length:", 15) == 0) {
+                idx += 15;
+                if (buf[idx] == ' ') idx++;
+                while (buf[idx] >= '0' && buf[idx] <= '9' && idx < httpBufSz) {
+                    len = (len * 10) + (buf[idx] - '0');
+                    idx++;
+                }
+                idx += 2; /* skip the crlf */
+            } else {
+                /* Advance idx past the next \r\n */
+                char* end = strstr(&buf[idx], "\r\n");
+                idx = end - buf + 2;
+                stop = 1;
+            }
+        }
+    }
+    
+    if (len > 0) {
+        *dst = (byte*)XMALLOC(len, NULL, DYNAMIC_TYPE_IN_BUFFER);
+        XMEMCPY(*dst, httpBuf + idx, len);
+    }
+
+    return len;
+}
+
+
+static int InitOCSP_Entry(OCSP_Entry* ocspe, DecodedCert* cert)
+{
+    CYASSL_ENTER("InitOCSP_Entry");
+
+    ocspe->next = NULL;
+    XMEMCPY(ocspe->issuerHash, cert->issuerHash, SHA_DIGEST_SIZE);
+    XMEMCPY(ocspe->issuerKeyHash, cert->issuerKeyHash, SHA_DIGEST_SIZE);
+    ocspe->status = NULL;
+    ocspe->totalStatus = 0;
+
+    return 0;
+}
+
+
+static OCSP_Entry* find_ocsp_entry(CYASSL_OCSP* ocsp, DecodedCert* cert)
+{
+    OCSP_Entry* entry = ocsp->ocspList;
+
+    while (entry)
+    {
+        if (XMEMCMP(entry->issuerHash, cert->issuerHash, SHA_DIGEST_SIZE) == 0
+            && XMEMCMP(entry->issuerKeyHash, cert->issuerKeyHash,
+                                                        SHA_DIGEST_SIZE) == 0)
+        {
+            CYASSL_MSG("Found OCSP responder");
+            break;
+        }
+        else
+        {
+            entry = entry->next;
+        }
+    }
+
+    if (entry == NULL)
+    {
+        CYASSL_MSG("Add a new OCSP entry");
+        entry = (OCSP_Entry*)XMALLOC(sizeof(OCSP_Entry),
+                                                NULL, DYNAMIC_TYPE_OCSP_ENTRY);
+        if (entry != NULL)
+        {
+            InitOCSP_Entry(entry, cert);
+            entry->next = ocsp->ocspList;
+            ocsp->ocspList = entry;
+        }
+    }
+
+    return entry;
+}
+
+
+static CertStatus* find_cert_status(OCSP_Entry* ocspe, DecodedCert* cert)
+{
+    CertStatus* stat = ocspe->status;
+
+    while (stat)
+    {
+        if(stat->serialSz == cert->serialSz &&
+            (XMEMCMP(stat->serial, cert->serial, cert->serialSz) == 0))
+        {
+            break;
+        }
+        else
+        {
+            stat = stat->next;
+        }
+    }
+    if (stat == NULL)
+    {
+        stat = (CertStatus*)XMALLOC(sizeof(CertStatus),
+                                            NULL, DYNAMIC_TYPE_OCSP_STATUS);
+        if (stat != NULL)
+        {
+            XMEMCPY(stat->serial, cert->serial, cert->serialSz);
+            stat->serialSz = cert->serialSz;
+            stat->status = -1;
+            stat->nextDate[0] = 0;
+            ocspe->totalStatus++;
+
+            stat->next = ocspe->status;
+            ocspe->status = stat;
+        }
+    }
+
+    return stat;
+}
+
+
+#define SCRATCH_BUFFER_SIZE 2048
+
+static int http_ocsp_transaction(CYASSL_OCSP* ocsp, DecodedCert* cert,
+                        byte* ocspReqBuf, int ocspReqSz, byte** ocspRespBuf)
+{
+    SOCKET_T sfd = -1;
+    byte httpBuf[SCRATCH_BUFFER_SIZE];
+    int httpBufSz = SCRATCH_BUFFER_SIZE;
+    char domainName[80], path[80];
+    int port, ocspRespSz;
+
+    if (ocsp->useOverrideUrl || cert->extAuthInfo == NULL) {
+        if (ocsp->overrideName != NULL) {
+            XMEMCPY(domainName, ocsp->overrideName, 80);
+            XMEMCPY(path, ocsp->overridePath, 80);
+            port = ocsp->overridePort;
+        } else
+            return OCSP_NEED_URL;
+    } else {
+        if (!decode_url((const char*)cert->extAuthInfo, cert->extAuthInfoSz,
+                                                    domainName, path, &port))
+            return OCSP_NEED_URL;
+    }
+
+    httpBufSz = build_http_request(domainName, path, ocspReqSz,
+                                                        httpBuf, httpBufSz);
+
+    tcp_connect(&sfd, domainName, port);
+    if (sfd > 0) {
+        int written;
+        written = write(sfd, httpBuf, httpBufSz);
+        if (written == httpBufSz) {
+            written = write(sfd, ocspReqBuf, ocspReqSz);
+            if (written == ocspReqSz) {
+                httpBufSz = read(sfd, httpBuf, SCRATCH_BUFFER_SIZE);
+                if (httpBufSz > 0) {
+                    ocspRespSz = decode_http_response(httpBuf, httpBufSz,
+                        ocspRespBuf);
+                }
+            }
+        }
+        close(sfd);
+        if (ocspRespSz == 0) {
+            CYASSL_MSG("HTTP response was not OK, no OCSP response");
+            return OCSP_LOOKUP_FAIL;
+        }
+    } else {
+        CYASSL_MSG("OCSP Responder connection failed");
+        return OCSP_LOOKUP_FAIL;
+    }
+
+    return ocspRespSz;
+}
+
+
+static int xstat2err(int stat)
+{
+    switch (stat) {
+        case CERT_GOOD:
+            return 0;
+            break;
+        case CERT_REVOKED:
+            return OCSP_CERT_REVOKED;
+            break;
+        default:
+            return OCSP_CERT_UNKNOWN;
+            break;
+    }
+}
+
+
+int CyaSSL_OCSP_Lookup_Cert(CYASSL_OCSP* ocsp, DecodedCert* cert)
+{
+    byte ocspReqBuf[SCRATCH_BUFFER_SIZE];
+    int ocspReqSz = SCRATCH_BUFFER_SIZE;
+    byte* ocspRespBuf = NULL;
+    int ocspRespSz;
+    OcspRequest ocspRequest;
+    OcspResponse ocspResponse;
+    int result = 0;
+    OCSP_Entry* ocspe;
+    CertStatus* certStatus;
+
+    /* If OCSP lookups are disabled, return success. */
+    if (!ocsp->enabled) {
+        CYASSL_MSG("OCSP lookup disabled, assuming CERT_GOOD");
+        return 0;
+    }
+
+    ocspe = find_ocsp_entry(ocsp, cert);
+    if (ocspe == NULL) {
+        CYASSL_MSG("alloc OCSP entry failed");
+        return MEMORY_ERROR;
+    }
+
+    certStatus = find_cert_status(ocspe, cert);
+    if (certStatus == NULL)
+    {
+        CYASSL_MSG("alloc OCSP cert status failed");
+        return MEMORY_ERROR;
+    }
+
+    if (certStatus->status != -1)
+    {
+        if (!ValidateDate(certStatus->thisDate,
+                                        certStatus->thisDateFormat, BEFORE) ||
+            (certStatus->nextDate[0] == 0) ||
+            !ValidateDate(certStatus->nextDate,
+                                        certStatus->nextDateFormat, AFTER))
+        {
+            CYASSL_MSG("\tinvalid status date, looking up cert");
+            certStatus->status = -1;
+        }
+        else
+        {
+            CYASSL_MSG("\tusing cached status");
+            result = xstat2err(certStatus->status);
+            return result;
+        }
+    }
+    
+    InitOcspRequest(&ocspRequest, cert, ocspReqBuf, ocspReqSz);
+    ocspReqSz = EncodeOcspRequest(&ocspRequest);
+    result = http_ocsp_transaction(ocsp, cert,
+                                        ocspReqBuf, ocspReqSz, &ocspRespBuf);
+    if (result < 0) return result;
+        /* If the transaction failed, return that result. */
+
+    InitOcspResponse(&ocspResponse, certStatus, ocspRespBuf, ocspRespSz);
+    OcspResponseDecode(&ocspResponse);
+
+    if (ocspResponse.responseStatus != OCSP_SUCCESSFUL) {
+        CYASSL_MSG("OCSP Responder failure");
+        result = OCSP_LOOKUP_FAIL;
+    } else {
+        if (CompareOcspReqResp(&ocspRequest, &ocspResponse) == 0)
+        {
+            result = xstat2err(ocspResponse.status->status);
+        }
+        else
+        {
+            CYASSL_MSG("OCSP Response incorrect for Request");
+            result = OCSP_LOOKUP_FAIL;
+        }
+    }
+    if (ocspReqBuf != NULL) {
+        XFREE(ocspRespBuf, NULL, DYNAMIC_TYPE_IN_BUFFER);
+    }
+
+    return result;
+}
+
+
+#endif /* HAVE_OCSP */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/sniffer.c b/FreeRTOS-Plus/Source/CyaSSL/src/sniffer.c
new file mode 100644 (file)
index 0000000..037d528
--- /dev/null
@@ -0,0 +1,2405 @@
+/* sniffer.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+
+#ifdef CYASSL_SNIFFER
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <assert.h>
+#include <time.h>
+
+#ifndef _WIN32
+  #include <arpa/inet.h>
+#endif
+
+#ifdef _WIN32
+    #define SNPRINTF _snprintf
+#else
+    #define SNPRINTF snprintf
+#endif
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+#include <cyassl/sniffer.h>
+#include <cyassl/sniffer_error.h>
+
+
+#ifndef min
+
+static INLINE word32 min(word32 a, word32 b)
+{
+    return a > b ? b : a;
+}
+
+#endif
+
+
+/* Misc constants */
+enum {
+    MAX_SERVER_ADDRESS = 128, /* maximum server address length */
+    MAX_ERROR_LEN      = 80,  /* maximum error length */
+    ETHER_IF_ADDR_LEN  = 6,   /* ethernet interface address length */
+    LOCAL_IF_ADDR_LEN  = 4,   /* localhost interface address length, !windows */
+    TCP_PROTO          = 6,   /* TCP_PROTOCOL */
+    IP_HDR_SZ          = 20,  /* IP header legnth, min */
+    TCP_HDR_SZ         = 20,  /* TCP header legnth, min */
+    IPV4               = 4,   /* IP version 4 */
+    TCP_PROTOCOL       = 6,   /* TCP Protocol id */
+    TRACE_MSG_SZ       = 80,  /* Trace Message buffer size */
+    HASH_SIZE          = 499, /* Session Hash Table Rows */
+    PSEUDO_HDR_SZ      = 12,  /* TCP Pseudo Header size in bytes */
+    FATAL_ERROR_STATE  =  1,  /* SnifferSession fatal error state */
+    SNIFFER_TIMEOUT    = 900, /* Cache unclosed Sessions for 15 minutes */
+    TICKET_HINT_LEN    = 4,   /* Session Ticket Hint length */
+    EXT_TYPE_SZ        = 2,   /* Extension length */
+    TICKET_EXT_ID      = 0x23 /* Session Ticket Extension ID */
+};
+
+
+#ifdef _WIN32
+
+static HMODULE dllModule;  /* for error string resources */
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+                     )
+{
+       static int didInit = 0;
+
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+               if (didInit == 0) {
+            dllModule = hModule;
+                       ssl_InitSniffer();
+                       didInit = 1;
+               }
+        break;
+    case DLL_THREAD_ATTACH:
+        break;
+    case DLL_THREAD_DETACH:
+        break;
+    case DLL_PROCESS_DETACH:
+               if (didInit) {
+                       ssl_FreeSniffer();
+                       didInit = 0;
+               }
+        break;
+    }
+    return TRUE;
+}
+
+#endif /* _WIN32 */
+
+
+static int TraceOn = 0;         /* Trace is off by default */
+static FILE* TraceFile = 0;
+
+
+/* windows uses .rc table for this */
+#ifndef _WIN32
+
+static const char* const msgTable[] =
+{
+    /* 1 */
+    "Out of Memory",
+    "New SSL Sniffer Server Registered",
+    "Checking IP Header",
+    "SSL Sniffer Server Not Registered",
+    "Checking TCP Header",
+
+    /* 6 */
+    "SSL Sniffer Server Port Not Registered",
+    "RSA Private Decrypt Error",
+    "RSA Private Decode Error",
+    "Set Cipher Spec Error",
+    "Server Hello Input Malformed",
+
+    /* 11 */
+    "Couldn't Resume Session Error",
+    "Server Did Resumption",
+    "Client Hello Input Malformed",
+    "Client Trying to Resume",
+    "Handshake Input Malformed",
+
+    /* 16 */
+    "Got Hello Verify msg",
+    "Got Server Hello msg",
+    "Got Cert Request msg",
+    "Got Server Key Exchange msg",
+    "Got Cert msg",
+
+    /* 21 */
+    "Got Server Hello Done msg",
+    "Got Finished msg",
+    "Got Client Hello msg",
+    "Got Client Key Exchange msg",
+    "Got Cert Verify msg",
+
+    /* 26 */
+    "Got Unknown Handshake msg",
+    "New SSL Sniffer Session created",
+    "Couldn't create new SSL",
+    "Got a Packet to decode",
+    "No data present",
+
+    /* 31 */
+    "Session Not Found",
+    "Got an Old Client Hello msg",
+    "Old Client Hello Input Malformed",
+    "Old Client Hello OK",
+    "Bad Old Client Hello",
+
+    /* 36 */
+    "Bad Record Header",
+    "Record Header Input Malformed",
+    "Got a HandShake msg",
+    "Bad HandShake msg",
+    "Got a Change Cipher Spec msg",
+
+    /* 41 */
+    "Got Application Data msg",
+    "Bad Application Data",
+    "Got an Alert msg",
+    "Another msg to Process",
+    "Removing Session From Table",
+    
+    /* 46 */
+    "Bad Key File",
+    "Wrong IP Version",
+    "Wrong Protocol type",
+    "Packet Short for header processing",
+    "Got Unknown Record Type",
+    
+    /* 51 */
+    "Can't Open Trace File",
+    "Session in Fatal Error State",
+    "Partial SSL record received",
+    "Buffer Error, malformed input",
+    "Added to Partial Input",
+    
+    /* 56 */
+    "Received a Duplicate Packet",
+    "Received an Out of Order Packet",
+    "Received an Overlap Duplicate Packet",
+    "Received an Overlap Reassembly Begin Duplicate Packet",
+    "Received an Overlap Reassembly End Duplicate Packet",
+
+    /* 61 */
+    "Missed the Client Hello Entirely",
+    "Got Hello Request msg",
+    "Got Session Ticket msg",
+    "Bad Input",
+    "Bad Decrypt Type",
+
+    /* 66 */
+    "Bad Finished Message Processing",
+    "Bad Compression Type"
+};
+
+
+/* *nix version uses table above */
+static void GetError(int idx, char* str)
+{
+    XSTRNCPY(str, msgTable[idx - 1], MAX_ERROR_LEN);
+}
+
+
+#else /* _WIN32 */
+
+
+/* Windows version uses .rc table */
+static void GetError(int idx, char* buffer)
+{
+    if (!LoadStringA(dllModule, idx, buffer, MAX_ERROR_LEN))
+        buffer[0] = 0;
+}
+
+
+#endif /* _WIN32 */
+
+
+/* Packet Buffer for reassembly list and ready list */
+typedef struct PacketBuffer {
+    word32  begin;      /* relative sequence begin */
+    word32  end;        /* relative sequence end   */
+    byte*   data;       /* actual data             */
+    struct PacketBuffer* next; /* next on reassembly list or ready list */
+} PacketBuffer;
+
+
+/* Sniffer Server holds info for each server/port monitored */
+typedef struct SnifferServer {
+    SSL_CTX*       ctx;                          /* SSL context */
+    char           address[MAX_SERVER_ADDRESS];  /* passed in server address */
+    word32         server;                       /* netowrk order address */
+    int            port;                         /* server port */
+    struct SnifferServer* next;                  /* for list */
+} SnifferServer;
+
+
+/* Session Flags */
+typedef struct Flags {
+    byte           side;            /* which end is current packet headed */
+    byte           serverCipherOn;  /* indicates whether cipher is active */
+    byte           clientCipherOn;  /* indicates whether cipher is active */
+    byte           resuming;        /* did this session come from resumption */
+    byte           cached;          /* have we cached this session yet */
+    byte           clientHello;     /* processed client hello yet, for SSLv2 */
+    byte           finCount;        /* get both FINs before removing */
+    byte           fatalError;      /* fatal error state */
+} Flags;
+
+
+/* Out of Order FIN caputre */
+typedef struct FinCaputre {
+    word32 cliFinSeq;               /* client relative sequence FIN  0 is no */
+    word32 srvFinSeq;               /* server relative sequence FIN, 0 is no */
+    byte   cliCounted;              /* did we count yet, detects duplicates */
+    byte   srvCounted;              /* did we count yet, detects duplicates */
+} FinCaputre;
+
+
+/* Sniffer Session holds info for each client/server SSL/TLS session */
+typedef struct SnifferSession {
+    SnifferServer* context;         /* server context */
+    SSL*           sslServer;       /* SSL server side decode */
+    SSL*           sslClient;       /* SSL client side decode */
+    word32         server;          /* server address in network byte order */
+    word32         client;          /* client address in network byte order */
+    word16         srvPort;         /* server port */
+    word16         cliPort;         /* client port */
+    word32         cliSeqStart;     /* client start sequence */
+    word32         srvSeqStart;     /* server start sequence */
+    word32         cliExpected;     /* client expected sequence (relative) */
+    word32         srvExpected;     /* server expected sequence (relative) */
+    FinCaputre     finCaputre;      /* retain out of order FIN s */
+    Flags          flags;           /* session flags */
+    time_t         bornOn;          /* born on ticks */
+    PacketBuffer*  cliReassemblyList; /* client out of order packets */
+    PacketBuffer*  srvReassemblyList; /* server out of order packets */
+    struct SnifferSession* next;      /* for hash table list */
+    byte*          ticketID;          /* mac ID of session ticket */
+} SnifferSession;
+
+
+/* Sniffer Server List and mutex */
+static SnifferServer* ServerList = 0;
+static CyaSSL_Mutex ServerListMutex;
+
+
+/* Session Hash Table, mutex, and count */
+static SnifferSession* SessionTable[HASH_SIZE];
+static CyaSSL_Mutex SessionMutex;
+static int SessionCount = 0;
+
+
+/* Initialize overall Sniffer */
+void ssl_InitSniffer(void)
+{
+    CyaSSL_Init();
+    InitMutex(&ServerListMutex);
+    InitMutex(&SessionMutex);
+}
+
+
+/* Free Sniffer Server's resources/self */
+static void FreeSnifferServer(SnifferServer* srv)
+{
+    if (srv)
+        SSL_CTX_free(srv->ctx);
+    free(srv);
+}
+
+
+/* free PacketBuffer's resources/self */
+static void FreePacketBuffer(PacketBuffer* del)
+{
+    if (del) {
+        free(del->data);
+        free(del);
+    }
+}
+
+
+/* remove PacketBuffer List */
+static void FreePacketList(PacketBuffer* in)
+{
+    if (in) {
+        PacketBuffer* del;
+        PacketBuffer* packet = in;
+        
+        while (packet) {
+            del = packet;
+            packet = packet->next;
+            FreePacketBuffer(del);
+        }
+    }
+}
+
+
+/* Free Sniffer Session's resources/self */
+static void FreeSnifferSession(SnifferSession* session)
+{
+    if (session) {
+        SSL_free(session->sslClient);
+        SSL_free(session->sslServer);
+        
+        FreePacketList(session->cliReassemblyList);
+        FreePacketList(session->srvReassemblyList);
+
+        free(session->ticketID);
+    }
+    free(session);
+}
+
+
+/* Free overall Sniffer */
+void ssl_FreeSniffer(void)
+{
+    SnifferServer*  srv;
+    SnifferServer*  removeServer;
+    SnifferSession* session;
+    SnifferSession* removeSession;
+    int i;
+
+    LockMutex(&ServerListMutex);
+    LockMutex(&SessionMutex);
+    
+    srv = ServerList;
+    while (srv) {
+        removeServer = srv;
+        srv = srv->next;
+        FreeSnifferServer(removeServer);
+    }
+
+    for (i = 0; i < HASH_SIZE; i++) {
+        session = SessionTable[i];
+        while (session) {
+            removeSession = session;
+            session = session->next;
+            FreeSnifferSession(removeSession);
+        }
+    }
+
+    UnLockMutex(&SessionMutex);
+    UnLockMutex(&ServerListMutex);
+
+    FreeMutex(&SessionMutex);
+    FreeMutex(&ServerListMutex);
+    CyaSSL_Cleanup();
+}
+
+
+/* Initialize a SnifferServer */
+static void InitSnifferServer(SnifferServer* sniffer)
+{
+    sniffer->ctx = 0;
+    XMEMSET(sniffer->address, 0, MAX_SERVER_ADDRESS);
+    sniffer->server   = 0;
+    sniffer->port     = 0;
+    sniffer->next     = 0;
+}
+
+
+/* Initialize session flags */
+static void InitFlags(Flags* flags)
+{
+    flags->side           = 0;
+    flags->serverCipherOn = 0;
+    flags->clientCipherOn = 0;
+    flags->resuming       = 0;
+    flags->cached         = 0;
+    flags->clientHello    = 0;
+    flags->finCount       = 0;
+    flags->fatalError     = 0;
+}
+
+
+/* Initialize FIN Capture */
+static void InitFinCapture(FinCaputre* cap)
+{
+    cap->cliFinSeq  = 0;
+    cap->srvFinSeq  = 0;
+    cap->cliCounted = 0;
+    cap->srvCounted = 0;
+}
+
+
+/* Initialize a Sniffer Session */
+static void InitSession(SnifferSession* session)
+{
+    session->context        = 0;
+    session->sslServer      = 0;
+    session->sslClient      = 0;
+    session->server         = 0;
+    session->client         = 0;
+    session->srvPort        = 0;
+    session->cliPort        = 0;
+    session->cliSeqStart    = 0;
+    session->srvSeqStart    = 0;
+    session->cliExpected    = 0;
+    session->srvExpected    = 0;
+    session->bornOn         = 0;
+    session->cliReassemblyList = 0;
+    session->srvReassemblyList = 0;
+    session->next           = 0;
+    session->ticketID       = 0;
+    
+    InitFlags(&session->flags);
+    InitFinCapture(&session->finCaputre);
+}
+
+
+/* IP Info from IP Header */
+typedef struct IpInfo {
+    int    length;        /* length of this header */
+    int    total;         /* total length of fragment */
+    word32 src;           /* network order source address */
+    word32 dst;           /* network order destination address */
+} IpInfo;
+
+
+/* TCP Info from TCP Header */
+typedef struct TcpInfo {
+    int    srcPort;       /* source port */
+    int    dstPort;       /* source port */
+    int    length;        /* length of this header */
+    word32 sequence;      /* sequence number */
+    byte   fin;           /* FIN set */
+    byte   rst;           /* RST set */
+    byte   syn;           /* SYN set */
+    byte   ack;           /* ACK set */
+} TcpInfo;
+
+
+/* Tcp Pseudo Header for Checksum calculation */
+typedef struct TcpPseudoHdr {
+    word32  src;        /* source address */
+    word32  dst;        /* destination address */
+    byte    rsv;        /* reserved, always 0 */
+    byte    protocol;   /* IP protocol */
+    word16  legnth;     /* tcp header length + data length (doesn't include */
+                        /* pseudo header length) network order */
+} TcpPseudoHdr;
+
+
+/* Password Setting Callback */
+static int SetPassword(char* passwd, int sz, int rw, void* userdata)
+{
+    (void)rw;
+    XSTRNCPY(passwd, userdata, sz);
+    return XSTRLEN(userdata);
+}
+
+
+/* Ethernet Header */
+typedef struct EthernetHdr {
+    byte   dst[ETHER_IF_ADDR_LEN];    /* destination host address */ 
+    byte   src[ETHER_IF_ADDR_LEN];    /* source  host address */ 
+    word16 type;                      /* IP, ARP, etc */ 
+} EthernetHdr;
+
+
+/* IP Header */
+typedef struct IpHdr {
+    byte    ver_hl;              /* version/header length */
+    byte    tos;                 /* type of service */
+    word16  length;              /* total length */
+    word16  id;                  /* identification */
+    word16  offset;              /* fragment offset field */
+    byte    ttl;                 /* time to live */
+    byte    protocol;            /* protocol */
+    word16  sum;                 /* checksum */
+    word32  src;                 /* source address */
+    word32  dst;                 /* destination address */
+} IpHdr;
+
+
+#define IP_HL(ip)      ( (((ip)->ver_hl) & 0x0f) * 4)
+#define IP_V(ip)       ( ((ip)->ver_hl) >> 4)
+
+/* TCP Header */
+typedef struct TcpHdr {
+    word16  srcPort;            /* source port */
+    word16  dstPort;            /* destination port */
+    word32  sequence;           /* sequence number */ 
+    word32  ack;                /* acknoledgment number */ 
+    byte    offset;             /* data offset, reserved */
+    byte    flags;              /* option flags */
+    word16  window;             /* window */
+    word16  sum;                /* checksum */
+    word16  urgent;             /* urgent pointer */
+} TcpHdr;
+
+#define TCP_LEN(tcp)  ( (((tcp)->offset & 0xf0) >> 4) * 4)
+#define TCP_FIN 0x01
+#define TCP_SYN 0x02
+#define TCP_RST 0x04
+#define TCP_ACK 0x10
+
+
+
+
+
+/* Use platform specific GetError to write to tracfile if tracing */ 
+static void Trace(int idx) 
+{
+    if (TraceOn) {
+        char myBuffer[MAX_ERROR_LEN];
+        GetError(idx, myBuffer);
+        fprintf(TraceFile, "\t%s\n", myBuffer);
+#ifdef DEBUG_SNIFFER
+        fprintf(stderr,    "\t%s\n", myBuffer);
+#endif
+    }
+}
+
+
+/* Show TimeStamp for beginning of packet Trace */
+static void TraceHeader(void)
+{
+    if (TraceOn) {
+        time_t ticks = time(NULL);
+        fprintf(TraceFile, "\n%s", ctime(&ticks));
+    }
+}
+
+
+/* Show Set Server info for Trace */
+static void TraceSetServer(const char* srv, int port, const char* keyFile)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tTrying to install a new Sniffer Server with\n");
+        fprintf(TraceFile, "\tserver: %s, port: %d, keyFile: %s\n", srv, port,
+                                                                    keyFile);
+    }
+}
+
+
+/* Trace got packet number */
+static void TracePacket(void)
+{
+    if (TraceOn) {
+        static word32 packetNumber = 0;
+        fprintf(TraceFile, "\tGot a Packet to decode, packet %u\n",
+                ++packetNumber);
+    }
+}
+
+
+/* Convert network byte order address into human readable */
+static char* IpToS(word32 addr, char* str)
+{
+    byte* p = (byte*)&addr;
+    
+    SNPRINTF(str, TRACE_MSG_SZ, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+    
+    return str;
+}
+
+
+/* Show destination and source address from Ip Hdr for packet Trace */
+static void TraceIP(IpHdr* iphdr)
+{
+    if (TraceOn) {
+        char src[TRACE_MSG_SZ];
+        char dst[TRACE_MSG_SZ];
+        fprintf(TraceFile, "\tdst:%s src:%s\n", IpToS(iphdr->dst, dst),
+                IpToS(iphdr->src, src));
+    }
+}
+
+
+/* Show destination and source port from Tcp Hdr for packet Trace */
+static void TraceTcp(TcpHdr* tcphdr)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tdstPort:%u srcPort:%u\n", ntohs(tcphdr->dstPort),
+                ntohs(tcphdr->srcPort));
+    }
+}
+
+
+/* Show sequence and payload length for Trace */
+static void TraceSequence(word32 seq, int len)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tSequence:%u, payload length:%d\n", seq, len);
+    }
+}
+
+
+/* Show relative expected and relative received sequences */
+static void TraceRelativeSequence(word32 expected, word32 got)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tExpected sequence:%u, received sequence:%u\n",
+                expected, got);
+    }
+}
+
+
+/* Show server sequence startup from SYN */
+static void TraceServerSyn(word32 seq)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tServer SYN, Sequence Start:%u\n", seq);
+    }
+}
+
+
+/* Show client sequence startup from SYN */
+static void TraceClientSyn(word32 seq)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tClient SYN, Sequence Start:%u\n", seq);
+    }
+}
+
+
+/* Show client FIN capture */
+static void TraceClientFin(word32 finSeq, word32 relSeq)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tClient FIN capture:%u, current SEQ:%u\n",
+                finSeq, relSeq);
+    }
+}
+
+
+/* Show server FIN capture */
+static void TraceServerFin(word32 finSeq, word32 relSeq)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tServer FIN capture:%u, current SEQ:%u\n",
+                finSeq, relSeq);
+    }
+}
+
+
+/* Show number of SSL data bytes decoded, could be 0 (ok) */
+static void TraceGotData(int bytes)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\t%d bytes of SSL App data processed\n", bytes);
+    }
+}
+
+
+/* Show bytes added to old SSL App data */
+static void TraceAddedData(int newBytes, int existingBytes)
+{
+    if (TraceOn) {
+        fprintf(TraceFile,
+                "\t%d bytes added to %d exisiting bytes in User Buffer\n",
+                newBytes, existingBytes);
+    }
+}
+
+
+/* Show Stale Session */
+static void TraceStaleSession(void)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tFound a stale session\n");
+    }
+}
+
+
+/* Show Finding Stale Sessions */
+static void TraceFindingStale(void)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tTrying to find Stale Sessions\n");
+    }
+}
+
+
+/* Show Removed Session */
+static void TraceRemovedSession(void)
+{
+    if (TraceOn) {
+        fprintf(TraceFile, "\tRemoved it\n");
+    }
+}
+
+
+/* Set user error string */
+static void SetError(int idx, char* error, SnifferSession* session, int fatal)
+{
+    GetError(idx, error);
+    Trace(idx);
+    if (session && fatal == FATAL_ERROR_STATE)
+        session->flags.fatalError = 1;
+}
+
+
+/* See if this IPV4 network order address has been registered */
+/* return 1 is true, 0 is false */
+static int IsServerRegistered(word32 addr)
+{
+    int ret = 0;     /* false */
+    SnifferServer* sniffer;
+
+    LockMutex(&ServerListMutex);
+    
+    sniffer = ServerList;
+    while (sniffer) {
+        if (sniffer->server == addr) {
+            ret = 1;
+            break;
+        }
+        sniffer = sniffer->next;
+    }
+    
+    UnLockMutex(&ServerListMutex);
+
+    return ret;
+}
+
+
+/* See if this port has been registered to watch */
+/* return 1 is true, 0 is false */
+static int IsPortRegistered(word32 port)
+{
+    int ret = 0;    /* false */
+    SnifferServer* sniffer;
+    
+    LockMutex(&ServerListMutex);
+    
+    sniffer = ServerList;
+    while (sniffer) {
+        if (sniffer->port == (int)port) {
+            ret = 1; 
+            break;
+        }
+        sniffer = sniffer->next;
+    }
+    
+    UnLockMutex(&ServerListMutex);
+
+    return ret;
+}
+
+
+/* Get SnifferServer from IP and Port */
+static SnifferServer* GetSnifferServer(IpInfo* ipInfo, TcpInfo* tcpInfo)
+{
+    SnifferServer* sniffer;
+    
+    LockMutex(&ServerListMutex);
+    
+    sniffer = ServerList;
+    while (sniffer) {
+        if (sniffer->port == tcpInfo->srcPort && sniffer->server == ipInfo->src)
+            break;
+        if (sniffer->port == tcpInfo->dstPort && sniffer->server == ipInfo->dst)
+            break;
+        sniffer = sniffer->next;
+    }
+    
+    UnLockMutex(&ServerListMutex);
+    
+    return sniffer;
+}
+
+
+/* Hash the Session Info, return hash row */
+static word32 SessionHash(IpInfo* ipInfo, TcpInfo* tcpInfo)
+{
+    word32 hash = ipInfo->src * ipInfo->dst;
+    hash *= tcpInfo->srcPort * tcpInfo->dstPort;
+    
+    return hash % HASH_SIZE;
+}
+
+
+/* Get Exisiting SnifferSession from IP and Port */
+static SnifferSession* GetSnifferSession(IpInfo* ipInfo, TcpInfo* tcpInfo)
+{
+    SnifferSession* session;
+    
+    word32 row = SessionHash(ipInfo, tcpInfo);
+    assert(row >= 0 && row <= HASH_SIZE);
+    
+    LockMutex(&SessionMutex);
+    
+    session = SessionTable[row];
+    while (session) {
+        if (session->server == ipInfo->src && session->client == ipInfo->dst &&
+                    session->srvPort == tcpInfo->srcPort &&
+                    session->cliPort == tcpInfo->dstPort)
+            break;
+        if (session->client == ipInfo->src && session->server == ipInfo->dst &&
+                    session->cliPort == tcpInfo->srcPort &&
+                    session->srvPort == tcpInfo->dstPort)
+            break;
+        
+        session = session->next;
+    }
+    
+    UnLockMutex(&SessionMutex);
+    
+    /* determine side */
+    if (session) {
+        if (ipInfo->dst == session->context->server &&
+            tcpInfo->dstPort == session->context->port)
+            session->flags.side = SERVER_END;
+        else
+            session->flags.side = CLIENT_END;
+    }    
+    
+    return session;
+}
+
+
+/* Sets the private key for a specific server and port  */
+/* returns 0 on success, -1 on error */
+int ssl_SetPrivateKey(const char* serverAddress, int port, const char* keyFile,
+                      int typeKey, const char* password, char* error)
+{
+    int            ret;
+    int            type = (typeKey == FILETYPE_PEM) ? SSL_FILETYPE_PEM :
+                                                      SSL_FILETYPE_ASN1;
+    SnifferServer* sniffer;
+    
+    TraceHeader();
+    TraceSetServer(serverAddress, port, keyFile);
+
+    sniffer = (SnifferServer*)malloc(sizeof(SnifferServer));
+    if (sniffer == NULL) {
+        SetError(MEMORY_STR, error, NULL, 0);
+        return -1;
+    }
+    InitSnifferServer(sniffer);
+
+    XSTRNCPY(sniffer->address, serverAddress, MAX_SERVER_ADDRESS);
+    sniffer->server = inet_addr(sniffer->address);
+    sniffer->port = port;
+    
+    /* start in client mode since SSL_new needs a cert for server */
+    sniffer->ctx = SSL_CTX_new(SSLv3_client_method());
+    if (!sniffer->ctx) {
+        SetError(MEMORY_STR, error, NULL, 0);
+        FreeSnifferServer(sniffer);
+        return -1;
+    }
+
+    if (password){
+        SSL_CTX_set_default_passwd_cb(sniffer->ctx, SetPassword);
+        SSL_CTX_set_default_passwd_cb_userdata(sniffer->ctx, (void*)password);
+    }
+    ret = SSL_CTX_use_PrivateKey_file(sniffer->ctx, keyFile, type);
+    if (ret != SSL_SUCCESS) {
+        SetError(KEY_FILE_STR, error, NULL, 0);
+        FreeSnifferServer(sniffer);
+        return -1;
+    }
+    Trace(NEW_SERVER_STR);
+    
+    LockMutex(&ServerListMutex);
+    
+    sniffer->next = ServerList;
+    ServerList = sniffer;
+    
+    UnLockMutex(&ServerListMutex);
+    
+    return 0;
+}
+
+
+/* Check IP Header for IPV4, TCP, and a registered server address */
+/* returns 0 on success, -1 on error */
+static int CheckIpHdr(IpHdr* iphdr, IpInfo* info, char* error)
+{
+    int    version = IP_V(iphdr);
+
+    TraceIP(iphdr);
+    Trace(IP_CHECK_STR);
+    if (version != IPV4) {
+        SetError(BAD_IPVER_STR, error, NULL, 0); 
+        return -1;
+    }
+
+    if (iphdr->protocol != TCP_PROTOCOL) { 
+        SetError(BAD_PROTO_STR, error, NULL, 0);
+        return -1;
+    }
+
+    if (!IsServerRegistered(iphdr->src) && !IsServerRegistered(iphdr->dst)) {
+        SetError(SERVER_NOT_REG_STR, error, NULL, 0);
+        return -1;
+    }
+
+    info->length  = IP_HL(iphdr);
+    info->total   = ntohs(iphdr->length);
+    info->src     = iphdr->src;
+    info->dst     = iphdr->dst;
+
+    return 0;
+}
+
+
+/* Check TCP Header for a registered port */
+/* returns 0 on success, -1 on error */
+static int CheckTcpHdr(TcpHdr* tcphdr, TcpInfo* info, char* error)
+{
+    TraceTcp(tcphdr);
+    Trace(TCP_CHECK_STR);
+    info->srcPort   = ntohs(tcphdr->srcPort);
+    info->dstPort   = ntohs(tcphdr->dstPort);
+    info->length    = TCP_LEN(tcphdr);
+    info->sequence  = ntohl(tcphdr->sequence);
+    info->fin       = tcphdr->flags & TCP_FIN;
+    info->rst       = tcphdr->flags & TCP_RST;
+    info->syn       = tcphdr->flags & TCP_SYN;
+    info->ack       = tcphdr->flags & TCP_ACK;
+
+    if (!IsPortRegistered(info->srcPort) && !IsPortRegistered(info->dstPort)) {
+        SetError(SERVER_PORT_NOT_REG_STR, error, NULL, 0);
+        return -1;
+    }
+
+    return 0;
+}
+
+
+/* Decode Record Layer Header */
+static int GetRecordHeader(const byte* input, RecordLayerHeader* rh, int* size)
+{
+    XMEMCPY(rh, input, RECORD_HEADER_SZ);
+    *size = (rh->length[0] << 8) | rh->length[1];
+
+    if (*size > (RECORD_SIZE + MAX_COMP_EXTRA + MAX_MSG_EXTRA))
+        return LENGTH_ERROR;
+
+    return 0;
+}
+
+
+/* Process Client Key Exchange, RSA only */
+static int ProcessClientKeyExchange(const byte* input, int* sslBytes,
+                                    SnifferSession* session, char* error)
+{
+    word32 idx = 0;
+    RsaKey key;
+    int    ret;
+
+    InitRsaKey(&key, 0);
+   
+    ret = RsaPrivateKeyDecode(session->context->ctx->privateKey.buffer,
+                          &idx, &key, session->context->ctx->privateKey.length);
+    if (ret == 0) {
+        int length = RsaEncryptSize(&key);
+        
+        if (IsTLS(session->sslServer)) 
+            input += 2;     /* tls pre length */
+       
+        if (length > *sslBytes) { 
+            SetError(PARTIAL_INPUT_STR, error, session, FATAL_ERROR_STATE);
+            FreeRsaKey(&key);
+            return -1;
+        }
+        ret = RsaPrivateDecrypt(input, length, 
+                  session->sslServer->arrays.preMasterSecret, SECRET_LEN, &key);
+        
+        if (ret != SECRET_LEN) {
+            SetError(RSA_DECRYPT_STR, error, session, FATAL_ERROR_STATE);
+            FreeRsaKey(&key);
+            return -1;
+        }
+        ret = 0;  /* not in error state */
+        session->sslServer->arrays.preMasterSz = SECRET_LEN;
+        
+        /* store for client side as well */
+        XMEMCPY(session->sslClient->arrays.preMasterSecret,
+               session->sslServer->arrays.preMasterSecret, SECRET_LEN);
+        session->sslClient->arrays.preMasterSz = SECRET_LEN;
+        
+        #ifdef SHOW_SECRETS
+        {
+            int i;
+            printf("pre master secret: ");
+            for (i = 0; i < SECRET_LEN; i++)
+                printf("%02x", session->sslServer->arrays.preMasterSecret[i]);
+            printf("\n");
+        }
+        #endif
+    }
+    else {
+        SetError(RSA_DECODE_STR, error, session, FATAL_ERROR_STATE);
+        FreeRsaKey(&key);
+        return -1;
+    }
+    
+    if (SetCipherSpecs(session->sslServer) != 0) {
+        SetError(BAD_CIPHER_SPEC_STR, error, session, FATAL_ERROR_STATE);
+        FreeRsaKey(&key);
+        return -1;
+    }
+   
+    if (SetCipherSpecs(session->sslClient) != 0) {
+        SetError(BAD_CIPHER_SPEC_STR, error, session, FATAL_ERROR_STATE);
+        FreeRsaKey(&key);
+        return -1;
+    }
+
+    MakeMasterSecret(session->sslServer);
+    MakeMasterSecret(session->sslClient);
+#ifdef SHOW_SECRETS
+    {
+        int i;
+        printf("server master secret: ");
+        for (i = 0; i < SECRET_LEN; i++)
+            printf("%02x", session->sslServer->arrays.masterSecret[i]);
+        printf("\n");
+        
+        printf("client master secret: ");
+        for (i = 0; i < SECRET_LEN; i++)
+            printf("%02x", session->sslClient->arrays.masterSecret[i]);
+        printf("\n");
+
+        printf("server suite = %d\n", session->sslServer->options.cipherSuite);
+        printf("client suite = %d\n", session->sslClient->options.cipherSuite);
+    }
+#endif   
+    
+    FreeRsaKey(&key);
+    return ret;
+}
+
+
+/* Process Session Ticket */
+static int ProcessSessionTicket(const byte* input, int* sslBytes,
+                                SnifferSession* session, char* error)
+{
+    word16 len;
+
+    /* make sure can read through hint and len */
+    if (TICKET_HINT_LEN + LENGTH_SZ > *sslBytes) {
+        SetError(BAD_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    
+    input     += TICKET_HINT_LEN;  /* skip over hint */
+    *sslBytes -= TICKET_HINT_LEN;
+
+    len = (input[0] << 8) | input[1];
+    input     += LENGTH_SZ;
+    *sslBytes -= LENGTH_SZ;
+
+    /* make sure can read through ticket */
+    if (len > *sslBytes || len < ID_LEN) {
+        SetError(BAD_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+
+    /* store session with macID as sessionID */
+    session->sslServer->options.haveSessionId = 1;
+    XMEMCPY(session->sslServer->arrays.sessionID, input + len - ID_LEN, ID_LEN);
+    
+    return 0;
+}
+
+
+/* Process Server Hello */
+static int ProcessServerHello(const byte* input, int* sslBytes,
+                              SnifferSession* session, char* error)
+{
+    ProtocolVersion pv;
+    byte            b;
+    int             toRead = sizeof(ProtocolVersion) + RAN_LEN + ENUM_LEN;
+    int             doResume     = 0;
+    
+    /* make sure we didn't miss ClientHello */
+    if (session->flags.clientHello == 0) {
+        SetError(MISSED_CLIENT_HELLO_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+
+    /* make sure can read through session len */
+    if (toRead > *sslBytes) {
+        SetError(SERVER_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    
+    XMEMCPY(&pv, input, sizeof(ProtocolVersion));
+    input     += sizeof(ProtocolVersion);
+    *sslBytes -= sizeof(ProtocolVersion);
+           
+    session->sslServer->version = pv;
+    session->sslClient->version = pv;
+           
+    XMEMCPY(session->sslServer->arrays.serverRandom, input, RAN_LEN);
+    XMEMCPY(session->sslClient->arrays.serverRandom, input, RAN_LEN);
+    input    += RAN_LEN;
+    *sslBytes -= RAN_LEN;
+    
+    b = *input++;
+    *sslBytes -= 1;
+    
+    /* make sure can read through compression */
+    if ( (b + SUITE_LEN + ENUM_LEN) > *sslBytes) {
+        SetError(SERVER_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    if (b) {
+        XMEMCPY(session->sslServer->arrays.sessionID, input, ID_LEN);
+        session->sslServer->options.haveSessionId = 1;
+    }
+    input     += b;
+    *sslBytes -= b;
+   
+    /* cipher suite */ 
+    (void)*input++;  /* eat first byte, always 0 */
+    b = *input++;
+    session->sslServer->options.cipherSuite = b;
+    session->sslClient->options.cipherSuite = b;
+    *sslBytes -= SUITE_LEN;
+
+    /* compression */
+    b = *input++;
+    *sslBytes -= ENUM_LEN;
+
+    if (b) {
+        SetError(BAD_COMPRESSION_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+   
+    if (session->sslServer->options.haveSessionId &&
+            XMEMCMP(session->sslServer->arrays.sessionID,
+                    session->sslClient->arrays.sessionID, ID_LEN) == 0)
+        doResume = 1;
+    else if (session->sslClient->options.haveSessionId == 0 &&
+             session->sslServer->options.haveSessionId == 0 &&
+             session->ticketID)
+        doResume = 1;
+
+    if (session->ticketID && doResume) {
+        /* use ticketID to retrieve from session */
+        XMEMCPY(session->sslServer->arrays.sessionID, session->ticketID,ID_LEN);
+    }
+
+    if (doResume ) {
+        SSL_SESSION* resume = GetSession(session->sslServer,
+                                       session->sslServer->arrays.masterSecret);
+        if (resume == NULL) {
+            SetError(BAD_SESSION_RESUME_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        /* make sure client has master secret too */
+        XMEMCPY(session->sslClient->arrays.masterSecret,
+               session->sslServer->arrays.masterSecret, SECRET_LEN);
+        session->flags.resuming = 1;
+        
+        Trace(SERVER_DID_RESUMPTION_STR);
+        if (SetCipherSpecs(session->sslServer) != 0) {
+            SetError(BAD_CIPHER_SPEC_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        
+        if (SetCipherSpecs(session->sslClient) != 0) {
+            SetError(BAD_CIPHER_SPEC_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        
+        if (session->sslServer->options.tls) {
+            DeriveTlsKeys(session->sslServer);
+            DeriveTlsKeys(session->sslClient);
+        }
+        else {
+            DeriveKeys(session->sslServer);
+            DeriveKeys(session->sslClient);
+        }
+    }
+#ifdef SHOW_SECRETS
+    {
+        int i;
+        printf("cipher suite = 0x%02x\n",
+               session->sslServer->options.cipherSuite);
+        printf("server random: ");
+        for (i = 0; i < RAN_LEN; i++)
+            printf("%02x", session->sslServer->arrays.serverRandom[i]);
+        printf("\n");
+    }
+#endif   
+    return 0;
+}
+
+
+/* Process normal Client Hello */
+static int ProcessClientHello(const byte* input, int* sslBytes, 
+                              SnifferSession* session, char* error)
+{
+    byte   bLen;
+    word16 len;
+    int    toRead = sizeof(ProtocolVersion) + RAN_LEN + ENUM_LEN;
+    
+    session->flags.clientHello = 1;  /* don't process again */
+    
+    /* make sure can read up to session len */
+    if (toRead > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    
+    /* skip, get negotiated one from server hello */
+    input     += sizeof(ProtocolVersion);
+    *sslBytes -= sizeof(ProtocolVersion);
+    
+    XMEMCPY(session->sslServer->arrays.clientRandom, input, RAN_LEN);
+    XMEMCPY(session->sslClient->arrays.clientRandom, input, RAN_LEN);
+    
+    input     += RAN_LEN;
+    *sslBytes -= RAN_LEN;
+    
+    /* store session in case trying to resume */
+    bLen = *input++;
+    *sslBytes -= ENUM_LEN;
+    if (bLen) {
+        if (ID_LEN > *sslBytes) {
+            SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        Trace(CLIENT_RESUME_TRY_STR);
+        XMEMCPY(session->sslClient->arrays.sessionID, input, ID_LEN);
+        session->sslClient->options.haveSessionId = 1;
+    }
+#ifdef SHOW_SECRETS
+    {
+        int i;
+        printf("client random: ");
+        for (i = 0; i < RAN_LEN; i++)
+            printf("%02x", session->sslServer->arrays.clientRandom[i]);
+        printf("\n");
+    }
+#endif
+
+    input     += bLen;
+    *sslBytes -= bLen;
+
+    /* skip cipher suites */
+    /* make sure can read len */
+    if (SUITE_LEN > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    len = (input[0] << 8) | input[1];
+    input     += SUITE_LEN;
+    *sslBytes -= SUITE_LEN;
+    /* make sure can read suites + comp len */
+    if (len + ENUM_LEN > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    input     += len;
+    *sslBytes -= len;
+
+    /* skip compression */
+    bLen       = *input++;
+    *sslBytes -= ENUM_LEN;
+    /* make sure can read len */
+    if (bLen > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    input     += bLen;
+    *sslBytes -= bLen;
+  
+    if (*sslBytes == 0) {
+        /* no extensions */
+        return 0;
+    }
+    
+    /* skip extensions until session ticket */
+    /* make sure can read len */
+    if (SUITE_LEN > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    len = (input[0] << 8) | input[1];
+    input     += SUITE_LEN;
+    *sslBytes -= SUITE_LEN;
+    /* make sure can read through all extensions */
+    if (len > *sslBytes) {
+        SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+
+    while (len > EXT_TYPE_SZ + LENGTH_SZ) {
+        byte   extType[EXT_TYPE_SZ];
+        word16 extLen;
+
+        extType[0] = input[0];
+        extType[1] = input[1];
+        input     += EXT_TYPE_SZ;
+        *sslBytes -= EXT_TYPE_SZ;
+
+        extLen = (input[0] << 8) | input[1];
+        input     += LENGTH_SZ;
+        *sslBytes -= LENGTH_SZ;
+
+        /* make sure can read through individual extension */
+        if (extLen > *sslBytes) {
+            SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+
+        if (extType[0] == 0x00 && extType[1] == TICKET_EXT_ID) {
+
+            /* make sure can read through ticket if there is a non blank one */
+            if (extLen && extLen < ID_LEN) {
+                SetError(CLIENT_HELLO_INPUT_STR, error, session,
+                         FATAL_ERROR_STATE);
+                return -1;
+            }
+
+            if (extLen) {
+                if (session->ticketID == 0) {
+                    session->ticketID = (byte*)malloc(ID_LEN);
+                    if (session->ticketID == 0) {
+                        SetError(MEMORY_STR, error, session,
+                                 FATAL_ERROR_STATE);
+                        return -1;
+                    }
+                }
+                XMEMCPY(session->ticketID, input + extLen - ID_LEN, ID_LEN);
+            }
+        }
+
+        input     += extLen;
+        *sslBytes -= extLen;
+        len       -= extLen + EXT_TYPE_SZ + LENGTH_SZ;
+    }
+
+    return 0;
+}
+
+
+/* Process Finished */
+static int ProcessFinished(const byte* input, int* sslBytes, 
+                           SnifferSession* session, char* error)
+{
+    SSL*   ssl;
+    word32 inOutIdx = 0;
+    int    ret;
+                
+    if (session->flags.side == SERVER_END)
+        ssl = session->sslServer;
+    else
+        ssl = session->sslClient;
+    ret = DoFinished(ssl, input, &inOutIdx, SNIFF);
+    *sslBytes -= (int)inOutIdx;
+
+    if (ret < 0) {
+        SetError(BAD_FINISHED_MSG, error, session, FATAL_ERROR_STATE);
+        return ret;
+    }
+                
+    if (ret == 0 && session->flags.cached == 0) {
+        if (session->sslServer->options.haveSessionId) {
+            CYASSL_SESSION* sess = GetSession(session->sslServer, NULL);
+            if (sess == NULL)
+                AddSession(session->sslServer);  /* don't re add */
+            session->flags.cached = 1;
+         }
+    }
+
+
+    return ret;
+}
+
+
+/* Process HandShake input */
+static int DoHandShake(const byte* input, int* sslBytes,
+                       SnifferSession* session, char* error)
+{
+    byte type;
+    int  size;
+    int  ret = 0;
+    
+    if (*sslBytes < HANDSHAKE_HEADER_SZ) {
+        SetError(HANDSHAKE_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    type = input[0];
+    size = (input[1] << 16) | (input[2] << 8) | input[3];
+    
+    input     += HANDSHAKE_HEADER_SZ;
+    *sslBytes -= HANDSHAKE_HEADER_SZ;
+    
+    if (*sslBytes < size) {
+        SetError(HANDSHAKE_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    
+    switch (type) {
+        case hello_verify_request:
+            Trace(GOT_HELLO_VERIFY_STR);
+            break;
+        case hello_request:
+            Trace(GOT_HELLO_REQUEST_STR);
+            break;
+        case session_ticket:
+            Trace(GOT_SESSION_TICKET_STR);
+            ret = ProcessSessionTicket(input, sslBytes, session, error);
+            break;
+        case server_hello:
+            Trace(GOT_SERVER_HELLO_STR);
+            ret = ProcessServerHello(input, sslBytes, session, error);
+            break;
+        case certificate_request:
+            Trace(GOT_CERT_REQ_STR);
+            break;
+        case server_key_exchange:
+            Trace(GOT_SERVER_KEY_EX_STR);
+            /* can't know temp key passively */
+            SetError(BAD_CIPHER_SPEC_STR, error, session, FATAL_ERROR_STATE);
+            ret = -1;
+            break;
+        case certificate:
+            Trace(GOT_CERT_STR);
+            break;
+        case server_hello_done:
+            Trace(GOT_SERVER_HELLO_DONE_STR);
+            break;
+        case finished:
+            Trace(GOT_FINISHED_STR);
+            ret = ProcessFinished(input, sslBytes, session, error);
+            break;
+        case client_hello:
+            Trace(GOT_CLIENT_HELLO_STR);
+            ret = ProcessClientHello(input, sslBytes, session, error);
+            break;
+        case client_key_exchange:
+            Trace(GOT_CLIENT_KEY_EX_STR);
+            ret = ProcessClientKeyExchange(input, sslBytes, session, error);
+            break;
+        case certificate_verify:
+            Trace(GOT_CERT_VER_STR);
+            break;
+        default:
+            SetError(GOT_UNKNOWN_HANDSHAKE_STR, error, session, 0);
+            return -1;
+    }   
+
+    return ret;
+}
+
+
+/* Decrypt input into plain output */
+static void Decrypt(SSL* ssl, byte* output, const byte* input, word32 sz)
+{
+    switch (ssl->specs.bulk_cipher_algorithm) {
+        #ifdef BUILD_ARC4
+        case rc4:
+            Arc4Process(&ssl->decrypt.arc4, output, input, sz);
+            break;
+        #endif
+            
+        #ifdef BUILD_DES3
+        case triple_des:
+            Des3_CbcDecrypt(&ssl->decrypt.des3, output, input, sz);
+            break;
+        #endif
+            
+        #ifdef BUILD_AES
+        case aes:
+            AesCbcDecrypt(&ssl->decrypt.aes, output, input, sz);
+            break;
+        #endif
+            
+        #ifdef HAVE_HC128
+        case hc128:
+            Hc128_Process(&ssl->decrypt.hc128, output, input, sz);
+            break;
+        #endif
+            
+        #ifdef BUILD_RABBIT
+        case rabbit:
+            RabbitProcess(&ssl->decrypt.rabbit, output, input, sz);
+            break;
+        #endif
+
+        default:
+            Trace(BAD_DECRYPT_TYPE);
+            break;
+    }
+}
+
+
+/* Decrypt input message into output, adjust output steam if needed */
+static const byte* DecryptMessage(SSL* ssl, const byte* input, word32 sz,
+                                  byte* output)
+{
+    Decrypt(ssl, output, input, sz);
+    ssl->keys.encryptSz = sz;
+    if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
+        return output + ssl->specs.block_size;     /* go past TLSv1.1 IV */
+    
+    return output;
+}
+
+
+/* remove session from table, use rowHint if no info (means we have a lock) */
+static void RemoveSession(SnifferSession* session, IpInfo* ipInfo,
+                        TcpInfo* tcpInfo, word32 rowHint)
+{
+    SnifferSession* previous = 0;
+    SnifferSession* current;
+    word32          row = rowHint;
+    int             haveLock = 0;
+   
+    if (ipInfo && tcpInfo)
+        row = SessionHash(ipInfo, tcpInfo);
+    else
+        haveLock = 1;
+    
+    assert(row >= 0 && row <= HASH_SIZE);
+    Trace(REMOVE_SESSION_STR);
+    
+    if (!haveLock)
+        LockMutex(&SessionMutex);
+    
+    current = SessionTable[row];
+    
+    while (current) {
+        if (current == session) {
+            if (previous)
+                previous->next = current->next;
+            else
+                SessionTable[row] = current->next;
+            FreeSnifferSession(session);
+            TraceRemovedSession();
+            break;
+        }
+        previous = current;
+        current  = current->next;
+    }
+    
+    if (!haveLock)
+        UnLockMutex(&SessionMutex);
+}
+
+
+/* Remove stale sessions from the Session Table, have a lock */
+static void RemoveStaleSessions(void)
+{
+    word32 i;
+    SnifferSession* session;
+    
+    for (i = 0; i < HASH_SIZE; i++) {
+        session = SessionTable[i];
+        while (session) {
+            SnifferSession* next = session->next; 
+            if (time(NULL) >= session->bornOn + SNIFFER_TIMEOUT) {
+                TraceStaleSession();
+                RemoveSession(session, NULL, NULL, i);
+            }
+            session = next;
+        }
+    }
+}
+
+
+/* Create a new Sniffer Session */
+static SnifferSession* CreateSession(IpInfo* ipInfo, TcpInfo* tcpInfo,
+                                     char* error)
+{
+    SnifferSession* session = 0;
+    int row;
+        
+    Trace(NEW_SESSION_STR);
+    /* create a new one */
+    session = (SnifferSession*)malloc(sizeof(SnifferSession));
+    if (session == NULL) {
+        SetError(MEMORY_STR, error, NULL, 0);
+        return 0;
+    }
+    InitSession(session);
+    session->server  = ipInfo->dst;
+    session->client  = ipInfo->src;
+    session->srvPort = tcpInfo->dstPort;
+    session->cliPort = tcpInfo->srcPort;
+    session->cliSeqStart = tcpInfo->sequence;
+    session->cliExpected = 1;  /* relative */
+    session->bornOn = time(NULL);
+                
+    session->context = GetSnifferServer(ipInfo, tcpInfo);
+    if (session->context == NULL) {
+        SetError(SERVER_NOT_REG_STR, error, NULL, 0);
+        free(session);
+        return 0;
+    }
+        
+    session->sslServer = SSL_new(session->context->ctx);
+    session->sslClient = SSL_new(session->context->ctx);
+    if (session->sslClient == NULL) {
+        if (session->sslServer) {
+            SSL_free(session->sslClient);
+            session->sslClient = 0;
+        }
+        SetError(BAD_NEW_SSL_STR, error, session, FATAL_ERROR_STATE);
+        free(session);
+        return 0;
+    }
+    /* put server back into server mode */
+    session->sslServer->options.side = SERVER_END;
+        
+    row = SessionHash(ipInfo, tcpInfo);
+    
+    /* add it to the session table */
+    LockMutex(&SessionMutex);
+        
+    session->next = SessionTable[row];
+    SessionTable[row] = session;
+    
+    SessionCount++;
+    
+    if ( (SessionCount % HASH_SIZE) == 0) {
+        TraceFindingStale();
+        RemoveStaleSessions();
+    }
+        
+    UnLockMutex(&SessionMutex);
+        
+    /* determine headed side */
+    if (ipInfo->dst == session->context->server &&
+        tcpInfo->dstPort == session->context->port)
+        session->flags.side = SERVER_END;
+    else
+        session->flags.side = CLIENT_END;        
+    
+    return session;
+}
+
+
+/* Process Old Client Hello Input */
+static int DoOldHello(SnifferSession* session, const byte* sslFrame,
+                      int* rhSize, int* sslBytes, char* error)
+{
+    const byte* input = sslFrame;
+    byte        b0, b1;
+    word32      idx = 0;
+    int         ret;
+
+    Trace(GOT_OLD_CLIENT_HELLO_STR);
+    session->flags.clientHello = 1;    /* don't process again */
+    b0 = *input++;
+    b1 = *input++;
+    *sslBytes -= 2;
+    *rhSize = ((b0 & 0x7f) << 8) | b1;
+
+    if (*rhSize > *sslBytes) {
+        SetError(OLD_CLIENT_INPUT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+
+    ret = ProcessOldClientHello(session->sslServer, input, &idx, *sslBytes,
+                                *rhSize);    
+    if (ret < 0) {
+        SetError(BAD_OLD_CLIENT_STR, error, session, FATAL_ERROR_STATE);
+        return -1;
+    }
+    
+    Trace(OLD_CLIENT_OK_STR);
+    XMEMCPY(session->sslClient->arrays.clientRandom,
+           session->sslServer->arrays.clientRandom, RAN_LEN);
+    
+    *sslBytes -= *rhSize;
+    return 0;
+}
+
+
+#if 0
+/* Calculate the TCP checksum, see RFC 1071 */
+/* return 0 for success, -1 on error */
+/* can be called from decode() with
+   TcpChecksum(&ipInfo, &tcpInfo, sslBytes, packet + ipInfo.length);
+   could also add a 64bit version if type available and using this
+*/
+int TcpChecksum(IpInfo* ipInfo, TcpInfo* tcpInfo, int dataLen,
+                const byte* packet)
+{
+    TcpPseudoHdr  pseudo;
+    int           count = PSEUDO_HDR_SZ;
+    const word16* data = (word16*)&pseudo;
+    word32        sum = 0;
+    word16        checksum;
+    
+    pseudo.src = ipInfo->src;
+    pseudo.dst = ipInfo->dst;
+    pseudo.rsv = 0;
+    pseudo.protocol = TCP_PROTO;
+    pseudo.legnth = htons(tcpInfo->length + dataLen);
+    
+    /* pseudo header sum */
+    while (count >= 2) {
+        sum   += *data++;
+        count -= 2;
+    }
+    
+    count = tcpInfo->length + dataLen;
+    data = (word16*)packet;
+    
+    /* main sum */
+    while (count > 1) {
+        sum   += *data++;
+        count -=2;
+    }
+    
+    /* get left-over, if any */
+    packet = (byte*)data;
+    if (count > 0) {
+        sum += *packet;
+    }
+    
+    /* fold 32bit sum into 16 bits */
+    while (sum >> 16)
+        sum = (sum & 0xffff) + (sum >> 16);
+    
+    checksum = (word16)~sum;
+    /* checksum should now equal 0, since included already calcd checksum */
+    /* field, but tcp checksum offloading could negate calculation */
+    if (checksum == 0)
+        return 0;
+    return -1;
+}
+#endif
+
+
+/* Check IP and TCP headers, set payload */
+/* returns 0 on success, -1 on error */
+static int CheckHeaders(IpInfo* ipInfo, TcpInfo* tcpInfo, const byte* packet,
+                  int length, const byte** sslFrame, int* sslBytes, char* error)
+{
+    TraceHeader();
+    TracePacket();
+    if (length < IP_HDR_SZ) {
+        SetError(PACKET_HDR_SHORT_STR, error, NULL, 0);
+        return -1;
+    }
+    if (CheckIpHdr((IpHdr*)packet, ipInfo, error) != 0)
+        return -1;
+    
+    if (length < (ipInfo->length + TCP_HDR_SZ)) {
+        SetError(PACKET_HDR_SHORT_STR, error, NULL, 0);
+        return -1;
+    }
+    if (CheckTcpHdr((TcpHdr*)(packet + ipInfo->length), tcpInfo, error) != 0)
+        return -1;
+    
+    *sslFrame = packet + ipInfo->length + tcpInfo->length;
+    if (*sslFrame > packet + length) {
+        SetError(PACKET_HDR_SHORT_STR, error, NULL, 0);
+        return -1;
+    }
+    *sslBytes = packet + length - *sslFrame;
+    
+    return 0;
+}
+
+
+/* Create or Find existing session */
+/* returns 0 on success (continue), -1 on error, 1 on success (end) */
+static int CheckSession(IpInfo* ipInfo, TcpInfo* tcpInfo, int sslBytes,
+                        SnifferSession** session, char* error)
+{
+    /* create a new SnifferSession on client SYN */
+    if (tcpInfo->syn && !tcpInfo->ack) {
+        TraceClientSyn(tcpInfo->sequence);
+        *session = CreateSession(ipInfo, tcpInfo, error);
+        if (*session == NULL) {
+            *session = GetSnifferSession(ipInfo, tcpInfo);
+            /* already had exisiting, so OK */
+            if (*session)
+                return 1;
+            
+            SetError(MEMORY_STR, error, NULL, 0);
+            return -1;
+        }
+        return 1;
+    }
+    /* get existing sniffer session */
+    else {
+        *session = GetSnifferSession(ipInfo, tcpInfo);
+        if (*session == NULL) {
+            /* don't worry about extraneous RST or duplicate FINs */
+            if (tcpInfo->fin || tcpInfo->rst)
+                return 1;
+            /* don't worry about duplicate ACKs either */
+            if (sslBytes == 0 && tcpInfo->ack)
+                return 1;
+            
+            SetError(BAD_SESSION_STR, error, NULL, 0);
+            return -1;
+        }        
+    }
+    return 0;
+}
+
+
+/* Create a Packet Buffer from *begin - end, adjust new *begin and bytesLeft */
+static PacketBuffer* CreateBuffer(word32* begin, word32 end, const byte* data,
+                                  int* bytesLeft)
+{
+    PacketBuffer* pb;
+    
+    int added = end - *begin + 1;
+    assert(*begin <= end);
+    
+    pb = (PacketBuffer*)malloc(sizeof(PacketBuffer));
+    if (pb == NULL) return NULL;
+    
+    pb->next  = 0;
+    pb->begin = *begin;
+    pb->end   = end;
+    pb->data = (byte*)malloc(added);
+    
+    if (pb->data == NULL) {
+        free(pb);
+        return NULL;
+    }
+    XMEMCPY(pb->data, data, added);
+    
+    *bytesLeft -= added;
+    *begin      = pb->end + 1;
+    
+    return pb;
+}
+
+
+/* Add sslFrame to Reassembly List */
+/* returns 1 (end) on success, -1, on error */
+static int AddToReassembly(byte from, word32 seq, const byte* sslFrame,
+                           int sslBytes, SnifferSession* session, char* error)
+{
+    PacketBuffer*  add;
+    PacketBuffer** front = (from == SERVER_END) ? &session->cliReassemblyList:
+                                                  &session->srvReassemblyList;
+    PacketBuffer*  curr = *front;
+    PacketBuffer*  prev = curr;
+    
+    word32  startSeq = seq;
+    word32  added;
+    int     bytesLeft = sslBytes;  /* could be overlapping fragment */
+
+    /* if list is empty add full frame to front */
+    if (!curr) {
+        add = CreateBuffer(&seq, seq + sslBytes - 1, sslFrame, &bytesLeft);
+        if (add == NULL) {
+            SetError(MEMORY_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        *front = add;
+        return 1;
+    }
+    
+    /* add to front if before current front, up to next->begin */
+    if (seq < curr->begin) {
+        word32 end = seq + sslBytes - 1;
+        
+        if (end >= curr->begin)
+            end = curr->begin - 1;
+        
+        add = CreateBuffer(&seq, end, sslFrame, &bytesLeft);
+        if (add == NULL) {
+            SetError(MEMORY_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        add->next = curr;
+        *front = add;
+    }
+    
+    /* while we have bytes left, try to find a gap to fill */
+    while (bytesLeft > 0) {
+        /* get previous packet in list */
+        while (curr && (seq >= curr->begin)) {
+            prev = curr;
+            curr = curr->next;
+        }
+        
+        /* don't add  duplicate data */
+        if (prev->end >= seq) {
+            if ( (seq + bytesLeft - 1) <= prev->end)
+                return 1;
+            seq = prev->end + 1;
+            bytesLeft = startSeq + sslBytes - seq;
+        }
+        
+        if (!curr)
+            /* we're at the end */
+            added = bytesLeft;
+        else 
+            /* we're in between two frames */
+            added = min((word32)bytesLeft, curr->begin - seq);
+        
+        /* data already there */
+        if (added == 0)
+            continue;
+        
+        add = CreateBuffer(&seq, seq + added - 1, &sslFrame[seq - startSeq],
+                           &bytesLeft);
+        if (add == NULL) {
+            SetError(MEMORY_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        add->next  = prev->next;
+        prev->next = add;
+    }
+    return 1;
+}
+
+
+/* Add out of order FIN capture */
+/* returns 1 for success (end) */
+static int AddFinCapture(SnifferSession* session, word32 sequence)
+{
+    if (session->flags.side == SERVER_END) {
+        if (session->finCaputre.cliCounted == 0)
+            session->finCaputre.cliFinSeq = sequence;
+    }
+    else {
+        if (session->finCaputre.srvCounted == 0)
+            session->finCaputre.srvFinSeq = sequence;
+    }
+    return 1;
+}
+
+
+/* Adjust incoming sequence based on side */
+/* returns 0 on success (continue), -1 on error, 1 on success (end) */
+static int AdjustSequence(TcpInfo* tcpInfo, SnifferSession* session,
+                          int* sslBytes, const byte** sslFrame, char* error)
+{
+    word32  seqStart = (session->flags.side == SERVER_END) ? 
+                                     session->cliSeqStart :session->srvSeqStart;
+    word32  real     = tcpInfo->sequence - seqStart;
+    word32* expected = (session->flags.side == SERVER_END) ?
+                                  &session->cliExpected : &session->srvExpected;
+    PacketBuffer* reassemblyList = (session->flags.side == SERVER_END) ?
+                        session->cliReassemblyList : session->srvReassemblyList;
+    
+    /* handle rollover of sequence */
+    if (tcpInfo->sequence < seqStart)
+        real = 0xffffffffU - seqStart + tcpInfo->sequence;
+        
+    TraceRelativeSequence(*expected, real);
+    
+    if (real < *expected) {
+        Trace(DUPLICATE_STR);
+        if (real + *sslBytes > *expected) {
+            int overlap = *expected - real;
+            Trace(OVERLAP_DUPLICATE_STR);
+                
+            /* adjust to expected, remove duplicate */
+            *sslFrame += overlap;
+            *sslBytes -= overlap;
+                
+            if (reassemblyList) {
+                word32 newEnd = *expected + *sslBytes;
+                    
+                if (newEnd > reassemblyList->begin) {
+                    Trace(OVERLAP_REASSEMBLY_BEGIN_STR);
+                    
+                    /* remove bytes already on reassembly list */
+                    *sslBytes -= newEnd - reassemblyList->begin;
+                }
+                if (newEnd > reassemblyList->end) {
+                    Trace(OVERLAP_REASSEMBLY_END_STR);
+                    
+                    /* may be past reassembly list end (could have more on list)
+                       so try to add what's past the front->end */
+                    AddToReassembly(session->flags.side, reassemblyList->end +1,
+                                *sslFrame + reassemblyList->end - *expected + 1,
+                                 newEnd - reassemblyList->end, session, error);
+                }
+            }
+        }
+        else
+            return 1;
+    }
+    else if (real > *expected) {
+        Trace(OUT_OF_ORDER_STR);
+        if (*sslBytes > 0)
+            return AddToReassembly(session->flags.side, real, *sslFrame,
+                                   *sslBytes, session, error);
+        else if (tcpInfo->fin)
+            return AddFinCapture(session, real);
+    }
+    /* got expected sequence */
+    *expected += *sslBytes;
+    if (tcpInfo->fin)
+        *expected += 1;
+    
+    return 0;
+}
+
+
+/* Check TCP Sequence status */
+/* returns 0 on success (continue), -1 on error, 1 on success (end) */
+static int CheckSequence(IpInfo* ipInfo, TcpInfo* tcpInfo,
+                         SnifferSession* session, int* sslBytes,
+                         const byte** sslFrame, char* error)
+{
+    int actualLen;
+    
+    /* init SEQ from server to client */
+    if (tcpInfo->syn && tcpInfo->ack) {
+        session->srvSeqStart = tcpInfo->sequence;
+        session->srvExpected = 1;
+        TraceServerSyn(tcpInfo->sequence);
+        return 1;
+    }
+    
+    /* adjust potential ethernet trailer */
+    actualLen = ipInfo->total - ipInfo->length - tcpInfo->length;
+    if (*sslBytes > actualLen) {
+        *sslBytes = actualLen;
+    }
+    
+    TraceSequence(tcpInfo->sequence, *sslBytes);
+    
+    return AdjustSequence(tcpInfo, session, sslBytes, sslFrame, error);    
+}
+
+
+/* Check Status before record processing */
+/* returns 0 on success (continue), -1 on error, 1 on success (end) */
+static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
+                          const byte** sslFrame, SnifferSession* session,
+                          int* sslBytes, const byte** end, char* error)
+{
+    word32 length;
+    SSL*   ssl = (session->flags.side == SERVER_END) ? session->sslServer :
+                                                       session->sslClient;
+    /* remove SnifferSession on 2nd FIN or RST */
+    if (tcpInfo->fin || tcpInfo->rst) {
+        /* flag FIN and RST */
+        if (tcpInfo->fin)
+            session->flags.finCount += 1;
+        else if (tcpInfo->rst)
+            session->flags.finCount += 2;
+        
+        if (session->flags.finCount >= 2) {
+            RemoveSession(session, ipInfo, tcpInfo, 0);
+            return 1;
+        }
+    }
+    
+    if (session->flags.fatalError == FATAL_ERROR_STATE) {
+        SetError(FATAL_ERROR_STR, error, NULL, 0);
+        return -1;
+    }
+    
+    if (*sslBytes == 0) {
+        Trace(NO_DATA_STR);
+        return 1;
+    }
+    
+    /* if current partial data, add to end of partial */
+    if ( (length = ssl->buffers.inputBuffer.length) ) {
+        Trace(PARTIAL_ADD_STR);
+        
+        if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
+            SetError(BUFFER_ERROR_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+        XMEMCPY(&ssl->buffers.inputBuffer.buffer[length], *sslFrame, *sslBytes);
+        *sslBytes += length;
+        ssl->buffers.inputBuffer.length = *sslBytes;
+        *sslFrame = ssl->buffers.inputBuffer.buffer;
+        *end = *sslFrame + *sslBytes;
+    }
+    
+    if (session->flags.clientHello == 0 && **sslFrame != handshake) {
+        int rhSize;
+        int ret = DoOldHello(session, *sslFrame, &rhSize, sslBytes, error);
+        if (ret < 0)
+            return -1;  /* error already set */
+        if (*sslBytes <= 0)
+            return 1;
+    }
+    
+    return 0;
+}
+
+
+/* See if input on the reassembly list is ready for consuming */
+/* returns 1 for TRUE, 0 for FALSE */
+static int HaveMoreInput(SnifferSession* session, const byte** sslFrame,
+                         int* sslBytes, const byte** end)
+{
+    /* sequence and reassembly based on from, not to */
+    int            moreInput = 0;
+    PacketBuffer** front = (session->flags.side == SERVER_END) ?
+                      &session->cliReassemblyList : &session->srvReassemblyList;
+    word32*        expected = (session->flags.side == SERVER_END) ?
+                                  &session->cliExpected : &session->srvExpected;
+    /* buffer is on receiving end */
+    word32*        length = (session->flags.side == SERVER_END) ?
+                               &session->sslServer->buffers.inputBuffer.length :
+                               &session->sslClient->buffers.inputBuffer.length;
+    byte*          myBuffer = (session->flags.side == SERVER_END) ?
+                                session->sslServer->buffers.inputBuffer.buffer :
+                                session->sslClient->buffers.inputBuffer.buffer;
+    
+    while (*front && ((*front)->begin == *expected) ) {
+        word32 room = STATIC_BUFFER_LEN - *length;
+        word32 packetLen = (*front)->end - (*front)->begin + 1;
+        
+        if (packetLen <= room) {
+            PacketBuffer* del = *front;
+            
+            XMEMCPY(&myBuffer[*length], (*front)->data, packetLen);
+            *length   += packetLen;
+            *expected += packetLen;
+            
+            /* remove used packet */
+            *front = (*front)->next;
+            FreePacketBuffer(del);
+            
+            moreInput = 1;
+        }
+        else
+            break;
+    }
+    if (moreInput) {
+        *sslFrame = myBuffer;
+        *sslBytes = *length;
+        *end      = myBuffer + *length;
+    }
+    return moreInput;
+}
+                         
+
+
+/* Process Message(s) from sslFrame */
+/* return Number of bytes on success, 0 for no data yet, and -1 on error */
+static int ProcessMessage(const byte* sslFrame, SnifferSession* session,
+                          int sslBytes, byte* data, const byte* end,char* error)
+{
+    const byte*       sslBegin = sslFrame;
+    const byte*       tmp;
+    RecordLayerHeader rh;
+    int               rhSize;
+    int               ret;
+    int               decoded = 0;      /* bytes stored for user in data */
+    int               notEnough;        /* notEnough bytes yet flag */
+    SSL*              ssl = (session->flags.side == SERVER_END) ?
+                                        session->sslServer : session->sslClient;
+doMessage:
+    notEnough = 0;
+    if (sslBytes >= RECORD_HEADER_SZ) {
+        if (GetRecordHeader(sslFrame, &rh, &rhSize) != 0) {
+            SetError(BAD_RECORD_HDR_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+        }
+    }
+    else
+        notEnough = 1;
+
+    if (notEnough || rhSize > (sslBytes - RECORD_HEADER_SZ)) {
+        /* don't have enough input yet to process full SSL record */
+        Trace(PARTIAL_INPUT_STR);
+        
+        /* store partial if not there already or we advanced */
+        if (ssl->buffers.inputBuffer.length == 0 || sslBegin != sslFrame) {
+            if (sslBytes > (int)ssl->buffers.inputBuffer.bufferSize) {
+                SetError(BUFFER_ERROR_STR, error, session, FATAL_ERROR_STATE);
+                return -1;
+            }
+            XMEMCPY(ssl->buffers.inputBuffer.buffer, sslFrame, sslBytes);
+            ssl->buffers.inputBuffer.length = sslBytes;
+        }
+        if (HaveMoreInput(session, &sslFrame, &sslBytes, &end))
+            goto doMessage;
+        return decoded;
+    }
+    sslFrame += RECORD_HEADER_SZ;
+    sslBytes -= RECORD_HEADER_SZ;
+    tmp = sslFrame + rhSize;   /* may have more than one record to process */
+    
+    /* decrypt if needed */
+    if (session->flags.side == SERVER_END && session->flags.serverCipherOn)
+        sslFrame = DecryptMessage(ssl, sslFrame, rhSize,
+                                  ssl->buffers.outputBuffer.buffer);
+    else if (session->flags.side == CLIENT_END && session->flags.clientCipherOn)
+        sslFrame = DecryptMessage(ssl, sslFrame, rhSize,
+                                  ssl->buffers.outputBuffer.buffer);
+            
+    switch ((enum ContentType)rh.type) {
+        case handshake:
+            Trace(GOT_HANDSHAKE_STR);
+            ret = DoHandShake(sslFrame, &sslBytes, session, error);
+            if (ret != 0) {
+                if (session->flags.fatalError == 0)
+                    SetError(BAD_HANDSHAKE_STR,error,session,FATAL_ERROR_STATE);
+                return -1;
+            }
+            break;
+        case change_cipher_spec:
+            if (session->flags.side == SERVER_END)
+                session->flags.serverCipherOn = 1;
+            else
+                session->flags.clientCipherOn = 1;
+            Trace(GOT_CHANGE_CIPHER_STR);
+            break;
+        case application_data:
+            Trace(GOT_APP_DATA_STR);
+            {
+                word32 inOutIdx = 0;
+                    
+                ret = DoApplicationData(ssl, (byte*)sslFrame, &inOutIdx);
+                if (ret == 0) {
+                    ret = ssl->buffers.clearOutputBuffer.length;
+                    TraceGotData(ret);
+                    if (ret) {  /* may be blank message */
+                        XMEMCPY(&data[decoded],
+                               ssl->buffers.clearOutputBuffer.buffer, ret);
+                        TraceAddedData(ret, decoded);
+                        decoded += ret;
+                        ssl->buffers.clearOutputBuffer.length = 0;
+                    }
+                }
+                else {
+                    SetError(BAD_APP_DATA_STR, error,session,FATAL_ERROR_STATE);
+                    return -1;
+                }
+            }
+            break;
+        case alert:
+            Trace(GOT_ALERT_STR);
+            break;
+        case no_type:
+        default:
+            SetError(GOT_UNKNOWN_RECORD_STR, error, session, FATAL_ERROR_STATE);
+            return -1;
+    }
+    
+    if (tmp < end) {
+        Trace(ANOTHER_MSG_STR);
+        sslFrame = tmp;
+        sslBytes = end - tmp;
+        goto doMessage;
+    }
+    
+    /* clear used input */
+    ssl->buffers.inputBuffer.length = 0;
+    
+    /* could have more input ready now */
+    if (HaveMoreInput(session, &sslFrame, &sslBytes, &end))
+        goto doMessage;
+    
+    return decoded;
+}
+
+
+/* See if we need to process any pending FIN captures */
+static void CheckFinCapture(IpInfo* ipInfo, TcpInfo* tcpInfo, 
+                            SnifferSession* session)
+{
+    if (session->finCaputre.cliFinSeq && session->finCaputre.cliFinSeq <= 
+                                         session->cliExpected) {
+        if (session->finCaputre.cliCounted == 0) {
+            session->flags.finCount += 1;
+            session->finCaputre.cliCounted = 1;
+            TraceClientFin(session->finCaputre.cliFinSeq, session->cliExpected);
+        }
+    }
+        
+    if (session->finCaputre.srvFinSeq && session->finCaputre.srvFinSeq <= 
+                                         session->srvExpected) {
+        if (session->finCaputre.srvCounted == 0) {
+            session->flags.finCount += 1;
+            session->finCaputre.srvCounted = 1;
+            TraceServerFin(session->finCaputre.srvFinSeq, session->srvExpected);
+        }
+    }
+                
+    if (session->flags.finCount >= 2) 
+        RemoveSession(session, ipInfo, tcpInfo, 0);
+}
+
+
+/* Passes in an IP/TCP packet for decoding (ethernet/localhost frame) removed */
+/* returns Number of bytes on success, 0 for no data yet, and -1 on error */
+int ssl_DecodePacket(const byte* packet, int length, byte* data, char* error)
+{
+    TcpInfo           tcpInfo;
+    IpInfo            ipInfo;
+    const byte*       sslFrame;
+    const byte*       end = packet + length;
+    int               sslBytes;                /* ssl bytes unconsumed */
+    int               ret;
+    SnifferSession*   session = 0;
+
+    if (CheckHeaders(&ipInfo, &tcpInfo, packet, length, &sslFrame, &sslBytes,
+                     error) != 0)
+        return -1;
+    
+    ret = CheckSession(&ipInfo, &tcpInfo, sslBytes, &session, error);
+    if (ret == -1)     return -1;
+    else if (ret == 1) return  0;   /* done for now */
+    
+    ret = CheckSequence(&ipInfo, &tcpInfo, session, &sslBytes, &sslFrame,error);
+    if (ret == -1)     return -1;
+    else if (ret == 1) return  0;   /* done for now */
+    
+    ret = CheckPreRecord(&ipInfo, &tcpInfo, &sslFrame, session, &sslBytes,
+                         &end, error);
+    if (ret == -1)     return -1;
+    else if (ret == 1) return  0;   /* done for now */
+
+    ret = ProcessMessage(sslFrame, session, sslBytes, data, end, error);
+    CheckFinCapture(&ipInfo, &tcpInfo, session);
+    return ret;
+}
+
+
+/* Enables (if traceFile)/ Disables debug tracing */
+/* returns 0 on success, -1 on error */
+int ssl_Trace(const char* traceFile, char* error)
+{
+    if (traceFile) {
+        TraceFile = fopen(traceFile, "a");
+        if (!TraceFile) {
+            SetError(BAD_TRACE_FILE_STR, error, NULL, 0);
+            return -1;
+        }
+        TraceOn = 1;
+    }
+    else 
+        TraceOn = 0;
+
+    return 0;
+}
+
+
+
+
+#endif /* CYASSL_SNIFFER */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/ssl.c b/FreeRTOS-Plus/Source/CyaSSL/src/ssl.c
new file mode 100644 (file)
index 0000000..8456c58
--- /dev/null
@@ -0,0 +1,7852 @@
+/* ssl.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef HAVE_ERRNO_H 
+    #include <errno.h>
+#endif
+
+#define TRUE  1
+#define FALSE 0
+
+#include <cyassl/ssl.h>
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+#include <cyassl/ctaocrypt/coding.h>
+
+#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
+    #include <cyassl/openssl/evp.h>
+#endif
+
+#ifdef OPENSSL_EXTRA
+    /* openssl headers begin */
+    #include <cyassl/openssl/hmac.h>
+    #include <cyassl/openssl/crypto.h>
+    #include <cyassl/openssl/des.h>
+    #include <cyassl/openssl/bn.h>
+    #include <cyassl/openssl/dh.h>
+    #include <cyassl/openssl/rsa.h>
+    #include <cyassl/openssl/pem.h>
+    /* openssl headers end, cyassl internal headers next */
+    #include <cyassl/ctaocrypt/hmac.h>
+    #include <cyassl/ctaocrypt/random.h>
+    #include <cyassl/ctaocrypt/des3.h>
+    #include <cyassl/ctaocrypt/md4.h>
+    #include <cyassl/ctaocrypt/md5.h>
+    #include <cyassl/ctaocrypt/arc4.h>
+    #ifdef CYASSL_SHA512
+        #include <cyassl/ctaocrypt/sha512.h>
+    #endif
+#endif
+
+#ifndef NO_FILESYSTEM
+    #if !defined(USE_WINDOWS_API) && !defined(NO_CYASSL_DIR)
+        #include <dirent.h>
+    #endif
+#endif /* NO_FILESYSTEM */
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+char* mystrnstr(const char* s1, const char* s2, unsigned int n)
+{
+    unsigned int s2_len = XSTRLEN(s2);
+
+    if (s2_len == 0)
+        return (char*)s1;
+
+    while (n >= s2_len && s1[0]) {
+        if (s1[0] == s2[0])
+            if (XMEMCMP(s1, s2, s2_len) == 0)
+                return (char*)s1;
+        s1++;
+        n--;
+    }
+
+    return NULL;
+}
+
+
+CYASSL_CTX* CyaSSL_CTX_new(CYASSL_METHOD* method)
+{
+    CYASSL_CTX* ctx = NULL;
+
+    CYASSL_ENTER("CYASSL_CTX_new");
+
+    if (method == NULL)
+        return ctx;
+
+    ctx = (CYASSL_CTX*) XMALLOC(sizeof(CYASSL_CTX), 0, DYNAMIC_TYPE_CTX);
+    if (ctx) {
+        if (InitSSL_Ctx(ctx, method) < 0) {
+            CYASSL_MSG("Init CTX failed");
+            CyaSSL_CTX_free(ctx);
+            ctx = NULL;
+        }
+    }
+
+    CYASSL_LEAVE("CYASSL_CTX_new", 0);
+    return ctx;
+}
+
+
+void CyaSSL_CTX_free(CYASSL_CTX* ctx)
+{
+    CYASSL_ENTER("SSL_CTX_free");
+    if (ctx)
+        FreeSSL_Ctx(ctx);
+    CYASSL_LEAVE("SSL_CTX_free", 0);
+}
+
+
+CYASSL* CyaSSL_new(CYASSL_CTX* ctx)
+{
+    CYASSL* ssl = NULL;
+
+    CYASSL_ENTER("SSL_new");
+
+    if (ctx == NULL)
+        return ssl;
+
+    ssl = (CYASSL*) XMALLOC(sizeof(CYASSL), ctx->heap,DYNAMIC_TYPE_SSL);
+    if (ssl)
+        if (InitSSL(ssl, ctx) < 0) {
+            FreeSSL(ssl);
+            ssl = 0;
+        }
+
+    CYASSL_LEAVE("SSL_new", 0);
+    return ssl;
+}
+
+
+void CyaSSL_free(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_free");
+    if (ssl)
+        FreeSSL(ssl);
+    CYASSL_LEAVE("SSL_free", 0);
+}
+
+
+int CyaSSL_set_fd(CYASSL* ssl, int fd)
+{
+    CYASSL_ENTER("SSL_set_fd");
+    ssl->rfd = fd;      /* not used directly to allow IO callbacks */
+    ssl->wfd = fd;
+
+    ssl->IOCB_ReadCtx  = &ssl->rfd;
+    ssl->IOCB_WriteCtx = &ssl->wfd;
+
+    CYASSL_LEAVE("SSL_set_fd", SSL_SUCCESS);
+    return SSL_SUCCESS;
+}
+
+
+int CyaSSL_get_fd(const CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_get_fd");
+    CYASSL_LEAVE("SSL_get_fd", ssl->rfd);
+    return ssl->rfd;
+}
+
+
+int CyaSSL_negotiate(CYASSL* ssl)
+{
+    int err = SSL_FATAL_ERROR;
+
+    CYASSL_ENTER("CyaSSL_negotiate");
+#ifndef NO_CYASSL_SERVER
+    if (ssl->options.side == SERVER_END)
+        err = CyaSSL_accept(ssl);
+#endif
+
+#ifndef NO_CYASSL_CLIENT
+    if (ssl->options.side == CLIENT_END)
+        err = CyaSSL_connect(ssl);
+#endif
+
+    CYASSL_LEAVE("CyaSSL_negotiate", err);
+
+    if (err == SSL_SUCCESS)
+        return 0;
+    else
+        return err;
+}
+
+
+/* server Diffie-Hellman parameters */
+int CyaSSL_SetTmpDH(CYASSL* ssl, const unsigned char* p, int pSz,
+                    const unsigned char* g, int gSz)
+{
+    byte havePSK = 0;
+
+    CYASSL_ENTER("CyaSSL_SetTmpDH");
+    if (ssl == NULL || p == NULL || g == NULL) return BAD_FUNC_ARG;
+
+    if (ssl->options.side != SERVER_END)
+        return SIDE_ERROR;
+
+    if (ssl->buffers.serverDH_P.buffer && ssl->buffers.weOwnDH)
+        XFREE(ssl->buffers.serverDH_P.buffer, ssl->ctx->heap, DYNAMIC_TYPE_DH);
+    if (ssl->buffers.serverDH_G.buffer && ssl->buffers.weOwnDH)
+        XFREE(ssl->buffers.serverDH_G.buffer, ssl->ctx->heap, DYNAMIC_TYPE_DH);
+
+    ssl->buffers.weOwnDH = 1;  /* SSL owns now */
+    ssl->buffers.serverDH_P.buffer = (byte*)XMALLOC(pSz, ssl->ctx->heap,
+                                                    DYNAMIC_TYPE_DH);
+    if (ssl->buffers.serverDH_P.buffer == NULL)
+        return MEMORY_E;
+
+    ssl->buffers.serverDH_G.buffer = (byte*)XMALLOC(gSz, ssl->ctx->heap,
+                                                    DYNAMIC_TYPE_DH);
+    if (ssl->buffers.serverDH_G.buffer == NULL) {
+        XFREE(ssl->buffers.serverDH_P.buffer, ssl->ctx->heap, DYNAMIC_TYPE_DH);
+        return MEMORY_E;
+    }
+
+    ssl->buffers.serverDH_P.length = pSz;
+    ssl->buffers.serverDH_G.length = gSz;
+
+    XMEMCPY(ssl->buffers.serverDH_P.buffer, p, pSz);
+    XMEMCPY(ssl->buffers.serverDH_G.buffer, g, gSz);
+
+    ssl->options.haveDH = 1;
+    #ifndef NO_PSK
+        havePSK = ssl->options.havePSK;
+    #endif
+    InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH,
+               havePSK, ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+               ssl->options.haveStaticECC, ssl->options.side);
+
+    CYASSL_LEAVE("CyaSSL_SetTmpDH", 0);
+    return 0;
+}
+
+
+int CyaSSL_write(CYASSL* ssl, const void* data, int sz)
+{
+    int ret;
+
+    CYASSL_ENTER("SSL_write()");
+
+#ifdef HAVE_ERRNO_H 
+    errno = 0;
+#endif
+
+    ret = SendData(ssl, data, sz);
+
+    CYASSL_LEAVE("SSL_write()", ret);
+
+    if (ret < 0)
+        return SSL_FATAL_ERROR;
+    else
+        return ret;
+}
+
+
+int CyaSSL_read(CYASSL* ssl, void* data, int sz)
+{
+    int ret; 
+
+    CYASSL_ENTER("SSL_read()");
+
+#ifdef HAVE_ERRNO_H 
+        errno = 0;
+#endif
+
+    ret = ReceiveData(ssl, (byte*)data, min(sz, OUTPUT_RECORD_SIZE));
+
+    CYASSL_LEAVE("SSL_read()", ret);
+
+    if (ret < 0)
+        return SSL_FATAL_ERROR;
+    else
+        return ret;
+}
+
+
+int CyaSSL_shutdown(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_shutdown()");
+
+    if (ssl->options.quietShutdown) {
+        CYASSL_MSG("quiet shutdown, no close notify sent"); 
+        return 0;
+    }
+
+    /* try to send close notify, not an error if can't */
+    if (!ssl->options.isClosed && !ssl->options.connReset &&
+                                  !ssl->options.sentNotify) {
+        ssl->error = SendAlert(ssl, alert_warning, close_notify);
+        if (ssl->error < 0) {
+            CYASSL_ERROR(ssl->error);
+            return SSL_FATAL_ERROR;
+        }
+        ssl->options.sentNotify = 1;  /* don't send close_notify twice */
+    }
+
+    CYASSL_LEAVE("SSL_shutdown()", ssl->error);
+
+    ssl->error = SSL_ERROR_SYSCALL;   /* simulate OpenSSL behavior */
+
+    return 0;
+}
+
+
+int CyaSSL_get_error(CYASSL* ssl, int ret)
+{
+    CYASSL_ENTER("SSL_get_error");
+    CYASSL_LEAVE("SSL_get_error", ssl->error);
+    if (ret > 0)
+        return SSL_ERROR_NONE;
+
+    if (ssl->error == WANT_READ)
+        return SSL_ERROR_WANT_READ;         /* convert to OpenSSL type */
+    else if (ssl->error == WANT_WRITE)
+        return SSL_ERROR_WANT_WRITE;        /* convert to OpenSSL type */
+    else if (ssl->error == ZERO_RETURN) 
+        return SSL_ERROR_ZERO_RETURN;       /* convert to OpenSSL type */
+    return ssl->error;
+}
+
+
+int CyaSSL_want_read(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_want_read");
+    if (ssl->error == WANT_READ)
+        return 1;
+
+    return 0;
+}
+
+
+int CyaSSL_want_write(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_want_write");
+    if (ssl->error == WANT_WRITE)
+        return 1;
+
+    return 0;
+}
+
+
+char* CyaSSL_ERR_error_string(unsigned long errNumber, char* data)
+{
+    static const char* msg = "Please supply a buffer for error string";
+
+    CYASSL_ENTER("ERR_error_string");
+    if (data) {
+        SetErrorString(errNumber, data);
+        return data;
+    }
+
+    return (char*)msg;
+}
+
+
+void CyaSSL_ERR_error_string_n(unsigned long e, char* buf, unsigned long len)
+{
+    CYASSL_ENTER("CyaSSL_ERR_error_string_n");
+    if (len) CyaSSL_ERR_error_string(e, buf);
+}
+
+
+CYASSL_CERT_MANAGER* CyaSSL_CertManagerNew(void)
+{
+    CYASSL_CERT_MANAGER* cm = NULL;
+
+    CYASSL_ENTER("CyaSSL_CertManagerNew");
+
+    cm = (CYASSL_CERT_MANAGER*) XMALLOC(sizeof(CYASSL_CERT_MANAGER), 0,
+                                        DYNAMIC_TYPE_CERT_MANAGER);
+    if (cm) {
+        cm->caList          = NULL;
+        cm->heap            = NULL;
+        cm->caCacheCallback = NULL;
+        cm->crl             = NULL;
+        cm->crlEnabled      = 0;
+        cm->crlCheckAll     = 0;
+        cm->cbMissingCRL    = NULL;
+
+        if (InitMutex(&cm->caLock) != 0) {
+            CYASSL_MSG("Bad mutex init");
+            CyaSSL_CertManagerFree(cm);
+            return NULL;
+        }
+    }
+
+    return cm;
+}
+
+
+void CyaSSL_CertManagerFree(CYASSL_CERT_MANAGER* cm)
+{
+    CYASSL_ENTER("CyaSSL_CertManagerFree");
+
+    if (cm) {
+        #ifdef HAVE_CRL
+            if (cm->crl) 
+                FreeCRL(cm->crl);
+        #endif
+        FreeSigners(cm->caList, NULL);
+        FreeMutex(&cm->caLock);
+        XFREE(cm, NULL, DYNAMIC_TYPE_CERT_MANAGER);
+    }
+
+}
+
+
+
+
+#ifndef NO_FILESYSTEM
+
+void CyaSSL_ERR_print_errors_fp(FILE* fp, int err)
+{
+    char data[MAX_ERROR_SZ + 1];
+
+    CYASSL_ENTER("CyaSSL_ERR_print_errors_fp");
+    SetErrorString(err, data);
+    fprintf(fp, "%s", data);
+}
+
+#endif
+
+
+int CyaSSL_pending(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_pending");
+    return ssl->buffers.clearOutputBuffer.length;
+}
+
+
+/* trun on handshake group messages for context */
+int CyaSSL_CTX_set_group_messages(CYASSL_CTX* ctx)
+{
+    if (ctx == NULL)
+       return BAD_FUNC_ARG;
+
+    ctx->groupMessages = 1;
+
+    return SSL_SUCCESS;
+}
+
+
+#ifndef NO_CYASSL_CLIENT
+/* connect enough to get peer cert chain */
+int CyaSSL_connect_cert(CYASSL* ssl)
+{
+    int  ret;
+
+    if (ssl == NULL)
+        return SSL_FAILURE;
+
+    ssl->options.certOnly = 1;
+    ret = CyaSSL_connect(ssl);
+    ssl->options.certOnly   = 0;
+
+    return ret;
+}
+#endif
+
+
+/* trun on handshake group messages for ssl object */
+int CyaSSL_set_group_messages(CYASSL* ssl)
+{
+    if (ssl == NULL)
+       return BAD_FUNC_ARG;
+
+    ssl->options.groupMessages = 1;
+
+    return SSL_SUCCESS;
+}
+
+
+int CyaSSL_SetVersion(CYASSL* ssl, int version)
+{
+    byte havePSK = 0;
+
+    CYASSL_ENTER("CyaSSL_SetVersion");
+
+    if (ssl == NULL) {
+        CYASSL_MSG("Bad function argument");
+        return BAD_FUNC_ARG;
+    }
+
+    switch (version) {
+        case CYASSL_SSLV3:
+            ssl->version = MakeSSLv3();
+            break;
+
+#ifndef NO_TLS
+        case CYASSL_TLSV1:
+            ssl->version = MakeTLSv1();
+            break;
+
+        case CYASSL_TLSV1_1:
+            ssl->version = MakeTLSv1_1();
+            break;
+
+        case CYASSL_TLSV1_2:
+            ssl->version = MakeTLSv1_2();
+            break;
+#endif
+
+        default:
+            CYASSL_MSG("Bad function argument");
+            return BAD_FUNC_ARG;
+    }
+
+    #ifndef NO_PSK
+        havePSK = ssl->options.havePSK;
+    #endif
+
+    InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, havePSK,
+                ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                ssl->options.haveStaticECC, ssl->options.side);
+
+    return SSL_SUCCESS;
+}
+
+
+/* does CA already exist on signer list */
+int AlreadySigner(CYASSL_CERT_MANAGER* cm, byte* hash)
+{
+    Signer* signers;
+    int     ret = 0;
+
+    if (LockMutex(&cm->caLock) != 0)
+        return  ret;
+    signers = cm->caList;
+    while (signers) {
+        if (XMEMCMP(hash, signers->hash, SHA_DIGEST_SIZE) == 0) {
+            ret = 1;
+            break;
+        }
+        signers = signers->next;
+    }
+    UnLockMutex(&cm->caLock);
+
+    return ret;
+}
+
+
+/* return CA if found, otherwise NULL */
+Signer* GetCA(void* vp, byte* hash)
+{
+    CYASSL_CERT_MANAGER* cm = (CYASSL_CERT_MANAGER*)vp;
+    Signer* ret = NULL;
+    Signer* signers;
+
+    if (cm == NULL)
+        return NULL;
+
+    signers = cm->caList;
+
+    if (LockMutex(&cm->caLock) != 0)
+        return ret;
+    while (signers) {
+        if (XMEMCMP(hash, signers->hash, SHA_DIGEST_SIZE) == 0) {
+            ret = signers;
+            break;
+        }
+        signers = signers->next;
+    }
+    UnLockMutex(&cm->caLock);
+
+    return ret;
+}
+
+
+/* owns der, internal now uses too */
+/* type flag ids from user or from chain received during verify
+   don't allow chain ones to be added w/o isCA extension */
+int AddCA(CYASSL_CERT_MANAGER* cm, buffer der, int type, int verify)
+{
+    int         ret;
+    DecodedCert cert;
+    Signer*     signer = 0;
+
+    CYASSL_MSG("Adding a CA");
+    InitDecodedCert(&cert, der.buffer, der.length, cm->heap);
+    ret = ParseCert(&cert, CA_TYPE, verify, cm);
+    CYASSL_MSG("    Parsed new CA");
+
+    if (ret == 0 && cert.isCA == 0 && type != CYASSL_USER_CA) {
+        CYASSL_MSG("    Can't add as CA if not actually one");
+        ret = NOT_CA_ERROR;
+    }
+    else if (ret == 0 && AlreadySigner(cm, cert.subjectHash)) {
+        CYASSL_MSG("    Already have this CA, not adding again");
+        (void)ret;
+    } 
+    else if (ret == 0) {
+        /* take over signer parts */
+        signer = MakeSigner(cm->heap);
+        if (!signer)
+            ret = MEMORY_ERROR;
+        else {
+            signer->keyOID     = cert.keyOID;
+            signer->publicKey  = cert.publicKey;
+            signer->pubKeySize = cert.pubKeySize;
+            signer->name = cert.subjectCN;
+            XMEMCPY(signer->hash, cert.subjectHash, SHA_DIGEST_SIZE);
+            signer->next = NULL;   /* in case lock fails */
+
+            cert.publicKey = 0;  /* don't free here */
+            cert.subjectCN = 0;
+
+            if (LockMutex(&cm->caLock) == 0) {
+                signer->next = cm->caList;
+                cm->caList  = signer;   /* takes ownership */
+                UnLockMutex(&cm->caLock);
+                if (cm->caCacheCallback)
+                    cm->caCacheCallback(der.buffer, (int)der.length, type);
+            }
+            else {
+                CYASSL_MSG("    CA Mutex Lock failed");
+                ret = BAD_MUTEX_ERROR;
+                FreeSigners(signer, cm->heap);
+            }
+        }
+    }
+
+    CYASSL_MSG("    Freeing Parsed CA");
+    FreeDecodedCert(&cert);
+    CYASSL_MSG("    Freeing der CA");
+    XFREE(der.buffer, ctx->heap, DYNAMIC_TYPE_CA);
+    CYASSL_MSG("        OK Freeing der CA");
+
+    CYASSL_LEAVE("AddCA", ret);
+    if (ret == 0) return SSL_SUCCESS;
+    return ret;
+}
+
+
+#ifndef NO_SESSION_CACHE
+
+    /* basic config gives a cache with 33 sessions, adequate for clients and
+       embedded servers
+
+       MEDIUM_SESSION_CACHE allows 1055 sessions, adequate for servers that
+       aren't under heavy load, basically allows 200 new sessions per minute
+
+       BIG_SESSION_CACHE yields 20,0027 sessions
+
+       HUGE_SESSION_CACHE yields 65,791 sessions, for servers under heavy load,
+       allows over 13,000 new sessions per minute or over 200 new sessions per
+       second
+
+       SMALL_SESSION_CACHE only stores 6 sessions, good for embedded clients
+       or systems where the default of nearly 3kB is too much RAM, this define
+       uses less than 500 bytes RAM
+    */
+    #ifdef HUGE_SESSION_CACHE
+        #define SESSIONS_PER_ROW 11
+        #define SESSION_ROWS 5981
+    #elif defined(BIG_SESSION_CACHE)
+        #define SESSIONS_PER_ROW 7
+        #define SESSION_ROWS 2861
+    #elif defined(MEDIUM_SESSION_CACHE)
+        #define SESSIONS_PER_ROW 5
+        #define SESSION_ROWS 211
+    #elif defined(SMALL_SESSION_CACHE)
+        #define SESSIONS_PER_ROW 2
+        #define SESSION_ROWS 3 
+    #else
+        #define SESSIONS_PER_ROW 3
+        #define SESSION_ROWS 11
+    #endif
+
+    typedef struct SessionRow {
+        int nextIdx;                           /* where to place next one   */
+        int totalCount;                        /* sessions ever on this row */
+        CYASSL_SESSION Sessions[SESSIONS_PER_ROW];
+    } SessionRow;
+
+    static SessionRow SessionCache[SESSION_ROWS];
+
+    static CyaSSL_Mutex session_mutex;   /* SessionCache mutex */
+
+#endif /* NO_SESSION_CACHE */
+
+
+    /* Remove PEM header/footer, convert to ASN1, store any encrypted data 
+       info->consumed tracks of PEM bytes consumed in case multiple parts */
+    int PemToDer(const unsigned char* buff, long sz, int type,
+                      buffer* der, void* heap, EncryptedInfo* info, int* eccKey)
+    {
+        char  header[PEM_LINE_LEN];
+        char  footer[PEM_LINE_LEN];
+        char* headerEnd;
+        char* footerEnd;
+        char* consumedEnd;
+        long  neededSz;
+        int   pkcs8    = 0;
+        int   pkcs8Enc = 0;
+        int   dynamicType = 0;
+
+        (void)heap;
+        (void)dynamicType;
+        (void)pkcs8Enc;
+
+        if (type == CERT_TYPE || type == CA_TYPE)  {
+            XSTRNCPY(header, "-----BEGIN CERTIFICATE-----", sizeof(header));
+            XSTRNCPY(footer, "-----END CERTIFICATE-----", sizeof(footer));
+            dynamicType = (type == CA_TYPE) ? DYNAMIC_TYPE_CA :
+                                              DYNAMIC_TYPE_CERT;
+        } else if (type == DH_PARAM_TYPE) {
+            XSTRNCPY(header, "-----BEGIN DH PARAMETERS-----", sizeof(header));
+            XSTRNCPY(footer, "-----END DH PARAMETERS-----", sizeof(footer));
+            dynamicType = DYNAMIC_TYPE_KEY;
+        } else if (type == CRL_TYPE) {
+            XSTRNCPY(header, "-----BEGIN X509 CRL-----", sizeof(header));
+            XSTRNCPY(footer, "-----END X509 CRL-----", sizeof(footer));
+            dynamicType = DYNAMIC_TYPE_CRL;
+        } else {
+            XSTRNCPY(header, "-----BEGIN RSA PRIVATE KEY-----", sizeof(header));
+            XSTRNCPY(footer, "-----END RSA PRIVATE KEY-----", sizeof(footer));
+            dynamicType = DYNAMIC_TYPE_KEY;
+        }
+
+        /* find header */
+        headerEnd = XSTRNSTR((char*)buff, header, sz);
+        if (!headerEnd && type == PRIVATEKEY_TYPE) {  /* may be pkcs8 */
+            XSTRNCPY(header, "-----BEGIN PRIVATE KEY-----", sizeof(header));
+            XSTRNCPY(footer, "-----END PRIVATE KEY-----", sizeof(footer));
+        
+            headerEnd = XSTRNSTR((char*)buff, header, sz);
+            if (headerEnd)
+                pkcs8 = 1;
+            else {
+                XSTRNCPY(header, "-----BEGIN ENCRYPTED PRIVATE KEY-----",
+                        sizeof(header));
+                XSTRNCPY(footer, "-----END ENCRYPTED PRIVATE KEY-----",
+                        sizeof(footer));
+
+                headerEnd = XSTRNSTR((char*)buff, header, sz);
+                if (headerEnd)
+                    pkcs8Enc = 1;
+            }
+        }
+        if (!headerEnd && type == PRIVATEKEY_TYPE) {  /* may be ecc */
+            XSTRNCPY(header, "-----BEGIN EC PRIVATE KEY-----", sizeof(header));
+            XSTRNCPY(footer, "-----END EC PRIVATE KEY-----", sizeof(footer));
+        
+            headerEnd = XSTRNSTR((char*)buff, header, sz);
+            if (headerEnd)
+                *eccKey = 1;
+        }
+        if (!headerEnd && type == PRIVATEKEY_TYPE) {  /* may be dsa */
+            XSTRNCPY(header, "-----BEGIN DSA PRIVATE KEY-----", sizeof(header));
+            XSTRNCPY(footer, "-----END DSA PRIVATE KEY-----", sizeof(footer));
+        
+            headerEnd = XSTRNSTR((char*)buff, header, sz);
+        }
+        if (!headerEnd)
+            return SSL_BAD_FILE;
+        headerEnd += XSTRLEN(header);
+
+        /* get next line */
+        if (headerEnd[0] == '\n')
+            headerEnd++;
+        else if (headerEnd[1] == '\n')
+            headerEnd += 2;
+        else
+            return SSL_BAD_FILE;
+
+#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
+    {
+        /* remove encrypted header if there */
+        char encHeader[] = "Proc-Type";
+        char* line = XSTRNSTR((char*)buff, encHeader, PEM_LINE_LEN);
+        if (line) {
+            char* newline;
+            char* finish;
+            char* start  = XSTRNSTR(line, "DES", PEM_LINE_LEN);
+    
+            if (!start)
+                start = XSTRNSTR(line, "AES", PEM_LINE_LEN);
+            
+            if (!start) return SSL_BAD_FILE;
+            if (!info)  return SSL_BAD_FILE;
+            
+            finish = XSTRNSTR(start, ",", PEM_LINE_LEN);
+
+            if (start && finish && (start < finish)) {
+                newline = XSTRNSTR(finish, "\r", PEM_LINE_LEN);
+
+                XMEMCPY(info->name, start, finish - start);
+                info->name[finish - start] = 0;
+                XMEMCPY(info->iv, finish + 1, sizeof(info->iv));
+
+                if (!newline) newline = XSTRNSTR(finish, "\n", PEM_LINE_LEN);
+                if (newline && (newline > finish)) {
+                    info->ivSz = (word32)(newline - (finish + 1));
+                    info->set = 1;
+                }
+                else
+                    return SSL_BAD_FILE;
+            }
+            else
+                return SSL_BAD_FILE;
+
+            /* eat blank line */
+            while (*newline == '\r' || *newline == '\n')
+                newline++;
+            headerEnd = newline;
+        }
+    }
+#endif /* OPENSSL_EXTRA || HAVE_WEBSERVER */
+
+        /* find footer */
+        footerEnd = XSTRNSTR((char*)buff, footer, sz);
+        if (!footerEnd) return SSL_BAD_FILE;
+
+        consumedEnd = footerEnd + XSTRLEN(footer);
+
+        /* get next line */
+        if (consumedEnd[0] == '\n')
+            consumedEnd++;
+        else if (consumedEnd[1] == '\n')
+            consumedEnd += 2;
+        else
+            return SSL_BAD_FILE;
+
+        if (info)
+            info->consumed = (long)(consumedEnd - (char*)buff);
+
+        /* set up der buffer */
+        neededSz = (long)(footerEnd - headerEnd);
+        if (neededSz > sz || neededSz < 0) return SSL_BAD_FILE;
+        der->buffer = (byte*) XMALLOC(neededSz, heap, dynamicType);
+        if (!der->buffer) return MEMORY_ERROR;
+        der->length = neededSz;
+
+        if (Base64_Decode((byte*)headerEnd, neededSz, der->buffer,
+                          &der->length) < 0)
+            return SSL_BAD_FILE;
+
+        if (pkcs8)
+            return ToTraditional(der->buffer, der->length);
+
+#ifdef OPENSSL_EXTRA
+         if (pkcs8Enc) {
+            int  passwordSz;
+            char password[80];
+
+            if (!info->ctx || !info->ctx->passwd_cb)
+                return SSL_BAD_FILE;  /* no callback error */
+            passwordSz = info->ctx->passwd_cb(password, sizeof(password), 0,
+                                              info->ctx->userdata);
+            return ToTraditionalEnc(der->buffer, der->length, password,
+                                    passwordSz);
+         }
+#endif
+
+        return 0;
+    }
+
+
+    /* process the buffer buff, legnth sz, into ctx of format and type
+       used tracks bytes consumed, userChain specifies a user cert chain
+       to pass during the handshake */
+    static int ProcessBuffer(CYASSL_CTX* ctx, const unsigned char* buff,
+                             long sz, int format, int type, CYASSL* ssl,
+                             long* used, int userChain)
+    {
+        EncryptedInfo info;
+        buffer        der;        /* holds DER or RAW (for NTRU) */
+        int           dynamicType = 0;
+        int           eccKey = 0;
+
+        info.set      = 0;
+        info.ctx      = ctx;
+        info.consumed = 0;
+        der.buffer    = 0;
+
+        (void)dynamicType;
+
+        if (used)
+            *used = sz;     /* used bytes default to sz, PEM chain may shorten*/
+
+        if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM 
+                                        && format != SSL_FILETYPE_RAW)
+            return SSL_BAD_FILETYPE;
+
+        if (type == CA_TYPE)
+            dynamicType = DYNAMIC_TYPE_CA;
+        else if (type == CERT_TYPE)
+            dynamicType = DYNAMIC_TYPE_CERT;
+        else
+            dynamicType = DYNAMIC_TYPE_KEY;
+
+        if (format == SSL_FILETYPE_PEM) {
+            int ret = PemToDer(buff, sz, type, &der, ctx->heap, &info, &eccKey);
+            if (ret < 0) {
+                XFREE(der.buffer, ctx->heap, dynamicType);
+                return ret;
+            }
+            if (used)
+                *used = info.consumed;
+            /* we may have a user cert chain, try to consume */
+            if (userChain && type == CERT_TYPE && info.consumed < sz) {
+                byte   staticBuffer[FILE_BUFFER_SIZE];  /* tmp chain buffer */
+                byte*  chainBuffer = staticBuffer;
+                int    dynamicBuffer = 0;
+                word32 bufferSz = sizeof(staticBuffer);
+                long   consumed = info.consumed;
+                word32 idx = 0;
+
+                if ( (sz - consumed) > (int)bufferSz) {
+                    CYASSL_MSG("Growing Tmp Chain Buffer");
+                    bufferSz = sz - consumed;  /* will shrink to actual size */
+                    chainBuffer = (byte*)XMALLOC(bufferSz, ctx->heap,
+                                                 DYNAMIC_FILE_TYPE);
+                    if (chainBuffer == NULL) {
+                        XFREE(der.buffer, ctx->heap, dynamicType);
+                        return MEMORY_E;
+                    }
+                    dynamicBuffer = 1;
+                }
+
+                CYASSL_MSG("Processing Cert Chain");
+                while (consumed < sz) {
+                    long   left;
+                    buffer part;
+                    info.consumed = 0;
+                    part.buffer = 0;
+
+                    ret = PemToDer(buff + consumed, sz - consumed, type, &part,
+                                   ctx->heap, &info, &eccKey);
+                    if (ret == 0) {
+                        if ( (idx + part.length) > bufferSz) {
+                            CYASSL_MSG("   Cert Chain bigger than buffer");
+                            ret = BUFFER_E;
+                        }
+                        else {
+                            c32to24(part.length, &chainBuffer[idx]);
+                            idx += CERT_HEADER_SZ;
+                            XMEMCPY(&chainBuffer[idx], part.buffer,part.length);
+                            idx += part.length;
+                            consumed  += info.consumed;
+                            if (used)
+                                *used += info.consumed;
+                        }
+                    }
+
+                    XFREE(part.buffer, ctx->heap, dynamicType);
+                    if (ret < 0) {
+                        CYASSL_MSG("   Error in Cert in Chain");
+                        XFREE(der.buffer, ctx->heap, dynamicType);
+                        return ret;
+                    }
+                    CYASSL_MSG("   Consumed another Cert in Chain");
+
+                    left = sz - consumed;
+                    if (left > 0 && left < CERT_MIN_SIZE) {
+                        CYASSL_MSG("   Non Cert at end of file");
+                        break;
+                    }
+                }
+                CYASSL_MSG("Finished Processing Cert Chain");
+                ctx->certChain.buffer = (byte*)XMALLOC(idx, ctx->heap,
+                                                       dynamicType);
+                if (ctx->certChain.buffer) {
+                    ctx->certChain.length = idx;
+                    XMEMCPY(ctx->certChain.buffer, chainBuffer, idx);
+                }
+                if (dynamicBuffer)
+                    XFREE(chainBuffer, ctx->heap, DYNAMIC_FILE_TYPE);
+                if (ctx->certChain.buffer == NULL) {
+                    XFREE(der.buffer, ctx->heap, dynamicType);
+                    return MEMORY_E;
+                }
+            }
+        }
+        else {  /* ASN1 (DER) or RAW (NTRU) */
+            der.buffer = (byte*) XMALLOC(sz, ctx->heap, dynamicType);
+            if (!der.buffer) return MEMORY_ERROR;
+            XMEMCPY(der.buffer, buff, sz);
+            der.length = sz;
+        }
+
+#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
+        if (info.set) {
+            /* decrypt */
+            char password[80];
+            int  passwordSz;
+            int  ret;
+
+            byte key[AES_256_KEY_SIZE];
+            byte  iv[AES_IV_SIZE];
+
+            if (!ctx->passwd_cb) {
+                XFREE(der.buffer, ctx->heap, dynamicType);
+                return NO_PASSWORD;
+            }
+
+            /* use file's salt for key derivation, hex decode first */
+            if (Base16_Decode(info.iv, info.ivSz, info.iv, &info.ivSz) != 0) {
+                XFREE(der.buffer, ctx->heap, dynamicType);
+                return ASN_INPUT_E;
+            }
+
+            passwordSz = ctx->passwd_cb(password, sizeof(password), 0,
+                                    ctx->userdata);
+            if ( (ret = EVP_BytesToKey(info.name, "MD5", info.iv,
+                            (byte*)password, passwordSz, 1, key, iv)) <= 0) {
+                XFREE(der.buffer, ctx->heap, dynamicType);
+                return ret;
+            }
+
+            if (XSTRNCMP(info.name, "DES-CBC", 7) == 0) {
+                Des enc;
+                Des_SetKey(&enc, key, info.iv, DES_DECRYPTION);
+                Des_CbcDecrypt(&enc, der.buffer, der.buffer, der.length);
+            }
+            else if (XSTRNCMP(info.name, "DES-EDE3-CBC", 13) == 0) {
+                Des3 enc;
+                Des3_SetKey(&enc, key, info.iv, DES_DECRYPTION);
+                Des3_CbcDecrypt(&enc, der.buffer, der.buffer, der.length);
+            }
+            else if (XSTRNCMP(info.name, "AES-128-CBC", 13) == 0) {
+                Aes enc;
+                AesSetKey(&enc, key, AES_128_KEY_SIZE, info.iv, AES_DECRYPTION);
+                AesCbcDecrypt(&enc, der.buffer, der.buffer, der.length);
+            }
+            else if (XSTRNCMP(info.name, "AES-192-CBC", 13) == 0) {
+                Aes enc;
+                AesSetKey(&enc, key, AES_192_KEY_SIZE, info.iv, AES_DECRYPTION);
+                AesCbcDecrypt(&enc, der.buffer, der.buffer, der.length);
+            }
+            else if (XSTRNCMP(info.name, "AES-256-CBC", 13) == 0) {
+                Aes enc;
+                AesSetKey(&enc, key, AES_256_KEY_SIZE, info.iv, AES_DECRYPTION);
+                AesCbcDecrypt(&enc, der.buffer, der.buffer, der.length);
+            }
+            else { 
+                XFREE(der.buffer, ctx->heap, dynamicType);
+                return SSL_BAD_FILE;
+            }
+        }
+#endif /* OPENSSL_EXTRA || HAVE_WEBSERVER */
+
+        if (type == CA_TYPE)
+            return AddCA(ctx->cm, der, CYASSL_USER_CA, ctx->verifyPeer);
+                                                          /* takes der over */
+        else if (type == CERT_TYPE) {
+            if (ssl) {
+                if (ssl->buffers.weOwnCert && ssl->buffers.certificate.buffer)
+                    XFREE(ssl->buffers.certificate.buffer, ctx->heap,
+                          dynamicType);
+                ssl->buffers.certificate = der;
+                ssl->buffers.weOwnCert = 1;
+            }
+            else {
+                if (ctx->certificate.buffer)
+                    XFREE(ctx->certificate.buffer, ctx->heap, dynamicType);
+                ctx->certificate = der;     /* takes der over */
+            }
+        }
+        else if (type == PRIVATEKEY_TYPE) {
+            if (ssl) {
+                if (ssl->buffers.weOwnKey && ssl->buffers.key.buffer)
+                    XFREE(ssl->buffers.key.buffer, ctx->heap, dynamicType);
+                ssl->buffers.key = der;
+                ssl->buffers.weOwnKey = 1;
+            }
+            else {
+                if (ctx->privateKey.buffer)
+                    XFREE(ctx->privateKey.buffer, ctx->heap, dynamicType);
+                ctx->privateKey = der;      /* takes der over */
+            }
+        }
+        else {
+            XFREE(der.buffer, ctx->heap, dynamicType);
+            return SSL_BAD_CERTTYPE;
+        }
+
+        if (type == PRIVATEKEY_TYPE && format != SSL_FILETYPE_RAW) {
+            if (!eccKey) { 
+                /* make sure RSA key can be used */
+                RsaKey key;
+                word32 idx = 0;
+        
+                InitRsaKey(&key, 0);
+                if (RsaPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
+#ifdef HAVE_ECC  
+                    /* could have DER ECC (or pkcs8 ecc), no easy way to tell */
+                    eccKey = 1;  /* so try it out */
+#endif
+                    if (!eccKey) {
+                        FreeRsaKey(&key);
+                        return SSL_BAD_FILE;
+                    }
+                }
+                FreeRsaKey(&key);
+            }
+#ifdef HAVE_ECC  
+            if (eccKey ) {
+                /* make sure ECC key can be used */
+                word32  idx = 0;
+                ecc_key key;
+
+                ecc_init(&key);
+                if (EccPrivateKeyDecode(der.buffer,&idx,&key,der.length) != 0) {
+                    ecc_free(&key);
+                    return SSL_BAD_FILE;
+                }
+                ecc_free(&key);
+                ctx->haveStaticECC = 1;
+                if (ssl)
+                    ssl->options.haveStaticECC = 1;
+            }
+#endif /* HAVE_ECC */
+        }
+        else if (type == CERT_TYPE) {
+            int         ret;
+            DecodedCert cert;
+
+            CYASSL_MSG("Checking cert signature type");
+            InitDecodedCert(&cert, der.buffer, der.length, ctx->heap);
+
+            if ((ret = DecodeToKey(&cert, 0)) < 0) {
+                CYASSL_MSG("Decode to key failed");
+                return SSL_BAD_FILE; 
+            }            
+            switch (cert.signatureOID) {
+                case CTC_SHAwECDSA:
+                case CTC_SHA256wECDSA:
+                case CTC_SHA384wECDSA:
+                case CTC_SHA512wECDSA:
+                    CYASSL_MSG("ECDSA cert signature");
+                    ctx->haveECDSAsig = 1;
+                    if (ssl)
+                        ssl->options.haveECDSAsig = 1;
+                    break;
+                default:
+                    CYASSL_MSG("Not ECDSA cert signature");
+                    break;
+            }
+
+            FreeDecodedCert(&cert);
+        }
+
+        return SSL_SUCCESS;
+    }
+
+
+
+
+/* CA PEM file for verification, may have multiple/chain certs to process */
+static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff,
+                            long sz, int format, int type, CYASSL* ssl)
+{
+    long used = 0;
+    int  ret  = 0;
+
+    CYASSL_MSG("Processing CA PEM file");
+    while (used < sz) {
+        long consumed = 0;
+        long left;
+
+        ret = ProcessBuffer(ctx, buff + used, sz - used, format, type, ssl,
+                            &consumed, 0);
+        if (ret < 0)
+            break;
+
+        CYASSL_MSG("   Processed a CA");
+        used += consumed;
+
+        left = sz - used;
+        if (left > 0 && left < CERT_MIN_SIZE) { /* non cert stuff at eof */
+            CYASSL_MSG("   Non CA cert at eof");
+            break;
+        }
+    }
+    return ret;
+}
+
+
+#ifndef NO_FILESYSTEM
+
+#ifndef MICRIUM
+    #define XFILE      FILE
+    #define XFOPEN     fopen 
+    #define XFSEEK     fseek
+    #define XFTELL     ftell
+    #define XREWIND    rewind
+    #define XFREAD     fread
+    #define XFCLOSE    fclose
+    #define XSEEK_END  SEEK_END
+#else
+    #include <fs.h>
+    #define XFILE      FS_FILE
+    #define XFOPEN     fs_fopen 
+    #define XFSEEK     fs_fseek
+    #define XFTELL     fs_ftell
+    #define XREWIND    fs_rewind
+    #define XFREAD     fs_fread
+    #define XFCLOSE    fs_fclose
+    #define XSEEK_END  FS_SEEK_END
+#endif
+
+
+/* process a file with name fname into ctx of format and type
+   userChain specifies a user certificate chain to pass during handshake */
+int ProcessFile(CYASSL_CTX* ctx, const char* fname, int format, int type,
+                CYASSL* ssl, int userChain, CYASSL_CRL* crl)
+{
+    byte   staticBuffer[FILE_BUFFER_SIZE];
+    byte*  myBuffer = staticBuffer;
+    int    dynamic = 0;
+    int    ret;
+    long   sz = 0;
+    XFILE* file = XFOPEN(fname, "rb"); 
+
+    (void)crl;
+
+    if (!file) return SSL_BAD_FILE;
+    XFSEEK(file, 0, XSEEK_END);
+    sz = XFTELL(file);
+    XREWIND(file);
+
+    if (sz > (long)sizeof(staticBuffer)) {
+        CYASSL_MSG("Getting dynamic buffer");
+        myBuffer = (byte*) XMALLOC(sz, ctx->heap, DYNAMIC_TYPE_FILE);
+        if (myBuffer == NULL) {
+            XFCLOSE(file);
+            return SSL_BAD_FILE;
+        }
+        dynamic = 1;
+    }
+
+    if ( (ret = XFREAD(myBuffer, sz, 1, file)) < 0)
+        ret = SSL_BAD_FILE;
+    else {
+        if (type == CA_TYPE && format == SSL_FILETYPE_PEM) 
+            ret = ProcessChainBuffer(ctx, myBuffer, sz, format, type, ssl);
+#ifdef HAVE_CRL
+        else if (type == CRL_TYPE)
+            ret = BufferLoadCRL(crl, myBuffer, sz, format);
+#endif
+        else
+            ret = ProcessBuffer(ctx, myBuffer, sz, format, type, ssl, NULL,
+                                userChain);
+    }
+
+    XFCLOSE(file);
+    if (dynamic) XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE);
+
+    return ret;
+}
+
+
+/* loads file then loads each file in path, no c_rehash */
+int CyaSSL_CTX_load_verify_locations(CYASSL_CTX* ctx, const char* file,
+                                     const char* path)
+{
+    int ret = SSL_SUCCESS;
+
+    CYASSL_ENTER("CyaSSL_CTX_load_verify_locations");
+    (void)path;
+
+    if (ctx == NULL || (file == NULL && path == NULL) )
+        return SSL_FAILURE;
+
+    if (file)
+        ret = ProcessFile(ctx, file, SSL_FILETYPE_PEM, CA_TYPE, NULL, 0, NULL);
+
+    if (ret == SSL_SUCCESS && path) {
+        /* try to load each regular file in path */
+    #ifdef USE_WINDOWS_API 
+        WIN32_FIND_DATAA FindFileData;
+        HANDLE hFind;
+        char   name[MAX_FILENAME_SZ];
+
+        XMEMSET(name, 0, sizeof(name));
+        XSTRNCPY(name, path, MAX_FILENAME_SZ - 4);
+        XSTRNCAT(name, "\\*", 3);
+
+        hFind = FindFirstFileA(name, &FindFileData);
+        if (hFind == INVALID_HANDLE_VALUE) {
+            CYASSL_MSG("FindFirstFile for path verify locations failed");
+            return BAD_PATH_ERROR;
+        }
+
+        do {
+            if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
+                XSTRNCPY(name, path, MAX_FILENAME_SZ/2 - 3);
+                XSTRNCAT(name, "\\", 2);
+                XSTRNCAT(name, FindFileData.cFileName, MAX_FILENAME_SZ/2);
+
+                ret = ProcessFile(ctx, name, SSL_FILETYPE_PEM, CA_TYPE, NULL,0,
+                                  NULL);
+            }
+        } while (ret == SSL_SUCCESS && FindNextFileA(hFind, &FindFileData));
+
+        FindClose(hFind);
+    #elif !defined(NO_CYASSL_DIR)
+        struct dirent* entry;
+        DIR*   dir = opendir(path);
+
+        if (dir == NULL) {
+            CYASSL_MSG("opendir path verify locations failed");
+            return BAD_PATH_ERROR;
+        }
+        while ( ret == SSL_SUCCESS && (entry = readdir(dir)) != NULL) {
+            if (entry->d_type & DT_REG) {
+                char name[MAX_FILENAME_SZ];
+
+                XMEMSET(name, 0, sizeof(name));
+                XSTRNCPY(name, path, MAX_FILENAME_SZ/2 - 2);
+                XSTRNCAT(name, "/", 1);
+                XSTRNCAT(name, entry->d_name, MAX_FILENAME_SZ/2);
+                
+                ret = ProcessFile(ctx, name, SSL_FILETYPE_PEM, CA_TYPE, NULL,0,
+                                  NULL);
+            }
+        }
+        closedir(dir);
+    #endif
+    }
+
+    return ret;
+}
+
+
+/* Verify the ceritficate, 1 for success, < 0 for error */
+int CyaSSL_CertManagerVerifyBuffer(CYASSL_CERT_MANAGER* cm, const byte* buff,
+                                   int sz, int format)
+{
+    int ret = 0;
+    int eccKey = 0;  /* not used */
+
+    DecodedCert cert;
+    buffer      der;
+
+    CYASSL_ENTER("CyaSSL_CertManagerVerifyBuffer");
+
+    der.buffer = NULL;
+
+    if (format == SSL_FILETYPE_PEM) { 
+        EncryptedInfo info;
+            
+        info.set      = 0;
+        info.ctx      = NULL;
+        info.consumed = 0;
+        ret = PemToDer(buff, sz, CERT_TYPE, &der, cm->heap, &info, &eccKey);
+        InitDecodedCert(&cert, der.buffer, der.length, cm->heap);
+    }
+    else
+        InitDecodedCert(&cert, (byte*)buff, sz, cm->heap);
+
+    if (ret == 0)
+        ret = ParseCertRelative(&cert, CERT_TYPE, 1, cm);
+#ifdef HAVE_CRL
+    if (ret == 0 && cm->crlEnabled)
+        ret = CheckCertCRL(cm->crl, &cert);
+#endif
+
+    FreeDecodedCert(&cert);
+    XFREE(der.buffer, cm->heap, DYNAMIC_TYPE_CERT);
+
+    return ret;
+}
+
+
+/* Verify the ceritficate, 1 for success, < 0 for error */
+int CyaSSL_CertManagerVerify(CYASSL_CERT_MANAGER* cm, const char* fname,
+                             int format)
+{
+    int    ret = SSL_FATAL_ERROR;
+    byte   staticBuffer[FILE_BUFFER_SIZE];
+    byte*  myBuffer = staticBuffer;
+    int    dynamic = 0;
+    long   sz = 0;
+    XFILE* file = XFOPEN(fname, "rb"); 
+
+    CYASSL_ENTER("CyaSSL_CertManagerVerify");
+
+    if (!file) return SSL_BAD_FILE;
+    XFSEEK(file, 0, XSEEK_END);
+    sz = XFTELL(file);
+    XREWIND(file);
+
+    if (sz > (long)sizeof(staticBuffer)) {
+        CYASSL_MSG("Getting dynamic buffer");
+        myBuffer = (byte*) XMALLOC(sz, cm->heap, DYNAMIC_TYPE_FILE);
+        if (myBuffer == NULL) {
+            XFCLOSE(file);
+            return SSL_BAD_FILE;
+        }
+        dynamic = 1;
+    }
+
+    if ( (ret = XFREAD(myBuffer, sz, 1, file)) < 0)
+        ret = SSL_BAD_FILE;
+    else 
+        ret = CyaSSL_CertManagerVerifyBuffer(cm, myBuffer, sz, format);
+
+    XFCLOSE(file);
+    if (dynamic) XFREE(myBuffer, cm->heap, DYNAMIC_TYPE_FILE);
+
+    if (ret == 0)
+        return SSL_SUCCESS;
+    return ret;
+}
+
+
+/* like load verify locations, 1 for success, < 0 for error */
+int CyaSSL_CertManagerLoadCA(CYASSL_CERT_MANAGER* cm, const char* file,
+                             const char* path)
+{
+    int ret = SSL_FATAL_ERROR;
+    CYASSL_CTX* tmp;
+
+    CYASSL_ENTER("CyaSSL_CertManagerLoadCA");
+
+    if (cm == NULL) {
+        CYASSL_MSG("No CertManager error");
+        return ret;
+    }
+    tmp = CyaSSL_CTX_new(CyaSSLv3_client_method());
+
+    if (tmp == NULL) {
+        CYASSL_MSG("CTX new failed");
+        return ret;
+    }
+
+    /* for tmp use */
+    CyaSSL_CertManagerFree(tmp->cm);
+    tmp->cm = cm;
+
+    ret = CyaSSL_CTX_load_verify_locations(tmp, file, path);
+
+    /* don't loose our good one */
+    tmp->cm = NULL;
+    CyaSSL_CTX_free(tmp);
+
+    return ret;
+}
+
+
+
+/* turn on CRL if off and compiled in, set options */
+int CyaSSL_CertManagerEnableCRL(CYASSL_CERT_MANAGER* cm, int options)
+{
+    int ret = SSL_SUCCESS;
+
+    (void)options;
+
+    CYASSL_ENTER("CyaSSL_CertManagerEnableCRL");
+    if (cm == NULL)
+        return BAD_FUNC_ARG;
+
+    #ifdef HAVE_CRL
+        if (cm->crl == NULL) {
+            cm->crl = (CYASSL_CRL*)XMALLOC(sizeof(CYASSL_CRL), cm->heap,
+                                           DYNAMIC_TYPE_CRL);
+            if (cm->crl == NULL)
+                return MEMORY_E;
+
+            if (InitCRL(cm->crl, cm) != 0) {
+                CYASSL_MSG("Init CRL failed");
+                FreeCRL(cm->crl);
+                cm->crl = NULL;
+                return SSL_FAILURE;
+            }
+        }
+        cm->crlEnabled = 1;
+        if (options & CYASSL_CRL_CHECKALL)
+            cm->crlCheckAll = 1;
+    #else
+        ret = NOT_COMPILED_IN;
+    #endif
+
+    return ret;
+}
+
+
+int CyaSSL_CertManagerDisableCRL(CYASSL_CERT_MANAGER* cm)
+{
+    CYASSL_ENTER("CyaSSL_CertManagerDisableCRL");
+    if (cm == NULL)
+        return BAD_FUNC_ARG;
+
+    cm->crlEnabled = 0;
+
+    return SSL_SUCCESS;
+}
+
+
+int CyaSSL_CTX_check_private_key(CYASSL_CTX* ctx)
+{
+    /* TODO: check private against public for RSA match */
+    (void)ctx; 
+    CYASSL_ENTER("SSL_CTX_check_private_key");
+    return SSL_SUCCESS;
+}
+
+
+#ifdef HAVE_CRL
+
+
+/* check CRL if enabled, SSL_SUCCESS  */
+int CyaSSL_CertManagerCheckCRL(CYASSL_CERT_MANAGER* cm, byte* der, int sz)
+{
+    int         ret;
+    DecodedCert cert;
+
+    CYASSL_ENTER("CyaSSL_CertManagerCheckCRL");
+
+    if (cm == NULL)
+        return BAD_FUNC_ARG;
+
+    if (cm->crlEnabled == 0)
+        return SSL_SUCCESS;
+
+    InitDecodedCert(&cert, der, sz, NULL);
+
+    ret = ParseCertRelative(&cert, CERT_TYPE, NO_VERIFY, cm);
+    if (ret != 0) {
+        CYASSL_MSG("ParseCert failed");
+        return ret;
+    }
+    else {
+        ret = CheckCertCRL(cm->crl, &cert);
+        if (ret != 0) {
+            CYASSL_MSG("CheckCertCRL failed");
+        }
+    }
+
+    FreeDecodedCert(&cert);
+
+    if (ret == 0)
+        return SSL_SUCCESS;  /* convert */
+
+    return ret;
+}
+
+
+int CyaSSL_CertManagerSetCRL_Cb(CYASSL_CERT_MANAGER* cm, CbMissingCRL cb)
+{
+    CYASSL_ENTER("CyaSSL_CertManagerSetCRL_Cb");
+    if (cm == NULL)
+        return BAD_FUNC_ARG;
+
+    cm->cbMissingCRL = cb;
+
+    return SSL_SUCCESS;
+}
+
+
+int CyaSSL_CertManagerLoadCRL(CYASSL_CERT_MANAGER* cm, const char* path,
+                              int type, int monitor)
+{
+    CYASSL_ENTER("CyaSSL_CertManagerLoadCRL");
+    if (cm == NULL)
+        return BAD_FUNC_ARG;
+
+    if (cm->crl == NULL) {
+        if (CyaSSL_CertManagerEnableCRL(cm, 0) != SSL_SUCCESS) {
+            CYASSL_MSG("Enable CRL failed");
+            return -1;
+        }
+    }
+
+    return LoadCRL(cm->crl, path, type, monitor);
+}
+
+
+int CyaSSL_EnableCRL(CYASSL* ssl, int options)
+{
+    CYASSL_ENTER("CyaSSL_EnableCRL");
+    if (ssl)
+        return CyaSSL_CertManagerEnableCRL(ssl->ctx->cm, options);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_DisableCRL(CYASSL* ssl)
+{
+    CYASSL_ENTER("CyaSSL_DisableCRL");
+    if (ssl)
+        return CyaSSL_CertManagerDisableCRL(ssl->ctx->cm);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_LoadCRL(CYASSL* ssl, const char* path, int type, int monitor)
+{
+    CYASSL_ENTER("CyaSSL_LoadCRL");
+    if (ssl)
+        return CyaSSL_CertManagerLoadCRL(ssl->ctx->cm, path, type, monitor);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_SetCRL_Cb(CYASSL* ssl, CbMissingCRL cb)
+{
+    CYASSL_ENTER("CyaSSL_SetCRL_Cb");
+    if (ssl)
+        return CyaSSL_CertManagerSetCRL_Cb(ssl->ctx->cm, cb);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_CTX_EnableCRL(CYASSL_CTX* ctx, int options)
+{
+    CYASSL_ENTER("CyaSSL_CTX_EnableCRL");
+    if (ctx)
+        return CyaSSL_CertManagerEnableCRL(ctx->cm, options);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_CTX_DisableCRL(CYASSL_CTX* ctx)
+{
+    CYASSL_ENTER("CyaSSL_CTX_DisableCRL");
+    if (ctx)
+        return CyaSSL_CertManagerDisableCRL(ctx->cm);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_CTX_LoadCRL(CYASSL_CTX* ctx, const char* path, int type, int monitor)
+{
+    CYASSL_ENTER("CyaSSL_CTX_LoadCRL");
+    if (ctx)
+        return CyaSSL_CertManagerLoadCRL(ctx->cm, path, type, monitor);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+int CyaSSL_CTX_SetCRL_Cb(CYASSL_CTX* ctx, CbMissingCRL cb)
+{
+    CYASSL_ENTER("CyaSSL_CTX_SetCRL_Cb");
+    if (ctx)
+        return CyaSSL_CertManagerSetCRL_Cb(ctx->cm, cb);
+    else
+        return BAD_FUNC_ARG;
+}
+
+
+#endif /* HAVE_CRL */
+
+
+#ifdef CYASSL_DER_LOAD
+
+/* Add format parameter to allow DER load of CA files */
+int CyaSSL_CTX_der_load_verify_locations(CYASSL_CTX* ctx, const char* file,
+                                         int format)
+{
+    CYASSL_ENTER("CyaSSL_CTX_der_load_verify_locations");
+    if (ctx == NULL || file == NULL)
+        return SSL_FAILURE;
+
+    if (ProcessFile(ctx, file, format, CA_TYPE, NULL, 0, NULL) == SSL_SUCCESS)
+        return SSL_SUCCESS;
+
+    return SSL_FAILURE;
+}
+
+#endif /* CYASSL_DER_LOAD */
+
+
+#ifdef CYASSL_CERT_GEN
+
+/* load pem cert from file into der buffer, return der size or error */
+int CyaSSL_PemCertToDer(const char* fileName, unsigned char* derBuf, int derSz) 
+{
+    byte   staticBuffer[FILE_BUFFER_SIZE];
+    byte*  fileBuf = staticBuffer;
+    int    dynamic = 0;
+    int    ret;
+    int    ecc = 0;
+    long   sz = 0;
+    XFILE* file = XFOPEN(fileName, "rb"); 
+    EncryptedInfo info;
+    buffer        converted;
+
+    CYASSL_ENTER("CyaSSL_PemCertToDer");
+    converted.buffer = 0;
+
+    if (!file) return SSL_BAD_FILE;
+    XFSEEK(file, 0, XSEEK_END);
+    sz = XFTELL(file);
+    XREWIND(file);
+
+    if (sz > (long)sizeof(staticBuffer)) {
+        fileBuf = (byte*) XMALLOC(sz, 0, DYNAMIC_TYPE_FILE);
+        if (fileBuf == NULL) {
+            XFCLOSE(file);
+            return SSL_BAD_FILE;
+        }
+        dynamic = 1;
+    }
+
+    if ( (ret = XFREAD(fileBuf, sz, 1, file)) < 0)
+        ret = SSL_BAD_FILE;
+    else
+        ret = PemToDer(fileBuf, sz, CA_TYPE, &converted, 0, &info, &ecc);
+
+    if (ret == 0) {
+        if (converted.length < (word32)derSz) {
+            XMEMCPY(derBuf, converted.buffer, converted.length);
+            ret = converted.length;
+        }
+        else
+            ret = BUFFER_E;
+    }       
+
+    XFREE(converted.buffer, 0, DYNAMIC_TYPE_CA); 
+    if (dynamic)
+        XFREE(fileBuf, 0, DYNAMIC_TYPE_FILE); 
+    XFCLOSE(file);
+
+    return ret;
+}
+
+#endif /* CYASSL_CERT_GEN */
+
+
+int CyaSSL_CTX_use_certificate_file(CYASSL_CTX* ctx, const char* file,
+                                    int format)
+{
+    CYASSL_ENTER("CyaSSL_CTX_use_certificate_file");
+    if (ProcessFile(ctx, file, format, CERT_TYPE, NULL, 0, NULL) == SSL_SUCCESS)
+        return SSL_SUCCESS;
+
+    return SSL_FAILURE;
+}
+
+
+int CyaSSL_CTX_use_PrivateKey_file(CYASSL_CTX* ctx, const char* file,int format)
+{
+    CYASSL_ENTER("CyaSSL_CTX_use_PrivateKey_file");
+    if (ProcessFile(ctx, file, format, PRIVATEKEY_TYPE, NULL, 0, NULL)
+                    == SSL_SUCCESS)
+        return SSL_SUCCESS;
+
+    return SSL_FAILURE;
+}
+
+
+int CyaSSL_CTX_use_certificate_chain_file(CYASSL_CTX* ctx, const char* file)
+{
+   /* procces up to MAX_CHAIN_DEPTH plus subject cert */
+   CYASSL_ENTER("CyaSSL_CTX_use_certificate_chain_file");
+   if (ProcessFile(ctx, file, SSL_FILETYPE_PEM,CERT_TYPE,NULL,1, NULL)
+                   == SSL_SUCCESS)
+       return SSL_SUCCESS;
+
+   return SSL_FAILURE;
+}
+
+
+#ifdef OPENSSL_EXTRA
+/* put SSL type in extra for now, not very common */
+
+int CyaSSL_use_certificate_file(CYASSL* ssl, const char* file, int format)
+{
+    CYASSL_ENTER("CyaSSL_use_certificate_file");
+    if (ProcessFile(ssl->ctx, file, format, CERT_TYPE, ssl, 0, NULL)
+                    == SSL_SUCCESS)
+        return SSL_SUCCESS;
+
+    return SSL_FAILURE;
+}
+
+
+int CyaSSL_use_PrivateKey_file(CYASSL* ssl, const char* file, int format)
+{
+    CYASSL_ENTER("CyaSSL_use_PrivateKey_file");
+    if (ProcessFile(ssl->ctx, file, format, PRIVATEKEY_TYPE, ssl, 0, NULL)
+                                                                 == SSL_SUCCESS)
+        return SSL_SUCCESS;
+
+    return SSL_FAILURE;
+}
+
+
+int CyaSSL_use_certificate_chain_file(CYASSL* ssl, const char* file)
+{
+   /* procces up to MAX_CHAIN_DEPTH plus subject cert */
+   CYASSL_ENTER("CyaSSL_use_certificate_chain_file");
+   if (ProcessFile(ssl->ctx, file, SSL_FILETYPE_PEM, CERT_TYPE, ssl, 1, NULL)
+                                                                 == SSL_SUCCESS)
+       return SSL_SUCCESS;
+
+   return SSL_FAILURE;
+}
+
+
+/* server wrapper for ctx or ssl Diffie-Hellman parameters */
+static int CyaSSL_SetTmpDH_buffer_wrapper(CYASSL_CTX* ctx, CYASSL* ssl,
+                                  const unsigned char* buf, long sz, int format)
+{
+    buffer der;
+    int    ret;
+    int    weOwnDer = 0;
+    byte   p[MAX_DH_SIZE];
+    byte   g[MAX_DH_SIZE];
+    word32 pSz = sizeof(p);
+    word32 gSz = sizeof(g);
+
+    der.buffer = (byte*)buf;
+    der.length = sz;
+
+    if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
+        return SSL_BAD_FILETYPE;
+
+    if (format == SSL_FILETYPE_PEM) {
+        der.buffer = NULL;
+        ret = PemToDer(buf, sz, DH_PARAM_TYPE, &der, ctx->heap, NULL,NULL);
+        if (ret < 0) {
+            XFREE(der.buffer, ctx->heap, DYNAMIC_TYPE_KEY);
+            return ret;
+        }
+        weOwnDer = 1;
+    }
+
+    if (DhParamsLoad(der.buffer, der.length, p, &pSz, g, &gSz) < 0)
+        ret = SSL_BAD_FILETYPE;
+    else {
+        if (ssl)
+            ret = CyaSSL_SetTmpDH(ssl, p, pSz, g, gSz);
+        else
+            ret = CyaSSL_CTX_SetTmpDH(ctx, p, pSz, g, gSz);
+    }
+
+    if (weOwnDer)
+        XFREE(der.buffer, ctx->heap, DYNAMIC_TYPE_KEY);
+
+    return ret;
+}
+
+/* server Diffie-Hellman parameters */
+int CyaSSL_SetTmpDH_buffer(CYASSL* ssl, const unsigned char* buf, long sz,
+                           int format)
+{
+    return CyaSSL_SetTmpDH_buffer_wrapper(ssl->ctx, ssl, buf, sz, format);
+}
+
+
+/* server ctx Diffie-Hellman parameters */
+int CyaSSL_CTX_SetTmpDH_buffer(CYASSL_CTX* ctx, const unsigned char* buf,
+                               long sz, int format)
+{
+    return CyaSSL_SetTmpDH_buffer_wrapper(ctx, NULL, buf, sz, format);
+}
+
+
+#ifdef HAVE_ECC
+
+/* Set Temp CTX EC-DHE size in octets, should be 20 - 66 for 160 - 521 bit */
+int CyaSSL_CTX_SetTmpEC_DHE_Sz(CYASSL_CTX* ctx, word16 sz)
+{
+    if (ctx == NULL || sz < ECC_MINSIZE || sz > ECC_MAXSIZE)
+        return BAD_FUNC_ARG;
+
+    ctx->eccTempKeySz = sz;
+
+    return SSL_SUCCESS;
+}
+
+
+/* Set Temp SSL EC-DHE size in octets, should be 20 - 66 for 160 - 521 bit */
+int CyaSSL_SetTmpEC_DHE_Sz(CYASSL* ssl, word16 sz)
+{
+    if (ssl == NULL || sz < ECC_MINSIZE || sz > ECC_MAXSIZE)
+        return BAD_FUNC_ARG;
+
+    ssl->eccTempKeySz = sz;
+
+    return SSL_SUCCESS;
+}
+
+#endif /* HAVE_ECC */
+
+
+#if !defined(NO_FILESYSTEM)
+
+/* server Diffie-Hellman parameters */
+static int CyaSSL_SetTmpDH_file_wrapper(CYASSL_CTX* ctx, CYASSL* ssl,
+                                        const char* fname, int format)
+{
+    byte   staticBuffer[FILE_BUFFER_SIZE];
+    byte*  myBuffer = staticBuffer;
+    int    dynamic = 0;
+    int    ret;
+    long   sz = 0;
+    XFILE* file = XFOPEN(fname, "rb"); 
+
+    if (!file) return SSL_BAD_FILE;
+    XFSEEK(file, 0, XSEEK_END);
+    sz = XFTELL(file);
+    XREWIND(file);
+
+    if (sz > (long)sizeof(staticBuffer)) {
+        CYASSL_MSG("Getting dynamic buffer");
+        myBuffer = (byte*) XMALLOC(sz, ctx->heap, DYNAMIC_TYPE_FILE);
+        if (myBuffer == NULL) {
+            XFCLOSE(file);
+            return SSL_BAD_FILE;
+        }
+        dynamic = 1;
+    }
+
+    if ( (ret = XFREAD(myBuffer, sz, 1, file)) < 0)
+        ret = SSL_BAD_FILE;
+    else {
+        if (ssl)
+            ret = CyaSSL_SetTmpDH_buffer(ssl, myBuffer, sz, format);
+        else
+            ret = CyaSSL_CTX_SetTmpDH_buffer(ctx, myBuffer, sz, format);
+    }
+
+    XFCLOSE(file);
+    if (dynamic) XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE);
+
+    return ret;
+}
+
+/* server Diffie-Hellman parameters */
+int CyaSSL_SetTmpDH_file(CYASSL* ssl, const char* fname, int format)
+{
+    return CyaSSL_SetTmpDH_file_wrapper(ssl->ctx, ssl, fname, format);
+}
+
+
+/* server Diffie-Hellman parameters */
+int CyaSSL_CTX_SetTmpDH_file(CYASSL_CTX* ctx, const char* fname, int format)
+{
+    return CyaSSL_SetTmpDH_file_wrapper(ctx, NULL, fname, format);
+}
+
+
+#endif /* !NO_FILESYSTEM */
+#endif /* OPENSSL_EXTRA */
+
+#ifdef HAVE_NTRU
+
+int CyaSSL_CTX_use_NTRUPrivateKey_file(CYASSL_CTX* ctx, const char* file)
+{
+    CYASSL_ENTER("CyaSSL_CTX_use_NTRUPrivateKey_file");
+    if (ProcessFile(ctx, file, SSL_FILETYPE_RAW, PRIVATEKEY_TYPE, NULL, 0, NULL)
+                         == SSL_SUCCESS) {
+        ctx->haveNTRU = 1;
+        return SSL_SUCCESS;
+    }
+
+    return SSL_FAILURE;
+}
+
+#endif /* HAVE_NTRU */
+
+
+
+#ifdef OPENSSL_EXTRA
+
+    int CyaSSL_CTX_use_RSAPrivateKey_file(CYASSL_CTX* ctx,const char* file,
+                                       int format)
+    {
+        CYASSL_ENTER("SSL_CTX_use_RSAPrivateKey_file");
+        if (ProcessFile(ctx, file,format,PRIVATEKEY_TYPE,NULL,0, NULL)
+                        == SSL_SUCCESS)
+            return SSL_SUCCESS;
+
+        return SSL_FAILURE;
+    }
+
+    int CyaSSL_use_RSAPrivateKey_file(CYASSL* ssl, const char* file, int format)
+    {
+        CYASSL_ENTER("CyaSSL_use_RSAPrivateKey_file");
+        if (ProcessFile(ssl->ctx, file, format, PRIVATEKEY_TYPE, ssl, 0, NULL)
+                                                                 == SSL_SUCCESS)
+            return SSL_SUCCESS;
+
+        return SSL_FAILURE;
+    }
+
+#endif /* OPENSSL_EXTRA */
+
+#endif /* NO_FILESYSTEM */
+
+
+void CyaSSL_CTX_set_verify(CYASSL_CTX* ctx, int mode, VerifyCallback vc)
+{
+    CYASSL_ENTER("CyaSSL_CTX_set_verify");
+    if (mode & SSL_VERIFY_PEER) {
+        ctx->verifyPeer = 1;
+        ctx->verifyNone = 0;  /* in case perviously set */
+    }
+
+    if (mode == SSL_VERIFY_NONE) {
+        ctx->verifyNone = 1;
+        ctx->verifyPeer = 0;  /* in case previously set */
+    }
+
+    if (mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
+        ctx->failNoCert = 1;
+
+    ctx->verifyCallback = vc;
+}
+
+
+void CyaSSL_set_verify(CYASSL* ssl, int mode, VerifyCallback vc)
+{
+    CYASSL_ENTER("CyaSSL_set_verify");
+    if (mode & SSL_VERIFY_PEER) {
+        ssl->options.verifyPeer = 1;
+        ssl->options.verifyNone = 0;  /* in case perviously set */
+    }
+
+    if (mode == SSL_VERIFY_NONE) {
+        ssl->options.verifyNone = 1;
+        ssl->options.verifyPeer = 0;  /* in case previously set */
+    }
+
+    if (mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)
+        ssl->options.failNoCert = 1;
+
+    ssl->verifyCallback = vc;
+}
+
+
+/* store context CA Cache addition callback */
+void CyaSSL_CTX_SetCACb(CYASSL_CTX* ctx, CallbackCACache cb)
+{
+    if (ctx && ctx->cm)
+        ctx->cm->caCacheCallback = cb;
+}
+
+
+#ifndef NO_SESSION_CACHE
+
+CYASSL_SESSION* CyaSSL_get_session(CYASSL* ssl)
+{
+    CYASSL_ENTER("SSL_get_session");
+    if (ssl)
+        return GetSession(ssl, 0);
+
+    return NULL;
+}
+
+
+int CyaSSL_set_session(CYASSL* ssl, CYASSL_SESSION* session)
+{
+    CYASSL_ENTER("SSL_set_session");
+    if (session)
+        return SetSession(ssl, session);
+
+    return SSL_FAILURE;
+}
+
+#endif /* NO_SESSION_CACHE */
+
+
+void CyaSSL_load_error_strings(void)   /* compatibility only */
+{}
+
+
+int CyaSSL_library_init(void)
+{
+    CYASSL_ENTER("SSL_library_init");
+    if (CyaSSL_Init() == 0)
+        return SSL_SUCCESS;
+    else
+        return SSL_FATAL_ERROR;
+}
+
+
+#ifndef NO_SESSION_CACHE
+
+/* on by default if built in but allow user to turn off */
+long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX* ctx, long mode)
+{
+    CYASSL_ENTER("SSL_CTX_set_session_cache_mode");
+    if (mode == SSL_SESS_CACHE_OFF)
+        ctx->sessionCacheOff = 1;
+
+    if (mode == SSL_SESS_CACHE_NO_AUTO_CLEAR)
+        ctx->sessionCacheFlushOff = 1;
+
+    return SSL_SUCCESS;
+}
+
+#endif /* NO_SESSION_CACHE */
+
+
+int CyaSSL_CTX_set_cipher_list(CYASSL_CTX* ctx, const char* list)
+{
+    CYASSL_ENTER("CyaSSL_CTX_set_cipher_list");
+    if (SetCipherList(&ctx->suites, list))
+        return SSL_SUCCESS;
+    else
+        return SSL_FAILURE;
+}
+
+
+int CyaSSL_set_cipher_list(CYASSL* ssl, const char* list)
+{
+    CYASSL_ENTER("CyaSSL_set_cipher_list");
+    if (SetCipherList(&ssl->suites, list)) {
+        byte havePSK = 0;
+
+        #ifndef NO_PSK
+            havePSK = ssl->options.havePSK;
+        #endif
+
+        InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, havePSK,
+                   ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                   ssl->options.haveStaticECC, ssl->options.side);
+
+        return SSL_SUCCESS;
+    }
+    else
+        return SSL_FAILURE;
+}
+
+
+/* client only parts */
+#ifndef NO_CYASSL_CLIENT
+
+    CYASSL_METHOD* CyaSSLv3_client_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        CYASSL_ENTER("SSLv3_client_method");
+        if (method)
+            InitSSL_Method(method, MakeSSLv3());
+        return method;
+    }
+
+    #ifdef CYASSL_DTLS
+        CYASSL_METHOD* CyaDTLSv1_client_method(void)
+        {
+            CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+            CYASSL_ENTER("DTLSv1_client_method");
+            if (method)
+                InitSSL_Method(method, MakeDTLSv1());
+            return method;
+        }
+    #endif
+
+
+    /* please see note at top of README if you get an error from connect */
+    int CyaSSL_connect(CYASSL* ssl)
+    {
+        int neededState;
+
+        CYASSL_ENTER("SSL_connect()");
+
+        #ifdef HAVE_ERRNO_H 
+            errno = 0;
+        #endif
+
+        if (ssl->options.side != CLIENT_END) {
+            CYASSL_ERROR(ssl->error = SIDE_ERROR);
+            return SSL_FATAL_ERROR;
+        }
+
+        #ifdef CYASSL_DTLS
+            if (ssl->version.major == DTLS_MAJOR && 
+                                      ssl->version.minor == DTLS_MINOR) {
+                ssl->options.dtls   = 1;
+                ssl->options.tls    = 1;
+                ssl->options.tls1_1 = 1;
+            }
+        #endif
+
+        if (ssl->buffers.outputBuffer.length > 0) {
+            if ( (ssl->error = SendBuffered(ssl)) == 0) {
+                ssl->options.connectState++;
+                CYASSL_MSG("connect state: Advanced from buffered send");
+            }
+            else {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+        }
+
+        switch (ssl->options.connectState) {
+
+        case CONNECT_BEGIN :
+            /* always send client hello first */
+            if ( (ssl->error = SendClientHello(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+            ssl->options.connectState = CLIENT_HELLO_SENT;
+            CYASSL_MSG("connect state: CLIENT_HELLO_SENT");
+
+        case CLIENT_HELLO_SENT :
+            neededState = ssl->options.resuming ? SERVER_FINISHED_COMPLETE :
+                                          SERVER_HELLODONE_COMPLETE;
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls && !ssl->options.resuming)
+                    neededState = SERVER_HELLOVERIFYREQUEST_COMPLETE;
+            #endif
+            /* get response */
+            while (ssl->options.serverState < neededState) {
+                if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+                /* if resumption failed, reset needed state */
+                else if (neededState == SERVER_FINISHED_COMPLETE)
+                    if (!ssl->options.resuming) {
+                        if (!ssl->options.dtls)
+                            neededState = SERVER_HELLODONE_COMPLETE;
+                        else
+                            neededState = SERVER_HELLOVERIFYREQUEST_COMPLETE;
+                    }
+            }
+
+            ssl->options.connectState = HELLO_AGAIN;
+            CYASSL_MSG("connect state: HELLO_AGAIN");
+
+        case HELLO_AGAIN :
+            if (ssl->options.certOnly)
+                return SSL_SUCCESS;
+
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls && !ssl->options.resuming) {
+                    /* re-init hashes, exclude first hello and verify request */
+                    InitMd5(&ssl->hashMd5);
+                    InitSha(&ssl->hashSha);
+                    #ifndef NO_SHA256
+                        if (IsAtLeastTLSv1_2(ssl))
+                            InitSha256(&ssl->hashSha256);
+                    #endif
+                    if ( (ssl->error = SendClientHello(ssl)) != 0) {
+                        CYASSL_ERROR(ssl->error);
+                        return SSL_FATAL_ERROR;
+                    }
+                }
+            #endif
+
+            ssl->options.connectState = HELLO_AGAIN_REPLY;
+            CYASSL_MSG("connect state: HELLO_AGAIN_REPLY");
+
+        case HELLO_AGAIN_REPLY :
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls) {
+                    neededState = ssl->options.resuming ?
+                           SERVER_FINISHED_COMPLETE : SERVER_HELLODONE_COMPLETE;
+            
+                    /* get response */
+                    while (ssl->options.serverState < neededState) {
+                        if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                                CYASSL_ERROR(ssl->error);
+                                return SSL_FATAL_ERROR;
+                        }
+                        /* if resumption failed, reset needed state */
+                        else if (neededState == SERVER_FINISHED_COMPLETE)
+                            if (!ssl->options.resuming)
+                                neededState = SERVER_HELLODONE_COMPLETE;
+                    }
+                }
+            #endif
+
+            ssl->options.connectState = FIRST_REPLY_DONE;
+            CYASSL_MSG("connect state: FIRST_REPLY_DONE");
+
+        case FIRST_REPLY_DONE :
+            if (ssl->options.sendVerify)
+                if ( (ssl->error = SendCertificate(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+
+            ssl->options.connectState = FIRST_REPLY_FIRST;
+            CYASSL_MSG("connect state: FIRST_REPLY_FIRST");
+
+        case FIRST_REPLY_FIRST :
+            if (!ssl->options.resuming)
+                if ( (ssl->error = SendClientKeyExchange(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+
+            ssl->options.connectState = FIRST_REPLY_SECOND;
+            CYASSL_MSG("connect state: FIRST_REPLY_SECOND");
+
+        case FIRST_REPLY_SECOND :
+            if (ssl->options.sendVerify)
+                if ( (ssl->error = SendCertificateVerify(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+            }
+            ssl->options.connectState = FIRST_REPLY_THIRD;
+            CYASSL_MSG("connect state: FIRST_REPLY_THIRD");
+
+        case FIRST_REPLY_THIRD :
+            if ( (ssl->error = SendChangeCipher(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+            ssl->options.connectState = FIRST_REPLY_FOURTH;
+            CYASSL_MSG("connect state: FIRST_REPLY_FOURTH");
+
+        case FIRST_REPLY_FOURTH :
+            if ( (ssl->error = SendFinished(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+
+            ssl->options.connectState = FINISHED_DONE;
+            CYASSL_MSG("connect state: FINISHED_DONE");
+
+        case FINISHED_DONE :
+            /* get response */
+            while (ssl->options.serverState < SERVER_FINISHED_COMPLETE)
+                if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+          
+            ssl->options.connectState = SECOND_REPLY_DONE;
+            CYASSL_MSG("connect state: SECOND_REPLY_DONE");
+
+        case SECOND_REPLY_DONE:
+            if (ssl->buffers.inputBuffer.dynamicFlag)
+                ShrinkInputBuffer(ssl, NO_FORCED_FREE);
+            CYASSL_LEAVE("SSL_connect()", SSL_SUCCESS);
+            return SSL_SUCCESS;
+
+        default:
+            CYASSL_MSG("Unknown connect state ERROR");
+            return SSL_FATAL_ERROR; /* unknown connect state */
+        }
+    }
+
+#endif /* NO_CYASSL_CLIENT */
+
+
+/* server only parts */
+#ifndef NO_CYASSL_SERVER
+
+    CYASSL_METHOD* CyaSSLv3_server_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        CYASSL_ENTER("SSLv3_server_method");
+        if (method) {
+            InitSSL_Method(method, MakeSSLv3());
+            method->side = SERVER_END;
+        }
+        return method;
+    }
+
+
+    #ifdef CYASSL_DTLS
+        CYASSL_METHOD* CyaDTLSv1_server_method(void)
+        {
+            CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+            CYASSL_ENTER("DTLSv1_server_method");
+            if (method) {
+                InitSSL_Method(method, MakeDTLSv1());
+                method->side = SERVER_END;
+            }
+            return method;
+        }
+    #endif
+
+
+    int CyaSSL_accept(CYASSL* ssl)
+    {
+        byte havePSK = 0;
+        CYASSL_ENTER("SSL_accept()");
+
+        #ifdef HAVE_ERRNO_H 
+            errno = 0;
+        #endif
+
+        #ifndef NO_PSK
+            havePSK = ssl->options.havePSK;
+        #endif
+
+        if (ssl->options.side != SERVER_END) {
+            CYASSL_ERROR(ssl->error = SIDE_ERROR);
+            return SSL_FATAL_ERROR;
+        }
+
+        /* in case used set_accept_state after init */
+        if (!havePSK && (ssl->buffers.certificate.buffer == NULL ||
+                         ssl->buffers.key.buffer == NULL)) {
+            CYASSL_MSG("accept error: don't have server cert and key");
+            ssl->error = NO_PRIVATE_KEY;
+            CYASSL_ERROR(ssl->error);
+            return SSL_FATAL_ERROR;
+        }
+
+        #ifdef HAVE_ECC
+            /* in case used set_accept_state after init */
+            if (ssl->eccTempKeyPresent == 0) {
+                if (ecc_make_key(&ssl->rng, ssl->eccTempKeySz,
+                                 &ssl->eccTempKey) != 0) {
+                    ssl->error = ECC_MAKEKEY_ERROR;
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR; 
+                } 
+                ssl->eccTempKeyPresent = 1;
+            }
+        #endif
+
+        #ifdef CYASSL_DTLS
+            if (ssl->version.major == DTLS_MAJOR &&
+                                      ssl->version.minor == DTLS_MINOR) {
+                ssl->options.dtls   = 1;
+                ssl->options.tls    = 1;
+                ssl->options.tls1_1 = 1;
+            }
+        #endif
+
+        if (ssl->buffers.outputBuffer.length > 0) {
+            if ( (ssl->error = SendBuffered(ssl)) == 0) {
+                ssl->options.acceptState++;
+                CYASSL_MSG("accept state: Advanced from buffered send");
+            }
+            else {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+        }
+
+        switch (ssl->options.acceptState) {
+    
+        case ACCEPT_BEGIN :
+            /* get response */
+            while (ssl->options.clientState < CLIENT_HELLO_COMPLETE)
+                if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+            ssl->options.acceptState = ACCEPT_CLIENT_HELLO_DONE;
+            CYASSL_MSG("accept state ACCEPT_CLIENT_HELLO_DONE");
+
+        case ACCEPT_CLIENT_HELLO_DONE :
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls && !ssl->options.resuming)
+                    if ( (ssl->error = SendHelloVerifyRequest(ssl)) != 0) {
+                        CYASSL_ERROR(ssl->error);
+                        return SSL_FATAL_ERROR;
+                    }
+            #endif
+            ssl->options.acceptState = HELLO_VERIFY_SENT;
+            CYASSL_MSG("accept state HELLO_VERIFY_SENT");
+
+        case HELLO_VERIFY_SENT:
+            #ifdef CYASSL_DTLS
+                if (ssl->options.dtls && !ssl->options.resuming) {
+                    ssl->options.clientState = NULL_STATE;  /* get again */
+                    /* re-init hashes, exclude first hello and verify request */
+                    InitMd5(&ssl->hashMd5);
+                    InitSha(&ssl->hashSha);
+                    #ifndef NO_SHA256
+                        if (IsAtLeastTLSv1_2(ssl))
+                            InitSha256(&ssl->hashSha256);
+                    #endif
+
+                    while (ssl->options.clientState < CLIENT_HELLO_COMPLETE)
+                        if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                            CYASSL_ERROR(ssl->error);
+                            return SSL_FATAL_ERROR;
+                        }
+                }
+            #endif
+            ssl->options.acceptState = ACCEPT_FIRST_REPLY_DONE;
+            CYASSL_MSG("accept state ACCEPT_FIRST_REPLY_DONE");
+
+        case ACCEPT_FIRST_REPLY_DONE :
+            if ( (ssl->error = SendServerHello(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+            ssl->options.acceptState = SERVER_HELLO_SENT;
+            CYASSL_MSG("accept state SERVER_HELLO_SENT");
+
+        case SERVER_HELLO_SENT :
+            if (!ssl->options.resuming) 
+                if ( (ssl->error = SendCertificate(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+            ssl->options.acceptState = CERT_SENT;
+            CYASSL_MSG("accept state CERT_SENT");
+
+        case CERT_SENT :
+            if (!ssl->options.resuming) 
+                if ( (ssl->error = SendServerKeyExchange(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+            ssl->options.acceptState = KEY_EXCHANGE_SENT;
+            CYASSL_MSG("accept state KEY_EXCHANGE_SENT");
+
+        case KEY_EXCHANGE_SENT :
+            if (!ssl->options.resuming) 
+                if (ssl->options.verifyPeer)
+                    if ( (ssl->error = SendCertificateRequest(ssl)) != 0) {
+                        CYASSL_ERROR(ssl->error);
+                        return SSL_FATAL_ERROR;
+                    }
+            ssl->options.acceptState = CERT_REQ_SENT;
+            CYASSL_MSG("accept state CERT_REQ_SENT");
+
+        case CERT_REQ_SENT :
+            if (!ssl->options.resuming) 
+                if ( (ssl->error = SendServerHelloDone(ssl)) != 0) {
+                    CYASSL_ERROR(ssl->error);
+                    return SSL_FATAL_ERROR;
+                }
+            ssl->options.acceptState = SERVER_HELLO_DONE;
+            CYASSL_MSG("accept state SERVER_HELLO_DONE");
+
+        case SERVER_HELLO_DONE :
+            if (!ssl->options.resuming) {
+                while (ssl->options.clientState < CLIENT_FINISHED_COMPLETE)
+                    if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                        CYASSL_ERROR(ssl->error);
+                        return SSL_FATAL_ERROR;
+                    }
+            }
+            ssl->options.acceptState = ACCEPT_SECOND_REPLY_DONE;
+            CYASSL_MSG("accept state  ACCEPT_SECOND_REPLY_DONE");
+          
+        case ACCEPT_SECOND_REPLY_DONE : 
+            if ( (ssl->error = SendChangeCipher(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+            ssl->options.acceptState = CHANGE_CIPHER_SENT;
+            CYASSL_MSG("accept state  CHANGE_CIPHER_SENT");
+
+        case CHANGE_CIPHER_SENT : 
+            if ( (ssl->error = SendFinished(ssl)) != 0) {
+                CYASSL_ERROR(ssl->error);
+                return SSL_FATAL_ERROR;
+            }
+
+            ssl->options.acceptState = ACCEPT_FINISHED_DONE;
+            CYASSL_MSG("accept state ACCEPT_FINISHED_DONE");
+
+        case ACCEPT_FINISHED_DONE :
+            if (ssl->options.resuming)
+                while (ssl->options.clientState < CLIENT_FINISHED_COMPLETE)
+                    if ( (ssl->error = ProcessReply(ssl)) < 0) {
+                        CYASSL_ERROR(ssl->error);
+                        return SSL_FATAL_ERROR;
+                    }
+
+            ssl->options.acceptState = ACCEPT_THIRD_REPLY_DONE;
+            CYASSL_MSG("accept state ACCEPT_THIRD_REPLY_DONE");
+
+        case ACCEPT_THIRD_REPLY_DONE :
+            if (ssl->buffers.inputBuffer.dynamicFlag)
+                ShrinkInputBuffer(ssl, NO_FORCED_FREE);
+            CYASSL_LEAVE("SSL_accept()", SSL_SUCCESS);
+            return SSL_SUCCESS;
+
+        default :
+            CYASSL_MSG("Unknown accept state ERROR");
+            return SSL_FATAL_ERROR;
+        }
+    }
+
+#endif /* NO_CYASSL_SERVER */
+
+/* prevent multiple mutex initializations */
+static volatile int initRefCount = 0;
+static CyaSSL_Mutex count_mutex;   /* init ref count mutex */
+
+int CyaSSL_Init(void)
+{
+    int ret = 0;
+
+    CYASSL_ENTER("CyaSSL_Init");
+
+    if (initRefCount == 0) {
+#ifndef NO_SESSION_CACHE
+        if (InitMutex(&session_mutex) != 0)
+            ret = BAD_MUTEX_ERROR;
+#endif
+        if (InitMutex(&count_mutex) != 0)
+            ret = BAD_MUTEX_ERROR;
+    }
+    if (ret == 0) {
+        LockMutex(&count_mutex);
+        initRefCount++;
+        UnLockMutex(&count_mutex);
+    }
+
+    return ret;
+}
+
+
+int CyaSSL_Cleanup(void)
+{
+    int ret = 0;
+    int release = 0;
+
+    CYASSL_ENTER("CyaSSL_Cleanup");
+
+    LockMutex(&count_mutex);
+
+    release = initRefCount-- == 1;
+    if (initRefCount < 0)
+        initRefCount = 0;
+
+    UnLockMutex(&count_mutex);
+
+    if (!release)
+        return ret;
+
+#ifndef NO_SESSION_CACHE
+    if (FreeMutex(&session_mutex) != 0)
+        ret = BAD_MUTEX_ERROR;
+#endif
+    if (FreeMutex(&count_mutex) != 0)
+        ret = BAD_MUTEX_ERROR;
+
+    return ret;
+}
+
+
+#ifndef NO_SESSION_CACHE
+
+
+static INLINE word32 HashSession(const byte* sessionID)
+{
+    /* id is random, just make 32 bit number from first 4 bytes for now */
+    return (sessionID[0] << 24) | (sessionID[1] << 16) | (sessionID[2] <<  8) |
+            sessionID[3];
+}
+
+
+void CyaSSL_flush_sessions(CYASSL_CTX* ctx, long tm)
+{
+    /* static table now, no flusing needed */
+    (void)ctx;
+    (void)tm;
+}
+
+
+/* set ssl session timeout in seconds */
+int CyaSSL_set_timeout(CYASSL* ssl, unsigned int to)
+{
+    if (ssl == NULL)
+        return BAD_FUNC_ARG;
+
+    ssl->timeout = to;
+
+    return SSL_SUCCESS;
+}
+
+
+/* set ctx session timeout in seconds */
+int CyaSSL_CTX_set_timeout(CYASSL_CTX* ctx, unsigned int to)
+{
+    if (ctx == NULL)
+        return BAD_FUNC_ARG;
+
+    ctx->timeout = to;
+
+    return SSL_SUCCESS;
+}
+
+
+CYASSL_SESSION* GetSession(CYASSL* ssl, byte* masterSecret)
+{
+    CYASSL_SESSION* ret = 0;
+    const byte*  id = ssl->arrays.sessionID;
+    word32       row;
+    int          idx;
+    
+    if (ssl->options.sessionCacheOff)
+        return NULL;
+
+    if (ssl->options.haveSessionId == 0)
+        return NULL;
+
+    row = HashSession(id) % SESSION_ROWS;
+
+    if (LockMutex(&session_mutex) != 0)
+        return 0;
+   
+    if (SessionCache[row].totalCount >= SESSIONS_PER_ROW)
+        idx = SESSIONS_PER_ROW - 1;
+    else
+        idx = SessionCache[row].nextIdx - 1;
+
+    for (; idx >= 0; idx--) {
+        CYASSL_SESSION* current;
+        
+        if (idx >= SESSIONS_PER_ROW)    /* server could have restarted, idx  */
+            break;                      /* would be word32(-1) and seg fault */
+        
+        current = &SessionCache[row].Sessions[idx];
+        if (XMEMCMP(current->sessionID, id, ID_LEN) == 0) {
+            if (LowResTimer() < (current->bornOn + current->timeout)) {
+                ret = current;
+                if (masterSecret)
+                    XMEMCPY(masterSecret, current->masterSecret, SECRET_LEN);
+            }
+            break;
+        }   
+    }
+
+    UnLockMutex(&session_mutex);
+    
+    return ret;
+}
+
+
+int SetSession(CYASSL* ssl, CYASSL_SESSION* session)
+{
+    if (ssl->options.sessionCacheOff)
+        return SSL_FAILURE;
+
+    if (LowResTimer() < (session->bornOn + session->timeout)) {
+        ssl->session  = *session;
+        ssl->options.resuming = 1;
+
+#ifdef SESSION_CERTS
+        ssl->version              = session->version;
+        ssl->options.cipherSuite0 = session->cipherSuite0;
+        ssl->options.cipherSuite  = session->cipherSuite;
+#endif
+
+        return SSL_SUCCESS;
+    }
+    return SSL_FAILURE;  /* session timed out */
+}
+
+
+int AddSession(CYASSL* ssl)
+{
+    word32 row, idx;
+
+    if (ssl->options.sessionCacheOff)
+        return 0;
+
+    if (ssl->options.haveSessionId == 0)
+        return 0;
+
+    row = HashSession(ssl->arrays.sessionID) % SESSION_ROWS;
+
+    if (LockMutex(&session_mutex) != 0)
+        return BAD_MUTEX_ERROR;
+
+    idx = SessionCache[row].nextIdx++;
+
+    XMEMCPY(SessionCache[row].Sessions[idx].masterSecret,
+           ssl->arrays.masterSecret, SECRET_LEN);
+    XMEMCPY(SessionCache[row].Sessions[idx].sessionID, ssl->arrays.sessionID,
+           ID_LEN);
+
+    SessionCache[row].Sessions[idx].timeout = ssl->timeout;
+    SessionCache[row].Sessions[idx].bornOn  = LowResTimer();
+
+#ifdef SESSION_CERTS
+    SessionCache[row].Sessions[idx].chain.count = ssl->session.chain.count;
+    XMEMCPY(SessionCache[row].Sessions[idx].chain.certs,
+           ssl->session.chain.certs, sizeof(x509_buffer) * MAX_CHAIN_DEPTH);
+
+    SessionCache[row].Sessions[idx].version      = ssl->version;
+    SessionCache[row].Sessions[idx].cipherSuite0 = ssl->options.cipherSuite0;
+    SessionCache[row].Sessions[idx].cipherSuite  = ssl->options.cipherSuite;
+#endif
+
+    SessionCache[row].totalCount++;
+    if (SessionCache[row].nextIdx == SESSIONS_PER_ROW)
+        SessionCache[row].nextIdx = 0;
+
+    if (UnLockMutex(&session_mutex) != 0)
+        return BAD_MUTEX_ERROR;
+
+    return 0;
+}
+
+
+    #ifdef SESSION_STATS
+
+    CYASSL_API
+    void PrintSessionStats(void)
+    {
+        word32 totalSessionsSeen = 0;
+        word32 totalSessionsNow = 0;
+        word32 rowNow;
+        int    i;
+        double E;               /* expected freq */
+        double chiSquare = 0;
+        
+        for (i = 0; i < SESSION_ROWS; i++) {
+            totalSessionsSeen += SessionCache[i].totalCount;
+
+            if (SessionCache[i].totalCount >= SESSIONS_PER_ROW)
+                rowNow = SESSIONS_PER_ROW;
+            else if (SessionCache[i].nextIdx == 0)
+                rowNow = 0;
+            else
+                rowNow = SessionCache[i].nextIdx;
+        
+            totalSessionsNow += rowNow;
+        }
+
+        printf("Total Sessions Seen = %d\n", totalSessionsSeen);
+        printf("Total Sessions Now  = %d\n", totalSessionsNow);
+
+        E = (double)totalSessionsSeen / SESSION_ROWS;
+
+        for (i = 0; i < SESSION_ROWS; i++) {
+            double diff = SessionCache[i].totalCount - E;
+            diff *= diff;                /* square    */
+            diff /= E;                   /* normalize */
+
+            chiSquare += diff;
+        }
+        printf("  chi-square = %5.1f, d.f. = %d\n", chiSquare,
+                                                     SESSION_ROWS - 1);
+        if (SESSION_ROWS == 11)
+            printf(" .05 p value =  18.3, chi-square should be less\n");
+        else if (SESSION_ROWS == 211)
+            printf(".05 p value  = 244.8, chi-square should be less\n");
+        else if (SESSION_ROWS == 5981)
+            printf(".05 p value  = 6161.0, chi-square should be less\n");
+        else if (SESSION_ROWS == 3)
+            printf(".05 p value  =   6.0, chi-square should be less\n");
+        else if (SESSION_ROWS == 2861)
+            printf(".05 p value  = 2985.5, chi-square should be less\n");
+        printf("\n");
+    }
+
+    #endif /* SESSION_STATS */
+
+#else  /* NO_SESSION_CACHE */
+
+/* No session cache version */
+CYASSL_SESSION* GetSession(CYASSL* ssl, byte* masterSecret)
+{
+    return NULL;  
+}
+
+#endif /* NO_SESSION_CACHE */
+
+
+/* call before SSL_connect, if verifying will add name check to
+   date check and signature check */
+int CyaSSL_check_domain_name(CYASSL* ssl, const char* dn)
+{
+    CYASSL_ENTER("CyaSSL_check_domain_name");
+    if (ssl->buffers.domainName.buffer)
+        XFREE(ssl->buffers.domainName.buffer, ssl->heap, DYNAMIC_TYPE_DOMAIN);
+
+    ssl->buffers.domainName.length = (word32)XSTRLEN(dn) + 1;
+    ssl->buffers.domainName.buffer = (byte*) XMALLOC(
+                ssl->buffers.domainName.length, ssl->heap, DYNAMIC_TYPE_DOMAIN);
+
+    if (ssl->buffers.domainName.buffer) {
+        XSTRNCPY((char*)ssl->buffers.domainName.buffer, dn,
+                ssl->buffers.domainName.length);
+        return SSL_SUCCESS;
+    }
+    else {
+        ssl->error = MEMORY_ERROR;
+        return SSL_FAILURE;
+    }
+}
+
+
+/* turn on CyaSSL zlib compression
+   returns 0 for success, else error (not built in)
+*/
+int CyaSSL_set_compression(CYASSL* ssl)
+{
+    CYASSL_ENTER("CyaSSL_set_compression");
+    (void)ssl;
+#ifdef HAVE_LIBZ
+    ssl->options.usingCompression = 1;
+    return 0;
+#else
+    return NOT_COMPILED_IN;
+#endif
+}
+
+
+#ifndef USE_WINDOWS_API 
+    #ifndef NO_WRITEV
+
+        /* simulate writev semantics, doesn't actually do block at a time though
+           because of SSL_write behavior and because front adds may be small */
+        int CyaSSL_writev(CYASSL* ssl, const struct iovec* iov, int iovcnt)
+        {
+            byte  tmp[OUTPUT_RECORD_SIZE];
+            byte* myBuffer    = tmp;
+            int   send      = 0;
+            int   newBuffer = 0;
+            int   idx       = 0;
+            int   i;
+            int   ret;
+
+            CYASSL_ENTER("CyaSSL_writev");
+
+            for (i = 0; i < iovcnt; i++)
+                send += iov[i].iov_len;
+
+            if (send > (int)sizeof(tmp)) {
+                byte* tmp2 = (byte*) XMALLOC(send, ssl->heap,
+                                             DYNAMIC_TYPE_WRITEV);
+                if (!tmp2)
+                    return MEMORY_ERROR;
+                myBuffer = tmp2;
+                newBuffer = 1;
+            }
+
+            for (i = 0; i < iovcnt; i++) {
+                XMEMCPY(&myBuffer[idx], iov[i].iov_base, iov[i].iov_len);
+                idx += iov[i].iov_len;
+            }
+
+            ret = CyaSSL_write(ssl, myBuffer, send);
+
+            if (newBuffer) XFREE(myBuffer, ssl->heap, DYNAMIC_TYPE_WRITEV);
+
+            return ret;
+        }
+    #endif
+#endif
+
+
+#ifdef CYASSL_CALLBACKS
+
+    typedef struct itimerval Itimerval;
+
+    /* don't keep calling simple functions while setting up timer and singals
+       if no inlining these are the next best */
+
+    #define AddTimes(a, b, c)                       \
+        do {                                        \
+            c.tv_sec  = a.tv_sec  + b.tv_sec;       \
+            c.tv_usec = a.tv_usec + b.tv_usec;      \
+            if (c.tv_sec >=  1000000) {             \
+                c.tv_sec++;                         \
+                c.tv_usec -= 1000000;               \
+            }                                       \
+        } while (0)
+
+
+    #define SubtractTimes(a, b, c)                  \
+        do {                                        \
+            c.tv_sec  = a.tv_sec  - b.tv_sec;       \
+            c.tv_usec = a.tv_usec - b.tv_usec;      \
+            if (c.tv_sec < 0) {                     \
+                c.tv_sec--;                         \
+                c.tv_usec += 1000000;               \
+            }                                       \
+        } while (0)
+
+    #define CmpTimes(a, b, cmp)                     \
+        ((a.tv_sec  ==  b.tv_sec) ?                 \
+            (a.tv_usec cmp b.tv_usec) :             \
+            (a.tv_sec  cmp b.tv_sec))               \
+
+
+    /* do nothing handler */
+    static void myHandler(int signo)
+    {
+        return;
+    }
+
+
+    static int CyaSSL_ex_wrapper(CYASSL* ssl, HandShakeCallBack hsCb,
+                                 TimeoutCallBack toCb, Timeval timeout)
+    {
+        int       ret        = SSL_FATAL_ERROR;
+        int       oldTimerOn = 0;   /* was timer already on */
+        Timeval   startTime;
+        Timeval   endTime;
+        Timeval   totalTime;
+        Itimerval myTimeout;
+        Itimerval oldTimeout; /* if old timer adjust from total time to reset */
+        struct sigaction act, oact;
+       
+        #define ERR_OUT(x) { ssl->hsInfoOn = 0; ssl->toInfoOn = 0; return x; }
+
+        if (hsCb) {
+            ssl->hsInfoOn = 1;
+            InitHandShakeInfo(&ssl->handShakeInfo);
+        }
+        if (toCb) {
+            ssl->toInfoOn = 1;
+            InitTimeoutInfo(&ssl->timeoutInfo);
+            
+            if (gettimeofday(&startTime, 0) < 0)
+                ERR_OUT(GETTIME_ERROR);
+
+            /* use setitimer to simulate getitimer, init 0 myTimeout */
+            myTimeout.it_interval.tv_sec  = 0;
+            myTimeout.it_interval.tv_usec = 0;
+            myTimeout.it_value.tv_sec     = 0;
+            myTimeout.it_value.tv_usec    = 0;
+            if (setitimer(ITIMER_REAL, &myTimeout, &oldTimeout) < 0)
+                ERR_OUT(SETITIMER_ERROR);
+
+            if (oldTimeout.it_value.tv_sec || oldTimeout.it_value.tv_usec) {
+                oldTimerOn = 1;
+                
+                /* is old timer going to expire before ours */
+                if (CmpTimes(oldTimeout.it_value, timeout, <)) { 
+                    timeout.tv_sec  = oldTimeout.it_value.tv_sec;
+                    timeout.tv_usec = oldTimeout.it_value.tv_usec;
+                }       
+            }
+            myTimeout.it_value.tv_sec  = timeout.tv_sec;
+            myTimeout.it_value.tv_usec = timeout.tv_usec;
+            
+            /* set up signal handler, don't restart socket send/recv */
+            act.sa_handler = myHandler;
+            sigemptyset(&act.sa_mask);
+            act.sa_flags = 0;
+#ifdef SA_INTERRUPT
+            act.sa_flags |= SA_INTERRUPT;
+#endif
+            if (sigaction(SIGALRM, &act, &oact) < 0)
+                ERR_OUT(SIGACT_ERROR);
+
+            if (setitimer(ITIMER_REAL, &myTimeout, 0) < 0)
+                ERR_OUT(SETITIMER_ERROR);
+        }
+
+        /* do main work */
+#ifndef NO_CYASSL_CLIENT
+        if (ssl->options.side == CLIENT_END)
+            ret = CyaSSL_connect(ssl);
+#endif
+#ifndef NO_CYASSL_SERVER
+        if (ssl->options.side == SERVER_END)
+            ret = CyaSSL_accept(ssl);
+#endif
+       
+        /* do callbacks */ 
+        if (toCb) {
+            if (oldTimerOn) {
+                gettimeofday(&endTime, 0);
+                SubtractTimes(endTime, startTime, totalTime);
+                /* adjust old timer for elapsed time */
+                if (CmpTimes(totalTime, oldTimeout.it_value, <))
+                    SubtractTimes(oldTimeout.it_value, totalTime,
+                                  oldTimeout.it_value);
+                else {
+                    /* reset value to interval, may be off */
+                    oldTimeout.it_value.tv_sec = oldTimeout.it_interval.tv_sec;
+                    oldTimeout.it_value.tv_usec =oldTimeout.it_interval.tv_usec;
+                }
+                /* keep iter the same whether there or not */
+            }
+            /* restore old handler */
+            if (sigaction(SIGALRM, &oact, 0) < 0)
+                ret = SIGACT_ERROR;    /* more pressing error, stomp */
+            else
+                /* use old settings which may turn off (expired or not there) */
+                if (setitimer(ITIMER_REAL, &oldTimeout, 0) < 0)
+                    ret = SETITIMER_ERROR;
+            
+            /* if we had a timeout call callback */
+            if (ssl->timeoutInfo.timeoutName[0]) {
+                ssl->timeoutInfo.timeoutValue.tv_sec  = timeout.tv_sec;
+                ssl->timeoutInfo.timeoutValue.tv_usec = timeout.tv_usec;
+                (toCb)(&ssl->timeoutInfo);
+            }
+            /* clean up */
+            FreeTimeoutInfo(&ssl->timeoutInfo, ssl->heap);
+            ssl->toInfoOn = 0;
+        }
+        if (hsCb) {
+            FinishHandShakeInfo(&ssl->handShakeInfo, ssl);
+            (hsCb)(&ssl->handShakeInfo);
+            ssl->hsInfoOn = 0;
+        }
+        return ret;
+    }
+
+
+#ifndef NO_CYASSL_CLIENT
+
+    int CyaSSL_connect_ex(CYASSL* ssl, HandShakeCallBack hsCb,
+                          TimeoutCallBack toCb, Timeval timeout)
+    {
+        CYASSL_ENTER("CyaSSL_connect_ex");
+        return CyaSSL_ex_wrapper(ssl, hsCb, toCb, timeout);
+    }
+
+#endif
+
+
+#ifndef NO_CYASSL_SERVER
+
+    int CyaSSL_accept_ex(CYASSL* ssl, HandShakeCallBack hsCb,
+                         TimeoutCallBack toCb,Timeval timeout)
+    {
+        CYASSL_ENTER("CyaSSL_accept_ex");
+        return CyaSSL_ex_wrapper(ssl, hsCb, toCb, timeout);
+    }
+
+#endif
+
+#endif /* CYASSL_CALLBACKS */
+
+
+#ifndef NO_PSK
+
+    void CyaSSL_CTX_set_psk_client_callback(CYASSL_CTX* ctx,
+                                         psk_client_callback cb)
+    {
+        CYASSL_ENTER("SSL_CTX_set_psk_client_callback");
+        ctx->havePSK = 1;
+        ctx->client_psk_cb = cb;
+    }
+
+
+    void CyaSSL_set_psk_client_callback(CYASSL* ssl, psk_client_callback cb)
+    {
+        CYASSL_ENTER("SSL_set_psk_client_callback");
+        ssl->options.havePSK = 1;
+        ssl->options.client_psk_cb = cb;
+
+        InitSuites(&ssl->suites, ssl->version,TRUE,TRUE, ssl->options.haveNTRU,
+                   ssl->options.haveECDSAsig, ssl->options.haveStaticECC,
+                   ssl->options.side);
+    }
+
+
+    void CyaSSL_CTX_set_psk_server_callback(CYASSL_CTX* ctx,
+                                         psk_server_callback cb)
+    {
+        CYASSL_ENTER("SSL_CTX_set_psk_server_callback");
+        ctx->havePSK = 1;
+        ctx->server_psk_cb = cb;
+    }
+
+
+    void CyaSSL_set_psk_server_callback(CYASSL* ssl, psk_server_callback cb)
+    {
+        CYASSL_ENTER("SSL_set_psk_server_callback");
+        ssl->options.havePSK = 1;
+        ssl->options.server_psk_cb = cb;
+
+        InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, TRUE,
+                   ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                   ssl->options.haveStaticECC, ssl->options.side);
+    }
+
+
+    const char* CyaSSL_get_psk_identity_hint(const CYASSL* ssl)
+    {
+        CYASSL_ENTER("SSL_get_psk_identity_hint");
+        return ssl->arrays.server_hint;
+    }
+
+
+    const char* CyaSSL_get_psk_identity(const CYASSL* ssl)
+    {
+        CYASSL_ENTER("SSL_get_psk_identity");
+        return ssl->arrays.client_identity;
+    }
+
+
+    int CyaSSL_CTX_use_psk_identity_hint(CYASSL_CTX* ctx, const char* hint)
+    {
+        CYASSL_ENTER("SSL_CTX_use_psk_identity_hint");
+        if (hint == 0)
+            ctx->server_hint[0] = 0;
+        else {
+            XSTRNCPY(ctx->server_hint, hint, MAX_PSK_ID_LEN);
+            ctx->server_hint[MAX_PSK_ID_LEN - 1] = '\0';
+        }
+        return SSL_SUCCESS;
+    }
+
+
+    int CyaSSL_use_psk_identity_hint(CYASSL* ssl, const char* hint)
+    {
+        CYASSL_ENTER("SSL_use_psk_identity_hint");
+        if (hint == 0)
+            ssl->arrays.server_hint[0] = 0;
+        else {
+            XSTRNCPY(ssl->arrays.server_hint, hint, MAX_PSK_ID_LEN);
+            ssl->arrays.server_hint[MAX_PSK_ID_LEN - 1] = '\0';
+        }
+        return SSL_SUCCESS;
+    }
+
+#endif /* NO_PSK */
+
+
+/* used to be defined on NO_FILESYSTEM only, but are generally useful */
+
+    /* CyaSSL extension allows DER files to be loaded from buffers as well */
+    int CyaSSL_CTX_load_verify_buffer(CYASSL_CTX* ctx, const unsigned char* in,
+                                      long sz, int format)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_load_verify_buffer");
+        if (format == SSL_FILETYPE_PEM)
+            return ProcessChainBuffer(ctx, in, sz, format, CA_TYPE, NULL);
+        else
+            return ProcessBuffer(ctx, in, sz, format, CA_TYPE, NULL,NULL,0);
+    }
+
+
+    int CyaSSL_CTX_use_certificate_buffer(CYASSL_CTX* ctx,
+                                 const unsigned char* in, long sz, int format)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_use_certificate_buffer");
+        return ProcessBuffer(ctx, in, sz, format, CERT_TYPE, NULL, NULL, 0);
+    }
+
+
+    int CyaSSL_CTX_use_PrivateKey_buffer(CYASSL_CTX* ctx,
+                                 const unsigned char* in, long sz, int format)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_use_PrivateKey_buffer");
+        return ProcessBuffer(ctx, in, sz, format, PRIVATEKEY_TYPE, NULL,NULL,0);
+    }
+
+
+    int CyaSSL_CTX_use_certificate_chain_buffer(CYASSL_CTX* ctx,
+                                 const unsigned char* in, long sz)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_use_certificate_chain_buffer");
+        return ProcessBuffer(ctx, in, sz, SSL_FILETYPE_PEM, CERT_TYPE, NULL,
+                             NULL, 1);
+    }
+
+    int CyaSSL_use_certificate_buffer(CYASSL* ssl,
+                                 const unsigned char* in, long sz, int format)
+    {
+        CYASSL_ENTER("CyaSSL_use_certificate_buffer");
+        return ProcessBuffer(ssl->ctx, in, sz, format,CERT_TYPE,ssl,NULL,0);
+    }
+
+
+    int CyaSSL_use_PrivateKey_buffer(CYASSL* ssl,
+                                 const unsigned char* in, long sz, int format)
+    {
+        CYASSL_ENTER("CyaSSL_use_PrivateKey_buffer");
+        return ProcessBuffer(ssl->ctx, in, sz, format, PRIVATEKEY_TYPE, 
+                             ssl, NULL, 0);
+    }
+
+
+    int CyaSSL_use_certificate_chain_buffer(CYASSL* ssl,
+                                 const unsigned char* in, long sz)
+    {
+        CYASSL_ENTER("CyaSSL_use_certificate_chain_buffer");
+        return ProcessBuffer(ssl->ctx, in, sz, SSL_FILETYPE_PEM, CERT_TYPE,
+                             ssl, NULL, 1);
+    }
+
+/* old NO_FILESYSTEM end */
+
+
+#if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
+
+
+    int CyaSSL_add_all_algorithms(void)
+    {
+        CYASSL_ENTER("CyaSSL_add_all_algorithms");
+        CyaSSL_Init();
+        return SSL_SUCCESS;
+    }
+
+
+    long CyaSSL_CTX_sess_set_cache_size(CYASSL_CTX* ctx, long sz)
+    {
+        /* cache size fixed at compile time in CyaSSL */
+        (void)ctx;
+        (void)sz;
+        return 0;
+    }
+
+
+    void CyaSSL_CTX_set_quiet_shutdown(CYASSL_CTX* ctx, int mode)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_set_quiet_shutdown");
+        if (mode)
+            ctx->quietShutdown = 1;
+    }
+
+
+    void CyaSSL_set_quiet_shutdown(CYASSL* ssl, int mode)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_set_quiet_shutdown");
+        if (mode)
+            ssl->options.quietShutdown = 1;
+    }
+
+
+    void CyaSSL_set_bio(CYASSL* ssl, CYASSL_BIO* rd, CYASSL_BIO* wr)
+    {
+        CYASSL_ENTER("SSL_set_bio");
+        CyaSSL_set_rfd(ssl, rd->fd);
+        CyaSSL_set_wfd(ssl, wr->fd);
+
+        ssl->biord = rd;
+        ssl->biowr = wr;
+    }
+
+
+    void CyaSSL_CTX_set_client_CA_list(CYASSL_CTX* ctx,
+                                       STACK_OF(CYASSL_X509_NAME)* names)
+    {
+        (void)ctx; 
+        (void)names; 
+    }
+
+
+    STACK_OF(CYASSL_X509_NAME)* CyaSSL_load_client_CA_file(const char* fname)
+    {
+        (void)fname;
+        return 0;
+    }
+
+
+    int CyaSSL_CTX_set_default_verify_paths(CYASSL_CTX* ctx)
+    {
+        /* TODO:, not needed in goahead */
+        (void)ctx; 
+        return SSL_NOT_IMPLEMENTED;
+    }
+
+
+    /* keyblock size in bytes or -1 */
+    int CyaSSL_get_keyblock_size(CYASSL* ssl)
+    {
+        if (ssl == NULL)
+            return -1;
+
+        return 2 * (ssl->specs.key_size + ssl->specs.iv_size +
+                    ssl->specs.hash_size);
+    }
+
+
+    /* store keys returns 0 or -1 on error */
+    int CyaSSL_get_keys(CYASSL* ssl, unsigned char** ms, unsigned int* msLen,
+                                     unsigned char** sr, unsigned int* srLen,
+                                     unsigned char** cr, unsigned int* crLen)
+    {
+        if (ssl == NULL)
+            return -1;
+
+        *ms = ssl->arrays.masterSecret;
+        *sr = ssl->arrays.serverRandom;
+        *cr = ssl->arrays.clientRandom;
+
+        *msLen = SECRET_LEN;
+        *srLen = RAN_LEN;
+        *crLen = RAN_LEN;
+    
+        return 0;
+    }
+
+
+    void CyaSSL_set_accept_state(CYASSL* ssl)
+    {
+        byte havePSK = 0;
+
+        CYASSL_ENTER("SSL_set_accept_state");
+        ssl->options.side = SERVER_END;
+        /* reset suites in case user switched */
+#ifndef NO_PSK
+        havePSK = ssl->options.havePSK;
+#endif
+        InitSuites(&ssl->suites, ssl->version, ssl->options.haveDH, havePSK,
+                   ssl->options.haveNTRU, ssl->options.haveECDSAsig,
+                   ssl->options.haveStaticECC, ssl->options.side);
+    }
+
+   
+    /* return true if connection established */
+    int CyaSSL_is_init_finished(CYASSL* ssl)
+    {
+        if (ssl == NULL)
+            return 0;
+
+        if (ssl->options.handShakeState == HANDSHAKE_DONE)
+            return 1;
+
+        return 0;
+    }
+
+
+    void CyaSSL_CTX_set_tmp_rsa_callback(CYASSL_CTX* ctx,
+                                      CYASSL_RSA*(*f)(CYASSL*, int, int))
+    {
+        /* CyaSSL verifies all these internally */   
+        (void)ctx; 
+        (void)f; 
+    }
+
+
+    void CyaSSL_set_shutdown(CYASSL* ssl, int opt)
+    {
+        (void)ssl; 
+        (void)opt; 
+    }
+
+
+    long CyaSSL_CTX_set_options(CYASSL_CTX* ctx, long opt)
+    {
+        /* goahead calls with 0, do nothing */ 
+        CYASSL_ENTER("SSL_CTX_set_options");
+        (void)ctx; 
+        return opt;
+    }
+
+
+    int CyaSSL_set_rfd(CYASSL* ssl, int rfd)
+    {
+        CYASSL_ENTER("SSL_set_rfd");
+        ssl->rfd = rfd;      /* not used directly to allow IO callbacks */
+
+        ssl->IOCB_ReadCtx  = &ssl->rfd;
+
+        return SSL_SUCCESS;
+    }
+
+
+    int CyaSSL_set_wfd(CYASSL* ssl, int wfd)
+    {
+        CYASSL_ENTER("SSL_set_wfd");
+        ssl->wfd = wfd;      /* not used directly to allow IO callbacks */
+
+        ssl->IOCB_WriteCtx  = &ssl->wfd;
+
+        return SSL_SUCCESS;
+    }
+
+
+    CYASSL_RSA* CyaSSL_RSA_generate_key(int len, unsigned long bits,
+                                          void(*f)(int, int, void*), void* data)
+    {
+        /* no tmp key needed, actual generation not supported */
+        CYASSL_ENTER("RSA_generate_key");
+        (void)len; 
+        (void)bits; 
+        (void)f; 
+        (void)data; 
+        return NULL;
+    }
+
+
+    /* return the next, if any, altname from the peer cert */
+    char* CyaSSL_X509_get_next_altname(CYASSL_X509* cert)
+    {
+        char* ret = NULL;
+        CYASSL_ENTER("CyaSSL_X509_get_next_altname");
+
+        /* don't have any to work with */
+        if (cert == NULL || cert->altNames == NULL)
+            return NULL;
+
+        /* already went through them */
+        if (cert->altNamesNext == NULL)
+            return NULL;
+
+        ret = cert->altNamesNext->name;
+        cert->altNamesNext = cert->altNamesNext->next;
+
+        return ret;
+    }
+
+
+    CYASSL_X509_NAME* CyaSSL_X509_get_issuer_name(CYASSL_X509* cert)
+    {
+        CYASSL_ENTER("X509_get_issuer_name");
+        return &cert->issuer;
+    }
+
+
+    CYASSL_X509_NAME* CyaSSL_X509_get_subject_name(CYASSL_X509* cert)
+    {
+        CYASSL_ENTER("X509_get_subject_name");
+        return &cert->subject;
+    }
+
+
+    /* copy name into in buffer, at most sz bytes, if buffer is null will
+       malloc buffer, call responsible for freeing                     */
+    char* CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME* name, char* in, int sz)
+    {
+        int copySz = min(sz, name->sz);
+
+        CYASSL_ENTER("CyaSSL_X509_NAME_oneline");
+        if (!name->sz) return in;
+
+        if (!in) {
+            in = (char*)XMALLOC(name->sz, 0, DYNAMIC_TYPE_OPENSSL);
+            if (!in ) return in;
+            copySz = name->sz;
+        }
+
+        if (copySz == 0)
+            return in;
+
+        XMEMCPY(in, name->name, copySz - 1);
+        in[copySz - 1] = 0;
+
+        return in;
+    }
+
+
+    CYASSL_X509* CyaSSL_X509_STORE_CTX_get_current_cert(
+                                                     CYASSL_X509_STORE_CTX* ctx)
+    {
+        (void)ctx; 
+        return 0;
+    }
+
+
+    int CyaSSL_X509_STORE_CTX_get_error(CYASSL_X509_STORE_CTX* ctx)
+    {
+        (void)ctx; 
+        return 0;
+    }
+
+
+    int CyaSSL_X509_STORE_CTX_get_error_depth(CYASSL_X509_STORE_CTX* ctx)
+    {
+        (void)ctx; 
+        return 0;
+    }
+
+
+    CYASSL_BIO_METHOD* CyaSSL_BIO_f_buffer(void)
+    {
+        static CYASSL_BIO_METHOD meth;
+
+        CYASSL_ENTER("BIO_f_buffer");
+        meth.type = BIO_BUFFER;
+
+        return &meth;
+    }
+
+
+    long CyaSSL_BIO_set_write_buffer_size(CYASSL_BIO* bio, long size)
+    {
+        /* CyaSSL has internal buffer, compatibility only */
+        CYASSL_ENTER("BIO_set_write_buffer_size");
+        (void)bio; 
+        return size; 
+    }
+
+
+    CYASSL_BIO_METHOD* CyaSSL_BIO_f_ssl(void)
+    {
+        static CYASSL_BIO_METHOD meth;
+
+        CYASSL_ENTER("BIO_f_ssl");
+        meth.type = BIO_SSL;
+
+        return &meth;
+    }
+
+
+    CYASSL_BIO* CyaSSL_BIO_new_socket(int sfd, int closeF)
+    {
+        CYASSL_BIO* bio = (CYASSL_BIO*) XMALLOC(sizeof(CYASSL_BIO), 0,
+                                                DYNAMIC_TYPE_OPENSSL);
+
+        CYASSL_ENTER("BIO_new_socket");
+        if (bio) { 
+            bio->type  = BIO_SOCKET;
+            bio->close = (byte)closeF;
+            bio->eof   = 0;
+            bio->ssl   = 0;
+            bio->fd    = sfd;
+            bio->prev  = 0;
+            bio->next  = 0;
+        }
+        return bio; 
+    }
+
+
+    int CyaSSL_BIO_eof(CYASSL_BIO* b)
+    {
+        CYASSL_ENTER("BIO_eof");
+        if (b->eof)
+            return 1;
+
+        return 0;        
+    }
+
+
+    long CyaSSL_BIO_set_ssl(CYASSL_BIO* b, CYASSL* ssl, int closeF)
+    {
+        CYASSL_ENTER("BIO_set_ssl");
+        b->ssl   = ssl;
+        b->close = (byte)closeF;
+    /* add to ssl for bio free if SSL_free called before/instead of free_all? */
+
+        return 0;
+    }
+
+
+    CYASSL_BIO* CyaSSL_BIO_new(CYASSL_BIO_METHOD* method)
+    {
+        CYASSL_BIO* bio = (CYASSL_BIO*) XMALLOC(sizeof(CYASSL_BIO), 0,
+                                                DYNAMIC_TYPE_OPENSSL);
+        CYASSL_ENTER("BIO_new");
+        if (bio) {
+            bio->type   = method->type;
+            bio->close  = 0;
+            bio->eof    = 0;
+            bio->ssl    = NULL;
+            bio->mem    = NULL;
+            bio->memLen = 0;
+            bio->fd     = 0;
+            bio->prev   = NULL;
+            bio->next   = NULL;
+        }
+        return bio;
+    }
+
+
+    int CyaSSL_BIO_get_mem_data(CYASSL_BIO* bio, const byte** p)
+    {
+        if (bio == NULL || p == NULL)
+            return -1;
+
+        *p = bio->mem;
+
+        return bio->memLen;
+    }
+
+
+    CYASSL_BIO* CyaSSL_BIO_new_mem_buf(void* buf, int len)
+    {
+        CYASSL_BIO* bio = NULL;
+        if (buf == NULL)
+            return bio;
+
+        bio = CyaSSL_BIO_new(CyaSSL_BIO_s_mem());
+        if (bio == NULL)
+            return bio;
+
+        bio->memLen = len;
+        bio->mem    = (byte*)XMALLOC(len, 0, DYNAMIC_TYPE_OPENSSL);
+        if (bio->mem == NULL) {
+            XFREE(bio, 0, DYNAMIC_TYPE_OPENSSL);
+            return NULL;
+        }
+
+        XMEMCPY(bio->mem, buf, len);
+
+        return bio;
+    }
+
+
+#ifdef USE_WINDOWS_API 
+    #define CloseSocket(s) closesocket(s)
+#else
+    #define CloseSocket(s) close(s)
+#endif
+
+    int CyaSSL_BIO_free(CYASSL_BIO* bio)
+    {
+        /* unchain?, doesn't matter in goahead since from free all */
+        CYASSL_ENTER("BIO_free");
+        if (bio) {
+            if (bio->close) {
+                if (bio->ssl)
+                    CyaSSL_free(bio->ssl);
+                if (bio->fd)
+                    CloseSocket(bio->fd);
+            }
+            if (bio->mem)
+                XFREE(bio->mem, 0, DYNAMIC_TYPE_OPENSSL);
+            XFREE(bio, 0, DYNAMIC_TYPE_OPENSSL);
+        }
+        return 0;
+    }
+
+
+    int CyaSSL_BIO_free_all(CYASSL_BIO* bio)
+    {
+        CYASSL_ENTER("BIO_free_all");
+        while (bio) {
+            CYASSL_BIO* next = bio->next;
+            CyaSSL_BIO_free(bio);
+            bio = next;
+        }
+        return 0;
+    }
+
+
+    int CyaSSL_BIO_read(CYASSL_BIO* bio, void* buf, int len)
+    {
+        int  ret;
+        CYASSL* ssl = 0;
+        CYASSL_BIO* front = bio;
+
+        CYASSL_ENTER("BIO_read");
+        /* already got eof, again is error */
+        if (front->eof)
+            return SSL_FATAL_ERROR;
+
+        while(bio && ((ssl = bio->ssl) == 0) )
+            bio = bio->next;
+
+        if (ssl == 0) return BAD_FUNC_ARG;
+
+        ret = CyaSSL_read(ssl, buf, len);
+        if (ret == 0)
+            front->eof = 1;
+        else if (ret < 0) {
+            int err = CyaSSL_get_error(ssl, 0);
+            if ( !(err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) )
+                front->eof = 1;
+        }
+        return ret;
+    }
+
+
+    int CyaSSL_BIO_write(CYASSL_BIO* bio, const void* data, int len)
+    {
+        int  ret;
+        CYASSL* ssl = 0;
+        CYASSL_BIO* front = bio;
+
+        CYASSL_ENTER("BIO_write");
+        /* already got eof, again is error */
+        if (front->eof)
+            return SSL_FATAL_ERROR;
+
+        while(bio && ((ssl = bio->ssl) == 0) )
+            bio = bio->next;
+
+        if (ssl == 0) return BAD_FUNC_ARG;
+
+        ret = CyaSSL_write(ssl, data, len);
+        if (ret == 0)
+            front->eof = 1;
+        else if (ret < 0) {
+            int err = CyaSSL_get_error(ssl, 0);
+            if ( !(err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) )
+                front->eof = 1;
+        }
+
+        return ret;
+    }
+
+
+    CYASSL_BIO* CyaSSL_BIO_push(CYASSL_BIO* top, CYASSL_BIO* append)
+    {
+        CYASSL_ENTER("BIO_push");
+        top->next    = append;
+        append->prev = top;
+
+        return top;
+    }
+
+
+    int CyaSSL_BIO_flush(CYASSL_BIO* bio)
+    {
+        /* for CyaSSL no flushing needed */
+        CYASSL_ENTER("BIO_flush");
+        (void)bio; 
+        return 1;
+    }
+
+
+#endif /* OPENSSL_EXTRA || GOAHEAD_WS */
+
+
+#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
+
+    void CyaSSL_CTX_set_default_passwd_cb_userdata(CYASSL_CTX* ctx,
+                                                   void* userdata)
+    {
+        CYASSL_ENTER("SSL_CTX_set_default_passwd_cb_userdata");
+        ctx->userdata = userdata;
+    }
+
+
+    void CyaSSL_CTX_set_default_passwd_cb(CYASSL_CTX* ctx, pem_password_cb cb)
+    {
+        CYASSL_ENTER("SSL_CTX_set_default_passwd_cb");
+        ctx->passwd_cb = cb;
+    }
+
+    int CyaSSL_num_locks(void)
+    {
+        return 0;
+    }
+
+    void CyaSSL_set_locking_callback(void (*f)(int, int, const char*, int))
+    {
+        (void)f; 
+    }
+
+    void CyaSSL_set_id_callback(unsigned long (*f)(void))
+    {
+        (void)f; 
+    }
+
+    unsigned long CyaSSL_ERR_get_error(void)
+    {
+        /* TODO: */
+        return 0;
+    }
+
+    int CyaSSL_EVP_BytesToKey(const CYASSL_EVP_CIPHER* type,
+                       const CYASSL_EVP_MD* md, const byte* salt,
+                       const byte* data, int sz, int count, byte* key, byte* iv)
+    {
+        int keyLen = 0;
+        int ivLen  = 0;
+
+        Md5    myMD;
+        byte   digest[MD5_DIGEST_SIZE];
+
+        int j;
+        int keyLeft;
+        int ivLeft;
+        int keyOutput = 0;
+
+        CYASSL_ENTER("EVP_BytesToKey");
+        InitMd5(&myMD);
+
+        /* only support MD5 for now */
+        if (XSTRNCMP(md, "MD5", 3)) return 0;
+
+        /* only support CBC DES and AES for now */
+        if (XSTRNCMP(type, "DES-CBC", 7) == 0) {
+            keyLen = DES_KEY_SIZE;
+            ivLen  = DES_IV_SIZE;
+        }
+        else if (XSTRNCMP(type, "DES-EDE3-CBC", 12) == 0) {
+            keyLen = DES3_KEY_SIZE;
+            ivLen  = DES_IV_SIZE;
+        }
+        else if (XSTRNCMP(type, "AES-128-CBC", 11) == 0) {
+            keyLen = AES_128_KEY_SIZE;
+            ivLen  = AES_IV_SIZE;
+        }
+        else if (XSTRNCMP(type, "AES-192-CBC", 11) == 0) {
+            keyLen = AES_192_KEY_SIZE;
+            ivLen  = AES_IV_SIZE;
+        }
+        else if (XSTRNCMP(type, "AES-256-CBC", 11) == 0) {
+            keyLen = AES_256_KEY_SIZE;
+            ivLen  = AES_IV_SIZE;
+        }
+        else
+            return 0;
+
+        keyLeft   = keyLen;
+        ivLeft    = ivLen;
+
+        while (keyOutput < (keyLen + ivLen)) {
+            int digestLeft = MD5_DIGEST_SIZE;
+            /* D_(i - 1) */
+            if (keyOutput)                      /* first time D_0 is empty */
+                Md5Update(&myMD, digest, MD5_DIGEST_SIZE);
+            /* data */
+            Md5Update(&myMD, data, sz);
+            /* salt */
+            if (salt)
+                Md5Update(&myMD, salt, EVP_SALT_SIZE);
+            Md5Final(&myMD, digest);
+            /* count */
+            for (j = 1; j < count; j++) {
+                Md5Update(&myMD, digest, MD5_DIGEST_SIZE);
+                Md5Final(&myMD, digest);
+            }
+
+            if (keyLeft) {
+                int store = min(keyLeft, MD5_DIGEST_SIZE);
+                XMEMCPY(&key[keyLen - keyLeft], digest, store);
+
+                keyOutput  += store;
+                keyLeft    -= store;
+                digestLeft -= store;
+            }
+
+            if (ivLeft && digestLeft) {
+                int store = min(ivLeft, digestLeft);
+                XMEMCPY(&iv[ivLen - ivLeft], &digest[MD5_DIGEST_SIZE -
+                                                    digestLeft], store);
+                keyOutput += store;
+                ivLeft    -= store;
+            }
+        }
+        if (keyOutput != (keyLen + ivLen))
+            return 0;
+        return keyOutput;
+    }
+
+#endif /* OPENSSL_EXTRA || HAVE_WEBSERVER */
+
+
+#ifdef OPENSSL_EXTRA
+
+    unsigned long CyaSSLeay(void)
+    {
+        return SSLEAY_VERSION_NUMBER;
+    }
+
+
+    const char* CyaSSLeay_version(int type)
+    {
+        static const char* version = "SSLeay CyaSSL compatibility";
+        (void)type; 
+        return version;
+    }
+
+
+    void CyaSSL_MD5_Init(CYASSL_MD5_CTX* md5)
+    {
+        typedef char md5_test[sizeof(MD5_CTX) >= sizeof(Md5) ? 1 : -1];
+        (void)sizeof(md5_test);
+
+        CYASSL_ENTER("MD5_Init");
+        InitMd5((Md5*)md5);
+    }
+
+
+    void CyaSSL_MD5_Update(CYASSL_MD5_CTX* md5, const void* input,
+                           unsigned long sz)
+    {
+        CYASSL_ENTER("CyaSSL_MD5_Update");
+        Md5Update((Md5*)md5, (const byte*)input, sz);
+    }
+
+
+    void CyaSSL_MD5_Final(byte* input, CYASSL_MD5_CTX* md5)
+    {
+        CYASSL_ENTER("MD5_Final");
+        Md5Final((Md5*)md5, input);
+    }
+
+
+    void CyaSSL_SHA_Init(CYASSL_SHA_CTX* sha)
+    {
+        typedef char sha_test[sizeof(SHA_CTX) >= sizeof(Sha) ? 1 : -1];
+        (void)sizeof(sha_test);
+
+        CYASSL_ENTER("SHA_Init");
+        InitSha((Sha*)sha);
+    }
+
+
+    void CyaSSL_SHA_Update(CYASSL_SHA_CTX* sha, const void* input,
+                           unsigned long sz)
+    {
+        CYASSL_ENTER("SHA_Update");
+        ShaUpdate((Sha*)sha, (const byte*)input, sz);
+    }
+
+
+    void CyaSSL_SHA_Final(byte* input, CYASSL_SHA_CTX* sha)
+    {
+        CYASSL_ENTER("SHA_Final");
+        ShaFinal((Sha*)sha, input);
+    }
+
+
+    void CyaSSL_SHA1_Init(CYASSL_SHA_CTX* sha)
+    {
+        CYASSL_ENTER("SHA1_Init");
+        SHA_Init(sha);
+    }
+
+
+    void CyaSSL_SHA1_Update(CYASSL_SHA_CTX* sha, const void* input,
+                            unsigned long sz)
+    {
+        CYASSL_ENTER("SHA1_Update");
+        SHA_Update(sha, input, sz);
+    }
+
+
+    void CyaSSL_SHA1_Final(byte* input, CYASSL_SHA_CTX* sha)
+    {
+        CYASSL_ENTER("SHA1_Final");
+        SHA_Final(input, sha);
+    }
+
+
+    void CyaSSL_SHA256_Init(CYASSL_SHA256_CTX* sha256)
+    {
+        typedef char sha_test[sizeof(SHA256_CTX) >= sizeof(Sha256) ? 1 : -1];
+        (void)sizeof(sha_test);
+
+        CYASSL_ENTER("SHA256_Init");
+        InitSha256((Sha256*)sha256);
+    }
+
+
+    void CyaSSL_SHA256_Update(CYASSL_SHA256_CTX* sha, const void* input,
+                              unsigned long sz)
+    {
+        CYASSL_ENTER("SHA256_Update");
+        Sha256Update((Sha256*)sha, (const byte*)input, sz);
+    }
+
+
+    void CyaSSL_SHA256_Final(byte* input, CYASSL_SHA256_CTX* sha)
+    {
+        CYASSL_ENTER("SHA256_Final");
+        Sha256Final((Sha256*)sha, input);
+    }
+
+
+    #ifdef CYASSL_SHA384
+
+    void CyaSSL_SHA384_Init(CYASSL_SHA384_CTX* sha)
+    {
+        typedef char sha_test[sizeof(SHA384_CTX) >= sizeof(Sha384) ? 1 : -1];
+        (void)sizeof(sha_test);
+
+        CYASSL_ENTER("SHA384_Init");
+        InitSha384((Sha384*)sha);
+    }
+
+
+    void CyaSSL_SHA384_Update(CYASSL_SHA384_CTX* sha, const void* input,
+                           unsigned long sz)
+    {
+        CYASSL_ENTER("SHA384_Update");
+        Sha384Update((Sha384*)sha, (const byte*)input, sz);
+    }
+
+
+    void CyaSSL_SHA384_Final(byte* input, CYASSL_SHA384_CTX* sha)
+    {
+        CYASSL_ENTER("SHA384_Final");
+        Sha384Final((Sha384*)sha, input);
+    }
+
+    #endif /* CYASSL_SHA384 */
+
+
+   #ifdef CYASSL_SHA512
+
+    void CyaSSL_SHA512_Init(CYASSL_SHA512_CTX* sha)
+    {
+        typedef char sha_test[sizeof(SHA512_CTX) >= sizeof(Sha512) ? 1 : -1];
+        (void)sizeof(sha_test);
+
+        CYASSL_ENTER("SHA512_Init");
+        InitSha512((Sha512*)sha);
+    }
+
+
+    void CyaSSL_SHA512_Update(CYASSL_SHA512_CTX* sha, const void* input,
+                           unsigned long sz)
+    {
+        CYASSL_ENTER("SHA512_Update");
+        Sha512Update((Sha512*)sha, (const byte*)input, sz);
+    }
+
+
+    void CyaSSL_SHA512_Final(byte* input, CYASSL_SHA512_CTX* sha)
+    {
+        CYASSL_ENTER("SHA512_Final");
+        Sha512Final((Sha512*)sha, input);
+    }
+
+    #endif /* CYASSL_SHA512 */
+
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_md5(void)
+    {
+        static const char* type = "MD5";
+        CYASSL_ENTER("EVP_md5");
+        return type;
+    }
+
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_sha1(void)
+    {
+        static const char* type = "SHA";
+        CYASSL_ENTER("EVP_sha1");
+        return type;
+    }
+
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_sha256(void)
+    {
+        static const char* type = "SHA256";
+        CYASSL_ENTER("EVP_sha256");
+        return type;
+    }
+
+    #ifdef CYASSL_SHA384
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_sha384(void)
+    {
+        static const char* type = "SHA384";
+        CYASSL_ENTER("EVP_sha384");
+        return type;
+    }
+
+    #endif /* CYASSL_SHA384 */
+
+    #ifdef CYASSL_SHA512
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_sha512(void)
+    {
+        static const char* type = "SHA512";
+        CYASSL_ENTER("EVP_sha512");
+        return type;
+    }
+
+    #endif /* CYASSL_SHA512 */
+
+
+    void CyaSSL_EVP_MD_CTX_init(CYASSL_EVP_MD_CTX* ctx)
+    {
+        CYASSL_ENTER("EVP_CIPHER_MD_CTX_init");
+        (void)ctx; 
+        /* do nothing */ 
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_cbc(void)
+    {
+        static const char* type = "AES128-CBC";
+        CYASSL_ENTER("CyaSSL_EVP_aes_128_cbc");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_cbc(void)
+    {
+        static const char* type = "AES192-CBC";
+        CYASSL_ENTER("CyaSSL_EVP_aes_192_cbc");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_cbc(void)
+    {
+        static const char* type = "AES256-CBC";
+        CYASSL_ENTER("CyaSSL_EVP_aes_256_cbc");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_ctr(void)
+    {
+        static const char* type = "AES128-CTR";
+        CYASSL_ENTER("CyaSSL_EVP_aes_128_ctr");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_ctr(void)
+    {
+        static const char* type = "AES192-CTR";
+        CYASSL_ENTER("CyaSSL_EVP_aes_192_ctr");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_ctr(void)
+    {
+        static const char* type = "AES256-CTR";
+        CYASSL_ENTER("CyaSSL_EVP_aes_256_ctr");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_cbc(void)
+    {
+        static const char* type = "DES-CBC";
+        CYASSL_ENTER("CyaSSL_EVP_des_cbc");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_ede3_cbc(void)
+    {
+        static const char* type = "DES-EDE3-CBC";
+        CYASSL_ENTER("CyaSSL_EVP_des_ede3_cbc");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_rc4(void)
+    {
+        static const char* type = "ARC4";
+        CYASSL_ENTER("CyaSSL_EVP_rc4");
+        return type;
+    }
+
+
+    const CYASSL_EVP_CIPHER* CyaSSL_EVP_enc_null(void)
+    {
+        static const char* type = "NULL";
+        CYASSL_ENTER("CyaSSL_EVP_enc_null");
+        return type;
+    }
+
+
+    int CyaSSL_EVP_MD_CTX_cleanup(CYASSL_EVP_MD_CTX* ctx)
+    {
+        CYASSL_ENTER("EVP_MD_CTX_cleanup");
+        (void)ctx; 
+        return 0;
+    }
+
+
+
+    void CyaSSL_EVP_CIPHER_CTX_init(CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_ENTER("EVP_CIPHER_CTX_init");
+        if (ctx) {
+            ctx->cipherType = 0xff;   /* no init */
+            ctx->keyLen     = 0;
+            ctx->enc        = 1;      /* start in encrypt mode */
+        }
+    }
+
+
+    int CyaSSL_EVP_CIPHER_CTX_cleanup(CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_ENTER("EVP_CIPHER_CTX_cleanup");
+        if (ctx) {
+            ctx->cipherType = 0xff;  /* no more init */
+            ctx->keyLen     = 0;
+        }
+
+        return 1;  /* success */
+    }    
+
+    int  CyaSSL_EVP_CipherInit(CYASSL_EVP_CIPHER_CTX* ctx,
+                               const CYASSL_EVP_CIPHER* type, byte* key,
+                               byte* iv, int enc)
+    {
+        CYASSL_ENTER("CyaSSL_EVP_CipherInit");
+        if (ctx == NULL) {
+            CYASSL_MSG("no ctx");
+            return 0;   /* failure */
+        }
+
+        if (type == NULL && ctx->cipherType == 0xff) {
+            CYASSL_MSG("no type set");
+            return 0;   /* failure */
+        }
+
+        if (ctx->cipherType == AES_128_CBC_TYPE || (type &&
+                                       XSTRNCMP(type, "AES128-CBC", 10) == 0)) {
+            CYASSL_MSG("AES-128-CBC");
+            ctx->cipherType = AES_128_CBC_TYPE;
+            ctx->keyLen     = 16;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          ctx->enc ? AES_ENCRYPTION : AES_DECRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+        else if (ctx->cipherType == AES_192_CBC_TYPE || (type &&
+                                       XSTRNCMP(type, "AES192-CBC", 10) == 0)) {
+            CYASSL_MSG("AES-192-CBC");
+            ctx->cipherType = AES_192_CBC_TYPE;
+            ctx->keyLen     = 24;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          ctx->enc ? AES_ENCRYPTION : AES_DECRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+        else if (ctx->cipherType == AES_256_CBC_TYPE || (type &&
+                                       XSTRNCMP(type, "AES256-CBC", 10) == 0)) {
+            CYASSL_MSG("AES-256-CBC");
+            ctx->cipherType = AES_256_CBC_TYPE;
+            ctx->keyLen     = 32;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          ctx->enc ? AES_ENCRYPTION : AES_DECRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+#ifdef CYASSL_AES_COUNTER
+        else if (ctx->cipherType == AES_128_CTR_TYPE || (type &&
+                                       XSTRNCMP(type, "AES128-CTR", 10) == 0)) {
+            CYASSL_MSG("AES-128-CTR");
+            ctx->cipherType = AES_128_CTR_TYPE;
+            ctx->keyLen     = 16;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          AES_ENCRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+        else if (ctx->cipherType == AES_192_CTR_TYPE || (type &&
+                                       XSTRNCMP(type, "AES192-CTR", 10) == 0)) {
+            CYASSL_MSG("AES-192-CTR");
+            ctx->cipherType = AES_192_CTR_TYPE;
+            ctx->keyLen     = 24;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          AES_ENCRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+        else if (ctx->cipherType == AES_256_CTR_TYPE || (type &&
+                                       XSTRNCMP(type, "AES256-CTR", 10) == 0)) {
+            CYASSL_MSG("AES-256-CTR");
+            ctx->cipherType = AES_256_CTR_TYPE;
+            ctx->keyLen     = 32;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                AesSetKey(&ctx->cipher.aes, key, ctx->keyLen, iv,
+                          AES_ENCRYPTION);
+            if (iv && key == NULL)
+                AesSetIV(&ctx->cipher.aes, iv);
+        }
+#endif /* CYASSL_AES_CTR */
+        else if (ctx->cipherType == DES_CBC_TYPE || (type &&
+                                       XSTRNCMP(type, "DES-CBC", 7) == 0)) {
+            CYASSL_MSG("DES-CBC");
+            ctx->cipherType = DES_CBC_TYPE;
+            ctx->keyLen     = 8;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                Des_SetKey(&ctx->cipher.des, key, iv,
+                          ctx->enc ? DES_ENCRYPTION : DES_DECRYPTION);
+            if (iv && key == NULL)
+                Des_SetIV(&ctx->cipher.des, iv);
+        }
+        else if (ctx->cipherType == DES_EDE3_CBC_TYPE || (type &&
+                                     XSTRNCMP(type, "DES-EDE3-CBC", 11) == 0)) {
+            CYASSL_MSG("DES-EDE3-CBC");
+            ctx->cipherType = DES_EDE3_CBC_TYPE;
+            ctx->keyLen     = 24;
+            if (enc == 0 || enc == 1)
+                ctx->enc = enc ? 1 : 0;
+            if (key)
+                Des3_SetKey(&ctx->cipher.des3, key, iv,
+                          ctx->enc ? DES_ENCRYPTION : DES_DECRYPTION);
+            if (iv && key == NULL)
+                Des3_SetIV(&ctx->cipher.des3, iv);
+        }
+        else if (ctx->cipherType == ARC4_TYPE || (type &&
+                                     XSTRNCMP(type, "ARC4", 4) == 0)) {
+            CYASSL_MSG("ARC4");
+            ctx->cipherType = ARC4_TYPE;
+            if (ctx->keyLen == 0)  /* user may have already set */
+                ctx->keyLen = 16;  /* default to 128 */
+            if (key)
+                Arc4SetKey(&ctx->cipher.arc4, key, ctx->keyLen); 
+        }
+        else if (ctx->cipherType == NULL_CIPHER_TYPE || (type &&
+                                     XSTRNCMP(type, "NULL", 4) == 0)) {
+            CYASSL_MSG("NULL cipher");
+            ctx->cipherType = NULL_CIPHER_TYPE;
+            ctx->keyLen = 0; 
+        }
+        else
+            return 0;   /* failure */
+
+
+        return 1;   /* success */
+    }
+
+
+    int CyaSSL_EVP_CIPHER_CTX_key_length(CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_ENTER("CyaSSL_EVP_CIPHER_CTX_key_length");
+        if (ctx)
+            return ctx->keyLen;
+
+        return 0;   /* failure */
+    }
+
+
+    int CyaSSL_EVP_CIPHER_CTX_set_key_length(CYASSL_EVP_CIPHER_CTX* ctx,
+                                             int keylen)
+    {
+        CYASSL_ENTER("CyaSSL_EVP_CIPHER_CTX_set_key_length");
+        if (ctx)
+            ctx->keyLen = keylen;
+        else
+            return 0;  /* failure */
+
+        return 1;  /* success */
+    }
+
+
+    int CyaSSL_EVP_Cipher(CYASSL_EVP_CIPHER_CTX* ctx, byte* dst, byte* src,
+                          word32 len)
+    {
+        CYASSL_ENTER("CyaSSL_EVP_Cipher");
+
+        if (ctx == NULL || dst == NULL || src == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return 0;  /* failure */
+        }
+
+        if (ctx->cipherType == 0xff) { 
+            CYASSL_MSG("no init");
+            return 0;  /* failure */
+        }
+
+        switch (ctx->cipherType) {
+
+            case AES_128_CBC_TYPE :
+            case AES_192_CBC_TYPE :
+            case AES_256_CBC_TYPE :
+                CYASSL_MSG("AES CBC");
+                if (ctx->enc)
+                    AesCbcEncrypt(&ctx->cipher.aes, dst, src, len);
+                else
+                    AesCbcDecrypt(&ctx->cipher.aes, dst, src, len);
+                break;
+
+#ifdef CYASSL_AES_COUNTER
+            case AES_128_CTR_TYPE :
+            case AES_192_CTR_TYPE :
+            case AES_256_CTR_TYPE :
+                    CYASSL_MSG("AES CTR");
+                    AesCtrEncrypt(&ctx->cipher.aes, dst, src, len);
+                break;
+#endif
+
+            case DES_CBC_TYPE :
+                if (ctx->enc)
+                    Des_CbcEncrypt(&ctx->cipher.des, dst, src, len);
+                else
+                    Des_CbcDecrypt(&ctx->cipher.des, dst, src, len);
+                break;
+                
+            case DES_EDE3_CBC_TYPE :
+                if (ctx->enc)
+                    Des3_CbcEncrypt(&ctx->cipher.des3, dst, src, len);
+                else
+                    Des3_CbcDecrypt(&ctx->cipher.des3, dst, src, len);
+                break;
+
+            case ARC4_TYPE :
+                Arc4Process(&ctx->cipher.arc4, dst, src, len);
+                break;
+
+            case NULL_CIPHER_TYPE :
+                XMEMCPY(dst, src, len);
+                break;
+
+            default: {
+                CYASSL_MSG("bad type");
+                return 0;  /* failure */
+            }
+        }    
+
+        CYASSL_MSG("CyaSSL_EVP_Cipher success");
+        return 1;  /* success */ 
+    }
+
+
+    /* store for external read of iv, 0 on success */
+    int  CyaSSL_StoreExternalIV(CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_ENTER("CyaSSL_StoreExternalIV");
+
+        if (ctx == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return -1;
+        }
+    
+        switch (ctx->cipherType) {
+
+            case AES_128_CBC_TYPE :
+            case AES_192_CBC_TYPE :
+            case AES_256_CBC_TYPE :
+                CYASSL_MSG("AES CBC");
+                memcpy(ctx->iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE);
+                break;
+
+#ifdef CYASSL_AES_COUNTER
+            case AES_128_CTR_TYPE :
+            case AES_192_CTR_TYPE :
+            case AES_256_CTR_TYPE :
+                CYASSL_MSG("AES CTR");
+                memcpy(ctx->iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE);
+                break;
+#endif
+
+            case DES_CBC_TYPE :
+                CYASSL_MSG("DES CBC");
+                memcpy(ctx->iv, &ctx->cipher.des.reg, DES_BLOCK_SIZE);
+                break;
+                
+            case DES_EDE3_CBC_TYPE :
+                CYASSL_MSG("DES EDE3 CBC");
+                memcpy(ctx->iv, &ctx->cipher.des.reg, DES_BLOCK_SIZE);
+                break;
+
+            case ARC4_TYPE :
+                CYASSL_MSG("ARC4");
+                break;
+
+            case NULL_CIPHER_TYPE :
+                CYASSL_MSG("NULL");
+                break;
+
+            default: {
+                CYASSL_MSG("bad type");
+                return -1;  /* failure */
+            }
+        }    
+        return 0;  /* success */
+    }
+
+
+    /* set internal IV from external, 0 on success */
+    int  CyaSSL_SetInternalIV(CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+
+        CYASSL_ENTER("CyaSSL_SetInternalIV");
+
+        if (ctx == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return -1;
+        }
+    
+        switch (ctx->cipherType) {
+
+            case AES_128_CBC_TYPE :
+            case AES_192_CBC_TYPE :
+            case AES_256_CBC_TYPE :
+                CYASSL_MSG("AES CBC");
+                memcpy(&ctx->cipher.aes.reg, ctx->iv, AES_BLOCK_SIZE);
+                break;
+
+#ifdef CYASSL_AES_COUNTER
+            case AES_128_CTR_TYPE :
+            case AES_192_CTR_TYPE :
+            case AES_256_CTR_TYPE :
+                CYASSL_MSG("AES CTR");
+                memcpy(&ctx->cipher.aes.reg, ctx->iv, AES_BLOCK_SIZE);
+                break;
+#endif
+
+            case DES_CBC_TYPE :
+                CYASSL_MSG("DES CBC");
+                memcpy(&ctx->cipher.des.reg, ctx->iv, DES_BLOCK_SIZE);
+                break;
+                
+            case DES_EDE3_CBC_TYPE :
+                CYASSL_MSG("DES EDE3 CBC");
+                memcpy(&ctx->cipher.des.reg, ctx->iv, DES_BLOCK_SIZE);
+                break;
+
+            case ARC4_TYPE :
+                CYASSL_MSG("ARC4");
+                break;
+
+            case NULL_CIPHER_TYPE :
+                CYASSL_MSG("NULL");
+                break;
+
+            default: {
+                CYASSL_MSG("bad type");
+                return -1;  /* failure */
+            }
+        }    
+        return 0;  /* success */
+    }
+
+
+    int CyaSSL_EVP_DigestInit(CYASSL_EVP_MD_CTX* ctx, const CYASSL_EVP_MD* type)
+    {
+        CYASSL_ENTER("EVP_DigestInit");
+        if (XSTRNCMP(type, "MD5", 3) == 0) {
+             ctx->macType = MD5;
+             CyaSSL_MD5_Init((MD5_CTX*)&ctx->hash);
+        }
+        else if (XSTRNCMP(type, "SHA256", 6) == 0) {
+             ctx->macType = SHA256;
+             CyaSSL_SHA256_Init((SHA256_CTX*)&ctx->hash);
+        }
+    #ifdef CYASSL_SHA384
+        else if (XSTRNCMP(type, "SHA384", 6) == 0) {
+             ctx->macType = SHA384;
+             CyaSSL_SHA384_Init((SHA384_CTX*)&ctx->hash);
+        }
+    #endif
+    #ifdef CYASSL_SHA512
+        else if (XSTRNCMP(type, "SHA512", 6) == 0) {
+             ctx->macType = SHA512;
+             CyaSSL_SHA512_Init((SHA512_CTX*)&ctx->hash);
+        }
+    #endif
+        /* has to be last since would pick or 256, 384, or 512 too */
+        else if (XSTRNCMP(type, "SHA", 3) == 0) {
+             ctx->macType = SHA;
+             CyaSSL_SHA_Init((SHA_CTX*)&ctx->hash);
+        }    
+        else
+             return BAD_FUNC_ARG;
+
+        return 0;
+    }
+
+
+    int CyaSSL_EVP_DigestUpdate(CYASSL_EVP_MD_CTX* ctx, const void* data,
+                                unsigned long sz)
+    {
+        CYASSL_ENTER("EVP_DigestUpdate");
+        if (ctx->macType == MD5) 
+            CyaSSL_MD5_Update((MD5_CTX*)&ctx->hash, data, (unsigned long)sz);
+        else if (ctx->macType == SHA) 
+            CyaSSL_SHA_Update((SHA_CTX*)&ctx->hash, data, (unsigned long)sz);
+        else if (ctx->macType == SHA256) 
+            CyaSSL_SHA256_Update((SHA256_CTX*)&ctx->hash, data,
+                                 (unsigned long)sz);
+    #ifdef CYASSL_SHA384
+        else if (ctx->macType == SHA384) 
+            CyaSSL_SHA384_Update((SHA384_CTX*)&ctx->hash, data,
+                                 (unsigned long)sz);
+    #endif
+    #ifdef CYASSL_SHA512
+        else if (ctx->macType == SHA512) 
+            CyaSSL_SHA512_Update((SHA512_CTX*)&ctx->hash, data,
+                                 (unsigned long)sz);
+    #endif
+        else
+            return BAD_FUNC_ARG;
+
+        return 0;
+    }
+
+
+    int CyaSSL_EVP_DigestFinal(CYASSL_EVP_MD_CTX* ctx, unsigned char* md,
+                               unsigned int* s)
+    {
+        CYASSL_ENTER("EVP_DigestFinal");
+        if (ctx->macType == MD5) {
+            CyaSSL_MD5_Final(md, (MD5_CTX*)&ctx->hash);
+            if (s) *s = MD5_DIGEST_SIZE;
+        }
+        else if (ctx->macType == SHA) {
+            CyaSSL_SHA_Final(md, (SHA_CTX*)&ctx->hash);
+            if (s) *s = SHA_DIGEST_SIZE;
+        }
+        else if (ctx->macType == SHA256) {
+            CyaSSL_SHA256_Final(md, (SHA256_CTX*)&ctx->hash);
+            if (s) *s = SHA256_DIGEST_SIZE;
+        }
+    #ifdef CYASSL_SHA384
+        else if (ctx->macType == SHA384) {
+            CyaSSL_SHA384_Final(md, (SHA384_CTX*)&ctx->hash);
+            if (s) *s = SHA384_DIGEST_SIZE;
+        }
+    #endif
+    #ifdef CYASSL_SHA512
+        else if (ctx->macType == SHA512) {
+            CyaSSL_SHA512_Final(md, (SHA512_CTX*)&ctx->hash);
+            if (s) *s = SHA512_DIGEST_SIZE;
+        }
+    #endif
+        else
+            return BAD_FUNC_ARG;
+
+        return 0;
+    }
+
+
+    int CyaSSL_EVP_DigestFinal_ex(CYASSL_EVP_MD_CTX* ctx, unsigned char* md,
+                                  unsigned int* s)
+    {
+        CYASSL_ENTER("EVP_DigestFinal_ex");
+        return EVP_DigestFinal(ctx, md, s);
+    }
+
+
+    unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md, const void* key,
+                               int key_len, const unsigned char* d, int n,
+                               unsigned char* md, unsigned int* md_len)
+    {
+        Hmac hmac;
+
+        CYASSL_ENTER("HMAC");
+        if (!md) return 0;  /* no static buffer support */
+
+        if (XSTRNCMP(evp_md, "MD5", 3) == 0) {
+            HmacSetKey(&hmac, MD5, (const byte*)key, key_len);
+            if (md_len) *md_len = MD5_DIGEST_SIZE;
+        }
+        else if (XSTRNCMP(evp_md, "SHA", 3) == 0) {
+            HmacSetKey(&hmac, SHA, (const byte*)key, key_len);    
+            if (md_len) *md_len = SHA_DIGEST_SIZE;
+        }
+        else
+            return 0;
+
+        HmacUpdate(&hmac, d, n);
+        HmacFinal(&hmac, md);
+    
+        return md;
+    }
+
+    void CyaSSL_ERR_clear_error(void)
+    {
+        /* TODO: */
+    }
+
+
+    int CyaSSL_RAND_status(void)
+    {
+        return 1;  /* CTaoCrypt provides enough seed internally */
+    }
+
+
+
+    void CyaSSL_RAND_add(const void* add, int len, double entropy)
+    {
+        (void)add;
+        (void)len;
+        (void)entropy;
+
+        /* CyaSSL seeds/adds internally, use explicit RNG if you want
+           to take control */
+    }
+
+
+    int CyaSSL_DES_key_sched(CYASSL_const_DES_cblock* key,
+                             CYASSL_DES_key_schedule* schedule)
+    {
+        CYASSL_ENTER("DES_key_sched");
+        XMEMCPY(schedule, key, sizeof(const_DES_cblock));
+        return 0;
+    }
+
+
+    void CyaSSL_DES_cbc_encrypt(const unsigned char* input,
+                     unsigned char* output, long length,
+                     CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec,
+                     int enc)
+    {
+        Des myDes;
+        CYASSL_ENTER("DES_cbc_encrypt");
+        Des_SetKey(&myDes, (const byte*)schedule, (const byte*)ivec, !enc);
+
+        if (enc)
+            Des_CbcEncrypt(&myDes, output, input, length);
+        else
+            Des_CbcDecrypt(&myDes, output, input, length);
+    }
+
+
+    /* correctly sets ivec for next call */
+    void CyaSSL_DES_ncbc_encrypt(const unsigned char* input,
+                     unsigned char* output, long length,
+                     CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec,
+                     int enc)
+    {
+        Des myDes;
+        CYASSL_ENTER("DES_ncbc_encrypt");
+        Des_SetKey(&myDes, (const byte*)schedule, (const byte*)ivec, !enc);
+
+        if (enc)
+            Des_CbcEncrypt(&myDes, output, input, length);
+        else
+            Des_CbcDecrypt(&myDes, output, input, length);
+
+        XMEMCPY(ivec, output + length - sizeof(DES_cblock), sizeof(DES_cblock));
+    }
+
+
+    void CyaSSL_ERR_free_strings(void)
+    {
+        /* handled internally */
+    }
+
+
+    void CyaSSL_ERR_remove_state(unsigned long state)
+    {
+        /* TODO: GetErrors().Remove(); */
+        (void)state; 
+    }
+
+
+    void CyaSSL_EVP_cleanup(void)
+    {
+        /* nothing to do here */
+    }
+
+
+    void CyaSSL_cleanup_all_ex_data(void)
+    {
+        /* nothing to do here */
+    }
+
+
+    long CyaSSL_CTX_set_mode(CYASSL_CTX* ctx, long mode)
+    {
+        /* SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER is CyaSSL default mode */
+
+        CYASSL_ENTER("SSL_CTX_set_mode");
+        if (mode == SSL_MODE_ENABLE_PARTIAL_WRITE)
+            ctx->partialWrite = 1;
+
+        return mode;
+    }
+
+
+    long CyaSSL_CTX_get_mode(CYASSL_CTX* ctx)
+    {
+        /* TODO: */
+        (void)ctx; 
+        return 0;
+    }
+
+
+    void CyaSSL_CTX_set_default_read_ahead(CYASSL_CTX* ctx, int m)
+    {
+        /* TODO: maybe? */
+        (void)ctx; 
+        (void)m; 
+    }
+
+
+    int CyaSSL_CTX_set_session_id_context(CYASSL_CTX* ctx,
+                                       const unsigned char* sid_ctx,
+                                       unsigned int sid_ctx_len)
+    {
+        /* No application specific context needed for cyaSSL */
+        (void)ctx; 
+        (void)sid_ctx; 
+        (void)sid_ctx_len; 
+        return SSL_SUCCESS;
+    }
+
+
+    long CyaSSL_CTX_sess_get_cache_size(CYASSL_CTX* ctx)
+    {
+        /* TODO: maybe? */
+        (void)ctx; 
+        return (~0);
+    }
+
+    unsigned long CyaSSL_ERR_get_error_line_data(const char** file, int* line,
+                                          const char** data, int *flags)
+    {
+        /* Not implemented */
+        (void)file; 
+        (void)line; 
+        (void)data; 
+        (void)flags; 
+        return 0;
+    }
+
+
+    CYASSL_X509* CyaSSL_get_peer_certificate(CYASSL* ssl)
+    {
+        CYASSL_ENTER("SSL_get_peer_certificate");
+        if (ssl->peerCert.issuer.sz)
+            return &ssl->peerCert;
+        else
+            return 0;
+    }
+
+
+
+    int CyaSSL_set_ex_data(CYASSL* ssl, int idx, void* data)
+    {
+#ifdef FORTRESS
+        if (ssl != NULL && idx < MAX_EX_DATA)
+        {
+            ssl->ex_data[idx] = data;
+            return SSL_SUCCESS;
+        }
+#else
+        (void)ssl;
+        (void)idx;
+        (void)data;
+#endif
+        return SSL_FAILURE;
+    }
+
+
+    int CyaSSL_get_shutdown(const CYASSL* ssl)
+    {
+        (void)ssl;
+        return 0;
+    }
+
+
+    int CyaSSL_set_session_id_context(CYASSL* ssl, const unsigned char* id,
+                                   unsigned int len)
+    {
+        (void)ssl;
+        (void)id;
+        (void)len;
+        return 0;
+    }
+
+
+    void CyaSSL_set_connect_state(CYASSL* ssl)
+    {
+        (void)ssl;
+        /* client by default */ 
+    }
+
+
+    int CyaSSL_session_reused(CYASSL* ssl)
+    {
+        return ssl->options.resuming;
+    }
+
+
+    void CyaSSL_SESSION_free(CYASSL_SESSION* session)
+    {
+        (void)session;
+    }
+
+
+    const char* CyaSSL_get_version(CYASSL* ssl)
+    {
+        CYASSL_ENTER("SSL_get_version");
+        if (ssl->version.major == SSLv3_MAJOR) {
+            switch (ssl->version.minor) {
+                case SSLv3_MINOR :
+                    return "SSLv3";
+                case TLSv1_MINOR :
+                    return "TLSv1";
+                case TLSv1_1_MINOR :
+                    return "TLSv1.1";
+                case TLSv1_2_MINOR :
+                    return "TLSv1.2";
+                default:
+                    return "unknown";
+            }
+        }
+        else if (ssl->version.major == DTLS_MAJOR)
+            return "DTLS";
+        return "unknown";
+    }
+
+
+    CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL* ssl)
+    {
+        CYASSL_ENTER("SSL_get_current_cipher");
+        if (ssl)
+            return &ssl->cipher;
+        else
+            return NULL;
+    }
+
+
+    const char* CyaSSL_CIPHER_get_name(const CYASSL_CIPHER* cipher)
+    {
+        CYASSL_ENTER("SSL_CIPHER_get_name");
+        if (cipher) {
+#ifdef HAVE_ECC
+            if (cipher->ssl->options.cipherSuite0 == ECC_BYTE) {
+            /* ECC suites */
+            switch (cipher->ssl->options.cipherSuite) {
+                case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA";
+                case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA";
+                case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA";
+                case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA";
+                case TLS_ECDHE_RSA_WITH_RC4_128_SHA :
+                    return "TLS_ECDHE_RSA_WITH_RC4_128_SHA";
+                case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA :
+                    return "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA";
+                case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA :
+                    return "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA";
+                case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA :
+                    return "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA";
+
+                case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA";
+                case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA";
+                case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA";
+                case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA";
+                case TLS_ECDH_RSA_WITH_RC4_128_SHA :
+                    return "TLS_ECDH_RSA_WITH_RC4_128_SHA";
+                case TLS_ECDH_ECDSA_WITH_RC4_128_SHA :
+                    return "TLS_ECDH_ECDSA_WITH_RC4_128_SHA";
+                case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA :
+                    return "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA";
+                case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA :
+                    return "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA";
+
+                case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256";
+                case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384";
+                case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256";
+                case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384";
+                case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256";
+                case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384";
+                case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256";
+                case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384";
+
+                default:
+                    return "NONE";
+            }
+            }
+#endif
+            if (cipher->ssl->options.cipherSuite0 != ECC_BYTE) {
+            /* normal suites */
+            switch (cipher->ssl->options.cipherSuite) {
+                case SSL_RSA_WITH_RC4_128_SHA :
+                    return "SSL_RSA_WITH_RC4_128_SHA";
+                case SSL_RSA_WITH_RC4_128_MD5 :
+                    return "SSL_RSA_WITH_RC4_128_MD5";
+                case SSL_RSA_WITH_3DES_EDE_CBC_SHA :
+                    return "SSL_RSA_WITH_3DES_EDE_CBC_SHA";
+                case TLS_RSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_RSA_WITH_AES_128_CBC_SHA";
+                case TLS_RSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_RSA_WITH_AES_256_CBC_SHA";
+                case TLS_RSA_WITH_AES_128_CBC_SHA256 :
+                    return "TLS_RSA_WITH_AES_128_CBC_SHA256";
+                case TLS_RSA_WITH_AES_256_CBC_SHA256 :
+                    return "TLS_RSA_WITH_AES_256_CBC_SHA256";
+                case TLS_PSK_WITH_AES_128_CBC_SHA :
+                    return "TLS_PSK_WITH_AES_128_CBC_SHA";
+                case TLS_PSK_WITH_AES_256_CBC_SHA :
+                    return "TLS_PSK_WITH_AES_256_CBC_SHA";
+                case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 :
+                    return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256";
+                case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :
+                    return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256";
+                case TLS_DHE_RSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA";
+                case TLS_DHE_RSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA";
+                case TLS_RSA_WITH_HC_128_CBC_MD5 :
+                    return "TLS_RSA_WITH_HC_128_CBC_MD5";
+                case TLS_RSA_WITH_HC_128_CBC_SHA :
+                    return "TLS_RSA_WITH_HC_128_CBC_SHA";
+                case TLS_RSA_WITH_RABBIT_CBC_SHA :
+                    return "TLS_RSA_WITH_RABBIT_CBC_SHA";
+                case TLS_NTRU_RSA_WITH_RC4_128_SHA :
+                    return "TLS_NTRU_RSA_WITH_RC4_128_SHA";
+                case TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA :
+                    return "TLS_NTRU_RSA_WITH_3DES_EDE_CBC_SHA";
+                case TLS_NTRU_RSA_WITH_AES_128_CBC_SHA :
+                    return "TLS_NTRU_RSA_WITH_AES_128_CBC_SHA";
+                case TLS_NTRU_RSA_WITH_AES_256_CBC_SHA :
+                    return "TLS_NTRU_RSA_WITH_AES_256_CBC_SHA";
+                case TLS_RSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_RSA_WITH_AES_128_GCM_SHA256";
+                case TLS_RSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_RSA_WITH_AES_256_GCM_SHA384";
+                case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 :
+                    return "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
+                case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 :
+                    return "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384";
+                default:
+                    return "NONE";
+            }  /* switch */
+            }  /* normal / ECC */
+        }
+
+        return "NONE";
+    }
+
+
+    const char* CyaSSL_get_cipher(CYASSL* ssl)
+    {
+        CYASSL_ENTER("CyaSSL_get_cipher");
+        return CyaSSL_CIPHER_get_name(CyaSSL_get_current_cipher(ssl));
+    }
+
+
+    /* server ctx Diffie-Hellman parameters */
+    int CyaSSL_CTX_SetTmpDH(CYASSL_CTX* ctx, const unsigned char* p, int pSz,
+                            const unsigned char* g, int gSz)
+    {
+        CYASSL_ENTER("CyaSSL_CTX_SetTmpDH");
+        if (ctx == NULL || p == NULL || g == NULL) return BAD_FUNC_ARG;
+
+        XFREE(ctx->serverDH_P.buffer, ctx->heap, DYNAMIC_TYPE_DH);
+        XFREE(ctx->serverDH_G.buffer, ctx->heap, DYNAMIC_TYPE_DH);
+
+        ctx->serverDH_P.buffer = (byte*)XMALLOC(pSz, ctx->heap,DYNAMIC_TYPE_DH);
+        if (ctx->serverDH_P.buffer == NULL)
+            return MEMORY_E;
+
+        ctx->serverDH_G.buffer = (byte*)XMALLOC(gSz, ctx->heap,DYNAMIC_TYPE_DH);
+        if (ctx->serverDH_G.buffer == NULL) {
+            XFREE(ctx->serverDH_P.buffer, ctx->heap, DYNAMIC_TYPE_DH);
+            return MEMORY_E;
+        }
+
+        ctx->serverDH_P.length = pSz;
+        ctx->serverDH_G.length = gSz;
+
+        XMEMCPY(ctx->serverDH_P.buffer, p, pSz);
+        XMEMCPY(ctx->serverDH_G.buffer, g, gSz);
+
+        ctx->haveDH = 1;
+
+        CYASSL_LEAVE("CyaSSL_CTX_SetTmpDH", 0);
+        return 0;
+    }
+
+
+    char* CyaSSL_CIPHER_description(CYASSL_CIPHER* cipher, char* in, int len)
+    {
+        (void)cipher;
+        (void)in;
+        (void)len;
+        return 0;
+    }
+
+
+    CYASSL_SESSION* CyaSSL_get1_session(CYASSL* ssl)  /* what's ref count */
+    {
+        (void)ssl;
+        return 0;
+    }
+
+
+    void CyaSSL_X509_free(CYASSL_X509* buf)
+    {
+        (void)buf;
+    }
+
+
+    /* was do nothing */
+    /*
+    void OPENSSL_free(void* buf)
+    {
+        (void)buf;
+    }
+    */
+
+
+    int CyaSSL_OCSP_parse_url(char* url, char** host, char** port, char** path,
+                       int* ssl)
+    {
+        (void)url;
+        (void)host;
+        (void)port;
+        (void)path;
+        (void)ssl;
+        return 0;
+    }
+
+
+    CYASSL_METHOD* CyaSSLv2_client_method(void)
+    {
+        return 0;
+    }
+
+
+    CYASSL_METHOD* CyaSSLv2_server_method(void)
+    {
+        return 0;
+    }
+
+
+#ifndef NO_MD4
+
+    void CyaSSL_MD4_Init(CYASSL_MD4_CTX* md4)
+    {
+        /* make sure we have a big enough buffer */
+        typedef char ok[sizeof(md4->buffer) >= sizeof(Md4) ? 1 : -1];
+        (void) sizeof(ok);
+        CYASSL_ENTER("MD4_Init");
+        InitMd4((Md4*)md4);    
+    }
+
+
+    void CyaSSL_MD4_Update(CYASSL_MD4_CTX* md4, const void* data,
+                           unsigned long len)
+    {
+        CYASSL_ENTER("MD4_Update");
+        Md4Update((Md4*)md4, (const byte*)data, (word32)len); 
+    }
+
+
+    void CyaSSL_MD4_Final(unsigned char* digest, CYASSL_MD4_CTX* md4)
+    {
+        CYASSL_ENTER("MD4_Final");
+        Md4Final((Md4*)md4, digest); 
+    }
+
+#endif /* NO_MD4 */
+
+
+    CYASSL_BIO* CyaSSL_BIO_pop(CYASSL_BIO* top)
+    {
+        (void)top;
+        return 0;
+    }
+
+
+    int CyaSSL_BIO_pending(CYASSL_BIO* bio)
+    {
+        (void)bio;
+        return 0;
+    }
+
+
+
+    CYASSL_BIO_METHOD* CyaSSL_BIO_s_mem(void)
+    {
+        static CYASSL_BIO_METHOD meth;
+
+        CYASSL_ENTER("BIO_s_mem");
+        meth.type = BIO_MEMORY;
+
+        return &meth;
+    }
+
+
+    CYASSL_BIO_METHOD* CyaSSL_BIO_f_base64(void)
+    {
+        return 0;
+    }
+
+
+    void CyaSSL_BIO_set_flags(CYASSL_BIO* bio, int flags)
+    {
+        (void)bio;
+        (void)flags;
+    }
+
+
+
+    void CyaSSL_RAND_screen(void)
+    {
+    
+    }
+
+
+    const char* CyaSSL_RAND_file_name(char* fname, unsigned long len)
+    {
+        (void)fname;
+        (void)len;
+        return 0;
+    }
+
+
+    int CyaSSL_RAND_write_file(const char* fname)
+    {
+        (void)fname;
+        return 0;
+    }
+
+
+    int CyaSSL_RAND_load_file(const char* fname, long len)
+    {
+        (void)fname;
+        /* CTaoCrypt provides enough entropy internally or will report error */
+        if (len == -1)
+            return 1024;
+        else
+            return (int)len;
+    }
+
+
+    int CyaSSL_RAND_egd(const char* path)
+    {
+        (void)path;
+        return 0;
+    }
+
+
+
+    CYASSL_COMP_METHOD* CyaSSL_COMP_zlib(void)
+    {
+        return 0;
+    }
+
+
+    CYASSL_COMP_METHOD* CyaSSL_COMP_rle(void)
+    {
+        return 0;
+    }
+
+
+    int CyaSSL_COMP_add_compression_method(int method, void* data)
+    {
+        (void)method;
+        (void)data;
+        return 0;
+    }
+
+
+
+    int CyaSSL_get_ex_new_index(long idx, void* data, void* cb1, void* cb2,
+                             void* cb3)
+    {
+        (void)idx;
+        (void)data;
+        (void)cb1;
+        (void)cb2;
+        (void)cb3;
+        return 0;
+    }
+
+
+    void CyaSSL_set_dynlock_create_callback(CYASSL_dynlock_value* (*f)(
+                                                              const char*, int))
+    {
+        (void)f;
+    }
+
+
+    void CyaSSL_set_dynlock_lock_callback(
+                 void (*f)(int, CYASSL_dynlock_value*, const char*, int))
+    {
+        (void)f;
+    }
+
+
+    void CyaSSL_set_dynlock_destroy_callback(
+                      void (*f)(CYASSL_dynlock_value*, const char*, int))
+    {
+        (void)f;
+    }
+
+
+
+    const char* CyaSSL_X509_verify_cert_error_string(long err)
+    {
+        (void)err;
+        return 0;
+    }
+
+
+
+    int CyaSSL_X509_LOOKUP_add_dir(CYASSL_X509_LOOKUP* lookup, const char* dir,
+                                   long len)
+    {
+        (void)lookup;
+        (void)dir;
+        (void)len;
+        return 0;
+    }
+
+
+    int CyaSSL_X509_LOOKUP_load_file(CYASSL_X509_LOOKUP* lookup,
+                                     const char* file, long len)
+    {
+        (void)lookup;
+        (void)file;
+        (void)len;
+        return 0;
+    }
+
+
+    CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_hash_dir(void)
+    {
+        return 0;
+    }
+
+
+    CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_file(void)
+    {
+        return 0;
+    }
+
+
+
+    CYASSL_X509_LOOKUP* CyaSSL_X509_STORE_add_lookup(CYASSL_X509_STORE* store,
+                                                   CYASSL_X509_LOOKUP_METHOD* m)
+    {
+        (void)store;
+        (void)m;
+        return 0;
+    }
+
+
+    CYASSL_X509_STORE* CyaSSL_X509_STORE_new(void)
+    {
+        return 0;
+    }
+
+
+    int CyaSSL_X509_STORE_get_by_subject(CYASSL_X509_STORE_CTX* ctx, int idx,
+                                CYASSL_X509_NAME* name, CYASSL_X509_OBJECT* obj)
+    {
+        (void)ctx;
+        (void)idx;
+        (void)name;
+        (void)obj;
+        return 0;
+    }
+
+
+    int CyaSSL_X509_STORE_CTX_init(CYASSL_X509_STORE_CTX* ctx,
+         CYASSL_X509_STORE* store, CYASSL_X509* x509, STACK_OF(CYASSL_X509)* sk)
+    {
+        (void)ctx;
+        (void)store;
+        (void)x509;
+        (void)sk;
+        return 0;
+    }
+
+
+    void CyaSSL_X509_STORE_CTX_cleanup(CYASSL_X509_STORE_CTX* ctx)
+    {
+        (void)ctx;
+    }
+
+
+
+    CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_lastUpdate(CYASSL_X509_CRL* crl)
+    {
+        (void)crl;
+        return 0;
+    }
+
+
+    CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_nextUpdate(CYASSL_X509_CRL* crl)
+    {
+        (void)crl;
+        return 0;
+    }
+
+
+
+    CYASSL_EVP_PKEY* CyaSSL_X509_get_pubkey(CYASSL_X509* x509)
+    {
+        (void)x509;
+        return 0;
+    }
+
+
+    int CyaSSL_X509_CRL_verify(CYASSL_X509_CRL* crl, CYASSL_EVP_PKEY* key)
+    {
+        (void)crl;
+        (void)key;
+        return 0;
+    }
+
+
+    void CyaSSL_X509_STORE_CTX_set_error(CYASSL_X509_STORE_CTX* ctx, int err)
+    {
+        (void)ctx;
+        (void)err;
+    }
+
+
+    void CyaSSL_X509_OBJECT_free_contents(CYASSL_X509_OBJECT* obj)
+    {
+        (void)obj;
+    }
+
+
+    void CyaSSL_EVP_PKEY_free(CYASSL_EVP_PKEY* key)
+    {
+        (void)key;
+    }
+
+
+    int CyaSSL_X509_cmp_current_time(const CYASSL_ASN1_TIME* asnTime)
+    {
+        (void)asnTime;
+        return 0;
+    }
+
+
+    int CyaSSL_sk_X509_REVOKED_num(CYASSL_X509_REVOKED* revoked)
+    {
+        (void)revoked;
+        return 0;
+    }
+
+
+
+    CYASSL_X509_REVOKED* CyaSSL_X509_CRL_get_REVOKED(CYASSL_X509_CRL* crl)
+    {
+        (void)crl;
+        return 0;
+    }
+
+
+    CYASSL_X509_REVOKED* CyaSSL_sk_X509_REVOKED_value(
+                                        CYASSL_X509_REVOKED* revoked, int value)
+    {
+        (void)revoked;
+        (void)value;
+        return 0;
+    }
+
+
+
+    CYASSL_ASN1_INTEGER* CyaSSL_X509_get_serialNumber(CYASSL_X509* x509)
+    {
+        (void)x509;
+        return 0;
+    }
+
+
+    int CyaSSL_ASN1_TIME_print(CYASSL_BIO* bio, const CYASSL_ASN1_TIME* asnTime)
+    {
+        (void)bio;
+        (void)asnTime;
+        return 0;
+    }
+
+
+
+    int CyaSSL_ASN1_INTEGER_cmp(const CYASSL_ASN1_INTEGER* a,
+                                const CYASSL_ASN1_INTEGER* b)
+    {
+        (void)a;
+        (void)b;
+        return 0;
+    }
+
+
+    long CyaSSL_ASN1_INTEGER_get(const CYASSL_ASN1_INTEGER* i)
+    {
+        (void)i;
+        return 0;
+    }
+
+
+
+    void* CyaSSL_X509_STORE_CTX_get_ex_data(CYASSL_X509_STORE_CTX* ctx, int idx)
+    {
+#ifdef FORTRESS
+        if (ctx != NULL && idx == 0)
+            return ctx->ex_data;
+#else
+        (void)ctx;
+        (void)idx;
+#endif
+        return 0;
+    }
+
+
+    int CyaSSL_get_ex_data_X509_STORE_CTX_idx(void)
+    {
+        return 0;
+    }
+
+
+    void* CyaSSL_get_ex_data(const CYASSL* ssl, int idx)
+    {
+#ifdef FORTRESS
+        if (ssl != NULL && idx < MAX_EX_DATA)
+            return ssl->ex_data[idx];
+#else
+        (void)ssl;
+        (void)idx;
+#endif
+        return 0;
+    }
+
+
+    void CyaSSL_CTX_set_info_callback(CYASSL_CTX* ctx, void (*f)(void))
+    {
+        (void)ctx;
+        (void)f;
+    }
+
+
+    unsigned long CyaSSL_ERR_peek_error(void)
+    {
+        return 0;
+    }
+
+
+    int CyaSSL_ERR_GET_REASON(int err)
+    {
+        (void)err;
+        return 0;
+    }
+
+
+    char* CyaSSL_alert_type_string_long(int alertID)
+    {
+        (void)alertID;
+        return 0;
+    }
+
+
+    char* CyaSSL_alert_desc_string_long(int alertID)
+    {
+        (void)alertID;
+        return 0;
+    }
+
+
+    char* CyaSSL_state_string_long(CYASSL* ssl)
+    {
+        (void)ssl;
+        return 0;
+    }
+
+
+    int CyaSSL_PEM_def_callback(char* name, int num, int w, void* key)
+    {
+        (void)name;
+        (void)num;
+        (void)w;
+        (void)key;
+        return 0;
+    }
+    
+
+    long CyaSSL_CTX_sess_accept(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_connect(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_accept_good(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_connect_good(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_accept_renegotiate(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_connect_renegotiate(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_hits(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_cb_hits(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_cache_full(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_misses(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_timeouts(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    long CyaSSL_CTX_sess_number(CYASSL_CTX* ctx)
+    {
+        (void)ctx;
+        return 0;
+    }
+
+
+    void CyaSSL_DES_set_key_unchecked(CYASSL_const_DES_cblock* myDes,
+                                                   CYASSL_DES_key_schedule* key)
+    {
+        (void)myDes;
+        (void)key;
+    }
+
+
+    void CyaSSL_DES_set_odd_parity(CYASSL_DES_cblock* myDes)
+    {
+        (void)myDes;
+    }
+
+    
+    void CyaSSL_DES_ecb_encrypt(CYASSL_DES_cblock* desa,
+                 CYASSL_DES_cblock* desb, CYASSL_DES_key_schedule* key, int len)
+    {
+        (void)desa;
+        (void)desb;
+        (void)key;
+        (void)len;
+    }
+
+    int CyaSSL_BIO_printf(CYASSL_BIO* bio, const char* format, ...)
+    {
+        (void)bio;
+        (void)format;
+        return 0;
+    }
+
+
+    int CyaSSL_ASN1_UTCTIME_print(CYASSL_BIO* bio, const CYASSL_ASN1_UTCTIME* a)
+    {
+        (void)bio;
+        (void)a;
+        return 0;
+    }
+    
+
+    int  CyaSSL_sk_num(CYASSL_X509_REVOKED* rev)
+    {
+        (void)rev;
+        return 0;
+    }
+
+
+    void* CyaSSL_sk_value(CYASSL_X509_REVOKED* rev, int i)
+    {
+        (void)rev;
+        (void)i;
+        return 0;
+    }
+
+
+    /* stunnel 4.28 needs */
+    void* CyaSSL_CTX_get_ex_data(const CYASSL_CTX* ctx, int d)
+    {
+        (void)ctx;
+        (void)d;
+        return 0;
+    }
+
+
+    int CyaSSL_CTX_set_ex_data(CYASSL_CTX* ctx, int d, void* p)
+    {
+        (void)ctx;
+        (void)d;
+        (void)p;
+        return SSL_SUCCESS;
+    }
+
+
+    void CyaSSL_CTX_sess_set_get_cb(CYASSL_CTX* ctx,
+                        CYASSL_SESSION*(*f)(CYASSL*, unsigned char*, int, int*))
+    {
+        (void)ctx;
+        (void)f;
+    }
+
+
+    void CyaSSL_CTX_sess_set_new_cb(CYASSL_CTX* ctx,
+                                 int (*f)(CYASSL*, CYASSL_SESSION*))
+    {
+        (void)ctx;
+        (void)f;
+    }
+
+
+    void CyaSSL_CTX_sess_set_remove_cb(CYASSL_CTX* ctx, void (*f)(CYASSL_CTX*,
+                                                            CYASSL_SESSION*))
+    {
+        (void)ctx;
+        (void)f;
+    }
+
+
+    int CyaSSL_i2d_SSL_SESSION(CYASSL_SESSION* sess, unsigned char** p)
+    {
+        (void)sess;
+        (void)p;
+        return sizeof(CYASSL_SESSION);
+    }
+
+
+    CYASSL_SESSION* CyaSSL_d2i_SSL_SESSION(CYASSL_SESSION** sess,
+                                    const unsigned char** p, long i)
+    {
+        (void)p;
+        (void)i;
+        if (sess)
+            return *sess;
+        return NULL;
+    }
+
+
+    long CyaSSL_SESSION_get_timeout(const CYASSL_SESSION* sess)
+    {
+        CYASSL_ENTER("CyaSSL_SESSION_get_timeout");
+        return sess->timeout;
+    }
+
+
+    long CyaSSL_SESSION_get_time(const CYASSL_SESSION* sess)
+    {
+        CYASSL_ENTER("CyaSSL_SESSION_get_time");
+        return sess->bornOn;
+    }
+
+
+    int CyaSSL_CTX_get_ex_new_index(long idx, void* arg, void* a, void* b,
+                                    void* c)
+    {
+        (void)idx;
+        (void)arg;
+        (void)a;
+        (void)b;
+        (void)c;
+        return 0; 
+    }
+
+    /* write X509 serial number in unsigned binary to buffer 
+       buffer needs to be at least EXTERNAL_SERIAL_SIZE (32) for all cases
+       return 0 on success */
+    int CyaSSL_X509_get_serial_number(CYASSL_X509* x509, byte* in, int* inOutSz)
+    {
+        CYASSL_ENTER("CyaSSL_X509_get_serial_number");
+        if (x509 == NULL || in == NULL || *inOutSz < x509->serialSz)
+            return BAD_FUNC_ARG;
+
+        XMEMCPY(in, x509->serial, x509->serialSz);
+        *inOutSz = x509->serialSz;
+
+        return 0;
+    }
+
+
+    const byte* CyaSSL_X509_get_der(CYASSL_X509* x509, int* outSz)
+    { 
+        CYASSL_ENTER("CyaSSL_X509_get_der");
+        
+        if (x509 == NULL || outSz == NULL)
+            return NULL;
+
+        *outSz = (int)x509->derCert.length;
+        return x509->derCert.buffer;
+    }  
+
+
+    char*  CyaSSL_X509_get_subjectCN(CYASSL_X509* x509)
+    {
+        if (x509 == NULL)
+            return NULL;
+
+        return x509->subjectCN;
+    }
+
+
+#ifdef FORTRESS
+    int CyaSSL_cmp_peer_cert_to_file(CYASSL* ssl, const char *fname)
+    {
+        int ret = -1;
+
+        CYASSL_ENTER("CyaSSL_cmp_peer_cert_to_file");
+        if (ssl != NULL && fname != NULL)
+        {
+            XFILE*        file = NULL;
+            int           sz = 0;
+            byte          staticBuffer[FILE_BUFFER_SIZE];
+            byte*         myBuffer = staticBuffer;
+            CYASSL_CTX*   ctx = ssl->ctx;
+            EncryptedInfo info;
+            buffer        fileDer;
+            int           eccKey = 0;
+            CYASSL_X509*  peer_cert = &ssl->peerCert;
+
+            info.set = 0;
+            info.ctx = ctx;
+            info.consumed = 0;
+            fileDer.buffer = 0;
+
+            file = XFOPEN(fname, "rb"); 
+            if (!file) return SSL_BAD_FILE;
+            XFSEEK(file, 0, XSEEK_END);
+            sz = XFTELL(file);
+            XREWIND(file);
+            if (sz > (long)sizeof(staticBuffer)) {
+                CYASSL_MSG("Getting dynamic buffer");
+                myBuffer = (byte*) XMALLOC(sz, ctx->heap, DYNAMIC_TYPE_FILE);
+            }
+            
+            if ((myBuffer != NULL) &&
+                (XFREAD(myBuffer, sz, 1, file) > 0) &&
+                (PemToDer(myBuffer, sz, CERT_TYPE,
+                                &fileDer, ctx->heap, &info, &eccKey) == 0) &&
+                (fileDer.length != 0) &&
+                (fileDer.length == peer_cert->derCert.length) &&
+                (XMEMCMP(peer_cert->derCert.buffer, fileDer.buffer,
+                                                    fileDer.length) == 0))
+            {
+                ret = 0;
+            }
+
+            XFCLOSE(file);
+            if (fileDer.buffer)
+                XFREE(fileDer.buffer, ctx->heap, DYNAMIC_TYPE_CERT);
+            if (myBuffer && (myBuffer != staticBuffer))
+                XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE);
+        }
+
+        return ret;
+    }
+#else
+    int CyaSSL_cmp_peer_cert_to_file(CYASSL* ssl, const char *fname)
+    {
+        (void)ssl;
+        (void)fname;
+        return -1;
+    }
+#endif
+
+
+static RNG globalRNG;
+static int initGlobalRNG = 0;
+
+    int CyaSSL_RAND_seed(const void* seed, int len)
+    {
+
+        CYASSL_MSG("CyaSSL_RAND_seed");
+
+        (void)seed;
+        (void)len;
+
+        if (initGlobalRNG == 0) {
+            if (InitRng(&globalRNG) < 0) {
+                CYASSL_MSG("CyaSSL Init Global RNG failed");
+            }
+            initGlobalRNG = 1;
+        }
+
+        return 0;
+    }
+
+
+    int CyaSSL_RAND_bytes(unsigned char* buf, int num)
+    {
+        RNG    tmpRNG;
+        RNG*   rng = &tmpRNG; 
+
+        CYASSL_ENTER("RAND_bytes");
+        if (InitRng(&tmpRNG) != 0) {
+            CYASSL_MSG("Bad RNG Init, trying global");
+            if (initGlobalRNG == 0) {
+                CYASSL_MSG("Global RNG no Init");
+                return 0; 
+            }
+            rng = &globalRNG;
+        }
+
+        RNG_GenerateBlock(rng, buf, num);
+
+        return 1;
+    }
+
+    CYASSL_BN_CTX* CyaSSL_BN_CTX_new(void)
+    {
+        static int ctx;  /* ctaocrypt doesn't now need ctx */
+
+        CYASSL_MSG("CyaSSL_BN_CTX_new");
+
+        return (CYASSL_BN_CTX*)&ctx;
+    }
+
+    void CyaSSL_BN_CTX_init(CYASSL_BN_CTX* ctx)
+    {
+        (void)ctx;
+        CYASSL_MSG("CyaSSL_BN_CTX_init");
+    }
+
+
+    void CyaSSL_BN_CTX_free(CYASSL_BN_CTX* ctx)
+    {
+        (void)ctx;
+        CYASSL_MSG("CyaSSL_BN_CTX_free");
+
+        /* do free since static ctx that does nothing */
+    }
+
+
+    static void InitCyaSSL_BigNum(CYASSL_BIGNUM* bn)
+    { 
+        CYASSL_MSG("InitCyaSSL_BigNum");
+        if (bn) {
+            bn->neg      = 0;
+            bn->internal = NULL;
+        }
+    }
+
+
+    CYASSL_BIGNUM* CyaSSL_BN_new(void)
+    {
+        CYASSL_BIGNUM* external;
+        mp_int*        mpi;
+
+        CYASSL_MSG("CyaSSL_BN_new");
+
+        mpi = (mp_int*) XMALLOC(sizeof(mp_int), NULL, DYNAMIC_TYPE_BIGINT);
+        if (mpi == NULL) {
+            CYASSL_MSG("CyaSSL_BN_new malloc mpi failure");
+            return NULL;
+        }
+
+        external = (CYASSL_BIGNUM*) XMALLOC(sizeof(CYASSL_BIGNUM), NULL,
+                                            DYNAMIC_TYPE_BIGINT);
+        if (external == NULL) {
+            CYASSL_MSG("CyaSSL_BN_new malloc CYASSL_BIGNUM failure");
+            XFREE(mpi, NULL, DYNAMIC_TYPE_BIGINT);
+            return NULL;
+        }
+
+        InitCyaSSL_BigNum(external);
+        mp_init(mpi);
+        external->internal = mpi;
+
+        return external;
+    }
+
+
+    void CyaSSL_BN_free(CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_free");
+        if (bn) {
+            if (bn->internal) {
+                mp_clear((mp_int*)bn->internal);
+                XFREE(bn->internal, NULL, DYNAMIC_TYPE_BIGINT);
+                bn->internal = NULL;
+            }
+            XFREE(bn, NULL, DYNAMIC_TYPE_BIGINT);
+        }
+    }
+
+
+    void CyaSSL_BN_clear_free(CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_clear_free");
+
+        CyaSSL_BN_free(bn);
+    }
+
+
+    int CyaSSL_BN_sub(CYASSL_BIGNUM* r, const CYASSL_BIGNUM* a,
+                      const CYASSL_BIGNUM* b)
+    {
+        CYASSL_MSG("CyaSSL_BN_sub");
+
+        if (r == NULL || a == NULL || b == NULL)
+            return 0;
+
+        if (mp_sub((mp_int*)a->internal,(mp_int*)b->internal,
+                   (mp_int*)r->internal) == MP_OKAY)
+            return 1;
+
+        CYASSL_MSG("CyaSSL_BN_sub mp_sub failed");
+        return 0;
+    }
+
+
+    int CyaSSL_BN_mod(CYASSL_BIGNUM* r, const CYASSL_BIGNUM* a,
+                         const CYASSL_BIGNUM* b, const CYASSL_BN_CTX* c)
+    {
+        (void)c;
+        CYASSL_MSG("CyaSSL_BN_mod");
+
+        if (r == NULL || a == NULL || b == NULL)
+            return 0;
+
+        if (mp_mod((mp_int*)a->internal,(mp_int*)b->internal,
+                   (mp_int*)r->internal) == MP_OKAY)
+            return 1;
+
+        CYASSL_MSG("CyaSSL_BN_mod mp_mod failed");
+        return 0;
+    }
+
+
+    const CYASSL_BIGNUM* CyaSSL_BN_value_one(void)
+    {
+        static CYASSL_BIGNUM* bn_one = NULL;
+
+        CYASSL_MSG("CyaSSL_BN_value_one");
+
+        if (bn_one == NULL) {
+            bn_one = CyaSSL_BN_new();
+            if (bn_one)
+                mp_set_int((mp_int*)bn_one->internal, 1);
+        }
+
+        return bn_one;
+    }
+
+
+    int CyaSSL_BN_num_bytes(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_num_bytes");
+
+        if (bn == NULL || bn->internal == NULL)
+            return 0;
+
+        return mp_unsigned_bin_size((mp_int*)bn->internal);
+    }
+
+
+    int CyaSSL_BN_num_bits(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_num_bits");
+
+        if (bn == NULL || bn->internal == NULL)
+            return 0;
+
+        return mp_count_bits((mp_int*)bn->internal);
+    }
+
+
+    int CyaSSL_BN_is_zero(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_is_zero");
+
+        if (bn == NULL || bn->internal == NULL)
+            return 0;
+
+        return mp_iszero((mp_int*)bn->internal);
+    }
+
+
+    int CyaSSL_BN_is_one(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_is_one");
+
+        if (bn == NULL || bn->internal == NULL)
+            return 0;
+
+        if (mp_cmp_d((mp_int*)bn->internal, 1) == 0)
+            return 1;
+
+        return 0;
+    }
+
+
+    int CyaSSL_BN_is_odd(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_MSG("CyaSSL_BN_is_odd");
+
+        if (bn == NULL || bn->internal == NULL)
+            return 0;
+
+        return mp_isodd((mp_int*)bn->internal);
+    }
+
+
+    int CyaSSL_BN_cmp(const CYASSL_BIGNUM* a, const CYASSL_BIGNUM* b)
+    {
+        CYASSL_MSG("CyaSSL_BN_cmp");
+
+        if (a == NULL || a->internal == NULL || b == NULL || b->internal ==NULL)
+            return 0;
+
+        return mp_cmp((mp_int*)a->internal, (mp_int*)b->internal);
+    }
+
+
+    int CyaSSL_BN_bn2bin(const CYASSL_BIGNUM* bn, unsigned char* r)
+    {
+        CYASSL_MSG("CyaSSL_BN_bn2bin");
+
+        if (bn == NULL || bn->internal == NULL) {
+            CYASSL_MSG("NULL bn error");
+            return -1;
+        }
+
+        if (r == NULL)
+            return mp_unsigned_bin_size((mp_int*)bn->internal);
+
+        if (mp_to_unsigned_bin((mp_int*)bn->internal, r) != MP_OKAY) {
+            CYASSL_MSG("mp_to_unsigned_bin error");
+            return -1;
+        }
+
+        return mp_unsigned_bin_size((mp_int*)bn->internal);
+    }
+
+
+    CYASSL_BIGNUM* CyaSSL_BN_bin2bn(const unsigned char* str, int len,
+                                   CYASSL_BIGNUM* ret)
+    {
+        CYASSL_MSG("CyaSSL_BN_bin2bn");
+
+        if (ret && ret->internal) {
+            if (mp_read_unsigned_bin((mp_int*)ret->internal, str, len) != 0) {
+                CYASSL_MSG("mp_read_unsigned_bin failure");
+                return NULL;
+            } 
+        }
+        else {
+            CYASSL_MSG("CyaSSL_BN_bin2bn wants return bignum");
+        }
+
+        return ret;
+    }
+
+
+    int CyaSSL_mask_bits(CYASSL_BIGNUM* bn, int n)
+    {
+        (void)bn;
+        (void)n;
+        CYASSL_MSG("CyaSSL_BN_mask_bits");
+
+        return -1;
+    }
+
+
+    int CyaSSL_BN_rand(CYASSL_BIGNUM* bn, int bits, int top, int bottom)
+    {
+        byte          buff[1024];
+        RNG           tmpRNG;
+        RNG*          rng = &tmpRNG; 
+        int           ret;
+        int           len = bits/8;
+
+        (void)top;
+        (void)bottom;
+        CYASSL_MSG("CyaSSL_BN_rand");
+
+        if (bn == NULL || bn->internal == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return 0; 
+        }
+
+        if (bits % 8)
+            len++;
+
+        if ( (ret = InitRng(&tmpRNG)) != 0) {
+            CYASSL_MSG("Bad RNG Init, trying global");
+            if (initGlobalRNG == 0) {
+                CYASSL_MSG("Global RNG no Init");
+                return 0; 
+            }
+            rng = &globalRNG;
+        }
+
+        RNG_GenerateBlock(rng, buff, len);
+        buff[0]     |= 0x80 | 0x40;
+        buff[len-1] |= 0x01;
+
+        if (mp_read_unsigned_bin((mp_int*)bn->internal,buff,len) != MP_OKAY) {
+            CYASSL_MSG("mp read bin failed");
+            return 0;
+        }
+                
+        return 1;
+    }
+
+
+    int CyaSSL_BN_is_bit_set(const CYASSL_BIGNUM* bn, int n)
+    {
+        (void)bn;
+        (void)n;
+
+        CYASSL_MSG("CyaSSL_BN_is_bit_set");
+
+        return 0;
+    }
+
+
+    int CyaSSL_BN_hex2bn(CYASSL_BIGNUM** bn, const char* str)
+    {
+        byte    decoded[1024];
+        word32  decSz = sizeof(decoded);
+
+        CYASSL_MSG("CyaSSL_BN_hex2bn");
+
+        if (str == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return 0;
+        }
+
+        if (Base16_Decode((byte*)str, strlen(str), decoded, &decSz) < 0) {
+            CYASSL_MSG("Bad Base16_Decode error");
+            return 0;
+        }
+
+        if (bn == NULL)
+            return decSz;
+
+        if (*bn == NULL) {
+            *bn = CyaSSL_BN_new();
+            if (*bn == NULL) {
+                CYASSL_MSG("BN new failed");
+                return 0;
+            }
+        }
+
+        if (CyaSSL_BN_bin2bn(decoded, decSz, *bn) == NULL) {
+            CYASSL_MSG("Bad bin2bn error");
+            return 0;
+        }
+
+        return 1;  /* success */
+    }
+
+
+    CYASSL_BIGNUM* CyaSSL_BN_dup(const CYASSL_BIGNUM* bn)
+    {
+        CYASSL_BIGNUM* ret;
+
+        CYASSL_MSG("CyaSSL_BN_dup");
+
+        if (bn == NULL || bn->internal == NULL) {
+            CYASSL_MSG("bn NULL error");
+            return NULL;
+        }
+
+        ret = CyaSSL_BN_new();
+        if (ret == NULL) {
+            CYASSL_MSG("bn new error");
+            return NULL;
+        }
+
+        if (mp_copy((mp_int*)bn->internal, (mp_int*)ret->internal) != MP_OKAY) {
+            CYASSL_MSG("mp_copy error");
+            CyaSSL_BN_free(ret);
+            return NULL;
+        }
+
+        return ret;
+    }
+
+
+    CYASSL_BIGNUM* CyaSSL_BN_copy(CYASSL_BIGNUM* r, const CYASSL_BIGNUM* bn)
+    {
+        (void)r;
+        (void)bn;
+
+        CYASSL_MSG("CyaSSL_BN_copy");
+
+        return NULL;
+    }
+
+
+    int CyaSSL_BN_set_word(CYASSL_BIGNUM* bn, unsigned long w)
+    {
+        (void)bn;
+        (void)w;
+
+        CYASSL_MSG("CyaSSL_BN_set_word");
+
+        return -1;
+    }
+
+
+    int CyaSSL_BN_dec2bn(CYASSL_BIGNUM** bn, const char* str)
+    {
+        (void)bn;
+        (void)str;
+
+        CYASSL_MSG("CyaSSL_BN_dec2bn");
+
+        return -1;
+    }
+
+
+    char* CyaSSL_BN_bn2dec(const CYASSL_BIGNUM* bn)
+    {
+        (void)bn;
+
+        CYASSL_MSG("CyaSSL_BN_bn2dec");
+
+        return NULL;
+    }
+
+
+    static void InitCyaSSL_DH(CYASSL_DH* dh)
+    {
+        if (dh) {
+            dh->p        = NULL;
+            dh->g        = NULL;
+            dh->pub_key  = NULL;
+            dh->priv_key = NULL;
+            dh->internal = NULL;
+            dh->inSet    = 0;
+            dh->exSet    = 0;
+        }
+    }
+
+
+    CYASSL_DH* CyaSSL_DH_new(void)
+    {
+        CYASSL_DH* external;
+        DhKey*     key;
+
+        CYASSL_MSG("CyaSSL_DH_new");
+
+        key = (DhKey*) XMALLOC(sizeof(DhKey), NULL, DYNAMIC_TYPE_DH);
+        if (key == NULL) {
+            CYASSL_MSG("CyaSSL_DH_new malloc DhKey failure");
+            return NULL;
+        }
+
+        external = (CYASSL_DH*) XMALLOC(sizeof(CYASSL_DH), NULL,
+                                        DYNAMIC_TYPE_DH);
+        if (external == NULL) {
+            CYASSL_MSG("CyaSSL_DH_new malloc CYASSL_DH failure");
+            XFREE(key, NULL, DYNAMIC_TYPE_DH);
+            return NULL;
+        }
+
+        InitCyaSSL_DH(external);
+        InitDhKey(key);
+        external->internal = key;
+
+        return external;
+    }
+
+
+    void CyaSSL_DH_free(CYASSL_DH* dh)
+    {
+        CYASSL_MSG("CyaSSL_DH_free");
+
+        if (dh) {
+            if (dh->internal) {
+                FreeDhKey((DhKey*)dh->internal);
+                XFREE(dh->internal, NULL, DYNAMIC_TYPE_DH);
+                dh->internal = NULL;
+            }
+            CyaSSL_BN_free(dh->priv_key);
+            CyaSSL_BN_free(dh->pub_key);
+            CyaSSL_BN_free(dh->g);
+            CyaSSL_BN_free(dh->p);
+            InitCyaSSL_DH(dh);  /* set back to NULLs for safety */
+
+            XFREE(dh, NULL, DYNAMIC_TYPE_DH);
+        }
+    }
+
+
+    static int SetDhInternal(CYASSL_DH* dh) 
+    {
+        unsigned char p[1024];
+        unsigned char g[1024];
+        int           pSz = sizeof(p);
+        int           gSz = sizeof(g);
+
+        CYASSL_ENTER("SetDhInternal");
+
+        if (dh == NULL || dh->p == NULL || dh->g == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return -1;
+        }
+
+        if (CyaSSL_BN_bn2bin(dh->p, NULL) > pSz) {
+            CYASSL_MSG("Bad p internal size");
+            return -1;
+        }
+
+        if (CyaSSL_BN_bn2bin(dh->g, NULL) > gSz) {
+            CYASSL_MSG("Bad g internal size");
+            return -1;
+        }
+
+        pSz = CyaSSL_BN_bn2bin(dh->p, p);
+        gSz = CyaSSL_BN_bn2bin(dh->g, g);
+        
+        if (pSz <= 0 || gSz <= 0) {
+            CYASSL_MSG("Bad BN2bin set");
+            return -1;
+        }
+
+        if (DhSetKey((DhKey*)dh->internal, p, pSz, g, gSz) < 0) {
+            CYASSL_MSG("Bad DH SetKey");
+            return -1;
+        }
+
+        dh->inSet = 1;
+
+        return 0;
+    }
+
+
+    int CyaSSL_DH_size(CYASSL_DH* dh)
+    {
+        CYASSL_MSG("CyaSSL_DH_size");
+
+        if (dh == NULL)
+            return 0;
+
+        return CyaSSL_BN_num_bytes(dh->p);
+    }
+
+
+    /* return 1 on success else 0 */
+    int CyaSSL_DH_generate_key(CYASSL_DH* dh)
+    {
+        unsigned char pub [1024];
+        unsigned char priv[1024];
+        word32        pubSz  = sizeof(pub);
+        word32        privSz = sizeof(priv);
+        RNG           tmpRNG;
+        RNG*          rng = &tmpRNG; 
+        int           ret;
+
+        CYASSL_MSG("CyaSSL_DH_generate_key");
+
+        if (dh == NULL || dh->p == NULL || dh->g == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return 0; 
+        }
+
+        if (dh->inSet == 0) {
+            if (SetDhInternal(dh) < 0) {
+                CYASSL_MSG("Bad DH set internal");
+                return 0; 
+            }
+        }
+
+        if ( (ret = InitRng(&tmpRNG)) != 0) {
+            CYASSL_MSG("Bad RNG Init, trying global");
+            if (initGlobalRNG == 0) {
+                CYASSL_MSG("Global RNG no Init");
+                return 0; 
+            }
+            rng = &globalRNG;
+        }
+
+        if (DhGenerateKeyPair((DhKey*)dh->internal, rng, priv, &privSz,
+                                pub, &pubSz) < 0) {
+            CYASSL_MSG("Bad DhGenerateKeyPair");
+            return 0; 
+        }
+
+        if (dh->pub_key)
+            CyaSSL_BN_free(dh->pub_key);
+        dh->pub_key = CyaSSL_BN_new();
+        if (dh->pub_key == NULL) {
+            CYASSL_MSG("Bad DH new pub");
+            return 0; 
+        }
+
+        if (dh->priv_key)
+            CyaSSL_BN_free(dh->priv_key);
+        dh->priv_key = CyaSSL_BN_new();
+        if (dh->priv_key == NULL) {
+            CYASSL_MSG("Bad DH new priv");
+            return 0; 
+        }
+
+        if (CyaSSL_BN_bin2bn(pub, pubSz, dh->pub_key) == NULL) {
+            CYASSL_MSG("Bad DH bn2bin error pub");
+            return 0; 
+        }
+
+        if (CyaSSL_BN_bin2bn(priv, privSz, dh->priv_key) == NULL) {
+            CYASSL_MSG("Bad DH bn2bin error priv");
+            return 0; 
+        }
+
+        CYASSL_MSG("CyaSSL_generate_key success");
+        return 1;
+    }
+
+
+    /* return 1 on success, 0 otherwise */
+    int CyaSSL_DH_compute_key(unsigned char* key, CYASSL_BIGNUM* otherPub,
+                              CYASSL_DH* dh)
+    {
+        unsigned char pub [1024];
+        unsigned char priv[1024];
+        word32        pubSz  = sizeof(pub);
+        word32        privSz = sizeof(priv);
+        word32        keySz;
+
+        CYASSL_MSG("CyaSSL_DH_compute_key");
+
+        if (dh == NULL || dh->priv_key == NULL || otherPub == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return 0; 
+        }
+
+        keySz = (word32)DH_size(dh);
+        if (keySz == 0) {
+            CYASSL_MSG("Bad DH_size");
+            return 0;
+        }
+
+        if (CyaSSL_BN_bn2bin(dh->priv_key, NULL) > (int)privSz) {
+            CYASSL_MSG("Bad priv internal size");
+            return 0;
+        }
+
+        if (CyaSSL_BN_bn2bin(otherPub, NULL) > (int)pubSz) {
+            CYASSL_MSG("Bad otherPub size");
+            return 0;
+        }
+
+        privSz = CyaSSL_BN_bn2bin(dh->priv_key, priv);
+        pubSz  = CyaSSL_BN_bn2bin(otherPub, pub);
+        
+        if (privSz <= 0 || pubSz <= 0) {
+            CYASSL_MSG("Bad BN2bin set");
+            return 0;
+        }
+
+        if (DhAgree((DhKey*)dh->internal, key, &keySz, priv, privSz, pub,
+                    pubSz) < 0) {
+            CYASSL_MSG("DhAgree failed");
+            return 0;
+        }
+
+        CYASSL_MSG("CyaSSL_compute_key success");
+        return (int)keySz;
+    }
+
+
+    static void InitCyaSSL_DSA(CYASSL_DSA* dsa)
+    {
+        if (dsa) {
+            dsa->p        = NULL;
+            dsa->q        = NULL;
+            dsa->g        = NULL;
+            dsa->pub_key  = NULL;
+            dsa->priv_key = NULL;
+            dsa->internal = NULL;
+            dsa->inSet    = 0;
+            dsa->exSet    = 0;
+        }
+    }
+
+
+    CYASSL_DSA* CyaSSL_DSA_new(void)
+    {
+        CYASSL_DSA* external;
+        DsaKey*     key;
+
+        CYASSL_MSG("CyaSSL_DSA_new");
+
+        key = (DsaKey*) XMALLOC(sizeof(DsaKey), NULL, DYNAMIC_TYPE_DSA);
+        if (key == NULL) {
+            CYASSL_MSG("CyaSSL_DSA_new malloc DsaKey failure");
+            return NULL;
+        }
+
+        external = (CYASSL_DSA*) XMALLOC(sizeof(CYASSL_DSA), NULL,
+                                        DYNAMIC_TYPE_DSA);
+        if (external == NULL) {
+            CYASSL_MSG("CyaSSL_DSA_new malloc CYASSL_DSA failure");
+            XFREE(key, NULL, DYNAMIC_TYPE_DSA);
+            return NULL;
+        }
+
+        InitCyaSSL_DSA(external);
+        InitDsaKey(key);
+        external->internal = key;
+
+        return external;
+    }
+
+
+    void CyaSSL_DSA_free(CYASSL_DSA* dsa)
+    {
+        CYASSL_MSG("CyaSSL_DSA_free");
+
+        if (dsa) {
+            if (dsa->internal) {
+                FreeDsaKey((DsaKey*)dsa->internal);
+                XFREE(dsa->internal, NULL, DYNAMIC_TYPE_DSA);
+                dsa->internal = NULL;
+            }
+            CyaSSL_BN_free(dsa->priv_key);
+            CyaSSL_BN_free(dsa->pub_key);
+            CyaSSL_BN_free(dsa->g);
+            CyaSSL_BN_free(dsa->q);
+            CyaSSL_BN_free(dsa->p);
+            InitCyaSSL_DSA(dsa);  /* set back to NULLs for safety */
+
+            XFREE(dsa, NULL, DYNAMIC_TYPE_DSA);
+        }
+    }
+
+
+    int CyaSSL_DSA_generate_key(CYASSL_DSA* dsa)
+    {
+        (void)dsa;
+
+        CYASSL_MSG("CyaSSL_DSA_generate_key");
+
+        return 0;  /* key gen not needed by server */
+    }
+
+
+    int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA* dsa, int bits,
+                   unsigned char* seed, int seedLen, int* counterRet,
+                   unsigned long* hRet, void* cb)
+    {
+        (void)dsa;
+        (void)bits;
+        (void)seed;
+        (void)seedLen;
+        (void)counterRet;
+        (void)hRet;
+        (void)cb;
+
+        CYASSL_MSG("CyaSSL_DSA_generate_parameters_ex");
+
+        return 0;  /* key gen not needed by server */
+    }
+
+
+    static void InitCyaSSL_Rsa(CYASSL_RSA* rsa)
+    {
+        if (rsa) {
+            rsa->n        = NULL;
+            rsa->e        = NULL;
+            rsa->d        = NULL;
+            rsa->p        = NULL;
+            rsa->q        = NULL;
+               rsa->dmp1     = NULL;
+               rsa->dmq1     = NULL;
+               rsa->iqmp     = NULL;
+            rsa->internal = NULL;
+            rsa->inSet    = 0;
+            rsa->exSet    = 0;
+        }
+    }
+
+
+    CYASSL_RSA* CyaSSL_RSA_new(void)
+    {
+        CYASSL_RSA* external;
+        RsaKey*     key;
+
+        CYASSL_MSG("CyaSSL_RSA_new");
+
+        key = (RsaKey*) XMALLOC(sizeof(RsaKey), NULL, DYNAMIC_TYPE_RSA);
+        if (key == NULL) {
+            CYASSL_MSG("CyaSSL_RSA_new malloc RsaKey failure");
+            return NULL;
+        }
+
+        external = (CYASSL_RSA*) XMALLOC(sizeof(CYASSL_RSA), NULL,
+                                         DYNAMIC_TYPE_RSA);
+        if (external == NULL) {
+            CYASSL_MSG("CyaSSL_RSA_new malloc CYASSL_RSA failure");
+            XFREE(key, NULL, DYNAMIC_TYPE_RSA);
+            return NULL;
+        }
+
+        InitCyaSSL_Rsa(external);
+        InitRsaKey(key, NULL);
+        external->internal = key;
+
+        return external;
+    }
+
+
+    void CyaSSL_RSA_free(CYASSL_RSA* rsa)
+    {
+        CYASSL_MSG("CyaSSL_RSA_free");
+
+        if (rsa) {
+            if (rsa->internal) {
+                FreeRsaKey((RsaKey*)rsa->internal);
+                XFREE(rsa->internal, NULL, DYNAMIC_TYPE_RSA);
+                rsa->internal = NULL;
+            }
+            CyaSSL_BN_free(rsa->iqmp);
+            CyaSSL_BN_free(rsa->dmq1);
+            CyaSSL_BN_free(rsa->dmp1);
+            CyaSSL_BN_free(rsa->q);
+            CyaSSL_BN_free(rsa->p);
+            CyaSSL_BN_free(rsa->d);
+            CyaSSL_BN_free(rsa->e);
+            CyaSSL_BN_free(rsa->n);
+            InitCyaSSL_Rsa(rsa);  /* set back to NULLs for safety */
+
+            XFREE(rsa, NULL, DYNAMIC_TYPE_RSA);
+        }
+    }
+
+
+    static int SetIndividualExternal(CYASSL_BIGNUM** bn, mp_int* mpi)
+    {
+        CYASSL_MSG("Entering SetIndividualExternal");
+
+        if (mpi == NULL) {
+            CYASSL_MSG("mpi NULL error");
+            return -1;
+        }
+
+        if (*bn == NULL) {
+            *bn = CyaSSL_BN_new();
+            if (*bn == NULL) {
+                CYASSL_MSG("SetIndividualExternal alloc failed");
+                return -1;
+            }
+        }
+
+        if (mp_copy(mpi, (mp_int*)((*bn)->internal)) != MP_OKAY) {
+            CYASSL_MSG("mp_copy error");
+            return -1;
+        }
+
+        return 0;
+    }
+
+
+    static int SetDsaExternal(CYASSL_DSA* dsa)
+    {
+        DsaKey* key;
+        CYASSL_MSG("Entering SetDsaExternal");
+
+        if (dsa == NULL || dsa->internal == NULL) {
+            CYASSL_MSG("dsa key NULL error");
+            return -1;
+        }
+
+        key = (DsaKey*)dsa->internal;
+
+        if (SetIndividualExternal(&dsa->p, &key->p) < 0) {
+            CYASSL_MSG("dsa p key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&dsa->q, &key->q) < 0) {
+            CYASSL_MSG("dsa q key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&dsa->g, &key->g) < 0) {
+            CYASSL_MSG("dsa g key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&dsa->pub_key, &key->y) < 0) {
+            CYASSL_MSG("dsa y key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&dsa->priv_key, &key->x) < 0) {
+            CYASSL_MSG("dsa x key error");
+            return -1;
+        }
+
+        dsa->exSet = 1;
+
+        return 0;
+    }
+
+
+    static int SetRsaExternal(CYASSL_RSA* rsa)
+    {
+        RsaKey* key;
+        CYASSL_MSG("Entering SetRsaExternal");
+
+        if (rsa == NULL || rsa->internal == NULL) {
+            CYASSL_MSG("rsa key NULL error");
+            return -1;
+        }
+
+        key = (RsaKey*)rsa->internal;
+
+        if (SetIndividualExternal(&rsa->n, &key->n) < 0) {
+            CYASSL_MSG("rsa n key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->e, &key->e) < 0) {
+            CYASSL_MSG("rsa e key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->d, &key->d) < 0) {
+            CYASSL_MSG("rsa d key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->p, &key->p) < 0) {
+            CYASSL_MSG("rsa p key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->q, &key->q) < 0) {
+            CYASSL_MSG("rsa q key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->dmp1, &key->dP) < 0) {
+            CYASSL_MSG("rsa dP key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->dmq1, &key->dQ) < 0) {
+            CYASSL_MSG("rsa dQ key error");
+            return -1;
+        }
+
+        if (SetIndividualExternal(&rsa->iqmp, &key->u) < 0) {
+            CYASSL_MSG("rsa u key error");
+            return -1;
+        }
+
+        rsa->exSet = 1;
+
+        return 0;
+    }
+
+
+    int CyaSSL_RSA_generate_key_ex(CYASSL_RSA* rsa, int bits, CYASSL_BIGNUM* bn,
+                                   void* cb)
+    {
+        RNG rng;
+
+        CYASSL_MSG("CyaSSL_RSA_generate_key_ex");
+
+        (void)rsa;
+        (void)bits;
+        (void)cb;
+        (void)bn;
+    
+        if (InitRng(&rng) < 0) {
+            CYASSL_MSG("RNG init failed");
+            return -1;
+        }
+
+#ifdef CYASSL_KEY_GEN
+        if (MakeRsaKey((RsaKey*)rsa->internal, bits, 65537, &rng) < 0) {
+            CYASSL_MSG("MakeRsaKey failed");
+            return -1;
+        }
+
+        if (SetRsaExternal(rsa) < 0) {
+            CYASSL_MSG("SetRsaExternal failed");
+            return -1;
+        }
+
+        rsa->inSet = 1;
+
+        return 1;  /* success */
+#else
+        CYASSL_MSG("No Key Gen built in");
+        return -1;
+#endif
+
+    }
+
+
+    int CyaSSL_RSA_blinding_on(CYASSL_RSA* rsa, CYASSL_BN_CTX* bn)
+    {
+        (void)rsa;
+        (void)bn;
+
+        CYASSL_MSG("CyaSSL_RSA_blinding_on");
+
+        return 1;  /* on by default */
+    }
+
+
+    int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr,
+                                   unsigned char* to, CYASSL_RSA* rsa, int padding)
+    {
+        (void)len;
+        (void)fr;
+        (void)to;
+        (void)rsa;
+        (void)padding;
+
+        CYASSL_MSG("CyaSSL_RSA_public_encrypt");
+
+        return -1;
+    }
+
+
+    int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr,
+                                   unsigned char* to, CYASSL_RSA* rsa, int padding)
+    {
+        (void)len;
+        (void)fr;
+        (void)to;
+        (void)rsa;
+        (void)padding;
+
+        CYASSL_MSG("CyaSSL_RSA_private_decrypt");
+
+        return -1;
+    }
+
+
+    int CyaSSL_RSA_size(const CYASSL_RSA* rsa)
+    {
+        CYASSL_MSG("CyaSSL_RSA_size");
+
+        if (rsa == NULL)
+            return 0;
+
+        return CyaSSL_BN_num_bytes(rsa->n);
+    }
+
+
+    /* return 0 on success, < 0 otherwise */
+    int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
+                           CYASSL_DSA* dsa)
+    {
+        RNG    tmpRNG;
+        RNG*   rng = &tmpRNG; 
+
+        CYASSL_MSG("CyaSSL_DSA_do_sign");
+
+        if (d == NULL || sigRet == NULL || dsa == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return -1;
+        }
+
+        if (dsa->inSet == 0) {
+            CYASSL_MSG("No DSA internal set");
+            return -1;
+        }
+
+        if (InitRng(&tmpRNG) != 0) {
+            CYASSL_MSG("Bad RNG Init, trying global");
+            if (initGlobalRNG == 0) {
+                CYASSL_MSG("Global RNG no Init");
+                return -1; 
+            }
+            rng = &globalRNG;
+        }
+
+        if (DsaSign(d, sigRet, (DsaKey*)dsa->internal, rng) < 0) {
+            CYASSL_MSG("DsaSign failed");
+            return -1;
+        }
+
+        return 0;
+    }
+
+
+    /* return 1 on success, 0 otherwise */
+    int CyaSSL_RSA_sign(int type, const unsigned char* m,
+                               unsigned int mLen, unsigned char* sigRet,
+                               unsigned int* sigLen, CYASSL_RSA* rsa)
+    {
+        byte   encodedSig[MAX_ENCODED_SIG_SZ];
+        word32 outLen;
+        word32 signSz;
+        RNG    tmpRNG;
+        RNG*   rng = &tmpRNG; 
+
+        CYASSL_MSG("CyaSSL_RSA_sign");
+
+        if (m == NULL || sigRet == NULL || sigLen == NULL || rsa == NULL) {
+            CYASSL_MSG("Bad function arguments");
+            return 0;
+        }
+
+        if (rsa->inSet == 0) {
+            CYASSL_MSG("No RSA internal set");
+            return 0;
+        }
+
+        outLen = (word32)CyaSSL_BN_num_bytes(rsa->n);
+        if (outLen == 0) {
+            CYASSL_MSG("Bad RSA size");
+            return 0;
+        }
+       
+        if (InitRng(&tmpRNG) != 0) {
+            CYASSL_MSG("Bad RNG Init, trying global");
+            if (initGlobalRNG == 0) {
+                CYASSL_MSG("Global RNG no Init");
+                return 0; 
+            }
+            rng = &globalRNG;
+        }
+
+        switch (type) {
+            case NID_md5:
+                type = MD5h;
+                break;
+
+            case NID_sha1:
+                type = SHAh;
+                break;
+
+            default:
+                CYASSL_MSG("Bad md type");
+                return 0;
+        }
+
+        signSz = EncodeSignature(encodedSig, m, mLen, type);
+        if (signSz == 0) {
+            CYASSL_MSG("Bad Encode Signature");
+            return 0;
+        }
+
+        *sigLen = RsaSSL_Sign(encodedSig, signSz, sigRet, outLen,
+                              (RsaKey*)rsa->internal, rng);
+        if (*sigLen <= 0) {
+            CYASSL_MSG("Bad Rsa Sign");
+            return 0;
+        }
+
+        CYASSL_MSG("CyaSSL_RSA_sign success");
+        return 1;  /* success */
+    }
+
+
+    int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from,
+                              unsigned char* to, CYASSL_RSA* rsa, int padding)
+    {
+        (void)flen;
+        (void)from;
+        (void)to;
+        (void)rsa;
+        (void)padding;
+
+        CYASSL_MSG("CyaSSL_RSA_public_decrypt");
+
+        return -1;
+    }
+
+
+    /* generate p-1 and q-1 */
+    int CyaSSL_RSA_GenAdd(CYASSL_RSA* rsa)
+    {
+        int    err;
+        mp_int tmp;
+
+        CYASSL_MSG("CyaSSL_RsaGenAdd");
+
+        if (rsa == NULL || rsa->p == NULL || rsa->q == NULL || rsa->d == NULL ||
+                           rsa->dmp1 == NULL || rsa->dmq1 == NULL) {
+            CYASSL_MSG("rsa no init error");
+            return -1;
+        }
+
+        if (mp_init(&tmp) != MP_OKAY) {
+            CYASSL_MSG("mp_init error");
+            return -1;
+        }
+
+        err = mp_sub_d((mp_int*)rsa->p->internal, 1, &tmp);
+        if (err != MP_OKAY)
+            CYASSL_MSG("mp_sub_d error");
+        else
+            err = mp_mod((mp_int*)rsa->d->internal, &tmp,
+                         (mp_int*)rsa->dmp1->internal);
+
+        if (err != MP_OKAY)
+            CYASSL_MSG("mp_mod error");
+        else
+            err = mp_sub_d((mp_int*)rsa->q->internal, 1, &tmp);
+        if (err != MP_OKAY)
+            CYASSL_MSG("mp_sub_d error");
+        else
+            err = mp_mod((mp_int*)rsa->d->internal, &tmp,
+                         (mp_int*)rsa->dmq1->internal);
+
+        mp_clear(&tmp);
+
+        if (err == MP_OKAY)
+            return 0;
+        else
+            return -1;
+    }
+
+
+    void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key, int keylen,
+                      const EVP_MD* type)
+    {
+        CYASSL_MSG("CyaSSL_HMAC_Init");
+
+        if (ctx == NULL) {
+            CYASSL_MSG("no ctx on init");
+            return;
+        }
+
+        if (type) {
+            CYASSL_MSG("init has type");
+
+            if (XSTRNCMP(type, "MD5", 3) == 0) {
+                CYASSL_MSG("md5 hmac");
+                ctx->type = MD5;
+            }
+            else if (XSTRNCMP(type, "SHA256", 6) == 0) {
+                CYASSL_MSG("sha256 hmac");
+                ctx->type = SHA256;
+            }
+            
+            /* has to be last since would pick or 256, 384, or 512 too */
+            else if (XSTRNCMP(type, "SHA", 3) == 0) {
+                CYASSL_MSG("sha hmac");
+                ctx->type = SHA;
+            }
+            else {
+                CYASSL_MSG("bad init type");
+            }
+        }
+
+        if (key && keylen) {
+            CYASSL_MSG("keying hmac");
+            HmacSetKey(&ctx->hmac, ctx->type, (const byte*)key, (word32)keylen);
+        }
+    }
+
+
+    void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx, const unsigned char* data,
+                        int len)
+    {
+        CYASSL_MSG("CyaSSL_HMAC_Update");
+
+        if (ctx && data) {
+            CYASSL_MSG("updating hmac");
+            HmacUpdate(&ctx->hmac, data, (word32)len);
+        }
+    }
+
+
+    void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash,
+                       unsigned int* len)
+    {
+        CYASSL_MSG("CyaSSL_HMAC_Final");
+
+        if (ctx && hash) {
+            CYASSL_MSG("final hmac");
+            HmacFinal(&ctx->hmac, hash);
+
+            if (len) {
+                CYASSL_MSG("setting output len");
+                switch (ctx->type) {
+                    case MD5:
+                        *len = MD5_DIGEST_SIZE;
+                        break;
+
+                    case SHA:
+                        *len = SHA_DIGEST_SIZE;
+                        break;
+
+                    case SHA256:
+                        *len = SHA256_DIGEST_SIZE;
+                        break;
+
+                    default:
+                        CYASSL_MSG("bad hmac type");
+                }
+            }
+        }
+    }
+
+
+    void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx)
+    {
+        (void)ctx;
+
+        CYASSL_MSG("CyaSSL_HMAC_cleanup");
+    }
+
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_get_digestbynid(int id)
+    {
+        CYASSL_MSG("CyaSSL_get_digestbynid");
+
+        switch(id) {
+            case NID_md5:
+                return CyaSSL_EVP_md5();
+                break;
+
+            case NID_sha1:
+                return CyaSSL_EVP_sha1();
+                break;
+
+            default:
+                CYASSL_MSG("Bad digest id value");
+        }
+
+        return NULL;
+    }
+
+
+    CYASSL_RSA* CyaSSL_EVP_PKEY_get1_RSA(CYASSL_EVP_PKEY* key)
+    {
+        (void)key;
+        CYASSL_MSG("CyaSSL_EVP_PKEY_get1_RSA");
+
+        return NULL;
+    }
+
+
+    CYASSL_DSA* CyaSSL_EVP_PKEY_get1_DSA(CYASSL_EVP_PKEY* key)
+    {
+        (void)key;
+        CYASSL_MSG("CyaSSL_EVP_PKEY_get1_DSA");
+
+        return NULL;
+    }
+
+
+    void* CyaSSL_EVP_X_STATE(const CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_MSG("CyaSSL_EVP_X_STATE");
+
+        if (ctx) {
+            switch (ctx->cipherType) {
+                case ARC4_TYPE:
+                    CYASSL_MSG("returning arc4 state");
+                    return (void*)&ctx->cipher.arc4.x;
+                    break;
+
+                default:
+                    CYASSL_MSG("bad x state type");
+                    return 0;
+            }
+        }
+
+        return NULL;
+    }
+
+
+    int CyaSSL_EVP_X_STATE_LEN(const CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_MSG("CyaSSL_EVP_X_STATE_LEN");
+
+        if (ctx) {
+            switch (ctx->cipherType) {
+                case ARC4_TYPE:
+                    CYASSL_MSG("returning arc4 state size");
+                    return sizeof(Arc4);
+                    break;
+
+                default:
+                    CYASSL_MSG("bad x state type");
+                    return 0;
+            }
+        }
+
+        return 0;
+    }
+
+
+    void CyaSSL_3des_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
+                                unsigned char* iv, int len)
+    {
+        (void)len;
+
+        CYASSL_MSG("CyaSSL_3des_iv");
+
+        if (ctx == NULL || iv == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return;
+        }
+
+        if (doset)
+            Des3_SetIV(&ctx->cipher.des3, iv);
+        else
+            memcpy(iv, &ctx->cipher.des3.reg, DES_BLOCK_SIZE);
+    }
+
+
+    void CyaSSL_aes_ctr_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset,
+                          unsigned char* iv, int len)
+    {
+        (void)len;
+
+        CYASSL_MSG("CyaSSL_aes_ctr_iv");
+
+        if (ctx == NULL || iv == NULL) {
+            CYASSL_MSG("Bad function argument");
+            return;
+        }
+
+        if (doset)
+            AesSetIV(&ctx->cipher.aes, iv);
+        else
+            memcpy(iv, &ctx->cipher.aes.reg, AES_BLOCK_SIZE);
+    }
+
+
+    const CYASSL_EVP_MD* CyaSSL_EVP_ripemd160(void)
+    {
+        CYASSL_MSG("CyaSSL_ripemd160");
+
+        return NULL;
+    }
+
+
+    int CyaSSL_EVP_MD_size(const CYASSL_EVP_MD* type)
+    {
+        CYASSL_MSG("CyaSSL_EVP_MD_size");
+
+        if (type == NULL) {
+            CYASSL_MSG("No md type arg");
+            return BAD_FUNC_ARG;
+        }
+
+        if (XSTRNCMP(type, "MD5", 3) == 0) {
+            return MD5_DIGEST_SIZE;
+        }
+        else if (XSTRNCMP(type, "SHA256", 6) == 0) {
+            return SHA256_DIGEST_SIZE;
+        }
+    #ifdef CYASSL_SHA384
+        else if (XSTRNCMP(type, "SHA384", 6) == 0) {
+            return SHA384_DIGEST_SIZE;
+        }
+    #endif
+    #ifdef CYASSL_SHA512
+        else if (XSTRNCMP(type, "SHA512", 6) == 0) {
+            return SHA512_DIGEST_SIZE;
+        }
+    #endif
+        /* has to be last since would pick or 256, 384, or 512 too */
+        else if (XSTRNCMP(type, "SHA", 3) == 0) {
+            return SHA_DIGEST_SIZE;
+        }   
+
+        return BAD_FUNC_ARG;
+    }
+
+
+    int CyaSSL_EVP_CIPHER_CTX_iv_length(const CYASSL_EVP_CIPHER_CTX* ctx)
+    {
+        CYASSL_MSG("CyaSSL_EVP_CIPHER_CTX_iv_length");
+
+        switch (ctx->cipherType) {
+
+            case AES_128_CBC_TYPE :
+            case AES_192_CBC_TYPE :
+            case AES_256_CBC_TYPE :
+                CYASSL_MSG("AES CBC");
+                return AES_BLOCK_SIZE;
+                break;
+
+#ifdef CYASSL_AES_COUNTER
+            case AES_128_CTR_TYPE :
+            case AES_192_CTR_TYPE :
+            case AES_256_CTR_TYPE :
+                CYASSL_MSG("AES CTR");
+                return AES_BLOCK_SIZE;
+                break;
+#endif
+
+            case DES_CBC_TYPE :
+                CYASSL_MSG("DES CBC");
+                return DES_BLOCK_SIZE;
+                break;
+                
+            case DES_EDE3_CBC_TYPE :
+                CYASSL_MSG("DES EDE3 CBC");
+                return DES_BLOCK_SIZE;
+                break;
+
+            case ARC4_TYPE :
+                CYASSL_MSG("ARC4");
+                return 0;
+                break;
+
+            case NULL_CIPHER_TYPE :
+                CYASSL_MSG("NULL");
+                return 0;
+                break;
+
+            default: {
+                CYASSL_MSG("bad type");
+            }
+        }    
+        return 0;
+    }
+
+
+    void CyaSSL_OPENSSL_free(void* p)
+    {
+        CYASSL_MSG("CyaSSL_OPENSSL_free");
+
+        XFREE(p, NULL, 0);
+    }
+
+
+    int CyaSSL_PEM_write_bio_RSAPrivateKey(CYASSL_BIO* bio, RSA* rsa,
+                                         const EVP_CIPHER* cipher,
+                                         unsigned char* passwd, int len,
+                                         pem_password_cb cb, void* arg)
+    {
+        (void)bio;
+        (void)rsa;
+        (void)cipher;
+        (void)passwd;
+        (void)len;
+        (void)cb;
+        (void)arg;
+
+        CYASSL_MSG("CyaSSL_PEM_write_bio_RSAPrivateKey");
+
+        return -1;
+    }
+
+
+
+    int CyaSSL_PEM_write_bio_DSAPrivateKey(CYASSL_BIO* bio, DSA* rsa,
+                                         const EVP_CIPHER* cipher,
+                                         unsigned char* passwd, int len,
+                                         pem_password_cb cb, void* arg)
+    {
+        (void)bio;
+        (void)rsa;
+        (void)cipher;
+        (void)passwd;
+        (void)len;
+        (void)cb;
+        (void)arg;
+
+        CYASSL_MSG("CyaSSL_PEM_write_bio_DSAPrivateKey");
+
+        return -1;
+    }
+
+
+
+    CYASSL_EVP_PKEY* CyaSSL_PEM_read_bio_PrivateKey(CYASSL_BIO* bio,
+                        CYASSL_EVP_PKEY** key, pem_password_cb cb, void* arg)
+    {
+        (void)bio;
+        (void)key;
+        (void)cb;
+        (void)arg;
+
+        CYASSL_MSG("CyaSSL_PEM_read_bio_PrivateKey");
+
+        return NULL;
+    }
+
+
+
+/* Return bytes written to buff or < 0 for error */
+int CyaSSL_KeyPemToDer(const unsigned char* pem, int pemSz, unsigned char* buff,
+                       int buffSz, const char* pass)
+{
+    EncryptedInfo info;
+    int           eccKey = 0;
+    int           ret;
+    buffer        der;
+
+    (void)pass;
+
+    CYASSL_ENTER("CyaSSL_KeyPemToDer");
+
+    if (pem == NULL || buff == NULL || buffSz <= 0) {
+        CYASSL_MSG("Bad pem der args"); 
+        return BAD_FUNC_ARG;
+    }
+
+    info.set       = 0;
+    info.ctx      = NULL;
+    info.consumed = 0;
+    der.buffer    = NULL;
+
+    ret = PemToDer(pem, pemSz, PRIVATEKEY_TYPE, &der, NULL, &info, &eccKey);
+    if (ret < 0) {
+        CYASSL_MSG("Bad Pem To Der"); 
+    }
+    else {
+        if (der.length <= (word32)buffSz) {
+            XMEMCPY(buff, der.buffer, der.length);
+            ret = der.length;
+        }
+        else {
+            CYASSL_MSG("Bad der length");
+            ret = BAD_FUNC_ARG;
+        }
+    }
+
+    XFREE(der.buffer, NULL, DYANMIC_KEY_TYPE);
+
+    return ret;
+}
+
+
+/* Load RSA from Der, 0 on success < 0 on error */
+int CyaSSL_RSA_LoadDer(CYASSL_RSA* rsa, const unsigned char* der,  int derSz)
+{
+    word32 idx = 0;
+    int    ret;
+
+    CYASSL_ENTER("CyaSSL_RSA_LoadDer");
+
+    if (rsa == NULL || rsa->internal == NULL || der == NULL || derSz <= 0) {
+        CYASSL_MSG("Bad function arguments");
+        return BAD_FUNC_ARG;
+    }
+
+    ret = RsaPrivateKeyDecode(der, &idx, (RsaKey*)rsa->internal, derSz);
+    if (ret < 0) {
+        CYASSL_MSG("RsaPrivateKeyDecode failed");
+        return ret;
+    }
+
+    if (SetRsaExternal(rsa) < 0) {
+        CYASSL_MSG("SetRsaExternal failed");
+        return -1;
+    }
+
+    rsa->inSet = 1;
+
+    return 0;
+}
+
+
+/* Load DSA from Der, 0 on success < 0 on error */
+int CyaSSL_DSA_LoadDer(CYASSL_DSA* dsa, const unsigned char* der,  int derSz)
+{
+    word32 idx = 0;
+    int    ret;
+
+    CYASSL_ENTER("CyaSSL_DSA_LoadDer");
+
+    if (dsa == NULL || dsa->internal == NULL || der == NULL || derSz <= 0) {
+        CYASSL_MSG("Bad function arguments");
+        return BAD_FUNC_ARG;
+    }
+
+    ret = DsaPrivateKeyDecode(der, &idx, (DsaKey*)dsa->internal, derSz);
+    if (ret < 0) {
+        CYASSL_MSG("DsaPrivateKeyDecode failed");
+        return ret;
+    }
+
+    if (SetDsaExternal(dsa) < 0) {
+        CYASSL_MSG("SetDsaExternal failed");
+        return -1;
+    }
+
+    dsa->inSet = 1;
+
+    return 0;
+}
+
+
+
+
+
+#endif /* OPENSSL_EXTRA */
+
+
+#ifdef SESSION_CERTS
+
+
+/* Get peer's certificate chain */
+CYASSL_X509_CHAIN* CyaSSL_get_peer_chain(CYASSL* ssl)
+{
+    CYASSL_ENTER("CyaSSL_get_peer_chain");
+    if (ssl)
+        return &ssl->session.chain;
+
+    return 0;
+}
+
+
+/* Get peer's certificate chain total count */
+int CyaSSL_get_chain_count(CYASSL_X509_CHAIN* chain)
+{
+    CYASSL_ENTER("CyaSSL_get_chain_count");
+    if (chain)
+        return chain->count;
+
+    return 0;
+}
+
+
+/* Get peer's ASN.1 DER ceritifcate at index (idx) length in bytes */
+int CyaSSL_get_chain_length(CYASSL_X509_CHAIN* chain, int idx)
+{
+    CYASSL_ENTER("CyaSSL_get_chain_length");
+    if (chain)
+        return chain->certs[idx].length;
+
+    return 0;
+}
+
+
+/* Get peer's ASN.1 DER ceritifcate at index (idx) */
+byte* CyaSSL_get_chain_cert(CYASSL_X509_CHAIN* chain, int idx)
+{
+    CYASSL_ENTER("CyaSSL_get_chain_cert");
+    if (chain)
+        return chain->certs[idx].buffer;
+
+    return 0;
+}
+
+
+/* Get peer's PEM ceritifcate at index (idx), output to buffer if inLen big
+   enough else return error (-1), output length is in *outLen */
+int  CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN* chain, int idx,
+                               unsigned char* buf, int inLen, int* outLen)
+{
+    const char header[] = "-----BEGIN CERTIFICATE-----\n";
+    const char footer[] = "-----END CERTIFICATE-----\n";
+
+    int headerLen = sizeof(header) - 1;
+    int footerLen = sizeof(footer) - 1;
+    int i;
+    int err;
+
+    CYASSL_ENTER("CyaSSL_get_chain_cert_pem");
+    if (!chain || !outLen || !buf)
+        return BAD_FUNC_ARG;
+
+    /* don't even try if inLen too short */
+    if (inLen < headerLen + footerLen + chain->certs[idx].length)
+        return BAD_FUNC_ARG;
+
+    /* header */
+    XMEMCPY(buf, header, headerLen);
+    i = headerLen;
+
+    /* body */
+    *outLen = inLen;  /* input to Base64_Encode */
+    if ( (err = Base64_Encode(chain->certs[idx].buffer,
+                       chain->certs[idx].length, buf + i, (word32*)outLen)) < 0)
+        return err;
+    i += *outLen;
+
+    /* footer */
+    if ( (i + footerLen) > inLen)
+        return BAD_FUNC_ARG;
+    XMEMCPY(buf + i, footer, footerLen);
+    *outLen += headerLen + footerLen; 
+
+    return 0;
+}
+
+
+/* get session ID */
+const byte* CyaSSL_get_sessionID(const CYASSL_SESSION* session)
+{
+    CYASSL_ENTER("CyaSSL_get_sessionID");
+    if (session)
+        return session->sessionID;
+
+    return NULL;
+}
+
+
+#endif /* SESSION_CERTS */
+
+
+long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, long options)
+{
+    CYASSL_ENTER("CyaSSL_CTX_OCSP_set_options");
+#ifdef HAVE_OCSP
+    if (ctx != NULL) {
+        ctx->ocsp.enabled = (options & CYASSL_OCSP_ENABLE) != 0;
+        ctx->ocsp.useOverrideUrl = (options & CYASSL_OCSP_URL_OVERRIDE) != 0;
+        return 1;
+    }
+    return 0;
+#else
+    (void)ctx;
+    (void)options;
+    return NOT_COMPILED_IN;
+#endif
+}
+
+
+int CyaSSL_CTX_OCSP_set_override_url(CYASSL_CTX* ctx, const char* url)
+{
+    CYASSL_ENTER("CyaSSL_CTX_OCSP_set_override_url");
+#ifdef HAVE_OCSP
+    return CyaSSL_OCSP_set_override_url(&ctx->ocsp, url);
+#else
+    (void)ctx;
+    (void)url;
+    return NOT_COMPILED_IN;
+#endif
+}
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/src/tls.c b/FreeRTOS-Plus/Source/CyaSSL/src/tls.c
new file mode 100644 (file)
index 0000000..f5ef460
--- /dev/null
@@ -0,0 +1,531 @@
+/* tls.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/ssl.h>
+#include <cyassl/internal.h>
+#include <cyassl/error.h>
+#include <cyassl/ctaocrypt/hmac.h>
+
+
+
+#ifndef NO_TLS
+
+
+#ifndef min
+
+    static INLINE word32 min(word32 a, word32 b)
+    {
+        return a > b ? b : a;
+    }
+
+#endif /* min */
+
+
+/* calculate XOR for TLSv1 PRF */
+static INLINE void get_xor(byte *digest, word32 digLen, byte* md5, byte* sha)
+{
+    word32 i;
+
+    for (i = 0; i < digLen; i++) 
+        digest[i] = md5[i] ^ sha[i];
+}
+
+
+#ifdef CYASSL_SHA384
+    #define PHASH_MAX_DIGEST_SIZE SHA384_DIGEST_SIZE
+#else
+    #define PHASH_MAX_DIGEST_SIZE SHA256_DIGEST_SIZE
+#endif
+
+/* compute p_hash for MD5, SHA-1, SHA-256, or SHA-384 for TLSv1 PRF */
+static void p_hash(byte* result, word32 resLen, const byte* secret,
+                   word32 secLen, const byte* seed, word32 seedLen, int hash)
+{
+    word32   len = MD5_DIGEST_SIZE;
+    word32   times;
+    word32   lastLen;
+    word32   lastTime;
+    word32   i;
+    word32   idx = 0;
+    byte     previous[PHASH_MAX_DIGEST_SIZE];  /* max size */
+    byte     current[PHASH_MAX_DIGEST_SIZE];   /* max size */
+
+    Hmac hmac;
+
+    if (hash == md5_mac) {
+        hash = MD5;
+    }
+    else if (hash == sha_mac) {
+        len = SHA_DIGEST_SIZE;
+        hash = SHA;
+    } else if (hash == sha256_mac) {
+        len = SHA256_DIGEST_SIZE;
+        hash = SHA256;
+    }
+#ifdef CYASSL_SHA384
+    else if (hash == sha384_mac)
+    {
+        len = SHA384_DIGEST_SIZE;
+        hash = SHA384;
+    }
+#endif
+
+    times = resLen / len;
+    lastLen = resLen % len;
+    if (lastLen) times += 1;
+    lastTime = times - 1;
+
+    HmacSetKey(&hmac, hash, secret, secLen);
+    HmacUpdate(&hmac, seed, seedLen);       /* A0 = seed */
+    HmacFinal(&hmac, previous);             /* A1 */
+
+    for (i = 0; i < times; i++) {
+        HmacUpdate(&hmac, previous, len);
+        HmacUpdate(&hmac, seed, seedLen);
+        HmacFinal(&hmac, current);
+
+        if ( (i == lastTime) && lastLen)
+            XMEMCPY(&result[idx], current, min(lastLen, sizeof(current)));
+        else {
+            XMEMCPY(&result[idx], current, len);
+            idx += len;
+            HmacUpdate(&hmac, previous, len);
+            HmacFinal(&hmac, previous);
+        }
+    }
+}
+
+
+
+/* compute TLSv1 PRF (pseudo random function using HMAC) */
+static void PRF(byte* digest, word32 digLen, const byte* secret, word32 secLen,
+            const byte* label, word32 labLen, const byte* seed, word32 seedLen,
+            int useAtLeastSha256, int hash_type)
+{
+    word32 half = (secLen + 1) / 2;
+
+    byte md5_half[MAX_PRF_HALF];        /* half is real size */
+    byte sha_half[MAX_PRF_HALF];        /* half is real size */
+    byte labelSeed[MAX_PRF_LABSEED];    /* labLen + seedLen is real size */
+    byte md5_result[MAX_PRF_DIG];       /* digLen is real size */
+    byte sha_result[MAX_PRF_DIG];       /* digLen is real size */
+
+    if (half > MAX_PRF_HALF)
+        return;
+    if (labLen + seedLen > MAX_PRF_LABSEED)
+        return;
+    if (digLen > MAX_PRF_DIG)
+        return;
+    
+    XMEMCPY(md5_half, secret, half);
+    XMEMCPY(sha_half, secret + half - secLen % 2, half);
+
+    XMEMCPY(labelSeed, label, labLen);
+    XMEMCPY(labelSeed + labLen, seed, seedLen);
+
+    if (useAtLeastSha256) {
+        /* If a cipher suite wants an algorithm better than sha256, it
+         * should use better. */
+        if (hash_type < sha256_mac)
+            hash_type = sha256_mac;
+        p_hash(digest, digLen, secret, secLen, labelSeed, labLen + seedLen,
+               hash_type);
+        return;
+    }
+
+    p_hash(md5_result, digLen, md5_half, half, labelSeed, labLen + seedLen,
+           md5_mac);
+    p_hash(sha_result, digLen, sha_half, half, labelSeed, labLen + seedLen,
+           sha_mac);
+    get_xor(digest, digLen, md5_result, sha_result);
+}
+
+
+#ifdef CYASSL_SHA384
+    #define HSHASH_SZ SHA384_DIGEST_SIZE
+#else
+    #define HSHASH_SZ FINISHED_SZ
+#endif
+
+
+void BuildTlsFinished(CYASSL* ssl, Hashes* hashes, const byte* sender)
+{
+    const byte* side;
+    byte        handshake_hash[HSHASH_SZ];
+    word32      hashSz = FINISHED_SZ;
+
+    Md5Final(&ssl->hashMd5, handshake_hash);
+    ShaFinal(&ssl->hashSha, &handshake_hash[MD5_DIGEST_SIZE]);
+    if (IsAtLeastTLSv1_2(ssl)) {
+#ifndef NO_SHA256
+        if (ssl->specs.mac_algorithm <= sha256_mac) {
+            Sha256Final(&ssl->hashSha256, handshake_hash);
+            hashSz = SHA256_DIGEST_SIZE;
+        }
+#endif
+#ifdef CYASSL_SHA384
+        if (ssl->specs.mac_algorithm == sha384_mac) {
+            Sha384Final(&ssl->hashSha384, handshake_hash);
+            hashSz = SHA384_DIGEST_SIZE;
+        }
+#endif
+    }
+   
+    if ( XSTRNCMP((const char*)sender, (const char*)client, SIZEOF_SENDER) == 0)
+        side = tls_client;
+    else
+        side = tls_server;
+
+    PRF(hashes->md5, TLS_FINISHED_SZ, ssl->arrays.masterSecret, SECRET_LEN,
+        side, FINISHED_LABEL_SZ, handshake_hash, hashSz, IsAtLeastTLSv1_2(ssl),
+        ssl->specs.mac_algorithm);
+}
+
+
+ProtocolVersion MakeTLSv1(void)
+{
+    ProtocolVersion pv;
+    pv.major = SSLv3_MAJOR;
+    pv.minor = TLSv1_MINOR;
+
+    return pv;
+}
+
+
+ProtocolVersion MakeTLSv1_1(void)
+{
+    ProtocolVersion pv;
+    pv.major = SSLv3_MAJOR;
+    pv.minor = TLSv1_1_MINOR;
+
+    return pv;
+}
+
+
+ProtocolVersion MakeTLSv1_2(void)
+{
+    ProtocolVersion pv;
+    pv.major = SSLv3_MAJOR;
+    pv.minor = TLSv1_2_MINOR;
+
+    return pv;
+}
+
+
+static const byte master_label[MASTER_LABEL_SZ + 1] = "master secret";
+static const byte key_label   [KEY_LABEL_SZ + 1]    = "key expansion";
+
+
+int DeriveTlsKeys(CYASSL* ssl)
+{
+    int length = 2 * ssl->specs.hash_size + 
+                 2 * ssl->specs.key_size  +
+                 2 * ssl->specs.iv_size;
+    byte         seed[SEED_LEN];
+    byte         key_data[MAX_PRF_DIG];
+
+    XMEMCPY(seed, ssl->arrays.serverRandom, RAN_LEN);
+    XMEMCPY(&seed[RAN_LEN], ssl->arrays.clientRandom, RAN_LEN);
+
+    PRF(key_data, length, ssl->arrays.masterSecret, SECRET_LEN, key_label,
+        KEY_LABEL_SZ, seed, SEED_LEN, IsAtLeastTLSv1_2(ssl),
+        ssl->specs.mac_algorithm);
+
+    return StoreKeys(ssl, key_data);
+}
+
+
+int MakeTlsMasterSecret(CYASSL* ssl)
+{
+    byte seed[SEED_LEN];
+    
+    XMEMCPY(seed, ssl->arrays.clientRandom, RAN_LEN);
+    XMEMCPY(&seed[RAN_LEN], ssl->arrays.serverRandom, RAN_LEN);
+
+    PRF(ssl->arrays.masterSecret, SECRET_LEN,
+        ssl->arrays.preMasterSecret, ssl->arrays.preMasterSz,
+        master_label, MASTER_LABEL_SZ, 
+        seed, SEED_LEN, IsAtLeastTLSv1_2(ssl), ssl->specs.mac_algorithm);
+
+#ifdef SHOW_SECRETS
+    {
+        int i;
+        printf("master secret: ");
+        for (i = 0; i < SECRET_LEN; i++)
+            printf("%02x", ssl->arrays.masterSecret[i]);
+        printf("\n");
+    }
+#endif
+
+    return DeriveTlsKeys(ssl);
+}
+
+
+/*** next for static INLINE s copied from cyassl_int.c ***/
+
+/* convert 16 bit integer to opaque */
+INLINE static void c16toa(word16 u16, byte* c)
+{
+    c[0] = (u16 >> 8) & 0xff;
+    c[1] =  u16 & 0xff;
+}
+
+
+/* convert 32 bit integer to opaque */
+static INLINE void c32toa(word32 u32, byte* c)
+{
+    c[0] = (u32 >> 24) & 0xff;
+    c[1] = (u32 >> 16) & 0xff;
+    c[2] = (u32 >>  8) & 0xff;
+    c[3] =  u32 & 0xff;
+}
+
+
+static INLINE word32 GetSEQIncrement(CYASSL* ssl, int verify)
+{
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls) {
+        if (verify)
+            return ssl->keys.dtls_peer_sequence_number; /* explicit from peer */
+        else
+            return ssl->keys.dtls_sequence_number - 1; /* already incremented */
+    }
+#endif
+    if (verify)
+        return ssl->keys.peer_sequence_number++; 
+    else
+        return ssl->keys.sequence_number++; 
+}
+
+
+#ifdef CYASSL_DTLS
+
+static INLINE word32 GetEpoch(CYASSL* ssl, int verify)
+{
+    if (verify)
+        return ssl->keys.dtls_peer_epoch; 
+    else
+        return ssl->keys.dtls_epoch; 
+}
+
+#endif /* CYASSL_DTLS */
+
+
+static INLINE const byte* GetMacSecret(CYASSL* ssl, int verify)
+{
+    if ( (ssl->options.side == CLIENT_END && !verify) ||
+         (ssl->options.side == SERVER_END &&  verify) )
+        return ssl->keys.client_write_MAC_secret;
+    else
+        return ssl->keys.server_write_MAC_secret;
+}
+
+/*** end copy ***/
+
+
+/* TLS type HMAC */
+void TLS_hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
+              int content, int verify)
+{
+    Hmac hmac;
+    byte seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 };
+    byte length[LENGTH_SZ];
+    byte inner[ENUM_LEN + VERSION_SZ + LENGTH_SZ]; /* type + version +len */
+    int  type;
+
+    c16toa((word16)sz, length);
+#ifdef CYASSL_DTLS
+    if (ssl->options.dtls)
+        c16toa(GetEpoch(ssl, verify), seq);
+#endif
+    c32toa(GetSEQIncrement(ssl, verify), &seq[sizeof(word32)]);
+    
+    if (ssl->specs.mac_algorithm == md5_mac)
+        type = MD5;
+    else if (ssl->specs.mac_algorithm == sha_mac)
+        type = SHA;
+    else
+        type = SHA256;
+    HmacSetKey(&hmac, type, GetMacSecret(ssl, verify), ssl->specs.hash_size);
+    
+    HmacUpdate(&hmac, seq, SEQ_SZ);                               /* seq_num */
+    inner[0] = (byte)content;                                     /* type */
+    inner[ENUM_LEN] = ssl->version.major;
+    inner[ENUM_LEN + ENUM_LEN] = ssl->version.minor;              /* version */
+    XMEMCPY(&inner[ENUM_LEN + VERSION_SZ], length, LENGTH_SZ);     /* length */
+    HmacUpdate(&hmac, inner, sizeof(inner));
+    HmacUpdate(&hmac, in, sz);                                /* content */
+    HmacFinal(&hmac, digest);
+}
+
+
+#ifndef NO_CYASSL_CLIENT
+
+    CYASSL_METHOD* CyaTLSv1_client_method(void)
+    {
+        CYASSL_METHOD* method =
+                             (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                      DYNAMIC_TYPE_METHOD);
+        if (method)
+            InitSSL_Method(method, MakeTLSv1());
+        return method;
+    }
+
+
+    CYASSL_METHOD* CyaTLSv1_1_client_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method)
+            InitSSL_Method(method, MakeTLSv1_1());
+        return method;
+    }
+
+
+#ifndef NO_SHA256   /* can't use without SHA256 */
+
+    CYASSL_METHOD* CyaTLSv1_2_client_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method)
+            InitSSL_Method(method, MakeTLSv1_2());
+        return method;
+    }
+
+#endif
+
+
+    CYASSL_METHOD* CyaSSLv23_client_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method) {
+#ifndef NO_SHA256         /* 1.2 requires SHA256 */
+            InitSSL_Method(method, MakeTLSv1_2());
+#else
+            InitSSL_Method(method, MakeTLSv1_1());
+#endif
+            method->downgrade = 1;
+        }
+        return method;
+    }
+
+
+#endif /* NO_CYASSL_CLIENT */
+
+
+
+#ifndef NO_CYASSL_SERVER
+
+    CYASSL_METHOD* CyaTLSv1_server_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method) {
+            InitSSL_Method(method, MakeTLSv1());
+            method->side = SERVER_END;
+        }
+        return method;
+    }
+
+
+    CYASSL_METHOD* CyaTLSv1_1_server_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method) {
+            InitSSL_Method(method, MakeTLSv1_1());
+            method->side = SERVER_END;
+        }
+        return method;
+    }
+
+
+#ifndef NO_SHA256   /* can't use without SHA256 */
+
+    CYASSL_METHOD* CyaTLSv1_2_server_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method) {
+            InitSSL_Method(method, MakeTLSv1_2());
+            method->side = SERVER_END;
+        }
+        return method;
+    }
+
+#endif
+
+
+    CYASSL_METHOD* CyaSSLv23_server_method(void)
+    {
+        CYASSL_METHOD* method =
+                              (CYASSL_METHOD*) XMALLOC(sizeof(CYASSL_METHOD), 0,
+                                                       DYNAMIC_TYPE_METHOD);
+        if (method) {
+#ifndef NO_SHA256         /* 1.2 requires SHA256 */
+            InitSSL_Method(method, MakeTLSv1_2());
+#else
+            InitSSL_Method(method, MakeTLSv1_1());
+#endif
+            method->side      = SERVER_END;
+            method->downgrade = 1;
+        }
+        return method;
+    }
+
+
+
+#endif /* NO_CYASSL_SERVER */
+
+#else /* NO_TLS */
+
+/* catch CyaSSL programming errors */
+void BuildTlsFinished(CYASSL* ssl, Hashes* hashes, const byte* sender)
+{
+   
+}
+
+
+int DeriveTlsKeys(CYASSL* ssl)
+{
+    return NOT_COMPILED_IN;
+}
+
+
+int MakeTlsMasterSecret(CYASSL* ssl)
+{ 
+    return NOT_COMPILED_IN;
+}
+
+#endif /* NO_TLS */
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSniffer.vcproj b/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSniffer.vcproj
new file mode 100644 (file)
index 0000000..1a4ca9b
--- /dev/null
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="sslSniffer"\r
+       ProjectGUID="{34FAE5A6-2B0F-4B55-86FE-0C43E4810F4D}"\r
+       RootNamespace="sslSniffer"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../"\r
+                               PreprocessorDefinitions="CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../"\r
+                               PreprocessorDefinitions="CYASSL_SNIFFER;SSL_SNIFFER_EXPORTS"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\src\sniffer.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\include\sniffer.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\cyassl\sniffer_error.rc"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/include.am b/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/include.am
new file mode 100644 (file)
index 0000000..cf2ed1c
--- /dev/null
@@ -0,0 +1,12 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+noinst_PROGRAMS += sslSniffer/sslSnifferTest/snifftest
+sslSniffer_sslSnifferTest_snifftest_SOURCES = sslSniffer/sslSnifferTest/snifftest.c
+if BUILD_SNIFFER
+sslSniffer_sslSnifferTest_snifftest_LDADD        = src/libcyassl.la -lpcap
+sslSniffer_sslSnifferTest_snifftest_DEPENDENCIES = src/libcyassl.la
+endif
+EXTRA_DIST += sslSniffer/sslSniffer.vcproj
+EXTRA_DIST += sslSniffer/sslSnifferTest/sslSniffTest.vcproj
diff --git a/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/snifftest.c b/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/snifftest.c
new file mode 100644 (file)
index 0000000..a132538
--- /dev/null
@@ -0,0 +1,276 @@
+/* snifftest.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifdef _WIN32
+    #define CYASSL_SNIFFER
+#endif
+
+#ifndef CYASSL_SNIFFER
+
+/* blank build */
+#include <stdio.h>
+#include <stdlib.h>
+int main()
+{
+    printf("do ./configure --enable-sniffer to enable build support\n");
+    return EXIT_SUCCESS;
+}
+
+#else
+/* do a full build */
+
+#ifdef _MSC_VER
+       /* builds on *nix too, for scanf device and port */
+       #define _CRT_SECURE_NO_WARNINGS
+#endif
+
+#include <pcap/pcap.h>     /* pcap stuff */
+#include <stdio.h>         /* printf */
+#include <stdlib.h>        /* EXIT_SUCCESS */
+#include <string.h>        /* strcmp */
+#include <signal.h>        /* signal */
+
+#include <cyassl/sniffer.h>
+
+
+#ifndef _WIN32
+    #include <arpa/inet.h>
+#endif
+
+typedef unsigned char byte;
+
+enum {
+    ETHER_IF_FRAME_LEN = 14,   /* ethernet interface frame length */
+    NULL_IF_FRAME_LEN =   4,   /* no link interface frame length  */
+};
+
+
+pcap_t* pcap = 0;
+pcap_if_t *alldevs;
+
+static void sig_handler(const int sig) 
+{
+    printf("SIGINT handled = %d.\n", sig);
+    if (pcap)
+        pcap_close(pcap);
+       pcap_freealldevs(alldevs);
+#ifndef _WIN32
+    ssl_FreeSniffer();
+#endif
+    exit(EXIT_SUCCESS);
+}
+
+
+static void err_sys(const char* msg)
+{
+       fprintf(stderr, "%s\n", msg);
+       exit(EXIT_FAILURE);
+}
+
+
+#ifdef _WIN32
+       #define SNPRINTF _snprintf
+#else
+       #define SNPRINTF snprintf
+#endif
+
+
+static char* iptos(unsigned int addr)
+{
+       static char    output[32];
+       byte *p = (byte*)&addr;
+
+       SNPRINTF(output, sizeof(output), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+
+       return output;
+}
+
+
+int main(int argc, char** argv)
+{
+    int          ret;
+       int                  inum;
+       int                  port;
+    int          saveFile = 0;
+       int                  i = 0;
+    int          frame = ETHER_IF_FRAME_LEN; 
+    char         err[PCAP_ERRBUF_SIZE];
+       char         filter[32];
+       const char  *server = NULL;
+       struct       bpf_program fp;
+       pcap_if_t   *d;
+       pcap_addr_t *a;
+
+    signal(SIGINT, sig_handler);
+
+#ifndef _WIN32
+    ssl_InitSniffer();   /* dll load on Windows */
+#endif
+    ssl_Trace("./tracefile.txt", err);
+
+    if (argc == 1) {
+        /* normal case, user chooses device and port */
+
+           if (pcap_findalldevs(&alldevs, err) == -1)
+                   err_sys("Error in pcap_findalldevs");
+
+           for (d = alldevs; d; d=d->next) {
+                   printf("%d. %s", ++i, d->name);
+                   if (d->description)
+                           printf(" (%s)\n", d->description);
+                   else
+                           printf(" (No description available)\n");
+           }
+
+           if (i == 0)
+                   err_sys("No interfaces found! Make sure pcap or WinPcap is"
+                    " installed correctly and you have sufficient permissions");
+
+           printf("Enter the interface number (1-%d): ", i);
+           scanf("%d", &inum);
+
+           if (inum < 1 || inum > i)
+                   err_sys("Interface number out of range");
+
+           /* Jump to the selected adapter */
+           for (d = alldevs, i = 0; i < inum - 1; d = d->next, i++);
+
+           pcap = pcap_create(d->name, err);
+
+        if (pcap == NULL) printf("pcap_create failed %s\n", err);
+
+           /* get an IPv4 address */
+           for (a = d->addresses; a; a = a->next) {
+                   switch(a->addr->sa_family)
+                   {
+                           case AF_INET:
+                                   server = 
+                        iptos(((struct sockaddr_in *)a->addr)->sin_addr.s_addr);
+                                   printf("server = %s\n", server);
+                                   break;
+
+                default:
+                    break;
+                   }
+           }
+           if (server == NULL)
+                   err_sys("Unable to get device IPv4 address");
+
+        ret = pcap_set_snaplen(pcap, 65536);
+        if (ret != 0) printf("pcap_set_snaplen failed %s\n", pcap_geterr(pcap));
+
+        ret = pcap_set_timeout(pcap, 1000); 
+        if (ret != 0) printf("pcap_set_timeout failed %s\n", pcap_geterr(pcap));
+
+        ret = pcap_set_buffer_size(pcap, 1000000); 
+        if (ret != 0)
+                   printf("pcap_set_buffer_size failed %s\n", pcap_geterr(pcap));
+
+        ret = pcap_set_promisc(pcap, 1); 
+        if (ret != 0) printf("pcap_set_promisc failed %s\n", pcap_geterr(pcap));
+
+
+        ret = pcap_activate(pcap);
+        if (ret != 0) printf("pcap_activate failed %s\n", pcap_geterr(pcap));
+
+           printf("Enter the port to scan: ");
+           scanf("%d", &port);
+
+           SNPRINTF(filter, sizeof(filter), "tcp and port %d", port);
+
+           ret = pcap_compile(pcap, &fp, filter, 0, 0);
+        if (ret != 0) printf("pcap_compile failed %s\n", pcap_geterr(pcap));
+
+        ret = pcap_setfilter(pcap, &fp);
+        if (ret != 0) printf("pcap_setfilter failed %s\n", pcap_geterr(pcap));
+
+        ret = ssl_SetPrivateKey(server, port, "../../certs/server-key.pem",
+                               FILETYPE_PEM, NULL, err);
+    }
+    else if (argc >= 3) {
+        saveFile = 1;
+        pcap = pcap_open_offline(argv[1], err);
+        if (pcap == NULL) {
+            printf("pcap_open_offline failed %s\n", err);
+            ret = -1;
+        }
+        else {
+            /* defaults for server and port */
+            port = 443;
+            server = "127.0.0.1";
+
+            if (argc >= 4)
+                server = argv[3];
+
+            if (argc >= 5)
+                port = atoi(argv[4]);
+
+            ret = ssl_SetPrivateKey(server, port, argv[2],
+                                    FILETYPE_PEM, NULL, err);
+        }
+    }
+    else {
+        /* usage error */
+        printf(
+             "usage: ./snifftest or ./snifftest dump pemKey [server] [port]\n");
+        exit(EXIT_FAILURE);
+    }
+
+    if (ret != 0)
+        err_sys(err);
+
+    if (pcap_datalink(pcap) == DLT_NULL) 
+        frame = NULL_IF_FRAME_LEN;
+
+    while (1) {
+        struct pcap_pkthdr header;
+        const unsigned char* packet = pcap_next(pcap, &header);
+        if (packet) {
+
+            byte data[65535];
+
+            if (header.caplen > 40)  { /* min ip(20) + min tcp(20) */
+                               packet        += frame;
+                               header.caplen -= frame;                                 
+            }
+            else
+                continue;
+
+            ret = ssl_DecodePacket(packet, header.caplen, data, err);
+            if (ret < 0)
+                printf("ssl_Decode ret = %d, %s\n", ret, err);
+            if (ret > 0) {
+                data[ret] = 0;
+                               printf("SSL App Data:%s\n", data);
+            }
+        }
+        else if (saveFile)
+            break;      /* we're done reading file */
+    }
+
+    return EXIT_SUCCESS;
+}
+
+#endif /* full build */
diff --git a/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/sslSniffTest.vcproj b/FreeRTOS-Plus/Source/CyaSSL/sslSniffer/sslSnifferTest/sslSniffTest.vcproj
new file mode 100644 (file)
index 0000000..0a45e3e
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="sslSniffTest"
+       ProjectGUID="{8C89E16E-9C36-45EF-A491-F4EBD4A8D8F1}"
+       RootNamespace="sslSniffTest"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="196613"
+       >
+       <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="../../../WpdPack/Include;../../include"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="wpcap.lib"
+                               LinkIncremental="2"
+                               AdditionalLibraryDirectories="../../../WpdPack/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="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"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="../../../WpdPack/Include;../../include"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="wpcap.lib"
+                               LinkIncremental="1"
+                               AdditionalLibraryDirectories="../../../WpdPack/Lib"
+                               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="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\snifftest.c"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       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>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/FreeRTOS-Plus/Source/CyaSSL/stamp-h.in b/FreeRTOS-Plus/Source/CyaSSL/stamp-h.in
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/FreeRTOS-Plus/Source/CyaSSL/support/libcyassl.pc.in b/FreeRTOS-Plus/Source/CyaSSL/support/libcyassl.pc.in
new file mode 100644 (file)
index 0000000..ad469bc
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: cyassl
+Description: cyassl C library.
+Version: @VERSION@
+Libs: -L${libdir} -lcyassl
+Cflags: -I${includedir}
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/PythonBuild.sh b/FreeRTOS-Plus/Source/CyaSSL/swig/PythonBuild.sh
new file mode 100644 (file)
index 0000000..7f0939c
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+echo
+swig -python cyassl.i
+pythonIncludes=`python-config --includes`
+pythonLibs=`python-config --libs`
+gcc -c -fpic cyassl_wrap.c -I$pythonIncludes
+gcc -c -fpic cyassl_adds.c 
+gcc -shared -flat_namespace  cyassl_adds.o  cyassl_wrap.o -lcyassl $pythonLibs -o _cyassl.so
+python runme.py
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/README b/FreeRTOS-Plus/Source/CyaSSL/swig/README
new file mode 100644 (file)
index 0000000..302bc6b
--- /dev/null
@@ -0,0 +1,44 @@
+
+
+Initial swig interface file
+
+Please send questions to support@yassl.com
+
+
+
+**Python Support**
+
+    For Linux, OS X, or *nix
+
+1) build CyaSSL with fpic on Linux, not needed on OS X
+    ./configure --disable-shared CFLAGS=-fpic
+    make
+    sudo make install
+
+
+2) start the example echoserver from the examples/echoserver directory
+    ./echoserver
+
+3) run ./PtyonBuild.sh from this directory it will
+    a) build the swig wrapper file
+    b) compile the swig wrapper and cyassl wrapper files
+    c) place them into a cyassl shared library for python
+    d) run runme.py which will connect to the CyaSSL echo server, write a
+       string, then read the result and output it
+
+
+    Windows only 
+
+1) Make sure the install path to cyassl doesn't have any spaces anywhere in the
+   directory path because swig doesn't like that
+2) Have python for Windows installed, note install directory
+3) Have swigwin installed, note install directory
+4) Make sure swigwin install direcotry is added to PATH env. variable
+5) Make sure env. variables PYTHON_INCLUDE and PYTHON_LIB are set correctly e.g.
+    PYTHON_INCLUE="c:\Python26\include"
+    PYTHON_LIB="c:\Python26\libs\python26.lib"
+6) Build python_cyassl in Release mode only, Debug build fails to find a debug
+    python library that isn't included by default
+7) The outputs _cyassl.pyd and cyassl.py are the cyassl import library
+8) Can now run python runme.py from the swig directory 
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/cyassl.i b/FreeRTOS-Plus/Source/CyaSSL/swig/cyassl.i
new file mode 100644 (file)
index 0000000..d32776f
--- /dev/null
@@ -0,0 +1,63 @@
+/* cyassl.i
+ *
+ * Copyright (C) 2006-2011 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+%module cyassl
+%{
+    #include <cyassl/ssl.h>
+    #include <cyassl/ctaocrypt/rsa.h>
+
+    /* defn adds */
+    char* CyaSSL_error_string(int err);
+    int   CyaSSL_swig_connect(CYASSL*, const char* server, int port);
+    RNG*  GetRng(void);
+    RsaKey* GetRsaPrivateKey(const char* file);
+    void    FillSignStr(unsigned char*, const char*, int);
+%}
+
+
+CYASSL_METHOD* CyaTLSv1_client_method(void);
+CYASSL_CTX*    CyaSSL_CTX_new(CYASSL_METHOD*);
+int            CyaSSL_CTX_load_verify_locations(CYASSL_CTX*, const char*, const char*);
+CYASSL*        CyaSSL_new(CYASSL_CTX*);
+int            CyaSSL_get_error(CYASSL*, int);
+int            CyaSSL_write(CYASSL*, const char*, int);
+int            CyaSSL_Debugging_ON(void);
+int            CyaSSL_Init(void);
+char*          CyaSSL_error_string(int);
+int            CyaSSL_swig_connect(CYASSL*, const char* server, int port);
+
+int         RsaSSL_Sign(const unsigned char* in, int inLen, unsigned char* out, int outLen, RsaKey* key, RNG* rng);
+
+int         RsaSSL_Verify(const unsigned char* in, int inLen, unsigned char* out, int outLen, RsaKey* key);
+
+RNG* GetRng(void);
+RsaKey* GetRsaPrivateKey(const char* file);
+void    FillSignStr(unsigned char*, const char*, int);
+
+%include carrays.i
+%include cdata.i
+%array_class(unsigned char, byteArray);
+int         CyaSSL_read(CYASSL*, unsigned char*, int);
+
+
+#define    SSL_FAILURE      0
+#define    SSL_SUCCESS      1
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/cyassl_adds.c b/FreeRTOS-Plus/Source/CyaSSL/swig/cyassl_adds.c
new file mode 100644 (file)
index 0000000..a6c7b2e
--- /dev/null
@@ -0,0 +1,232 @@
+/* cyassl_adds.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#ifndef _WIN32
+    #define HAVE_CONFIG_H
+#endif
+
+#include <cyassl/ssl.h>
+#include <cyassl/ctaocrypt/rsa.h>
+#include <cyassl/ctaocrypt/asn.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
+
+#ifdef _WIN32
+    #include <winsock2.h>
+    #include <process.h>
+    #ifdef TEST_IPV6            /* don't require newer SDK for IPV4 */
+           #include <ws2tcpip.h>
+        #include <wspiapi.h>
+    #endif
+    #define SOCKET_T int
+#else
+    #include <string.h>
+    #include <unistd.h>
+    #include <netdb.h>
+    #include <netinet/in.h>
+    #include <arpa/inet.h>
+    #include <sys/ioctl.h>
+    #include <sys/time.h>
+    #include <sys/types.h>
+    #include <sys/socket.h>
+    #include <pthread.h>
+    #ifdef NON_BLOCKING
+        #include <fcntl.h>
+    #endif
+    #ifdef TEST_IPV6
+        #include <netdb.h>
+    #endif
+    #define SOCKET_T unsigned int
+#endif /* _WIN32 */
+
+#ifdef _MSC_VER
+    /* disable conversion warning */
+    /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
+    #pragma warning(disable:4244 4996)
+#endif
+
+#if defined(__MACH__) || defined(_WIN32)
+    #ifndef _SOCKLEN_T
+        typedef int socklen_t;
+    #endif
+#endif
+
+
+/* HPUX doesn't use socklent_t for third parameter to accept */
+#if !defined(__hpux__)
+    typedef socklen_t* ACCEPT_THIRD_T;
+#else
+    typedef int*       ACCEPT_THIRD_T;
+#endif
+
+
+#ifdef _WIN32
+    #define CloseSocket(s) closesocket(s)
+    #define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); }
+#else
+    #define CloseSocket(s) close(s)
+    #define StartTCP() 
+#endif
+
+
+#ifdef TEST_IPV6
+    typedef struct sockaddr_in6 SOCKADDR_IN_T;
+    #define AF_INET_V    AF_INET6
+#else
+    typedef struct sockaddr_in  SOCKADDR_IN_T;
+    #define AF_INET_V    AF_INET
+#endif
+   
+
+enum {
+    SSL_BLOCKING    = 2,
+    SSL_NONBLOCKING = 4
+};
+
+
+static int tcp_socket(SOCKET_T* sockfd, SOCKADDR_IN_T* addr, const char* peer,
+                       short port)
+{
+    const char* host = peer;
+
+    /* peer could be in human readable form */
+    if (isalpha(peer[0])) {
+        struct hostent* entry = gethostbyname(peer);
+
+        if (entry) {
+            struct sockaddr_in tmp;
+            memset(&tmp, 0, sizeof(struct sockaddr_in));
+            memcpy(&tmp.sin_addr.s_addr, entry->h_addr_list[0],entry->h_length);
+            host = inet_ntoa(tmp.sin_addr);
+        }
+        else
+            return -1;   /* no entry for host */ 
+    }
+
+    *sockfd = socket(AF_INET, SOCK_STREAM, 0);
+    memset(addr, 0, sizeof(SOCKADDR_IN_T));
+
+    addr->sin_family = AF_INET;
+    addr->sin_port = htons(port);
+    addr->sin_addr.s_addr = inet_addr(host);
+
+#ifdef SO_NOSIGPIPE
+    {
+        int on = 1;
+        socklen_t len = sizeof(on);
+        setsockopt(*sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, len);
+    }
+#endif
+
+    return 0;
+}
+
+
+static int tcp_connect(SOCKET_T* sockfd, const char* ip, short port)
+{
+    SOCKADDR_IN_T addr;
+    int ret = tcp_socket(sockfd, &addr, ip, port);
+    if (ret != 0) return ret;
+
+    if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
+        return -2; /* can't connect */
+
+    return 0;
+}
+    
+
+int CyaSSL_swig_connect(CYASSL* ssl, const char* server, int port)
+{
+    SOCKET_T sockfd;
+    int ret = tcp_connect(&sockfd, server, port);
+    if (ret != 0) return ret;
+    
+    CyaSSL_set_fd(ssl, sockfd);
+
+    return CyaSSL_connect(ssl);
+}
+
+
+char* CyaSSL_error_string(int err)
+{
+    static char buffer[80];
+
+    return CyaSSL_ERR_error_string(err, buffer);
+}
+
+
+RNG* GetRng(void)
+{
+    RNG* rng = (RNG*)malloc(sizeof(RNG));
+
+    if (rng)
+        if (InitRng(rng) != 0) {
+            free(rng);
+            rng = 0;
+        }
+
+    return rng;
+}
+
+
+RsaKey* GetRsaPrivateKey(const char* keyFile)
+{
+    RsaKey* key = (RsaKey*)malloc(sizeof(RsaKey));
+
+    if (key) {
+        byte   tmp[1024];
+        size_t bytes;
+        int    ret;
+        word32 idx = 0;
+        FILE*  file = fopen(keyFile, "rb");
+
+        if (!file) {
+            free(key);
+            return 0;
+        }
+
+        bytes = fread(tmp, 1, sizeof(tmp), file);
+        fclose(file);
+        InitRsaKey(key, 0);
+
+        ret = RsaPrivateKeyDecode(tmp, &idx, key, (word32)bytes);
+        if (ret != 0) {
+            FreeRsaKey(key);
+            free(key);
+            return 0;
+        }
+    }
+    return key;
+}
+
+
+void FillSignStr(unsigned char* dst, const char* src, int size)
+{
+    memcpy(dst, src, size);
+}
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/include.am b/FreeRTOS-Plus/Source/CyaSSL/swig/include.am
new file mode 100644 (file)
index 0000000..32adb5b
--- /dev/null
@@ -0,0 +1,12 @@
+# vim:ft=automake
+# All paths should be given relative to the root
+
+EXTRA_DIST+= \
+            swig/PythonBuild.sh \
+            swig/README \
+            swig/cyassl.i \
+            swig/cyassl_adds.c \
+            swig/python_cyassl.vcproj \
+            swig/rsasign.py \
+            swig/runme.py
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/python_cyassl.vcproj b/FreeRTOS-Plus/Source/CyaSSL/swig/python_cyassl.vcproj
new file mode 100644 (file)
index 0000000..d4373a9
--- /dev/null
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9.00"
+       Name="python_cyassl"
+       ProjectGUID="{47A3ABA9-EC54-4788-BC7E-370595B2011A}"
+       RootNamespace="python_cyassl"
+       Keyword="Win32Proj"
+       TargetFrameworkVersion="196613"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="0"
+                               AdditionalIncludeDirectories="../include;../ctaocrypt/include;&quot;$(PYTHON_INCLUDE)&quot;"
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PYTHON_CYASSL_EXPORTS"
+                               MinimalRebuild="true"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="3"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="4"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="$(PYTHON_LIB) Ws2_32.lib"
+                               OutputFile="_cyassl.pyd"
+                               LinkIncremental="2"
+                               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="VCPostBuildEventTool"
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
+                       ConfigurationType="2"
+                       CharacterSet="1"
+                       WholeProgramOptimization="1"
+                       >
+                       <Tool
+                               Name="VCPreBuildEventTool"
+                       />
+                       <Tool
+                               Name="VCCustomBuildTool"
+                       />
+                       <Tool
+                               Name="VCXMLDataGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCWebServiceProxyGeneratorTool"
+                       />
+                       <Tool
+                               Name="VCMIDLTool"
+                       />
+                       <Tool
+                               Name="VCCLCompilerTool"
+                               Optimization="2"
+                               EnableIntrinsicFunctions="true"
+                               AdditionalIncludeDirectories="../include;../ctaocrypt/include;&quot;$(PYTHON_INCLUDE)&quot;"
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_CYASSL_EXPORTS"
+                               RuntimeLibrary="2"
+                               EnableFunctionLevelLinking="true"
+                               UsePrecompiledHeader="0"
+                               WarningLevel="3"
+                               DebugInformationFormat="3"
+                       />
+                       <Tool
+                               Name="VCManagedResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCResourceCompilerTool"
+                       />
+                       <Tool
+                               Name="VCPreLinkEventTool"
+                       />
+                       <Tool
+                               Name="VCLinkerTool"
+                               AdditionalDependencies="$(PYTHON_LIB) Ws2_32.lib"
+                               OutputFile="_cyassl.pyd"
+                               LinkIncremental="1"
+                               GenerateDebugInformation="true"
+                               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="VCPostBuildEventTool"
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\cyassl_adds.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\cyassl_wrap.c"
+                               >
+                       </File>
+               </Filter>
+               <Filter
+                       Name="Header Files"
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+                       >
+               </Filter>
+               <Filter
+                       Name="Resource Files"
+                       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=".\cyassl.i"
+                       >
+                       <FileConfiguration
+                               Name="Debug|Win32"
+                               >
+                               <Tool
+                                       Name="VCCustomBuildTool"
+                                       CommandLine="echo In order to function correctly, please ensure the following environment variables are correctly set:&#x0D;&#x0A;echo PYTHON_INCLUDE: %PYTHON_INCLUDE%&#x0D;&#x0A;echo PYTHON_LIB: %PYTHON_LIB%&#x0D;&#x0A;echo on&#x0D;&#x0A;swig.exe -python $(InputPath)&#x0D;&#x0A;"
+                                       Outputs="$(InputName)_wrap.c"
+                               />
+                       </FileConfiguration>
+                       <FileConfiguration
+                               Name="Release|Win32"
+                               >
+                               <Tool
+                                       Name="VCCustomBuildTool"
+                                       CommandLine="echo In order to function correctly, please ensure the following environment variables are correctly set:&#x0D;&#x0A;echo PYTHON_INCLUDE: %PYTHON_INCLUDE%&#x0D;&#x0A;echo PYTHON_LIB: %PYTHON_LIB%&#x0D;&#x0A;echo on&#x0D;&#x0A;swig.exe -python $(InputPath)"
+                                       Outputs="$(InputName)_wrap.c"
+                               />
+                       </FileConfiguration>
+               </File>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/rsasign.py b/FreeRTOS-Plus/Source/CyaSSL/swig/rsasign.py
new file mode 100644 (file)
index 0000000..ad2e114
--- /dev/null
@@ -0,0 +1,35 @@
+# file: rsasign.py
+
+import cyassl 
+
+
+# start Random Number Generator
+rng = cyassl.GetRng()
+if rng == None:
+    print "Couldn't get an RNG"
+    exit(-1)
+
+# load RSA private key in DER format
+key = cyassl.GetRsaPrivateKey("../certs/client-key.der")
+if key == None:
+    print "Couldn't load DER private key file"
+    exit(-1)
+
+# Make byte Arrays and fill input
+signOutput = cyassl.byteArray(128)   # 128 allows 1024 bit private key
+signStr    = cyassl.byteArray(25)    # input can't be larger then key size
+                                     # 64 for 512 bit 128 for 1024 bit
+cyassl.FillSignStr(signStr, "Everybody gets Friday off", 25)
+
+# Do RSA Sign
+signedSize = cyassl.RsaSSL_Sign(signStr, 25, signOutput, 128, key, rng) 
+
+# Show output 
+print "Signed Size = ", signedSize, " signed array = ", cyassl.cdata(signOutput, signedSize)
+
+# let's verify this worked
+signVerify = cyassl.byteArray(signedSize)
+verifySize = cyassl.RsaSSL_Verify(signOutput, signedSize, signVerify, signedSize, key)
+
+print "Verify Size = ", verifySize, " verify array = ", cyassl.cdata(signVerify, verifySize)
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/swig/runme.py b/FreeRTOS-Plus/Source/CyaSSL/swig/runme.py
new file mode 100644 (file)
index 0000000..42cbdb4
--- /dev/null
@@ -0,0 +1,40 @@
+# file: runme.py
+
+import cyassl 
+
+print ""
+print "Trying to connect to the echo server..."
+
+cyassl.CyaSSL_Init()
+#cyassl.CyaSSL_Debugging_ON()
+ctx = cyassl.CyaSSL_CTX_new(cyassl.CyaTLSv1_client_method())
+if ctx == None:
+    print "Couldn't get SSL CTX for TLSv1"
+    exit(-1)
+
+ret = cyassl.CyaSSL_CTX_load_verify_locations(ctx, "../certs/ca-cert.pem", None)
+if ret != cyassl.SSL_SUCCESS:
+    print "Couldn't do SSL_CTX_load_verify_locations "
+    print "error string = ", ret 
+    exit(-1)
+
+ssl = cyassl.CyaSSL_new(ctx)
+ret = cyassl.CyaSSL_swig_connect(ssl, "localhost", 11111)
+
+if ret != cyassl.SSL_SUCCESS:
+    print "Couldn't do SSL connect"
+    err    = cyassl.CyaSSL_get_error(ssl, 0)
+    print "error string = ", cyassl.CyaSSL_error_string(err)
+    exit(-1)
+
+print "...Connected"
+written = cyassl.CyaSSL_write(ssl, "hello from python\r\n", 19)
+
+if written > 0:
+    print "Wrote ", written, " bytes"
+
+byteArray = cyassl.byteArray(100)
+readBytes = cyassl.CyaSSL_read(ssl, byteArray, 100)
+
+print "server reply: ", cyassl.cdata(byteArray, readBytes) 
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/api.c b/FreeRTOS-Plus/Source/CyaSSL/tests/api.c
new file mode 100644 (file)
index 0000000..102dc09
--- /dev/null
@@ -0,0 +1,725 @@
+/* api.c API unit tests
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <stdlib.h>
+#include <cyassl/ssl.h>
+#include <cyassl/test.h>
+#include <tests/unit.h>
+
+#define TEST_FAIL       (-1)
+#define TEST_SUCCESS    (0)
+
+static int test_CyaSSL_Init(void);
+static int test_CyaSSL_Cleanup(void);
+static int test_CyaSSL_Method_Allocators(void);
+static int test_CyaSSL_CTX_new(CYASSL_METHOD *method);
+#ifndef NO_FILESYSTEM
+static int test_CyaSSL_CTX_use_certificate_file(void);
+static int test_CyaSSL_CTX_use_PrivateKey_file(void);
+static int test_CyaSSL_CTX_load_verify_locations(void);
+static int test_server_CyaSSL_new(void);
+static int test_client_CyaSSL_new(void);
+static int test_CyaSSL_read_write(void);
+#endif
+
+/* test function helpers */
+static int test_method(CYASSL_METHOD *method, const char *name);
+static int test_method2(CYASSL_METHOD *method, const char *name);
+#ifndef NO_FILESYSTEM
+static int test_ucf(CYASSL_CTX *ctx, const char* file, int type,
+    int cond, const char* name);
+static int test_upkf(CYASSL_CTX *ctx, const char* file, int type,
+    int cond, const char* name);
+static int test_lvl(CYASSL_CTX *ctx, const char* file, const char* path,
+    int cond, const char* name);
+
+THREAD_RETURN CYASSL_THREAD test_server_nofail(void*);
+void test_client_nofail(void*);
+#endif
+
+static const char* bogusFile  = "/dev/null";
+static const char* testingFmt = "   %s:";
+static const char* resultFmt  = " %s\n";
+static const char* passed     = "passed";
+static const char* failed     = "failed";
+
+/* List of methods found in echoserver.c that I'm skipping for the moment:
+ * - CyaSSL_CTX_set_session_cache_mode()
+ */
+
+int ApiTest(void)
+{
+    printf(" Begin API Tests\n");
+    test_CyaSSL_Init();
+    test_CyaSSL_Method_Allocators();
+    test_CyaSSL_CTX_new(CyaSSLv23_server_method());
+#ifndef NO_FILESYSTEM
+    test_CyaSSL_CTX_use_certificate_file();
+    test_CyaSSL_CTX_use_PrivateKey_file();
+    test_CyaSSL_CTX_load_verify_locations();
+    test_server_CyaSSL_new();
+    test_client_CyaSSL_new();
+    test_CyaSSL_read_write();
+#endif
+    test_CyaSSL_Cleanup();
+    printf(" End API Tests\n");
+
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_Init(void)
+{
+    int result;
+
+    printf(testingFmt, "CyaSSL_Init()");
+    result = CyaSSL_Init();
+    printf(resultFmt, result ? failed : passed);
+
+    return result;
+}
+
+static int test_CyaSSL_Cleanup(void)
+{
+    int result;
+
+    printf(testingFmt, "CyaSSL_Cleanup()");
+    result = CyaSSL_Cleanup();
+    printf(resultFmt, result ? failed : passed);
+
+    return result;
+}
+
+int test_method(CYASSL_METHOD *method, const char *name)
+{
+    printf(testingFmt, name);
+    if (method == NULL)
+    {
+        printf(resultFmt, failed);
+        return TEST_FAIL;
+    }
+    XFREE(method, 0, DYNAMIC_TYPE_METHOD);
+    printf(resultFmt, passed);
+    return TEST_SUCCESS;
+}
+
+int test_method2(CYASSL_METHOD *method, const char *name)
+{
+    printf(testingFmt, name);
+    if (method != NULL)
+    {
+        XFREE(method, 0, DYNAMIC_TYPE_METHOD);
+        printf(resultFmt, failed);
+        return TEST_FAIL;
+    }
+    printf(resultFmt, passed);
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_Method_Allocators(void)
+{
+    test_method(CyaSSLv3_server_method(), "CyaSSLv3_server_method()");
+    test_method(CyaSSLv3_client_method(), "CyaSSLv3_client_method()");
+    test_method(CyaTLSv1_server_method(), "CyaTLSv1_server_method()");
+    test_method(CyaTLSv1_client_method(), "CyaTLSv1_client_method()");
+    test_method(CyaTLSv1_1_server_method(), "CyaTLSv1_1_server_method()");
+    test_method(CyaTLSv1_1_client_method(), "CyaTLSv1_1_client_method()");
+    test_method(CyaTLSv1_2_server_method(), "CyaTLSv1_2_server_method()");
+    test_method(CyaTLSv1_2_client_method(), "CyaTLSv1_2_client_method()");
+    test_method(CyaSSLv23_client_method(), "CyaSSLv23_client_method()");
+
+#ifdef CYASSL_DTLS
+    test_method(CyaDTLSv1_server_method(), "CyaDTLSv1_server_method()");
+    test_method(CyaDTLSv1_client_method(), "CyaDTLSv1_client_method()");
+#endif /* CYASSL_DTLS */
+
+#ifdef OPENSSL_EXTRA
+    test_method2(CyaSSLv2_server_method(), "CyaSSLv2_server_method()");
+    test_method2(CyaSSLv2_client_method(), "CyaSSLv2_client_method()");
+#endif /* OPENSSL_EXTRA */
+
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_CTX_new(CYASSL_METHOD *method)
+{
+    if (method != NULL)
+    {
+        CYASSL_CTX *ctx;
+    
+        printf(testingFmt, "CyaSSL_CTX_new(NULL)");
+        ctx = CyaSSL_CTX_new(NULL);
+        if (ctx != NULL)
+        {
+            CyaSSL_CTX_free(ctx);
+            printf(resultFmt, failed);
+        }
+        else
+            printf(resultFmt, passed);
+    
+        printf(testingFmt, "CyaSSL_CTX_new(method)");
+        ctx = CyaSSL_CTX_new(method);
+        if (ctx == NULL)
+        {
+            printf(resultFmt, failed);
+            XFREE(method, 0, DYNAMIC_TYPE_METHOD);
+            /* free the method data. if this was successful, freeing
+               the CTX frees the method. */
+        }
+        else
+        {
+            CyaSSL_CTX_free(ctx);
+            printf(resultFmt, passed);
+        }
+    }
+    else
+        printf("test_CyaSSL_CTX_new() called without method\n");
+
+    return TEST_SUCCESS;
+}
+
+#ifndef NO_FILESYSTEM
+/* Helper for testing CyaSSL_CTX_use_certificate_file() */
+int test_ucf(CYASSL_CTX *ctx, const char* file, int type, int cond,
+    const char* name)
+{
+    int result;
+
+    printf(testingFmt, name);
+    result = CyaSSL_CTX_use_certificate_file(ctx, file, type);
+    if (result != cond)
+    {
+        printf(resultFmt, failed);
+        return TEST_FAIL;
+    }
+    printf(resultFmt, passed);
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_CTX_use_certificate_file(void)
+{
+    CYASSL_METHOD *method;
+    CYASSL_CTX *ctx;
+
+    method = CyaSSLv23_server_method();
+    if (method == NULL)
+    {
+        printf("test_CyaSSL_CTX_use_certificate_file() cannot create method\n");
+        return TEST_FAIL;
+    }
+
+    ctx = CyaSSL_CTX_new(method);
+    if (ctx == NULL)
+    {
+        printf("test_CyaSSL_CTX_use_certificate_file() cannot create context\n");
+        XFREE(method, 0, DYNAMIC_TYPE_METHOD);
+        return TEST_FAIL;
+    }
+
+    /* setting all parameters to garbage. this should succeed with
+        failure */
+    /* Then set the parameters to legit values but set each item to
+        bogus and call again. Finish with a successful success. */
+
+    test_ucf(NULL, NULL, 9999, SSL_FAILURE,
+        "CyaSSL_CTX_use_certificate_file(NULL, NULL, 9999)");
+/*  test_ucf(NULL, svrCert, SSL_FILETYPE_PEM, SSL_FAILURE,
+        "CyaSSL_CTX_use_certificate_file(NULL, svrCert, SSL_FILETYPE_PEM)");*/
+    test_ucf(ctx, bogusFile, SSL_FILETYPE_PEM, SSL_FAILURE,
+        "CyaSSL_CTX_use_certificate_file(ctx, bogusFile, SSL_FILETYPE_PEM)");
+    test_ucf(ctx, svrCert, 9999, SSL_FAILURE,
+        "CyaSSL_CTX_use_certificate_file(ctx, svrCert, 9999)");
+    test_ucf(ctx, svrCert, SSL_FILETYPE_PEM, SSL_SUCCESS,
+        "CyaSSL_CTX_use_certificate_file(ctx, svrCert, SSL_FILETYPE_PEM)");
+
+    CyaSSL_CTX_free(ctx);
+    return TEST_SUCCESS;
+}
+
+/* Helper for testing CyaSSL_CTX_use_PrivateKey_file() */
+int test_upkf(CYASSL_CTX *ctx, const char* file, int type, int cond,
+    const char* name)
+{
+    int result;
+
+    printf(testingFmt, name);
+    result = CyaSSL_CTX_use_PrivateKey_file(ctx, file, type);
+    if (result != cond)
+    {
+        printf(resultFmt, failed);
+        return TEST_FAIL;
+    }
+    printf(resultFmt, passed);
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_CTX_use_PrivateKey_file(void)
+{
+    CYASSL_METHOD *method;
+    CYASSL_CTX *ctx;
+
+    method = CyaSSLv23_server_method();
+    if (method == NULL)
+    {
+        printf("test_CyaSSL_CTX_use_PrivateKey_file() cannot create method\n");
+        return TEST_FAIL;
+    }
+
+    ctx = CyaSSL_CTX_new(method);
+    if (ctx == NULL)
+    {
+        printf("test_CyaSSL_CTX_use_PrivateKey_file() cannot create context\n");
+        XFREE(method, 0, DYNAMIC_TYPE_METHOD);
+        return TEST_FAIL;
+    }
+
+    test_upkf(NULL, NULL, 9999, SSL_FAILURE,
+        "CyaSSL_CTX_use_PrivateKey_file(NULL, NULL, 9999)");
+/*  test_upkf(NULL, svrKey, SSL_FILETYPE_PEM, SSL_FAILURE,
+        "CyaSSL_CTX_use_PrivateKey_file(NULL, svrKey, SSL_FILETYPE_PEM)");*/
+    test_upkf(ctx, bogusFile, SSL_FILETYPE_PEM, SSL_FAILURE,
+        "CyaSSL_CTX_use_PrivateKey_file(ctx, bogusFile, SSL_FILETYPE_PEM)");
+    test_upkf(ctx, svrKey, 9999, SSL_FAILURE,
+        "CyaSSL_CTX_use_PrivateKey_file(ctx, svrKey, 9999)");
+    test_upkf(ctx, svrKey, SSL_FILETYPE_PEM, SSL_SUCCESS,
+        "CyaSSL_CTX_use_PrivateKey_file(ctx, svrKey, SSL_FILETYPE_PEM)");
+
+    CyaSSL_CTX_free(ctx);
+    return TEST_SUCCESS;
+}
+
+/* Helper for testing CyaSSL_CTX_load_verify_locations() */
+int test_lvl(CYASSL_CTX *ctx, const char* file, const char* path, int cond,
+    const char* name)
+{
+    int result;
+
+    printf(testingFmt, name);
+    /*
+     * CyaSSL_CTX_load_verify_locations() returns SSL_SUCCESS (1) for 
+     * success, SSL_FAILURE (0) for a non-specific failure, or a specific
+     * failure code (<0). Need to normalize the return code to 1 or 0.
+     */
+    result = CyaSSL_CTX_load_verify_locations(ctx, file, path) >= SSL_SUCCESS;
+    if (result != cond)
+    {
+        printf(resultFmt, failed);
+        return TEST_FAIL;
+    }
+    printf(resultFmt, passed);
+    return TEST_SUCCESS;
+}
+
+int test_CyaSSL_CTX_load_verify_locations(void)
+{
+    CYASSL_METHOD *method;
+    CYASSL_CTX *ctx;
+
+    method = CyaSSLv23_client_method();
+    if (method == NULL)
+    {
+        printf("test_CyaSSL_CTX_load_verify_locations() cannot create method\n");
+        return TEST_FAIL;
+    }
+
+    ctx = CyaSSL_CTX_new(method);
+    if (ctx == NULL)
+    {
+        printf("test_CyaSSL_CTX_load_verify_locations() cannot create context\n");
+        free(method);
+        return TEST_FAIL;
+    }
+    
+    test_lvl(NULL, NULL, NULL, SSL_FAILURE,
+        "CyaSSL_CTX_load_verify_locations(NULL, NULL, NULL)");
+    test_lvl(ctx, NULL, NULL, SSL_FAILURE,
+        "CyaSSL_CTX_load_verify_locations(ctx, NULL, NULL)");
+    test_lvl(NULL, caCert, NULL, SSL_FAILURE,
+        "CyaSSL_CTX_load_verify_locations(ctx, NULL, NULL)");
+    test_lvl(ctx, caCert, bogusFile, SSL_FAILURE,
+        "CyaSSL_CTX_load_verify_locations(ctx, caCert, bogusFile)");
+    /* Add a test for the certs directory path loading. */
+    /* There is a leak here. If you load a second cert, the first one
+       is lost. */
+    test_lvl(ctx, caCert, 0, SSL_SUCCESS,
+        "CyaSSL_CTX_load_verify_locations(ctx, caCert, 0)");
+
+    CyaSSL_CTX_free(ctx);
+    return TEST_SUCCESS;
+}
+
+int test_server_CyaSSL_new(void)
+{
+    int result;
+    CYASSL_CTX *ctx;
+    CYASSL_CTX *ctx_nocert;
+    CYASSL *ssl;
+
+    ctx = CyaSSL_CTX_new(CyaSSLv23_server_method());
+    if (ctx == NULL)
+    {
+        printf("test_server_CyaSSL_new() cannot create context\n");
+        return TEST_FAIL;
+    }
+
+    result = CyaSSL_CTX_use_certificate_file(ctx, svrCert, SSL_FILETYPE_PEM);
+    if (result == SSL_FAILURE)
+    {
+        printf("test_server_CyaSSL_new() cannot obtain certificate\n");
+        CyaSSL_CTX_free(ctx);
+        return TEST_FAIL;
+    }
+
+    result = CyaSSL_CTX_use_PrivateKey_file(ctx, svrKey, SSL_FILETYPE_PEM);
+    if (result == SSL_FAILURE)
+    {
+        printf("test_server_CyaSSL_new() cannot obtain key\n");
+        CyaSSL_CTX_free(ctx);
+        return TEST_FAIL;
+    }
+
+    ctx_nocert = CyaSSL_CTX_new(CyaSSLv23_server_method());
+    if (ctx_nocert == NULL)
+    {
+        printf("test_server_CyaSSL_new() cannot create bogus context\n");
+        CyaSSL_CTX_free(ctx);
+        return TEST_FAIL;
+    }
+
+    printf(testingFmt, "CyaSSL_new(NULL) server");
+    ssl = CyaSSL_new(NULL);
+    if (ssl != NULL)
+    {
+        printf(resultFmt, failed);
+        CyaSSL_free(ssl);
+    }
+    else
+        printf(resultFmt, passed);
+
+    printf(testingFmt, "CyaSSL_new(ctx_nocert) server");
+    ssl = CyaSSL_new(ctx_nocert);
+    if (ssl != NULL)
+    {
+        printf(resultFmt, failed);
+        CyaSSL_free(ssl);
+    }
+    else
+        printf(resultFmt, passed);
+
+    printf(testingFmt, "CyaSSL_new(ctx) server");
+    ssl = CyaSSL_new(ctx);
+    if (ssl == NULL)
+        printf(resultFmt, failed);
+    else
+    {
+        printf(resultFmt, passed);
+        CyaSSL_free(ssl);
+    }
+    
+    CyaSSL_CTX_free(ctx_nocert);
+    CyaSSL_CTX_free(ctx);
+    return TEST_SUCCESS;
+}
+
+int test_client_CyaSSL_new(void)
+{
+    int result;
+    CYASSL_CTX *ctx;
+    CYASSL_CTX *ctx_nocert;
+    CYASSL *ssl;
+
+    ctx = CyaSSL_CTX_new(CyaSSLv23_client_method());
+    if (ctx == NULL)
+    {
+        printf("test_client_CyaSSL_new() cannot create context\n");
+        return TEST_FAIL;
+    }
+
+    result = CyaSSL_CTX_load_verify_locations(ctx, caCert, 0);
+    if (result == SSL_FAILURE)
+    {
+        printf("test_client_CyaSSL_new() cannot obtain certificate\n");
+        CyaSSL_CTX_free(ctx);
+        return TEST_FAIL;
+    }
+
+    ctx_nocert = CyaSSL_CTX_new(CyaSSLv23_client_method());
+    if (ctx_nocert == NULL)
+    {
+        printf("test_client_CyaSSL_new() cannot create bogus context\n");
+        CyaSSL_CTX_free(ctx);
+        return TEST_FAIL;
+    }
+
+    printf(testingFmt, "CyaSSL_new(NULL) client");
+    ssl = CyaSSL_new(NULL);
+    if (ssl != NULL)
+    {
+        printf(resultFmt, failed);
+        CyaSSL_free(ssl);
+    }
+    else
+        printf(resultFmt, passed);
+
+    printf(testingFmt, "CyaSSL_new(ctx_nocert) client");
+    ssl = CyaSSL_new(ctx_nocert);
+    if (ssl == NULL)
+        printf(resultFmt, failed);
+    else
+    {
+        printf(resultFmt, passed);
+        CyaSSL_free(ssl);
+    }
+
+    printf(testingFmt, "CyaSSL_new(ctx) client");
+    ssl = CyaSSL_new(ctx);
+    if (ssl == NULL)
+        printf(resultFmt, failed);
+    else
+    {
+        printf(resultFmt, passed);
+        CyaSSL_free(ssl);
+    }
+
+    CyaSSL_CTX_free(ctx_nocert);
+    CyaSSL_CTX_free(ctx);
+    return TEST_SUCCESS;
+}
+
+
+static int test_CyaSSL_read_write(void)
+{
+    /* The unit testing for read and write shall happen simutaneously, since
+     * one can't do anything with one without the other. (Except for a failure
+     * test case.) This function will call all the others that will set up,
+     * execute, and report their test findings.
+     *
+     * Set up the success case first. This function will become the template
+     * for the other tests. This should eventually be renamed
+     *
+     * The success case isn't interesting, how can this fail?
+     * - Do not give the client context a CA certificate. The connect should
+     *   fail. Do not need server for this?
+     * - Using NULL for the ssl object on server. Do not need client for this.
+     * - Using NULL for the ssl object on client. Do not need server for this.
+     * - Good ssl objects for client and server. Client write() without server
+     *   read().
+     * - Good ssl objects for client and server. Server write() without client
+     *   read().
+     * - Forgetting the password callback?
+    */
+    int test_result = TEST_SUCCESS;
+    tcp_ready ready;
+    func_args client_args;
+    func_args server_args;
+    THREAD_TYPE serverThread;
+
+    StartTCP();
+
+    InitTcpReady(&ready);
+    server_args.signal = &ready;
+    start_thread(test_server_nofail, &server_args, &serverThread);
+    wait_tcp_ready(&server_args);
+    test_client_nofail(&client_args);
+    join_thread(serverThread);
+
+    if (client_args.return_code != TEST_SUCCESS)
+    {
+        printf(resultFmt, "client failure");
+        test_result = TEST_FAIL;
+    }
+    if (server_args.return_code != TEST_SUCCESS)
+    {
+        printf(resultFmt, "server failure");
+        test_result = TEST_FAIL;
+    }
+
+    FreeTcpReady(&ready);
+
+    return test_result;
+};
+
+
+THREAD_RETURN CYASSL_THREAD test_server_nofail(void* args)
+{
+    SOCKET_T sockfd = 0;
+    int clientfd = 0;
+
+    CYASSL_METHOD* method = 0;
+    CYASSL_CTX* ctx = 0;
+    CYASSL* ssl = 0;
+
+    char msg[] = "I hear you fa shizzle!";
+    char input[1024];
+    int idx;
+   
+    ((func_args*)args)->return_code = TEST_FAIL;
+    method = CyaSSLv23_server_method();
+    ctx = CyaSSL_CTX_new(method);
+
+    CyaSSL_CTX_set_verify(ctx,
+                    SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, 0);
+
+#ifdef OPENSSL_EXTRA
+    CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+
+    if (CyaSSL_CTX_load_verify_locations(ctx, cliCert, 0) != SSL_SUCCESS)
+    {
+        /*err_sys("can't load ca file, Please run from CyaSSL home dir");*/
+        return 0;
+    }
+    if (CyaSSL_CTX_use_certificate_file(ctx, svrCert, SSL_FILETYPE_PEM)
+            != SSL_SUCCESS)
+    {
+        /*err_sys("can't load server cert chain file, "
+                "Please run from CyaSSL home dir");*/
+        return 0;
+    }
+    if (CyaSSL_CTX_use_PrivateKey_file(ctx, svrKey, SSL_FILETYPE_PEM)
+            != SSL_SUCCESS)
+    {
+        /*err_sys("can't load server key file, "
+                "Please run from CyaSSL home dir");*/
+        return 0;
+    }
+    ssl = CyaSSL_new(ctx);
+    tcp_accept(&sockfd, &clientfd, (func_args*)args, yasslPort, 0, 0);
+    CloseSocket(sockfd);
+
+    CyaSSL_set_fd(ssl, clientfd);
+
+#ifdef NO_PSK
+    #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA)
+        CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM);
+    #else
+        SetDH(ssl);  /* will repick suites with DHE, higher priority than PSK */
+    #endif
+#endif
+    if (CyaSSL_accept(ssl) != SSL_SUCCESS)
+    {
+        int err = CyaSSL_get_error(ssl, 0);
+        char buffer[80];
+        printf("error = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer));
+        /*err_sys("SSL_accept failed");*/
+        return 0;
+    }
+
+    idx = CyaSSL_read(ssl, input, sizeof(input));
+    if (idx > 0) {
+        input[idx] = 0;
+        printf("Client message: %s\n", input);
+    }
+    
+    if (CyaSSL_write(ssl, msg, sizeof(msg)) != sizeof(msg))
+    {
+        /*err_sys("SSL_write failed");*/
+        return 0;
+    }
+
+    CyaSSL_shutdown(ssl);
+    CyaSSL_free(ssl);
+    CyaSSL_CTX_free(ctx);
+    
+    CloseSocket(clientfd);
+    ((func_args*)args)->return_code = TEST_SUCCESS;
+    return 0;
+}
+
+void test_client_nofail(void* args)
+{
+    SOCKET_T sockfd = 0;
+
+    CYASSL_METHOD*  method  = 0;
+    CYASSL_CTX*     ctx     = 0;
+    CYASSL*         ssl     = 0;
+
+    char msg[64] = "hello cyassl!";
+    char reply[1024];
+    int  input;
+    int  msgSz = strlen(msg);
+
+    int     argc = ((func_args*)args)->argc;
+    char**  argv = ((func_args*)args)->argv;
+
+    ((func_args*)args)->return_code = TEST_FAIL;
+    method = CyaSSLv23_client_method();
+    ctx = CyaSSL_CTX_new(method);
+
+#ifdef OPENSSL_EXTRA
+    CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
+#endif
+
+    if (CyaSSL_CTX_load_verify_locations(ctx, caCert, 0) != SSL_SUCCESS)
+    {
+        /* err_sys("can't load ca file, Please run from CyaSSL home dir");*/
+        return;
+    }
+    if (CyaSSL_CTX_use_certificate_file(ctx, cliCert, SSL_FILETYPE_PEM)
+            != SSL_SUCCESS)
+    {
+        /*err_sys("can't load client cert file, "
+                "Please run from CyaSSL home dir");*/
+        return;
+    }
+    if (CyaSSL_CTX_use_PrivateKey_file(ctx, cliKey, SSL_FILETYPE_PEM)
+            != SSL_SUCCESS)
+    {
+        /*err_sys("can't load client key file, "
+                "Please run from CyaSSL home dir");*/
+        return;
+    }
+
+    tcp_connect(&sockfd, yasslIP, yasslPort, 0);
+
+    ssl = CyaSSL_new(ctx);
+    CyaSSL_set_fd(ssl, sockfd);
+    if (CyaSSL_connect(ssl) != SSL_SUCCESS)
+    {
+        int  err = CyaSSL_get_error(ssl, 0);
+        char buffer[80];
+        printf("err = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer));
+        /*printf("SSL_connect failed");*/
+        return;
+    }
+
+    if (CyaSSL_write(ssl, msg, msgSz) != msgSz)
+    {
+        /*err_sys("SSL_write failed");*/
+        return;
+    }
+
+    input = CyaSSL_read(ssl, reply, sizeof(reply));
+    if (input > 0)
+    {
+        reply[input] = 0;
+        printf("Server response: %s\n", reply);
+    }
+
+    ((func_args*)args)->return_code = TEST_SUCCESS;
+    return;
+}
+
+
+
+
+#endif /* NO_FILESYSTEM */
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/hash.c b/FreeRTOS-Plus/Source/CyaSSL/tests/hash.c
new file mode 100644 (file)
index 0000000..b3a6cc9
--- /dev/null
@@ -0,0 +1,559 @@
+/* hash.c has unit tests
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <stdio.h>
+
+#include <cyassl/ctaocrypt/md4.h>
+#include <cyassl/ctaocrypt/md5.h>
+#include <cyassl/ctaocrypt/sha.h>
+#include <cyassl/ctaocrypt/sha256.h>
+#include <cyassl/ctaocrypt/sha512.h>
+#include <cyassl/ctaocrypt/ripemd.h>
+#include <cyassl/ctaocrypt/hmac.h>
+
+#include <tests/unit.h>
+
+typedef struct testVector {
+    char*  input;
+    char*  output; 
+    size_t inLen;
+    size_t outLen;
+} testVector;
+
+int  md4_test(void);
+int  md5_test(void);
+int  sha_test(void);
+int  sha256_test(void);
+int  sha512_test(void);
+int  sha384_test(void);
+int  ripemd_test(void);
+int  hmac_test(void);
+
+int HashTest(void)
+{
+    int ret = 0;
+
+    printf(" Begin HASH Tests\n");
+
+#ifndef NO_MD4
+    if ( (ret = md4_test()) ) {
+        printf( "   MD4      test failed!\n");
+        return ret; 
+    } else
+        printf( "   MD4      test passed!\n");
+#endif
+
+    if ( (ret = md5_test()) ) {
+        printf( "   MD5      test failed!\n");
+        return ret; 
+    } else
+        printf( "   MD5      test passed!\n");
+    
+    if ( (ret = sha_test()) ) {
+        printf( "   SHA      test failed!\n");
+        return ret; 
+    } else
+        printf( "   SHA      test passed!\n");
+    
+#ifndef NO_SHA256
+    if ( (ret = sha256_test()) ) {
+        printf( "   SHA-256  test failed!\n");
+        return ret; 
+    } else
+        printf( "   SHA-256  test passed!\n");
+#endif
+
+#ifdef CYASSL_SHA512
+    if ( (ret = sha512_test()) ) {
+        printf( "   SHA-512  test failed!\n");
+        return ret; 
+    } else
+        printf( "   SHA-512  test passed!\n");
+#endif
+
+#ifdef CYASSL_SHA384
+    if ( (ret = sha384_test()) ) {
+        printf( "   SHA-384  test failed!\n");
+        return ret; 
+    } else
+        printf( "   SHA-384  test passed!\n");
+#endif
+
+#ifdef CYASSL_RIPEMD
+    if ( (ret = ripemd_test()) ) {
+        printf( "   RIPEMD   test failed!\n");
+        return ret; 
+    } else
+        printf( "   RIPEMD   test passed!\n");
+#endif
+
+#ifndef NO_HMAC
+    if ( (ret = hmac_test()) ) {
+        printf( "   HMAC     test failed!\n");
+        return ret; 
+    } else
+        printf( "   HMAC     test passed!\n");
+#endif
+
+    printf(" End HASH Tests\n");
+    
+    return 0;
+}
+
+#ifndef NO_MD4
+
+int md4_test(void)
+{
+    Md4  md4;
+    byte hash[MD4_DIGEST_SIZE];
+
+    testVector a, b, c, d, e, f, g;
+    testVector test_md4[7];
+    int times = sizeof(test_md4) / sizeof(testVector), i;
+
+    a.input  = "";
+    a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" 
+               "\xc0";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "a";
+    b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" 
+               "\x24";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abc";
+    c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" 
+               "\x9d";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "message digest";
+    d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" 
+               "\x4b";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    e.input  = "abcdefghijklmnopqrstuvwxyz";
+    e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" 
+               "\xa9";
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    f.input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345"
+               "6789";
+    f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" 
+               "\xe4";
+    f.inLen  = strlen(f.input);
+    f.outLen = strlen(f.output);
+
+    g.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" 
+               "\x36";
+    g.inLen  = strlen(g.input);
+    g.outLen = strlen(g.output);
+
+    test_md4[0] = a;
+    test_md4[1] = b;
+    test_md4[2] = c;
+    test_md4[3] = d;
+    test_md4[4] = e;
+    test_md4[5] = f;
+    test_md4[6] = g;
+
+    InitMd4(&md4);
+
+    for (i = 0; i < times; ++i) {
+        Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
+        Md4Final(&md4, hash);
+
+        if (memcmp(hash, test_md4[i].output, MD4_DIGEST_SIZE) != 0)
+            return -205 - i;
+    }
+
+    return 0;
+}
+
+#endif /* NO_MD4 */
+
+int md5_test(void)
+{
+    Md5  md5;
+    byte hash[MD5_DIGEST_SIZE];
+
+    testVector a, b, c, d, e;
+    testVector test_md5[5];
+    int times = sizeof(test_md5) / sizeof(testVector), i;
+
+    a.input  = "abc";
+    a.output = "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f"
+               "\x72";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "message digest";
+    b.output = "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d\x52\x5a\x2f\x31\xaa\xf1\x61"
+               "\xd0";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abcdefghijklmnopqrstuvwxyz";
+    c.output = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1"
+               "\x3b";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345"
+               "6789";
+    d.output = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d"
+               "\x9f";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    e.input  = "1234567890123456789012345678901234567890123456789012345678"
+               "9012345678901234567890";
+    e.output = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6"
+               "\x7a";
+    e.inLen  = strlen(e.input);
+    e.outLen = strlen(e.output);
+
+    test_md5[0] = a;
+    test_md5[1] = b;
+    test_md5[2] = c;
+    test_md5[3] = d;
+    test_md5[4] = e;
+
+    InitMd5(&md5);
+
+    for (i = 0; i < times; ++i) {
+        Md5Update(&md5, (byte*)test_md5[i].input, (word32)test_md5[i].inLen);
+        Md5Final(&md5, hash);
+
+        if (memcmp(hash, test_md5[i].output, MD5_DIGEST_SIZE) != 0)
+            return -5 - i;
+    }
+
+    return 0;
+}
+
+int sha_test(void)
+{
+    Sha  sha;
+    byte hash[SHA_DIGEST_SIZE];
+
+    testVector a, b, c, d;
+    testVector test_sha[4];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2"
+               "\x6C\x9C\xD0\xD8\x9D";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+    b.output = "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29"
+               "\xE5\xE5\x46\x70\xF1";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaa";
+    c.output = "\x00\x98\xBA\x82\x4B\x5C\x16\x42\x7B\xD7\xA1\x12\x2A\x5A\x44"
+               "\x2A\x25\xEC\x64\x4D";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+               "aaaaaaaaaa";
+    d.output = "\xAD\x5B\x3F\xDB\xCB\x52\x67\x78\xC2\x83\x9D\x2F\x15\x1E\xA7"
+               "\x53\x99\x5E\x26\xA0";
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+    test_sha[2] = c;
+    test_sha[3] = d;
+
+    InitSha(&sha);
+
+    for (i = 0; i < times; ++i) {
+        ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen);
+        ShaFinal(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+
+#ifndef NO_SHA256
+int sha256_test(void)
+{
+    Sha256 sha;
+    byte   hash[SHA256_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xBA\x78\x16\xBF\x8F\x01\xCF\xEA\x41\x41\x40\xDE\x5D\xAE\x22"
+               "\x23\xB0\x03\x61\xA3\x96\x17\x7A\x9C\xB4\x10\xFF\x61\xF2\x00"
+               "\x15\xAD";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+    b.output = "\x24\x8D\x6A\x61\xD2\x06\x38\xB8\xE5\xC0\x26\x93\x0C\x3E\x60"
+               "\x39\xA3\x3C\xE4\x59\x64\xFF\x21\x67\xF6\xEC\xED\xD4\x19\xDB"
+               "\x06\xC1";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha256(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha256Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA256_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif
+
+#ifdef CYASSL_SHA512
+int sha512_test(void)
+{
+    Sha512 sha;
+    byte   hash[SHA512_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41"
+               "\x31\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55"
+               "\xd3\x9a\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3"
+               "\xfe\xeb\xbd\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f"
+               "\xa5\x4c\xa4\x9f";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    b.output = "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14"
+               "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88"
+               "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4"
+               "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b"
+               "\x87\x4b\xe9\x09"; 
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha512(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha512Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA512_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif
+
+#ifdef CYASSL_SHA384
+int sha384_test()
+{
+    Sha384 sha;
+    byte   hash[SHA384_DIGEST_SIZE];
+
+    testVector a, b;
+    testVector test_sha[2];
+    int times = sizeof(test_sha) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b\xb5\xa0\x3d\x69\x9a\xc6\x50"
+               "\x07\x27\x2c\x32\xab\x0e\xde\xd1\x63\x1a\x8b\x60\x5a\x43\xff"
+               "\x5b\xed\x80\x86\x07\x2b\xa1\xe7\xcc\x23\x58\xba\xec\xa1\x34"
+               "\xc8\x25\xa7";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhi"
+               "jklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+    b.output = "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b"
+               "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0"
+               "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91"
+               "\x74\x60\x39";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    test_sha[0] = a;
+    test_sha[1] = b;
+
+    InitSha384(&sha);
+
+    for (i = 0; i < times; ++i) {
+        Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen);
+        Sha384Final(&sha, hash);
+
+        if (memcmp(hash, test_sha[i].output, SHA384_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif
+
+#ifdef CYASSL_RIPEMD
+int ripemd_test(void)
+{
+    RipeMd  ripemd;
+    byte hash[RIPEMD_DIGEST_SIZE];
+
+    testVector a, b, c, d;
+    testVector test_ripemd[4];
+    int times = sizeof(test_ripemd) / sizeof(struct testVector), i;
+
+    a.input  = "abc";
+    a.output = "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04\x4a\x8e\x98\xc6"
+               "\xb0\x87\xf1\x5a\x0b\xfc";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "message digest";
+    b.output = "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8\x81\xb1\x23\xa8"
+               "\x5f\xfa\x21\x59\x5f\x36";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; 
+    c.output = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05\xa0\x6c\x27\xdc"
+               "\xf4\x9a\xda\x62\xeb\x2b";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    d.input  = "12345678901234567890123456789012345678901234567890123456"
+               "789012345678901234567890";
+    d.output = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb\xd3\x32\x3c\xab"
+               "\x82\xbf\x63\x32\x6b\xfb"; 
+    d.inLen  = strlen(d.input);
+    d.outLen = strlen(d.output);
+
+    test_ripemd[0] = a;
+    test_ripemd[1] = b;
+    test_ripemd[2] = c;
+    test_ripemd[3] = d;
+
+    InitRipeMd(&ripemd);
+
+    for (i = 0; i < times; ++i) {
+        RipeMdUpdate(&ripemd, (byte*)test_ripemd[i].input,
+                     (word32)test_ripemd[i].inLen);
+        RipeMdFinal(&ripemd, hash);
+
+        if (memcmp(hash, test_ripemd[i].output, RIPEMD_DIGEST_SIZE) != 0)
+            return -10 - i;
+    }
+
+    return 0;
+}
+#endif /* CYASSL_RIPEMD */
+
+#ifndef NO_HMAC
+int hmac_test(void)
+{
+    Hmac hmac;
+    byte hash[MD5_DIGEST_SIZE];
+
+    const char* keys[]=
+    {
+        "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b",
+        "Jefe",
+        "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
+    };
+
+    testVector a, b, c;
+    testVector test_hmac[3];
+
+    int times = sizeof(test_hmac) / sizeof(testVector), i;
+
+    a.input  = "Hi There";
+    a.output = "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc"
+               "\x9d";
+    a.inLen  = strlen(a.input);
+    a.outLen = strlen(a.output);
+
+    b.input  = "what do ya want for nothing?";
+    b.output = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7"
+               "\x38";
+    b.inLen  = strlen(b.input);
+    b.outLen = strlen(b.output);
+
+    c.input  = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+               "\xDD\xDD\xDD\xDD\xDD\xDD";
+    c.output = "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3"
+               "\xf6";
+    c.inLen  = strlen(c.input);
+    c.outLen = strlen(c.output);
+
+    test_hmac[0] = a;
+    test_hmac[1] = b;
+    test_hmac[2] = c;
+
+    for (i = 0; i < times; ++i) {
+        HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i]));
+        HmacUpdate(&hmac, (byte*)test_hmac[i].input,
+                   (word32)test_hmac[i].inLen);
+        HmacFinal(&hmac, hash);
+
+        if (memcmp(hash, test_hmac[i].output, MD5_DIGEST_SIZE) != 0)
+            return -20 - i;
+    }
+
+    return 0;
+}
+#endif
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/include.am b/FreeRTOS-Plus/Source/CyaSSL/tests/include.am
new file mode 100644 (file)
index 0000000..d62e3f9
--- /dev/null
@@ -0,0 +1,28 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+check_PROGRAMS += tests/unit
+noinst_PROGRAMS += tests/unit
+tests_unit_SOURCES = \
+                             tests/unit.c \
+                             tests/api.c \
+                             tests/suites.c \
+                  tests/hash.c \
+                             examples/client/client.c \
+                             examples/server/server.c
+tests_unit_CFLAGS       = -DNO_MAIN_DRIVER $(AM_CFLAGS) $(PTHREAD_CFLAGS)
+tests_unit_LDADD        = src/libcyassl.la  $(PTHREAD_LIBS)
+tests_unit_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += tests/unit.h
+EXTRA_DIST += tests/test.conf \
+              tests/test-openssl.conf \
+              tests/test-hc128.conf \
+              tests/test-psk.conf \
+              tests/test-ntru.conf \
+              tests/test-ecc.conf \
+              tests/test-aesgcm.conf \
+              tests/test-aesgcm-ecc.conf \
+              tests/test-aesgcm-openssl.conf \
+              tests/test-dtls.conf
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/suites.c b/FreeRTOS-Plus/Source/CyaSSL/tests/suites.c
new file mode 100644 (file)
index 0000000..6e59ed8
--- /dev/null
@@ -0,0 +1,343 @@
+/* suites.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <cyassl/ssl.h>
+#include <tests/unit.h>
+
+
+#define MAX_ARGS 40
+#define MAX_COMMAND_SZ 240
+
+
+void client_test(void*);
+THREAD_RETURN CYASSL_THREAD server_test(void*);
+
+
+static void execute_test_case(int svr_argc, char** svr_argv,
+                              int cli_argc, char** cli_argv)
+{
+    func_args cliArgs = {cli_argc, cli_argv, 0, NULL};
+    func_args svrArgs = {svr_argc, svr_argv, 0, NULL};
+
+    tcp_ready   ready;
+    THREAD_TYPE serverThread;
+    char        commandLine[MAX_COMMAND_SZ];
+    int         i;
+    static      int tests = 1;
+
+    commandLine[0] = '\0';
+    for (i = 0; i < svr_argc; i++) {
+        strcat(commandLine, svr_argv[i]);
+        strcat(commandLine, " ");
+    }
+    printf("trying server command line[%d]: %s\n", tests, commandLine);
+
+    commandLine[0] = '\0';
+    for (i = 0; i < cli_argc; i++) {
+        strcat(commandLine, cli_argv[i]);
+        strcat(commandLine, " ");
+    }
+    printf("trying client command line[%d]: %s\n", tests++, commandLine);
+
+    InitTcpReady(&ready);
+
+    /* start server */
+    svrArgs.signal = &ready;
+    start_thread(server_test, &svrArgs, &serverThread);
+    wait_tcp_ready(&svrArgs);
+
+    /* start client */
+    client_test(&cliArgs);
+
+    /* verify results */ 
+    if (cliArgs.return_code != 0) {
+        printf("client_test failed\n");
+        exit(EXIT_FAILURE);
+    }
+
+    join_thread(serverThread);
+    if (svrArgs.return_code != 0) { 
+        printf("server_test failed\n");
+        exit(EXIT_FAILURE);
+    }
+
+    FreeTcpReady(&ready);
+
+}
+
+void test_harness(void* vargs)
+{
+    func_args* args = (func_args*)vargs;
+    char* script;
+    long  sz, len;
+    int   cliMode = 0;   /* server or client command flag, server first */
+    FILE* file;
+    char* svrArgs[MAX_ARGS];
+    int   svrArgsSz;
+    char* cliArgs[MAX_ARGS];
+    int   cliArgsSz;
+    char* cursor;
+    char* comment;
+    char* fname = "tests/test.conf";
+
+
+    if (args->argc == 1) {
+        printf("notice: using default file %s\n", fname);
+    }
+    else if(args->argc != 2) {
+        printf("usage: harness [FILE]\n");
+        args->return_code = 1;
+        return;
+    }
+    else {
+        fname = args->argv[1];
+    }
+
+    file = fopen(fname, "r");
+    if (file == NULL) {
+        fprintf(stderr, "unable to open %s\n", fname);
+        args->return_code = 1;
+        return;
+    }
+    fseek(file, 0, SEEK_END);
+    sz = ftell(file);
+    rewind(file);
+    if (sz == 0) {
+        fprintf(stderr, "%s is empty\n", fname);
+        fclose(file);
+        args->return_code = 1;
+        return;
+    }
+
+    script = (char*)malloc(sz+1);
+    if (script == 0) {
+        fprintf(stderr, "unable to allocte script buffer\n");
+        fclose(file);
+        args->return_code = 1;
+        return;
+    }
+
+    len = fread(script, 1, sz, file);
+    if (len != sz) {
+        fprintf(stderr, "read error\n");
+        fclose(file);
+        args->return_code = 1;
+        return;
+    }
+    
+    fclose(file);
+    script[sz] = 0;
+
+    cursor = script;
+    svrArgsSz = 1;
+    svrArgs[0] = args->argv[0];
+    cliArgsSz = 1;
+    cliArgs[0] = args->argv[0];
+
+    while (*cursor != 0) {
+        int do_it = 0;
+
+        switch (*cursor) {
+            case '\n':
+                /* A blank line triggers test case execution or switches
+                   to client mode if we don't have the client command yet */
+                if (cliMode == 0)
+                    cliMode = 1;  /* switch to client mode processing */
+                else
+                    do_it = 1;    /* Do It, we have server and client */
+                cursor++;
+                break;
+            case '#':
+                /* Ignore lines that start with a #. */
+                comment = strsep(&cursor, "\n");
+                printf("%s\n", comment);
+                break;
+            case '-':
+                /* Parameters start with a -. They end in either a newline
+                 * or a space. Capture until either, save in Args list. */
+                if (cliMode)
+                    cliArgs[cliArgsSz++] = strsep(&cursor, " \n");
+                else
+                    svrArgs[svrArgsSz++] = strsep(&cursor, " \n");
+                break;
+            default:
+                /* Anything from cursor until end of line that isn't the above
+                 * is data for a paramter. Just up until the next newline in
+                 * the Args list. */
+                if (cliMode)
+                    cliArgs[cliArgsSz++] = strsep(&cursor, "\n");
+                else
+                    svrArgs[svrArgsSz++] = strsep(&cursor, "\n");
+                if (*cursor == 0)  /* eof */
+                    do_it = 1; 
+        }
+
+        if (svrArgsSz == MAX_ARGS || cliArgsSz == MAX_ARGS) {
+            fprintf(stderr, "too many arguments, forcing test run\n");
+            do_it = 1;
+        }
+
+        if (do_it) {
+            execute_test_case(svrArgsSz, svrArgs, cliArgsSz, cliArgs);
+            svrArgsSz = 1;
+            cliArgsSz = 1;
+            cliMode   = 0;
+        }
+    }
+
+    free(script);
+    args->return_code = 0;
+}
+
+
+int SuiteTest(void)
+{
+    func_args args;
+    char argv0[2][32];
+    char* myArgv[2];
+
+    printf(" Begin Cipher Suite Tests\n");
+
+    /* setup */
+    myArgv[0] = argv0[0];
+    myArgv[1] = argv0[1];
+    args.argv = myArgv;
+    strcpy(argv0[0], "SuiteTest");
+
+    /* default case */
+    args.argc = 1;
+    printf("starting default cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+
+    /* any extra cases will need another argument */
+    args.argc = 2;
+
+#ifdef OPENSSL_EXTRA
+    /* add openssl extra suites */
+    strcpy(argv0[1], "tests/test-openssl.conf");
+    printf("starting openssl extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifdef HAVE_HC128 
+    /* add hc128 extra suites */
+    strcpy(argv0[1], "tests/test-hc128.conf");
+    printf("starting hc128 extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifndef NO_PSK
+    /* add psk extra suites */
+    strcpy(argv0[1], "tests/test-psk.conf");
+    printf("starting psk extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifdef HAVE_NTRU
+    /* add ntru extra suites */
+    strcpy(argv0[1], "tests/test-ntru.conf");
+    printf("starting ntru extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifdef HAVE_ECC
+    /* add ecc extra suites */
+    strcpy(argv0[1], "tests/test-ecc.conf");
+    printf("starting ecc extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifdef HAVE_AESGCM
+    /* add aesgcm extra suites */
+    strcpy(argv0[1], "tests/test-aesgcm.conf");
+    printf("starting aesgcm extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#if defined(HAVE_AESGCM) && defined(OPENSSL_EXTRA)
+    /* add aesgcm openssl extra suites */
+    strcpy(argv0[1], "tests/test-aesgcm-openssl.conf");
+    printf("starting aesgcm openssl extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#if defined(HAVE_AESGCM) && defined(HAVE_ECC)
+    /* add aesgcm ecc extra suites */
+    strcpy(argv0[1], "tests/test-aesgcm-ecc.conf");
+    printf("starting aesgcm ecc extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+#ifdef CYASSL_DTLS 
+    /* add dtls extra suites */
+    strcpy(argv0[1], "tests/test-dtls.conf");
+    printf("starting dtls extra cipher suite tests\n");
+    test_harness(&args);
+    if (args.return_code != 0) {
+        printf("error from script %d\n", args.return_code);
+        exit(EXIT_FAILURE);  
+    }
+#endif
+
+    printf(" End Cipher Suite Tests\n");
+
+    return args.return_code;
+}
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-ecc.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-ecc.conf
new file mode 100644 (file)
index 0000000..7aff47f
--- /dev/null
@@ -0,0 +1,80 @@
+# server TLSv1.2 ECDHE-ECDSA-AES128-GCM-SHA256 
+-v 3
+-l ECDHE-ECDSA-AES128-GCM-SHA256
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-AES128-GCM-SHA256 
+-v 3
+-l ECDHE-ECDSA-AES128-GCM-SHA256
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-AES256-GCM-SHA384
+-v 3
+-l ECDHE-ECDSA-AES256-GCM-SHA384
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-AES256-GCM-SHA384
+-v 3
+-l ECDHE-ECDSA-AES256-GCM-SHA384
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDH-ECDSA-AES128-GCM-SHA256 
+-v 3
+-l ECDH-ECDSA-AES128-GCM-SHA256
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-AES128-GCM-SHA256 
+-v 3
+-l ECDH-ECDSA-AES128-GCM-SHA256
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDH-ECDSA-AES256-GCM-SHA384
+-v 3
+-l ECDH-ECDSA-AES256-GCM-SHA384
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-AES256-GCM-SHA384
+-v 3
+-l ECDH-ECDSA-AES256-GCM-SHA384
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 
+-v 3
+-l ECDHE-RSA-AES128-GCM-SHA256
+
+# client TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256 
+-v 3
+-l ECDHE-RSA-AES128-GCM-SHA256
+
+# server TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384
+-v 3
+-l ECDHE-RSA-AES256-GCM-SHA384
+
+# client TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384
+-v 3
+-l ECDHE-RSA-AES256-GCM-SHA384
+
+# server TLSv1.2 ECDH-RSA-AES128-GCM-SHA256 
+-v 3
+-l ECDH-RSA-AES128-GCM-SHA256
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-AES128-GCM-SHA256 
+-v 3
+-l ECDH-RSA-AES128-GCM-SHA256
+
+# server TLSv1.2 ECDH-RSA-AES256-GCM-SHA384
+-v 3
+-l ECDH-RSA-AES256-GCM-SHA384
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-AES256-GCM-SHA384
+-v 3
+-l ECDH-RSA-AES256-GCM-SHA384
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-openssl.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm-openssl.conf
new file mode 100644 (file)
index 0000000..006e272
--- /dev/null
@@ -0,0 +1,16 @@
+# server TLSv1.2 DHE-RSA-AES128-GCM-SHA256 
+-v 3
+-l DHE-RSA-AES128-GCM-SHA256
+
+# client TLSv1.2 DHE-RSA-AES128-GCM-SHA256 
+-v 3
+-l DHE-RSA-AES128-GCM-SHA256
+
+# server TLSv1.2 DHE-RSA-AES256-GCM-SHA384
+-v 3
+-l DHE-RSA-AES256-GCM-SHA384
+
+# client TLSv1.2 DHE-RSA-AES256-GCM-SHA384
+-v 3
+-l DHE-RSA-AES256-GCM-SHA384
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-aesgcm.conf
new file mode 100644 (file)
index 0000000..9efc5a5
--- /dev/null
@@ -0,0 +1,16 @@
+# server TLSv1.2 RSA-AES128-GCM-SHA256 
+-v 3
+-l AES128-GCM-SHA256
+
+# client TLSv1.2 RSA-AES128-GCM-SHA256 
+-v 3
+-l AES128-GCM-SHA256
+
+# server TLSv1.2 RSA-AES256-GCM-SHA384
+-v 3
+-l AES256-GCM-SHA384
+
+# client TLSv1.2 RSA-AES256-GCM-SHA384
+-v 3
+-l AES256-GCM-SHA384
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-dtls.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-dtls.conf
new file mode 100644 (file)
index 0000000..7cffa96
--- /dev/null
@@ -0,0 +1,64 @@
+# server DTLSv1 RC4-SHA
+-u
+-l RC4-SHA
+
+# client DTLSv1 RC4-SHA
+-u
+-l RC4-SHA
+
+# server DTLSv1 RC4-MD5
+-u
+-l RC4-MD5
+
+# client DTLSv1 RC4-MD5
+-u
+-l RC4-MD5
+
+# server DTLSv1 DES-CBC3-SHA
+-u
+-l DES-CBC3-SHA
+
+# client DTLSv1 DES-CBC3-SHA
+-u
+-l DES-CBC3-SHA
+
+# server DTLSv1 AES128-SHA
+-u
+-l AES128-SHA
+
+# client DTLSv1 AES128-SHA
+-u
+-l AES128-SHA
+
+# server DTLSv1 AES256-SHA
+-u
+-l AES256-SHA
+
+# client DTLSv1 AES256-SHA
+-u
+-l AES256-SHA
+
+# server DTLSv1 AES128-SHA256
+-u
+-l AES128-SHA256
+
+# client DTLSv1 AES128-SHA256
+-u
+-l AES128-SHA256
+
+# server DTLSv1 AES256-SHA256
+-u
+-l AES256-SHA256
+
+# client DTLSv1 AES256-SHA256
+-u
+-l AES256-SHA256
+
+# server DTLSv1 RABBIT-SHA
+-u
+-l RABBIT-SHA
+
+# client DTLSv1 RABBIT-SHA
+-u
+-l RABBIT-SHA
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-ecc.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-ecc.conf
new file mode 100644 (file)
index 0000000..ca1bc56
--- /dev/null
@@ -0,0 +1,480 @@
+# server TLSv1 ECDHE-RSA-RC4
+-v 1
+-l ECDHE-RSA-RC4-SHA
+
+# client TLSv1 ECDHE-RSA-RC4
+-v 1
+-l ECDHE-RSA-RC4-SHA
+
+# server TLSv1 ECDHE-RSA-DES3
+-v 1
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# client TLSv1 ECDHE-RSA-DES3
+-v 1
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# server TLSv1 ECDHE-RSA-AES128 
+-v 1
+-l ECDHE-RSA-AES128-SHA
+
+# client TLSv1 ECDHE-RSA-AES128 
+-v 1
+-l ECDHE-RSA-AES128-SHA
+
+# server TLSv1 ECDHE-RSA-AES256
+-v 1
+-l ECDHE-RSA-AES256-SHA
+
+# client TLSv1 ECDHE-RSA-AES256
+-v 1
+-l ECDHE-RSA-AES256-SHA
+
+# server TLSv1.1 ECDHE-RSA-RC4
+-v 2
+-l ECDHE-RSA-RC4-SHA
+
+# client TLSv1.1 ECDHE-RSA-RC4
+-v 2
+-l ECDHE-RSA-RC4-SHA
+
+# server TLSv1.1 ECDHE-RSA-DES3
+-v 2
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# client TLSv1.1 ECDHE-RSA-DES3
+-v 2
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# server TLSv1.1 ECDHE-RSA-AES128 
+-v 2
+-l ECDHE-RSA-AES128-SHA
+
+# client TLSv1.1 ECDHE-RSA-AES128 
+-v 2
+-l ECDHE-RSA-AES128-SHA
+
+# server TLSv1.1 ECDHE-RSA-AES256
+-v 2
+-l ECDHE-RSA-AES256-SHA
+
+# client TLSv1.1 ECDHE-RSA-AES256
+-v 2
+-l ECDHE-RSA-AES256-SHA
+
+# server TLSv1.2 ECDHE-RSA-RC4
+-v 3
+-l ECDHE-RSA-RC4-SHA
+
+# client TLSv1.2 ECDHE-RSA-RC4
+-v 3
+-l ECDHE-RSA-RC4-SHA
+
+# server TLSv1.2 ECDHE-RSA-DES3
+-v 3
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# client TLSv1.2 ECDHE-RSA-DES3
+-v 3
+-l ECDHE-RSA-DES-CBC3-SHA
+
+# server TLSv1.2 ECDHE-RSA-AES128 
+-v 3
+-l ECDHE-RSA-AES128-SHA
+
+# client TLSv1.2 ECDHE-RSA-AES128 
+-v 3
+-l ECDHE-RSA-AES128-SHA
+
+# server TLSv1.2 ECDHE-RSA-AES256
+-v 3
+-l ECDHE-RSA-AES256-SHA
+
+# client TLSv1.2 ECDHE-RSA-AES256
+-v 3
+-l ECDHE-RSA-AES256-SHA
+
+# server TLSv1 ECDHE-ECDSA-RC4
+-v 1
+-l ECDHE-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDHE-ECDSA-RC4
+-v 1
+-l ECDHE-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDHE-ECDSA-DES3
+-v 1
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDHE-ECDSA-DES3
+-v 1
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDHE-ECDSA-AES128 
+-v 1
+-l ECDHE-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDHE-ECDSA-AES128 
+-v 1
+-l ECDHE-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDHE-ECDSA-AES256
+-v 1
+-l ECDHE-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDHE-ECDSA-AES256
+-v 1
+-l ECDHE-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDHE-EDCSA-RC4
+-v 2
+-l ECDHE-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDHE-ECDSA-RC4
+-v 2
+-l ECDHE-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDHE-ECDSA-DES3
+-v 2
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDHE-ECDSA-DES3
+-v 2
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDHE-ECDSA-AES128 
+-v 2
+-l ECDHE-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDHE-ECDSA-AES128 
+-v 2
+-l ECDHE-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDHE-ECDSA-AES256
+-v 2
+-l ECDHE-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDHE-ECDSA-AES256
+-v 2
+-l ECDHE-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-RC4
+-v 3
+-l ECDHE-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-RC4
+-v 3
+-l ECDHE-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-DES3
+-v 3
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-DES3
+-v 3
+-l ECDHE-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-AES128 
+-v 3
+-l ECDHE-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-AES128 
+-v 3
+-l ECDHE-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-AES256
+-v 3
+-l ECDHE-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDHE-ECDSA-AES256
+-v 3
+-l ECDHE-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDH-RSA-RC4
+-v 1
+-l ECDH-RSA-RC4-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-RSA-RC4
+-v 1
+-l ECDH-RSA-RC4-SHA
+
+# server TLSv1 ECDH-RSA-DES3
+-v 1
+-l ECDH-RSA-DES-CBC3-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-RSA-DES3
+-v 1
+-l ECDH-RSA-DES-CBC3-SHA
+
+# server TLSv1 ECDH-RSA-AES128 
+-v 1
+-l ECDH-RSA-AES128-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-RSA-AES128 
+-v 1
+-l ECDH-RSA-AES128-SHA
+
+# server TLSv1 ECDH-RSA-AES256
+-v 1
+-l ECDH-RSA-AES256-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-RSA-AES256
+-v 1
+-l ECDH-RSA-AES256-SHA
+
+# server TLSv1.1 ECDH-RSA-RC4
+-v 2
+-l ECDH-RSA-RC4-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-RSA-RC4
+-v 2
+-l ECDH-RSA-RC4-SHA
+
+# server TLSv1.1 ECDH-RSA-DES3
+-v 2
+-l ECDH-RSA-DES-CBC3-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-RSA-DES3
+-v 2
+-l ECDH-RSA-DES-CBC3-SHA
+
+# server TLSv1.1 ECDH-RSA-AES128 
+-v 2
+-l ECDH-RSA-AES128-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-RSA-AES128 
+-v 2
+-l ECDH-RSA-AES128-SHA
+
+# server TLSv1.1 ECDH-RSA-AES256
+-v 2
+-l ECDH-RSA-AES256-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-RSA-AES256
+-v 2
+-l ECDH-RSA-AES256-SHA
+
+# server TLSv1.2 ECDH-RSA-RC4
+-v 3
+-l ECDH-RSA-RC4-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-RC4
+-v 3
+-l ECDH-RSA-RC4-SHA
+
+# server TLSv1.2 ECDH-RSA-DES3
+-v 3
+-l ECDH-RSA-DES-CBC3-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-DES3
+-v 3
+-l ECDH-RSA-DES-CBC3-SHA
+
+# server TLSv1.2 ECDH-RSA-AES128 
+-v 3
+-l ECDH-RSA-AES128-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-AES128 
+-v 3
+-l ECDH-RSA-AES128-SHA
+
+# server TLSv1.2 ECDH-RSA-AES256
+-v 3
+-l ECDH-RSA-AES256-SHA
+-c ./certs/server-ecc-rsa.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-RSA-AES256
+-v 3
+-l ECDH-RSA-AES256-SHA
+
+# server TLSv1 ECDH-ECDSA-RC4
+-v 1
+-l ECDH-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-ECDSA-RC4
+-v 1
+-l ECDH-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDH-ECDSA-DES3
+-v 1
+-l ECDH-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-ECDSA-DES3
+-v 1
+-l ECDH-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDH-ECDSA-AES128 
+-v 1
+-l ECDH-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-ECDSA-AES128 
+-v 1
+-l ECDH-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1 ECDH-ECDSA-AES256
+-v 1
+-l ECDH-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1 ECDH-ECDSA-AES256
+-v 1
+-l ECDH-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDH-EDCSA-RC4
+-v 2
+-l ECDH-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-ECDSA-RC4
+-v 2
+-l ECDH-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDH-ECDSA-DES3
+-v 2
+-l ECDH-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-ECDSA-DES3
+-v 2
+-l ECDH-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDH-ECDSA-AES128 
+-v 2
+-l ECDH-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-ECDSA-AES128 
+-v 2
+-l ECDH-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.1 ECDH-ECDSA-AES256
+-v 2
+-l ECDH-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.1 ECDH-ECDSA-AES256
+-v 2
+-l ECDH-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDHE-ECDSA-RC4
+-v 3
+-l ECDH-ECDSA-RC4-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-RC4
+-v 3
+-l ECDH-ECDSA-RC4-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDH-ECDSA-DES3
+-v 3
+-l ECDH-ECDSA-DES-CBC3-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-DES3
+-v 3
+-l ECDH-ECDSA-DES-CBC3-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDH-ECDSA-AES128 
+-v 3
+-l ECDH-ECDSA-AES128-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-AES128 
+-v 3
+-l ECDH-ECDSA-AES128-SHA
+-A ./certs/server-ecc.pem
+
+# server TLSv1.2 ECDH-ECDSA-AES256
+-v 3
+-l ECDH-ECDSA-AES256-SHA
+-c ./certs/server-ecc.pem
+-k ./certs/ecc-key.pem
+
+# client TLSv1.2 ECDH-ECDSA-AES256
+-v 3
+-l ECDH-ECDSA-AES256-SHA
+-A ./certs/server-ecc.pem
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-hc128.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-hc128.conf
new file mode 100644 (file)
index 0000000..feb0b12
--- /dev/null
@@ -0,0 +1,48 @@
+# server TLSv1 HC128-SHA
+-v 1
+-l HC128-SHA
+
+# client TLSv1 HC128-SHA
+-v 1
+-l HC128-SHA
+
+# server TLSv1 HC128-MD5
+-v 1
+-l HC128-MD5
+
+# client TLSv1 HC128-MD5
+-v 1
+-l HC128-MD5
+
+# server TLSv1.1 HC128-SHA
+-v 2
+-l HC128-SHA
+
+# client TLSv1.1 HC128-SHA
+-v 2
+-l HC128-SHA
+
+# server TLSv1.1 HC128-MD5
+-v 2
+-l HC128-MD5
+
+# client TLSv1.1 HC128-MD5
+-v 2
+-l HC128-MD5
+
+# server TLSv1.2 HC128-SHA
+-v 3
+-l HC128-SHA
+
+# client TLSv1.2 HC128-SHA
+-v 3
+-l HC128-SHA
+
+# server TLSv1.2 HC128-MD5
+-v 3
+-l HC128-MD5
+
+# client TLSv1.2 HC128-MD5
+-v 3
+-l HC128-MD5
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-ntru.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-ntru.conf
new file mode 100644 (file)
index 0000000..7674fb5
--- /dev/null
@@ -0,0 +1,132 @@
+# server TLSv1 NTRU_RC4
+-v 1
+-l NTRU-RC4-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1 NTRU_RC4
+-v 1
+-l NTRU-RC4-SHA
+
+# server TLSv1 NTRU_DES3
+-v 1
+-l NTRU-DES-CBC3-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1 NTRU_DES3
+-v 1
+-l NTRU-DES-CBC3-SHA
+
+# server TLSv1 NTRU_AES128
+-v 1
+-l NTRU-AES128-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1 NTRU_AES128
+-v 1
+-l NTRU-AES128-SHA
+
+# server TLSv1 NTRU_AES256
+-v 1
+-l NTRU-AES256-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1 NTRU_AES256
+-v 1
+-l NTRU-AES256-SHA
+
+# server TLSv1.1 NTRU_RC4
+-v 2
+-l NTRU-RC4-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.1 NTRU_RC4
+-v 2
+-l NTRU-RC4-SHA
+
+# server TLSv1.1 NTRU_DES3
+-v 2
+-l NTRU-DES-CBC3-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.1 NTRU_DES3
+-v 2
+-l NTRU-DES-CBC3-SHA
+
+# server TLSv1.1 NTRU_AES128
+-v 2
+-l NTRU-AES128-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.1 NTRU_AES128
+-v 2
+-l NTRU-AES128-SHA
+
+# server TLSv1.1 NTRU_AES256
+-v 2
+-l NTRU-AES256-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.1 NTRU_AES256
+-v 2
+-l NTRU-AES256-SHA
+
+# server TLSv1.2 NTRU_RC4
+-v 3
+-l NTRU-RC4-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.2 NTRU_RC4
+-v 3
+-l NTRU-RC4-SHA
+
+# server TLSv1.2 NTRU_DES3
+-v 3
+-l NTRU-DES-CBC3-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.2 NTRU_DES3
+-v 3
+-l NTRU-DES-CBC3-SHA
+
+# server TLSv1.2 NTRU_AES128
+-v 3
+-l NTRU-AES128-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.2 NTRU_AES128
+-v 3
+-l NTRU-AES128-SHA
+
+# server TLSv1.2 NTRU_AES256
+-v 3
+-l NTRU-AES256-SHA
+-n
+-c ./certs/ntru-cert.pem
+-k ./certs/ntru-key.raw
+
+# client TLSv1.2 NTRU_AES256
+-v 3
+-l NTRU-AES256-SHA
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-openssl.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-openssl.conf
new file mode 100644 (file)
index 0000000..22a287a
--- /dev/null
@@ -0,0 +1,96 @@
+# server TLSv1 DHE AES128
+-v 1
+-l DHE-RSA-AES128-SHA
+
+# client TLSv1 DHE AES128
+-v 1
+-l DHE-RSA-AES128-SHA
+
+# server TLSv1 DHE AES256
+-v 1
+-l DHE-RSA-AES256-SHA
+
+# client TLSv1 DHE AES256
+-v 1
+-l DHE-RSA-AES256-SHA
+
+# server TLSv1 DHE AES128-SHA256
+-v 1
+-l DHE-RSA-AES128-SHA256
+
+# client TLSv1 DHE AES128-SHA256
+-v 1
+-l DHE-RSA-AES128-SHA256
+
+# server TLSv1 DHE AES256-SHA256
+-v 1
+-l DHE-RSA-AES256-SHA256
+
+# client TLSv1 DHE AES256-SHA256
+-v 1
+-l DHE-RSA-AES256-SHA256
+
+# server TLSv1.1 DHE AES128
+-v 2
+-l DHE-RSA-AES128-SHA
+
+# client TLSv1.1 DHE AES128
+-v 2
+-l DHE-RSA-AES128-SHA
+
+# server TLSv1.1 DHE AES256
+-v 2
+-l DHE-RSA-AES256-SHA
+
+# client TLSv1.1 DHE AES256
+-v 2
+-l DHE-RSA-AES256-SHA
+
+# server TLSv1.1 DHE AES128-SHA256
+-v 2
+-l DHE-RSA-AES128-SHA256
+
+# client TLSv1.1 DHE AES128-SHA256
+-v 2
+-l DHE-RSA-AES128-SHA256
+
+# server TLSv1.1 DHE AES256-SHA256
+-v 2
+-l DHE-RSA-AES256-SHA256
+
+# client TLSv1.1 DHE AES256-SHA256
+-v 2
+-l DHE-RSA-AES256-SHA256
+
+# server TLSv1.2 DHE AES128
+-v 3
+-l DHE-RSA-AES128-SHA
+
+# client TLSv1.2 DHE AES128
+-v 3
+-l DHE-RSA-AES128-SHA
+
+# server TLSv1.2 DHE AES256
+-v 3
+-l DHE-RSA-AES256-SHA
+
+# client TLSv1.2 DHE AES256
+-v 3
+-l DHE-RSA-AES256-SHA
+
+# server TLSv1.2 DHE AES128-SHA256
+-v 3
+-l DHE-RSA-AES128-SHA256
+
+# client TLSv1.2 DHE AES128-SHA256
+-v 3
+-l DHE-RSA-AES128-SHA256
+
+# server TLSv1.2 DHE AES256-SHA256
+-v 3
+-l DHE-RSA-AES256-SHA256
+
+# client TLSv1.2 DHE AES256-SHA256
+-v 3
+-l DHE-RSA-AES256-SHA256
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test-psk.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test-psk.conf
new file mode 100644 (file)
index 0000000..ca4b918
--- /dev/null
@@ -0,0 +1,60 @@
+# server TLSv1 PSK-AES128
+-s
+-v 1
+-l PSK-AES128-CBC-SHA
+
+# client TLSv1 PSK-AES128
+-s
+-v 1
+-l PSK-AES128-CBC-SHA
+
+# server TLSv1 PSK-AES256
+-s
+-v 1
+-l PSK-AES256-CBC-SHA
+
+# client TLSv1 PSK-AES256
+-s
+-v 1
+-l PSK-AES256-CBC-SHA
+
+# server TLSv1.1 PSK-AES128
+-s
+-v 2
+-l PSK-AES128-CBC-SHA
+
+# client TLSv1.1 PSK-AES128
+-s
+-v 2
+-l PSK-AES128-CBC-SHA
+
+# server TLSv1.1 PSK-AES256
+-s
+-v 2
+-l PSK-AES256-CBC-SHA
+
+# client TLSv1.1 PSK-AES256
+-s
+-v 2
+-l PSK-AES256-CBC-SHA
+
+# server TLSv1.2 PSK-AES128
+-s
+-v 3
+-l PSK-AES128-CBC-SHA
+
+# client TLSv1.2 PSK-AES128
+-s
+-v 3
+-l PSK-AES128-CBC-SHA
+
+# server TLSv1.2 PSK-AES256
+-s
+-v 3
+-l PSK-AES256-CBC-SHA
+
+# client TLSv1.2 PSK-AES256
+-s
+-v 3
+-l PSK-AES256-CBC-SHA
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/test.conf b/FreeRTOS-Plus/Source/CyaSSL/tests/test.conf
new file mode 100644 (file)
index 0000000..a4a2076
--- /dev/null
@@ -0,0 +1,216 @@
+# server SSLv3 RC4-SHA
+-v 0
+-l RC4-SHA
+
+# client SSLv3 RC4-SHA
+-v 0
+-l RC4-SHA
+
+# server SSLv3 RC4-MD5
+-v 0
+-l RC4-MD5
+
+# client SSLv3 RC4-MD5
+-v 0
+-l RC4-MD5
+
+# server SSLv3 DES-CBC3-SHA
+-v 0
+-l DES-CBC3-SHA
+
+# client SSLv3 DES-CBC3-SHA
+-v 0
+-l DES-CBC3-SHA
+
+# server TLSv1 RC4-SHA
+-v 1
+-l RC4-SHA
+
+# client TLSv1 RC4-SHA
+-v 1
+-l RC4-SHA
+
+# server TLSv1 RC4-MD5
+-v 1
+-l RC4-MD5
+
+# client TLSv1 RC4-MD5
+-v 1
+-l RC4-MD5
+
+# server TLSv1 DES-CBC3-SHA
+-v 1
+-l DES-CBC3-SHA
+
+# client TLSv1 DES-CBC3-SHA
+-v 1
+-l DES-CBC3-SHA
+
+# server TLSv1 AES128-SHA
+-v 1
+-l AES128-SHA
+
+# client TLSv1 AES128-SHA
+-v 1
+-l AES128-SHA
+
+# server TLSv1 AES256-SHA
+-v 1
+-l AES256-SHA
+
+# client TLSv1 AES256-SHA
+-v 1
+-l AES256-SHA
+
+# server TLSv1 AES128-SHA256
+-v 1
+-l AES128-SHA256
+
+# client TLSv1 AES128-SHA256
+-v 1
+-l AES128-SHA256
+
+# server TLSv1 AES256-SHA256
+-v 1
+-l AES256-SHA256
+
+# client TLSv1 AES256-SHA256
+-v 1
+-l AES256-SHA256
+
+# server TLSv1 RABBIT-SHA
+-v 1
+-l RABBIT-SHA
+
+# client TLSv1 RABBIT-SHA
+-v 1
+-l RABBIT-SHA
+
+# server TLSv1.1 RC4-SHA
+-v 2
+-l RC4-SHA
+
+# client TLSv1.1 RC4-SHA
+-v 2
+-l RC4-SHA
+
+# server TLSv1.1 RC4-MD5
+-v 2
+-l RC4-MD5
+
+# client TLSv1.1 RC4-MD5
+-v 2
+-l RC4-MD5
+
+# server TLSv1.1 DES-CBC3-SHA
+-v 2
+-l DES-CBC3-SHA
+
+# client TLSv1.1 DES-CBC3-SHA
+-v 2
+-l DES-CBC3-SHA
+
+# server TLSv1.1 AES128-SHA
+-v 2
+-l AES128-SHA
+
+# client TLSv1.1 AES128-SHA
+-v 2
+-l AES128-SHA
+
+# server TLSv1.1 AES256-SHA
+-v 2
+-l AES256-SHA
+
+# client TLSv1.1 AES256-SHA
+-v 2
+-l AES256-SHA
+
+# server TLSv1.1 AES128-SHA256
+-v 2
+-l AES128-SHA256
+
+# client TLSv1.1 AES128-SHA256
+-v 2
+-l AES128-SHA256
+
+# server TLSv1.1 AES256-SHA256
+-v 2
+-l AES256-SHA256
+
+# client TLSv1.1 AES256-SHA256
+-v 2
+-l AES256-SHA256
+
+# server TLSv1.1 RABBIT-SHA
+-v 2
+-l RABBIT-SHA
+
+# client TLSv1.1 RABBIT-SHA
+-v 2
+-l RABBIT-SHA
+
+# server TLSv1.2 RC4-SHA
+-v 3
+-l RC4-SHA
+
+# client TLSv1.2 RC4-SHA
+-v 3
+-l RC4-SHA
+
+# server TLSv1.2 RC4-MD5
+-v 3
+-l RC4-MD5
+
+# client TLSv1.2 RC4-MD5
+-v 3
+-l RC4-MD5
+
+# server TLSv1.2 DES-CBC3-SHA
+-v 3
+-l DES-CBC3-SHA
+
+# client TLSv1.2 DES-CBC3-SHA
+-v 3
+-l DES-CBC3-SHA
+
+# server TLSv1.2 AES128-SHA
+-v 3
+-l AES128-SHA
+
+# client TLSv1.2 AES128-SHA
+-v 3
+-l AES128-SHA
+
+# server TLSv1.2 AES256-SHA
+-v 3
+-l AES256-SHA
+
+# client TLSv1.2 AES256-SHA
+-v 3
+-l AES256-SHA
+
+# server TLSv1.2 AES128-SHA256
+-v 3
+-l AES128-SHA256
+
+# client TLSv1.2 AES128-SHA256
+-v 3
+-l AES128-SHA256
+
+# server TLSv1.2 AES256-SHA256
+-v 3
+-l AES256-SHA256
+
+# client TLSv1.2 AES256-SHA256
+-v 3
+-l AES256-SHA256
+
+# server TLSv1.2 RABBIT-SHA
+-v 3
+-l RABBIT-SHA
+
+# client TLSv1.2 RABBIT-SHA
+-v 3
+-l RABBIT-SHA
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/unit.c b/FreeRTOS-Plus/Source/CyaSSL/tests/unit.c
new file mode 100644 (file)
index 0000000..1fbcc9c
--- /dev/null
@@ -0,0 +1,89 @@
+/* unit.c unit tests driver */
+#include <stdio.h>
+#include <tests/unit.h>
+
+
+int myoptind = 0;
+char* myoptarg = NULL;
+
+
+int main(int argc, char** argv)
+{
+    int ret;
+
+    printf("staring unit tests...\n");
+
+    if ( (ret = ApiTest()) != 0) {
+        printf("api test failed with %d\n", ret);
+        return ret;
+    }
+
+    if ( (ret = HashTest()) != 0){
+        printf("hash test failed with %d\n", ret);
+        return ret;
+    }
+
+    if ( (ret = SuiteTest()) != 0){
+        printf("suite test failed with %d\n", ret);
+        return ret;
+    }
+
+    return 0;
+}
+
+
+void wait_tcp_ready(func_args* args)
+{
+#ifdef _POSIX_THREADS
+    pthread_mutex_lock(&args->signal->mutex);
+    
+    if (!args->signal->ready)
+        pthread_cond_wait(&args->signal->cond, &args->signal->mutex);
+    args->signal->ready = 0; /* reset */
+
+    pthread_mutex_unlock(&args->signal->mutex);
+#endif
+}
+
+
+void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread)
+{
+#ifdef _POSIX_THREADS
+    pthread_create(thread, 0, fun, args);
+    return;
+#else
+    *thread = (THREAD_TYPE)_beginthreadex(0, 0, fun, args, 0, 0);
+#endif
+}
+
+
+void join_thread(THREAD_TYPE thread)
+{
+#ifdef _POSIX_THREADS
+    pthread_join(thread, 0);
+#else
+    int res = WaitForSingleObject(thread, INFINITE);
+    assert(res == WAIT_OBJECT_0);
+    res = CloseHandle(thread);
+    assert(res);
+#endif
+}
+
+
+void InitTcpReady(tcp_ready* ready)
+{
+    ready->ready = 0;
+#ifdef _POSIX_THREADS
+      pthread_mutex_init(&ready->mutex, 0);
+      pthread_cond_init(&ready->cond, 0);
+#endif
+}
+
+
+void FreeTcpReady(tcp_ready* ready)
+{
+#ifdef _POSIX_THREADS
+    pthread_mutex_destroy(&ready->mutex);
+    pthread_cond_destroy(&ready->cond);
+#endif
+}
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/CyaSSL/tests/unit.h b/FreeRTOS-Plus/Source/CyaSSL/tests/unit.h
new file mode 100644 (file)
index 0000000..840893c
--- /dev/null
@@ -0,0 +1,13 @@
+/* unit.h unit tests driver */
+
+#ifndef CyaSSL_UNIT_H
+#define CyaSSL_UNIT_H
+
+#include <cyassl/test.h>    /* thread and tcp stuff */
+
+int ApiTest(void);
+int SuiteTest(void);
+int HashTest(void);
+
+
+#endif /* CyaSSL_UNIT_H */
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/CyaSSL/testsuite/include.am b/FreeRTOS-Plus/Source/CyaSSL/testsuite/include.am
new file mode 100644 (file)
index 0000000..1772ac1
--- /dev/null
@@ -0,0 +1,22 @@
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+
+check_PROGRAMS += testsuite/testsuite
+noinst_PROGRAMS += testsuite/testsuite
+testsuite_testsuite_SOURCES = \
+                             ctaocrypt/test/test.c \
+                             examples/client/client.c \
+                             examples/echoclient/echoclient.c \
+                             examples/echoserver/echoserver.c \
+                             examples/server/server.c \
+                             testsuite/testsuite.c
+testsuite_testsuite_CFLAGS       = -DNO_MAIN_DRIVER $(AM_CFLAGS) $(PTHREAD_CFLAGS)
+testsuite_testsuite_LDADD        = src/libcyassl.la $(PTHREAD_LIBS)
+testsuite_testsuite_DEPENDENCIES = src/libcyassl.la
+EXTRA_DIST += testsuite/testsuite.sln
+EXTRA_DIST += testsuite/testsuite-ntru.vcproj
+EXTRA_DIST += testsuite/testsuite.vcproj
+EXTRA_DIST += input
+EXTRA_DIST += quit
diff --git a/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite-ntru.vcproj b/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite-ntru.vcproj
new file mode 100644 (file)
index 0000000..6ed108a
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="testsuite"\r
+       ProjectGUID="{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"\r
+       RootNamespace="testsuite"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../;../NTRU/include"\r
+                               PreprocessorDefinitions="NO_MAIN_DRIVER;CYASSL_RIPEMD;CYASSL_SHA512;OPENSSL_EXTRA;HAVE_NTRU;NO_PSK;WIN32"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories="..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../;../NTRU/include"\r
+                               PreprocessorDefinitions="NO_MAIN_DRIVER;CYASSL_RIPEMD;CYASSL_SHA512;OPENSSL_EXTRA;HAVE_NTRU;NO_PSK;WIN32"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib neo.lib"\r
+                               LinkIncremental="1"\r
+                               AdditionalLibraryDirectories="..\NTRU\bin"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\examples\client\client.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\echoclient\echoclient.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\echoserver\echoserver.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\server\server.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\ctaocrypt\test\test.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\testsuite.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.c b/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.c
new file mode 100644 (file)
index 0000000..ebcb0c2
--- /dev/null
@@ -0,0 +1,236 @@
+/* testsuite.c
+ *
+ * Copyright (C) 2006-2012 Sawtooth Consulting Ltd.
+ *
+ * This file is part of CyaSSL.
+ *
+ * CyaSSL is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * CyaSSL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include <config.h>
+#endif
+
+#include <cyassl/openssl/ssl.h>
+#include <cyassl/test.h>
+#include <cyassl/ctaocrypt/md5.h>
+
+#ifdef SINGLE_THREADED
+    #error testsuite needs threads to run, please run ctaocrypt/test, \
+           and the examples/ individually
+#endif
+
+void ctaocrypt_test(void*);
+
+void client_test(void*);
+void echoclient_test(void*);
+
+THREAD_RETURN CYASSL_THREAD server_test(void*);
+THREAD_RETURN CYASSL_THREAD echoserver_test(void*);
+
+void file_test(char* file, byte* hash);
+
+enum {
+    NUMARGS = 3
+};
+
+
+int myoptind = 0;
+char* myoptarg = NULL;
+
+
+int main(int argc, char** argv)
+{
+    func_args args;
+    func_args server_args;
+
+    tcp_ready ready;
+    THREAD_TYPE serverThread;
+
+    StartTCP();
+
+    args.argc = server_args.argc = argc;
+    args.argv = server_args.argv = argv;
+
+    CyaSSL_Init();
+#ifdef DEBUG_CYASSL
+    CyaSSL_Debugging_ON();
+#endif
+
+    if (CurrentDir("testsuite"))
+        ChangeDirBack(1);
+    else if (CurrentDir("build"))  /* Xcode->Preferences->Locations->Build */
+        ChangeDirBack(2);          /* Location "Place build product in locations
+                                      specified by targets", uses build/Debug */
+    /* CTaoCrypt test */
+    ctaocrypt_test(&args);
+    if (args.return_code != 0) return args.return_code;
+    /* Simple CyaSSL client server test */
+    InitTcpReady(&ready);
+    server_args.signal = &ready;
+    start_thread(server_test, &server_args, &serverThread);
+    wait_tcp_ready(&server_args);
+
+    client_test(&args);
+    if (args.return_code != 0) return args.return_code;
+    join_thread(serverThread);
+    if (server_args.return_code != 0) return server_args.return_code;
+
+    /* Echo input yaSSL client server test */
+    start_thread(echoserver_test, &server_args, &serverThread);
+    wait_tcp_ready(&server_args);
+    {
+        func_args echo_args;
+        char* myArgv[NUMARGS];
+
+        char argc0[32];
+        char argc1[32];
+        char argc2[32];
+
+        myArgv[0] = argc0;
+        myArgv[1] = argc1;
+        myArgv[2] = argc2;
+
+        echo_args.argc = NUMARGS;
+        echo_args.argv = myArgv;
+   
+        strcpy(echo_args.argv[0], "echoclient");
+        strcpy(echo_args.argv[1], "input");
+        strcpy(echo_args.argv[2], "output");
+        remove("output");
+
+        /* make sure OK */
+        echoclient_test(&echo_args);
+        if (echo_args.return_code != 0) return echo_args.return_code;  
+
+#ifdef CYASSL_DTLS
+        wait_tcp_ready(&server_args);
+#endif
+        /* send quit to echoserver */
+        echo_args.argc = 2;
+        strcpy(echo_args.argv[1], "quit");
+
+        echoclient_test(&echo_args);
+        if (echo_args.return_code != 0) return echo_args.return_code;
+        join_thread(serverThread);
+        if (server_args.return_code != 0) return server_args.return_code;
+    }
+
+    /* validate output equals input */
+    {
+        byte input[MD5_DIGEST_SIZE];
+        byte output[MD5_DIGEST_SIZE];
+
+        file_test("input",  input);
+        file_test("output", output);
+        if (memcmp(input, output, sizeof(input)) != 0)
+            return EXIT_FAILURE;
+    }
+
+    CyaSSL_Cleanup();
+    FreeTcpReady(&ready);
+
+    printf("\nAll tests passed!\n");
+    return EXIT_SUCCESS;
+}
+
+
+
+void wait_tcp_ready(func_args* args)
+{
+#ifdef _POSIX_THREADS
+    pthread_mutex_lock(&args->signal->mutex);
+    
+    if (!args->signal->ready)
+        pthread_cond_wait(&args->signal->cond, &args->signal->mutex);
+    args->signal->ready = 0; /* reset */
+
+    pthread_mutex_unlock(&args->signal->mutex);
+#endif
+}
+
+
+void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread)
+{
+#ifdef _POSIX_THREADS
+    pthread_create(thread, 0, fun, args);
+    return;
+#else
+    *thread = (THREAD_TYPE)_beginthreadex(0, 0, fun, args, 0, 0);
+#endif
+}
+
+
+void join_thread(THREAD_TYPE thread)
+{
+#ifdef _POSIX_THREADS
+    pthread_join(thread, 0);
+#else
+    int res = WaitForSingleObject(thread, INFINITE);
+    assert(res == WAIT_OBJECT_0);
+    res = CloseHandle(thread);
+    assert(res);
+#endif
+}
+
+
+void InitTcpReady(tcp_ready* ready)
+{
+    ready->ready = 0;
+#ifdef _POSIX_THREADS
+      pthread_mutex_init(&ready->mutex, 0);
+      pthread_cond_init(&ready->cond, 0);
+#endif
+}
+
+
+void FreeTcpReady(tcp_ready* ready)
+{
+#ifdef _POSIX_THREADS
+    pthread_mutex_destroy(&ready->mutex);
+    pthread_cond_destroy(&ready->cond);
+#endif
+}
+
+
+void file_test(char* file, byte* check)
+{
+    FILE* f;
+    int   i = 0, j;
+    Md5   md5;
+    byte  buf[1024];
+    byte  md5sum[MD5_DIGEST_SIZE];
+   
+    InitMd5(&md5); 
+    if( !( f = fopen( file, "rb" ) )) {
+        printf("Can't open %s\n", file);
+        return;
+    }
+    while( ( i = (int)fread(buf, 1, sizeof(buf), f )) > 0 )
+        Md5Update(&md5, buf, i);
+    
+    Md5Final(&md5, md5sum);
+    memcpy(check, md5sum, sizeof(md5sum));
+
+    for(j = 0; j < MD5_DIGEST_SIZE; ++j ) 
+        printf( "%02x", md5sum[j] );
+   
+    printf("  %s\n", file);
+
+    fclose(f);
+}
+
+
diff --git a/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.sln b/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.sln
new file mode 100644 (file)
index 0000000..b89dcc1
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsuite", "testsuite.vcproj", "{9D4D8446-CE91-4F7A-AFF2-90D0B5DCD717}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {9D4D8446-CE91-4F7A-AFF2-90D0B5DCD717}.Debug|Win32.ActiveCfg = Debug|Win32
+               {9D4D8446-CE91-4F7A-AFF2-90D0B5DCD717}.Debug|Win32.Build.0 = Debug|Win32
+               {9D4D8446-CE91-4F7A-AFF2-90D0B5DCD717}.Release|Win32.ActiveCfg = Release|Win32
+               {9D4D8446-CE91-4F7A-AFF2-90D0B5DCD717}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.vcproj b/FreeRTOS-Plus/Source/CyaSSL/testsuite/testsuite.vcproj
new file mode 100644 (file)
index 0000000..a569b13
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="testsuite"\r
+       ProjectGUID="{611E8971-46E0-4D0A-B5A1-632C3B00CB80}"\r
+       RootNamespace="testsuite"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="196613"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../"\r
+                               PreprocessorDefinitions="NO_MAIN_DRIVER;CYASSL_RIPEMD;CYASSL_SHA512;OPENSSL_EXTRA;NO_PSK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               AdditionalIncludeDirectories="../"\r
+                               PreprocessorDefinitions="NO_MAIN_DRIVER;CYASSL_RIPEMD;CYASSL_SHA512;OPENSSL_EXTRA;NO_PSK"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="Ws2_32.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\examples\client\client.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\echoclient\echoclient.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\echoserver\echoserver.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\examples\server\server.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\ctaocrypt\test\test.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\testsuite.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.c
new file mode 100644 (file)
index 0000000..13f584d
--- /dev/null
@@ -0,0 +1,342 @@
+/*\r
+ * FreeRTOS+CLI V1.0.1 (C) 2012 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+CLI is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+CLI is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+CLI uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+CLI is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+CLI into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+CLI product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+CLI is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+CLI unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+CLI is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <string.h>\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Utils includes. */\r
+#include "FreeRTOS_CLI.h"\r
+\r
+typedef struct xCOMMAND_INPUT_LIST\r
+{\r
+       const CLI_Command_Definition_t *pxCommandLineDefinition;\r
+       struct xCOMMAND_INPUT_LIST *pxNext;\r
+} CLI_Definition_List_Item_t;\r
+\r
+/*\r
+ * The callback function that is executed when "help" is entered.  This is the\r
+ * only default command that is always present.\r
+ */\r
+static portBASE_TYPE prvHelpCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString );\r
+\r
+/*\r
+ * Return the number of parameters that follow the command name.\r
+ */\r
+static int8_t prvGetNumberOfParameters( const int8_t * pcCommandString );\r
+\r
+/* The definition of the "help" command.  This command is always at the front\r
+of the list of registered commands. */\r
+static const CLI_Command_Definition_t xHelpCommand =\r
+{\r
+       ( const int8_t * const ) "help",\r
+       ( const int8_t * const ) "\r\nhelp:\r\n Lists all the registered commands\r\n\r\n",\r
+       prvHelpCommand,\r
+       0\r
+};\r
+\r
+/* The definition of the list of commands.  Commands that are registered are\r
+added to this list. */\r
+static CLI_Definition_List_Item_t xRegisteredCommands =\r
+{\r
+       &xHelpCommand,  /* The first command in the list is always the help command, defined in this file. */\r
+       NULL                    /* The next pointer is initialised to NULL, as there are no other registered commands yet. */\r
+};\r
+\r
+/* A buffer into which command outputs can be written is declared here, rather\r
+than in the command console implementation, to allow multiple command consoles\r
+to share the same buffer.  For example, an application may allow access to the\r
+command interpreter by UART and by Ethernet.  Sharing a buffer is done purely\r
+to save RAM.  Note, however, that the command console itself is not re-entrant,\r
+so only one command interpreter interface can be used at any one time.  For that\r
+reason, no attempt at providing mutual exclusion to the cOutputBuffer array is\r
+attempted. */\r
+static int8_t cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister )\r
+{\r
+static CLI_Definition_List_Item_t *pxLastCommandInList = &xRegisteredCommands;\r
+CLI_Definition_List_Item_t *pxNewListItem;\r
+portBASE_TYPE xReturn = pdFAIL;\r
+\r
+       /* Check the parameter is not NULL. */\r
+       configASSERT( pxCommandToRegister );\r
+\r
+       /* Create a new list item that will reference the command being registered. */\r
+       pxNewListItem = ( CLI_Definition_List_Item_t * ) pvPortMalloc( sizeof( CLI_Definition_List_Item_t ) );\r
+       configASSERT( pxNewListItem );\r
+\r
+       if( pxNewListItem != NULL )\r
+       {\r
+               taskENTER_CRITICAL();\r
+               {\r
+                       /* Reference the command being registered from the newly created\r
+                       list item. */\r
+                       pxNewListItem->pxCommandLineDefinition = pxCommandToRegister;\r
+\r
+                       /* The new list item will get added to the end of the list, so\r
+                       pxNext has nowhere to point. */\r
+                       pxNewListItem->pxNext = NULL;\r
+\r
+                       /* Add the newly created list item to the end of the already existing\r
+                       list. */\r
+                       pxLastCommandInList->pxNext = pxNewListItem;\r
+\r
+                       /* Set the end of list marker to the new list item. */\r
+                       pxLastCommandInList = pxNewListItem;\r
+               }\r
+               taskEXIT_CRITICAL();\r
+\r
+               xReturn = pdPASS;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_CLIProcessCommand( const int8_t * const pcCommandInput, int8_t * pcWriteBuffer, size_t xWriteBufferLen  )\r
+{\r
+static const CLI_Definition_List_Item_t *pxCommand = NULL;\r
+portBASE_TYPE xReturn = pdTRUE;\r
+const int8_t *pcRegisteredCommandString;\r
+size_t xCommandStringLength;\r
+\r
+       /* Note:  This function is not re-entrant.  It must not be called from more\r
+       thank one task. */\r
+\r
+       if( pxCommand == NULL )\r
+       {\r
+               /* Search for the command string in the list of registered commands. */\r
+               for( pxCommand = &xRegisteredCommands; pxCommand != NULL; pxCommand = pxCommand->pxNext )\r
+               {\r
+                       pcRegisteredCommandString = pxCommand->pxCommandLineDefinition->pcCommand;\r
+                       xCommandStringLength = strlen( ( const char * ) pcRegisteredCommandString );\r
+\r
+                       /* To ensure the string lengths match exactly, so as not to pick up\r
+                       a sub-string of a longer command, check the byte after the expected\r
+                       end of the string is either the end of the string or a space before\r
+                       a parameter. */\r
+                       if( ( pcCommandInput[ xCommandStringLength ] == ' ' ) || ( pcCommandInput[ xCommandStringLength ] == 0x00 ) )\r
+                       {\r
+                               if( strncmp( ( const char * ) pcCommandInput, ( const char * ) pcRegisteredCommandString, xCommandStringLength ) == 0 )\r
+                               {\r
+                                       /* The command has been found.  Check it has the expected\r
+                                       number of parameters.  If cExpectedNumberOfParameters is -1,\r
+                                       then there could be a variable number of parameters and no\r
+                                       check is made. */\r
+                                       if( pxCommand->pxCommandLineDefinition->cExpectedNumberOfParameters >= 0 )\r
+                                       {\r
+                                               if( prvGetNumberOfParameters( pcCommandInput ) != pxCommand->pxCommandLineDefinition->cExpectedNumberOfParameters )\r
+                                               {\r
+                                                       xReturn = pdFALSE;\r
+                                               }\r
+                                       }\r
+\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       if( ( pxCommand != NULL ) && ( xReturn == pdFALSE ) )\r
+       {\r
+               /* The command was found, but the number of parameters with the command\r
+               was incorrect. */\r
+               strncpy( ( char * ) pcWriteBuffer, "Incorrect command parameter(s).  Enter \"help\" to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
+               pxCommand = NULL;\r
+       }\r
+       else if( pxCommand != NULL )\r
+       {\r
+               /* Call the callback function that is registered to this command. */\r
+               xReturn = pxCommand->pxCommandLineDefinition->pxCommandInterpreter( pcWriteBuffer, xWriteBufferLen, pcCommandInput );\r
+\r
+               /* If xReturn is pdFALSE, then no further strings will be returned\r
+               after this one, and     pxCommand can be reset to NULL ready to search\r
+               for the next entered command. */\r
+               if( xReturn == pdFALSE )\r
+               {\r
+                       pxCommand = NULL;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               /* pxCommand was NULL, the command was not found. */\r
+               strncpy( ( char * ) pcWriteBuffer, ( const char * const ) "Command not recognised.  Enter \"help\" to view a list of available commands.\r\n\r\n", xWriteBufferLen );\r
+               xReturn = pdFALSE;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+int8_t *FreeRTOS_CLIGetOutputBuffer( void )\r
+{\r
+       return cOutputBuffer;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+const int8_t *FreeRTOS_CLIGetParameter( const int8_t *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength )\r
+{\r
+unsigned portBASE_TYPE uxParametersFound = 0;\r
+const int8_t *pcReturn = NULL;\r
+\r
+       *pxParameterStringLength = 0;\r
+\r
+       while( uxParametersFound < uxWantedParameter )\r
+       {\r
+               /* Index the character pointer past the current word.  If this is the start\r
+               of the command string then the first word is the command itself. */\r
+               while( ( ( *pcCommandString ) != 0x00 ) && ( ( *pcCommandString ) != ' ' ) )\r
+               {\r
+                       pcCommandString++;\r
+               }\r
+\r
+               /* Find the start of the next string. */\r
+               while( ( ( *pcCommandString ) != 0x00 ) && ( ( *pcCommandString ) == ' ' ) )\r
+               {\r
+                       pcCommandString++;\r
+               }\r
+\r
+               /* Was a string found? */\r
+               if( *pcCommandString != 0x00 )\r
+               {\r
+                       /* Is this the start of the required parameter? */\r
+                       uxParametersFound++;\r
+\r
+                       if( uxParametersFound == uxWantedParameter )\r
+                       {\r
+                               /* How long is the parameter? */\r
+                               pcReturn = pcCommandString;\r
+                               while( ( ( *pcCommandString ) != 0x00 ) && ( ( *pcCommandString ) != ' ' ) )\r
+                               {\r
+                                       ( *pxParameterStringLength )++;\r
+                                       pcCommandString++;\r
+                               }\r
+\r
+                               if( *pxParameterStringLength == 0 )\r
+                               {\r
+                                       pcReturn = NULL;\r
+                               }\r
+\r
+                               break;\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return pcReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvHelpCommand( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t *pcCommandString )\r
+{\r
+static const CLI_Definition_List_Item_t * pxCommand = NULL;\r
+signed portBASE_TYPE xReturn;\r
+\r
+       ( void ) pcCommandString;\r
+\r
+       if( pxCommand == NULL )\r
+       {\r
+               /* Reset the pxCommand pointer back to the start of the list. */\r
+               pxCommand = &xRegisteredCommands;\r
+       }\r
+\r
+       /* Return the next command help string, before moving the pointer on to\r
+       the next command in the list. */\r
+       strncpy( ( char * ) pcWriteBuffer, ( const char * ) pxCommand->pxCommandLineDefinition->pcHelpString, xWriteBufferLen );\r
+       pxCommand = pxCommand->pxNext;\r
+\r
+       if( pxCommand == NULL )\r
+       {\r
+               /* There are no more commands in the list, so there will be no more\r
+               strings to return after this one and pdFALSE should be returned. */\r
+               xReturn = pdFALSE;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdTRUE;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static int8_t prvGetNumberOfParameters( const int8_t * pcCommandString )\r
+{\r
+int8_t cParameters = 0;\r
+portBASE_TYPE xLastCharacterWasSpace = pdFALSE;\r
+\r
+       /* Count the number of space delimited words in pcCommandString. */\r
+       while( *pcCommandString != 0x00 )\r
+       {\r
+               if( ( *pcCommandString ) == ' ' )\r
+               {\r
+                       if( xLastCharacterWasSpace != pdTRUE )\r
+                       {\r
+                               cParameters++;\r
+                               xLastCharacterWasSpace = pdTRUE;\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       xLastCharacterWasSpace = pdFALSE;\r
+               }\r
+\r
+               pcCommandString++;\r
+       }\r
+\r
+       /* If the command string ended with spaces, then there will have been too\r
+       many parameters counted. */\r
+       if( xLastCharacterWasSpace == pdTRUE )\r
+       {\r
+               cParameters--;\r
+       }\r
+\r
+       /* The value returned is one less than the number of space delimited words,\r
+       as the first word should be the command itself. */\r
+       return cParameters;\r
+}\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/FreeRTOS_CLI.h
new file mode 100644 (file)
index 0000000..ffeb0e7
--- /dev/null
@@ -0,0 +1,115 @@
+/*\r
+ * FreeRTOS+CLI V1.0.1 (C) 2012 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+CLI is an add-on component to FreeRTOS.  It is not, in itself, part \r
+ * of the FreeRTOS kernel.  FreeRTOS+CLI is licensed separately from FreeRTOS, \r
+ * and uses a different license to FreeRTOS.  FreeRTOS+CLI uses a dual license \r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+CLI is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+CLI into\r
+ * proprietary software for redistribution in any form must first obtain a \r
+ * (very) low cost commercial license - and in-so-doing support the maintenance, \r
+ * support and further development of the FreeRTOS+CLI product.  Commercial \r
+ * licenses can be obtained from http://shop.freertos.org and do not require any \r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+CLI is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+CLI unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+CLI is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus\r
+ *\r
+ */\r
+\r
+#ifndef COMMAND_INTERPRETER_H\r
+#define COMMAND_INTERPRETER_H\r
+\r
+/* The prototype to which callback functions used to process command line\r
+commands must comply.  pcWriteBuffer is a buffer into which the output from \r
+executing the command can be written, xWriteBufferLen is the length, in bytes of \r
+the pcWriteBuffer buffer, and pcCommandString is the entire string as input by\r
+the user (from which parameters can be extracted).*/\r
+typedef portBASE_TYPE (*pdCOMMAND_LINE_CALLBACK)( int8_t *pcWriteBuffer, size_t xWriteBufferLen, const int8_t * pcCommandString );\r
+\r
+/* The structure that defines command line commands.  A command line command\r
+should be defined by declaring a const structure of this type. */\r
+typedef struct xCOMMAND_LINE_INPUT\r
+{\r
+       const int8_t * const pcCommand;                         /* The command that causes pxCommandInterpreter to be executed.  For example "help".  Must be all lower case. */\r
+       const int8_t * const pcHelpString;                      /* String that describes how to use the command.  Should start with the command itself, and end with "\r\n".  For example "help: Returns a list of all the commands\r\n". */\r
+       const pdCOMMAND_LINE_CALLBACK pxCommandInterpreter;     /* A pointer to the callback function that will return the output generated by the command. */\r
+       int8_t cExpectedNumberOfParameters;                     /* Commands expect a fixed number of parameters, which may be zero. */\r
+} CLI_Command_Definition_t;\r
+\r
+/* For backward compatibility. */\r
+#define xCommandLineInput CLI_Command_Definition_t\r
+\r
+/*\r
+ * Register the command passed in using the pxCommandToRegister parameter.\r
+ * Registering a command adds the command to the list of commands that are\r
+ * handled by the command interpreter.  Once a command has been registered it\r
+ * can be executed from the command line.\r
+ */\r
+portBASE_TYPE FreeRTOS_CLIRegisterCommand( const CLI_Command_Definition_t * const pxCommandToRegister );\r
+\r
+/*\r
+ * Runs the command interpreter for the command string "pcCommandInput".  Any\r
+ * output generated by running the command will be placed into pcWriteBuffer.\r
+ * xWriteBufferLen must indicate the size, in bytes, of the buffer pointed to\r
+ * by pcWriteBuffer.\r
+ *\r
+ * FreeRTOS_CLIProcessCommand should be called repeatedly until it returns pdFALSE.\r
+ *\r
+ * pcCmdIntProcessCommand is not reentrant.  It must not be called from more\r
+ * than one task - or at least - by more than one task at a time.\r
+ */\r
+portBASE_TYPE FreeRTOS_CLIProcessCommand( const int8_t * const pcCommandInput, int8_t * pcWriteBuffer, size_t xWriteBufferLen  );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * A buffer into which command outputs can be written is declared in the\r
+ * main command interpreter, rather than in the command console implementation,\r
+ * to allow application that provide access to the command console via multiple\r
+ * interfaces to share a buffer, and therefore save RAM.  Note, however, that\r
+ * the command interpreter itself is not re-entrant, so only one command\r
+ * console interface can be used at any one time.  For that reason, no attempt\r
+ * is made to provide any mutual exclusion mechanism on the output buffer.\r
+ *\r
+ * FreeRTOS_CLIGetOutputBuffer() returns the address of the output buffer.\r
+ */\r
+int8_t *FreeRTOS_CLIGetOutputBuffer( void );\r
+\r
+/*\r
+ * Return a pointer to the xParameterNumber'th word in pcCommandString.\r
+ */\r
+const int8_t *FreeRTOS_CLIGetParameter( const int8_t *pcCommandString, unsigned portBASE_TYPE uxWantedParameter, portBASE_TYPE *pxParameterStringLength );\r
+\r
+#endif /* COMMAND_INTERPRETER_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/History.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/History.txt
new file mode 100644 (file)
index 0000000..778a63d
--- /dev/null
@@ -0,0 +1,7 @@
+Changes between V1.0.0 and V1.0.1 released 05/07/2012\r
+\r
+       + Change the name of the structure used to map a function that implements\r
+         a CLI command to the string used to call the command from \r
+         xCommandLineInput to CLI_Command_Definition_t, as it was always intended\r
+         to be.  A #define was added to map the old name to the new name for\r
+         reasons of backward compatibility.
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/LICENSE_INFORMATION.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/LICENSE_INFORMATION.txt
new file mode 100644 (file)
index 0000000..b25a91b
--- /dev/null
@@ -0,0 +1,9 @@
+Note the FreeRTOS+CLI license terms are different to the FreeRTOS license terms.\r
+\r
+FreeRTOS+CLI is dual licensed.  The files are provided here under an unmodified \r
+open source GNU GPL license.  Commercial licenses are also available.  \r
+See http://www.FreeRTOS.org/cli\r
+\r
+USERS OF NXP MICROCONTROLLERS CAN OBTAIN FREE COMMERCIAL LICENSES.\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/ReadMe.url b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/ReadMe.url
new file mode 100644 (file)
index 0000000..3a76266
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/cli\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/readme.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-CLI/readme.txt
new file mode 100644 (file)
index 0000000..0f61b02
--- /dev/null
@@ -0,0 +1,4 @@
+Contains source and header files that implement FreeRTOS+CLI.  See\r
+http://www.FreeRTOS.org/cli for documentation and license information.\r
+\r
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/LinkToDemo.url b/FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/LinkToDemo.url
new file mode 100644 (file)
index 0000000..e803bf2
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_IO/Demo_Applications/LPCXpresso_LPC1769/NXP_LPC1769_Demo_Description.shtml\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/readme.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-IO/readme.txt
new file mode 100644 (file)
index 0000000..f5c8d2f
--- /dev/null
@@ -0,0 +1,7 @@
+It is not possible to create an example FreeRTOS+IO project for the Windows\r
+simulator.  FreeRTOS+IO information can be found on http://www.FreeRTOS.org/IO.\r
+\r
+A featured demo that includes telnet like functionality, a web server, \r
+a command line interface (using FreeRTOS+CLI) and a FAT file system is \r
+described on \r
+http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_IO/Demo_Applications/LPCXpresso_LPC1769/NXP_LPC1769_Demo_Description.shtml
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/Readme Config.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/Readme Config.txt
new file mode 100644 (file)
index 0000000..8883a59
--- /dev/null
@@ -0,0 +1,22 @@
+FreeRTOS+Trace v2.3.0\r
+---------------------\r
+\r
+This directory contains the recorder files that the typical FreeRTOS+Trace user needs to be aware of.\r
+\r
+- trcPort.h - contains the hardware ports and the setting of what port to use.\r
+- trcConfig.h - contains the recorder configuration.\r
+\r
+The files in this directory are however not referenced by any of the demo projects. \r
+Copies of these files are instead found in each Demo project directory.\r
+\r
+These copies are included here to make the TraceRecorderSrc directory complete.\r
+\r
+If you use this template, you will need to update the following macro definitions in trcPort.h:\r
+- SELECTED_PORT\r
+- IRQ_PRIORITY_ORDER\r
+- vTraceConsoleMessage (optional, if console prints are desired)\r
+\r
+Always remember to check the settings used in trcConfig.h.\r
+\r
+Percepio AB\r
+www.percepio.com\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcConfig.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcConfig.h
new file mode 100644 (file)
index 0000000..1ffa3ef
--- /dev/null
@@ -0,0 +1,465 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcConfig.h\r
+ *\r
+ * Configuration parameters for the trace recorder library. Before using the \r
+ * trace recorder library, please check that the default settings are \r
+ * appropriate for your system, and if necessary adjust these. Most likely, you \r
+ * will need to adjust the NTask, NISR, NQueue, NMutex and NSemaphore values to \r
+ * reflect the number of such objects in your system. These may be \r
+ * overapproximated, although larger values values implies more RAM usage.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCCONFIG_H\r
+#define TRCCONFIG_H\r
+\r
+/*******************************************************************************\r
+ * CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the event buffer, i.e., the number of records\r
+ * it may store. Each registered event typically use one record (4 byte), but\r
+ * vTracePrintF may use multiple records depending on the number of data args.\r
+ ******************************************************************************/\r
+\r
+#define EVENT_BUFFER_SIZE 1000 /* Adjust wrt. to available RAM */\r
+\r
+\r
+/*******************************************************************************\r
+ * USE_LINKER_PRAGMA\r
+ *\r
+ * Macro which should be defined as an integer value, default is 0.\r
+ *\r
+ * If this is 1, the header file "recorderdata_linker_pragma.h" is included just\r
+ * before the declaration of RecorderData (in trcBase.c), i.e., the trace data \r
+ * structure. This allows the user to specify a pragma with linker options. \r
+ *\r
+ * Example (for IAR Embedded Workbench and NXP LPC17xx):\r
+ * #pragma location="AHB_RAM_MEMORY"\r
+ * \r
+ * This example instructs the IAR linker to place RecorderData in another RAM \r
+ * bank, the AHB RAM. This can also be used for other compilers with a similar\r
+ * pragmas for linker options.\r
+ * \r
+ * Note that this only applies if using static allocation, see below.\r
+ ******************************************************************************/\r
+\r
+#define USE_LINKER_PRAGMA 0\r
+\r
+\r
+/*******************************************************************************\r
+ * SYMBOL_TABLE_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the symbol table, in bytes. This symbol table \r
+ * stores User Events labels and names of deleted tasks, queues, or other kernel\r
+ * objects. Note that the names of active objects not stored here but in the \r
+ * Object Table. Thus, if you don't use User Events or delete any kernel \r
+ * objects you set this to zero (0) to minimize RAM usage.\r
+ ******************************************************************************/\r
+#define SYMBOL_TABLE_SIZE 1000\r
+\r
+/*******************************************************************************\r
+ * NTask, NISR, NQueue, NSemaphore, NMutex\r
+ *\r
+ * A group of Macros which should be defined as an integer value of zero (0) \r
+ * or larger.\r
+ *\r
+ * This defines the capacity of the Object Property Table - the maximum number\r
+ * of objects active at any given point within each object class.\r
+ * \r
+ * NOTE: In case objects are deleted and created during runtime, this setting\r
+ * does not limit the total amount of objects, only the number of concurrently\r
+ * active objects. \r
+ *\r
+ * Using too small values will give an error message through the vTraceError\r
+ * routine, which makes the error message appear when opening the trace data\r
+ * in FreeRTOS+Trace. If you are using the recorder status monitor task,\r
+ * any error messages are displayed in console prints, assuming that the\r
+ * print macro has been defined properly (vConsolePrintMessage). \r
+ *\r
+ * It can be wise to start with very large values for these constants, \r
+ * unless you are very confident on these numbers. Then do a recording and\r
+ * check the actual usage in FreeRTOS+Trace. This is shown by selecting\r
+ * View -> Trace Details -> Resource Usage -> Object Table\r
+ * \r
+ * NOTE 2: Remember to account for all tasks created by FreeRTOS, such as the \r
+ * IDLE task, the FreeRTOS timer task, and any tasks created by other 3rd party \r
+ * software components, such as communication stacks. The recorder also has an \r
+ * optional monitor task to account for, if this is used.\r
+ * Moreover, one task slot is used to indicate "(startup)", i.e., a fictive \r
+ * task that represent the time before the FreeRTOS scheduler starts. \r
+ * NTask should thus be at least 2-3 slots larger than your application task count.\r
+ *\r
+ * NOTE 3: The FreeRTOS timer task creates a Queue, that should be accounted \r
+ * for in NQueue.\r
+ ******************************************************************************/\r
+#define NTask             15\r
+#define NISR              4\r
+#define NQueue            3\r
+#define NSemaphore        4\r
+#define NMutex            2\r
+\r
+/* Maximum object name length for each class (includes zero termination) */\r
+#define NameLenTask       configMAX_TASK_NAME_LEN\r
+#define NameLenISR        10\r
+#define NameLenQueue      15\r
+#define NameLenSemaphore  15\r
+#define NameLenMutex      15\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION\r
+ *\r
+ * Macro which should be defined as a string.\r
+ *\r
+ * This string is stored in the trace and displayed in FreeRTOS+Trace. Can be\r
+ * used to store, e.g., system version or build date. This is also used to store\r
+ * internal error messages from the recorder, which if occurs overwrites the\r
+ * value defined here. This may be maximum 256 chars.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION "FreeRTOS+Trace Demo"\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION_MAX_LENGTH\r
+ *\r
+ * The maximum length (including zero termination) for the TRACE_DESCRIPTION\r
+ * string. Since this string also is used for internal error messages from the \r
+ * recorder do not make it too short, as this may truncate the error messages.\r
+ * Default is 80. \r
+ * Maximum allowed length is 256 - the trace will fail to load if longer.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION_MAX_LENGTH 80\r
+\r
+\r
+/******************************************************************************\r
+ * TRACE_DATA_ALLOCATION\r
+ *\r
+ * This defines how to allocate the recorder data structure, i.e., using a \r
+ * static declaration or using a dynamic allocation in runtime (malloc).\r
+ *\r
+ * Should be one of these two options:\r
+ * - TRACE_DATA_ALLOCATION_STATIC (default)\r
+ * - TRACE_DATA_ALLOCATION_DYNAMIC\r
+ *\r
+ * Using static allocation has the benefits of compile-time errors if the buffer \r
+ * is too large (too large constants in trcConfig.h) and no need to call the \r
+ * initialization routine (xTraceInitTraceData).\r
+ *\r
+ * Using dynamic allocation may give more flexibility in some cases.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_DATA_ALLOCATION TRACE_DATA_ALLOCATION_STATIC\r
+\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION REGARDING WHAT CODE/FEATURES TO INCLUDE\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * INCLUDE_FLOAT_SUPPORT\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), all references to floating point values are removed,\r
+ * in case floating point values are not supported by the platform used.\r
+ * Floating point values are only used in vTracePrintF and its subroutines, to \r
+ * store float (%f) or double (%lf) argments. \r
+ *\r
+ * Note: vTracePrintF can still be used with integer and string arguments in\r
+ * either case.\r
+ *****************************************************************************/\r
+#define INCLUDE_FLOAT_SUPPORT 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_USER_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0) the code for creating User Events is excluded to\r
+ * reduce code size. User Events are application-generated events, like \r
+ * "printf" but for the trace log instead of console output. User Events are \r
+ * much faster than a printf and can therefore be used in timing critical code.\r
+ * See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
+ * \r
+ * Note that FreeRTOS+Trace Standard Edition or Professional Edition is required\r
+ * for User Events, they are not displayed in FreeRTOS+Trace Free Edition.\r
+ *****************************************************************************/\r
+#define INCLUDE_USER_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_READY_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Ready events is \r
+ * excluded. Note, this will make it impossible to calculate the correct\r
+ * response times.\r
+ *****************************************************************************/\r
+#define INCLUDE_READY_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_ISR_TRACING\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Interrupt Service Routines is \r
+ * excluded to reduce code size. Note, recording ISRs require that you insert\r
+ * calls to vTraceStoreISRBegin and vTraceStoreISREnd in your interrupt handlers.\r
+ * There is no automatic recording of ISRs like for task scheduling, since \r
+ * FreeRTOS does not have a central interrupt dispatcher.\r
+ *****************************************************************************/\r
+#define INCLUDE_ISR_TRACING 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_OBJECT_DELETE\r
+ * \r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * This must be enabled (1) if tasks, queues or other \r
+ * traced kernel objects are deleted at runtime, e.g., using vTaskDelete or \r
+ * vQueueDelete. If no deletes are made, this can be set to 0 in order to\r
+ * exclude the delete-handling code. \r
+ *****************************************************************************/\r
+#define INCLUDE_OBJECT_DELETE 1\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION RELATED TO BEHAVIOR\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * RECORDER_STORE_MODE\r
+ *\r
+ * Macro which should be defined as one of:\r
+ * - STORE_MODE_RING_BUFFER\r
+ * - STORE_MODE_STOP_WHEN_FULL\r
+ * Default is STORE_MODE_RING_BUFFER.\r
+ *\r
+ * With RECORDER_STORE_MODE set to STORE_MODE_RING_BUFFER, the events are stored\r
+ * in a ring buffer, i.e., where the oldest events are overwritten when the\r
+ * buffer becomes full. This allows you to get the last events leading up to an\r
+ * interesting state, e.g., an error, without having a large trace buffer for\r
+ * string the whole run since startup. In this mode, the recorder can run\r
+ * "forever" as the buffer never gets full, i.e., in the sense that it always\r
+ * has room for more events.\r
+ *\r
+ * To fetch the trace in mode STORE_MODE_RING_BUFFER, you need to first halt the\r
+ * system using your debugger and then do a RAM dump, or to explicitly stop the\r
+ * recorder using vTraceStop() and then store/upload the trace data using a\r
+ * FreeRTOS task that you need to provide yourself. The trace data is found in\r
+ * the struct RecorderData, initialized in trcBase.c.\r
+ *\r
+ * Note that, if you upload the trace using a RAM dump, i.e., when the system is \r
+ * halted on a breakpoint or by a debugger command, there is no need to stop the \r
+ * recorder first.\r
+ *\r
+ * When RECORDER_STORE_MODE is STORE_MODE_STOP_WHEN_FULL, the recording is\r
+ * stopped when the buffer becomes full. When the recorder stops itself this way\r
+ * vTracePortEnd() is called which allows for custom actions, such as triggering\r
+ * a task that stores the trace buffer, i.e., in case taking a RAM dump\r
+ * using an on-chip debugger is not possible. In the Windows port, vTracePortEnd\r
+ * saves the trace to file directly, but this is not recommended in a real-time\r
+ * system since the scheduler is blocked during the processing of vTracePortEnd.\r
+ *****************************************************************************/\r
+#ifndef WIN32\r
+#define RECORDER_STORE_MODE STORE_MODE_RING_BUFFER\r
+#else\r
+/* Default in the Win32 demo */\r
+#define RECORDER_STORE_MODE STORE_MODE_STOP_WHEN_FULL\r
+#endif\r
+\r
+/******************************************************************************\r
+ * STOP_AFTER_N_EVENTS\r
+ *\r
+ * Macro which should be defined as an integer value, or not defined.\r
+ * Default is -1\r
+ *\r
+ * STOP_AFTER_N_EVENTS is intended for tests of the ring buffer mode (when\r
+ * RECORDER_STORE_MODE is STORE_MODE_RING_BUFFER). It stops the recording when\r
+ * the specified number of events has been observed. This value can be larger\r
+ * than the buffer size, to allow for test of the "wrapping around" that occurs\r
+ * in ring buffer mode . A negative value (or no definition of this macro)\r
+ * disables this feature.\r
+ *****************************************************************************/\r
+#define STOP_AFTER_N_EVENTS -1\r
+\r
+/******************************************************************************\r
+ * USE_IMPLICIT_IFE_RULES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * ### Instance Finish Events (IFE) ###\r
+ *\r
+ * For tasks with "infinite" main loops (non-terminating tasks), the concept\r
+ * of a task instance has no clear definition, it is an application-specific\r
+ * thing. FreeRTOS+Trace allows you to define Instance Finish Events (IFEs),\r
+ * which marks the point in a cyclic task when the "task instance" ends.\r
+ * The IFE is a blocking kernel call, typically in the main loop of a task\r
+ * which typically reads a message queue, waits for a semaphore or performs\r
+ * an explicit delay.\r
+ *\r
+ * If USE_IMPLICIT_IFE_RULES is one (1), the following FreeRTOS kernel calls\r
+ * are considered by default to be IFEs (Implicit IFEs):\r
+ *  - vTaskDelay\r
+ *  - vTaskDelayUntil\r
+ *  - vTaskSuspend\r
+ *  - xQueueReceive (blocking cases only)\r
+ *  - xSemaphoreTake (blocking cases only)\r
+ *\r
+ * However, Implicit IFEs only applies to blocking kernel calls. If an\r
+ * xQueueReceive reads a message without blocking, it does not create a new\r
+ * instance since no blocking occurred.\r
+ *\r
+ * Moreover, the actual IFE might sometimes be another blocking call such as\r
+ * xQueueSend or xSemaphoreGive. We therefore allow for user-defined\r
+ * Explicit IFEs by calling\r
+ *\r
+ *     vTraceTaskInstanceIsFinished()\r
+ *\r
+ * right before the kernel call considered as IFE. This does not create an\r
+ * additional event but instead stores the service code and object handle\r
+ * of the IFE call as properties of the task.\r
+ *\r
+ * If using Explicit IFEs and the task also calls an Implicit IFE like\r
+ * vTaskDelay, this may result in additional incorrect task instances.\r
+ * This is solved by disabling the Implicit IFEs for the task, by adding\r
+ * a call to\r
+ * \r
+ *     vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+ * \r
+ * in the very beginning of that task. This allows you to combine Explicit IFEs\r
+ * for some tasks with Implicit IFEs for the rest of the tasks, if\r
+ * USE_IMPLICIT_IFE_RULES is 1.\r
+ *\r
+ * By setting USE_IMPLICIT_IFE_RULES to zero (0), the implicit IFEs are disabled\r
+ * for all tasks. Tasks will then be considered to have a single instance only, \r
+ * covering all execution fragments, unless you define an explicit IFE in each\r
+ * task by calling vTraceTaskInstanceIsFinished before the blocking call.\r
+ *****************************************************************************/\r
+#define USE_IMPLICIT_IFE_RULES 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_SAVE_TO_FILE\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If enabled (1), the recorder will include code for saving the trace\r
+ * to a local file system.\r
+ ******************************************************************************/\r
+#ifdef WIN32\r
+    #define INCLUDE_SAVE_TO_FILE 1\r
+#else\r
+    #define INCLUDE_SAVE_TO_FILE 0\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PRIORITY\r
+ *\r
+ * Macro which sets the priority of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is tskIDLE_PRIORITY + 1\r
+ * Note that if your system constantly has a high CPU load from high-priority \r
+ * tasks, this might not be get a chance to execute.\r
+ * \r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_PRIORITY (tskIDLE_PRIORITY + 1)\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_STACKSIZE\r
+ *\r
+ * Macro which sets the stack size of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is intentionally \r
+ * excluded from the demo trace.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_STACKSIZE 500\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PERIOD\r
+ *\r
+ * Macro which sets the period of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is 1000 FreeRTOS ticks (typically 1 second). On the Windows port, a \r
+ * lower value is suggested since the Windows port runs very slowly, often 20-40\r
+ * times slower than the simulated FreeRTOS time.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#ifdef WIN32\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 100\r
+#else\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TEAM_LICENSE_CODE\r
+ *\r
+ * Macro which defines a string - the team license code.\r
+ * If no team license is available, this should be an empty string "".\r
+ * This should be maximum 32 chars, including zero-termination.\r
+ *****************************************************************************/\r
+#define TEAM_LICENSE_CODE ""\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcPort.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Configuration - template/trcPort.h
new file mode 100644 (file)
index 0000000..a2d4bf1
--- /dev/null
@@ -0,0 +1,490 @@
+/******************************************************************************* \r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.h\r
+ *\r
+ * Contains together with trcPort.c all portability issues of the trace recorder \r
+ * library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCPORT_H\r
+#define TRCPORT_H\r
+\r
+/* If FreeRTOS Win32 port */\r
+#ifdef WIN32\r
+\r
+   #undef _WIN32_WINNT\r
+   #define _WIN32_WINNT 0x0600\r
+\r
+   /* Standard includes. */\r
+   #include <stdio.h>\r
+   #include <windows.h>\r
+   #include <direct.h>\r
+\r
+/*******************************************************************************\r
+ * The Win32 port by default saves the trace to file and then kills the\r
+ * program when the recorder is stopped, to facilitate quick, simple tests\r
+ * of the recorder.\r
+ ******************************************************************************/\r
+   #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
+   #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
+\r
+#endif\r
+\r
+#define DIRECTION_INCREMENTING 1\r
+#define DIRECTION_DECREMENTING 2\r
+\r
+/******************************************************************************\r
+ * Supported ports\r
+ * \r
+ * PORT_HWIndependent\r
+ * A hardware independent fallback option for event timestamping. Provides low \r
+ * resolution timestamps based on the OS tick.\r
+ * This may be used on the Win32 port, but may also be used on embedded hardware \r
+ * platforms. Note that this gives suboptimal display in FreeRTOS+Trace. All \r
+ * time durations will be truncated to the OS tick frequency, typically 1 KHz. \r
+ * This means that a task or ISR that executes in less than 1 ms get an exection \r
+ * time of zero. They are however still visible in FreeRTOS+Trace. \r
+ *\r
+ * PORT_Win32\r
+ * "Accurate" timestamping based on the Windows permance counter. Note that\r
+ * this gives the host machine time, not the simulated FreeRTOS time (tick \r
+ * count). The timing of the Win32 FreeRTOS build is not real-time, since it \r
+ * depends on the scheduling and tick rate of Windows, which is very slow.\r
+ *\r
+ * Officially supported hardware timer ports:\r
+ * - PORT_Atmel_AT91SAM7\r
+ * - PORT_Atmel_UC3A0\r
+ * - PORT_ARM_CortexM \r
+ * - PORT_Renesas_RX600\r
+ * - PORT_Microchip_dsPIC_AND_PIC24\r
+ *\r
+ * We also provide several "unofficial" hardware-specific ports. There have \r
+ * been developed by external contributors, and have not yet been verified \r
+ * by Percepio AB. Let us know if you have problems getting these to work.\r
+ * \r
+ * Unoffical hardware specific ports provided are:\r
+ * - PORT_TEXAS_INSTRUMENTS_TMS570\r
+ * - PORT_TEXAS_INSTRUMENTS_MSP430\r
+ * - PORT_MICROCHIP_PIC32\r
+ * - PORT_XILINX_PPC405\r
+ * - PORT_XILINX_PPC440\r
+ * - PORT_XILINX_MICROBLAZE\r
+ * - PORT_NXP_LPC210X\r
+ *\r
+ *****************************************************************************/\r
+\r
+#define PORT_NOT_SET                          -1\r
+\r
+/*** Officially supported hardware timer ports *******************************/\r
+#define PORT_HWIndependent                     0\r
+#define PORT_Win32                             1\r
+#define PORT_Atmel_AT91SAM7                    2\r
+#define PORT_Atmel_UC3A0                       3\r
+#define PORT_ARM_CortexM                       4\r
+#define PORT_Renesas_RX600                     5\r
+#define PORT_Microchip_dsPIC_AND_PIC24         6\r
+\r
+/*** Unofficial ports, provided by external developers, not yet verified *****/\r
+#define PORT_TEXAS_INSTRUMENTS_TMS570          7\r
+#define PORT_TEXAS_INSTRUMENTS_MSP430          8\r
+#define PORT_MICROCHIP_PIC32                   9\r
+#define PORT_XILINX_PPC405                    10\r
+#define PORT_XILINX_PPC440                    11\r
+#define PORT_XILINX_MICROBLAZE                12\r
+#define PORT_NXP_LPC210X                      13\r
+\r
+/*** Select your port here! **************************************************/\r
+#define SELECTED_PORT PORT_NOT_SET\r
+/*****************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET) \r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * IRQ_PRIORITY_ORDER\r
+ *\r
+ * Macro which should be defined as an integer of 0 or 1.\r
+ *\r
+ * This should be 0 if lower irq priority values implies higher priority \r
+ * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+ * if higher irq priority values means higher priority, this should be 1.\r
+ *\r
+ * This setting is not critical. It is used only to sort and colorize the \r
+ * interrupts in priority order, in case you record interrupts using\r
+ * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
+ *\r
+ * We provide this setting for some hardware architectures below:\r
+ * - ARM Cortex M:       0 (lower irq priority values are more significant)\r
+ * - Atmel AT91SAM7x:    1 (higher irq priority values are more significant)\r
+ * - Atmel AVR32:        1 (higher irq priority values are more significant)\r
+ * - Renesas RX600:      1 (higher irq priority values are more significant)\r
+ * - Microchip PIC24:    0 (lower irq priority values are more significant)\r
+ * - Microchip dsPIC:    0 (lower irq priority values are more significant)\r
+ * - TI TMS570:          0 (lower irq priority values are more significant)\r
+ * - Freescale HCS08:    0 (lower irq priority values are more significant)\r
+ * - Freescale HCS12:    0 (lower irq priority values are more significant)\r
+ * - PowerPC 405:        0 (lower irq priority values are more significant)\r
+ * - PowerPC 440:        0 (lower irq priority values are more significant)\r
+ * - Freescale ColdFire: 1 (higher irq priority values are more significant)\r
+ * - NXP LPC210x:        0 (lower irq priority values are more significant)\r
+ * - MicroBlaze:        0  (lower irq priority values are more significant)\r
+ *\r
+ * If your chip is not on the above list, and you perhaps know this detail by \r
+ * heart, please inform us by e-mail to support@percepio.com.\r
+ *\r
+ ******************************************************************************\r
+ *\r
+ * HWTC Macros \r
+ *\r
+ * These four HWTC macros provides a hardware isolation layer representing a \r
+ * generic hardware timer/counter used for driving the operating system tick, \r
+ * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
+ * AT91SAM7X.\r
+ *\r
+ * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
+ * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
+ * already wrapped.\r
+ *\r
+ * HWTC_COUNT_DIRECTION: Should be one of:\r
+ * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
+ *   such as the PIT on Atmel AT91SAM7X.\r
+ *   When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
+ *   interrupt is signaled.\r
+ * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
+ *   such as the SysTick on ARM Cortex M3/M4 chips.\r
+ *   When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
+ *   interrupt is signaled.\r
+ *\r
+ * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
+ * two tick interrupts. This should preferably be mapped to the reload\r
+ * register of the hardware timer, to make it more portable between chips in the \r
+ * same family. The macro should in most cases be (reload register + 1).\r
+ *\r
+ * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
+ * (where the SysTick runs at the core clock frequency), the "differential \r
+ * timestamping" used in the recorder will more frequently insert extra XTS \r
+ * events to store the timestamps, which increases the event buffer usage. \r
+ * In such cases, to reduce the number of XTS events and thereby get longer \r
+ * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
+ * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
+ * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
+ * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
+ * faster chip require a higher HWTC_DIVISOR value. \r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * FREE LICENSE OFFER FROM PERCEPIO\r
+ *\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students,\r
+ * hobbyists or early-phase startups) we have the following offer: \r
+ * Provide a hardware port for our FreeRTOS recorder and get a FREE single-user\r
+ * license for FreeRTOS+Trace Professional Edition. Read more about this offer\r
+ * at www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_Win32)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
+    #define HWTC_PERIOD 0\r
+    #define HWTC_DIVISOR 1\r
+    \r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_HWIndependent)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT 0\r
+    #define HWTC_PERIOD 1\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+\r
+    /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
+    A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
+    #define HWTC_PERIOD 2995 \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
+  \r
+    /* For Atmel AVR32 (AT32UC3A) */\r
+  \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+    /* For all chips using ARM Cortex M cores */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
+    #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
+    #define HWTC_DIVISOR 2\r
+    \r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Renesas_RX600)    \r
+\r
+    #include "iodefine.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (CMT0.CMCNT)\r
+    #define HWTC_PERIOD ((((configPERIPHERAL_CLOCK_HZ/configTICK_RATE_HZ)-1)/8))\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_dsPIC_AND_PIC24) \r
+\r
+    /* For Microchip PIC24 and dsPIC (16 bit) */\r
+\r
+    /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
+       than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 Âµs. \r
+       In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
+       becomes a problem on PIC24, use the filters to exclude less interresting tasks \r
+       or system calls. */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TMR1)\r
+    #define HWTC_PERIOD (PR1+1)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+    \r
+    /* Tested with LPC2106, but should work with most LPC21XX chips.\r
+       Assumption: prescaler is 1:1 (this setting is hardcoded in \r
+       FreeRTOS port for LPC21XX) */\r
+      \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT  *((uint32_t *)0xE0004008 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) \r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
+    #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
+    #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
+    #define HWTC_PERIOD (RTIUDCP0)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TA0R)\r
+    #define HWTC_PERIOD configCPU_CLOCKS_PER_TICK      \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ReadTimer1())     /* Should be available in BSP */\r
+    #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x3db)\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most PowerPC chips */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x016 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+    \r
+#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most Microblaze configurations\r
+     * This port is based on the official FreeRTOS Microlaze port and example application.\r
+     * It uses the AXI Timer 0 - the tick interrupt source.\r
+     * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
+     */\r
+    #include "xtmrctr_l.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
+    #define HWTC_PERIOD ( configCPU_CLOCK_HZ / configTICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 16\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower irq priority values are more significant\r
+\r
+#elif (SELECTED_PORT != PORT_NOT_SET)\r
+\r
+    #error "SELECTED_PORT had unsupported value!"\r
+    #define SELECTED_PORT PORT_NOT_SET\r
+\r
+#endif\r
+\r
+#if (SELECTED_PORT != PORT_NOT_SET)\r
+    \r
+    #ifndef HWTC_COUNT_DIRECTION\r
+    #error "HWTC_COUNT_DIRECTION is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_COUNT\r
+    #error "HWTC_COUNT is not set!"    \r
+    #endif \r
+    \r
+    #ifndef HWTC_PERIOD\r
+    #error "HWTC_PERIOD is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_DIVISOR\r
+    #error "HWTC_DIVISOR is not set!"    \r
+    #endif \r
+    \r
+    #ifndef IRQ_PRIORITY_ORDER\r
+    #error "IRQ_PRIORITY_ORDER is not set!"\r
+    #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
+    #error "IRQ_PRIORITY_ORDER has bad value!"\r
+    #endif \r
+    \r
+    #if (HWTC_DIVISOR < 1)\r
+    #error "HWTC_DIVISOR must be a non-zero positive value!"\r
+    #endif \r
+\r
+#endif\r
+/*******************************************************************************\r
+ * vTraceConsoleMessage\r
+ *\r
+ * A wrapper for your system-specific console "printf" console output function.\r
+ * This needs to be correctly defined to see status reports from the trace \r
+ * status monitor task (this is defined in trcUser.c).\r
+ ******************************************************************************/         \r
+#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+/* Port specific includes */\r
+#include "console.h"\r
+#endif\r
+\r
+#define vTraceConsoleMessage(x)\r
+\r
+/*******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, \r
+ * students, hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called when the recorder is stopped due to full buffer.\r
+ * Mainly intended to show a message in the console.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetFileName.\r
+ ******************************************************************************/\r
+void vTracePortEnd(void);\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path);\r
+\r
+/******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a target-side file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port may call\r
+ * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
+ ******************************************************************************/\r
+void vTracePortSave(void);\r
+\r
+#endif\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcBase.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcBase.h
new file mode 100644 (file)
index 0000000..4ffd55c
--- /dev/null
@@ -0,0 +1,524 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcBase.h\r
+ *\r
+ * Core functionallity of the FreeRTOS+Trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ * \r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCBASE_H\r
+#define TRCBASE_H\r
+\r
+#include <stdio.h>\r
+#include <string.h>\r
+\r
+#include "FreeRTOS.h"\r
+#include "trcConfig.h"\r
+#include "trcTypes.h"\r
+#include "trcPort.h"\r
+\r
+extern volatile int recorder_busy;\r
+\r
+#define trcCRITICAL_SECTION_BEGIN() {taskENTER_CRITICAL(); recorder_busy++;}\r
+#define trcCRITICAL_SECTION_END() {recorder_busy--; taskEXIT_CRITICAL();}\r
+\r
+#define NCLASSES 5\r
+#define VERSION 0x1AA1\r
+#define MINOR_VERSION 1\r
+#define STORE_MODE_STOP_WHEN_FULL 1\r
+#define STORE_MODE_RING_BUFFER 2\r
+#define TRACE_DATA_ALLOCATION_STATIC 1\r
+#define TRACE_DATA_ALLOCATION_DYNAMIC 2\r
+\r
+/******************************************************************************\r
+ * Object Property Table\r
+ * The Object Table contains name and other properties of the objects (tasks,\r
+ * queues, mutexes, etc). The below data structures defines the properties of\r
+ * each object class and are used to cast the byte buffer into a cleaner format.\r
+ *\r
+ * The values in the object table are continously overwritten and always \r
+ * represent the current state. If a property is changed during runtime, the OLD \r
+ * value should be stored in the trace buffer, not the new value (since the new \r
+ * value is found in the Object Property Table).\r
+ * For close events this mechanism is the old names are stored in the symbol\r
+ * table), for "priority set" (the old priority is stored in the event data)\r
+ * and for "isActive", where the value decides is the taskswitch event type\r
+ * should be "new" or "resume".\r
+ ******************************************************************************/\r
+\r
+/* The size of the Object Property Table entries, in bytes, per object */\r
+\r
+/* Queue properties (except name):     current number of message in queue */\r
+#define PropertyTableSizeQueue         (NameLenQueue + 1)      \r
+\r
+/* Semaphore properties (except name): state (signaled = 1, cleared = 0) */\r
+#define PropertyTableSizeSemaphore     (NameLenSemaphore + 1) \r
+\r
+/* Mutex properties (except name):     owner (task handle, 0 = free) */\r
+#define PropertyTableSizeMutex         (NameLenMutex + 1)         \r
+\r
+/* Task properties (except name):      Byte 0: Current priority\r
+                                       Byte 1: state (if already active) \r
+                                       Byte 2: InstanceFinishEvent_ServiceCode\r
+                                       Byte 3: InstanceFinishEvent_ObjHandle */\r
+#define PropertyTableSizeTask         (NameLenTask + 4)\r
+\r
+/* ISR properties:                     Byte 0: priority\r
+                                       Byte 1: state (if already active) */\r
+#define PropertyTableSizeISR          (NameLenISR + 2)\r
+\r
+/* The layout of the byte array representing the Object Property Table */\r
+#define StartIndexQueue            0\r
+#define StartIndexSemaphore        StartIndexQueue     + NQueue * PropertyTableSizeQueue\r
+#define StartIndexMutex            StartIndexSemaphore + NSemaphore * PropertyTableSizeSemaphore\r
+#define StartIndexTask             StartIndexMutex     + NMutex * PropertyTableSizeMutex\r
+#define StartIndexISR              StartIndexTask      + NTask * PropertyTableSizeTask\r
+#define DynObjTableSize            StartIndexISR       + NISR * PropertyTableSizeISR\r
+\r
+typedef struct\r
+{\r
+    /* = NCLASSES */\r
+    uint32_t NumberOfObjectClasses;\r
+    \r
+    uint32_t ObjectPropertyTableSizeInBytes;\r
+        \r
+    /* This is used to calculate the index in the dynamic object table \r
+    (handle - 1 - nofStaticObjects = index)*/\r
+    uint8_t NumberOfObjectsPerClass[ 4*((NCLASSES+3)/4)];      \r
+\r
+    /* Allocation size rounded up to the closest multiple of 4 */    \r
+    uint8_t NameLengthPerClass[ 4*((NCLASSES+3)/4) ];\r
+    \r
+    uint8_t TotalPropertyBytesPerClass[ 4*((NCLASSES+3)/4) ];\r
+    \r
+    /* Allocation size rounded up to the closest multiple of 2 */\r
+    uint16_t StartIndexOfClass[ 2*((NCLASSES+1)/2) ];\r
+\r
+    /* The actual handles issued, should be Initiated to all zeros */     \r
+    uint8_t objbytes[ 4*((DynObjTableSize+3)/4) ];\r
+} ObjectPropertyTableType;\r
+\r
+/* Symbol table data structure */\r
+typedef struct\r
+{\r
+    /* = SYMBOL_HISTORY_TABLE_SIZE_IN_BYTES */\r
+    uint32_t symTableSize;                       \r
+        \r
+    /* Entry 0 is reserved. Any reference to entry 0 implies NULL*/\r
+    uint32_t nextFreeSymbolIndex;         \r
+        \r
+    /* Size rounded up to closest multiple of 4, to avoid alignment issues*/\r
+    uint8_t symbytes[4*((SYMBOL_TABLE_SIZE+3)/4)];           \r
+        \r
+    /* Used for lookups - Up to 64 linked lists within the symbol table \r
+    connecting all entries with the same 6 bit checksum. \r
+    This field holds the current list heads. Should be initiated to zeros */\r
+    uint16_t latestEntryOfChecksum[64];              \r
+} symbolTableType;\r
+\r
+\r
+/*******************************************************************************\r
+ * The data structures of the different events, all 4 bytes long \r
+ ******************************************************************************/\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;                \r
+    objectHandleType objHandle;\r
+    uint16_t dts;    /* differential timestamp - time since last event */            \r
+} TSEvent, TREvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t objHandle;\r
+    uint16_t dts;\r
+} KernelCall;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    objectHandleType objHandle;\r
+    uint8_t param;\r
+    uint8_t dts;                \r
+} KernelCallWithParamAndHandle;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t dts;                \r
+    uint16_t param;\r
+} KernelCallWithParam16;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    objectHandleType objHandle;    /* the handle of the closed object */\r
+    uint16_t symbolIndex;          /* the name of the closed object */\r
+} ObjCloseNameEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t arg1;            \r
+    uint8_t arg2;        \r
+    uint8_t arg3;        \r
+} ObjClosePropEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;\r
+    uint8_t dts;                \r
+    uint16_t payload;         /* the name of the user event */\r
+} UserEvent;\r
+\r
+typedef struct\r
+{\r
+    uint8_t type;            \r
+    \r
+    /* 8 bits extra for storing DTS, if it does not fit in ordinary event \r
+    (this one is always MSB if used) */\r
+    uint8_t xts_8;            \r
+    \r
+    /* 16 bits extra for storing DTS, if it does not fit in ordinary event. */\r
+    uint16_t xts_16;          \r
+} XTSEvent;\r
+\r
+\r
+/*******************************************************************************\r
+ * The main datastructure, read by FreeRTOS+Trace from the RAM dump\r
+ ******************************************************************************/\r
+\r
+typedef struct\r
+{    \r
+    uint8_t startmarker0;\r
+    uint8_t startmarker1;\r
+    uint8_t startmarker2;\r
+    uint8_t startmarker3;\r
+    uint8_t startmarker4;\r
+    uint8_t startmarker5;\r
+    uint8_t startmarker6;\r
+    uint8_t startmarker7;\r
+    uint8_t startmarker8;\r
+    uint8_t startmarker9;\r
+    uint8_t startmarker10;\r
+    uint8_t startmarker11;\r
+\r
+    /* For FreeRTOS: 0x1AA1 */\r
+    uint16_t version;     \r
+    \r
+    /* Currently 1 for v2.2.2 (0 earlier)*/\r
+    uint8_t minor_version;\r
+    \r
+    /* This should be 0 if lower irq priority values implies higher priority \r
+    levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+    if higher irq priority values means higher priority, this should be 1. */ \r
+    uint8_t irq_priority_order;\r
+            \r
+    /* sizeof(RecorderDataType) - just for control */\r
+    uint32_t filesize;\r
+            \r
+    /* Current number of events recorded */\r
+    uint32_t numEvents;\r
+\r
+    /* The buffer size, in number of event records */\r
+    uint32_t maxEvents;\r
+        \r
+    /* The event buffer index, where to write the next event */\r
+    uint32_t nextFreeIndex;\r
+        \r
+    /* 1 if the buffer is full, 0 otherwise */\r
+    uint32_t bufferIsFull;\r
+\r
+    /* The frequency of the clock/timer/counter used as time base */\r
+    uint32_t frequency;\r
+\r
+    /* The absolute timestamp of the last stored event, in the native \r
+    timebase, modulo frequency! */\r
+    uint32_t absTimeLastEvent;    \r
+    \r
+    /* The number of seconds in total - lasts for 136 years */\r
+    uint32_t absTimeLastEventSecond;    \r
+    \r
+    /* 1 if the recorder has been started, 0 if not yet started or stopped.\r
+    This is a 32 bit variable due to alignment issues. */\r
+    uint32_t recorderActive;      \r
+\r
+    /* For storing a Team License key */\r
+    uint8_t teamLicenceKey[32];\r
+\r
+    /* 0xF0F0F0F0 - for control only */\r
+    int32_t debugMarker0;                    \r
+\r
+    /* The Object Property Table holds information about currently active\r
+    tasks, queues, and other recorded objects. This is updated on each\r
+    create call and includes object name and other properties. */\r
+    ObjectPropertyTableType ObjectPropertyTable;\r
+\r
+    /* 0xF1F1F1F1 - for control only */ \r
+    int32_t debugMarker1;                    \r
+\r
+    /* The Symbol Table stores strings for User Events and is also used to \r
+    store names of deleted objects, which still may be in the trace but no \r
+    longer are available. */        \r
+    symbolTableType SymbolTable;\r
+\r
+    /* For includsion of float support, and for endian detection of floats. \r
+    The value should be (float)1 or (uint32_t)0 */    \r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    float exampleFloatEncoding;              \r
+#else\r
+    uint32_t exampleFloatEncoding;              \r
+#endif\r
+    /* This is non-zero if an internal error occured in the recorder, e.g., if\r
+    one of the Nxxx constants was too small. The systemInfo string will then \r
+    contain an error message that is displayed when attempting to view the \r
+    trace file. */\r
+    uint32_t internalErrorOccured;\r
+    \r
+    /* 0xF2F2F2F2 - for control only */ \r
+    int32_t debugMarker2;                    \r
+      \r
+    /* Generic system information string, presented in the tool. Note that this \r
+    is also used for storing any internal error messages from the recorder, so\r
+    do not make TRACE_DESCRIPTION_MAX_LENGTH too small. 80 is recommended. */\r
+    char systemInfo[TRACE_DESCRIPTION_MAX_LENGTH];                   \r
+\r
+    /* 0xF3F3F3F3 - for control only */\r
+    int32_t debugMarker3;                    \r
+\r
+    /* The event data, in 4-byte records */\r
+    uint8_t eventData[ EVENT_BUFFER_SIZE * 4 ];\r
+\r
+    uint8_t endmarker0;\r
+    uint8_t endmarker1;\r
+    uint8_t endmarker2;\r
+    uint8_t endmarker3;\r
+    uint8_t endmarker4;\r
+    uint8_t endmarker5;\r
+    uint8_t endmarker6;\r
+    uint8_t endmarker7;\r
+    uint8_t endmarker8;\r
+    uint8_t endmarker9;\r
+    uint8_t endmarker10;\r
+    uint8_t endmarker11;\r
+\r
+} RecorderDataType;\r
+\r
+extern RecorderDataType* RecorderDataPtr;\r
+\r
+/******************************************************************************\r
+ * ObjectHandleStack\r
+ * This data-structure is used to provide a mechanism for 1-byte trace object\r
+ * handles. This way, only 1 byte is necessary instead of 4 bytes (a pointer)\r
+ * when storing a reference to an object. This allows for up to 255 objects of\r
+ * each object class - Task, ISR, Semaphore, CountingSemaphore, Mutex and Queue,\r
+ * active at any given moment. There can be more "historic" objects, that have\r
+ * been deleted - that number is only limited by the size of the symbol table.\r
+ * Note that handle zero (0) is not used, it is a code for an invalid handle.\r
+ *\r
+ * This data structure keeps track of the FREE handles, not the handles in use.\r
+ * This datastructure contains one stack per object class. When a handle is\r
+ * allocated to an object, the next free handle is popped from the stack. When\r
+ * a handle is released (on object delete), it is pushed back on the stack.\r
+ * Note that there is no initialization code that pushed the free handles\r
+ * initially, that is not necessary due to the following optimization:\r
+ *\r
+ * The stack of handles (objectHandles) is initially all zeros. Since zero\r
+ * is not a valid handle, that is a signal of additional handles needed.\r
+ * If a zero is received when popping a new handle, it is replaced by the\r
+ * index of the popped handle instead.\r
+ *\r
+ *****************************************************************************/\r
+typedef struct\r
+{\r
+    /* For each object class, the index of the next handle to allocate */\r
+    int16_t indexOfNextAvailableHandle[ NCLASSES ];              \r
+\r
+    /* The lowest index of this class (constant) */        \r
+    int16_t lowestIndexOfClass[ NCLASSES ];                    \r
+        \r
+    /* The highest index of this class (constant) */\r
+    int16_t highestIndexOfClass[ NCLASSES ];    \r
+        \r
+    /* The highest use count for this class (for statistics) */\r
+    int16_t handleCountWaterMarksOfClass[ NCLASSES ];                \r
+        \r
+    /* The free object handles - a set of stacks within this array */\r
+    objectHandleType objectHandles[ NTask+NISR+NSemaphore+NMutex+NQueue ];\r
+\r
+} objectHandleStackType;\r
+\r
+/* Internal data */\r
+\r
+extern objectHandleStackType objectHandleStacks;\r
+\r
+/* Structures to handle the exclude flags for all objects, tasks and event codes */\r
+#define NEventCodes 0x100\r
+extern uint8_t excludedFlags[(NEventCodes+NQueue+NSemaphore+NMutex+NTask) / 8 + 1];\r
+extern uint8_t ifeFlags[NTask / 8 + 1];\r
+\r
+/* Internal functions */\r
+\r
+uint16_t prvTraceGetDTS(uint16_t param_maxDTS);\r
+\r
+void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength);\r
+\r
+traceLabel prvTraceCreateSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel channel);\r
+\r
+traceLabel prvTraceLookupSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel channel);\r
+\r
+traceLabel prvTraceOpenSymbol(const char* name, traceLabel userEventChannel);\r
+\r
+void prvTraceUpdateCounters(void);\r
+\r
+void prvCheckDataToBeOverwrittenForMultiEntryUserEvents(uint8_t nEntries);\r
+\r
+objectHandleType xTraceGetObjectHandle(traceObjectClass objectclass);\r
+\r
+void vTraceFreeObjectHandle(traceObjectClass objectclass, \r
+                            objectHandleType handle);\r
+\r
+void vTraceSetObjectName(traceObjectClass objectclass, \r
+                         objectHandleType handle, \r
+                         const char* name);\r
+\r
+void* xTraceNextFreeEventBufferSlot(void);\r
+\r
+uint16_t uiIndexOfObject(objectHandleType objecthandle, \r
+    uint8_t objectclass);\r
+\r
+\r
+/*******************************************************************************\r
+ * vTraceError\r
+ *\r
+ * Called by various parts in the recorder. Stops the recorder and stores a \r
+ * pointer to an error message, which is printed by the monitor task.\r
+ ******************************************************************************/\r
+void vTraceError(const char* msg);\r
+\r
+/*******************************************************************************\r
+ * xTraceGetLastError\r
+ *\r
+ * Gives the last error message, if any. NULL if no error message is stored.\r
+ * The message is cleared on read.\r
+ ******************************************************************************/\r
+char* xTraceGetLastError(void);\r
+\r
+/*******************************************************************************\r
+ * xTraceInitTraceData\r
+ *\r
+ * Allocates and initializes the recorder datastructure, based on the constants\r
+ * in trcConfig.h. This allows for allocating the data on the heap, instead of\r
+ * using a static declaration.\r
+ ******************************************************************************/\r
+RecorderDataType* xTraceInitTraceData(void);\r
+\r
+/* Internal macros */\r
+\r
+#define PROPERTY_NAME_GET(objectclass, objecthandle) \\r
+(const char*)(& RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(objecthandle, objectclass)])\r
+\r
+#define PROPERTY_OBJECT_STATE(objectclass, handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes[uiIndexOfObject(handle, objectclass) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[objectclass]]\r
+\r
+#define PROPERTY_ACTOR_PRIORITY(objectclass, handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes[uiIndexOfObject(handle, objectclass) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[objectclass] + 1]\r
+\r
+#define PROPERTY_TASK_IFE_SERVICECODE(handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(handle, TRACE_CLASS_TASK) \\r
++ RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[TRACE_CLASS_TASK]+2]\r
+\r
+#define PROPERTY_TASK_IFE_OBJHANDLE(handle) \\r
+RecorderDataPtr->ObjectPropertyTable.objbytes \\r
+[uiIndexOfObject(handle, TRACE_CLASS_TASK) \\r
++  RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[TRACE_CLASS_TASK]+3]\r
+\r
+#define SET_FLAG_ISEXCLUDED(bitIndex) excludedFlags[(bitIndex) >> 3] |= (1 << ((bitIndex) & 7))\r
+#define CLEAR_FLAG_ISEXCLUDED(bitIndex) excludedFlags[(bitIndex) >> 3] &= ~(1 << ((bitIndex) & 7))\r
+#define GET_FLAG_ISEXCLUDED(bitIndex) (excludedFlags[(bitIndex) >> 3] & (1 << ((bitIndex) & 7)))\r
+\r
+#define SET_FLAG_MARKIFE(bitIndex) ifeFlags[(bitIndex) >> 3] |= (1 << ((bitIndex) & 7))\r
+#define CLEAR_FLAG_MARKIFE(bitIndex) ifeFlags[(bitIndex) >> 3] &= ~(1 << ((bitIndex) & 7))\r
+#define GET_FLAG_MARKIFE(bitIndex) (ifeFlags[(bitIndex) >> 3] & (1 << ((bitIndex) & 7)))\r
+\r
+#define SET_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) SET_FLAG_ISEXCLUDED(eventCode)\r
+#define CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) CLEAR_FLAG_ISEXCLUDED(eventCode)\r
+#define GET_EVENT_CODE_FLAG_ISEXCLUDED(eventCode) GET_FLAG_ISEXCLUDED(eventCode)\r
+\r
+#define SET_QUEUE_FLAG_ISEXCLUDED(queueHandle) SET_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+#define CLEAR_QUEUE_FLAG_ISEXCLUDED(queueHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+#define GET_QUEUE_FLAG_ISEXCLUDED(queueHandle) GET_FLAG_ISEXCLUDED(NEventCodes+queueHandle-1)\r
+\r
+#define SET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+#define CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+#define GET_SEMAPHORE_FLAG_ISEXCLUDED(semaphoreHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+semaphoreHandle-1)\r
+\r
+#define SET_MUTEX_FLAG_ISEXCLUDED(mutexHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+#define CLEAR_MUTEX_FLAG_ISEXCLUDED(mutexHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+#define GET_MUTEX_FLAG_ISEXCLUDED(mutexHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+mutexHandle-1)\r
+\r
+#define SET_TASK_FLAG_ISEXCLUDED(taskHandle) SET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+#define CLEAR_TASK_FLAG_ISEXCLUDED(taskHandle) CLEAR_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+#define GET_TASK_FLAG_ISEXCLUDED(taskHandle) GET_FLAG_ISEXCLUDED(NEventCodes+NQueue+NSemaphore+NMutex+taskHandle-1)\r
+\r
+#define SET_TASK_FLAG_MARKIFE(bitIndex) SET_FLAG_MARKIFE(bitIndex-1)\r
+#define CLEAR_TASK_FLAG_MARKIFE(bitIndex) CLEAR_FLAG_MARKIFE(bitIndex-1)\r
+#define GET_TASK_FLAG_MARKIFE(bitIndex) GET_FLAG_MARKIFE(bitIndex-1)\r
+\r
+/* For debug printouts - the names of the object classes */\r
+extern char OBJECTCLASSNAME[NCLASSES][10];\r
+/*=\r
+{\r
+        "QUEUE"\r
+        "SEMAPHORE",\r
+        "MUTEX",\r
+        "TASK",\r
+        "ISR"\r
+};*/\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcHooks.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcHooks.h
new file mode 100644 (file)
index 0000000..c5fc9a4
--- /dev/null
@@ -0,0 +1,308 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcHooks.h\r
+ *\r
+ * The kernel integration hooks for FreeRTOS (v7.1.0 or later). This file should\r
+ * be included in the end of FreeRTOSConfig.h, together with:\r
+ *\r
+ * #define configUSE_TRACE_FACILITY 1\r
+ *\r
+ * NOTE: \r
+ * For IAR Embedded Workbench for ARM, you need to have a preprocessor condition\r
+ * on the include, to except it from the assembler step which otherwise give\r
+ * compile-time errors.\r
+ *\r
+ * #ifdef __ICCARM__\r
+ *       #include "percepio/Include/trcHooks.h"\r
+ * #endif\r
+ * \r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCHOOKS_H\r
+#define TRCHOOKS_H\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+    #include "trcUser.h"\r
+       \r
+    #undef INCLUDE_xTaskGetSchedulerState\r
+    #define INCLUDE_xTaskGetSchedulerState 1\r
+       \r
+    #undef INCLUDE_xTaskGetCurrentTaskHandle\r
+    #define INCLUDE_xTaskGetCurrentTaskHandle 1\r
+       \r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+    /* Called for each task that becomes ready */\r
+    #undef traceMOVED_TASK_TO_READY_STATE\r
+    #define traceMOVED_TASK_TO_READY_STATE( pxTCB ) \\r
+    vTraceStoreTaskReady((unsigned char)pxTCB->uxTaskNumber);\r
+#endif\r
+       \r
+    /* Called on each OS tick. Will call uiPortGetTimestamp to make sure it is called at least once every OS tick. */\r
+    #undef traceTASK_INCREMENT_TICK\r
+    #define traceTASK_INCREMENT_TICK( xTickCount ) \\r
+      if (uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdTRUE || uxMissedTicks == 0) {extern uint32_t uiTraceTickCount; uiTraceTickCount++; uiTracePortGetTimeStamp(0);}\r
+\r
+    /* Called on each task-switch */\r
+    #undef traceTASK_SWITCHED_IN\r
+    #define traceTASK_SWITCHED_IN() \\r
+      vTraceStoreTaskswitch();\r
+\r
+    /* Called on vTaskSuspend */\r
+    #undef traceTASK_SUSPEND\r
+    #define traceTASK_SUSPEND( pxTaskToSuspend ) \\r
+      vTraceStoreKernelCall(TASK_SUSPEND, TRACE_CLASS_TASK, pxTaskToSuspend->uxTaskNumber); \\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxTaskToSuspend->uxTaskNumber);\r
+\r
+    /* Called on vTaskDelay - note the use of FreeRTOS variable xTicksToDelay */\r
+    #undef traceTASK_DELAY\r
+    #define traceTASK_DELAY() \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCallWithNumericParamOnly(TASK_DELAY, (uint16_t)xTicksToDelay);\\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxCurrentTCB->uxTaskNumber);\\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called on vTaskDelayUntil - note the use of FreeRTOS variable xTimeToWake */\r
+    #undef traceTASK_DELAY_UNTIL\r
+    #define traceTASK_DELAY_UNTIL() \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCallWithNumericParamOnly(TASK_DELAY_UNTIL, (uint16_t)xTimeToWake); \\r
+      vTraceSetTaskInstanceFinished((uint8_t)pxCurrentTCB->uxTaskNumber); \\r
+      portEXIT_CRITICAL();\r
+\r
+#ifndef INCLUDE_OBJECT_DELETE\r
+#define INCLUDE_OBJECT_DELETE 1\r
+#endif\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+    /* Called on vTaskDelete */\r
+    #undef traceTASK_DELETE\r
+    #define traceTASK_DELETE( pxTaskToDelete ) \\r
+      trcCRITICAL_SECTION_BEGIN(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_DELETE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, pxTaskToDelete->uxTaskNumber); \\r
+      vTraceStoreObjectNameOnCloseEvent((objectHandleType)pxTaskToDelete->uxTaskNumber, TRACE_CLASS_TASK); \\r
+      vTraceStoreObjectPropertiesOnCloseEvent((objectHandleType)pxTaskToDelete->uxTaskNumber, TRACE_CLASS_TASK); \\r
+      vTraceSetPriorityProperty(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber, (uint8_t)pxTaskToDelete->uxPriority); \\r
+      vTraceSetObjectState(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber, TASK_STATE_INSTANCE_NOT_ACTIVE); \\r
+      vTraceFreeObjectHandle(TRACE_CLASS_TASK, (objectHandleType)pxTaskToDelete->uxTaskNumber); \\r
+      trcCRITICAL_SECTION_END();\r
+#endif\r
+\r
+    /* Called on vTaskCreate */\r
+    #undef traceTASK_CREATE\r
+    #define traceTASK_CREATE( pxNewTCB ) \\r
+      if (pxNewTCB != NULL){ \\r
+          pxNewTCB->uxTaskNumber = xTraceGetObjectHandle(TRACE_CLASS_TASK); \\r
+          vTraceSetObjectName(TRACE_CLASS_TASK, (objectHandleType)pxNewTCB->uxTaskNumber, (char*)pxNewTCB->pcTaskName); \\r
+          vTraceSetPriorityProperty(TRACE_CLASS_TASK, (objectHandleType)pxNewTCB->uxTaskNumber, (uint8_t)pxNewTCB->uxPriority); \\r
+          vTraceStoreKernelCall(EVENTGROUP_CREATE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, pxNewTCB->uxTaskNumber);\\r
+      }\r
+\r
+    /* Called in vTaskCreate, if it fails (typically if the stack can not be allocated) */\r
+    #undef traceTASK_CREATE_FAILED\r
+    #define traceTASK_CREATE_FAILED() \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK, TRACE_CLASS_TASK, 0); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreate, and thereby for all other object based on queues, such as semaphores. */\r
+    #undef traceQUEUE_CREATE\r
+    #define traceQUEUE_CREATE( pxNewQueue )\\r
+        portENTER_CRITICAL(); \\r
+        pxNewQueue->ucQueueNumber = xTraceGetObjectHandle(TraceObjectClassTable[pxNewQueue->ucQueueType]);\\r
+        vTraceStoreKernelCall(EVENTGROUP_CREATE + TraceObjectClassTable[pxNewQueue->ucQueueType], TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber); \\r
+        vTraceSetObjectState(TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber, 0); \\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreate, if the queue creation fails */\r
+    #undef traceQUEUE_CREATE_FAILED\r
+    #define traceQUEUE_CREATE_FAILED( queueType ) \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall((uint8_t)(EVENTGROUP_FAILED_CREATE + TraceObjectClassTable[queueType]), TraceObjectClassTable[queueType], 0); \\r
+        portEXIT_CRITICAL();\r
+    \r
+    /* Called in xQueueCreateMutex, and thereby also from xSemaphoreCreateMutex and xSemaphoreCreateRecursiveMutex */\r
+    #undef traceCREATE_MUTEX\r
+    #define traceCREATE_MUTEX( pxNewQueue ) \\r
+      portENTER_CRITICAL();\\r
+      pxNewQueue->ucQueueNumber = xTraceGetObjectHandle(TRACE_CLASS_MUTEX); \\r
+      vTraceStoreKernelCall(EVENTGROUP_CREATE + TraceObjectClassTable[pxNewQueue->ucQueueType], TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxNewQueue->ucQueueType], pxNewQueue->ucQueueNumber, 0); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called in xQueueCreateMutex when the operation fails (when memory allocation fails) */\r
+    #undef traceCREATE_MUTEX_FAILED\r
+    #define traceCREATE_MUTEX_FAILED() \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX, TRACE_CLASS_MUTEX, 0);\\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called when the Mutex can not be given, since not holder */\r
+    #undef traceGIVE_MUTEX_RECURSIVE_FAILED\r
+    #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex ) \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX, TRACE_CLASS_MUTEX, pxMutex->ucQueueNumber); \\r
+        portEXIT_CRITICAL();\r
+\r
+    /* Called when a message is sent to a queue */\r
+    #undef traceQUEUE_SEND\r
+    #define traceQUEUE_SEND( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (uint8_t)pxQueue->ucQueueNumber, (uint8_t)0); \\r
+      }else{\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (uint8_t)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting + 1)); \\r
+      }\r
+\r
+    /* Called when a message failed to be sent to a queue (timeout) */\r
+    #undef traceQUEUE_SEND_FAILED\r
+    #define traceQUEUE_SEND_FAILED( pxQueue ) \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called when the task is blocked due to a send operation on a full queue */\r
+    #undef traceBLOCKING_ON_QUEUE_SEND\r
+    #define traceBLOCKING_ON_QUEUE_SEND( pxQueue ) \\r
+      portENTER_CRITICAL();\\r
+      vTraceStoreKernelCall(EVENTGROUP_BLOCK_ON_SEND + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+                \r
+    /* Called when a message is received from a queue */\r
+    #undef traceQUEUE_RECEIVE\r
+    #define traceQUEUE_RECEIVE( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){\\r
+          extern volatile void * volatile pxCurrentTCB; \\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxCurrentTCB)); /*For mutex, store the new owner rather than queue length */ \\r
+      }else{\\r
+          vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting - 1)); \\r
+      }\r
+        \r
+    /* Called when the task is blocked due to a receive operation on an empty queue */\r
+    #undef traceBLOCKING_ON_QUEUE_RECEIVE\r
+    #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ) \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_BLOCK_ON_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      if (TraceObjectClassTable[pxQueue->ucQueueType] != TRACE_CLASS_MUTEX){\\r
+          extern volatile void * volatile pxCurrentTCB; \\r
+          vTraceSetTaskInstanceFinished((objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxCurrentTCB)); \\r
+      }\\r
+      portEXIT_CRITICAL();\r
+\r
+    /* Called on xQueuePeek */\r
+    #undef traceQUEUE_PEEK\r
+    #define traceQUEUE_PEEK( pxQueue ) \\r
+        vTraceStoreKernelCall(EVENTGROUP_PEEK + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+    /* Called when a receive operation on a queue fails (timeout) */\r
+    #undef traceQUEUE_RECEIVE_FAILED\r
+    #define traceQUEUE_RECEIVE_FAILED( pxQueue ) \\r
+      portENTER_CRITICAL(); \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_RECEIVE + TraceObjectClassTable[pxQueue->ucQueueType],  TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      portEXIT_CRITICAL();\r
+        \r
+    /* Called when a message is sent from interrupt context, e.g., using xQueueSendFromISR */\r
+    #undef traceQUEUE_SEND_FROM_ISR\r
+    #define traceQUEUE_SEND_FROM_ISR( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_SEND_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting + 1));\r
+\r
+    /* Called when a message send from interrupt context fails (since the queue was full) */\r
+    #undef traceQUEUE_SEND_FROM_ISR_FAILED\r
+    #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_SEND_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+    /* Called when a message is received in interrupt context, e.g., using xQueueReceiveFromISR */\r
+    #undef traceQUEUE_RECEIVE_FROM_ISR\r
+    #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_RECEIVE_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+      vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)(pxQueue->uxMessagesWaiting - 1));\r
+    \r
+    /* Called when a message receive from interrupt context fails (since the queue was empty) */\r
+    #undef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
+    #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) \\r
+      vTraceStoreKernelCall(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber);\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+    /* Called on vQueueDelete */\r
+    #undef traceQUEUE_DELETE\r
+    #define traceQUEUE_DELETE( pxQueue ) \\r
+    { \\r
+        portENTER_CRITICAL();\\r
+        vTraceStoreKernelCall(EVENTGROUP_DELETE + TraceObjectClassTable[pxQueue->ucQueueType], TraceObjectClassTable[pxQueue->ucQueueType], pxQueue->ucQueueNumber); \\r
+        vTraceStoreObjectNameOnCloseEvent((objectHandleType)pxQueue->ucQueueNumber, TraceObjectClassTable[pxQueue->ucQueueType]); \\r
+        vTraceStoreObjectPropertiesOnCloseEvent((objectHandleType)pxQueue->ucQueueNumber, TraceObjectClassTable[pxQueue->ucQueueType]); \\r
+        if (TraceObjectClassTable[pxQueue->ucQueueType] == TRACE_CLASS_MUTEX){ \\r
+            vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (objectHandleType)uxTaskGetTaskNumber((xTaskHandle)pxQueue->pxMutexHolder)); \\r
+        }else{ \\r
+            vTraceSetObjectState(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber, (uint8_t)uxQueueMessagesWaiting(pxQueue)); \\r
+        } \\r
+        vTraceFreeObjectHandle(TraceObjectClassTable[pxQueue->ucQueueType], (objectHandleType)pxQueue->ucQueueNumber); \\r
+        portEXIT_CRITICAL();\\r
+    }\r
+#endif\r
+    \r
+    /* Called in vTaskPrioritySet */\r
+    #undef traceTASK_PRIORITY_SET\r
+    #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_SET, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority);\r
+\r
+    /* Called in vTaskPriorityInherit, which is called by Mutex operations */\r
+    #undef traceTASK_PRIORITY_INHERIT\r
+    #define traceTASK_PRIORITY_INHERIT( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_INHERIT, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority );\r
+\r
+    /* Called in vTaskPriorityDisinherit, which is called by Mutex operations */\r
+    #undef traceTASK_PRIORITY_DISINHERIT\r
+    #define traceTASK_PRIORITY_DISINHERIT( pxTask, uxNewPriority ) \\r
+      vTraceStoreKernelCallWithParam(TASK_PRIORITY_DISINHERIT, TRACE_CLASS_TASK, pxTask->uxTaskNumber, uiTraceGetPriorityProperty(TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber));\\r
+      vTraceSetPriorityProperty( TRACE_CLASS_TASK, (uint8_t)pxTask->uxTaskNumber, (uint8_t)uxNewPriority );\r
+\r
+    /* Called in vTaskResume */\r
+    #undef traceTASK_RESUME\r
+    #define traceTASK_RESUME( pxTaskToResume ) \\r
+      vTraceStoreKernelCall(TASK_RESUME, TRACE_CLASS_TASK, pxTaskToResume->uxTaskNumber);\r
+\r
+    /* Called in vTaskResumeFromISR */\r
+    #undef traceTASK_RESUME_FROM_ISR\r
+    #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\\r
+      vTraceStoreKernelCall(TASK_RESUME_FROM_ISR, TRACE_CLASS_TASK, pxTaskToResume->uxTaskNumber);\r
+\r
+#endif\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernel.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcKernel.h
new file mode 100644 (file)
index 0000000..c81db92
--- /dev/null
@@ -0,0 +1,274 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcKernel.h\r
+ *\r
+ * Functions used by trcHooks.h, for the FreeRTOS kernel integration.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCKERNEL_H\r
+#define TRCKERNEL_H\r
+\r
+#include "trcBase.h"\r
+\r
+/* Internal functions */\r
+\r
+\r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+void vTraceStoreTaskReady(objectHandleType handle);\r
+#endif\r
+\r
+void vTraceStoreTaskswitch(void);\r
+\r
+void vTraceStoreKernelCall(uint32_t eventcode, traceObjectClass objectClass, uint32_t byteParam); \r
+\r
+void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, \r
+                                               uint16_t param);\r
+\r
+void vTraceStoreKernelCallWithParam(uint32_t evtcode, traceObjectClass objectClass, \r
+                                    uint32_t objectNumber, uint8_t param);\r
+\r
+void vTraceSetTaskInstanceFinished(objectHandleType handle);\r
+\r
+void vTraceSetPriorityProperty(uint8_t objectclass, uint8_t id, uint8_t value);\r
+\r
+uint8_t uiTraceGetPriorityProperty(uint8_t objectclass, uint8_t id);\r
+\r
+void vTraceSetObjectState(uint8_t objectclass, uint8_t id, uint8_t value);\r
+\r
+uint8_t uiTraceGetObjectState(uint8_t objectclass, uint8_t id);\r
+\r
+#if (INCLUDE_OBJECT_DELETE == 1)    \r
+\r
+void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle, \r
+                                       traceObjectClass objectclass);\r
+\r
+void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle, \r
+                                             traceObjectClass objectclass);\r
+#endif\r
+\r
+/* Internal constants for task state */\r
+#define TASK_STATE_INSTANCE_NOT_ACTIVE 0\r
+#define TASK_STATE_INSTANCE_ACTIVE 1\r
+#define TASK_STATE_INSTANCE_MARKED_FINISHED 2\r
+\r
+extern objectHandleType handle_of_running_task;\r
+\r
+/* This defines the mapping between FreeRTOS queue types and our internal \r
+class IDs */\r
+extern traceObjectClass TraceObjectClassTable[5];\r
+\r
+/*******************************************************************************\r
+ * The event codes - should match the offline config file.\r
+ * \r
+ * Some sections below are encoded to allow for constructions like:\r
+ *\r
+ *  vTraceStoreKernelCall(EVENTGROUP_CREATE + objectclass, ...\r
+ *\r
+ * The object class ID is given by the three LSB bits, in such cases. Since each \r
+ * object class has a separate object property table, the class ID is needed to \r
+ * know what section in the object table to use for getting an object name from\r
+ * an object handle. \r
+ ******************************************************************************/\r
+\r
+#define NULL_EVENT                   (0x00)  /* Ignored in the analysis*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_RE\r
+ *\r
+ * Events that indicate that something is ready to execute.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_RE                (NULL_EVENT + 2)                   /*0x02*/\r
+#define TR_TASK_READY                (EVENTGROUP_RE + 0)                /*0x02*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_TS\r
+ *\r
+ * Events for storing task-switches and interrupts. The RESUME events are \r
+ * generated if the task/interrupt is already marked active.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_TS                (EVENTGROUP_RE + 2)                /*0x04*/\r
+#define TS_ISR_BEGIN                 (EVENTGROUP_TS + 0)                /*0x04*/\r
+#define TS_ISR_RESUME                (EVENTGROUP_TS + 1)                /*0x05*/\r
+#define TS_TASK_BEGIN                (EVENTGROUP_TS + 2)                /*0x06*/\r
+#define TS_TASK_RESUME               (EVENTGROUP_TS + 3)                /*0x07*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_OBJCLOSE_NAME\r
+ * \r
+ * About Close Events\r
+ * When an object is evicted from the object property table (object close), two \r
+ * internal events are stored (EVENTGROUP_OBJCLOSE_NAME and \r
+ * EVENTGROUP_OBJCLOSE_PROP), containg the handle-name mapping and object \r
+ * properties valid up to this point.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_OBJCLOSE_NAME     (EVENTGROUP_TS + 4)                /*0x08*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_OBJCLOSE_PROP\r
+ * \r
+ * The internal event carrying properties of deleted objects\r
+ * The handle and object class of the closed object is not stored in this event, \r
+ * but is assumed to be the same as in the preceeding CLOSE event. Thus, these \r
+ * two events must be generated from within a critical section. \r
+ * When queues are closed, arg1 is the "state" property (i.e., number of \r
+ * buffered messages/signals).\r
+ * When actors are closed, arg1 is priority, arg2 is handle of the "instance \r
+ * finish" event, and arg3 is event code of the "instance finish" event. \r
+ * In this case, the lower three bits is the object class of the instance finish \r
+ * handle. The lower three bits are not used (always zero) when queues are \r
+ * closed since the queue type is given in the previous OBJCLOSE_NAME event.\r
+ ******************************************************************************/\r
+#define EVENTGROUP_OBJCLOSE_PROP     (EVENTGROUP_OBJCLOSE_NAME + 8)     /*0x10*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_CREATE\r
+ * \r
+ * The events in this group are used to log Kernel object creations.\r
+ * The lower three bits in the event code gives the object class, i.e., type of\r
+ * create operation (task, queue, semaphore, etc).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_CREATE    (EVENTGROUP_OBJCLOSE_PROP + 8)             /*0x18*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_SEND\r
+ * \r
+ * The events in this group are used to log Send/Give events on queues, \r
+ * semaphores and mutexeds The lower three bits in the event code gives the \r
+ * object class, i.e., what type of object that is operated on (queue, semaphore \r
+ * or mutex).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_SEND      (EVENTGROUP_CREATE + 8)                    /*0x20*/\r
+\r
+/*******************************************************************************\r
+ * EVENTGROUP_RECEIVE\r
+ * \r
+ * The events in this group are used to log Receive/Take events on queues, \r
+ * semaphores and mutexes. The lower three bits in the event code gives the \r
+ * object class, i.e., what type of object that is operated on (queue, semaphore\r
+ * or mutex).\r
+ ******************************************************************************/\r
+#define EVENTGROUP_RECEIVE                       (EVENTGROUP_SEND + 8)  /*0x28*/\r
+\r
+/* Send/Give operations, from ISR */\r
+#define EVENTGROUP_SEND_FROM_ISR              (EVENTGROUP_RECEIVE + 8)  /*0x30*/\r
+\r
+/* Receive/Take operations, from ISR */\r
+#define EVENTGROUP_RECEIVE_FROM_ISR     (EVENTGROUP_SEND_FROM_ISR + 8)  /*0x38*/\r
+\r
+/* "Failed" event type versions of above (timeout, failed allocation, etc) */\r
+#define EVENTGROUP_FAILED_KSE         (EVENTGROUP_RECEIVE_FROM_ISR + 8) /*0x40*/\r
+\r
+/* Failed create calls - memory allocation failed */\r
+#define EVENTGROUP_FAILED_CREATE                (EVENTGROUP_FAILED_KSE) /*0x40*/\r
+\r
+/* Failed send/give - timeout! */\r
+#define EVENTGROUP_FAILED_SEND           (EVENTGROUP_FAILED_CREATE + 8) /*0x48*/\r
+\r
+/* Failed receive/take - timeout! */\r
+#define EVENTGROUP_FAILED_RECEIVE          (EVENTGROUP_FAILED_SEND + 8) /*0x50*/\r
+\r
+/* Failed non-blocking send/give - queue full */\r
+#define EVENTGROUP_FAILED_SEND_FROM_ISR (EVENTGROUP_FAILED_RECEIVE + 8) /*0x58*/\r
+\r
+/* Failed non-blocking receive/take - queue empty */\r
+#define EVENTGROUP_FAILED_RECEIVE_FROM_ISR \\r
+                                  (EVENTGROUP_FAILED_SEND_FROM_ISR + 8) /*0x60*/\r
+\r
+/* Events when blocking on receive/take */\r
+#define EVENTGROUP_BLOCK_ON_RECEIVE \\r
+                               (EVENTGROUP_FAILED_RECEIVE_FROM_ISR + 8) /*0x68*/\r
+\r
+/* Events when blocking on send/give */\r
+#define EVENTGROUP_BLOCK_ON_SEND     (EVENTGROUP_BLOCK_ON_RECEIVE + 8)  /*0x70*/\r
+\r
+/* Events on queue peek (receive) */\r
+#define EVENTGROUP_PEEK              (EVENTGROUP_BLOCK_ON_SEND + 8)     /*0x78*/\r
+\r
+/* Events on object delete (vTaskDelete or vQueueDelete) */\r
+#define EVENTGROUP_DELETE            (EVENTGROUP_PEEK + 8)              /*0x80*/\r
+\r
+/* Other events - object class is implied: TASK */\r
+#define EVENTGROUP_OTHERS            (EVENTGROUP_DELETE + 8)            /*0x88*/\r
+#define TASK_DELAY_UNTIL             (EVENTGROUP_OTHERS + 0)            /*0x88*/\r
+#define TASK_DELAY                   (EVENTGROUP_OTHERS + 1)            /*0x89*/\r
+#define TASK_SUSPEND                 (EVENTGROUP_OTHERS + 2)            /*0x8A*/\r
+#define TASK_RESUME                  (EVENTGROUP_OTHERS + 3)            /*0x8B*/\r
+#define TASK_RESUME_FROM_ISR         (EVENTGROUP_OTHERS + 4)            /*0x8C*/\r
+#define TASK_PRIORITY_SET            (EVENTGROUP_OTHERS + 5)            /*0x8D*/\r
+#define TASK_PRIORITY_INHERIT        (EVENTGROUP_OTHERS + 6)            /*0x8E*/\r
+#define TASK_PRIORITY_DISINHERIT     (EVENTGROUP_OTHERS + 7)            /*0x8F*/\r
+\r
+/* Not yet used */\r
+#define EVENTGROUP_FTRACE_PLACEHOLDER    (EVENTGROUP_OTHERS + 8)        /*0x90*/\r
+\r
+/* User events */\r
+#define EVENTGROUP_USEREVENT (EVENTGROUP_FTRACE_PLACEHOLDER + 8)        /*0x98*/\r
+#define USER_EVENT (EVENTGROUP_USEREVENT + 0)\r
+\r
+/* Allow for 0-15 arguments (the number of args is added to event code) */\r
+#define USER_EVENT_LAST (EVENTGROUP_USEREVENT + 15)                     /*0xA7*/\r
+\r
+/*******************************************************************************\r
+ * XTS Event - eXtended TimeStamp events\r
+ * The timestamps used in the recorder are "differential timestamps" (DTS), i.e.\r
+ * the time since the last stored event. The DTS fields are either 1 or 2 bytes \r
+ * in the other events, depending on the bytes available in the event struct. \r
+ * If the time since the last event (the DTS) is larger than allowed for by \r
+ * the DTS field of the current event, an XTS event is inserted immidiatly \r
+ * before the original event. The XTS event contains up to 3 additional bytes \r
+ * of the DTS value - the higher bytes of the true DTS value. The lower 1-2 \r
+ * bytes are stored in the normal DTS field. \r
+ * There are two types of XTS events, XTS8 and XTS16. An XTS8 event is stored \r
+ * when there is only room for 1 byte (8 bit) DTS data in the original event, \r
+ * which means a limit of 0xFF (255). The XTS16 is used when the original event \r
+ * has a 16 bit DTS field and thereby can handle values up to 0xFFFF (65535).\r
+ * \r
+ * Using a very high frequency time base can result in many XTS events. \r
+ * Preferably, the time between two OS ticks should fit in 16 bits, i.e.,\r
+ * at most 65535. If your time base has a higher frequency, you can define\r
+ * the TRACE\r
+ ******************************************************************************/\r
+\r
+#define EVENTGROUP_SYS (EVENTGROUP_USEREVENT + 16)                      /*0xA8*/\r
+#define XTS8 (EVENTGROUP_SYS + 0)                                       /*0xA8*/\r
+#define XTS16 (EVENTGROUP_SYS + 1)                                      /*0xA9*/\r
+\r
+#define EVENT_BEING_WRITTEN (EVENTGROUP_SYS + 2)                        /*0xAA*/\r
+\r
+#define RESERVED_DUMMY_CODE (EVENTGROUP_SYS + 3)                        /*0xAB*/\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTypes.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcTypes.h
new file mode 100644 (file)
index 0000000..7bf438c
--- /dev/null
@@ -0,0 +1,81 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcTypes.h\r
+ *\r
+ * Data types used by the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCTYPES_H\r
+#define TRCTYPES_H\r
+\r
+#include <stdint.h>\r
+\r
+typedef uint16_t traceLabel;\r
+\r
+typedef uint8_t objectHandleType;\r
+\r
+typedef uint8_t traceObjectClass;\r
+\r
+#define TRACE_CLASS_QUEUE ((traceObjectClass)0)\r
+#define TRACE_CLASS_SEMAPHORE ((traceObjectClass)1) \r
+#define TRACE_CLASS_MUTEX ((traceObjectClass)2)\r
+#define TRACE_CLASS_TASK ((traceObjectClass)3)\r
+#define TRACE_CLASS_ISR ((traceObjectClass)4)\r
+\r
+typedef uint8_t traceKernelService;\r
+\r
+#define TRACE_KERNEL_SERVICE_TASK_CREATE ((traceKernelService)0)\r
+#define TRACE_KERNEL_SERVICE_TASK_DELETE ((traceKernelService)1)\r
+#define TRACE_KERNEL_SERVICE_TASK_DELAY ((traceKernelService)2)\r
+#define TRACE_KERNEL_SERVICE_PRIORITY_SET ((traceKernelService)3)\r
+#define TRACE_KERNEL_SERVICE_TASK_SUSPEND ((traceKernelService)4)\r
+#define TRACE_KERNEL_SERVICE_TASK_RESUME ((traceKernelService)5)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_CREATE ((traceKernelService)6)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_DELETE ((traceKernelService)7)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_SEND ((traceKernelService)8)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_RECEIVE ((traceKernelService)9)\r
+#define TRACE_KERNEL_SERVICE_QUEUE_PEEK ((traceKernelService)10)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_CREATE ((traceKernelService)11)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_DELETE ((traceKernelService)12)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_GIVE ((traceKernelService)13)\r
+#define TRACE_KERNEL_SERVICE_MUTEX_TAKE ((traceKernelService)14)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_CREATE ((traceKernelService)15)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_DELETE ((traceKernelService)16)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_GIVE ((traceKernelService)17)\r
+#define TRACE_KERNEL_SERVICE_SEMAPHORE_TAKE ((traceKernelService)18)\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcUser.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/Include/trcUser.h
new file mode 100644 (file)
index 0000000..3e80162
--- /dev/null
@@ -0,0 +1,444 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcUser.h\r
+ * The public API of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCUSER_H\r
+#define TRCUSER_H\r
+\r
+#include "FreeRTOS.h"\r
+\r
+#include "trcKernel.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * uiTraceStart\r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * Returns 1 if the recorder was started successfully.\r
+ * Returns 0 if the recorder start was prevented due to a previous internal \r
+ * error. In that case, check vTraceGetLastError to get the error message.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+uint32_t uiTraceStart(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStart \r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * This function is obsolete, but has been saved for backwards compatibility. \r
+ * We recommend using uiTraceStart instead.\r
+ ******************************************************************************/\r
+void vTraceStart(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStartStatusMonitor\r
+ *\r
+ * This starts a task to monitor the status of the recorder module. \r
+ * This task periodically prints a line to the console window, which shows the \r
+ * recorder status, the number of events recorded and the latest timestamp. \r
+ * This task calls vTracePortEnd (trcPort.c) when it detects that the recorder \r
+ * has been stopped. This allows for adding custom actions, e.g., to store the\r
+ * trace to a file in case a file system is available on the device.\r
+ ******************************************************************************/\r
+void vTraceStartStatusMonitor(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceStop\r
+ *\r
+ * Stops the recorder. The recording can be resumed by calling vTraceStart.\r
+ * This does not reset the recorder. Use vTraceClear is that is desired.\r
+ ******************************************************************************/\r
+void vTraceStop(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceClear\r
+ *\r
+ * Resets the recorder. Only necessary if a restart is desired - this is not \r
+ * needed in the startup initialization.\r
+ ******************************************************************************/\r
+void vTraceClear(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceSetQueueName\r
+ *\r
+ * Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This function should\r
+ * be called right after creation of the queue/mutex/semaphore. If not using \r
+ * this function, the queues/mutexes/semaphores will be presented by their\r
+ * numeric handle only.\r
+ *\r
+ * Example:\r
+ *     actuatorQ = xQueueCreate(3, sizeof(QueueMessage));\r
+ *     vTraceSetQueueName(actuatorQ, "ActuatorQueue");\r
+ ******************************************************************************/\r
+void vTraceSetQueueName(void* queue, const char* name);\r
+\r
+#if (INCLUDE_ISR_TRACING == 1)\r
+\r
+/*******************************************************************************\r
+ * vTraceSetISRProperties\r
+ * \r
+ * Registers an Interrupt Service Routine in the recorder library, This must be\r
+ * called before using vTraceStoreISRBegin to store ISR events. This is \r
+ * typically called in the startup of the system, before the scheduler is \r
+ * started.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceSetISRProperties(objectHandleType handle, const char* name, char priority);\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISRBegin\r
+ * \r
+ * Registers the beginning of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceStoreISRBegin(objectHandleType id);\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISREnd\r
+ * \r
+ * Registers the end of an Interrupt Service Routine.\r
+ *\r
+ * Note! This may only be used for interrupts affected by portENTER_CRITICAL.\r
+ * In some FreeRTOS ports, such as ARM Cortex M3, this does not disable all\r
+ * interrupts. Interrupts above configMAX_SYSCALL_INTERRUPT_PRIORITY are still \r
+ * enabled, but may not call the FreeRTOS API. Such may not call the recorder \r
+ * API, including this function.\r
+ *\r
+ * See http://www.freertos.org/a00110.html\r
+ * \r
+ * If allowing nested ISRs, this must be called with interrupts disabled. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         portEXIT_CRITICAL();\r
+ *         ...\r
+ *         portENTER_CRITICAL(); // Required if nested ISRs are allowed\r
+ *         vTraceStoreISREnd();\r
+ *         portEXIT_CRITICAL();\r
+ *     }\r
+ ******************************************************************************/\r
+void vTraceStoreISREnd(void);\r
+\r
+#else\r
+   /* If not including the ISR recording */\r
+\r
+void vTraceIncreaseISRActive(void);\r
+\r
+void vTraceDecreaseISRActive(void);\r
+\r
+#define vTraceSetISRProperties(handle, name, priority)\r
+#define vTraceStoreISRBegin(id) vTraceIncreaseISRActive()\r
+#define vTraceStoreISREnd() vTraceDecreaseISRActive()\r
+\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vvTraceTaskSkipDefaultInstanceFinishedEvents\r
+ *\r
+ * This is useful if there are implicit Instance Finish Events, such as \r
+ * vTaskDelayUntil or xQueueReceive, in a task where an explicit Instance Finish \r
+ * Event has been defined. This function tells the recorder that only the \r
+ * explicitly defined functions (using vTraceTaskInstanceIsFinished) should be\r
+ * treated as Instance Finish Events for this task. The implicit Instance Finish \r
+ * Events are thus disregarded for this task.\r
+ ******************************************************************************/\r
+void vTraceTaskSkipDefaultInstanceFinishedEvents(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceTaskInstanceIsFinished\r
+ * \r
+ * This defines an explicit Instance Finish Event for the current task. It tells \r
+ * the recorder that the current instance of this task is finished at the next \r
+ * kernel call of the task, e.g., a taskDelay or a queue receive. This function \r
+ * should be called right before the api function call considered to be the end \r
+ * of the task instamce, i.e., the Instance Finish Event.\r
+ ******************************************************************************/\r
+void vTraceTaskInstanceIsFinished(void);\r
+\r
+/*******************************************************************************\r
+ * vTraceGetTraceBuffer\r
+ * \r
+ * Returns a pointer to the recorder data structure. Use this together with \r
+ * uiTraceGetTraceBufferSize if you wish to implement an own store/upload \r
+ * solution, e.g., in case a debugger connection is not available for uploading \r
+ * the data.\r
+ ******************************************************************************/\r
+void* vTraceGetTraceBuffer(void);\r
+\r
+/*******************************************************************************\r
+ * uiTraceGetTraceBufferSize\r
+ * \r
+ * Gets the size of the recorder data structure. For use together with \r
+ * vTraceGetTraceBuffer if you wish to implement an own store/upload solution, \r
+ * e.g., in case a debugger connection is not available for uploading the data.\r
+ ******************************************************************************/\r
+uint32_t uiTraceGetTraceBufferSize(void);\r
+\r
+#if (INCLUDE_USER_EVENTS == 1)\r
+\r
+/*******************************************************************************\r
+ * xTraceOpenLabel\r
+ * \r
+ * Creates user event labels for user event channels or for individual events.\r
+ * User events can be used to log application events and data for display in\r
+ * the visualization tool. A user event is identified by a label, i.e., a string,\r
+ * which is stored in the recorder's symbol table.\r
+ * When logging a user event, a numeric handle (reference) to this string is\r
+ * used to identify the event. This is obtained by calling \r
+ * \r
+ *     xTraceOpenLabel()\r
+ *\r
+ * whihc adds the string to the symbol table (if not already present)\r
+ * and returns the corresponding handle.\r
+ *\r
+ * This can be used in two ways:\r
+ *\r
+ * 1. The handle is looked up every time, when storing the user event.\r
+ *\r
+ * Example:\r
+ *     vTraceUserEvent(xTraceOpenLabel("MyUserEvent"));\r
+ *\r
+ * 2. The label is registered just once, with the handle stored in an\r
+ *  application variable - much like using a file handle.\r
+ *\r
+ * Example:\r
+ *     myEventHandle = xTraceOpenLabel("MyUserEvent");\r
+ *     ...\r
+ *     vTraceUserEvent(myEventHandle);\r
+ *\r
+ * The second option is faster since no lookup is required on each event, and \r
+ * therefore recommended for user events that are frequently\r
+ * executed and/or located in time-critical code. The lookup operation is\r
+ * however fairly fast due to the design of the symbol table.\r
+ ******************************************************************************/\r
+traceLabel xTraceOpenLabel(const char* label);\r
+\r
+ /******************************************************************************\r
+ * vTraceUserEvent\r
+ *\r
+ * Basic user event (Standard and Professional Edition only)\r
+ * \r
+ * Generates a User Event with a text label. The label is created/looked up\r
+ * in the symbol table using xTraceOpenLabel.\r
+ ******************************************************************************/\r
+void vTraceUserEvent(traceLabel eventLabel);\r
+\r
+ /******************************************************************************\r
+ * vTracePrintF \r
+ * \r
+ * Advanced user events (Professional Edition only)\r
+ *\r
+ * Generates User Event with formatted text and data, similar to a "printf".\r
+ * It is very fast compared to a normal "printf" since this function only \r
+ * stores the arguments. The actual formatting is done\r
+ * on the host PC when the trace is displayed in the viewer tool. \r
+ *\r
+ * User Event labels are created using xTraceOpenLabel.\r
+ * Example:\r
+ *\r
+ *     traceLabel adc_uechannel = xTraceOpenLabel("ADC User Events");\r
+ *     ...\r
+ *     vTracePrint(adc_uechannel, \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * This can be combined into one line, if desired, but this is slower:\r
+ *\r
+ *     vTracePrint(xTraceOpenLabel("ADC User Events"), \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * Calling xTraceOpenLabel multiple times will not create duplicate entries, but\r
+ * it is of course faster to just do it once, and then keep the handle for later \r
+ * use. If you don´t have any data arguments, only a text label/string, it is \r
+ * better to use vTraceUserEvent - it is faster.\r
+ *\r
+ * Format specifiers supported:\r
+ *  %d - 32 bit signed integer\r
+ *  %u - 32 bit unsigned integer\r
+ *  %f - 32 bit float\r
+ *  %s - string (is copied to the recorder symbol table)\r
+ *  %hd - 16 bit signed integer\r
+ *  %hu - 16 bit unsigned integer\r
+ *  %bd - 8 bit signed integer\r
+ *  %bu - 8 bit unsigned integer\r
+ *  %lf - double-precision float (Note! See below...)\r
+ * \r
+ * Up to 15 data arguments are allowed, with a total size of maximum 32 byte.\r
+ * In case this is exceeded, the user event is changed into an error message.\r
+ * \r
+ * The data is stored in trace buffer, and is packed to allow storing multiple \r
+ * smaller data entries in the same 4-byte record, e.g., four 8-bit values.\r
+ * A string requires two bytes, as the symbol table is limited to 64K. Storing \r
+ * a double (%lf) uses two records, so this is quite costly. Use float (%f) \r
+ * unless the higher precision is really necessary.\r
+ * \r
+ * Note that the double-precision float (%lf) assumes a 64 bit double \r
+ * representation. This does not seem to be the case on e.g. PIC24F. \r
+ * Before using a %lf argument on a 16-bit MCU, please verify that \r
+ * "sizeof(double)" actually gives 8 as expected. If not, use %f instead.\r
+ ******************************************************************************/ \r
+void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...);\r
+\r
+#else\r
+\r
+#define vTracePrintF(eventLabel, formatStr, ...);\r
+#define xTraceOpenLabel(label) 0\r
+#define vTraceUserEvent(eventLabel) \r
+\r
+#endif\r
+\r
+/******************************************************************************\r
+ * vTraceExclude______FromTrace\r
+ *\r
+ * Excludes a task or object from the trace.\r
+ * This can be useful if some irrelevant task is very frequent and is "eating\r
+ * up the buffer". This should be called after the task has been created, but \r
+ * before starting the FreeRTOS scheduler.\r
+ *****************************************************************************/\r
+void vTraceExcludeQueueFromTrace(void* handle);\r
+void vTraceExcludeSemaphoreFromTrace(void* handle);\r
+void vTraceExcludeMutexFromTrace(void* handle);\r
+void vTraceExcludeTaskFromTrace(void* handle);\r
+void vTraceExcludeKernelServiceFromTrace(traceKernelService kernelService);\r
+\r
+/******************************************************************************\r
+ * vTraceInclude______InTrace\r
+ *\r
+ * Includes a task, object or kernel service in the trace. This is only\r
+ * necessary if the task or object has been previously exluded.\r
+ *****************************************************************************/\r
+void vTraceIncludeQueueInTrace(void* handle);\r
+void vTraceIncludeSemaphoreInTrace(void* handle);\r
+void vTraceIncludeMutexInTrace(void* handle);\r
+void vTraceIncludeTaskInTrace(void* handle);\r
+void vTraceIncludeKernelServiceInTrace(traceKernelService kernelService);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#else\r
+\r
+#include "trcPort.h"\r
+\r
+#define vTraceInit()\r
+#define uiTraceStart() (1)\r
+#define vTraceStart()\r
+#define vTraceStop()\r
+#define vTraceClear()\r
+#define vTraceStartStatusMonitor()\r
+#define vTracePortSetOutFile(f)\r
+#define vTraceGetTraceBuffer() ((void*)0)\r
+#define uiTraceGetTraceBufferSize() 0\r
+#define xTraceOpenLabel(label) 0\r
+#define vTraceUserEvent(eventLabel)\r
+#define vTracePrintF(eventLabel,formatStr,...)\r
+#define vTraceExcludeTaskFromSchedulingTrace(name)\r
+#define vTraceSetQueueName(queue, name)\r
+\r
+#define vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+#define vTraceSetISRProperties(handle, name, priority)\r
+#define vTraceStoreISRBegin(id)\r
+#define vTraceStoreISREnd()\r
+#endif\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/ReadMe.url b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/ReadMe.url
new file mode 100644 (file)
index 0000000..251da66
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/trace\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/debugger trace upload.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/debugger trace upload.txt
new file mode 100644 (file)
index 0000000..417a54b
--- /dev/null
@@ -0,0 +1,126 @@
+\r
+FreeRTOS+Trace - Uploading the trace data\r
+-----------------------------------------\r
+Percepio AB, Nov. 8, 2012\r
+\r
+This document decribes how to upload the trace data from the target system to\r
+FreeRTOS+Trace. For information on how to integrate and enable the recorder \r
+library in your FreeRTOS project, see the FreeRTOS+Trace User Manual.\r
+\r
+FreeRTOS+Trace uses your existing debugger to upload the trace data from the \r
+chip RAM. This is a plain RAM dump, that is done whenever you want to look at \r
+the trace buffer contents. This means it works with essentially with any debug \r
+probe on the market.\r
+\r
+Note that hardware-generated trace is not required (or used by) FreeRTOS+Trace. \r
+We however plan to add support for that in future versions of FreeRTOS+Trace \r
+and other Tracealyzer products.\r
+\r
+Built-in support for Segger J-Link/J-Trace and Atmel SAM-ICE\r
+------------------------------------------------------------\r
+FreeRTOS+Trace v2.3 supports Segger J-Link and J-Link compatible debuggers \r
+directly, without any debugger IDE involved. Using other debug probes is \r
+also possible, but requires some extra steps, described below.\r
+\r
+If you have a Segger J-Link/J-Trace debug probe or another J-Link compatible \r
+debug probe, just select \r
+\r
+    "File" menu -> "Upload from <debug probe name>". \r
+\r
+This opens a dialog where you get to enter the memory region where\r
+the recorder data structure is located. Normally you select the entire \r
+internal RAM according to the datasheet of your MCU, but the exact address\r
+can be found can by inspecting the "RecorderData" struct or the \r
+"RecorderDataPtr" pointer with your debugger.\r
+\r
+Typical values are 0x0, 0x10000000 or 0x20000000 as start address\r
+and 0x10000 or 0x20000 as size (64 KB or 128 KB).\r
+\r
+This makes FreeRTOS+Trace reads the chip RAM and locate the trace data. \r
+Note that this option is only available if a compatible debug probe is found.\r
+\r
+J-Link compatible debug probes also include Atmel SAM-ICE and many built-in \r
+debug interfaces on demonstration/evaluation boards (where there is a USB \r
+connection directly to the board). Look for a Segger J-Link label on the board.\r
+\r
+MemoryLogger extension in Atmel Studio 6\r
+----------------------------------------\r
+Atmel's new MemoryLogger extension provides a superb integration with\r
+FreeRTOS+Trace. Look for "MemoryLogger" in Atmel Gallery, available in \r
+Atmel Studio and at the Atmel website.\r
+\r
+This extension automatically detects the path to FreeRTOS+Trace, if \r
+installed, and gives you a single-click upload/refresh. You can use it \r
+while debugging and optionally get an automatic refresh eash time the \r
+MCU is halted, e.g., on each breakpoint.\r
+\r
+Using other development environments and debug probes\r
+-----------------------------------------------------\r
+Most debuggers are able to save the RAM contents to a file. FreeRTOS+Trace \r
+supports the following common formats:\r
+- Binary (.bin), supporting gdb, J-Link and Renesas HEW.\r
+- Intel Hex (.hex), supporting IAR Embedded Workbench and Atmel Studio (atprogram.exe)\r
+- MCH (.mch), supporting Microchip MPLAB.\r
+\r
+When you store the RAM dump, you must also make sure to select the right region, \r
+i.e., start address and size. The recorder data is stored in a single data \r
+block, identified by the pointer RecorderDataPtr. \r
+It is not necessary to match the begin and end of the recorder data, as long as \r
+it is fully included by the dumped memory region. FreeRTOS+Trace automatically \r
+finds the trace data in the RAM dump, thanks to special signatures. For chips \r
+with on-chip RAM only, we therefore recommend to dump the entire RAM. This is \r
+usually very fast.\r
+For chips with larger amounts of (external) RAM, it is typically possible to \r
+dump a limited region where the data is typically found.\r
+\r
+Using IAR Embedded Workbench for ARM, version 6.3\r
+-------------------------------------------------\r
+In the debugger view, when stopped on a breakpoint:\r
+- Select "Debug" menu, "Memory" submenu, "Save..." (keyboard shortcut: ALT,d,y,s)\r
+- In the Save dialog\r
+       - Zone: Memory\r
+       - Start Adress: 10000000 (for NXP LPC1766 in the demo project)\r
+       - End Adress: 1000FFFF (for NXP LPC1766 in the demo project)\r
+       - File format: Intel Extended\r
+       - Filename: <name>.hex\r
+       - Press "Save" button\r
+You can now open <name>.hex in FreeRTOS+Trace.\r
+\r
+To find the right Start and End addresses, check the address of the symbol \r
+"RecorderData". The addresses does not need to match this symbol exactly, as \r
+long as the whole data is included.\r
+\r
+Using Renesas High-performance Embedded Workshop v4.09\r
+------------------------------------------------------\r
+In the debugger view, when stopped on a breakpoint:\r
+- Select "Debug" menu, "Save Memory..." (keyboard shortcut: ALT,d,a)\r
+- In the Save dialog\r
+       - Format: Binary\r
+       - Filename: <name>.bin\r
+       - Start Address: 00000000 (For RX62N in the demo project)\r
+       - End Address: 0000FFFF (For RX62N in the demo project)\r
+       - Access size: 1\r
+       - Press "Save" button and open <name>.bin in FreeRTOS+Trace.\r
+       \r
+Using Microchip MPLAB v8.86\r
+------------------------------------------------------\r
+- Select "View" -> "File Registers". This shows you the memory contents.\r
+- Make sure "Hex" is selected in the bottom left (instead of "Symbolic"). Hex mode seems to be default.\r
+- Right click in the view and select "Export Table...".\r
+- In the dialog ("Export As"), make sure "Single Column Output" is selected (seems to be default).\r
+- Select start address 0x0000 and make sure the end address is beyond the RecorderData structure. \r
+  The default values seems to be the whole RAM, so you probably don't need to change this.\r
+- Save as a .mch file and open this file in FreeRTOS+Trace v2.2.4 or later (support for the .mch format was added in v2.2.4).\r
+\r
+Using STM32 ST-Link\r
+------------------------------------------------------\r
+- Start "ST-Link Utility"\r
+- Connect to the device and view the device memory.\r
+- Set the view to display the entire RAM, or at least the section containing the RecorderData structure.\r
+- Select "Save as" and choose binary (.bin) or Intel Hex (.hex) format.\r
+- Open the resulting file in FreeRTOS+Trace.\r
+\r
+In case you have any question, contact support@percepio.com\r
+\r
+Percepio AB\r
+www.percepio.com\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/readme.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/readme.txt
new file mode 100644 (file)
index 0000000..0553c8b
--- /dev/null
@@ -0,0 +1,53 @@
+\r
+FreeRTOS+Trace Trace Recorder Library\r
+-------------------------------------\r
+Percepio AB\r
+www.percepio.com\r
+\r
+This directory contains the core trace recorder library used by FreeRTOS+Trace v2.3. \r
+\r
+Ready-to-run demonstrations projects are found at www.percepio.com.\r
+\r
+For information on how to integrate the recorder library in your FreeRTOS build, see\r
+the FreeRTOS+Trace User Manual, section 2.\r
+\r
+For information on how to upload the trace data from your target system RAM to \r
+FreeRTOS+Trace, see "debugger trace upload.txt"\r
+\r
+NOTE: This trace recorder library requires FreeRTOS v7.3.0 or later.\r
+\r
+Files included\r
+--------------\r
+- trcConfig.h               - The recorder's configuration file, check this!\r
+- trcUser.c / trcUser.h     - The main API towards the application (trcUser.h in the only include necessary).\r
+- trcKernel.c / trcKernel.h - Internal routines for storing kernel events.\r
+- trcBase.c / trcBase.h     - Internal routines for manipulating the data structures and calculating timestamps.\r
+- trcPort.c / trcPort.h     - The port layer, abstracting the hardware (mainly the timer used for timestamping).\r
+- trcHooks.h                           - The interface between FreeRTOS and the recorder, containing trace macro defintions.\r
+- trcTypes.h                           - Type definitions used.\r
+\r
+Hardware Timer Ports\r
+--------------------\r
+This release contains hardware timer ports for the following hardware architectures:\r
+\r
+- ARM Cortex M3/M4 (all brands, such as Atmel SAM3/SAM4, NXP 17xx, 18xx, 43xx, STM32, Freescale Kinetis, ...)\r
+- Atmel AT91SAM7x\r
+- Atmel AT32UC3 (AVR32)\r
+- Renesas RX600 (e.g., RX62N)\r
+- Microchip dsPIC/PIC24\r
+\r
+These are defined in trcPort.h. This also contains several "unofficial" ports, provided by external contributors.\r
+By unofficial, it means that they are not yet verified by Percepio AB. Please refer to trcPort.h for detailed information. \r
+If you use an unofficial port and beleive it is incorrect, please let us know!\r
+\r
+In case your MCU is not yet supported directly, developing a new port is quite easy, just a matter of defining a few macros\r
+according to your specific MCU. See trcPort.h for further information.\r
+\r
+In case you have any questions, do not hesitate to contact support@percepio.com\r
+\r
+Percepio AB\r
+Köpmangatan 1A\r
+72215 VästerÃ¥s\r
+Sweden\r
+\r
+www.percepio.com
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcBase.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcBase.c
new file mode 100644 (file)
index 0000000..c80915c
--- /dev/null
@@ -0,0 +1,992 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcBase.c\r
+ *\r
+ * Core functionality of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+/*******************************************************************************\r
+ * Static data initializations\r
+ ******************************************************************************/\r
+\r
+\r
+/*******************************************************************************\r
+ * RecorderData\r
+ *\r
+ * The main data structure. This is the data read by FreeRTOS+Trace, typically\r
+ * through a debugger RAM dump. The recorder access this through the pointer\r
+ * RecorderDataPtr, to allow for dynamic memory allocation as well.\r
+ *\r
+ * On the NXP LPC17xx you may use the secondary RAM bank (AHB RAM) for this\r
+ * purpose. For instance, the LPC1766 has 32 KB AHB RAM which allows for \r
+ * allocating a buffer size of at least 7500 events without affecting the main\r
+ * RAM. To place RecorderData in this RAM bank, use the below declaration.\r
+ * \r
+ *     #pragma location="AHB_RAM_MEMORY"\r
+ *     RecorderDataType RecorderData = ...\r
+ * \r
+ * This of course works for other hardware architectures with additional RAM \r
+ * banks as well, just replace "AHB_RAM_MEMORY" with the name of the right \r
+ * address section from the linker file.\r
+ *\r
+ * However, to keep trcBase.c portable and still have a preconfigured IAR demo\r
+ * using AHB RAM, we don't add the pragma directly in trcBase.c but in a header \r
+ * included where the pragma should go. This is used depending on the setting\r
+ * USE_LINKER_PRAGMA, defined in trcConfig.h.\r
+ * \r
+ * If using GCC, this is instead done by adding a "section" attribute:\r
+ *\r
+ *     RecorderDataType RecorderData __attribute__ ((section ("name"))) = ...\r
+ *\r
+ * Remember to replace "name" with the correct section name.\r
+ ******************************************************************************/\r
+\r
+#if (TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_STATIC)\r
+#if (USE_LINKER_PRAGMA == 1)\r
+#include "recorderdata_linker_pragma.h"\r
+#endif\r
+RecorderDataType RecorderData =\r
+{\r
+    /* start marker, 12 chars */\r
+    0x01, 0x02, 0x03, 0x04,\r
+    0x71, 0x72, 0x73, 0x74,\r
+    0xF1, 0xF2, 0xF3, 0xF4,\r
+\r
+    /* version code - also used to determine endianness */\r
+    VERSION,\r
+\r
+    /* minor file format version */\r
+    MINOR_VERSION,\r
+    \r
+    /* irq priority order */\r
+    IRQ_PRIORITY_ORDER,\r
+\r
+    /* file size (for control) */\r
+    sizeof(RecorderDataType),\r
+\r
+    /* number of events stored so far */\r
+    0,\r
+\r
+    /* size of events buffer (in event records, each 4 bytes) */\r
+    EVENT_BUFFER_SIZE,\r
+\r
+    /* next free event index (event index, not byte address) */\r
+    0,\r
+\r
+    /* buffer is full */ \r
+    0,\r
+\r
+    /* frequency of clock user for timestamps, in Hz - should be 0 here\r
+    as this is used to indicate "not yet initialized" - this is instead\r
+    initialized on the first taskswitch event. */\r
+    0,\r
+\r
+    /* the absolute timestamp of the last stored event, modulo frequency */\r
+    0,\r
+\r
+    /* the number of seconds so far */\r
+    0,\r
+\r
+    /* is recorder active (yes = 1) - note that "close" events are always \r
+        stored to keep the name-handle mapping updated!*/\r
+    0,\r
+\r
+    /* Generated by FreeRTOS+Trace in Team Admin mode. Otherwise this should be "". */\r
+    TEAM_LICENSE_CODE,\r
+\r
+    /* debug marker 0 */\r
+    0xF0F0F0F0,\r
+\r
+    /* The Object Property Table - holds info of all active objects */ \r
+    {\r
+        /* Number of object classes, also those not used */\r
+        NCLASSES,\r
+\r
+        /* The size in bytes of the object table byte pool */\r
+        DynObjTableSize,\r
+\r
+        /* The number of slots/handles available for each class */\r
+        {\r
+            NQueue,\r
+            NSemaphore,\r
+            NMutex,\r
+            NTask,\r
+            NISR\r
+        },\r
+\r
+        /* The maximum name length for each object class */\r
+        {\r
+            NameLenQueue,\r
+            NameLenSemaphore,\r
+            NameLenMutex,\r
+            NameLenTask,\r
+            NameLenISR\r
+        },\r
+\r
+        /* The total length a property table entry of the class */\r
+        {\r
+            PropertyTableSizeQueue,\r
+            PropertyTableSizeSemaphore,\r
+            PropertyTableSizeMutex,\r
+            PropertyTableSizeTask,\r
+            PropertyTableSizeISR\r
+        },\r
+\r
+        /* The start index of each class in the object property table */\r
+        {\r
+            StartIndexQueue,\r
+            StartIndexSemaphore,\r
+            StartIndexMutex,\r
+            StartIndexTask,\r
+            StartIndexISR\r
+        },\r
+\r
+        /* the object property table - encoded in a byte array using above \r
+        definitions */\r
+        {0}\r
+    },\r
+\r
+    /* debug marker 1 */\r
+    0xF1F1F1F1,\r
+\r
+    /* The Symbol Table - holds all object names used since system \r
+       startup. Every string is unique, so objects with same name will share \r
+       an entry. Each name entry has four extra bytes: byte 0-1 is a link \r
+       reference in an internal linked list, used for fast lookups, byte 2-3 \r
+       holds a reference to a channel label used for vTracePrintF format \r
+       strings, and byte 4.. holds the object name, followed by a \r
+       zero-termination.*/\r
+    {\r
+        SYMBOL_TABLE_SIZE,\r
+\r
+        /* next free index (0 is reserved to mean NULL) */\r
+        1,\r
+\r
+        /* the symbol table byte pool */\r
+        {0},\r
+\r
+        /* this is a 64 entry array holding 16-bit references (indexes) \r
+           to the most recent entry of each checksum - i.e., list heads.*/\r
+        {0},\r
+\r
+    },\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    /* example float, for float endian detection */\r
+    (float)1.0,\r
+#else\r
+    /* This code signals that no float support is included */\r
+    (uint32_t)0, \r
+#endif\r
+\r
+    /* internalErrorOccured */\r
+    0,\r
+    \r
+    /* debug marker 2 */\r
+    0xF2F2F2F2,\r
+    \r
+    /* The trace description string, can hold any information about the system, \r
+        e.g., version, configuration. Error messages from the recorder are\r
+        copied to this buffer. Also used for internal error messages.*/\r
+    TRACE_DESCRIPTION,\r
+        \r
+    /* debug marker 3 */\r
+    0xF3F3F3F3,\r
+\r
+    /* the event data buffer, size EVENT_BUFFER_SIZE*4 */\r
+    {0},\r
+\r
+    /* end markers, used to extract the trace from a RAM dump image */\r
+    0x0A, 0x0B, 0x0C, 0x0D,\r
+    0x71, 0x72, 0x73, 0x74,\r
+    0xF1, 0xF2, 0xF3, 0xF4\r
+};\r
+\r
+RecorderDataType* RecorderDataPtr = &RecorderData;\r
+\r
+/* This version of the function does nothing as the trace data is statically allocated */\r
+RecorderDataType* xTraceInitTraceData(void)\r
+{\r
+    return 0;\r
+}\r
+\r
+#elif (TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_DYNAMIC)\r
+\r
+RecorderDataType* RecorderDataPtr = NULL;\r
+\r
+/* This version of the function dynamically allocates the trace data */\r
+RecorderDataType* xTraceInitTraceData(void)\r
+{\r
+    RecorderDataType* tmp = (RecorderDataType*)pvPortMalloc(sizeof(RecorderDataType));\r
+\r
+    if (! tmp)\r
+    {\r
+        vTraceError("Malloc failed in xTraceInitTraceData! Reduce size constants in trcConfig.h");\r
+        return NULL;\r
+    }\r
+    \r
+    (void)memset(tmp, 0, sizeof(RecorderDataType));\r
+\r
+    tmp->startmarker0 = 0x01;\r
+    tmp->startmarker1 = 0x02;\r
+    tmp->startmarker2 = 0x03;\r
+    tmp->startmarker3 = 0x04;\r
+    tmp->startmarker4 = 0x71;\r
+    tmp->startmarker5 = 0x72;\r
+    tmp->startmarker6 = 0x73;\r
+    tmp->startmarker7 = 0x74;\r
+    tmp->startmarker8 = 0xF1;\r
+    tmp->startmarker9 = 0xF2;\r
+    tmp->startmarker10 = 0xF3;\r
+    tmp->startmarker11 = 0xF4;\r
+    tmp->version = VERSION;\r
+    tmp->minor_version = MINOR_VERSION;\r
+    tmp->irq_priority_order = IRQ_PRIORITY_ORDER;\r
+    tmp->filesize = sizeof(RecorderDataType);\r
+    \r
+    tmp->maxEvents = EVENT_BUFFER_SIZE;\r
+    \r
+    tmp->debugMarker0 = 0xF0F0F0F0;\r
+    tmp->ObjectPropertyTable.NumberOfObjectClasses = NCLASSES;\r
+    tmp->ObjectPropertyTable.ObjectPropertyTableSizeInBytes = DynObjTableSize;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[0] = NQueue;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[1] = NSemaphore;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[2] = NMutex;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[3] = NTask;\r
+    tmp->ObjectPropertyTable.NumberOfObjectsPerClass[4] = NISR;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[0] = NameLenQueue;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[1] = NameLenSemaphore;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[2] = NameLenMutex;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[3] = NameLenTask;\r
+    tmp->ObjectPropertyTable.NameLengthPerClass[4] = NameLenISR;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[0] = PropertyTableSizeQueue;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[1] = PropertyTableSizeSemaphore;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[2] = PropertyTableSizeMutex;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[3] = PropertyTableSizeTask;\r
+    tmp->ObjectPropertyTable.TotalPropertyBytesPerClass[4] = PropertyTableSizeISR;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[0] = StartIndexQueue;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[1] = StartIndexSemaphore;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[2] = StartIndexMutex;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[3] = StartIndexTask;\r
+    tmp->ObjectPropertyTable.StartIndexOfClass[4] = StartIndexISR;    \r
+    tmp->debugMarker1 = 0xF1F1F1F1;\r
+    tmp->SymbolTable.symTableSize = SYMBOL_TABLE_SIZE;\r
+    tmp->SymbolTable.nextFreeSymbolIndex = 1;\r
+#if (INCLUDE_FLOAT_SUPPORT == 1)\r
+    tmp->exampleFloatEncoding = (float)1.0; /* otherwize already zero */\r
+#endif\r
+    tmp->debugMarker2 = 0xF2F2F2F2;    \r
+    (void)strncpy(tmp->systemInfo, TRACE_DESCRIPTION, TRACE_DESCRIPTION_MAX_LENGTH);\r
+    tmp->debugMarker3 = 0xF3F3F3F3;\r
+    tmp->endmarker0 = 0x0A;\r
+    tmp->endmarker1 = 0x0B;\r
+    tmp->endmarker2 = 0x0C;\r
+    tmp->endmarker3 = 0x0D;\r
+    tmp->endmarker4 = 0x71;\r
+    tmp->endmarker5 = 0x72;\r
+    tmp->endmarker6 = 0x73;\r
+    tmp->endmarker7 = 0x74;\r
+    tmp->endmarker8 = 0xF1;\r
+    tmp->endmarker9 = 0xF2;\r
+    tmp->endmarker10 = 0xF3;\r
+    tmp->endmarker11 = 0xF4;\r
+    \r
+    RecorderDataPtr = tmp;\r
+\r
+    return (RecorderDataType*)RecorderDataPtr;\r
+}\r
+\r
+#endif\r
+\r
+volatile int recorder_busy = 0;\r
+\r
+char sprintfBuffer[150];\r
+\r
+/* For debug printouts - the names of the object classes */\r
+char OBJECTCLASSNAME[NCLASSES][10] =\r
+{\r
+        "QUEUE",\r
+        "SEMAPHORE",\r
+        "MUTEX",\r
+        "TASK",\r
+        "ISR"\r
+};\r
+\r
+/* Initialization of the handle mechanism, see e.g, xTraceGetObjectHandle */\r
+objectHandleStackType objectHandleStacks =\r
+{\r
+        /* indexOfNextAvailableHandle */\r
+        {\r
+                0,\r
+                NQueue,\r
+                NQueue + NSemaphore,\r
+                NQueue + NSemaphore + NMutex,\r
+                NQueue + NSemaphore + NMutex + NTask\r
+        },\r
+\r
+        /* lowestIndexOfClass */\r
+        {\r
+                0,\r
+                NQueue,\r
+                NQueue + NSemaphore,\r
+                NQueue + NSemaphore + NMutex,\r
+                NQueue + NSemaphore + NMutex + NTask\r
+        },\r
+\r
+        /* highestIndexOfClass */\r
+        {\r
+                NQueue - 1,\r
+                NQueue + NSemaphore - 1,\r
+                NQueue + NSemaphore + NMutex - 1,\r
+                NQueue + NSemaphore + NMutex + NTask - 1,\r
+                NQueue + NSemaphore + NMutex + NTask + NISR - 1\r
+        },\r
+        {0},\r
+        {0}\r
+};\r
+\r
+\r
+/* Used for internal state flags of objects */\r
+uint8_t excludedFlags[(NEventCodes+NQueue+NSemaphore+NMutex+NTask) / 8 + 1];\r
+uint8_t ifeFlags[NTask / 8 + 1];\r
+\r
+/* Gives the last error message of the recorder. NULL if no error message. */\r
+char* traceErrorMessage = NULL;\r
+\r
+void* xTraceNextFreeEventBufferSlot(void)\r
+{\r
+    if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+    {\r
+        vTraceError("Attempt to index outside event buffer!");\r
+        return NULL;\r
+    }\r
+    return (void*)(&RecorderDataPtr->\r
+                   eventData[RecorderDataPtr->nextFreeIndex*4]);\r
+}\r
+\r
+uint16_t uiIndexOfObject(objectHandleType objecthandle, uint8_t objectclass)\r
+{\r
+    if ((objectclass < NCLASSES) && (objecthandle > 0) && (objecthandle <= \r
+    RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))\r
+    {\r
+        return (uint16_t)(RecorderDataPtr->\r
+            ObjectPropertyTable.StartIndexOfClass[objectclass] + \r
+            (RecorderDataPtr->\r
+            ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * \r
+            (objecthandle-1)));\r
+    }\r
+    \r
+    vTraceError("Object table lookup with invalid object handle or object class!");    \r
+    return 0;\r
+}\r
+\r
+/*******************************************************************************\r
+ * Object handle system \r
+ * This provides a mechanism to assign each kernel object (tasks, queues, etc)\r
+ * with a 1-byte handle, that is used to identify the object in the trace.\r
+ * This way, only one byte instead of four is necessary to identify the object.\r
+ * This allows for maximum 255 objects, of each object class, active at any\r
+ * moment.\r
+ * Note that zero is reserved as an error code and is not a valid handle.\r
+ * \r
+ * In order to allow for fast dynamic allocation and release of object handles, \r
+ * the handles of each object class (e.g., TASK) are stored in a stack. When a \r
+ * handle is needed, e.g., on task creation, the next free handle is popped from \r
+ * the stack. When an object (e.g., task) is deleted, its handle is pushed back \r
+ * on the stack and can thereby be reused for other objects.\r
+ * \r
+ * Since this allows for reuse of object handles, a specific handle (e.g, "8") \r
+ * may refer to TASK_X at one point, and later mean "TASK_Y". To resolve this, \r
+ * the recorder uses "Close events", which are stored in the main event buffer \r
+ * when objects are deleted and their handles are released. The close event \r
+ * contains the mapping between object handle and object name which was valid up\r
+ * to this point in time. The object name is stored as a symbol table entry. \r
+ ******************************************************************************/\r
+\r
+objectHandleType xTraceGetObjectHandle(traceObjectClass objectclass)\r
+{\r
+    static objectHandleType handle;\r
+    static int indexOfHandle;\r
+\r
+    indexOfHandle = objectHandleStacks.indexOfNextAvailableHandle[objectclass];\r
+    if (objectHandleStacks.objectHandles[indexOfHandle] == 0)\r
+    {\r
+        /* Zero is used to indicate a never before used handle, i.e.,\r
+           new slots in the handle stack. The handle slot needs to \r
+           be initialized here (starts at 1). */\r
+        objectHandleStacks.objectHandles[indexOfHandle] = \r
+            (objectHandleType)(1 + indexOfHandle - \r
+            objectHandleStacks.lowestIndexOfClass[objectclass]);\r
+    }\r
+\r
+    handle = objectHandleStacks.objectHandles[indexOfHandle];\r
+    \r
+    if ( objectHandleStacks.indexOfNextAvailableHandle[objectclass] \r
+        > objectHandleStacks.highestIndexOfClass[objectclass] )\r
+    {\r
+        /* ERROR */\r
+        switch(objectclass)\r
+        {\r
+        case TRACE_CLASS_TASK:\r
+            vTraceError("Not enough TASK handles - increase NTask in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_ISR:\r
+            vTraceError("Not enough ISR handles - increase NISR in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_SEMAPHORE:\r
+            vTraceError("Not enough SEMAPHORE handles - increase NSemaphore in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_MUTEX:\r
+            vTraceError("Not enough MUTEX handles - increase NMutex in trcConfig.h");         \r
+            break;\r
+        case TRACE_CLASS_QUEUE:\r
+            vTraceError("Not enough QUEUE handles - increase NQueue in trcConfig.h");         \r
+            break;\r
+        default:\r
+            vTraceError("Invalid object class.");\r
+            break;\r
+        }\r
+        \r
+        handle = 0; /* an invalid/anonymous handle - but the recorder is stopped now... */\r
+    }\r
+    else\r
+    {\r
+        int hndCount;\r
+        objectHandleStacks.indexOfNextAvailableHandle[objectclass]++;\r
+        \r
+        hndCount = objectHandleStacks.indexOfNextAvailableHandle[objectclass] - \r
+            objectHandleStacks.lowestIndexOfClass[objectclass];\r
+        \r
+        if (hndCount > \r
+            objectHandleStacks.handleCountWaterMarksOfClass[objectclass])\r
+        {\r
+            objectHandleStacks.handleCountWaterMarksOfClass[objectclass] = \r
+                (objectHandleType)hndCount;\r
+        }\r
+    }\r
+\r
+    return handle;\r
+}\r
+\r
+void vTraceFreeObjectHandle(traceObjectClass objectclass, objectHandleType handle)\r
+{\r
+    int indexOfHandle;\r
+\r
+    /* Check that there is room to push the handle on the stack */\r
+    if ( (objectHandleStacks.indexOfNextAvailableHandle[objectclass] - 1) < \r
+        objectHandleStacks.lowestIndexOfClass[objectclass] )\r
+    {\r
+        /* Error */\r
+        vTraceError("Attempt to free more handles than allocated! (duplicate xTaskDelete or xQueueDelete?)");\r
+    }\r
+    else\r
+    {\r
+        objectHandleStacks.indexOfNextAvailableHandle[objectclass]--;\r
+        indexOfHandle = objectHandleStacks.indexOfNextAvailableHandle[objectclass];\r
+        objectHandleStacks.objectHandles[indexOfHandle] = handle;\r
+    }\r
+\r
+}\r
+\r
+/*******************************************************************************\r
+ * Objects Property Table \r
+ *\r
+ * This holds the names and properties of the currently active objects, such as\r
+ * tasks and queues. This is developed to support "dynamic" objects which might\r
+ * be deleted during runtime. Their handles are only valid during their\r
+ * lifetime, i.e., from create to delete, as they might be reused on later\r
+ * create operations. When an object is deleted from the OPT, its data is moved\r
+ * to the trace buffer and/or the symbol table.\r
+ * When an object (task, queue, etc.) is created, it receives a handle, which\r
+ * together with the object class specifies its location in the OPT. Thus,\r
+ * objects of different types may share the same name and/or handle, but still\r
+ * be independent objects.\r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * vTraceSetObjectName\r
+ *\r
+ * Registers the names of queues, semaphores and other kernel objects in the\r
+ * recorder's Object Property Table, at the given handle and object class.\r
+ ******************************************************************************/\r
+void vTraceSetObjectName(traceObjectClass objectclass, \r
+                         objectHandleType handle, \r
+                         const char* name)\r
+{\r
+    static uint16_t idx;\r
+\r
+    if (handle == 0)\r
+    {\r
+        vTraceError("Illegal handle (0) in vTraceSetObjectName.");   \r
+        return;\r
+    }\r
+    \r
+    switch(objectclass)\r
+    {\r
+        case TRACE_CLASS_TASK:\r
+        case TRACE_CLASS_ISR:\r
+        case TRACE_CLASS_SEMAPHORE:\r
+        case TRACE_CLASS_MUTEX:\r
+        case TRACE_CLASS_QUEUE:\r
+        break;\r
+    default:\r
+        vTraceError("Illegal object class in vTraceSetObjectName");   \r
+        break;            \r
+    }\r
+\r
+    if (handle > \r
+        RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass])\r
+    {\r
+        switch(objectclass)\r
+        {\r
+            case TRACE_CLASS_TASK:\r
+            vTraceError("Not enough TASK handles - increase NTask in trcConfig.h");         \r
+            break;\r
+            case TRACE_CLASS_ISR:\r
+            vTraceError("Not enough ISR handles - increase NISR in trcConfig.h");       \r
+            break;\r
+            case TRACE_CLASS_SEMAPHORE:\r
+            vTraceError("Not enough SEMAPHORE handles - increase NSemaphore in trcConfig.h");\r
+            break;\r
+            case TRACE_CLASS_MUTEX:\r
+            vTraceError("Not enough MUTEX handles - increase NMutex in trcConfig.h");\r
+            break;\r
+            case TRACE_CLASS_QUEUE:\r
+            vTraceError("Not enough QUEUE handles - increase NQueue in trcConfig.h");\r
+            break;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        idx = uiIndexOfObject(handle, objectclass);\r
+\r
+        if (traceErrorMessage == NULL)\r
+        {\r
+            (void)strncpy((char*)&(RecorderDataPtr->ObjectPropertyTable.objbytes[idx]),\r
+                    name,\r
+                    RecorderDataPtr->ObjectPropertyTable.NameLengthPerClass[ objectclass ] );\r
+#ifdef WIN32\r
+            printf("vTraceSetObjectName(%d, %d, %s)\n", objectclass, handle, name);\r
+#endif\r
+        }\r
+    }\r
+}\r
+\r
+traceLabel prvTraceOpenSymbol(const char* name, traceLabel userEventChannel)\r
+{\r
+    static uint16_t result;\r
+    static uint8_t len;\r
+    static uint8_t crc;\r
+    len = 0;\r
+    crc = 0;\r
+    prvTraceGetChecksum(name, &crc, &len);\r
+\r
+    trcCRITICAL_SECTION_BEGIN();\r
+    result = prvTraceLookupSymbolTableEntry(name, crc, len, userEventChannel);\r
+    if (!result)\r
+    {\r
+        result = prvTraceCreateSymbolTableEntry(name, crc, len, userEventChannel);\r
+    }\r
+    trcCRITICAL_SECTION_END();\r
+\r
+    return result;\r
+}\r
+\r
+/*******************************************************************************\r
+ * Supporting functions\r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * vTraceError\r
+ *\r
+ * Called by various parts in the recorder. Stops the recorder and stores a \r
+ * pointer to an error message, which is printed by the monitor task.\r
+ * If you are not using the monitor task, you may use xTraceGetLastError() \r
+ * from your application to check if the recorder is OK.\r
+ *\r
+ * Note: If a recorder error is registered before vTraceStart is called, the \r
+ * trace start will be aborted. This can occur if any of the Nxxxx constants \r
+ * (e.g., NTask) in trcConfig.h is too small.\r
+ ******************************************************************************/\r
+void vTraceError(const char* msg)\r
+{\r
+    vTraceStop();\r
+    if (traceErrorMessage == NULL)\r
+    {\r
+      traceErrorMessage = (char*)msg;\r
+      (void)strncpy(RecorderDataPtr->systemInfo, \r
+          traceErrorMessage, \r
+          TRACE_DESCRIPTION_MAX_LENGTH);\r
+      RecorderDataPtr->internalErrorOccured = 1;\r
+    }\r
+}\r
+\r
+/******************************************************************************\r
+ * prvCheckDataToBeOverwrittenForMultiEntryUserEvents\r
+ *\r
+ * This checks if the next event to be overwritten is a multi-entry user event, \r
+ * i.e., a USER_EVENT followed by data entries.\r
+ * Such data entries do not have an event code at byte 0, as other events.\r
+ * All 4 bytes are user data, so the first byte of such data events must \r
+ * not be interpreted as type field. The number of data entries following\r
+ * a USER_EVENT is given in the event code of the USER_EVENT.\r
+ * Therefore, when overwriting a USER_EVENT (when using in ringbuffer mode)\r
+ * any data entries following must be replaced with NULL events (code 0).\r
+ *\r
+ * This is assumed to execute within a critical section...\r
+ *****************************************************************************/\r
+\r
+void prvCheckDataToBeOverwrittenForMultiEntryUserEvents(\r
+    uint8_t nofEntriesToCheck)\r
+{\r
+    /* Generic "int" type is desired - should be 16 bit variable on 16 bit HW */\r
+    unsigned int i = 0; \r
+    unsigned int e = 0;\r
+    while (i < nofEntriesToCheck)\r
+    {        \r
+        e = RecorderDataPtr->nextFreeIndex + i;\r
+        if ((RecorderDataPtr->eventData[e*4] > USER_EVENT) && \r
+            (RecorderDataPtr->eventData[e*4] < USER_EVENT + 16))\r
+        {\r
+            uint8_t nDataEvents = (uint8_t)(RecorderDataPtr->eventData[e*4] - USER_EVENT);\r
+            if ((e + nDataEvents) < RecorderDataPtr->maxEvents)\r
+            {\r
+                (void)memset(& RecorderDataPtr->eventData[e*4], 0, 4 + 4 * nDataEvents);\r
+            }\r
+        }\r
+        i++;\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceUpdateCounters\r
+ *\r
+ * Updates the index of the event buffer.\r
+ ******************************************************************************/\r
+void prvTraceUpdateCounters(void)\r
+{\r
+    if (RecorderDataPtr->recorderActive == 0)\r
+    {\r
+        return;\r
+    }\r
+    \r
+    RecorderDataPtr->numEvents++;\r
+\r
+    RecorderDataPtr->nextFreeIndex++;\r
+    \r
+    if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+    {   \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)       \r
+        RecorderDataPtr->bufferIsFull = 1;\r
+        RecorderDataPtr->nextFreeIndex = 0;\r
+#else\r
+        vTraceStop();\r
+#endif\r
+    }\r
+\r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+    prvCheckDataToBeOverwrittenForMultiEntryUserEvents(1);\r
+#endif\r
+    \r
+#ifdef STOP_AFTER_N_EVENTS\r
+#if (STOP_AFTER_N_EVENTS > -1)\r
+    if (RecorderDataPtr->numEvents >= STOP_AFTER_N_EVENTS)\r
+    {\r
+        vTraceStop();\r
+    }\r
+#endif\r
+#endif\r
+}\r
+    \r
+/******************************************************************************\r
+ * prvTraceGetDTS\r
+ *\r
+ * Returns a differential timestamp (DTS), i.e., the time since\r
+ * last event, and creates an XTS event if the DTS does not fit in the\r
+ * number of bits given. The XTS event holds the MSB bytes of the DTS.\r
+ *\r
+ * The parameter param_maxDTS should be 0xFF for 8-bit dts or 0xFFFF for\r
+ * events with 16-bit dts fields.\r
+ *****************************************************************************/\r
+uint16_t prvTraceGetDTS(uint16_t param_maxDTS)\r
+{\r
+    static uint32_t old_timestamp = 0;\r
+    XTSEvent* xts = 0;\r
+    uint32_t dts = 0;\r
+    uint32_t timestamp = 0;\r
+\r
+    if (RecorderDataPtr->frequency == 0)\r
+    {\r
+        /* If HWTC_PERIOD is mapped to the timer reload register,\r
+        such as in the Cortex M port, it is not initialized before\r
+        FreeRTOS has been started. We therefore store the frequency\r
+        of the timer at the first timestamped event after the \r
+        scheduler has started. (Note that this function is called\r
+        also by vTraceStart and uiTraceStart, which might be\r
+        called before the scheduler has been started.) */\r
+\r
+#if (SELECTED_PORT == PORT_Win32)    \r
+        RecorderDataPtr->frequency = 100000;\r
+#elif (SELECTED_PORT == PORT_HWIndependent)    \r
+        RecorderDataPtr->frequency = configTICK_RATE_HZ;\r
+#else        \r
+        if (xTaskGetSchedulerState() != 0) /* Has the scheduler started? */\r
+        {            \r
+            RecorderDataPtr->frequency = \r
+                 (uint32_t)HWTC_PERIOD * (uint32_t)configTICK_RATE_HZ / (uint32_t)HWTC_DIVISOR; \r
+        }\r
+#endif\r
+    }\r
+\r
+    /**************************************************************************\r
+    * The below statements read the timestamp from the timer port module.\r
+    * If necessary, whole seconds are extracted using division while the rest\r
+    * comes from the modulo operation.\r
+    **************************************************************************/\r
+    \r
+    uiTracePortGetTimeStamp(&timestamp);\r
+\r
+    /***************************************************************************\r
+    * This condition is only for the Win32 port, since it does not use the tick\r
+    * count but instead only HWTC_COUNT (from the performance counter).\r
+    * Without this condition, you sometimes get a negative dts value (converted\r
+    * into a very large unsiged value) when the performance counter wraps \r
+    * around. In other "normal" ports also using the FreeRTOS tick counter, this \r
+    * condition can not occur and therefore has no impact.\r
+    ***************************************************************************/\r
+    if (timestamp < old_timestamp)\r
+    {\r
+        timestamp += RecorderDataPtr->frequency;\r
+    }\r
+\r
+\r
+       dts = timestamp - old_timestamp;\r
+    old_timestamp = timestamp;\r
+    \r
+    if (RecorderDataPtr->frequency > 0)\r
+    {\r
+        /* Check if dts > 1 second */\r
+        if (dts > RecorderDataPtr->frequency)\r
+        {\r
+            /* More than 1 second has passed */\r
+            RecorderDataPtr->absTimeLastEventSecond += dts / RecorderDataPtr->frequency;\r
+            /* The part that is not an entire second is added to absTimeLastEvent */\r
+            RecorderDataPtr->absTimeLastEvent += dts % RecorderDataPtr->frequency;\r
+        }\r
+        else\r
+            RecorderDataPtr->absTimeLastEvent += dts;\r
+        \r
+        /* Check if absTimeLastEvent >= 1 second */\r
+        if (RecorderDataPtr->absTimeLastEvent >= RecorderDataPtr->frequency)\r
+        {\r
+            /* RecorderDataPtr->absTimeLastEvent is more than or equal to 1 second, but always less than 2 seconds */\r
+            RecorderDataPtr->absTimeLastEventSecond++;\r
+            RecorderDataPtr->absTimeLastEvent -= RecorderDataPtr->frequency;\r
+            /* RecorderDataPtr->absTimeLastEvent is now less than 1 second */\r
+        }\r
+    }\r
+    else\r
+    {\r
+        /* Special case if the recorder has not yet started (frequency may be uninitialized, i.e., zero) */\r
+        RecorderDataPtr->absTimeLastEvent = timestamp;\r
+    }\r
+\r
+    /* If the dts (time since last event) does not fit in event->dts (only 8 or 16 bits) */\r
+    if (dts > param_maxDTS)\r
+    {\r
+        /* Create an XTS event (eXtended TimeStamp) containing the higher dts bits*/\r
+        xts = (XTSEvent*) xTraceNextFreeEventBufferSlot();\r
+\r
+        if (xts != NULL)\r
+        {\r
+            if (param_maxDTS == 0xFFFF)\r
+            {\r
+                xts->type = XTS16;\r
+                xts->xts_16 = (uint16_t)((dts / 0x10000) & 0xFFFF);\r
+                xts->xts_8 = 0;\r
+            }\r
+            else if (param_maxDTS == 0xFF)\r
+            {\r
+                xts->type = XTS8;\r
+                xts->xts_16 = (uint16_t)((dts / 0x100) & 0xFFFF);\r
+                xts->xts_8 = (uint8_t)((dts / 0x1000000) & 0xFF);\r
+            }\r
+            else\r
+            {\r
+                vTraceError("Bad param_maxDTS in prvTraceGetDTS");\r
+            }\r
+            prvTraceUpdateCounters();\r
+        }\r
+    }\r
+\r
+    return (uint16_t)(dts % (param_maxDTS + 1));\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceLookupSymbolTableEntry\r
+ *\r
+ * Find an entry in the symbol table, return 0 if not present.\r
+ *\r
+ * The strings are stored in a byte pool, with four bytes of "meta-data" for\r
+ * every string.\r
+ * byte 0-1: index of next entry with same checksum (for fast lookup).\r
+ * byte 2-3: reference to a symbol table entry, a label for vTracePrintF\r
+ * format strings only (the handle of the destination channel).\r
+ * byte 4..(4 + length): the string (object name or user event label), with\r
+ * zero-termination\r
+ ******************************************************************************/\r
+traceLabel prvTraceLookupSymbolTableEntry(const char* name, \r
+                                          uint8_t crc6, \r
+                                          uint8_t len, \r
+                                          traceLabel chn)\r
+{\r
+    uint16_t i = RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ];\r
+\r
+    while (i != 0)\r
+    {\r
+        if (RecorderDataPtr->SymbolTable.symbytes[i + 2] == (chn & 0x00FF))\r
+        {\r
+            if (RecorderDataPtr->SymbolTable.symbytes[i + 3] == (chn / 0x100))\r
+            {\r
+                if (RecorderDataPtr->SymbolTable.symbytes[i + 4 + len] == '\0')\r
+                {\r
+                    if (strncmp((char*)(& RecorderDataPtr->SymbolTable.symbytes[i + 4]), name, len) == 0)\r
+                    {\r
+                        break; /* found */\r
+                    }\r
+                }\r
+            }\r
+        }\r
+        i = (uint16_t)(RecorderDataPtr->SymbolTable.symbytes[i] + (RecorderDataPtr->SymbolTable.symbytes[i + 1] * 0x100));\r
+    }\r
+    return i;\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceCreateSymbolTableEntry\r
+ *\r
+ * Creates an entry in the symbol table, independent if it exists already.\r
+ *\r
+ * The strings are stored in a byte pool, with four bytes of "meta-data" for\r
+ * every string.\r
+ * byte 0-1: index of next entry with same checksum (for fast lookup).\r
+ * byte 2-3: reference to a symbol table entry, a label for vTracePrintF\r
+ * format strings only (the handle of the destination channel).\r
+ * byte 4..(4 + length): the string (object name or user event label), with\r
+ * zero-termination\r
+ ******************************************************************************/\r
+uint16_t prvTraceCreateSymbolTableEntry(const char* name, \r
+                                        uint8_t crc6, \r
+                                        uint8_t len, \r
+                                        traceLabel channel)\r
+{\r
+    uint16_t ret = 0;\r
+    if (RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + len + 4 >= SYMBOL_TABLE_SIZE)\r
+    {\r
+        vTraceError("Symbol table full. Increase SYMBOL_TABLE_SIZE in trcConfig.h");\r
+        ret = 0;        \r
+    }\r
+    else\r
+    {\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex] = \r
+            (uint8_t)(RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ] & 0x00FF);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 1] = \r
+            (uint8_t)(RecorderDataPtr->SymbolTable.latestEntryOfChecksum[ crc6 ] / 0x100);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 2] = \r
+            (uint8_t)(channel & 0x00FF);\r
+\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 3] = \r
+            (uint8_t)(channel / 0x100);\r
+\r
+        /* set name (bytes 4...4+len-1) */\r
+        (void)strncpy((char*)&( RecorderDataPtr->SymbolTable.symbytes\r
+            [ RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 4] ), name, len);\r
+\r
+        /* Set zero termination (at offest 4+len) */\r
+        RecorderDataPtr->SymbolTable.symbytes\r
+            [RecorderDataPtr->SymbolTable.nextFreeSymbolIndex + 4 + len] = '\0';\r
+\r
+        /* store index of entry (for return value, and as head of LL[crc6]) */\r
+        RecorderDataPtr->SymbolTable.latestEntryOfChecksum\r
+            [ crc6 ] = (uint16_t)RecorderDataPtr->SymbolTable.nextFreeSymbolIndex;\r
+        \r
+        RecorderDataPtr->SymbolTable.nextFreeSymbolIndex += (len + 5);\r
+        \r
+        ret = (uint16_t)(RecorderDataPtr->SymbolTable.nextFreeSymbolIndex - \r
+            (len + 5));\r
+    }\r
+    \r
+    return ret;\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+ * prvTraceGetChecksum\r
+ *\r
+ * Calculates a simple 6-bit checksum from a string, used to index the string \r
+ * for fast symbol table lookup.\r
+ ******************************************************************************/\r
+void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength)\r
+{\r
+   unsigned char c;\r
+   int length = 0;\r
+   int crc = 0;\r
+   if ( pname != (const char *) 0 )\r
+   {\r
+      for ( ; (c = *pname++) != '\0'; )\r
+      {\r
+         crc += c;\r
+         length++;\r
+      }\r
+   }\r
+   *pcrc = (uint8_t)(crc % 64);\r
+   *plength = (uint8_t)length;\r
+}\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernel.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcKernel.c
new file mode 100644 (file)
index 0000000..98b84a8
--- /dev/null
@@ -0,0 +1,491 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcKernel.c\r
+ *\r
+ * Functions for integration of the trace recorder library in the FreeRTOS \r
+ * kernel (requires FreeRTOS v7.1.0 or later).\r
+ * \r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+\r
+\r
+/******************************************************************************\r
+ * TraceObjectClassTable\r
+ * Translates a FreeRTOS QueueType into trace objects classes (TRACE_CLASS_).\r
+ * This was added since we want to map both types of Mutex and both types of \r
+ * Semaphores on common classes for all Mutexes and all Semaphores respectively. \r
+ * \r
+ * FreeRTOS Queue types\r
+ * #define queueQUEUE_TYPE_BASE                  ( 0U ) => TRACE_CLASS_QUEUE\r
+ * #define queueQUEUE_TYPE_MUTEX                 ( 1U ) => TRACE_CLASS_MUTEX\r
+ * #define queueQUEUE_TYPE_COUNTING_SEMAPHORE    ( 2U ) => TRACE_CLASS_SEMAPHORE\r
+ * #define queueQUEUE_TYPE_BINARY_SEMAPHORE      ( 3U ) => TRACE_CLASS_SEMAPHORE\r
+ * #define queueQUEUE_TYPE_RECURSIVE_MUTEX       ( 4U ) => TRACE_CLASS_MUTEX \r
+ ******************************************************************************/\r
+traceObjectClass TraceObjectClassTable[5]        =  {TRACE_CLASS_QUEUE,     \r
+                                                     TRACE_CLASS_MUTEX,      \r
+                                                     TRACE_CLASS_SEMAPHORE,  \r
+                                                     TRACE_CLASS_SEMAPHORE,\r
+                                                     TRACE_CLASS_MUTEX };\r
+\r
+/* This is defined in FreeRTOS! */\r
+extern volatile void * volatile pxCurrentTCB; \r
+\r
+/* Internal variables */\r
+uint8_t nISRactive = 0;\r
+objectHandleType handle_of_last_logged_task = 0;\r
+uint8_t inExcludedTask = 0;\r
+\r
+static uint8_t prvTraceIsObjectExcluded(traceObjectClass, uint32_t);\r
+\r
+/*******************************************************************************\r
+ * prvTraceIsObjectExcluded\r
+ *\r
+ * Private function that accepts an object class and an object number and uses\r
+ * that to determine if the object has been flagged as excluded.\r
+ ******************************************************************************/\r
+static uint8_t prvTraceIsObjectExcluded(traceObjectClass objectClass, uint32_t objectNumber)\r
+{\r
+    switch(objectClass)\r
+    {\r
+    case TRACE_CLASS_QUEUE:\r
+        return GET_QUEUE_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_SEMAPHORE:\r
+        return GET_SEMAPHORE_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_MUTEX:\r
+        return GET_MUTEX_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    case TRACE_CLASS_TASK:\r
+        return GET_TASK_FLAG_ISEXCLUDED(objectNumber);\r
+        break;\r
+    }\r
+    return 0;\r
+}\r
+\r
+#if !defined INCLUDE_READY_EVENTS || INCLUDE_READY_EVENTS == 1\r
+/*******************************************************************************\r
+ * vTraceStoreTaskReady\r
+ *\r
+ * This function stores a ready state for the task handle sent in as parameter.\r
+ ******************************************************************************/\r
+void vTraceStoreTaskReady(objectHandleType handle)\r
+{\r
+    uint16_t dts3;\r
+    TREvent* tr;\r
+\r
+    if (!GET_TASK_FLAG_ISEXCLUDED(handle))\r
+    {\r
+        dts3 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+        {\r
+            tr = (TREvent*)xTraceNextFreeEventBufferSlot();\r
+\r
+            if (tr != NULL)\r
+            {\r
+                tr->type = TR_TASK_READY;\r
+                tr->dts = dts3;\r
+                tr->objHandle = handle;\r
+\r
+                prvTraceUpdateCounters();    \r
+            }\r
+        }\r
+    }\r
+}\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCall\r
+ *\r
+ * This is the main integration point for storing FreeRTOS kernel calls, and\r
+ * is called by the hooks in FreeRTOS.h (see trcKernel.h for event codes).\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCall(uint32_t ecode, traceObjectClass objectClass, uint32_t objectNumber)\r
+{\r
+    KernelCall * kse;\r
+    uint16_t dts1;\r
+\r
+    if (handle_of_last_logged_task == 0)\r
+    {\r
+        return;\r
+    }\r
+    \r
+    if (RecorderDataPtr->recorderActive)\r
+    {\r
+        \r
+        /* If it is an ISR or NOT an excluded task, this kernel call will be stored in the trace */\r
+        if (nISRactive || !inExcludedTask)\r
+        {\r
+            /* Make sure ISRs never change the IFE flags of tasks */\r
+            if (!nISRactive)\r
+            {\r
+                /* This checks if this is the first kernel call after a call to\r
+                vTraceTaskInstanceIsFinished. In that case, calls to this kernel service \r
+                with this specific kernel object become the "instance finish event"\r
+                (IFE) of the calling task.*/\r
+                if (GET_TASK_FLAG_MARKIFE(handle_of_last_logged_task))\r
+                {\r
+                    /* Reset the flag - this has been handled now */\r
+                    CLEAR_TASK_FLAG_MARKIFE(handle_of_last_logged_task);\r
+\r
+                    /* Store the kernel service tagged as instance finished event */\r
+                    PROPERTY_TASK_IFE_SERVICECODE(handle_of_last_logged_task) = \r
+                      (uint8_t)ecode;                \r
+\r
+                    /* Store the handle of the specific kernel object */\r
+                    PROPERTY_TASK_IFE_OBJHANDLE(handle_of_last_logged_task) =\r
+                      (objectHandleType)objectNumber;    \r
+                }\r
+            }\r
+            \r
+            /* Check if the referenced object or the event code is excluded */\r
+            if (!prvTraceIsObjectExcluded(objectClass, objectNumber) && !GET_EVENT_CODE_FLAG_ISEXCLUDED(ecode))\r
+            {\r
+                trcCRITICAL_SECTION_BEGIN();\r
+                dts1 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+                if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+                {           \r
+                    kse = (KernelCall*) xTraceNextFreeEventBufferSlot();\r
+                    if (kse != NULL)\r
+                    {\r
+                        kse->dts = dts1;\r
+                        kse->type = (uint8_t)ecode;\r
+                        kse->objHandle = (uint8_t)objectNumber;\r
+                        prvTraceUpdateCounters();\r
+                    }\r
+                }\r
+                trcCRITICAL_SECTION_END();\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCallWithParam\r
+ *\r
+ * Used for storing kernel calls with a handle and a numeric parameter. This is\r
+ * only used for traceTASK_PRIORITY_SET at the moment.\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCallWithParam(uint32_t evtcode,\r
+                                    traceObjectClass objectClass,\r
+                                    uint32_t objectNumber,\r
+                                    uint8_t param)\r
+{\r
+    KernelCallWithParamAndHandle * kse;\r
+    uint8_t dts2;\r
+\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task && \r
+        (! inExcludedTask || nISRactive))\r
+    {\r
+        /* Check if the referenced object or the event code is excluded */\r
+        if (!prvTraceIsObjectExcluded(objectClass, objectNumber) && !GET_EVENT_CODE_FLAG_ISEXCLUDED(evtcode))\r
+        {\r
+            trcCRITICAL_SECTION_BEGIN();\r
+            dts2 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+            if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+            {                \r
+                kse = (KernelCallWithParamAndHandle*) xTraceNextFreeEventBufferSlot();\r
+                if (kse != NULL)\r
+                {\r
+                    kse->dts = dts2;\r
+                    kse->type = (uint8_t)evtcode;\r
+                    kse->objHandle = (uint8_t)objectNumber;\r
+                    kse->param = param;\r
+                    prvTraceUpdateCounters();    \r
+                }\r
+            }\r
+            trcCRITICAL_SECTION_END();\r
+        }\r
+    }\r
+}\r
+\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreKernelCallWithNumericParamOnly\r
+ *\r
+ * Used for storing kernel calls with numeric parameters only. This is\r
+ * only used for traceTASK_DELAY and traceDELAY_UNTIL at the moment.\r
+ ******************************************************************************/\r
+void vTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, uint16_t param)\r
+{\r
+    KernelCallWithParam16 * kse;\r
+    uint8_t dts6;\r
+\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task \r
+        && (! inExcludedTask || nISRactive))\r
+    {\r
+        /* Check if the event code is excluded */\r
+        if (!GET_EVENT_CODE_FLAG_ISEXCLUDED(evtcode))\r
+        {\r
+            trcCRITICAL_SECTION_BEGIN();\r
+            dts6 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+            if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+            {                \r
+                kse = (KernelCallWithParam16*) xTraceNextFreeEventBufferSlot();\r
+                if (kse != NULL)\r
+                {\r
+                    kse->dts = dts6;\r
+                    kse->type = (uint8_t)evtcode;\r
+                    kse->param = param;\r
+                    prvTraceUpdateCounters();    \r
+                }\r
+            }\r
+            trcCRITICAL_SECTION_END();\r
+        }\r
+    }\r
+}\r
+\r
+objectHandleType handle_of_running_task = 0;\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreTaskswitch\r
+ * Called by the scheduler from the SWITCHED_OUT hook, and by uiTraceStart.\r
+ * At this point interrupts are assumed to be disabled!\r
+ ******************************************************************************/\r
+void vTraceStoreTaskswitch(void)\r
+{\r
+    uint16_t dts3;\r
+    TSEvent* ts;        \r
+    int8_t skipEvent = 0;\r
+    uint32_t schedulerState = 0;\r
+    \r
+    /*************************************************************************** \r
+    This is used to detect if a high-priority ISRs is illegally using the \r
+    recorder ISR trace functions (vTraceStoreISRBegin and ...End) while the \r
+    recorder is busy with a task-level event or lower priority ISR event.\r
+    \r
+    If this is detected, it triggers a call to vTraceError with the error \r
+    "Illegal call to vTraceStoreISRBegin/End". If you get this error, it means\r
+    that the macro taskENTER_CRITICAL does not disable this ISR, as required.\r
+    You can solve this by adjusting the value of the FreeRTOS constant\r
+    configMAX_SYSCALL_INTERRUPT_PRIORITY, which is defined in FreeRTOSConfig.h\r
+\r
+    Note: Setting recorder_busy is normally handled in our macros\r
+    trcCRITICAL_SECTION_BEGIN and _END, but is needed explicitly in this \r
+    function since critical sections should not be used in the context switch \r
+    event...)    \r
+    ***************************************************************************/\r
+    recorder_busy++; \r
+    \r
+    schedulerState = xTaskGetSchedulerState();\r
+\r
+    if (schedulerState == 0)\r
+    {\r
+        /* This occurs on the very first taskswitch event, generated by \r
+        vTraceStart and uiTraceStart if the scheduler is not yet started.\r
+        This creates a dummy "(startup)" task entry internally in the\r
+        recorder */\r
+        if (handle_of_running_task == 0)\r
+        {\r
+            handle_of_running_task = xTraceGetObjectHandle(TRACE_CLASS_TASK);\r
+\r
+            vTraceSetObjectName(TRACE_CLASS_TASK, \r
+                handle_of_running_task,\r
+                "(startup)");\r
+\r
+            vTraceSetPriorityProperty(TRACE_CLASS_TASK,\r
+                handle_of_running_task,\r
+                0);\r
+        }        \r
+    }\r
+    else\r
+    {    \r
+        handle_of_running_task = \r
+        (objectHandleType)uxTaskGetTaskNumber(xTaskGetCurrentTaskHandle());\r
+    }\r
+    \r
+    /* Skip the event if the task has been excluded, using vTraceExcludeTask */\r
+    if (GET_TASK_FLAG_ISEXCLUDED(handle_of_running_task))\r
+    {    \r
+        skipEvent = 1;\r
+        inExcludedTask = 1;            \r
+    }\r
+    else\r
+        inExcludedTask = 0;\r
+        \r
+\r
+    /* Skip the event if the same task is scheduled */\r
+    if (handle_of_running_task == handle_of_last_logged_task)\r
+    {\r
+        skipEvent = 1;\r
+    }\r
+  \r
+    if (! RecorderDataPtr->recorderActive)\r
+    {\r
+        skipEvent = 1;\r
+    }\r
+\r
+    /* If this event should be logged, log it! */\r
+    if (skipEvent == 0)    \r
+    {    \r
+        dts3 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+        \r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
+        {\r
+            handle_of_last_logged_task = handle_of_running_task;            \r
+            ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+\r
+            if (ts != NULL)\r
+            {\r
+                if (uiTraceGetObjectState(TRACE_CLASS_TASK,\r
+                    handle_of_last_logged_task) == TASK_STATE_INSTANCE_ACTIVE)\r
+                {\r
+                    ts->type = TS_TASK_RESUME;\r
+                }\r
+                else\r
+                {\r
+                    ts->type = TS_TASK_BEGIN;\r
+                }\r
+\r
+                ts->dts = dts3;\r
+                ts->objHandle = handle_of_last_logged_task;\r
+\r
+                vTraceSetObjectState(TRACE_CLASS_TASK, \r
+                                     handle_of_last_logged_task, \r
+                                     TASK_STATE_INSTANCE_ACTIVE);\r
+\r
+                prvTraceUpdateCounters();    \r
+            }\r
+        }\r
+    }    \r
+\r
+    /* See comment on recorder_busy++ above. */\r
+    recorder_busy--; \r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreNameCloseEvent\r
+ *\r
+ * Updates the symbol table with the name of this object from the dynamic\r
+ * objects table and stores a "close" event, holding the mapping between handle\r
+ * and name (a symbol table handle). The stored name-handle mapping is thus the\r
+ * "old" one, valid up until this point.\r
+ ******************************************************************************/\r
+#if (INCLUDE_OBJECT_DELETE == 1)\r
+void vTraceStoreObjectNameOnCloseEvent(objectHandleType handle, \r
+                                       traceObjectClass objectclass)\r
+{    \r
+    ObjCloseNameEvent * ce;\r
+    const char * name;\r
+    traceLabel idx;\r
+\r
+    name = PROPERTY_NAME_GET(objectclass, handle);\r
+\r
+    idx = prvTraceOpenSymbol(name, 0);\r
+    \r
+    // Interrupt disable not necessary, already done in trcHooks.h macro\r
+    ce = (ObjCloseNameEvent*) xTraceNextFreeEventBufferSlot(); \r
+    if (ce != NULL)\r
+    {\r
+        ce->type = EVENTGROUP_OBJCLOSE_NAME + objectclass;\r
+        ce->objHandle = handle;\r
+        ce->symbolIndex = idx;\r
+        prvTraceUpdateCounters();\r
+    }\r
+    \r
+}\r
+\r
+void vTraceStoreObjectPropertiesOnCloseEvent(objectHandleType handle, \r
+                                             traceObjectClass objectclass)\r
+{\r
+    ObjClosePropEvent * pe;\r
+\r
+    if (objectclass == TRACE_CLASS_ISR)\r
+    {        \r
+        /* ISR handles should not be closed - never called for ISR */\r
+        return;\r
+    }\r
+\r
+    // Interrupt disable not necessary, already done in trcHooks.h macro\r
+    pe = (ObjClosePropEvent*) xTraceNextFreeEventBufferSlot();\r
+    if (pe != NULL)\r
+    {\r
+        if (objectclass == TRACE_CLASS_TASK)\r
+        {\r
+            pe->arg1 = PROPERTY_ACTOR_PRIORITY(objectclass, handle);\r
+            pe->arg2 = PROPERTY_TASK_IFE_SERVICECODE(handle);\r
+            pe->arg3 = PROPERTY_TASK_IFE_OBJHANDLE(handle);\r
+            PROPERTY_TASK_IFE_SERVICECODE(handle) = 0;\r
+            PROPERTY_TASK_IFE_OBJHANDLE(handle) = 0;\r
+        }else{\r
+            pe->arg1 = PROPERTY_OBJECT_STATE(objectclass, handle);\r
+        }\r
+        pe->type = EVENTGROUP_OBJCLOSE_PROP + objectclass;    \r
+        prvTraceUpdateCounters();\r
+    }\r
+}\r
+#endif\r
+\r
+void vTraceSetPriorityProperty(uint8_t objectclass, uint8_t id, uint8_t value)\r
+{\r
+    PROPERTY_ACTOR_PRIORITY(objectclass, id) = value;\r
+}\r
+\r
+uint8_t uiTraceGetPriorityProperty(uint8_t objectclass, uint8_t id)\r
+{\r
+    return PROPERTY_ACTOR_PRIORITY(objectclass, id);\r
+}\r
+\r
+void vTraceSetObjectState(uint8_t objectclass, uint8_t id, uint8_t value)\r
+{\r
+    PROPERTY_OBJECT_STATE(objectclass, id) = value;\r
+}\r
+\r
+void vTraceSetTaskInstanceFinished(objectHandleType handle)\r
+{\r
+#if (USE_IMPLICIT_IFE_RULES == 1)\r
+    if (PROPERTY_TASK_IFE_SERVICECODE(handle) == 0)\r
+    {\r
+        PROPERTY_OBJECT_STATE(TRACE_CLASS_TASK, handle) = 0;\r
+    }\r
+#endif\r
+}\r
+\r
+uint8_t uiTraceGetObjectState(uint8_t objectclass, uint8_t id)\r
+{\r
+    return PROPERTY_OBJECT_STATE(objectclass, id);\r
+}\r
+\r
+#endif\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcPort.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcPort.c
new file mode 100644 (file)
index 0000000..e98dd57
--- /dev/null
@@ -0,0 +1,208 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcPort.c\r
+ *\r
+ * Contains all portability issues of the trace recorder library. \r
+ * See also trcPort.h, where port-specific macros are defined.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students\r
+ * , hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user licence for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include "trcUser.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+static char* prvFileName = NULL;\r
+#endif\r
+\r
+\r
+/*******************************************************************************\r
+ * uiTraceTickCount\r
+ *\r
+ * This variable is updated by the traceTASK_INCREMENT_TICK macro in the \r
+ * FreeRTOS tick handler. This does not need to be modified when developing a \r
+ * new timer port. It is prefered to keep any timer port changes in the HWTC \r
+ * macro definitions, which typically give sufficient flexibility.\r
+ ******************************************************************************/\r
+uint32_t uiTraceTickCount = 0;\r
+\r
+/******************************************************************************\r
+ * uiTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and uiTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of uiTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ * OFFER FROM PERCEPIO:\r
+ * For silicon companies and non-corporate FreeRTOS users (researchers, students\r
+ * , hobbyists or early-phase startups) we have an attractive offer: \r
+ * Provide a hardware timer port and get a FREE single-user license for\r
+ * FreeRTOS+Trace Professional Edition. Read more about this offer at \r
+ * www.percepio.com or contact us directly at support@percepio.com.\r
+ ******************************************************************************/\r
+void uiTracePortGetTimeStamp(uint32_t *pTimestamp)\r
+{\r
+    static uint32_t last_traceTickCount = 0;\r
+    static uint32_t last_hwtc_count = 0;\r
+    uint32_t traceTickCount = 0;\r
+    uint32_t hwtc_count = 0;\r
+    \r
+    /* Retrieve HWTC_COUNT only once since the same value should be used all throughout this function. */\r
+#if (HWTC_COUNT_DIRECTION == DIRECTION_INCREMENTING)\r
+    hwtc_count = HWTC_COUNT;\r
+#elif (HWTC_COUNT_DIRECTION == DIRECTION_DECREMENTING)\r
+    hwtc_count = HWTC_PERIOD - HWTC_COUNT;\r
+#else\r
+    Junk text to cause compiler error - HWTC_COUNT_DIRECTION is not set correctly!\r
+    Should be DIRECTION_INCREMENTING or DIRECTION_DECREMENTING\r
+#endif\r
+    \r
+    if (last_traceTickCount - uiTraceTickCount - 1 < 0x80000000)\r
+    {\r
+        /* This means last_traceTickCount is higher than uiTraceTickCount,\r
+        so we have previously compensated for a missed tick.\r
+        Therefore we use the last stored value because that is more accurate. */\r
+        traceTickCount = last_traceTickCount;\r
+    }\r
+    else\r
+    {\r
+        /* Business as usual */\r
+        traceTickCount = uiTraceTickCount;\r
+    }\r
+\r
+    /* Check for overflow. May occur if the update of uiTraceTickCount has been \r
+    delayed due to disabled interrupts. */\r
+    if (traceTickCount == last_traceTickCount && hwtc_count < last_hwtc_count)\r
+    {\r
+        /* A trace tick has occurred but not been executed by the kernel, so we compensate manually. */\r
+        traceTickCount++;\r
+    }\r
+    \r
+    /* Check if the return address is OK, then we perform the calculation. */\r
+    if (pTimestamp)\r
+    {\r
+        /* Get timestamp from trace ticks. Scale down the period to avoid unwanted overflows. */\r
+        *pTimestamp = traceTickCount * (HWTC_PERIOD / HWTC_DIVISOR);\r
+        /* Increase timestamp by (hwtc_count + "lost hardware ticks from scaling down period") / HWTC_DIVISOR. */\r
+        *pTimestamp += (hwtc_count + traceTickCount * (HWTC_PERIOD % HWTC_DIVISOR)) / HWTC_DIVISOR;\r
+    }\r
+    \r
+    /* Store the previous values. */\r
+    last_traceTickCount = traceTickCount;\r
+    last_hwtc_count = hwtc_count;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called by the monitor when a recorder stop is detected.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetOutFile.\r
+ ******************************************************************************/\r
+void vTracePortEnd()\r
+{\r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Running vTracePortEnd.\n\r");\r
+\r
+    #if (WIN32_PORT_SAVE_WHEN_STOPPED == 1)\r
+    vTracePortSave();\r
+    #endif\r
+\r
+    #if (WIN32_PORT_EXIT_WHEN_STOPPED == 1)\r
+    /* In the FreeRTOS/Win32 demo, this allows for killing the application \r
+    when the recorder is stopped (e.g., when the buffer is full) */\r
+    system("pause");\r
+    exit(0);\r
+    #endif\r
+}\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path)\r
+{\r
+    prvFileName = path;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a local file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port calls \r
+ * vTracePortSave in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSave()\r
+{\r
+    char buf[180];\r
+    FILE* f;\r
+\r
+    if (prvFileName == NULL)\r
+    {\r
+        prvFileName = "FreeRTOSPlusTrace.dump";\r
+        sprintf(buf, "No filename specified, using default \"%s\".", prvFileName);\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+\r
+    fopen_s(&f, prvFileName, "wb");\r
+    if (f)\r
+    {\r
+        fwrite(RecorderDataPtr, sizeof(RecorderDataType), 1, f);\r
+        fclose(f);\r
+        sprintf(buf, "\n\r[FreeRTOS+Trace] Saved in: %s\n\r", prvFileName);\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+    else\r
+    {\r
+        sprintf(buf, "\n\r[FreeRTOS+Trace] Failed to write to output file!\n\r");\r
+        vTraceConsoleMessage(buf);\r
+    }\r
+}\r
+#endif\r
+#endif
\ No newline at end of file
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcUser.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcUser.c
new file mode 100644 (file)
index 0000000..2e4bc1a
--- /dev/null
@@ -0,0 +1,1421 @@
+/*******************************************************************************\r
+ * FreeRTOS+Trace v2.3.0 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcUser.c\r
+ *\r
+ * The public API of the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * FreeRTOS+Trace is available as Free Edition and in two premium editions.\r
+ * You may use the premium features during 30 days for evaluation.\r
+ * Download FreeRTOS+Trace at http://www.percepio.com/products/downloads/\r
+ *\r
+ * Copyright Percepio AB, 2012.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#include <string.h>\r
+#include <stdarg.h>\r
+\r
+#include "trcUser.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+#if (configUSE_TRACE_FACILITY == 1)\r
+\r
+extern uint8_t inExcludedTask;\r
+extern uint8_t nISRactive;\r
+extern uint8_t handle_of_last_logged_task;\r
+extern uint32_t dts_min;\r
+extern uint32_t hwtc_count_max_after_tick;\r
+extern uint32_t hwtc_count_sum_after_tick;\r
+extern uint32_t hwtc_count_sum_after_tick_counter;\r
+extern unsigned char ucQueueGetQueueType(void*);\r
+extern unsigned char ucQueueGetQueueNumber(void*);\r
+extern char* traceErrorMessage;\r
+static void vTraceMonitorTask(void);\r
+static void prvTraceExcludeOrIncludeKernelServiceFromTrace(traceKernelService, uint8_t);\r
+    \r
+/*******************************************************************************\r
+ * vTraceMonitorTask\r
+ *\r
+ * A task which periodically reports the recorder status to the console.\r
+ * This is included depending on USE_TRACE_PROGRESS_MONITOR_TASK.\r
+ ******************************************************************************/\r
+static void vTraceMonitorTask(void)\r
+{    \r
+    portTickType xNextWakeTime;\r
+    char localsprintbuffer[90];\r
+    char* err = NULL;    \r
+    char* lastErr = NULL;      \r
+    #define STATE_INIT 0\r
+    #define STATE_STARTED 1\r
+    #define STATE_STOPPED 2    \r
+    int state = STATE_INIT;\r
+    \r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Monitor task started...\n\r");\r
+\r
+    /* Initialise xNextWakeTime - this only needs to be done once. */\r
+    xNextWakeTime = xTaskGetTickCount();\r
+\r
+    for (;;)\r
+    {\r
+        lastErr = err;        \r
+        err = xTraceGetLastError();\r
+        if (err != lastErr)\r
+        {\r
+            sprintf(localsprintbuffer, "\n\r[FreeRTOS+Trace] Error: %s\n\r", err);\r
+            vTraceConsoleMessage(localsprintbuffer); \r
+        }\r
+        \r
+        if (state == STATE_STOPPED || state == STATE_INIT) \r
+        {\r
+            if (RecorderDataPtr->recorderActive == 1)\r
+            {\r
+                state = STATE_STARTED;\r
+                vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder started.\n\r");                                       \r
+            }\r
+            else\r
+            {\r
+                if (state == STATE_INIT)\r
+                {\r
+                    \r
+                    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder not started.\n\r");\r
+                    state = STATE_STOPPED;\r
+                }\r
+            }\r
+        }\r
+        \r
+        if (state == STATE_STARTED)\r
+        {\r
+            if (RecorderDataPtr->frequency > 0)\r
+            {\r
+                sprintf(localsprintbuffer, \r
+                    "\n\r[FreeRTOS+Trace] Event count: %d, Duration: %d ms. [%d ticks]\n\r", \r
+                    (int)RecorderDataPtr->numEvents, \r
+                    (int)(RecorderDataPtr->absTimeLastEventSecond*1000 + (RecorderDataPtr->absTimeLastEvent*1000)/ RecorderDataPtr->frequency), (int)xTaskGetTickCount());\r
+                vTraceConsoleMessage(localsprintbuffer);\r
+            }\r
+\r
+            if (RecorderDataPtr->recorderActive == 0)\r
+            {\r
+                state = STATE_STOPPED;\r
+                vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Recorder stopped.\n\r");                                       \r
+                vTracePortEnd();\r
+            }\r
+                \r
+\r
+        }\r
+\r
+    /* Place this task in the blocked state until it is time to run again. */\r
+        vTaskDelayUntil( &xNextWakeTime, TRACE_PROGRESS_MONITOR_TASK_PERIOD);\r
+        \r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceClear\r
+ *\r
+ * Resets the recorder. Only necessary if a restart is desired - this is not \r
+ * needed in the startup initialization.\r
+ ******************************************************************************/\r
+void vTraceClear(void)\r
+{\r
+    trcCRITICAL_SECTION_BEGIN();\r
+    \r
+    RecorderDataPtr->absTimeLastEvent = 0;\r
+    RecorderDataPtr->nextFreeIndex = 0;\r
+    RecorderDataPtr->numEvents = 0;\r
+    RecorderDataPtr->bufferIsFull = 0;\r
+\r
+    trcCRITICAL_SECTION_END();\r
+    \r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStartStatusMonitor\r
+ *\r
+ * This starts a task to monitor the state of½ the recorder. \r
+ * This task periodically prints a line to the console window, which shows the \r
+ * number of events recorded and the latest timestamp. This task\r
+ * calls vTracePortEnd when the recorder has been stopped, where custom\r
+ * actions can be added, e.g., to store the trace to a file\r
+ * if a file system is available on the device.\r
+ ******************************************************************************/\r
+void vTraceStartStatusMonitor(void)\r
+{    \r
+    vTraceConsoleMessage("\n\r[FreeRTOS+Trace] Starting Trace Status Monitor...\n\r");\r
+    (void)xTaskCreate( (pdTASK_CODE)vTraceMonitorTask, (const signed char*)"TraceMon", TRACE_PROGRESS_MONITOR_TASK_STACKSIZE, NULL, TRACE_PROGRESS_MONITOR_TASK_PRIORITY, NULL );\r
+}\r
+\r
+/*******************************************************************************\r
+ * uiTraceStart\r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * Returns 1 if the recorder was started successfully.\r
+ * Returns 0 if the recorder start was prevented due to a previous internal \r
+ * error. In that case, check vTraceGetLastError to get the error message.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+\r
+uint32_t uiTraceStart(void)\r
+{        \r
+    if (traceErrorMessage == NULL)\r
+    {\r
+        trcCRITICAL_SECTION_BEGIN();\r
+        RecorderDataPtr->recorderActive = 1;\r
+        vTraceStoreTaskswitch(); /* Register the currently running task */\r
+        trcCRITICAL_SECTION_END();\r
+    }\r
+\r
+    return RecorderDataPtr->recorderActive;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStart \r
+ *\r
+ * Starts the recorder. The recorder will not be started if an error has been\r
+ * indicated using vTraceError, e.g. if any of the Nx constants in trcConfig.h \r
+ * has a too small value (NTASK, NQUEUE, etc).\r
+ * \r
+ * This function is obsolete, but has been saved for backwards compatibility. \r
+ * We recommend using uiTraceStart instead.\r
+ ******************************************************************************/\r
+void vTraceStart(void)\r
+{        \r
+    (void)uiTraceStart();\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStop\r
+ *\r
+ * Stops the recorder. The recording can be resumed by calling vTraceStart.\r
+ * This does not reset the recorder. Use vTraceClear is that is desired.\r
+ ******************************************************************************/\r
+void vTraceStop(void)\r
+{\r
+    RecorderDataPtr->recorderActive = 0;\r
+}\r
+\r
+/*******************************************************************************\r
+ * xTraceGetLastError\r
+ *\r
+ * Gives the last error message, if any. NULL if no error message is stored.\r
+ * The message is cleared on read.\r
+ * Any error message is also presented when opening a trace file in \r
+ * FreeRTOS+Trace v2.2.2 or later.\r
+ ******************************************************************************/\r
+char* xTraceGetLastError(void)\r
+{   \r
+    return traceErrorMessage;\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceGetTraceBuffer\r
+ * \r
+ * Returns a pointer to the recorder data structure. Use this together with \r
+ * uiTraceGetTraceBufferSize if you wish to implement an own store/upload \r
+ * solution, e.g., in case a debugger connection is not available for uploading \r
+ * the data.\r
+ ******************************************************************************/\r
+void* vTraceGetTraceBuffer(void)\r
+{\r
+    return RecorderDataPtr;\r
+}\r
+\r
+/*******************************************************************************\r
+ * uiTraceGetTraceBufferSize\r
+ * \r
+ * Gets the size of the recorder data structure. For use together with \r
+ * vTraceGetTraceBuffer if you wish to implement an own store/upload solution, \r
+ * e.g., in case a debugger connection is not available for uploading the data.\r
+ ******************************************************************************/\r
+uint32_t uiTraceGetTraceBufferSize(void)\r
+{\r
+    return sizeof(RecorderDataType);\r
+}\r
+\r
+/*******************************************************************************\r
+ * prvTraceExcludeOrIncludeKernelServiceFromTrace\r
+ * \r
+ * Includes or excludes all events that is related to the kernel service.\r
+ ******************************************************************************/\r
+static void prvTraceExcludeOrIncludeKernelServiceFromTrace(traceKernelService kernelService, uint8_t flag)\r
+{\r
+    switch(kernelService)\r
+    {\r
+    case TRACE_KERNEL_SERVICE_TASK_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_TASK);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_TASK);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_TASK);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_TASK);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_TASK);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_DELAY:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_DELAY_UNTIL);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_PRIORITY_SET:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_PRIORITY_SET);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_PRIORITY_SET);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_SUSPEND:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_SUSPEND);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_SUSPEND);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_TASK_RESUME:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME_FROM_ISR);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(TASK_RESUME_FROM_ISR);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_SEND:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            \r
+            \r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_RECEIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_QUEUE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_QUEUE_PEEK:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_QUEUE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_QUEUE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_PEEK + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_GIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_MUTEX_TAKE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_MUTEX);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_CREATE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_CREATE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_CREATE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_DELETE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_DELETE + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_GIVE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_SEND + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_SEND_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    case TRACE_KERNEL_SERVICE_SEMAPHORE_TAKE:\r
+        if (flag)\r
+        {\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            SET_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        else\r
+        {\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_BLOCK_ON_RECEIVE + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+            CLEAR_EVENT_CODE_FLAG_ISEXCLUDED(EVENTGROUP_FAILED_RECEIVE_FROM_ISR + TRACE_CLASS_SEMAPHORE);\r
+        }\r
+        break;\r
+    }\r
+}\r
+\r
+/******************************************************************************\r
+ * vTraceExclude______FromTrace\r
+ *\r
+ * Excludes a task or object from the trace.\r
+ * This can be useful if some irrelevant task is very frequent and is "eating\r
+ * up the buffer". This should be called after the task has been created, but \r
+ * before starting the FreeRTOS scheduler.\r
+ *****************************************************************************/\r
+void vTraceExcludeQueueFromTrace(void* handle)\r
+{\r
+    SET_QUEUE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeSemaphoreFromTrace(void* handle)\r
+{\r
+    SET_SEMAPHORE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeMutexFromTrace(void* handle)\r
+{\r
+    SET_MUTEX_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceExcludeTaskFromTrace(void* handle)\r
+{\r
+    SET_TASK_FLAG_ISEXCLUDED(uxTaskGetTaskNumber(handle));\r
+}\r
+\r
+void vTraceExcludeKernelServiceFromTrace(traceKernelService kernelService)\r
+{\r
+    prvTraceExcludeOrIncludeKernelServiceFromTrace(kernelService, 1);\r
+}\r
+\r
+/******************************************************************************\r
+ * vTraceInclude______InTrace\r
+ *\r
+ * Includes a task, object or kernel service in the trace. This is only\r
+ * necessary if the task or object has been previously exluded.\r
+ *****************************************************************************/\r
+void vTraceIncludeQueueInTrace(void* handle)\r
+{\r
+    CLEAR_QUEUE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeSemaphoreInTrace(void* handle)\r
+{\r
+    CLEAR_SEMAPHORE_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeMutexInTrace(void* handle)\r
+{\r
+    CLEAR_MUTEX_FLAG_ISEXCLUDED(ucQueueGetQueueNumber(handle));\r
+}\r
+\r
+void vTraceIncludeTaskInTrace(void* handle)\r
+{\r
+    CLEAR_TASK_FLAG_ISEXCLUDED(uxTaskGetTaskNumber(handle));\r
+}\r
+\r
+void vTraceIncludeKernelServiceInTrace(traceKernelService kernelService)\r
+{\r
+    prvTraceExcludeOrIncludeKernelServiceFromTrace(kernelService, 0);\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceSetQueueName\r
+ *\r
+ * Assigns a name to a FreeRTOS Queue, Semaphore or Mutex. This function should\r
+ * be called right after creation of the queue/mutex/semaphore. If not using \r
+ * this function, the queues/mutexes/semaphores will be presented by their\r
+ * numeric handle only.\r
+ *\r
+ * Example:\r
+ *     actuatorQ = xQueueCreate(3, sizeof(QueueMessage));\r
+ *     vTraceSetQueueName(actuatorQ, "ActuatorQueue");\r
+ ******************************************************************************/\r
+void vTraceSetQueueName(void* queue, const char* name)\r
+{\r
+    int t = ucQueueGetQueueType(queue);    \r
+    vTraceSetObjectName(TraceObjectClassTable[t], \r
+                        (objectHandleType)ucQueueGetQueueNumber(queue), name);\r
+}\r
+\r
+\r
+/******************************************************************************\r
+ * vTraceTaskInstanceIsFinished\r
+ * \r
+ * This defines an explicit Instance Finish Event for the current task. It tells \r
+ * the recorder that the current instance of this task is finished at the next \r
+ * kernel call of the task, e.g., a taskDelay or a queue receive. This function \r
+ * should be called right before the api function call considered to be the end \r
+ * of the current task instance, i.e., the Instance Finish Event.\r
+ *****************************************************************************/\r
+void vTraceTaskInstanceIsFinished()\r
+{\r
+    if (handle_of_last_logged_task)\r
+    {\r
+        SET_TASK_FLAG_MARKIFE(handle_of_last_logged_task);    \r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * vvTraceTaskSkipDefaultInstanceFinishedEvents\r
+ *\r
+ * This is useful if there are implicit Instance Finish Events, such as \r
+ * vTaskDelayUntil or xQueueReceive, in a task where an explicit Instance Finish \r
+ * Event has been defined. This function tells the recorder that only the \r
+ * explicitly defined functions, using vTraceTaskInstanceIsFinished, should be\r
+ * treated as Instance Finish Events for this task. The implicit Instance Finish \r
+ * Events are thus disregarded for the calling task.\r
+ ******************************************************************************/\r
+void vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+{    \r
+    if (handle_of_last_logged_task)\r
+    {\r
+        PROPERTY_TASK_IFE_SERVICECODE(handle_of_last_logged_task) = \r
+          RESERVED_DUMMY_CODE;\r
+    }\r
+}\r
+\r
+/*******************************************************************************\r
+ * Interrupt recording functions \r
+ ******************************************************************************/\r
+\r
+#if (INCLUDE_ISR_TRACING == 1)\r
+\r
+#define MAX_ISR_NESTING 16\r
+static uint8_t isrstack[MAX_ISR_NESTING];\r
+\r
+/*******************************************************************************\r
+ * vTraceSetISRProperties\r
+ * \r
+ * Registers an Interrupt Service Routine in the recorder library, This must be\r
+ * called before using vTraceStoreISRBegin to store ISR events. This is \r
+ * typically called in the startup of the system, before the scheduler is \r
+ * started.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: To safely record ISRs, you need to make sure that all traced \r
+ * interrupts actually are disabled by trcCRITICAL_SECTION_BEGIN(), which \r
+ * typically is mapped to portENTER_CRITICAL(), which uses the macro \r
+ * portDISABLE_INTERRUPTS. However, in some ports of FreeRTOS and depending on \r
+ * FreeRTOS configuration, this does not disable high priority interrupts!\r
+ * If an ISR calls vTraceStoreISRBegin while the recorder is busy, it will\r
+ * stop the recording and give an error message.\r
+ ******************************************************************************/\r
+void vTraceSetISRProperties(objectHandleType handle, const char* name, char priority)\r
+{\r
+    vTraceSetObjectName(TRACE_CLASS_ISR, handle, name);\r
+    vTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority);\r
+}\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISRBegin\r
+ * \r
+ * Registers the beginning of an Interrupt Service Routine.\r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: You need to make sure that any traced interrupts actually are \r
+ * disabled by trcCRITICAL_SECTION_BEGIN(), i.e., taskENTER_CRITICAL() which\r
+ * uses portDISABLE_INTERRUPTS(). \r
+ * In some ports of FreeRTOS, this does not disable high-priority interrupts,\r
+ * i.e., with priorities above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
+ * If an invalid call to vTraceStoreISRBegin is detected (i.e., that preempted\r
+ * a critical section of the recorder) this will generate a recorder error \r
+ * using vTraceError.\r
+ ******************************************************************************/\r
+void vTraceStoreISRBegin(objectHandleType handle)\r
+{\r
+    uint16_t dts4;\r
+    TSEvent* ts = NULL;\r
+\r
+    if (recorder_busy)\r
+    {\r
+      vTraceError("Illegal call to vTraceStoreISRBegin/End");\r
+      return;\r
+    }\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+    {    \r
+        trcCRITICAL_SECTION_BEGIN();\r
+        dts4 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {    \r
+\r
+            if (nISRactive < MAX_ISR_NESTING)\r
+            {    \r
+                isrstack[nISRactive] = handle;\r
+                nISRactive++;            \r
+                ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+                if (ts != NULL)\r
+                {\r
+                    ts->type = TS_ISR_BEGIN;\r
+                    ts->dts = dts4;\r
+                    ts->objHandle = handle;\r
+                    prvTraceUpdateCounters();                \r
+                }\r
+            }\r
+            else\r
+            {            \r
+                /* This should not occur unless something is very wrong */            \r
+                vTraceError("Too many nested interrupts!");\r
+            }        \r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+\r
+#if (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+int tailchain_irq_pending(void);\r
+\r
+/*******************************************************************************\r
+ * tailchain_irq_pending\r
+ *\r
+ * For Cortex-M chips only. Returns 1 if an interrupt is pending, by checking \r
+ * the 8 NVIC IRQ pend registers at 0xE000E200 to 0xE000E21C. Returns 0 if no \r
+ * interrupt is pending. This is used to predict tailchaining of ISRs.\r
+ ******************************************************************************/\r
+int tailchain_irq_pending(void)\r
+{\r
+  uint32_t* pend_reg = ((uint32_t*)0xE000E200);\r
+  int i;\r
+\r
+  for (i=0; i<8; i++)\r
+  {\r
+    if (pend_reg[i] != 0)\r
+    {\r
+      return 1;\r
+    }\r
+  }\r
+  return 0;  \r
+}\r
+\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * vTraceStoreISREnd\r
+ * \r
+ * Registers the end of an Interrupt Service Routine. \r
+ *\r
+ * Example:\r
+ *     #define ID_ISR_TIMER1 1       // lowest valid ID is 1\r
+ *     #define PRIO_OF_ISR_TIMER1 3  // the hardware priority of the interrupt\r
+ *     ...\r
+ *     vTraceSetISRProperties(ID_ISR_TIMER1, "ISRTimer1", PRIO_OF_ISR_TIMER1);\r
+ *     ...\r
+ *     void ISR_handler()\r
+ *     {\r
+ *         vTraceStoreISRBegin(ID_OF_ISR_TIMER1);\r
+ *         ...\r
+ *         vTraceStoreISREnd();\r
+ *     }\r
+ *\r
+ * NOTE: You need to make sure that any traced interrupts actually are \r
+ * disabled by trcCRITICAL_SECTION_BEGIN(), i.e., taskENTER_CRITICAL() which\r
+ * uses portDISABLE_INTERRUPTS(). \r
+ * In some ports of FreeRTOS, this does not disable high-priority interrupts,\r
+ * i.e., with priorities above configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
+ * If an invalid call to vTraceStoreISREnd is detected (i.e., that preempted\r
+ * a critical section of the recorder) this will generate a recorder error \r
+ * using vTraceError.\r
+ ******************************************************************************/\r
+void vTraceStoreISREnd(void)\r
+{\r
+    TSEvent* ts;\r
+    uint16_t dts5;\r
+\r
+    if (recorder_busy)\r
+    {\r
+      vTraceError("Illegal call to vTraceStoreISRBegin/End");\r
+      return;\r
+    }\r
+    \r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+    {\r
+        #if (SELECTED_PORT == PORT_ARM_CortexM)\r
+        if (tailchain_irq_pending() > 0)\r
+        {\r
+            nISRactive--; /* If an IRQ strikes exactly here, the resulting \r
+            ISR tailchaining is not detected. The trace instead shows a very \r
+            short fragment of the earlier preempted task/ISR, and then the new\r
+            ISR begins. */\r
+            return;\r
+        }\r
+        #endif\r
+      \r
+        trcCRITICAL_SECTION_BEGIN();\r
+        dts5 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {    \r
+            ts = (TSEvent*)xTraceNextFreeEventBufferSlot();\r
+            if (ts != NULL)\r
+            {\r
+                if (nISRactive > 1)\r
+                {\r
+                    /* return to another isr */\r
+                    ts->type = TS_ISR_RESUME;\r
+                    ts->objHandle = isrstack[nISRactive];\r
+                }\r
+                else\r
+                {\r
+                    /* return to task */\r
+                    ts->type = TS_TASK_RESUME;\r
+                    ts->objHandle = handle_of_last_logged_task;\r
+                }\r
+                ts->dts = dts5;\r
+                nISRactive--;\r
+                prvTraceUpdateCounters();\r
+            }\r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+#else\r
+\r
+/* ISR tracing is turned off */\r
+void vTraceIncreaseISRActive(void)\r
+{\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+        nISRactive++;\r
+}\r
+\r
+void vTraceDecreaseISRActive(objectHandleType handle)\r
+{\r
+    if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
+        nISRactive--;\r
+}\r
+#endif\r
+\r
+\r
+/*******************************************************************************\r
+ * User Event functions\r
+ ******************************************************************************/\r
+\r
+#if (INCLUDE_USER_EVENTS == 1)\r
+\r
+ /******************************************************************************\r
+ * vTraceUserEvent\r
+ *\r
+ * Basic user event (Standard and Professional Edition only)\r
+ * \r
+ * Generates a User Event with a text label. The label is created/looked up\r
+ * in the symbol table using xTraceOpenLabel.\r
+ ******************************************************************************/\r
+void vTraceUserEvent(traceLabel eventLabel)\r
+{\r
+    UserEvent* ue;\r
+    uint8_t dts1;\r
+\r
+    if (RecorderDataPtr->recorderActive && (! inExcludedTask || nISRactive ) && handle_of_last_logged_task)\r
+    {\r
+        trcCRITICAL_SECTION_BEGIN();\r
+\r
+        dts1 = (uint8_t)prvTraceGetDTS(0xFF);\r
+\r
+        if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */    \r
+        {       \r
+            ue = (UserEvent*) xTraceNextFreeEventBufferSlot();\r
+            if (ue != NULL)\r
+            {\r
+                ue->dts = dts1;\r
+                ue->type = USER_EVENT;\r
+                ue->payload = eventLabel;\r
+                prvTraceUpdateCounters();\r
+            }\r
+        }\r
+        trcCRITICAL_SECTION_END();        \r
+    }\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+\r
+/* one word (32 bit) is required for the USER_EVENT entry, 8 words \r
+(8*32 bit = 32 byte) available for argument data */\r
+#define MAX_ARG_SIZE (4+32)    \r
+\r
+static uint8_t writeInt8(void * buffer, uint8_t i, uint8_t value);\r
+static uint8_t writeInt16(void * buffer, uint8_t i, uint16_t value);\r
+static uint8_t writeInt32(void * buffer, uint8_t i, uint32_t value);\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+static uint8_t writeFloat(void * buffer, uint8_t i, float value);\r
+static uint8_t writeDouble(void * buffer, uint8_t i, double value);\r
+#endif\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt8(void * buffer, uint8_t i, uint8_t value)\r
+{    \r
+    \r
+    if (i >= MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }\r
+\r
+    ((uint8_t*)buffer)[i] = value;\r
+\r
+       if (i + 1 > MAX_ARG_SIZE)\r
+       {\r
+               return 255;\r
+       }\r
+\r
+    return i + 1;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt16(void * buffer, uint8_t i, uint16_t value)\r
+{      \r
+    /* Align to multiple of 2 */\r
+    while ((i % 2) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+                       \r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;        \r
+    }\r
+    \r
+    if (i + 2 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }\r
+\r
+    ((uint16_t*)buffer)[i/2] = value;\r
+\r
+    return i + 2;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeInt32(void * buffer, uint8_t i, uint32_t value)\r
+{\r
+    \r
+    /* A 32 bit value should begin at an even 4-byte address */\r
+    while ((i % 4) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+               \r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;\r
+    }\r
+    \r
+    if (i + 4 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }        \r
+\r
+    ((uint32_t*)buffer)[i/4] = value;\r
+\r
+    return i + 4;\r
+}\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeFloat(void * buffer, uint8_t i, float value)\r
+{\r
+    /* A 32 bit value should begin at an even 4-byte address */\r
+    while ((i % 4) != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+\r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;\r
+    }\r
+\r
+    if (i + 4 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }        \r
+\r
+    ((float*)buffer)[i/4] = value;\r
+    \r
+    return i + 4;\r
+}\r
+\r
+/*** Locally used in vTracePrintF ***/\r
+static uint8_t writeDouble(void * buffer, uint8_t i, double value)\r
+{\r
+    uint32_t * dest = buffer;\r
+    uint32_t * src = (void*)&value;\r
+    /* The double is written as two 32 bit values, and should begin at an even \r
+    4-byte address (to avoid having to align with 8 byte) */\r
+    while (i % 4 != 0)\r
+    {\r
+               if (i >= MAX_ARG_SIZE)\r
+               {\r
+                       return 255;\r
+               }\r
+\r
+        ((uint8_t*)buffer)[i] = 0;\r
+        i++;        \r
+    }\r
+    \r
+    if (i + 8 > MAX_ARG_SIZE)\r
+    {\r
+        return 255;\r
+    }       \r
+    \r
+    dest[i/4+0] = src[0];\r
+    dest[i/4+1] = src[1];\r
+    \r
+    return i + 8;\r
+}\r
+\r
+#endif\r
+\r
+ /******************************************************************************\r
+ * vTracePrintF \r
+ * \r
+ * Advanced user events (Professional Edition only)\r
+ *\r
+ * Generates User Event with formatted text and data, similar to a "printf".\r
+ * It is very fast compared to a normal "printf" since this function only \r
+ * stores the arguments. The actual formatting is done\r
+ * on the host PC when the trace is displayed in the viewer tool. \r
+ *\r
+ * User Event labels are created using xTraceOpenLabel.\r
+ * Example:\r
+ *\r
+ *     traceLabel adc_uechannel = xTraceOpenLabel("ADC User Events");\r
+ *     ...\r
+ *     vTracePrint(adc_uechannel, \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * This can be combined into one line, if desired, but this is slower:\r
+ *\r
+ *     vTracePrint(xTraceOpenLabel("ADC User Events"), \r
+ *                 "ADC channel %d: %lf volts", \r
+ *                 ch, (double)adc_reading/(double)scale);\r
+ *\r
+ * Calling xTraceOpenLabel multiple times will not create duplicate entries, but\r
+ * it is of course faster to just do it once, and then keep the handle for later \r
+ * use. If you don´t have any data arguments, only a text label/string, it is \r
+ * better to use vTraceUserEvent - it is faster.\r
+ *\r
+ * Format specifiers supported:\r
+ *  %d - 32 bit signed integer\r
+ *  %u - 32 bit unsigned integer\r
+ *  %f - 32 bit float\r
+ *  %s - string (is copied to the recorder symbol table)\r
+ *  %hd - 16 bit signed integer\r
+ *  %hu - 16 bit unsigned integer\r
+ *  %bd - 8 bit signed integer\r
+ *  %bu - 8 bit unsigned integer\r
+ *  %lf - double-precision float\r
+ * \r
+ * Up to 15 data arguments are allowed, with a total size of maximum 32 byte.\r
+ * In case this is exceeded, the user event is changed into an error message.\r
+ * \r
+ * The data is stored in trace buffer, and is packed to allow storing multiple \r
+ * smaller data entries in the same 4-byte record, e.g., four 8-bit values.\r
+ * A string requires two bytes, as the symbol table is limited to 64K. Storing a \r
+ * double (%lf) uses two records, so this is quite costly. Use float (%f) unless\r
+ * the higher precision is really necessary.\r
+ ******************************************************************************/\r
+void vTracePrintF(traceLabel eventLabel, const char* formatStr, ...)\r
+{\r
+    UserEvent* ue1;\r
+    va_list vl;\r
+    uint8_t argCounter = 0;\r
+    uint8_t i = 0;\r
+    uint8_t nofEventEntries = 0;\r
+    uint16_t formatStrIndex = 0;    \r
+\r
+    /**************************************************************************\r
+    * The array tempDataBuffer is a local buffer used in a two-phase commit of \r
+    * the event data, since a vTracePrintF may span over multiple slots in the \r
+    * buffer.\r
+    * This buffer can be made larger, of course, but remember the risk for \r
+    * stack overflow. Note: This should be a LOCAL buffer, must not be made \r
+    * global. That would cause data corruption when two calls to vTracePrintF\r
+    * from different tasks overlaps (interrupts are only disabled in a small \r
+    * part of this function, otherwise enabled)\r
+    ***************************************************************************/\r
+               \r
+    uint32_t tempDataBuffer[(3 + MAX_ARG_SIZE) / 4];   \r
+       \r
+       \r
+    if ((inExcludedTask == 0) &&\r
+        (nISRactive == 0) &&\r
+        (RecorderDataPtr->recorderActive == 1) &&\r
+        (handle_of_last_logged_task > 0))\r
+    {        \r
+        /* First, write the "primary" user event entry in the local buffer, but \r
+        let the event type be "EVENT_BEING_WRITTEN" for now...*/\r
+\r
+        ue1 = (UserEvent*)(&tempDataBuffer[0]);         \r
+        ue1->type = EVENT_BEING_WRITTEN;      /* Update this as the last step */\r
+        \r
+        i = 4;\r
+        formatStrIndex = 0;\r
+        va_start(vl, formatStr);          /* Begin reading the arguments list */\r
+\r
+        while (formatStr[formatStrIndex] != '\0')\r
+        {\r
+            if (formatStr[formatStrIndex] == '%')\r
+            {\r
+                argCounter++;\r
+\r
+                if (argCounter > 15)\r
+                {\r
+                    vTraceError("vTracePrintF - Too many arguments, max 15 allowed!");\r
+                    va_end(vl);                    \r
+                    formatStr = "[vTracePrintF error] Too many arguments, max 15 allowed!";\r
+                    i = 4;\r
+                    break;            \r
+                }\r
+\r
+/*******************************************************************************\r
+ * These below code writes raw data (primitive datatypes) in the event buffer, \r
+ * instead of the normal event structs (where byte 0 is event type).\r
+ * These data entries must never be interpreted as real event data, as the type\r
+ * field would be misleading since used for payload data. \r
+ * \r
+ * The correctness of this encoding depends on two mechanisms:\r
+ * \r
+ * 1. An initial USER_EVENT, which type code tells the number of 32-bit data \r
+ * entires that follows. (code - USER_EVENT = number of data entries). \r
+ * Note that a data entry corresponds to the slots that normally corresponds to \r
+ * one (1) event, i.e., 32 bits. vTracePrintF may encode several pieces of data \r
+ * in one data entry, e.g., two 16-bit values or four 8-bit values, one 16-bit\r
+ * value followes by two 8-bit values, etc.\r
+ *\r
+ * 2. A two-phase commit procedure, where the USER_EVENT and data entries are \r
+ * written to a local buffer at first, and when all checks are OK then copied to\r
+ * the main event buffer using a fast memcpy. The event code is finalized as the\r
+ * very last step. Before that that step, the event code indicates an unfinished\r
+ * event, which causes it to be ignored and stop the loading of the file (since \r
+ * an unfinished event is the last event in the trace).\r
+*******************************************************************************/\r
+                formatStrIndex++;\r
+                switch (formatStr[formatStrIndex])\r
+                {\r
+                case 'd':    i = writeInt32((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, uint32_t)); \r
+                             break;\r
+                case 'u':    i = writeInt32((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, uint32_t)); \r
+                             break;\r
+                case 's':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (uint16_t)xTraceOpenLabel((char*)va_arg(vl, char*))); \r
+                             break;\r
+\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+                             /* Yes, "double" as type also in the float \r
+                             case. This since "float" is promoted into "double" \r
+                             by the va_arg stuff. */\r
+                case 'f':    i = writeFloat((uint8_t*)tempDataBuffer, \r
+                                                i, \r
+                                                (float)va_arg(vl, double)); \r
+                             break;    \r
+#else\r
+/* No support for floats, but attempt to store a float user event\r
+avoid a possible crash due to float reference. Instead store the \r
+data on uint_32 format (will not be displayed anyway). This is just\r
+to keep va_arg and i consistent. */\r
+\r
+                case 'f':    i = writeInt32((uint8_t*)tempDataBuffer,\r
+                                                i, \r
+                                                (uint32_t)va_arg(vl, double)); \r
+#endif\r
+                case 'l':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+#if (INCLUDE_FLOAT_SUPPORT)\r
+                    case 'f':     i = writeDouble((uint8_t*)tempDataBuffer, \r
+                                                      i, \r
+                                                      (double)va_arg(vl, double)); \r
+                                  break;\r
+#else\r
+/* No support for floats, but attempt to store a float user event\r
+avoid a possible crash due to float reference. Instead store the \r
+data on uint_32 format (will not be displayed anyway). This is just\r
+to keep va_arg and i consistent. */\r
+                    case 'f':    i = writeInt32((uint8_t*)tempDataBuffer, /* In this case, the value will not be shown anyway */\r
+                                                    i, \r
+                                                    (uint32_t)va_arg(vl, double)); \r
+                                 i = writeInt32((uint8_t*)tempDataBuffer, /* Do it twice, to write in total 8 bytes */\r
+                                                    i, \r
+                                                    (uint32_t)va_arg(vl, double)); \r
+#endif\r
+\r
+                    }\r
+                    break;\r
+                case 'h':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+                    case 'd':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                    i, \r
+                                                    (uint16_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    case 'u':    i = writeInt16((uint8_t*)tempDataBuffer, \r
+                                                    i, \r
+                                                    (uint16_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    }\r
+                    break;\r
+                case 'b':\r
+                    formatStrIndex++;\r
+                    switch (formatStr[formatStrIndex])\r
+                    {\r
+                    case 'd':    i = writeInt8((uint8_t*)tempDataBuffer, \r
+                                                   i, \r
+                                                   (uint8_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    case 'u':    i = writeInt8((uint8_t*)tempDataBuffer, \r
+                                                   i, \r
+                                                   (uint8_t)va_arg(vl, uint32_t)); \r
+                                 break;\r
+                    }\r
+                    break;\r
+                }\r
+            }                                    \r
+            formatStrIndex++;    \r
+            if (i == 255)\r
+            {\r
+                va_end(vl);\r
+                //vTraceError("vTracePrintF - Too large arguments, max 32 byte allowed!");\r
+                formatStr = "[vTracePrintF error] Too large arguments, max 32 byte allowed!";\r
+                i = 4;\r
+                break;\r
+            }\r
+        }\r
+\r
+        va_end(vl);\r
+               \r
+        /* Store the format string, with a reference to the channel symbol */\r
+        ue1->payload = prvTraceOpenSymbol(formatStr, eventLabel);     \r
+\r
+        trcCRITICAL_SECTION_BEGIN();  \r
+\r
+        ue1->dts = (uint8_t)prvTraceGetDTS(0xFF);\r
+        if (! RecorderDataPtr->recorderActive)\r
+        {\r
+\r
+            /* Abort, since an XTS event (created by prvTraceGetDTS) filled the \r
+            buffer, and the recorder stopped since not circular buffer. */\r
+            trcCRITICAL_SECTION_END();\r
+        \r
+            return;\r
+        }\r
+            \r
+        nofEventEntries = (i+3)/4;\r
+\r
+        /* If the data does not fit in the remaining main buffer, wrap around to \r
+        0 if allowed, otherwise stop the recorder and quit). */\r
+        if (RecorderDataPtr->nextFreeIndex + nofEventEntries > RecorderDataPtr->maxEvents)\r
+        {\r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+            (void)memset(& RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4], \r
+                   0, \r
+                   (RecorderDataPtr->maxEvents - RecorderDataPtr->nextFreeIndex)*4);\r
+            RecorderDataPtr->nextFreeIndex = 0;\r
+            RecorderDataPtr->bufferIsFull = 1;\r
+#else\r
+            /* Abort and stop recorder, since the event data will not fit in the\r
+            buffer and not circular buffer in this case... */\r
+            trcCRITICAL_SECTION_END();\r
+            vTraceStop();\r
+\r
+            \r
+            return;\r
+#endif\r
+        }\r
+    \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+        /* Check that the buffer to be overwritten does not contain any user \r
+        events that would be partially overwritten. If so, they must be "killed"\r
+        by replacing the user event and following data with NULL events (i.e., \r
+        using a memset to zero).*/\r
+        prvCheckDataToBeOverwrittenForMultiEntryUserEvents(nofEventEntries);\r
+#endif\r
+        /* Copy the local buffer to the main buffer */\r
+        (void)memcpy(& RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4], \r
+               tempDataBuffer, \r
+               i);\r
+\r
+        /* Update the event type, i.e., number of data entries following the \r
+        main USER_EVENT entry (Note: important that this is after the memcpy, \r
+        but within the critical section!)*/\r
+        RecorderDataPtr->eventData[RecorderDataPtr->nextFreeIndex * 4] = \r
+          (uint8_t) USER_EVENT + nofEventEntries - 1;    \r
+        \r
+        /* Update the main buffer event index (already checked that it fits in \r
+        the buffer, so no need to check for wrapping)*/\r
+        \r
+        RecorderDataPtr->nextFreeIndex += nofEventEntries;\r
+        RecorderDataPtr->numEvents += nofEventEntries;\r
+        \r
+        if (RecorderDataPtr->nextFreeIndex >= EVENT_BUFFER_SIZE)\r
+        {\r
+        \r
+#if (RECORDER_STORE_MODE == STORE_MODE_RING_BUFFER)\r
+            RecorderDataPtr->nextFreeIndex = 0;\r
+            RecorderDataPtr->bufferIsFull = 1;\r
+#else\r
+            vTraceStop();\r
+#endif\r
+        }\r
+\r
+        trcCRITICAL_SECTION_END();\r
+    }    \r
+}\r
+    \r
+/*******************************************************************************\r
+ * xTraceOpenLabel\r
+ * \r
+ * Creates user event labels for user event channels or for individual events.\r
+ * User events can be used to log application events and data for display in\r
+ * the visualization tool. A user event is identified by a label, i.e., a string,\r
+ * which is stored in the recorder's symbol table.\r
+ * When logging a user event, a numeric handle (reference) to this string is\r
+ * used to identify the event. This is obtained by calling \r
+ * \r
+ *     xTraceOpenLabel()\r
+ *\r
+ * which adds the string to the symbol table (if not already present)\r
+ * and returns the corresponding handle.\r
+ *\r
+ * This can be used in two ways:\r
+ *\r
+ * 1. The handle is looked up every time, when storing the user event.\r
+ *\r
+ * Example:\r
+ *     vTraceUserEvent(xTraceOpenLabel("MyUserEvent"));\r
+ *\r
+ * 2. The label is registered just once, with the handle stored in an\r
+ *  application variable - much like using a file handle.\r
+ *\r
+ * Example:\r
+ *     myEventHandle = xTraceOpenLabel("MyUserEvent");\r
+ *     ...\r
+ *     vTraceUserEvent(myEventHandle);\r
+ *\r
+ * The second option is faster since no lookup is required on each event, and \r
+ * therefore recommended for user events that are frequently\r
+ * executed and/or located in time-critical code. The lookup operation is\r
+ * however fairly fast due to the design of the symbol table.\r
+ ******************************************************************************/\r
+traceLabel xTraceOpenLabel(const char* label)\r
+{\r
+    return prvTraceOpenSymbol(label, 0);\r
+}\r
+#endif\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DHCP.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DHCP.c
new file mode 100644 (file)
index 0000000..f113e56
--- /dev/null
@@ -0,0 +1,716 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "timers.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_DHCP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkInterface.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+/* Exclude the entire file if DHCP is not enabled. */\r
+#if ipconfigUSE_DHCP != 0\r
+\r
+#if ( ipconfigUSE_DHCP != 0 ) && ( ipconfigNETWORK_MTU < 586 )\r
+       /* DHCP must be able to receive an options field of 312 bytes, the fixed\r
+       part of the DHCP packet is 240 bytes, and the IP/UDP headers take 28 bytes. */\r
+       #error ipconfigNETWORK_MTU needs to be at least 586 to use DHCP (588 if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 1)\r
+#endif\r
+\r
+/* Parameter widths in the DHCP packet. */\r
+#define dhcpCLIENT_HARDWARE_ADDRESS_LENGTH             16\r
+#define dhcpSERVER_HOST_NAME_LENGTH                            64\r
+#define dhcpBOOT_FILE_NAME_LENGTH                              128\r
+\r
+/* Timer parameters.  Windows simulator times are much shorter because simulated\r
+time is not real time. */\r
+#ifdef _WINDOWS_\r
+       #define dhcpINITIAL_DHCP_TX_PERIOD                      ( 100 / portTICK_RATE_MS )\r
+       #define dhcpINITIAL_TIMER_PERIOD                        ( 10 / portTICK_RATE_MS )\r
+       #define dhcpMAX_TIME_TO_WAIT_FOR_ACK            ( 200 / portTICK_RATE_MS )\r
+#else\r
+       #define dhcpINITIAL_DHCP_TX_PERIOD                      ( 5000 / portTICK_RATE_MS )\r
+       #define dhcpINITIAL_TIMER_PERIOD                        ( 250 / portTICK_RATE_MS )\r
+       #define dhcpMAX_TIME_TO_WAIT_FOR_ACK            ( 5000 / portTICK_RATE_MS )\r
+#endif /* _WINDOWS_ */\r
+\r
+/* Codes of interest found in the DHCP options field. */\r
+#define dhcpSUBNET_MASK_OPTION_CODE                            ( 1 )\r
+#define dhcpGATEWAY_OPTION_CODE                                        ( 3 )\r
+#define hdcpDNS_SERVER_OPTIONS_CODE                            ( 6 )\r
+#define dhcpMESSAGE_TYPE_OPTION_CODE                   ( 53 )\r
+#define dhcpLEASE_TIME_OPTION_CODE                             ( 51 )\r
+#define dhcpCLIENT_IDENTIFIER_OPTION_CODE              ( 61 )\r
+#define dhcpPARAMETER_REQUEST_OPTION_CODE              ( 55 )\r
+#define dhcpREQUEST_IP_ADDRESS_OPTION_CODE             ( 50 )\r
+#define dhcpSERVER_IP_ADDRESS_OPTION_CODE              ( 54 )\r
+\r
+/* The four DHCP message types of interest. */\r
+#define dhcpMESSAGE_TYPE_DISCOVER                              ( 1 )\r
+#define dhcpMESSAGE_TYPE_OFFER                                 ( 2 )\r
+#define dhcpMESSAGE_TYPE_REQUEST                               ( 3 )\r
+#define dhcpMESSAGE_TYPE_ACK                                   ( 5 )\r
+#define dhcpMESSAGE_TYPE_NACK                                  ( 6 )\r
+\r
+/* Offsets into the transmitted DHCP options fields at which various parameters\r
+are located. */\r
+#define dhcpCLIENT_IDENTIFIER_OFFSET                   ( 5 )\r
+#define dhcpREQUESTED_IP_ADDRESS_OFFSET                        ( 13 )\r
+#define dhcpDHCP_SERVER_IP_ADDRESS_OFFSET              ( 19 )\r
+\r
+/* Values used in the DHCP packets. */\r
+#define dhcpREQUEST_OPCODE                                             ( 1 )\r
+#define dhcpREPLY_OPCODE                                               ( 2 )\r
+#define dhcpADDRESS_TYPE_ETHERNET                              ( 1 )\r
+#define dhcpETHERNET_ADDRESS_LENGTH                            ( 6 )\r
+\r
+/* If a lease time is not received, use the default of two days. */\r
+#define dhcpDEFAULT_LEASE_TIME                                 ( ( 48UL * 60UL * 60UL * 1000UL ) / portTICK_RATE_MS ) /* 48 hours in ticks. */\r
+\r
+/* Don't allow the lease time to be too short. */\r
+#define dhcpMINIMUM_LEASE_TIME                                 ( 60000UL / portTICK_RATE_MS )  /* 60 seconds in ticks. */\r
+\r
+/* Marks the end of the variable length options field in the DHCP packet. */\r
+#define dhcpOPTION_END_BYTE 0xff\r
+\r
+/* Offset into a DHCP message at which the first byte of the options is\r
+located. */\r
+#define dhcpFIRST_OPTION_BYTE_OFFSET                   ( 0xf0 )\r
+\r
+/* When walking the variable length options field, the following value is used\r
+to ensure the walk has not gone past the end of the valid options.  2 bytes is\r
+made up of the length byte, and minimum one byte value. */\r
+#define dhcpMAX_OPTION_LENGTH_OF_INTEREST              ( 2L )\r
+\r
+/* Standard DHCP port numbers and magic cookie value. */\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+       #define dhcpCLIENT_PORT 0x4400\r
+       #define dhcpSERVER_PORT 0x4300\r
+       #define dhcpCOOKIE              0x63538263\r
+#else\r
+       #define dhcpCLIENT_PORT 0x0044\r
+       #define dhcpSERVER_PORT 0x0043\r
+       #define dhcpCOOKIE              0x63825363\r
+#endif /* ipconfigBYTE_ORDER */\r
+\r
+#include "pack_struct_start.h"\r
+struct xDHCPMessage\r
+{\r
+       uint8_t ucOpcode;\r
+       uint8_t ucAddressType;\r
+       uint8_t ucAddressLength;\r
+       uint8_t ucHops;\r
+       uint32_t ulTransactionID;\r
+       uint16_t usElapsedTime;\r
+       uint16_t usFlags;\r
+       uint32_t ulClientIPAddress_ciaddr;\r
+       uint32_t ulYourIPAddress_yiaddr;\r
+       uint32_t ulServerIPAddress_siaddr;\r
+       uint32_t ulRelayAgentIPAddress_giaddr;\r
+       uint8_t ucClientHardwareAddress[ dhcpCLIENT_HARDWARE_ADDRESS_LENGTH ];\r
+       uint8_t ucServerHostName[ dhcpSERVER_HOST_NAME_LENGTH ];\r
+       uint8_t ucBootFileName[ dhcpBOOT_FILE_NAME_LENGTH ];\r
+       uint32_t ulDHCPCookie;\r
+       uint8_t ucFirstOptionByte;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xDHCPMessage xDHCPMessage_t;\r
+\r
+/* DHCP state machine states. */\r
+typedef enum\r
+{\r
+       eWaitingSendFirstDiscover = 0,  /* Initial state.  Send a discover the first time it is called, and reset all timers. */\r
+       eWaitingOffer,                                  /* Either resend the discover, or, if the offer is forthcoming, send a request. */\r
+       eWaitingAcknowledge,                    /* Either resend the request. */\r
+       eLeasedAddress,                                 /* Resend the request at the appropriate time to renew the lease. */\r
+       eNotUsingLeasedAddress                  /* DHCP failed, and a default IP address is being used. */\r
+} eDHCPState_t;\r
+\r
+/*\r
+ * Generate a DHCP discover message and send it on the DHCP socket.\r
+ */\r
+static void prvSendDHCPDiscover( xMACAddress_t *pxMACAddress );\r
+\r
+/*\r
+ * Interpret message received on the DHCP socket.\r
+ */\r
+static portBASE_TYPE prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing );\r
+\r
+/*\r
+ * Generate a DHCP request packet, and send it on the DHCP socket.\r
+ */\r
+static void prvSendDHCPRequest( xMACAddress_t *pxMACAddress );\r
+\r
+/*\r
+ * Prepare to start a DHCP transaction.  This initialises some state variables\r
+ * and creates the DHCP socket if necessary.\r
+ */\r
+static void prvInitialiseDHCP( void );\r
+\r
+/*\r
+ * Creates the part of outgoing DHCP messages that are common to all outgoing\r
+ * DHCP messages.\r
+ */\r
+static uint8_t *prvCreatePartDHCPMessage( struct freertos_sockaddr *pxAddress, xMACAddress_t *pxMACAddress, uint8_t ucOpcode, const uint8_t * const pucOptionsArray, size_t xOptionsArraySize );\r
+\r
+/*\r
+ * Create the DHCP socket, if it has not been created already.\r
+ */\r
+static void prvCreateDHCPSocket( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The timer used to drive the DHCP state machine. */\r
+static xTimerHandle xDHCPTimer = NULL;\r
+\r
+/* The UDP socket used for all incoming and outgoing DHCP traffic. */\r
+static xSocket_t xDHCPSocket = NULL;\r
+\r
+/* Hold information in between steps in the DHCP state machine. */\r
+static uint32_t ulTransactionId = 0UL, ulOfferedIPAddress = 0UL, ulDHCPServerAddress = 0UL, ulLeaseTime = 0;\r
+\r
+/* Hold information on the current timer state. */\r
+static portTickType xDHCPTxTime = 0x00, xDHCPTxPeriod = 0x00;\r
+\r
+/* Maintains the DHCP state machine state. */\r
+static eDHCPState_t eDHCPState = eWaitingSendFirstDiscover;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing )\r
+{\r
+       if( xReset != pdFALSE )\r
+       {\r
+               eDHCPState = eWaitingSendFirstDiscover;\r
+       }\r
+\r
+       switch( eDHCPState )\r
+       {\r
+               case eWaitingSendFirstDiscover :\r
+\r
+                       /* Initial state.  Create the DHCP socket, timer, etc. if they\r
+                       have not already been created. */\r
+                       prvInitialiseDHCP();\r
+                       *pulIPAddress = 0UL;\r
+\r
+                       /* Send the first discover request. */\r
+                       if( xDHCPSocket != NULL )\r
+                       {\r
+                               xDHCPTxTime = xTaskGetTickCount();\r
+                               prvSendDHCPDiscover( pxMACAddress );\r
+                               eDHCPState = eWaitingOffer;\r
+                       }\r
+                       break;\r
+\r
+               case eWaitingOffer :\r
+\r
+                       /* Look for offers coming in. */\r
+                       if( prvProcessDHCPReplies( dhcpMESSAGE_TYPE_OFFER, pxMACAddress, pxNetworkAddressing ) == pdPASS )\r
+                       {\r
+                               /* An offer has been made, generate the request. */\r
+                               xDHCPTxTime = xTaskGetTickCount();\r
+                               xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;\r
+                               prvSendDHCPRequest( pxMACAddress );\r
+                               eDHCPState = eWaitingAcknowledge;\r
+                       }\r
+                       else\r
+                       {\r
+                               /* Is it time to send another Discover? */\r
+                               if( ( xTaskGetTickCount() - xDHCPTxTime ) > xDHCPTxPeriod )\r
+                               {\r
+                                       /* Increase the time period, and if it has not got to the\r
+                                       point of giving up - send another discovery. */\r
+                                       xDHCPTxPeriod <<= 1;\r
+                                       if( xDHCPTxPeriod <= ipconfigMAXIMUM_DISCOVER_TX_PERIOD )\r
+                                       {\r
+                                               ulTransactionId++;\r
+                                               xDHCPTxTime = xTaskGetTickCount();\r
+                                               prvSendDHCPDiscover( pxMACAddress );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               /* Revert to static IP address. */\r
+                                               taskENTER_CRITICAL();\r
+                                               {\r
+                                                       *pulIPAddress = pxNetworkAddressing->ulDefaultIPAddress;\r
+                                                       iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( pxNetworkAddressing->ulDefaultIPAddress );\r
+                                               }\r
+                                               taskEXIT_CRITICAL();\r
+                                               eDHCPState = eNotUsingLeasedAddress;\r
+                                               xTimerStop( xDHCPTimer, ( portTickType ) 0 );\r
+\r
+                                               #if ipconfigFREERTOS_PLUS_NABTO == 1\r
+                                               {\r
+                                                       vStartNabtoTask();\r
+                                               }\r
+                                               #endif /* ipconfigFREERTOS_PLUS_NABTO */\r
+\r
+                                               #if ipconfigUSE_NETWORK_EVENT_HOOK == 1\r
+                                               {\r
+                                                       vApplicationIPNetworkEventHook( eNetworkUp );\r
+                                               }\r
+                                               #endif\r
+\r
+                                               /* Close socket to ensure packets don't queue on it. */\r
+                                               FreeRTOS_closesocket( xDHCPSocket );\r
+                                               xDHCPSocket = NULL;\r
+                                       }\r
+                               }\r
+                       }\r
+                       break;\r
+\r
+               case eWaitingAcknowledge :\r
+\r
+                       /* Look for acks coming in. */\r
+                       if( prvProcessDHCPReplies( dhcpMESSAGE_TYPE_ACK, pxMACAddress, pxNetworkAddressing ) == pdPASS )\r
+                       {\r
+                               /* DHCP completed.  The IP address can now be used, and the\r
+                               timer set to the lease timeout time. */\r
+                               *pulIPAddress = ulOfferedIPAddress;\r
+                               eDHCPState = eLeasedAddress;\r
+\r
+                               #if ipconfigFREERTOS_PLUS_NABTO == 1\r
+                               {\r
+                                       vStartNabtoTask();\r
+                               }\r
+                               #endif /* ipconfigFREERTOS_PLUS_NABTO */\r
+\r
+                               #if ipconfigUSE_NETWORK_EVENT_HOOK == 1\r
+                               {\r
+                                       vApplicationIPNetworkEventHook( eNetworkUp );\r
+                               }\r
+                               #endif\r
+\r
+                               /* Close socket to ensure packets don't queue on it. */\r
+                               FreeRTOS_closesocket( xDHCPSocket );\r
+                               xDHCPSocket = NULL;\r
+\r
+                               if( ulLeaseTime == 0UL )\r
+                               {\r
+                                       ulLeaseTime = dhcpDEFAULT_LEASE_TIME;\r
+                               }\r
+                               else if( ulLeaseTime < dhcpMINIMUM_LEASE_TIME )\r
+                               {\r
+                                       ulLeaseTime = dhcpMINIMUM_LEASE_TIME;\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* The lease time is already valid. */\r
+                               }\r
+\r
+                               xTimerChangePeriod( xDHCPTimer, ulLeaseTime, portMAX_DELAY );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* Is it time to send another Discover? */\r
+                               if( ( xTaskGetTickCount() - xDHCPTxTime ) > xDHCPTxPeriod )\r
+                               {\r
+                                       /* Increase the time period, and if it has not got to the\r
+                                       point of giving up - send another request. */\r
+                                       xDHCPTxPeriod <<= 1;\r
+                                       if( xDHCPTxPeriod <= ipconfigMAXIMUM_DISCOVER_TX_PERIOD )\r
+                                       {\r
+                                               xDHCPTxTime = xTaskGetTickCount();\r
+                                               prvSendDHCPRequest( pxMACAddress );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               /* Give up, start again. */\r
+                                               eDHCPState = eWaitingSendFirstDiscover;\r
+                                       }\r
+                               }\r
+                       }\r
+                       break;\r
+\r
+               case eLeasedAddress :\r
+\r
+                       /* Resend the request at the appropriate time to renew the lease. */\r
+                       prvCreateDHCPSocket();\r
+                       if( xDHCPSocket != NULL )\r
+                       {\r
+                               xDHCPTxTime = xTaskGetTickCount();\r
+                               xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;\r
+                               prvSendDHCPRequest( pxMACAddress );\r
+                               eDHCPState = eWaitingAcknowledge;\r
+                       }\r
+                       xTimerChangePeriod( xDHCPTimer, dhcpINITIAL_TIMER_PERIOD, portMAX_DELAY );\r
+                       break;\r
+\r
+               case eNotUsingLeasedAddress:\r
+                       xTimerStop( xDHCPTimer, ( portTickType ) 0 );\r
+                       break;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvCreateDHCPSocket( void )\r
+{\r
+struct freertos_sockaddr xAddress;\r
+portBASE_TYPE xReturn;\r
+portTickType xTimeoutTime = 0;\r
+\r
+       /* Create the socket, if it has not already been created. */\r
+       if( xDHCPSocket == NULL )\r
+       {\r
+               xDHCPSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+               configASSERT( ( xDHCPSocket != FREERTOS_INVALID_SOCKET ) );\r
+\r
+               /* Ensure the Rx and Tx timeouts are zero as the DHCP executes in the\r
+               context of the IP task. */\r
+               FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) );\r
+               FreeRTOS_setsockopt( xDHCPSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) );\r
+\r
+               /* Bind to the standard DHCP client port. */\r
+               xAddress.sin_port = dhcpCLIENT_PORT;\r
+               xReturn = FreeRTOS_bind( xDHCPSocket, &xAddress, sizeof( xAddress ) );\r
+               configASSERT( xReturn == 0 );\r
+\r
+               /* Remove compiler warnings if configASSERT() is not defined. */\r
+               ( void ) xReturn;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvInitialiseDHCP( void )\r
+{\r
+extern void vIPFunctionsTimerCallback( xTimerHandle xTimer );\r
+\r
+       /* Initialise the parameters that will be set by the DHCP process. */\r
+       if( ulTransactionId == 0 )\r
+       {\r
+               ulTransactionId = ipconfigRAND32();\r
+       }\r
+       else\r
+       {\r
+               ulTransactionId++;\r
+       }\r
+       ulOfferedIPAddress = 0UL;\r
+       ulDHCPServerAddress = 0UL;\r
+       xDHCPTxPeriod = dhcpINITIAL_DHCP_TX_PERIOD;\r
+\r
+       /* Create the DHCP socket if it has not already been created. */\r
+       prvCreateDHCPSocket();\r
+\r
+       if( xDHCPTimer == NULL )\r
+       {\r
+               xDHCPTimer = xTimerCreate( ( const signed char * const ) "DHCP", dhcpINITIAL_TIMER_PERIOD, pdTRUE, ( void * ) eDHCPEvent, vIPFunctionsTimerCallback );\r
+               configASSERT( xDHCPTimer );\r
+               xTimerStart( xDHCPTimer, portMAX_DELAY );\r
+       }\r
+       else\r
+       {\r
+               xTimerChangePeriod( xDHCPTimer, dhcpINITIAL_TIMER_PERIOD, portMAX_DELAY );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvProcessDHCPReplies( uint8_t ucExpectedMessageType, xMACAddress_t *pxMACAddress, xNetworkAddressingParameters_t *pxNetworkAddressing )\r
+{\r
+uint8_t *pucUDPPayload, *pucLastByte;\r
+struct freertos_sockaddr xClient;\r
+uint32_t xClientLength = sizeof( xClient );\r
+int32_t lBytes;\r
+xDHCPMessage_t *pxDHCPMessage;\r
+uint8_t *pucByte, ucOptionCode, ucLength;\r
+uint32_t ulProcessed;\r
+portBASE_TYPE xReturn = pdFALSE;\r
+const uint32_t ulMandatoryOptions = 2; /* DHCP server address, and the correct DHCP message type must be present in the options. */\r
+\r
+       lBytes = FreeRTOS_recvfrom( xDHCPSocket, ( void * ) &pucUDPPayload, 0, FREERTOS_ZERO_COPY, &xClient, &xClientLength );\r
+\r
+       if( lBytes > 0 )\r
+       {\r
+               /* Map a DHCP structure onto the received data. */\r
+               pxDHCPMessage = ( xDHCPMessage_t * ) ( pucUDPPayload );\r
+\r
+               /* Sanity check. */\r
+               if( ( pxDHCPMessage->ulDHCPCookie == dhcpCOOKIE ) && ( pxDHCPMessage->ucOpcode == dhcpREPLY_OPCODE ) && ( pxDHCPMessage->ulTransactionID == ulTransactionId ) )\r
+               {\r
+                       if( memcmp( ( void * ) &( pxDHCPMessage->ucClientHardwareAddress ), ( void * ) pxMACAddress, sizeof( xMACAddress_t ) ) == 0 )\r
+                       {\r
+                               /* None of the essential options have been processed yet. */\r
+                               ulProcessed = 0;\r
+\r
+                               /* Walk through the options until the dhcpOPTION_END_BYTE byte\r
+                               is found, taking care not to walk off the end of the options. */\r
+                               pucByte = &( pxDHCPMessage->ucFirstOptionByte );\r
+                               pucLastByte = &( pucUDPPayload[ lBytes - dhcpMAX_OPTION_LENGTH_OF_INTEREST ] );\r
+                               while( ( *pucByte != dhcpOPTION_END_BYTE ) && ( pucByte < pucLastByte ) )\r
+                               {\r
+                                       ucOptionCode = *pucByte;\r
+                                       pucByte++;\r
+                                       ucLength = *pucByte;\r
+                                       pucByte++;\r
+\r
+                                       switch( ucOptionCode )\r
+                                       {\r
+                                               case dhcpMESSAGE_TYPE_OPTION_CODE       :\r
+\r
+                                                       if( *pucByte == ucExpectedMessageType )\r
+                                                       {\r
+                                                               /* The message type is the message type the\r
+                                                               state machine is expecting. */\r
+                                                               ulProcessed++;\r
+                                                       }\r
+                                                       else if( *pucByte == dhcpMESSAGE_TYPE_NACK )\r
+                                                       {\r
+                                                               if( ucExpectedMessageType == dhcpMESSAGE_TYPE_ACK )\r
+                                                               {\r
+                                                                       /* Start again. */\r
+                                                                       eDHCPState = eWaitingSendFirstDiscover;\r
+                                                               }\r
+                                                       }\r
+                                                       else\r
+                                                       {\r
+                                                               /* Don't process other message types. */\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               case dhcpSUBNET_MASK_OPTION_CODE :\r
+\r
+                                                       if( ucLength == sizeof( uint32_t ) )\r
+                                                       {\r
+                                                               memcpy( ( void * ) &( pxNetworkAddressing->ulNetMask ), ( void * ) pucByte, ( size_t ) ucLength );\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               case dhcpGATEWAY_OPTION_CODE :\r
+\r
+                                                       if( ucLength == sizeof( uint32_t ) )\r
+                                                       {\r
+                                                               /* ulProcessed is not incremented in this case\r
+                                                               because the gateway is not essential. */\r
+                                                               memcpy( ( void * ) &( pxNetworkAddressing->ulGatewayAddress ), ( void * ) pucByte, ( size_t ) ucLength );\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               case hdcpDNS_SERVER_OPTIONS_CODE :\r
+\r
+                                                       /* ulProcessed is not incremented in this case\r
+                                                       because the DNS server is not essential.  Only the\r
+                                                       first DNS server address is taken. */\r
+                                                       memcpy( ( void * ) &( pxNetworkAddressing->ulDNSServerAddress ), ( void * ) pucByte, sizeof( uint32_t ) );\r
+                                                       break;\r
+\r
+                                               case dhcpSERVER_IP_ADDRESS_OPTION_CODE :\r
+\r
+                                                       if( ucLength == sizeof( uint32_t ) )\r
+                                                       {\r
+                                                               if( ucExpectedMessageType == dhcpMESSAGE_TYPE_OFFER )\r
+                                                               {\r
+                                                                       /* Offers state the replying server. */\r
+                                                                       ulProcessed++;\r
+                                                                       memcpy( ( void * ) &ulDHCPServerAddress, ( void * ) pucByte, ( size_t ) ucLength );\r
+                                                               }\r
+                                                               else\r
+                                                               {\r
+                                                                       /* The ack must come from the expected server. */\r
+                                                                       if( memcmp( ( void * ) &ulDHCPServerAddress, ( void * ) pucByte, ( size_t ) ucLength ) == 0 )\r
+                                                                       {\r
+                                                                               ulProcessed++;\r
+                                                                       }\r
+                                                               }\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               case dhcpLEASE_TIME_OPTION_CODE :\r
+\r
+                                                       if( ucLength == sizeof( &ulLeaseTime ) )\r
+                                                       {\r
+                                                               /* ulProcessed is not incremented in this case\r
+                                                               because the lease time is not essential. */\r
+                                                               memcpy( ( void * ) &ulLeaseTime, ( void * ) pucByte, ( size_t ) ucLength );\r
+                                                               ulLeaseTime = FreeRTOS_ntohl( ulLeaseTime );\r
+\r
+                                                               /* Convert the lease time to milliseconds\r
+                                                               (*1000) then ticks (/portTICK_RATE_MS). */\r
+                                                               ulLeaseTime *= ( 1000UL / portTICK_RATE_MS );\r
+\r
+                                                               /* Divide the lease time to ensure a renew \r
+                                                               request is sent before the lease actually\r
+                                                               expires. */\r
+                                                               ulLeaseTime >>= 1UL;\r
+                                                       }\r
+                                                       break;\r
+\r
+                                               default :\r
+\r
+                                                       /* Not interested in this field. */\r
+\r
+                                                       break;\r
+                                       }\r
+\r
+                                       /* Jump over the data to find the next option code. */\r
+                                       if( ucLength == 0 )\r
+                                       {\r
+                                               break;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               pucByte += ucLength;\r
+                                       }\r
+                               }\r
+\r
+                               /* Were all the mandatory options received? */\r
+                               if( ulProcessed == ulMandatoryOptions )\r
+                               {\r
+                                       ulOfferedIPAddress = pxDHCPMessage->ulYourIPAddress_yiaddr;\r
+                                       xReturn = pdPASS;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               FreeRTOS_ReleaseUDPPayloadBuffer( ( void * ) pucUDPPayload );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint8_t *prvCreatePartDHCPMessage( struct freertos_sockaddr *pxAddress, xMACAddress_t *pxMACAddress, uint8_t ucOpcode, const uint8_t * const pucOptionsArray, size_t xOptionsArraySize )\r
+{\r
+xDHCPMessage_t *pxDHCPMessage;\r
+const size_t xRequiredBufferSize = sizeof( xDHCPMessage_t ) + xOptionsArraySize;\r
+uint8_t *pucUDPPayloadBuffer;\r
+\r
+       /* Get a buffer.  This uses a maximum delay, but the delay will be capped\r
+       to ipconfigMAX_SEND_BLOCK_TIME_TICKS so the return value still needs to be\r
+       test. */\r
+       do\r
+       {\r
+       }while( ( pucUDPPayloadBuffer = ( uint8_t * ) FreeRTOS_GetUDPPayloadBuffer( xRequiredBufferSize, portMAX_DELAY ) ) == NULL );\r
+\r
+       pxDHCPMessage = ( xDHCPMessage_t * ) pucUDPPayloadBuffer;\r
+\r
+       /* Most fields need to be zero. */\r
+       memset( ( void * ) pxDHCPMessage, 0x00, sizeof( xDHCPMessage_t ) );\r
+\r
+       /* Create the message. */\r
+       pxDHCPMessage->ucOpcode = ucOpcode;\r
+       pxDHCPMessage->ucAddressType = dhcpADDRESS_TYPE_ETHERNET;\r
+       pxDHCPMessage->ucAddressLength = dhcpETHERNET_ADDRESS_LENGTH;\r
+       pxDHCPMessage->ulTransactionID = ulTransactionId;\r
+       pxDHCPMessage->ulYourIPAddress_yiaddr = ulOfferedIPAddress;\r
+       pxDHCPMessage->ulDHCPCookie = dhcpCOOKIE;\r
+       memcpy( ( void * ) &( pxDHCPMessage->ucClientHardwareAddress[ 0 ] ), ( void * ) pxMACAddress, sizeof( xMACAddress_t ) );\r
+\r
+       /* Copy in the const part of the options options. */\r
+       memcpy( ( void * ) &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET ] ), ( void * ) pucOptionsArray, xOptionsArraySize );\r
+\r
+       /* Map in the client identifier. */\r
+       memcpy( ( void * ) &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + dhcpCLIENT_IDENTIFIER_OFFSET ] ), ( void * ) pxMACAddress, sizeof( xMACAddress_t ) );\r
+\r
+       /* Set the addressing. */\r
+       pxAddress->sin_addr = ipBROADCAST_IP_ADDRESS;\r
+       pxAddress->sin_port = ( uint16_t ) dhcpSERVER_PORT;\r
+\r
+       return pucUDPPayloadBuffer;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSendDHCPRequest( xMACAddress_t *pxMACAddress )\r
+{\r
+uint8_t *pucUDPPayloadBuffer;\r
+struct freertos_sockaddr xAddress;\r
+static const uint8_t ucDHCPRequestOptions[] =\r
+{\r
+       /* Do not change the ordering without also changing\r
+       dhcpCLIENT_IDENTIFIER_OFFSET, dhcpREQUESTED_IP_ADDRESS_OFFSET and\r
+       dhcpDHCP_SERVER_IP_ADDRESS_OFFSET. */\r
+       dhcpMESSAGE_TYPE_OPTION_CODE, 1, dhcpMESSAGE_TYPE_REQUEST,              /* Message type option. */\r
+       dhcpCLIENT_IDENTIFIER_OPTION_CODE, 6, 0, 0, 0, 0, 0, 0,                 /* Client identifier. */\r
+       dhcpREQUEST_IP_ADDRESS_OPTION_CODE, 4, 0, 0, 0, 0,                              /* The IP address being requested. */\r
+       dhcpSERVER_IP_ADDRESS_OPTION_CODE, 4, 0, 0, 0, 0,                               /* The IP address of the DHCP server. */\r
+       dhcpOPTION_END_BYTE\r
+};\r
+\r
+       pucUDPPayloadBuffer = prvCreatePartDHCPMessage( &xAddress, pxMACAddress, dhcpREQUEST_OPCODE, ucDHCPRequestOptions, sizeof( ucDHCPRequestOptions ) );\r
+\r
+       /* Copy in the IP address being requested. */\r
+       memcpy( ( void * ) &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + dhcpREQUESTED_IP_ADDRESS_OFFSET ] ), ( void * ) &ulOfferedIPAddress, sizeof( ulOfferedIPAddress ) );\r
+\r
+       /* Copy in the address of the DHCP server being used. */\r
+       memcpy( ( void * ) &( pucUDPPayloadBuffer[ dhcpFIRST_OPTION_BYTE_OFFSET + dhcpDHCP_SERVER_IP_ADDRESS_OFFSET ] ), ( void * ) &ulDHCPServerAddress, sizeof( ulDHCPServerAddress ) );\r
+\r
+       iptraceSENDING_DHCP_REQUEST();\r
+       if( FreeRTOS_sendto( xDHCPSocket, pucUDPPayloadBuffer, ( sizeof( xDHCPMessage_t ) + sizeof( ucDHCPRequestOptions ) ), FREERTOS_ZERO_COPY, &xAddress, sizeof( xAddress ) ) == 0 )\r
+       {\r
+               /* The packet was not successfully queued for sending and must be\r
+               returned to the stack. */\r
+               FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSendDHCPDiscover( xMACAddress_t *pxMACAddress )\r
+{\r
+uint8_t *pucUDPPayloadBuffer;\r
+struct freertos_sockaddr xAddress;\r
+static const uint8_t ucDHCPDiscoverOptions[] =\r
+{\r
+       /* Do not change the ordering without also changing dhcpCLIENT_IDENTIFIER_OFFSET. */\r
+       dhcpMESSAGE_TYPE_OPTION_CODE, 1, dhcpMESSAGE_TYPE_DISCOVER,                                     /* Message type option. */\r
+       dhcpCLIENT_IDENTIFIER_OPTION_CODE, 6, 0, 0, 0, 0, 0, 0,                                         /* Client identifier. */\r
+       dhcpPARAMETER_REQUEST_OPTION_CODE, 3, dhcpSUBNET_MASK_OPTION_CODE, dhcpGATEWAY_OPTION_CODE, hdcpDNS_SERVER_OPTIONS_CODE,        /* Parameter request option. */\r
+       dhcpOPTION_END_BYTE\r
+};\r
+\r
+       pucUDPPayloadBuffer = prvCreatePartDHCPMessage( &xAddress, pxMACAddress, dhcpREQUEST_OPCODE, ucDHCPDiscoverOptions, sizeof( ucDHCPDiscoverOptions ) );\r
+\r
+       iptraceSENDING_DHCP_DISCOVER();\r
+       if( FreeRTOS_sendto( xDHCPSocket, pucUDPPayloadBuffer, ( sizeof( xDHCPMessage_t ) + sizeof( ucDHCPDiscoverOptions ) ), FREERTOS_ZERO_COPY, &xAddress, sizeof( xAddress ) ) == 0 )\r
+       {\r
+               /* The packet was not successfully queued for sending and must be\r
+               returned to the stack. */\r
+               FreeRTOS_ReleaseUDPPayloadBuffer( pucUDPPayloadBuffer );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#endif /* ipconfigUSE_DHCP != 0 */\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DNS.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DNS.c
new file mode 100644 (file)
index 0000000..2a5598f
--- /dev/null
@@ -0,0 +1,411 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "timers.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_DNS.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkInterface.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+/* Exclude the entire file if DNS is not enabled. */\r
+#if ipconfigUSE_DNS != 0\r
+\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+       #define dnsOUTGOING_FLAGS                               0x0001 /* Standard query. */\r
+       #define dnsTYPE                                                 0x0100 /* A record (host address. */\r
+       #define dnsCLASS                                                0x0100 /* IN */\r
+       #define dnsDNS_PORT                                             0x3500\r
+       #define dnsONE_QUESTION                                 0x0100\r
+       #define dnsRX_FLAGS_MASK                                0x0f80 /* The bits of interest in the flags field of incoming DNS messages. */\r
+       #define dnsEXPECTED_RX_FLAGS                    0x0080 /* Should be a response, without any errors. */\r
+#else\r
+       #define dnsDNS_PORT                                             0x35\r
+       #define dnsONE_QUESTION                                 0x01\r
+       #define dnsFLAG_QUERY_RESPONSE_BIT              0x8000\r
+       #define dnsFLAG_OPERATION_CODE_BITS             0x7800\r
+       #define dnsFLAG_TRUNCATION_BIT                  0x0200\r
+       #define dnsFLAG_RESPONSE_CODE_BITS              0x000f\r
+       #define dnsOUTGOING_FLAGS                               0x0100 /* Standard query. */\r
+       #define dnsTYPE                                                 0x0001 /* A record (host address. */\r
+       #define dnsCLASS                                                0x0001 /* IN */\r
+       #define dnsRX_FLAGS_MASK                                0x800f /* The bits of interest in the flags field of incoming DNS messages. */\r
+       #define dnsEXPECTED_RX_FLAGS                    0x8000 /* Should be a response, without any errors. */\r
+#endif /* ipconfigBYTE_ORDER */\r
+\r
+/* The maximum number of times a DNS request should be sent out if a response\r
+is not received, before giving up. */\r
+#define dnsMAX_REQUEST_ATTEMPTS                5\r
+\r
+/* If the top two bits in the first character of a name field are set then the\r
+name field is an offset to the string, rather than the string itself. */\r
+#define dnsNAME_IS_OFFSET                      ( ( uint8_t ) 0xc0 )\r
+\r
+/*\r
+ * Create a socket and bind it to the standard DNS port number.  Return the\r
+ * the created socket - or NULL if the socket could not be created or bound.\r
+ */\r
+static xSocket_t prvCreateDNSSocket( void );\r
+\r
+/*\r
+ * Create the DNS message in the zero copy buffer passed in the first parameter.\r
+ */\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier );\r
+\r
+/*\r
+ * Simple routine that jumps over the NAME field of a resource record.\r
+ */\r
+static uint8_t *prvSkipNameField( uint8_t *pucByte );\r
+\r
+/*\r
+ * Process a response packet from a DNS server.\r
+ */\r
+static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer, uint16_t usIdentifier );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+#include "pack_struct_start.h"\r
+struct xDNSMessage\r
+{\r
+       uint16_t usIdentifier;\r
+       uint16_t usFlags;\r
+       uint16_t usQuestions;\r
+       uint16_t usAnswers;\r
+       uint16_t usAuthorityRRs;\r
+       uint16_t usAdditionalRRs;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xDNSMessage xDNSMessage_t;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName )\r
+{\r
+static uint16_t usIdentifier = 0;\r
+struct freertos_sockaddr xAddress;\r
+static xSocket_t xDNSSocket = NULL;\r
+uint32_t ulIPAddress = 0UL;\r
+uint8_t *pucUDPPayloadBuffer;\r
+static uint32_t ulAddressLength;\r
+portBASE_TYPE xAttempt;\r
+int32_t lBytes;\r
+size_t xPayloadLength;\r
+const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const char * const ) pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */\r
+\r
+       if( xDNSSocket == NULL )\r
+       {\r
+               xDNSSocket = prvCreateDNSSocket();\r
+       }\r
+\r
+       if( xDNSSocket != NULL )\r
+       {\r
+               /* Generate a unique identifier for this query. */\r
+               usIdentifier++;\r
+\r
+               for( xAttempt = 0; xAttempt < dnsMAX_REQUEST_ATTEMPTS; xAttempt++ )\r
+               {\r
+                       /* Get a buffer.  This uses a maximum delay, but the delay will be\r
+                       capped to ipconfigMAX_SEND_BLOCK_TIME_TICKS so the return value\r
+                       still needs to be tested. */\r
+                       pucUDPPayloadBuffer = ( uint8_t * ) FreeRTOS_GetUDPPayloadBuffer( xExpectedPayloadLength, portMAX_DELAY );\r
+                       if( pucUDPPayloadBuffer != NULL )\r
+                       {\r
+                               /* Create the message in the obtained buffer. */\r
+                               xPayloadLength = prvCreateDNSMessage( pucUDPPayloadBuffer, pcHostName, usIdentifier );\r
+                               iptraceSENDING_DNS_REQUEST();\r
+\r
+                               /* Obtain the DNS server address. */\r
+                               FreeRTOS_GetAddressConfiguration( NULL, NULL, NULL, &ulIPAddress );\r
+\r
+                               /* Send the DNS message. */\r
+                               xAddress.sin_addr = ulIPAddress;\r
+                               xAddress.sin_port = dnsDNS_PORT;\r
+                               ulIPAddress = 0;\r
+\r
+                               if( FreeRTOS_sendto( xDNSSocket, pucUDPPayloadBuffer, xPayloadLength, FREERTOS_ZERO_COPY, &xAddress, sizeof( xAddress ) ) != 0 )\r
+                               {\r
+                                       /* Wait for the reply. */\r
+                                       lBytes = FreeRTOS_recvfrom( xDNSSocket, &pucUDPPayloadBuffer, 0, FREERTOS_ZERO_COPY, &xAddress, &ulAddressLength );\r
+\r
+                                       if( lBytes > 0 )\r
+                                       {\r
+                                               /* The reply was received.  Process it. */\r
+                                               ulIPAddress = prvParseDNSReply( pucUDPPayloadBuffer, usIdentifier );\r
+\r
+                                               /* Finished with the buffer.  The zero copy interface\r
+                                               is being used, so the buffer must be freed by the\r
+                                               task. */\r
+                                               FreeRTOS_ReleaseUDPPayloadBuffer( ( void * ) pucUDPPayloadBuffer );\r
+\r
+                                               if( ulIPAddress != 0 )\r
+                                               {\r
+                                                       /* All done. */\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* The message was not sent so the stack will not be\r
+                                       releasing the zero copy - it must be released here. */\r
+                                       FreeRTOS_ReleaseUDPPayloadBuffer( ( void * ) pucUDPPayloadBuffer );\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       return ulIPAddress;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier )\r
+{\r
+xDNSMessage_t *pxDNSMessageHeader;\r
+uint8_t *pucStart, *pucByte;\r
+const uint16_t usARecordType = dnsTYPE, usClass = dnsCLASS;\r
+static const xDNSMessage_t xDefaultPartDNSHeader =\r
+{\r
+       0,                                      /* The identifier will be overwritten. */\r
+       dnsOUTGOING_FLAGS,      /* Flags set for standard query. */\r
+       dnsONE_QUESTION,        /* One question is being asked. */\r
+       0,                                      /* No replies are included. */\r
+       0,                                      /* No authorities. */\r
+       0                                       /* No additional authorities. */\r
+};\r
+\r
+       /* Copy in the const part of the header. */\r
+       memcpy( ( void * ) pucUDPPayloadBuffer, ( void * ) &xDefaultPartDNSHeader, sizeof( xDefaultPartDNSHeader ) );\r
+\r
+       /* Write in a unique identifier. */\r
+       pxDNSMessageHeader = ( xDNSMessage_t * ) pucUDPPayloadBuffer;\r
+       pxDNSMessageHeader->usIdentifier = usIdentifier;\r
+\r
+       /* Create the resource record at the end of the header.  First\r
+       find the end of the header. */\r
+       pucStart = pucUDPPayloadBuffer + sizeof( xDefaultPartDNSHeader );\r
+\r
+       /* Leave a gap for the first length bytes. */\r
+       pucByte = pucStart + 1;\r
+\r
+       /* Copy in the host name. */\r
+       strcpy( ( char * ) pucByte, ( const char * ) pcHostName );\r
+\r
+       /* Mark the end of the string. */\r
+       pucByte += strlen( ( const char * ) pcHostName );\r
+       *pucByte = 0x00;\r
+\r
+       /* Walk the string to replace the '.' characters with byte counts.\r
+       pucStart holds the address of the byte count.  Walking the string\r
+       starts after the byte count position. */\r
+       pucByte = pucStart;\r
+\r
+       do\r
+       {\r
+               pucByte++;\r
+\r
+               while( ( *pucByte != 0x00 ) && ( *pucByte != '.' ) )\r
+               {\r
+                       pucByte++;\r
+               }\r
+\r
+               /* Fill in the byte count, then move the pucStart pointer up to\r
+               the found byte position. */\r
+               *pucStart = ( uint8_t ) ( ( uint32_t ) pucByte - ( uint32_t ) pucStart );\r
+               ( *pucStart )--;\r
+\r
+               pucStart = pucByte;\r
+\r
+       } while( *pucByte != 0x00 );\r
+\r
+       /* Finish off the record. */\r
+       pucByte++;\r
+       memcpy( ( void * ) pucByte, &usARecordType, sizeof( uint16_t ) );\r
+       pucByte += sizeof( uint16_t );\r
+       memcpy( ( void * ) pucByte, &usClass, sizeof( uint16_t ) );\r
+       pucByte += sizeof( uint16_t );\r
+\r
+       /* Return the total size of the generated message, which is the space from\r
+       the last written byte to the beginning of the buffer. */\r
+       return ( ( uint32_t ) pucByte - ( uint32_t ) pucUDPPayloadBuffer );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint8_t *prvSkipNameField( uint8_t *pucByte )\r
+{\r
+       /* Determine if the name is the fully coded name, or an offset to the name\r
+       elsewhere in the message. */\r
+       if( ( *pucByte & dnsNAME_IS_OFFSET ) == dnsNAME_IS_OFFSET )\r
+       {\r
+               /* Jump over the two byte offset. */\r
+               pucByte += sizeof( uint16_t );\r
+\r
+       }\r
+       else\r
+       {\r
+               /* pucByte points to the full name.  Walk over the string. */\r
+               while( *pucByte != 0x00 )\r
+               {\r
+                       /* The number of bytes to jump for each name section is stored in the byte\r
+                       before the name section. */\r
+                       pucByte += ( *pucByte + 1 );\r
+               }\r
+\r
+               pucByte++;\r
+       }\r
+\r
+       return pucByte;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint32_t prvParseDNSReply( uint8_t *pucUDPPayloadBuffer, uint16_t usIdentifier )\r
+{\r
+xDNSMessage_t *pxDNSMessageHeader;\r
+uint32_t ulIPAddress = 0UL;\r
+uint8_t *pucByte;\r
+uint16_t x, usDataLength;\r
+const uint16_t usARecordType = dnsTYPE;\r
+\r
+       pxDNSMessageHeader = ( xDNSMessage_t * ) pucUDPPayloadBuffer;\r
+\r
+       if( pxDNSMessageHeader->usIdentifier == usIdentifier )\r
+       {\r
+               if( ( pxDNSMessageHeader->usFlags & dnsRX_FLAGS_MASK ) == dnsEXPECTED_RX_FLAGS )\r
+               {\r
+                       /* Start at the first byte after the header. */\r
+                       pucByte = pucUDPPayloadBuffer + sizeof( xDNSMessage_t );\r
+\r
+                       /* Skip any question records. */\r
+                       pxDNSMessageHeader->usQuestions = FreeRTOS_ntohs( pxDNSMessageHeader->usQuestions );\r
+                       for( x = 0; x < pxDNSMessageHeader->usQuestions; x++ )\r
+                       {\r
+                               /* Skip the variable length name field. */\r
+                               pucByte = prvSkipNameField( pucByte );\r
+\r
+                               /* Skip the type and class fields. */\r
+                               pucByte += sizeof( uint32_t );\r
+                       }\r
+\r
+                       /* Search through the answers records. */\r
+                       pxDNSMessageHeader->usAnswers = FreeRTOS_ntohs( pxDNSMessageHeader->usAnswers );\r
+                       for( x = 0; x < pxDNSMessageHeader->usAnswers; x++ )\r
+                       {\r
+                               pucByte = prvSkipNameField( pucByte );\r
+\r
+                               /* Is the type field that of an A record? */\r
+                               if( memcmp( ( void * ) pucByte, ( void * ) &usARecordType, sizeof( uint16_t ) ) == 0 )\r
+                               {\r
+                                       /* This is the required record.  Skip the type, class, and\r
+                                       time to live fields, plus the first byte of the data\r
+                                       length. */\r
+                                       pucByte += ( sizeof( uint32_t ) + sizeof( uint32_t ) + sizeof( uint8_t ) );\r
+\r
+                                       /* Sanity check the data length. */\r
+                                       if( *pucByte == sizeof( uint32_t ) )\r
+                                       {\r
+                                               /* Skip the second byte of the length. */\r
+                                               pucByte++;\r
+\r
+                                               /* Copy the IP address out of the record. */\r
+                                               memcpy( ( void * ) &ulIPAddress, ( void * ) pucByte, sizeof( uint32_t ) );\r
+                                       }\r
+\r
+                                       break;\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* Skip the type, class and time to live fields. */\r
+                                       pucByte += ( sizeof( uint32_t ) + sizeof( uint32_t ) );\r
+\r
+                                       /* Determine the length of the data in the field. */\r
+                                       memcpy( ( void * ) &usDataLength, ( void * ) pucByte, sizeof( uint16_t ) );\r
+                                       usDataLength = FreeRTOS_ntohs( usDataLength );\r
+\r
+                                       /* Jump over the data lenth bytes, and the data itself. */\r
+                                       pucByte += usDataLength + sizeof( uint16_t );\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       return ulIPAddress;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static xSocket_t prvCreateDNSSocket( void )\r
+{\r
+static xSocket_t xSocket = NULL;\r
+struct freertos_sockaddr xAddress;\r
+portBASE_TYPE xReturn;\r
+portTickType xTimeoutTime = 200 / portTICK_RATE_MS;\r
+\r
+       /* This must be the first time this function has been called.  Create\r
+       the socket. */\r
+       xSocket = FreeRTOS_socket( FREERTOS_AF_INET, FREERTOS_SOCK_DGRAM, FREERTOS_IPPROTO_UDP );\r
+\r
+       /* Auto bind the port. */\r
+       xAddress.sin_port = 0;\r
+       xReturn = FreeRTOS_bind( xSocket, &xAddress, sizeof( xAddress ) );\r
+\r
+       /* Check the bind was successful, and clean up if not. */\r
+       if( xReturn != 0 )\r
+       {\r
+               FreeRTOS_closesocket( xSocket );\r
+               xSocket = NULL;\r
+       }\r
+       else\r
+       {\r
+               /* Set the send and receive timeouts. */\r
+               FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_RCVTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) );\r
+               FreeRTOS_setsockopt( xSocket, 0, FREERTOS_SO_SNDTIMEO, ( void * ) &xTimeoutTime, sizeof( portTickType ) );\r
+       }\r
+\r
+       return xSocket;\r
+}\r
+\r
+#endif /* ipconfigUSE_DNS != 0 */\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.c
new file mode 100644 (file)
index 0000000..f635b3c
--- /dev/null
@@ -0,0 +1,1035 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Sanity check the UDP payload length setting is compatible with the\r
+fragmentation setting. */\r
+#if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+       #if ( ( ipMAX_UDP_PAYLOAD_LENGTH % 8 ) != 0 )\r
+               #error ( ipconfigNETWORK_MTU - 28 ) must be divisible by 8 when fragmentation is used\r
+       #endif /* ipMAX_UDP_PAYLOAD_LENGTH */\r
+#endif /* ipconfigFRAGMENT_OUTGOING_PACKETS */\r
+\r
+/* The ItemValue of the sockets xBoundSocketListItem member holds the socket's\r
+port number. */\r
+#define socketSET_SOCKET_ADDRESS( pxSocket, usPort ) listSET_LIST_ITEM_VALUE( ( &( ( pxSocket )->xBoundSocketListItem ) ), ( usPort ) )\r
+#define socketGET_SOCKET_ADDRESS( pxSocket ) listGET_LIST_ITEM_VALUE( ( &( ( pxSocket )->xBoundSocketListItem ) ) )\r
+\r
+/* xWaitingPacketSemaphore is not created until the socket is bound, so can be\r
+tested to see if bind() has been called. */\r
+#define socketSOCKET_IS_BOUND( pxSocket ) ( ( uint32_t ) pxSocket->xWaitingPacketSemaphore )\r
+\r
+/* If FreeRTOS_sendto() is called on a socket that is not bound to a port\r
+number then, depending on the FreeRTOSIPConfig.h settings, it might be that a\r
+port number is automatically generated for the socket.  Automatically generated\r
+port numbers will be between socketAUTO_PORT_ALLOCATION_START_NUMBER and\r
+0xffff. */\r
+#define socketAUTO_PORT_ALLOCATION_START_NUMBER ( ( uint16_t ) 0xc000 )\r
+\r
+/* When the automatically generated port numbers overflow, the next value used\r
+is not set back to socketAUTO_PORT_ALLOCATION_START_NUMBER because it is likely\r
+that the first few automatically generated ports will still be in use.  Instead\r
+it is reset back to the value defined by this constant. */\r
+#define socketAUTO_PORT_ALLOCATION_RESET_NUMBER ( ( uint16_t ) 0xc100 )\r
+\r
+/* The number of octets that make up an IP address. */\r
+#define socketMAX_IP_ADDRESS_OCTETS            4\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Allocate the next port number from the private allocation range.\r
+ */\r
+static uint16_t prvGetPrivatePortNumber( void );\r
+\r
+/*\r
+ * Return the list itme from within pxList that has an item value of\r
+ * xWantedItemValue.  If there is no such list item return NULL.\r
+ */\r
+xListItem * pxListFindListItemWithValue( xList *pxList, portTickType xWantedItemValue );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+typedef struct XSOCKET\r
+{\r
+       xSemaphoreHandle xWaitingPacketSemaphore;\r
+       xList xWaitingPacketsList;\r
+       xListItem xBoundSocketListItem; /* Used to reference the socket from a bound sockets list. */\r
+       portTickType xReceiveBlockTime;\r
+       portTickType xSendBlockTime;\r
+       uint8_t ucSocketOptions;\r
+       #if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+               xQueueHandle xSelectQueue;\r
+       #endif\r
+} xFreeRTOS_Socket_t;\r
+\r
+\r
+/* The list that contains mappings between sockets and port numbers.  Accesses\r
+to this list must be protected by critical sections of one kind or another. */\r
+static xList xBoundSocketsList;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+xSocket_t FreeRTOS_socket( portBASE_TYPE xDomain, portBASE_TYPE xType, portBASE_TYPE xProtocol )\r
+{\r
+xFreeRTOS_Socket_t *pxSocket;\r
+\r
+       /* Only UDP on Ethernet is currently supported. */\r
+       configASSERT( xDomain == FREERTOS_AF_INET );\r
+       configASSERT( xType == FREERTOS_SOCK_DGRAM );\r
+       configASSERT( xProtocol == FREERTOS_IPPROTO_UDP );\r
+       configASSERT( listLIST_IS_INITIALISED( &xBoundSocketsList ) );\r
+\r
+       /* Allocate the structure that will hold the socket information. */\r
+       pxSocket = ( xFreeRTOS_Socket_t * ) pvPortMalloc( sizeof( xFreeRTOS_Socket_t ) );\r
+\r
+       if( pxSocket == NULL )\r
+       {\r
+               pxSocket = ( xFreeRTOS_Socket_t * ) FREERTOS_INVALID_SOCKET;\r
+               iptraceFAILED_TO_CREATE_SOCKET();\r
+       }\r
+       else\r
+       {\r
+               /* Initialise the socket's members.  The semaphore will be created if\r
+               the socket is bound to an address, for now the pointer to the semaphore\r
+               is just set to NULL to show it has not been created. */\r
+               pxSocket->xWaitingPacketSemaphore = NULL;\r
+               vListInitialise( &( pxSocket->xWaitingPacketsList ) );\r
+               vListInitialiseItem( &( pxSocket->xBoundSocketListItem ) );\r
+               listSET_LIST_ITEM_OWNER( &( pxSocket->xBoundSocketListItem ), ( void * ) pxSocket );\r
+               pxSocket->xSendBlockTime = ( portTickType ) 0;\r
+               pxSocket->xReceiveBlockTime = portMAX_DELAY;\r
+               pxSocket->ucSocketOptions = FREERTOS_SO_UDPCKSUM_OUT;\r
+               #if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+                       pxSocket->xSelectQueue = NULL;\r
+               #endif\r
+       }\r
+\r
+       /* Remove compiler warnings in the case the configASSERT() is not defined. */\r
+       ( void ) xDomain;\r
+       ( void ) xType;\r
+       ( void ) xProtocol;\r
+\r
+       return ( xSocket_t ) pxSocket;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+\r
+       xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength )\r
+       {\r
+       xQueueHandle xSelectQueue;\r
+\r
+               /* Create the queue into which the address of sockets that are\r
+               available to read are posted. */\r
+               xSelectQueue = xQueueCreate( uxEventQueueLength, sizeof( xSocket_t ) );\r
+\r
+               return ( xSocketSet_t ) xSelectQueue;\r
+       }\r
+\r
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+\r
+       portBASE_TYPE FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet )\r
+       {\r
+       xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+       portBASE_TYPE xReturn;\r
+       \r
+               /* Is the socket already a member of a select group? */\r
+               if( pxSocket->xSelectQueue == NULL )\r
+               {\r
+                       /* Store a pointer to the select group in the socket for future \r
+                       reference. */\r
+                       pxSocket->xSelectQueue = ( xQueueHandle ) xSocketSet;\r
+                       xReturn = pdPASS;\r
+               }\r
+               else\r
+               {\r
+                       /* The socket is already a member of a select group so cannot be added\r
+                       to another. */\r
+                       xReturn = pdFAIL;\r
+               }\r
+\r
+               return xReturn;\r
+       }\r
+\r
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+\r
+       portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet ) \r
+       {\r
+       xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+       portBASE_TYPE xReturn;\r
+\r
+               /* Is the socket a member of the select group? */\r
+               if( pxSocket->xSelectQueue == ( xQueueHandle ) xSocketSet )\r
+               {\r
+                       /* The socket is no longer a member of the select group. */\r
+                       pxSocket->xSelectQueue = NULL;\r
+                       xReturn = pdPASS;\r
+               }\r
+               else\r
+               {\r
+                       xReturn = pdFAIL;\r
+               }\r
+\r
+               return xReturn;\r
+       }\r
+\r
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+\r
+       xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, portTickType xBlockTimeTicks )\r
+       {\r
+       xFreeRTOS_Socket_t *pxSocket;\r
+\r
+               /* Wait for a socket to be ready to read. */\r
+               if( xQueueReceive( ( xQueueHandle ) xSocketSet, &pxSocket, xBlockTimeTicks ) != pdPASS )\r
+               {\r
+                       pxSocket = NULL;\r
+               }\r
+\r
+               return ( xSocket_t ) pxSocket;\r
+       }\r
+\r
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
+/*-----------------------------------------------------------*/\r
+\r
+int32_t FreeRTOS_recvfrom( xSocket_t xSocket, void *pvBuffer, size_t xBufferLength, uint32_t ulFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength )\r
+{\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+int32_t lReturn;\r
+xFreeRTOS_Socket_t *pxSocket;\r
+\r
+       pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+       /* The function prototype is designed to maintain the expected Berkeley\r
+       sockets standard, but this implementation does not use all the parameters. */\r
+       ( void ) pxSourceAddressLength;\r
+\r
+       if( socketSOCKET_IS_BOUND( pxSocket ) != pdFALSE )\r
+       {\r
+               /* The semaphore is given when received data is queued on the socket. */\r
+               if( xSemaphoreTake( pxSocket->xWaitingPacketSemaphore, pxSocket->xReceiveBlockTime ) == pdPASS )\r
+               {\r
+                       taskENTER_CRITICAL();\r
+                       {\r
+                               configASSERT( ( listCURRENT_LIST_LENGTH( &( pxSocket->xWaitingPacketsList ) ) > 0U ) );\r
+\r
+                               /* The owner of the list item is the network buffer. */\r
+                               pxNetworkBuffer = ( xNetworkBufferDescriptor_t * ) listGET_OWNER_OF_HEAD_ENTRY( &( pxSocket->xWaitingPacketsList ) );\r
+\r
+                               /* Remove the network buffer from the list of buffers waiting to\r
+                               be processed by the socket. */\r
+                               uxListRemove( &( pxNetworkBuffer->xBufferListItem ) );\r
+                       }\r
+                       taskEXIT_CRITICAL();\r
+\r
+                       if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                       {\r
+                               /* The zero copy flag is not set.  Truncate the length if it\r
+                               won't fit in the provided buffer. */\r
+                               if( pxNetworkBuffer->xDataLength > xBufferLength )\r
+                               {\r
+                                       iptraceRECVFROM_DISCARDING_BYTES( ( xBufferLength - pxNetworkBuffer->xDataLength ) );\r
+                                       pxNetworkBuffer->xDataLength = xBufferLength;\r
+                               }\r
+\r
+                               /* Copy the received data into the provided buffer, then\r
+                               release the network buffer. */\r
+                               memcpy( pvBuffer, ( void * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipUDP_PAYLOAD_OFFSET ] ), pxNetworkBuffer->xDataLength );\r
+                               vNetworkBufferRelease( pxNetworkBuffer );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The zero copy flag was set.  pvBuffer is not a buffer into\r
+                               which the received data can be copied, but a pointer that must\r
+                               be set to point to the buffer in which the received data has\r
+                               already been placed. */\r
+                               *( ( void** ) pvBuffer ) = ( void * ) ( &( pxNetworkBuffer->pucEthernetBuffer[ ipUDP_PAYLOAD_OFFSET ] ) );\r
+                       }\r
+\r
+                       /* The returned value is the data length, which may have been\r
+                       capped to the receive buffer size. */\r
+                       lReturn = ( int32_t ) pxNetworkBuffer->xDataLength;\r
+\r
+                       if( pxSourceAddress != NULL )\r
+                       {\r
+                               pxSourceAddress->sin_port = pxNetworkBuffer->usPort;\r
+                               pxSourceAddress->sin_addr = pxNetworkBuffer->ulIPAddress;\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       lReturn = FREERTOS_EWOULDBLOCK;\r
+                       iptraceRECVFROM_TIMEOUT();\r
+               }\r
+       }\r
+       else\r
+       {\r
+               lReturn = FREERTOS_EINVAL;\r
+       }\r
+\r
+       return lReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+\r
+       int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength )\r
+       {\r
+       xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+       xIPFragmentParameters_t *pxFragmentParameters;\r
+       size_t xBytesToSend, xBytesRemaining;\r
+       xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL };\r
+       extern xQueueHandle xNetworkEventQueue;\r
+       uint8_t *pucBuffer;\r
+       xTimeOutType xTimeOut;\r
+       portTickType xTicksToWait;\r
+       uint16_t usFragmentOffset;\r
+       xFreeRTOS_Socket_t *pxSocket;\r
+\r
+               pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+               /* The function prototype is designed to maintain the expected Berkeley\r
+               sockets standard, but this implementation does not use all the\r
+               parameters. */\r
+               ( void ) xDestinationAddressLength;\r
+               configASSERT( xNetworkEventQueue );\r
+               configASSERT( pvBuffer );\r
+\r
+               xBytesRemaining = xTotalDataLength;\r
+\r
+               if( socketSOCKET_IS_BOUND( pxSocket ) == pdFALSE )\r
+               {\r
+                       /* If the socket is not already bound to an address, bind it now.\r
+                       Passing NULL as the address parameter tells FreeRTOS_bind() to select\r
+                       the address to bind to. */\r
+                       FreeRTOS_bind( xSocket, NULL, 0 );\r
+               }\r
+\r
+               if( socketSOCKET_IS_BOUND( pxSocket ) != pdFALSE )\r
+               {\r
+                       /* pucBuffer will be reset if this send turns out to be a zero copy\r
+                       send because in that case pvBuffer is actually a pointer to an\r
+                       xUserData_t structure, not the UDP payload. */\r
+                       pucBuffer = ( uint8_t * ) pvBuffer;\r
+                       vTaskSetTimeOutState( &xTimeOut );\r
+                       xTicksToWait = pxSocket->xSendBlockTime;\r
+\r
+                       /* The data being transmitted will be sent in\r
+                       ipMAX_UDP_PAYLOAD_LENGTH chunks if xDataLength is greater than the\r
+                       network buffer payload size.  Loop until all the data is sent. */\r
+                       while( xBytesRemaining > 0 )\r
+                       {\r
+                               if( xBytesRemaining > ipMAX_UDP_PAYLOAD_LENGTH )\r
+                               {\r
+                                       /* Cap the amount being sent in this packet to the maximum\r
+                                       UDP payload size.  This will be a multiple of 8 already,\r
+                                       removing the need to check in the code. */\r
+                                       xBytesToSend = ipMAX_UDP_PAYLOAD_LENGTH;\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* Send all remaining bytes - which may well be the total\r
+                                       number of bytes if the packet was not chopped up. */\r
+                                       xBytesToSend = xBytesRemaining;\r
+                               }\r
+\r
+                               /* If the zero copy flag is set, then the data is already in a\r
+                               network buffer.  Otherwise, get a new network buffer. */\r
+                               if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                               {\r
+                                       if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdTRUE )\r
+                                       {\r
+                                               xTicksToWait = 0;\r
+                                       }\r
+\r
+                                       pxNetworkBuffer = pxNetworkBufferGet( xBytesToSend + sizeof( xUDPPacket_t ), xTicksToWait );\r
+                               }\r
+                               else\r
+                               {\r
+                                       if( xTotalDataLength > ipMAX_UDP_PAYLOAD_LENGTH )\r
+                                       {\r
+                                               /* The packet needs fragmenting, but zero copy buffers\r
+                                               cannot be fragmented. */\r
+                                               pxNetworkBuffer = NULL;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               /* When zero copy is used, pvBuffer is a pointer to the\r
+                                               payload of a buffer that has already been obtained from the\r
+                                               stack.  Obtain the network buffer pointer from the buffer. */\r
+                                               pucBuffer = ( uint8_t * ) pvBuffer;\r
+                                               pucBuffer -= ( ipBUFFER_PADDING + sizeof( xUDPPacket_t ) );\r
+                                               pxNetworkBuffer = * ( ( xNetworkBufferDescriptor_t ** ) pucBuffer );\r
+                                       }\r
+                               }\r
+\r
+                               if( pxNetworkBuffer != NULL )\r
+                               {\r
+                                       /* Use the part of the network buffer that will be completed\r
+                                       by the IP layer as temporary storage to pass extra\r
+                                       information required by the IP layer. */\r
+                                       pxFragmentParameters = ( xIPFragmentParameters_t * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipFRAGMENTATION_PARAMETERS_OFFSET ] );\r
+                                       pxFragmentParameters->ucSocketOptions = pxSocket->ucSocketOptions;\r
+\r
+                                       if( xBytesRemaining > ipMAX_UDP_PAYLOAD_LENGTH )\r
+                                       {\r
+                                               /* The packet is being chopped up, and more data will\r
+                                               follow. */\r
+                                               pxFragmentParameters->ucSocketOptions = ( pxSocket->ucSocketOptions | FREERTOS_NOT_LAST_IN_FRAGMENTED_PACKET );\r
+                                       }\r
+\r
+                                       if( xTotalDataLength > ipMAX_UDP_PAYLOAD_LENGTH )\r
+                                       {\r
+                                               /* Let the IP layer know this packet has been chopped up,\r
+                                               and supply the IP layer with any addition information it\r
+                                               needs to make sense of it. */\r
+                                               pxFragmentParameters->ucSocketOptions |= FREERTOS_FRAGMENTED_PACKET;\r
+                                               usFragmentOffset = ( uint16_t ) ( xTotalDataLength - xBytesRemaining );\r
+                                               pxFragmentParameters->usFragmentedPacketOffset = usFragmentOffset;\r
+                                               pxFragmentParameters->usFragmentLength = ( uint16_t ) xBytesToSend;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               usFragmentOffset = 0;\r
+                                       }\r
+\r
+                                       /* Write the payload into the packet.  The IP layer is\r
+                                       queried to find where in the IP payload the data should be\r
+                                       written.  This is because the necessary offset is different\r
+                                       for the first packet, because the first packet leaves space\r
+                                       for a UDP header.  Note that this changes usFragmentOffset\r
+                                       from the offset in the entire UDP packet, to the offset\r
+                                       in the IP packet. */\r
+                                       if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                                       {\r
+                                               /* Only copy the data if it is not already in the\r
+                                               expected location. */\r
+                                               usFragmentOffset = ipGET_UDP_PAYLOAD_OFFSET_FOR_FRAGMENT( usFragmentOffset );\r
+                                               memcpy( ( void * ) &( pxNetworkBuffer->pucEthernetBuffer[ usFragmentOffset ] ), ( void * ) pucBuffer, xBytesToSend );\r
+                                       }\r
+                                       pxNetworkBuffer->xDataLength = xTotalDataLength;\r
+                                       pxNetworkBuffer->usPort = pxDestinationAddress->sin_port;\r
+                                       pxNetworkBuffer->usBoundPort = ( uint16_t ) socketGET_SOCKET_ADDRESS( pxSocket );\r
+                                       pxNetworkBuffer->ulIPAddress = pxDestinationAddress->sin_addr;\r
+\r
+                                       /* Tell the networking task that the packet needs sending. */\r
+                                       xStackTxEvent.pvData = pxNetworkBuffer;\r
+\r
+                                       if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdTRUE )\r
+                                       {\r
+                                               xTicksToWait = 0;\r
+                                       }\r
+\r
+                                       if( xQueueSendToBack( xNetworkEventQueue, &xStackTxEvent, xTicksToWait ) != pdPASS )\r
+                                       {\r
+                                               /* If the buffer was allocated in this function, release it. */\r
+                                               if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                                               {\r
+                                                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                                               }\r
+                                               iptraceSTACK_TX_EVENT_LOST( ipSTACK_TX_EVENT );\r
+                                               break;\r
+                                       }\r
+\r
+                                       /* Adjust counters ready to either exit the loop, or send\r
+                                       another chunk of data. */\r
+                                       xBytesRemaining -= xBytesToSend;\r
+                                       pucBuffer += xBytesToSend;\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* If errno was available, errno would be set to\r
+                                       FREERTOS_ENOPKTS.  As it is, the function must return the\r
+                                       number of transmitted bytes, so the calling function knows how\r
+                                       much data was actually sent. */\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               return ( xTotalDataLength - xBytesRemaining );\r
+       } /* Tested */\r
+\r
+#else /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */\r
+\r
+       int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength )\r
+       {\r
+       xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+       xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL };\r
+       extern xQueueHandle xNetworkEventQueue;\r
+       xTimeOutType xTimeOut;\r
+       portTickType xTicksToWait;\r
+       int32_t lReturn = 0;\r
+       xFreeRTOS_Socket_t *pxSocket;\r
+       uint8_t *pucBuffer;\r
+\r
+               pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+               /* The function prototype is designed to maintain the expected Berkeley\r
+               sockets standard, but this implementation does not use all the\r
+               parameters. */\r
+               ( void ) xDestinationAddressLength;\r
+               configASSERT( xNetworkEventQueue );\r
+               configASSERT( pvBuffer );\r
+\r
+               if( xTotalDataLength <= ipMAX_UDP_PAYLOAD_LENGTH )\r
+               {\r
+                       if( socketSOCKET_IS_BOUND( pxSocket ) == pdFALSE )\r
+                       {\r
+                               /* If the socket is not already bound to an address, bind it now.\r
+                               Passing NULL as the address parameter tells FreeRTOS_bind() to\r
+                               select the address to bind to. */\r
+                               FreeRTOS_bind( pxSocket, NULL, 0 );\r
+                       }\r
+\r
+                       if( socketSOCKET_IS_BOUND( pxSocket ) != pdFALSE )\r
+                       {\r
+                               xTicksToWait = pxSocket->xSendBlockTime;\r
+\r
+                               if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                               {\r
+                                       /* Zero copy is not set, so obtain a network buffer into\r
+                                       which the payload will be copied. */\r
+                                       vTaskSetTimeOutState( &xTimeOut );\r
+                                       pxNetworkBuffer = pxNetworkBufferGet( xTotalDataLength + sizeof( xUDPPacket_t ), xTicksToWait );\r
+\r
+                                       if( pxNetworkBuffer != NULL )\r
+                                       {\r
+                                               memcpy( ( void * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipUDP_PAYLOAD_OFFSET ] ), ( void * ) pvBuffer, xTotalDataLength );\r
+\r
+                                               if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdTRUE )\r
+                                               {\r
+                                                       /* The entire block time has been used up. */\r
+                                                       xTicksToWait = 0;\r
+                                               }\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* When zero copy is used, pvBuffer is a pointer to the\r
+                                       payload of a buffer that has already been obtained from the\r
+                                       stack.  Obtain the network buffer pointer from the buffer. */\r
+                                       pucBuffer = ( uint8_t * ) pvBuffer;\r
+                                       pucBuffer -= ( ipBUFFER_PADDING + sizeof( xUDPPacket_t ) );\r
+                                       pxNetworkBuffer = * ( ( xNetworkBufferDescriptor_t ** ) pucBuffer );\r
+                               }\r
+\r
+                               if( pxNetworkBuffer != NULL )\r
+                               {\r
+                                       pxNetworkBuffer->xDataLength = xTotalDataLength;\r
+                                       pxNetworkBuffer->usPort = pxDestinationAddress->sin_port;\r
+                                       pxNetworkBuffer->usBoundPort = ( uint16_t ) socketGET_SOCKET_ADDRESS( pxSocket );\r
+                                       pxNetworkBuffer->ulIPAddress = pxDestinationAddress->sin_addr;\r
+\r
+                                       /* The socket options are passed to the IP layer in the\r
+                                       space that will eventually get used by the Ethernet header. */\r
+                                       pxNetworkBuffer->pucEthernetBuffer[ ipSOCKET_OPTIONS_OFFSET ] = pxSocket->ucSocketOptions;\r
+\r
+                                       /* Tell the networking task that the packet needs sending. */\r
+                                       xStackTxEvent.pvData = pxNetworkBuffer;\r
+\r
+                                       if( xQueueSendToBack( xNetworkEventQueue, &xStackTxEvent, xTicksToWait ) != pdPASS )\r
+                                       {\r
+                                               /* If the buffer was allocated in this function, release it. */\r
+                                               if( ( ulFlags & FREERTOS_ZERO_COPY ) == 0 )\r
+                                               {\r
+                                                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                                               }\r
+                                               iptraceSTACK_TX_EVENT_LOST( ipSTACK_TX_EVENT );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               lReturn = ( int32_t ) xTotalDataLength;\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* If errno was available, errno would be set to\r
+                                       FREERTOS_ENOPKTS.  As it is, the function must return the\r
+                                       number of transmitted bytes, so the calling function knows how\r
+                                       much data was actually sent. */\r
+                                       iptraceNO_BUFFER_FOR_SENDTO();\r
+                               }\r
+                       }\r
+                       else\r
+                       {\r
+                               iptraceSENDTO_SOCKET_NOT_BOUND();\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       /* The data is longer than the available buffer space.  Setting\r
+                       ipconfigCAN_FRAGMENT_OUTGOING_PACKETS to 1 may allow this packet\r
+                       to be sent. */\r
+                       iptraceSENDTO_DATA_TOO_LONG();\r
+               }\r
+\r
+               return lReturn;\r
+       } /* Tested */\r
+\r
+#endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr * pxAddress, socklen_t xAddressLength )\r
+{\r
+portBASE_TYPE xReturn = 0; /* In Berkeley sockets, 0 means pass for bind(). */\r
+xFreeRTOS_Socket_t *pxSocket;\r
+#if ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1\r
+       struct freertos_sockaddr xAddress;\r
+#endif /* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND */\r
+\r
+       pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+       /* The function prototype is designed to maintain the expected Berkeley\r
+       sockets standard, but this implementation does not use all the parameters. */\r
+       ( void ) xAddressLength;\r
+\r
+       configASSERT( xSocket );\r
+       configASSERT( xSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+       #if ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1\r
+       {\r
+               /* pxAddress will be NULL if sendto() was called on a socket without the\r
+               socket being bound to an address.  In this case, automatically allocate\r
+               an address to the socket.  There is a very tiny chance that the allocated\r
+               port will already be in use - if that is the case, then the check below\r
+               [pxListFindListItemWithValue()] will result in an error being returned. */\r
+               if( pxAddress == NULL )\r
+               {\r
+                       pxAddress = &xAddress;\r
+                       pxAddress->sin_port = prvGetPrivatePortNumber();\r
+               }\r
+       }\r
+       #endif /* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1 */\r
+\r
+       /* Sockets must be bound before calling FreeRTOS_sendto() if\r
+       ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND is not set to 1. */\r
+       configASSERT( pxAddress );\r
+\r
+       if( pxAddress != NULL )\r
+       {\r
+               if( pxAddress->sin_port == 0 )\r
+               {\r
+                       pxAddress->sin_port = prvGetPrivatePortNumber();\r
+               }\r
+\r
+               vTaskSuspendAll();\r
+               {\r
+                       /* Check to ensure the port is not already in use. */\r
+                       if( pxListFindListItemWithValue( &xBoundSocketsList, ( portTickType ) pxAddress->sin_port ) != NULL )\r
+                       {\r
+                               xReturn = FREERTOS_EADDRINUSE;\r
+                       }\r
+               }\r
+               xTaskResumeAll();\r
+\r
+               /* Check that xReturn has not been set before continuing. */\r
+               if( xReturn == 0 )\r
+               {\r
+                       if( pxSocket->xWaitingPacketSemaphore == NULL )\r
+                       {\r
+                               /* Create the semaphore used to count the number of packets that\r
+                               are queued on this socket. */\r
+                               pxSocket->xWaitingPacketSemaphore = xSemaphoreCreateCounting( ipconfigNUM_NETWORK_BUFFERS, 0 );\r
+\r
+                               if( pxSocket->xWaitingPacketSemaphore != NULL )\r
+                               {\r
+                                       /* Allocate the port number to the socket. */\r
+                                       socketSET_SOCKET_ADDRESS( pxSocket, pxAddress->sin_port );\r
+                                       taskENTER_CRITICAL();\r
+                                       {\r
+                                               /* Add the socket to the list of bound ports. */\r
+                                               vListInsertEnd( &xBoundSocketsList, &( pxSocket->xBoundSocketListItem ) );\r
+                                       }\r
+                                       taskEXIT_CRITICAL();\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* Out of memory. */\r
+                                       xReturn = FREERTOS_ENOBUFS;\r
+                               }\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The socket is already bound. */\r
+                               xReturn = FREERTOS_EINVAL;\r
+                       }\r
+               }\r
+       }\r
+       else\r
+       {\r
+               xReturn = FREERTOS_EADDRNOTAVAIL;\r
+       }\r
+\r
+       if( xReturn != 0 )\r
+       {\r
+               iptraceBIND_FAILED( xSocket, ( FreeRTOS_ntohs( pxAddress->sin_port ) ) );\r
+       }\r
+\r
+       return xReturn;\r
+} /* Tested */\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket )\r
+{\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+xFreeRTOS_Socket_t *pxSocket;\r
+\r
+       pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+       configASSERT( pxSocket );\r
+       configASSERT( pxSocket != FREERTOS_INVALID_SOCKET );\r
+\r
+       /* Socket must be unbound first, to ensure no more packets are queued on\r
+       it. */\r
+       if( socketSOCKET_IS_BOUND( pxSocket ) != pdFALSE )\r
+       {\r
+               taskENTER_CRITICAL();\r
+               {\r
+                       uxListRemove( &( pxSocket->xBoundSocketListItem ) );\r
+               }\r
+               taskEXIT_CRITICAL();\r
+       }\r
+\r
+       /* Now the socket is not bound the list of waiting packets can be\r
+       drained. */\r
+       if( pxSocket->xWaitingPacketSemaphore != NULL )\r
+       {\r
+               while( listCURRENT_LIST_LENGTH( &( pxSocket->xWaitingPacketsList ) ) > 0U )\r
+               {\r
+                       pxNetworkBuffer = ( xNetworkBufferDescriptor_t * ) listGET_OWNER_OF_HEAD_ENTRY( &( pxSocket->xWaitingPacketsList ) );\r
+                       uxListRemove( &( pxNetworkBuffer->xBufferListItem ) );\r
+                       vNetworkBufferRelease( pxNetworkBuffer );\r
+               }\r
+               vSemaphoreDelete( pxSocket->xWaitingPacketSemaphore );\r
+       }\r
+\r
+       vPortFree( pxSocket );\r
+\r
+       return 0;\r
+} /* Tested */\r
+/*-----------------------------------------------------------*/\r
+\r
+void FreeRTOS_SocketsInit( void )\r
+{\r
+       vListInitialise( &xBoundSocketsList );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength )\r
+{\r
+/* The standard Berkeley function returns 0 for success. */\r
+portBASE_TYPE xReturn = 0;\r
+portBASE_TYPE lOptionValue;\r
+xFreeRTOS_Socket_t *pxSocket;\r
+\r
+       pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;\r
+\r
+       /* The function prototype is designed to maintain the expected Berkeley\r
+       sockets standard, but this implementation does not use all the parameters. */\r
+       ( void ) lLevel;\r
+       ( void ) xOptionLength;\r
+\r
+       configASSERT( xSocket );\r
+\r
+       switch( lOptionName )\r
+       {\r
+               case FREERTOS_SO_RCVTIMEO       :\r
+                       /* Receive time out. */\r
+                       pxSocket->xReceiveBlockTime = *( ( portTickType * ) pvOptionValue );\r
+                       break;\r
+\r
+               case FREERTOS_SO_SNDTIMEO       :\r
+                       /* The send time out is capped for the reason stated in the comments\r
+                       where ipconfigMAX_SEND_BLOCK_TIME_TICKS is defined in\r
+                       FreeRTOSIPConfig.h (assuming an official configuration file is being\r
+                       used. */\r
+                       pxSocket->xSendBlockTime = *( ( portTickType * ) pvOptionValue );\r
+                       if( pxSocket->xSendBlockTime > ipconfigMAX_SEND_BLOCK_TIME_TICKS )\r
+                       {\r
+                               pxSocket->xSendBlockTime = ipconfigMAX_SEND_BLOCK_TIME_TICKS;\r
+                       }\r
+                       break;\r
+\r
+               case FREERTOS_SO_UDPCKSUM_OUT :\r
+                       /* Turn calculating of the UDP checksum on/off for this socket. */\r
+                       lOptionValue = ( portBASE_TYPE ) pvOptionValue;\r
+\r
+                       if( lOptionValue == 0 )\r
+                       {\r
+                               pxSocket->ucSocketOptions &= ~FREERTOS_SO_UDPCKSUM_OUT;\r
+                       }\r
+                       else\r
+                       {\r
+                               pxSocket->ucSocketOptions |= FREERTOS_SO_UDPCKSUM_OUT;\r
+                       }\r
+                       break;\r
+\r
+               default :\r
+                       /* No other options are handled. */\r
+                       xReturn = FREERTOS_ENOPROTOOPT;\r
+                       break;\r
+       }\r
+\r
+       return xReturn;\r
+} /* Tested */\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort )\r
+{\r
+xListItem *pxListItem;\r
+portBASE_TYPE xReturn = pdPASS;\r
+xFreeRTOS_Socket_t *pxSocket;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+\r
+       vTaskSuspendAll();\r
+       {\r
+               /* See if there is a list item associated with the port number on the\r
+               list of bound sockets. */\r
+               pxListItem = pxListFindListItemWithValue( &xBoundSocketsList, ( portTickType ) usPort );\r
+       }\r
+       xTaskResumeAll();\r
+\r
+       if( pxListItem != NULL )\r
+       {\r
+               /* The owner of the list item is the socket itself. */\r
+               pxSocket = ( xFreeRTOS_Socket_t * ) listGET_LIST_ITEM_OWNER( pxListItem );\r
+\r
+               vTaskSuspendAll();\r
+               {\r
+                       #if( ipconfigSUPPORT_SELECT_FUNCTION == 1 )\r
+                       {\r
+                               /* Is the socket a member of a select() group? */\r
+                               if( pxSocket->xSelectQueue != NULL )\r
+                               {\r
+                                       /* Can the select group be notified that the socket is \r
+                                       ready to be read? */\r
+                                       if( xQueueSendFromISR( pxSocket->xSelectQueue, &pxSocket, &xHigherPriorityTaskWoken ) != pdPASS )\r
+                                       {\r
+                                               /* Could not notify the select group. */\r
+                                               xReturn = pdFAIL;\r
+                                               iptraceFAILED_TO_NOTIFY_SELECT_GROUP( pxSocket );\r
+                                       }                               \r
+                               }\r
+                       }\r
+                       #endif \r
+\r
+                       if( xReturn == pdPASS )\r
+                       {\r
+                               taskENTER_CRITICAL();\r
+                               {\r
+                                       /* Add the network packet to the list of packets to be \r
+                                       processed by the socket. */\r
+                                       vListInsertEnd( &( pxSocket->xWaitingPacketsList ), &( pxNetworkBuffer->xBufferListItem ) );\r
+                               }\r
+                               taskEXIT_CRITICAL();\r
+\r
+                               /* The socket's counting semaphore records how many packets are \r
+                               waiting to be processed by the socket. */\r
+                               xSemaphoreGiveFromISR( pxSocket->xWaitingPacketSemaphore, &xHigherPriorityTaskWoken );\r
+                       }\r
+               }\r
+               if( xTaskResumeAll() == pdFALSE )\r
+               {\r
+                       if( xHigherPriorityTaskWoken != pdFALSE )\r
+                       {\r
+                               taskYIELD();\r
+                       }\r
+               }\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint16_t prvGetPrivatePortNumber( void )\r
+{\r
+static uint16_t usNextPortToUse = socketAUTO_PORT_ALLOCATION_START_NUMBER - 1;\r
+uint16_t usReturn;\r
+\r
+       /* Assign the next port in the range. */\r
+       taskENTER_CRITICAL();\r
+               usNextPortToUse++;\r
+       taskEXIT_CRITICAL();\r
+\r
+       /* Has it overflowed? */\r
+       if( usNextPortToUse == 0U )\r
+       {\r
+               /* Don't go right back to the start of the dynamic/private port\r
+               range numbers as any persistent sockets are likely to have been\r
+               create first so the early port numbers may still be in use. */\r
+               usNextPortToUse = socketAUTO_PORT_ALLOCATION_RESET_NUMBER;\r
+       }\r
+\r
+       usReturn = FreeRTOS_htons( usNextPortToUse );\r
+\r
+       return usReturn;\r
+} /* Tested */\r
+/*-----------------------------------------------------------*/\r
+\r
+xListItem * pxListFindListItemWithValue( xList *pxList, portTickType xWantedItemValue )\r
+{\r
+xListItem *pxIterator, *pxReturn;\r
+\r
+       pxReturn = NULL;\r
+       for( pxIterator = ( xListItem * ) pxList->xListEnd.pxNext; pxIterator != ( xListItem* ) &( pxList->xListEnd ); pxIterator = ( xListItem * ) pxIterator->pxNext )\r
+       {\r
+               if( pxIterator->xItemValue == xWantedItemValue )\r
+               {\r
+                       pxReturn = pxIterator;\r
+                       break;\r
+               }\r
+       }\r
+\r
+       return pxReturn;\r
+} /* Tested */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigINCLUDE_FULL_INET_ADDR == 1\r
+\r
+       uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress )\r
+       {\r
+       const uint8_t ucDecimalBase = 10;\r
+       uint8_t ucOctet[ socketMAX_IP_ADDRESS_OCTETS ];\r
+       const uint8_t *pucPointerOnEntering;\r
+       uint32_t ulReturn = 0UL, ulOctetNumber, ulValue;\r
+       portBASE_TYPE xResult = pdPASS;\r
+\r
+               for( ulOctetNumber = 0; ulOctetNumber < socketMAX_IP_ADDRESS_OCTETS; ulOctetNumber++ )\r
+               {\r
+                       ulValue = 0;\r
+                       pucPointerOnEntering = pucIPAddress;\r
+\r
+                       while( ( *pucIPAddress >= ( uint8_t ) '0' ) && ( *pucIPAddress <= ( uint8_t ) '9' ) )\r
+                       {\r
+                               /* Move previous read characters into the next decimal\r
+                               position. */\r
+                               ulValue *= ucDecimalBase;\r
+\r
+                               /* Add the binary value of the ascii character. */\r
+                               ulValue += ( *pucIPAddress - ( uint8_t ) '0' );\r
+\r
+                               /* Move to next character in the string. */\r
+                               pucIPAddress++;\r
+                       }\r
+\r
+                       /* Check characters were read. */\r
+                       if( pucIPAddress == pucPointerOnEntering )\r
+                       {\r
+                               xResult = pdFAIL;\r
+                       }\r
+\r
+                       /* Check the value fits in an 8-bit number. */\r
+                       if( ulValue > 0xffUL )\r
+                       {\r
+                               xResult = pdFAIL;\r
+                       }\r
+                       else\r
+                       {\r
+                               ucOctet[ ulOctetNumber ] = ( uint8_t ) ulValue;\r
+\r
+                               /* Check the next character is as expected. */\r
+                               if( ulOctetNumber < ( socketMAX_IP_ADDRESS_OCTETS - 1 ) )\r
+                               {\r
+                                       if( *pucIPAddress != ( uint8_t ) '.' )\r
+                                       {\r
+                                               xResult = pdFAIL;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               /* Move past the dot. */\r
+                                               pucIPAddress++;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       if( xResult == pdFAIL )\r
+                       {\r
+                               /* No point going on. */\r
+                               break;\r
+                       }\r
+               }\r
+\r
+               if( *pucIPAddress != ( uint8_t ) 0x00 )\r
+               {\r
+                       /* Expected the end of the string. */\r
+                       xResult = pdFAIL;\r
+               }\r
+\r
+               if( ulOctetNumber != socketMAX_IP_ADDRESS_OCTETS )\r
+               {\r
+                       /* Didn't read enough octets. */\r
+                       xResult = pdFAIL;\r
+               }\r
+\r
+               if( xResult == pdPASS )\r
+               {\r
+                       ulReturn = FreeRTOS_inet_addr_quick( ucOctet[ 0 ], ucOctet[ 1 ], ucOctet[ 2 ], ucOctet[ 3 ] );\r
+               }\r
+\r
+               return ulReturn;\r
+       }\r
+\r
+#endif /* ipconfigINCLUDE_FULL_INET_ADDR */\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c
new file mode 100644 (file)
index 0000000..31da9f3
--- /dev/null
@@ -0,0 +1,1854 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+#include "timers.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "FreeRTOS_DHCP.h"\r
+#include "NetworkInterface.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Sanity check the configuration. */\r
+#if configUSE_TIMERS != 1\r
+       #error configUSE_TIMERS must be set to 1 in FreeRTOSConfig.h to use this file\r
+#endif\r
+\r
+#if configTICK_RATE_HZ > 1000\r
+       #error configTICK_RATE_HZ must be less than 1000 to use FreeRTOS+UDP\r
+#endif\r
+\r
+#if ( ipconfigEVENT_QUEUE_LENGTH < ( ipconfigNUM_NETWORK_BUFFERS + 5 ) )\r
+       #error The ipconfigEVENT_QUEUE_LENGTH parameter must be at least ipconfigNUM_NETWORK_BUFFERS + 5\r
+#endif\r
+\r
+#if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1 && ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+       #error ipconfigSUPPORT_OUTGOING_PINGS can only be set to 1 if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS is set to 0 as IP fragmentation is not supported for ICMP (ping) packets\r
+#endif\r
+\r
+#if ( ipconfigNETWORK_MTU < 46 )\r
+       #error ipconfigNETWORK_MTU must be at least 46.\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The IP header length in bytes. */\r
+#define ipIP_HEADER_LENGTH             ( 20 )\r
+\r
+/* IP protocol definitions. */\r
+#define ipPROTOCOL_ICMP                        ( 1 )\r
+#define ipPROTOCOL_UDP                 ( 17 )\r
+\r
+/* ICMP protocol definitions. */\r
+#define ipICMP_ECHO_REQUEST            ( ( uint16_t ) 8 )\r
+#define ipICMP_ECHO_REPLY              ( ( uint16_t ) 0 )\r
+\r
+/* The expected IP version and header length coded into the IP header itself. */\r
+#define ipIP_VERSION_AND_HEADER_LENGTH_BYTE ( ( uint8_t ) 0x45 )\r
+\r
+/* Time delay between repeated attempts to initialise the network hardware. */\r
+#define ipINITIALISATION_RETRY_DELAY   ( ( ( portTickType ) 3000 ) / portTICK_RATE_MS )\r
+\r
+/* The local MAC address is accessed from within xDefaultPartUDPPacketHeader,\r
+rather than duplicated in its own variable. */\r
+#define ipLOCAL_MAC_ADDRESS ( xDefaultPartUDPPacketHeader )\r
+\r
+/* The local IP address is accessed from within xDefaultPartUDPPacketHeader,\r
+rather than duplicated in its own variable. */\r
+#define ipLOCAL_IP_ADDRESS_POINTER ( ( uint32_t * ) &( xDefaultPartUDPPacketHeader[ 20 ] ) )\r
+\r
+/* Defines how often the ARP timer callback function is executed.  The time is\r
+shorted in the Windows simulator as simulated time is not real time. */\r
+#ifdef _WINDOWS_\r
+       #define ipARP_TIMER_PERIOD_MS   ( 500 ) /* For windows simulator builds. */\r
+#else\r
+       #define ipARP_TIMER_PERIOD_MS   ( 10000 )\r
+#endif\r
+\r
+/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1, then the Ethernet\r
+driver will filter incoming packets and only pass the stack those packets it\r
+considers need processing.  In this case ipCONSIDER_FRAME_FOR_PROCESSING() can\r
+be #defined away.  If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 0\r
+then the Ethernet driver will pass all received packets to the stack, and the\r
+stack must do the filtering itself.  In this case ipCONSIDER_FRAME_FOR_PROCESSING\r
+needs to call eConsiderFrameForProcessing. */\r
+#if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES == 0\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eConsiderFrameForProcessing( ( pucEthernetBuffer ) )\r
+#else\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eProcessBuffer\r
+#endif\r
+\r
+/* When the age of an entry in the ARP table reaches this value (it counts down\r
+to zero, so this is an old entry) an ARP request will be sent to see if the\r
+entry is still valid and can therefore be refreshed. */\r
+#define ipMAX_ARP_AGE_BEFORE_NEW_ARP_REQUEST           ( 3 )\r
+\r
+/* Number of bits to shift to divide by 8.  Used to remove the need for a\r
+divide. */\r
+#define ipSHIFT_TO_DIVIDE_BY_8                                                 ( 3U )\r
+\r
+/* The bit set in the IP header flags to indicate that the IP packet contains\r
+a fragment of the eventual total payload, and that more fragments will follow. */\r
+#define ipMORE_FRAGMENTS_FLAG_BIT                                      ( 0x2000U )\r
+\r
+/* ICMP packets are sent using the same function as UDP packets.  The port\r
+number is used to distinguish between the two, as 0 is an invalid UDP port. */\r
+#define ipPACKET_CONTAINS_ICMP_DATA                                    ( 0 )\r
+\r
+/* The character used to fill ICMP echo requests, and therefore also the\r
+character expected to fill ICMP echo replies. */\r
+#define ipECHO_DATA_FILL_BYTE                                          'x'\r
+\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+       #define ipFRAGMENT_OFFSET_BIT_MASK                              ( ( uint16_t ) 0xff0f ) /* The bits in the two byte IP header field that make up the fragment offset value. */\r
+#else\r
+       #define ipFRAGMENT_OFFSET_BIT_MASK                              ( ( uint16_t ) 0x0fff ) /* The bits in the two byte IP header field that make up the fragment offset value. */\r
+       #if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+               #warning Fragment offsets have not been tested on big endian machines.\r
+       #endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */\r
+#endif /* ipconfigBYTE_ORDER */\r
+\r
+/*-----------------------------------------------------------*/\r
+/* Miscellaneous structure and definitions. */\r
+/*-----------------------------------------------------------*/\r
+\r
+typedef struct xARP_CACHE_TABLE_ROW\r
+{\r
+       uint32_t ulIPAddress;           /* The IP address of an ARP cache entry. */\r
+       xMACAddress_t xMACAddress;  /* The MAC address of an ARP cache entry. */\r
+       uint8_t ucAge;                          /* A value that is periodically decremented but can also be refreshed by active communication.  The ARP cache entry is removed if the value reaches zero. */\r
+} xARPCacheRow_t;\r
+\r
+typedef enum\r
+{\r
+       eARPCacheMiss = 0,                      /* An ARP table lookup did not find a valid entry. */\r
+       eARPCacheHit,                           /* An ARP table lookup found a valid entry. */\r
+       eCantSendPacket                         /* There is no IP address, or an ARP is still in progress, so the packet cannot be sent. */\r
+} eARPLookupResult_t;\r
+\r
+typedef enum\r
+{\r
+       eNotFragment = 0,                       /* The IP packet being sent is not part of a fragment. */\r
+       eFirstFragment,                         /* The IP packet being sent is the first in a set of fragmented packets. */\r
+       eFollowingFragment                      /* The IP packet being sent is part of a set of fragmented packets. */\r
+} eIPFragmentStatus_t;\r
+\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Called when new data is available from the network interface.\r
+ */\r
+static void prvProcessEthernetPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * Called when the application has generated a UDP packet to send.\r
+ */\r
+static void prvProcessGeneratedPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * Processes incoming ARP packets.\r
+ */\r
+static eFrameProcessingResult_t prvProcessARPPacket( xARPPacket_t * const pxARPFrame );\r
+\r
+/*\r
+ * Process incoming IP packets.\r
+ */\r
+static eFrameProcessingResult_t prvProcessIPPacket( const xIPPacket_t * const pxIPPacket, xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * Process incoming ICMP packets.\r
+ */\r
+#if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+       static eFrameProcessingResult_t prvProcessICMPPacket( xICMPPacket_t * const pxICMPPacket );\r
+#endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */\r
+\r
+/*\r
+ * Swap the source and destination addresses in an already constructed Ethernet\r
+ * frame, and send the frame to the network.\r
+ */\r
+static void prvReturnEthernetFrame( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * Return the checksum generated over usDataLengthBytes from pucNextData.\r
+ */\r
+static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes );\r
+\r
+/*\r
+ * The callback function that is assigned to all periodic processing timers -\r
+ * namely the DHCP timer and the ARP timer.\r
+ */\r
+void vIPFunctionsTimerCallback( xTimerHandle xTimer );\r
+\r
+/*\r
+ * Reduce the age count in each entry within the ARP cache.  An entry is no\r
+ * longer considered valid and is deleted if its age reaches zero.\r
+ */\r
+static void prvAgeARPCache( void );\r
+\r
+/*\r
+ * If ulIPAddress is already in the ARP cache table then reset the age of the\r
+ * entry back to its maximum value.  If ulIPAddress is not already in the ARP\r
+ * cache table then add it - replacing the oldest current entry if there is not\r
+ * a free space available.\r
+ */\r
+static void prvRefreshARPCacheEntry( const xMACAddress_t * const pxMACAddress, const uint32_t ulIPAddress );\r
+\r
+/*\r
+ * Creates the pseudo header necessary then generate the checksum over the UDP\r
+ * packet.  Returns the calculated checksum.\r
+ */\r
+static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket );\r
+\r
+/*\r
+ * Look for ulIPAddress in the ARP cache.  If the IP address exists, copy the\r
+ * associated MAC address into pxMACAddress, refresh the ARP cache entry's\r
+ * age, and return eARPCacheHit.  If the IP address does not exist in the ARP\r
+ * cache return eARPCacheMiss.  If the packet cannot be sent for any reason\r
+ * (maybe DHCP is still in process, or the addressing needs a gateway but there\r
+ * isn't a gateway defined) then return eCantSendPacket.\r
+ */\r
+static eARPLookupResult_t prvGetARPCacheEntry( uint32_t *pulIPAddress, xMACAddress_t * const pxMACAddress );\r
+\r
+/*\r
+ * The main UDP/IP stack processing task.  This task receives commands/events\r
+ * from the network hardware drivers, tasks that are using sockets, and software\r
+ * timers (such as the ARP timer).\r
+ */\r
+static void prvIPTask( void *pvParameters );\r
+\r
+/*\r
+ * Send out an ARP request for the IP address contained in pxNetworkBuffer, and\r
+ * add an entry into the ARP table that indicates that an ARP reply is\r
+ * outstanding so re-transmissions can be generated.\r
+ */\r
+static void prvGenerateARPRequestPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * Called when outgoing packets are fragmented and require a fragment offset in\r
+ * their IP headers.  Set the fragment offset (which includes the IP flags) and\r
+ * length from the data passed in the pxFragmentParameters structure.\r
+ */\r
+ #if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+       static void prvCalculateFragmentOffsetAndLength( xIPFragmentParameters_t *pxFragmentParameters, uint16_t *pusFragmentOffset, uint16_t *pusFragmentLength );\r
+#endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS */\r
+\r
+/*\r
+ * Complete the pxUDPPacket header with the information passed in\r
+ * pxNetworkBuffer.  ucSocketOptions are passed in case the options include\r
+ * disabling the checksum.\r
+ */\r
+static void prvCompleteUDPHeader( xNetworkBufferDescriptor_t *pxNetworkBuffer, xUDPPacket_t *pxUDPPacket, uint8_t ucSocketOptions );\r
+\r
+/*\r
+ * Send the event eEvent to the IP task event queue, using a block time of\r
+ * zero.  Return pdPASS if the message was sent successfully, otherwise return\r
+ * pdFALSE.\r
+*/\r
+static portBASE_TYPE prvSendEventToIPTask( eIPEvent_t eEvent );\r
+\r
+/*\r
+ * Generate and send an ARP request for the IP address passed in ulIPAddress.\r
+ */\r
+static void prvOutputARPRequest( uint32_t ulIPAddress );\r
+\r
+/*\r
+ * Turns around an incoming ping request to convert it into a ping reply.\r
+ */\r
+#if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 )\r
+       static eFrameProcessingResult_t prvProcessICMPEchoRequest( xICMPPacket_t * const pxICMPPacket );\r
+#endif /* ipconfigREPLY_TO_INCOMING_PINGS */\r
+\r
+/*\r
+ * Processes incoming ping replies.  The application callback function\r
+ * vApplicationPingReplyHook() is called with the results.\r
+ */\r
+#if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+       static void prvProcessICMPEchoReply( xICMPPacket_t * const pxICMPPacket );\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+/*\r
+ * Called to create a network connection when the stack is first started, or\r
+ * when the network connection is lost.\r
+ */\r
+static void prvProcessNetworkDownEvent( void );\r
+\r
+#if( ipconfigFREERTOS_PLUS_NABTO == 1 )\r
+       static void prvStartNabtoTask( void );\r
+       extern void FreeRTOS_NabtoInit();\r
+#endif /* ipconfigFRERTOS_PLUS_NABTO */\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue used to pass events into the UDP task for processing. */\r
+xQueueHandle xNetworkEventQueue = NULL;\r
+\r
+/* The ARP cache. */\r
+static xARPCacheRow_t xARPCache[ ipconfigARP_CACHE_ENTRIES ];\r
+\r
+/* The timer that triggers ARP events. */\r
+static xTimerHandle xARPTimer = NULL;\r
+\r
+/* Used to ensure network down events cannot be missed when they cannot be\r
+posted to the network event queue because the network event queue is already\r
+full. */\r
+static portBASE_TYPE xNetworkDownEventPending = pdFALSE;\r
+\r
+/* For convenience, a MAC address of all zeros and another of all 0xffs are\r
+defined const for quick reference. */\r
+static const xMACAddress_t xNullMACAddress = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } };\r
+static const xMACAddress_t xBroadcastMACAddress = { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };\r
+\r
+/* Part of the Ethernet and IP headers are always constant when sending an IPv4\r
+UDP packet.  This array defines the constant parts, allowing this part of the\r
+packet to be filled in using a simple memcpy() instead of individual writes. */\r
+uint8_t xDefaultPartUDPPacketHeader[] =\r
+{\r
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     /* Ethernet source MAC address. */\r
+       0x08, 0x00,                                                     /* Ethernet frame type. */\r
+       ipIP_VERSION_AND_HEADER_LENGTH_BYTE,    /* ucVersionHeaderLength. */\r
+       0x00,                                                                   /* ucDifferentiatedServicesCode. */\r
+       0x00, 0x00,                                                     /* usLength. */\r
+       0x00, 0x00,                                                     /* usIdentification. */\r
+       0x00, 0x00,                                                     /* usFragmentOffset. */\r
+       updconfigIP_TIME_TO_LIVE,                               /* ucTimeToLive */\r
+       ipPROTOCOL_UDP,                                                 /* ucProtocol. */\r
+       0x00, 0x00,                                                     /* usHeaderChecksum. */\r
+       0x00, 0x00, 0x00, 0x00                                  /* Source IP address. */\r
+};\r
+\r
+/* Part of the Ethernet and ARP headers are always constant when sending an IPv4\r
+ARP packet.  This array defines the constant parts, allowing this part of the\r
+packet to be filled in using a simple memcpy() instead of individual writes. */\r
+static const uint8_t xDefaultPartARPPacketHeader[] =\r
+{\r
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff,     /* Ethernet destination address. */\r
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     /* Ethernet source address. */\r
+       0x08, 0x06,                                                     /* Ethernet frame type (ipARP_TYPE). */\r
+       0x00, 0x01,                                                     /* usHardwareType (ipARP_HARDWARE_TYPE_ETHERNET). */\r
+       0x08, 0x00,                                                             /* usProtocolType. */\r
+       ipMAC_ADDRESS_LENGTH_BYTES,                     /* ucHardwareAddressLength. */\r
+       ipIP_ADDRESS_LENGTH_BYTES,                              /* ucProtocolAddressLength. */\r
+       0x00, 0x01,                                                     /* usOperation (ipARP_REQUEST). */\r
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,     /* xSenderHardwareAddress. */\r
+       0x00, 0x00, 0x00, 0x00,                                 /* ulSenderProtocolAddress. */\r
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00      /* xTargetHardwareAddress. */\r
+};\r
+\r
+/* Structure that stores the netmask, gateway address and DNS server addresses. */\r
+static xNetworkAddressingParameters_t xNetworkAddressing = { 0, 0, 0, 0 };\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvIPTask( void *pvParameters )\r
+{\r
+xIPStackEvent_t xReceivedEvent;\r
+\r
+       /* Just to prevent compiler warnings about unused parameters. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Create the ARP timer, but don't start it until the network has\r
+       connected. */\r
+       xARPTimer = xTimerCreate(       ( const signed char * const ) "ARPTimer", ( ipARP_TIMER_PERIOD_MS / portTICK_RATE_MS ), pdTRUE, ( void * ) eARPTimerEvent, vIPFunctionsTimerCallback );\r
+       configASSERT( xARPTimer );\r
+\r
+       /* Generate a dummy message to say that the network connection has gone\r
+       down.  This will cause this task to initialise the network interface.  After\r
+       this it is the responsibility of the network interface hardware driver to\r
+       send this message if a previously connected network is disconnected. */\r
+       FreeRTOS_NetworkDown();\r
+\r
+       /* Loop, processing IP events. */\r
+       for( ;; )\r
+       {\r
+               /* Wait until there is something to do. */\r
+               if( xQueueReceive( xNetworkEventQueue, ( void * ) &xReceivedEvent, portMAX_DELAY ) == pdPASS )\r
+               {\r
+                       iptraceNETWORK_EVENT_RECEIVED( xReceivedEvent.eEventType );\r
+\r
+                       switch( xReceivedEvent.eEventType )\r
+                       {\r
+                               case eNetworkDownEvent :\r
+                                       /* Attempt to establish a connection. */\r
+                                       prvProcessNetworkDownEvent();\r
+                                       break;\r
+\r
+                               case eEthernetRxEvent :\r
+                                       /* The network hardware driver has received a new packet.\r
+                                       A pointer to the received buffer is located in the pvData\r
+                                       member of the received event structure. */\r
+                                       prvProcessEthernetPacket( ( xNetworkBufferDescriptor_t * ) ( xReceivedEvent.pvData ) );\r
+                                       break;\r
+\r
+                               case eARPTimerEvent :\r
+                                       /* The ARP timer has expired, process the ARP cache. */\r
+                                       prvAgeARPCache();\r
+                                       break;\r
+\r
+                               case eStackTxEvent :\r
+                                       /* The network stack has generated a packet to send.  A\r
+                                       pointer to the generated buffer is located in the pvData\r
+                                       member of the received event structure. */\r
+                                       prvProcessGeneratedPacket( ( xNetworkBufferDescriptor_t * ) ( xReceivedEvent.pvData ) );\r
+                                       break;\r
+\r
+                               case eDHCPEvent:\r
+                                       /* The DHCP state machine needs processing. */\r
+                                       #if ipconfigUSE_DHCP == 1\r
+                                       {\r
+                                               vDHCPProcess( pdFALSE, ( xMACAddress_t * ) ipLOCAL_MAC_ADDRESS, ipLOCAL_IP_ADDRESS_POINTER, &xNetworkAddressing );\r
+                                       }\r
+                                       #endif\r
+                                       break;\r
+\r
+                               default :\r
+                                       /* Should not get here. */\r
+                                       break;\r
+                       }\r
+\r
+                       if( xNetworkDownEventPending != pdFALSE )\r
+                       {\r
+                               /* A network down event could not be posted to the network\r
+                               event queue because the queue was full.  Try posting again. */\r
+                               FreeRTOS_NetworkDown();\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void FreeRTOS_NetworkDown( void )\r
+{\r
+static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL };\r
+const portTickType xDontBlock = 0;\r
+\r
+       /* Simply send the network task the appropriate event. */\r
+       if( xQueueSendToBack( xNetworkEventQueue, &xNetworkDownEvent, xDontBlock ) != pdPASS )\r
+       {\r
+               xNetworkDownEventPending = pdTRUE;\r
+       }\r
+       else\r
+       {\r
+               xNetworkDownEventPending = pdFALSE;\r
+       }\r
+\r
+       iptraceNETWORK_DOWN();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_NetworkDownFromISR( void )\r
+{\r
+static const xIPStackEvent_t xNetworkDownEvent = { eNetworkDownEvent, NULL };\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+\r
+       /* Simply send the network task the appropriate event. */\r
+       if( xQueueSendToBackFromISR( xNetworkEventQueue, &xNetworkDownEvent, &xHigherPriorityTaskWoken ) != pdPASS )\r
+       {\r
+               xNetworkDownEventPending = pdTRUE;\r
+       }\r
+       else\r
+       {\r
+               xNetworkDownEventPending = pdFALSE;\r
+       }\r
+       iptraceNETWORK_DOWN();\r
+\r
+       return xHigherPriorityTaskWoken;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void *FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks )\r
+{\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+void *pvReturn;\r
+\r
+       /* Cap the block time.  The reason for this is explained where\r
+       ipconfigMAX_SEND_BLOCK_TIME_TICKS is defined (assuming an official\r
+       FreeRTOSIPConfig.h header file is being used). */\r
+       if( xBlockTimeTicks > ipconfigMAX_SEND_BLOCK_TIME_TICKS )\r
+       {\r
+               xBlockTimeTicks = ipconfigMAX_SEND_BLOCK_TIME_TICKS;\r
+       }\r
+\r
+       /* Obtain a network buffer with the required amount of storage. */\r
+       pxNetworkBuffer = pxNetworkBufferGet( sizeof( xUDPPacket_t ) + xRequestedSizeBytes, xBlockTimeTicks );\r
+\r
+       if( pxNetworkBuffer != NULL )\r
+       {\r
+               /* Leave space for the UPD header. */\r
+               pvReturn = ( void * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipUDP_PAYLOAD_OFFSET ] );\r
+       }\r
+       else\r
+       {\r
+               pvReturn = NULL;\r
+       }\r
+\r
+       return ( void * ) pvReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void FreeRTOS_ReleaseUDPPayloadBuffer( void *pvBuffer )\r
+{\r
+uint8_t *pucBuffer;\r
+\r
+       /* Obtain the network buffer from the zero copy pointer. */\r
+       pucBuffer = ( uint8_t * ) pvBuffer;\r
+       pucBuffer -= ( ipBUFFER_PADDING + sizeof( xUDPPacket_t ) );\r
+\r
+       vNetworkBufferRelease( * ( ( xNetworkBufferDescriptor_t ** ) pucBuffer ) );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+uint8_t * FreeRTOS_GetMACAddress( void )\r
+{\r
+       return ipLOCAL_MAC_ADDRESS;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] )\r
+{\r
+static portBASE_TYPE xReturn = pdFALSE;\r
+\r
+       /* Only create the IP event queue if it has not already been created, in\r
+       case this function is called more than once. */\r
+       if( xNetworkEventQueue == NULL )\r
+       {\r
+               xNetworkEventQueue = xQueueCreate( ipconfigEVENT_QUEUE_LENGTH, sizeof( xIPStackEvent_t ) );\r
+               configASSERT( xNetworkEventQueue );\r
+               vQueueAddToRegistry( xNetworkEventQueue, ( signed char * ) "NetEvnt" );\r
+       }\r
+\r
+       if( xNetworkBuffersInitialise() == pdPASS )\r
+       {\r
+               if( xNetworkEventQueue != NULL )\r
+               {\r
+                       /* xReturn is static to ensure the network interface is not\r
+                       initialised     twice. */\r
+                       if( xReturn == pdFALSE )\r
+                       {\r
+                               /* Store the local IP and MAC address. */\r
+                               xNetworkAddressing.ulDefaultIPAddress = FreeRTOS_inet_addr_quick( ucIPAddress[ 0 ], ucIPAddress[ 1 ], ucIPAddress[ 2 ], ucIPAddress[ 3 ] );\r
+                               xNetworkAddressing.ulNetMask = FreeRTOS_inet_addr_quick( ucNetMask[ 0 ], ucNetMask[ 1 ], ucNetMask[ 2 ], ucNetMask[ 3 ] );\r
+                               xNetworkAddressing.ulGatewayAddress = FreeRTOS_inet_addr_quick( ucGatewayAddress[ 0 ], ucGatewayAddress[ 1 ], ucGatewayAddress[ 2 ], ucGatewayAddress[ 3 ] );\r
+                               xNetworkAddressing.ulDNSServerAddress = FreeRTOS_inet_addr_quick( ucDNSServerAddress[ 0 ], ucDNSServerAddress[ 1 ], ucDNSServerAddress[ 2 ], ucDNSServerAddress[ 3 ] );\r
+\r
+                               #if ipconfigUSE_DHCP == 1\r
+                               {\r
+                                       /* The IP address is not set until DHCP completes. */\r
+                                       *ipLOCAL_IP_ADDRESS_POINTER = 0x00UL;\r
+                               }\r
+                               #else\r
+                               {\r
+                                       *ipLOCAL_IP_ADDRESS_POINTER = xNetworkAddressing.ulDefaultIPAddress;\r
+                               }\r
+                               #endif /* ipconfigUSE_DHCP == 1 */\r
+\r
+                               /* The MAC address is stored in the start of the default packet\r
+                               header fragment, which is used when sending UDP packets. */\r
+                               memcpy( ( void * ) ipLOCAL_MAC_ADDRESS, ( void * ) ucMACAddress, ( size_t ) ipMAC_ADDRESS_LENGTH_BYTES );\r
+\r
+                               /* Prepare the sockets interface. */\r
+                               FreeRTOS_SocketsInit();\r
+\r
+                               /* Create the task that processes Ethernet and stack events. */\r
+                               xReturn = xTaskCreate( prvIPTask, ( const signed char * const ) "UDP/IP", ipconfigUDP_TASK_STACK_SIZE_WORDS, NULL, ipconfigUDP_TASK_PRIORITY, NULL );\r
+                       }\r
+               }\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress )\r
+{\r
+       if( pulIPAddress != NULL )\r
+       {\r
+               *pulIPAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+       }\r
+\r
+       if( pulNetMask != NULL )\r
+       {\r
+               *pulNetMask = xNetworkAddressing.ulNetMask;\r
+       }\r
+\r
+       if( pulGatewayAddress != NULL )\r
+       {\r
+               *pulGatewayAddress = xNetworkAddressing.ulGatewayAddress;\r
+       }\r
+\r
+       if( pulDNSServerAddress != NULL )\r
+       {\r
+               *pulDNSServerAddress = xNetworkAddressing.ulDNSServerAddress;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+\r
+       portBASE_TYPE FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, portTickType xBlockTimeTicks )\r
+       {\r
+       xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+       xICMPHeader_t *pxICMPHeader;\r
+       portBASE_TYPE xReturn = pdFAIL;\r
+       static uint16_t usSequenceNumber = 0;\r
+       uint8_t *pucChar;\r
+       xIPStackEvent_t xStackTxEvent = { eStackTxEvent, NULL };\r
+\r
+               if( xNumberOfBytesToSend < ( ( ipconfigNETWORK_MTU - sizeof( xIPHeader_t ) ) - sizeof( xICMPHeader_t ) ) )\r
+               {\r
+                       pxNetworkBuffer = pxNetworkBufferGet( xNumberOfBytesToSend + sizeof( xICMPPacket_t ), xBlockTimeTicks );\r
+\r
+                       if( pxNetworkBuffer != NULL )\r
+                       {\r
+                               pxICMPHeader = ( xICMPHeader_t * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipIP_PAYLOAD_OFFSET ] );\r
+                               usSequenceNumber++;\r
+\r
+                               /* Fill in the basic header information. */\r
+                               pxICMPHeader->ucTypeOfMessage = ipICMP_ECHO_REQUEST;\r
+                               pxICMPHeader->ucTypeOfService = 0;\r
+                               pxICMPHeader->usIdentifier = usSequenceNumber;\r
+                               pxICMPHeader->usSequenceNumber = usSequenceNumber;\r
+                               pxICMPHeader->usChecksum = 0;\r
+\r
+                               /* Find the start of the data. */\r
+                               pucChar = ( uint8_t * ) pxICMPHeader;\r
+                               pucChar += sizeof( xICMPHeader_t );\r
+\r
+                               /* Just memset the data to a fixed value. */\r
+                               memset( ( void * ) pucChar, ( int ) ipECHO_DATA_FILL_BYTE, xNumberOfBytesToSend );\r
+\r
+                               /* The message is complete, calculate the checksum. */\r
+                               pxICMPHeader->usChecksum = prvGenerateChecksum( ( uint8_t * ) pxICMPHeader, ( uint16_t ) ( xNumberOfBytesToSend + sizeof( xICMPHeader_t ) ) );\r
+\r
+                               /* Complete the network buffer information. */\r
+                               pxNetworkBuffer->ulIPAddress = ulIPAddress;\r
+                               pxNetworkBuffer->usPort = ipPACKET_CONTAINS_ICMP_DATA;\r
+                               pxNetworkBuffer->xDataLength = xNumberOfBytesToSend + sizeof( xICMPHeader_t );\r
+\r
+                               /* Send to the stack. */\r
+                               xStackTxEvent.pvData = pxNetworkBuffer;\r
+                               if( xQueueSendToBack( xNetworkEventQueue, &xStackTxEvent, xBlockTimeTicks ) != pdPASS )\r
+                               {\r
+                                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                                       iptraceSTACK_TX_EVENT_LOST( ipSTACK_TX_EVENT );\r
+                               }\r
+                               else\r
+                               {\r
+                                       xReturn = usSequenceNumber;\r
+                               }\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       /* The requested number of bytes will not fit in the available space\r
+                       in the network buffer.  Outgoing fragmentation is only supported for\r
+                       UDP packets. */\r
+               }\r
+\r
+               return xReturn;\r
+       }\r
+\r
+#endif /* ipconfigSUPPORT_OUTGOING_PINGS == 1 */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+static portBASE_TYPE prvSendEventToIPTask( eIPEvent_t eEvent )\r
+{\r
+xIPStackEvent_t xEventMessage;\r
+const portTickType xDontBlock = 0;\r
+portBASE_TYPE xReturn;\r
+\r
+       xEventMessage.eEventType = eEvent;\r
+       xReturn = xQueueSendToBack( xNetworkEventQueue, &xEventMessage, xDontBlock );\r
+\r
+       if( xReturn != pdPASS )\r
+       {\r
+               iptraceSTACK_TX_EVENT_LOST( ipARP_TIMER_EVENT );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vIPFunctionsTimerCallback( xTimerHandle xTimer )\r
+{\r
+eIPEvent_t eMessage;\r
+\r
+       /* This time can be used to send more than one type of message to the IP\r
+       task.  The message ID is stored in the ID of the timer.  The strange\r
+       casting is to avoid compiler warnings. */\r
+       eMessage = ( eIPEvent_t ) ( ( int ) pvTimerGetTimerID( xTimer ) );\r
+\r
+       prvSendEventToIPTask( eMessage );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvOutputARPRequest( uint32_t ulIPAddress )\r
+{\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+\r
+       /* This is called from the context of the IP event task, so a block time\r
+       must not be used. */\r
+       pxNetworkBuffer = pxNetworkBufferGet( sizeof( xARPPacket_t ), 0 );\r
+       if( pxNetworkBuffer != NULL )\r
+       {\r
+               pxNetworkBuffer->ulIPAddress = ulIPAddress;\r
+               prvGenerateARPRequestPacket( pxNetworkBuffer );\r
+               xNetworkInterfaceOutput( pxNetworkBuffer );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvAgeARPCache( void )\r
+{\r
+portBASE_TYPE x;\r
+\r
+       /* Loop through each entry in the ARP cache. */\r
+       for( x = 0; x < ipconfigARP_CACHE_ENTRIES; x++ )\r
+       {\r
+               /* If the entry is valid (its age is greater than zero). */\r
+               if( xARPCache[ x ].ucAge > 0U )\r
+               {\r
+                       /* Decrement the age value of the entry in this ARP cache table row.\r
+                       When the age reaches zero it is no longer considered valid. */\r
+                       ( xARPCache[ x ].ucAge )--;\r
+\r
+                       /* If the entry has a MAC address of 0, then it is waiting an ARP\r
+                       reply, and the ARP request should be retransmitted. */\r
+                       if( memcmp( ( void * ) &xNullMACAddress, ( void * ) &( xARPCache[ x ].xMACAddress ), sizeof( xMACAddress_t ) ) == 0 )\r
+                       {\r
+                               prvOutputARPRequest( xARPCache[ x ].ulIPAddress );\r
+                       }\r
+                       else if( xARPCache[ x ].ucAge <= ipMAX_ARP_AGE_BEFORE_NEW_ARP_REQUEST )\r
+                       {\r
+                               /* This entry will get removed soon.  See if the MAC address is\r
+                               still valid to prevent this happening. */\r
+                               iptraceARP_TABLE_ENTRY_WILL_EXPIRE( xARPCache[ x ].ulIPAddress );\r
+                               prvOutputARPRequest( xARPCache[ x ].ulIPAddress );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The age has just ticked down, with nothing to do. */\r
+                       }\r
+\r
+                       if( xARPCache[ x ].ucAge == 0 )\r
+                       {\r
+                               /* The entry is no longer valid.  Wipe it out. */\r
+                               iptraceARP_TABLE_ENTRY_EXPIRED( xARPCache[ x ].ulIPAddress );\r
+                               xARPCache[ x ].ulIPAddress = 0UL;\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static eARPLookupResult_t prvGetARPCacheEntry( uint32_t *pulIPAddress, xMACAddress_t * const pxMACAddress )\r
+{\r
+portBASE_TYPE x;\r
+eARPLookupResult_t eReturn;\r
+uint32_t ulAddressToLookup;\r
+\r
+       if( *pulIPAddress == ipBROADCAST_IP_ADDRESS )\r
+       {\r
+               /* This is a broadcast so uses the broadcast MAC address. */\r
+               memcpy( ( void * ) pxMACAddress, &xBroadcastMACAddress, sizeof( xMACAddress_t ) );\r
+               eReturn = eARPCacheHit;\r
+       }\r
+       else if( *ipLOCAL_IP_ADDRESS_POINTER == 0UL )\r
+       {\r
+               /* The IP address has not yet been assigned, so there is nothing that\r
+               can be done. */\r
+               eReturn = eCantSendPacket;\r
+       }\r
+       else\r
+       {\r
+               if( ( *pulIPAddress & xNetworkAddressing.ulNetMask ) != ( ( *ipLOCAL_IP_ADDRESS_POINTER ) & xNetworkAddressing.ulNetMask ) )\r
+               {\r
+                       /* The IP address is off the local network, so look up the hardware\r
+                       address of the router, if any. */\r
+                       ulAddressToLookup = xNetworkAddressing.ulGatewayAddress;\r
+               }\r
+               else\r
+               {\r
+                       /* The IP address is on the local network, so lookup the requested\r
+                       IP address directly. */\r
+                       ulAddressToLookup = *pulIPAddress;\r
+               }\r
+\r
+               if( ulAddressToLookup == 0UL )\r
+               {\r
+                       /* The address is not on the local network, and there is not a\r
+                       router. */\r
+                       eReturn = eCantSendPacket;\r
+               }\r
+               else\r
+               {\r
+                       eReturn = eARPCacheMiss;\r
+\r
+                       /* Loop through each entry in the ARP cache. */\r
+                       for( x = 0; x < ipconfigARP_CACHE_ENTRIES; x++ )\r
+                       {\r
+                               /* Does this row in the ARP cache table hold an entry for the IP\r
+                               address being queried? */\r
+                               if( xARPCache[ x ].ulIPAddress == ulAddressToLookup )\r
+                               {\r
+                                       /* The IP address matched.  Is there a valid MAC address? */\r
+                                       if( memcmp( ( void * ) &xNullMACAddress, ( void * ) &( xARPCache[ x ].xMACAddress ), sizeof( xMACAddress_t ) ) == 0 )\r
+                                       {\r
+                                               /* This entry is waiting an ARP reply, so is not valid. */\r
+                                               eReturn = eCantSendPacket;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               /* A valid entry was found. */\r
+                                               memcpy( pxMACAddress, &( xARPCache[ x ].xMACAddress ), sizeof( xMACAddress_t ) );\r
+                                               eReturn = eARPCacheHit;\r
+                                       }\r
+                               }\r
+\r
+                               if( eReturn != eARPCacheMiss )\r
+                               {\r
+                                       break;\r
+                               }\r
+                       }\r
+\r
+                       if( eReturn == eARPCacheMiss )\r
+                       {\r
+                               /* It might be that the ARP has to go to the gateway. */\r
+                               *pulIPAddress = ulAddressToLookup;\r
+                       }\r
+               }\r
+       }\r
+\r
+       return eReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvRefreshARPCacheEntry( const xMACAddress_t * const pxMACAddress, const uint32_t ulIPAddress )\r
+{\r
+portBASE_TYPE x, xEntryFound = pdFALSE, xOldestEntry = 0;\r
+uint8_t ucMinAgeFound = 0U;\r
+\r
+       /* Only process the IP address if it is on the local network. */\r
+       if( ( ulIPAddress & xNetworkAddressing.ulNetMask ) == ( ( *ipLOCAL_IP_ADDRESS_POINTER ) & xNetworkAddressing.ulNetMask ) )\r
+       {\r
+               /* Start with the maximum possible number. */\r
+               ucMinAgeFound--;\r
+\r
+               /* For each entry in the ARP cache table. */\r
+               for( x = 0; x < ipconfigARP_CACHE_ENTRIES; x++ )\r
+               {\r
+                       /* Does this line in the cache table hold an entry for the IP\r
+                       address being queried? */\r
+                       if( xARPCache[ x ].ulIPAddress == ulIPAddress )\r
+                       {\r
+                               /* If the MAC address is all zeros then the refresh is due to\r
+                               an ARP reply, so in effect this is a new entry in the ARP\r
+                               cache. */\r
+                               if( memcmp( &( xARPCache[ x ].xMACAddress ), &xNullMACAddress, sizeof( xMACAddress_t ) ) == 0 )\r
+                               {\r
+                                       iptraceARP_TABLE_ENTRY_CREATED( xARPCache[ x ].ulIPAddress, *pxMACAddress );\r
+                               }\r
+\r
+                               /* Refresh the cache entry so the entry's age is back to its\r
+                               maximum value. */\r
+                               xARPCache[ x ].ucAge = ipconfigMAX_ARP_AGE;\r
+                               memcpy( &( xARPCache[ x ].xMACAddress ), pxMACAddress, sizeof( xMACAddress_t ) );\r
+                               xEntryFound = pdTRUE;\r
+                               break;\r
+                       }\r
+                       else\r
+                       {\r
+                               /* As the table is traversed, remember the table row that\r
+                               contains the oldest entry (the lowest age count, as ages are\r
+                               decremented to zero) so the row can be re-used if this function\r
+                               needs to add an entry that does not already exist. */\r
+                               if( xARPCache[ x ].ucAge < ucMinAgeFound )\r
+                               {\r
+                                       ucMinAgeFound = xARPCache[ x ].ucAge;\r
+                                       xOldestEntry = x;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               if( xEntryFound == pdFALSE )\r
+               {\r
+                       /* The wanted entry does not already exist.  Add the entry into the\r
+                       cache, replacing the oldest entry (which might be an empty entry). */\r
+                       xARPCache[ xOldestEntry ].ulIPAddress = ulIPAddress;\r
+                       memcpy( &( xARPCache[ xOldestEntry ].xMACAddress ), pxMACAddress, sizeof( xMACAddress_t ) );\r
+\r
+                       /* If the MAC address is all zeros, then this entry is not yet\r
+                       complete but still waiting the reply from an ARP request.  When this\r
+                       is the case     the age is set to a much lower value as an ARP\r
+                       retransmission will be generated each time the ARP timer is called\r
+                       while the reply is still outstanding. */\r
+                       if( pxMACAddress == &xNullMACAddress )\r
+                       {\r
+                               xARPCache[ xOldestEntry ].ucAge = ipconfigMAX_ARP_RETRANSMISSIONS;\r
+                       }\r
+                       else\r
+                       {\r
+                               iptraceARP_TABLE_ENTRY_CREATED( xARPCache[ xOldestEntry ].ulIPAddress, xARPCache[ xOldestEntry ].xMACAddress );\r
+                               xARPCache[ xOldestEntry ].ucAge = ipconfigMAX_ARP_AGE;\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+\r
+       static void prvCalculateFragmentOffsetAndLength( xIPFragmentParameters_t *pxFragmentParameters, uint16_t *pusFragmentOffset, uint16_t *pusFragmentLength )\r
+       {\r
+               *pusFragmentOffset = pxFragmentParameters->usFragmentedPacketOffset;\r
+\r
+               if( *pusFragmentOffset != 0 )\r
+               {\r
+                       /* Take into account that the payload has had a UDP header added in the\r
+                       first fragment of the set. */\r
+                       *pusFragmentOffset += sizeof( xUDPHeader_t );\r
+               }\r
+\r
+               /* The offset is defined in multiples of 8 bytes. */\r
+               *pusFragmentOffset >>= ipSHIFT_TO_DIVIDE_BY_8;\r
+               *pusFragmentLength = pxFragmentParameters->usFragmentLength;\r
+\r
+               if( ( pxFragmentParameters->ucSocketOptions & FREERTOS_NOT_LAST_IN_FRAGMENTED_PACKET ) != 0 )\r
+               {\r
+                       /* Set the more fragments flag. */\r
+                       *pusFragmentOffset |= ipMORE_FRAGMENTS_FLAG_BIT;\r
+               }\r
+       }\r
+\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvCompleteUDPHeader( xNetworkBufferDescriptor_t *pxNetworkBuffer, xUDPPacket_t *pxUDPPacket, uint8_t ucSocketOptions )\r
+{\r
+xUDPHeader_t *pxUDPHeader;\r
+\r
+       pxUDPHeader = &( pxUDPPacket->xUDPHeader );\r
+\r
+       pxUDPHeader->usDestinationPort = pxNetworkBuffer->usPort;\r
+       pxUDPHeader->usSourcePort = pxNetworkBuffer->usBoundPort;\r
+       pxUDPHeader->usLength = ( uint16_t ) ( pxNetworkBuffer->xDataLength + sizeof( xUDPHeader_t ) );\r
+       pxUDPHeader->usLength = FreeRTOS_htons( pxUDPPacket->xUDPHeader.usLength );\r
+       pxUDPHeader->usChecksum = 0;\r
+\r
+       if( ( ucSocketOptions & FREERTOS_SO_UDPCKSUM_OUT ) != 0U )\r
+       {\r
+               pxUDPHeader->usChecksum = prvGenerateUDPChecksum( pxUDPPacket );\r
+               if( pxUDPHeader->usChecksum == 0x00 )\r
+               {\r
+                       /* A calculated checksum of 0 must be inverted as 0 means the\r
+                       checksum is disabled. */\r
+                       pxUDPHeader->usChecksum = 0xffffU;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1\r
+\r
+       static void prvProcessGeneratedPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+       {\r
+       xUDPPacket_t *pxUDPPacket;\r
+       xUDPHeader_t *pxUDPHeader;\r
+       xIPHeader_t *pxIPHeader;\r
+       eARPLookupResult_t eReturned;\r
+       eIPFragmentStatus_t eFragmentStatus;\r
+       uint16_t usFragmentOffset = 0, usFragmentLength;\r
+       xIPFragmentParameters_t *pxFragmentParameters;\r
+       static uint16_t usPacketIdentifier = 0U;\r
+\r
+               /* Map the UDP packet onto the start of the frame. */\r
+               pxUDPPacket = ( xUDPPacket_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
+\r
+               /* Determine the ARP cache status for the requested IP address. */\r
+               eReturned = prvGetARPCacheEntry( &( pxNetworkBuffer->ulIPAddress ), &( pxUDPPacket->xEthernetHeader.xDestinationAddress ) );\r
+\r
+               if( eReturned != eCantSendPacket )\r
+               {\r
+                       if( eReturned == eARPCacheHit )\r
+                       {\r
+                               iptraceSENDING_UDP_PACKET( pxNetworkBuffer->ulIPAddress );\r
+\r
+                               /* Create short cuts to the data within the packet. */\r
+                               pxUDPHeader = &( pxUDPPacket->xUDPHeader );\r
+                               pxIPHeader = &( pxUDPPacket->xIPHeader );\r
+                               pxFragmentParameters = ( xIPFragmentParameters_t * ) &( pxNetworkBuffer->pucEthernetBuffer[ ipFRAGMENTATION_PARAMETERS_OFFSET ] );\r
+\r
+                               /* IP header source and destination addresses must be set\r
+                               before the UDP checksum is calculated. */\r
+                               pxIPHeader->ulDestinationIPAddress = pxNetworkBuffer->ulIPAddress;\r
+                               pxIPHeader->ulSourceIPAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+\r
+                               /* If the packet is not fragmented, or if the packet is the\r
+                               first in a fragmented packet, then a UDP header is required. */\r
+                               if( ( pxFragmentParameters->ucSocketOptions & FREERTOS_FRAGMENTED_PACKET ) == 0 )\r
+                               {\r
+                                       eFragmentStatus = eNotFragment;\r
+\r
+                                       #if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+                                       {\r
+                                               /* Is it possible that the packet is not actually a UDP\r
+                                               packet after all, but an ICMP packet. */\r
+                                               if( pxNetworkBuffer->usPort != ipPACKET_CONTAINS_ICMP_DATA )\r
+                                               {\r
+                                                       prvCompleteUDPHeader( pxNetworkBuffer, pxUDPPacket, pxFragmentParameters->ucSocketOptions );\r
+                                               }\r
+                                       }\r
+                                       #else /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+                                       {\r
+                                               prvCompleteUDPHeader( pxNetworkBuffer, pxUDPPacket, pxFragmentParameters->ucSocketOptions );\r
+                                       }\r
+                                       #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+\r
+                                       usFragmentLength = 0U;\r
+\r
+                                       /* The identifier is incremented as this is a new and\r
+                                       unfragmented IP packet. */\r
+                                       usPacketIdentifier++;\r
+                               }\r
+                               else if( pxFragmentParameters->usFragmentedPacketOffset == 0 )\r
+                               {\r
+                                       eFragmentStatus = eFirstFragment;\r
+                                       prvCalculateFragmentOffsetAndLength( pxFragmentParameters, &usFragmentOffset, &usFragmentLength );\r
+                                       /* Note FREERTOS_SO_UDPCKSUM_OUT is used because checksums\r
+                                       cannot currently be used on fragmented packets. */\r
+                                       pxFragmentParameters->ucSocketOptions &= ~FREERTOS_SO_UDPCKSUM_OUT;\r
+                                       prvCompleteUDPHeader( pxNetworkBuffer, pxUDPPacket, pxFragmentParameters->ucSocketOptions );\r
+\r
+                                       /* The identifier is incremented because, although this is a\r
+                                       fragmented packet, it is the first in the fragmentation\r
+                                       set. */\r
+                                       usPacketIdentifier++;\r
+                               }\r
+                               else\r
+                               {\r
+                                       eFragmentStatus = eFollowingFragment;\r
+                                       prvCalculateFragmentOffsetAndLength( pxFragmentParameters, &usFragmentOffset, &usFragmentLength );\r
+                               }\r
+\r
+                               /* memcpy() the constant parts of the header information into the\r
+                               correct location within the packet.  This fills in:\r
+                                       xEthernetHeader.xSourceAddress\r
+                                       xEthernetHeader.usFrameType\r
+                                       xIPHeader.ucVersionHeaderLength\r
+                                       xIPHeader.ucDifferentiatedServicesCode\r
+                                       xIPHeader.usLength\r
+                                       xIPHeader.usIdentification\r
+                                       xIPHeader.usFragmentOffset\r
+                                       xIPHeader.ucTimeToLive\r
+                                       xIPHeader.ucProtocol\r
+                               and\r
+                                       xIPHeader.usHeaderChecksum\r
+                               */\r
+                               memcpy( ( void *) &( pxUDPPacket->xEthernetHeader.xSourceAddress ), ( void * ) xDefaultPartUDPPacketHeader, sizeof( xDefaultPartUDPPacketHeader ) );\r
+\r
+                               /* The fragment status is used to complete the length and\r
+                               fragment offset fields. */\r
+                               if( eFragmentStatus == eNotFragment )\r
+                               {\r
+                                       pxIPHeader->usLength = ( uint16_t ) ( pxNetworkBuffer->xDataLength + sizeof( xIPHeader_t ) + sizeof( xUDPHeader_t ) );\r
+                               }\r
+                               else if( eFragmentStatus == eFirstFragment )\r
+                               {\r
+                                       pxIPHeader->usFragmentOffset = FreeRTOS_htons( usFragmentOffset );\r
+                                       pxIPHeader->usLength = ( uint16_t ) ( usFragmentLength + sizeof( xIPHeader_t ) + sizeof( xUDPHeader_t ) );\r
+                               }\r
+                               else\r
+                               {\r
+                                       pxIPHeader->usFragmentOffset = FreeRTOS_htons( usFragmentOffset );\r
+                                       pxIPHeader->usLength = ( uint16_t ) ( usFragmentLength + sizeof( xIPHeader_t ) );\r
+                               }\r
+\r
+                               /* The total transmit size adds on the Ethernet header. */\r
+                               pxNetworkBuffer->xDataLength = pxIPHeader->usLength + sizeof( xEthernetHeader_t );\r
+                               pxIPHeader->usLength = FreeRTOS_htons( pxIPHeader->usLength );\r
+                               pxIPHeader->ulDestinationIPAddress = pxNetworkBuffer->ulIPAddress;\r
+                               pxIPHeader->usIdentification = usPacketIdentifier;\r
+                               pxIPHeader->usHeaderChecksum = prvGenerateChecksum( ( uint8_t * ) &( pxIPHeader->ucVersionHeaderLength ), ipIP_HEADER_LENGTH );\r
+                       }\r
+                       else if ( eReturned == eARPCacheMiss )\r
+                       {\r
+                               /* Send an ARP for the required IP address. */\r
+                               iptracePACKET_DROPPED_TO_GENERATE_ARP( pxNetworkBuffer->ulIPAddress );\r
+                               prvGenerateARPRequestPacket( pxNetworkBuffer );\r
+\r
+                               /* Add an entry to the ARP table with a null hardware address.\r
+                               This allows the ARP timer to know that an ARP reply is\r
+                               outstanding, and perform retransmissions if necessary. */\r
+                               prvRefreshARPCacheEntry( &xNullMACAddress, pxNetworkBuffer->ulIPAddress );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The lookup indicated that an ARP request has already been\r
+                               sent out for the queried IP address. */\r
+                               eReturned = eCantSendPacket;\r
+                       }\r
+               }\r
+\r
+               if( eReturned != eCantSendPacket )\r
+               {\r
+                       /* The network driver is responsible for freeing the network buffer\r
+                       after the packet has been sent. */\r
+                       xNetworkInterfaceOutput( pxNetworkBuffer );\r
+               }\r
+               else\r
+               {\r
+                       /* The packet can't be sent (DHCP not completed?).  Just drop the\r
+                       packet. */\r
+                       vNetworkBufferRelease( pxNetworkBuffer );\r
+               }\r
+       }\r
+\r
+#else /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1 */\r
+\r
+       static void prvProcessGeneratedPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+       {\r
+       xUDPPacket_t *pxUDPPacket;\r
+       xIPHeader_t *pxIPHeader;\r
+       eARPLookupResult_t eReturned;\r
+\r
+               /* Map the UDP packet onto the start of the frame. */\r
+               pxUDPPacket = ( xUDPPacket_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
+\r
+               /* Determine the ARP cache status for the requested IP address. */\r
+               eReturned = prvGetARPCacheEntry( &( pxNetworkBuffer->ulIPAddress ), &( pxUDPPacket->xEthernetHeader.xDestinationAddress ) );\r
+               if( eReturned != eCantSendPacket )\r
+               {\r
+                       if( eReturned == eARPCacheHit )\r
+                       {\r
+                               iptraceSENDING_UDP_PACKET( pxNetworkBuffer->ulIPAddress );\r
+\r
+                               /* Create short cuts to the data within the packet. */\r
+                               pxIPHeader = &( pxUDPPacket->xIPHeader );\r
+\r
+                               /* IP header source and destination addresses must be set before\r
+                               the     UDP checksum is calculated.  The socket options, which\r
+                               specify whether a checksum should be calculated or not, are\r
+                               passed in the as yet unused part of the packet data. */\r
+                               pxIPHeader->ulDestinationIPAddress = pxNetworkBuffer->ulIPAddress;\r
+                               pxIPHeader->ulSourceIPAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+\r
+                               #if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+                               {\r
+                                       /* Is it possible that the packet is not actually a UDP packet\r
+                                       after all, but an ICMP packet. */\r
+                                       if( pxNetworkBuffer->usPort != ipPACKET_CONTAINS_ICMP_DATA )\r
+                                       {\r
+                                               prvCompleteUDPHeader( pxNetworkBuffer, pxUDPPacket, pxNetworkBuffer->pucEthernetBuffer[ ipSOCKET_OPTIONS_OFFSET ] );\r
+                                       }\r
+                               }\r
+                               #else /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+                               {\r
+                                       prvCompleteUDPHeader( pxNetworkBuffer, pxUDPPacket, pxNetworkBuffer->pucEthernetBuffer[ ipSOCKET_OPTIONS_OFFSET ] );\r
+                               }\r
+                               #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+                               /* memcpy() the constant parts of the header information into\r
+                               the     correct location within the packet.  This fills in:\r
+                                       xEthernetHeader.xSourceAddress\r
+                                       xEthernetHeader.usFrameType\r
+                                       xIPHeader.ucVersionHeaderLength\r
+                                       xIPHeader.ucDifferentiatedServicesCode\r
+                                       xIPHeader.usLength\r
+                                       xIPHeader.usIdentification\r
+                                       xIPHeader.usFragmentOffset\r
+                                       xIPHeader.ucTimeToLive\r
+                                       xIPHeader.ucProtocol\r
+                               and\r
+                                       xIPHeader.usHeaderChecksum\r
+                               */\r
+                               memcpy( ( void *) &( pxUDPPacket->xEthernetHeader.xSourceAddress ), ( void * ) xDefaultPartUDPPacketHeader, sizeof( xDefaultPartUDPPacketHeader ) );\r
+\r
+                               #if ipconfigSUPPORT_OUTGOING_PINGS == 1\r
+                               {\r
+                                       if( pxNetworkBuffer->usPort == ipPACKET_CONTAINS_ICMP_DATA )\r
+                                       {\r
+                                               pxIPHeader->ucProtocol = ipPROTOCOL_ICMP;\r
+                                               pxIPHeader->usLength = ( uint16_t ) ( pxNetworkBuffer->xDataLength + sizeof( xIPHeader_t ) );\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               pxIPHeader->usLength = ( uint16_t ) ( pxNetworkBuffer->xDataLength + sizeof( xIPHeader_t ) + sizeof( xUDPHeader_t ) );\r
+                                       }\r
+                               }\r
+                               #else /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+                               {\r
+                                       pxIPHeader->usLength = ( uint16_t ) ( pxNetworkBuffer->xDataLength + sizeof( xIPHeader_t ) + sizeof( xUDPHeader_t ) );\r
+                               }\r
+                               #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+\r
+                               /* The total transmit size adds on the Ethernet header. */\r
+                               pxNetworkBuffer->xDataLength = pxIPHeader->usLength + sizeof( xEthernetHeader_t );\r
+                               pxIPHeader->usLength = FreeRTOS_htons( pxIPHeader->usLength );\r
+                               pxIPHeader->ulDestinationIPAddress = pxNetworkBuffer->ulIPAddress;\r
+                               pxIPHeader->usHeaderChecksum = prvGenerateChecksum( ( uint8_t * ) &( pxIPHeader->ucVersionHeaderLength ), ipIP_HEADER_LENGTH );\r
+                       }\r
+                       else if ( eReturned == eARPCacheMiss )\r
+                       {\r
+                               /* Generate an ARP for the required IP address. */\r
+                               iptracePACKET_DROPPED_TO_GENERATE_ARP( pxNetworkBuffer->ulIPAddress );\r
+                               prvGenerateARPRequestPacket( pxNetworkBuffer );\r
+\r
+                               /* Add an entry to the ARP table with a null hardware address.\r
+                               This allows the ARP timer to know that an ARP reply is\r
+                               outstanding, and perform retransmissions if necessary. */\r
+                               prvRefreshARPCacheEntry( &xNullMACAddress, pxNetworkBuffer->ulIPAddress );\r
+                       }\r
+                       else\r
+                       {\r
+                               /* The lookup indicated that an ARP request has already been\r
+                               sent out for the queried IP address. */\r
+                               eReturned = eCantSendPacket;\r
+                       }\r
+               }\r
+\r
+               if( eReturned != eCantSendPacket )\r
+               {\r
+                       /* The network driver is responsible for freeing the network buffer\r
+                       after the packet has been sent. */\r
+                       xNetworkInterfaceOutput( pxNetworkBuffer );\r
+               }\r
+               else\r
+               {\r
+                       /* The packet can't be sent (DHCP not completed?).  Just drop the\r
+                       packet. */\r
+                       vNetworkBufferRelease( pxNetworkBuffer );\r
+               }\r
+       }\r
+\r
+\r
+#endif /* ipconfigCAN_FRAGMENT_OUTGOING_PACKETS == 1 */\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvGenerateARPRequestPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+xARPPacket_t *pxARPPacket;\r
+\r
+       pxARPPacket = ( xARPPacket_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
+\r
+       /* memcpy the const part of the header information into the correct\r
+       location in the packet.  This copies:\r
+               xEthernetHeader.ulDestinationAddress\r
+               xEthernetHeader.usFrameType;\r
+               xARPHeader.usHardwareType;\r
+               xARPHeader.usProtocolType;\r
+               xARPHeader.ucHardwareAddressLength;\r
+               xARPHeader.ucProtocolAddressLength;\r
+               xARPHeader.usOperation;\r
+               xARPHeader.xTargetHardwareAddress;\r
+       */\r
+       memcpy( ( void * ) &( pxARPPacket->xEthernetHeader ), ( void * ) xDefaultPartARPPacketHeader, sizeof( xDefaultPartARPPacketHeader ) );\r
+       memcpy( ( void * ) &( pxARPPacket->xEthernetHeader.xSourceAddress ) , ( void * ) ipLOCAL_MAC_ADDRESS, ( size_t ) ipMAC_ADDRESS_LENGTH_BYTES );\r
+       memcpy( ( void * ) &( pxARPPacket->xARPHeader.xSenderHardwareAddress ), ( void * ) ipLOCAL_MAC_ADDRESS, ( size_t ) ipMAC_ADDRESS_LENGTH_BYTES );\r
+       pxARPPacket->xARPHeader.ulSenderProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+       pxARPPacket->xARPHeader.ulTargetProtocolAddress = pxNetworkBuffer->ulIPAddress;\r
+\r
+       pxNetworkBuffer->xDataLength = sizeof( xARPPacket_t );\r
+\r
+       iptraceCREATING_ARP_REQUEST( ulIPAddress );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucEthernetBuffer )\r
+{\r
+eFrameProcessingResult_t eReturn;\r
+const xEthernetHeader_t *pxEthernetHeader;\r
+\r
+       pxEthernetHeader = ( const xEthernetHeader_t * ) pucEthernetBuffer;\r
+\r
+       if( memcmp( ( void * ) &xBroadcastMACAddress, ( void * ) &( pxEthernetHeader->xDestinationAddress ), sizeof( xMACAddress_t ) ) == 0 )\r
+       {\r
+               /* The packet was a broadcast - process it. */\r
+               eReturn = eProcessBuffer;\r
+       }\r
+       else if( memcmp( ( void * ) ipLOCAL_MAC_ADDRESS, ( void * ) &( pxEthernetHeader->xDestinationAddress ), sizeof( xMACAddress_t ) ) == 0 )\r
+       {\r
+               /* The packet was to this node directly - process it. */\r
+               eReturn = eProcessBuffer;\r
+       }\r
+       else\r
+       {\r
+               /* The packet was not a broadcast, or for this node, just release\r
+               the buffer without taking any other action. */\r
+               eReturn = eReleaseBuffer;\r
+       }\r
+\r
+       #if ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES == 1\r
+       {\r
+               uint16_t usFrameType;\r
+\r
+                       if( eReturn == eProcessBuffer )\r
+                       {\r
+                               usFrameType = pxEthernetHeader->usFrameType;\r
+                               usFrameType = FreeRTOS_ntohs( usFrameType );\r
+\r
+                               if( usFrameType <= 0x600U )\r
+                               {\r
+                                       /* Not an Ethernet II frame. */\r
+                                       eReturn = eReleaseBuffer;\r
+                               }\r
+                       }\r
+       }\r
+       #endif /* ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES == 1  */\r
+\r
+       return eReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvProcessNetworkDownEvent( void )\r
+{\r
+       /* Stop the ARP timer while there is no network. */\r
+       xTimerStop( xARPTimer, portMAX_DELAY );\r
+\r
+       #if ipconfigUSE_NETWORK_EVENT_HOOK == 1\r
+       {\r
+               static portBASE_TYPE xCallEventHook = pdFALSE;\r
+\r
+               /* The first network down event is generated by the IP stack\r
+               itself to initialise the network hardware, so do not call the\r
+               network down event the first time through. */\r
+               if( xCallEventHook == pdFALSE )\r
+               {\r
+                       vApplicationIPNetworkEventHook( eNetworkDown );\r
+               }\r
+               xCallEventHook = pdTRUE;\r
+       }\r
+       #endif\r
+\r
+       /* The network has been disconnected (or is being\r
+       initialised for the first time).  Perform whatever hardware\r
+       processing is necessary to bring it up again, or wait for it\r
+       to be available again.  This is hardware dependent. */\r
+       if( xNetworkInterfaceInitialise() != pdPASS )\r
+       {\r
+               /* Ideally the network interface initialisation function\r
+               will only return when the network is available.  In case\r
+               this is not the case, wait a while before retrying the\r
+               initialisation. */\r
+               vTaskDelay( ipINITIALISATION_RETRY_DELAY );\r
+               FreeRTOS_NetworkDown();\r
+       }\r
+       else\r
+       {\r
+               /* Start the ARP timer. */\r
+               xTimerStart( xARPTimer, portMAX_DELAY );\r
+\r
+               #if ipconfigUSE_DHCP == 1\r
+               {\r
+                       /* The network is not up until DHCP has completed. */\r
+                       vDHCPProcess( pdTRUE, ( xMACAddress_t * ) ipLOCAL_MAC_ADDRESS, ipLOCAL_IP_ADDRESS_POINTER, &xNetworkAddressing );\r
+                       prvSendEventToIPTask( eDHCPEvent );\r
+               }\r
+               #else\r
+               {\r
+                       /* Static configuration is being used, so the network is now up. */\r
+                       #if ipconfigFREERTOS_PLUS_NABTO == 1\r
+                       {\r
+                               prvStartNabtoTask();\r
+                       }\r
+                       #endif /* ipconfigFREERTOS_PLUS_NABTO */\r
+\r
+                       #if ipconfigUSE_NETWORK_EVENT_HOOK == 1\r
+                       {\r
+                               vApplicationIPNetworkEventHook( eNetworkUp );\r
+                       }\r
+                       #endif /* ipconfigUSE_NETWORK_EVENT_HOOK */\r
+               }\r
+               #endif\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvProcessEthernetPacket( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+xEthernetHeader_t *pxEthernetHeader;\r
+volatile eFrameProcessingResult_t eReturned; /* Volatile to prevent complier warnings when ipCONSIDER_FRAME_FOR_PROCESSING just sets it to eProcessBuffer. */\r
+\r
+       configASSERT( pxNetworkBuffer );\r
+\r
+       /* Interpret the Ethernet frame. */\r
+       eReturned = ipCONSIDER_FRAME_FOR_PROCESSING( pxNetworkBuffer->pucEthernetBuffer );\r
+       pxEthernetHeader = ( xEthernetHeader_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
+\r
+       if( eReturned == eProcessBuffer )\r
+       {\r
+               /* Interpret the received Ethernet packet. */\r
+               switch ( pxEthernetHeader->usFrameType )\r
+               {\r
+                       case ipARP_TYPE :\r
+                               /* The Ethernet frame contains an ARP packet. */\r
+                               eReturned = prvProcessARPPacket( ( xARPPacket_t * ) pxEthernetHeader );\r
+                               break;\r
+\r
+                       case ipIP_TYPE  :\r
+                               /* The Ethernet frame contains an IP packet. */\r
+                               eReturned = prvProcessIPPacket( ( xIPPacket_t * ) pxEthernetHeader, pxNetworkBuffer );\r
+                               break;\r
+\r
+                       default :\r
+                               /* No other packet types are handled.  Nothing to do. */\r
+                               eReturned = eReleaseBuffer;\r
+                               break;\r
+               }\r
+       }\r
+\r
+       /* Perform any actions that resulted from processing the Ethernet\r
+       frame. */\r
+       switch( eReturned )\r
+       {\r
+               case eReturnEthernetFrame :\r
+                       /* The Ethernet frame will have been updated (maybe it was\r
+                       an ARP request or a PING request?) and should be sent back to\r
+                       its source. */\r
+                       prvReturnEthernetFrame( pxNetworkBuffer );\r
+                       /* The buffer must be released once\r
+                       the frame has been transmitted. */\r
+                       break;\r
+\r
+               case eFrameConsumed :\r
+                       /* The frame is in use somewhere, don't release the buffer\r
+                       yet. */\r
+                       break;\r
+\r
+               default :\r
+                       /* The frame is not being used anywhere, and the\r
+                       xNetworkBufferDescriptor_t structure containing the frame should just be\r
+                       released back to the list of free buffers. */\r
+                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                       break;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static eFrameProcessingResult_t prvProcessIPPacket( const xIPPacket_t * const pxIPPacket, xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+eFrameProcessingResult_t eReturn = eReleaseBuffer;\r
+const xIPHeader_t * pxIPHeader;\r
+xUDPPacket_t *pxUDPPacket;\r
+portBASE_TYPE xChecksumIsCorrect;\r
+\r
+       pxIPHeader = &( pxIPPacket->xIPHeader );\r
+\r
+       /* Is the packet for this node? */\r
+       if( ( pxIPHeader->ulDestinationIPAddress == *ipLOCAL_IP_ADDRESS_POINTER ) || ( pxIPHeader->ulDestinationIPAddress == ipBROADCAST_IP_ADDRESS ) || ( *ipLOCAL_IP_ADDRESS_POINTER == 0 ) )\r
+       {\r
+               /* Ensure the frame is IPv4 with no options bytes, and that the incoming\r
+               packet is not fragmented (only outgoing packets can be fragmented) as\r
+               these are the only handled IP frames currently. */\r
+               if( ( pxIPHeader->ucVersionHeaderLength == ipIP_VERSION_AND_HEADER_LENGTH_BYTE ) && ( ( pxIPHeader->usFragmentOffset & ipFRAGMENT_OFFSET_BIT_MASK ) == 0U ) )\r
+               {\r
+                       /* Is the IP header checksum correct? */\r
+                       if( prvGenerateChecksum( ( uint8_t * ) &( pxIPHeader->ucVersionHeaderLength ), ipIP_HEADER_LENGTH ) == 0 )\r
+                       {\r
+                               /* Add the IP and MAC addresses to the ARP table if they are not\r
+                               already there - otherwise refresh the age of the existing\r
+                               entry. */\r
+                               prvRefreshARPCacheEntry( &( pxIPPacket->xEthernetHeader.xSourceAddress ), pxIPHeader->ulSourceIPAddress );\r
+                               switch( pxIPHeader->ucProtocol )\r
+                               {\r
+                                       case ipPROTOCOL_ICMP :\r
+\r
+                                               /* The IP packet contained an ICMP frame.  Don't bother\r
+                                               checking the ICMP checksum, as if it is wrong then the\r
+                                               wrong data will also be returned, and the source of the\r
+                                               ping will know something went wrong because it will not\r
+                                               be able to validate what it receives. */\r
+                                               #if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+                                               {\r
+                                                       if( pxIPHeader->ulDestinationIPAddress == *ipLOCAL_IP_ADDRESS_POINTER )\r
+                                                       {\r
+                                                               eReturn = prvProcessICMPPacket( ( xICMPPacket_t * ) ( pxNetworkBuffer->pucEthernetBuffer ) );\r
+                                                       }\r
+                                               }\r
+                                               #endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */\r
+                                               break;\r
+\r
+                                       case ipPROTOCOL_UDP :\r
+\r
+                                               /* The IP packet contained a UDP frame. */\r
+                                               pxUDPPacket = ( xUDPPacket_t * ) ( pxNetworkBuffer->pucEthernetBuffer );\r
+\r
+                                               /* Note the header values required prior to the\r
+                                               checksum generation as the checksum pseudo header\r
+                                               may clobber some of these values. */\r
+                                               pxNetworkBuffer->xDataLength = FreeRTOS_ntohs( pxUDPPacket->xUDPHeader.usLength ) - sizeof( xUDPHeader_t );\r
+                                               pxNetworkBuffer->usPort = pxUDPPacket->xUDPHeader.usSourcePort;\r
+                                               pxNetworkBuffer->ulIPAddress = pxUDPPacket->xIPHeader.ulSourceIPAddress;\r
+\r
+                                               /* Is the checksum required? */\r
+                                               if( pxUDPPacket->xUDPHeader.usChecksum == 0 )\r
+                                               {\r
+                                                       xChecksumIsCorrect = pdTRUE;\r
+                                               }\r
+                                               else if( prvGenerateUDPChecksum( pxUDPPacket ) == 0 )\r
+                                               {\r
+                                                       xChecksumIsCorrect = pdTRUE;\r
+                                               }\r
+                                               else\r
+                                               {\r
+                                                       xChecksumIsCorrect = pdFALSE;\r
+                                               }\r
+\r
+                                               /* Is the checksum correct? */\r
+                                               if( xChecksumIsCorrect == pdTRUE )\r
+                                               {\r
+                                                       /* Pass the packet payload to the UDP sockets\r
+                                                       implementation. */\r
+                                                       if( xProcessReceivedUDPPacket( pxNetworkBuffer, pxUDPPacket->xUDPHeader.usDestinationPort ) == pdPASS )\r
+                                                       {\r
+                                                               eReturn = eFrameConsumed;\r
+                                                       }\r
+                                               }\r
+                                               break;\r
+\r
+                                       default :\r
+\r
+                                               /* Not a supported frame type. */\r
+                                               break;\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+       return eReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint16_t prvGenerateUDPChecksum( const xUDPPacket_t * const pxUDPPacket )\r
+{\r
+xPseudoHeader_t *pxPseudoHeader;\r
+uint16_t usLength, usReturn;\r
+\r
+       /* Map the pseudo header into the correct place within the real IP\r
+       header. */\r
+       pxPseudoHeader = ( xPseudoHeader_t * ) &( pxUDPPacket->xIPHeader.ucTimeToLive );\r
+\r
+       /* Ordering here is important so as not to overwrite data that is required\r
+       but has not yet been used as the pseudo header overlaps the information\r
+       that is being copied into it. */\r
+       pxPseudoHeader->ulSourceAddress = pxUDPPacket->xIPHeader.ulSourceIPAddress;\r
+       pxPseudoHeader->ulDestinationAddress = pxUDPPacket->xIPHeader.ulDestinationIPAddress;\r
+       pxPseudoHeader->ucZeros = 0x00;\r
+       pxPseudoHeader->ucProtocol = ipPROTOCOL_UDP;\r
+       pxPseudoHeader->usUDPLength = pxUDPPacket->xUDPHeader.usLength;\r
+\r
+       usLength = FreeRTOS_ntohs( pxPseudoHeader->usUDPLength );\r
+       usReturn = prvGenerateChecksum( ( uint8_t * ) pxPseudoHeader, usLength + sizeof( xPseudoHeader_t ) );\r
+\r
+       return usReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+\r
+       static void prvProcessICMPEchoReply( xICMPPacket_t * const pxICMPPacket )\r
+       {\r
+       ePingReplyStatus_t eStatus = eSuccess;\r
+       uint16_t usDataLength, usCount;\r
+       uint8_t *pucByte;\r
+\r
+               /* Find the total length of the IP packet. */\r
+               usDataLength = pxICMPPacket->xIPHeader.usLength;\r
+               usDataLength = FreeRTOS_ntohs( usDataLength );\r
+\r
+               /* Remove the length of the IP headers to obtain the length of the ICMP\r
+               message itself. */\r
+               usDataLength -= sizeof( xIPHeader_t );\r
+\r
+               if( prvGenerateChecksum( ( uint8_t * ) &( pxICMPPacket->xICMPHeader ), usDataLength ) != 0 )\r
+               {\r
+                       eStatus = eInvalidChecksum;\r
+               }\r
+               else\r
+               {\r
+                       /* Remove the length of the ICMP header, to obtain the length of\r
+                       data contained in the ping. */\r
+                       usDataLength -= sizeof( xICMPHeader_t );\r
+\r
+                       /* Find the first byte of the data within the ICMP packet. */\r
+                       pucByte = ( uint8_t * ) pxICMPPacket;\r
+                       pucByte += sizeof( xICMPPacket_t );\r
+\r
+                       /* Check each byte. */\r
+                       for( usCount = 0; usCount < usDataLength; usCount++ )\r
+                       {\r
+                               if( *pucByte != ipECHO_DATA_FILL_BYTE )\r
+                               {\r
+                                       eStatus = eInvalidData;\r
+                                       break;\r
+                               }\r
+\r
+                               pucByte++;\r
+                       }\r
+               }\r
+\r
+               vApplicationPingReplyHook( eStatus, pxICMPPacket->xICMPHeader.usIdentifier );\r
+       }\r
+\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 )\r
+\r
+       static eFrameProcessingResult_t prvProcessICMPEchoRequest( xICMPPacket_t * const pxICMPPacket )\r
+       {\r
+       xICMPHeader_t *pxICMPHeader;\r
+       xIPHeader_t *pxIPHeader;\r
+\r
+               iptraceSENDING_PING_REPLY( pxIPHeader->ulSourceIPAddress );\r
+\r
+               pxICMPHeader = &( pxICMPPacket->xICMPHeader );\r
+               pxIPHeader = &( pxICMPPacket->xIPHeader );\r
+\r
+               /* The checksum can be checked here - but a ping reply should be\r
+               returned even if the checksum is incorrect so the other end can\r
+               tell that the ping was received - even if the ping reply contains\r
+               invalid data. */\r
+               pxICMPHeader->ucTypeOfMessage = ipICMP_ECHO_REPLY;\r
+               pxIPHeader->ulDestinationIPAddress = pxIPHeader->ulSourceIPAddress;\r
+               pxIPHeader->ulSourceIPAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+\r
+               /* Update the checksum because the ucTypeOfMessage member in the\r
+               header has been changed to ipICMP_ECHO_REPLY. */\r
+               if( pxICMPHeader->usChecksum >= FreeRTOS_htons( ( ( uint16_t ) 0xffffU ) - ( ipICMP_ECHO_REQUEST << ( ( uint16_t ) 8U ) ) ) )\r
+               {\r
+                       pxICMPHeader->usChecksum += FreeRTOS_htons( ipICMP_ECHO_REQUEST << ( ( uint16_t ) 8U ) ) + ( uint16_t ) 1U;\r
+               }\r
+               else\r
+               {\r
+                       pxICMPHeader->usChecksum += FreeRTOS_htons( ipICMP_ECHO_REQUEST << ( ( uint16_t ) 8U ) );\r
+               }\r
+\r
+               return eReturnEthernetFrame;\r
+       }\r
+\r
+#endif /* ipconfigREPLY_TO_INCOMING_PINGS == 1 */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+\r
+       static eFrameProcessingResult_t prvProcessICMPPacket( xICMPPacket_t * const pxICMPPacket )\r
+       {\r
+       eFrameProcessingResult_t eReturn = eReleaseBuffer;\r
+\r
+               iptraceICMP_PACKET_RECEIVED();\r
+\r
+               switch( pxICMPPacket->xICMPHeader.ucTypeOfMessage )\r
+               {\r
+                       case ipICMP_ECHO_REQUEST        :\r
+                               #if ( ipconfigREPLY_TO_INCOMING_PINGS == 1 )\r
+                               {\r
+                                       eReturn = prvProcessICMPEchoRequest( pxICMPPacket );\r
+                               }\r
+                               #endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) */\r
+                               break;\r
+\r
+                       case ipICMP_ECHO_REPLY          :\r
+                               #if ( ipconfigSUPPORT_OUTGOING_PINGS == 1 )\r
+                               {\r
+                                       prvProcessICMPEchoReply( pxICMPPacket );\r
+                               }\r
+                               #endif /* ipconfigSUPPORT_OUTGOING_PINGS */\r
+                               break;\r
+\r
+                       default :\r
+                               break;\r
+               }\r
+\r
+               return eReturn;\r
+       }\r
+\r
+#endif /* ( ipconfigREPLY_TO_INCOMING_PINGS == 1 ) || ( ipconfigSUPPORT_OUTGOING_PINGS == 1 ) */\r
+/*-----------------------------------------------------------*/\r
+\r
+static uint16_t prvGenerateChecksum( const uint8_t * const pucNextData, const uint16_t usDataLengthBytes )\r
+{\r
+uint32_t ulChecksum = 0;\r
+uint16_t us, usDataLength16BitWords, *pusNextData;\r
+\r
+       /* There are half as many 16 bit words than bytes. */\r
+       usDataLength16BitWords = ( usDataLengthBytes >> 1U );\r
+\r
+       pusNextData = ( uint16_t * ) pucNextData;\r
+\r
+       for( us = 0U; us < usDataLength16BitWords; us++ )\r
+       {\r
+               ulChecksum += ( uint32_t ) pusNextData[ us ];\r
+       }\r
+\r
+       if( ( usDataLengthBytes & 0x01U ) != 0x00 )\r
+       {\r
+               /* There is one byte left over. */\r
+               #if ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN\r
+               {\r
+                       ulChecksum += ( uint32_t ) pucNextData[ usDataLengthBytes - 1 ];\r
+               }\r
+               #else\r
+               {\r
+                       us = ( uint16_t ) pucNextData[ usDataLengthBytes - 1 ];\r
+                       ulChecksum += ( uint32_t ) ( us << 8 );\r
+               }\r
+               #endif\r
+       }\r
+\r
+       while( ( ulChecksum >> 16UL ) != 0x00UL )\r
+       {\r
+               ulChecksum = ( ulChecksum & 0xffffUL ) + ( ulChecksum >> 16UL );\r
+       }\r
+\r
+       return ~( ( uint16_t ) ulChecksum );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvReturnEthernetFrame( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+xEthernetHeader_t *pxEthernetHeader;\r
+\r
+       pxEthernetHeader = ( xEthernetHeader_t * ) ( pxNetworkBuffer->pucEthernetBuffer );\r
+\r
+       /* Swap source and destination MAC addresses. */\r
+       memcpy( ( void * ) &( pxEthernetHeader->xDestinationAddress ), ( void * ) &( pxEthernetHeader->xSourceAddress ), sizeof( pxEthernetHeader->xDestinationAddress ) );\r
+       memcpy( ( void * ) &( pxEthernetHeader->xSourceAddress) , ( void * ) ipLOCAL_MAC_ADDRESS, ( size_t ) ipMAC_ADDRESS_LENGTH_BYTES );\r
+\r
+       /* Send! */\r
+       xNetworkInterfaceOutput( pxNetworkBuffer );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static eFrameProcessingResult_t prvProcessARPPacket( xARPPacket_t * const pxARPFrame )\r
+{\r
+eFrameProcessingResult_t eReturn = eReleaseBuffer;\r
+xARPHeader_t *pxARPHeader;\r
+\r
+       pxARPHeader = &( pxARPFrame->xARPHeader );\r
+\r
+       traceARP_PACKET_RECEIVED();\r
+\r
+       /* Sanity check the protocol type.  Don't do anything if the local IP\r
+       address is zero because that means a DHCP request has not completed. */\r
+       if( ( pxARPHeader->usProtocolType == ipARP_PROTOCOL_TYPE ) && ( *ipLOCAL_IP_ADDRESS_POINTER != 0UL ) )\r
+       {\r
+               switch( pxARPHeader->usOperation )\r
+               {\r
+                       case ipARP_REQUEST      :\r
+                               /* The packet contained an ARP request.  Was it for the IP\r
+                               address of the node running this code? */\r
+                               if( pxARPHeader->ulTargetProtocolAddress == *ipLOCAL_IP_ADDRESS_POINTER )\r
+                               {\r
+                                       iptraceSENDING_ARP_REPLY( pxARPHeader->ulSenderProtocolAddress );\r
+\r
+                                       /* The request is for the address of this node.  Add the\r
+                                       entry into the ARP cache, or refresh the entry if it\r
+                                       already exists. */\r
+                                       prvRefreshARPCacheEntry( &( pxARPHeader->xSenderHardwareAddress ), pxARPHeader->ulSenderProtocolAddress );\r
+\r
+                                       /* Generate a reply payload in the same buffer. */\r
+                                       pxARPHeader->usOperation = ipARP_REPLY;\r
+                                       memcpy( ( void * )  &( pxARPHeader->xTargetHardwareAddress ), ( void * ) &( pxARPHeader->xSenderHardwareAddress ), sizeof( xMACAddress_t ) );\r
+                                       pxARPHeader->ulTargetProtocolAddress = pxARPHeader->ulSenderProtocolAddress;\r
+                                       memcpy( ( void * ) &( pxARPHeader->xSenderHardwareAddress ), ( void * ) ipLOCAL_MAC_ADDRESS, sizeof( xMACAddress_t ) );\r
+                                       pxARPHeader->ulSenderProtocolAddress = *ipLOCAL_IP_ADDRESS_POINTER;\r
+\r
+                                       eReturn = eReturnEthernetFrame;\r
+                               }\r
+                               break;\r
+\r
+                       case ipARP_REPLY :\r
+                               iptracePROCESSING_RECEIVED_ARP_REPLY( pxARPHeader->ulTargetProtocolAddress );\r
+                               prvRefreshARPCacheEntry( &( pxARPHeader->xSenderHardwareAddress ), pxARPHeader->ulSenderProtocolAddress );\r
+                               break;\r
+\r
+                       default :\r
+                               /* Invalid. */\r
+                               break;\r
+               }\r
+       }\r
+\r
+       return eReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+       uint16_t FreeRTOS_htons( uint16_t usIn )\r
+       {\r
+               return  ( ( usIn & ( uint16_t ) 0x00ff ) << ( uint16_t ) 8U ) |\r
+                               ( ( usIn & ( uint16_t ) 0xff00 ) >> ( uint16_t ) 8U );\r
+       }\r
+#endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+       uint32_t FreeRTOS_htonl( uint32_t ulIn )\r
+       {\r
+               return  ( ( ulIn & 0x000000ffUL ) << 24UL ) |\r
+                               ( ( ulIn & 0x0000ff00UL ) << 8UL  ) |\r
+                               ( ( ulIn & 0x00ff0000UL ) >> 8UL  ) |\r
+                               ( ( ulIn & 0xff000000UL ) >> 24UL );\r
+       }\r
+#endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( ipconfigFREERTOS_PLUS_NABTO == 1 )\r
+       static void prvStartNabtoTask( void )\r
+       {\r
+       static portBASE_TYPE xNabtoTaskStarted = pdFALSE;\r
+\r
+               if( xNabtoTaskStarted == pdFALSE )\r
+               {\r
+                       FreeRTOS_NabtoInit();\r
+                       xNabtoTaskStarted = pdTRUE;\r
+               }\r
+       }\r
+#endif /* ipconfigFREERTOS_PLUS_NABTO */\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/History.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/History.txt
new file mode 100644 (file)
index 0000000..c815fcb
--- /dev/null
@@ -0,0 +1,23 @@
+Changes between V1.0.0 and V1.0.0\r
+\r
+       + Add select() function.\r
+\r
+Changes between V1.0.0rc1 and V1.0.0:\r
+\r
+       + Correct name of prvCompleteUDPHeader().\r
+       + Ensure network down events cannot be missed when the network event queue \r
+         to which they are posted is full.\r
+       + Only start the ARP timer when the network has connected.\r
+       + Remove initialisation call to the DHCP state machine - the call is made \r
+         directly when the network connects.\r
+       + Add the network event queue and the BufferAllocation_2.c counting \r
+         semaphore to the queue registry.\r
+       + Only initialise the DMA buffers in the lpc18xx_emac.c driver if the \r
+         autonegotiation was successful.\r
+         \r
+       Known issues in this version:\r
+       \r
+       + DHCP server attempts to copy the IP addresses of all the offered DNS\r
+         servers into a buffer than can only hold one address.\r
+         \r
+         \r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/ReadMe.url b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/ReadMe.url
new file mode 100644 (file)
index 0000000..434898e
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/udp\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOSIPConfigDefaults.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOSIPConfigDefaults.h
new file mode 100644 (file)
index 0000000..bd93841
--- /dev/null
@@ -0,0 +1,138 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_DEFAULT_IP_CONFIG_H\r
+#define FREERTOS_DEFAULT_IP_CONFIG_H\r
+\r
+/* This file provides default values for configuration options that are missing\r
+from the FreeRTOSIPConfig.h configuration header file. */\r
+\r
+#ifndef ipconfigUSE_NETWORK_EVENT_HOOK\r
+       #define ipconfigUSE_NETWORK_EVENT_HOOK 0\r
+#endif\r
+\r
+#ifndef ipconfigMAX_SEND_BLOCK_TIME_TICKS\r
+       #define ipconfigMAX_SEND_BLOCK_TIME_TICKS ( 20 / portTICK_RATE_MS )\r
+#endif\r
+\r
+#ifndef ipconfigARP_CACHE_ENTRIES\r
+       #define ipconfigARP_CACHE_ENTRIES               10\r
+#endif\r
+\r
+#ifndef ipconfigMAX_ARP_RETRANSMISSIONS\r
+       #define ipconfigMAX_ARP_RETRANSMISSIONS ( 5 )\r
+#endif\r
+\r
+#ifndef ipconfigMAX_ARP_AGE\r
+       #define ipconfigMAX_ARP_AGE                     150\r
+#endif\r
+\r
+#ifndef ipconfigINCLUDE_FULL_INET_ADDR\r
+       #define ipconfigINCLUDE_FULL_INET_ADDR  1\r
+#endif\r
+\r
+#ifndef ipconfigNUM_NETWORK_BUFFERS\r
+       #define ipconfigNUM_NETWORK_BUFFERS             45\r
+#endif\r
+\r
+#ifndef ipconfigEVENT_QUEUE_LENGTH\r
+       #define ipconfigEVENT_QUEUE_LENGTH              ( ipconfigNUM_NETWORK_BUFFERS + 5 )\r
+#endif\r
+\r
+#ifndef ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND\r
+       #define ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND 1\r
+#endif\r
+\r
+#ifndef updconfigIP_TIME_TO_LIVE\r
+       #define updconfigIP_TIME_TO_LIVE                128\r
+#endif\r
+\r
+#ifndef ipconfigCAN_FRAGMENT_OUTGOING_PACKETS\r
+       #define ipconfigCAN_FRAGMENT_OUTGOING_PACKETS 0\r
+#endif\r
+\r
+#ifndef ipconfigNETWORK_MTU\r
+       #define ipconfigNETWORK_MTU 1500\r
+#endif\r
+\r
+#ifndef ipconfigUSE_DHCP\r
+       #define ipconfigUSE_DHCP        1\r
+#endif\r
+\r
+#ifndef ipconfigMAXIMUM_DISCOVER_TX_PERIOD\r
+       #ifdef _WINDOWS_\r
+               #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 999 / portTICK_RATE_MS )\r
+       #else\r
+               #define ipconfigMAXIMUM_DISCOVER_TX_PERIOD              ( 30000 / portTICK_RATE_MS )\r
+       #endif /* _WINDOWS_ */\r
+#endif /* ipconfigMAXIMUM_DISCOVER_TX_PERIOD */\r
+\r
+#ifndef ipconfigUSE_DNS\r
+       #define ipconfigUSE_DNS         1\r
+#endif\r
+\r
+#ifndef ipconfigREPLY_TO_INCOMING_PINGS\r
+       #define ipconfigREPLY_TO_INCOMING_PINGS                         1\r
+#endif\r
+\r
+#ifndef ipconfigSUPPORT_OUTGOING_PINGS\r
+       #define ipconfigSUPPORT_OUTGOING_PINGS                          0\r
+#endif\r
+\r
+#ifndef updconfigLOOPBACK_ETHERNET_PACKETS\r
+       #define updconfigLOOPBACK_ETHERNET_PACKETS      0\r
+#endif\r
+\r
+#ifndef ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES\r
+       #define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1\r
+#endif\r
+\r
+#ifndef ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES\r
+       #define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES     1\r
+#endif\r
+\r
+#ifndef configINCLUDE_TRACE_RELATED_CLI_COMMANDS\r
+       #define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS 0\r
+#else\r
+       #define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS configINCLUDE_TRACE_RELATED_CLI_COMMANDS\r
+#endif\r
+\r
+#ifndef ipconfigFREERTOS_PLUS_NABTO\r
+       #define ipconfigFREERTOS_PLUS_NABTO 0\r
+#endif\r
+\r
+#endif /* FREERTOS_DEFAULT_IP_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DHCP.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DHCP.h
new file mode 100644 (file)
index 0000000..102938d
--- /dev/null
@@ -0,0 +1,63 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_DHCP_H\r
+#define FREERTOS_DHCP_H\r
+\r
+/* Application level configuration options. */\r
+#include "FreeRTOSIPConfig.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+/*\r
+ * NOT A PUBLIC API FUNCTION.\r
+ */\r
+void vDHCPProcess( portBASE_TYPE xReset, xMACAddress_t *pxMACAddress, uint32_t *pulIPAddress, xNetworkAddressingParameters_t *pxNetworkAddressing );\r
+\r
+#endif /* FREERTOS_DHCP_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DNS.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_DNS.h
new file mode 100644 (file)
index 0000000..ca8ab7a
--- /dev/null
@@ -0,0 +1,65 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_DNS_H\r
+#define FREERTOS_DNS_H\r
+\r
+/* Application level configuration options. */\r
+#include "FreeRTOSIPConfig.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+/**\r
+ * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE\r
+ * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
+ */\r
+uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );\r
+\r
+#endif /* FREERTOS_DNS_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_IP_Private.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_IP_Private.h
new file mode 100644 (file)
index 0000000..31fb541
--- /dev/null
@@ -0,0 +1,344 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_IP_PRIVATE_H\r
+#define FREERTOS_IP_PRIVATE_H\r
+\r
+/* Application level configuration options. */\r
+#include "FreeRTOSIPConfig.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+typedef struct xNetworkAddressingParameters\r
+{\r
+       uint32_t ulDefaultIPAddress;\r
+       uint32_t ulNetMask;\r
+       uint32_t ulGatewayAddress;\r
+       uint32_t ulDNSServerAddress;\r
+} xNetworkAddressingParameters_t;\r
+\r
+\r
+/*-----------------------------------------------------------*/\r
+/* Protocol headers.                                         */\r
+/*-----------------------------------------------------------*/\r
+\r
+#include "pack_struct_start.h"\r
+struct xETH_HEADER\r
+{\r
+       xMACAddress_t xDestinationAddress;\r
+       xMACAddress_t xSourceAddress;\r
+       uint16_t usFrameType;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xETH_HEADER xEthernetHeader_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xARP_HEADER\r
+{\r
+       uint16_t usHardwareType;\r
+       uint16_t usProtocolType;\r
+       uint8_t ucHardwareAddressLength;\r
+       uint8_t ucProtocolAddressLength;\r
+       uint16_t usOperation;\r
+       xMACAddress_t xSenderHardwareAddress;\r
+       uint32_t ulSenderProtocolAddress;\r
+       xMACAddress_t xTargetHardwareAddress;\r
+       uint32_t ulTargetProtocolAddress;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xARP_HEADER xARPHeader_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xIP_HEADER\r
+{\r
+       uint8_t ucVersionHeaderLength;\r
+       uint8_t ucDifferentiatedServicesCode;\r
+       uint16_t usLength;\r
+       uint16_t usIdentification;\r
+       uint16_t usFragmentOffset;\r
+       uint8_t ucTimeToLive;\r
+       uint8_t ucProtocol;\r
+       uint16_t usHeaderChecksum;\r
+       uint32_t ulSourceIPAddress;\r
+       uint32_t ulDestinationIPAddress;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xIP_HEADER xIPHeader_t;\r
+#define ipSIZE_OF_IP_HEADER 20\r
+\r
+#include "pack_struct_start.h"\r
+struct xICMP_HEADER\r
+{\r
+       uint8_t ucTypeOfMessage;\r
+       uint8_t ucTypeOfService;\r
+       uint16_t usChecksum;\r
+       uint16_t usIdentifier;\r
+       uint16_t usSequenceNumber;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xICMP_HEADER xICMPHeader_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xUDP_HEADER\r
+{\r
+       uint16_t usSourcePort;\r
+       uint16_t usDestinationPort;\r
+       uint16_t usLength;\r
+       uint16_t usChecksum;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xUDP_HEADER xUDPHeader_t;\r
+#define ipSIZE_OF_UDP_HEADER 8\r
+\r
+#include "pack_struct_start.h"\r
+struct xPSEUDO_HEADER\r
+{\r
+       uint32_t ulSourceAddress;\r
+       uint32_t ulDestinationAddress;\r
+       uint8_t ucZeros;\r
+       uint8_t ucProtocol;\r
+       uint16_t usUDPLength;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xPSEUDO_HEADER xPseudoHeader_t;\r
+\r
+/*-----------------------------------------------------------*/\r
+/* Nested protocol packets.                                  */\r
+/*-----------------------------------------------------------*/\r
+\r
+#include "pack_struct_start.h"\r
+struct xARP_PACKET\r
+{\r
+       xEthernetHeader_t xEthernetHeader;\r
+       xARPHeader_t xARPHeader;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xARP_PACKET xARPPacket_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xIP_PACKET\r
+{\r
+       xEthernetHeader_t xEthernetHeader;\r
+       xIPHeader_t xIPHeader;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xIP_PACKET xIPPacket_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xICMP_PACKET\r
+{\r
+       xEthernetHeader_t xEthernetHeader;\r
+       xIPHeader_t xIPHeader;\r
+       xICMPHeader_t xICMPHeader;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xICMP_PACKET xICMPPacket_t;\r
+\r
+#include "pack_struct_start.h"\r
+struct xUDP_PACKET\r
+{\r
+       xEthernetHeader_t xEthernetHeader;\r
+       xIPHeader_t xIPHeader;\r
+       xUDPHeader_t xUDPHeader;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xUDP_PACKET xUDPPacket_t;\r
+\r
+/* Dimensions the buffers that are filled by received Ethernet frames. */\r
+#define ipETHERNET_CRC_BYTES                                   ( 4UL )\r
+#define ipETHERNET_OPTIONAL_802_1Q_TAG_BYTES   ( 4UL )\r
+#define ipTOTAL_ETHERNET_FRAME_SIZE                            ( ipconfigNETWORK_MTU + sizeof( xEthernetHeader_t ) + ipETHERNET_CRC_BYTES + ipETHERNET_OPTIONAL_802_1Q_TAG_BYTES )\r
+\r
+/* The maximum UDP payload length. */\r
+#define ipMAX_UDP_PAYLOAD_LENGTH ( ( ipconfigNETWORK_MTU - ipSIZE_OF_IP_HEADER ) - ipSIZE_OF_UDP_HEADER )\r
+\r
+typedef enum\r
+{\r
+       eReleaseBuffer = 0,             /* Processing the frame did not find anything to do - just release the buffer. */\r
+       eProcessBuffer,                 /* An Ethernet frame has a valid address - continue process its contents. */\r
+       eReturnEthernetFrame,   /* The Ethernet frame contains an ARP or ICMP packet that can be returned to its source. */\r
+       eFrameConsumed                  /* Processing the Ethernet packet contents resulted in the payload being sent to the stack. */\r
+} eFrameProcessingResult_t;\r
+\r
+typedef enum\r
+{\r
+       eNetworkDownEvent = 0,  /* The network interface has been lost and/or needs [re]connecting. */\r
+       eEthernetRxEvent,       /* The network interface has queued a received Ethernet frame. */\r
+       eARPTimerEvent,         /* The ARP timer expired. */\r
+       eStackTxEvent,          /* The software stack has queued a packet to transmit. */\r
+       eDHCPEvent                      /* Process the DHCP state machine. */\r
+} eIPEvent_t;\r
+\r
+typedef struct IP_TASK_COMMANDS\r
+{\r
+       eIPEvent_t eEventType;\r
+       void *pvData;\r
+} xIPStackEvent_t;\r
+\r
+#define ipBROADCAST_IP_ADDRESS 0xffffffffUL\r
+\r
+/* Offset into the Ethernet frame that is used to temporarily store information\r
+on the fragmentation status of the packet being sent.  The value is important,\r
+as it is past the location into which the destination address will get placed. */\r
+#define ipFRAGMENTATION_PARAMETERS_OFFSET              ( 6 )\r
+#define ipSOCKET_OPTIONS_OFFSET                                        ( 6 )\r
+\r
+/* Only used when outgoing fragmentation is being used (FreeRTOSIPConfig.h\r
+setting. */\r
+#define ipGET_UDP_PAYLOAD_OFFSET_FOR_FRAGMENT( usFragmentOffset ) ( ( ( usFragmentOffset ) == 0 ) ? ipUDP_PAYLOAD_OFFSET : ipIP_PAYLOAD_OFFSET )\r
+\r
+/* The offset into a UDP packet at which the UDP data (payload) starts. */\r
+#define ipUDP_PAYLOAD_OFFSET   ( sizeof( xUDPPacket_t ) )\r
+\r
+/* The offset into an IP packet into which the IP data (payload) starts. */\r
+#define ipIP_PAYLOAD_OFFSET            ( sizeof( xIPPacket_t ) )\r
+\r
+/* Space left at the beginning of a network buffer storage area to store a\r
+pointer back to the network buffer.  Should be a multiple of 8 to ensure\r
+8 byte alignment is maintained on architectures that require it. */\r
+#define ipBUFFER_PADDING               ( 8 )\r
+\r
+#include "pack_struct_start.h"\r
+struct xUDP_IP_FRACMENT_PARAMETERS\r
+{\r
+       uint8_t ucSocketOptions;\r
+       uint8_t ucPadFor16BitAlignment;\r
+       uint16_t usFragmentedPacketOffset;\r
+       uint16_t usFragmentLength;\r
+       uint16_t usPayloadChecksum;\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xUDP_IP_FRACMENT_PARAMETERS xIPFragmentParameters_t;\r
+\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+\r
+       /* Ethernet frame types. */\r
+       #define ipARP_TYPE      ( 0x0608U )\r
+       #define ipIP_TYPE       ( 0x0008U )\r
+\r
+       /* ARP related definitions. */\r
+       #define ipARP_PROTOCOL_TYPE ( 0x0008U )\r
+       #define ipARP_HARDWARE_TYPE_ETHERNET ( 0x0100U )\r
+       #define ipARP_REQUEST ( 0x0100 )\r
+       #define ipARP_REPLY ( 0x0200 )\r
+\r
+#else\r
+\r
+       /* Ethernet frame types. */\r
+       #define ipARP_TYPE      ( 0x0806U )\r
+       #define ipIP_TYPE       ( 0x0800U )\r
+\r
+       /* ARP related definitions. */\r
+       #define ipARP_PROTOCOL_TYPE ( 0x0800U )\r
+       #define ipARP_HARDWARE_TYPE_ETHERNET ( 0x0001U )\r
+       #define ipARP_REQUEST ( 0x0001 )\r
+       #define ipARP_REPLY ( 0x0002 )\r
+\r
+#endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */\r
+\r
+/* The structure used to store buffers and pass them around the network stack.\r
+Buffers can be in use by the stack, in use by the network interface hardware\r
+driver, or free (not in use). */\r
+typedef struct xNETWORK_BUFFER\r
+{\r
+       xListItem xBufferListItem;              /* Used to reference the buffer form the free buffer list or a socket. */\r
+       uint32_t ulIPAddress;                   /* Source or destination IP address, depending on usage scenario. */\r
+       uint8_t *pucEthernetBuffer;     /* Pointer to the start of the Ethernet frame. */\r
+       size_t xDataLength;                     /* Starts by holding the total Ethernet frame length, then the UDP payload length. */\r
+       uint16_t usPort;                                /* Source or destination port, depending on usage scenario. */\r
+       uint16_t usBoundPort;                   /* The port to which a transmitting socket is bound. */\r
+} xNetworkBufferDescriptor_t;\r
+\r
+void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+\r
+/*\r
+ * A version of FreeRTOS_GetReleaseNetworkBuffer() that can be called from an\r
+ * interrupt.  If a non zero value is returned, then the calling ISR should\r
+ * perform a context switch before exiting the ISR.\r
+ */\r
+portBASE_TYPE FreeRTOS_ReleaseFreeNetworkBufferFromISR( void );\r
+\r
+/*\r
+ * Create a message that contains a command to initialise the network interface.\r
+ * This is used during initialisation, and at any time the network interface\r
+ * goes down thereafter.  The network interface hardware driver is responsible\r
+ * for sending the message that contains the network interface down command/\r
+ * event.\r
+ *\r
+ * Only use the FreeRTOS_NetworkDownFromISR() version if the function is to be\r
+ * called from an interrupt service routine.  If FreeRTOS_NetworkDownFromISR()\r
+ * returns a non-zero value then a context switch should be performed ebfore\r
+ * the interrupt is exited.\r
+ */\r
+void FreeRTOS_NetworkDown( void );\r
+portBASE_TYPE FreeRTOS_NetworkDownFromISR( void );\r
+\r
+/*\r
+ * Inspect an Ethernet frame to see if it contains data that the stack needs to\r
+ * process.  eProcessBuffer is returned if the frame should be processed by the\r
+ * stack.  eReleaseBuffer is returned if the frame should be discarded.\r
+ */\r
+eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucEthernetBuffer );\r
+\r
+#if( ipconfigINCLUDE_TEST_CODE == 1 )\r
+       unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void );\r
+#endif /* ipconfigINCLUDE_TEST_CODE */\r
+\r
+/* Socket related private functions. */\r
+portBASE_TYPE xProcessReceivedUDPPacket( xNetworkBufferDescriptor_t *pxNetworkBuffer, uint16_t usPort );\r
+void FreeRTOS_SocketsInit( void );\r
+\r
+/* If FreeRTOS+NABTO is included then include the prototype of the function that\r
+creates the Nabto task. */\r
+#if( ipconfigFREERTOS_PLUS_NABTO == 1 )\r
+       void vStartNabtoTask( void );\r
+#endif\r
+\r
+\r
+#endif /* FREERTOS_IP_PRIVATE_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_Sockets.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_Sockets.h
new file mode 100644 (file)
index 0000000..c44f497
--- /dev/null
@@ -0,0 +1,173 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_UDP_H\r
+#define FREERTOS_UDP_H\r
+\r
+/* Standard includes. */\r
+#include <string.h>\r
+\r
+/* Application level configuration options. */\r
+#include "FreeRTOSIPConfig.h"\r
+\r
+#ifndef INC_FREERTOS_H\r
+       #error FreeRTOS.h must be included before FreeRTOS_Sockets.h.\r
+#endif\r
+\r
+#ifndef TASK_H\r
+       #error The FreeRTOS header file task.h must be included before FreeRTOS_Sockets.h.\r
+#endif\r
+\r
+/* Assigned to an xSocket_t variable when the socket is not valid, probably\r
+because it could not be created. */\r
+#define FREERTOS_INVALID_SOCKET        ( ( void * ) ~0U )\r
+\r
+/* API function error values.  As errno is supported, the FreeRTOS sockets\r
+functions return error codes rather than just a pass or fail indication. */\r
+#define FREERTOS_SOCKET_ERROR  ( -1 )\r
+#define FREERTOS_EWOULDBLOCK   ( -2 )\r
+#define FREERTOS_EINVAL                        ( -4 )\r
+#define FREERTOS_EADDRNOTAVAIL ( -5 )\r
+#define FREERTOS_EADDRINUSE            ( -6 )\r
+#define FREERTOS_ENOBUFS               ( -7 )\r
+#define FREERTOS_ENOPROTOOPT   ( -8 )\r
+\r
+/* Values for the parameters to FreeRTOS_socket(), inline with the Berkeley\r
+standard.  See the documentation of FreeRTOS_socket() for more information. */\r
+#define FREERTOS_AF_INET               ( 2 )\r
+#define FREERTOS_SOCK_DGRAM            ( 2 )\r
+#define FREERTOS_IPPROTO_UDP   ( 17 )\r
+\r
+/* A bit value that can be passed into the FreeRTOS_sendto() function as part of\r
+the flags parameter.  Setting the FREERTOS_ZERO_COPY in the flags parameter\r
+indicates that the zero copy interface is being used.  See the documentation for\r
+FreeRTOS_sockets() for more information. */\r
+#define FREERTOS_ZERO_COPY             ( 0x01UL )\r
+\r
+/* Values that can be passed in the option name parameter of calls to\r
+FreeRTOS_setsockopt(). */\r
+#define FREERTOS_SO_RCVTIMEO           ( 0 )           /* Used to set the receive time out. */\r
+#define FREERTOS_SO_SNDTIMEO           ( 1 )           /* Used to set the send time out. */\r
+#define FREERTOS_SO_UDPCKSUM_OUT       ( 0x02 )        /* Used to turn the use of the UDP checksum by a socket on or off.  This also doubles as part of an 8-bit bitwise socket option. */\r
+#define FREERTOS_NOT_LAST_IN_FRAGMENTED_PACKET         ( 0x80 )  /* For internal use only, but also part of an 8-bit bitwise value. */\r
+#define FREERTOS_FRAGMENTED_PACKET                             ( 0x40 )  /* For internal use only, but also part of an 8-bit bitwise value. */\r
+\r
+/* For compatibility with the expected Berkeley sockets naming. */\r
+#define socklen_t uint32_t\r
+\r
+/* For this limited implementation, only two members are required in the\r
+Berkeley style sockaddr structure. */\r
+struct freertos_sockaddr\r
+{\r
+       uint16_t sin_port;\r
+       uint32_t sin_addr;\r
+};\r
+\r
+#if ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN\r
+\r
+       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet3 ) ) << 24UL ) |                     \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) << 16UL ) |                     \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) <<  8UL ) |                     \\r
+                                                                               ( ( uint32_t ) ( ucOctet0 ) )\r
+\r
+       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \\r
+                                                                               sprintf( ( char * ) ( pucBuffer ), "%d.%d.%d.%d",       \\r
+                                                                                       ( ( ulIPAddress ) & 0xffUL ),                                   \\r
+                                                                                       ( ( ( ulIPAddress ) >> 8UL ) & 0xffUL ),                \\r
+                                                                                       ( ( ( ulIPAddress ) >> 16UL ) & 0xffUL ),               \\r
+                                                                                       ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ) )\r
+\r
+#else /* ipconfigBYTE_ORDER */\r
+\r
+       #define FreeRTOS_inet_addr_quick( ucOctet0, ucOctet1, ucOctet2, ucOctet3 )                              \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet0 ) ) << 24UL ) |                     \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet1 ) ) << 16UL ) |                     \\r
+                                                                               ( ( ( uint32_t ) ( ucOctet2 ) ) <<  8UL ) |                     \\r
+                                                                               ( ( uint32_t ) ( ucOctet3 ) )\r
+\r
+       #define FreeRTOS_inet_ntoa( ulIPAddress, pucBuffer )                                                                    \\r
+                                                                               sprintf( ( char * ) ( pucBuffer ), "%d.%d.%d.%d",       \\r
+                                                                                       ( ( ( ulIPAddress ) >> 24UL ) & 0xffUL ) ),             \\r
+                                                                                       ( ( ( ulIPAddress ) >> 16UL ) & 0xffUL ),               \\r
+                                                                                       ( ( ( ulIPAddress ) >> 8UL ) & 0xffUL ),                \\r
+                                                                                       ( ( ulIPAddress ) & 0xffUL )\r
+\r
+#endif /* ipconfigBYTE_ORDER */\r
+\r
+/* The socket type itself. */\r
+typedef void *xSocket_t;\r
+\r
+/* The xSocketSet_t type is the equivalent to the fd_set type used by the \r
+Berkeley API. */\r
+typedef void *xSocketSet_t;\r
+\r
+/**\r
+ * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE\r
+ * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
+ */\r
+xSocket_t FreeRTOS_socket( portBASE_TYPE xDomain, portBASE_TYPE xType, portBASE_TYPE xProtocol );\r
+int32_t FreeRTOS_recvfrom( xSocket_t xSocket, void *pvBuffer, size_t xBufferLength, uint32_t ulFlags, struct freertos_sockaddr *pxSourceAddress, socklen_t *pxSourceAddressLength );\r
+int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalDataLength, uint32_t ulFlags, const struct freertos_sockaddr *pxDestinationAddress, socklen_t xDestinationAddressLength );\r
+portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );\r
+portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );\r
+portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket );\r
+uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );\r
+uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress );\r
+\r
+#if ipconfigSUPPORT_SELECT_FUNCTION == 1\r
+       xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength );\r
+       portBASE_TYPE FreeRTOS_FD_SET( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
+       portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet );\r
+       xSocket_t FreeRTOS_select( xSocketSet_t xSocketSet, portTickType xBlockTimeTicks );\r
+#endif /* ipconfigSUPPORT_SELECT_FUNCTION */\r
+\r
+#endif /* FREERTOS_UDP_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_UDP_IP.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/FreeRTOS_UDP_IP.h
new file mode 100644 (file)
index 0000000..338126e
--- /dev/null
@@ -0,0 +1,118 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef FREERTOS_IP_H\r
+#define FREERTOS_IP_H\r
+\r
+/* Use in FreeRTOSIPConfig.h. */\r
+#define FREERTOS_LITTLE_ENDIAN 0\r
+#define FREERTOS_BIG_ENDIAN            1\r
+\r
+/* Application level configuration options. */\r
+#include "FreeRTOSIPConfig.h"\r
+#include "FreeRTOSIPConfigDefaults.h"\r
+#include "IPTraceMacroDefaults.h"\r
+\r
+/* The number of octets in the MAC and IP addresses respectively. */\r
+#define ipMAC_ADDRESS_LENGTH_BYTES ( 6 )\r
+#define ipIP_ADDRESS_LENGTH_BYTES ( 4 )\r
+\r
+#include "pack_struct_start.h"\r
+struct xMAC_ADDRESS\r
+{\r
+       uint8_t ucBytes[ ipMAC_ADDRESS_LENGTH_BYTES ];\r
+}\r
+#include "pack_struct_end.h"\r
+typedef struct xMAC_ADDRESS xMACAddress_t;\r
+\r
+typedef enum eNETWORK_EVENTS\r
+{\r
+       eNetworkUp,             /* The network is configured. */\r
+       eNetworkDown    /* The network connection has been lost. */\r
+} eIPCallbackEvent_t;\r
+\r
+typedef enum ePING_REPLY_STATUS\r
+{\r
+       eSuccess = 0,           /* A correct reply has been received for an outgoing ping. */\r
+       eInvalidChecksum,       /* A reply was received for an outgoing ping but the checksum of the reply was incorrect. */\r
+       eInvalidData            /* A reply was received to an outgoing ping but the payload of the reply was not correct. */\r
+} ePingReplyStatus_t;\r
+\r
+/* Endian related definitions. */\r
+#if( ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN )\r
+\r
+       uint16_t FreeRTOS_htons( uint16_t usIn );\r
+       uint32_t FreeRTOS_htonl( uint32_t ulIn );\r
+\r
+#else\r
+\r
+       #define FreeRTOS_htons( x ) ( x )\r
+       #define FreeRTOS_htonl( x ) ( x )\r
+\r
+#endif /* ipconfigBYTE_ORDER == FREERTOS_LITTLE_ENDIAN */\r
+\r
+#define FreeRTOS_ntohs( x ) FreeRTOS_htons( x )\r
+#define FreeRTOS_ntohl( x ) FreeRTOS_htonl( x )\r
+\r
+/**\r
+ * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE\r
+ * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml\r
+ */\r
+portBASE_TYPE FreeRTOS_IPInit( const uint8_t ucIPAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucNetMask[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucGatewayAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucDNSServerAddress[ ipIP_ADDRESS_LENGTH_BYTES ], const uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ] );\r
+void * FreeRTOS_GetUDPPayloadBuffer( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks );\r
+void FreeRTOS_GetAddressConfiguration( uint32_t *pulIPAddress, uint32_t *pulNetMask, uint32_t *pulGatewayAddress, uint32_t *pulDNSServerAddress );\r
+portBASE_TYPE FreeRTOS_SendPingRequest( uint32_t ulIPAddress, size_t xNumberOfBytesToSend, portTickType xBlockTimeTicks );\r
+void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent );\r
+void vApplicationPingReplyHook( ePingReplyStatus_t eStatus, uint16_t usIdentifier );\r
+void FreeRTOS_ReleaseUDPPayloadBuffer( void *pvBuffer );\r
+uint8_t * FreeRTOS_GetMACAddress( void );\r
+\r
+#endif /* FREERTOS_IP_H */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/IPTraceMacroDefaults.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/IPTraceMacroDefaults.h
new file mode 100644 (file)
index 0000000..0592290
--- /dev/null
@@ -0,0 +1,172 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* This file provides default (empty) implementations for any IP trace macros\r
+that are not defined by the user.  See\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml */\r
+\r
+#ifndef UDP_TRACE_MACRO_DEFAULTS_H\r
+#define UDP_TRACE_MACRO_DEFAULTS_H\r
+\r
+#ifndef iptraceNETWORK_DOWN\r
+       #define iptraceNETWORK_DOWN()\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_BUFFER_RELEASED\r
+       #define iptraceNETWORK_BUFFER_RELEASED( pxBufferAddress )\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_BUFFER_OBTAINED\r
+       #define iptraceNETWORK_BUFFER_OBTAINED( pxBufferAddress )\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR\r
+       #define iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR( pxBufferAddress )\r
+#endif\r
+\r
+#ifndef iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER\r
+       #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER()\r
+#endif\r
+\r
+#ifndef iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER_FROM_ISR\r
+       #define iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER_FROM_ISR()\r
+#endif\r
+\r
+#ifndef iptraceCREATING_ARP_REQUEST\r
+       #define iptraceCREATING_ARP_REQUEST( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceARP_TABLE_ENTRY_WILL_EXPIRE\r
+       #define iptraceARP_TABLE_ENTRY_WILL_EXPIRE( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceARP_TABLE_ENTRY_EXPIRED\r
+       #define iptraceARP_TABLE_ENTRY_EXPIRED( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceARP_TABLE_ENTRY_CREATED\r
+       #define iptraceARP_TABLE_ENTRY_CREATED( ulIPAddress, ucMACAddress )\r
+#endif\r
+\r
+#ifndef iptraceSENDING_UDP_PACKET\r
+       #define iptraceSENDING_UDP_PACKET( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptracePACKET_DROPPED_TO_GENERATE_ARP\r
+       #define iptracePACKET_DROPPED_TO_GENERATE_ARP( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceICMP_PACKET_RECEIVED\r
+       #define iptraceICMP_PACKET_RECEIVED()\r
+#endif\r
+\r
+#ifndef iptraceSENDING_PING_REPLY\r
+       #define iptraceSENDING_PING_REPLY( ulIPAddress )\r
+#endif\r
+\r
+#ifndef traceARP_PACKET_RECEIVED\r
+       #define traceARP_PACKET_RECEIVED()\r
+#endif\r
+\r
+#ifndef iptracePROCESSING_RECEIVED_ARP_REPLY\r
+       #define iptracePROCESSING_RECEIVED_ARP_REPLY( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceSENDING_ARP_REPLY\r
+       #define iptraceSENDING_ARP_REPLY( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceFAILED_TO_CREATE_SOCKET\r
+       #define iptraceFAILED_TO_CREATE_SOCKET()\r
+#endif\r
+\r
+#ifndef iptraceRECVFROM_DISCARDING_BYTES\r
+       #define iptraceRECVFROM_DISCARDING_BYTES( xNumberOfBytesDiscarded )\r
+#endif\r
+\r
+#ifndef iptraceETHERNET_RX_EVENT_LOST\r
+       #define iptraceETHERNET_RX_EVENT_LOST()\r
+#endif\r
+\r
+#ifndef iptraceSTACK_TX_EVENT_LOST\r
+       #define iptraceSTACK_TX_EVENT_LOST( xEvent )\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_EVENT_RECEIVED\r
+       #define iptraceNETWORK_EVENT_RECEIVED( eEvent )\r
+#endif\r
+\r
+#ifndef iptraceBIND_FAILED\r
+       #define iptraceBIND_FAILED( xSocket, usPort )\r
+#endif\r
+\r
+#ifndef iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS\r
+       #define iptraceDHCP_REQUESTS_FAILED_USING_DEFAULT_IP_ADDRESS( ulIPAddress )\r
+#endif\r
+\r
+#ifndef iptraceSENDING_DHCP_DISCOVER\r
+       #define iptraceSENDING_DHCP_DISCOVER()\r
+#endif\r
+\r
+#ifndef iptraceSENDING_DHCP_REQUEST\r
+       #define iptraceSENDING_DHCP_REQUEST()\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_INTERFACE_TRANSMIT\r
+       #define iptraceNETWORK_INTERFACE_TRANSMIT()\r
+#endif\r
+\r
+#ifndef iptraceNETWORK_INTERFACE_RECEIVE\r
+       #define iptraceNETWORK_INTERFACE_RECEIVE()\r
+#endif\r
+\r
+#ifndef iptraceSENDING_DNS_REQUEST\r
+       #define iptraceSENDING_DNS_REQUEST()\r
+#endif\r
+\r
+#ifndef        iptraceWAITING_FOR_TX_DMA_DESCRIPTOR\r
+       #define iptraceWAITING_FOR_TX_DMA_DESCRIPTOR\r
+#endif\r
+\r
+#ifndef ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS\r
+       #define ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS 0\r
+#endif\r
+\r
+#ifndef iptraceFAILED_TO_NOTIFY_SELECT_GROUP\r
+       #define iptraceFAILED_TO_NOTIFY_SELECT_GROUP( xSocket )\r
+#endif\r
+#endif /* UDP_TRACE_MACRO_DEFAULTS_H */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkBufferManagement.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkBufferManagement.h
new file mode 100644 (file)
index 0000000..d142d64
--- /dev/null
@@ -0,0 +1,50 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef NETWORK_BUFFER_MANAGEMENT_H\r
+#define NETWORK_BUFFER_MANAGEMENT_H\r
+\r
+/* NOTE PUBLIC API FUNCTIONS. */\r
+portBASE_TYPE xNetworkBuffersInitialise( void );\r
+xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks );\r
+xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );\r
+void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+portBASE_TYPE vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+uint8_t *pucEthernetBufferGet( size_t *pxRequestedSizeBytes );\r
+void vEthernetBufferRelease( uint8_t *pucEthernetBuffer );\r
+\r
+#endif /* NETWORK_BUFFER_MANAGEMENT_H */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkInterface.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkInterface.h
new file mode 100644 (file)
index 0000000..6e61287
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+#ifndef NETWORK_INTERFACE_H\r
+#define NETWORK_INTERFACE_H\r
+\r
+/* NOTE PUBLIC API FUNCTIONS. */\r
+portBASE_TYPE xNetworkInterfaceInitialise( void );\r
+portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+void vNetworkInterfaceAllocateRAMToBuffers( xNetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ] );\r
+\r
+#endif /* NETWORK_INTERFACE_H */\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_1.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_1.c
new file mode 100644 (file)
index 0000000..f7ea428
--- /dev/null
@@ -0,0 +1,242 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+\r
+/******************************************************************************\r
+ *\r
+ * See the following web page for essential buffer allocation scheme usage and\r
+ * configuration details:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Buffer_Management.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "NetworkInterface.h"\r
+\r
+/* For an Ethernet interrupt to be able to obtain a network buffer there must\r
+be at least this number of buffers available. */\r
+#define ipINTERRUPT_BUFFER_GET_THRESHOLD       ( 3 )\r
+\r
+/* A list of free (available) xNetworkBufferDescriptor_t structures. */\r
+static xList xFreeBuffersList;\r
+\r
+/* Declares the pool of xNetworkBufferDescriptor_t structures that are available to the\r
+system.  All the network buffers referenced from xFreeBuffersList exist in this\r
+array.  The array is not accessed directly except during initialisation, when\r
+the xFreeBuffersList is filled (as all the buffers are free when the system is\r
+booted). */\r
+static xNetworkBufferDescriptor_t xNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ];\r
+\r
+/* The semaphore used to obtain network buffers. */\r
+static xSemaphoreHandle xNetworkBufferSemaphore = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkBuffersInitialise( void )\r
+{\r
+portBASE_TYPE xReturn, x;\r
+\r
+       /* Only initialise the buffers and their associated kernel objects if they\r
+       have not been initialised before. */\r
+       if( xNetworkBufferSemaphore == NULL )\r
+       {\r
+               xNetworkBufferSemaphore = xSemaphoreCreateCounting( ipconfigNUM_NETWORK_BUFFERS, ipconfigNUM_NETWORK_BUFFERS );\r
+               configASSERT( xNetworkBufferSemaphore );\r
+\r
+               if( xNetworkBufferSemaphore != NULL )\r
+               {\r
+                       vListInitialise( &xFreeBuffersList );\r
+\r
+                       /* Initialise all the network buffers.  The buffer storage comes\r
+                       from the network interface, and different hardware has different\r
+                       requirements. */\r
+                       vNetworkInterfaceAllocateRAMToBuffers( xNetworkBuffers );\r
+                       for( x = 0; x < ipconfigNUM_NETWORK_BUFFERS; x++ )\r
+                       {\r
+                               /* Initialise and set the owner of the buffer list items. */\r
+                               vListInitialiseItem( &( xNetworkBuffers[ x ].xBufferListItem ) );\r
+                               listSET_LIST_ITEM_OWNER( &( xNetworkBuffers[ x ].xBufferListItem ), &xNetworkBuffers[ x ] );\r
+\r
+                               /* Currently, all buffers are available for use. */\r
+                               vListInsert( &xFreeBuffersList, &( xNetworkBuffers[ x ].xBufferListItem ) );\r
+                       }\r
+               }\r
+       }\r
+\r
+       if( xNetworkBufferSemaphore == NULL )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdPASS;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks )\r
+{\r
+xNetworkBufferDescriptor_t *pxReturn = NULL;\r
+\r
+       /*_RB_ The current implementation only has a single size memory block, so\r
+       the requested size parameter is not used (yet). */\r
+       ( void ) xRequestedSizeBytes;\r
+\r
+       /* If there is a semaphore available, there is a network buffer available. */\r
+       if( xSemaphoreTake( xNetworkBufferSemaphore, xBlockTimeTicks ) == pdPASS )\r
+       {\r
+               /* Protect the structure as it is accessed from tasks and interrupts. */\r
+               taskENTER_CRITICAL();\r
+               {\r
+                       pxReturn = ( xNetworkBufferDescriptor_t * ) listGET_OWNER_OF_HEAD_ENTRY( &xFreeBuffersList );\r
+                       uxListRemove( &( pxReturn->xBufferListItem ) );\r
+               }\r
+               taskEXIT_CRITICAL();\r
+               iptraceNETWORK_BUFFER_OBTAINED( pxReturn );\r
+       }\r
+       else\r
+       {\r
+               iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER();\r
+       }\r
+\r
+       return pxReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes )\r
+{\r
+xNetworkBufferDescriptor_t *pxReturn = NULL;\r
+unsigned portBASE_TYPE uxSavedInterruptStatus;\r
+\r
+       /*_RB_ The current implementation only has a single size memory block, so\r
+       the requested size parameter is not used (yet). */\r
+       ( void ) xRequestedSizeBytes;\r
+\r
+       /* If there is a semaphore available then there is a buffer available, but,\r
+       as this is called from an interrupt, only take a buffer if there are at\r
+       least ipINTERRUPT_BUFFER_GET_THRESHOLD buffers remaining.  This prevents,\r
+       to a certain degree at least, a rapidly executing interrupt exhausting\r
+       buffer and in so doing preventing tasks from continuing. */\r
+       if( uxQueueMessagesWaitingFromISR( ( xQueueHandle ) xNetworkBufferSemaphore ) > ipINTERRUPT_BUFFER_GET_THRESHOLD )\r
+       {\r
+               if( xSemaphoreTakeFromISR( xNetworkBufferSemaphore, NULL ) == pdPASS )\r
+               {\r
+                       /* Protect the structure as it is accessed from tasks and interrupts. */\r
+                       uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
+                       {\r
+                               pxReturn = ( xNetworkBufferDescriptor_t * ) listGET_OWNER_OF_HEAD_ENTRY( &xFreeBuffersList );\r
+                               uxListRemove( &( pxReturn->xBufferListItem ) );\r
+                       }\r
+                       portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
+\r
+                       iptraceNETWORK_BUFFER_OBTAINED_FROM_ISR( pxReturn );\r
+               }\r
+       }\r
+\r
+       if( pxReturn == NULL )\r
+       {\r
+               iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER_FROM_ISR();\r
+       }\r
+\r
+       return pxReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+unsigned portBASE_TYPE uxSavedInterruptStatus;\r
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
+\r
+       /* Ensure the buffer is returned to the list of free buffers before the\r
+       counting semaphore is 'given' to say a buffer is available. */\r
+       uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
+       {\r
+               vListInsertEnd( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );\r
+       }\r
+       portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
+\r
+       xSemaphoreGiveFromISR( xNetworkBufferSemaphore, &xHigherPriorityTaskWoken );\r
+       iptraceNETWORK_BUFFER_RELEASED( pxNetworkBuffer );\r
+\r
+       return xHigherPriorityTaskWoken;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+portBASE_TYPE xListItemAlreadyInFreeList;\r
+\r
+       /* Ensure the buffer is returned to the list of free buffers before the\r
+       counting semaphore is 'given' to say a buffer is available. */\r
+       taskENTER_CRITICAL();\r
+       {\r
+               xListItemAlreadyInFreeList = listIS_CONTAINED_WITHIN( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );\r
+\r
+               if( xListItemAlreadyInFreeList == pdFALSE )\r
+               {\r
+                       vListInsertEnd( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );\r
+               }\r
+\r
+               configASSERT( xListItemAlreadyInFreeList == pdFALSE );\r
+       }\r
+       taskEXIT_CRITICAL();\r
+\r
+       xSemaphoreGive( xNetworkBufferSemaphore );\r
+       iptraceNETWORK_BUFFER_RELEASED( pxNetworkBuffer );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( ipconfigINCLUDE_TEST_CODE == 1 )\r
+\r
+unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void )\r
+{\r
+       return listCURRENT_LIST_LENGTH( &xFreeBuffersList );\r
+}\r
+\r
+#endif /* ipconfigINCLUDE_TEST_CODE */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_2.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_2.c
new file mode 100644 (file)
index 0000000..ade0803
--- /dev/null
@@ -0,0 +1,280 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/******************************************************************************\r
+ *\r
+ * See the following web page for essential buffer allocation scheme usage and \r
+ * configuration details:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Buffer_Management.shtml\r
+ *\r
+ ******************************************************************************/\r
+\r
+/* THIS FILE SHOULD NOT BE USED IF THE PROJECT INCLUDES A MEMORY ALLOCATOR\r
+THAT WILL FRAGMENT THE HEAP MEMORY.  For example, heap_2 must not be used,\r
+heap_4 can be used. */\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "NetworkInterface.h"\r
+\r
+/* For an Ethernet interrupt to be able to obtain a network buffer there must\r
+be at least this number of buffers available. */\r
+#define ipINTERRUPT_BUFFER_GET_THRESHOLD       ( 3 )\r
+\r
+/* A list of free (available) xNetworkBufferDescriptor_t structures. */\r
+static xList xFreeBuffersList;\r
+\r
+/* Declares the pool of xNetworkBufferDescriptor_t structures that are available to the\r
+system.  All the network buffers referenced from xFreeBuffersList exist in this\r
+array.  The array is not accessed directly except during initialisation, when\r
+the xFreeBuffersList is filled (as all the buffers are free when the system is\r
+booted). */\r
+static xNetworkBufferDescriptor_t xNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ];\r
+\r
+/* The semaphore used to obtain network buffers. */\r
+static xSemaphoreHandle xNetworkBufferSemaphore = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkBuffersInitialise( void )\r
+{\r
+portBASE_TYPE xReturn, x;\r
+\r
+       /* Only initialise the buffers and their associated kernel objects if they\r
+       have not been initialised before. */\r
+       if( xNetworkBufferSemaphore == NULL )\r
+       {\r
+               xNetworkBufferSemaphore = xSemaphoreCreateCounting( ipconfigNUM_NETWORK_BUFFERS, ipconfigNUM_NETWORK_BUFFERS );\r
+               configASSERT( xNetworkBufferSemaphore );\r
+               vQueueAddToRegistry( xNetworkBufferSemaphore, ( signed char * ) "NetBufSem" );\r
+\r
+               /* If the trace recorder code is included name the semaphore for viewing\r
+               in FreeRTOS+Trace.  */\r
+               #if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1\r
+               {\r
+                       extern xQueueHandle xNetworkEventQueue;\r
+                       vTraceSetQueueName( xNetworkEventQueue, "IPStackEvent" );\r
+                       vTraceSetQueueName( xNetworkBufferSemaphore, "NetworkBufferCount" );\r
+               }\r
+               #endif /*  ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */\r
+\r
+               if( xNetworkBufferSemaphore != NULL )\r
+               {\r
+                       vListInitialise( &xFreeBuffersList );\r
+\r
+                       /* Initialise all the network buffers.  No storage is allocated to\r
+                       the buffers yet. */\r
+                       for( x = 0; x < ipconfigNUM_NETWORK_BUFFERS; x++ )\r
+                       {\r
+                               /* Initialise and set the owner of the buffer list items. */\r
+                               xNetworkBuffers[ x ].pucEthernetBuffer = NULL;\r
+                               vListInitialiseItem( &( xNetworkBuffers[ x ].xBufferListItem ) );\r
+                               listSET_LIST_ITEM_OWNER( &( xNetworkBuffers[ x ].xBufferListItem ), &xNetworkBuffers[ x ] );\r
+\r
+                               /* Currently, all buffers are available for use. */\r
+                               vListInsert( &xFreeBuffersList, &( xNetworkBuffers[ x ].xBufferListItem ) );\r
+                       }\r
+               }\r
+       }\r
+\r
+       if( xNetworkBufferSemaphore == NULL )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdPASS;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+uint8_t *pucEthernetBufferGet( size_t *pxRequestedSizeBytes )\r
+{\r
+uint8_t *pucEthernetBuffer;\r
+\r
+       if( *pxRequestedSizeBytes < sizeof( xARPPacket_t ) )\r
+       {\r
+               /* Buffers must be at least large enough to hold ARP packets, otherwise\r
+               nothing can be done. */\r
+               *pxRequestedSizeBytes = sizeof( xARPPacket_t );\r
+       }\r
+\r
+       /* Allocate a buffer large enough to store the requested Ethernet frame size\r
+       and a pointer to a network buffer structure (hence the addition of\r
+       ipBUFFER_PADDING bytes). */\r
+       pucEthernetBuffer = ( uint8_t * ) pvPortMalloc( *pxRequestedSizeBytes + ipBUFFER_PADDING );\r
+\r
+       /* Enough space is left at the start of the buffer to place a pointer to\r
+       the network buffer structure that references this Ethernet buffer.  Return\r
+       a pointer to the start of the Ethernet buffer itself. */\r
+       pucEthernetBuffer += ipBUFFER_PADDING;\r
+\r
+       return pucEthernetBuffer;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vEthernetBufferRelease( uint8_t *pucEthernetBuffer )\r
+{\r
+       /* There is space before the Ethernet buffer in which a pointer to the\r
+       network buffer that references this Ethernet buffer is stored.  Remove the\r
+       space before freeing the buffer. */\r
+       if( pucEthernetBuffer != NULL )\r
+       {\r
+               pucEthernetBuffer -= ipBUFFER_PADDING;\r
+               vPortFree( ( void * ) pucEthernetBuffer );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks )\r
+{\r
+xNetworkBufferDescriptor_t *pxReturn = NULL;\r
+\r
+       if( ( xRequestedSizeBytes != 0 ) && ( xRequestedSizeBytes < sizeof( xARPPacket_t ) ) )\r
+       {\r
+               /* ARP packets can replace application packets, so the storage must be\r
+               at least large enough to hold an ARP. */\r
+               xRequestedSizeBytes = sizeof( xARPPacket_t );\r
+       }\r
+\r
+       /* If there is a semaphore available, there is a network buffer available. */\r
+       if( xSemaphoreTake( xNetworkBufferSemaphore, xBlockTimeTicks ) == pdPASS )\r
+       {\r
+               /* Protect the structure as it is accessed from tasks and interrupts. */\r
+               taskENTER_CRITICAL();\r
+               {\r
+                       pxReturn = ( xNetworkBufferDescriptor_t * ) listGET_OWNER_OF_HEAD_ENTRY( &xFreeBuffersList );\r
+                       uxListRemove( &( pxReturn->xBufferListItem ) );\r
+               }\r
+               taskEXIT_CRITICAL();\r
+\r
+               /* Allocate storage of exactly the requested size to the buffer. */\r
+               configASSERT( pxReturn->pucEthernetBuffer == NULL );\r
+               if( xRequestedSizeBytes > 0 )\r
+               {\r
+                       /* Extra space is obtained so a pointer to the network buffer can\r
+                       be stored at the beginning of the buffer. */\r
+                       pxReturn->pucEthernetBuffer = ( uint8_t * ) pvPortMalloc( xRequestedSizeBytes + ipBUFFER_PADDING );\r
+\r
+                       if( pxReturn->pucEthernetBuffer == NULL )\r
+                       {\r
+                               /* The attempt to allocate storage for the buffer payload failed,\r
+                               so the network buffer structure cannot be used and must be\r
+                               released. */\r
+                               vNetworkBufferRelease( pxReturn );\r
+                               pxReturn = NULL;\r
+                       }\r
+                       else\r
+                       {\r
+                               /* Store a pointer to the network buffer structure in the\r
+                               buffer storage area, then move the buffer pointer on past the\r
+                               stored pointer so the pointer value is not overwritten by the\r
+                               application when the buffer is used. */\r
+                               *( ( xNetworkBufferDescriptor_t ** ) ( pxReturn->pucEthernetBuffer ) ) = pxReturn;\r
+                               pxReturn->pucEthernetBuffer += ipBUFFER_PADDING;\r
+                               iptraceNETWORK_BUFFER_OBTAINED( pxReturn );\r
+\r
+                               /* Store the actual size of the allocated buffer, which may be\r
+                               greater than the requested size. */\r
+                               pxReturn->xDataLength = xRequestedSizeBytes;\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       iptraceNETWORK_BUFFER_OBTAINED( pxReturn );\r
+               }\r
+       }\r
+\r
+       if( pxReturn == NULL )\r
+       {\r
+               iptraceFAILED_TO_OBTAIN_NETWORK_BUFFER();\r
+       }\r
+\r
+       return pxReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+portBASE_TYPE xListItemAlreadyInFreeList;\r
+\r
+       /* Ensure the buffer is returned to the list of free buffers before the\r
+       counting semaphore is 'given' to say a buffer is available.  Release the\r
+       storage allocated to the buffer payload.  THIS FILE SHOULD NOT BE USED\r
+       IF THE PROJECT INCLUDES A MEMORY ALLOCATOR THAT WILL FRAGMENT THE HEAP\r
+       MEMORY.  For example, heap_2 must not be used, heap_4 can be used. */\r
+       vEthernetBufferRelease( pxNetworkBuffer->pucEthernetBuffer );\r
+       pxNetworkBuffer->pucEthernetBuffer = NULL;\r
+\r
+       taskENTER_CRITICAL();\r
+       {\r
+               xListItemAlreadyInFreeList = listIS_CONTAINED_WITHIN( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );\r
+\r
+               if( xListItemAlreadyInFreeList == pdFALSE )\r
+               {\r
+                       vListInsertEnd( &xFreeBuffersList, &( pxNetworkBuffer->xBufferListItem ) );\r
+               }\r
+\r
+               configASSERT( xListItemAlreadyInFreeList == pdFALSE );\r
+       }\r
+       taskEXIT_CRITICAL();\r
+\r
+       xSemaphoreGive( xNetworkBufferSemaphore );\r
+       iptraceNETWORK_BUFFER_RELEASED( pxNetworkBuffer );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( ipconfigINCLUDE_TEST_CODE == 1 )\r
+\r
+unsigned portBASE_TYPE uxGetNumberOfFreeNetworkBuffers( void )\r
+{\r
+       return listCURRENT_LIST_LENGTH( &xFreeBuffersList );\r
+}\r
+\r
+#endif /* ipconfigINCLUDE_TEST_CODE */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_end.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_end.h
new file mode 100644 (file)
index 0000000..2c9111e
--- /dev/null
@@ -0,0 +1,58 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
+__attribute__( (packed) );\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_start.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/GCC/pack_struct_start.h
new file mode 100644 (file)
index 0000000..faadb75
--- /dev/null
@@ -0,0 +1,60 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+/* Nothing to do here. */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_end.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_end.h
new file mode 100644 (file)
index 0000000..ad11422
--- /dev/null
@@ -0,0 +1,60 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+;\r
+#pragma pack( pop )\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_start.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/MSVC/pack_struct_start.h
new file mode 100644 (file)
index 0000000..b4f8474
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+#pragma pack( push, 1 )\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_end.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_end.h
new file mode 100644 (file)
index 0000000..a644079
--- /dev/null
@@ -0,0 +1,66 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
+\r
+\r
+#ifdef _SH\r
+       #ifdef __RENESAS__\r
+               ;\r
+               #pragma unpack\r
+       #endif\r
+#endif\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_start.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/Compiler/Renesas/pack_struct_start.h
new file mode 100644 (file)
index 0000000..b67205e
--- /dev/null
@@ -0,0 +1,65 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/*****************************************************************************\r
+ *\r
+ * See the following URL for an exaplanation of this file:\r
+ * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Compiler_Porting.shtml\r
+ *\r
+ *****************************************************************************/\r
\r
+\r
+#ifdef _SH\r
+       #ifdef __RENESAS__\r
+               #pragma pack 1\r
+       #endif\r
+#endif\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC17xx/NetworkInterface.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC17xx/NetworkInterface.c
new file mode 100644 (file)
index 0000000..384fb47
--- /dev/null
@@ -0,0 +1,277 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* Hardware abstraction. */\r
+#include "FreeRTOS_IO.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Driver includes. */\r
+#include "lpc17xx_emac.h"\r
+#include "lpc17xx_pinsel.h"\r
+\r
+/* Demo includes. */\r
+#include "NetworkInterface.h"\r
+\r
+#if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES != 1\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eProcessBuffer\r
+#else\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eConsiderFrameForProcessing( ( pucEthernetBuffer ) )\r
+#endif\r
+\r
+/* When a packet is ready to be sent, if it cannot be sent immediately then the\r
+task performing the transmit will block for niTX_BUFFER_FREE_WAIT\r
+milliseconds.  It will do this a maximum of niMAX_TX_ATTEMPTS before giving\r
+up. */\r
+#define niTX_BUFFER_FREE_WAIT  ( ( portTickType ) 2UL / portTICK_RATE_MS )\r
+#define niMAX_TX_ATTEMPTS              ( 5 )\r
+\r
+/* The length of the queue used to send interrupt status words from the\r
+interrupt handler to the deferred handler task. */\r
+#define niINTERRUPT_QUEUE_LENGTH       ( 10 )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * A deferred interrupt handler task that processes\r
+ */\r
+static void prvEMACHandlerTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue used to communicate Ethernet events with the IP task. */\r
+extern xQueueHandle xNetworkEventQueue;\r
+\r
+/* The semaphore used to wake the deferred interrupt handler task when an Rx\r
+interrupt is received. */\r
+static xSemaphoreHandle xEMACRxEventSemaphore = NULL;\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceInitialise( void )\r
+{\r
+EMAC_CFG_Type Emac_Config;\r
+PINSEL_CFG_Type xPinConfig;\r
+portBASE_TYPE xStatus, xReturn;\r
+extern uint8_t ucMACAddress[ 6 ];\r
+\r
+       /* Enable Ethernet Pins */\r
+       boardCONFIGURE_ENET_PINS( xPinConfig );\r
+\r
+       Emac_Config.Mode = EMAC_MODE_AUTO;\r
+       Emac_Config.pbEMAC_Addr = ucMACAddress;\r
+       xStatus = EMAC_Init( &Emac_Config );\r
+\r
+       LPC_EMAC->IntEnable &= ~( EMAC_INT_TX_DONE );\r
+\r
+       if( xStatus != ERROR )\r
+       {\r
+               vSemaphoreCreateBinary( xEMACRxEventSemaphore );\r
+               configASSERT( xEMACRxEventSemaphore );\r
+\r
+               /* The handler task is created at the highest possible priority to\r
+               ensure the interrupt handler can return directly to it. */\r
+               xTaskCreate( prvEMACHandlerTask, ( const signed char * const ) "EMAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+\r
+               /* Enable the interrupt and set its priority to the minimum\r
+               interrupt priority.  */\r
+               NVIC_SetPriority( ENET_IRQn, configMAC_INTERRUPT_PRIORITY );\r
+               NVIC_EnableIRQ( ENET_IRQn );\r
+\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       configASSERT( xStatus != ERROR );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+portBASE_TYPE xReturn = pdFAIL;\r
+int32_t x;\r
+extern void EMAC_StartTransmitNextBuffer( uint32_t ulLength );\r
+extern void EMAC_SetNextPacketToSend( uint8_t * pucBuffer );\r
+\r
+\r
+       /* Attempt to obtain access to a Tx buffer. */\r
+       for( x = 0; x < niMAX_TX_ATTEMPTS; x++ )\r
+       {\r
+               if( EMAC_CheckTransmitIndex() == TRUE )\r
+               {\r
+                       /* Will the data fit in the Tx buffer? */\r
+                       if( pxNetworkBuffer->xDataLength < EMAC_ETH_MAX_FLEN ) /*_RB_ The size needs to come from FreeRTOSIPConfig.h. */\r
+                       {\r
+                               /* Assign the buffer to the Tx descriptor that is now known to\r
+                               be free. */\r
+                               EMAC_SetNextPacketToSend( pxNetworkBuffer->pucBuffer );\r
+\r
+                               /* The EMAC now owns the buffer. */\r
+                               pxNetworkBuffer->pucBuffer = NULL;\r
+\r
+                               /* Initiate the Tx. */\r
+                               EMAC_StartTransmitNextBuffer( pxNetworkBuffer->xDataLength );\r
+                               iptraceNETWORK_INTERFACE_TRANSMIT();\r
+\r
+                               /* The Tx has been initiated. */\r
+                               xReturn = pdPASS;\r
+                       }\r
+                       break;\r
+               }\r
+               else\r
+               {\r
+                       vTaskDelay( niTX_BUFFER_FREE_WAIT );\r
+               }\r
+       }\r
+\r
+       /* Finished with the network buffer. */\r
+       vNetworkBufferRelease( pxNetworkBuffer );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void ENET_IRQHandler( void )\r
+{\r
+uint32_t ulInterruptCause;\r
+\r
+       while( ( ulInterruptCause = LPC_EMAC->IntStatus ) != 0 )\r
+       {\r
+               /* Clear the interrupt. */\r
+               LPC_EMAC->IntClear = ulInterruptCause;\r
+\r
+               /* Clear fatal error conditions.  NOTE:  The driver does not clear all\r
+               errors, only those actually experienced.  For future reference, range\r
+               errors are not actually errors so can be ignored. */\r
+               if( ( ulInterruptCause & EMAC_INT_TX_UNDERRUN ) != 0U )\r
+               {\r
+                       LPC_EMAC->Command |= EMAC_CR_TX_RES;\r
+               }\r
+\r
+               /* Unblock the deferred interrupt handler task if the event was an\r
+               Rx. */\r
+               if( ( ulInterruptCause & EMAC_INT_RX_DONE ) != 0UL )\r
+               {\r
+                       xSemaphoreGiveFromISR( xEMACRxEventSemaphore, NULL );\r
+               }\r
+       }\r
+\r
+       /* Shortcut calling portEND_SWITCHING_ISR(). */\r
+       vPortYieldFromISR();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvEMACHandlerTask( void *pvParameters )\r
+{\r
+size_t xDataLength;\r
+const uint16_t usCRCLength = 4;\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };\r
+\r
+/* This is not included in the header file for some reason. */\r
+extern uint8_t *EMAC_NextPacketToRead( void );\r
+\r
+       ( void ) pvParameters;\r
+       configASSERT( xEMACRxEventSemaphore );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait for the EMAC interrupt to indicate that another packet has been\r
+               received.  The while() loop is only needed if INCLUDE_vTaskSuspend is\r
+               set to 0 in FreeRTOSConfig.h. */\r
+               while( xSemaphoreTake( xEMACRxEventSemaphore, portMAX_DELAY ) == pdFALSE );\r
+\r
+               /* At least one packet has been received. */\r
+               while( EMAC_CheckReceiveIndex() != FALSE )\r
+               {\r
+                       /* Obtain the length, minus the CRC.  The CRC is four bytes\r
+                       but the length is already minus 1. */\r
+                       xDataLength = ( size_t ) EMAC_GetReceiveDataSize() - ( usCRCLength - 1U );\r
+\r
+                       if( xDataLength > 0U )\r
+                       {\r
+                               /* Obtain a network buffer to pass this data into the\r
+                               stack.  No storage is required as the network buffer\r
+                               will point directly to the buffer that already holds\r
+                               the     received data. */\r
+                               pxNetworkBuffer = pxNetworkBufferGet( 0, ( portTickType ) 0 );\r
+\r
+                               if( pxNetworkBuffer != NULL )\r
+                               {\r
+                                       pxNetworkBuffer->pucBuffer = EMAC_NextPacketToRead();\r
+                                       pxNetworkBuffer->xDataLength = xDataLength;\r
+                                       xRxEvent.pvData = ( void * ) pxNetworkBuffer;\r
+\r
+                                       /* Data was received and stored.  Send a message to the IP\r
+                                       task to let it know. */\r
+                                       if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )\r
+                                       {\r
+                                               vNetworkBufferRelease( pxNetworkBuffer );\r
+                                               iptraceETHERNET_RX_EVENT_LOST();\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       iptraceETHERNET_RX_EVENT_LOST();\r
+                               }\r
+\r
+                               iptraceNETWORK_INTERFACE_RECEIVE();\r
+                       }\r
+\r
+                       /* Release the frame. */\r
+                       EMAC_UpdateRxConsumeIndex();\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/NetworkInterface.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/NetworkInterface.c
new file mode 100644 (file)
index 0000000..9621dce
--- /dev/null
@@ -0,0 +1,308 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Driver includes. */\r
+#include "lpc18xx_emac.h"\r
+\r
+/* Demo includes. */\r
+#include "NetworkInterface.h"\r
+\r
+#if configMAC_INTERRUPT_PRIORITY > configMAC_INTERRUPT_PRIORITY\r
+       #error configMAC_INTERRUPT_PRIORITY must be greater than or equal to configMAC_INTERRUPT_PRIORITY (higher numbers mean lower logical priority)\r
+#endif\r
+\r
+#ifndef configNUM_RX_ETHERNET_DMA_DESCRIPTORS\r
+       #error configNUM_RX_ETHERNET_DMA_DESCRIPTORS must be defined in FreeRTOSConfig.h to set the number of RX DMA descriptors\r
+#endif\r
+\r
+#ifndef configNUM_TX_ETHERNET_DMA_DESCRIPTORS\r
+       #error configNUM_TX_ETHERNET_DMA_DESCRIPTORS must be defined in FreeRTOSConfig.h to set the number of TX DMA descriptors\r
+#endif\r
+\r
+/* If a packet cannot be sent immediately then the task performing the send\r
+operation will be held in the Blocked state (so other tasks can execute) for\r
+niTX_BUFFER_FREE_WAIT ticks.  It will do this a maximum of niMAX_TX_ATTEMPTS\r
+before giving up. */\r
+#define niTX_BUFFER_FREE_WAIT  ( ( portTickType ) 2UL / portTICK_RATE_MS )\r
+#define niMAX_TX_ATTEMPTS              ( 5 )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * A deferred interrupt handler task that processes received frames.\r
+ */\r
+static void prvEMACDeferredInterruptHandlerTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue used to communicate Ethernet events to the IP task. */\r
+extern xQueueHandle xNetworkEventQueue;\r
+\r
+/* The semaphore used to wake the deferred interrupt handler task when an Rx\r
+interrupt is received. */\r
+static xSemaphoreHandle xEMACRxEventSemaphore = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceInitialise( void )\r
+{\r
+EMAC_CFG_Type Emac_Config;\r
+portBASE_TYPE xReturn;\r
+extern uint8_t ucMACAddress[ 6 ];\r
+\r
+       Emac_Config.pbEMAC_Addr = ucMACAddress;\r
+       xReturn = EMAC_Init( &Emac_Config );\r
+\r
+       if( xReturn == pdPASS )\r
+       {\r
+               LPC_ETHERNET->DMA_INT_EN =  DMA_INT_NOR_SUM | DMA_INT_RECEIVE;\r
+\r
+               /* Create the event semaphore if it has not already been created. */\r
+               if( xEMACRxEventSemaphore == NULL )\r
+               {\r
+                       vSemaphoreCreateBinary( xEMACRxEventSemaphore );\r
+                       #if ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1\r
+                       {\r
+                               /* If the trace recorder code is included name the semaphore for\r
+                               viewing in FreeRTOS+Trace. */\r
+                               vTraceSetQueueName( xEMACRxEventSemaphore, "MAC_RX" );\r
+                       }\r
+                       #endif /*  ipconfigINCLUDE_EXAMPLE_FREERTOS_PLUS_TRACE_CALLS == 1 */\r
+               }\r
+\r
+               configASSERT( xEMACRxEventSemaphore );\r
+\r
+               /* The Rx deferred interrupt handler task is created at the highest\r
+               possible priority to ensure the interrupt handler can return directly to\r
+               it no matter which task was running when the interrupt occurred. */\r
+               xTaskCreate(    prvEMACDeferredInterruptHandlerTask,            /* The function that implements the task. */\r
+                                               ( const signed char * const ) "MACTsk",\r
+                                               configMINIMAL_STACK_SIZE,       /* Stack allocated to the task (defined in words, not bytes). */\r
+                                               NULL,                                           /* The task parameter is not used. */\r
+                                               configMAX_PRIORITIES - 1,       /* The priority assigned to the task. */\r
+                                               NULL );                                         /* The handle is not required, so NULL is passed. */\r
+\r
+               /* Enable the interrupt and set its priority as configured.  THIS\r
+               DRIVER REQUIRES configMAC_INTERRUPT_PRIORITY TO BE DEFINED, PREFERABLY\r
+               IN FreeRTOSConfig.h. */\r
+               NVIC_SetPriority( ETHERNET_IRQn, configMAC_INTERRUPT_PRIORITY );\r
+               NVIC_EnableIRQ( ETHERNET_IRQn );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+portBASE_TYPE xReturn = pdFAIL;\r
+int32_t x;\r
+\r
+       /* Attempt to obtain access to a Tx descriptor. */\r
+       for( x = 0; x < niMAX_TX_ATTEMPTS; x++ )\r
+       {\r
+               if( EMAC_CheckTransmitIndex() == TRUE )\r
+               {\r
+                       /* Assign the buffer being transmitted to the Tx descriptor. */\r
+                       EMAC_SetNextPacketToSend( pxNetworkBuffer->pucEthernetBuffer );\r
+\r
+                       /* The EMAC now owns the buffer and will free it when it has been\r
+                       transmitted.  Set pucBuffer to NULL to ensure the buffer is not\r
+                       freed when the network buffer structure is returned to the pool\r
+                       of network buffers. */\r
+                       pxNetworkBuffer->pucEthernetBuffer = NULL;\r
+\r
+                       /* Initiate the Tx. */\r
+                       EMAC_StartTransmitNextBuffer( pxNetworkBuffer->xDataLength );\r
+                       iptraceNETWORK_INTERFACE_TRANSMIT();\r
+\r
+                       /* The Tx has been initiated. */\r
+                       xReturn = pdPASS;\r
+\r
+                       break;\r
+               }\r
+               else\r
+               {\r
+                       iptraceWAITING_FOR_TX_DMA_DESCRIPTOR();\r
+                       vTaskDelay( niTX_BUFFER_FREE_WAIT );\r
+               }\r
+       }\r
+\r
+       /* Finished with the network buffer. */\r
+       vNetworkBufferRelease( pxNetworkBuffer );\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void ETH_IRQHandler( void )\r
+{\r
+uint32_t ulInterruptCause;\r
+\r
+       ulInterruptCause = LPC_ETHERNET->DMA_STAT ;\r
+\r
+       /* Clear the interrupt. */\r
+       LPC_ETHERNET->DMA_STAT |= ( DMA_INT_NOR_SUM | DMA_INT_RECEIVE );\r
+\r
+       /* Clear fatal error conditions.  NOTE:  The driver does not clear all\r
+       errors, only those actually experienced.  For future reference, range\r
+       errors are not actually errors so can be ignored. */\r
+       if( ( ulInterruptCause & ( 1 << 13 ) ) != 0U )\r
+       {\r
+               LPC_ETHERNET->DMA_STAT |= ( 1 << 13 );\r
+       }\r
+\r
+       /* Unblock the deferred interrupt handler task if the event was an Rx. */\r
+       if( ( ulInterruptCause & DMA_INT_RECEIVE ) != 0UL )\r
+       {\r
+               xSemaphoreGiveFromISR( xEMACRxEventSemaphore, NULL );\r
+       }\r
+\r
+       /* Shortcut to calling portEND_SWITCHING_ISR().  Only do this if you\r
+       understand what you are doing!  Otherwise use portEND_SWITCHING_ISR()\r
+       directly. */\r
+       vPortYieldFromISR();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvEMACDeferredInterruptHandlerTask( void *pvParameters )\r
+{\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };\r
+\r
+       ( void ) pvParameters;\r
+       configASSERT( xEMACRxEventSemaphore );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait for the EMAC interrupt to indicate that another packet has been\r
+               received.  The while() loop is only needed if INCLUDE_vTaskSuspend is\r
+               set to 0 in FreeRTOSConfig.h.  If INCLUDE_vTaskSuspend is set to 1\r
+               then portMAX_DELAY would be an indefinite block time and\r
+               xSemaphoreTake() would only return when the semaphore was actually\r
+               obtained. */\r
+               while( xSemaphoreTake( xEMACRxEventSemaphore, portMAX_DELAY ) == pdFALSE );\r
+\r
+               /* At least one packet has been received. */\r
+               while( EMAC_CheckReceiveIndex() != FALSE )\r
+               {\r
+                       /* The buffer filled by the DMA is going to be passed into the IP\r
+                       stack.  Allocate another buffer for the DMA descriptor. */\r
+                       pxNetworkBuffer = pxNetworkBufferGet( ipTOTAL_ETHERNET_FRAME_SIZE, ( portTickType ) 0 );\r
+\r
+                       if( pxNetworkBuffer != NULL )\r
+                       {\r
+                               /* Swap the buffer just allocated and referenced from the\r
+                               pxNetworkBuffer with the buffer that has already been filled by\r
+                               the DMA.  pxNetworkBuffer will then hold a reference to the\r
+                               buffer that already contains the data without any data having\r
+                               been copied between buffers. */\r
+                               EMAC_NextPacketToRead( pxNetworkBuffer );\r
+\r
+                               #if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES == 1\r
+                               {\r
+                                       if( pxNetworkBuffer->xDataLength > 0 )\r
+                                       {\r
+                                               /* If the frame would not be processed by the IP stack then\r
+                                               don't even bother sending it to the IP stack. */\r
+                                               if( eConsiderFrameForProcessing( pxNetworkBuffer->pucEthernetBuffer ) != eProcessBuffer )\r
+                                               {\r
+                                                       pxNetworkBuffer->xDataLength = 0;\r
+                                               }\r
+                                       }\r
+                               }\r
+                               #endif\r
+\r
+                               if( pxNetworkBuffer->xDataLength > 0 )\r
+                               {\r
+                                       /* Store a pointer to the network buffer structure in the\r
+                                       padding space that was left in front of the Ethernet frame.\r
+                                       The pointer     is needed to ensure the network buffer structure\r
+                                       can be located when it is time for it to be freed if the\r
+                                       Ethernet frame gets     used as a zero copy buffer. */\r
+                                       *( ( xNetworkBufferDescriptor_t ** ) ( ( pxNetworkBuffer->pucEthernetBuffer - ipBUFFER_PADDING ) ) ) = pxNetworkBuffer;\r
+\r
+                                       /* Data was received and stored.  Send it to the IP task\r
+                                       for processing. */\r
+                                       xRxEvent.pvData = ( void * ) pxNetworkBuffer;\r
+                                       if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )\r
+                                       {\r
+                                               /* The buffer could not be sent to the IP task so the\r
+                                               buffer must be released. */\r
+                                               vNetworkBufferRelease( pxNetworkBuffer );\r
+                                               iptraceETHERNET_RX_EVENT_LOST();\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               iptraceNETWORK_INTERFACE_RECEIVE();\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* The buffer does not contain any data so there is no\r
+                                       point sending it to the IP task.  Just release it. */\r
+                                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                                       iptraceETHERNET_RX_EVENT_LOST();\r
+                               }\r
+                       }\r
+                       else\r
+                       {\r
+                               iptraceETHERNET_RX_EVENT_LOST();\r
+                       }\r
+\r
+                       /* Release the descriptor. */\r
+                       EMAC_UpdateRxConsumeIndex();\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.c
new file mode 100644 (file)
index 0000000..5162f4d
--- /dev/null
@@ -0,0 +1,610 @@
+/**********************************************************************\r
+* Copyright(C) 2011, NXP Semiconductor\r
+* All rights reserved.\r
+* Heavily modified by Real Time Engineers ltd.\r
+***********************************************************************\r
+* Software that is described herein is for illustrative purposes only\r
+* which provides customers with programming information regarding the\r
+* products. This software is supplied "AS IS" without any warranties.\r
+* NXP Semiconductors assumes no responsibility or liability for the\r
+* use of the software, conveys no license or title under any patent,\r
+* copyright, or mask work right to the product. NXP Semiconductors\r
+* reserves the right to make changes in the software without\r
+* notification. NXP Semiconductors also make no representation or\r
+* warranty that such application will be suitable for the specified\r
+* use without further testing or modification.\r
+**********************************************************************/\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Library includes. */\r
+#include "lpc18xx_emac.h"\r
+#include "lpc18xx_rgu.h"\r
+#include "lpc18xx_scu.h"\r
+#include "lpc18xx_gpio.h"\r
+\r
+\r
+#define emacTIMEOUT_DELAY      ( 2 )\r
+#define emacNEGOTIATE_DELAY    ( 10 / portTICK_RATE_MS )\r
+\r
+#define emacEXPECTED_RX_STATUS_MASK    ( RX_FIRST_SEGM | RX_LAST_SEGM )\r
+\r
+/* Rx descriptors and data array. */\r
+static volatile RX_Desc Rx_Desc[ configNUM_RX_ETHERNET_DMA_DESCRIPTORS ];\r
+static unsigned int RxDescIndex = 0;\r
+\r
+/** Rx Status data array - Must be 8-Byte aligned */\r
+#if defined ( __CC_ARM   )\r
+       static __align(8) RX_Stat Rx_Stat[ configNUM_RX_ETHERNET_DMA_DESCRIPTORS ];\r
+#elif defined ( __ICCARM__ )\r
+       #pragma data_alignment=8\r
+       static RX_Stat Rx_Stat[ configNUM_RX_ETHERNET_DMA_DESCRIPTORS ];\r
+#elif defined   (  __GNUC__  )\r
+       static volatile __attribute__ ((aligned (8))) RX_Stat Rx_Stat[ configNUM_RX_ETHERNET_DMA_DESCRIPTORS ];\r
+#endif\r
+\r
+/* Tx descriptors and status array. */\r
+static volatile TX_Desc Tx_Desc[ configNUM_TX_ETHERNET_DMA_DESCRIPTORS ];\r
+static volatile TX_Stat Tx_Stat[ configNUM_TX_ETHERNET_DMA_DESCRIPTORS ];\r
+static unsigned int TxDescIndex = 0;\r
+\r
+/* Private Functions ---------------------------------------------------------- */\r
+static void rx_descr_init( void );\r
+static void tx_descr_init( void );\r
+static int32_t write_PHY( uint32_t PhyReg, uint16_t Value );\r
+static int32_t read_PHY( uint32_t PhyReg );\r
+static void setEmacAddr( uint8_t abStationAddr[] );\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initializes the EMAC peripheral according to the specified\r
+ *               parameters in the EMAC_ConfigStruct.\r
+ * @param[in]  EMAC_ConfigStruct Pointer to a EMAC_CFG_Type structure\r
+ *                    that contains the configuration information for the\r
+ *                    specified EMAC peripheral.\r
+ * @return             None\r
+ *\r
+ * Note: This function will initialize EMAC module according to procedure below:\r
+ *  - Remove the soft reset condition from the MAC\r
+ *  - Configure the PHY via the MIIM interface of the MAC\r
+ *  - Select RMII mode\r
+ *  - Configure the transmit and receive DMA engines, including the descriptor arrays\r
+ *  - Configure the host registers (MAC1,MAC2 etc.) in the MAC\r
+ *  - Enable the receive and transmit data paths\r
+ *  In default state after initializing, only Rx Done and Tx Done interrupt are enabled,\r
+ *  all remain interrupts are disabled\r
+ *  (Ref. from LPC17xx UM)\r
+ **********************************************************************/\r
+portBASE_TYPE EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct)\r
+{\r
+int32_t id1, id2, regv, phy = 0;\r
+int32_t phy_linkstatus_reg, phy_linkstatus_mask;\r
+uint32_t x;\r
+const uint32_t ulMaxAttempts = 250UL;\r
+portBASE_TYPE xReturn = pdPASS;\r
+\r
+       /* Enable Ethernet Pins (NGX LPC1830 Xplorer. */\r
+       scu_pinmux(0x2 ,0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7);\r
+       scu_pinmux(0x1 ,17 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0x1 ,18 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0x1 ,20 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0x1 ,19 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC0);\r
+       scu_pinmux(0x0 ,1 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC6);\r
+       scu_pinmux(0x1 ,15 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0x0 ,0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC2);\r
+       scu_pinmux(0x1 ,16 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0xC ,9 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3);\r
+       scu_pinmux(0x1 ,16 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7);\r
+\r
+       /* Ethernet RESET Pins */\r
+       scu_pinmux(0x1 ,0 , MD_PUP, FUNC0);\r
+       GPIO_SetDir(0,(1<<4), 1);\r
+       GPIO_SetValue(0,(1<<4));\r
+\r
+\r
+       #if MII                           /*   Select MII interface       */                             // check MUXING for new Eagle...\r
+         scu_pinmux(0xC ,6 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_RXD2: PC_6 -> FUNC3\r
+         scu_pinmux(0xC ,7 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_RXD3: PC_7 -> FUNC3\r
+         scu_pinmux(0xC ,0 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_RXLK: PC_0 -> FUNC3\r
+         scu_pinmux(0xC ,2 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_TXD2: PC_2 -> FUNC3\r
+         scu_pinmux(0xC ,3 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_TXD3: PC_3 -> FUNC3\r
+         scu_pinmux(0xC ,5 , (MD_PLN | MD_EZI | MD_ZI), FUNC3);        // ENET_TX_ER:  PC_5 -> FUNC3\r
+         scu_pinmux(0x0 ,1 , (MD_PLN | MD_EZI | MD_ZI), FUNC2);        // ENET_COL:  P0_1 -> FUNC2\r
+       #else                              /*   Select RMII interface     */\r
+         LPC_CREG->CREG6 |= RMII_SELECT;\r
+       #endif\r
+\r
+\r
+       RGU_SoftReset( RGU_SIG_ETHERNET );\r
+\r
+       /* Wait for reset. */\r
+       while( !( LPC_RGU->RESET_ACTIVE_STATUS0 & ( 1 << ETHERNET_RST ) ) )\r
+       {\r
+               vTaskDelay( emacTIMEOUT_DELAY );\r
+       }\r
+\r
+       /* Reset all GMAC Subsystem internal registers and logic. */\r
+       LPC_ETHERNET->DMA_BUS_MODE |= DMA_SOFT_RESET;\r
+\r
+       /* Wait for software reset completion. */\r
+       while( LPC_ETHERNET->DMA_BUS_MODE & DMA_SOFT_RESET )\r
+       {\r
+               vTaskDelay( emacTIMEOUT_DELAY );\r
+       }\r
+\r
+       /* Put the PHY in reset mode */\r
+       write_PHY( PHY_REG_BMCR, PHY_BMCR_RESET );\r
+\r
+       /* Wait for hardware reset to end. */\r
+       for( x = 0; x < ulMaxAttempts; x++ )\r
+       {\r
+               regv = read_PHY (PHY_REG_BMCR);\r
+               if( !( regv & PHY_BMCR_RESET ) )\r
+               {\r
+                       /* Reset complete */\r
+                       break;\r
+               }\r
+               else\r
+               {\r
+                       vTaskDelay( emacTIMEOUT_DELAY );\r
+               }\r
+       }\r
+\r
+       if( x == ulMaxAttempts )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       /* Check if this is a DP83848C PHY. */\r
+       id1 = read_PHY( PHY_REG_IDR1 );\r
+       id2 = read_PHY( PHY_REG_IDR2 );\r
+       if( ( ( id1 << 16 ) | ( id2 & 0xFFF0 ) ) == DP83848C_ID )\r
+       {\r
+               phy = DP83848C_ID;\r
+       }\r
+       else if( ( ( id1 << 16 ) | id2 ) == LAN8720_ID )\r
+       {\r
+               phy = LAN8720_ID;\r
+       }\r
+\r
+       if( phy != 0 )\r
+       {\r
+               /* Use autonegotiation about the link speed. */\r
+               write_PHY( PHY_REG_BMCR, PHY_AUTO_NEG );\r
+\r
+               /* Wait to complete Auto_Negotiation. */\r
+               for( x = 0; x < ulMaxAttempts; x++ )\r
+               {\r
+                       regv = read_PHY( PHY_REG_BMSR );\r
+\r
+                       if( ( regv & PHY_AUTO_NEG_DONE ) != 0 )\r
+                       {\r
+                               /* Auto negotiation Complete. */\r
+                               break;\r
+                       }\r
+                       else\r
+                       {\r
+                               vTaskDelay( emacNEGOTIATE_DELAY );\r
+                       }\r
+               }\r
+\r
+               if( x == ulMaxAttempts )\r
+               {\r
+                       xReturn = pdFAIL;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+\r
+       if( xReturn == pdPASS )\r
+       {\r
+               /* Default to DP83848C. */\r
+               phy_linkstatus_reg = PHY_REG_STS;\r
+               phy_linkstatus_mask = 0x0001;\r
+\r
+               if( phy == LAN8720_ID )\r
+               {\r
+                       phy_linkstatus_reg = PHY_REG_BMSR;\r
+                       phy_linkstatus_mask = 0x0004;\r
+               }\r
+\r
+               /* Check the link status. */\r
+               for( x = 0; x < ulMaxAttempts; x++ )\r
+               {\r
+                       regv = read_PHY( phy_linkstatus_reg );\r
+\r
+                       if( ( regv & phy_linkstatus_mask ) != 0 )\r
+                       {\r
+                               /* Link is on. */\r
+                               break;\r
+                       }\r
+                       else\r
+                       {\r
+                               vTaskDelay( emacNEGOTIATE_DELAY );\r
+                       }\r
+               }\r
+\r
+               if( x == ulMaxAttempts )\r
+               {\r
+                       xReturn = pdFAIL;\r
+               }\r
+\r
+               regv = read_PHY( PHY_REG_SPCON );\r
+               regv &= PHY_REG_HCDSPEED_MASK;\r
+\r
+               /* Configure 100MBit/10MBit mode and Full/Half Duplex mode. */\r
+               switch( regv )\r
+               {\r
+                       case PHY_REG_HCDSPEED_10MB_FULLD:\r
+                               LPC_ETHERNET->MAC_CONFIG |= MAC_DUPMODE;\r
+                               break;\r
+\r
+                       case PHY_REG_HCDSPEED_100MB_HALFD:\r
+                               LPC_ETHERNET->MAC_CONFIG |= MAC_100MPS;\r
+                               break;\r
+\r
+                       case PHY_REG_HCDSPEED_100MB_FULLD:\r
+                               LPC_ETHERNET->MAC_CONFIG |= MAC_DUPMODE;\r
+                               LPC_ETHERNET->MAC_CONFIG |= MAC_100MPS;\r
+                               break;\r
+\r
+                       default:\r
+                               break;\r
+               }\r
+\r
+               /* Set the Ethernet MAC Address registers */\r
+               setEmacAddr( EMAC_ConfigStruct->pbEMAC_Addr );\r
+\r
+               /* Initialize Descriptor Lists    */\r
+               rx_descr_init();\r
+               tx_descr_init();\r
+\r
+               /* Configure Filter\r
+               LPC_ETHERNET->MAC_FRAME_FILTER is left at its default value.\r
+               MAC_PROMISCUOUS and MAC_RECEIVEALL can be set if required. */\r
+\r
+               /* Enable Receiver and Transmitter   */\r
+               LPC_ETHERNET->MAC_CONFIG |= (MAC_TX_ENABLE | MAC_RX_ENABLE);\r
+\r
+               /* Enable interrupts    */\r
+               LPC_ETHERNET->DMA_INT_EN =  DMA_INT_NOR_SUM | DMA_INT_RECEIVE ;\r
+\r
+               /* Start Transmission & Receive processes   */\r
+               LPC_ETHERNET->DMA_OP_MODE |= (DMA_SS_TRANSMIT | DMA_SS_RECEIVE );\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+\r
+/*********************************************************************//**\r
+ **********************************************************************/\r
+portBASE_TYPE EMAC_CheckTransmitIndex( void )\r
+{\r
+portBASE_TYPE xReturn;\r
+\r
+       if( ( Tx_Desc[ TxDescIndex ].Status & OWN_BIT ) == 0 )\r
+       {\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              EMAC_SetNextPacketToSend\r
+ * @param[in]  pucBuffer\r
+ * @return             None\r
+ ***********************************************************************/\r
+void EMAC_SetNextPacketToSend( uint8_t * pucBuffer )\r
+{\r
+       /* The old packet is now finished with and can be freed. */\r
+       vEthernetBufferRelease( ( void * ) Tx_Desc[ TxDescIndex ].Packet );\r
+\r
+       /* Assign the new packet to the descriptor. */\r
+       Tx_Desc[ TxDescIndex ].Packet = ( uint32_t ) pucBuffer;\r
+}\r
+\r
+void EMAC_StartTransmitNextBuffer( uint32_t ulLength )\r
+{\r
+       Tx_Desc[ TxDescIndex ].Ctrl = ulLength;\r
+       Tx_Desc[ TxDescIndex ].Status |= OWN_BIT;\r
+\r
+       /* Wake Up the DMA if it's in Suspended Mode. */\r
+       LPC_ETHERNET->DMA_TRANS_POLL_DEMAND = 1;\r
+       TxDescIndex++;\r
+\r
+       if( TxDescIndex == configNUM_TX_ETHERNET_DMA_DESCRIPTORS )\r
+       {\r
+               TxDescIndex = 0;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Get size of current Received data in received buffer (due to\r
+ *                             RxConsumeIndex)\r
+ * @param[in]  None\r
+ * @return             Size of received data\r
+ **********************************************************************/\r
+uint32_t EMAC_GetReceiveDataSize(void)\r
+{\r
+unsigned short RxLen = 0;\r
+\r
+       RxLen = ( Rx_Desc[ RxDescIndex ].Status >> 16 ) & 0x03FFF;\r
+       return RxLen;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Increase the RxConsumeIndex (after reading the Receive buffer\r
+ *                             to release the Receive buffer) and wrap-around the index if\r
+ *                             it reaches the maximum Receive Number\r
+ * @param[in]  None\r
+ * @return             None\r
+ **********************************************************************/\r
+void EMAC_UpdateRxConsumeIndex( void )\r
+{\r
+       Rx_Desc[ RxDescIndex ].Status = OWN_BIT;\r
+       RxDescIndex++;\r
+\r
+       if( RxDescIndex == configNUM_RX_ETHERNET_DMA_DESCRIPTORS )\r
+       {\r
+               RxDescIndex = 0;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Check whether if the current RxConsumeIndex is not equal to the\r
+ *                             current RxProduceIndex.\r
+ * @param[in]  None\r
+ * @return             TRUE if they're not equal, otherwise return FALSE\r
+ *\r
+ * Note: In case the RxConsumeIndex is not equal to the RxProduceIndex,\r
+ * it means there're available data has been received. They should be read\r
+ * out and released the Receive Data Buffer by updating the RxConsumeIndex value.\r
+ **********************************************************************/\r
+portBASE_TYPE EMAC_CheckReceiveIndex(void)\r
+{\r
+portBASE_TYPE xReturn;\r
+\r
+       if( ( Rx_Desc[ RxDescIndex ].Status & OWN_BIT ) == 0 )\r
+       {\r
+               xReturn = pdPASS;\r
+       }\r
+       else\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+\r
+void EMAC_NextPacketToRead( xNetworkBufferDescriptor_t *pxNetworkBuffer )\r
+{\r
+uint8_t *pucTemp;\r
+\r
+       /* Swap the buffer in the network buffer with the buffer used by the DMA.\r
+       This allows the data to be passed out without having to perform any copies. */\r
+       pucTemp = ( uint8_t * ) Rx_Desc[ RxDescIndex ].Packet;\r
+       Rx_Desc[ RxDescIndex ].Packet = ( uint32_t ) pxNetworkBuffer->pucEthernetBuffer;\r
+       pxNetworkBuffer->pucEthernetBuffer = pucTemp;\r
+\r
+       /* Only supports frames coming in single buffers.  If this frame is split\r
+       across multiple buffers then reject it (and if the frame is needed increase\r
+       the ipconfigNETWORK_MTU setting). */\r
+       if( ( Rx_Desc[ RxDescIndex ].Status & emacEXPECTED_RX_STATUS_MASK ) != emacEXPECTED_RX_STATUS_MASK )\r
+       {\r
+               pxNetworkBuffer->xDataLength = 0;\r
+       }\r
+       else\r
+       {\r
+               pxNetworkBuffer->xDataLength = ( size_t ) EMAC_GetReceiveDataSize() - ( ipETHERNET_CRC_BYTES - 1U );;\r
+       }\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initializes RX Descriptor\r
+ * @param[in]  None\r
+ * @return             None\r
+ ***********************************************************************/\r
+static void rx_descr_init( void )\r
+{\r
+uint32_t x;\r
+size_t xBufferSize = ipTOTAL_ETHERNET_FRAME_SIZE;\r
+\r
+       for( x = 0; x < configNUM_RX_ETHERNET_DMA_DESCRIPTORS; x++ )\r
+       {\r
+               /* Obtain the buffer first, as the size of the buffer might be changed\r
+               within the pucEthernetBufferGet() call. */\r
+               Rx_Desc[ x ].Packet  = ( uint32_t ) pucEthernetBufferGet( &xBufferSize );\r
+               Rx_Desc[ x ].Status = OWN_BIT;\r
+               Rx_Desc[ x ].Ctrl  = xBufferSize;\r
+               Rx_Desc[ x ].NextDescripter = ( uint32_t ) &Rx_Desc[ x + 1 ];\r
+               \r
+               configASSERT( ( ( ( uint32_t ) Rx_Desc[x].Packet ) & 0x07 ) == 0 );\r
+       }\r
+\r
+       /* Last Descriptor */\r
+       Rx_Desc[ configNUM_RX_ETHERNET_DMA_DESCRIPTORS - 1 ].Ctrl |= RX_END_RING;\r
+\r
+       RxDescIndex = 0;\r
+\r
+       /* Set Starting address of RX Descriptor list */\r
+       LPC_ETHERNET->DMA_REC_DES_ADDR = ( uint32_t ) Rx_Desc;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Initializes TX Descriptor\r
+ * @param[in]  None\r
+ * @return             None\r
+ ***********************************************************************/\r
+static void tx_descr_init( void )\r
+{\r
+/* Initialize Transmit Descriptor and Status array. */\r
+uint32_t x;\r
+\r
+       for( x = 0; x < configNUM_TX_ETHERNET_DMA_DESCRIPTORS; x++ )\r
+       {\r
+               Tx_Desc[ x ].Status = TX_LAST_SEGM | TX_FIRST_SEGM;\r
+               Tx_Desc[ x ].Ctrl  = 0;\r
+               Tx_Desc[ x ].NextDescripter = ( uint32_t ) &Tx_Desc[ x + 1 ];\r
+\r
+               /* Packet is assigned when a Tx is initiated. */\r
+               Tx_Desc[ x ].Packet   = ( uint32_t )NULL;\r
+       }\r
+\r
+       /* Last Descriptor? */\r
+       Tx_Desc[ configNUM_TX_ETHERNET_DMA_DESCRIPTORS-1 ].Status |= TX_END_RING;\r
+\r
+       /* Set Starting address of TX Descriptor list */\r
+       LPC_ETHERNET->DMA_TRANS_DES_ADDR = ( uint32_t ) Tx_Desc;\r
+}\r
+\r
+\r
+/*********************************************************************//**\r
+ * @brief              Write value to PHY device\r
+ * @param[in]  PhyReg: PHY Register address\r
+ * @param[in]  Value:  Value to write\r
+ * @return             0 - if success\r
+ *                             1 - if fail\r
+ ***********************************************************************/\r
+static int32_t write_PHY (uint32_t PhyReg, uint16_t Value)\r
+{\r
+uint32_t x;\r
+const uint32_t ulMaxAttempts = 250UL;\r
+int32_t lReturn = pdPASS;\r
+\r
+       /* Write a data 'Value' to PHY register 'PhyReg'. */\r
+       x = 0;\r
+       while( LPC_ETHERNET->MAC_MII_ADDR & GMII_BUSY )\r
+       {\r
+               x++;\r
+\r
+               if( x >= ulMaxAttempts )\r
+               {\r
+                       /* Time out. */\r
+                       lReturn = pdFAIL;\r
+                       break;\r
+               }\r
+               else\r
+               {\r
+                       /* GMII is busy. */\r
+                       vTaskDelay( emacTIMEOUT_DELAY );\r
+               }\r
+       }\r
+\r
+       if( lReturn == pdPASS )\r
+       {\r
+               LPC_ETHERNET->MAC_MII_ADDR = ( DP83848C_DEF_ADR << 11 ) | ( PhyReg << 6 ) | GMII_WRITE;\r
+               LPC_ETHERNET->MAC_MII_DATA = Value;\r
+\r
+               /* Start PHY Write Cycle. */\r
+               LPC_ETHERNET->MAC_MII_ADDR |= GMII_BUSY;\r
+\r
+               /* Wait untl operation completed. */\r
+               for( x = 0; x < ulMaxAttempts; x++ )\r
+               {\r
+                       if( ( LPC_ETHERNET->MAC_MII_ADDR & GMII_BUSY ) == 0 )\r
+                       {\r
+                               break;\r
+                       }\r
+                       else\r
+                       {\r
+                               vTaskDelay( emacTIMEOUT_DELAY );\r
+                       }\r
+               }\r
+\r
+               if( x == ulMaxAttempts )\r
+               {\r
+                       /* Timeout. */\r
+                       lReturn = pdFAIL;\r
+               }\r
+       }\r
+\r
+       return lReturn;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Read value from PHY device\r
+ * @param[in]  PhyReg: PHY Register address\r
+ * @return             0 - if success\r
+ *                             1 - if fail\r
+ ***********************************************************************/\r
+static int32_t read_PHY( uint32_t PhyReg )\r
+{\r
+int32_t lValue = 0;\r
+uint32_t x;\r
+const uint32_t ulMaxAttempts = 250UL;\r
+\r
+       /* Write a data 'Value' to PHY register 'PhyReg'. */\r
+       x = 0;\r
+       while( LPC_ETHERNET->MAC_MII_ADDR & GMII_BUSY )\r
+       {\r
+               x++;\r
+\r
+               if( x >= ulMaxAttempts )\r
+               {\r
+                       /* Time out. */\r
+                       break;\r
+               }\r
+               else\r
+               {\r
+                       /* GMII is busy. */\r
+                       vTaskDelay( emacTIMEOUT_DELAY );\r
+               }\r
+       }\r
+\r
+       if( x < ulMaxAttempts )\r
+       {\r
+               /* Read a PHY register 'PhyReg'. */\r
+               LPC_ETHERNET->MAC_MII_ADDR = ( DP83848C_DEF_ADR << 11 ) | ( PhyReg << 6 ) | GMII_READ;\r
+\r
+               /* Start PHY Read Cycle. */\r
+               LPC_ETHERNET->MAC_MII_ADDR |= GMII_BUSY;\r
+\r
+               /* Wait until operation completed */\r
+               for( x = 0; x < ulMaxAttempts; x++ )\r
+               {\r
+                       if( ( LPC_ETHERNET->MAC_MII_ADDR & GMII_BUSY ) == 0 )\r
+                       {\r
+                               break;\r
+                       }\r
+                       else\r
+                       {\r
+                               vTaskDelay( emacTIMEOUT_DELAY );\r
+                       }\r
+               }\r
+\r
+               configASSERT( x != ulMaxAttempts );\r
+               lValue = LPC_ETHERNET->MAC_MII_DATA;\r
+       }\r
+\r
+       return lValue;\r
+}\r
+\r
+/*********************************************************************//**\r
+ * @brief              Set Station MAC address for EMAC module\r
+ * @param[in]  abStationAddr Pointer to Station address that contains 6-bytes\r
+ *                             of MAC address (should be in order from MAC Address 1 to MAC Address 6)\r
+ * @return             None\r
+ **********************************************************************/\r
+static void setEmacAddr( uint8_t abStationAddr[] )\r
+{\r
+       /* Set the Ethernet MAC Address registers */\r
+       LPC_ETHERNET->MAC_ADDR0_HIGH = (( uint32_t ) abStationAddr[ 5 ] << 8 ) | ( uint32_t )abStationAddr[ 4 ];\r
+       LPC_ETHERNET->MAC_ADDR0_LOW =   (( uint32_t )abStationAddr[ 3 ] << 24) | (( uint32_t )abStationAddr[ 2 ] << 16) | (( uint32_t )abStationAddr[ 1 ] << 8 ) | ( uint32_t )abStationAddr[ 0 ];\r
+}\r
+\r
+\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.h b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/LPC18xx/lpc18xx_emac.h
new file mode 100644 (file)
index 0000000..cc4444d
--- /dev/null
@@ -0,0 +1,238 @@
+/***********************************************************************//**\r
+ * @file               lpc17xx_emac.h\r
+ * @brief              Contains all macro definitions and function prototypes\r
+ *                             support for Ethernet MAC firmware library on LPC17xx\r
+ * @version            2.0\r
+ * @date               21. May. 2010\r
+ * @author             NXP MCU SW Application Team\r
+ **************************************************************************\r
+ * Software that is described herein is for illustrative purposes only\r
+ * which provides customers with programming information regarding the\r
+ * products. This software is supplied "AS IS" without any warranties.\r
+ * NXP Semiconductors assumes no responsibility or liability for the\r
+ * use of the software, conveys no license or title under any patent,\r
+ * copyright, or mask work right to the product. NXP Semiconductors\r
+ * reserves the right to make changes in the software without\r
+ * notification. NXP Semiconductors also make no representation or\r
+ * warranty that such application will be suitable for the specified\r
+ * use without further testing or modification.\r
+ **************************************************************************/\r
+\r
+/* Peripheral group ----------------------------------------------------------- */\r
+/** @defgroup EMAC EMAC\r
+ * @ingroup LPC1700CMSIS_FwLib_Drivers\r
+ * @{\r
+ */\r
+\r
+#ifndef LPC18XX_EMAC_H_\r
+#define LPC18XX_EMAC_H_\r
+\r
+/* Includes ------------------------------------------------------------------- */\r
+#include "LPC18xx.h"\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif\r
+\r
+#include "lpc_types.h"\r
+\r
+/* Configuration */\r
+\r
+/* Interface Selection */\r
+#define MII                            0               // =0 RMII  -  =1 MII\r
+\r
+/* End of Configuration   */\r
+\r
+/*  Descriptors Fields bits       */\r
+#define OWN_BIT                                (1U<<31)        /*  Own bit in RDES0 & TDES0              */\r
+#define RX_END_RING                    (1<<15)         /*  Receive End of Ring bit in RDES1      */\r
+#define RX_NXTDESC_FLAG                (1<<14)         /*  Second Address Chained bit in RDES1   */\r
+#define TX_LAST_SEGM           (1<<29)         /*  Last Segment bit in TDES0             */\r
+#define RX_LAST_SEGM           (1<<9)\r
+#define TX_FIRST_SEGM          (1<<28)         /*  First Segment bit in TDES0            */\r
+#define RX_FIRST_SEGM          (1<<8)          /*  First Segment bit in TDES0            */\r
+#define TX_END_RING                    (1<<21)         /*  Transmit End of Ring bit in TDES0     */\r
+#define TX_NXTDESC_FLAG                (1<<20)         /*  Second Address Chained bit in TDES0   */\r
+\r
+/* EMAC Memory Buffer configuration for 16K Ethernet RAM */\r
+#define EMAC_ETH_MAX_FLEN              ipETHERNET_FRAME_SIZE_TO_USE\r
+\r
+/* NOTE: EMAC_NUM_RX_FRAG is not used by the example FreeRTOS drivers - use\r
+configNUM_RX_ETHERNET_DMA_DESCRIPTORS. */\r
+#define EMAC_NUM_RX_FRAG         6           /**< Num.of RX Fragments */\r
+\r
+/* NOTE: EMAC_NUM_TX_FRAG is not used by the example FreeRTOS drivers - use\r
+configNUM_TX_ETHERNET_DMA_DESCRIPTORS. */\r
+#define EMAC_NUM_TX_FRAG         2           /**< Num.of TX Fragments */\r
+\r
+/* EMAC Control and Status bits   */\r
+#define MAC_RX_ENABLE   (1<<2)                 /*  Receiver Enable in MAC_CONFIG reg      */\r
+#define MAC_TX_ENABLE   (1<<3)                 /*  Transmitter Enable in MAC_CONFIG reg   */\r
+#define MAC_PADCRC_STRIP (1<<7)                        /*  Automatic Pad-CRC Stripping in MAC_CONFIG reg   */\r
+#define MAC_DUPMODE             (1<<11)                /*  Duplex Mode in  MAC_CONFIG reg         */\r
+#define MAC_100MPS              (1<<14)                /*  Speed is 100Mbps in MAC_CONFIG reg     */\r
+#define MAC_PROMISCUOUS  (1U<<0)               /*  Promiscuous Mode bit in MAC_FRAME_FILTER reg    */\r
+#define MAC_DIS_BROAD    (1U<<5)               /*  Disable Broadcast Frames bit in     MAC_FRAME_FILTER reg    */\r
+#define MAC_RECEIVEALL   (1U<<31)       /*  Receive All bit in MAC_FRAME_FILTER reg    */\r
+#define DMA_SOFT_RESET   0x01          /*  Software Reset bit in DMA_BUS_MODE reg */\r
+#define DMA_SS_RECEIVE   (1<<1)         /*  Start/Stop Receive bit in DMA_OP_MODE reg  */\r
+#define DMA_SS_TRANSMIT  (1<<13)        /*  Start/Stop Transmission bit in DMA_OP_MODE reg  */\r
+#define DMA_INT_TRANSMIT (1<<0)         /*  Transmit Interrupt Enable bit in DMA_INT_EN reg */\r
+#define DMA_INT_OVERFLOW (1<<4)         /*  Overflow Interrupt Enable bit in DMA_INT_EN reg */\r
+#define DMA_INT_UNDERFLW (1<<5)         /*  Underflow Interrupt Enable bit in DMA_INT_EN reg */\r
+#define DMA_INT_RECEIVE  (1<<6)         /*  Receive Interrupt Enable bit in DMA_INT_EN reg */\r
+#define DMA_INT_ABN_SUM  (1<<15)        /*  Abnormal Interrupt Summary Enable bit in DMA_INT_EN reg */\r
+#define DMA_INT_NOR_SUM  (1<<16)        /*  Normal Interrupt Summary Enable bit in DMA_INT_EN reg */\r
+\r
+/* MII Management Command Register */\r
+#define GMII_READ           (0<<1)             /* GMII Read PHY                     */\r
+#define GMII_WRITE          (1<<1)      /* GMII Write PHY                    */\r
+#define GMII_BUSY           0x00000001  /* GMII is Busy / Start Read/Write   */\r
+#define MII_WR_TOUT         0x00050000  /* MII Write timeout count           */\r
+#define MII_RD_TOUT         0x00050000  /* MII Read timeout count            */\r
+\r
+/* MII Management Address Register */\r
+#define MADR_PHY_ADR        0x00001F00  /* PHY Address Mask                  */\r
+\r
+/* LAN8720 PHY Registers */\r
+#define PHY_REG_BMCR        0x00        /* Basic Mode Control Register       */\r
+#define PHY_REG_BMSR        0x01        /* Basic Mode Status Register        */\r
+#define PHY_REG_IDR1        0x02        /* PHY Identifier 1                  */\r
+#define PHY_REG_IDR2        0x03        /* PHY Identifier 2                  */\r
+#define PHY_REG_ANAR        0x04        /* Auto-Negotiation Advertisement    */\r
+#define PHY_REG_ANLPAR      0x05        /* Auto-Neg. Link Partner Abitily    */\r
+#define PHY_REG_ANER        0x06        /* Auto-Neg. Expansion Register      */\r
+#define PHY_REG_ANNPTR      0x07        /* Auto-Neg. Next Page TX            */\r
+\r
+/* LAN8720 PHY Speed identify */\r
+#define PHY_REG_SPCON                                  0x1f   /* Speed indication Register     */\r
+#define PHY_REG_HCDSPEED_MASK                  0x1c   /* Speed indication Register mask*/\r
+#define PHY_REG_HCDSPEED_10MB_HALFD            0x04   /* Speed is 10Mbps HALF-duplex   */\r
+#define PHY_REG_HCDSPEED_10MB_FULLD            0x14   /* Speed is 10Mbps FULL-duplex   */\r
+#define PHY_REG_HCDSPEED_100MB_HALFD    0x08   /* Speed is 100Mbps HALF-duplex  */\r
+#define PHY_REG_HCDSPEED_100MB_FULLD    0x18   /* Speed is 100Mbps FULL-duplex  */\r
+\r
+\r
+/* PHY Extended Registers */\r
+#define PHY_REG_STS         0x10        /* Status Register                   */\r
+#define PHY_REG_MICR        0x11        /* MII Interrupt Control Register    */\r
+#define PHY_REG_MISR        0x12        /* MII Interrupt Status Register     */\r
+#define PHY_REG_FCSCR       0x14        /* False Carrier Sense Counter       */\r
+#define PHY_REG_RECR        0x15        /* Receive Error Counter             */\r
+#define PHY_REG_PCSR        0x16        /* PCS Sublayer Config. and Status   */\r
+#define PHY_REG_RBR         0x17        /* RMII and Bypass Register          */\r
+#define PHY_REG_LEDCR       0x18        /* LED Direct Control Register       */\r
+#define PHY_REG_PHYCR       0x19        /* PHY Control Register              */\r
+#define PHY_REG_10BTSCR     0x1A        /* 10Base-T Status/Control Register  */\r
+#define PHY_REG_CDCTRL1     0x1B        /* CD Test Control and BIST Extens.  */\r
+#define PHY_REG_EDCR        0x1D        /* Energy Detect Control Register    */\r
+\r
+/* PHY Control and Status bits  */\r
+#define PHY_FULLD_100M      0x2100      /* Full Duplex 100Mbit               */\r
+#define PHY_HALFD_100M      0x2000      /* Half Duplex 100Mbit               */\r
+#define PHY_FULLD_10M       0x0100      /* Full Duplex 10Mbit                */\r
+#define PHY_HALFD_10M       0x0000      /* Half Duplex 10MBit                */\r
+#define PHY_AUTO_NEG        0x1000      /* Select Auto Negotiation           */\r
+#define PHY_AUTO_NEG_DONE   0x0020             /* AutoNegotiation Complete in BMSR PHY reg  */\r
+#define PHY_BMCR_RESET         0x8000          /* Reset bit at BMCR PHY reg         */\r
+#define LINK_VALID_STS         0x0001          /* Link Valid Status at REG_STS PHY reg  */\r
+#define FULL_DUP_STS           0x0004          /* Full Duplex Status at REG_STS PHY reg */\r
+#define SPEED_10M_STS          0x0002          /* 10Mbps Status at REG_STS PHY reg */\r
+\r
+#define DP83848C_DEF_ADR    0x01        /* Default PHY device address        */\r
+#define DP83848C_ID         0x20005C90  /* PHY Identifier (without Rev. info */\r
+#define LAN8720_ID                     0x0007C0F1  /* PHY Identifier for SMSC PHY       */\r
+\r
+/*  Misc    */\r
+#define ETHERNET_RST           22                      /*      Reset Output for EMAC at RGU     */\r
+#define RMII_SELECT                    0x04            /*  Select RMII in EMACCFG           */\r
+\r
+\r
+/**\r
+ * @brief EMAC configuration structure definition\r
+ */\r
+typedef struct {\r
+       uint32_t        Mode;                                           /**< Supported EMAC PHY device speed, should be one of the following:\r
+                                                                                       - EMAC_MODE_AUTO\r
+                                                                                       - EMAC_MODE_10M_FULL\r
+                                                                                       - EMAC_MODE_10M_HALF\r
+                                                                                       - EMAC_MODE_100M_FULL\r
+                                                                                       - EMAC_MODE_100M_HALF\r
+                                                                                       */\r
+       uint8_t         *pbEMAC_Addr;                           /**< Pointer to EMAC Station address that contains 6-bytes\r
+                                                                                       of MAC address, it must be sorted in order (bEMAC_Addr[0]..[5])\r
+                                                                                       */\r
+} EMAC_CFG_Type;\r
+\r
+/* Descriptor and status formats ---------------------------------------------- */\r
+/**\r
+ * @brief RX Descriptor structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t Status;                /**< Receive Status  Descriptor */\r
+       uint32_t Ctrl;                  /**< Receive Control Descriptor */\r
+       uint32_t Packet;                /**< Receive Packet Descriptor */\r
+       uint32_t NextDescripter;/**< Receive Next Descriptor Address */\r
+} RX_Desc;\r
+\r
+/**\r
+ * @brief RX Status structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t Info;          /**< Receive Information Status */\r
+       uint32_t HashCRC;       /**< Receive Hash CRC Status */\r
+} RX_Stat;\r
+\r
+/**\r
+ * @brief TX Descriptor structure type definition\r
+ */\r
+typedef struct {\r
+       uint32_t Status;                /**< Transmit Status  Descriptor */\r
+       uint32_t Ctrl;          /**< Transmit Control Descriptor */\r
+       uint32_t Packet;        /**< Transmit Packet Descriptor */\r
+       uint32_t NextDescripter;        /**< Transmit Next Descriptor Address */\r
+} TX_Desc;\r
+\r
+/**\r
+ * @brief TX Status structure type definition\r
+ */\r
+typedef struct {\r
+   uint32_t Info;              /**< Transmit Information Status */\r
+} TX_Stat;\r
+\r
+\r
+/**\r
+ * @brief TX Data Buffer structure definition\r
+ */\r
+typedef struct {\r
+       uint32_t ulDataLen;                     /**< Data length */\r
+       uint32_t *pbDataBuf;            /**< A word-align data pointer to data buffer */\r
+} EMAC_PACKETBUF_Type;\r
+\r
+\r
+\r
+/*  Prototypes               */\r
+portBASE_TYPE EMAC_Init(EMAC_CFG_Type *EMAC_ConfigStruct);\r
+int32_t EMAC_UpdatePHYStatus(void);\r
+uint32_t EMAC_GetReceiveDataSize(void);\r
+void EMAC_StartTransmitNextBuffer( uint32_t ulLength );\r
+void EMAC_SetNextPacketToSend( uint8_t * pucBuffer );\r
+void EMAC_NextPacketToRead( xNetworkBufferDescriptor_t *pxNetworkBuffer );\r
+void EMAC_UpdateRxConsumeIndex(void);\r
+portBASE_TYPE EMAC_CheckReceiveIndex(void);\r
+portBASE_TYPE EMAC_CheckTransmitIndex(void);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* LPC18XX_EMAC_H_ */\r
+\r
+/**\r
+ * @}\r
+ */\r
+\r
+/* --------------------------------- End Of File ------------------------------ */\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SH2A/NetworkInterface.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/SH2A/NetworkInterface.c
new file mode 100644 (file)
index 0000000..6a0afdf
--- /dev/null
@@ -0,0 +1,161 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Hardware includes. */\r
+#include "hwEthernet.h"\r
+\r
+/* Demo includes. */\r
+#include "NetworkInterface.h"\r
+\r
+#if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES != 1\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eProcessBuffer\r
+#else\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eConsiderFrameForProcessing( ( pucEthernetBuffer ) )\r
+#endif\r
+\r
+/* When a packet is ready to be sent, if it cannot be sent immediately then the\r
+task performing the transmit will block for niTX_BUFFER_FREE_WAIT\r
+milliseconds.  It will do this a maximum of niMAX_TX_ATTEMPTS before giving\r
+up. */\r
+#define niTX_BUFFER_FREE_WAIT  ( ( portTickType ) 2UL / portTICK_RATE_MS )\r
+#define niMAX_TX_ATTEMPTS              ( 5 )\r
+\r
+/* The length of the queue used to send interrupt status words from the\r
+interrupt handler to the deferred handler task. */\r
+#define niINTERRUPT_QUEUE_LENGTH       ( 10 )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * A deferred interrupt handler task that processes\r
+ */\r
+extern void vEMACHandlerTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue used to communicate Ethernet events with the IP task. */\r
+extern xQueueHandle xNetworkEventQueue;\r
+\r
+/* The semaphore used to wake the deferred interrupt handler task when an Rx\r
+interrupt is received. */\r
+xSemaphoreHandle xEMACRxEventSemaphore = NULL;\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceInitialise( void )\r
+{\r
+portBASE_TYPE xStatus, xReturn;\r
+extern uint8_t ucMACAddress[ 6 ];\r
+\r
+       /* Initialise the MAC. */\r
+       vInitEmac();\r
+\r
+       while( lEMACWaitForLink() != pdPASS )\r
+    {\r
+        vTaskDelay( 20 );\r
+    }\r
+\r
+       vSemaphoreCreateBinary( xEMACRxEventSemaphore );\r
+       configASSERT( xEMACRxEventSemaphore );\r
+\r
+       /* The handler task is created at the highest possible priority to\r
+       ensure the interrupt handler can return directly to it. */\r
+       xTaskCreate( vEMACHandlerTask, ( const signed char * const ) "EMAC", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );\r
+       xReturn = pdPASS;\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+{\r
+extern void vEMACCopyWrite( uint8_t * pucBuffer, uint16_t usLength );\r
+\r
+       vEMACCopyWrite( pxNetworkBuffer->pucBuffer, pxNetworkBuffer->xDataLength );\r
+\r
+       /* Finished with the network buffer. */\r
+       vNetworkBufferRelease( pxNetworkBuffer );\r
+\r
+       return pdTRUE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if 0\r
+void ENET_IRQHandler( void )\r
+{\r
+uint32_t ulInterruptCause;\r
+\r
+       while( ( ulInterruptCause = LPC_EMAC->IntStatus ) != 0 )\r
+       {\r
+               /* Clear the interrupt. */\r
+               LPC_EMAC->IntClear = ulInterruptCause;\r
+\r
+               /* Clear fatal error conditions.  NOTE:  The driver does not clear all\r
+               errors, only those actually experienced.  For future reference, range\r
+               errors are not actually errors so can be ignored. */\r
+               if( ( ulInterruptCause & EMAC_INT_TX_UNDERRUN ) != 0U )\r
+               {\r
+                       LPC_EMAC->Command |= EMAC_CR_TX_RES;\r
+               }\r
+\r
+               /* Unblock the deferred interrupt handler task if the event was an\r
+               Rx. */\r
+               if( ( ulInterruptCause & EMAC_INT_RX_DONE ) != 0UL )\r
+               {\r
+                       xSemaphoreGiveFromISR( xEMACRxEventSemaphore, NULL );\r
+               }\r
+       }\r
+\r
+       /* Shortcut calling portEND_SWITCHING_ISR(). */\r
+       vPortYieldFromISR();\r
+}\r
+/*-----------------------------------------------------------*/\r
+#endif\r
+\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/WinPCap/NetworkInterface.c b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/NetworkInterface/WinPCap/NetworkInterface.c
new file mode 100644 (file)
index 0000000..702455b
--- /dev/null
@@ -0,0 +1,469 @@
+/*\r
+ * FreeRTOS+UDP V1.0.0 (C) 2013 Real Time Engineers ltd.\r
+ *\r
+ * FreeRTOS+UDP is an add-on component to FreeRTOS.  It is not, in itself, part\r
+ * of the FreeRTOS kernel.  FreeRTOS+UDP is licensed separately from FreeRTOS,\r
+ * and uses a different license to FreeRTOS.  FreeRTOS+UDP uses a dual license\r
+ * model, information on which is provided below:\r
+ *\r
+ * - Open source licensing -\r
+ * FreeRTOS+UDP is a free download and may be used, modified and distributed\r
+ * without charge provided the user adheres to version two of the GNU General\r
+ * Public license (GPL) and does not remove the copyright notice or this text.\r
+ * The GPL V2 text is available on the gnu.org web site, and on the following\r
+ * URL: http://www.FreeRTOS.org/gpl-2.0.txt\r
+ *\r
+ * - Commercial licensing -\r
+ * Businesses and individuals who wish to incorporate FreeRTOS+UDP into\r
+ * proprietary software for redistribution in any form must first obtain a\r
+ * (very) low cost commercial license - and in-so-doing support the maintenance,\r
+ * support and further development of the FreeRTOS+UDP product.  Commercial\r
+ * licenses can be obtained from http://shop.freertos.org and do not require any\r
+ * source files to be changed.\r
+ *\r
+ * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
+ * use FreeRTOS+UDP unless you agree that you use the software 'as is'.\r
+ * FreeRTOS+UDP is provided WITHOUT ANY WARRANTY; without even the implied\r
+ * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
+ * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
+ * implied, expressed, or statutory.\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://www.FreeRTOS.org/udp\r
+ *\r
+ */\r
+\r
+/* WinPCap includes. */\r
+#define HAVE_REMOTE\r
+#include "pcap.h"\r
+\r
+/* Standard includes. */\r
+#include <stdint.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+\r
+/* FreeRTOS+UDP includes. */\r
+#include "FreeRTOS_UDP_IP.h"\r
+#include "FreeRTOS_IP_Private.h"\r
+#include "FreeRTOS_Sockets.h"\r
+#include "NetworkBufferManagement.h"\r
+\r
+/* Demo includes. */\r
+#include "NetworkInterface.h"\r
+\r
+/* If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 1, then the Ethernet\r
+driver will filter incoming packets and only pass the stack those packets it\r
+considers need processing.  In this case ipCONSIDER_FRAME_FOR_PROCESSING() can\r
+be #defined away.  If ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is set to 0\r
+then the Ethernet driver will pass all received packets to the stack, and the\r
+stack must do the filtering itself.  In this case ipCONSIDER_FRAME_FOR_PROCESSING\r
+needs to call eConsiderFrameForProcessing. */\r
+#if ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES != 1\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eProcessBuffer\r
+#else\r
+       #define ipCONSIDER_FRAME_FOR_PROCESSING( pucEthernetBuffer ) eConsiderFrameForProcessing( ( pucEthernetBuffer ) )\r
+#endif\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Print out a numbered list of network interfaces that are available on the\r
+ * host computer.\r
+ */\r
+static pcap_if_t * prvPrintAvailableNetworkInterfaces( void );\r
+\r
+/*\r
+ * Open the network interface.  The number of the interface to be opened is set\r
+ * by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.\r
+ */\r
+static void prvOpenSelectedNetworkInterface( pcap_if_t *pxAllNetworkInterfaces );\r
+\r
+/*\r
+ * Configure the capture filter to allow blocking reads, and to filter out\r
+ * packets that are not of interest to this demo.\r
+ */\r
+static void prvConfigureCaptureBehaviour( void );\r
+\r
+/*\r
+ * A function that simulates Ethernet interrupts by periodically polling the\r
+ * WinPCap interface for new data.\r
+ */\r
+static void prvInterruptSimulatorTask( void *pvParameters );\r
+\r
+/* The interface being used by WinPCap. */\r
+static pcap_t *pxOpenedInterfaceHandle = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Required by the WinPCap library. */\r
+static char cErrorBuffer[ PCAP_ERRBUF_SIZE ];\r
+\r
+/* When statically allocated network buffers are used (as opposed to having\r
+the buffer payloads allocated and freed as required) the actual buffer storage\r
+areas must be defined in the portable layer.  This is because different\r
+microcontrollers have different location, size and alignment requirements.  In\r
+this case the network buffers are declared in NetworkInterface.c because, as\r
+this file is only used on Windows machines, wasting a few bytes in buffers that\r
+never get used does not matter (the buffers will not get used if the dynamic\r
+payload allocation file is included in the project). */\r
+static uint8_t ucBuffers[ ipconfigNUM_NETWORK_BUFFERS ][ ipTOTAL_ETHERNET_FRAME_SIZE ];\r
+\r
+/* The queue used to communicate Ethernet events with the IP task. */\r
+extern xQueueHandle xNetworkEventQueue;\r
+\r
+/* Protect the PCAP interface as it is accessed from two tasks (an interrupt\r
+simulator is used as real interrupts cannot be obtained from the Ethernet as\r
+would normally be the case). */\r
+xSemaphoreHandle xPCAPMutex = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xNetworkInterfaceInitialise( void )\r
+{\r
+portBASE_TYPE xReturn = pdFALSE;\r
+pcap_if_t *pxAllNetworkInterfaces;\r
+\r
+       if( xPCAPMutex == NULL )\r
+       {\r
+               xPCAPMutex = xSemaphoreCreateMutex();\r
+               configASSERT( xPCAPMutex );\r
+       }\r
+\r
+       /* Query the computer the simulation is being executed on to find the\r
+       network interfaces it has installed. */\r
+       pxAllNetworkInterfaces = prvPrintAvailableNetworkInterfaces();\r
+\r
+       /* Open the network interface.  The number of the interface to be opened is\r
+       set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.\r
+       Calling this function will set the pxOpenedInterfaceHandle variable.  If,\r
+       after calling this function, pxOpenedInterfaceHandle is equal to NULL, then\r
+       the interface could not be opened. */\r
+       if( pxAllNetworkInterfaces != NULL )\r
+       {\r
+               prvOpenSelectedNetworkInterface( pxAllNetworkInterfaces );\r
+       }\r
+\r
+       if( pxOpenedInterfaceHandle != NULL )\r
+       {\r
+               xReturn = pdPASS;\r
+       }\r
+\r
+       return xReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if updconfigLOOPBACK_ETHERNET_PACKETS == 1\r
+\r
+       portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+       {\r
+       xEthernetHeader_t *pxEthernetHeader;\r
+       xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };\r
+       extern uint8_t xDefaultPartUDPPacketHeader[];\r
+       static const xMACAddress_t xBroadcastMACAddress = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };\r
+       portBASE_TYPE xCanLoopback;\r
+\r
+               pxEthernetHeader = ( xEthernetHeader_t * ) pxNetworkBuffer->pucEthernetBuffer;\r
+\r
+               if( memcmp( ( void * ) &( pxEthernetHeader->xDestinationAddress ), ( void * ) &xBroadcastMACAddress, sizeof( xMACAddress_t ) ) == 0 )\r
+               {\r
+                       /* This is a broadcast. */\r
+                       xCanLoopback = pdTRUE;\r
+               }\r
+               else if( memcmp( ( void * ) &( pxEthernetHeader->xDestinationAddress ), ( void * ) xDefaultPartUDPPacketHeader, sizeof( xMACAddress_t ) ) == 0 )\r
+               {\r
+                       /* This is being sent to itself. */\r
+                       xCanLoopback = pdTRUE;\r
+               }\r
+               else\r
+               {\r
+                       /* This is being sent externally. */\r
+                       xCanLoopback = pdFALSE;\r
+               }\r
+\r
+               iptraceNETWORK_INTERFACE_TRANSMIT();\r
+\r
+               if( xCanLoopback == pdTRUE )\r
+               {\r
+                       /* Just loop the frame back to the input queue.  Here the loopback\r
+                       is sending a message to itself, so a block time cannot be used for\r
+                       fear of deadlocking. */\r
+                       xRxEvent.pvData = ( void * ) pxNetworkBuffer;\r
+                       if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )\r
+                       {\r
+                               vNetworkBufferRelease( pxNetworkBuffer );\r
+                               iptraceETHERNET_RX_EVENT_LOST();\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       /* Send the packet. */\r
+                       xSemaphoreTake( xPCAPMutex, portMAX_DELAY );\r
+                       {\r
+                               pcap_sendpacket( pxOpenedInterfaceHandle, pxNetworkBuffer->pucEthernetBuffer, pxNetworkBuffer->xDataLength );\r
+                       }\r
+                       xSemaphoreGive( xPCAPMutex );\r
+\r
+                       /* The buffer has been transmitted so can be released. */\r
+                       vNetworkBufferRelease( pxNetworkBuffer );\r
+               }\r
+\r
+               return pdPASS;\r
+       }\r
+\r
+#else /* updconfigLOOPBACK_ETHERNET_PACKETS == 1 */\r
+\r
+       portBASE_TYPE xNetworkInterfaceOutput( xNetworkBufferDescriptor_t * const pxNetworkBuffer )\r
+       {\r
+               xSemaphoreTake( xPCAPMutex, portMAX_DELAY );\r
+               {\r
+                       iptraceNETWORK_INTERFACE_TRANSMIT();\r
+                       pcap_sendpacket( pxOpenedInterfaceHandle, pxNetworkBuffer->pucEthernetBuffer, pxNetworkBuffer->xDataLength );\r
+               }\r
+               xSemaphoreGive( xPCAPMutex );\r
+\r
+               /* The buffer has been transmitted so can be released. */\r
+               vNetworkBufferRelease( pxNetworkBuffer );\r
+\r
+               return pdPASS;\r
+       }\r
+\r
+#endif /* updconfigLOOPBACK_ETHERNET_PACKETS == 1 */\r
+/*-----------------------------------------------------------*/\r
+\r
+static pcap_if_t * prvPrintAvailableNetworkInterfaces( void )\r
+{\r
+pcap_if_t * pxAllNetworkInterfaces = NULL, *xInterface;\r
+long lInterfaceNumber = 1;\r
+\r
+    if( pcap_findalldevs_ex( PCAP_SRC_IF_STRING, NULL, &pxAllNetworkInterfaces, cErrorBuffer ) == -1 )\r
+    {\r
+        printf( "\r\nCould not obtain a list of network interfaces\r\n%s\r\n", cErrorBuffer );\r
+        pxAllNetworkInterfaces = NULL;\r
+    }\r
+\r
+       if( pxAllNetworkInterfaces != NULL )\r
+       {\r
+               /* Print out the list of network interfaces.  The first in the list\r
+               is interface '1', not interface '0'. */\r
+               for( xInterface = pxAllNetworkInterfaces; xInterface != NULL; xInterface = xInterface->next )\r
+               {\r
+                       printf( "%d. %s", lInterfaceNumber, xInterface->name );\r
+\r
+                       if( xInterface->description != NULL )\r
+                       {\r
+                               printf( " (%s)\r\n", xInterface->description );\r
+                       }\r
+                       else\r
+                       {\r
+                               printf( " (No description available)\r\n") ;\r
+                       }\r
+\r
+                       lInterfaceNumber++;\r
+               }\r
+       }\r
+\r
+    if( lInterfaceNumber == 1 )\r
+    {\r
+               /* The interface number was never incremented, so the above for() loop\r
+               did not execute meaning no interfaces were found. */\r
+        printf( " \r\nNo network interfaces were found.\r\n" );\r
+        pxAllNetworkInterfaces = NULL;\r
+    }\r
+\r
+       printf( "\r\nThe interface that will be opened is set by configNETWORK_INTERFACE_TO_USE which should be defined in FreeRTOSConfig.h\r\n" );\r
+       printf( "Attempting to open interface number %d.\r\n", configNETWORK_INTERFACE_TO_USE );\r
+\r
+    if( ( configNETWORK_INTERFACE_TO_USE < 1L ) || ( configNETWORK_INTERFACE_TO_USE > lInterfaceNumber ) )\r
+    {\r
+        printf("\r\nconfigNETWORK_INTERFACE_TO_USE is not in the valid range.\r\n" );\r
+\r
+               if( pxAllNetworkInterfaces != NULL )\r
+               {\r
+                       /* Free the device list, as no devices are going to be opened. */\r
+                       pcap_freealldevs( pxAllNetworkInterfaces );\r
+                       pxAllNetworkInterfaces = NULL;\r
+               }\r
+    }\r
+\r
+       return pxAllNetworkInterfaces;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvOpenSelectedNetworkInterface( pcap_if_t *pxAllNetworkInterfaces )\r
+{\r
+pcap_if_t *xInterface;\r
+long x;\r
+\r
+    /* Walk the list of devices until the selected device is located. */\r
+       xInterface = pxAllNetworkInterfaces;\r
+    for( x = 0L; x < ( configNETWORK_INTERFACE_TO_USE - 1L ); x++ )\r
+       {\r
+               xInterface = xInterface->next;\r
+       }\r
+\r
+    /* Open the selected interface. */\r
+       pxOpenedInterfaceHandle = pcap_open(    xInterface->name,               /* The name of the selected interface. */\r
+                                                                                       ipTOTAL_ETHERNET_FRAME_SIZE,    /* The size of the packet to capture. */\r
+                                                                                       PCAP_OPENFLAG_PROMISCUOUS,      /* Open in promiscious mode as the MAC and\r
+                                                                                                                                               IP address is going to be "simulated", and\r
+                                                                                                                                               not be the real MAC and IP address.  This allows\r
+                                                                                                                                               trafic to the simulated IP address to be routed\r
+                                                                                                                                               to uIP, and trafic to the real IP address to be\r
+                                                                                                                                               routed to the Windows TCP/IP stack. */\r
+                                                                                       0x00L,                                  /* The read time out. */\r
+                                                                                       NULL,                                   /* No authentication is required as this is\r
+                                                                                                                                               not a remote capture session. */\r
+                                                                                       cErrorBuffer\r
+                                                                          );\r
+\r
+    if ( pxOpenedInterfaceHandle == NULL )\r
+    {\r
+        printf( "\r\n%s is not supported by WinPcap and cannot be opened\r\n", xInterface->name );\r
+    }\r
+       else\r
+       {\r
+               /* Configure the capture filter to allow blocking reads, and to filter\r
+               out packets that are not of interest to this demo. */\r
+               prvConfigureCaptureBehaviour();\r
+       }\r
+\r
+       /* The device list is no longer required. */\r
+       pcap_freealldevs( pxAllNetworkInterfaces );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvConfigureCaptureBehaviour( void )\r
+{\r
+struct bpf_program xFilterCode;\r
+const long lMinBytesToCopy = 10L, lBlocking = 1L;\r
+unsigned long ulNetMask;\r
+\r
+       /* Unblock a read as soon as anything is received. */\r
+       pcap_setmintocopy( pxOpenedInterfaceHandle, lMinBytesToCopy );\r
+\r
+       /* Allow blocking. */\r
+       pcap_setnonblock( pxOpenedInterfaceHandle, lBlocking, cErrorBuffer );\r
+\r
+       /* Set up a filter so only the packets of interest are passed to the IP\r
+       stack.  cErrorBuffer is used for convenience to create the string.  Don't\r
+       confuse this with an error message. *//*_RB_ This should not use the #defined constants. *//*_RB_ Constants should not be used, but passed through a generic network API. */\r
+       sprintf( cErrorBuffer, "broadcast or multicast or ether host %x:%x:%x:%x:%x:%x", configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 );\r
+\r
+       /*_RB_ Constants should not be used, but passed through a generic network API. */\r
+       ulNetMask = ( configNET_MASK3 << 24UL ) | ( configNET_MASK2 << 16UL ) | ( configNET_MASK1 << 8L ) | configNET_MASK0;\r
+\r
+       if( pcap_compile(pxOpenedInterfaceHandle, &xFilterCode, cErrorBuffer, 1, ulNetMask ) < 0 )\r
+    {\r
+        printf("\r\nThe packet filter string is invalid\r\n" );\r
+    }\r
+       else\r
+       {\r
+               if( pcap_setfilter( pxOpenedInterfaceHandle, &xFilterCode ) < 0 )\r
+               {\r
+                       printf( "\r\nAn error occurred setting the packet filter.\r\n" );\r
+               }\r
+       }\r
+\r
+       /* Create a task that simulates an interrupt in a real system.  This will\r
+       block waiting for packets, then send a message to the uIP task when data\r
+       is available. */\r
+       xTaskCreate( prvInterruptSimulatorTask, ( signed char * ) "MAC_ISR", configMINIMAL_STACK_SIZE, NULL, configMAC_ISR_SIMULATOR_PRIORITY, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvInterruptSimulatorTask( void *pvParameters )\r
+{\r
+static struct pcap_pkthdr *pxHeader;\r
+const uint8_t *pucPacketData;\r
+long lResult;\r
+xNetworkBufferDescriptor_t *pxNetworkBuffer;\r
+xIPStackEvent_t xRxEvent = { eEthernetRxEvent, NULL };\r
+eFrameProcessingResult_t eResult;\r
+\r
+       /* Just to kill the compiler warning. */\r
+       ( void ) pvParameters;\r
+\r
+       for( ;; )\r
+       {\r
+               /* Get the next packet. */\r
+               xSemaphoreTake( xPCAPMutex, portMAX_DELAY );\r
+               {\r
+                       lResult = pcap_next_ex( pxOpenedInterfaceHandle, &pxHeader, &pucPacketData );\r
+               }\r
+               xSemaphoreGive( xPCAPMutex );\r
+\r
+               if( lResult == 1 )\r
+               {\r
+                       eResult = ipCONSIDER_FRAME_FOR_PROCESSING( pucPacketData );\r
+                       if( eResult == eProcessBuffer )\r
+                       {\r
+                               /* Will the data fit into the frame buffer? */\r
+                               if( pxHeader->len <= ipTOTAL_ETHERNET_FRAME_SIZE )\r
+                               {\r
+                                       /* Obtain a buffer into which the data can be placed.  This\r
+                                       is only an interrupt simulator, not a real interrupt, so it\r
+                                       is ok to call the task level function here.  */\r
+                                       xSemaphoreTake( xPCAPMutex, portMAX_DELAY );\r
+                                       {\r
+                                               pxNetworkBuffer = pxNetworkBufferGet( pxHeader->len, 0 );\r
+                                       }\r
+                                       xSemaphoreGive( xPCAPMutex );\r
+\r
+                                       if( pxNetworkBuffer != NULL )\r
+                                       {\r
+                                               memcpy( pxNetworkBuffer->pucEthernetBuffer, pucPacketData, pxHeader->len );\r
+                                               pxNetworkBuffer->xDataLength = ( size_t ) pxHeader->len;\r
+                                               xRxEvent.pvData = ( void * ) pxNetworkBuffer;\r
+\r
+                                               /* Data was received and stored.  Send a message to the IP\r
+                                               task to let it know. */\r
+                                               if( xQueueSendToBack( xNetworkEventQueue, &xRxEvent, ( portTickType ) 0 ) == pdFALSE )\r
+                                               {\r
+                                                       /* The buffer could not be sent to the stack so\r
+                                                       must be released again.  This is only an interrupt\r
+                                                       simulator, not a real interrupt, so it is ok to use\r
+                                                       the task level function here. */\r
+                                                       vNetworkBufferRelease( pxNetworkBuffer );\r
+                                                       iptraceETHERNET_RX_EVENT_LOST();\r
+                                               }\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               iptraceETHERNET_RX_EVENT_LOST();\r
+                                       }\r
+                               }\r
+                               else\r
+                               {\r
+                                       /* Log that a packet was dropped because it would have\r
+                                       overflowed the buffer. */\r
+                               }\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       /* There is no real way of simulating an interrupt.  Make sure\r
+                       other tasks can run. */\r
+                       vTaskDelay( configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY );\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#if configUSE_STATIC_BUFFERS == 1\r
+       void vNetworkInterfaceAllocateRAMToBuffers( xNetworkBufferDescriptor_t pxNetworkBuffers[ ipconfigNUM_NETWORK_BUFFERS ] )\r
+       {\r
+       portBASE_TYPE x;\r
+\r
+               for( x = 0; x < ipconfigNUM_NETWORK_BUFFERS; x++ )\r
+               {\r
+                       pxNetworkBuffers[ x ].pucEthernetBuffer = &( ucBuffers[ x ][ 0 ] );\r
+               }\r
+       }\r
+#endif\r
+/*-----------------------------------------------------------*/\r
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/readme.txt b/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/readme.txt
new file mode 100644 (file)
index 0000000..1933686
--- /dev/null
@@ -0,0 +1,16 @@
+Contains the files that implement FreeRTOS+UDP.\r
+\r
+User documentation, including an API reference is available on:\r
+http://www.FreeRTOS.org/udp\r
+\r
+A description of the source code organisation is available on:\r
+http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_IP_Embedded_Ethernet_Tutorial.shtml\r
+\r
+The porting guide is available one:\r
+http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_Porting.shtml\r
+\r
+\r
+At this time it is recommended to use BufferAllocation_2.c in which case it is\r
+essential to use the heap_4.c memory allocation scheme:\r
+http://www.freertos.org/a00111.html\r
+\r
diff --git a/FreeRTOS-Plus/Source/WebDocs.url b/FreeRTOS-Plus/Source/WebDocs.url
new file mode 100644 (file)
index 0000000..be5966f
--- /dev/null
@@ -0,0 +1,5 @@
+[InternetShortcut]\r
+URL=http://www.freertos.org/plus\r
+IDList=\r
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
diff --git a/FreeRTOS-Plus/Source/readme.txt b/FreeRTOS-Plus/Source/readme.txt
new file mode 100644 (file)
index 0000000..85de14c
--- /dev/null
@@ -0,0 +1,7 @@
+Directories:\r
+\r
++ The FreeRTOS-Plus/Source contains the source code of each FreeRTOS+ product.\r
+\r
++ See http://www.FreeRTOS.org for FreeRTOS documentation.  See\r
+  http://www.freertos.org/plus for FreeRTOS+ documentation.\r
+\r